diff options
| author | Scott Larson <[email protected]> | 2020-10-09 12:39:54 -0700 |
|---|---|---|
| committer | Scott Larson <[email protected]> | 2020-10-09 12:39:54 -0700 |
| commit | 3f1e20df866441bd7e3e8a45fffe1d5ab0413002 (patch) | |
| tree | a4fd231c2da5829f8913d0c92d633e4173f2fa33 | |
| parent | ed83d6f07d3ef30993be946b5889aaba816b1f17 (diff) | |
6.1 Releasev6.1_rel
860 files changed, 7499 insertions, 2646 deletions
diff --git a/LICENSED-HARDWARE.txt b/LICENSED-HARDWARE.txt index fd9627c..93a21d0 100644 --- a/LICENSED-HARDWARE.txt +++ b/LICENSED-HARDWARE.txt @@ -25,4 +25,4 @@ Renesas: -------------------------------------------------------------------------------- -More coming soon. Please check back frequently for updates. +More coming soon. Please check back frequently for updates.
\ No newline at end of file @@ -96,8 +96,9 @@ Professional support plans (https://azure.microsoft.com/en-us/support/options/) The following are references to additional Azure RTOS and Azure IoT in general: | | | |---|---| -| Azure RTOS Website: | https://azure.microsoft.com/en-us/services/rtos/ | +| Azure RTOS Documenation and Guides: | https://docs.microsoft.com/azure/rtos | +| Azure RTOS Website: | https://azure.microsoft.com/services/rtos/ | | Azure RTOS Sales Questions: | https://azure-rtos.ms-iot-contact.com/ | -| Microsoft Q/A for Azure IoT: | https://docs.microsoft.com/en-us/answers/products/azure?product=iot | -| Internet of Things Show: | https://aka.ms/iotshow | -| IoT Tech Community: | https://aka.ms/iottechcommunity | +| For technical questions check out Microsoft Q/A for Azure IoT: | https://aka.ms/QnA/azure-rtos | +| Internet of Things Show for latest announcements and online training: | https://aka.ms/iotshow | +| IoT Tech Community: | https://aka.ms/community/azure-rtos | diff --git a/common/core/CMakeLists.txt b/common/core/CMakeLists.txt index ce38377..054f49c 100644 --- a/common/core/CMakeLists.txt +++ b/common/core/CMakeLists.txt @@ -49,6 +49,7 @@ target_sources(${PROJECT_NAME} PRIVATE ${CMAKE_CURRENT_LIST_DIR}/src/ux_hcd_sim_host_asynch_schedule.c ${CMAKE_CURRENT_LIST_DIR}/src/ux_hcd_sim_host_asynchronous_endpoint_create.c ${CMAKE_CURRENT_LIST_DIR}/src/ux_hcd_sim_host_asynchronous_endpoint_destroy.c + ${CMAKE_CURRENT_LIST_DIR}/src/ux_hcd_sim_host_controller_disable.c ${CMAKE_CURRENT_LIST_DIR}/src/ux_hcd_sim_host_ed_obtain.c ${CMAKE_CURRENT_LIST_DIR}/src/ux_hcd_sim_host_ed_td_clean.c ${CMAKE_CURRENT_LIST_DIR}/src/ux_hcd_sim_host_endpoint_reset.c @@ -96,6 +97,7 @@ target_sources(${PROJECT_NAME} PRIVATE ${CMAKE_CURRENT_LIST_DIR}/src/ux_host_stack_class_instance_verify.c ${CMAKE_CURRENT_LIST_DIR}/src/ux_host_stack_class_interface_scan.c ${CMAKE_CURRENT_LIST_DIR}/src/ux_host_stack_class_register.c + ${CMAKE_CURRENT_LIST_DIR}/src/ux_host_stack_class_unregister.c ${CMAKE_CURRENT_LIST_DIR}/src/ux_host_stack_configuration_descriptor_parse.c ${CMAKE_CURRENT_LIST_DIR}/src/ux_host_stack_configuration_enumerate.c ${CMAKE_CURRENT_LIST_DIR}/src/ux_host_stack_configuration_instance_create.c @@ -119,6 +121,7 @@ target_sources(${PROJECT_NAME} PRIVATE ${CMAKE_CURRENT_LIST_DIR}/src/ux_host_stack_hcd_register.c ${CMAKE_CURRENT_LIST_DIR}/src/ux_host_stack_hcd_thread_entry.c ${CMAKE_CURRENT_LIST_DIR}/src/ux_host_stack_hcd_transfer_request.c + ${CMAKE_CURRENT_LIST_DIR}/src/ux_host_stack_hcd_unregister.c ${CMAKE_CURRENT_LIST_DIR}/src/ux_host_stack_hnp_polling_thread_entry.c ${CMAKE_CURRENT_LIST_DIR}/src/ux_host_stack_initialize.c ${CMAKE_CURRENT_LIST_DIR}/src/ux_host_stack_interface_endpoint_get.c @@ -138,6 +141,7 @@ target_sources(${PROJECT_NAME} PRIVATE ${CMAKE_CURRENT_LIST_DIR}/src/ux_host_stack_role_swap.c ${CMAKE_CURRENT_LIST_DIR}/src/ux_host_stack_transfer_request.c ${CMAKE_CURRENT_LIST_DIR}/src/ux_host_stack_transfer_request_abort.c + ${CMAKE_CURRENT_LIST_DIR}/src/ux_host_stack_uninitialize.c ${CMAKE_CURRENT_LIST_DIR}/src/ux_system_error_handler.c ${CMAKE_CURRENT_LIST_DIR}/src/ux_system_initialize.c ${CMAKE_CURRENT_LIST_DIR}/src/ux_system_uninitialize.c diff --git a/common/core/inc/ux_api.h b/common/core/inc/ux_api.h index 4dacbcf..a26e257 100644 --- a/common/core/inc/ux_api.h +++ b/common/core/inc/ux_api.h @@ -26,7 +26,7 @@ /* APPLICATION INTERFACE DEFINITION RELEASE */ /* */ /* ux_api.h PORTABLE C */ -/* 6.0.2 */ +/* 6.1 */ /* AUTHOR */ /* */ /* Chaoqiong Xiao, Microsoft Corporation */ @@ -44,14 +44,24 @@ /* DATE NAME DESCRIPTION */ /* */ /* 05-19-2020 Chaoqiong Xiao Initial Version 6.0 */ -/* 06-30-2020 Chaoqiong Xiao Modified comment(s), and */ -/* updated product constants, */ -/* avoided div 0 in overflow */ -/* checking macro, */ -/* resulting in version 6.0.1 */ -/* 08-14-2020 Chaoqiong Xiao Modified comment(s), and */ -/* updated product constants, */ -/* resulting in version 6.0.2 */ +/* 09-30-2020 Chaoqiong Xiao Modified comment(s), */ +/* added query usage of device */ +/* ClassSubclassProtocol, */ +/* added option to disable FX */ +/* media integration, prefixed */ +/* UX to MS_TO_TICK, added */ +/* APIs and macros related to */ +/* uninitialize, optimized */ +/* based on compile */ +/* definitions, updated */ +/* product constants, used */ +/* host class extension */ +/* pointer for class specific */ +/* structured data, used UX */ +/* prefix to refer to TX */ +/* symbols instead of using */ +/* them directly, */ +/* resulting in version 6.1 */ /* */ /**************************************************************************/ @@ -113,13 +123,59 @@ typedef signed char SCHAR; #endif /* UX_ENABLE_ASSERT */ +/* Convert from millisecond to ThreadX Tick value. */ +#define UX_MS_TO_TICK(ms) ((ms) * (UX_PERIODIC_RATE) / 1000) + +/* Deprecated, left to be compatible with apps already using MS_TO_TICK. */ +#define MS_TO_TICK(ms) UX_MS_TO_TICK(ms) + + +/* If UX_DEVICE_INITIALIZE_FRAMEWORK_SCAN_DISABLE is defined, + it define USBX device max number of endpoints (1~n). + else max number of endpoints are from scan result. + It must be equal to or larger than max number of endpoints + can be activated at the same time. */ +#ifndef UX_MAX_DEVICE_ENDPOINTS +#define UX_MAX_DEVICE_ENDPOINTS 6 +#endif + +/* If UX_DEVICE_INITIALIZE_FRAMEWORK_SCAN_DISABLE is defined, + it define USBX device max number of interfacess (1~n). + else max number of interfacess are from scan result. + It must be equal to or larger than max number of interfaces + in a activated configuration. */ +#ifndef UX_MAX_DEVICE_INTERFACES +#define UX_MAX_DEVICE_INTERFACES 6 +#endif + + +/* 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 #define UX_MAX_SLAVE_INTERFACES 16 #endif -/* Convert from millisecond to ThreadX Tick value. */ -#define MS_TO_TICK(ms) ((ms) * (UX_PERIODIC_RATE) / 1000) +/* Define USBX max number of devices (1 ~ n). */ +#ifndef UX_MAX_DEVICES +#define UX_MAX_DEVICES 4 +#endif + +/* Define USBX max number of HCDs (1 ~ n). */ +#ifndef UX_MAX_HCD +#define UX_MAX_HCD 2 +#endif + +/* Define USBX max root hub port (1 ~ n). */ +#ifndef UX_MAX_ROOTHUB_PORT +#define UX_MAX_ROOTHUB_PORT 4 +#endif + +/* Define USBX max TT. */ +#ifndef UX_MAX_TT +#define UX_MAX_TT 8 +#endif /* Define USBX Host Enum Thread Stack Size. */ #ifndef UX_HOST_ENUM_THREAD_STACK_SIZE @@ -139,8 +195,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 0 -#define USBX_PATCH_VERSION 2 +#define USBX_MINOR_VERSION 1 +#define USBX_PATCH_VERSION 0 /* Macros for concatenating tokens, where UX_CONCATn concatenates n tokens. */ @@ -311,7 +367,7 @@ VOID _ux_trace_event_update(TX_TRACE_BUFFER_ENTRY *event, ULONG timestamp, UL #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 */ +#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 */ @@ -326,6 +382,10 @@ VOID _ux_trace_event_update(TX_TRACE_BUFFER_ENTRY *event, ULONG timestamp, UL #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 the USBX host class events. */ @@ -640,17 +700,119 @@ VOID _ux_trace_event_update(TX_TRACE_BUFFER_ENTRY *event, ULONG timestamp, UL #endif #endif + +/* Define interrupts lockout constructs to protect the memory allocation/release which could happen + under ISR in the device stack. */ + +#ifndef UX_INTERRUPT_SAVE_AREA +#define UX_INTERRUPT_SAVE_AREA TX_INTERRUPT_SAVE_AREA +#endif + +#ifndef UX_DISABLE +#define UX_DISABLE TX_DISABLE +#endif + +#ifndef UX_RESTORE +#define UX_RESTORE TX_RESTORE +#endif + + +/* Define thread/timer related things. */ + +#ifndef UX_EMPTY +#define UX_EMPTY TX_EMPTY +#endif + +#ifndef UX_TIMER +#define UX_TIMER TX_TIMER +#endif + +#ifndef UX_THREAD +#define UX_THREAD TX_THREAD +#endif + +#ifndef UX_AUTO_START +#define UX_AUTO_START TX_AUTO_START +#endif + +#ifndef UX_DONT_START +#define UX_DONT_START TX_DONT_START +#endif + +#ifndef UX_AUTO_ACTIVATE +#define UX_AUTO_ACTIVATE TX_AUTO_ACTIVATE +#endif + +#ifndef UX_NO_ACTIVATE +#define UX_NO_ACTIVATE TX_NO_ACTIVATE +#endif + +#ifndef UX_THREAD_GET_SYSTEM_STATE +#define UX_THREAD_GET_SYSTEM_STATE TX_THREAD_GET_SYSTEM_STATE +#endif + +#ifndef UX_WAIT_FOREVER +#define UX_WAIT_FOREVER TX_WAIT_FOREVER +#endif + +#ifndef UX_NO_WAIT +#define UX_NO_WAIT TX_NO_WAIT +#endif + +#ifndef UX_NO_TIME_SLICE +#define UX_NO_TIME_SLICE TX_NO_TIME_SLICE +#endif + + +/* Define semaphore related things. */ + +#ifndef UX_SEMAPHORE +#define UX_SEMAPHORE TX_SEMAPHORE +#endif + + +/* Define mutex related things. */ + +#ifndef UX_MUTEX +#define UX_MUTEX TX_MUTEX +#endif + + +/* Define event flags group related things. */ + +#ifndef UX_EVENT_FLAGS_GROUP +#define UX_EVENT_FLAGS_GROUP TX_EVENT_FLAGS_GROUP +#endif + +#ifndef UX_OR_CLEAR +#define UX_OR_CLEAR TX_OR_CLEAR +#endif + +#ifndef UX_OR +#define UX_OR TX_OR +#endif + +#ifndef UX_AND_CLEAR +#define UX_AND_CLEAR TX_AND_CLEAR +#endif + +#ifndef UX_AND +#define UX_AND TX_AND +#endif + +#ifndef UX_NO_EVENTS +#define UX_NO_EVENTS TX_NO_EVENTS +#endif + + /* Define basic USBX constants. */ #define UX_NULL ((void*)0) #define UX_TRUE 1 #define UX_FALSE 0 -#define UX_MAX_TT 8 #define UX_TT_MASK 0x1FF #define UX_TT_BANDWIDTH 6000 #define UX_SLAVE_ENDPOINT_DEFAULT_BUFFER_SIZE 256 -#define UX_REGULAR_MEMORY 0 -#define UX_CACHE_SAFE_MEMORY 1 #define UX_MAX_BYTES_PER_FRAME_FS 1157 #define UX_MAX_BYTES_PER_MICROFRAME_HS 5785 @@ -691,11 +853,14 @@ VOID _ux_trace_event_update(TX_TRACE_BUFFER_ENTRY *event, ULONG timestamp, UL /* Define Generic USBX constants. */ -#define UX_WAIT_FOREVER 0xffffffff #define UX_UNUSED 0 #define UX_USED 1 -#define UX_MEMORY_UNUSED 0x12345678 -#define UX_MEMORY_USED 0x87654321 + +#define UX_MEMORY_UNUSED 0x00000000u +#define UX_MEMORY_USED 0x80000000u +#define UX_REGULAR_MEMORY 0 +#define UX_CACHE_SAFE_MEMORY 1 + #define UX_NO_ALIGN 0 #define UX_ALIGN_16 0x0f #define UX_ALIGN_MIN 0x0f @@ -821,6 +986,8 @@ VOID _ux_trace_event_update(TX_TRACE_BUFFER_ENTRY *event, ULONG timestamp, UL #define UX_DEVICE_REMOVAL 2 #define UX_HID_CLIENT_INSERTION 3 #define UX_HID_CLIENT_REMOVAL 4 +#define UX_STORAGE_MEDIA_INSERTION 5 +#define UX_STORAGE_MEDIA_REMOVAL 6 /* Define USBX transfer request status constants. */ @@ -1059,6 +1226,7 @@ VOID _ux_trace_event_update(TX_TRACE_BUFFER_ENTRY *event, ULONG timestamp, UL #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_SLAVE_CLASS_COMMAND_QUERY 1 #define UX_SLAVE_CLASS_COMMAND_ACTIVATE 2 @@ -1070,6 +1238,7 @@ VOID _ux_trace_event_update(TX_TRACE_BUFFER_ENTRY *event, ULONG timestamp, UL #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 @@ -1191,15 +1360,18 @@ typedef struct UX_HOST_CLASS_COMMAND_STRUCT typedef struct UX_HOST_CLASS_STRUCT { +#if defined(UX_NAME_REFERENCED_BY_POINTER) + const UCHAR *ux_host_class_name; +#else UCHAR ux_host_class_name[UX_MAX_CLASS_NAME_LENGTH + 1]; /* "+1" for string null-terminator */ +#endif + UINT ux_host_class_status; - UINT (*ux_host_class_entry_function) (struct UX_HOST_CLASS_COMMAND_STRUCT *) ; - UINT ux_host_class_nb_devices_owned; + UINT (*ux_host_class_entry_function) (struct UX_HOST_CLASS_COMMAND_STRUCT *); VOID *ux_host_class_first_instance; VOID *ux_host_class_client; - TX_THREAD ux_host_class_thread; - VOID *ux_host_class_thread_stack; VOID *ux_host_class_media; + VOID *ux_host_class_ext; } UX_HOST_CLASS; @@ -1219,7 +1391,7 @@ typedef struct UX_TRANSFER_STRUCT UINT ux_transfer_request_value; UINT ux_transfer_request_index; VOID (*ux_transfer_request_completion_function) (struct UX_TRANSFER_STRUCT *); - TX_SEMAPHORE ux_transfer_request_semaphore; + UX_SEMAPHORE ux_transfer_request_semaphore; VOID *ux_transfer_request_class_instance; ULONG ux_transfer_request_maximum_length; ULONG ux_transfer_request_timeout_value; @@ -1228,7 +1400,7 @@ typedef struct UX_TRANSFER_STRUCT struct UX_TRANSFER_STRUCT *ux_transfer_request_next_transfer_request; VOID *ux_transfer_request_user_specific; - TX_THREAD *ux_transfer_request_thread_pending; + UX_THREAD *ux_transfer_request_thread_pending; } UX_TRANSFER; @@ -1376,31 +1548,66 @@ typedef struct UX_DEVICE_STRUCT ULONG ux_device_state; ULONG ux_device_address; ULONG ux_device_speed; - ULONG ux_device_port_location; - ULONG ux_device_max_power; ULONG ux_device_power_source; UINT ux_device_current_configuration; - TX_SEMAPHORE ux_device_protection_semaphore; - struct UX_DEVICE_STRUCT - *ux_device_parent; + UX_SEMAPHORE ux_device_protection_semaphore; struct UX_HOST_CLASS_STRUCT *ux_device_class; VOID *ux_device_class_instance; - struct UX_HCD_STRUCT - *ux_device_hcd; struct UX_CONFIGURATION_STRUCT *ux_device_first_configuration; - struct UX_DEVICE_STRUCT - *ux_device_next_device; struct UX_DEVICE_DESCRIPTOR_STRUCT ux_device_descriptor; struct UX_ENDPOINT_STRUCT ux_device_control_endpoint; + ULONG ux_device_port_location; +#if UX_MAX_HCD > 1 + 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 ux_device_hub_tt[UX_MAX_TT]; +#endif } UX_DEVICE; +#if UX_MAX_HCD > 1 +#define UX_DEVICE_HCD_GET(d) ((d)->ux_device_hcd) +#define UX_DEVICE_HCD_SET(d,h) do { (d)->ux_device_hcd = (h); } while(0) +#define UX_DEVICE_HCD_MATCH(d,h) ((d)->ux_device_hcd == (h)) +#else +#define UX_DEVICE_HCD_GET(d) (_ux_system_host->ux_system_host_hcd_array) +#define UX_DEVICE_HCD_SET(d,h) +#define UX_DEVICE_HCD_MATCH(d,h) (_ux_system_host->ux_system_host_hcd_array == (h)) +#endif + + +#if UX_MAX_DEVICES > 1 +#define UX_DEVICE_PARENT_GET(d) ((d)->ux_device_parent) +#define UX_DEVICE_PARENT_SET(d,p) do { (d)->ux_device_parent = (p); } while(0) +#define UX_DEVICE_PARENT_MATCH(d,p) ((d)->ux_device_parent == (p)) +#define UX_DEVICE_PARENT_IS_HUB(d) ((d)->ux_device_parent != UX_NULL) +#define UX_DEVICE_PARENT_IS_ROOTHUB(d) ((d)->ux_device_parent == UX_NULL) +#define UX_DEVICE_MAX_POWER_GET(d) ((d)->ux_device_max_power) +#define UX_DEVICE_MAX_POWER_SET(d,p) do {(d)->ux_device_max_power = (p); } while(0) +#else +#define UX_DEVICE_PARENT_GET(d) (UX_NULL) +#define UX_DEVICE_PARENT_SET(d,p) UX_PARAMETER_NOT_USED(p) +#define UX_DEVICE_PARENT_MATCH(d,p) ((p) == UX_NULL) +#define UX_DEVICE_PARENT_IS_HUB(d) (UX_FALSE) +#define UX_DEVICE_PARENT_IS_ROOTHUB(d) (UX_TRUE) +#define UX_DEVICE_MAX_POWER_GET(d) (UX_MAX_SELF_POWER) +#define UX_DEVICE_MAX_POWER_SET(d,p) UX_PARAMETER_NOT_USED(p) +#endif +#define UX_DEVICE_PORT_LOCATION_GET(d) ((d)->ux_device_port_location) +#define UX_DEVICE_PORT_LOCATION_SET(d,l) do { (d)->ux_device_port_location = (l); } while(0) +#define UX_DEVICE_PORT_LOCATION_MATCH(d,l) ((d)->ux_device_port_location == (l)) + + /* Define USBX Configuration Descriptor structure. */ typedef struct UX_CONFIGURATION_DESCRIPTOR_STRUCT @@ -1523,24 +1730,34 @@ typedef struct UX_DFU_FUNCTIONAL_DESCRIPTOR_STRUCT typedef struct UX_HCD_STRUCT { +#if defined(UX_NAME_REFERENCED_BY_POINTER) + const UCHAR *ux_hcd_name; +#else UCHAR ux_hcd_name[UX_MAX_HCD_NAME_LENGTH + 1]; /* "+1" for string null-terminator */ - UCHAR ux_hcd_address[16]; +#endif + UINT ux_hcd_status; UINT ux_hcd_controller_type; - UINT ux_hcd_otg_capabilities; UINT ux_hcd_irq; UINT ux_hcd_nb_root_hubs; - UINT ux_hcd_root_hub_signal[16]; + UINT ux_hcd_root_hub_signal[UX_MAX_ROOTHUB_PORT]; UINT ux_hcd_nb_devices; - UINT ux_hcd_power_switch; UINT ux_hcd_thread_signal; ULONG ux_hcd_rh_device_connection; ULONG ux_hcd_io; - ULONG ux_hcd_available_bandwidth; - ULONG ux_hcd_maximum_transfer_request_size; - ULONG ux_hcd_version; UINT (*ux_hcd_entry_function) (struct UX_HCD_STRUCT *, UINT, VOID *); void *ux_hcd_controller_hardware; + +#if defined(UX_OTG_SUPPORT) + UINT ux_hcd_otg_capabilities; +#endif + +#if UX_MAX_DEVICES > 1 + UCHAR ux_hcd_address[16]; + UINT ux_hcd_power_switch; + ULONG ux_hcd_available_bandwidth; + ULONG ux_hcd_version; +#endif } UX_HCD; @@ -1561,7 +1778,7 @@ typedef struct UX_SLAVE_TRANSFER_STRUCT ULONG ux_slave_transfer_request_completion_code; ULONG ux_slave_transfer_request_phase; VOID (*ux_slave_transfer_request_completion_function) (struct UX_SLAVE_TRANSFER_STRUCT *); - TX_SEMAPHORE ux_slave_transfer_request_semaphore; + UX_SEMAPHORE ux_slave_transfer_request_semaphore; ULONG ux_slave_transfer_request_timeout; ULONG ux_slave_transfer_request_force_zlp; UCHAR ux_slave_transfer_request_setup[UX_SETUP_SIZE]; @@ -1639,7 +1856,6 @@ typedef struct UX_SLAVE_DEVICE_STRUCT typedef struct UX_SLAVE_DCD_STRUCT { - UCHAR ux_slave_dcd_name[32]; UINT ux_slave_dcd_status; UINT ux_slave_dcd_controller_type; UINT ux_slave_dcd_otg_capabilities; @@ -1676,12 +1892,17 @@ typedef struct UX_SLAVE_CLASS_COMMAND_STRUCT typedef struct UX_SLAVE_CLASS_STRUCT { +#if defined(UX_NAME_REFERENCED_BY_POINTER) + const UCHAR *ux_slave_class_name; +#else UCHAR ux_slave_class_name[UX_MAX_CLASS_NAME_LENGTH + 1]; /* "+1" for string null-terminator */ +#endif + UINT ux_slave_class_status; - UINT (*ux_slave_class_entry_function) (struct UX_SLAVE_CLASS_COMMAND_STRUCT *) ; + UINT (*ux_slave_class_entry_function) (struct UX_SLAVE_CLASS_COMMAND_STRUCT *); VOID *ux_slave_class_instance; VOID *ux_slave_class_client; - TX_THREAD ux_slave_class_thread; + UX_THREAD ux_slave_class_thread; VOID *ux_slave_class_thread_stack; VOID *ux_slave_class_interface_parameter; ULONG ux_slave_class_interface_number; @@ -1714,18 +1935,41 @@ typedef struct UX_SYSTEM_STRUCT 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; +#endif + UINT ux_system_thread_lowest_priority; - TX_MUTEX ux_system_mutex; - ULONG ux_system_debug_code; - ULONG ux_system_debug_count; + UX_MUTEX ux_system_mutex; + +#ifndef UX_DISABLE_ERROR_HANDLER UINT ux_system_last_error; UINT ux_system_error_count; + VOID (*ux_system_error_callback_function) (UINT system_level, UINT system_context, UINT error_code); +#endif + +#ifdef UX_ENABLE_DEBUG_LOG + ULONG ux_system_debug_code; + ULONG ux_system_debug_count; UCHAR *ux_system_debug_log_buffer; UCHAR *ux_system_debug_log_head; UCHAR *ux_system_debug_log_tail; ULONG ux_system_debug_log_size; - VOID (*ux_system_debug_callback_function) (UCHAR *debug_message, ULONG debug_value) ; - VOID (*ux_system_error_callback_function) (UINT system_level, UINT system_context, UINT error_code) ; + VOID (*ux_system_debug_callback_function) (UCHAR *debug_message, ULONG debug_value); +#endif } UX_SYSTEM; @@ -1734,30 +1978,70 @@ typedef struct UX_SYSTEM_STRUCT typedef struct UX_SYSTEM_HOST_STRUCT { +#if UX_MAX_CLASS_DRIVER > 1 UINT ux_system_host_max_class; - UINT ux_system_host_registered_class; +#endif UX_HOST_CLASS *ux_system_host_class_array; + +#if UX_MAX_HCD > 1 UINT ux_system_host_max_hcd; - UX_HCD *ux_system_host_hcd_array; +#endif UINT ux_system_host_registered_hcd; - UX_DEVICE *ux_system_host_device_array; + UX_HCD *ux_system_host_hcd_array; + +#if UX_MAX_DEVICES > 1 ULONG ux_system_host_max_devices; +#endif + UX_DEVICE *ux_system_host_device_array; + ULONG ux_system_host_max_ed; ULONG ux_system_host_max_td; ULONG ux_system_host_max_iso_td; - UINT ux_system_host_rhsc_hcd; + UCHAR *ux_system_host_enum_thread_stack; - TX_THREAD ux_system_host_enum_thread; - TX_SEMAPHORE ux_system_host_enum_semaphore; + UX_THREAD ux_system_host_enum_thread; + UX_SEMAPHORE ux_system_host_enum_semaphore; + +#if UX_MAX_DEVICES > 1 VOID (*ux_system_host_enum_hub_function) (VOID); +#endif + UCHAR *ux_system_host_hcd_thread_stack; - TX_THREAD ux_system_host_hcd_thread; + UX_THREAD ux_system_host_hcd_thread; + UX_SEMAPHORE ux_system_host_hcd_semaphore; + +#if defined(UX_OTG_SUPPORT) UCHAR *ux_system_host_hnp_polling_thread_stack; - TX_THREAD ux_system_host_hnp_polling_thread; - TX_SEMAPHORE ux_system_host_hcd_semaphore; + UX_THREAD ux_system_host_hnp_polling_thread; +#endif + UINT (*ux_system_host_change_function) (ULONG, UX_HOST_CLASS *, VOID *); } UX_SYSTEM_HOST; +#if UX_MAX_CLASS_DRIVER > 1 +#define UX_SYSTEM_HOST_MAX_CLASS_GET() (_ux_system_host->ux_system_host_max_class) +#define UX_SYSTEM_HOST_MAX_CLASS_SET(n) do { _ux_system_host->ux_system_host_max_class = (n); } while(0) +#else +#define UX_SYSTEM_HOST_MAX_CLASS_GET() (1) +#define UX_SYSTEM_HOST_MAX_CLASS_SET(n) UX_PARAMETER_NOT_USED(n) +#endif + +#if UX_MAX_HCD > 1 +#define UX_SYSTEM_HOST_MAX_HCD_GET() (_ux_system_host->ux_system_host_max_hcd) +#define UX_SYSTEM_HOST_MAX_HCD_SET(n) do { _ux_system_host->ux_system_host_max_hcd = (n); } while(0) +#else +#define UX_SYSTEM_HOST_MAX_HCD_GET() (1) +#define UX_SYSTEM_HOST_MAX_HCD_SET(n) UX_PARAMETER_NOT_USED(n) +#endif + +#if UX_MAX_DEVICES > 1 +#define UX_SYSTEM_HOST_MAX_DEVICES_SET(n) do { _ux_system_host->ux_system_host_max_devices = (n); } while(0) +#define UX_SYSTEM_HOST_MAX_DEVICES_GET() (_ux_system_host->ux_system_host_max_devices) +#else +#define UX_SYSTEM_HOST_MAX_DEVICES_SET(n) UX_PARAMETER_NOT_USED(n) +#define UX_SYSTEM_HOST_MAX_DEVICES_GET() (1) +#endif + typedef struct UX_SYSTEM_SLAVE_STRUCT { @@ -1776,8 +2060,9 @@ typedef struct UX_SYSTEM_SLAVE_STRUCT ULONG ux_system_slave_language_id_framework_length; UCHAR *ux_system_slave_dfu_framework; ULONG ux_system_slave_dfu_framework_length; +#if UX_MAX_SLAVE_CLASS_DRIVER > 1 UINT ux_system_slave_max_class; - UINT ux_system_slave_registered_class; +#endif UX_SLAVE_CLASS *ux_system_slave_class_array; UX_SLAVE_CLASS *ux_system_slave_interface_class_array[UX_MAX_SLAVE_INTERFACES]; ULONG ux_system_slave_speed; @@ -1795,12 +2080,20 @@ typedef struct UX_SYSTEM_SLAVE_STRUCT } UX_SYSTEM_SLAVE; +#if UX_MAX_SLAVE_CLASS_DRIVER > 1 +#define UX_SYSTEM_DEVICE_MAX_CLASS_SET(n) do { _ux_system_slave->ux_system_slave_max_class = (n); } while(0) +#define UX_SYSTEM_DEVICE_MAX_CLASS_GET() (_ux_system_slave->ux_system_slave_max_class) +#else +#define UX_SYSTEM_DEVICE_MAX_CLASS_SET(n) do { UX_PARAMETER_NOT_USED(n); } while(0) +#define UX_SYSTEM_DEVICE_MAX_CLASS_GET() (1) +#endif + typedef struct UX_SYSTEM_OTG_STRUCT { - TX_THREAD ux_system_otg_thread; + UX_THREAD ux_system_otg_thread; UCHAR *ux_system_otg_thread_stack; - TX_SEMAPHORE ux_system_otg_semaphore; + UX_SEMAPHORE ux_system_otg_semaphore; UINT (*ux_system_otg_function) (ULONG); ULONG ux_system_otg_mode; ULONG ux_system_otg_io; @@ -1829,7 +2122,7 @@ typedef struct UX_HOST_CLASS_DPUMP_STRUCT UX_ENDPOINT *ux_host_class_dpump_bulk_in_endpoint; UX_ENDPOINT *ux_host_class_dpump_interrupt_endpoint; UINT ux_host_class_dpump_state; - TX_SEMAPHORE ux_host_class_dpump_semaphore; + UX_SEMAPHORE ux_host_class_dpump_semaphore; } UX_HOST_CLASS_DPUMP; @@ -1855,13 +2148,16 @@ typedef struct UX_HOST_CLASS_DPUMP_STRUCT #define ux_host_stack_class_instance_destroy _ux_host_stack_class_instance_destroy #define ux_host_stack_class_instance_get _ux_host_stack_class_instance_get #define ux_host_stack_class_register _ux_host_stack_class_register +#define ux_host_stack_class_unregister _ux_host_stack_class_unregister #define ux_host_stack_configuration_interface_get _ux_host_stack_configuration_interface_get #define ux_host_stack_device_configuration_get _ux_host_stack_device_configuration_get #define ux_host_stack_device_configuration_select _ux_host_stack_device_configuration_select #define ux_host_stack_device_get _ux_host_stack_device_get #define ux_host_stack_endpoint_transfer_abort _ux_host_stack_endpoint_transfer_abort #define ux_host_stack_hcd_register _ux_host_stack_hcd_register +#define ux_host_stack_hcd_unregister _ux_host_stack_hcd_unregister #define ux_host_stack_initialize _ux_host_stack_initialize +#define ux_host_stack_uninitialize _ux_host_stack_uninitialize #define ux_host_stack_interface_endpoint_get _ux_host_stack_interface_endpoint_get #define ux_host_stack_interface_setting_select _ux_host_stack_interface_setting_select #define ux_host_stack_transfer_request _ux_host_stack_transfer_request diff --git a/common/core/inc/ux_dcd_sim_slave.h b/common/core/inc/ux_dcd_sim_slave.h index 82bf23c..f9ebcff 100644 --- a/common/core/inc/ux_dcd_sim_slave.h +++ b/common/core/inc/ux_dcd_sim_slave.h @@ -26,7 +26,7 @@ /* COMPONENT DEFINITION RELEASE */ /* */ /* ux_dcd_sim_slave.h PORTABLE C */ -/* 6.0 */ +/* 6.1 */ /* AUTHOR */ /* */ /* Chaoqiong Xiao, Microsoft Corporation */ @@ -42,6 +42,8 @@ /* 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 */ /* */ /**************************************************************************/ diff --git a/common/core/inc/ux_device_class_dpump.h b/common/core/inc/ux_device_class_dpump.h index cfed0b2..2216d37 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.0 */ +/* 6.1 */ /* AUTHOR */ /* */ /* Chaoqiong Xiao, Microsoft Corporation */ @@ -41,6 +41,8 @@ /* 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 */ /* */ /**************************************************************************/ diff --git a/common/core/inc/ux_device_stack.h b/common/core/inc/ux_device_stack.h index f9ad783..7cecf2d 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.0 */ +/* 6.1 */ /* AUTHOR */ /* */ /* Chaoqiong Xiao, Microsoft Corporation */ @@ -40,6 +40,8 @@ /* 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 */ /* */ /**************************************************************************/ diff --git a/common/core/inc/ux_hcd_sim_host.h b/common/core/inc/ux_hcd_sim_host.h index fae2c9d..4012012 100644 --- a/common/core/inc/ux_hcd_sim_host.h +++ b/common/core/inc/ux_hcd_sim_host.h @@ -26,7 +26,7 @@ /* COMPONENT DEFINITION RELEASE */ /* */ /* ux_hcd_sim_host.h PORTABLE C */ -/* 6.0 */ +/* 6.1 */ /* AUTHOR */ /* */ /* Chaoqiong Xiao, Microsoft Corporation */ @@ -42,6 +42,12 @@ /* DATE NAME DESCRIPTION */ /* */ /* 05-19-2020 Chaoqiong Xiao Initial Version 6.0 */ +/* 09-30-2020 Chaoqiong Xiao Modified comment(s), */ +/* added controller disable, */ +/* used UX prefix to refer to */ +/* TX symbols instead of using */ +/* them directly, */ +/* resulting in version 6.1 */ /* */ /**************************************************************************/ @@ -105,7 +111,7 @@ typedef struct UX_HCD_SIM_HOST_STRUCT UINT ux_hcd_sim_host_periodic_scheduler_active; UINT ux_hcd_sim_host_interruptible; ULONG ux_hcd_sim_host_interrupt_count; - TX_TIMER ux_hcd_sim_host_timer; + UX_TIMER ux_hcd_sim_host_timer; } UX_HCD_SIM_HOST; @@ -141,7 +147,7 @@ typedef struct UX_HCD_SIM_HOST_ED_STRUCT typedef struct UX_HCD_SIM_HOST_TD_STRUCT { - UCHAR * ux_sim_host_td_buffer; + UCHAR * ux_sim_host_td_buffer; ULONG ux_sim_host_td_length; struct UX_HCD_SIM_HOST_TD_STRUCT *ux_sim_host_td_next_td; @@ -174,7 +180,7 @@ typedef struct UX_HCD_SIM_HOST_TD_STRUCT typedef struct UX_HCD_SIM_HOST_ISO_TD_STRUCT { - UCHAR * ux_sim_host_iso_td_buffer; + UCHAR * ux_sim_host_iso_td_buffer; ULONG ux_sim_host_iso_td_length; struct UX_HCD_SIM_HOST_ISO_TD_STRUCT *ux_sim_host_iso_td_next_td; @@ -204,6 +210,7 @@ UINT _ux_hcd_sim_host_entry(UX_HCD *hcd, UINT function, VOID *parameter); UINT _ux_hcd_sim_host_frame_number_get(UX_HCD_SIM_HOST *hcd_sim_host, ULONG *frame_number); VOID _ux_hcd_sim_host_frame_number_set(UX_HCD_SIM_HOST *hcd_sim_host, ULONG frame_number); UINT _ux_hcd_sim_host_initialize(UX_HCD *hcd); +UINT _ux_hcd_sim_host_controller_disable(UX_HCD_SIM_HOST *hcd); UINT _ux_hcd_sim_host_interrupt_endpoint_create(UX_HCD_SIM_HOST *hcd_sim_host, UX_ENDPOINT *endpoint); VOID _ux_hcd_sim_host_iso_queue_process(UX_HCD_SIM_HOST *hcd_sim_host); VOID _ux_hcd_sim_host_iso_schedule(UX_HCD_SIM_HOST *hcd_sim_host); diff --git a/common/core/inc/ux_host_class_dpump.h b/common/core/inc/ux_host_class_dpump.h index 4b3907e..c3c9047 100644 --- a/common/core/inc/ux_host_class_dpump.h +++ b/common/core/inc/ux_host_class_dpump.h @@ -26,7 +26,7 @@ /* COMPONENT DEFINITION RELEASE */ /* */ /* ux_host_class_dpump.h PORTABLE C */ -/* 6.0 */ +/* 6.1 */ /* AUTHOR */ /* */ /* Chaoqiong Xiao, Microsoft Corporation */ @@ -41,6 +41,8 @@ /* 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 */ /* */ /**************************************************************************/ diff --git a/common/core/inc/ux_host_stack.h b/common/core/inc/ux_host_stack.h index ec62880..e17f9f1 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.0 */ +/* 6.1 */ /* AUTHOR */ /* */ /* Chaoqiong Xiao, Microsoft Corporation */ @@ -41,6 +41,11 @@ /* DATE NAME DESCRIPTION */ /* */ /* 05-19-2020 Chaoqiong Xiao Initial Version 6.0 */ +/* 09-30-2020 Chaoqiong Xiao Modified comment(s), */ +/* added uninitialize APIs, */ +/* optimized based on compile */ +/* definitions, */ +/* resulting in version 6.1 */ /* */ /**************************************************************************/ @@ -50,9 +55,16 @@ /* Define Host Stack component function prototypes. */ +#if UX_MAX_DEVICES > 1 VOID _ux_host_stack_bandwidth_release(UX_HCD *hcd, UX_ENDPOINT *endpoint); VOID _ux_host_stack_bandwidth_claim(UX_HCD *hcd, UX_ENDPOINT *endpoint); UINT _ux_host_stack_bandwidth_check(UX_HCD *hcd, UX_ENDPOINT *endpoint); +#else +#define _ux_host_stack_bandwidth_release(a,b) +#define _ux_host_stack_bandwidth_claim(a,b) +#define _ux_host_stack_bandwidth_check(a,b) (UX_SUCCESS) +#endif + UX_HOST_CLASS * _ux_host_stack_class_call(UX_HOST_CLASS_COMMAND *class_command); UINT _ux_host_stack_class_device_scan(UX_DEVICE *device); UINT _ux_host_stack_class_get(UCHAR *class_name, UX_HOST_CLASS **class); @@ -63,6 +75,7 @@ UINT _ux_host_stack_class_instance_verify(UCHAR *class_name, VOID *class_inst UINT _ux_host_stack_class_interface_scan(UX_DEVICE *device); UINT _ux_host_stack_class_register(UCHAR *class_name, UINT (*class_entry_function)(struct UX_HOST_CLASS_COMMAND_STRUCT *)); +UINT _ux_host_stack_class_unregister(UINT (*class_entry_function)(struct UX_HOST_CLASS_COMMAND_STRUCT *)); UINT _ux_host_stack_configuration_descriptor_parse(UX_DEVICE *device, UX_CONFIGURATION *configuration, UINT configuration_index); UINT _ux_host_stack_configuration_enumerate(UX_DEVICE *device); UINT _ux_host_stack_configuration_instance_create(UX_CONFIGURATION *configuration); @@ -88,9 +101,11 @@ UINT _ux_host_stack_endpoint_transfer_abort(UX_ENDPOINT *endpoint); VOID _ux_host_stack_enum_thread_entry(ULONG input); UINT _ux_host_stack_hcd_register(UCHAR *hcd_name, UINT (*hcd_init_function)(struct UX_HCD_STRUCT *), ULONG hcd_param1, ULONG hcd_param2); +UINT _ux_host_stack_hcd_unregister(UCHAR *hcd_name, ULONG hcd_param1, ULONG hcd_param2); VOID _ux_host_stack_hcd_thread_entry(ULONG input); UINT _ux_host_stack_hcd_transfer_request(UX_TRANSFER *transfer_request); UINT _ux_host_stack_initialize(UINT (*ux_system_host_change_function)(ULONG, UX_HOST_CLASS *, VOID *)); +UINT _ux_host_stack_uninitialize(VOID); UINT _ux_host_stack_interface_endpoint_get(UX_INTERFACE *interface, UINT endpoint_index, UX_ENDPOINT **endpoint); UINT _ux_host_stack_interface_instance_create(UX_INTERFACE *interface); VOID _ux_host_stack_interface_instance_delete(UX_INTERFACE *interface); @@ -109,8 +124,12 @@ UINT _ux_host_stack_rh_device_extraction(UX_HCD *hcd, UINT port_index); UINT _ux_host_stack_rh_device_insertion(UX_HCD *hcd, UINT port_index); UINT _ux_host_stack_transfer_request(UX_TRANSFER *transfer_request); UINT _ux_host_stack_transfer_request_abort(UX_TRANSFER *transfer_request); -VOID _ux_host_stack_hnp_polling_thread_entry(ULONG id); UINT _ux_host_stack_role_swap(UX_DEVICE *device); +#if defined(UX_OTG_SUPPORT) +VOID _ux_host_stack_hnp_polling_thread_entry(ULONG id); +#endif + + #endif diff --git a/common/core/inc/ux_system.h b/common/core/inc/ux_system.h index 06f898b..ac46308 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.0 */ +/* 6.1 */ /* AUTHOR */ /* */ /* Chaoqiong Xiao, Microsoft Corporation */ @@ -41,6 +41,8 @@ /* 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 */ /* */ /**************************************************************************/ diff --git a/common/core/inc/ux_user_sample.h b/common/core/inc/ux_user_sample.h index b7bb606..7f046fb 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.0 */ +/* 6.1 */ /* */ /* AUTHOR */ /* */ @@ -45,6 +45,8 @@ /* 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 */ /* */ /**************************************************************************/ diff --git a/common/core/inc/ux_utility.h b/common/core/inc/ux_utility.h index 3f2b6e4..ae74c90 100644 --- a/common/core/inc/ux_utility.h +++ b/common/core/inc/ux_utility.h @@ -26,7 +26,7 @@ /* COMPONENT DEFINITION RELEASE */ /* */ /* ux_utility.h PORTABLE C */ -/* 6.0 */ +/* 6.1 */ /* AUTHOR */ /* */ /* Chaoqiong Xiao, Microsoft Corporation */ @@ -41,6 +41,12 @@ /* 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 */ +/* prefix to refer to TX */ +/* symbols instead of using */ +/* them directly, */ +/* resulting in version 6.1 */ /* */ /**************************************************************************/ @@ -66,10 +72,10 @@ 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); VOID _ux_utility_memory_set(VOID *destination, UCHAR value, ULONG length); -UINT _ux_utility_mutex_create(TX_MUTEX *mutex, CHAR *mutex_name); -UINT _ux_utility_mutex_delete(TX_MUTEX *mutex); -VOID _ux_utility_mutex_off(TX_MUTEX *mutex); -VOID _ux_utility_mutex_on(TX_MUTEX *mutex); +UINT _ux_utility_mutex_create(UX_MUTEX *mutex, CHAR *mutex_name); +UINT _ux_utility_mutex_delete(UX_MUTEX *mutex); +VOID _ux_utility_mutex_off(UX_MUTEX *mutex); +VOID _ux_utility_mutex_on(UX_MUTEX *mutex); 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); @@ -78,44 +84,51 @@ ULONG _ux_utility_pci_read(ULONG bus_number, ULONG device_number, ULO VOID _ux_utility_pci_write(ULONG bus_number, ULONG device_number, ULONG function_number, ULONG offset, ULONG value, UINT write_size); VOID *_ux_utility_physical_address(VOID *virtual_address); -UINT _ux_utility_semaphore_create(TX_SEMAPHORE *semaphore, CHAR *semaphore_name, UINT initial_count); -UINT _ux_utility_semaphore_delete(TX_SEMAPHORE *semaphore); -UINT _ux_utility_semaphore_get(TX_SEMAPHORE *semaphore, ULONG semaphore_signal); -UINT _ux_utility_semaphore_put(TX_SEMAPHORE *semaphore); +UINT _ux_utility_semaphore_create(UX_SEMAPHORE *semaphore, CHAR *semaphore_name, UINT initial_count); +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); VOID _ux_utility_set_interrupt_handler(UINT irq, VOID (*interrupt_handler)(VOID)); ULONG _ux_utility_short_get(UCHAR * address); ULONG _ux_utility_short_get_big_endian(UCHAR * address); VOID _ux_utility_short_put(UCHAR * address, USHORT value); VOID _ux_utility_short_put_big_endian(UCHAR * address, USHORT value); -UINT _ux_utility_thread_create(TX_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, UINT priority, UINT preempt_threshold, ULONG time_slice, UINT auto_start); -UINT _ux_utility_thread_delete(TX_THREAD *thread_ptr); +UINT _ux_utility_thread_delete(UX_THREAD *thread_ptr); VOID _ux_utility_thread_relinquish(VOID); UINT _ux_utility_thread_schedule_other(UINT caller_priority); -UINT _ux_utility_thread_resume(TX_THREAD *thread_ptr); +UINT _ux_utility_thread_resume(UX_THREAD *thread_ptr); UINT _ux_utility_thread_sleep(ULONG ticks); -UINT _ux_utility_thread_suspend(TX_THREAD *thread_ptr); -TX_THREAD *_ux_utility_thread_identify(VOID); -UINT _ux_utility_timer_create(TX_TIMER *timer, CHAR *timer_name, VOID (*expiration_function) (ULONG), +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, UINT activation_flag); +UINT _ux_utility_timer_delete(UX_TIMER *timer); VOID *_ux_utility_virtual_address(VOID *physical_address); -UINT _ux_utility_event_flags_create(TX_EVENT_FLAGS_GROUP *group_ptr, CHAR *name); -UINT _ux_utility_event_flags_delete(TX_EVENT_FLAGS_GROUP *group_ptr); -UINT _ux_utility_event_flags_get(TX_EVENT_FLAGS_GROUP *group_ptr, ULONG requested_flags, +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 get_option, ULONG *actual_flags_ptr, ULONG wait_option); -UINT _ux_utility_event_flags_set(TX_EVENT_FLAGS_GROUP *group_ptr, ULONG flags_to_set, +UINT _ux_utility_event_flags_set(UX_EVENT_FLAGS_GROUP*group_ptr, ULONG flags_to_set, UINT set_option); VOID _ux_utility_unicode_to_string(UCHAR *source, UCHAR *destination); VOID _ux_utility_string_to_unicode(UCHAR *source, UCHAR *destination); -VOID _ux_system_error_handler(UINT system_level, UINT system_context, UINT error_code); VOID _ux_utility_debug_callback_register(VOID (*debug_callback)(UCHAR *, ULONG)); -VOID _ux_utility_error_callback_register(VOID (*error_callback)(UINT system_level, UINT system_context, UINT error_code)); VOID _ux_utility_delay_ms(ULONG ms_wait); +#ifdef UX_DISABLE_ERROR_HANDLER +#define _ux_system_error_handler(system_level, system_context, error_code) do {} while(0) +#define _ux_utility_error_callback_register(error_callback) do {} while(0) +#else +VOID _ux_system_error_handler(UINT system_level, UINT system_context, UINT error_code); +VOID _ux_utility_error_callback_register(VOID (*error_callback)(UINT system_level, UINT system_context, UINT error_code)); +#endif + #define UX_UTILITY_ADD_SAFE(add_a, add_b, result, status) do { \ if (UX_OVERFLOW_CHECK_ADD_ULONG(add_a, add_b)) \ status = UX_ERROR; \ @@ -174,6 +187,14 @@ VOID* _ux_utility_memory_allocate_add_safe(ULONG align,ULONG cache,UL #endif /* UX_DISABLE_ARITHMETIC_CHECK */ + +#if defined(UX_NAME_REFERENCED_BY_POINTER) +#define ux_utility_name_match(n0,n1,l) ((n0) == (n1)) +#else +#define ux_utility_name_match(n0,n1,l) (_ux_utility_memory_compare(n0,n1,l) == UX_SUCCESS) +#endif + + /* Define the system API mappings. Note: this section is only applicable to application source code, hence the conditional that turns off this diff --git a/common/core/src/ux_dcd_sim_slave_address_set.c b/common/core/src/ux_dcd_sim_slave_address_set.c index 703312e..82f2819 100644 --- a/common/core/src/ux_dcd_sim_slave_address_set.c +++ b/common/core/src/ux_dcd_sim_slave_address_set.c @@ -31,10 +31,10 @@ /**************************************************************************/ /* */ -/* FUNCTION RELEASE */ +/* FUNCTION RELEASE */ /* */ -/* _ux_dcd_sim_slave_address_set PORTABLE C */ -/* 6.0 */ +/* _ux_dcd_sim_slave_address_set PORTABLE C */ +/* 6.1 */ /* AUTHOR */ /* */ /* Chaoqiong Xiao, Microsoft Corporation */ @@ -66,6 +66,8 @@ /* 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 */ /* */ /**************************************************************************/ UINT _ux_dcd_sim_slave_address_set(UX_DCD_SIM_SLAVE *dcd_sim_slave, ULONG address) diff --git a/common/core/src/ux_dcd_sim_slave_endpoint_create.c b/common/core/src/ux_dcd_sim_slave_endpoint_create.c index 3dcc2d2..912d5bf 100644 --- a/common/core/src/ux_dcd_sim_slave_endpoint_create.c +++ b/common/core/src/ux_dcd_sim_slave_endpoint_create.c @@ -34,7 +34,7 @@ /* FUNCTION RELEASE */ /* */ /* _ux_dcd_sim_slave_endpoint_create PORTABLE C */ -/* 6.0 */ +/* 6.1 */ /* AUTHOR */ /* */ /* Chaoqiong Xiao, Microsoft Corporation */ @@ -65,6 +65,8 @@ /* 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 */ /* */ /**************************************************************************/ UINT _ux_dcd_sim_slave_endpoint_create(UX_DCD_SIM_SLAVE *dcd_sim_slave, UX_SLAVE_ENDPOINT *endpoint) diff --git a/common/core/src/ux_dcd_sim_slave_endpoint_destroy.c b/common/core/src/ux_dcd_sim_slave_endpoint_destroy.c index 0fabe5f..b9690ed 100644 --- a/common/core/src/ux_dcd_sim_slave_endpoint_destroy.c +++ b/common/core/src/ux_dcd_sim_slave_endpoint_destroy.c @@ -31,10 +31,10 @@ /**************************************************************************/ /* */ -/* FUNCTION RELEASE */ +/* FUNCTION RELEASE */ /* */ -/* _ux_dcd_sim_slave_endpoint_destroy PORTABLE C */ -/* 6.0 */ +/* _ux_dcd_sim_slave_endpoint_destroy PORTABLE C */ +/* 6.1 */ /* AUTHOR */ /* */ /* Chaoqiong Xiao, Microsoft Corporation */ @@ -65,6 +65,8 @@ /* 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 */ /* */ /**************************************************************************/ UINT _ux_dcd_sim_slave_endpoint_destroy(UX_DCD_SIM_SLAVE *dcd_sim_slave, UX_SLAVE_ENDPOINT *endpoint) diff --git a/common/core/src/ux_dcd_sim_slave_endpoint_reset.c b/common/core/src/ux_dcd_sim_slave_endpoint_reset.c index a2659f6..6dc0083 100644 --- a/common/core/src/ux_dcd_sim_slave_endpoint_reset.c +++ b/common/core/src/ux_dcd_sim_slave_endpoint_reset.c @@ -31,10 +31,10 @@ /**************************************************************************/ /* */ -/* FUNCTION RELEASE */ +/* FUNCTION RELEASE */ /* */ -/* _ux_dcd_sim_slave_endpoint_reset PORTABLE C */ -/* 6.0 */ +/* _ux_dcd_sim_slave_endpoint_reset PORTABLE C */ +/* 6.1 */ /* AUTHOR */ /* */ /* Chaoqiong Xiao, Microsoft Corporation */ @@ -65,6 +65,8 @@ /* 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 */ /* */ /**************************************************************************/ UINT _ux_dcd_sim_slave_endpoint_reset(UX_DCD_SIM_SLAVE *dcd_sim_slave, UX_SLAVE_ENDPOINT *endpoint) diff --git a/common/core/src/ux_dcd_sim_slave_endpoint_stall.c b/common/core/src/ux_dcd_sim_slave_endpoint_stall.c index 00c53f0..53e2601 100644 --- a/common/core/src/ux_dcd_sim_slave_endpoint_stall.c +++ b/common/core/src/ux_dcd_sim_slave_endpoint_stall.c @@ -31,10 +31,10 @@ /**************************************************************************/ /* */ -/* FUNCTION RELEASE */ +/* FUNCTION RELEASE */ /* */ -/* _ux_dcd_sim_slave_endpoint_stall PORTABLE C */ -/* 6.0 */ +/* _ux_dcd_sim_slave_endpoint_stall PORTABLE C */ +/* 6.1 */ /* AUTHOR */ /* */ /* Chaoqiong Xiao, Microsoft Corporation */ @@ -65,6 +65,8 @@ /* 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 */ /* */ /**************************************************************************/ UINT _ux_dcd_sim_slave_endpoint_stall(UX_DCD_SIM_SLAVE *dcd_sim_slave, UX_SLAVE_ENDPOINT *endpoint) diff --git a/common/core/src/ux_dcd_sim_slave_endpoint_status.c b/common/core/src/ux_dcd_sim_slave_endpoint_status.c index 1830cb6..a8b5c69 100644 --- a/common/core/src/ux_dcd_sim_slave_endpoint_status.c +++ b/common/core/src/ux_dcd_sim_slave_endpoint_status.c @@ -34,7 +34,7 @@ /* FUNCTION RELEASE */ /* */ /* _ux_dcd_sim_slave_endpoint_status PORTABLE C */ -/* 6.0 */ +/* 6.1 */ /* AUTHOR */ /* */ /* Chaoqiong Xiao, Microsoft Corporation */ @@ -65,6 +65,8 @@ /* 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 */ /* */ /**************************************************************************/ UINT _ux_dcd_sim_slave_endpoint_status(UX_DCD_SIM_SLAVE *dcd_sim_slave, ULONG endpoint_index) diff --git a/common/core/src/ux_dcd_sim_slave_frame_number_get.c b/common/core/src/ux_dcd_sim_slave_frame_number_get.c index 6f87b2d..1901dbe 100644 --- a/common/core/src/ux_dcd_sim_slave_frame_number_get.c +++ b/common/core/src/ux_dcd_sim_slave_frame_number_get.c @@ -31,10 +31,10 @@ /**************************************************************************/ /* */ -/* FUNCTION RELEASE */ +/* FUNCTION RELEASE */ /* */ -/* _ux_dcd_sim_slave_frame_number_get PORTABLE C */ -/* 6.0 */ +/* _ux_dcd_sim_slave_frame_number_get PORTABLE C */ +/* 6.1 */ /* AUTHOR */ /* */ /* Chaoqiong Xiao, Microsoft Corporation */ @@ -66,6 +66,8 @@ /* 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 */ /* */ /**************************************************************************/ UINT _ux_dcd_sim_slave_frame_number_get(UX_DCD_SIM_SLAVE *dcd_sim_slave, ULONG *frame_number) diff --git a/common/core/src/ux_dcd_sim_slave_function.c b/common/core/src/ux_dcd_sim_slave_function.c index bd58839..f3e332b 100644 --- a/common/core/src/ux_dcd_sim_slave_function.c +++ b/common/core/src/ux_dcd_sim_slave_function.c @@ -30,10 +30,10 @@ /**************************************************************************/ /* */ -/* FUNCTION RELEASE */ +/* FUNCTION RELEASE */ /* */ -/* _ux_dcd_sim_slave_function PORTABLE C */ -/* 6.0 */ +/* _ux_dcd_sim_slave_function PORTABLE C */ +/* 6.1 */ /* AUTHOR */ /* */ /* Chaoqiong Xiao, Microsoft Corporation */ @@ -76,6 +76,8 @@ /* 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 */ /* */ /**************************************************************************/ UINT _ux_dcd_sim_slave_function(UX_SLAVE_DCD *dcd, UINT function, VOID *parameter) diff --git a/common/core/src/ux_dcd_sim_slave_initialize.c b/common/core/src/ux_dcd_sim_slave_initialize.c index 4499ae6..febc3bf 100644 --- a/common/core/src/ux_dcd_sim_slave_initialize.c +++ b/common/core/src/ux_dcd_sim_slave_initialize.c @@ -31,10 +31,10 @@ /**************************************************************************/ /* */ -/* FUNCTION RELEASE */ +/* FUNCTION RELEASE */ /* */ -/* _ux_dcd_sim_slave_initialize PORTABLE C */ -/* 6.0 */ +/* _ux_dcd_sim_slave_initialize PORTABLE C */ +/* 6.1 */ /* AUTHOR */ /* */ /* Chaoqiong Xiao, Microsoft Corporation */ @@ -64,6 +64,8 @@ /* 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 */ /* */ /**************************************************************************/ UINT _ux_dcd_sim_slave_initialize(VOID) diff --git a/common/core/src/ux_dcd_sim_slave_initialize_complete.c b/common/core/src/ux_dcd_sim_slave_initialize_complete.c index 7e22c85..820dad5 100644 --- a/common/core/src/ux_dcd_sim_slave_initialize_complete.c +++ b/common/core/src/ux_dcd_sim_slave_initialize_complete.c @@ -31,10 +31,10 @@ /**************************************************************************/ /* */ -/* FUNCTION RELEASE */ +/* FUNCTION RELEASE */ /* */ -/* _ux_dcd_sim_slave_initialize_complete PORTABLE C */ -/* 6.0 */ +/* _ux_dcd_sim_slave_initialize_complete PORTABLE C */ +/* 6.1 */ /* AUTHOR */ /* */ /* Chaoqiong Xiao, Microsoft Corporation */ @@ -66,6 +66,9 @@ /* DATE NAME DESCRIPTION */ /* */ /* 05-19-2020 Chaoqiong Xiao Initial Version 6.0 */ +/* 09-30-2020 Chaoqiong Xiao Modified comment(s), */ +/* prefixed UX to MS_TO_TICK, */ +/* resulting in version 6.1 */ /* */ /**************************************************************************/ UINT _ux_dcd_sim_slave_initialize_complete(VOID) @@ -102,7 +105,7 @@ UX_SLAVE_TRANSFER *transfer_request; transfer_request = &device -> ux_slave_device_control_endpoint.ux_slave_endpoint_transfer_request; /* Set the timeout to be for Control Endpoint. */ - transfer_request -> ux_slave_transfer_request_timeout = MS_TO_TICK(UX_CONTROL_TRANSFER_TIMEOUT); + transfer_request -> ux_slave_transfer_request_timeout = UX_MS_TO_TICK(UX_CONTROL_TRANSFER_TIMEOUT); /* Adjust the current data pointer as well. */ transfer_request -> ux_slave_transfer_request_current_data_pointer = diff --git a/common/core/src/ux_dcd_sim_slave_state_change.c b/common/core/src/ux_dcd_sim_slave_state_change.c index eacd3d8..4ed8e3c 100644 --- a/common/core/src/ux_dcd_sim_slave_state_change.c +++ b/common/core/src/ux_dcd_sim_slave_state_change.c @@ -34,7 +34,7 @@ /* FUNCTION RELEASE */ /* */ /* _ux_dcd_sim_slave_state_change PORTABLE C */ -/* 6.0 */ +/* 6.1 */ /* AUTHOR */ /* */ /* Chaoqiong Xiao, Microsoft Corporation */ @@ -66,6 +66,8 @@ /* 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 */ /* */ /**************************************************************************/ UINT _ux_dcd_sim_slave_state_change(UX_DCD_SIM_SLAVE *dcd_sim_slave, ULONG state) diff --git a/common/core/src/ux_dcd_sim_slave_transfer_abort.c b/common/core/src/ux_dcd_sim_slave_transfer_abort.c index f3c56b4..9648aab 100644 --- a/common/core/src/ux_dcd_sim_slave_transfer_abort.c +++ b/common/core/src/ux_dcd_sim_slave_transfer_abort.c @@ -33,8 +33,8 @@ /* */ /* FUNCTION RELEASE */ /* */ -/* _ux_dcd_sim_slave_transfer_abort PORTABLE C */ -/* 6.0 */ +/* _ux_dcd_sim_slave_transfer_abort PORTABLE C */ +/* 6.1 */ /* AUTHOR */ /* */ /* Chaoqiong Xiao, Microsoft Corporation */ @@ -65,6 +65,8 @@ /* 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 */ /* */ /**************************************************************************/ UINT _ux_dcd_sim_slave_transfer_abort(UX_DCD_SIM_SLAVE *dcd_sim_slave, UX_SLAVE_TRANSFER *transfer_request) diff --git a/common/core/src/ux_dcd_sim_slave_transfer_request.c b/common/core/src/ux_dcd_sim_slave_transfer_request.c index 5e1d530..41c8485 100644 --- a/common/core/src/ux_dcd_sim_slave_transfer_request.c +++ b/common/core/src/ux_dcd_sim_slave_transfer_request.c @@ -31,10 +31,10 @@ /**************************************************************************/ /* */ -/* FUNCTION RELEASE */ +/* FUNCTION RELEASE */ /* */ -/* _ux_dcd_sim_slave_transfer_request PORTABLE C */ -/* 6.0 */ +/* _ux_dcd_sim_slave_transfer_request PORTABLE C */ +/* 6.1 */ /* AUTHOR */ /* */ /* Chaoqiong Xiao, Microsoft Corporation */ @@ -71,6 +71,8 @@ /* 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 */ /* */ /**************************************************************************/ UINT _ux_dcd_sim_slave_transfer_request(UX_DCD_SIM_SLAVE *dcd_sim_slave, UX_SLAVE_TRANSFER *transfer_request) diff --git a/common/core/src/ux_device_class_dpump_activate.c b/common/core/src/ux_device_class_dpump_activate.c index 1e0d307..e2f401d 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.0 */ +/* 6.1 */ /* AUTHOR */ /* */ /* Chaoqiong Xiao, Microsoft Corporation */ @@ -64,6 +64,8 @@ /* 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 */ /* */ /**************************************************************************/ 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 e4e759a..6c6b90e 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.0 */ +/* 6.1 */ /* AUTHOR */ /* */ /* Chaoqiong Xiao, Microsoft Corporation */ @@ -65,6 +65,10 @@ /* DATE NAME DESCRIPTION */ /* */ /* 05-19-2020 Chaoqiong Xiao Initial Version 6.0 */ +/* 09-30-2020 Chaoqiong Xiao Modified comment(s), */ +/* verified memset and memcpy */ +/* cases, */ +/* resulting in version 6.1 */ /* */ /**************************************************************************/ UINT _ux_device_class_dpump_change(UX_SLAVE_CLASS_COMMAND *command) @@ -133,9 +137,9 @@ UX_SLAVE_ENDPOINT *endpoint; /* Reset the endpoint buffers. */ _ux_utility_memory_set(dpump -> ux_slave_class_dpump_bulkout_endpoint -> ux_slave_endpoint_transfer_request. - ux_slave_transfer_request_data_pointer, 0, UX_SLAVE_REQUEST_DATA_MAX_LENGTH); + ux_slave_transfer_request_data_pointer, 0, UX_SLAVE_REQUEST_DATA_MAX_LENGTH); /* Use case of memset is verified. */ _ux_utility_memory_set(dpump -> ux_slave_class_dpump_bulkin_endpoint -> ux_slave_endpoint_transfer_request. - ux_slave_transfer_request_data_pointer, 0, UX_SLAVE_REQUEST_DATA_MAX_LENGTH); + ux_slave_transfer_request_data_pointer, 0, UX_SLAVE_REQUEST_DATA_MAX_LENGTH); /* Use case of memset is verified. */ /* Keep the alternate setting in the dpump structure. */ dpump -> ux_slave_class_dpump_alternate_setting = interface -> ux_slave_interface_descriptor.bAlternateSetting; diff --git a/common/core/src/ux_device_class_dpump_deactivate.c b/common/core/src/ux_device_class_dpump_deactivate.c index 420ae11..188efe9 100644 --- a/common/core/src/ux_device_class_dpump_deactivate.c +++ b/common/core/src/ux_device_class_dpump_deactivate.c @@ -35,7 +35,7 @@ /* FUNCTION RELEASE */ /* */ /* _ux_device_class_dpump_deactivate PORTABLE C */ -/* 6.0 */ +/* 6.1 */ /* AUTHOR */ /* */ /* Chaoqiong Xiao, Microsoft Corporation */ @@ -65,6 +65,8 @@ /* 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 */ /* */ /**************************************************************************/ UINT _ux_device_class_dpump_deactivate(UX_SLAVE_CLASS_COMMAND *command) diff --git a/common/core/src/ux_device_class_dpump_entry.c b/common/core/src/ux_device_class_dpump_entry.c index d91272d..10c3aac 100644 --- a/common/core/src/ux_device_class_dpump_entry.c +++ b/common/core/src/ux_device_class_dpump_entry.c @@ -33,8 +33,8 @@ /* */ /* FUNCTION RELEASE */ /* */ -/* _ux_class_device_dpump_entry PORTABLE C */ -/* 6.0 */ +/* _ux_device_class_dpump_entry PORTABLE C */ +/* 6.1 */ /* AUTHOR */ /* */ /* Chaoqiong Xiao, Microsoft Corporation */ @@ -70,6 +70,8 @@ /* 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 */ /* */ /**************************************************************************/ UINT _ux_device_class_dpump_entry(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 8096878..50f88e4 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.0 */ +/* 6.1 */ /* AUTHOR */ /* */ /* Chaoqiong Xiao, Microsoft Corporation */ @@ -64,6 +64,8 @@ /* 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 */ /* */ /**************************************************************************/ 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 2a607e4..7108cf5 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.0 */ +/* 6.1 */ /* AUTHOR */ /* */ /* Chaoqiong Xiao, Microsoft Corporation */ @@ -66,6 +66,10 @@ /* DATE NAME DESCRIPTION */ /* */ /* 05-19-2020 Chaoqiong Xiao Initial Version 6.0 */ +/* 09-30-2020 Chaoqiong Xiao Modified comment(s), */ +/* verified memset and memcpy */ +/* cases, */ +/* resulting in version 6.1 */ /* */ /**************************************************************************/ UINT _ux_device_class_dpump_read(UX_SLAVE_CLASS_DPUMP *dpump, UCHAR *buffer, @@ -143,7 +147,7 @@ ULONG local_requested_length; /* We need to copy the buffer locally. */ _ux_utility_memory_copy(buffer, transfer_request -> ux_slave_transfer_request_data_pointer, - local_requested_length); + local_requested_length); /* Use case of memcpy is verified. */ /* Next buffer address. */ buffer += transfer_request -> ux_slave_transfer_request_actual_length; diff --git a/common/core/src/ux_device_class_dpump_thread.c b/common/core/src/ux_device_class_dpump_thread.c index 254ea75..598f6e7 100644 --- a/common/core/src/ux_device_class_dpump_thread.c +++ b/common/core/src/ux_device_class_dpump_thread.c @@ -37,7 +37,7 @@ VOID _ux_device_class_dpump_thread(ULONG dpump_class); /* FUNCTION RELEASE */ /* */ /* _ux_device_class_dpump_thread PORTABLE C */ -/* 6.0 */ +/* 6.1 */ /* AUTHOR */ /* */ /* Chaoqiong Xiao, Microsoft Corporation */ @@ -70,6 +70,10 @@ VOID _ux_device_class_dpump_thread(ULONG dpump_class); /* DATE NAME DESCRIPTION */ /* */ /* 05-19-2020 Chaoqiong Xiao Initial Version 6.0 */ +/* 09-30-2020 Chaoqiong Xiao Modified comment(s), */ +/* verified memset and memcpy */ +/* cases, */ +/* resulting in version 6.1 */ /* */ /**************************************************************************/ VOID _ux_device_class_dpump_thread(ULONG dpump_class) @@ -141,7 +145,7 @@ ULONG length; /* Copy the buffer to the target in endpoint. */ _ux_utility_memory_copy(endpoint_in -> ux_slave_endpoint_transfer_request.ux_slave_transfer_request_data_pointer, endpoint_out -> ux_slave_endpoint_transfer_request.ux_slave_transfer_request_data_pointer, - length); + length); /* Use case of memcpy is verified. */ /* Now we send the packet back to the host. On the endpoint In. */ transfer_request = &endpoint_in -> ux_slave_endpoint_transfer_request; diff --git a/common/core/src/ux_device_class_dpump_write.c b/common/core/src/ux_device_class_dpump_write.c index 676bf69..4d72b42 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.0 */ +/* 6.1 */ /* AUTHOR */ /* */ /* Chaoqiong Xiao, Microsoft Corporation */ @@ -66,6 +66,10 @@ /* DATE NAME DESCRIPTION */ /* */ /* 05-19-2020 Chaoqiong Xiao Initial Version 6.0 */ +/* 09-30-2020 Chaoqiong Xiao Modified comment(s), */ +/* verified memset and memcpy */ +/* cases, */ +/* resulting in version 6.1 */ /* */ /**************************************************************************/ UINT _ux_device_class_dpump_write(UX_SLAVE_CLASS_DPUMP *dpump, UCHAR *buffer, @@ -138,7 +142,7 @@ UINT status; /* On a out, we copy the buffer to the caller. Not very efficient but it makes the API easier. */ _ux_utility_memory_copy(transfer_request -> ux_slave_transfer_request_data_pointer, - buffer, local_requested_length); + buffer, local_requested_length); /* Use case of memcpy is verified. */ /* Send the request to the device controller. */ status = _ux_device_stack_transfer_request(transfer_request, local_requested_length, local_requested_length); diff --git a/common/core/src/ux_device_stack_alternate_setting_get.c b/common/core/src/ux_device_stack_alternate_setting_get.c index 8d26f59..9e61808 100644 --- a/common/core/src/ux_device_stack_alternate_setting_get.c +++ b/common/core/src/ux_device_stack_alternate_setting_get.c @@ -31,10 +31,10 @@ /**************************************************************************/ /* */ -/* FUNCTION RELEASE */ +/* FUNCTION RELEASE */ /* */ -/* _ux_device_stack_alternate_setting_get PORTABLE C */ -/* 6.0 */ +/* _ux_device_stack_alternate_setting_get PORTABLE C */ +/* 6.1 */ /* AUTHOR */ /* */ /* Chaoqiong Xiao, Microsoft Corporation */ @@ -66,6 +66,10 @@ /* DATE NAME DESCRIPTION */ /* */ /* 05-19-2020 Chaoqiong Xiao Initial Version 6.0 */ +/* 09-30-2020 Chaoqiong Xiao Modified comment(s), */ +/* optimized based on compile */ +/* definitions, */ +/* resulting in version 6.1 */ /* */ /**************************************************************************/ UINT _ux_device_stack_alternate_setting_get(ULONG interface_value) @@ -91,8 +95,12 @@ UINT status; /* Obtain the pointer to the first interface attached. */ interface = device -> ux_slave_device_first_interface; +#if !defined(UX_DEVICE_INITIALIZE_FRAMEWORK_SCAN_DISABLE) || UX_MAX_DEVICE_INTERFACES > 1 /* Start parsing each interface. */ while (interface != UX_NULL) +#else + if (interface != UX_NULL) +#endif { /* Check if this is the interface we have an inquiry for. */ @@ -122,8 +130,10 @@ UINT status; return(status); } +#if !defined(UX_DEVICE_INITIALIZE_FRAMEWORK_SCAN_DISABLE) || UX_MAX_DEVICE_INTERFACES > 1 /* Get the next interface. */ interface = interface -> ux_slave_interface_next_interface; +#endif } } diff --git a/common/core/src/ux_device_stack_alternate_setting_set.c b/common/core/src/ux_device_stack_alternate_setting_set.c index 5e67f76..d48d506 100644 --- a/common/core/src/ux_device_stack_alternate_setting_set.c +++ b/common/core/src/ux_device_stack_alternate_setting_set.c @@ -31,10 +31,10 @@ /**************************************************************************/ /* */ -/* FUNCTION RELEASE */ +/* FUNCTION RELEASE */ /* */ -/* _ux_device_stack_alternate_setting_set PORTABLE C */ -/* 6.0 */ +/* _ux_device_stack_alternate_setting_set PORTABLE C */ +/* 6.1 */ /* AUTHOR */ /* */ /* Chaoqiong Xiao, Microsoft Corporation */ @@ -73,11 +73,19 @@ /* DATE NAME DESCRIPTION */ /* */ /* 05-19-2020 Chaoqiong Xiao Initial Version 6.0 */ +/* 09-30-2020 Chaoqiong Xiao Modified comment(s), */ +/* optimized based on compile */ +/* definitions, verified */ +/* memset and memcpy cases, */ +/* resulting in version 6.1 */ /* */ /**************************************************************************/ UINT _ux_device_stack_alternate_setting_set(ULONG interface_value, ULONG alternate_setting_value) { +UX_SLAVE_DEVICE *device; +UX_SLAVE_INTERFACE *interface; +#if !defined(UX_DEVICE_ALTERNATE_SETTING_SUPPORT_DISABLE) UX_SLAVE_DCD *dcd; UX_SLAVE_TRANSFER *transfer_request; UCHAR *device_framework; @@ -86,36 +94,29 @@ ULONG descriptor_length; UCHAR descriptor_type; UX_CONFIGURATION_DESCRIPTOR configuration_descriptor; UX_INTERFACE_DESCRIPTOR interface_descriptor; -UX_SLAVE_DEVICE *device; UX_SLAVE_ENDPOINT *endpoint; UX_SLAVE_ENDPOINT *next_endpoint; -UX_SLAVE_INTERFACE *interface; UX_SLAVE_ENDPOINT *endpoint_link; ULONG endpoints_pool_number; UX_SLAVE_CLASS_COMMAND class_command; UX_SLAVE_CLASS *class; UINT status; +#endif /* If trace is enabled, insert this event into the trace buffer. */ UX_TRACE_IN_LINE_INSERT(UX_TRACE_DEVICE_STACK_ALTERNATE_SETTING_SET, interface_value, alternate_setting_value, 0, 0, UX_TRACE_DEVICE_STACK_EVENTS, 0, 0) - /* Get the pointer to the DCD. */ - dcd = &_ux_system_slave->ux_system_slave_dcd; - - /* We may have multiple configurations! */ - device_framework = _ux_system_slave -> ux_system_slave_device_framework; - device_framework_length = _ux_system_slave -> ux_system_slave_device_framework_length; - /* Get the pointer to the device. */ device = &_ux_system_slave -> ux_system_slave_device; /* Protocol error must be reported when it's unconfigured */ if (device -> ux_slave_device_state != UX_DEVICE_CONFIGURED) - return UX_FUNCTION_NOT_SUPPORTED; + return(UX_FUNCTION_NOT_SUPPORTED); /* Find the current interface. */ interface = device -> ux_slave_device_first_interface; +#if !defined(UX_DEVICE_INITIALIZE_FRAMEWORK_SCAN_DISABLE) || UX_MAX_DEVICE_INTERFACES > 1 /* Scan all interfaces if any. */ while (interface != UX_NULL) { @@ -125,6 +126,10 @@ UINT status; else interface = interface -> ux_slave_interface_next_interface; } +#else + if (interface -> ux_slave_interface_descriptor.bInterfaceNumber != interface_value) + interface = UX_NULL; +#endif /* We must have found the interface pointer for the interface value requested by the caller. */ @@ -139,12 +144,30 @@ UINT status; return(UX_INTERFACE_HANDLE_UNKNOWN); } - + /* If the host is requesting a change of alternate setting to the current one, we do not need to do any work. */ if (interface -> ux_slave_interface_descriptor.bAlternateSetting == alternate_setting_value) return(UX_SUCCESS); - + +#if defined(UX_DEVICE_ALTERNATE_SETTING_SUPPORT_DISABLE) + + /* If alternate setting is disabled, do error trap. */ + _ux_system_error_handler(UX_SYSTEM_LEVEL_THREAD, UX_SYSTEM_CONTEXT_CLASS, UX_FUNCTION_NOT_SUPPORTED); + + /* If trace is enabled, insert this event into the trace buffer. */ + UX_TRACE_IN_LINE_INSERT(UX_TRACE_ERROR, UX_FUNCTION_NOT_SUPPORTED, interface, 0, 0, UX_TRACE_ERRORS, 0, 0) + + return(UX_FUNCTION_NOT_SUPPORTED); +#else + + /* Get the pointer to the DCD. */ + dcd = &_ux_system_slave->ux_system_slave_dcd; + + /* We may have multiple configurations! */ + device_framework = _ux_system_slave -> ux_system_slave_device_framework; + device_framework_length = _ux_system_slave -> ux_system_slave_device_framework_length; + /* Parse the device framework and locate a configuration descriptor. */ while (device_framework_length != 0) { @@ -352,7 +375,7 @@ UINT status; } /* The interface descriptor in the current class must be changed to the new alternate setting. */ - _ux_utility_memory_copy(&interface -> ux_slave_interface_descriptor, &interface_descriptor, sizeof(UX_INTERFACE_DESCRIPTOR)); + _ux_utility_memory_copy(&interface -> ux_slave_interface_descriptor, &interface_descriptor, sizeof(UX_INTERFACE_DESCRIPTOR)); /* Use case of memcpy is verified. */ /* Get the class for the interface. */ class = _ux_system_slave -> ux_system_slave_interface_class_array[interface -> ux_slave_interface_descriptor.bInterfaceNumber]; @@ -404,5 +427,6 @@ UINT status; /* Return error completion. */ return(UX_ERROR); +#endif } diff --git a/common/core/src/ux_device_stack_class_register.c b/common/core/src/ux_device_stack_class_register.c index b65b725..9895699 100644 --- a/common/core/src/ux_device_stack_class_register.c +++ b/common/core/src/ux_device_stack_class_register.c @@ -31,10 +31,10 @@ /**************************************************************************/ /* */ -/* FUNCTION RELEASE */ +/* FUNCTION RELEASE */ /* */ -/* _ux_device_stack_class_register PORTABLE C */ -/* 6.0 */ +/* _ux_device_stack_class_register PORTABLE C */ +/* 6.1 */ /* AUTHOR */ /* */ /* Chaoqiong Xiao, Microsoft Corporation */ @@ -74,6 +74,11 @@ /* DATE NAME DESCRIPTION */ /* */ /* 05-19-2020 Chaoqiong Xiao Initial Version 6.0 */ +/* 09-30-2020 Chaoqiong Xiao Modified comment(s), */ +/* optimized based on compile */ +/* definitions, verified */ +/* memset and memcpy cases, */ +/* resulting in version 6.1 */ /* */ /**************************************************************************/ UINT _ux_device_stack_class_register(UCHAR *class_name, @@ -83,11 +88,13 @@ UINT _ux_device_stack_class_register(UCHAR *class_name, VOID *parameter) { -UX_SLAVE_CLASS *class; -ULONG class_index; +UX_SLAVE_CLASS *class_inst; UINT status; UX_SLAVE_CLASS_COMMAND command; UINT class_name_length = 0; +#if UX_MAX_SLAVE_CLASS_DRIVER > 1 +ULONG class_index; +#endif /* Get the length of the class name (exclude null-terminator). */ @@ -98,34 +105,42 @@ UINT class_name_length = 0; /* If trace is enabled, insert this event into the trace buffer. */ UX_TRACE_IN_LINE_INSERT(UX_TRACE_DEVICE_STACK_CLASS_REGISTER, class_name, interface_number, parameter, 0, UX_TRACE_DEVICE_STACK_EVENTS, 0, 0) + /* Get first class. */ + class_inst = _ux_system_slave -> ux_system_slave_class_array; + +#if UX_MAX_SLAVE_CLASS_DRIVER > 1 /* We need to parse the class table to find an empty spot. */ - class = _ux_system_slave -> ux_system_slave_class_array; for (class_index = 0; class_index < _ux_system_slave -> ux_system_slave_max_class; class_index++) { +#endif /* Check if this class is already used. */ - if (class -> ux_slave_class_status == UX_UNUSED) + if (class_inst -> ux_slave_class_status == UX_UNUSED) { +#if defined(UX_NAME_REFERENCED_BY_POINTER) + class_inst -> ux_slave_class_name = (const UCHAR *)class_name; +#else /* We have found a free container for the class. Copy the name (with null-terminator). */ - _ux_utility_memory_copy(class -> ux_slave_class_name, class_name, class_name_length + 1); + _ux_utility_memory_copy(class_inst -> ux_slave_class_name, class_name, class_name_length + 1); /* Use case of memcpy is verified. */ +#endif /* Memorize the entry function of this class. */ - class -> ux_slave_class_entry_function = class_entry_function; + class_inst -> ux_slave_class_entry_function = class_entry_function; /* Memorize the pointer to the application parameter. */ - class -> ux_slave_class_interface_parameter = parameter; + class_inst -> ux_slave_class_interface_parameter = parameter; /* Memorize the configuration number on which this instance will be called. */ - class -> ux_slave_class_configuration_number = configuration_number; + class_inst -> ux_slave_class_configuration_number = configuration_number; /* Memorize the interface number on which this instance will be called. */ - class -> ux_slave_class_interface_number = interface_number; + class_inst -> ux_slave_class_interface_number = interface_number; /* Build all the fields of the Class Command to initialize the class. */ command.ux_slave_class_command_request = UX_SLAVE_CLASS_COMMAND_INITIALIZE; command.ux_slave_class_command_parameter = parameter; - command.ux_slave_class_command_class_ptr = class; + command.ux_slave_class_command_class_ptr = class_inst; /* Call the class initialization routine. */ status = class_entry_function(&command); @@ -135,15 +150,17 @@ UINT class_name_length = 0; return(status); /* Make this class used now. */ - class -> ux_slave_class_status = UX_USED; + class_inst -> ux_slave_class_status = UX_USED; /* Return successful completion. */ return(UX_SUCCESS); } +#if UX_MAX_SLAVE_CLASS_DRIVER > 1 /* Move to the next class. */ - class++; + class_inst ++; } +#endif /* No more entries in the class table. */ return(UX_MEMORY_INSUFFICIENT); diff --git a/common/core/src/ux_device_stack_class_unregister.c b/common/core/src/ux_device_stack_class_unregister.c index 9fa2d1c..8e89d9c 100644 --- a/common/core/src/ux_device_stack_class_unregister.c +++ b/common/core/src/ux_device_stack_class_unregister.c @@ -31,10 +31,10 @@ /**************************************************************************/ /* */ -/* FUNCTION RELEASE */ +/* FUNCTION RELEASE */ /* */ -/* _ux_device_stack_class_unregister PORTABLE C */ -/* 6.0 */ +/* _ux_device_stack_class_unregister PORTABLE C */ +/* 6.1 */ /* AUTHOR */ /* */ /* Chaoqiong Xiao, Microsoft Corporation */ @@ -71,43 +71,56 @@ /* DATE NAME DESCRIPTION */ /* */ /* 05-19-2020 Chaoqiong Xiao Initial Version 6.0 */ +/* 09-30-2020 Chaoqiong Xiao Modified comment(s), */ +/* optimized based on compile */ +/* definitions, */ +/* resulting in version 6.1 */ /* */ /**************************************************************************/ UINT _ux_device_stack_class_unregister(UCHAR *class_name, UINT (*class_entry_function)(struct UX_SLAVE_CLASS_COMMAND_STRUCT *)) { -UX_SLAVE_CLASS *class; -ULONG class_index; +UX_SLAVE_CLASS *class_inst; UINT status; UX_SLAVE_CLASS_COMMAND command; +#if !defined(UX_NAME_REFERENCED_BY_POINTER) UINT class_name_length = 0; +#endif +#if UX_MAX_SLAVE_CLASS_DRIVER > 1 +ULONG class_index; +#endif /* If trace is enabled, insert this event into the trace buffer. */ UX_TRACE_IN_LINE_INSERT(UX_TRACE_DEVICE_STACK_CLASS_UNREGISTER, class_name, 0, 0, 0, UX_TRACE_DEVICE_STACK_EVENTS, 0, 0) +#if !defined(UX_NAME_REFERENCED_BY_POINTER) /* Get the length of the class name (exclude null-terminator). */ status = _ux_utility_string_length_check(class_name, &class_name_length, UX_MAX_CLASS_NAME_LENGTH); if (status) return(status); +#endif + + class_inst = _ux_system_slave -> ux_system_slave_class_array; +#if UX_MAX_SLAVE_CLASS_DRIVER > 1 /* We need to parse the class table to find the right class. */ - class = _ux_system_slave -> ux_system_slave_class_array; for (class_index = 0; class_index < _ux_system_slave -> ux_system_slave_max_class; class_index++) { +#endif /* Check if this class is the right one. */ - if (class -> ux_slave_class_status == UX_USED) + if (class_inst -> ux_slave_class_status == UX_USED) { /* We have found a used container with a class. Compare the name (include null-terminator). */ - if (_ux_utility_memory_compare(class -> ux_slave_class_name, class_name, class_name_length + 1) == UX_SUCCESS) + if (ux_utility_name_match(class_inst -> ux_slave_class_name, class_name, class_name_length + 1)) { /* Build all the fields of the Class Command to uninitialize the class. */ command.ux_slave_class_command_request = UX_SLAVE_CLASS_COMMAND_UNINITIALIZE; - command.ux_slave_class_command_class_ptr = class; + command.ux_slave_class_command_class_ptr = class_inst; /* Call the class uninitialization routine. */ status = class_entry_function(&command); @@ -117,19 +130,21 @@ UINT class_name_length = 0; return(status); /* Make this class unused now. */ - class -> ux_slave_class_status = UX_UNUSED; + class_inst -> ux_slave_class_status = UX_UNUSED; /* Erase the instance of the class. */ - class -> ux_slave_class_instance = UX_NULL; + class_inst -> ux_slave_class_instance = UX_NULL; /* Return successful completion. */ return(UX_SUCCESS); } } +#if UX_MAX_SLAVE_CLASS_DRIVER > 1 /* Move to the next class. */ - class++; + class_inst ++; } +#endif /* No class match. */ return(UX_NO_CLASS_MATCH); diff --git a/common/core/src/ux_device_stack_clear_feature.c b/common/core/src/ux_device_stack_clear_feature.c index 02356d0..5d078b0 100644 --- a/common/core/src/ux_device_stack_clear_feature.c +++ b/common/core/src/ux_device_stack_clear_feature.c @@ -34,7 +34,7 @@ /* FUNCTION RELEASE */ /* */ /* _ux_device_stack_clear_feature PORTABLE C */ -/* 6.0 */ +/* 6.1 */ /* AUTHOR */ /* */ /* Chaoqiong Xiao, Microsoft Corporation */ @@ -67,6 +67,10 @@ /* DATE NAME DESCRIPTION */ /* */ /* 05-19-2020 Chaoqiong Xiao Initial Version 6.0 */ +/* 09-30-2020 Chaoqiong Xiao Modified comment(s), */ +/* optimized based on compile */ +/* definitions, */ +/* resulting in version 6.1 */ /* */ /**************************************************************************/ UINT _ux_device_stack_clear_feature(ULONG request_type, ULONG request_value, ULONG request_index) @@ -125,8 +129,10 @@ UX_SLAVE_ENDPOINT *endpoint_target; We need to find the endpoint through the interface(s). */ interface = device -> ux_slave_device_first_interface; +#if !defined(UX_DEVICE_INITIALIZE_FRAMEWORK_SCAN_DISABLE) || UX_MAX_DEVICE_INTERFACES > 1 while (interface != UX_NULL) { +#endif /* Get the first endpoint for this interface. */ endpoint_target = interface -> ux_slave_interface_first_endpoint; @@ -153,9 +159,12 @@ UX_SLAVE_ENDPOINT *endpoint_target; endpoint_target = endpoint_target -> ux_slave_endpoint_next_endpoint; } +#if !defined(UX_DEVICE_INITIALIZE_FRAMEWORK_SCAN_DISABLE) || UX_MAX_DEVICE_INTERFACES > 1 /* Next interface. */ interface = interface -> ux_slave_interface_next_interface; } +#endif + /* Intentional fallthrough and go into the default case. */ /* fall through */ diff --git a/common/core/src/ux_device_stack_configuration_get.c b/common/core/src/ux_device_stack_configuration_get.c index f069038..569db9a 100644 --- a/common/core/src/ux_device_stack_configuration_get.c +++ b/common/core/src/ux_device_stack_configuration_get.c @@ -34,7 +34,7 @@ /* FUNCTION RELEASE */ /* */ /* _ux_device_stack_configuration_get PORTABLE C */ -/* 6.0 */ +/* 6.1 */ /* AUTHOR */ /* */ /* Chaoqiong Xiao, Microsoft Corporation */ @@ -65,6 +65,8 @@ /* 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 */ /* */ /**************************************************************************/ UINT _ux_device_stack_configuration_get(VOID) diff --git a/common/core/src/ux_device_stack_configuration_set.c b/common/core/src/ux_device_stack_configuration_set.c index 6c55218..7723c75 100644 --- a/common/core/src/ux_device_stack_configuration_set.c +++ b/common/core/src/ux_device_stack_configuration_set.c @@ -31,10 +31,10 @@ /**************************************************************************/ /* */ -/* FUNCTION RELEASE */ +/* FUNCTION RELEASE */ /* */ -/* _ux_device_stack_configuration_set PORTABLE C */ -/* 6.0 */ +/* _ux_device_stack_configuration_set PORTABLE C */ +/* 6.1 */ /* AUTHOR */ /* */ /* Chaoqiong Xiao, Microsoft Corporation */ @@ -72,6 +72,10 @@ /* DATE NAME DESCRIPTION */ /* */ /* 05-19-2020 Chaoqiong Xiao Initial Version 6.0 */ +/* 09-30-2020 Chaoqiong Xiao Modified comment(s), */ +/* optimized based on compile */ +/* definitions, */ +/* resulting in version 6.1 */ /* */ /**************************************************************************/ UINT _ux_device_stack_configuration_set(ULONG configuration_value) @@ -85,15 +89,19 @@ UCHAR descriptor_type; UX_CONFIGURATION_DESCRIPTOR configuration_descriptor = { 0 }; UX_INTERFACE_DESCRIPTOR interface_descriptor; UX_SLAVE_INTERFACE *interface; +#if !defined(UX_DEVICE_INITIALIZE_FRAMEWORK_SCAN_DISABLE) || UX_MAX_DEVICE_INTERFACES > 1 UX_SLAVE_INTERFACE *next_interface; -UX_SLAVE_CLASS *class; +#endif +UX_SLAVE_CLASS *class_inst; UX_SLAVE_CLASS *current_class = UX_NULL; UX_SLAVE_CLASS_COMMAND class_command; UX_SLAVE_DEVICE *device; ULONG iad_flag; ULONG iad_first_interface = 0; ULONG iad_number_interfaces = 0; +#if UX_MAX_SLAVE_CLASS_DRIVER > 1 ULONG class_index; +#endif /* If trace is enabled, insert this event into the trace buffer. */ @@ -159,35 +167,41 @@ ULONG class_index; /* Get the pointer to the first interface. */ interface = device -> ux_slave_device_first_interface; +#if !defined(UX_DEVICE_INITIALIZE_FRAMEWORK_SCAN_DISABLE) || UX_MAX_DEVICE_INTERFACES > 1 /* Deactivate all the interfaces if any. */ while (interface != UX_NULL) { - +#endif /* Build all the fields of the Class Command. */ class_command.ux_slave_class_command_request = UX_SLAVE_CLASS_COMMAND_DEACTIVATE; class_command.ux_slave_class_command_interface = (VOID *) interface; /* Get the pointer to the class container of this interface. */ - class = interface -> ux_slave_interface_class; + class_inst = interface -> ux_slave_interface_class; /* Store the class container. */ - class_command.ux_slave_class_command_class_ptr = class; + class_command.ux_slave_class_command_class_ptr = class_inst; /* If there is a class container for this instance, deactivate it. */ - if (class != UX_NULL) + if (class_inst != UX_NULL) /* Call the class with the DEACTIVATE signal. */ - class -> ux_slave_class_entry_function(&class_command); + class_inst -> ux_slave_class_entry_function(&class_command); +#if !defined(UX_DEVICE_INITIALIZE_FRAMEWORK_SCAN_DISABLE) || UX_MAX_DEVICE_INTERFACES > 1 /* Get the next interface. */ next_interface = interface -> ux_slave_interface_next_interface; +#endif /* Remove the interface and all endpoints associated with it. */ _ux_device_stack_interface_delete(interface); +#if !defined(UX_DEVICE_INITIALIZE_FRAMEWORK_SCAN_DISABLE) || UX_MAX_DEVICE_INTERFACES > 1 /* Now we refresh the interface pointer. */ interface = next_interface; } +#endif + } /* No configuration is selected. */ @@ -273,35 +287,41 @@ ULONG class_index; { /* First interface. Scan the list of classes to find a match. */ - class = _ux_system_slave -> ux_system_slave_class_array; + class_inst = _ux_system_slave -> ux_system_slave_class_array; +#if UX_MAX_SLAVE_CLASS_DRIVER > 1 /* Parse all the class drivers. */ for (class_index = 0; class_index < _ux_system_slave -> ux_system_slave_max_class; class_index++) { +#endif /* Check if this class driver is used. */ - if (class -> ux_slave_class_status == UX_USED) + if (class_inst -> ux_slave_class_status == UX_USED) { /* Check if this is the same interface for the same configuration. */ - if ((interface_descriptor.bInterfaceNumber == class -> ux_slave_class_interface_number) && - (configuration_value == class -> ux_slave_class_configuration_number)) + if ((interface_descriptor.bInterfaceNumber == class_inst -> ux_slave_class_interface_number) && + (configuration_value == class_inst -> ux_slave_class_configuration_number)) { /* Memorize the class in the class/interface array. */ - _ux_system_slave -> ux_system_slave_interface_class_array[interface_descriptor.bInterfaceNumber] = class; + _ux_system_slave -> ux_system_slave_interface_class_array[interface_descriptor.bInterfaceNumber] = class_inst; /* And again as the current class. */ - current_class = class; + current_class = class_inst; +#if UX_MAX_SLAVE_CLASS_DRIVER > 1 /* We are done here. */ break; +#endif } } +#if UX_MAX_SLAVE_CLASS_DRIVER > 1 /* Move to the next registered class. */ - class++; + class_inst ++; } +#endif } else @@ -322,32 +342,38 @@ ULONG class_index; { /* First interface. Scan the list of classes to find a match. */ - class = _ux_system_slave -> ux_system_slave_class_array; + class_inst = _ux_system_slave -> ux_system_slave_class_array; +#if UX_MAX_SLAVE_CLASS_DRIVER > 1 /* Parse all the class drivers. */ for (class_index = 0; class_index < _ux_system_slave -> ux_system_slave_max_class; class_index++) { +#endif /* Check if this class driver is used. */ - if (class -> ux_slave_class_status == UX_USED) + if (class_inst -> ux_slave_class_status == UX_USED) { /* Check if this is the same interface for the same configuration. */ - if ((interface_descriptor.bInterfaceNumber == class -> ux_slave_class_interface_number) && - (configuration_value == class -> ux_slave_class_configuration_number)) + if ((interface_descriptor.bInterfaceNumber == class_inst -> ux_slave_class_interface_number) && + (configuration_value == class_inst -> ux_slave_class_configuration_number)) { /* Memorize the class in the class/interface array. */ - _ux_system_slave -> ux_system_slave_interface_class_array[interface_descriptor.bInterfaceNumber] = class; + _ux_system_slave -> ux_system_slave_interface_class_array[interface_descriptor.bInterfaceNumber] = class_inst; +#if UX_MAX_SLAVE_CLASS_DRIVER > 1 /* We are done here. */ break; +#endif } } +#if UX_MAX_SLAVE_CLASS_DRIVER > 1 /* Move to the next registered class. */ - class++; + class_inst ++; } +#endif } /* Set the interface. */ 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 3fbf671..3386dfd 100644 --- a/common/core/src/ux_device_stack_control_request_process.c +++ b/common/core/src/ux_device_stack_control_request_process.c @@ -30,10 +30,10 @@ /**************************************************************************/ /* */ -/* FUNCTION RELEASE */ +/* FUNCTION RELEASE */ /* */ -/* _ux_device_stack_control_request_process PORTABLE C */ -/* 6.0 */ +/* _ux_device_stack_control_request_process PORTABLE C */ +/* 6.1 */ /* AUTHOR */ /* */ /* Chaoqiong Xiao, Microsoft Corporation */ @@ -78,6 +78,8 @@ /* 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 */ /* */ /**************************************************************************/ 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 a1906fb..a165810 100644 --- a/common/core/src/ux_device_stack_descriptor_send.c +++ b/common/core/src/ux_device_stack_descriptor_send.c @@ -12,8 +12,8 @@ /**************************************************************************/ /**************************************************************************/ -/** */ -/** USBX Component */ +/** */ +/** USBX Component */ /** */ /** Device Stack */ /** */ @@ -29,12 +29,18 @@ #include "ux_device_stack.h" +#if (UX_SLAVE_REQUEST_CONTROL_MAX_LENGTH < UX_DEVICE_DESCRIPTOR_LENGTH) || \ + (UX_SLAVE_REQUEST_CONTROL_MAX_LENGTH < UX_DEVICE_QUALIFIER_DESCRIPTOR_LENGTH) || \ + (UX_SLAVE_REQUEST_CONTROL_MAX_LENGTH < UX_OTG_DESCRIPTOR_LENGTH) +#error UX_SLAVE_REQUEST_CONTROL_MAX_LENGTH too small, please check +#endif + /**************************************************************************/ /* */ -/* FUNCTION RELEASE */ +/* FUNCTION RELEASE */ /* */ -/* _ux_device_stack_descriptor_send PORTABLE C */ -/* 6.0 */ +/* _ux_device_stack_descriptor_send PORTABLE C */ +/* 6.1 */ /* AUTHOR */ /* */ /* Chaoqiong Xiao, Microsoft Corporation */ @@ -51,26 +57,31 @@ /* */ /* OUTPUT */ /* */ -/* Completion Status */ +/* Completion Status */ +/* */ +/* CALLS */ /* */ -/* CALLS */ -/* */ -/* (ux_slave_dcd_function) DCD dispatch function */ +/* (ux_slave_dcd_function) DCD dispatch function */ /* _ux_device_stack_transfer_request Process transfer request */ -/* _ux_utility_descriptor_parse Parse descriptor */ -/* _ux_utility_memory_copy Memory copy */ -/* _ux_utility_short_get Get short value */ -/* */ -/* CALLED BY */ -/* */ -/* Application */ +/* _ux_utility_descriptor_parse Parse descriptor */ +/* _ux_utility_memory_copy Memory copy */ +/* _ux_utility_short_get Get short value */ +/* */ +/* CALLED BY */ +/* */ +/* Application */ /* Device Stack */ -/* */ -/* 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 descriptor search */ +/* logic, verified memset and */ +/* memcpy cases, */ +/* resulting in version 6.1 */ /* */ /**************************************************************************/ UINT _ux_device_stack_descriptor_send(ULONG descriptor_type, ULONG request_index, ULONG host_length) @@ -103,7 +114,7 @@ ULONG string_length; /* Get the pointer to the device. */ device = &_ux_system_slave -> ux_system_slave_device; - + /* Get the control endpoint associated with the device. */ endpoint = &device -> ux_slave_device_control_endpoint; @@ -115,41 +126,42 @@ ULONG string_length; /* Isolate the descriptor index. */ descriptor_index = descriptor_type & 0xff; - + /* Reset the parsed index. */ parsed_descriptor_index = 0; - + /* Shift the descriptor type in the low byte field. */ descriptor_type = (UCHAR) ((descriptor_type >> 8) & 0xff); + /* Default descriptor length is host length. */ + length = host_length; + /* What type of descriptor do we need to return? */ switch (descriptor_type) { case UX_DEVICE_DESCRIPTOR_ITEM: - /* Setup the length appropriately. */ + /* Setup device descriptor length. */ if (host_length > UX_DEVICE_DESCRIPTOR_LENGTH) length = UX_DEVICE_DESCRIPTOR_LENGTH; - else - length = host_length; - - /* Copy the device descriptor into the transfer request memory. */ - _ux_utility_memory_copy(transfer_request -> ux_slave_transfer_request_data_pointer, - _ux_system_slave -> ux_system_slave_device_framework, length); - - /* Perform the data transfer. */ - status = _ux_device_stack_transfer_request(transfer_request, length, host_length); - break; + /* Fall through. */ case UX_DEVICE_QUALIFIER_DESCRIPTOR_ITEM: - /* Setup the length appropriately. */ - if (host_length > UX_DEVICE_QUALIFIER_DESCRIPTOR_LENGTH) + /* Setup qualifier descriptor length. */ + if (descriptor_type == UX_DEVICE_QUALIFIER_DESCRIPTOR_ITEM && + host_length > UX_DEVICE_QUALIFIER_DESCRIPTOR_LENGTH) length = UX_DEVICE_QUALIFIER_DESCRIPTOR_LENGTH; - else - length = host_length; - + + /* Fall through. */ + case UX_OTG_DESCRIPTOR_ITEM: + + /* Setup OTG descriptor length. */ + if (descriptor_type == UX_OTG_DESCRIPTOR_ITEM && + host_length > UX_OTG_DESCRIPTOR_LENGTH) + length = UX_OTG_DESCRIPTOR_LENGTH; + /* We may or may not have a device qualifier descriptor. */ device_framework = _ux_system_slave -> ux_system_slave_device_framework; device_framework_length = _ux_system_slave -> ux_system_slave_device_framework_length; @@ -158,20 +170,17 @@ ULONG string_length; /* Parse the device framework and locate a device qualifier descriptor. */ while (device_framework < device_framework_end) { - - /* Get the type of the current descriptor. */ - descriptor_type = *(device_framework + 1); - /* And its length. */ + /* Get descriptor length. */ descriptor_length = (ULONG) *device_framework; - - /* Check if this is a device qualifier descriptor. */ - if (descriptor_type == UX_DEVICE_QUALIFIER_DESCRIPTOR_ITEM) + + /* Check if this is a descriptor expected. */ + if (*(device_framework + 1) == descriptor_type) { - - /* Copy the device qualifier descriptor into the transfer request memory. */ - _ux_utility_memory_copy(transfer_request -> ux_slave_transfer_request_data_pointer, - device_framework, length); + + /* Copy the device descriptor into the transfer request memory. */ + _ux_utility_memory_copy(transfer_request -> ux_slave_transfer_request_data_pointer, + device_framework, length); /* Use case of memcpy is verified. */ /* Perform the data transfer. */ status = _ux_device_stack_transfer_request(transfer_request, length, host_length); @@ -184,77 +193,44 @@ ULONG string_length; /* Point to the next descriptor. */ device_framework += descriptor_length; } - break; - case UX_OTG_DESCRIPTOR_ITEM: - - /* Setup the length appropriately. */ - if (host_length > UX_OTG_DESCRIPTOR_LENGTH) - length = UX_OTG_DESCRIPTOR_LENGTH; - else - length = host_length; - - /* We may or may not have a OTG descriptor. */ - device_framework = _ux_system_slave -> ux_system_slave_device_framework; - device_framework_length = _ux_system_slave -> ux_system_slave_device_framework_length; - device_framework_end = device_framework + device_framework_length; + case UX_OTHER_SPEED_DESCRIPTOR_ITEM: + /* Fall through. */ + case UX_CONFIGURATION_DESCRIPTOR_ITEM: - /* Parse the device framework and locate a OTG descriptor. */ - while (device_framework < device_framework_end) + if (descriptor_type == UX_OTHER_SPEED_DESCRIPTOR_ITEM) { - - /* Get the type of the current descriptor. */ - descriptor_type = *(device_framework + 1); - - /* And its length. */ - descriptor_length = (ULONG) *device_framework; - - /* Check if this is a OTG descriptor. */ - if (descriptor_type == UX_OTG_DESCRIPTOR_ITEM) - { - - /* Copy the device OTG descriptor into the transfer request memory. */ - _ux_utility_memory_copy(transfer_request -> ux_slave_transfer_request_data_pointer, - device_framework, length); - - /* Perform the data transfer. */ - status = _ux_device_stack_transfer_request(transfer_request, length, host_length); - break; - } - /* Adjust what is left of the device framework. */ - device_framework_length -= descriptor_length; - - /* Point to the next descriptor. */ - device_framework += descriptor_length; + /* This request is used by the host to find out the capability of this device + if it was running at full speed. The behavior is the same as in a GET_CONFIGURATIOn descriptor + but we do not use the current device framework but rather the full speed framework. */ + device_framework = _ux_system_slave -> ux_system_slave_device_framework_full_speed; + device_framework_length = _ux_system_slave -> ux_system_slave_device_framework_length_full_speed; + device_framework_end = device_framework + device_framework_length; } - break; - - case UX_OTHER_SPEED_DESCRIPTOR_ITEM: + else + { - /* This request is used by the host to find out the capability of this device - if it was running at full speed. The behavior is the same as in a GET_CONFIGURATIOn descriptor - but we do not use the current device framework but rather the full speed framework. */ - device_framework = _ux_system_slave -> ux_system_slave_device_framework_full_speed; - device_framework_length = _ux_system_slave -> ux_system_slave_device_framework_length_full_speed; - device_framework_end = device_framework + device_framework_length; + /* We may have multiple configurations !, the index will tell us what + configuration descriptor we need to return. */ + device_framework = _ux_system_slave -> ux_system_slave_device_framework; + device_framework_length = _ux_system_slave -> ux_system_slave_device_framework_length; + device_framework_end = device_framework + device_framework_length; + } /* Parse the device framework and locate a configuration descriptor. */ while (device_framework < device_framework_end) { - /* Get the type of the current descriptor. */ - descriptor_type = *(device_framework + 1); - - /* And its length. */ + /* Get descriptor length. */ descriptor_length = (ULONG) *device_framework; - + /* Check if this is a configuration descriptor. We are cheating here. Instead of creating a OTHER SPEED descriptor, we simply scan the configuration descriptor for the Full Speed framework and return this configuration after we manually changed the configuration descriptor item into a Other Speed Descriptor. */ - if (descriptor_type == UX_CONFIGURATION_DESCRIPTOR_ITEM) + if (*(device_framework + 1) == UX_CONFIGURATION_DESCRIPTOR_ITEM) { /* Check the index. It must be the same as the one requested. */ @@ -274,8 +250,8 @@ ULONG string_length; and do not return more than what is allowed. */ if (configuration_descriptor_length < host_length) length = configuration_descriptor_length; - else - length = host_length; + else + length = host_length; /* Check buffer length, since total descriptors length may exceed buffer... */ if (length > UX_SLAVE_REQUEST_CONTROL_MAX_LENGTH) @@ -292,92 +268,12 @@ ULONG string_length; } /* Copy the device descriptor into the transfer request memory. */ - _ux_utility_memory_copy(transfer_request -> ux_slave_transfer_request_data_pointer, - device_framework, length); + _ux_utility_memory_copy(transfer_request -> ux_slave_transfer_request_data_pointer, + device_framework, length); /* Use case of memcpy is verified. */ - /* Now we need to hack the found descriptor because this request expect a OTHER_SPEED + /* Now we need to hack the found descriptor because this request expect a OTHER_SPEED descriptor instead of the regular CONFIGURATION descriptor. */ - *(transfer_request -> ux_slave_transfer_request_data_pointer + 1) = UX_OTHER_SPEED_DESCRIPTOR_ITEM; - - /* We can return the configuration descriptor. */ - status = _ux_device_stack_transfer_request(transfer_request, length, host_length); - break; - } - else - { - - /* There may be more configuration descriptors in this framework. */ - parsed_descriptor_index++; - } - } - - /* Adjust what is left of the device framework. */ - device_framework_length -= descriptor_length; - - /* Point to the next descriptor. */ - device_framework += descriptor_length; - } - break; - - case UX_CONFIGURATION_DESCRIPTOR_ITEM: - - /* We may have multiple configurations !, the index will tell us what - configuration descriptor we need to return. */ - device_framework = _ux_system_slave -> ux_system_slave_device_framework; - device_framework_length = _ux_system_slave -> ux_system_slave_device_framework_length; - device_framework_end = device_framework + device_framework_length; - - /* Parse the device framework and locate a configuration descriptor. */ - while (device_framework < device_framework_end) - { - - /* Get the type of the current descriptor. */ - descriptor_type = *(device_framework + 1); - - /* And its length. */ - descriptor_length = (ULONG) *device_framework; - - /* Check if this is a configuration descriptor. */ - if (descriptor_type == UX_CONFIGURATION_DESCRIPTOR_ITEM) - { - - /* Check the index. It must be the same as the one requested. */ - if (parsed_descriptor_index == descriptor_index) - { - - /* Parse the configuration descriptor. */ - _ux_utility_descriptor_parse(device_framework, - _ux_system_configuration_descriptor_structure, - UX_CONFIGURATION_DESCRIPTOR_ENTRIES, - (UCHAR *) &configuration_descriptor); - - /* Get the length of entire configuration descriptor. */ - configuration_descriptor_length = configuration_descriptor.wTotalLength; - - /* Ensure the host does not demand a length beyond our descriptor (Windows does that) - and do not return more than what is allowed. */ - if (configuration_descriptor_length < host_length) - length = configuration_descriptor_length; - else - length = host_length; - - /* Check buffer length, since total descriptors length may exceed buffer... */ - if (length > UX_SLAVE_REQUEST_CONTROL_MAX_LENGTH) - { - /* Error trap. */ - _ux_system_error_handler(UX_SYSTEM_LEVEL_THREAD, UX_SYSTEM_CONTEXT_DEVICE_STACK, UX_MEMORY_INSUFFICIENT); - - /* If trace is enabled, insert this event into the trace buffer. */ - UX_TRACE_IN_LINE_INSERT(UX_TRACE_ERROR, UX_MEMORY_INSUFFICIENT, device, 0, 0, UX_TRACE_ERRORS, 0, 0) - - /* Stall the endpoint. */ - status = dcd -> ux_slave_dcd_function(dcd, UX_DCD_STALL_ENDPOINT, endpoint); - break; - } - - /* Copy the device descriptor into the transfer request memory. */ - _ux_utility_memory_copy(transfer_request -> ux_slave_transfer_request_data_pointer, - device_framework, length); + *(transfer_request -> ux_slave_transfer_request_data_pointer + 1) = (UCHAR)descriptor_type; /* We can return the configuration descriptor. */ status = _ux_device_stack_transfer_request(transfer_request, length, host_length); @@ -401,7 +297,7 @@ ULONG string_length; case UX_STRING_DESCRIPTOR_ITEM: - /* We need to filter for the index 0 which is the language ID string. */ + /* We need to filter for the index 0 which is the language ID string. */ if (descriptor_index == 0) { @@ -431,13 +327,13 @@ ULONG string_length; /* Store the language ID into the buffer. */ _ux_utility_memory_copy(string_memory+2, _ux_system_slave -> ux_system_slave_language_id_framework, - _ux_system_slave -> ux_system_slave_language_id_framework_length); + _ux_system_slave -> ux_system_slave_language_id_framework_length); /* Use case of memcpy is verified. */ /* Filter the length asked/required. */ if (host_length > _ux_system_slave -> ux_system_slave_language_id_framework_length + 2) length = _ux_system_slave -> ux_system_slave_language_id_framework_length + 2; else - length = host_length; + length = host_length; /* We can return the string language ID descriptor. */ status = _ux_device_stack_transfer_request(transfer_request, length, host_length); @@ -449,16 +345,16 @@ ULONG string_length; and length. */ string_framework = _ux_system_slave -> ux_system_slave_string_framework; string_framework_length = _ux_system_slave -> ux_system_slave_string_framework_length; - - /* We search through the string framework until we find the right index. + + /* We search through the string framework until we find the right index. The index is in the lower byte of the descriptor type. */ while (string_framework_length != 0) { - + /* Ensure we have the correct language page. */ if (_ux_utility_short_get(string_framework) == request_index) { - + /* Check the index. */ if (*(string_framework + 2) == descriptor_index) { @@ -480,7 +376,7 @@ ULONG string_length; /* We have a request to send back a string. Use the transfer request buffer. */ string_memory = transfer_request -> ux_slave_transfer_request_data_pointer; - + /* Store the length in the string buffer. The length of the string descriptor is stored in the third byte, hence the ' + 3'. The encoding must be in 16-bit @@ -491,27 +387,27 @@ ULONG string_length; /* Store the Descriptor type. */ *(string_memory + 1) = UX_STRING_DESCRIPTOR_ITEM; - + /* Create the Unicode string. */ for (string_length = 0; string_length < *(string_framework + 3) ; string_length ++) { - + /* Insert a Unicode byte. */ *(string_memory + 2 + (string_length * 2)) = *(string_framework + 4 + string_length); /* Insert a zero after the Unicode byte. */ *(string_memory + 2 + (string_length * 2) + 1) = 0; - } + } /* Filter the length asked/required. */ if (host_length > (UINT)((*(string_framework + 3)*2) + 2)) length = (ULONG)((*(string_framework + 3)*2) + 2); else - length = host_length; - + length = host_length; + /* We can return the string descriptor. */ status = _ux_device_stack_transfer_request(transfer_request, length, host_length); - break; + break; } } @@ -527,7 +423,7 @@ ULONG string_length; /* Could not find the required string index. Stall the endpoint. */ dcd -> ux_slave_dcd_function(dcd, UX_DCD_STALL_ENDPOINT, endpoint); return(UX_ERROR); - } + } } break; diff --git a/common/core/src/ux_device_stack_disconnect.c b/common/core/src/ux_device_stack_disconnect.c index bb2586d..eac6fc0 100644 --- a/common/core/src/ux_device_stack_disconnect.c +++ b/common/core/src/ux_device_stack_disconnect.c @@ -31,10 +31,10 @@ /**************************************************************************/ /* */ -/* FUNCTION RELEASE */ +/* FUNCTION RELEASE */ /* */ -/* _ux_device_stack_disconnect PORTABLE C */ -/* 6.0 */ +/* _ux_device_stack_disconnect PORTABLE C */ +/* 6.1 */ /* AUTHOR */ /* */ /* Chaoqiong Xiao, Microsoft Corporation */ @@ -69,6 +69,10 @@ /* DATE NAME DESCRIPTION */ /* */ /* 05-19-2020 Chaoqiong Xiao Initial Version 6.0 */ +/* 09-30-2020 Chaoqiong Xiao Modified comment(s), */ +/* optimized based on compile */ +/* definitions, */ +/* resulting in version 6.1 */ /* */ /**************************************************************************/ UINT _ux_device_stack_disconnect(VOID) @@ -77,7 +81,9 @@ UINT _ux_device_stack_disconnect(VOID) UX_SLAVE_DCD *dcd; UX_SLAVE_DEVICE *device; UX_SLAVE_INTERFACE *interface; +#if !defined(UX_DEVICE_INITIALIZE_FRAMEWORK_SCAN_DISABLE) || UX_MAX_DEVICE_INTERFACES > 1 UX_SLAVE_INTERFACE *next_interface; +#endif UX_SLAVE_CLASS *class; UX_SLAVE_CLASS_COMMAND class_command; UINT status = UX_ERROR; @@ -101,9 +107,11 @@ UINT status = UX_ERROR; /* Get the pointer to the first interface. */ interface = device -> ux_slave_device_first_interface; +#if !defined(UX_DEVICE_INITIALIZE_FRAMEWORK_SCAN_DISABLE) || UX_MAX_DEVICE_INTERFACES > 1 /* Parse all the interfaces if any. */ while (interface != UX_NULL) { +#endif /* Build all the fields of the Class Command. */ class_command.ux_slave_class_command_request = UX_SLAVE_CLASS_COMMAND_DEACTIVATE; @@ -121,15 +129,19 @@ UINT status = UX_ERROR; /* Call the class with the DEACTIVATE signal. */ class -> ux_slave_class_entry_function(&class_command); +#if !defined(UX_DEVICE_INITIALIZE_FRAMEWORK_SCAN_DISABLE) || UX_MAX_DEVICE_INTERFACES > 1 /* Get the next interface. */ next_interface = interface -> ux_slave_interface_next_interface; +#endif /* Remove the interface and all endpoints associated with it. */ _ux_device_stack_interface_delete(interface); +#if !defined(UX_DEVICE_INITIALIZE_FRAMEWORK_SCAN_DISABLE) || UX_MAX_DEVICE_INTERFACES > 1 /* Now we refresh the interface pointer. */ interface = next_interface; } +#endif /* Mark the device as attached now. */ device -> ux_slave_device_state = UX_DEVICE_ATTACHED; diff --git a/common/core/src/ux_device_stack_endpoint_stall.c b/common/core/src/ux_device_stack_endpoint_stall.c index 53127aa..6b7ad50 100644 --- a/common/core/src/ux_device_stack_endpoint_stall.c +++ b/common/core/src/ux_device_stack_endpoint_stall.c @@ -31,10 +31,10 @@ /**************************************************************************/ /* */ -/* FUNCTION RELEASE */ +/* FUNCTION RELEASE */ /* */ -/* _ux_device_stack_endpoint_stall PORTABLE C */ -/* 6.0 */ +/* _ux_device_stack_endpoint_stall PORTABLE C */ +/* 6.1 */ /* AUTHOR */ /* */ /* Chaoqiong Xiao, Microsoft Corporation */ @@ -65,12 +65,17 @@ /* DATE NAME DESCRIPTION */ /* */ /* 05-19-2020 Chaoqiong Xiao Initial Version 6.0 */ +/* 09-30-2020 Chaoqiong Xiao Modified comment(s), */ +/* used UX prefix to refer to */ +/* TX symbols instead of using */ +/* them directly, */ +/* resulting in version 6.1 */ /* */ /**************************************************************************/ UINT _ux_device_stack_endpoint_stall(UX_SLAVE_ENDPOINT *endpoint) { -TX_INTERRUPT_SAVE_AREA +UX_INTERRUPT_SAVE_AREA UX_SLAVE_DCD *dcd; UINT status; @@ -87,7 +92,7 @@ UINT status; /* Ensure we don't change the endpoint's state after disconnection routine resets it. */ - TX_DISABLE + UX_DISABLE /* Check if the device is in a valid state; as soon as the device is out of the RESET state, transfers occur and thus endpoints may be stalled. */ @@ -102,7 +107,7 @@ UINT status; } /* Restore interrupts. */ - TX_RESTORE + UX_RESTORE /* Return completion status. */ return(status); diff --git a/common/core/src/ux_device_stack_get_status.c b/common/core/src/ux_device_stack_get_status.c index 1a14d9e..8eb364d 100644 --- a/common/core/src/ux_device_stack_get_status.c +++ b/common/core/src/ux_device_stack_get_status.c @@ -34,7 +34,7 @@ /* FUNCTION RELEASE */ /* */ /* _ux_device_stack_get_status PORTABLE C */ -/* 6.0 */ +/* 6.1 */ /* AUTHOR */ /* */ /* Chaoqiong Xiao, Microsoft Corporation */ @@ -68,6 +68,8 @@ /* 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 */ /* */ /**************************************************************************/ UINT _ux_device_stack_get_status(ULONG request_type, ULONG request_index, ULONG request_length) diff --git a/common/core/src/ux_device_stack_host_wakeup.c b/common/core/src/ux_device_stack_host_wakeup.c index b10d85e..60ed3f6 100644 --- a/common/core/src/ux_device_stack_host_wakeup.c +++ b/common/core/src/ux_device_stack_host_wakeup.c @@ -31,10 +31,10 @@ /**************************************************************************/ /* */ -/* FUNCTION RELEASE */ +/* FUNCTION RELEASE */ /* */ -/* _ux_device_stack_host_wakeup PORTABLE C */ -/* 6.0 */ +/* _ux_device_stack_host_wakeup PORTABLE C */ +/* 6.1 */ /* AUTHOR */ /* */ /* Chaoqiong Xiao, Microsoft Corporation */ @@ -65,6 +65,8 @@ /* 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 */ /* */ /**************************************************************************/ UINT _ux_device_stack_host_wakeup(VOID) diff --git a/common/core/src/ux_device_stack_initialize.c b/common/core/src/ux_device_stack_initialize.c index 4b9ca52..15e3eb3 100644 --- a/common/core/src/ux_device_stack_initialize.c +++ b/common/core/src/ux_device_stack_initialize.c @@ -47,10 +47,10 @@ UX_SYSTEM_SLAVE *_ux_system_slave; /**************************************************************************/ /* */ -/* FUNCTION RELEASE */ +/* FUNCTION RELEASE */ /* */ -/* _ux_device_stack_initialize PORTABLE C */ -/* 6.0 */ +/* _ux_device_stack_initialize PORTABLE C */ +/* 6.1 */ /* AUTHOR */ /* */ /* Chaoqiong Xiao, Microsoft Corporation */ @@ -93,6 +93,10 @@ UX_SYSTEM_SLAVE *_ux_system_slave; /* DATE NAME DESCRIPTION */ /* */ /* 05-19-2020 Chaoqiong Xiao Initial Version 6.0 */ +/* 09-30-2020 Chaoqiong Xiao Modified comment(s), */ +/* optimized based on compile */ +/* definitions, */ +/* resulting in version 6.1 */ /* */ /**************************************************************************/ UINT _ux_device_stack_initialize(UCHAR * device_framework_high_speed, ULONG device_framework_length_high_speed, @@ -107,14 +111,17 @@ UX_SLAVE_INTERFACE *interfaces_pool; UX_SLAVE_TRANSFER *transfer_request; UINT status; ULONG interfaces_found; -ULONG local_interfaces_found; ULONG endpoints_found; +#if !defined(UX_DEVICE_INITIALIZE_FRAMEWORK_SCAN_DISABLE) +ULONG max_interface_number; +ULONG local_interfaces_found; ULONG local_endpoints_found; ULONG endpoints_in_interface_found; UCHAR *device_framework; ULONG device_framework_length; UCHAR descriptor_type; ULONG descriptor_length; +#endif UCHAR *memory; /* If trace is enabled, insert this event into the trace buffer. */ @@ -140,7 +147,7 @@ UCHAR *memory; _ux_system_slave -> ux_system_slave_language_id_framework_length = language_id_framework_length; /* Store the max number of slave class drivers in the project structure. */ - _ux_system_slave -> ux_system_slave_max_class = UX_MAX_SLAVE_CLASS_DRIVER; + UX_SYSTEM_DEVICE_MAX_CLASS_SET(UX_MAX_SLAVE_CLASS_DRIVER); /* Store the device state change function callback. */ _ux_system_slave -> ux_system_slave_change_function = ux_system_slave_change_function; @@ -169,10 +176,18 @@ UCHAR *memory; status = UX_MEMORY_INSUFFICIENT; else status = UX_SUCCESS; - + +#if defined(UX_DEVICE_INITIALIZE_FRAMEWORK_SCAN_DISABLE) + + /* No scan, just assign predefined value. */ + interfaces_found = UX_MAX_SLAVE_INTERFACES; + endpoints_found = UX_MAX_DEVICE_ENDPOINTS; +#else + /* Reset all values we are using during the scanning of the framework. */ interfaces_found = 0; endpoints_found = 0; + max_interface_number = 0; /* Go on to scan interfaces if no error. */ if (status == UX_SUCCESS) @@ -229,6 +244,10 @@ UCHAR *memory; endpoints_in_interface_found = (ULONG) *(device_framework + 4); } + /* Check and update max interface number. */ + if (*(device_framework + 2) > max_interface_number) + max_interface_number = *(device_framework + 2); + break; case UX_CONFIGURATION_DESCRIPTOR_ITEM: @@ -297,9 +316,24 @@ UCHAR *memory; status = UX_DESCRIPTOR_CORRUPTED; } + + /* We do a sanity check on the finding. Max interface number should not exceed limit. */ + if (status == UX_SUCCESS && + max_interface_number >= UX_MAX_SLAVE_INTERFACES) + { + + /* Error trap. */ + _ux_system_error_handler(UX_SYSTEM_LEVEL_THREAD, UX_SYSTEM_CONTEXT_INIT, UX_MEMORY_INSUFFICIENT); + + /* If trace is enabled, insert this event into the trace buffer. */ + UX_TRACE_IN_LINE_INSERT(UX_TRACE_ERROR, UX_MEMORY_INSUFFICIENT, device_framework, 0, 0, UX_TRACE_ERRORS, 0, 0) + + status = UX_MEMORY_INSUFFICIENT; + } } +#endif - /* Go on to allocate endpoints pool if no error. */ + /* Go on to allocate interfaces pool if no error. */ if (status == UX_SUCCESS) { diff --git a/common/core/src/ux_device_stack_interface_delete.c b/common/core/src/ux_device_stack_interface_delete.c index 9d8ca4e..3b61df4 100644 --- a/common/core/src/ux_device_stack_interface_delete.c +++ b/common/core/src/ux_device_stack_interface_delete.c @@ -31,10 +31,10 @@ /**************************************************************************/ /* */ -/* FUNCTION RELEASE */ +/* FUNCTION RELEASE */ /* */ -/* _ux_device_stack_interface_delete PORTABLE C */ -/* 6.0 */ +/* _ux_device_stack_interface_delete PORTABLE C */ +/* 6.1 */ /* AUTHOR */ /* */ /* Chaoqiong Xiao, Microsoft Corporation */ @@ -67,6 +67,8 @@ /* 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 */ /* */ /**************************************************************************/ UINT _ux_device_stack_interface_delete(UX_SLAVE_INTERFACE *interface) diff --git a/common/core/src/ux_device_stack_interface_get.c b/common/core/src/ux_device_stack_interface_get.c index 38b444b..112ac8e 100644 --- a/common/core/src/ux_device_stack_interface_get.c +++ b/common/core/src/ux_device_stack_interface_get.c @@ -31,10 +31,10 @@ /**************************************************************************/ /* */ -/* FUNCTION RELEASE */ +/* FUNCTION RELEASE */ /* */ -/* _ux_device_stack_interface_get PORTABLE C */ -/* 6.0 */ +/* _ux_device_stack_interface_get PORTABLE C */ +/* 6.1 */ /* AUTHOR */ /* */ /* Chaoqiong Xiao, Microsoft Corporation */ @@ -67,6 +67,10 @@ /* DATE NAME DESCRIPTION */ /* */ /* 05-19-2020 Chaoqiong Xiao Initial Version 6.0 */ +/* 09-30-2020 Chaoqiong Xiao Modified comment(s), */ +/* optimized based on compile */ +/* definitions, */ +/* resulting in version 6.1 */ /* */ /**************************************************************************/ UINT _ux_device_stack_interface_get(UINT interface_value) @@ -98,10 +102,12 @@ UINT status; /* Get the pointer to the first interface. */ interface = device -> ux_slave_device_first_interface; - + +#if !defined(UX_DEVICE_INITIALIZE_FRAMEWORK_SCAN_DISABLE) || UX_MAX_DEVICE_INTERFACES > 1 /* Parse the interfaces if any. */ while (interface != UX_NULL) { +#endif /* Check if this is the interface we have an inquiry for. */ if (interface -> ux_slave_interface_descriptor.bInterfaceNumber == interface_value) @@ -127,9 +133,12 @@ UINT status; return(status); } +#if !defined(UX_DEVICE_INITIALIZE_FRAMEWORK_SCAN_DISABLE) || UX_MAX_DEVICE_INTERFACES > 1 /* Get the next interface. */ interface = interface -> ux_slave_interface_next_interface; } +#endif + } /* The alternate setting value was not found, so we return a stall error. */ diff --git a/common/core/src/ux_device_stack_interface_set.c b/common/core/src/ux_device_stack_interface_set.c index 82bc3fd..8670861 100644 --- a/common/core/src/ux_device_stack_interface_set.c +++ b/common/core/src/ux_device_stack_interface_set.c @@ -31,10 +31,10 @@ /**************************************************************************/ /* */ -/* FUNCTION RELEASE */ +/* FUNCTION RELEASE */ /* */ -/* _ux_device_stack_interface_set PORTABLE C */ -/* 6.0 */ +/* _ux_device_stack_interface_set PORTABLE C */ +/* 6.1 */ /* AUTHOR */ /* */ /* Chaoqiong Xiao, Microsoft Corporation */ @@ -72,6 +72,10 @@ /* DATE NAME DESCRIPTION */ /* */ /* 05-19-2020 Chaoqiong Xiao Initial Version 6.0 */ +/* 09-30-2020 Chaoqiong Xiao Modified comment(s), */ +/* optimized based on compile */ +/* definitions, */ +/* resulting in version 6.1 */ /* */ /**************************************************************************/ UINT _ux_device_stack_interface_set(UCHAR * device_framework, ULONG device_framework_length, @@ -82,13 +86,15 @@ UX_SLAVE_DCD *dcd; UX_SLAVE_DEVICE *device; UX_SLAVE_TRANSFER *transfer_request; UX_SLAVE_INTERFACE *interface; +#if !defined(UX_DEVICE_INITIALIZE_FRAMEWORK_SCAN_DISABLE) || UX_MAX_DEVICE_INTERFACES > 1 UX_SLAVE_INTERFACE *interface_link; +ULONG interfaces_pool_number; +#endif UX_SLAVE_ENDPOINT *endpoint; UX_SLAVE_ENDPOINT *endpoint_link; ULONG descriptor_length; UCHAR descriptor_type; ULONG endpoints_pool_number; -ULONG interfaces_pool_number; UINT status; UX_PARAMETER_NOT_USED(alternate_setting_value); @@ -105,16 +111,14 @@ UINT status; /* Find a free interface in the pool and hook it to the existing interface. */ interface = device -> ux_slave_device_interfaces_pool; + +#if !defined(UX_DEVICE_INITIALIZE_FRAMEWORK_SCAN_DISABLE) || UX_MAX_DEVICE_INTERFACES > 1 interfaces_pool_number = device -> ux_slave_device_interfaces_pool_number; while (interfaces_pool_number != 0) { /* Check if this interface is free. */ if (interface -> ux_slave_interface_status == UX_UNUSED) - { - /* Mark this interface as used now. */ - interface -> ux_slave_interface_status = UX_USED; break; - } /* Try the next interface. */ interface++; @@ -126,6 +130,16 @@ UINT status; /* Did we find a free interface ? */ if (interfaces_pool_number == 0) return(UX_MEMORY_INSUFFICIENT); +#else + + /* Check if this interface is free. */ + if (interface -> ux_slave_interface_status != UX_UNUSED) + return(UX_MEMORY_INSUFFICIENT); + +#endif + + /* Mark this interface as used now. */ + interface -> ux_slave_interface_status = UX_USED; /* If trace is enabled, register this object. */ UX_TRACE_OBJECT_REGISTER(UX_TRACE_DEVICE_OBJECT_TYPE_INTERFACE, interface, 0, 0, 0) @@ -136,6 +150,8 @@ UINT status; UX_INTERFACE_DESCRIPTOR_ENTRIES, (UCHAR *) &interface -> ux_slave_interface_descriptor); +#if !defined(UX_DEVICE_INITIALIZE_FRAMEWORK_SCAN_DISABLE) || UX_MAX_DEVICE_INTERFACES > 1 + /* Attach this interface to the end of the interface chain. */ if (device -> ux_slave_device_first_interface == UX_NULL) { @@ -150,6 +166,11 @@ UINT status; interface_link = interface_link -> ux_slave_interface_next_interface; interface_link -> ux_slave_interface_next_interface = interface; } +#else + + /* It must be very first one. */ + device -> ux_slave_device_first_interface = interface; +#endif /* Point beyond the interface descriptor. */ device_framework_length -= (ULONG) *device_framework; diff --git a/common/core/src/ux_device_stack_interface_start.c b/common/core/src/ux_device_stack_interface_start.c index 98747ef..1b8edc7 100644 --- a/common/core/src/ux_device_stack_interface_start.c +++ b/common/core/src/ux_device_stack_interface_start.c @@ -31,10 +31,10 @@ /**************************************************************************/ /* */ -/* FUNCTION RELEASE */ +/* FUNCTION RELEASE */ /* */ -/* _ux_device_stack_interface_start PORTABLE C */ -/* 6.0 */ +/* _ux_device_stack_interface_start PORTABLE C */ +/* 6.1 */ /* AUTHOR */ /* */ /* Chaoqiong Xiao, Microsoft Corporation */ @@ -66,6 +66,8 @@ /* 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 */ /* */ /**************************************************************************/ UINT _ux_device_stack_interface_start(UX_SLAVE_INTERFACE *interface) diff --git a/common/core/src/ux_device_stack_microsoft_extension_register.c b/common/core/src/ux_device_stack_microsoft_extension_register.c index 983e535..32d87e9 100644 --- a/common/core/src/ux_device_stack_microsoft_extension_register.c +++ b/common/core/src/ux_device_stack_microsoft_extension_register.c @@ -31,10 +31,10 @@ /**************************************************************************/ /* */ -/* FUNCTION RELEASE */ +/* FUNCTION RELEASE */ /* */ -/* _ux_device_stack_microsoft_extension_register PORTABLE C */ -/* 6.0 */ +/* _ux_device_stack_microsoft_extension_register PORTABLE C */ +/* 6.1 */ /* AUTHOR */ /* */ /* Chaoqiong Xiao, Microsoft Corporation */ @@ -66,6 +66,8 @@ /* 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 */ /* */ /**************************************************************************/ UINT _ux_device_stack_microsoft_extension_register(ULONG vendor_request, diff --git a/common/core/src/ux_device_stack_set_feature.c b/common/core/src/ux_device_stack_set_feature.c index e8cca96..53f1ba9 100644 --- a/common/core/src/ux_device_stack_set_feature.c +++ b/common/core/src/ux_device_stack_set_feature.c @@ -34,7 +34,7 @@ /* FUNCTION RELEASE */ /* */ /* _ux_device_stack_set_feature PORTABLE C */ -/* 6.0 */ +/* 6.1 */ /* AUTHOR */ /* */ /* Chaoqiong Xiao, Microsoft Corporation */ @@ -67,6 +67,11 @@ /* DATE NAME DESCRIPTION */ /* */ /* 05-19-2020 Chaoqiong Xiao Initial Version 6.0 */ +/* 09-30-2020 Chaoqiong Xiao Modified comment(s), */ +/* optimized based on compile */ +/* definitions, stalled on not */ +/* supported device requests, */ +/* resulting in version 6.1 */ /* */ /**************************************************************************/ UINT _ux_device_stack_set_feature(ULONG request_type, ULONG request_value, ULONG request_index) @@ -121,25 +126,29 @@ UX_SLAVE_ENDPOINT *endpoint_target; #ifdef UX_OTG_SUPPORT /* Check if we have a A_HNP_SUPPORT Feature. This is set when the Host is HNP capable. */ if (request_value == UX_OTG_FEATURE_A_HNP_SUPPORT) + { /* Store the A_HNP_SUPPORT flag. */ _ux_system_otg -> ux_system_otg_slave_set_feature_flag |= UX_OTG_FEATURE_A_HNP_SUPPORT; - else - { - /* Check if the host asks us to perform HNP. If also we become the host. */ - if (request_value == UX_OTG_FEATURE_B_HNP_ENABLE) - { + /* OK. */ + return(UX_SUCCESS); + } - /* The ISR will pick up the suspend event and check if we need to become IDLE or HOST. */ - _ux_system_otg -> ux_system_otg_slave_set_feature_flag |= UX_OTG_FEATURE_B_HNP_ENABLE; + /* Check if the host asks us to perform HNP. If also we become the host. */ + if (request_value == UX_OTG_FEATURE_B_HNP_ENABLE) + { - } + /* The ISR will pick up the suspend event and check if we need to become IDLE or HOST. */ + _ux_system_otg -> ux_system_otg_slave_set_feature_flag |= UX_OTG_FEATURE_B_HNP_ENABLE; + /* OK. */ + return(UX_SUCCESS); } #endif - - break; + + /* Request value not supported. */ + return(UX_FUNCTION_NOT_SUPPORTED); case UX_REQUEST_TARGET_ENDPOINT: @@ -148,9 +157,10 @@ UX_SLAVE_ENDPOINT *endpoint_target; We need to find the endpoint through the interface(s). */ interface = device -> ux_slave_device_first_interface; +#if !defined(UX_DEVICE_INITIALIZE_FRAMEWORK_SCAN_DISABLE) || UX_MAX_DEVICE_INTERFACES > 1 while (interface != UX_NULL) { - +#endif /* Get the first endpoint for this interface. */ endpoint_target = interface -> ux_slave_interface_first_endpoint; @@ -173,9 +183,11 @@ UX_SLAVE_ENDPOINT *endpoint_target; endpoint_target = endpoint_target -> ux_slave_endpoint_next_endpoint; } +#if !defined(UX_DEVICE_INITIALIZE_FRAMEWORK_SCAN_DISABLE) || UX_MAX_DEVICE_INTERFACES > 1 /* Next interface. */ interface = interface -> ux_slave_interface_next_interface; } +#endif /* We get here when the endpoint is wrong. Should not happen though. */ /* Intentionally fall through into the default case. */ @@ -188,8 +200,4 @@ UX_SLAVE_ENDPOINT *endpoint_target; /* No more work to do here. The command failed but the upper layer does not depend on it. */ return(UX_SUCCESS); } - - /* Return the function status. */ - return(UX_SUCCESS); } - diff --git a/common/core/src/ux_device_stack_transfer_abort.c b/common/core/src/ux_device_stack_transfer_abort.c index 49a58d9..9b17b5a 100644 --- a/common/core/src/ux_device_stack_transfer_abort.c +++ b/common/core/src/ux_device_stack_transfer_abort.c @@ -31,10 +31,10 @@ /**************************************************************************/ /* */ -/* FUNCTION RELEASE */ +/* FUNCTION RELEASE */ /* */ -/* _ux_device_stack_transfer_abort PORTABLE C */ -/* 6.0 */ +/* _ux_device_stack_transfer_abort PORTABLE C */ +/* 6.1 */ /* AUTHOR */ /* */ /* Chaoqiong Xiao, Microsoft Corporation */ @@ -71,12 +71,17 @@ /* DATE NAME DESCRIPTION */ /* */ /* 05-19-2020 Chaoqiong Xiao Initial Version 6.0 */ +/* 09-30-2020 Chaoqiong Xiao Modified comment(s), */ +/* used UX prefix to refer to */ +/* TX symbols instead of using */ +/* them directly, */ +/* resulting in version 6.1 */ /* */ /**************************************************************************/ UINT _ux_device_stack_transfer_abort(UX_SLAVE_TRANSFER *transfer_request, ULONG completion_code) { -TX_INTERRUPT_SAVE_AREA +UX_INTERRUPT_SAVE_AREA UX_SLAVE_DCD *dcd; @@ -92,7 +97,7 @@ UX_SLAVE_DCD *dcd; transfer_request -> ux_slave_transfer_request_completion_code = UX_TRANSFER_BUS_RESET; /* Ensure we're not preempted by the transfer completion ISR. */ - TX_DISABLE + UX_DISABLE /* It's possible the transfer already completed. Ensure it hasn't before doing the abort. */ if (transfer_request -> ux_slave_transfer_request_status == UX_TRANSFER_STATUS_PENDING) @@ -102,7 +107,7 @@ UX_SLAVE_DCD *dcd; dcd -> ux_slave_dcd_function(dcd, UX_DCD_TRANSFER_ABORT, (VOID *) transfer_request); /* Restore interrupts. Note that the transfer request should not be modified now. */ - TX_RESTORE + UX_RESTORE /* We need to set the completion code for the transfer to aborted. Note that the transfer request function cannot simultaneously modify this @@ -117,7 +122,7 @@ UX_SLAVE_DCD *dcd; { /* Restore interrupts. */ - TX_RESTORE + UX_RESTORE } /* This function never fails. */ diff --git a/common/core/src/ux_device_stack_transfer_all_request_abort.c b/common/core/src/ux_device_stack_transfer_all_request_abort.c index 48c7d3f..2837a40 100644 --- a/common/core/src/ux_device_stack_transfer_all_request_abort.c +++ b/common/core/src/ux_device_stack_transfer_all_request_abort.c @@ -31,10 +31,10 @@ /**************************************************************************/ /* */ -/* FUNCTION RELEASE */ +/* FUNCTION RELEASE */ /* */ -/* _ux_device_transfer_all_request_abort PORTABLE C */ -/* 6.0 */ +/* _ux_device_stack_transfer_all_request_abort PORTABLE C */ +/* 6.1 */ /* AUTHOR */ /* */ /* Chaoqiong Xiao, Microsoft Corporation */ @@ -67,6 +67,8 @@ /* 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 */ /* */ /**************************************************************************/ UINT _ux_device_stack_transfer_all_request_abort(UX_SLAVE_ENDPOINT *endpoint, ULONG completion_code) diff --git a/common/core/src/ux_device_stack_transfer_request.c b/common/core/src/ux_device_stack_transfer_request.c index 20f3aa9..08e2353 100644 --- a/common/core/src/ux_device_stack_transfer_request.c +++ b/common/core/src/ux_device_stack_transfer_request.c @@ -34,7 +34,7 @@ /* FUNCTION RELEASE */ /* */ /* _ux_device_stack_transfer_request PORTABLE C */ -/* 6.0 */ +/* 6.1 */ /* AUTHOR */ /* */ /* Chaoqiong Xiao, Microsoft Corporation */ @@ -71,6 +71,11 @@ /* DATE NAME DESCRIPTION */ /* */ /* 05-19-2020 Chaoqiong Xiao Initial Version 6.0 */ +/* 09-30-2020 Chaoqiong Xiao Modified comment(s), */ +/* used UX prefix to refer to */ +/* TX symbols instead of using */ +/* them directly, */ +/* resulting in version 6.1 */ /* */ /**************************************************************************/ UINT _ux_device_stack_transfer_request(UX_SLAVE_TRANSFER *transfer_request, @@ -78,7 +83,7 @@ UINT _ux_device_stack_transfer_request(UX_SLAVE_TRANSFER *transfer_request, ULONG host_length) { -TX_INTERRUPT_SAVE_AREA +UX_INTERRUPT_SAVE_AREA UX_SLAVE_DCD *dcd; UINT status; @@ -92,7 +97,7 @@ ULONG device_state; /* Disable interrupts to prevent the disconnection ISR from preempting us while we check the device state and set the transfer status. */ - TX_DISABLE + UX_DISABLE /* Get the device state. */ device_state = _ux_system_slave -> ux_system_slave_device.ux_slave_device_state; @@ -108,12 +113,12 @@ ULONG device_state; { /* The device is in an invalid state. Restore interrupts and return error. */ - TX_RESTORE + UX_RESTORE return(UX_TRANSFER_NOT_READY); } /* Restore interrupts. */ - TX_RESTORE + UX_RESTORE /* If trace is enabled, insert this event into the trace buffer. */ UX_TRACE_IN_LINE_INSERT(UX_TRACE_DEVICE_STACK_TRANSFER_REQUEST, transfer_request, 0, 0, 0, UX_TRACE_DEVICE_STACK_EVENTS, 0, 0) diff --git a/common/core/src/ux_device_stack_uninitialize.c b/common/core/src/ux_device_stack_uninitialize.c index 7a1c63e..71258ee 100644 --- a/common/core/src/ux_device_stack_uninitialize.c +++ b/common/core/src/ux_device_stack_uninitialize.c @@ -30,10 +30,10 @@ /**************************************************************************/ /* */ -/* FUNCTION RELEASE */ +/* FUNCTION RELEASE */ /* */ -/* _ux_device_stack_uninitialize PORTABLE C */ -/* 6.0 */ +/* _ux_device_stack_uninitialize PORTABLE C */ +/* 6.1 */ /* AUTHOR */ /* */ /* Chaoqiong Xiao, Microsoft Corporation */ @@ -63,6 +63,8 @@ /* 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 */ /* */ /**************************************************************************/ UINT _ux_device_stack_uninitialize(VOID) diff --git a/common/core/src/ux_hcd_sim_host_asynch_queue_process.c b/common/core/src/ux_hcd_sim_host_asynch_queue_process.c index d771e9e..eb4a458 100644 --- a/common/core/src/ux_hcd_sim_host_asynch_queue_process.c +++ b/common/core/src/ux_hcd_sim_host_asynch_queue_process.c @@ -34,7 +34,7 @@ /* FUNCTION RELEASE */ /* */ /* _ux_hcd_sim_host_asynch_queue_process PORTABLE C */ -/* 6.0 */ +/* 6.1 */ /* AUTHOR */ /* */ /* Chaoqiong Xiao, Microsoft Corporation */ @@ -66,6 +66,8 @@ /* 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 */ /* */ /**************************************************************************/ VOID _ux_hcd_sim_host_asynch_queue_process(UX_HCD_SIM_HOST *hcd_sim_host) diff --git a/common/core/src/ux_hcd_sim_host_asynch_schedule.c b/common/core/src/ux_hcd_sim_host_asynch_schedule.c index a0cefc4..1e78487 100644 --- a/common/core/src/ux_hcd_sim_host_asynch_schedule.c +++ b/common/core/src/ux_hcd_sim_host_asynch_schedule.c @@ -34,7 +34,7 @@ /* FUNCTION RELEASE */ /* */ /* _ux_hcd_sim_host_asynch_schedule PORTABLE C */ -/* 6.0 */ +/* 6.1 */ /* AUTHOR */ /* */ /* Chaoqiong Xiao, Microsoft Corporation */ @@ -64,6 +64,8 @@ /* 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 */ /* */ /**************************************************************************/ VOID _ux_hcd_sim_host_asynch_schedule(UX_HCD_SIM_HOST *hcd_sim_host) diff --git a/common/core/src/ux_hcd_sim_host_asynchronous_endpoint_create.c b/common/core/src/ux_hcd_sim_host_asynchronous_endpoint_create.c index 0cb523f..48bee36 100644 --- a/common/core/src/ux_hcd_sim_host_asynchronous_endpoint_create.c +++ b/common/core/src/ux_hcd_sim_host_asynchronous_endpoint_create.c @@ -34,7 +34,7 @@ /* FUNCTION RELEASE */ /* */ /* _ux_hcd_sim_host_asynchronous_endpoint_create PORTABLE C */ -/* 6.0 */ +/* 6.1 */ /* AUTHOR */ /* */ /* Chaoqiong Xiao, Microsoft Corporation */ @@ -67,6 +67,8 @@ /* 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 */ /* */ /**************************************************************************/ UINT _ux_hcd_sim_host_asynchronous_endpoint_create(UX_HCD_SIM_HOST *hcd_sim_host, UX_ENDPOINT *endpoint) diff --git a/common/core/src/ux_hcd_sim_host_asynchronous_endpoint_destroy.c b/common/core/src/ux_hcd_sim_host_asynchronous_endpoint_destroy.c index 71bbda2..c09aff5 100644 --- a/common/core/src/ux_hcd_sim_host_asynchronous_endpoint_destroy.c +++ b/common/core/src/ux_hcd_sim_host_asynchronous_endpoint_destroy.c @@ -34,7 +34,7 @@ /* FUNCTION RELEASE */ /* */ /* _ux_hcd_sim_host_asynchronous_endpoint_destroy PORTABLE C */ -/* 6.0 */ +/* 6.1 */ /* AUTHOR */ /* */ /* Chaoqiong Xiao, Microsoft Corporation */ @@ -66,6 +66,8 @@ /* 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 */ /* */ /**************************************************************************/ UINT _ux_hcd_sim_host_asynchronous_endpoint_destroy(UX_HCD_SIM_HOST *hcd_sim_host, UX_ENDPOINT *endpoint) diff --git a/common/core/src/ux_hcd_sim_host_controller_disable.c b/common/core/src/ux_hcd_sim_host_controller_disable.c new file mode 100644 index 0000000..2109e9e --- /dev/null +++ b/common/core/src/ux_hcd_sim_host_controller_disable.c @@ -0,0 +1,98 @@ +/**************************************************************************/ +/* */ +/* 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 */ +/** */ +/** Host Simulator Controller Driver */ +/** */ +/**************************************************************************/ +/**************************************************************************/ + +#define UX_SOURCE_CODE + + +/* Include necessary system files. */ + +#include "ux_api.h" +#include "ux_hcd_sim_host.h" + + +/**************************************************************************/ +/* */ +/* FUNCTION RELEASE */ +/* */ +/* _ux_hcd_sim_host_controller_disable PORTABLE C */ +/* 6.1 */ +/* AUTHOR */ +/* */ +/* Chaoqiong Xiao, Microsoft Corporation */ +/* */ +/* DESCRIPTION */ +/* */ +/* This function will disable the simulated host controller. */ +/* The controller will release all its resources (memory, IO ...). */ +/* After this, the controller will not send SOF any longer. */ +/* */ +/* INPUT */ +/* */ +/* hcd_sim_host Pointer to host controller */ +/* */ +/* OUTPUT */ +/* */ +/* Completion Status */ +/* */ +/* CALLS */ +/* */ +/* _ux_utility_memory_free Free memory block */ +/* _ux_utility_timer_delete Delete timer */ +/* */ +/* CALLED BY */ +/* */ +/* Host Simulator Controller Driver */ +/* */ +/* RELEASE HISTORY */ +/* */ +/* DATE NAME DESCRIPTION */ +/* */ +/* 09-30-2020 Chaoqiong Xiao Initial Version 6.1 */ +/* */ +/**************************************************************************/ +UINT _ux_hcd_sim_host_controller_disable(UX_HCD_SIM_HOST *hcd_sim_host) +{ + +UX_HCD *hcd = hcd_sim_host -> ux_hcd_sim_host_hcd_owner; + + + /* Set the state of the controller to HALTED first. */ + hcd -> ux_hcd_status = UX_HCD_STATUS_HALTED; + + /* Get simulated host controller. */ + hcd_sim_host = (UX_HCD_SIM_HOST *)hcd -> ux_hcd_controller_hardware; + + /* Delete timer. */ + _ux_utility_timer_delete(&hcd_sim_host -> ux_hcd_sim_host_timer); + + /* 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); + + /* Free simulated host controller memory. */ + _ux_utility_memory_free(hcd_sim_host); + hcd -> ux_hcd_controller_hardware = UX_NULL; + + /* Return successful completion. */ + return(UX_SUCCESS); +} diff --git a/common/core/src/ux_hcd_sim_host_ed_obtain.c b/common/core/src/ux_hcd_sim_host_ed_obtain.c index 1045bd5..3615186 100644 --- a/common/core/src/ux_hcd_sim_host_ed_obtain.c +++ b/common/core/src/ux_hcd_sim_host_ed_obtain.c @@ -34,7 +34,7 @@ /* FUNCTION RELEASE */ /* */ /* _ux_hcd_sim_host_ed_obtain PORTABLE C */ -/* 6.0 */ +/* 6.1 */ /* AUTHOR */ /* */ /* Chaoqiong Xiao, Microsoft Corporation */ @@ -64,6 +64,10 @@ /* DATE NAME DESCRIPTION */ /* */ /* 05-19-2020 Chaoqiong Xiao Initial Version 6.0 */ +/* 09-30-2020 Chaoqiong Xiao Modified comment(s), */ +/* verified memset and memcpy */ +/* cases, */ +/* resulting in version 6.1 */ /* */ /**************************************************************************/ UX_HCD_SIM_HOST_ED *_ux_hcd_sim_host_ed_obtain(UX_HCD_SIM_HOST *hcd_sim_host) @@ -83,7 +87,7 @@ ULONG ed_index; { /* The ED may have been used, so we reset all fields. */ - _ux_utility_memory_set(ed, 0, sizeof(UX_HCD_SIM_HOST_ED)); + _ux_utility_memory_set(ed, 0, sizeof(UX_HCD_SIM_HOST_ED)); /* Use case of memset is verified. */ /* This ED is now marked as USED. */ ed -> ux_sim_host_ed_status = UX_USED; diff --git a/common/core/src/ux_hcd_sim_host_ed_td_clean.c b/common/core/src/ux_hcd_sim_host_ed_td_clean.c index 658c616..3e574d4 100644 --- a/common/core/src/ux_hcd_sim_host_ed_td_clean.c +++ b/common/core/src/ux_hcd_sim_host_ed_td_clean.c @@ -34,7 +34,7 @@ /* FUNCTION RELEASE */ /* */ /* _ux_hcd_sim_host_ed_td_clean PORTABLE C */ -/* 6.0 */ +/* 6.1 */ /* AUTHOR */ /* */ /* Chaoqiong Xiao, Microsoft Corporation */ @@ -65,6 +65,8 @@ /* 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 */ /* */ /**************************************************************************/ VOID _ux_hcd_sim_host_ed_td_clean(UX_HCD_SIM_HOST_ED *ed) diff --git a/common/core/src/ux_hcd_sim_host_endpoint_reset.c b/common/core/src/ux_hcd_sim_host_endpoint_reset.c index 49eed9e..20e1ec8 100644 --- a/common/core/src/ux_hcd_sim_host_endpoint_reset.c +++ b/common/core/src/ux_hcd_sim_host_endpoint_reset.c @@ -34,7 +34,7 @@ /* FUNCTION RELEASE */ /* */ /* _ux_hcd_sim_host_endpoint_reset PORTABLE C */ -/* 6.0 */ +/* 6.1 */ /* AUTHOR */ /* */ /* Chaoqiong Xiao, Microsoft Corporation */ @@ -65,6 +65,8 @@ /* 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 */ /* */ /**************************************************************************/ UINT _ux_hcd_sim_host_endpoint_reset(UX_HCD_SIM_HOST *hcd_sim_host, UX_ENDPOINT *endpoint) diff --git a/common/core/src/ux_hcd_sim_host_entry.c b/common/core/src/ux_hcd_sim_host_entry.c index 02cce35..f9872db 100644 --- a/common/core/src/ux_hcd_sim_host_entry.c +++ b/common/core/src/ux_hcd_sim_host_entry.c @@ -34,7 +34,7 @@ /* FUNCTION RELEASE */ /* */ /* _ux_hcd_sim_host_entry PORTABLE C */ -/* 6.0 */ +/* 6.1 */ /* AUTHOR */ /* */ /* Chaoqiong Xiao, Microsoft Corporation */ @@ -82,6 +82,9 @@ /* DATE NAME DESCRIPTION */ /* */ /* 05-19-2020 Chaoqiong Xiao Initial Version 6.0 */ +/* 09-30-2020 Chaoqiong Xiao Modified comment(s), */ +/* added controller disable, */ +/* resulting in version 6.1 */ /* */ /**************************************************************************/ UINT _ux_hcd_sim_host_entry(UX_HCD *hcd, UINT function, VOID *parameter) @@ -113,7 +116,7 @@ UX_HCD_SIM_HOST *hcd_sim_host; case UX_HCD_DISABLE_CONTROLLER: - status = UX_SUCCESS; + status = _ux_hcd_sim_host_controller_disable(hcd_sim_host); break; diff --git a/common/core/src/ux_hcd_sim_host_frame_number_get.c b/common/core/src/ux_hcd_sim_host_frame_number_get.c index 2b90a2d..93a4c25 100644 --- a/common/core/src/ux_hcd_sim_host_frame_number_get.c +++ b/common/core/src/ux_hcd_sim_host_frame_number_get.c @@ -34,7 +34,7 @@ /* FUNCTION RELEASE */ /* */ /* _ux_hcd_sim_host_frame_number_get PORTABLE C */ -/* 6.0 */ +/* 6.1 */ /* AUTHOR */ /* */ /* Chaoqiong Xiao, Microsoft Corporation */ @@ -66,6 +66,8 @@ /* 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 */ /* */ /**************************************************************************/ UINT _ux_hcd_sim_host_frame_number_get(UX_HCD_SIM_HOST *hcd_sim_host, ULONG *frame_number) diff --git a/common/core/src/ux_hcd_sim_host_frame_number_set.c b/common/core/src/ux_hcd_sim_host_frame_number_set.c index e593b74..fd07a5d 100644 --- a/common/core/src/ux_hcd_sim_host_frame_number_set.c +++ b/common/core/src/ux_hcd_sim_host_frame_number_set.c @@ -34,7 +34,7 @@ /* FUNCTION RELEASE */ /* */ /* _ux_hcd_sim_host_frame_number_set PORTABLE C */ -/* 6.0 */ +/* 6.1 */ /* AUTHOR */ /* */ /* Chaoqiong Xiao, Microsoft Corporation */ @@ -66,6 +66,8 @@ /* 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 */ /* */ /**************************************************************************/ VOID _ux_hcd_sim_host_frame_number_set(UX_HCD_SIM_HOST *hcd_sim_host, ULONG frame_number) diff --git a/common/core/src/ux_hcd_sim_host_initialize.c b/common/core/src/ux_hcd_sim_host_initialize.c index 5d83260..c385e75 100644 --- a/common/core/src/ux_hcd_sim_host_initialize.c +++ b/common/core/src/ux_hcd_sim_host_initialize.c @@ -34,7 +34,7 @@ /* FUNCTION RELEASE */ /* */ /* _ux_hcd_sim_host_initialize PORTABLE C */ -/* 6.0 */ +/* 6.1 */ /* AUTHOR */ /* */ /* Chaoqiong Xiao, Microsoft Corporation */ @@ -67,6 +67,13 @@ /* DATE NAME DESCRIPTION */ /* */ /* 05-19-2020 Chaoqiong Xiao Initial Version 6.0 */ +/* 09-30-2020 Chaoqiong Xiao Modified comment(s), */ +/* optimized based on compile */ +/* definitions, used UX prefix */ +/* to refer to TX symbols */ +/* instead of using them */ +/* directly, */ +/* resulting in version 6.1 */ /* */ /**************************************************************************/ UINT _ux_hcd_sim_host_initialize(UX_HCD *hcd) @@ -92,10 +99,12 @@ UINT status; /* Initialize the function collector for this HCD. */ hcd -> ux_hcd_entry_function = _ux_hcd_sim_host_entry; - + +#if UX_MAX_DEVICES > 1 /* Initialize the max bandwidth for periodic endpoints. In simulation this is not very important. */ hcd -> ux_hcd_available_bandwidth = UX_HCD_SIM_HOST_AVAILABLE_BANDWIDTH; +#endif /* Set the state of the controller to HALTED first. */ hcd -> ux_hcd_status = UX_HCD_STATUS_HALTED; @@ -141,7 +150,7 @@ UINT status; /* We start a timer that will invoke the simulator every timer tick. */ status = _ux_utility_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, TX_AUTO_ACTIVATE); + _ux_hcd_sim_host_timer_function, (ULONG) (ALIGN_TYPE) hcd_sim_host, 1, 1, UX_AUTO_ACTIVATE); } UX_TIMER_EXTENSION_PTR_SET(&(hcd_sim_host -> ux_hcd_sim_host_timer), hcd_sim_host) diff --git a/common/core/src/ux_hcd_sim_host_interrupt_endpoint_create.c b/common/core/src/ux_hcd_sim_host_interrupt_endpoint_create.c index a42fa8d..daa6811 100644 --- a/common/core/src/ux_hcd_sim_host_interrupt_endpoint_create.c +++ b/common/core/src/ux_hcd_sim_host_interrupt_endpoint_create.c @@ -34,7 +34,7 @@ /* FUNCTION RELEASE */ /* */ /* _ux_hcd_sim_host_interrupt_endpoint_create PORTABLE C */ -/* 6.0 */ +/* 6.1 */ /* AUTHOR */ /* */ /* Chaoqiong Xiao, Microsoft Corporation */ @@ -86,6 +86,8 @@ /* 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 */ /* */ /**************************************************************************/ UINT _ux_hcd_sim_host_interrupt_endpoint_create(UX_HCD_SIM_HOST *hcd_sim_host, UX_ENDPOINT *endpoint) diff --git a/common/core/src/ux_hcd_sim_host_iso_queue_process.c b/common/core/src/ux_hcd_sim_host_iso_queue_process.c index 7b88faa..33a00b1 100644 --- a/common/core/src/ux_hcd_sim_host_iso_queue_process.c +++ b/common/core/src/ux_hcd_sim_host_iso_queue_process.c @@ -34,7 +34,7 @@ /* FUNCTION RELEASE */ /* */ /* _ux_hcd_sim_host_iso_queue_process PORTABLE C */ -/* 6.0 */ +/* 6.1 */ /* AUTHOR */ /* */ /* Chaoqiong Xiao, Microsoft Corporation */ @@ -65,6 +65,8 @@ /* 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 */ /* */ /**************************************************************************/ VOID _ux_hcd_sim_host_iso_queue_process(UX_HCD_SIM_HOST *hcd_sim_host) diff --git a/common/core/src/ux_hcd_sim_host_iso_schedule.c b/common/core/src/ux_hcd_sim_host_iso_schedule.c index f4206b5..1069aca 100644 --- a/common/core/src/ux_hcd_sim_host_iso_schedule.c +++ b/common/core/src/ux_hcd_sim_host_iso_schedule.c @@ -34,7 +34,7 @@ /* FUNCTION RELEASE */ /* */ /* _ux_hcd_sim_host_iso_schedule PORTABLE C */ -/* 6.0 */ +/* 6.1 */ /* AUTHOR */ /* */ /* Chaoqiong Xiao, Microsoft Corporation */ @@ -64,6 +64,8 @@ /* 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 */ /* */ /**************************************************************************/ VOID _ux_hcd_sim_host_iso_schedule(UX_HCD_SIM_HOST *hcd_sim_host) diff --git a/common/core/src/ux_hcd_sim_host_isochronous_endpoint_create.c b/common/core/src/ux_hcd_sim_host_isochronous_endpoint_create.c index ef7f738..196b7cb 100644 --- a/common/core/src/ux_hcd_sim_host_isochronous_endpoint_create.c +++ b/common/core/src/ux_hcd_sim_host_isochronous_endpoint_create.c @@ -34,7 +34,7 @@ /* FUNCTION RELEASE */ /* */ /* _ux_hcd_sim_host_isochronous_endpoint_create PORTABLE C */ -/* 6.0 */ +/* 6.1 */ /* AUTHOR */ /* */ /* Chaoqiong Xiao, Microsoft Corporation */ @@ -66,6 +66,8 @@ /* 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 */ /* */ /**************************************************************************/ UINT _ux_hcd_sim_host_isochronous_endpoint_create(UX_HCD_SIM_HOST *hcd_sim_host, UX_ENDPOINT *endpoint) diff --git a/common/core/src/ux_hcd_sim_host_isochronous_td_obtain.c b/common/core/src/ux_hcd_sim_host_isochronous_td_obtain.c index fbd44b0..571f4fb 100644 --- a/common/core/src/ux_hcd_sim_host_isochronous_td_obtain.c +++ b/common/core/src/ux_hcd_sim_host_isochronous_td_obtain.c @@ -34,7 +34,7 @@ /* FUNCTION RELEASE */ /* */ /* _ux_hcd_sim_host_isochronous_td_obtain PORTABLE C */ -/* 6.0 */ +/* 6.1 */ /* AUTHOR */ /* */ /* Chaoqiong Xiao, Microsoft Corporation */ @@ -64,6 +64,10 @@ /* DATE NAME DESCRIPTION */ /* */ /* 05-19-2020 Chaoqiong Xiao Initial Version 6.0 */ +/* 09-30-2020 Chaoqiong Xiao Modified comment(s), */ +/* verified memset and memcpy */ +/* cases, */ +/* resulting in version 6.1 */ /* */ /**************************************************************************/ UX_HCD_SIM_HOST_ISO_TD *_ux_hcd_sim_host_isochronous_td_obtain(UX_HCD_SIM_HOST *hcd_sim_host) @@ -83,7 +87,7 @@ ULONG td_index; { /* The TD may have been used, so we reset all fields. */ - _ux_utility_memory_set(td, 0, sizeof(UX_HCD_SIM_HOST_ISO_TD)); + _ux_utility_memory_set(td, 0, sizeof(UX_HCD_SIM_HOST_ISO_TD)); /* Use case of memset is verified. */ /* This TD is now marked as USED. */ td -> ux_sim_host_iso_td_status = UX_USED; diff --git a/common/core/src/ux_hcd_sim_host_least_traffic_list_get.c b/common/core/src/ux_hcd_sim_host_least_traffic_list_get.c index 24982b4..3573f7f 100644 --- a/common/core/src/ux_hcd_sim_host_least_traffic_list_get.c +++ b/common/core/src/ux_hcd_sim_host_least_traffic_list_get.c @@ -34,7 +34,7 @@ /* FUNCTION RELEASE */ /* */ /* _ux_hcd_sim_host_least_traffic_list_get PORTABLE C */ -/* 6.0 */ +/* 6.1 */ /* AUTHOR */ /* */ /* Chaoqiong Xiao, Microsoft Corporation */ @@ -65,6 +65,8 @@ /* 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 */ /* */ /**************************************************************************/ UX_HCD_SIM_HOST_ED *_ux_hcd_sim_host_least_traffic_list_get(UX_HCD_SIM_HOST *hcd_sim_host) diff --git a/common/core/src/ux_hcd_sim_host_periodic_endpoint_destroy.c b/common/core/src/ux_hcd_sim_host_periodic_endpoint_destroy.c index 2ae407c..03dbd12 100644 --- a/common/core/src/ux_hcd_sim_host_periodic_endpoint_destroy.c +++ b/common/core/src/ux_hcd_sim_host_periodic_endpoint_destroy.c @@ -34,7 +34,7 @@ /* FUNCTION RELEASE */ /* */ /* _ux_hcd_sim_host_periodic_endpoint_destroy PORTABLE C */ -/* 6.0 */ +/* 6.1 */ /* AUTHOR */ /* */ /* Chaoqiong Xiao, Microsoft Corporation */ @@ -65,6 +65,8 @@ /* 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 */ /* */ /**************************************************************************/ UINT _ux_hcd_sim_host_periodic_endpoint_destroy(UX_HCD_SIM_HOST *hcd_sim_host, UX_ENDPOINT *endpoint) diff --git a/common/core/src/ux_hcd_sim_host_periodic_schedule.c b/common/core/src/ux_hcd_sim_host_periodic_schedule.c index 1a6c3e2..9b5c579 100644 --- a/common/core/src/ux_hcd_sim_host_periodic_schedule.c +++ b/common/core/src/ux_hcd_sim_host_periodic_schedule.c @@ -34,7 +34,7 @@ /* FUNCTION RELEASE */ /* */ /* _ux_hcd_sim_host_periodic_schedule PORTABLE C */ -/* 6.0 */ +/* 6.1 */ /* AUTHOR */ /* */ /* Chaoqiong Xiao, Microsoft Corporation */ @@ -66,6 +66,8 @@ /* 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 */ /* */ /**************************************************************************/ VOID _ux_hcd_sim_host_periodic_schedule(UX_HCD_SIM_HOST *hcd_sim_host) diff --git a/common/core/src/ux_hcd_sim_host_periodic_tree_create.c b/common/core/src/ux_hcd_sim_host_periodic_tree_create.c index 87669a6..ff9491c 100644 --- a/common/core/src/ux_hcd_sim_host_periodic_tree_create.c +++ b/common/core/src/ux_hcd_sim_host_periodic_tree_create.c @@ -34,7 +34,7 @@ /* FUNCTION RELEASE */ /* */ /* _ux_hcd_sim_host_periodic_tree_create PORTABLE C */ -/* 6.0 */ +/* 6.1 */ /* AUTHOR */ /* */ /* Chaoqiong Xiao, Microsoft Corporation */ @@ -65,6 +65,8 @@ /* 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 */ /* */ /**************************************************************************/ UINT _ux_hcd_sim_host_periodic_tree_create(UX_HCD_SIM_HOST *hcd_sim_host) diff --git a/common/core/src/ux_hcd_sim_host_port_reset.c b/common/core/src/ux_hcd_sim_host_port_reset.c index 6974740..8be6740 100644 --- a/common/core/src/ux_hcd_sim_host_port_reset.c +++ b/common/core/src/ux_hcd_sim_host_port_reset.c @@ -36,7 +36,7 @@ /* FUNCTION RELEASE */ /* */ /* _ux_hcd_sim_host_port_reset PORTABLE C */ -/* 6.0 */ +/* 6.1 */ /* AUTHOR */ /* */ /* Chaoqiong Xiao, Microsoft Corporation */ @@ -68,6 +68,8 @@ /* 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 */ /* */ /**************************************************************************/ UINT _ux_hcd_sim_host_port_reset(UX_HCD_SIM_HOST *hcd_sim_host, ULONG port_index) diff --git a/common/core/src/ux_hcd_sim_host_port_status_get.c b/common/core/src/ux_hcd_sim_host_port_status_get.c index 50555f3..8c32526 100644 --- a/common/core/src/ux_hcd_sim_host_port_status_get.c +++ b/common/core/src/ux_hcd_sim_host_port_status_get.c @@ -34,7 +34,7 @@ /* FUNCTION RELEASE */ /* */ /* _ux_hcd_sim_host_port_status_get PORTABLE C */ -/* 6.0 */ +/* 6.1 */ /* AUTHOR */ /* */ /* Chaoqiong Xiao, Microsoft Corporation */ @@ -91,6 +91,8 @@ /* 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 */ /* */ /**************************************************************************/ ULONG _ux_hcd_sim_host_port_status_get(UX_HCD_SIM_HOST *hcd_sim_host, ULONG port_index) diff --git a/common/core/src/ux_hcd_sim_host_regular_td_obtain.c b/common/core/src/ux_hcd_sim_host_regular_td_obtain.c index ade397e..f3973ef 100644 --- a/common/core/src/ux_hcd_sim_host_regular_td_obtain.c +++ b/common/core/src/ux_hcd_sim_host_regular_td_obtain.c @@ -34,7 +34,7 @@ /* FUNCTION RELEASE */ /* */ /* _ux_hcd_sim_host_regular_td_obtain PORTABLE C */ -/* 6.0 */ +/* 6.1 */ /* AUTHOR */ /* */ /* Chaoqiong Xiao, Microsoft Corporation */ @@ -66,6 +66,10 @@ /* DATE NAME DESCRIPTION */ /* */ /* 05-19-2020 Chaoqiong Xiao Initial Version 6.0 */ +/* 09-30-2020 Chaoqiong Xiao Modified comment(s), */ +/* verified memset and memcpy */ +/* cases, */ +/* resulting in version 6.1 */ /* */ /**************************************************************************/ UX_HCD_SIM_HOST_TD *_ux_hcd_sim_host_regular_td_obtain(UX_HCD_SIM_HOST *hcd_sim_host) @@ -89,7 +93,7 @@ ULONG td_index; { /* The TD may have been used, so we reset all fields. */ - _ux_utility_memory_set(td, 0, sizeof(UX_HCD_SIM_HOST_TD)); + _ux_utility_memory_set(td, 0, sizeof(UX_HCD_SIM_HOST_TD)); /* Use case of memset is verified. */ /* This TD is now marked as USED. */ td -> ux_sim_host_td_status = UX_USED; diff --git a/common/core/src/ux_hcd_sim_host_request_bulk_transfer.c b/common/core/src/ux_hcd_sim_host_request_bulk_transfer.c index 28c72aa..4036ba3 100644 --- a/common/core/src/ux_hcd_sim_host_request_bulk_transfer.c +++ b/common/core/src/ux_hcd_sim_host_request_bulk_transfer.c @@ -34,7 +34,7 @@ /* FUNCTION RELEASE */ /* */ /* _ux_hcd_sim_host_request_bulk_transfer PORTABLE C */ -/* 6.0 */ +/* 6.1 */ /* AUTHOR */ /* */ /* Chaoqiong Xiao, Microsoft Corporation */ @@ -69,6 +69,8 @@ /* 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 */ /* */ /**************************************************************************/ UINT _ux_hcd_sim_host_request_bulk_transfer(UX_HCD_SIM_HOST *hcd_sim_host, UX_TRANSFER *transfer_request) diff --git a/common/core/src/ux_hcd_sim_host_request_control_transfer.c b/common/core/src/ux_hcd_sim_host_request_control_transfer.c index 9e0a2e0..f1d8de1 100644 --- a/common/core/src/ux_hcd_sim_host_request_control_transfer.c +++ b/common/core/src/ux_hcd_sim_host_request_control_transfer.c @@ -35,7 +35,7 @@ /* FUNCTION RELEASE */ /* */ /* _ux_hcd_sim_host_request_control_transfer PORTABLE C */ -/* 6.0 */ +/* 6.1 */ /* AUTHOR */ /* */ /* Chaoqiong Xiao, Microsoft Corporation */ @@ -74,6 +74,9 @@ /* DATE NAME DESCRIPTION */ /* */ /* 05-19-2020 Chaoqiong Xiao Initial Version 6.0 */ +/* 09-30-2020 Chaoqiong Xiao Modified comment(s), */ +/* prefixed UX to MS_TO_TICK, */ +/* resulting in version 6.1 */ /* */ /**************************************************************************/ UINT _ux_hcd_sim_host_request_control_transfer(UX_HCD_SIM_HOST *hcd_sim_host, UX_TRANSFER *transfer_request) @@ -292,7 +295,7 @@ UCHAR *data_pointer; hcd_sim_host -> ux_hcd_sim_host_queue_empty = UX_FALSE; /* Wait for the completion of the transfer request. */ - status = _ux_utility_semaphore_get(&transfer_request -> ux_transfer_request_semaphore, MS_TO_TICK(UX_CONTROL_TRANSFER_TIMEOUT)); + status = _ux_utility_semaphore_get(&transfer_request -> ux_transfer_request_semaphore, UX_MS_TO_TICK(UX_CONTROL_TRANSFER_TIMEOUT)); /* If the semaphore did not succeed we probably have a time out. */ if (status != UX_SUCCESS) diff --git a/common/core/src/ux_hcd_sim_host_request_interupt_transfer.c b/common/core/src/ux_hcd_sim_host_request_interupt_transfer.c index 02ab430..71cf33a 100644 --- a/common/core/src/ux_hcd_sim_host_request_interupt_transfer.c +++ b/common/core/src/ux_hcd_sim_host_request_interupt_transfer.c @@ -34,7 +34,7 @@ /* FUNCTION RELEASE */ /* */ /* _ux_hcd_sim_host_request_interrupt_transfer PORTABLE C */ -/* 6.0 */ +/* 6.1 */ /* AUTHOR */ /* */ /* Chaoqiong Xiao, Microsoft Corporation */ @@ -68,6 +68,8 @@ /* 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 */ /* */ /**************************************************************************/ UINT _ux_hcd_sim_host_request_interrupt_transfer(UX_HCD_SIM_HOST *hcd_sim_host, UX_TRANSFER *transfer_request) diff --git a/common/core/src/ux_hcd_sim_host_request_isochronous_transfer.c b/common/core/src/ux_hcd_sim_host_request_isochronous_transfer.c index fd037ce..d48b0d7 100644 --- a/common/core/src/ux_hcd_sim_host_request_isochronous_transfer.c +++ b/common/core/src/ux_hcd_sim_host_request_isochronous_transfer.c @@ -34,7 +34,7 @@ /* FUNCTION RELEASE */ /* */ /* _ux_hcd_sim_host_request_isochronous_transfer PORTABLE C */ -/* 6.0 */ +/* 6.1 */ /* AUTHOR */ /* */ /* Chaoqiong Xiao, Microsoft Corporation */ @@ -66,6 +66,8 @@ /* 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 */ /* */ /**************************************************************************/ UINT _ux_hcd_sim_host_request_isochronous_transfer(UX_HCD_SIM_HOST *hcd_sim_host, UX_TRANSFER *transfer_request) diff --git a/common/core/src/ux_hcd_sim_host_request_transfer.c b/common/core/src/ux_hcd_sim_host_request_transfer.c index 827856b..b422e2d 100644 --- a/common/core/src/ux_hcd_sim_host_request_transfer.c +++ b/common/core/src/ux_hcd_sim_host_request_transfer.c @@ -34,7 +34,7 @@ /* FUNCTION RELEASE */ /* */ /* _ux_hcd_sim_host_request_transfer PORTABLE C */ -/* 6.0 */ +/* 6.1 */ /* AUTHOR */ /* */ /* Chaoqiong Xiao, Microsoft Corporation */ @@ -75,6 +75,8 @@ /* 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 */ /* */ /**************************************************************************/ UINT _ux_hcd_sim_host_request_transfer(UX_HCD_SIM_HOST *hcd_sim_host, UX_TRANSFER *transfer_request) diff --git a/common/core/src/ux_hcd_sim_host_timer_function.c b/common/core/src/ux_hcd_sim_host_timer_function.c index f65e0c0..673fbe0 100644 --- a/common/core/src/ux_hcd_sim_host_timer_function.c +++ b/common/core/src/ux_hcd_sim_host_timer_function.c @@ -35,7 +35,7 @@ /* FUNCTION RELEASE */ /* */ /* _ux_hcd_sim_host_timer_function PORTABLE C */ -/* 6.0 */ +/* 6.1 */ /* AUTHOR */ /* */ /* Chaoqiong Xiao, Microsoft Corporation */ @@ -66,6 +66,8 @@ /* 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 */ /* */ /**************************************************************************/ VOID _ux_hcd_sim_host_timer_function(ULONG hcd_sim_host_addr) diff --git a/common/core/src/ux_hcd_sim_host_transaction_schedule.c b/common/core/src/ux_hcd_sim_host_transaction_schedule.c index af75c68..58e6127 100644 --- a/common/core/src/ux_hcd_sim_host_transaction_schedule.c +++ b/common/core/src/ux_hcd_sim_host_transaction_schedule.c @@ -36,7 +36,7 @@ /* FUNCTION RELEASE */ /* */ /* _ux_hcd_sim_host_transaction_schedule PORTABLE C */ -/* 6.0 */ +/* 6.1 */ /* AUTHOR */ /* */ /* Chaoqiong Xiao, Microsoft Corporation */ @@ -73,6 +73,10 @@ /* DATE NAME DESCRIPTION */ /* */ /* 05-19-2020 Chaoqiong Xiao Initial Version 6.0 */ +/* 09-30-2020 Chaoqiong Xiao Modified comment(s), */ +/* verified memset and memcpy */ +/* cases, */ +/* resulting in version 6.1 */ /* */ /**************************************************************************/ UINT _ux_hcd_sim_host_transaction_schedule(UX_HCD_SIM_HOST *hcd_sim_host, UX_HCD_SIM_HOST_ED *ed) @@ -152,7 +156,7 @@ UX_SLAVE_DCD *dcd; /* Move the buffer from the host TD to the device TD. */ _ux_utility_memory_copy(slave_transfer_request -> ux_slave_transfer_request_setup, td -> ux_sim_host_td_buffer, - td -> ux_sim_host_td_length); + td -> ux_sim_host_td_length); /* Use case of memcpy is verified. */ /* The setup phase never fails. We acknowledge the transfer code here by taking the TD out of the endpoint. */ ed -> ux_sim_host_ed_head_td = td -> ux_sim_host_td_next_td; @@ -173,6 +177,10 @@ UX_SLAVE_DCD *dcd; /* Get the length we expect from the SETUP packet. */ slave_transfer_request -> ux_slave_transfer_request_requested_length = _ux_utility_short_get(slave_transfer_request -> ux_slave_transfer_request_setup + 6); + /* Avoid buffer overflow. */ + if (slave_transfer_request -> ux_slave_transfer_request_requested_length > UX_SLAVE_REQUEST_CONTROL_MAX_LENGTH) + slave_transfer_request -> ux_slave_transfer_request_requested_length = UX_SLAVE_REQUEST_CONTROL_MAX_LENGTH; + /* Reset what we have received so far. */ slave_transfer_request -> ux_slave_transfer_request_actual_length = 0; @@ -195,7 +203,7 @@ UX_SLAVE_DCD *dcd; /* Copy the amount of data in the td into the slave transaction buffer. */ _ux_utility_memory_copy(slave_transfer_request -> ux_slave_transfer_request_current_data_pointer, data_td -> ux_sim_host_td_buffer, - data_td -> ux_sim_host_td_length); + data_td -> ux_sim_host_td_length); /* Use case of memcpy is verified. */ /* Add to the actual payload length. */ slave_transfer_request -> ux_slave_transfer_request_actual_length += data_td -> ux_sim_host_td_length; @@ -363,13 +371,13 @@ UX_SLAVE_DCD *dcd; /* Send the requested host data to the device. */ _ux_utility_memory_copy(slave_transfer_request -> ux_slave_transfer_request_current_data_pointer, td -> ux_sim_host_td_buffer, - transaction_length); + transaction_length); /* Use case of memcpy is verified. */ else /* Send the requested host data to the device. */ _ux_utility_memory_copy(td -> ux_sim_host_td_buffer, slave_transfer_request -> ux_slave_transfer_request_current_data_pointer, - transaction_length); + transaction_length); /* Use case of memcpy is verified. */ /* Update buffers. */ td -> ux_sim_host_td_buffer += transaction_length; diff --git a/common/core/src/ux_hcd_sim_host_transfer_abort.c b/common/core/src/ux_hcd_sim_host_transfer_abort.c index a205018..c7dfbd2 100644 --- a/common/core/src/ux_hcd_sim_host_transfer_abort.c +++ b/common/core/src/ux_hcd_sim_host_transfer_abort.c @@ -35,7 +35,7 @@ /* FUNCTION RELEASE */ /* */ /* _ux_hcd_sim_host_transfer_abort PORTABLE C */ -/* 6.0 */ +/* 6.1 */ /* AUTHOR */ /* */ /* Chaoqiong Xiao, Microsoft Corporation */ @@ -67,6 +67,8 @@ /* 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 */ /* */ /**************************************************************************/ UINT _ux_hcd_sim_host_transfer_abort(UX_HCD_SIM_HOST *hcd_sim_host, UX_TRANSFER *transfer_request) diff --git a/common/core/src/ux_host_class_dpump_activate.c b/common/core/src/ux_host_class_dpump_activate.c index 1a69150..c9b4863 100644 --- a/common/core/src/ux_host_class_dpump_activate.c +++ b/common/core/src/ux_host_class_dpump_activate.c @@ -35,7 +35,7 @@ /* FUNCTION RELEASE */ /* */ /* _ux_host_class_dpump_activate PORTABLE C */ -/* 6.0 */ +/* 6.1 */ /* AUTHOR */ /* */ /* Chaoqiong Xiao, Microsoft Corporation */ @@ -70,6 +70,8 @@ /* 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 */ /* */ /**************************************************************************/ UINT _ux_host_class_dpump_activate(UX_HOST_CLASS_COMMAND *command) diff --git a/common/core/src/ux_host_class_dpump_configure.c b/common/core/src/ux_host_class_dpump_configure.c index 5b3867d..bc276e4 100644 --- a/common/core/src/ux_host_class_dpump_configure.c +++ b/common/core/src/ux_host_class_dpump_configure.c @@ -35,7 +35,7 @@ /* FUNCTION RELEASE */ /* */ /* _ux_host_class_dpump_configure PORTABLE C */ -/* 6.0 */ +/* 6.1 */ /* AUTHOR */ /* */ /* Chaoqiong Xiao, Microsoft Corporation */ @@ -69,6 +69,10 @@ /* DATE NAME DESCRIPTION */ /* */ /* 05-19-2020 Chaoqiong Xiao Initial Version 6.0 */ +/* 09-30-2020 Chaoqiong Xiao Modified comment(s), */ +/* optimized based on compile */ +/* definitions, */ +/* resulting in version 6.1 */ /* */ /**************************************************************************/ UINT _ux_host_class_dpump_configure(UX_HOST_CLASS_DPUMP *dpump) @@ -76,7 +80,9 @@ UINT _ux_host_class_dpump_configure(UX_HOST_CLASS_DPUMP *dpump) UINT status; UX_CONFIGURATION *configuration; +#if UX_MAX_DEVICES > 1 UX_DEVICE *parent_device; +#endif /* If the device has been configured already, we don't need to do it @@ -98,7 +104,8 @@ UX_DEVICE *parent_device; return(UX_CONFIGURATION_HANDLE_UNKNOWN); } - + +#if UX_MAX_DEVICES > 1 /* Check the dpump power source and check the parent power source for incompatible connections. */ if (dpump -> ux_host_class_dpump_device -> ux_device_power_source == UX_DEVICE_BUS_POWERED) @@ -118,6 +125,7 @@ UX_DEVICE *parent_device; return(UX_CONNECTION_INCOMPATIBLE); } } +#endif /* We have the valid configuration. Ask the USBX stack to set this configuration. */ status = _ux_host_stack_device_configuration_select(configuration); diff --git a/common/core/src/ux_host_class_dpump_deactivate.c b/common/core/src/ux_host_class_dpump_deactivate.c index 3fab273..23426c3 100644 --- a/common/core/src/ux_host_class_dpump_deactivate.c +++ b/common/core/src/ux_host_class_dpump_deactivate.c @@ -35,7 +35,7 @@ /* FUNCTION RELEASE */ /* */ /* _ux_host_class_dpump_deactivate PORTABLE C */ -/* 6.0 */ +/* 6.1 */ /* AUTHOR */ /* */ /* Chaoqiong Xiao, Microsoft Corporation */ @@ -72,6 +72,8 @@ /* 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 */ /* */ /**************************************************************************/ UINT _ux_host_class_dpump_deactivate(UX_HOST_CLASS_COMMAND *command) diff --git a/common/core/src/ux_host_class_dpump_endpoints_get.c b/common/core/src/ux_host_class_dpump_endpoints_get.c index 466c423..453e481 100644 --- a/common/core/src/ux_host_class_dpump_endpoints_get.c +++ b/common/core/src/ux_host_class_dpump_endpoints_get.c @@ -35,7 +35,7 @@ /* FUNCTION RELEASE */ /* */ /* _ux_host_class_dpump_endpoints_get PORTABLE C */ -/* 6.0 */ +/* 6.1 */ /* AUTHOR */ /* */ /* Chaoqiong Xiao, Microsoft Corporation */ @@ -66,6 +66,8 @@ /* 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 */ /* */ /**************************************************************************/ UINT _ux_host_class_dpump_endpoints_get(UX_HOST_CLASS_DPUMP *dpump) diff --git a/common/core/src/ux_host_class_dpump_entry.c b/common/core/src/ux_host_class_dpump_entry.c index 6be5385..58bfaf1 100644 --- a/common/core/src/ux_host_class_dpump_entry.c +++ b/common/core/src/ux_host_class_dpump_entry.c @@ -35,7 +35,7 @@ /* FUNCTION RELEASE */ /* */ /* _ux_host_class_dpump_entry PORTABLE C */ -/* 6.0 */ +/* 6.1 */ /* AUTHOR */ /* */ /* Chaoqiong Xiao, Microsoft Corporation */ @@ -68,6 +68,8 @@ /* 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 */ /* */ /**************************************************************************/ UINT _ux_host_class_dpump_entry(UX_HOST_CLASS_COMMAND *command) diff --git a/common/core/src/ux_host_class_dpump_ioctl.c b/common/core/src/ux_host_class_dpump_ioctl.c index 7e197ea..acc728d 100644 --- a/common/core/src/ux_host_class_dpump_ioctl.c +++ b/common/core/src/ux_host_class_dpump_ioctl.c @@ -35,7 +35,7 @@ /* FUNCTION RELEASE */ /* */ /* _ux_host_class_dpump_ioctl PORTABLE C */ -/* 6.0 */ +/* 6.1 */ /* AUTHOR */ /* */ /* Chaoqiong Xiao, Microsoft Corporation */ @@ -69,6 +69,8 @@ /* 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 */ /* */ /**************************************************************************/ UINT _ux_host_class_dpump_ioctl(UX_HOST_CLASS_DPUMP *dpump, ULONG ioctl_function, diff --git a/common/core/src/ux_host_class_dpump_read.c b/common/core/src/ux_host_class_dpump_read.c index 363eb0b..806b801 100644 --- a/common/core/src/ux_host_class_dpump_read.c +++ b/common/core/src/ux_host_class_dpump_read.c @@ -35,7 +35,7 @@ /* FUNCTION RELEASE */ /* */ /* _ux_host_class_dpump_read PORTABLE C */ -/* 6.0 */ +/* 6.1 */ /* AUTHOR */ /* */ /* Chaoqiong Xiao, Microsoft Corporation */ @@ -74,6 +74,8 @@ /* 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 */ /* */ /**************************************************************************/ UINT _ux_host_class_dpump_read(UX_HOST_CLASS_DPUMP *dpump, UCHAR *data_pointer, diff --git a/common/core/src/ux_host_class_dpump_write.c b/common/core/src/ux_host_class_dpump_write.c index ceba568..d1a714b 100644 --- a/common/core/src/ux_host_class_dpump_write.c +++ b/common/core/src/ux_host_class_dpump_write.c @@ -35,7 +35,7 @@ /* FUNCTION RELEASE */ /* */ /* _ux_host_class_dpump_write PORTABLE C */ -/* 6.0 */ +/* 6.1 */ /* AUTHOR */ /* */ /* Chaoqiong Xiao, Microsoft Corporation */ @@ -74,6 +74,8 @@ /* 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 */ /* */ /**************************************************************************/ UINT _ux_host_class_dpump_write(UX_HOST_CLASS_DPUMP *dpump, UCHAR * data_pointer, diff --git a/common/core/src/ux_host_stack_bandwidth_check.c b/common/core/src/ux_host_stack_bandwidth_check.c index aa2e6c9..fab117a 100644 --- a/common/core/src/ux_host_stack_bandwidth_check.c +++ b/common/core/src/ux_host_stack_bandwidth_check.c @@ -29,12 +29,13 @@ #include "ux_host_stack.h" +#if UX_MAX_DEVICES > 1 /**************************************************************************/ /* */ /* FUNCTION RELEASE */ /* */ /* _ux_host_stack_bandwidth_check PORTABLE C */ -/* 6.0 */ +/* 6.1 */ /* AUTHOR */ /* */ /* Chaoqiong Xiao, Microsoft Corporation */ @@ -75,6 +76,10 @@ /* DATE NAME DESCRIPTION */ /* */ /* 05-19-2020 Chaoqiong Xiao Initial Version 6.0 */ +/* 09-30-2020 Chaoqiong Xiao Modified comment(s), */ +/* optimized based on compile */ +/* definitions, */ +/* resulting in version 6.1 */ /* */ /**************************************************************************/ UINT _ux_host_stack_bandwidth_check(UX_HCD *hcd, UX_ENDPOINT *endpoint) @@ -267,4 +272,4 @@ const UCHAR overheads[4][3] = { /* We get here when we have not found a 2.0 hub in the list and we got to the root port. */ return(UX_SUCCESS); } - +#endif /* #if UX_MAX_DEVICES > 1 */ diff --git a/common/core/src/ux_host_stack_bandwidth_claim.c b/common/core/src/ux_host_stack_bandwidth_claim.c index 1227bc4..5001d80 100644 --- a/common/core/src/ux_host_stack_bandwidth_claim.c +++ b/common/core/src/ux_host_stack_bandwidth_claim.c @@ -29,12 +29,13 @@ #include "ux_host_stack.h" +#if UX_MAX_DEVICES > 1 /**************************************************************************/ /* */ /* FUNCTION RELEASE */ /* */ /* _ux_host_stack_bandwidth_claim PORTABLE C */ -/* 6.0 */ +/* 6.1 */ /* AUTHOR */ /* */ /* Chaoqiong Xiao, Microsoft Corporation */ @@ -74,6 +75,10 @@ /* DATE NAME DESCRIPTION */ /* */ /* 05-19-2020 Chaoqiong Xiao Initial Version 6.0 */ +/* 09-30-2020 Chaoqiong Xiao Modified comment(s), */ +/* optimized based on compile */ +/* definitions, */ +/* resulting in version 6.1 */ /* */ /**************************************************************************/ VOID _ux_host_stack_bandwidth_claim(UX_HCD *hcd, UX_ENDPOINT *endpoint) @@ -242,3 +247,4 @@ const UCHAR overheads[4][3] = { to the root port. */ return; } +#endif /* #if UX_MAX_DEVICES > 1 */ diff --git a/common/core/src/ux_host_stack_bandwidth_release.c b/common/core/src/ux_host_stack_bandwidth_release.c index 082af6f..c1469e0 100644 --- a/common/core/src/ux_host_stack_bandwidth_release.c +++ b/common/core/src/ux_host_stack_bandwidth_release.c @@ -29,12 +29,13 @@ #include "ux_host_stack.h" +#if UX_MAX_DEVICES > 1 /**************************************************************************/ /* */ /* FUNCTION RELEASE */ /* */ /* _ux_host_stack_bandwidth_release PORTABLE C */ -/* 6.0 */ +/* 6.1 */ /* AUTHOR */ /* */ /* Chaoqiong Xiao, Microsoft Corporation */ @@ -73,6 +74,10 @@ /* DATE NAME DESCRIPTION */ /* */ /* 05-19-2020 Chaoqiong Xiao Initial Version 6.0 */ +/* 09-30-2020 Chaoqiong Xiao Modified comment(s), */ +/* optimized based on compile */ +/* definitions, */ +/* resulting in version 6.1 */ /* */ /**************************************************************************/ VOID _ux_host_stack_bandwidth_release(UX_HCD *hcd, UX_ENDPOINT *endpoint) @@ -237,4 +242,4 @@ const UCHAR overheads[4][3] = { to the root port. */ return; } - +#endif /* #if UX_MAX_DEVICES > 1 */ diff --git a/common/core/src/ux_host_stack_class_call.c b/common/core/src/ux_host_stack_class_call.c index f3a8513..710e683 100644 --- a/common/core/src/ux_host_stack_class_call.c +++ b/common/core/src/ux_host_stack_class_call.c @@ -34,7 +34,7 @@ /* FUNCTION RELEASE */ /* */ /* _ux_host_stack_class_call PORTABLE C */ -/* 6.0 */ +/* 6.1 */ /* AUTHOR */ /* */ /* Chaoqiong Xiao, Microsoft Corporation */ @@ -66,44 +66,51 @@ /* DATE NAME DESCRIPTION */ /* */ /* 05-19-2020 Chaoqiong Xiao Initial Version 6.0 */ +/* 09-30-2020 Chaoqiong Xiao Modified comment(s), */ +/* optimized based on compile */ +/* definitions, */ +/* resulting in version 6.1 */ /* */ /**************************************************************************/ UX_HOST_CLASS *_ux_host_stack_class_call(UX_HOST_CLASS_COMMAND *class_command) { -UX_HOST_CLASS *class; +UINT status = UX_NO_CLASS_MATCH; +UX_HOST_CLASS *class_inst; +#if UX_MAX_CLASS_DRIVER > 1 ULONG class_index; -UINT status; - +#endif /* Start from the 1st registered classes with USBX. */ - class = _ux_system_host -> ux_system_host_class_array; + class_inst = _ux_system_host -> ux_system_host_class_array; /* Parse all the class drivers. */ +#if UX_MAX_CLASS_DRIVER > 1 for (class_index = 0; class_index < _ux_system_host -> ux_system_host_max_class; class_index++) { +#endif /* Check if this class driver is used. */ - if (class -> ux_host_class_status == UX_USED) + if (class_inst -> ux_host_class_status == UX_USED) { /* We have found a potential candidate. Call this registered class entry function. */ - status = class -> ux_host_class_entry_function(class_command); + status = class_inst -> ux_host_class_entry_function(class_command); /* The status tells us if the registered class wants to own this class. */ if (status == UX_SUCCESS) { /* Yes, return this class pointer. */ - return(class); + return(class_inst); } } - +#if UX_MAX_CLASS_DRIVER > 1 /* Move to the next registered class. */ - class++; - } + class_inst ++; + } +#endif /* There is no driver who want to own this class! */ return(UX_NULL); } - diff --git a/common/core/src/ux_host_stack_class_device_scan.c b/common/core/src/ux_host_stack_class_device_scan.c index e3ffaa4..5e9d1ae 100644 --- a/common/core/src/ux_host_stack_class_device_scan.c +++ b/common/core/src/ux_host_stack_class_device_scan.c @@ -29,12 +29,19 @@ #include "ux_host_stack.h" +#if !defined(UX_HOST_STACK_DEVICE_DRIVER_SCAN_DISABLE) +#if defined(UX_HOST_STACK_DEVICE_DRIVER_SCAN_VIDPID_DISABLE) && \ + defined(UX_HOST_STACK_DEVICE_DRIVER_SCAN_DCSP_DISABLE) +#error When device driver scan is enabled at least one of scan method must be enabled in (VIDPID, DeviceClassSubclassProtocol) +#endif +#endif + /**************************************************************************/ /* */ /* FUNCTION RELEASE */ /* */ /* _ux_host_stack_class_device_scan PORTABLE C */ -/* 6.0 */ +/* 6.1 */ /* AUTHOR */ /* */ /* Chaoqiong Xiao, Microsoft Corporation */ @@ -67,13 +74,18 @@ /* DATE NAME DESCRIPTION */ /* */ /* 05-19-2020 Chaoqiong Xiao Initial Version 6.0 */ +/* 09-30-2020 Chaoqiong Xiao Modified comment(s), */ +/* used query usage of device */ +/* ClassSubclassProtocol, */ +/* resulting in version 6.1 */ /* */ /**************************************************************************/ UINT _ux_host_stack_class_device_scan(UX_DEVICE *device) { +#if !defined(UX_HOST_STACK_DEVICE_DRIVER_SCAN_DISABLE) UINT status; -UX_HOST_CLASS *class; +UX_HOST_CLASS *class_inst = UX_NULL; UX_HOST_CLASS_COMMAND class_command; /* Perform the command initialization. */ @@ -89,36 +101,30 @@ UX_HOST_CLASS_COMMAND class_command; class_command.ux_host_class_command_iad_subclass = 0; class_command.ux_host_class_command_iad_protocol = 0; +#if !defined(UX_HOST_STACK_DEVICE_DRIVER_SCAN_VIDPID_DISABLE) /* We start with the PID/VID for this device. */ class_command.ux_host_class_command_usage = UX_HOST_CLASS_COMMAND_USAGE_PIDVID; - class = _ux_host_stack_class_call(&class_command); + class_inst = _ux_host_stack_class_call(&class_command); +#endif +#if !defined(UX_HOST_STACK_DEVICE_DRIVER_SCAN_DCSP_DISABLE) /* On return, either we have found a class or the device is still an orphan. */ - if (class != UX_NULL) + if (class_inst == UX_NULL) { - device -> ux_device_class = class; - class_command.ux_host_class_command_class_ptr = class; - class_command.ux_host_class_command_request = UX_HOST_CLASS_COMMAND_ACTIVATE; - status = device -> ux_device_class -> ux_host_class_entry_function(&class_command); + /* It the PID/VID did not work, we continue looking for the Class\Subclass\Protocol match. */ + class_command.ux_host_class_command_usage = UX_HOST_CLASS_COMMAND_USAGE_DCSP; + class_inst = _ux_host_stack_class_call(&class_command); - /* Return result of activation. */ - return(status); } - - /* It the PID/VID did not work, we continue looking for the Class\Subclass\Protocol match. */ - class_command.ux_host_class_command_request = UX_HOST_CLASS_COMMAND_QUERY; - class_command.ux_host_class_command_container = (VOID *) device; - class_command.ux_host_class_command_usage = UX_HOST_CLASS_COMMAND_USAGE_CSP; - - class = _ux_host_stack_class_call(&class_command); +#endif /* On return, either we have found a class or the device is still an orphan. */ - if (class != UX_NULL) + if (class_inst != UX_NULL) { - device -> ux_device_class = class; - class_command.ux_host_class_command_class_ptr = class; + device -> ux_device_class = class_inst; + class_command.ux_host_class_command_class_ptr = class_inst; class_command.ux_host_class_command_request = UX_HOST_CLASS_COMMAND_ACTIVATE; status = device -> ux_device_class -> ux_host_class_entry_function(&class_command); @@ -126,6 +132,8 @@ UX_HOST_CLASS_COMMAND class_command; return(status); } +#endif + /* Return an error. */ return(UX_NO_CLASS_MATCH); } diff --git a/common/core/src/ux_host_stack_class_get.c b/common/core/src/ux_host_stack_class_get.c index 121d48b..bb57f3e 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.0 */ +/* 6.1 */ /* AUTHOR */ /* */ /* Chaoqiong Xiao, Microsoft Corporation */ @@ -74,33 +74,46 @@ /* DATE NAME DESCRIPTION */ /* */ /* 05-19-2020 Chaoqiong Xiao Initial Version 6.0 */ +/* 09-30-2020 Chaoqiong Xiao Modified comment(s), */ +/* optimized based on compile */ +/* definitions, */ +/* resulting in version 6.1 */ /* */ /**************************************************************************/ UINT _ux_host_stack_class_get(UCHAR *class_name, UX_HOST_CLASS **host_class) { UX_HOST_CLASS *class_ptr; -ULONG class_index; +#if !defined(UX_NAME_REFERENCED_BY_POINTER) UINT status; UINT class_name_length = 0; +#endif +#if UX_MAX_CLASS_DRIVER > 1 +ULONG class_index; +#endif - +#if !defined(UX_NAME_REFERENCED_BY_POINTER) /* Get the length of the class name (exclude null-terminator). */ status = _ux_utility_string_length_check(class_name, &class_name_length, UX_MAX_CLASS_NAME_LENGTH); if (status) return(status); +#endif - /* We need to parse the class driver table. */ + /* Get first class. */ class_ptr = _ux_system_host -> ux_system_host_class_array; + +#if UX_MAX_CLASS_DRIVER > 1 + /* We need to parse the class driver table. */ for (class_index = 0; class_index < _ux_system_host -> ux_system_host_max_class; class_index++) { +#endif /* Check if this class is already being used. */ if (class_ptr -> ux_host_class_status == UX_USED) { /* We have found a container. Check if this is the one we need (compare including null-terminator). */ - if (_ux_utility_memory_compare(class_ptr -> ux_host_class_name, class_name, class_name_length + 1) == UX_SUCCESS) + if (ux_utility_name_match(class_ptr -> ux_host_class_name, class_name, class_name_length + 1)) { /* The class container was found. Update the pointer to the class container for the caller. */ @@ -111,9 +124,11 @@ UINT class_name_length = 0; } } +#if UX_MAX_CLASS_DRIVER > 1 /* Move to the next class. */ class_ptr++; - } + } +#endif /* If trace is enabled, insert this event into the trace buffer. */ UX_TRACE_IN_LINE_INSERT(UX_TRACE_ERROR, UX_HOST_CLASS_UNKNOWN, class_name, 0, 0, UX_TRACE_ERRORS, 0, 0) diff --git a/common/core/src/ux_host_stack_class_instance_create.c b/common/core/src/ux_host_stack_class_instance_create.c index 2784ca0..068cd3f 100644 --- a/common/core/src/ux_host_stack_class_instance_create.c +++ b/common/core/src/ux_host_stack_class_instance_create.c @@ -34,7 +34,7 @@ /* FUNCTION RELEASE */ /* */ /* _ux_host_stack_class_instance_create PORTABLE C */ -/* 6.0 */ +/* 6.1 */ /* AUTHOR */ /* */ /* Chaoqiong Xiao, Microsoft Corporation */ @@ -69,6 +69,8 @@ /* 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 */ /* */ /**************************************************************************/ UINT _ux_host_stack_class_instance_create(UX_HOST_CLASS *host_class, VOID *class_instance) diff --git a/common/core/src/ux_host_stack_class_instance_destroy.c b/common/core/src/ux_host_stack_class_instance_destroy.c index 0ab3709..7ee71a6 100644 --- a/common/core/src/ux_host_stack_class_instance_destroy.c +++ b/common/core/src/ux_host_stack_class_instance_destroy.c @@ -34,7 +34,7 @@ /* FUNCTION RELEASE */ /* */ /* _ux_host_stack_class_instance_destroy PORTABLE C */ -/* 6.0 */ +/* 6.1 */ /* AUTHOR */ /* */ /* Chaoqiong Xiao, Microsoft Corporation */ @@ -66,6 +66,8 @@ /* 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 */ /* */ /**************************************************************************/ UINT _ux_host_stack_class_instance_destroy(UX_HOST_CLASS *host_class, VOID *class_instance) 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 8259858..63b63f0 100644 --- a/common/core/src/ux_host_stack_class_instance_get.c +++ b/common/core/src/ux_host_stack_class_instance_get.c @@ -34,7 +34,7 @@ /* FUNCTION RELEASE */ /* */ /* _ux_host_stack_class_instance_get PORTABLE C */ -/* 6.0 */ +/* 6.1 */ /* AUTHOR */ /* */ /* Chaoqiong Xiao, Microsoft Corporation */ @@ -71,6 +71,8 @@ /* 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 */ /* */ /**************************************************************************/ UINT _ux_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_instance_verify.c b/common/core/src/ux_host_stack_class_instance_verify.c index 41aa28c..46230cf 100644 --- a/common/core/src/ux_host_stack_class_instance_verify.c +++ b/common/core/src/ux_host_stack_class_instance_verify.c @@ -34,7 +34,7 @@ /* FUNCTION RELEASE */ /* */ /* _ux_host_stack_class_instance_verify PORTABLE C */ -/* 6.0 */ +/* 6.1 */ /* AUTHOR */ /* */ /* Chaoqiong Xiao, Microsoft Corporation */ @@ -70,34 +70,47 @@ /* DATE NAME DESCRIPTION */ /* */ /* 05-19-2020 Chaoqiong Xiao Initial Version 6.0 */ +/* 09-30-2020 Chaoqiong Xiao Modified comment(s), */ +/* optimized based on compile */ +/* definitions, */ +/* resulting in version 6.1 */ /* */ /**************************************************************************/ UINT _ux_host_stack_class_instance_verify(UCHAR *class_name, VOID *class_instance) { -UX_HOST_CLASS *class; -ULONG class_index; -VOID **current_class_instance; -UINT status; -UINT class_name_length = 0; - +UX_HOST_CLASS *class_inst; +#if UX_MAX_CLASS_DRIVER > 1 +ULONG class_index; +#endif +VOID **current_class_instance; +#if !defined(UX_NAME_REFERENCED_BY_POINTER) +UINT status; +UINT class_name_length = 0; +#endif +#if !defined(UX_NAME_REFERENCED_BY_POINTER) /* Get the length of the class name (exclude null-terminator). */ status = _ux_utility_string_length_check(class_name, &class_name_length, UX_MAX_CLASS_NAME_LENGTH); if (status) return(status); +#endif + + /* Get first class. */ + class_inst = _ux_system_host -> ux_system_host_class_array; +#if UX_MAX_CLASS_DRIVER > 1 /* We need to parse the class table. */ - class = _ux_system_host -> ux_system_host_class_array; for(class_index = 0; class_index < _ux_system_host -> ux_system_host_max_class; class_index++) { +#endif /* Check if this class is already used. */ - if (class -> ux_host_class_status == UX_USED) + if (class_inst -> ux_host_class_status == UX_USED) { /* Start with the first class instance attached to the class container. */ - current_class_instance = class -> ux_host_class_first_instance; + current_class_instance = class_inst -> ux_host_class_first_instance; /* Traverse the list of the class instances until we find the correct instance. */ while (current_class_instance != UX_NULL) @@ -109,7 +122,7 @@ UINT class_name_length = 0; { /* We have found the class container. Check if this is the one we need (compare including null-terminator). */ - if (_ux_utility_memory_compare(class -> ux_host_class_name, class_name, class_name_length + 1) == UX_SUCCESS) + if (ux_utility_name_match(class_inst-> ux_host_class_name, class_name, class_name_length + 1)) return(UX_SUCCESS); } @@ -117,11 +130,12 @@ UINT class_name_length = 0; current_class_instance = *current_class_instance; } } +#if UX_MAX_CLASS_DRIVER > 1 /* Move to the next class. */ - class++; + class_inst ++; } - +#endif /* If trace is enabled, insert this event into the trace buffer. */ UX_TRACE_IN_LINE_INSERT(UX_TRACE_ERROR, UX_HOST_CLASS_INSTANCE_UNKNOWN, class_instance, 0, 0, UX_TRACE_ERRORS, 0, 0) @@ -129,4 +143,3 @@ UINT class_name_length = 0; /* This class does not exist. */ return(UX_HOST_CLASS_INSTANCE_UNKNOWN); } - diff --git a/common/core/src/ux_host_stack_class_interface_scan.c b/common/core/src/ux_host_stack_class_interface_scan.c index d202d77..62b39e8 100644 --- a/common/core/src/ux_host_stack_class_interface_scan.c +++ b/common/core/src/ux_host_stack_class_interface_scan.c @@ -34,7 +34,7 @@ /* FUNCTION RELEASE */ /* */ /* _ux_host_stack_class_interface_scan PORTABLE C */ -/* 6.0 */ +/* 6.1 */ /* AUTHOR */ /* */ /* Chaoqiong Xiao, Microsoft Corporation */ @@ -81,6 +81,8 @@ /* 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 */ /* */ /**************************************************************************/ UINT _ux_host_stack_class_interface_scan(UX_DEVICE *device) diff --git a/common/core/src/ux_host_stack_class_register.c b/common/core/src/ux_host_stack_class_register.c index 5628401..d8570db 100644 --- a/common/core/src/ux_host_stack_class_register.c +++ b/common/core/src/ux_host_stack_class_register.c @@ -12,8 +12,8 @@ /**************************************************************************/ /**************************************************************************/ -/** */ -/** USBX Component */ +/** */ +/** USBX Component */ /** */ /** Host Stack */ /** */ @@ -29,89 +29,111 @@ #include "ux_host_stack.h" -/**************************************************************************/ -/* */ -/* FUNCTION RELEASE */ -/* */ -/* _ux_host_stack_class_register PORTABLE C */ -/* 6.0 */ +/**************************************************************************/ +/* */ +/* FUNCTION RELEASE */ +/* */ +/* _ux_host_stack_class_register PORTABLE C */ +/* 6.1 */ /* AUTHOR */ /* */ /* Chaoqiong Xiao, Microsoft Corporation */ /* */ /* DESCRIPTION */ -/* */ -/* This function registers a USB class to the USB stack. The Class */ -/* must specify an entry point for the USB stack to send commands */ +/* */ +/* This function registers a USB class to the USB stack. The Class */ +/* must specify an entry point for the USB stack to send commands */ /* such as: */ /* */ /* UX_HOST_CLASS_COMMAND_QUERY */ /* UX_HOST_CLASS_COMMAND_ACTIVATE */ -/* UX_HOST_CLASS_COMMAND_DESTROY */ +/* UX_HOST_CLASS_COMMAND_DESTROY */ /* */ /* Note: The C string of class_name must be NULL-terminated and the */ /* length of it (without the NULL-terminator itself) must be no larger */ /* than UX_MAX_CLASS_NAME_LENGTH. */ -/* */ -/* INPUT */ -/* */ -/* class_name Name of class */ -/* class_entry_function Entry function of the class */ -/* */ -/* OUTPUT */ -/* */ -/* Completion Status */ -/* */ -/* CALLS */ -/* */ +/* */ +/* INPUT */ +/* */ +/* class_name Name of class */ +/* class_entry_function Entry function of the class */ +/* */ +/* OUTPUT */ +/* */ +/* Completion Status */ +/* */ +/* CALLS */ +/* */ /* _ux_utility_string_length_check Check C string and return */ /* length if null-terminated */ -/* _ux_utility_memory_copy Copy memory block */ -/* */ -/* CALLED BY */ -/* */ -/* Application */ -/* USBX Components */ -/* */ -/* RELEASE HISTORY */ -/* */ -/* DATE NAME DESCRIPTION */ -/* */ +/* _ux_utility_memory_copy Copy memory block */ +/* */ +/* CALLED BY */ +/* */ +/* Application */ +/* USBX Components */ +/* */ +/* 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 */ +/* definitions, verified */ +/* memset and memcpy cases, */ +/* resulting in version 6.1 */ /* */ /**************************************************************************/ UINT _ux_host_stack_class_register(UCHAR *class_name, UINT (*class_entry_function)(struct UX_HOST_CLASS_COMMAND_STRUCT *)) { -UX_HOST_CLASS *class; -ULONG class_index; +UX_HOST_CLASS *class_inst; +#if !defined(UX_NAME_REFERENCED_BY_POINTER) UINT status; UINT class_name_length = 0; +#endif +#if UX_MAX_CLASS_DRIVER > 1 +ULONG class_index; +#endif + /* If trace is enabled, insert this event into the trace buffer. */ + UX_TRACE_IN_LINE_INSERT(UX_TRACE_HOST_STACK_CLASS_REGISTER, class_name, class_entry_function, 0, 0, UX_TRACE_HOST_STACK_EVENTS, 0, 0) +#if !defined(UX_NAME_REFERENCED_BY_POINTER) /* Get the length of the class name (exclude null-terminator). */ status = _ux_utility_string_length_check(class_name, &class_name_length, UX_MAX_CLASS_NAME_LENGTH); if (status) return(status); +#endif + /* Get first class. */ + class_inst = _ux_system_host -> ux_system_host_class_array; + +#if UX_MAX_CLASS_DRIVER > 1 /* We need to parse the class table to find an empty spot. */ - class = _ux_system_host -> ux_system_host_class_array; for (class_index = 0; class_index < _ux_system_host -> ux_system_host_max_class; class_index++) { +#endif /* Check if this class is already used. */ - if (class -> ux_host_class_status == UX_UNUSED) + if (class_inst -> ux_host_class_status == UX_UNUSED) { +#if defined(UX_NAME_REFERENCED_BY_POINTER) + class_inst -> ux_host_class_name = (const UCHAR *) class_name; +#else + /* We have found a free container for the class. Copy the name (with null-terminator). */ - _ux_utility_memory_copy(class -> ux_host_class_name, class_name, class_name_length + 1); - + _ux_utility_memory_copy(class_inst -> ux_host_class_name, class_name, class_name_length + 1); /* Use case of memcpy is verified. */ +#endif + /* Memorize the entry function of this class. */ - class -> ux_host_class_entry_function = class_entry_function; + class_inst -> ux_host_class_entry_function = class_entry_function; /* Mark it as used. */ - class -> ux_host_class_status = UX_USED; + class_inst -> ux_host_class_status = UX_USED; /* Return successful completion. */ return(UX_SUCCESS); @@ -123,7 +145,7 @@ UINT class_name_length = 0; { /* Check for an already installed class entry function. */ - if(class -> ux_host_class_entry_function == class_entry_function) + if(class_inst -> ux_host_class_entry_function == class_entry_function) { /* Error trap. */ @@ -136,11 +158,12 @@ UINT class_name_length = 0; return(UX_HOST_CLASS_ALREADY_INSTALLED); } } - +#if UX_MAX_CLASS_DRIVER > 1 /* Move to the next class. */ - class++; - } - + class_inst ++; + } +#endif + /* If trace is enabled, insert this event into the trace buffer. */ UX_TRACE_IN_LINE_INSERT(UX_TRACE_ERROR, UX_MEMORY_ARRAY_FULL, class_name, 0, 0, UX_TRACE_ERRORS, 0, 0) @@ -150,4 +173,3 @@ UINT class_name_length = 0; /* No more entries in the class table. */ return(UX_MEMORY_ARRAY_FULL); } - diff --git a/common/core/src/ux_host_stack_class_unregister.c b/common/core/src/ux_host_stack_class_unregister.c new file mode 100644 index 0000000..69b4194 --- /dev/null +++ b/common/core/src/ux_host_stack_class_unregister.c @@ -0,0 +1,125 @@ +/**************************************************************************/ +/* */ +/* 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 */ +/** */ +/** Host Stack */ +/** */ +/**************************************************************************/ +/**************************************************************************/ + + +/* Include necessary system files. */ + +#define UX_SOURCE_CODE + +#include "ux_api.h" +#include "ux_host_stack.h" + + +/**************************************************************************/ +/* */ +/* FUNCTION RELEASE */ +/* */ +/* _ux_host_stack_class_unregister PORTABLE C */ +/* 6.1 */ +/* AUTHOR */ +/* */ +/* Chaoqiong Xiao, Microsoft Corporation */ +/* */ +/* DESCRIPTION */ +/* */ +/* This function unregisters a USB class from the USB stack. */ +/* */ +/* Note following steps must be done before host class unregister: */ +/* All devices related to the class must be removed. */ +/* */ +/* INPUT */ +/* */ +/* class_name Name of class */ +/* class_entry_function Entry function of the class */ +/* */ +/* OUTPUT */ +/* */ +/* Completion Status */ +/* UX_SUCCESS Class unregistered */ +/* UX_NO_CLASS_MATCH Class not found */ +/* */ +/* CALLS */ +/* */ +/* (class_entry_function) Entry function of the class */ +/* */ +/* CALLED BY */ +/* */ +/* Application */ +/* USBX Components */ +/* */ +/* RELEASE HISTORY */ +/* */ +/* DATE NAME DESCRIPTION */ +/* */ +/* 09-30-2020 Chaoqiong Xiao Initial Version 6.1 */ +/* */ +/**************************************************************************/ +UINT _ux_host_stack_class_unregister(UINT (*class_entry_function)(struct UX_HOST_CLASS_COMMAND_STRUCT *)) +{ + +UX_HOST_CLASS *class_inst; +UX_HOST_CLASS_COMMAND class_command; +#if UX_MAX_CLASS_DRIVER > 1 +ULONG class_index; +#endif + + + /* If trace is enabled, insert this event into the trace buffer. */ + UX_TRACE_IN_LINE_INSERT(UX_TRACE_HOST_STACK_CLASS_UNREGISTER, class_entry_function, 0, 0, 0, UX_TRACE_HOST_STACK_EVENTS, 0, 0) + + /* Get first class. */ + class_inst = _ux_system_host -> ux_system_host_class_array; + +#if UX_MAX_CLASS_DRIVER > 1 + /* We need to parse the class table to find right class instance. */ + for (class_index = 0; class_index < _ux_system_host -> ux_system_host_max_class; class_index++) + { +#endif + + /* Check if the class is expected. */ + if (class_inst -> ux_host_class_entry_function == class_entry_function) + { + + /* Initialize the class command with the generic parameters. */ + class_command.ux_host_class_command_request = UX_HOST_CLASS_COMMAND_DESTROY; + class_command.ux_host_class_command_class_ptr = (VOID *)class_inst; + + /* Invoke command for class destroy. */ + class_inst -> ux_host_class_entry_function(&class_command); + + /* Mark as free. */ + class_inst -> ux_host_class_entry_function = UX_NULL; + class_inst -> ux_host_class_status = UX_UNUSED; + + /* Class unregistered success. */ + return(UX_SUCCESS); + } + +#if UX_MAX_CLASS_DRIVER > 1 + /* Move to the next class. */ + class_inst ++; + } +#endif + + /* No more entries in the class table. */ + return(UX_NO_CLASS_MATCH); +} diff --git a/common/core/src/ux_host_stack_configuration_descriptor_parse.c b/common/core/src/ux_host_stack_configuration_descriptor_parse.c index 4677860..4984dbc 100644 --- a/common/core/src/ux_host_stack_configuration_descriptor_parse.c +++ b/common/core/src/ux_host_stack_configuration_descriptor_parse.c @@ -34,7 +34,7 @@ /* FUNCTION RELEASE */ /* */ /* _ux_host_stack_configuration_descriptor_parse PORTABLE C */ -/* 6.0 */ +/* 6.1 */ /* AUTHOR */ /* */ /* Chaoqiong Xiao, Microsoft Corporation */ @@ -73,6 +73,8 @@ /* 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 */ /* */ /**************************************************************************/ UINT _ux_host_stack_configuration_descriptor_parse(UX_DEVICE *device, UX_CONFIGURATION *configuration, diff --git a/common/core/src/ux_host_stack_configuration_enumerate.c b/common/core/src/ux_host_stack_configuration_enumerate.c index 5b7158d..64ddd4c 100644 --- a/common/core/src/ux_host_stack_configuration_enumerate.c +++ b/common/core/src/ux_host_stack_configuration_enumerate.c @@ -34,7 +34,7 @@ /* FUNCTION RELEASE */ /* */ /* _ux_host_stack_configuration_enumerate PORTABLE C */ -/* 6.0 */ +/* 6.1 */ /* AUTHOR */ /* */ /* Chaoqiong Xiao, Microsoft Corporation */ @@ -79,6 +79,8 @@ /* 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 */ /* */ /**************************************************************************/ UINT _ux_host_stack_configuration_enumerate(UX_DEVICE *device) diff --git a/common/core/src/ux_host_stack_configuration_instance_create.c b/common/core/src/ux_host_stack_configuration_instance_create.c index 4c2aaa7..26834b3 100644 --- a/common/core/src/ux_host_stack_configuration_instance_create.c +++ b/common/core/src/ux_host_stack_configuration_instance_create.c @@ -34,7 +34,7 @@ /* FUNCTION RELEASE */ /* */ /* _ux_host_stack_configuration_instance_create PORTABLE C */ -/* 6.0 */ +/* 6.1 */ /* AUTHOR */ /* */ /* Chaoqiong Xiao, Microsoft Corporation */ @@ -66,6 +66,8 @@ /* 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 */ /* */ /**************************************************************************/ UINT _ux_host_stack_configuration_instance_create(UX_CONFIGURATION *configuration) diff --git a/common/core/src/ux_host_stack_configuration_instance_delete.c b/common/core/src/ux_host_stack_configuration_instance_delete.c index e537523..64d9e25 100644 --- a/common/core/src/ux_host_stack_configuration_instance_delete.c +++ b/common/core/src/ux_host_stack_configuration_instance_delete.c @@ -34,7 +34,7 @@ /* FUNCTION RELEASE */ /* */ /* _ux_host_stack_configuration_instance_delete PORTABLE C */ -/* 6.0 */ +/* 6.1 */ /* AUTHOR */ /* */ /* Chaoqiong Xiao, Microsoft Corporation */ @@ -66,6 +66,8 @@ /* 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 */ /* */ /**************************************************************************/ VOID _ux_host_stack_configuration_instance_delete(UX_CONFIGURATION *configuration) 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 6c6362e..77e760c 100644 --- a/common/core/src/ux_host_stack_configuration_interface_get.c +++ b/common/core/src/ux_host_stack_configuration_interface_get.c @@ -34,7 +34,7 @@ /* FUNCTION RELEASE */ /* */ /* _ux_host_stack_configuration_interface_get PORTABLE C */ -/* 6.0 */ +/* 6.1 */ /* AUTHOR */ /* */ /* Chaoqiong Xiao, Microsoft Corporation */ @@ -71,6 +71,8 @@ /* 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 */ /* */ /**************************************************************************/ UINT _ux_host_stack_configuration_interface_get(UX_CONFIGURATION *configuration, diff --git a/common/core/src/ux_host_stack_configuration_set.c b/common/core/src/ux_host_stack_configuration_set.c index bda29c4..26312d0 100644 --- a/common/core/src/ux_host_stack_configuration_set.c +++ b/common/core/src/ux_host_stack_configuration_set.c @@ -34,7 +34,7 @@ /* FUNCTION RELEASE */ /* */ /* _ux_host_stack_configuration_set PORTABLE C */ -/* 6.0 */ +/* 6.1 */ /* AUTHOR */ /* */ /* Chaoqiong Xiao, Microsoft Corporation */ @@ -66,6 +66,10 @@ /* DATE NAME DESCRIPTION */ /* */ /* 05-19-2020 Chaoqiong Xiao Initial Version 6.0 */ +/* 09-30-2020 Chaoqiong Xiao Modified comment(s), */ +/* optimized based on compile */ +/* definitions, */ +/* resulting in version 6.1 */ /* */ /**************************************************************************/ UINT _ux_host_stack_configuration_set(UX_CONFIGURATION *configuration) @@ -93,11 +97,11 @@ UX_HCD *hcd; /* For HNP to work the device has to be connected directly to the Root Hub and not a down stream hub. If the parent is NULL, the device is on the root hub. */ - if (device -> ux_device_parent == UX_NULL) + if (UX_DEVICE_PARENT_IS_ROOTHUB(device)) { /* With the device we have the pointer to the HCD. */ - hcd = device -> ux_device_hcd; + hcd = UX_DEVICE_HCD_GET(device); /* Check the HCD to ensure we have an OTG host controller. */ if (hcd -> ux_hcd_otg_capabilities & UX_HCD_OTG_CAPABLE) diff --git a/common/core/src/ux_host_stack_delay_ms.c b/common/core/src/ux_host_stack_delay_ms.c index fa96985..f024382 100644 --- a/common/core/src/ux_host_stack_delay_ms.c +++ b/common/core/src/ux_host_stack_delay_ms.c @@ -34,7 +34,7 @@ /* FUNCTION RELEASE */ /* */ /* _ux_host_stack_delay_ms PORTABLE C */ -/* 6.0 */ +/* 6.1 */ /* AUTHOR */ /* */ /* Chaoqiong Xiao, Microsoft Corporation */ @@ -65,6 +65,8 @@ /* 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 */ /* */ /**************************************************************************/ VOID _ux_host_stack_delay_ms(ULONG time) diff --git a/common/core/src/ux_host_stack_device_address_set.c b/common/core/src/ux_host_stack_device_address_set.c index 436d0e6..9734d0e 100644 --- a/common/core/src/ux_host_stack_device_address_set.c +++ b/common/core/src/ux_host_stack_device_address_set.c @@ -34,7 +34,7 @@ /* FUNCTION RELEASE */ /* */ /* _ux_host_stack_device_address_set PORTABLE C */ -/* 6.0 */ +/* 6.1 */ /* AUTHOR */ /* */ /* Chaoqiong Xiao, Microsoft Corporation */ @@ -65,19 +65,26 @@ /* DATE NAME DESCRIPTION */ /* */ /* 05-19-2020 Chaoqiong Xiao Initial Version 6.0 */ +/* 09-30-2020 Chaoqiong Xiao Modified comment(s), */ +/* optimized based on compile */ +/* definitions, */ +/* resulting in version 6.1 */ /* */ /**************************************************************************/ UINT _ux_host_stack_device_address_set(UX_DEVICE *device) { + +UINT status = UX_ERROR; UX_TRANSFER *transfer_request; -UINT status; UX_ENDPOINT *control_endpoint; +USHORT device_address; +#if UX_MAX_DEVICES > 1 UX_HCD *hcd; UINT address_byte_index; UINT address_bit_index; UCHAR device_address_byte; -USHORT device_address; +#endif /* Retrieve the pointer to the control endpoint. */ control_endpoint = &device -> ux_device_control_endpoint; @@ -85,11 +92,15 @@ USHORT device_address; /* Retrieve the transfer request pointer. */ transfer_request = &control_endpoint -> ux_endpoint_transfer_request; + /* Initialize device address to 1. */ + device_address = 1; + +#if UX_MAX_DEVICES > 1 + /* We need the HCD pointer as well. */ - hcd = device -> ux_device_hcd; + hcd = UX_DEVICE_HCD_GET(device); /* Calculate the new address of this device. We start with address 1. */ - device_address = 1; for (address_byte_index = 0; address_byte_index < 16; address_byte_index++) { @@ -108,51 +119,62 @@ USHORT device_address; /* Store the address mask byte. */ hcd -> ux_hcd_address[address_byte_index] = device_address_byte; - - /* If trace is enabled, insert this event into the trace buffer. */ - UX_TRACE_IN_LINE_INSERT(UX_TRACE_HOST_STACK_DEVICE_ADDRESS_SET, device, device_address, 0, 0, UX_TRACE_HOST_STACK_EVENTS, 0, 0) - /* Create a transfer request for the SET_ADDRESS request. */ - transfer_request -> ux_transfer_request_data_pointer = UX_NULL; - transfer_request -> ux_transfer_request_requested_length = 0; - transfer_request -> ux_transfer_request_function = UX_SET_ADDRESS; - transfer_request -> ux_transfer_request_type = UX_REQUEST_OUT | UX_REQUEST_TYPE_STANDARD | UX_REQUEST_TARGET_DEVICE; - transfer_request -> ux_transfer_request_value = device_address; - transfer_request -> ux_transfer_request_index = 0; + /* OK, apply address. */ + status = UX_SUCCESS; + break; + } + + /* This address was already taken, increment to the next address. */ + device_address++; + } + + /* If address found, break the loop. */ + if (status == UX_SUCCESS) + { + break; + } + } + if (status == UX_ERROR) - /* Send request to HCD layer. */ - status = _ux_host_stack_transfer_request(transfer_request); + /* We should never get here! */ + return(UX_ERROR); +#endif - /* Now, this address will be the one used in future transfers. The transfer may have failed and therefore - all the device resources including the new address will be free.*/ - device -> ux_device_address = (ULONG) device_address; + /* If trace is enabled, insert this event into the trace buffer. */ + UX_TRACE_IN_LINE_INSERT(UX_TRACE_HOST_STACK_DEVICE_ADDRESS_SET, device, device_address, 0, 0, UX_TRACE_HOST_STACK_EVENTS, 0, 0) - /* Check completion status. */ - if (status == UX_SUCCESS) - { + /* Create a transfer request for the SET_ADDRESS request. */ + transfer_request -> ux_transfer_request_data_pointer = UX_NULL; + transfer_request -> ux_transfer_request_requested_length = 0; + transfer_request -> ux_transfer_request_function = UX_SET_ADDRESS; + transfer_request -> ux_transfer_request_type = UX_REQUEST_OUT | UX_REQUEST_TYPE_STANDARD | UX_REQUEST_TARGET_DEVICE; + transfer_request -> ux_transfer_request_value = device_address; + transfer_request -> ux_transfer_request_index = 0; - /* Some devices need some time to accept this address. */ - _ux_utility_delay_ms(UX_DEVICE_ADDRESS_SET_WAIT); + /* Send request to HCD layer. */ + status = _ux_host_stack_transfer_request(transfer_request); - /* Return successful status. */ - return(status); - } - else - { + /* Now, this address will be the one used in future transfers. The transfer may have failed and therefore + all the device resources including the new address will be free.*/ + device -> ux_device_address = (ULONG) device_address; - /* We have an error at the first device transaction. This is mostly - due to the device having failed on the reset after power up. - we will try again either at the root hub or regular hub. */ - return(status); - } - } + /* Check completion status. */ + if (status == UX_SUCCESS) + { - /* This address was already taken, increment to the next address. */ - device_address++; - } + /* Some devices need some time to accept this address. */ + _ux_utility_delay_ms(UX_DEVICE_ADDRESS_SET_WAIT); + + /* Return successful status. */ + return(status); } + else + { - /* We should never get here! */ - return(UX_ERROR); + /* We have an error at the first device transaction. This is mostly + due to the device having failed on the reset after power up. + we will try again either at the root hub or regular hub. */ + return(status); + } } - 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 bdd772c..7b8d952 100644 --- a/common/core/src/ux_host_stack_device_configuration_get.c +++ b/common/core/src/ux_host_stack_device_configuration_get.c @@ -34,7 +34,7 @@ /* FUNCTION RELEASE */ /* */ /* _ux_host_stack_device_configuration_get PORTABLE C */ -/* 6.0 */ +/* 6.1 */ /* AUTHOR */ /* */ /* Chaoqiong Xiao, Microsoft Corporation */ @@ -69,6 +69,8 @@ /* 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 */ /* */ /**************************************************************************/ UINT _ux_host_stack_device_configuration_get(UX_DEVICE *device, UINT configuration_index, diff --git a/common/core/src/ux_host_stack_device_configuration_reset.c b/common/core/src/ux_host_stack_device_configuration_reset.c index 91f3f50..b340d75 100644 --- a/common/core/src/ux_host_stack_device_configuration_reset.c +++ b/common/core/src/ux_host_stack_device_configuration_reset.c @@ -34,7 +34,7 @@ /* FUNCTION RELEASE */ /* */ /* _ux_host_stack_device_configuration_reset PORTABLE C */ -/* 6.0 */ +/* 6.1 */ /* AUTHOR */ /* */ /* Chaoqiong Xiao, Microsoft Corporation */ @@ -66,6 +66,8 @@ /* 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 */ /* */ /**************************************************************************/ UINT _ux_host_stack_device_configuration_reset(UX_DEVICE *device) diff --git a/common/core/src/ux_host_stack_device_configuration_select.c b/common/core/src/ux_host_stack_device_configuration_select.c index 7d66915..dd8224a 100644 --- a/common/core/src/ux_host_stack_device_configuration_select.c +++ b/common/core/src/ux_host_stack_device_configuration_select.c @@ -1,11 +1,3 @@ - - - - - - - - /**************************************************************************/ /* */ /* Copyright (c) Microsoft Corporation. All rights reserved. */ @@ -42,7 +34,7 @@ /* FUNCTION RELEASE */ /* */ /* _ux_host_stack_device_configuration_select PORTABLE C */ -/* 6.0 */ +/* 6.1 */ /* AUTHOR */ /* */ /* Chaoqiong Xiao, Microsoft Corporation */ @@ -82,6 +74,10 @@ /* DATE NAME DESCRIPTION */ /* */ /* 05-19-2020 Chaoqiong Xiao Initial Version 6.0 */ +/* 09-30-2020 Chaoqiong Xiao Modified comment(s), */ +/* optimized based on compile */ +/* definitions, */ +/* resulting in version 6.1 */ /* */ /**************************************************************************/ UINT _ux_host_stack_device_configuration_select(UX_CONFIGURATION *configuration) @@ -134,7 +130,7 @@ UINT status; with the amount of power the device is consuming before allowing it to be configured. Otherwise we may run the risk of an over current fault. */ - if (configuration -> ux_configuration_descriptor.MaxPower > device -> ux_device_max_power) + if (configuration -> ux_configuration_descriptor.MaxPower > UX_DEVICE_MAX_POWER_GET(device)) { /* Error trap. */ diff --git a/common/core/src/ux_host_stack_device_descriptor_read.c b/common/core/src/ux_host_stack_device_descriptor_read.c index 968155e..61ac87b 100644 --- a/common/core/src/ux_host_stack_device_descriptor_read.c +++ b/common/core/src/ux_host_stack_device_descriptor_read.c @@ -34,7 +34,7 @@ /* FUNCTION RELEASE */ /* */ /* _ux_host_stack_device_descriptor_read PORTABLE C */ -/* 6.0 */ +/* 6.1 */ /* AUTHOR */ /* */ /* Chaoqiong Xiao, Microsoft Corporation */ @@ -67,6 +67,8 @@ /* 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 */ /* */ /**************************************************************************/ UINT _ux_host_stack_device_descriptor_read(UX_DEVICE *device) diff --git a/common/core/src/ux_host_stack_device_get.c b/common/core/src/ux_host_stack_device_get.c index d323ff5..82dd9c4 100644 --- a/common/core/src/ux_host_stack_device_get.c +++ b/common/core/src/ux_host_stack_device_get.c @@ -34,7 +34,7 @@ /* FUNCTION RELEASE */ /* */ /* _ux_host_stack_device_get PORTABLE C */ -/* 6.0 */ +/* 6.1 */ /* AUTHOR */ /* */ /* Chaoqiong Xiao, Microsoft Corporation */ @@ -69,19 +69,25 @@ /* DATE NAME DESCRIPTION */ /* */ /* 05-19-2020 Chaoqiong Xiao Initial Version 6.0 */ +/* 09-30-2020 Chaoqiong Xiao Modified comment(s), */ +/* optimized based on compile */ +/* definitions, */ +/* resulting in version 6.1 */ /* */ /**************************************************************************/ UINT _ux_host_stack_device_get(ULONG device_index, UX_DEVICE **device) { UX_DEVICE *current_device; +#if UX_MAX_DEVICES > 1 ULONG current_device_index; +#endif /* If trace is enabled, insert this event into the trace buffer. */ UX_TRACE_IN_LINE_INSERT(UX_TRACE_HOST_STACK_DEVICE_GET, device_index, 0, 0, 0, UX_TRACE_HOST_STACK_EVENTS, 0, 0) /* Check if the device index is still within the limits. */ - if (device_index >= _ux_system_host -> ux_system_host_max_devices) + if (device_index >= UX_SYSTEM_HOST_MAX_DEVICES_GET()) { /* Error trap. */ @@ -93,6 +99,8 @@ ULONG current_device_index; return(UX_DEVICE_HANDLE_UNKNOWN); } +#if UX_MAX_DEVICES > 1 + /* Start with the first device. */ current_device = _ux_system_host -> ux_system_host_device_array; current_device_index = 0; @@ -123,6 +131,16 @@ ULONG current_device_index; /* Move to next device. */ current_device++; } +#else + + /* Only one device, just check if it's used. */ + current_device = _ux_system_host -> ux_system_host_device_array; + if (current_device -> ux_device_handle != UX_UNUSED) + { + *device = current_device; + return(UX_SUCCESS); + } +#endif /* If trace is enabled, insert this event into the trace buffer. */ UX_TRACE_IN_LINE_INSERT(UX_TRACE_ERROR, UX_DEVICE_HANDLE_UNKNOWN, device, 0, 0, UX_TRACE_ERRORS, 0, 0) @@ -130,4 +148,3 @@ ULONG current_device_index; /* Return error. */ return(UX_DEVICE_HANDLE_UNKNOWN); } - diff --git a/common/core/src/ux_host_stack_device_remove.c b/common/core/src/ux_host_stack_device_remove.c index f82e923..020c900 100644 --- a/common/core/src/ux_host_stack_device_remove.c +++ b/common/core/src/ux_host_stack_device_remove.c @@ -12,8 +12,8 @@ /**************************************************************************/ /**************************************************************************/ -/** */ -/** USBX Component */ +/** */ +/** USBX Component */ /** */ /** Host Stack */ /** */ @@ -29,58 +29,64 @@ #include "ux_host_stack.h" -/**************************************************************************/ -/* */ -/* FUNCTION RELEASE */ -/* */ -/* _ux_host_stack_device_remove PORTABLE C */ -/* 6.0 */ +/**************************************************************************/ +/* */ +/* FUNCTION RELEASE */ +/* */ +/* _ux_host_stack_device_remove PORTABLE C */ +/* 6.1 */ /* AUTHOR */ /* */ /* Chaoqiong Xiao, Microsoft Corporation */ /* */ /* DESCRIPTION */ -/* */ -/* This function will remove a USB device from the bus. */ -/* */ -/* INPUT */ -/* */ +/* */ +/* This function will remove a USB device from the bus. */ +/* */ +/* INPUT */ +/* */ /* HCD Pointer to the HCD */ /* parent The parent device address */ -/* port_index Index of the port on which the*/ +/* port_index Index of the port on which the*/ /* change of status occurred */ -/* */ -/* OUTPUT */ -/* */ -/* Completion Status */ -/* */ -/* CALLS */ -/* */ -/* _ux_host_stack_device_resources_free Free all device resources */ -/* */ -/* CALLED BY */ -/* */ -/* USBX Components */ -/* */ -/* RELEASE HISTORY */ -/* */ -/* DATE NAME DESCRIPTION */ -/* */ +/* */ +/* OUTPUT */ +/* */ +/* Completion Status */ +/* */ +/* CALLS */ +/* */ +/* _ux_host_stack_device_resources_free Free all device resources */ +/* */ +/* 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), */ +/* optimized based on compile */ +/* definitions, */ +/* resulting in version 6.1 */ /* */ /**************************************************************************/ UINT _ux_host_stack_device_remove(UX_HCD *hcd, UX_DEVICE *parent, UINT port_index) { +#if UX_MAX_DEVICES > 1 ULONG container_index; +#endif UX_DEVICE *device; UX_CONFIGURATION *configuration; UX_INTERFACE *interface; UX_HOST_CLASS_COMMAND command; - /* We need to find the device descriptor for the removed device. We can find it + /* We need to find the device descriptor for the removed device. We can find it with the parent device and the port it was attached to. Start with the first device. */ - device = _ux_system_host -> ux_system_host_device_array; + device = _ux_system_host -> ux_system_host_device_array; /* If trace is enabled, insert this event into the trace buffer. */ UX_TRACE_IN_LINE_INSERT(UX_TRACE_HOST_STACK_DEVICE_REMOVE, hcd, parent, port_index, device, UX_TRACE_HOST_STACK_EVENTS, 0, 0) @@ -88,6 +94,7 @@ UX_HOST_CLASS_COMMAND command; /* If trace is enabled, unregister this object. */ UX_TRACE_OBJECT_UNREGISTER(device); +#if UX_MAX_DEVICES > 1 /* Start at the beginning of the list. */ container_index = 0; @@ -100,93 +107,105 @@ UX_HOST_CLASS_COMMAND command; { /* Check for the parent device and the port location and the controller. */ - if((device -> ux_device_parent == parent) && (device -> ux_device_port_location == port_index) && - (device -> ux_device_hcd == hcd)) - { + if( UX_DEVICE_PARENT_MATCH(device, parent) && + UX_DEVICE_PORT_LOCATION_MATCH(device, port_index) && + UX_DEVICE_HCD_MATCH(device, hcd)) + break; + } - /* We have found the device to be removed. */ - device -> ux_device_state = UX_DEVICE_REMOVED; + /* Move to the next device entry. */ + device++; + } - /* We have found the device to be removed. Initialize the class - command with the generic parameters. */ - command.ux_host_class_command_request = UX_HOST_CLASS_COMMAND_DEACTIVATE; + /* Device not found. */ + if (container_index > _ux_system_host -> ux_system_host_max_devices) +#else + UX_PARAMETER_NOT_USED(parent); + UX_PARAMETER_NOT_USED(port_index); - /* The device may have a class associated with the device container or its interfaces. */ - if (device -> ux_device_class_instance != UX_NULL) - { + /* Device is available and HCD is expected. */ + if (device -> ux_device_handle == UX_UNUSED || + !UX_DEVICE_HCD_MATCH(device, hcd)) +#endif + { - /* We need to stop the class instance for the device. */ - command.ux_host_class_command_instance = device -> ux_device_class_instance; - - /* Call the class. */ - device -> ux_device_class -> ux_host_class_entry_function(&command); - } - else - { + /* Error trap. */ + _ux_system_error_handler(UX_SYSTEM_LEVEL_THREAD, UX_SYSTEM_CONTEXT_ENUMERATOR, UX_DEVICE_HANDLE_UNKNOWN); - /* Search for the active configuration. */ - configuration = device -> ux_device_first_configuration; + /* If trace is enabled, insert this event into the trace buffer. */ + UX_TRACE_IN_LINE_INSERT(UX_TRACE_ERROR, UX_DEVICE_HANDLE_UNKNOWN, device, 0, 0, UX_TRACE_ERRORS, 0, 0) - /* Parse the interface(s) for this device in search of the classes - who own this device. */ - while (configuration != UX_NULL) - { + /* We get here when we could not find the device. */ + return(UX_DEVICE_HANDLE_UNKNOWN); + } - /* Is this the correct configuration? */ - if (configuration -> ux_configuration_descriptor.bConfigurationValue == - device -> ux_device_current_configuration) - { + /* We have found the device to be removed. */ + device -> ux_device_state = UX_DEVICE_REMOVED; - /* We have the correct configuration, search the interface(s). */ - interface = configuration -> ux_configuration_first_interface; - - /* Loop to perform the search. */ - while (interface != UX_NULL) - { + /* We have found the device to be removed. Initialize the class + command with the generic parameters. */ + command.ux_host_class_command_request = UX_HOST_CLASS_COMMAND_DEACTIVATE; - /* Check if an instance of the interface is present. */ - if (interface -> ux_interface_class_instance != UX_NULL) - { + /* The device may have a class associated with the device container or its interfaces. */ + if (device -> ux_device_class_instance != UX_NULL) + { - /* We need to stop the class instance for the device. */ - command.ux_host_class_command_instance = interface -> ux_interface_class_instance; - - /* Call the class. */ - interface -> ux_interface_class -> ux_host_class_entry_function(&command); - } + /* We need to stop the class instance for the device. */ + command.ux_host_class_command_instance = device -> ux_device_class_instance; - /* Move to next interface. */ - interface = interface -> ux_interface_next_interface; - } - } + /* Call the class. */ + device -> ux_device_class -> ux_host_class_entry_function(&command); + } + else + { - /* Move to next configuration in the list. */ - configuration = configuration -> ux_configuration_next_configuration; - } - } + /* Search for the active configuration. */ + configuration = device -> ux_device_first_configuration; - /* Now all the resources for this device must be free. */ - _ux_host_stack_device_resources_free(device); + /* Parse the interface(s) for this device in search of the classes + who own this device. */ + while (configuration != UX_NULL) + { - /* Decrement the number of devices on this bus. */ - hcd -> ux_hcd_nb_devices--; + /* Is this the correct configuration? */ + if (configuration -> ux_configuration_descriptor.bConfigurationValue == + device -> ux_device_current_configuration) + { - /* We are done with this device removal. */ - return(UX_SUCCESS); - } - } + /* We have the correct configuration, search the interface(s). */ + interface = configuration -> ux_configuration_first_interface; - /* Move to the next device entry. */ - device++; + /* Loop to perform the search. */ + while (interface != UX_NULL) + { + + /* Check if an instance of the interface is present. */ + if (interface -> ux_interface_class_instance != UX_NULL) + { + + /* We need to stop the class instance for the device. */ + command.ux_host_class_command_instance = interface -> ux_interface_class_instance; + + /* Call the class. */ + interface -> ux_interface_class -> ux_host_class_entry_function(&command); + } + + /* Move to next interface. */ + interface = interface -> ux_interface_next_interface; + } + } + + /* Move to next configuration in the list. */ + configuration = configuration -> ux_configuration_next_configuration; + } } - /* Error trap. */ - _ux_system_error_handler(UX_SYSTEM_LEVEL_THREAD, UX_SYSTEM_CONTEXT_ENUMERATOR, UX_DEVICE_HANDLE_UNKNOWN); + /* Now all the resources for this device must be free. */ + _ux_host_stack_device_resources_free(device); - /* If trace is enabled, insert this event into the trace buffer. */ - UX_TRACE_IN_LINE_INSERT(UX_TRACE_ERROR, UX_DEVICE_HANDLE_UNKNOWN, device, 0, 0, UX_TRACE_ERRORS, 0, 0) + /* Decrement the number of devices on this bus. */ + hcd -> ux_hcd_nb_devices--; - /* We get here when we could not find the device. */ - return(UX_DEVICE_HANDLE_UNKNOWN); + /* We are done with this device removal. */ + return(UX_SUCCESS); } - diff --git a/common/core/src/ux_host_stack_device_resources_free.c b/common/core/src/ux_host_stack_device_resources_free.c index 050f970..f77b3fd 100644 --- a/common/core/src/ux_host_stack_device_resources_free.c +++ b/common/core/src/ux_host_stack_device_resources_free.c @@ -34,7 +34,7 @@ /* FUNCTION RELEASE */ /* */ /* _ux_host_stack_device_resources_free PORTABLE C */ -/* 6.0 */ +/* 6.1 */ /* AUTHOR */ /* */ /* Chaoqiong Xiao, Microsoft Corporation */ @@ -73,6 +73,11 @@ /* DATE NAME DESCRIPTION */ /* */ /* 05-19-2020 Chaoqiong Xiao Initial Version 6.0 */ +/* 09-30-2020 Chaoqiong Xiao Modified comment(s), */ +/* optimized based on compile */ +/* definitions, verified */ +/* memset and memcpy cases, */ +/* resulting in version 6.1 */ /* */ /**************************************************************************/ UINT _ux_host_stack_device_resources_free(UX_DEVICE *device) @@ -84,9 +89,11 @@ UX_ENDPOINT *endpoint; VOID *container; ULONG current_alternate_setting; UX_HCD *hcd; +#if UX_MAX_DEVICES > 1 UINT device_address_byte_index; UINT device_address_bit_index; UCHAR device_address_byte; +#endif /* If trace is enabled, insert this event into the trace buffer. */ UX_TRACE_IN_LINE_INSERT(UX_TRACE_HOST_STACK_DEVICE_RESOURCE_FREE, device, 0, 0, 0, UX_TRACE_HOST_STACK_EVENTS, 0, 0) @@ -161,7 +168,7 @@ UCHAR device_address_byte; /* We need the HCD address for the control endpoint removal and to free the device address. */ - hcd = device -> ux_device_hcd; + hcd = UX_DEVICE_HCD_GET(device); /* Was the control endpoint already created ? */ if (device -> ux_device_control_endpoint.ux_endpoint_state != 0) @@ -181,6 +188,7 @@ UCHAR device_address_byte; /* The semaphore attached to the control endpoint must be destroyed. */ _ux_utility_semaphore_delete(&device -> ux_device_control_endpoint.ux_endpoint_transfer_request.ux_transfer_request_semaphore); +#if UX_MAX_DEVICES > 1 /* Check if the device had an assigned address. */ if (device -> ux_device_address != 0) { @@ -199,13 +207,14 @@ UCHAR device_address_byte; /* Free the address. */ hcd -> ux_hcd_address[device_address_byte_index] &= (UCHAR)~device_address_byte; - } + } +#endif /* The semaphore for endpoint 0 protection must be destroyed. */ _ux_utility_semaphore_delete(&device -> ux_device_protection_semaphore); /* Now this device can be free and its container return to the pool. */ - _ux_utility_memory_set(device, 0, sizeof(UX_DEVICE)); + _ux_utility_memory_set(device, 0, sizeof(UX_DEVICE)); /* Use case of memset is verified. */ /* Mark the device handle as unused. */ device -> ux_device_handle = UX_UNUSED; diff --git a/common/core/src/ux_host_stack_endpoint_instance_create.c b/common/core/src/ux_host_stack_endpoint_instance_create.c index f24a8c4..e804631 100644 --- a/common/core/src/ux_host_stack_endpoint_instance_create.c +++ b/common/core/src/ux_host_stack_endpoint_instance_create.c @@ -34,7 +34,7 @@ /* FUNCTION RELEASE */ /* */ /* _ux_host_stack_endpoint_instance_create PORTABLE C */ -/* 6.0 */ +/* 6.1 */ /* AUTHOR */ /* */ /* Chaoqiong Xiao, Microsoft Corporation */ @@ -69,20 +69,22 @@ /* DATE NAME DESCRIPTION */ /* */ /* 05-19-2020 Chaoqiong Xiao Initial Version 6.0 */ +/* 09-30-2020 Chaoqiong Xiao Modified comment(s), */ +/* optimized based on compile */ +/* definitions, */ +/* resulting in version 6.1 */ /* */ /**************************************************************************/ UINT _ux_host_stack_endpoint_instance_create(UX_ENDPOINT *endpoint) { UX_HCD *hcd; -UX_DEVICE *device; UINT status; UCHAR endpoint_type; /* Obtain the HCD for this endpoint. */ - device = endpoint -> ux_endpoint_device; - hcd = device -> ux_device_hcd; + hcd = UX_DEVICE_HCD_GET(endpoint -> ux_endpoint_device); /* If trace is enabled, insert this event into the trace buffer. */ UX_TRACE_IN_LINE_INSERT(UX_TRACE_HOST_STACK_ENDPOINT_INSTANCE_CREATE, device, endpoint, 0, 0, UX_TRACE_HOST_STACK_EVENTS, 0, 0) diff --git a/common/core/src/ux_host_stack_endpoint_instance_delete.c b/common/core/src/ux_host_stack_endpoint_instance_delete.c index 66e69a9..5de4ade 100644 --- a/common/core/src/ux_host_stack_endpoint_instance_delete.c +++ b/common/core/src/ux_host_stack_endpoint_instance_delete.c @@ -34,7 +34,7 @@ /* FUNCTION RELEASE */ /* */ /* _ux_host_stack_endpoint_instance_delete PORTABLE C */ -/* 6.0 */ +/* 6.1 */ /* AUTHOR */ /* */ /* Chaoqiong Xiao, Microsoft Corporation */ @@ -68,18 +68,20 @@ /* DATE NAME DESCRIPTION */ /* */ /* 05-19-2020 Chaoqiong Xiao Initial Version 6.0 */ +/* 09-30-2020 Chaoqiong Xiao Modified comment(s), */ +/* optimized based on compile */ +/* definitions, */ +/* resulting in version 6.1 */ /* */ /**************************************************************************/ VOID _ux_host_stack_endpoint_instance_delete(UX_ENDPOINT *endpoint) { UX_HCD *hcd; -UX_DEVICE *device; /* Obtain the HCD for this endpoint. */ - device = endpoint -> ux_endpoint_device; - hcd = device -> ux_device_hcd; + hcd = UX_DEVICE_HCD_GET(endpoint -> ux_endpoint_device); /* If trace is enabled, insert this event into the trace buffer. */ UX_TRACE_IN_LINE_INSERT(UX_TRACE_HOST_STACK_ENDPOINT_INSTANCE_DELETE, device, endpoint, 0, 0, UX_TRACE_HOST_STACK_EVENTS, 0, 0) diff --git a/common/core/src/ux_host_stack_endpoint_reset.c b/common/core/src/ux_host_stack_endpoint_reset.c index 78753de..2941b7e 100644 --- a/common/core/src/ux_host_stack_endpoint_reset.c +++ b/common/core/src/ux_host_stack_endpoint_reset.c @@ -34,7 +34,7 @@ /* FUNCTION RELEASE */ /* */ /* _ux_host_stack_endpoint_reset PORTABLE C */ -/* 6.0 */ +/* 6.1 */ /* AUTHOR */ /* */ /* Chaoqiong Xiao, Microsoft Corporation */ @@ -66,6 +66,10 @@ /* DATE NAME DESCRIPTION */ /* */ /* 05-19-2020 Chaoqiong Xiao Initial Version 6.0 */ +/* 09-30-2020 Chaoqiong Xiao Modified comment(s), */ +/* optimized based on compile */ +/* definitions, */ +/* resulting in version 6.1 */ /* */ /**************************************************************************/ UINT _ux_host_stack_endpoint_reset(UX_ENDPOINT *endpoint) @@ -106,7 +110,7 @@ UINT status; { /* Pickup HCD pointer. */ - hcd = device -> ux_device_hcd; + hcd = UX_DEVICE_HCD_GET(device); /* Call HCD entry function. */ status = hcd -> ux_hcd_entry_function(hcd, UX_HCD_RESET_ENDPOINT, endpoint); 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 f0b7ed5..ba6edc2 100644 --- a/common/core/src/ux_host_stack_endpoint_transfer_abort.c +++ b/common/core/src/ux_host_stack_endpoint_transfer_abort.c @@ -34,7 +34,7 @@ /* FUNCTION RELEASE */ /* */ /* _ux_host_stack_endpoint_transfer_abort PORTABLE C */ -/* 6.0 */ +/* 6.1 */ /* AUTHOR */ /* */ /* Chaoqiong Xiao, Microsoft Corporation */ @@ -72,6 +72,8 @@ /* 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 */ /* */ /**************************************************************************/ UINT _ux_host_stack_endpoint_transfer_abort(UX_ENDPOINT *endpoint) diff --git a/common/core/src/ux_host_stack_enum_thread_entry.c b/common/core/src/ux_host_stack_enum_thread_entry.c index 29d6e8a..93b6a23 100644 --- a/common/core/src/ux_host_stack_enum_thread_entry.c +++ b/common/core/src/ux_host_stack_enum_thread_entry.c @@ -34,7 +34,7 @@ /* FUNCTION RELEASE */ /* */ /* _ux_host_stack_enum_thread_entry PORTABLE C */ -/* 6.0 */ +/* 6.1 */ /* AUTHOR */ /* */ /* Chaoqiong Xiao, Microsoft Corporation */ @@ -78,6 +78,10 @@ /* DATE NAME DESCRIPTION */ /* */ /* 05-19-2020 Chaoqiong Xiao Initial Version 6.0 */ +/* 09-30-2020 Chaoqiong Xiao Modified comment(s), */ +/* optimized based on compile */ +/* definitions, */ +/* resulting in version 6.1 */ /* */ /**************************************************************************/ VOID _ux_host_stack_enum_thread_entry(ULONG input) @@ -92,6 +96,7 @@ VOID _ux_host_stack_enum_thread_entry(ULONG input) /* Wait for the semaphore to be put by the root hub or a regular hub. */ _ux_utility_semaphore_get(&_ux_system_host -> ux_system_host_enum_semaphore, UX_WAIT_FOREVER); +#if UX_MAX_DEVICES > 1 /* We try the hub first. For this we look into the USBX project structure to see if there is at least one hub. */ if (_ux_system_host -> ux_system_host_enum_hub_function != UX_NULL) @@ -100,6 +105,7 @@ VOID _ux_host_stack_enum_thread_entry(ULONG input) /* Yes, there is a HUB function, call it! */ _ux_system_host -> ux_system_host_enum_hub_function(); } +#endif /* The signal may be also coming from the root hub, call the root hub handler. */ _ux_host_stack_rh_change_process(); diff --git a/common/core/src/ux_host_stack_hcd_register.c b/common/core/src/ux_host_stack_hcd_register.c index 5aa1b3e..5894b6a 100644 --- a/common/core/src/ux_host_stack_hcd_register.c +++ b/common/core/src/ux_host_stack_hcd_register.c @@ -12,8 +12,8 @@ /**************************************************************************/ /**************************************************************************/ -/** */ -/** USBX Component */ +/** */ +/** USBX Component */ /** */ /** Host Stack */ /** */ @@ -29,51 +29,58 @@ #include "ux_host_stack.h" -/**************************************************************************/ -/* */ -/* FUNCTION RELEASE */ -/* */ -/* _ux_host_stack_hcd_register PORTABLE C */ -/* 6.0 */ +/**************************************************************************/ +/* */ +/* FUNCTION RELEASE */ +/* */ +/* _ux_host_stack_hcd_register PORTABLE C */ +/* 6.1 */ /* AUTHOR */ /* */ /* Chaoqiong Xiao, Microsoft Corporation */ /* */ /* DESCRIPTION */ -/* */ +/* */ /* This function registers a USB controller driver with the USBX stack */ -/* and invokes the HCD driver's initialization function. */ +/* and invokes the HCD driver's initialization function. */ /* */ /* Note: The C string of hcd_name must be NULL-terminated and the */ /* length of it (without the NULL-terminator itself) must be no larger */ /* than UX_MAX_HCD_NAME_LENGTH. */ -/* */ -/* INPUT */ -/* */ -/* hcd_name Name of HCD to register */ -/* hcd_entry_function Entry function of HCD driver */ -/* */ -/* OUTPUT */ -/* */ -/* Completion Status */ -/* */ -/* */ -/* CALLS */ -/* */ +/* */ +/* INPUT */ +/* */ +/* hcd_name Name of HCD to register */ +/* hcd_entry_function Entry function of HCD driver */ +/* hcd_param1 Parameter 1 of HCD */ +/* hcd_param2 Parameter 2 of HCD */ +/* */ +/* OUTPUT */ +/* */ +/* Completion Status */ +/* */ +/* */ +/* CALLS */ +/* */ /* _ux_utility_string_length_check Check and return C string */ /* length if no error */ -/* _ux_utility_memory_copy Copy name into HCD structure */ -/* (hcd_init_function) Init function of HCD driver */ -/* */ -/* CALLED BY */ -/* */ -/* Application */ -/* */ -/* RELEASE HISTORY */ -/* */ -/* DATE NAME DESCRIPTION */ -/* */ +/* _ux_utility_memory_copy Copy name into HCD structure */ +/* (hcd_init_function) Init function of HCD driver */ +/* */ +/* 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), */ +/* optimized based on compile */ +/* definitions, verified */ +/* memset and memcpy cases, */ +/* resulting in version 6.1 */ /* */ /**************************************************************************/ UINT _ux_host_stack_hcd_register(UCHAR *hcd_name, @@ -81,23 +88,34 @@ UINT _ux_host_stack_hcd_register(UCHAR *hcd_name, { UX_HCD *hcd; -ULONG hcd_index; UINT status; +#if !defined(UX_NAME_REFERENCED_BY_POINTER) UINT hcd_name_length = 0; +#endif +#if UX_MAX_HCD > 1 +ULONG hcd_index; +#endif + /* If trace is enabled, insert this event into the trace buffer. */ - UX_TRACE_IN_LINE_INSERT(UX_TRACE_HOST_STACK_HCD_REGISTER, hcd_name, 0, 0, 0, UX_TRACE_HOST_STACK_EVENTS, 0, 0) + UX_TRACE_IN_LINE_INSERT(UX_TRACE_HOST_STACK_HCD_REGISTER, hcd_name, hcd_param1, hcd_param2, 0, UX_TRACE_HOST_STACK_EVENTS, 0, 0) +#if !defined(UX_NAME_REFERENCED_BY_POINTER) /* Get the length of the class name (exclude null-terminator). */ status = _ux_utility_string_length_check(hcd_name, &hcd_name_length, UX_MAX_HCD_NAME_LENGTH); if (status) return(status); +#endif - /* We need to parse the controller driver table to find an empty spot. */ + /* Get HCD. */ hcd = _ux_system_host -> ux_system_host_hcd_array; + +#if UX_MAX_HCD > 1 + /* We need to parse the controller driver table to find an empty spot. */ for(hcd_index = 0; hcd_index < _ux_system_host -> ux_system_host_max_hcd; hcd_index++) { +#endif /* Is this slot available? */ if(hcd -> ux_hcd_status == UX_UNUSED) @@ -105,13 +123,18 @@ UINT hcd_name_length = 0; /* Yes, setup the new HCD entry. */ +#if defined(UX_NAME_REFERENCED_BY_POINTER) + hcd -> ux_hcd_name = (const UCHAR *)hcd_name; +#else + /* Initialize the array of the new controller with its name (include null-terminator). */ - _ux_utility_memory_copy(hcd -> ux_hcd_name, hcd_name, hcd_name_length + 1); + _ux_utility_memory_copy(hcd -> ux_hcd_name, hcd_name, hcd_name_length + 1); /* Use case of memcpy is verified. */ +#endif /* Store the hardware resources of the controller */ hcd -> ux_hcd_io = hcd_param1; hcd -> ux_hcd_irq = hcd_param2; - + /* This controller is now used */ hcd -> ux_hcd_status = UX_USED; @@ -124,10 +147,11 @@ UINT hcd_name_length = 0; /* Return the completion status to the caller. */ return(status); } - +#if UX_MAX_HCD > 1 /* Try the next HCD structure */ - hcd++; - } + hcd++; + } +#endif /* We have exhausted the array of the HCDs, return an error. */ return(UX_MEMORY_INSUFFICIENT); diff --git a/common/core/src/ux_host_stack_hcd_thread_entry.c b/common/core/src/ux_host_stack_hcd_thread_entry.c index cc01793..70be1fa 100644 --- a/common/core/src/ux_host_stack_hcd_thread_entry.c +++ b/common/core/src/ux_host_stack_hcd_thread_entry.c @@ -34,7 +34,7 @@ /* FUNCTION RELEASE */ /* */ /* _ux_host_stack_hcd_thread_entry PORTABLE C */ -/* 6.0 */ +/* 6.1 */ /* AUTHOR */ /* */ /* Chaoqiong Xiao, Microsoft Corporation */ @@ -68,6 +68,10 @@ /* DATE NAME DESCRIPTION */ /* */ /* 05-19-2020 Chaoqiong Xiao Initial Version 6.0 */ +/* 09-30-2020 Chaoqiong Xiao Modified comment(s), */ +/* optimized based on compile */ +/* definitions, */ +/* resulting in version 6.1 */ /* */ /**************************************************************************/ VOID _ux_host_stack_hcd_thread_entry(ULONG input) @@ -75,7 +79,7 @@ VOID _ux_host_stack_hcd_thread_entry(ULONG input) UINT hcd_index; UX_HCD *hcd; -UX_INT_SAVE_AREA +UX_INTERRUPT_SAVE_AREA UX_PARAMETER_NOT_USED(input); @@ -88,10 +92,14 @@ UX_INT_SAVE_AREA thread to process. */ _ux_utility_semaphore_get(&_ux_system_host -> ux_system_host_hcd_semaphore, UX_WAIT_FOREVER); +#if UX_MAX_HCD > 1 /* This thread was awaken by one or more HCD controllers. Check each of the HCDs to see who posted work to do. */ for(hcd_index = 0; hcd_index < _ux_system_host -> ux_system_host_registered_hcd; hcd_index++) { +#else + hcd_index = 0; +#endif /* Pickup HCD pointer. */ hcd = &_ux_system_host -> ux_system_host_hcd_array[hcd_index]; @@ -102,11 +110,14 @@ UX_INT_SAVE_AREA /* Yes, call the HCD function to process the work. */ hcd -> ux_hcd_entry_function(hcd, UX_HCD_PROCESS_DONE_QUEUE, UX_NULL); - UX_DISABLE_INTS + UX_DISABLE hcd -> ux_hcd_thread_signal--; - UX_RESTORE_INTS + UX_RESTORE } + +#if UX_MAX_HCD > 1 } +#endif } } diff --git a/common/core/src/ux_host_stack_hcd_transfer_request.c b/common/core/src/ux_host_stack_hcd_transfer_request.c index 02bfe6a..5511e7f 100644 --- a/common/core/src/ux_host_stack_hcd_transfer_request.c +++ b/common/core/src/ux_host_stack_hcd_transfer_request.c @@ -34,7 +34,7 @@ /* FUNCTION RELEASE */ /* */ /* _ux_host_stack_hcd_transfer_request PORTABLE C */ -/* 6.0 */ +/* 6.1 */ /* AUTHOR */ /* */ /* Chaoqiong Xiao, Microsoft Corporation */ @@ -65,22 +65,20 @@ /* DATE NAME DESCRIPTION */ /* */ /* 05-19-2020 Chaoqiong Xiao Initial Version 6.0 */ +/* 09-30-2020 Chaoqiong Xiao Modified comment(s), */ +/* optimized based on compile */ +/* definitions, */ +/* resulting in version 6.1 */ /* */ /**************************************************************************/ UINT _ux_host_stack_hcd_transfer_request(UX_TRANSFER *transfer_request) { -UX_ENDPOINT *endpoint; -UX_DEVICE *device; UINT status; UX_HCD *hcd; - /* Get the endpoint container from the transfer request. */ - endpoint = transfer_request -> ux_transfer_request_endpoint; - - /* Obtain the HCD for this endpoint. */ - device = endpoint -> ux_endpoint_device; - hcd = device -> ux_device_hcd; + /* Obtain the HCD. */ + hcd = UX_DEVICE_HCD_GET(transfer_request -> ux_transfer_request_endpoint -> ux_endpoint_device); /* Call the HCD entry function to process the transfer request. */ status = hcd -> ux_hcd_entry_function(hcd, UX_HCD_TRANSFER_REQUEST, (VOID *) transfer_request); diff --git a/common/core/src/ux_host_stack_hcd_unregister.c b/common/core/src/ux_host_stack_hcd_unregister.c new file mode 100644 index 0000000..0fdc6d5 --- /dev/null +++ b/common/core/src/ux_host_stack_hcd_unregister.c @@ -0,0 +1,189 @@ +/**************************************************************************/ +/* */ +/* 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 */ +/** */ +/** Host Stack */ +/** */ +/**************************************************************************/ +/**************************************************************************/ + + +/* Include necessary system files. */ + +#define UX_SOURCE_CODE + +#include "ux_api.h" +#include "ux_host_stack.h" + + +/**************************************************************************/ +/* */ +/* FUNCTION RELEASE */ +/* */ +/* _ux_host_stack_hcd_unregister PORTABLE C */ +/* 6.1 */ +/* AUTHOR */ +/* */ +/* Chaoqiong Xiao, Microsoft Corporation */ +/* */ +/* DESCRIPTION */ +/* */ +/* This function unregisters a USB host controller driver (HCD) with */ +/* the USBX stack, removes all devices rooted from that controller and */ +/* disable/stop the controller. */ +/* */ +/* INPUT */ +/* */ +/* hcd_name Name of HCD to unregister */ +/* hcd_param1 Parameter 1 of HCD */ +/* hcd_param2 Parameter 2 of HCD */ +/* */ +/* OUTPUT */ +/* */ +/* Completion Status */ +/* UX_SUCCESS HCD unregistered, related */ +/* devices removed and hardware */ +/* disabled/stopped success */ +/* UX_ERROR HCD not found */ +/* */ +/* CALLS */ +/* */ +/* _ux_utility_string_length_check Check and return C string */ +/* length if no error */ +/* _ux_utility_memory_compare Memory compare */ +/* (ux_hcd_entry_function) HCD dispatch entry function */ +/* */ +/* CALLED BY */ +/* */ +/* Application */ +/* */ +/* RELEASE HISTORY */ +/* */ +/* DATE NAME DESCRIPTION */ +/* */ +/* 09-30-2020 Chaoqiong Xiao Initial Version 6.1 */ +/* */ +/**************************************************************************/ +UINT _ux_host_stack_hcd_unregister(UCHAR *hcd_name, + ULONG hcd_param1, ULONG hcd_param2) +{ + +UINT status; +UX_DEVICE *device; +UX_HCD *hcd; +#if UX_MAX_CLASS_DRIVER > 1 || UX_MAX_DEVICES > 1 +ULONG scan_index; +#endif +#if !defined(UX_NAME_REFERENCED_BY_POINTER) +UINT hcd_name_length = 0; +#endif + + + /* If trace is enabled, insert this event into the trace buffer. */ + UX_TRACE_IN_LINE_INSERT(UX_TRACE_HOST_STACK_HCD_UNREGISTER, hcd_name, hcd_param1, hcd_param2, 0, UX_TRACE_HOST_STACK_EVENTS, 0, 0) + +#if !defined(UX_NAME_REFERENCED_BY_POINTER) + /* Get the length of the class name (exclude null-terminator). */ + status = _ux_utility_string_length_check(hcd_name, + &hcd_name_length, UX_MAX_HCD_NAME_LENGTH); + if (status) + return(status); +#endif + + /* Get first HCD. */ + hcd = _ux_system_host -> ux_system_host_hcd_array; + + /* Default to not found status. */ + status = UX_FALSE; + +#if UX_MAX_CLASS_DRIVER > 1 + /* We need to parse the controller driver table to find an empty spot. */ + for (scan_index = 0; + scan_index < _ux_system_host -> ux_system_host_max_hcd; + scan_index++) + { +#endif + + /* Is this slot available and saved hcd_parameters match? */ + if (hcd -> ux_hcd_status == UX_USED && + hcd -> ux_hcd_io == hcd_param1 && + hcd -> ux_hcd_irq == hcd_param2) + { + + + /* Yes, compare the name (with null terminator). */ + status = ux_utility_name_match(hcd -> ux_hcd_name, + hcd_name, hcd_name_length + 1); +#if UX_MAX_CLASS_DRIVER > 1 + + /* Break if name match (found HCD). */ + if (status == UX_TRUE) + break; +#endif + } + +#if UX_MAX_CLASS_DRIVER > 1 + /* Try the next HCD structure */ + hcd ++; + } +#endif + + /* No valid HCD found. */ + if (status != UX_TRUE) + return(UX_ERROR); + + /* Now disable controller. */ + hcd -> ux_hcd_entry_function(hcd, UX_HCD_DISABLE_CONTROLLER, UX_NULL); + + /* Get first device. */ + device = _ux_system_host -> ux_system_host_device_array; + +#if UX_MAX_DEVICES > 1 + /* Remove all devices connected to the controller. */ + for (scan_index = 0; + scan_index < _ux_system_host -> ux_system_host_max_devices; + scan_index ++) + { +#else + + /* No device. */ + if (device -> ux_device_handle == UX_UNUSED) + return(UX_SUCCESS); +#endif + + /* Is this device on the HCD root hub? */ + if (UX_DEVICE_HCD_MATCH(device, hcd) && + UX_DEVICE_PARENT_IS_ROOTHUB(device)) + { + + /* Remove the device (and downstream things connected to it). */ + _ux_host_stack_device_remove(hcd, UX_DEVICE_PARENT_GET(device), + UX_DEVICE_PORT_LOCATION_GET(device)); + + /* The device has been removed, so the port is free again. */ + hcd -> ux_hcd_rh_device_connection &= (ULONG) + ~(1 << device -> ux_device_port_location); + } + +#if UX_MAX_DEVICES > 1 + } +#endif + + /* And we have one new controller unregistered. */ + _ux_system_host -> ux_system_host_registered_hcd --; + + return(UX_SUCCESS); +} diff --git a/common/core/src/ux_host_stack_hnp_polling_thread_entry.c b/common/core/src/ux_host_stack_hnp_polling_thread_entry.c index d01d2da..d185cdf 100644 --- a/common/core/src/ux_host_stack_hnp_polling_thread_entry.c +++ b/common/core/src/ux_host_stack_hnp_polling_thread_entry.c @@ -29,12 +29,13 @@ #include "ux_host_stack.h" +#if defined(UX_OTG_SUPPORT) /**************************************************************************/ /* */ /* FUNCTION RELEASE */ /* */ /* _ux_host_stack_hnp_polling_thread_entry PORTABLE C */ -/* 6.0 */ +/* 6.1 */ /* AUTHOR */ /* */ /* Chaoqiong Xiao, Microsoft Corporation */ @@ -71,6 +72,10 @@ /* DATE NAME DESCRIPTION */ /* */ /* 05-19-2020 Chaoqiong Xiao Initial Version 6.0 */ +/* 09-30-2020 Chaoqiong Xiao Modified comment(s), */ +/* optimized based on compile */ +/* definitions, */ +/* resulting in version 6.1 */ /* */ /**************************************************************************/ VOID _ux_host_stack_hnp_polling_thread_entry(ULONG argument) @@ -134,7 +139,7 @@ UINT status; container_index = 0; /* Search the list until the end. */ - while (container_index++ < _ux_system_host -> ux_system_host_max_devices) + while (container_index++ < UX_SYSTEM_HOST_MAX_DEVICES_GET()) { /* Until we have found a used entry. */ @@ -142,8 +147,8 @@ UINT status; { /* Check for the parent device and the port location and the controller. */ - if((device -> ux_device_port_location == port_index) && - (device -> ux_device_hcd == hcd)) + if(UX_DEVICE_PORT_LOCATION_MATCH(device, port_index) && + UX_DEVICE_HCD_MATCH(device, hcd)) { /* We have a device on a OTG port. But is it a OTG HNP capable device ? @@ -229,4 +234,4 @@ UINT status; } } } - +#endif /* #if defined(UX_OTG_SUPPORT) */ diff --git a/common/core/src/ux_host_stack_initialize.c b/common/core/src/ux_host_stack_initialize.c index f8b6072..3363872 100644 --- a/common/core/src/ux_host_stack_initialize.c +++ b/common/core/src/ux_host_stack_initialize.c @@ -87,7 +87,7 @@ UCHAR _ux_system_host_hcd_simulator_name[] = "ux_ /* FUNCTION RELEASE */ /* */ /* _ux_host_stack_initialize PORTABLE C */ -/* 6.0 */ +/* 6.1 */ /* AUTHOR */ /* */ /* Chaoqiong Xiao, Microsoft Corporation */ @@ -124,6 +124,13 @@ UCHAR _ux_system_host_hcd_simulator_name[] = "ux_ /* DATE NAME DESCRIPTION */ /* */ /* 05-19-2020 Chaoqiong Xiao Initial Version 6.0 */ +/* 09-30-2020 Chaoqiong Xiao Modified comment(s), */ +/* optimized based on compile */ +/* definitions, used UX prefix */ +/* to refer to TX symbols */ +/* instead of using them */ +/* directly, */ +/* resulting in version 6.1 */ /* */ /**************************************************************************/ UINT _ux_host_stack_initialize(UINT (*ux_system_host_change_function)(ULONG, UX_HOST_CLASS *, VOID *)) @@ -137,12 +144,12 @@ UCHAR *memory; /* Initialize some of the global so that we don't have to recompile the core code when one item is adjusted. */ - _ux_system_host -> ux_system_host_max_class = UX_MAX_CLASS_DRIVER; - _ux_system_host -> ux_system_host_max_hcd = UX_MAX_HCD; - _ux_system_host -> ux_system_host_max_devices = UX_MAX_DEVICES; _ux_system_host -> ux_system_host_max_ed = UX_MAX_ED; _ux_system_host -> ux_system_host_max_td = UX_MAX_TD; _ux_system_host -> ux_system_host_max_iso_td = UX_MAX_ISO_TD; + UX_SYSTEM_HOST_MAX_CLASS_SET(UX_MAX_CLASS_DRIVER); + UX_SYSTEM_HOST_MAX_HCD_SET(UX_MAX_HCD); + UX_SYSTEM_HOST_MAX_DEVICES_SET(UX_MAX_DEVICES); /* Set the change device function address. */ _ux_system_host -> ux_system_host_change_function = ux_system_host_change_function; @@ -235,7 +242,7 @@ UCHAR *memory; status = _ux_utility_thread_create(&_ux_system_host -> ux_system_host_enum_thread, "ux_system_host_enum_thread", _ux_host_stack_enum_thread_entry, 0, _ux_system_host -> ux_system_host_enum_thread_stack, UX_HOST_ENUM_THREAD_STACK_SIZE, UX_THREAD_PRIORITY_ENUM, - UX_THREAD_PRIORITY_ENUM, UX_NO_TIME_SLICE, TX_AUTO_START); + UX_THREAD_PRIORITY_ENUM, UX_NO_TIME_SLICE, UX_AUTO_START); /* Check the completion status. */ if(status != UX_SUCCESS) @@ -248,7 +255,7 @@ UCHAR *memory; status = _ux_utility_thread_create(&_ux_system_host -> ux_system_host_hcd_thread, "ux_host_stack_hcd_thread", _ux_host_stack_hcd_thread_entry, 0, _ux_system_host -> ux_system_host_hcd_thread_stack, UX_HOST_HCD_THREAD_STACK_SIZE, UX_THREAD_PRIORITY_HCD, - UX_THREAD_PRIORITY_HCD, UX_NO_TIME_SLICE,TX_AUTO_START); + UX_THREAD_PRIORITY_HCD, UX_NO_TIME_SLICE,UX_AUTO_START); /* Check the completion status. */ if(status != UX_SUCCESS) @@ -273,7 +280,7 @@ UCHAR *memory; status = _ux_utility_thread_create(&_ux_system_host -> ux_system_host_hnp_polling_thread, "ux_host_stack_hnp_polling_thread", _ux_host_stack_hnp_polling_thread_entry, 0, _ux_system_host -> ux_system_host_hnp_polling_thread_stack, UX_HOST_HNP_POLLING_THREAD_STACK_SIZE, UX_THREAD_PRIORITY_ENUM, - UX_THREAD_PRIORITY_ENUM, UX_NO_TIME_SLICE, TX_AUTO_START); + UX_THREAD_PRIORITY_ENUM, UX_NO_TIME_SLICE, UX_AUTO_START); /* Check the completion status. */ if (status != UX_SUCCESS) 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 549b79b..237babc 100644 --- a/common/core/src/ux_host_stack_interface_endpoint_get.c +++ b/common/core/src/ux_host_stack_interface_endpoint_get.c @@ -34,7 +34,7 @@ /* FUNCTION RELEASE */ /* */ /* _ux_host_stack_interface_endpoint_get PORTABLE C */ -/* 6.0 */ +/* 6.1 */ /* AUTHOR */ /* */ /* Chaoqiong Xiao, Microsoft Corporation */ @@ -68,6 +68,8 @@ /* 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 */ /* */ /**************************************************************************/ UINT _ux_host_stack_interface_endpoint_get(UX_INTERFACE *interface, UINT endpoint_index, UX_ENDPOINT **endpoint) diff --git a/common/core/src/ux_host_stack_interface_instance_create.c b/common/core/src/ux_host_stack_interface_instance_create.c index 79482fc..57cd956 100644 --- a/common/core/src/ux_host_stack_interface_instance_create.c +++ b/common/core/src/ux_host_stack_interface_instance_create.c @@ -34,7 +34,7 @@ /* FUNCTION RELEASE */ /* */ /* _ux_host_stack_interface_instance_create PORTABLE C */ -/* 6.0 */ +/* 6.1 */ /* AUTHOR */ /* */ /* Chaoqiong Xiao, Microsoft Corporation */ @@ -65,6 +65,8 @@ /* 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 */ /* */ /**************************************************************************/ UINT _ux_host_stack_interface_instance_create(UX_INTERFACE *interface) diff --git a/common/core/src/ux_host_stack_interface_instance_delete.c b/common/core/src/ux_host_stack_interface_instance_delete.c index f12b1f5..4ecbef6 100644 --- a/common/core/src/ux_host_stack_interface_instance_delete.c +++ b/common/core/src/ux_host_stack_interface_instance_delete.c @@ -34,7 +34,7 @@ /* FUNCTION RELEASE */ /* */ /* _ux_host_stack_interface_instance_delete PORTABLE C */ -/* 6.0 */ +/* 6.1 */ /* AUTHOR */ /* */ /* Chaoqiong Xiao, Microsoft Corporation */ @@ -66,6 +66,8 @@ /* 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 */ /* */ /**************************************************************************/ VOID _ux_host_stack_interface_instance_delete(UX_INTERFACE *interface) diff --git a/common/core/src/ux_host_stack_interface_set.c b/common/core/src/ux_host_stack_interface_set.c index dd62866..a75eec5 100644 --- a/common/core/src/ux_host_stack_interface_set.c +++ b/common/core/src/ux_host_stack_interface_set.c @@ -34,7 +34,7 @@ /* FUNCTION RELEASE */ /* */ /* _ux_host_stack_interface_set PORTABLE C */ -/* 6.0 */ +/* 6.1 */ /* AUTHOR */ /* */ /* Chaoqiong Xiao, Microsoft Corporation */ @@ -65,6 +65,8 @@ /* 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 */ /* */ /**************************************************************************/ UINT _ux_host_stack_interface_set(UX_INTERFACE *interface) 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 5fb24a7..145fce6 100644 --- a/common/core/src/ux_host_stack_interface_setting_select.c +++ b/common/core/src/ux_host_stack_interface_setting_select.c @@ -34,7 +34,7 @@ /* FUNCTION RELEASE */ /* */ /* _ux_host_stack_interface_setting_select PORTABLE C */ -/* 6.0 */ +/* 6.1 */ /* AUTHOR */ /* */ /* Chaoqiong Xiao, Microsoft Corporation */ @@ -68,6 +68,8 @@ /* 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 */ /* */ /**************************************************************************/ UINT _ux_host_stack_interface_setting_select(UX_INTERFACE *interface) diff --git a/common/core/src/ux_host_stack_interfaces_scan.c b/common/core/src/ux_host_stack_interfaces_scan.c index 41cf9cd..1f4c143 100644 --- a/common/core/src/ux_host_stack_interfaces_scan.c +++ b/common/core/src/ux_host_stack_interfaces_scan.c @@ -34,7 +34,7 @@ /* FUNCTION RELEASE */ /* */ /* _ux_host_stack_interfaces_scan PORTABLE C */ -/* 6.0 */ +/* 6.1 */ /* AUTHOR */ /* */ /* Chaoqiong Xiao, Microsoft Corporation */ @@ -69,6 +69,8 @@ /* 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 */ /* */ /**************************************************************************/ UINT _ux_host_stack_interfaces_scan(UX_CONFIGURATION *configuration, UCHAR * descriptor) diff --git a/common/core/src/ux_host_stack_new_configuration_create.c b/common/core/src/ux_host_stack_new_configuration_create.c index e982289..9153441 100644 --- a/common/core/src/ux_host_stack_new_configuration_create.c +++ b/common/core/src/ux_host_stack_new_configuration_create.c @@ -34,7 +34,7 @@ /* FUNCTION RELEASE */ /* */ /* _ux_host_stack_new_configuration_create PORTABLE C */ -/* 6.0 */ +/* 6.1 */ /* AUTHOR */ /* */ /* Chaoqiong Xiao, Microsoft Corporation */ @@ -68,6 +68,8 @@ /* 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 */ /* */ /**************************************************************************/ VOID _ux_host_stack_new_configuration_create(UX_DEVICE *device, UX_CONFIGURATION *configuration) diff --git a/common/core/src/ux_host_stack_new_device_create.c b/common/core/src/ux_host_stack_new_device_create.c index 387cba9..af6a109 100644 --- a/common/core/src/ux_host_stack_new_device_create.c +++ b/common/core/src/ux_host_stack_new_device_create.c @@ -34,7 +34,7 @@ /* FUNCTION RELEASE */ /* */ /* _ux_host_stack_new_device_create PORTABLE C */ -/* 6.0 */ +/* 6.1 */ /* AUTHOR */ /* */ /* Chaoqiong Xiao, Microsoft Corporation */ @@ -92,6 +92,10 @@ /* DATE NAME DESCRIPTION */ /* */ /* 05-19-2020 Chaoqiong Xiao Initial Version 6.0 */ +/* 09-30-2020 Chaoqiong Xiao Modified comment(s), */ +/* optimized based on compile */ +/* definitions, */ +/* resulting in version 6.1 */ /* */ /**************************************************************************/ UINT _ux_host_stack_new_device_create(UX_HCD *hcd, UX_DEVICE *device_owner, @@ -104,6 +108,7 @@ UINT status; UX_ENDPOINT *control_endpoint; +#if UX_MAX_DEVICES > 1 /* Verify the number of devices attached to the HCD already. Normally a HCD can have up to 127 devices but that can be tailored. */ if (hcd -> ux_hcd_nb_devices > UX_MAX_USB_DEVICES) @@ -117,6 +122,7 @@ UX_ENDPOINT *control_endpoint; return(UX_TOO_MANY_DEVICES); } +#endif /* Get a new device container to store this new device. */ device = _ux_host_stack_new_device_get(); @@ -143,11 +149,11 @@ UX_ENDPOINT *control_endpoint; Initialize the device structure. */ device -> ux_device_handle = (ULONG) (ALIGN_TYPE) device; device -> ux_device_state = UX_DEVICE_ATTACHED; - device -> ux_device_parent = device_owner; - device -> ux_device_hcd = hcd; device -> ux_device_speed = device_speed; - device -> ux_device_port_location = port_index; - device -> ux_device_max_power = port_max_power; + UX_DEVICE_MAX_POWER_SET(device, port_max_power); + UX_DEVICE_PARENT_SET(device, device_owner); + UX_DEVICE_HCD_SET(device, hcd); + UX_DEVICE_PORT_LOCATION_SET(device, port_index); /* Create a semaphore for the device. This is to protect endpoint 0 mostly for OTG HNP polling. The initial count is 1 as a mutex mechanism. */ diff --git a/common/core/src/ux_host_stack_new_device_get.c b/common/core/src/ux_host_stack_new_device_get.c index 88fbb2f..62d5e4c 100644 --- a/common/core/src/ux_host_stack_new_device_get.c +++ b/common/core/src/ux_host_stack_new_device_get.c @@ -34,7 +34,7 @@ /* FUNCTION RELEASE */ /* */ /* _ux_host_stack_new_device_get PORTABLE C */ -/* 6.0 */ +/* 6.1 */ /* AUTHOR */ /* */ /* Chaoqiong Xiao, Microsoft Corporation */ @@ -64,23 +64,32 @@ /* DATE NAME DESCRIPTION */ /* */ /* 05-19-2020 Chaoqiong Xiao Initial Version 6.0 */ +/* 09-30-2020 Chaoqiong Xiao Modified comment(s), */ +/* optimized based on compile */ +/* definitions, verified */ +/* memset and memcpy cases, */ +/* resulting in version 6.1 */ /* */ /**************************************************************************/ UX_DEVICE *_ux_host_stack_new_device_get(VOID) { +#if UX_MAX_DEVICES > 1 ULONG container_index; +#endif UX_DEVICE *device; /* Start with the first device. */ device = _ux_system_host -> ux_system_host_device_array; +#if UX_MAX_DEVICES > 1 /* Reset the container index. */ container_index = 0; /* Search the list until the end. */ while (container_index++ < _ux_system_host -> ux_system_host_max_devices) +#endif { /* Until we have found an unused entry. */ @@ -88,7 +97,7 @@ UX_DEVICE *device; { /* Reset the entire entry. */ - _ux_utility_memory_set(device, 0, sizeof(UX_DEVICE)); + _ux_utility_memory_set(device, 0, sizeof(UX_DEVICE)); /* Use case of memset is verified. */ /* This entry is now used. */ device -> ux_device_handle = UX_USED; @@ -96,9 +105,11 @@ UX_DEVICE *device; /* Return the device pointer. */ return(device); } +#if UX_MAX_DEVICES > 1 /* Move to the next device entry. */ device++; +#endif } /* No unused devices, return NULL. */ diff --git a/common/core/src/ux_host_stack_new_endpoint_create.c b/common/core/src/ux_host_stack_new_endpoint_create.c index abadc00..d1ef9ee 100644 --- a/common/core/src/ux_host_stack_new_endpoint_create.c +++ b/common/core/src/ux_host_stack_new_endpoint_create.c @@ -34,7 +34,7 @@ /* FUNCTION RELEASE */ /* */ /* _ux_host_stack_new_endpoint_create PORTABLE C */ -/* 6.0 */ +/* 6.1 */ /* AUTHOR */ /* */ /* Chaoqiong Xiao, Microsoft Corporation */ @@ -72,6 +72,8 @@ /* 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 */ /* */ /**************************************************************************/ UINT _ux_host_stack_new_endpoint_create(UX_INTERFACE *interface, diff --git a/common/core/src/ux_host_stack_new_interface_create.c b/common/core/src/ux_host_stack_new_interface_create.c index 14c9c5a..0d15252 100644 --- a/common/core/src/ux_host_stack_new_interface_create.c +++ b/common/core/src/ux_host_stack_new_interface_create.c @@ -34,7 +34,7 @@ /* FUNCTION RELEASE */ /* */ /* _ux_host_stack_new_interface_create PORTABLE C */ -/* 6.0 */ +/* 6.1 */ /* AUTHOR */ /* */ /* Chaoqiong Xiao, Microsoft Corporation */ @@ -78,6 +78,8 @@ /* 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 */ /* */ /**************************************************************************/ UINT _ux_host_stack_new_interface_create(UX_CONFIGURATION *configuration, diff --git a/common/core/src/ux_host_stack_rh_change_process.c b/common/core/src/ux_host_stack_rh_change_process.c index 91bc167..8a6b1f3 100644 --- a/common/core/src/ux_host_stack_rh_change_process.c +++ b/common/core/src/ux_host_stack_rh_change_process.c @@ -34,7 +34,7 @@ /* FUNCTION RELEASE */ /* */ /* _ux_host_stack_rh_change_process PORTABLE C */ -/* 6.0 */ +/* 6.1 */ /* AUTHOR */ /* */ /* Chaoqiong Xiao, Microsoft Corporation */ @@ -67,6 +67,9 @@ /* DATE NAME DESCRIPTION */ /* */ /* 05-19-2020 Chaoqiong Xiao Initial Version 6.0 */ +/* 09-30-2020 Chaoqiong Xiao Modified comment(s), */ +/* used new interrupt macros, */ +/* resulting in version 6.1 */ /* */ /**************************************************************************/ VOID _ux_host_stack_rh_change_process(VOID) @@ -76,7 +79,7 @@ UX_HCD *hcd; UINT hcd_index; ULONG port_status; UINT port_index; -UX_INT_SAVE_AREA +UX_INTERRUPT_SAVE_AREA /* This thread was maybe awaken by one or more HCD controllers. Check each of the HCD to see where there has been a change of topology. */ @@ -102,9 +105,9 @@ UX_INT_SAVE_AREA UX_TRACE_IN_LINE_INSERT(UX_TRACE_HOST_STACK_RH_CHANGE_PROCESS, port_index, 0, 0, 0, UX_TRACE_HOST_STACK_EVENTS, 0, 0) /* Reset that port activity signal. */ - UX_DISABLE_INTS + UX_DISABLE hcd -> ux_hcd_root_hub_signal[port_index]--; - UX_RESTORE_INTS + UX_RESTORE /* Call HCD for port status. */ port_status = hcd -> ux_hcd_entry_function(hcd, UX_HCD_GET_PORT_STATUS, (VOID *)((ALIGN_TYPE)port_index)); @@ -139,9 +142,9 @@ UX_INT_SAVE_AREA { /* We need to get back in synch now. */ - UX_DISABLE_INTS + UX_DISABLE hcd -> ux_hcd_root_hub_signal[port_index] = 0; - UX_RESTORE_INTS + UX_RESTORE /* First extract the device. */ _ux_host_stack_rh_device_extraction(hcd,port_index); diff --git a/common/core/src/ux_host_stack_rh_device_extraction.c b/common/core/src/ux_host_stack_rh_device_extraction.c index 90d8b80..42182e7 100644 --- a/common/core/src/ux_host_stack_rh_device_extraction.c +++ b/common/core/src/ux_host_stack_rh_device_extraction.c @@ -34,7 +34,7 @@ /* FUNCTION RELEASE */ /* */ /* _ux_host_stack_rh_device_extraction PORTABLE C */ -/* 6.0 */ +/* 6.1 */ /* AUTHOR */ /* */ /* Chaoqiong Xiao, Microsoft Corporation */ @@ -66,6 +66,8 @@ /* 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 */ /* */ /**************************************************************************/ UINT _ux_host_stack_rh_device_extraction(UX_HCD *hcd, UINT port_index) diff --git a/common/core/src/ux_host_stack_rh_device_insertion.c b/common/core/src/ux_host_stack_rh_device_insertion.c index fe08260..a30ed4a 100644 --- a/common/core/src/ux_host_stack_rh_device_insertion.c +++ b/common/core/src/ux_host_stack_rh_device_insertion.c @@ -34,7 +34,7 @@ /* FUNCTION RELEASE */ /* */ /* _ux_host_stack_rh_device_insertion PORTABLE C */ -/* 6.0 */ +/* 6.1 */ /* AUTHOR */ /* */ /* Chaoqiong Xiao, Microsoft Corporation */ @@ -69,6 +69,10 @@ /* DATE NAME DESCRIPTION */ /* */ /* 05-19-2020 Chaoqiong Xiao Initial Version 6.0 */ +/* 09-30-2020 Chaoqiong Xiao Modified comment(s), */ +/* checked HCD status before */ +/* retrying enumeration, */ +/* resulting in version 6.1 */ /* */ /**************************************************************************/ UINT _ux_host_stack_rh_device_insertion(UX_HCD *hcd, UINT port_index) @@ -142,11 +146,18 @@ UINT status; /* Return success to the caller. */ return(UX_SUCCESS); } - else if (index_loop < UX_RH_ENUMERATION_RETRY - 1) + else + { + + /* Return error if HCD is dead. */ + if (hcd -> ux_hcd_status != UX_HCD_STATUS_OPERATIONAL) + return(UX_CONTROLLER_DEAD); - /* Simulate remove to free allocated resources before retry. */ + /* Simulate remove to free allocated resources if retry. */ + if (index_loop < UX_RH_ENUMERATION_RETRY - 1) _ux_host_stack_device_remove(hcd, UX_NULL, port_index); } + } /* We get here if something did not go well. Either the port did not respond well to the ENABLE\RESET phases or the device did not enumerate well diff --git a/common/core/src/ux_host_stack_role_swap.c b/common/core/src/ux_host_stack_role_swap.c index f28b32a..46aee96 100644 --- a/common/core/src/ux_host_stack_role_swap.c +++ b/common/core/src/ux_host_stack_role_swap.c @@ -34,7 +34,7 @@ /* FUNCTION RELEASE */ /* */ /* _ux_host_stack_role_swap PORTABLE C */ -/* 6.0 */ +/* 6.1 */ /* AUTHOR */ /* */ /* Chaoqiong Xiao, Microsoft Corporation */ @@ -68,11 +68,21 @@ /* DATE NAME DESCRIPTION */ /* */ /* 05-19-2020 Chaoqiong Xiao Initial Version 6.0 */ +/* 09-30-2020 Chaoqiong Xiao Modified comment(s), */ +/* optimized based on compile */ +/* definitions, */ +/* resulting in version 6.1 */ /* */ /**************************************************************************/ UINT _ux_host_stack_role_swap(UX_DEVICE *device) { +#if !defined(UX_OTG_SUPPORT) + + UX_PARAMETER_NOT_USED(device); + return(UX_FUNCTION_NOT_SUPPORTED); +#else + UX_ENDPOINT *control_endpoint; UX_TRANSFER *transfer_request; UINT status; @@ -111,5 +121,5 @@ UINT status; _ux_system_otg -> ux_system_otg_change_mode_event = 0; return(UX_SUCCESS); +#endif } - diff --git a/common/core/src/ux_host_stack_transfer_request.c b/common/core/src/ux_host_stack_transfer_request.c index 8c093be..8f7740f 100644 --- a/common/core/src/ux_host_stack_transfer_request.c +++ b/common/core/src/ux_host_stack_transfer_request.c @@ -34,7 +34,7 @@ /* FUNCTION RELEASE */ /* */ /* _ux_host_stack_transfer_request PORTABLE C */ -/* 6.0 */ +/* 6.1 */ /* AUTHOR */ /* */ /* Chaoqiong Xiao, Microsoft Corporation */ @@ -78,12 +78,19 @@ /* DATE NAME DESCRIPTION */ /* */ /* 05-19-2020 Chaoqiong Xiao Initial Version 6.0 */ +/* 09-30-2020 Chaoqiong Xiao Modified comment(s), */ +/* optimized based on compile */ +/* definitions, used UX prefix */ +/* to refer to TX symbols */ +/* instead of using them */ +/* directly, */ +/* resulting in version 6.1 */ /* */ /**************************************************************************/ UINT _ux_host_stack_transfer_request(UX_TRANSFER *transfer_request) { -TX_INTERRUPT_SAVE_AREA +UX_INTERRUPT_SAVE_AREA UX_ENDPOINT *endpoint; UX_DEVICE *device; @@ -99,7 +106,7 @@ UINT status; /* Ensure we are not preempted by the enum thread while we check the device state and set the transfer status. */ - TX_DISABLE + UX_DISABLE /* We can only transfer when the device is ATTACHED, ADDRESSED OR CONFIGURED. */ if ((device -> ux_device_state == UX_DEVICE_ATTACHED) || (device -> ux_device_state == UX_DEVICE_ADDRESSED) @@ -117,7 +124,7 @@ UINT status; { /* The device is in an invalid state. Restore interrupts and return error. */ - TX_RESTORE + UX_RESTORE /* Check if this is endpoint 0. */ if ((endpoint -> ux_endpoint_descriptor.bEndpointAddress & (UINT)~UX_ENDPOINT_DIRECTION) == 0) @@ -136,13 +143,13 @@ UINT status; } /* Restore interrupts. */ - TX_RESTORE + UX_RESTORE /* If trace is enabled, insert this event into the trace buffer. */ UX_TRACE_IN_LINE_INSERT(UX_TRACE_HOST_STACK_TRANSFER_REQUEST, device, endpoint, transfer_request, 0, UX_TRACE_HOST_STACK_EVENTS, 0, 0) /* With the device we have the pointer to the HCD. */ - hcd = device -> ux_device_hcd; + hcd = UX_DEVICE_HCD_GET(device); /* If this is endpoint 0, we protect the endpoint from a possible re-entry. */ if ((endpoint -> ux_endpoint_descriptor.bEndpointAddress & (UINT)~UX_ENDPOINT_DIRECTION) == 0) 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 cbdaa19..1b51853 100644 --- a/common/core/src/ux_host_stack_transfer_request_abort.c +++ b/common/core/src/ux_host_stack_transfer_request_abort.c @@ -34,7 +34,7 @@ /* FUNCTION RELEASE */ /* */ /* _ux_host_stack_transfer_request_abort PORTABLE C */ -/* 6.0 */ +/* 6.1 */ /* AUTHOR */ /* */ /* Chaoqiong Xiao, Microsoft Corporation */ @@ -73,28 +73,24 @@ /* DATE NAME DESCRIPTION */ /* */ /* 05-19-2020 Chaoqiong Xiao Initial Version 6.0 */ +/* 09-30-2020 Chaoqiong Xiao Modified comment(s), */ +/* optimized based on compile */ +/* definitions, */ +/* resulting in version 6.1 */ /* */ /**************************************************************************/ UINT _ux_host_stack_transfer_request_abort(UX_TRANSFER *transfer_request) { -UX_ENDPOINT *endpoint; -UX_DEVICE *device; UX_HCD *hcd; ULONG completion_code; - /* Get the endpoint container from the transfer request. */ - endpoint = transfer_request -> ux_transfer_request_endpoint; - - /* Get the device container from the endpoint. */ - device = endpoint -> ux_endpoint_device; - /* If trace is enabled, insert this event into the trace buffer. */ UX_TRACE_IN_LINE_INSERT(UX_TRACE_HOST_STACK_TRANSFER_REQUEST_ABORT, device, endpoint, transfer_request, 0, UX_TRACE_HOST_STACK_EVENTS, 0, 0) /* With the device we have the pointer to the HCD. */ - hcd = device -> ux_device_hcd; + hcd = UX_DEVICE_HCD_GET(transfer_request -> ux_transfer_request_endpoint -> ux_endpoint_device); /* Check pending transaction. */ if (transfer_request -> ux_transfer_request_completion_code == UX_TRANSFER_STATUS_PENDING) diff --git a/common/core/src/ux_host_stack_uninitialize.c b/common/core/src/ux_host_stack_uninitialize.c new file mode 100644 index 0000000..770a44a --- /dev/null +++ b/common/core/src/ux_host_stack_uninitialize.c @@ -0,0 +1,121 @@ +/**************************************************************************/ +/* */ +/* 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 */ +/** */ +/** Host Stack */ +/** */ +/**************************************************************************/ +/**************************************************************************/ + + +/* Include necessary system files. */ + +#define UX_SOURCE_CODE + +#include "ux_api.h" +#include "ux_host_stack.h" + + +/**************************************************************************/ +/* */ +/* FUNCTION RELEASE */ +/* */ +/* _ux_host_stack_uninitialize PORTABLE C */ +/* 6.1 */ +/* AUTHOR */ +/* */ +/* Chaoqiong Xiao, Microsoft Corporation */ +/* */ +/* DESCRIPTION */ +/* */ +/* This function uninitializes all the host code for USBX to work on a */ +/* specific platform. */ +/* */ +/* Note following steps must be done before host stack uninitialize: */ +/* All HCDs must be unregistered (devices also removed). */ +/* All classes unregistered (clients attached also removed). */ +/* */ +/* INPUT */ +/* */ +/* */ +/* OUTPUT */ +/* */ +/* Completion Status */ +/* UX_SUCCESS Uninitialized success */ +/* */ +/* */ +/* CALLS */ +/* */ +/* _ux_utility_memory_free Free host memory */ +/* _ux_utility_thread_delete Delete host thread */ +/* _ux_utility_semaphore_delete Delete host semaphore */ +/* */ +/* CALLED BY */ +/* */ +/* Application */ +/* */ +/* RELEASE HISTORY */ +/* */ +/* DATE NAME DESCRIPTION */ +/* */ +/* 09-30-2020 Chaoqiong Xiao Initial Version 6.1 */ +/* */ +/**************************************************************************/ +UINT _ux_host_stack_uninitialize(VOID) +{ + + /* If trace is enabled, insert this event into the trace buffer. */ + UX_TRACE_IN_LINE_INSERT(UX_TRACE_HOST_STACK_UNINITIALIZE, 0, 0, 0, 0, UX_TRACE_HOST_STACK_EVENTS, 0, 0) + + /* Delete enumeration thread. */ + _ux_utility_thread_delete(&_ux_system_host -> ux_system_host_enum_thread); + + /* Delete enumeration semaphore. */ + _ux_utility_semaphore_delete(&_ux_system_host -> ux_system_host_enum_semaphore); + + /* Free enumeration thread stack. */ + _ux_utility_memory_free(_ux_system_host -> ux_system_host_enum_thread_stack); + + /* Delete HCD thread. */ + _ux_utility_thread_delete(&_ux_system_host -> ux_system_host_hcd_thread); + + /* Delete HCD semaphore. */ + _ux_utility_semaphore_delete(&_ux_system_host -> ux_system_host_hcd_semaphore); + + /* Free HCD thread stack. */ + _ux_utility_memory_free(_ux_system_host -> ux_system_host_hcd_thread_stack); + +#if UX_OTG_SUPPORT + + /* Delete HNP thread. */ + _ux_utility_thread_delete(&_ux_system_host -> ux_system_host_hnp_polling_thread); + + /* Free HNP thread stack. */ + _ux_utility_memory_free(_ux_system_host -> ux_system_host_hnp_polling_thread_stack); +#endif + + /* Free HCD array. */ + _ux_utility_memory_free(_ux_system_host -> ux_system_host_hcd_array); + + /* Free Class array. */ + _ux_utility_memory_free(_ux_system_host -> ux_system_host_class_array); + + /* Free Device array. */ + _ux_utility_memory_free(_ux_system_host -> ux_system_host_device_array); + + /* Return success to caller. */ + return(UX_SUCCESS); +} diff --git a/common/core/src/ux_system_error_handler.c b/common/core/src/ux_system_error_handler.c index 530c925..939a16a 100644 --- a/common/core/src/ux_system_error_handler.c +++ b/common/core/src/ux_system_error_handler.c @@ -27,13 +27,13 @@ #include "ux_api.h" - +#ifndef UX_DISABLE_ERROR_HANDLER /**************************************************************************/ /* */ /* FUNCTION RELEASE */ /* */ /* _ux_system_error_handler PORTABLE C */ -/* 6.0 */ +/* 6.1 */ /* AUTHOR */ /* */ /* Chaoqiong Xiao, Microsoft Corporation */ @@ -66,11 +66,13 @@ /* 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 */ /* */ /**************************************************************************/ VOID _ux_system_error_handler(UINT system_level, UINT system_context, UINT error_code) { - + /* Save the last system error code. */ _ux_system -> ux_system_last_error = error_code; @@ -85,3 +87,4 @@ VOID _ux_system_error_handler(UINT system_level, UINT system_context, UINT err _ux_system -> ux_system_error_callback_function(system_level, system_context, error_code); } } +#endif diff --git a/common/core/src/ux_system_initialize.c b/common/core/src/ux_system_initialize.c index b232f8d..17c0d3a 100644 --- a/common/core/src/ux_system_initialize.c +++ b/common/core/src/ux_system_initialize.c @@ -65,7 +65,7 @@ UCHAR _ux_system_ecm_interface_descriptor_structure[] = {1,1 /* FUNCTION RELEASE */ /* */ /* _ux_system_initialize PORTABLE C */ -/* 6.0 */ +/* 6.1 */ /* AUTHOR */ /* */ /* Chaoqiong Xiao, Microsoft Corporation */ @@ -101,6 +101,10 @@ UCHAR _ux_system_ecm_interface_descriptor_structure[] = {1,1 /* DATE NAME DESCRIPTION */ /* */ /* 05-19-2020 Chaoqiong Xiao Initial Version 6.0 */ +/* 09-30-2020 Chaoqiong Xiao Modified comment(s), */ +/* verified memset and memcpy */ +/* cases, */ +/* resulting in version 6.1 */ /* */ /**************************************************************************/ UINT _ux_system_initialize(VOID *regular_memory_pool_start, ULONG regular_memory_size, @@ -114,7 +118,7 @@ UINT status; ULONG memory_pool_offset; /* Reset memory block */ - _ux_utility_memory_set(regular_memory_pool_start, 0, regular_memory_size); + _ux_utility_memory_set(regular_memory_pool_start, 0, regular_memory_size); /* Use case of memset is verified. */ /* Set the _ux_system structure at the start of our regular memory */ _ux_system = (UX_SYSTEM *) regular_memory_pool_start; @@ -207,7 +211,7 @@ ULONG memory_pool_offset; _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); + _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; @@ -215,6 +219,15 @@ ULONG memory_pool_offset; memory_block -> ux_memory_block_status = UX_MEMORY_UNUSED; } +#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; + + /* Other fields are kept zero. */ +#endif + #ifdef UX_ENABLE_DEBUG_LOG /* Obtain memory for storing the debug log. */ diff --git a/common/core/src/ux_system_uninitialize.c b/common/core/src/ux_system_uninitialize.c index c00a36a..5b20e04 100644 --- a/common/core/src/ux_system_uninitialize.c +++ b/common/core/src/ux_system_uninitialize.c @@ -34,7 +34,7 @@ /* FUNCTION RELEASE */ /* */ /* _ux_system_uninitialize PORTABLE C */ -/* 6.0 */ +/* 6.1 */ /* AUTHOR */ /* */ /* Chaoqiong Xiao, Microsoft Corporation */ @@ -63,6 +63,8 @@ /* 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 */ /* */ /**************************************************************************/ UINT _ux_system_uninitialize(VOID) diff --git a/common/core/src/ux_trace_event_insert.c b/common/core/src/ux_trace_event_insert.c index 33ae201..0cd38f8 100644 --- a/common/core/src/ux_trace_event_insert.c +++ b/common/core/src/ux_trace_event_insert.c @@ -35,7 +35,7 @@ /* FUNCTION RELEASE */ /* */ /* _ux_trace_event_insert PORTABLE C */ -/* 6.0 */ +/* 6.1 */ /* AUTHOR */ /* */ /* Chaoqiong Xiao, Microsoft Corporation */ @@ -73,6 +73,11 @@ /* DATE NAME DESCRIPTION */ /* */ /* 05-19-2020 Chaoqiong Xiao Initial Version 6.0 */ +/* 09-30-2020 Chaoqiong Xiao Modified comment(s), */ +/* used UX prefix to refer to */ +/* TX symbols instead of using */ +/* them directly, */ +/* resulting in version 6.1 */ /* */ /**************************************************************************/ #ifdef UX_TRACE_INSERT_MACROS @@ -80,14 +85,14 @@ VOID _ux_trace_event_insert(ULONG event_id, ULONG info_field_1, ULONG info_fiel ULONG filter, TX_TRACE_BUFFER_ENTRY **current_event, ULONG *current_timestamp) { -TX_INTERRUPT_SAVE_AREA +UX_INTERRUPT_SAVE_AREA TX_TRACE_BUFFER_ENTRY *event; ULONG timestamp; /* Disable interrupts. */ - TX_DISABLE + UX_DISABLE /* Pickup the current event. */ event = _tx_trace_buffer_current_ptr; @@ -134,7 +139,7 @@ ULONG timestamp; } /* Restore interrupts. */ - TX_RESTORE + UX_RESTORE } #endif diff --git a/common/core/src/ux_trace_event_update.c b/common/core/src/ux_trace_event_update.c index 516f783..06e8be2 100644 --- a/common/core/src/ux_trace_event_update.c +++ b/common/core/src/ux_trace_event_update.c @@ -35,7 +35,7 @@ /* FUNCTION RELEASE */ /* */ /* _ux_trace_event_update PORTABLE C */ -/* 6.0 */ +/* 6.1 */ /* AUTHOR */ /* */ /* Chaoqiong Xiao, Microsoft Corporation */ @@ -71,17 +71,22 @@ /* DATE NAME DESCRIPTION */ /* */ /* 05-19-2020 Chaoqiong Xiao Initial Version 6.0 */ +/* 09-30-2020 Chaoqiong Xiao Modified comment(s), */ +/* used UX prefix to refer to */ +/* TX symbols instead of using */ +/* them directly, */ +/* resulting in version 6.1 */ /* */ /**************************************************************************/ #ifdef UX_TRACE_INSERT_MACROS VOID _ux_trace_event_update(TX_TRACE_BUFFER_ENTRY *event, ULONG timestamp, ULONG event_id, ULONG info_field_1, ULONG info_field_2, ULONG info_field_3, ULONG info_field_4) { -TX_INTERRUPT_SAVE_AREA +UX_INTERRUPT_SAVE_AREA /* Disable interrupts. */ - TX_DISABLE + UX_DISABLE /* Determine if the event exists and is still the event originally inserted into the trace. */ if ((event) && (event -> tx_trace_buffer_entry_event_id == event_id) && (event -> tx_trace_buffer_entry_time_stamp == timestamp)) @@ -122,7 +127,7 @@ TX_INTERRUPT_SAVE_AREA } } /* Restore interrupts. */ - TX_RESTORE + UX_RESTORE } #endif diff --git a/common/core/src/ux_trace_object_register.c b/common/core/src/ux_trace_object_register.c index 8a1758f..04f86e3 100644 --- a/common/core/src/ux_trace_object_register.c +++ b/common/core/src/ux_trace_object_register.c @@ -36,7 +36,7 @@ extern VOID _tx_trace_object_register(UCHAR , VOID *, CHAR *, ULONG , ULONG ); /* FUNCTION RELEASE */ /* */ /* _ux_trace_object_register PORTABLE C */ -/* 6.0 */ +/* 6.1 */ /* AUTHOR */ /* */ /* Chaoqiong Xiao, Microsoft Corporation */ @@ -70,22 +70,27 @@ extern VOID _tx_trace_object_register(UCHAR , VOID *, CHAR *, ULONG , ULONG ); /* DATE NAME DESCRIPTION */ /* */ /* 05-19-2020 Chaoqiong Xiao Initial Version 6.0 */ +/* 09-30-2020 Chaoqiong Xiao Modified comment(s), */ +/* used UX prefix to refer to */ +/* TX symbols instead of using */ +/* them directly, */ +/* resulting in version 6.1 */ /* */ /**************************************************************************/ VOID _ux_trace_object_register(UCHAR object_type, VOID *object_ptr, CHAR *object_name, ULONG parameter_1, ULONG parameter_2) { -TX_INTERRUPT_SAVE_AREA +UX_INTERRUPT_SAVE_AREA /* Disable interrupts. */ - TX_DISABLE + UX_DISABLE /* Call actual object register function. */ _tx_trace_object_register(object_type, object_ptr, object_name, parameter_1, parameter_2); /* Restore interrupts. */ - TX_RESTORE + UX_RESTORE } #endif diff --git a/common/core/src/ux_trace_object_unregister.c b/common/core/src/ux_trace_object_unregister.c index 88417db..8e553b0 100644 --- a/common/core/src/ux_trace_object_unregister.c +++ b/common/core/src/ux_trace_object_unregister.c @@ -36,7 +36,7 @@ extern VOID _tx_trace_object_unregister(VOID *); /* FUNCTION RELEASE */ /* */ /* _ux_trace_object_unregister PORTABLE C */ -/* 6.0 */ +/* 6.1 */ /* AUTHOR */ /* */ /* Chaoqiong Xiao, Microsoft Corporation */ @@ -66,21 +66,26 @@ extern VOID _tx_trace_object_unregister(VOID *); /* DATE NAME DESCRIPTION */ /* */ /* 05-19-2020 Chaoqiong Xiao Initial Version 6.0 */ +/* 09-30-2020 Chaoqiong Xiao Modified comment(s), */ +/* used UX prefix to refer to */ +/* TX symbols instead of using */ +/* them directly, */ +/* resulting in version 6.1 */ /* */ /**************************************************************************/ VOID _ux_trace_object_unregister(VOID *object_ptr) { -TX_INTERRUPT_SAVE_AREA +UX_INTERRUPT_SAVE_AREA /* Disable interrupts. */ - TX_DISABLE + UX_DISABLE /* Call actual object unregister function. */ _tx_trace_object_unregister(object_ptr); /* Restore interrupts. */ - TX_RESTORE + UX_RESTORE } #endif diff --git a/common/core/src/ux_utility_debug_callback_register.c b/common/core/src/ux_utility_debug_callback_register.c index 59b35c4..fada5de 100644 --- a/common/core/src/ux_utility_debug_callback_register.c +++ b/common/core/src/ux_utility_debug_callback_register.c @@ -34,7 +34,7 @@ /* FUNCTION RELEASE */ /* */ /* _ux_utility_debug_callback_register PORTABLE C */ -/* 6.0 */ +/* 6.1 */ /* AUTHOR */ /* */ /* Chaoqiong Xiao, Microsoft Corporation */ @@ -67,6 +67,8 @@ /* 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 */ /* */ /**************************************************************************/ VOID _ux_utility_debug_callback_register(VOID (*debug_callback)(UCHAR *, ULONG)) diff --git a/common/core/src/ux_utility_debug_log.c b/common/core/src/ux_utility_debug_log.c index a7fdddf..d7d1f0c 100644 --- a/common/core/src/ux_utility_debug_log.c +++ b/common/core/src/ux_utility_debug_log.c @@ -34,7 +34,7 @@ /* FUNCTION RELEASE */ /* */ /* _ux_utility_debug_log PORTABLE C */ -/* 6.0 */ +/* 6.1 */ /* AUTHOR */ /* */ /* Chaoqiong Xiao, Microsoft Corporation */ @@ -74,6 +74,12 @@ /* DATE NAME DESCRIPTION */ /* */ /* 05-19-2020 Chaoqiong Xiao Initial Version 6.0 */ +/* 09-30-2020 Chaoqiong Xiao Modified comment(s), */ +/* verified memset and memcpy */ +/* cases, used UX prefix to */ +/* refer to TX symbols instead */ +/* of using them directly, */ +/* resulting in version 6.1 */ /* */ /**************************************************************************/ VOID _ux_utility_debug_log(UCHAR *debug_location, UCHAR *debug_message, ULONG debug_code, @@ -88,7 +94,7 @@ ULONG parameter_shift; UCHAR parameter_hexa; ULONG local_parameter_value; ULONG current_time; -TX_INTERRUPT_SAVE_AREA +UX_INTERRUPT_SAVE_AREA /* Is USBX system completely initialized ? */ if (_ux_system -> ux_system_debug_log_size == 0) @@ -97,7 +103,7 @@ TX_INTERRUPT_SAVE_AREA return; /* Entering critical area. Disable interrupts. */ - TX_DISABLE + UX_DISABLE /* Store the debug value as the last debug value recorded. */ _ux_system -> ux_system_debug_code = debug_code; @@ -117,7 +123,10 @@ TX_INTERRUPT_SAVE_AREA total_debug_message_length = debug_location_string_length + debug_message_string_length + 10 + 10 + 10 + 10 + 5; /* Can we accommodate this debug value message at the current location ? */ - if (_ux_system -> ux_system_debug_log_head + total_debug_message_length > _ux_system -> ux_system_debug_log_buffer + _ux_system -> ux_system_debug_log_size) + if (total_debug_message_length >= _ux_system -> ux_system_debug_log_size) + return; + if (_ux_system -> ux_system_debug_log_head + total_debug_message_length > + ux_system -> ux_system_debug_log_buffer + _ux_system -> ux_system_debug_log_size) { /* The debug value log to insert goes beyond the end of the log buffer, rewind to the beginning. */ @@ -125,7 +134,7 @@ TX_INTERRUPT_SAVE_AREA } /* Copy the time strings and parameters in the log buffer. */ - _ux_utility_memory_copy(_ux_system -> ux_system_debug_log_head, "At time : ", 10); + _ux_utility_memory_copy(_ux_system -> ux_system_debug_log_head, "At time : ", 10); /* Use case of memcpy is verified. */ _ux_system -> ux_system_debug_log_head += 10; /* Get the time value from TX. */ @@ -173,11 +182,11 @@ TX_INTERRUPT_SAVE_AREA _ux_system -> ux_system_debug_log_head++; /* Copy the strings and parameters in the log buffer. */ - _ux_utility_memory_copy(_ux_system -> ux_system_debug_log_head, debug_location, debug_location_string_length); + _ux_utility_memory_copy(_ux_system -> ux_system_debug_log_head, debug_location, debug_location_string_length); /* Use case of memcpy is verified. */ _ux_system -> ux_system_debug_log_head += debug_location_string_length; *_ux_system -> ux_system_debug_log_head = ','; _ux_system -> ux_system_debug_log_head++; - _ux_utility_memory_copy(_ux_system -> ux_system_debug_log_head, debug_message, debug_message_string_length); + _ux_utility_memory_copy(_ux_system -> ux_system_debug_log_head, debug_message, debug_message_string_length); /* Use case of memcpy is verified. */ _ux_system -> ux_system_debug_log_head += debug_message_string_length; *_ux_system -> ux_system_debug_log_head = ','; _ux_system -> ux_system_debug_log_head++; @@ -301,7 +310,7 @@ TX_INTERRUPT_SAVE_AREA } /* Restore interrupts. */ - TX_RESTORE + UX_RESTORE /* We are done here. No return codes. */ return; diff --git a/common/core/src/ux_utility_delay_ms.c b/common/core/src/ux_utility_delay_ms.c index 78c1dc8..cb212c3 100644 --- a/common/core/src/ux_utility_delay_ms.c +++ b/common/core/src/ux_utility_delay_ms.c @@ -33,7 +33,7 @@ /* FUNCTION RELEASE */ /* */ /* _ux_utility_delay_ms PORTABLE C */ -/* 6.0 */ +/* 6.1 */ /* AUTHOR */ /* */ /* Chaoqiong Xiao, Microsoft Corporation */ @@ -65,6 +65,8 @@ /* 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 */ /* */ /**************************************************************************/ VOID _ux_utility_delay_ms(ULONG ms_wait) diff --git a/common/core/src/ux_utility_descriptor_pack.c b/common/core/src/ux_utility_descriptor_pack.c index 6db1b61..574c56c 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.0 */ +/* 6.1 */ /* AUTHOR */ /* */ /* Chaoqiong Xiao, Microsoft Corporation */ @@ -70,6 +70,8 @@ /* 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 */ /* */ /**************************************************************************/ 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 496a406..ff23559 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.0 */ +/* 6.1 */ /* AUTHOR */ /* */ /* Chaoqiong Xiao, Microsoft Corporation */ @@ -70,6 +70,8 @@ /* 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 */ /* */ /**************************************************************************/ VOID _ux_utility_descriptor_parse(UCHAR * raw_descriptor, UCHAR * descriptor_structure, diff --git a/common/core/src/ux_utility_error_callback_register.c b/common/core/src/ux_utility_error_callback_register.c index cf77f0f..b0809db 100644 --- a/common/core/src/ux_utility_error_callback_register.c +++ b/common/core/src/ux_utility_error_callback_register.c @@ -26,12 +26,14 @@ #include "ux_api.h" + +#ifndef UX_DISABLE_ERROR_HANDLER /**************************************************************************/ /* */ /* FUNCTION RELEASE */ /* */ /* _ux_utility_error_callback_register PORTABLE C */ -/* 6.0 */ +/* 6.1 */ /* AUTHOR */ /* */ /* Chaoqiong Xiao, Microsoft Corporation */ @@ -64,6 +66,8 @@ /* 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 */ /* */ /**************************************************************************/ VOID _ux_utility_error_callback_register(VOID (*error_callback)(UINT system_level, UINT system_context, UINT error_code)) @@ -76,3 +80,5 @@ VOID _ux_utility_error_callback_register(VOID (*error_callback)(UINT system_lev /* We are done here. No return codes. */ return; } +#endif + diff --git a/common/core/src/ux_utility_event_flags_create.c b/common/core/src/ux_utility_event_flags_create.c index 8d43c58..bb7d72f 100644 --- a/common/core/src/ux_utility_event_flags_create.c +++ b/common/core/src/ux_utility_event_flags_create.c @@ -33,7 +33,7 @@ /* FUNCTION RELEASE */ /* */ /* _ux_utility_event_flags_create PORTABLE C */ -/* 6.0 */ +/* 6.1 */ /* AUTHOR */ /* */ /* Chaoqiong Xiao, Microsoft Corporation */ @@ -64,9 +64,14 @@ /* DATE NAME DESCRIPTION */ /* */ /* 05-19-2020 Chaoqiong Xiao Initial Version 6.0 */ +/* 09-30-2020 Chaoqiong Xiao Modified comment(s), */ +/* used UX prefix to refer to */ +/* TX symbols instead of using */ +/* them directly, */ +/* resulting in version 6.1 */ /* */ /**************************************************************************/ -UINT _ux_utility_event_flags_create(TX_EVENT_FLAGS_GROUP *group_ptr, CHAR *name) +UINT _ux_utility_event_flags_create(UX_EVENT_FLAGS_GROUP*group_ptr, CHAR *name) { UINT status; diff --git a/common/core/src/ux_utility_event_flags_delete.c b/common/core/src/ux_utility_event_flags_delete.c index e6ed879..f7b4628 100644 --- a/common/core/src/ux_utility_event_flags_delete.c +++ b/common/core/src/ux_utility_event_flags_delete.c @@ -33,7 +33,7 @@ /* FUNCTION RELEASE */ /* */ /* _ux_utility_event_flags_delete PORTABLE C */ -/* 6.0 */ +/* 6.1 */ /* AUTHOR */ /* */ /* Chaoqiong Xiao, Microsoft Corporation */ @@ -63,9 +63,14 @@ /* DATE NAME DESCRIPTION */ /* */ /* 05-19-2020 Chaoqiong Xiao Initial Version 6.0 */ +/* 09-30-2020 Chaoqiong Xiao Modified comment(s), */ +/* used UX prefix to refer to */ +/* TX symbols instead of using */ +/* them directly, */ +/* resulting in version 6.1 */ /* */ /**************************************************************************/ -UINT _ux_utility_event_flags_delete(TX_EVENT_FLAGS_GROUP *group_ptr) +UINT _ux_utility_event_flags_delete(UX_EVENT_FLAGS_GROUP*group_ptr) { UINT status; diff --git a/common/core/src/ux_utility_event_flags_get.c b/common/core/src/ux_utility_event_flags_get.c index ee634a4..2ec5c45 100644 --- a/common/core/src/ux_utility_event_flags_get.c +++ b/common/core/src/ux_utility_event_flags_get.c @@ -33,7 +33,7 @@ /* FUNCTION RELEASE */ /* */ /* _ux_utility_event_flags_get PORTABLE C */ -/* 6.0 */ +/* 6.1 */ /* AUTHOR */ /* */ /* Chaoqiong Xiao, Microsoft Corporation */ @@ -68,9 +68,14 @@ /* DATE NAME DESCRIPTION */ /* */ /* 05-19-2020 Chaoqiong Xiao Initial Version 6.0 */ +/* 09-30-2020 Chaoqiong Xiao Modified comment(s), */ +/* used UX prefix to refer to */ +/* TX symbols instead of using */ +/* them directly, */ +/* resulting in version 6.1 */ /* */ /**************************************************************************/ -UINT _ux_utility_event_flags_get(TX_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) { diff --git a/common/core/src/ux_utility_event_flags_set.c b/common/core/src/ux_utility_event_flags_set.c index 4c01799..1449745 100644 --- a/common/core/src/ux_utility_event_flags_set.c +++ b/common/core/src/ux_utility_event_flags_set.c @@ -33,7 +33,7 @@ /* FUNCTION RELEASE */ /* */ /* _ux_utility_event_flags_set PORTABLE C */ -/* 6.0 */ +/* 6.1 */ /* AUTHOR */ /* */ /* Chaoqiong Xiao, Microsoft Corporation */ @@ -66,9 +66,14 @@ /* DATE NAME DESCRIPTION */ /* */ /* 05-19-2020 Chaoqiong Xiao Initial Version 6.0 */ +/* 09-30-2020 Chaoqiong Xiao Modified comment(s), */ +/* used UX prefix to refer to */ +/* TX symbols instead of using */ +/* them directly, */ +/* resulting in version 6.1 */ /* */ /**************************************************************************/ -UINT _ux_utility_event_flags_set(TX_EVENT_FLAGS_GROUP *group_ptr, ULONG flags_to_set, +UINT _ux_utility_event_flags_set(UX_EVENT_FLAGS_GROUP*group_ptr, ULONG flags_to_set, UINT set_option) { diff --git a/common/core/src/ux_utility_long_get.c b/common/core/src/ux_utility_long_get.c index 46b4053..9c34f2f 100644 --- a/common/core/src/ux_utility_long_get.c +++ b/common/core/src/ux_utility_long_get.c @@ -33,7 +33,7 @@ /* FUNCTION RELEASE */ /* */ /* _ux_utility_long_get PORTABLE C */ -/* 6.0 */ +/* 6.1 */ /* AUTHOR */ /* */ /* Chaoqiong Xiao, Microsoft Corporation */ @@ -63,6 +63,8 @@ /* 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 */ /* */ /**************************************************************************/ ULONG _ux_utility_long_get(UCHAR * address) diff --git a/common/core/src/ux_utility_long_get_big_endian.c b/common/core/src/ux_utility_long_get_big_endian.c index 96b59fc..ecf3dac 100644 --- a/common/core/src/ux_utility_long_get_big_endian.c +++ b/common/core/src/ux_utility_long_get_big_endian.c @@ -33,7 +33,7 @@ /* FUNCTION RELEASE */ /* */ /* _ux_utility_long_get_big_endian PORTABLE C */ -/* 6.0 */ +/* 6.1 */ /* AUTHOR */ /* */ /* Chaoqiong Xiao, Microsoft Corporation */ @@ -63,6 +63,8 @@ /* 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 */ /* */ /**************************************************************************/ ULONG _ux_utility_long_get_big_endian(UCHAR * address) diff --git a/common/core/src/ux_utility_long_put.c b/common/core/src/ux_utility_long_put.c index b68b441..3192c72 100644 --- a/common/core/src/ux_utility_long_put.c +++ b/common/core/src/ux_utility_long_put.c @@ -33,7 +33,7 @@ /* FUNCTION RELEASE */ /* */ /* _ux_utility_long_put PORTABLE C */ -/* 6.0 */ +/* 6.1 */ /* AUTHOR */ /* */ /* Chaoqiong Xiao, Microsoft Corporation */ @@ -64,6 +64,8 @@ /* 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 */ /* */ /**************************************************************************/ VOID _ux_utility_long_put(UCHAR * address, ULONG value) diff --git a/common/core/src/ux_utility_long_put_big_endian.c b/common/core/src/ux_utility_long_put_big_endian.c index a7e6244..eee3a3c 100644 --- a/common/core/src/ux_utility_long_put_big_endian.c +++ b/common/core/src/ux_utility_long_put_big_endian.c @@ -33,7 +33,7 @@ /* FUNCTION RELEASE */ /* */ /* _ux_utility_long_put_big_endian PORTABLE C */ -/* 6.0 */ +/* 6.1 */ /* AUTHOR */ /* */ /* Chaoqiong Xiao, Microsoft Corporation */ @@ -64,6 +64,8 @@ /* 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 */ /* */ /**************************************************************************/ VOID _ux_utility_long_put_big_endian(UCHAR * address, ULONG value) diff --git a/common/core/src/ux_utility_memory_allocate.c b/common/core/src/ux_utility_memory_allocate.c index c874fb6..3b55043 100644 --- a/common/core/src/ux_utility_memory_allocate.c +++ b/common/core/src/ux_utility_memory_allocate.c @@ -33,7 +33,7 @@ /* FUNCTION RELEASE */ /* */ /* _ux_utility_memory_allocate PORTABLE C */ -/* 6.0 */ +/* 6.1 */ /* AUTHOR */ /* */ /* Chaoqiong Xiao, Microsoft Corporation */ @@ -67,6 +67,10 @@ /* DATE NAME DESCRIPTION */ /* */ /* 05-19-2020 Chaoqiong Xiao Initial Version 6.0 */ +/* 09-30-2020 Chaoqiong Xiao Modified comment(s), */ +/* verified memset and memcpy */ +/* cases, */ +/* resulting in version 6.1 */ /* */ /**************************************************************************/ VOID *_ux_utility_memory_allocate(ULONG memory_alignment, ULONG memory_cache_flag, @@ -257,7 +261,7 @@ ALIGN_TYPE int_memory_buffer; /* 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_block -> ux_memory_block_status = UX_MEMORY_USED | memory_cache_flag; /* Declare how much memory we removed from the pool. */ memory_removed_from_pool = memory_block -> ux_memory_block_size + (ULONG)sizeof(UX_MEMORY_BLOCK); @@ -277,7 +281,7 @@ ALIGN_TYPE int_memory_buffer; 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; + 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)); @@ -317,7 +321,7 @@ ALIGN_TYPE int_memory_buffer; memory_buffer = ((UCHAR *) memory_block) + sizeof(UX_MEMORY_BLOCK); /* Clear the memory block. */ - _ux_utility_memory_set(memory_buffer, 0, memory_size_requested); + _ux_utility_memory_set(memory_buffer, 0, memory_size_requested); /* Use case of memset is verified. */ /* 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) @@ -335,6 +339,7 @@ ALIGN_TYPE int_memory_buffer; 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; + break; default: @@ -345,6 +350,46 @@ ALIGN_TYPE int_memory_buffer; } } +#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; + } + 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; + } + + /* 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; + +#endif + /* Release the protection. */ _ux_utility_mutex_off(&_ux_system -> ux_system_mutex); diff --git a/common/core/src/ux_utility_memory_allocate_add_safe.c b/common/core/src/ux_utility_memory_allocate_add_safe.c index 9a972d5..138b1f5 100644 --- a/common/core/src/ux_utility_memory_allocate_add_safe.c +++ b/common/core/src/ux_utility_memory_allocate_add_safe.c @@ -32,7 +32,7 @@ /* FUNCTION RELEASE */ /* */ /* _ux_utility_memory_allocate_add_safe PORTABLE C */ -/* 6.0 */ +/* 6.1 */ /* AUTHOR */ /* */ /* Chaoqiong Xiao, Microsoft Corporation */ @@ -68,6 +68,8 @@ /* 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 */ /* */ /**************************************************************************/ VOID* _ux_utility_memory_allocate_add_safe(ULONG align,ULONG cache,ULONG size_add_a,ULONG size_add_b) diff --git a/common/core/src/ux_utility_memory_allocate_mulc_safe.c b/common/core/src/ux_utility_memory_allocate_mulc_safe.c index 000a465..5d3cd91 100644 --- a/common/core/src/ux_utility_memory_allocate_mulc_safe.c +++ b/common/core/src/ux_utility_memory_allocate_mulc_safe.c @@ -32,7 +32,7 @@ /* FUNCTION RELEASE */ /* */ /* _ux_utility_memory_allocate_mulc_safe PORTABLE C */ -/* 6.0 */ +/* 6.1 */ /* AUTHOR */ /* */ /* Chaoqiong Xiao, Microsoft Corporation */ @@ -72,6 +72,8 @@ /* 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 */ /* */ /**************************************************************************/ VOID* _ux_utility_memory_allocate_mulc_safe(ULONG align,ULONG cache,ULONG size_mul_v,ULONG size_mul_c) diff --git a/common/core/src/ux_utility_memory_allocate_mulv_safe.c b/common/core/src/ux_utility_memory_allocate_mulv_safe.c index 6054ef7..1d5ea05 100644 --- a/common/core/src/ux_utility_memory_allocate_mulv_safe.c +++ b/common/core/src/ux_utility_memory_allocate_mulv_safe.c @@ -32,7 +32,7 @@ /* FUNCTION RELEASE */ /* */ /* _ux_utility_memory_allocate_mulv_safe PORTABLE C */ -/* 6.0 */ +/* 6.1 */ /* AUTHOR */ /* */ /* Chaoqiong Xiao, Microsoft Corporation */ @@ -72,6 +72,8 @@ /* 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 */ /* */ /**************************************************************************/ VOID* _ux_utility_memory_allocate_mulv_safe(ULONG align,ULONG cache,ULONG size_mul_v0,ULONG size_mul_v1) diff --git a/common/core/src/ux_utility_memory_compare.c b/common/core/src/ux_utility_memory_compare.c index 713e11e..705af04 100644 --- a/common/core/src/ux_utility_memory_compare.c +++ b/common/core/src/ux_utility_memory_compare.c @@ -33,7 +33,7 @@ /* FUNCTION RELEASE */ /* */ /* _ux_utility_memory_compare PORTABLE C */ -/* 6.0 */ +/* 6.1 */ /* AUTHOR */ /* */ /* Chaoqiong Xiao, Microsoft Corporation */ @@ -66,6 +66,8 @@ /* 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 */ /* */ /**************************************************************************/ UINT _ux_utility_memory_compare(VOID *memory_source, VOID *memory_destination, ULONG length) diff --git a/common/core/src/ux_utility_memory_copy.c b/common/core/src/ux_utility_memory_copy.c index 0bb83d0..e7d448b 100644 --- a/common/core/src/ux_utility_memory_copy.c +++ b/common/core/src/ux_utility_memory_copy.c @@ -33,7 +33,7 @@ /* FUNCTION RELEASE */ /* */ /* _ux_utility_memory_copy PORTABLE C */ -/* 6.0 */ +/* 6.1 */ /* AUTHOR */ /* */ /* Chaoqiong Xiao, Microsoft Corporation */ @@ -66,6 +66,8 @@ /* 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 */ /* */ /**************************************************************************/ VOID _ux_utility_memory_copy(VOID *memory_destination, VOID *memory_source, ULONG length) diff --git a/common/core/src/ux_utility_memory_free.c b/common/core/src/ux_utility_memory_free.c index 02d28f6..54fed00 100644 --- a/common/core/src/ux_utility_memory_free.c +++ b/common/core/src/ux_utility_memory_free.c @@ -33,7 +33,7 @@ /* FUNCTION RELEASE */ /* */ /* _ux_utility_memory_free PORTABLE C */ -/* 6.0 */ +/* 6.1 */ /* AUTHOR */ /* */ /* Chaoqiong Xiao, Microsoft Corporation */ @@ -64,6 +64,8 @@ /* 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 */ /* */ /**************************************************************************/ VOID _ux_utility_memory_free(VOID *memory) @@ -85,7 +87,8 @@ UCHAR *memory_address; memory_size_returned = memory_block -> ux_memory_block_size + (ULONG)sizeof(UX_MEMORY_BLOCK); /* Check this memory block to see if it valid. */ - if (memory_block -> ux_memory_block_status != UX_MEMORY_USED) + 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)) { /* Not valid. Release the protection. */ @@ -101,6 +104,21 @@ UCHAR *memory_address; return; } +#ifdef UX_ENABLE_MEMORY_STATISTICS + + /* 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 + /* We mark this memory block as being unused. */ memory_block -> ux_memory_block_status = UX_MEMORY_UNUSED; @@ -131,7 +149,7 @@ UCHAR *memory_address; { /* Determine if the memory block is used. */ - if (next_block -> ux_memory_block_status == UX_MEMORY_USED) + if (next_block -> ux_memory_block_status != UX_MEMORY_UNUSED) { /* Yes, move to next block. */ 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 b6294bb..87179f3 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 @@ -33,7 +33,7 @@ /* FUNCTION RELEASE */ /* */ /* _ux_utility_memory_free_block_best_get PORTABLE C */ -/* 6.0 */ +/* 6.1 */ /* AUTHOR */ /* */ /* Chaoqiong Xiao, Microsoft Corporation */ @@ -64,6 +64,8 @@ /* 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 */ /* */ /**************************************************************************/ UX_MEMORY_BLOCK *_ux_utility_memory_free_block_best_get(ULONG memory_cache_flag, diff --git a/common/core/src/ux_utility_memory_set.c b/common/core/src/ux_utility_memory_set.c index 5cf7a7f..fda88e9 100644 --- a/common/core/src/ux_utility_memory_set.c +++ b/common/core/src/ux_utility_memory_set.c @@ -33,7 +33,7 @@ /* FUNCTION RELEASE */ /* */ /* _ux_utility_memory_set PORTABLE C */ -/* 6.0 */ +/* 6.1 */ /* AUTHOR */ /* */ /* Chaoqiong Xiao, Microsoft Corporation */ @@ -65,6 +65,8 @@ /* 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 */ /* */ /**************************************************************************/ VOID _ux_utility_memory_set(VOID *destination, UCHAR value, ULONG length) diff --git a/common/core/src/ux_utility_mutex_create.c b/common/core/src/ux_utility_mutex_create.c index b8bb410..c262290 100644 --- a/common/core/src/ux_utility_mutex_create.c +++ b/common/core/src/ux_utility_mutex_create.c @@ -33,7 +33,7 @@ /* FUNCTION RELEASE */ /* */ /* _ux_utility_mutex_create PORTABLE C */ -/* 6.0 */ +/* 6.1 */ /* AUTHOR */ /* */ /* Chaoqiong Xiao, Microsoft Corporation */ @@ -64,9 +64,14 @@ /* DATE NAME DESCRIPTION */ /* */ /* 05-19-2020 Chaoqiong Xiao Initial Version 6.0 */ +/* 09-30-2020 Chaoqiong Xiao Modified comment(s), */ +/* used UX prefix to refer to */ +/* TX symbols instead of using */ +/* them directly, */ +/* resulting in version 6.1 */ /* */ /**************************************************************************/ -UINT _ux_utility_mutex_create(TX_MUTEX *mutex, CHAR *mutex_name) +UINT _ux_utility_mutex_create(UX_MUTEX *mutex, CHAR *mutex_name) { UINT status; diff --git a/common/core/src/ux_utility_mutex_delete.c b/common/core/src/ux_utility_mutex_delete.c index caed65c..f2b2ced 100644 --- a/common/core/src/ux_utility_mutex_delete.c +++ b/common/core/src/ux_utility_mutex_delete.c @@ -33,7 +33,7 @@ /* FUNCTION RELEASE */ /* */ /* _ux_utility_mutex_delete PORTABLE C */ -/* 6.0 */ +/* 6.1 */ /* AUTHOR */ /* */ /* Chaoqiong Xiao, Microsoft Corporation */ @@ -63,9 +63,14 @@ /* DATE NAME DESCRIPTION */ /* */ /* 05-19-2020 Chaoqiong Xiao Initial Version 6.0 */ +/* 09-30-2020 Chaoqiong Xiao Modified comment(s), */ +/* used UX prefix to refer to */ +/* TX symbols instead of using */ +/* them directly, */ +/* resulting in version 6.1 */ /* */ /**************************************************************************/ -UINT _ux_utility_mutex_delete(TX_MUTEX *mutex) +UINT _ux_utility_mutex_delete(UX_MUTEX *mutex) { UINT status; diff --git a/common/core/src/ux_utility_mutex_off.c b/common/core/src/ux_utility_mutex_off.c index 03ccec2..839ebc0 100644 --- a/common/core/src/ux_utility_mutex_off.c +++ b/common/core/src/ux_utility_mutex_off.c @@ -33,7 +33,7 @@ /* FUNCTION RELEASE */ /* */ /* _ux_utility_mutex_off PORTABLE C */ -/* 6.0 */ +/* 6.1 */ /* AUTHOR */ /* */ /* Chaoqiong Xiao, Microsoft Corporation */ @@ -63,9 +63,14 @@ /* DATE NAME DESCRIPTION */ /* */ /* 05-19-2020 Chaoqiong Xiao Initial Version 6.0 */ +/* 09-30-2020 Chaoqiong Xiao Modified comment(s), */ +/* used UX prefix to refer to */ +/* TX symbols instead of using */ +/* them directly, */ +/* resulting in version 6.1 */ /* */ /**************************************************************************/ -VOID _ux_utility_mutex_off(TX_MUTEX *mutex) +VOID _ux_utility_mutex_off(UX_MUTEX *mutex) { /* Call ThreadX to release protection. */ diff --git a/common/core/src/ux_utility_mutex_on.c b/common/core/src/ux_utility_mutex_on.c index 14a4aa2..bbb17b1 100644 --- a/common/core/src/ux_utility_mutex_on.c +++ b/common/core/src/ux_utility_mutex_on.c @@ -33,7 +33,7 @@ /* FUNCTION RELEASE */ /* */ /* _ux_utility_mutex_on PORTABLE C */ -/* 6.0 */ +/* 6.1 */ /* AUTHOR */ /* */ /* Chaoqiong Xiao, Microsoft Corporation */ @@ -63,9 +63,14 @@ /* DATE NAME DESCRIPTION */ /* */ /* 05-19-2020 Chaoqiong Xiao Initial Version 6.0 */ +/* 09-30-2020 Chaoqiong Xiao Modified comment(s), */ +/* used UX prefix to refer to */ +/* TX symbols instead of using */ +/* them directly, */ +/* resulting in version 6.1 */ /* */ /**************************************************************************/ -VOID _ux_utility_mutex_on(TX_MUTEX *mutex) +VOID _ux_utility_mutex_on(UX_MUTEX *mutex) { UINT status; diff --git a/common/core/src/ux_utility_pci_class_scan.c b/common/core/src/ux_utility_pci_class_scan.c index 672fada..f1a5f71 100644 --- a/common/core/src/ux_utility_pci_class_scan.c +++ b/common/core/src/ux_utility_pci_class_scan.c @@ -33,7 +33,7 @@ /* FUNCTION RELEASE */ /* */ /* _ux_utility_pci_class_scan PORTABLE C */ -/* 6.0 */ +/* 6.1 */ /* AUTHOR */ /* */ /* Chaoqiong Xiao, Microsoft Corporation */ @@ -70,6 +70,8 @@ /* 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 */ /* */ /**************************************************************************/ ULONG _ux_utility_pci_class_scan(ULONG pci_class, ULONG bus_number, ULONG device_number, diff --git a/common/core/src/ux_utility_pci_read.c b/common/core/src/ux_utility_pci_read.c index 22cd473..5ced97b 100644 --- a/common/core/src/ux_utility_pci_read.c +++ b/common/core/src/ux_utility_pci_read.c @@ -33,7 +33,7 @@ /* FUNCTION RELEASE */ /* */ /* _ux_utility_pci_read PORTABLE C */ -/* 6.0 */ +/* 6.1 */ /* AUTHOR */ /* */ /* Chaoqiong Xiao, Microsoft Corporation */ @@ -71,6 +71,8 @@ /* 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 */ /* */ /**************************************************************************/ ULONG _ux_utility_pci_read(ULONG bus_number, ULONG device_number, ULONG function_number, diff --git a/common/core/src/ux_utility_pci_write.c b/common/core/src/ux_utility_pci_write.c index a17655d..c8635e2 100644 --- a/common/core/src/ux_utility_pci_write.c +++ b/common/core/src/ux_utility_pci_write.c @@ -33,7 +33,7 @@ /* FUNCTION RELEASE */ /* */ /* _ux_utility_pci_write PORTABLE C */ -/* 6.0 */ +/* 6.1 */ /* AUTHOR */ /* */ /* Chaoqiong Xiao, Microsoft Corporation */ @@ -71,6 +71,8 @@ /* 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 */ /* */ /**************************************************************************/ VOID _ux_utility_pci_write(ULONG bus_number, ULONG device_number, ULONG function_number, diff --git a/common/core/src/ux_utility_physical_address.c b/common/core/src/ux_utility_physical_address.c index 8709155..9143057 100644 --- a/common/core/src/ux_utility_physical_address.c +++ b/common/core/src/ux_utility_physical_address.c @@ -33,7 +33,7 @@ /* FUNCTION RELEASE */ /* */ /* _ux_utility_physical_address PORTABLE C */ -/* 6.0 */ +/* 6.1 */ /* AUTHOR */ /* */ /* Chaoqiong Xiao, Microsoft Corporation */ @@ -64,6 +64,8 @@ /* 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 */ /* */ /**************************************************************************/ VOID *_ux_utility_physical_address(VOID *virtual_address) diff --git a/common/core/src/ux_utility_semaphore_create.c b/common/core/src/ux_utility_semaphore_create.c index ec411fa..db380d8 100644 --- a/common/core/src/ux_utility_semaphore_create.c +++ b/common/core/src/ux_utility_semaphore_create.c @@ -33,7 +33,7 @@ /* FUNCTION RELEASE */ /* */ /* _ux_utility_semaphore_create PORTABLE C */ -/* 6.0 */ +/* 6.1 */ /* AUTHOR */ /* */ /* Chaoqiong Xiao, Microsoft Corporation */ @@ -65,9 +65,14 @@ /* DATE NAME DESCRIPTION */ /* */ /* 05-19-2020 Chaoqiong Xiao Initial Version 6.0 */ +/* 09-30-2020 Chaoqiong Xiao Modified comment(s), */ +/* used UX prefix to refer to */ +/* TX symbols instead of using */ +/* them directly, */ +/* resulting in version 6.1 */ /* */ /**************************************************************************/ -UINT _ux_utility_semaphore_create(TX_SEMAPHORE *semaphore, CHAR *semaphore_name, UINT initial_count) +UINT _ux_utility_semaphore_create(UX_SEMAPHORE *semaphore, CHAR *semaphore_name, UINT initial_count) { UINT status; diff --git a/common/core/src/ux_utility_semaphore_delete.c b/common/core/src/ux_utility_semaphore_delete.c index d9d3ea5..fdc3a4e 100644 --- a/common/core/src/ux_utility_semaphore_delete.c +++ b/common/core/src/ux_utility_semaphore_delete.c @@ -33,7 +33,7 @@ /* FUNCTION RELEASE */ /* */ /* _ux_utility_semaphore_delete PORTABLE C */ -/* 6.0 */ +/* 6.1 */ /* AUTHOR */ /* */ /* Chaoqiong Xiao, Microsoft Corporation */ @@ -63,9 +63,14 @@ /* DATE NAME DESCRIPTION */ /* */ /* 05-19-2020 Chaoqiong Xiao Initial Version 6.0 */ +/* 09-30-2020 Chaoqiong Xiao Modified comment(s), */ +/* used UX prefix to refer to */ +/* TX symbols instead of using */ +/* them directly, */ +/* resulting in version 6.1 */ /* */ /**************************************************************************/ -UINT _ux_utility_semaphore_delete(TX_SEMAPHORE *semaphore) +UINT _ux_utility_semaphore_delete(UX_SEMAPHORE *semaphore) { UINT status; diff --git a/common/core/src/ux_utility_semaphore_get.c b/common/core/src/ux_utility_semaphore_get.c index 8627b5d..4fc1188 100644 --- a/common/core/src/ux_utility_semaphore_get.c +++ b/common/core/src/ux_utility_semaphore_get.c @@ -33,7 +33,7 @@ /* FUNCTION RELEASE */ /* */ /* _ux_utility_semaphore_get PORTABLE C */ -/* 6.0 */ +/* 6.1 */ /* AUTHOR */ /* */ /* Chaoqiong Xiao, Microsoft Corporation */ @@ -65,21 +65,26 @@ /* DATE NAME DESCRIPTION */ /* */ /* 05-19-2020 Chaoqiong Xiao Initial Version 6.0 */ +/* 09-30-2020 Chaoqiong Xiao Modified comment(s), */ +/* used UX prefix to refer to */ +/* TX symbols instead of using */ +/* them directly, */ +/* resulting in version 6.1 */ /* */ /**************************************************************************/ -UINT _ux_utility_semaphore_get(TX_SEMAPHORE *semaphore, ULONG semaphore_signal) +UINT _ux_utility_semaphore_get(UX_SEMAPHORE *semaphore, ULONG semaphore_signal) { UINT status; -TX_THREAD *my_thread; +UX_THREAD *my_thread; CHAR *name; UINT state; ULONG run_count; UINT priority; UINT preemption_threshold; ULONG time_slice; -TX_THREAD *next_thread; -TX_THREAD *suspended_thread; +UX_THREAD *next_thread; +UX_THREAD *suspended_thread; /* Call TX to know my own tread. */ my_thread = tx_thread_identify(); diff --git a/common/core/src/ux_utility_semaphore_put.c b/common/core/src/ux_utility_semaphore_put.c index ba1df05..8502dad 100644 --- a/common/core/src/ux_utility_semaphore_put.c +++ b/common/core/src/ux_utility_semaphore_put.c @@ -33,7 +33,7 @@ /* FUNCTION RELEASE */ /* */ /* _ux_utility_semaphore_put PORTABLE C */ -/* 6.0 */ +/* 6.1 */ /* AUTHOR */ /* */ /* Chaoqiong Xiao, Microsoft Corporation */ @@ -63,9 +63,14 @@ /* DATE NAME DESCRIPTION */ /* */ /* 05-19-2020 Chaoqiong Xiao Initial Version 6.0 */ +/* 09-30-2020 Chaoqiong Xiao Modified comment(s), */ +/* used UX prefix to refer to */ +/* TX symbols instead of using */ +/* them directly, */ +/* resulting in version 6.1 */ /* */ /**************************************************************************/ -UINT _ux_utility_semaphore_put(TX_SEMAPHORE *semaphore) +UINT _ux_utility_semaphore_put(UX_SEMAPHORE *semaphore) { UINT status; diff --git a/common/core/src/ux_utility_set_interrupt_handler.c b/common/core/src/ux_utility_set_interrupt_handler.c index fd30c78..7a0cac1 100644 --- a/common/core/src/ux_utility_set_interrupt_handler.c +++ b/common/core/src/ux_utility_set_interrupt_handler.c @@ -33,7 +33,7 @@ /* FUNCTION RELEASE */ /* */ /* _ux_utility_set_interrupt_handler PORTABLE C */ -/* 6.0 */ +/* 6.1 */ /* AUTHOR */ /* */ /* Chaoqiong Xiao, Microsoft Corporation */ @@ -64,6 +64,8 @@ /* 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 */ /* */ /**************************************************************************/ VOID _ux_utility_set_interrupt_handler(UINT irq, VOID (*interrupt_handler)(VOID)) diff --git a/common/core/src/ux_utility_short_get.c b/common/core/src/ux_utility_short_get.c index 99b43fd..3a24c42 100644 --- a/common/core/src/ux_utility_short_get.c +++ b/common/core/src/ux_utility_short_get.c @@ -33,7 +33,7 @@ /* FUNCTION RELEASE */ /* */ /* _ux_utility_short_get PORTABLE C */ -/* 6.0 */ +/* 6.1 */ /* AUTHOR */ /* */ /* Chaoqiong Xiao, Microsoft Corporation */ @@ -63,6 +63,8 @@ /* 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 */ /* */ /**************************************************************************/ ULONG _ux_utility_short_get(UCHAR * address) diff --git a/common/core/src/ux_utility_short_get_big_endian.c b/common/core/src/ux_utility_short_get_big_endian.c index ac3cd35..f6cefa3 100644 --- a/common/core/src/ux_utility_short_get_big_endian.c +++ b/common/core/src/ux_utility_short_get_big_endian.c @@ -33,7 +33,7 @@ /* FUNCTION RELEASE */ /* */ /* _ux_utility_short_get_big_endian PORTABLE C */ -/* 6.0 */ +/* 6.1 */ /* AUTHOR */ /* */ /* Chaoqiong Xiao, Microsoft Corporation */ @@ -63,6 +63,8 @@ /* 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 */ /* */ /**************************************************************************/ ULONG _ux_utility_short_get_big_endian(UCHAR * address) diff --git a/common/core/src/ux_utility_short_put.c b/common/core/src/ux_utility_short_put.c index 3655e5b..330882b 100644 --- a/common/core/src/ux_utility_short_put.c +++ b/common/core/src/ux_utility_short_put.c @@ -33,7 +33,7 @@ /* FUNCTION RELEASE */ /* */ /* _ux_utility_short_put PORTABLE C */ -/* 6.0 */ +/* 6.1 */ /* AUTHOR */ /* */ /* Chaoqiong Xiao, Microsoft Corporation */ @@ -64,6 +64,8 @@ /* 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 */ /* */ /**************************************************************************/ VOID _ux_utility_short_put(UCHAR * address, USHORT value) diff --git a/common/core/src/ux_utility_short_put_big_endian.c b/common/core/src/ux_utility_short_put_big_endian.c index f382255..7d20be6 100644 --- a/common/core/src/ux_utility_short_put_big_endian.c +++ b/common/core/src/ux_utility_short_put_big_endian.c @@ -33,7 +33,7 @@ /* FUNCTION RELEASE */ /* */ /* _ux_utility_short_put_big_endian PORTABLE C */ -/* 6.0 */ +/* 6.1 */ /* AUTHOR */ /* */ /* Chaoqiong Xiao, Microsoft Corporation */ @@ -64,6 +64,8 @@ /* 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 */ /* */ /**************************************************************************/ VOID _ux_utility_short_put_big_endian(UCHAR * address, USHORT value) diff --git a/common/core/src/ux_utility_string_length_check.c b/common/core/src/ux_utility_string_length_check.c index 4ecc3cb..f4a2a0a 100644 --- a/common/core/src/ux_utility_string_length_check.c +++ b/common/core/src/ux_utility_string_length_check.c @@ -33,7 +33,7 @@ /* FUNCTION RELEASE */ /* */ /* _ux_utility_string_length_check PORTABLE C */ -/* 6.0 */ +/* 6.1 */ /* AUTHOR */ /* */ /* Chaoqiong Xiao, Microsoft Corporation */ @@ -72,6 +72,8 @@ /* 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 */ /* */ /**************************************************************************/ UINT _ux_utility_string_length_check(UCHAR *string, UINT *string_length_ptr, UINT max_string_length) diff --git a/common/core/src/ux_utility_string_length_get.c b/common/core/src/ux_utility_string_length_get.c index 6522612..a151d9b 100644 --- a/common/core/src/ux_utility_string_length_get.c +++ b/common/core/src/ux_utility_string_length_get.c @@ -33,7 +33,7 @@ /* FUNCTION RELEASE */ /* */ /* _ux_utility_string_length_get PORTABLE C */ -/* 6.0 */ +/* 6.1 */ /* AUTHOR */ /* */ /* Chaoqiong Xiao, Microsoft Corporation */ @@ -69,6 +69,8 @@ /* 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 */ /* */ /**************************************************************************/ ULONG _ux_utility_string_length_get(UCHAR *string) diff --git a/common/core/src/ux_utility_string_to_unicode.c b/common/core/src/ux_utility_string_to_unicode.c index 6ec0b47..7f2ed63 100644 --- a/common/core/src/ux_utility_string_to_unicode.c +++ b/common/core/src/ux_utility_string_to_unicode.c @@ -33,7 +33,7 @@ /* FUNCTION RELEASE */ /* */ /* _ux_utility_string_to_unicode PORTABLE C */ -/* 6.0 */ +/* 6.1 */ /* AUTHOR */ /* */ /* Chaoqiong Xiao, Microsoft Corporation */ @@ -73,6 +73,8 @@ /* 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 */ /* */ /**************************************************************************/ VOID _ux_utility_string_to_unicode(UCHAR *source, UCHAR *destination) diff --git a/common/core/src/ux_utility_thread_create.c b/common/core/src/ux_utility_thread_create.c index 0a5d969..c7cdcd6 100644 --- a/common/core/src/ux_utility_thread_create.c +++ b/common/core/src/ux_utility_thread_create.c @@ -33,7 +33,7 @@ /* FUNCTION RELEASE */ /* */ /* _ux_utility_thread_create PORTABLE C */ -/* 6.0 */ +/* 6.1 */ /* AUTHOR */ /* */ /* Chaoqiong Xiao, Microsoft Corporation */ @@ -72,9 +72,14 @@ /* DATE NAME DESCRIPTION */ /* */ /* 05-19-2020 Chaoqiong Xiao Initial Version 6.0 */ +/* 09-30-2020 Chaoqiong Xiao Modified comment(s), */ +/* used UX prefix to refer to */ +/* TX symbols instead of using */ +/* them directly, */ +/* resulting in version 6.1 */ /* */ /**************************************************************************/ -UINT _ux_utility_thread_create(TX_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, UINT priority, UINT preempt_threshold, diff --git a/common/core/src/ux_utility_thread_delete.c b/common/core/src/ux_utility_thread_delete.c index dd9aad5..b6b90ca 100644 --- a/common/core/src/ux_utility_thread_delete.c +++ b/common/core/src/ux_utility_thread_delete.c @@ -33,7 +33,7 @@ /* FUNCTION RELEASE */ /* */ /* _ux_utility_thread_delete PORTABLE C */ -/* 6.0 */ +/* 6.1 */ /* AUTHOR */ /* */ /* Chaoqiong Xiao, Microsoft Corporation */ @@ -64,9 +64,14 @@ /* DATE NAME DESCRIPTION */ /* */ /* 05-19-2020 Chaoqiong Xiao Initial Version 6.0 */ +/* 09-30-2020 Chaoqiong Xiao Modified comment(s), */ +/* used UX prefix to refer to */ +/* TX symbols instead of using */ +/* them directly, */ +/* resulting in version 6.1 */ /* */ /**************************************************************************/ -UINT _ux_utility_thread_delete(TX_THREAD *thread_ptr) +UINT _ux_utility_thread_delete(UX_THREAD *thread_ptr) { UINT status; diff --git a/common/core/src/ux_utility_thread_identify.c b/common/core/src/ux_utility_thread_identify.c index 02f640d..36a67d6 100644 --- a/common/core/src/ux_utility_thread_identify.c +++ b/common/core/src/ux_utility_thread_identify.c @@ -34,7 +34,7 @@ /* FUNCTION RELEASE */ /* */ /* _ux_utility_thread_identify PORTABLE C */ -/* 6.0 */ +/* 6.1 */ /* AUTHOR */ /* */ /* Chaoqiong Xiao, Microsoft Corporation */ @@ -64,14 +64,19 @@ /* DATE NAME DESCRIPTION */ /* */ /* 05-19-2020 Chaoqiong Xiao Initial Version 6.0 */ +/* 09-30-2020 Chaoqiong Xiao Modified comment(s), */ +/* used UX prefix to refer to */ +/* TX symbols instead of using */ +/* them directly, */ +/* resulting in version 6.1 */ /* */ /**************************************************************************/ -TX_THREAD *_ux_utility_thread_identify(VOID) +UX_THREAD *_ux_utility_thread_identify(VOID) { /* If we're under interrupt, the thread returned by tx_thread_identify is the thread running prior to the ISR. Instead, we set it to null. */ - return(TX_THREAD_GET_SYSTEM_STATE() ? UX_NULL : tx_thread_identify()); + return(UX_THREAD_GET_SYSTEM_STATE() ? UX_NULL : tx_thread_identify()); } diff --git a/common/core/src/ux_utility_thread_relinquish.c b/common/core/src/ux_utility_thread_relinquish.c index d7f687a..5875fd7 100644 --- a/common/core/src/ux_utility_thread_relinquish.c +++ b/common/core/src/ux_utility_thread_relinquish.c @@ -33,7 +33,7 @@ /* FUNCTION RELEASE */ /* */ /* _ux_utility_thread_relinquish PORTABLE C */ -/* 6.0 */ +/* 6.1 */ /* AUTHOR */ /* */ /* Chaoqiong Xiao, Microsoft Corporation */ @@ -61,6 +61,8 @@ /* 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 */ /* */ /**************************************************************************/ VOID _ux_utility_thread_relinquish(VOID) diff --git a/common/core/src/ux_utility_thread_resume.c b/common/core/src/ux_utility_thread_resume.c index 2bb13a6..c440516 100644 --- a/common/core/src/ux_utility_thread_resume.c +++ b/common/core/src/ux_utility_thread_resume.c @@ -33,7 +33,7 @@ /* FUNCTION RELEASE */ /* */ /* _ux_utility_thread_resume PORTABLE C */ -/* 6.0 */ +/* 6.1 */ /* AUTHOR */ /* */ /* Chaoqiong Xiao, Microsoft Corporation */ @@ -63,9 +63,14 @@ /* DATE NAME DESCRIPTION */ /* */ /* 05-19-2020 Chaoqiong Xiao Initial Version 6.0 */ +/* 09-30-2020 Chaoqiong Xiao Modified comment(s), */ +/* used UX prefix to refer to */ +/* TX symbols instead of using */ +/* them directly, */ +/* resulting in version 6.1 */ /* */ /**************************************************************************/ -UINT _ux_utility_thread_resume(TX_THREAD *thread_ptr) +UINT _ux_utility_thread_resume(UX_THREAD *thread_ptr) { UINT status; diff --git a/common/core/src/ux_utility_thread_schedule_other.c b/common/core/src/ux_utility_thread_schedule_other.c index 388031e..aa6537c 100644 --- a/common/core/src/ux_utility_thread_schedule_other.c +++ b/common/core/src/ux_utility_thread_schedule_other.c @@ -32,8 +32,8 @@ /* */ /* FUNCTION RELEASE */ /* */ -/* _ux_utility_thread_priority_change PORTABLE C */ -/* 6.0 */ +/* _ux_utility_thread_schedule_other PORTABLE C */ +/* 6.1 */ /* AUTHOR */ /* */ /* Chaoqiong Xiao, Microsoft Corporation */ @@ -65,6 +65,11 @@ /* DATE NAME DESCRIPTION */ /* */ /* 05-19-2020 Chaoqiong Xiao Initial Version 6.0 */ +/* 09-30-2020 Chaoqiong Xiao Modified comment(s), */ +/* used UX prefix to refer to */ +/* TX symbols instead of using */ +/* them directly, */ +/* resulting in version 6.1 */ /* */ /**************************************************************************/ UINT _ux_utility_thread_schedule_other(UINT caller_priority) @@ -72,7 +77,7 @@ UINT _ux_utility_thread_schedule_other(UINT caller_priority) UINT status; UINT old_priority; -TX_THREAD *my_thread; +UX_THREAD *my_thread; UX_PARAMETER_NOT_USED(caller_priority); diff --git a/common/core/src/ux_utility_thread_sleep.c b/common/core/src/ux_utility_thread_sleep.c index cfa494e..337e604 100644 --- a/common/core/src/ux_utility_thread_sleep.c +++ b/common/core/src/ux_utility_thread_sleep.c @@ -33,7 +33,7 @@ /* FUNCTION RELEASE */ /* */ /* _ux_utility_thread_sleep PORTABLE C */ -/* 6.0 */ +/* 6.1 */ /* AUTHOR */ /* */ /* Chaoqiong Xiao, Microsoft Corporation */ @@ -64,6 +64,8 @@ /* 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 */ /* */ /**************************************************************************/ UINT _ux_utility_thread_sleep(ULONG ticks) diff --git a/common/core/src/ux_utility_thread_suspend.c b/common/core/src/ux_utility_thread_suspend.c index 304ce18..6ea47c0 100644 --- a/common/core/src/ux_utility_thread_suspend.c +++ b/common/core/src/ux_utility_thread_suspend.c @@ -33,7 +33,7 @@ /* FUNCTION RELEASE */ /* */ /* _ux_utility_thread_suspend PORTABLE C */ -/* 6.0 */ +/* 6.1 */ /* AUTHOR */ /* */ /* Chaoqiong Xiao, Microsoft Corporation */ @@ -63,9 +63,14 @@ /* DATE NAME DESCRIPTION */ /* */ /* 05-19-2020 Chaoqiong Xiao Initial Version 6.0 */ +/* 09-30-2020 Chaoqiong Xiao Modified comment(s), */ +/* used UX prefix to refer to */ +/* TX symbols instead of using */ +/* them directly, */ +/* resulting in version 6.1 */ /* */ /**************************************************************************/ -UINT _ux_utility_thread_suspend(TX_THREAD *thread_ptr) +UINT _ux_utility_thread_suspend(UX_THREAD *thread_ptr) { UINT status; diff --git a/common/core/src/ux_utility_timer_create.c b/common/core/src/ux_utility_timer_create.c index 04c3c69..1bb973f 100644 --- a/common/core/src/ux_utility_timer_create.c +++ b/common/core/src/ux_utility_timer_create.c @@ -33,7 +33,7 @@ /* FUNCTION RELEASE */ /* */ /* _ux_utility_timer_create PORTABLE C */ -/* 6.0 */ +/* 6.1 */ /* AUTHOR */ /* */ /* Chaoqiong Xiao, Microsoft Corporation */ @@ -64,6 +64,8 @@ /* 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 */ /* */ /**************************************************************************/ UINT _ux_utility_timer_create(TX_TIMER *timer, CHAR *timer_name, VOID (*expiration_function) (ULONG), diff --git a/common/core/src/ux_utility_timer_delete.c b/common/core/src/ux_utility_timer_delete.c new file mode 100644 index 0000000..7e384ef --- /dev/null +++ b/common/core/src/ux_utility_timer_delete.c @@ -0,0 +1,79 @@ +/**************************************************************************/ +/* */ +/* 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 */ +/** */ +/** Utility */ +/** */ +/**************************************************************************/ +/**************************************************************************/ + + +/* Include necessary system files. */ + +#define UX_SOURCE_CODE + +#include "ux_api.h" + + +/**************************************************************************/ +/* */ +/* FUNCTION RELEASE */ +/* */ +/* _ux_utility_timer_delete PORTABLE C */ +/* 6.1 */ +/* AUTHOR */ +/* */ +/* Chaoqiong Xiao, Microsoft Corporation */ +/* */ +/* DESCRIPTION */ +/* */ +/* This function deletes a timer. */ +/* */ +/* INPUT */ +/* */ +/* timer Pointer to timer */ +/* */ +/* OUTPUT */ +/* */ +/* Completion Status */ +/* */ +/* CALLS */ +/* */ +/* tx_timer_delete ThreadX timer delete */ +/* */ +/* CALLED BY */ +/* */ +/* USBX Components */ +/* */ +/* RELEASE HISTORY */ +/* */ +/* DATE NAME DESCRIPTION */ +/* */ +/* 09-30-2020 Chaoqiong Xiao Initial Version 6.1 */ +/* */ +/**************************************************************************/ +UINT _ux_utility_timer_delete(TX_TIMER *timer) +{ + +UINT status; + + + /* Call ThreadX to delete the timer object. */ + status = tx_timer_delete(timer); + + /* Return completion status. */ + return(status); +} diff --git a/common/core/src/ux_utility_unicode_to_string.c b/common/core/src/ux_utility_unicode_to_string.c index aeb1564..530ff6b 100644 --- a/common/core/src/ux_utility_unicode_to_string.c +++ b/common/core/src/ux_utility_unicode_to_string.c @@ -33,7 +33,7 @@ /* FUNCTION RELEASE */ /* */ /* _ux_utility_unicode_to_string PORTABLE C */ -/* 6.0 */ +/* 6.1 */ /* AUTHOR */ /* */ /* Chaoqiong Xiao, Microsoft Corporation */ @@ -65,6 +65,8 @@ /* 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 */ /* */ /**************************************************************************/ VOID _ux_utility_unicode_to_string(UCHAR *source, UCHAR *destination) diff --git a/common/core/src/ux_utility_virtual_address.c b/common/core/src/ux_utility_virtual_address.c index 5bb4e95..cb9151d 100644 --- a/common/core/src/ux_utility_virtual_address.c +++ b/common/core/src/ux_utility_virtual_address.c @@ -33,7 +33,7 @@ /* FUNCTION RELEASE */ /* */ /* _ux_utility_virtual_address PORTABLE C */ -/* 6.0 */ +/* 6.1 */ /* AUTHOR */ /* */ /* Chaoqiong Xiao, Microsoft Corporation */ @@ -64,6 +64,8 @@ /* 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 */ /* */ /**************************************************************************/ VOID *_ux_utility_virtual_address(VOID *physical_address) 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 2ed7cfb..38acd0d 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.0 */ +/* 6.1 */ /* AUTHOR */ /* */ /* Chaoqiong Xiao, Microsoft Corporation */ @@ -41,6 +41,11 @@ /* DATE NAME DESCRIPTION */ /* */ /* 05-19-2020 Chaoqiong Xiao Initial Version 6.0 */ +/* 09-30-2020 Chaoqiong Xiao Modified comment(s), */ +/* used UX prefix to refer to */ +/* TX symbols instead of using */ +/* them directly, */ +/* resulting in version 6.1 */ /* */ /**************************************************************************/ @@ -333,7 +338,7 @@ typedef struct UX_DEVICE_CLASS_AUDIO_STREAM_STRUCT UX_DEVICE_CLASS_AUDIO_STREAM_CALLBACKS ux_device_class_audio_stream_callbacks; UCHAR *ux_device_class_audio_stream_thread_stack; - TX_THREAD ux_device_class_audio_stream_thread; + UX_THREAD ux_device_class_audio_stream_thread; UCHAR *ux_device_class_audio_stream_buffer; ULONG ux_device_class_audio_stream_buffer_size; 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 4d3572e..add1f9e 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.0 */ +/* 6.1 */ /* AUTHOR */ /* */ /* Chaoqiong Xiao, Microsoft Corporation */ @@ -41,6 +41,8 @@ /* 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 */ /* */ /**************************************************************************/ 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 6da1b1b..f55df76 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.0 */ +/* 6.1 */ /* AUTHOR */ /* */ /* Chaoqiong Xiao, Microsoft Corporation */ @@ -41,6 +41,8 @@ /* 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 */ /* */ /**************************************************************************/ 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 43a6703..3934fc9 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.0 */ +/* 6.1 */ /* AUTHOR */ /* */ /* Chaoqiong Xiao, Microsoft Corporation */ @@ -39,6 +39,11 @@ /* DATE NAME DESCRIPTION */ /* */ /* 05-19-2020 Chaoqiong Xiao Initial Version 6.0 */ +/* 09-30-2020 Chaoqiong Xiao Modified comment(s), */ +/* used UX prefix to refer to */ +/* TX symbols instead of using */ +/* them directly, */ +/* resulting in version 6.1 */ /* */ /**************************************************************************/ @@ -137,21 +142,21 @@ typedef struct UX_SLAVE_CLASS_CDC_ACM_STRUCT { UX_SLAVE_INTERFACE *ux_slave_class_cdc_acm_interface; UX_SLAVE_CLASS_CDC_ACM_PARAMETER ux_slave_class_cdc_acm_parameter; - TX_MUTEX ux_slave_class_cdc_acm_endpoint_in_mutex; - TX_MUTEX ux_slave_class_cdc_acm_endpoint_out_mutex; + UX_MUTEX ux_slave_class_cdc_acm_endpoint_in_mutex; + UX_MUTEX ux_slave_class_cdc_acm_endpoint_out_mutex; ULONG ux_slave_class_cdc_acm_baudrate; UCHAR ux_slave_class_cdc_acm_stop_bit; UCHAR ux_slave_class_cdc_acm_parity; UCHAR ux_slave_class_cdc_acm_data_bit; UCHAR ux_slave_class_cdc_acm_data_dtr_state; UCHAR ux_slave_class_cdc_acm_data_rts_state; - TX_THREAD ux_slave_class_cdc_acm_bulkin_thread; - TX_THREAD ux_slave_class_cdc_acm_bulkout_thread; + UX_THREAD ux_slave_class_cdc_acm_bulkin_thread; + UX_THREAD ux_slave_class_cdc_acm_bulkout_thread; UCHAR *ux_slave_class_cdc_acm_bulkin_thread_stack; UCHAR *ux_slave_class_cdc_acm_bulkout_thread_stack; UINT (*ux_device_class_cdc_acm_write_callback)(struct UX_SLAVE_CLASS_CDC_ACM_STRUCT *cdc_acm, UINT status, ULONG length); UINT (*ux_device_class_cdc_acm_read_callback)(struct UX_SLAVE_CLASS_CDC_ACM_STRUCT *cdc_acm, UINT status, UCHAR *data_pointer, ULONG length); - TX_EVENT_FLAGS_GROUP ux_slave_class_cdc_acm_event_flags_group; + UX_EVENT_FLAGS_GROUP ux_slave_class_cdc_acm_event_flags_group; ULONG ux_slave_class_cdc_acm_transmission_status; ULONG ux_slave_class_cdc_acm_scheduled_write; ULONG ux_slave_class_cdc_acm_callback_total_length; 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 df6dee3..fac6c1c 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.0 */ +/* 6.1 */ /* AUTHOR */ /* */ /* Chaoqiong Xiao, Microsoft Corporation */ @@ -39,6 +39,11 @@ /* DATE NAME DESCRIPTION */ /* */ /* 05-19-2020 Chaoqiong Xiao Initial Version 6.0 */ +/* 09-30-2020 Chaoqiong Xiao Modified comment(s), */ +/* used UX prefix to refer to */ +/* TX symbols instead of using */ +/* them directly, */ +/* resulting in version 6.1 */ /* */ /**************************************************************************/ @@ -269,7 +274,7 @@ typedef struct UX_SLAVE_CLASS_CDC_ECM_STRUCT ULONG ux_slave_class_cdc_ecm_ethernet_multicast_filter; ULONG ux_slave_class_cdc_ecm_ethernet_power_management_filter; ULONG ux_slave_class_cdc_ecm_ethernet_packet_filter; - TX_EVENT_FLAGS_GROUP ux_slave_class_cdc_ecm_event_flags_group; + UX_EVENT_FLAGS_GROUP ux_slave_class_cdc_ecm_event_flags_group; UCHAR ux_slave_class_cdc_ecm_local_node_id[UX_DEVICE_CLASS_CDC_ECM_NODE_ID_LENGTH]; UCHAR ux_slave_class_cdc_ecm_remote_node_id[UX_DEVICE_CLASS_CDC_ECM_NODE_ID_LENGTH]; NX_IP *ux_slave_class_cdc_ecm_nx_ip; @@ -281,14 +286,14 @@ typedef struct UX_SLAVE_CLASS_CDC_ECM_STRUCT NX_PACKET *ux_slave_class_cdc_ecm_receive_queue; UCHAR *ux_slave_class_cdc_ecm_pool_memory; NX_PACKET_POOL ux_slave_class_cdc_ecm_packet_pool; - TX_THREAD ux_slave_class_cdc_ecm_bulkin_thread; - TX_THREAD ux_slave_class_cdc_ecm_bulkout_thread; - TX_THREAD ux_slave_class_cdc_ecm_interrupt_thread; + UX_THREAD ux_slave_class_cdc_ecm_bulkin_thread; + UX_THREAD ux_slave_class_cdc_ecm_bulkout_thread; + UX_THREAD ux_slave_class_cdc_ecm_interrupt_thread; UCHAR *ux_slave_class_cdc_ecm_bulkin_thread_stack; UCHAR *ux_slave_class_cdc_ecm_bulkout_thread_stack; UCHAR *ux_slave_class_cdc_ecm_interrupt_thread_stack; ULONG ux_slave_class_cdc_ecm_link_state; - TX_MUTEX ux_slave_class_cdc_ecm_mutex; + UX_MUTEX ux_slave_class_cdc_ecm_mutex; VOID *ux_slave_class_cdc_ecm_network_handle; } UX_SLAVE_CLASS_CDC_ECM; 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 815aec0..10e3985 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.0 */ +/* 6.1 */ /* AUTHOR */ /* */ /* Chaoqiong Xiao, Microsoft Corporation */ @@ -39,6 +39,11 @@ /* DATE NAME DESCRIPTION */ /* */ /* 05-19-2020 Chaoqiong Xiao Initial Version 6.0 */ +/* 09-30-2020 Chaoqiong Xiao Modified comment(s), */ +/* used UX prefix to refer to */ +/* TX symbols instead of using */ +/* them directly, */ +/* resulting in version 6.1 */ /* */ /**************************************************************************/ @@ -161,9 +166,9 @@ typedef struct UX_SLAVE_CLASS_DFU_STRUCT UINT (*ux_slave_class_dfu_notify)(VOID *dfu, ULONG notification); ULONG ux_slave_class_dfu_download_block_count; ULONG ux_slave_class_dfu_upload_block_count; - TX_THREAD ux_slave_class_dfu_thread; + UX_THREAD ux_slave_class_dfu_thread; UCHAR *ux_slave_class_dfu_thread_stack; - TX_EVENT_FLAGS_GROUP ux_slave_class_dfu_event_flags_group; + UX_EVENT_FLAGS_GROUP ux_slave_class_dfu_event_flags_group; } UX_SLAVE_CLASS_DFU; 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 f1b885b..05e3833 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.0 */ +/* 6.1 */ /* AUTHOR */ /* */ /* Chaoqiong Xiao, Microsoft Corporation */ @@ -41,6 +41,11 @@ /* DATE NAME DESCRIPTION */ /* */ /* 05-19-2020 Chaoqiong Xiao Initial Version 6.0 */ +/* 09-30-2020 Chaoqiong Xiao Modified comment(s), */ +/* used UX prefix to refer to */ +/* TX symbols instead of using */ +/* them directly, */ +/* resulting in version 6.1 */ /* */ /**************************************************************************/ @@ -122,7 +127,7 @@ typedef struct UX_SLAVE_CLASS_HID_STRUCT UCHAR *ux_device_class_hid_report_address; ULONG ux_device_class_hid_report_id; ULONG ux_device_class_hid_report_length; - TX_EVENT_FLAGS_GROUP ux_device_class_hid_event_flags_group; + UX_EVENT_FLAGS_GROUP ux_device_class_hid_event_flags_group; ULONG ux_device_class_hid_event_idle_rate; ULONG ux_device_class_hid_event_wait_timeout; UX_SLAVE_CLASS_HID_EVENT *ux_device_class_hid_event_array; 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 5506927..36558ba 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.0 */ +/* 6.1 */ /* AUTHOR */ /* */ /* Chaoqiong Xiao, Microsoft Corporation */ @@ -41,6 +41,11 @@ /* DATE NAME DESCRIPTION */ /* */ /* 05-19-2020 Chaoqiong Xiao Initial Version 6.0 */ +/* 09-30-2020 Chaoqiong Xiao Modified comment(s), */ +/* used UX prefix to refer to */ +/* TX symbols instead of using */ +/* them directly, */ +/* resulting in version 6.1 */ /* */ /**************************************************************************/ @@ -785,10 +790,10 @@ typedef struct UX_SLAVE_CLASS_PIMA_STRUCT ULONG ux_device_class_pima_storage_free_space_image; UCHAR *ux_device_class_pima_storage_description; UCHAR *ux_device_class_pima_storage_volume_label; - TX_SEMAPHORE ux_device_class_pima_semaphore; - TX_THREAD ux_device_class_pima_interrupt_thread; + UX_SEMAPHORE ux_device_class_pima_semaphore; + UX_THREAD ux_device_class_pima_interrupt_thread; UCHAR *ux_device_class_pima_interrupt_thread_stack; - TX_SEMAPHORE ux_device_class_pima_interrupt_thread_semaphore; + UX_SEMAPHORE ux_device_class_pima_interrupt_thread_semaphore; UX_SLAVE_CLASS_PIMA_EVENT *ux_device_class_pima_event_array; UX_SLAVE_CLASS_PIMA_EVENT 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 c934b18..7142cf3 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.0 */ +/* 6.1 */ /* AUTHOR */ /* */ /* Chaoqiong Xiao, Microsoft Corporation */ @@ -39,6 +39,11 @@ /* DATE NAME DESCRIPTION */ /* */ /* 05-19-2020 Chaoqiong Xiao Initial Version 6.0 */ +/* 09-30-2020 Chaoqiong Xiao Modified comment(s), */ +/* used UX prefix to refer to */ +/* TX symbols instead of using */ +/* them directly, */ +/* resulting in version 6.1 */ /* */ /**************************************************************************/ @@ -479,7 +484,7 @@ typedef struct UX_SLAVE_CLASS_RNDIS_STRUCT { UX_SLAVE_INTERFACE *ux_slave_class_rndis_interface; UX_SLAVE_CLASS_RNDIS_PARAMETER ux_slave_class_rndis_parameter; - TX_SEMAPHORE ux_slave_class_rndis_semaphore; + UX_SEMAPHORE ux_slave_class_rndis_semaphore; UX_SLAVE_ENDPOINT *ux_slave_class_rndis_interrupt_endpoint; UX_SLAVE_ENDPOINT *ux_slave_class_rndis_bulkin_endpoint; UX_SLAVE_ENDPOINT *ux_slave_class_rndis_bulkout_endpoint; @@ -498,7 +503,7 @@ typedef struct UX_SLAVE_CLASS_RNDIS_STRUCT ULONG ux_slave_class_rndis_statistics_rcv_error_alignment; ULONG ux_slave_class_rndis_statistics_xmit_one_collision; ULONG ux_slave_class_rndis_statistics_xmit_more_collisions; - TX_EVENT_FLAGS_GROUP ux_slave_class_rndis_event_flags_group; + UX_EVENT_FLAGS_GROUP ux_slave_class_rndis_event_flags_group; UCHAR ux_slave_class_rndis_local_node_id[UX_DEVICE_CLASS_RNDIS_NODE_ID_LENGTH]; UCHAR ux_slave_class_rndis_remote_node_id[UX_DEVICE_CLASS_RNDIS_NODE_ID_LENGTH]; NX_IP *ux_slave_class_rndis_nx_ip; @@ -509,14 +514,14 @@ typedef struct UX_SLAVE_CLASS_RNDIS_STRUCT NX_PACKET *ux_slave_class_rndis_receive_queue; UCHAR *ux_slave_class_rndis_pool_memory; NX_PACKET_POOL ux_slave_class_rndis_packet_pool; - TX_THREAD ux_slave_class_rndis_interrupt_thread; - TX_THREAD ux_slave_class_rndis_bulkin_thread; - TX_THREAD ux_slave_class_rndis_bulkout_thread; + UX_THREAD ux_slave_class_rndis_interrupt_thread; + UX_THREAD ux_slave_class_rndis_bulkin_thread; + UX_THREAD ux_slave_class_rndis_bulkout_thread; UCHAR *ux_slave_class_rndis_interrupt_thread_stack; UCHAR *ux_slave_class_rndis_bulkin_thread_stack; UCHAR *ux_slave_class_rndis_bulkout_thread_stack; ULONG ux_slave_class_rndis_link_state; - TX_MUTEX ux_slave_class_rndis_mutex; + UX_MUTEX ux_slave_class_rndis_mutex; VOID *ux_slave_class_rndis_network_handle; } UX_SLAVE_CLASS_RNDIS; 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 c2e7858..e658da8 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.0.2 */ +/* 6.1 */ /* AUTHOR */ /* */ /* Chaoqiong Xiao, Microsoft Corporation */ @@ -41,9 +41,9 @@ /* DATE NAME DESCRIPTION */ /* */ /* 05-19-2020 Chaoqiong Xiao Initial Version 6.0 */ -/* 08-14-2020 Chaoqiong Xiao Modified comment(s), */ -/* added mode related macros, */ -/* resulting in version 6.0.2 */ +/* 09-30-2020 Chaoqiong Xiao Modified comment(s), */ +/* optimized command logic, */ +/* resulting in version 6.1 */ /* */ /**************************************************************************/ @@ -425,9 +425,7 @@ typedef struct UX_SLAVE_CLASS_STORAGE_LUN_STRUCT ULONG ux_slave_class_storage_media_read_only_flag; ULONG ux_slave_class_storage_media_id; ULONG ux_slave_class_storage_scsi_tag; - UCHAR ux_slave_class_storage_request_sense_key; - UCHAR ux_slave_class_storage_request_code; - UCHAR ux_slave_class_storage_request_code_qualifier; + ULONG ux_slave_class_storage_request_sense_status; ULONG ux_slave_class_storage_disk_status; ULONG ux_slave_class_storage_last_session_state; UINT (*ux_slave_class_storage_media_read)(VOID *storage, ULONG lun, UCHAR *data_pointer, ULONG number_blocks, ULONG lba, ULONG *media_status); @@ -437,6 +435,14 @@ typedef struct UX_SLAVE_CLASS_STORAGE_LUN_STRUCT UINT (*ux_slave_class_storage_media_notification)(VOID *storage, ULONG lun, ULONG media_id, ULONG notification_class, UCHAR **media_notification, ULONG *media_notification_length); } UX_SLAVE_CLASS_STORAGE_LUN; +/* Sense status value (key at bit0-7, code at bit8-15 and qualifier at bit16-23). */ + +#define UX_DEVICE_CLASS_STORAGE_SENSE_STATUS(key,code,qualifier) (((key) & 0xFF)|(((code) & 0xFF) << 8)|(((qualifier) & 0xFF) << 16)) +#define UX_DEVICE_CLASS_STORAGE_SENSE_KEY(status) ((status) & 0xFF) +#define UX_DEVICE_CLASS_STORAGE_SENSE_CODE(status) (((status) >> 8) & 0xFF) +#define UX_DEVICE_CLASS_STORAGE_SENSE_QUALIFIER(status) (((status) >> 16) & 0xFF) + + /* Define Slave Storage Class structure. */ typedef struct UX_SLAVE_CLASS_STORAGE_STRUCT @@ -444,7 +450,7 @@ typedef struct UX_SLAVE_CLASS_STORAGE_STRUCT UX_SLAVE_INTERFACE *ux_slave_class_storage_interface; ULONG ux_slave_class_storage_number_lun; UX_SLAVE_CLASS_STORAGE_LUN ux_slave_class_storage_lun[UX_MAX_SLAVE_LUN]; - ULONG ux_slave_class_storage_phase_error; + ULONG ux_slave_class_storage_csw_status; VOID (*ux_slave_class_storage_instance_activate)(VOID *); VOID (*ux_slave_class_storage_instance_deactivate)(VOID *); UCHAR *ux_slave_class_storage_vendor_id; @@ -454,6 +460,9 @@ typedef struct UX_SLAVE_CLASS_STORAGE_STRUCT } UX_SLAVE_CLASS_STORAGE; +#define UX_DEVICE_CLASS_STORAGE_CSW_STATUS(p) (((UCHAR*)(p))[0]) +#define UX_DEVICE_CLASS_STORAGE_CSW_SKIP(p) (((UCHAR*)(p))[3]) + /* Define Slave Storage Class Calling Parameter structure */ typedef struct UX_SLAVE_CLASS_STORAGE_PARAMETER_STRUCT diff --git a/common/usbx_device_classes/src/ux_device_class_audio10_control_process.c b/common/usbx_device_classes/src/ux_device_class_audio10_control_process.c index d742db1..0e32334 100644 --- a/common/usbx_device_classes/src/ux_device_class_audio10_control_process.c +++ b/common/usbx_device_classes/src/ux_device_class_audio10_control_process.c @@ -35,7 +35,7 @@ /* FUNCTION RELEASE */ /* */ /* _ux_device_class_audio10_control_process PORTABLE C */ -/* 6.0 */ +/* 6.1 */ /* AUTHOR */ /* */ /* Chaoqiong Xiao, Microsoft Corporation */ @@ -73,6 +73,8 @@ /* 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 */ /* */ /**************************************************************************/ UINT _ux_device_class_audio10_control_process(UX_DEVICE_CLASS_AUDIO *audio, diff --git a/common/usbx_device_classes/src/ux_device_class_audio20_control_process.c b/common/usbx_device_classes/src/ux_device_class_audio20_control_process.c index 9474f87..a5b92f4 100644 --- a/common/usbx_device_classes/src/ux_device_class_audio20_control_process.c +++ b/common/usbx_device_classes/src/ux_device_class_audio20_control_process.c @@ -34,8 +34,8 @@ /* */ /* FUNCTION RELEASE */ /* */ -/* _ux_device_class_audio_control_request PORTABLE C */ -/* 6.0 */ +/* _ux_device_class_audio20_control_process PORTABLE C */ +/* 6.1 */ /* AUTHOR */ /* */ /* Chaoqiong Xiao, Microsoft Corporation */ @@ -74,6 +74,8 @@ /* 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 */ /* */ /**************************************************************************/ UINT _ux_device_class_audio20_control_process(UX_DEVICE_CLASS_AUDIO *audio, 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 24e1ca1..9ef3669 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.0 */ +/* 6.1 */ /* AUTHOR */ /* */ /* Chaoqiong Xiao, Microsoft Corporation */ @@ -63,6 +63,8 @@ /* 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 */ /* */ /**************************************************************************/ UINT _ux_device_class_audio_activate(UX_SLAVE_CLASS_COMMAND *command) 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 41051c9..827ee2a 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.0 */ +/* 6.1 */ /* AUTHOR */ /* */ /* Chaoqiong Xiao, Microsoft Corporation */ @@ -63,6 +63,8 @@ /* 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 */ /* */ /**************************************************************************/ UINT _ux_device_class_audio_change(UX_SLAVE_CLASS_COMMAND *command) diff --git a/common/usbx_device_classes/src/ux_device_class_audio_control_request.c b/common/usbx_device_classes/src/ux_device_class_audio_control_request.c index da96385..7ee5bb9 100644 --- a/common/usbx_device_classes/src/ux_device_class_audio_control_request.c +++ b/common/usbx_device_classes/src/ux_device_class_audio_control_request.c @@ -34,7 +34,7 @@ /* FUNCTION RELEASE */ /* */ /* _ux_device_class_audio_control_request PORTABLE C */ -/* 6.0 */ +/* 6.1 */ /* AUTHOR */ /* */ /* Chaoqiong Xiao, Microsoft Corporation */ @@ -65,6 +65,8 @@ /* 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 */ /* */ /**************************************************************************/ UINT _ux_device_class_audio_control_request(UX_SLAVE_CLASS_COMMAND *command) diff --git a/common/usbx_device_classes/src/ux_device_class_audio_deactivate.c b/common/usbx_device_classes/src/ux_device_class_audio_deactivate.c index 6e1eaf7..8c6460b 100644 --- a/common/usbx_device_classes/src/ux_device_class_audio_deactivate.c +++ b/common/usbx_device_classes/src/ux_device_class_audio_deactivate.c @@ -34,7 +34,7 @@ /* FUNCTION RELEASE */ /* */ /* _ux_device_class_audio_deactivate PORTABLE C */ -/* 6.0 */ +/* 6.1 */ /* AUTHOR */ /* */ /* Chaoqiong Xiao, Microsoft Corporation */ @@ -65,6 +65,8 @@ /* 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 */ /* */ /**************************************************************************/ UINT _ux_device_class_audio_deactivate(UX_SLAVE_CLASS_COMMAND *command) diff --git a/common/usbx_device_classes/src/ux_device_class_audio_entry.c b/common/usbx_device_classes/src/ux_device_class_audio_entry.c index ccbd65d..39cd908 100644 --- a/common/usbx_device_classes/src/ux_device_class_audio_entry.c +++ b/common/usbx_device_classes/src/ux_device_class_audio_entry.c @@ -33,8 +33,8 @@ /* */ /* FUNCTION RELEASE */ /* */ -/* _ux_class_device_audio_entry PORTABLE C */ -/* 6.0 */ +/* _ux_device_class_audio_entry PORTABLE C */ +/* 6.1 */ /* AUTHOR */ /* */ /* Chaoqiong Xiao, Microsoft Corporation */ @@ -72,6 +72,8 @@ /* 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 */ /* */ /**************************************************************************/ UINT _ux_device_class_audio_entry(UX_SLAVE_CLASS_COMMAND *command) diff --git a/common/usbx_device_classes/src/ux_device_class_audio_frame_write.c b/common/usbx_device_classes/src/ux_device_class_audio_frame_write.c index 8042209..1840670 100644 --- a/common/usbx_device_classes/src/ux_device_class_audio_frame_write.c +++ b/common/usbx_device_classes/src/ux_device_class_audio_frame_write.c @@ -34,7 +34,7 @@ /* FUNCTION RELEASE */ /* */ /* _ux_device_class_audio_frame_write PORTABLE C */ -/* 6.0 */ +/* 6.1 */ /* AUTHOR */ /* */ /* Chaoqiong Xiao, Microsoft Corporation */ @@ -68,6 +68,10 @@ /* DATE NAME DESCRIPTION */ /* */ /* 05-19-2020 Chaoqiong Xiao Initial Version 6.0 */ +/* 09-30-2020 Chaoqiong Xiao Modified comment(s), */ +/* verified memset and memcpy */ +/* cases, */ +/* resulting in version 6.1 */ /* */ /**************************************************************************/ UINT _ux_device_class_audio_frame_write(UX_DEVICE_CLASS_AUDIO_STREAM *stream, UCHAR *frame, ULONG length) @@ -116,7 +120,7 @@ ULONG frame_buffer_size; next_frame_buffer = stream -> ux_device_class_audio_stream_buffer; /* Copy frame. */ - _ux_utility_memory_copy(stream -> ux_device_class_audio_stream_access_pos -> ux_device_class_audio_frame_data, frame, length); + _ux_utility_memory_copy(stream -> ux_device_class_audio_stream_access_pos -> ux_device_class_audio_frame_data, frame, length); /* Use case of memcpy is verified. */ stream -> ux_device_class_audio_stream_access_pos -> ux_device_class_audio_frame_length = length; /* Move frame position. */ 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 a085e28..904fb6a 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.0 */ +/* 6.1 */ /* AUTHOR */ /* */ /* Chaoqiong Xiao, Microsoft Corporation */ @@ -67,6 +67,12 @@ /* DATE NAME DESCRIPTION */ /* */ /* 05-19-2020 Chaoqiong Xiao Initial Version 6.0 */ +/* 09-30-2020 Chaoqiong Xiao Modified comment(s), */ +/* verified memset and memcpy */ +/* cases, used UX prefix to */ +/* refer to TX symbols instead */ +/* of using them directly, */ +/* resulting in version 6.1 */ /* */ /**************************************************************************/ UINT _ux_device_class_audio_initialize(UX_SLAVE_CLASS_COMMAND *command) @@ -178,7 +184,7 @@ ULONG i; stream_parameter -> ux_device_class_audio_stream_parameter_thread_entry, (ULONG)(ALIGN_TYPE)stream, (VOID *) stream -> ux_device_class_audio_stream_thread_stack, memory_size, UX_THREAD_PRIORITY_CLASS, - UX_THREAD_PRIORITY_CLASS, UX_NO_TIME_SLICE, TX_DONT_START); + UX_THREAD_PRIORITY_CLASS, UX_NO_TIME_SLICE, UX_DONT_START); /* Check for successful allocation. */ if (status != UX_SUCCESS) @@ -189,7 +195,7 @@ ULONG i; /* Save callbacks. */ _ux_utility_memory_copy(&stream -> ux_device_class_audio_stream_callbacks, &stream_parameter -> ux_device_class_audio_stream_parameter_callbacks, - sizeof(UX_DEVICE_CLASS_AUDIO_STREAM_CALLBACKS)); + sizeof(UX_DEVICE_CLASS_AUDIO_STREAM_CALLBACKS)); /* Use case of memcpy is verified. */ /* Save audio instance. */ stream -> ux_device_class_audio_stream_audio = audio; @@ -211,7 +217,7 @@ ULONG i; /* Save callbacks. */ _ux_utility_memory_copy(&audio -> ux_device_class_audio_callbacks, &audio_parameter -> ux_device_class_audio_parameter_callbacks, - sizeof(UX_DEVICE_CLASS_AUDIO_CALLBACKS)); + sizeof(UX_DEVICE_CLASS_AUDIO_CALLBACKS)); /* Use case of memcpy is verified. */ /* Return completion status. */ return(UX_SUCCESS); diff --git a/common/usbx_device_classes/src/ux_device_class_audio_ioctl.c b/common/usbx_device_classes/src/ux_device_class_audio_ioctl.c index 99797de..d8bee50 100644 --- a/common/usbx_device_classes/src/ux_device_class_audio_ioctl.c +++ b/common/usbx_device_classes/src/ux_device_class_audio_ioctl.c @@ -34,7 +34,7 @@ /* FUNCTION RELEASE */ /* */ /* _ux_device_class_audio_ioctl PORTABLE C */ -/* 6.0 */ +/* 6.1 */ /* AUTHOR */ /* */ /* Chaoqiong Xiao, Microsoft Corporation */ @@ -66,6 +66,8 @@ /* 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 */ /* */ /**************************************************************************/ UINT _ux_device_class_audio_ioctl(UX_DEVICE_CLASS_AUDIO *audio, ULONG ioctl_function, diff --git a/common/usbx_device_classes/src/ux_device_class_audio_read_frame_free.c b/common/usbx_device_classes/src/ux_device_class_audio_read_frame_free.c index b03a0fd..b2430b5 100644 --- a/common/usbx_device_classes/src/ux_device_class_audio_read_frame_free.c +++ b/common/usbx_device_classes/src/ux_device_class_audio_read_frame_free.c @@ -34,7 +34,7 @@ /* FUNCTION RELEASE */ /* */ /* _ux_device_class_audio_read_frame_free PORTABLE C */ -/* 6.0 */ +/* 6.1 */ /* AUTHOR */ /* */ /* Chaoqiong Xiao, Microsoft Corporation */ @@ -64,6 +64,8 @@ /* 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 */ /* */ /**************************************************************************/ UINT _ux_device_class_audio_read_frame_free(UX_DEVICE_CLASS_AUDIO_STREAM *stream) diff --git a/common/usbx_device_classes/src/ux_device_class_audio_read_frame_get.c b/common/usbx_device_classes/src/ux_device_class_audio_read_frame_get.c index d5ed96f..3cfd71a 100644 --- a/common/usbx_device_classes/src/ux_device_class_audio_read_frame_get.c +++ b/common/usbx_device_classes/src/ux_device_class_audio_read_frame_get.c @@ -34,7 +34,7 @@ /* FUNCTION RELEASE */ /* */ /* _ux_device_class_audio_read_frame_get PORTABLE C */ -/* 6.0 */ +/* 6.1 */ /* AUTHOR */ /* */ /* Chaoqiong Xiao, Microsoft Corporation */ @@ -68,6 +68,8 @@ /* 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 */ /* */ /**************************************************************************/ UINT _ux_device_class_audio_read_frame_get(UX_DEVICE_CLASS_AUDIO_STREAM *stream, 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 7f668d4..b48a0db 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 @@ -33,8 +33,8 @@ /* */ /* FUNCTION RELEASE */ /* */ -/* _ux_device_class_audio_read_thread PORTABLE C */ -/* 6.0 */ +/* _ux_device_class_audio_read_thread_entry PORTABLE C */ +/* 6.1 */ /* AUTHOR */ /* */ /* Chaoqiong Xiao, Microsoft Corporation */ @@ -68,6 +68,10 @@ /* DATE NAME DESCRIPTION */ /* */ /* 05-19-2020 Chaoqiong Xiao Initial Version 6.0 */ +/* 09-30-2020 Chaoqiong Xiao Modified comment(s), */ +/* verified memset and memcpy */ +/* cases, */ +/* resulting in version 6.1 */ /* */ /**************************************************************************/ VOID _ux_device_class_audio_read_thread_entry(ULONG audio_stream) @@ -137,7 +141,7 @@ ULONG actual_length; stream -> ux_device_class_audio_stream_transfer_pos -> ux_device_class_audio_frame_pos = 0; _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); + actual_length); /* Use case of memcpy is verified. */ /* 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_reception_start.c b/common/usbx_device_classes/src/ux_device_class_audio_reception_start.c index 6a471fe..6be79e5 100644 --- a/common/usbx_device_classes/src/ux_device_class_audio_reception_start.c +++ b/common/usbx_device_classes/src/ux_device_class_audio_reception_start.c @@ -34,7 +34,7 @@ /* FUNCTION RELEASE */ /* */ /* _ux_device_class_audio_reception_start PORTABLE C */ -/* 6.0 */ +/* 6.1 */ /* AUTHOR */ /* */ /* Chaoqiong Xiao, Microsoft Corporation */ @@ -65,6 +65,8 @@ /* 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 */ /* */ /**************************************************************************/ UINT _ux_device_class_audio_reception_start(UX_DEVICE_CLASS_AUDIO_STREAM *stream) diff --git a/common/usbx_device_classes/src/ux_device_class_audio_sample_read16.c b/common/usbx_device_classes/src/ux_device_class_audio_sample_read16.c index f218054..04dbd26 100644 --- a/common/usbx_device_classes/src/ux_device_class_audio_sample_read16.c +++ b/common/usbx_device_classes/src/ux_device_class_audio_sample_read16.c @@ -34,7 +34,7 @@ /* FUNCTION RELEASE */ /* */ /* _ux_device_class_audio_sample_read16 PORTABLE C */ -/* 6.0 */ +/* 6.1 */ /* AUTHOR */ /* */ /* Chaoqiong Xiao, Microsoft Corporation */ @@ -66,6 +66,8 @@ /* 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 */ /* */ /**************************************************************************/ UINT _ux_device_class_audio_sample_read16(UX_DEVICE_CLASS_AUDIO_STREAM *stream, diff --git a/common/usbx_device_classes/src/ux_device_class_audio_sample_read24.c b/common/usbx_device_classes/src/ux_device_class_audio_sample_read24.c index 1ce43fd..cd53dd9 100644 --- a/common/usbx_device_classes/src/ux_device_class_audio_sample_read24.c +++ b/common/usbx_device_classes/src/ux_device_class_audio_sample_read24.c @@ -34,7 +34,7 @@ /* FUNCTION RELEASE */ /* */ /* _ux_device_class_audio_sample_read24 PORTABLE C */ -/* 6.0 */ +/* 6.1 */ /* AUTHOR */ /* */ /* Chaoqiong Xiao, Microsoft Corporation */ @@ -66,6 +66,8 @@ /* 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 */ /* */ /**************************************************************************/ UINT _ux_device_class_audio_sample_read24(UX_DEVICE_CLASS_AUDIO_STREAM *stream, diff --git a/common/usbx_device_classes/src/ux_device_class_audio_sample_read32.c b/common/usbx_device_classes/src/ux_device_class_audio_sample_read32.c index e0ecc6d..0e53daa 100644 --- a/common/usbx_device_classes/src/ux_device_class_audio_sample_read32.c +++ b/common/usbx_device_classes/src/ux_device_class_audio_sample_read32.c @@ -34,7 +34,7 @@ /* FUNCTION RELEASE */ /* */ /* _ux_device_class_audio_sample_read32 PORTABLE C */ -/* 6.0 */ +/* 6.1 */ /* AUTHOR */ /* */ /* Chaoqiong Xiao, Microsoft Corporation */ @@ -66,6 +66,8 @@ /* 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 */ /* */ /**************************************************************************/ UINT _ux_device_class_audio_sample_read32(UX_DEVICE_CLASS_AUDIO_STREAM *stream, ULONG *buffer) diff --git a/common/usbx_device_classes/src/ux_device_class_audio_sample_read8.c b/common/usbx_device_classes/src/ux_device_class_audio_sample_read8.c index 580d28c..2eab8e3 100644 --- a/common/usbx_device_classes/src/ux_device_class_audio_sample_read8.c +++ b/common/usbx_device_classes/src/ux_device_class_audio_sample_read8.c @@ -34,7 +34,7 @@ /* FUNCTION RELEASE */ /* */ /* _ux_device_class_audio_sample_read8 PORTABLE C */ -/* 6.0 */ +/* 6.1 */ /* AUTHOR */ /* */ /* Chaoqiong Xiao, Microsoft Corporation */ @@ -66,6 +66,8 @@ /* 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 */ /* */ /**************************************************************************/ UINT _ux_device_class_audio_sample_read8(UX_DEVICE_CLASS_AUDIO_STREAM *stream, diff --git a/common/usbx_device_classes/src/ux_device_class_audio_stream_get.c b/common/usbx_device_classes/src/ux_device_class_audio_stream_get.c index 4072478..06bf94f 100644 --- a/common/usbx_device_classes/src/ux_device_class_audio_stream_get.c +++ b/common/usbx_device_classes/src/ux_device_class_audio_stream_get.c @@ -34,7 +34,7 @@ /* FUNCTION RELEASE */ /* */ /* _ux_device_class_audio_stream_get PORTABLE C */ -/* 6.0 */ +/* 6.1 */ /* AUTHOR */ /* */ /* Chaoqiong Xiao, Microsoft Corporation */ @@ -69,6 +69,8 @@ /* 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 */ /* */ /**************************************************************************/ UINT _ux_device_class_audio_stream_get(UX_DEVICE_CLASS_AUDIO *audio, diff --git a/common/usbx_device_classes/src/ux_device_class_audio_transmission_start.c b/common/usbx_device_classes/src/ux_device_class_audio_transmission_start.c index 31d8480..7b52f6b 100644 --- a/common/usbx_device_classes/src/ux_device_class_audio_transmission_start.c +++ b/common/usbx_device_classes/src/ux_device_class_audio_transmission_start.c @@ -34,7 +34,7 @@ /* FUNCTION RELEASE */ /* */ /* _ux_device_class_audio_transmission_start PORTABLE C */ -/* 6.0 */ +/* 6.1 */ /* AUTHOR */ /* */ /* Chaoqiong Xiao, Microsoft Corporation */ @@ -65,6 +65,8 @@ /* 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 */ /* */ /**************************************************************************/ UINT _ux_device_class_audio_transmission_start(UX_DEVICE_CLASS_AUDIO_STREAM *stream) 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 28886dd..1cac54e 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.0 */ +/* 6.1 */ /* AUTHOR */ /* */ /* Chaoqiong Xiao, Microsoft Corporation */ @@ -65,6 +65,8 @@ /* 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 */ /* */ /**************************************************************************/ UINT _ux_device_class_audio_uninitialize(UX_SLAVE_CLASS_COMMAND *command) diff --git a/common/usbx_device_classes/src/ux_device_class_audio_write_frame_commit.c b/common/usbx_device_classes/src/ux_device_class_audio_write_frame_commit.c index f8efba5..655bd61 100644 --- a/common/usbx_device_classes/src/ux_device_class_audio_write_frame_commit.c +++ b/common/usbx_device_classes/src/ux_device_class_audio_write_frame_commit.c @@ -34,7 +34,7 @@ /* FUNCTION RELEASE */ /* */ /* _ux_device_class_audio_write_frame_commit PORTABLE C */ -/* 6.0 */ +/* 6.1 */ /* AUTHOR */ /* */ /* Chaoqiong Xiao, Microsoft Corporation */ @@ -67,6 +67,8 @@ /* 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 */ /* */ /**************************************************************************/ UINT _ux_device_class_audio_write_frame_commit(UX_DEVICE_CLASS_AUDIO_STREAM *stream, ULONG length) diff --git a/common/usbx_device_classes/src/ux_device_class_audio_write_frame_get.c b/common/usbx_device_classes/src/ux_device_class_audio_write_frame_get.c index 5ad7945..ca95236 100644 --- a/common/usbx_device_classes/src/ux_device_class_audio_write_frame_get.c +++ b/common/usbx_device_classes/src/ux_device_class_audio_write_frame_get.c @@ -34,7 +34,7 @@ /* FUNCTION RELEASE */ /* */ /* _ux_device_class_audio_write_frame_get PORTABLE C */ -/* 6.0 */ +/* 6.1 */ /* AUTHOR */ /* */ /* Chaoqiong Xiao, Microsoft Corporation */ @@ -68,6 +68,8 @@ /* 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 */ /* */ /**************************************************************************/ UINT _ux_device_class_audio_write_frame_get(UX_DEVICE_CLASS_AUDIO_STREAM *stream, UCHAR **frame, ULONG *length) 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 a246cf1..7b204d6 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 @@ -33,8 +33,8 @@ /* */ /* FUNCTION RELEASE */ /* */ -/* _ux_device_class_audio_write_thread PORTABLE C */ -/* 6.0 */ +/* _ux_device_class_audio_write_thread_entry PORTABLE C */ +/* 6.1 */ /* AUTHOR */ /* */ /* Chaoqiong Xiao, Microsoft Corporation */ @@ -68,6 +68,10 @@ /* DATE NAME DESCRIPTION */ /* */ /* 05-19-2020 Chaoqiong Xiao Initial Version 6.0 */ +/* 09-30-2020 Chaoqiong Xiao Modified comment(s), */ +/* verified memset and memcpy */ +/* cases, */ +/* resulting in version 6.1 */ /* */ /**************************************************************************/ VOID _ux_device_class_audio_write_thread_entry(ULONG audio_stream) @@ -110,7 +114,7 @@ ULONG actual_length; transfer_length = stream -> ux_device_class_audio_stream_transfer_pos -> ux_device_class_audio_frame_length; 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); + stream -> ux_device_class_audio_stream_transfer_pos -> ux_device_class_audio_frame_data, transfer_length); /* Use case of memcpy is verified. */ /* 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_cdc_acm_activate.c b/common/usbx_device_classes/src/ux_device_class_cdc_acm_activate.c index 58c5f4b..50791fd 100644 --- a/common/usbx_device_classes/src/ux_device_class_cdc_acm_activate.c +++ b/common/usbx_device_classes/src/ux_device_class_cdc_acm_activate.c @@ -33,7 +33,7 @@ /* FUNCTION RELEASE */ /* */ /* _ux_device_class_cdc_acm_activate PORTABLE C */ -/* 6.0 */ +/* 6.1 */ /* AUTHOR */ /* */ /* Chaoqiong Xiao, Microsoft Corporation */ @@ -63,6 +63,8 @@ /* 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 */ /* */ /**************************************************************************/ UINT _ux_device_class_cdc_acm_activate(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 9d0e4bc..b72f9be 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 @@ -33,7 +33,7 @@ /* FUNCTION RELEASE */ /* */ /* _ux_device_class_cdc_acm_bulkin_thread PORTABLE C */ -/* 6.0 */ +/* 6.1 */ /* AUTHOR */ /* */ /* Chaoqiong Xiao, Microsoft Corporation */ @@ -66,6 +66,12 @@ /* DATE NAME DESCRIPTION */ /* */ /* 05-19-2020 Chaoqiong Xiao Initial Version 6.0 */ +/* 09-30-2020 Chaoqiong Xiao Modified comment(s), */ +/* verified memset and memcpy */ +/* cases, used UX prefix to */ +/* refer to TX symbols instead */ +/* of using them directly, */ +/* resulting in version 6.1 */ /* */ /**************************************************************************/ VOID _ux_device_class_cdc_acm_bulkin_thread(ULONG cdc_acm_class) @@ -116,7 +122,7 @@ ULONG sent_length; /* Wait until we have a event sent by the application. */ status = _ux_utility_event_flags_get(&cdc_acm -> ux_slave_class_cdc_acm_event_flags_group, UX_DEVICE_CLASS_CDC_ACM_WRITE_EVENT, - TX_OR_CLEAR, &actual_flags, TX_WAIT_FOREVER); + UX_OR_CLEAR, &actual_flags, UX_WAIT_FOREVER); /* Check the completion code. */ if (status == UX_SUCCESS) @@ -158,7 +164,7 @@ ULONG sent_length; /* Copy the payload locally. */ _ux_utility_memory_copy (transfer_request -> ux_slave_transfer_request_data_pointer, cdc_acm -> ux_slave_class_cdc_acm_callback_current_data_pointer, - transfer_length); + transfer_length); /* Use case of memcpy is verified. */ /* Send the acm payload to the host. */ status = _ux_device_stack_transfer_request(transfer_request, transfer_length, transfer_length); 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 5ca343f..4003f54 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 @@ -33,7 +33,7 @@ /* FUNCTION RELEASE */ /* */ /* _ux_device_class_cdc_acm_bulkout_thread PORTABLE C */ -/* 6.0 */ +/* 6.1 */ /* AUTHOR */ /* */ /* Chaoqiong Xiao, Microsoft Corporation */ @@ -66,6 +66,8 @@ /* 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 */ /* */ /**************************************************************************/ 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_control_request.c b/common/usbx_device_classes/src/ux_device_class_cdc_acm_control_request.c index 8ae6921..5fd1d1c 100644 --- a/common/usbx_device_classes/src/ux_device_class_cdc_acm_control_request.c +++ b/common/usbx_device_classes/src/ux_device_class_cdc_acm_control_request.c @@ -34,7 +34,7 @@ /* FUNCTION RELEASE */ /* */ /* _ux_device_class_cdc_acm_control_request PORTABLE C */ -/* 6.0 */ +/* 6.1 */ /* AUTHOR */ /* */ /* Chaoqiong Xiao, Microsoft Corporation */ @@ -65,6 +65,8 @@ /* 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 */ /* */ /**************************************************************************/ UINT _ux_device_class_cdc_acm_control_request(UX_SLAVE_CLASS_COMMAND *command) diff --git a/common/usbx_device_classes/src/ux_device_class_cdc_acm_deactivate.c b/common/usbx_device_classes/src/ux_device_class_cdc_acm_deactivate.c index dc132e1..eeafcb6 100644 --- a/common/usbx_device_classes/src/ux_device_class_cdc_acm_deactivate.c +++ b/common/usbx_device_classes/src/ux_device_class_cdc_acm_deactivate.c @@ -34,7 +34,7 @@ /* FUNCTION RELEASE */ /* */ /* _ux_device_class_cdc_acm_deactivate PORTABLE C */ -/* 6.0 */ +/* 6.1 */ /* AUTHOR */ /* */ /* Chaoqiong Xiao, Microsoft Corporation */ @@ -65,6 +65,8 @@ /* 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 */ /* */ /**************************************************************************/ UINT _ux_device_class_cdc_acm_deactivate(UX_SLAVE_CLASS_COMMAND *command) diff --git a/common/usbx_device_classes/src/ux_device_class_cdc_acm_entry.c b/common/usbx_device_classes/src/ux_device_class_cdc_acm_entry.c index 1cf3e63..2e4f3a1 100644 --- a/common/usbx_device_classes/src/ux_device_class_cdc_acm_entry.c +++ b/common/usbx_device_classes/src/ux_device_class_cdc_acm_entry.c @@ -33,8 +33,8 @@ /* */ /* FUNCTION RELEASE */ /* */ -/* _ux_class_device_cdc_acm_entry PORTABLE C */ -/* 6.0 */ +/* _ux_device_class_cdc_acm_entry PORTABLE C */ +/* 6.1 */ /* AUTHOR */ /* */ /* Chaoqiong Xiao, Microsoft Corporation */ @@ -71,6 +71,8 @@ /* 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 */ /* */ /**************************************************************************/ UINT _ux_device_class_cdc_acm_entry(UX_SLAVE_CLASS_COMMAND *command) 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 e858c2c..ba7c9da 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 @@ -33,7 +33,7 @@ /* FUNCTION RELEASE */ /* */ /* _ux_device_class_cdc_acm_initialize PORTABLE C */ -/* 6.0 */ +/* 6.1 */ /* AUTHOR */ /* */ /* Chaoqiong Xiao, Microsoft Corporation */ @@ -66,6 +66,8 @@ /* 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 */ /* */ /**************************************************************************/ 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 3aacab0..c1488be 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.0 */ +/* 6.1 */ /* AUTHOR */ /* */ /* Chaoqiong Xiao, Microsoft Corporation */ @@ -71,6 +71,11 @@ /* DATE NAME DESCRIPTION */ /* */ /* 05-19-2020 Chaoqiong Xiao Initial Version 6.0 */ +/* 09-30-2020 Chaoqiong Xiao Modified comment(s), */ +/* used UX prefix to refer to */ +/* TX symbols instead of using */ +/* them directly, */ +/* resulting in version 6.1 */ /* */ /**************************************************************************/ UINT _ux_device_class_cdc_acm_ioctl(UX_SLAVE_CLASS_CDC_ACM *cdc_acm, ULONG ioctl_function, @@ -286,7 +291,7 @@ UX_SLAVE_TRANSFER *transfer_request; _ux_device_class_cdc_acm_bulkin_thread, (ULONG) (ALIGN_TYPE) cdc_acm, (VOID *) cdc_acm -> ux_slave_class_cdc_acm_bulkin_thread_stack , UX_THREAD_STACK_SIZE, UX_THREAD_PRIORITY_CLASS, - UX_THREAD_PRIORITY_CLASS, UX_NO_TIME_SLICE, TX_AUTO_START); + UX_THREAD_PRIORITY_CLASS, UX_NO_TIME_SLICE, UX_AUTO_START); /* Check the creation of this thread. */ if (status != UX_SUCCESS) @@ -311,7 +316,7 @@ UX_SLAVE_TRANSFER *transfer_request; _ux_device_class_cdc_acm_bulkout_thread, (ULONG) (ALIGN_TYPE) cdc_acm, (VOID *) cdc_acm -> ux_slave_class_cdc_acm_bulkout_thread_stack , UX_THREAD_STACK_SIZE, UX_THREAD_PRIORITY_CLASS, - UX_THREAD_PRIORITY_CLASS, UX_NO_TIME_SLICE, TX_AUTO_START); + UX_THREAD_PRIORITY_CLASS, UX_NO_TIME_SLICE, UX_AUTO_START); /* Check the creation of this thread. */ if (status != UX_SUCCESS) 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 2994e36..56caacd 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 @@ -34,7 +34,7 @@ /* FUNCTION RELEASE */ /* */ /* _ux_device_class_cdc_acm_read PORTABLE C */ -/* 6.0 */ +/* 6.1 */ /* AUTHOR */ /* */ /* Chaoqiong Xiao, Microsoft Corporation */ @@ -72,6 +72,10 @@ /* DATE NAME DESCRIPTION */ /* */ /* 05-19-2020 Chaoqiong Xiao Initial Version 6.0 */ +/* 09-30-2020 Chaoqiong Xiao Modified comment(s), */ +/* verified memset and memcpy */ +/* cases, */ +/* resulting in version 6.1 */ /* */ /**************************************************************************/ UINT _ux_device_class_cdc_acm_read(UX_SLAVE_CLASS_CDC_ACM *cdc_acm, UCHAR *buffer, @@ -159,7 +163,7 @@ ULONG local_requested_length; /* We need to copy the buffer locally. */ _ux_utility_memory_copy(buffer, transfer_request -> ux_slave_transfer_request_data_pointer, - transfer_request -> ux_slave_transfer_request_actual_length); + transfer_request -> ux_slave_transfer_request_actual_length); /* Use case of memcpy is verified. */ /* Next buffer address. */ buffer += transfer_request -> ux_slave_transfer_request_actual_length; 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 e73e162..fc7742c 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.0 */ +/* 6.1 */ /* AUTHOR */ /* */ /* Chaoqiong Xiao, Microsoft Corporation */ @@ -65,6 +65,8 @@ /* 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 */ /* */ /**************************************************************************/ 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 0014a11..461855b 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 @@ -34,7 +34,7 @@ /* FUNCTION RELEASE */ /* */ /* _ux_device_class_cdc_acm_write PORTABLE C */ -/* 6.0 */ +/* 6.1 */ /* AUTHOR */ /* */ /* Chaoqiong Xiao, Microsoft Corporation */ @@ -72,6 +72,10 @@ /* DATE NAME DESCRIPTION */ /* */ /* 05-19-2020 Chaoqiong Xiao Initial Version 6.0 */ +/* 09-30-2020 Chaoqiong Xiao Modified comment(s), */ +/* verified memset and memcpy */ +/* cases, */ +/* resulting in version 6.1 */ /* */ /**************************************************************************/ UINT _ux_device_class_cdc_acm_write(UX_SLAVE_CLASS_CDC_ACM *cdc_acm, UCHAR *buffer, @@ -169,7 +173,7 @@ UINT status = 0; /* On a out, we copy the buffer to the caller. Not very efficient but it makes the API easier. */ _ux_utility_memory_copy(transfer_request -> ux_slave_transfer_request_data_pointer, - buffer, local_requested_length); + buffer, local_requested_length); /* Use case of memcpy is verified. */ /* Send the request to the device controller. */ status = _ux_device_stack_transfer_request(transfer_request, local_requested_length, local_requested_length); 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 15d4824..3aba3d2 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.0 */ +/* 6.1 */ /* AUTHOR */ /* */ /* Chaoqiong Xiao, Microsoft Corporation */ @@ -67,6 +67,11 @@ /* DATE NAME DESCRIPTION */ /* */ /* 05-19-2020 Chaoqiong Xiao Initial Version 6.0 */ +/* 09-30-2020 Chaoqiong Xiao Modified comment(s), */ +/* used UX prefix to refer to */ +/* TX symbols instead of using */ +/* them directly, */ +/* resulting in version 6.1 */ /* */ /**************************************************************************/ UINT _ux_device_class_cdc_acm_write_with_callback(UX_SLAVE_CLASS_CDC_ACM *cdc_acm, UCHAR *buffer, @@ -123,7 +128,7 @@ UINT status; cdc_acm -> ux_slave_class_cdc_acm_scheduled_write = UX_TRUE; /* Invoke the bulkin thread by sending a flag . */ - status = _ux_utility_event_flags_set(&cdc_acm -> ux_slave_class_cdc_acm_event_flags_group, UX_DEVICE_CLASS_CDC_ACM_WRITE_EVENT, TX_OR); + status = _ux_utility_event_flags_set(&cdc_acm -> ux_slave_class_cdc_acm_event_flags_group, UX_DEVICE_CLASS_CDC_ACM_WRITE_EVENT, UX_OR); /* Simply return the last function result. When we leave this function, the deferred writing has been scheduled. */ return(status); 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 eca34ed..1ccac6e 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.0 */ +/* 6.1 */ /* AUTHOR */ /* */ /* Chaoqiong Xiao, Microsoft Corporation */ @@ -63,6 +63,12 @@ /* DATE NAME DESCRIPTION */ /* */ /* 05-19-2020 Chaoqiong Xiao Initial Version 6.0 */ +/* 09-30-2020 Chaoqiong Xiao Modified comment(s), */ +/* verified memset and memcpy */ +/* cases, used UX prefix to */ +/* refer to TX symbols instead */ +/* of using them directly, */ +/* resulting in version 6.1 */ /* */ /**************************************************************************/ UINT _ux_device_class_cdc_ecm_activate(UX_SLAVE_CLASS_COMMAND *command) @@ -114,7 +120,7 @@ ULONG physical_address_lsw; /* Reset the endpoint buffers. */ _ux_utility_memory_set(cdc_ecm -> ux_slave_class_cdc_ecm_interrupt_endpoint -> ux_slave_endpoint_transfer_request. - ux_slave_transfer_request_data_pointer, 0, UX_SLAVE_REQUEST_DATA_MAX_LENGTH); + ux_slave_transfer_request_data_pointer, 0, UX_SLAVE_REQUEST_DATA_MAX_LENGTH); /* Use case of memset is verified. */ /* Resume the interrupt endpoint threads. */ _ux_utility_thread_resume(&cdc_ecm -> ux_slave_class_cdc_ecm_interrupt_thread); @@ -192,13 +198,13 @@ ULONG physical_address_lsw; cdc_ecm -> ux_slave_class_cdc_ecm_link_state = UX_DEVICE_CLASS_CDC_ECM_LINK_STATE_UP; /* Wake up the Interrupt thread and send a network notification to the host. */ - _ux_utility_event_flags_set(&cdc_ecm -> ux_slave_class_cdc_ecm_event_flags_group, UX_DEVICE_CLASS_CDC_ECM_NETWORK_NOTIFICATION_EVENT, TX_OR); + _ux_utility_event_flags_set(&cdc_ecm -> ux_slave_class_cdc_ecm_event_flags_group, UX_DEVICE_CLASS_CDC_ECM_NETWORK_NOTIFICATION_EVENT, UX_OR); /* 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_SLAVE_REQUEST_DATA_MAX_LENGTH); + ux_slave_transfer_request_data_pointer, 0, UX_SLAVE_REQUEST_DATA_MAX_LENGTH); /* 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_SLAVE_REQUEST_DATA_MAX_LENGTH); + ux_slave_transfer_request_data_pointer, 0, UX_SLAVE_REQUEST_DATA_MAX_LENGTH); /* Use case of memset is verified. */ /* Resume the endpoint threads. */ _ux_utility_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 d1ed308..107ad53 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 @@ -33,7 +33,7 @@ /* FUNCTION RELEASE */ /* */ /* _ux_device_class_cdc_ecm_bulkin_thread PORTABLE C */ -/* 6.0 */ +/* 6.1 */ /* AUTHOR */ /* */ /* Chaoqiong Xiao, Microsoft Corporation */ @@ -69,6 +69,12 @@ /* DATE NAME DESCRIPTION */ /* */ /* 05-19-2020 Chaoqiong Xiao Initial Version 6.0 */ +/* 09-30-2020 Chaoqiong Xiao Modified comment(s), */ +/* verified memset and memcpy */ +/* cases, used UX prefix to */ +/* refer to TX symbols instead */ +/* of using them directly, */ +/* resulting in version 6.1 */ /* */ /**************************************************************************/ VOID _ux_device_class_cdc_ecm_bulkin_thread(ULONG cdc_ecm_class) @@ -105,7 +111,7 @@ ULONG transfer_length; or until there has been a change in the device state (i.e. disconnection). */ _ux_utility_event_flags_get(&cdc_ecm -> ux_slave_class_cdc_ecm_event_flags_group, (UX_DEVICE_CLASS_CDC_ECM_NEW_BULKIN_EVENT | UX_DEVICE_CLASS_CDC_ECM_NEW_DEVICE_STATE_CHANGE_EVENT), - TX_OR_CLEAR, &actual_flags, TX_WAIT_FOREVER); + UX_OR_CLEAR, &actual_flags, UX_WAIT_FOREVER); /* Check the completion code and the actual flags returned. */ if ((actual_flags & UX_DEVICE_CLASS_CDC_ECM_NEW_DEVICE_STATE_CHANGE_EVENT) == 0) @@ -142,7 +148,7 @@ ULONG transfer_length; { /* Copy the packet in the transfer descriptor buffer. */ - _ux_utility_memory_copy(transfer_request -> ux_slave_transfer_request_data_pointer, packet_header, current_packet -> nx_packet_length); + _ux_utility_memory_copy(transfer_request -> ux_slave_transfer_request_data_pointer, packet_header, current_packet -> nx_packet_length); /* Use case of memcpy is verified. */ /* Calculate the transfer length. */ transfer_length = current_packet -> nx_packet_length; 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 958e7aa..3a70402 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 @@ -33,7 +33,7 @@ /* FUNCTION RELEASE */ /* */ /* _ux_device_class_cdc_ecm_bulkout_thread PORTABLE C */ -/* 6.0 */ +/* 6.1 */ /* AUTHOR */ /* */ /* Chaoqiong Xiao, Microsoft Corporation */ @@ -70,6 +70,11 @@ /* DATE NAME DESCRIPTION */ /* */ /* 05-19-2020 Chaoqiong Xiao Initial Version 6.0 */ +/* 09-30-2020 Chaoqiong Xiao Modified comment(s), */ +/* prefixed UX to MS_TO_TICK, */ +/* verified memset and memcpy */ +/* cases, */ +/* resulting in version 6.1 */ /* */ /**************************************************************************/ VOID _ux_device_class_cdc_ecm_bulkout_thread(ULONG cdc_ecm_class) @@ -102,7 +107,7 @@ ULONG ip_given_length; /* We can accept new reception. Get a NX Packet */ status = nx_packet_allocate(&cdc_ecm -> ux_slave_class_cdc_ecm_packet_pool, &packet, - NX_RECEIVE_PACKET, MS_TO_TICK(UX_DEVICE_CLASS_CDC_ECM_PACKET_POOL_WAIT)); + NX_RECEIVE_PACKET, UX_MS_TO_TICK(UX_DEVICE_CLASS_CDC_ECM_PACKET_POOL_WAIT)); if (status == NX_SUCCESS) { @@ -140,7 +145,7 @@ ULONG ip_given_length; packet -> nx_packet_append_ptr = packet -> nx_packet_prepend_ptr + transfer_request -> ux_slave_transfer_request_actual_length; /* Copy the received packet in the IP packet data area. */ - _ux_utility_memory_copy(packet -> nx_packet_prepend_ptr, transfer_request -> ux_slave_transfer_request_data_pointer, packet -> nx_packet_length); + _ux_utility_memory_copy(packet -> nx_packet_prepend_ptr, transfer_request -> ux_slave_transfer_request_data_pointer, packet -> nx_packet_length); /* Use case of memcpy is verified. */ /* Calculate the accurate packet length from ip header. */ if((*(packet -> nx_packet_prepend_ptr + 12) == 0x08) && 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 4306003..a8f59bb 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.0 */ +/* 6.1 */ /* AUTHOR */ /* */ /* Chaoqiong Xiao, Microsoft Corporation */ @@ -69,6 +69,12 @@ /* DATE NAME DESCRIPTION */ /* */ /* 05-19-2020 Chaoqiong Xiao Initial Version 6.0 */ +/* 09-30-2020 Chaoqiong Xiao Modified comment(s), */ +/* verified memset and memcpy */ +/* cases, used UX prefix to */ +/* refer to TX symbols instead */ +/* of using them directly, */ +/* resulting in version 6.1 */ /* */ /**************************************************************************/ UINT _ux_device_class_cdc_ecm_change(UX_SLAVE_CLASS_COMMAND *command) @@ -139,16 +145,16 @@ UX_SLAVE_ENDPOINT *endpoint; /* 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_SLAVE_REQUEST_DATA_MAX_LENGTH); + ux_slave_transfer_request_data_pointer, 0, UX_SLAVE_REQUEST_DATA_MAX_LENGTH); /* 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_SLAVE_REQUEST_DATA_MAX_LENGTH); + ux_slave_transfer_request_data_pointer, 0, UX_SLAVE_REQUEST_DATA_MAX_LENGTH); /* Use case of memset is verified. */ /* Resume the endpoint threads. */ _ux_utility_thread_resume(&cdc_ecm -> ux_slave_class_cdc_ecm_bulkout_thread); _ux_utility_thread_resume(&cdc_ecm -> ux_slave_class_cdc_ecm_bulkin_thread); /* Wake up the Interrupt thread and send a network notification to the host. */ - _ux_utility_event_flags_set(&cdc_ecm -> ux_slave_class_cdc_ecm_event_flags_group, UX_DEVICE_CLASS_CDC_ECM_NETWORK_NOTIFICATION_EVENT, TX_OR); + _ux_utility_event_flags_set(&cdc_ecm -> ux_slave_class_cdc_ecm_event_flags_group, UX_DEVICE_CLASS_CDC_ECM_NETWORK_NOTIFICATION_EVENT, UX_OR); /* If there is an activate function call it. */ if (cdc_ecm -> ux_slave_class_cdc_ecm_parameter.ux_slave_class_cdc_ecm_instance_activate != UX_NULL) @@ -173,10 +179,10 @@ UX_SLAVE_ENDPOINT *endpoint; /* Notify the thread waiting for network notification events. In this case, the event is that the link state has been switched to down. */ - _ux_utility_event_flags_set(&cdc_ecm -> ux_slave_class_cdc_ecm_event_flags_group, UX_DEVICE_CLASS_CDC_ECM_NETWORK_NOTIFICATION_EVENT, TX_OR); + _ux_utility_event_flags_set(&cdc_ecm -> ux_slave_class_cdc_ecm_event_flags_group, UX_DEVICE_CLASS_CDC_ECM_NETWORK_NOTIFICATION_EVENT, UX_OR); /* Wake up the bulk in thread so that it can clean up the xmit queue. */ - _ux_utility_event_flags_set(&cdc_ecm -> ux_slave_class_cdc_ecm_event_flags_group, UX_DEVICE_CLASS_CDC_ECM_NEW_DEVICE_STATE_CHANGE_EVENT, TX_OR); + _ux_utility_event_flags_set(&cdc_ecm -> ux_slave_class_cdc_ecm_event_flags_group, UX_DEVICE_CLASS_CDC_ECM_NEW_DEVICE_STATE_CHANGE_EVENT, UX_OR); /* If there is a deactivate function call it. */ if (cdc_ecm -> ux_slave_class_cdc_ecm_parameter.ux_slave_class_cdc_ecm_instance_deactivate != UX_NULL) diff --git a/common/usbx_device_classes/src/ux_device_class_cdc_ecm_control_request.c b/common/usbx_device_classes/src/ux_device_class_cdc_ecm_control_request.c index f4b4ce2..a42445b 100644 --- a/common/usbx_device_classes/src/ux_device_class_cdc_ecm_control_request.c +++ b/common/usbx_device_classes/src/ux_device_class_cdc_ecm_control_request.c @@ -33,7 +33,7 @@ /* FUNCTION RELEASE */ /* */ /* _ux_device_class_cdc_ecm_control_request PORTABLE C */ -/* 6.0 */ +/* 6.1 */ /* AUTHOR */ /* */ /* Chaoqiong Xiao, Microsoft Corporation */ @@ -64,6 +64,8 @@ /* 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 */ /* */ /**************************************************************************/ UINT _ux_device_class_cdc_ecm_control_request(UX_SLAVE_CLASS_COMMAND *command) diff --git a/common/usbx_device_classes/src/ux_device_class_cdc_ecm_deactivate.c b/common/usbx_device_classes/src/ux_device_class_cdc_ecm_deactivate.c index 30d5319..7f2a5f7 100644 --- a/common/usbx_device_classes/src/ux_device_class_cdc_ecm_deactivate.c +++ b/common/usbx_device_classes/src/ux_device_class_cdc_ecm_deactivate.c @@ -34,7 +34,7 @@ /* FUNCTION RELEASE */ /* */ /* _ux_device_class_cdc_ecm_deactivate PORTABLE C */ -/* 6.0 */ +/* 6.1 */ /* AUTHOR */ /* */ /* Chaoqiong Xiao, Microsoft Corporation */ @@ -67,6 +67,11 @@ /* DATE NAME DESCRIPTION */ /* */ /* 05-19-2020 Chaoqiong Xiao Initial Version 6.0 */ +/* 09-30-2020 Chaoqiong Xiao Modified comment(s), */ +/* used UX prefix to refer to */ +/* TX symbols instead of using */ +/* them directly, */ +/* resulting in version 6.1 */ /* */ /**************************************************************************/ UINT _ux_device_class_cdc_ecm_deactivate(UX_SLAVE_CLASS_COMMAND *command) @@ -115,7 +120,7 @@ UX_SLAVE_CLASS *class; _ux_device_stack_transfer_all_request_abort(cdc_ecm -> ux_slave_class_cdc_ecm_interrupt_endpoint, UX_TRANSFER_BUS_RESET); /* Wake up the bulk in thread so it will release the NetX resources used and suspend. */ - _ux_utility_event_flags_set(&cdc_ecm -> ux_slave_class_cdc_ecm_event_flags_group, UX_DEVICE_CLASS_CDC_ECM_NEW_DEVICE_STATE_CHANGE_EVENT, TX_OR); + _ux_utility_event_flags_set(&cdc_ecm -> ux_slave_class_cdc_ecm_event_flags_group, UX_DEVICE_CLASS_CDC_ECM_NEW_DEVICE_STATE_CHANGE_EVENT, UX_OR); /* If there is a deactivate function call it. */ if (cdc_ecm -> ux_slave_class_cdc_ecm_parameter.ux_slave_class_cdc_ecm_instance_deactivate != UX_NULL) diff --git a/common/usbx_device_classes/src/ux_device_class_cdc_ecm_entry.c b/common/usbx_device_classes/src/ux_device_class_cdc_ecm_entry.c index 802aaaa..1242155 100644 --- a/common/usbx_device_classes/src/ux_device_class_cdc_ecm_entry.c +++ b/common/usbx_device_classes/src/ux_device_class_cdc_ecm_entry.c @@ -33,8 +33,8 @@ /* */ /* FUNCTION RELEASE */ /* */ -/* _ux_class_device_cdc_ecm_entry PORTABLE C */ -/* 6.0 */ +/* _ux_device_class_cdc_ecm_entry PORTABLE C */ +/* 6.1 */ /* AUTHOR */ /* */ /* Chaoqiong Xiao, Microsoft Corporation */ @@ -72,6 +72,8 @@ /* 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 */ /* */ /**************************************************************************/ UINT _ux_device_class_cdc_ecm_entry(UX_SLAVE_CLASS_COMMAND *command) 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 b446066..af9ed7d 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 @@ -34,7 +34,7 @@ UX_DEVICE_CLASS_CDC_ECM_NX_ETHERNET_POOL_ALLOCSIZE_ASSERT /* FUNCTION RELEASE */ /* */ /* _ux_device_class_cdc_ecm_initialize PORTABLE C */ -/* 6.0 */ +/* 6.1 */ /* AUTHOR */ /* */ /* Chaoqiong Xiao, Microsoft Corporation */ @@ -73,6 +73,12 @@ UX_DEVICE_CLASS_CDC_ECM_NX_ETHERNET_POOL_ALLOCSIZE_ASSERT /* DATE NAME DESCRIPTION */ /* */ /* 05-19-2020 Chaoqiong Xiao Initial Version 6.0 */ +/* 09-30-2020 Chaoqiong Xiao Modified comment(s), */ +/* verified memset and memcpy */ +/* cases, used UX prefix to */ +/* refer to TX symbols instead */ +/* of using them directly, */ +/* resulting in version 6.1 */ /* */ /**************************************************************************/ UINT _ux_device_class_cdc_ecm_initialize(UX_SLAVE_CLASS_COMMAND *command) @@ -164,7 +170,7 @@ UINT status; _ux_device_class_cdc_ecm_interrupt_thread, (ULONG) (ALIGN_TYPE) class, (VOID *) cdc_ecm -> ux_slave_class_cdc_ecm_interrupt_thread_stack , UX_THREAD_STACK_SIZE, UX_THREAD_PRIORITY_CLASS, - UX_THREAD_PRIORITY_CLASS, UX_NO_TIME_SLICE, TX_DONT_START); + UX_THREAD_PRIORITY_CLASS, UX_NO_TIME_SLICE, UX_DONT_START); if (status != UX_SUCCESS) status = (UX_THREAD_ERROR); } @@ -182,7 +188,7 @@ UINT status; _ux_device_class_cdc_ecm_bulkout_thread, (ULONG) (ALIGN_TYPE) class, (VOID *) cdc_ecm -> ux_slave_class_cdc_ecm_bulkout_thread_stack , UX_THREAD_STACK_SIZE, UX_THREAD_PRIORITY_CLASS, - UX_THREAD_PRIORITY_CLASS, UX_NO_TIME_SLICE, TX_DONT_START); + UX_THREAD_PRIORITY_CLASS, UX_NO_TIME_SLICE, UX_DONT_START); if (status != UX_SUCCESS) status = (UX_THREAD_ERROR); else @@ -197,7 +203,7 @@ UINT status; _ux_device_class_cdc_ecm_bulkin_thread, (ULONG) (ALIGN_TYPE) class, (VOID *) cdc_ecm -> ux_slave_class_cdc_ecm_bulkin_thread_stack , UX_THREAD_STACK_SIZE, UX_THREAD_PRIORITY_CLASS, - UX_THREAD_PRIORITY_CLASS, UX_NO_TIME_SLICE, TX_DONT_START); + UX_THREAD_PRIORITY_CLASS, UX_NO_TIME_SLICE, UX_DONT_START); if (status != UX_SUCCESS) status = (UX_THREAD_ERROR); else @@ -224,14 +230,14 @@ UINT status; /* Copy the local node ID. */ _ux_utility_memory_copy(cdc_ecm -> ux_slave_class_cdc_ecm_local_node_id, cdc_ecm_parameter -> ux_slave_class_cdc_ecm_parameter_local_node_id, - UX_DEVICE_CLASS_CDC_ECM_NODE_ID_LENGTH); + UX_DEVICE_CLASS_CDC_ECM_NODE_ID_LENGTH); /* Use case of memcpy is verified. */ /* Copy the remote node ID. */ _ux_utility_memory_copy(cdc_ecm -> ux_slave_class_cdc_ecm_remote_node_id, cdc_ecm_parameter -> ux_slave_class_cdc_ecm_parameter_remote_node_id, - UX_DEVICE_CLASS_CDC_ECM_NODE_ID_LENGTH); + UX_DEVICE_CLASS_CDC_ECM_NODE_ID_LENGTH); /* Use case of memcpy is verified. */ /* Store the rest of the parameters as they are in the local instance. */ - _ux_utility_memory_copy(&cdc_ecm -> ux_slave_class_cdc_ecm_parameter, cdc_ecm_parameter, sizeof (UX_SLAVE_CLASS_CDC_ECM_PARAMETER)); + _ux_utility_memory_copy(&cdc_ecm -> ux_slave_class_cdc_ecm_parameter, cdc_ecm_parameter, sizeof (UX_SLAVE_CLASS_CDC_ECM_PARAMETER)); /* Use case of memcpy is verified. */ return(UX_SUCCESS); } diff --git a/common/usbx_device_classes/src/ux_device_class_cdc_ecm_interrupt_thread.c b/common/usbx_device_classes/src/ux_device_class_cdc_ecm_interrupt_thread.c index 8ca7bb8..2d80492 100644 --- a/common/usbx_device_classes/src/ux_device_class_cdc_ecm_interrupt_thread.c +++ b/common/usbx_device_classes/src/ux_device_class_cdc_ecm_interrupt_thread.c @@ -34,7 +34,7 @@ /* FUNCTION RELEASE */ /* */ /* _ux_device_class_cdc_ecm_interrupt_thread PORTABLE C */ -/* 6.0 */ +/* 6.1 */ /* AUTHOR */ /* */ /* Chaoqiong Xiao, Microsoft Corporation */ @@ -68,6 +68,11 @@ /* DATE NAME DESCRIPTION */ /* */ /* 05-19-2020 Chaoqiong Xiao Initial Version 6.0 */ +/* 09-30-2020 Chaoqiong Xiao Modified comment(s), */ +/* used UX prefix to refer to */ +/* TX symbols instead of using */ +/* them directly, */ +/* resulting in version 6.1 */ /* */ /**************************************************************************/ VOID _ux_device_class_cdc_ecm_interrupt_thread(ULONG cdc_ecm_class) @@ -106,7 +111,7 @@ UCHAR *notification_buffer; on the interrupt pipe frequency or a change in the idle state forces us to send an empty report. */ _ux_utility_event_flags_get(&cdc_ecm -> ux_slave_class_cdc_ecm_event_flags_group, UX_DEVICE_CLASS_CDC_ECM_NETWORK_NOTIFICATION_EVENT, - TX_OR_CLEAR, &actual_flags, TX_WAIT_FOREVER); + UX_OR_CLEAR, &actual_flags, UX_WAIT_FOREVER); /* Build the Network Notification response. */ notification_buffer = transfer_request -> ux_slave_transfer_request_data_pointer; 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 217b92b..a7e8b45 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.0 */ +/* 6.1 */ /* AUTHOR */ /* */ /* Chaoqiong Xiao, Microsoft Corporation */ @@ -70,6 +70,8 @@ /* 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 */ /* */ /**************************************************************************/ UINT _ux_device_class_cdc_ecm_uninitialize(UX_SLAVE_CLASS_COMMAND *command) diff --git a/common/usbx_device_classes/src/ux_device_class_cdc_ecm_write.c b/common/usbx_device_classes/src/ux_device_class_cdc_ecm_write.c index 4e2293a..c9bca45 100644 --- a/common/usbx_device_classes/src/ux_device_class_cdc_ecm_write.c +++ b/common/usbx_device_classes/src/ux_device_class_cdc_ecm_write.c @@ -34,7 +34,7 @@ /* FUNCTION RELEASE */ /* */ /* _ux_device_class_cdc_ecm_write PORTABLE C */ -/* 6.0 */ +/* 6.1 */ /* AUTHOR */ /* */ /* Chaoqiong Xiao, Microsoft Corporation */ @@ -68,6 +68,11 @@ /* DATE NAME DESCRIPTION */ /* */ /* 05-19-2020 Chaoqiong Xiao Initial Version 6.0 */ +/* 09-30-2020 Chaoqiong Xiao Modified comment(s), */ +/* used UX prefix to refer to */ +/* TX symbols instead of using */ +/* them directly, */ +/* resulting in version 6.1 */ /* */ /**************************************************************************/ UINT _ux_device_class_cdc_ecm_write(VOID *cdc_ecm_class, NX_PACKET *packet) @@ -107,7 +112,7 @@ UX_SLAVE_CLASS_CDC_ECM *cdc_ecm; _ux_utility_mutex_off(&cdc_ecm -> ux_slave_class_cdc_ecm_mutex); /* Set an event to wake up the bulkin thread. */ - _ux_utility_event_flags_set(&cdc_ecm -> ux_slave_class_cdc_ecm_event_flags_group, UX_DEVICE_CLASS_CDC_ECM_NEW_BULKIN_EVENT, TX_OR); + _ux_utility_event_flags_set(&cdc_ecm -> ux_slave_class_cdc_ecm_event_flags_group, UX_DEVICE_CLASS_CDC_ECM_NEW_BULKIN_EVENT, UX_OR); /* Packet successfully added. Return success. */ status = UX_SUCCESS; diff --git a/common/usbx_device_classes/src/ux_device_class_dfu_activate.c b/common/usbx_device_classes/src/ux_device_class_dfu_activate.c index 1ac1c50..259a6a4 100644 --- a/common/usbx_device_classes/src/ux_device_class_dfu_activate.c +++ b/common/usbx_device_classes/src/ux_device_class_dfu_activate.c @@ -33,7 +33,7 @@ /* FUNCTION RELEASE */ /* */ /* _ux_device_class_dfu_activate PORTABLE C */ -/* 6.0 */ +/* 6.1 */ /* AUTHOR */ /* */ /* Chaoqiong Xiao, Microsoft Corporation */ @@ -69,6 +69,8 @@ /* 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 */ /* */ /**************************************************************************/ UINT _ux_device_class_dfu_activate(UX_SLAVE_CLASS_COMMAND *command) diff --git a/common/usbx_device_classes/src/ux_device_class_dfu_control_request.c b/common/usbx_device_classes/src/ux_device_class_dfu_control_request.c index ff5b8db..ebf023b 100644 --- a/common/usbx_device_classes/src/ux_device_class_dfu_control_request.c +++ b/common/usbx_device_classes/src/ux_device_class_dfu_control_request.c @@ -34,7 +34,7 @@ /* FUNCTION RELEASE */ /* */ /* _ux_device_class_dfu_control_request PORTABLE C */ -/* 6.0 */ +/* 6.1 */ /* AUTHOR */ /* */ /* Chaoqiong Xiao, Microsoft Corporation */ @@ -66,6 +66,11 @@ /* DATE NAME DESCRIPTION */ /* */ /* 05-19-2020 Chaoqiong Xiao Initial Version 6.0 */ +/* 09-30-2020 Chaoqiong Xiao Modified comment(s), */ +/* used UX prefix to refer to */ +/* TX symbols instead of using */ +/* them directly, */ +/* resulting in version 6.1 */ /* */ /**************************************************************************/ UINT _ux_device_class_dfu_control_request(UX_SLAVE_CLASS_COMMAND *command) @@ -120,14 +125,14 @@ ULONG media_status; { /* Wake up the DFU thread and send a detach request.. */ - _ux_utility_event_flags_set(&dfu -> ux_slave_class_dfu_event_flags_group, UX_DEVICE_CLASS_DFU_THREAD_EVENT_DISCONNECT, TX_OR); + _ux_utility_event_flags_set(&dfu -> ux_slave_class_dfu_event_flags_group, UX_DEVICE_CLASS_DFU_THREAD_EVENT_DISCONNECT, UX_OR); } else { /* We expect the host to issue a reset. Arm a timer in the DFU thread. */ - _ux_utility_event_flags_set(&dfu -> ux_slave_class_dfu_event_flags_group, UX_DEVICE_CLASS_DFU_THREAD_EVENT_WAIT_RESET, TX_OR); + _ux_utility_event_flags_set(&dfu -> ux_slave_class_dfu_event_flags_group, UX_DEVICE_CLASS_DFU_THREAD_EVENT_WAIT_RESET, UX_OR); } @@ -541,7 +546,7 @@ ULONG media_status; { /* Wake up the DFU thread and send a detach request.. */ - _ux_utility_event_flags_set(&dfu -> ux_slave_class_dfu_event_flags_group, UX_DEVICE_CLASS_DFU_THREAD_EVENT_DISCONNECT, TX_OR); + _ux_utility_event_flags_set(&dfu -> ux_slave_class_dfu_event_flags_group, UX_DEVICE_CLASS_DFU_THREAD_EVENT_DISCONNECT, UX_OR); } diff --git a/common/usbx_device_classes/src/ux_device_class_dfu_deactivate.c b/common/usbx_device_classes/src/ux_device_class_dfu_deactivate.c index f43f0a1..96132e2 100644 --- a/common/usbx_device_classes/src/ux_device_class_dfu_deactivate.c +++ b/common/usbx_device_classes/src/ux_device_class_dfu_deactivate.c @@ -34,7 +34,7 @@ /* FUNCTION RELEASE */ /* */ /* _ux_device_class_dfu_deactivate PORTABLE C */ -/* 6.0 */ +/* 6.1 */ /* AUTHOR */ /* */ /* Chaoqiong Xiao, Microsoft Corporation */ @@ -64,6 +64,8 @@ /* 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 */ /* */ /**************************************************************************/ UINT _ux_device_class_dfu_deactivate(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 9e76da3..2dd1333 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 @@ -33,8 +33,8 @@ /* */ /* FUNCTION RELEASE */ /* */ -/* _ux_class_device_dfu_entry PORTABLE C */ -/* 6.0 */ +/* _ux_device_class_dfu_entry PORTABLE C */ +/* 6.1 */ /* AUTHOR */ /* */ /* Chaoqiong Xiao, Microsoft Corporation */ @@ -70,6 +70,8 @@ /* 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 */ /* */ /**************************************************************************/ 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 f65148f..165fdf4 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 @@ -33,7 +33,7 @@ /* FUNCTION RELEASE */ /* */ /* _ux_device_class_dfu_initialize PORTABLE C */ -/* 6.0 */ +/* 6.1 */ /* AUTHOR */ /* */ /* Chaoqiong Xiao, Microsoft Corporation */ @@ -68,6 +68,11 @@ /* DATE NAME DESCRIPTION */ /* */ /* 05-19-2020 Chaoqiong Xiao Initial Version 6.0 */ +/* 09-30-2020 Chaoqiong Xiao Modified comment(s), */ +/* used UX prefix to refer to */ +/* TX symbols instead of using */ +/* them directly, */ +/* resulting in version 6.1 */ /* */ /**************************************************************************/ UINT _ux_device_class_dfu_initialize(UX_SLAVE_CLASS_COMMAND *command) @@ -183,7 +188,7 @@ ULONG descriptor_length; _ux_device_class_dfu_thread, (ULONG) (ALIGN_TYPE) class, (VOID *) dfu -> ux_slave_class_dfu_thread_stack, UX_THREAD_STACK_SIZE, UX_THREAD_PRIORITY_CLASS, - UX_THREAD_PRIORITY_CLASS, UX_NO_TIME_SLICE, TX_AUTO_START); + UX_THREAD_PRIORITY_CLASS, UX_NO_TIME_SLICE, UX_AUTO_START); /* Check the creation of this thread. */ if (status != UX_SUCCESS) diff --git a/common/usbx_device_classes/src/ux_device_class_dfu_thread.c b/common/usbx_device_classes/src/ux_device_class_dfu_thread.c index c6fbbfc..f18b524 100644 --- a/common/usbx_device_classes/src/ux_device_class_dfu_thread.c +++ b/common/usbx_device_classes/src/ux_device_class_dfu_thread.c @@ -33,7 +33,7 @@ /* FUNCTION RELEASE */ /* */ /* _ux_device_class_dfu_thread PORTABLE C */ -/* 6.0 */ +/* 6.1 */ /* AUTHOR */ /* */ /* Chaoqiong Xiao, Microsoft Corporation */ @@ -67,6 +67,11 @@ /* DATE NAME DESCRIPTION */ /* */ /* 05-19-2020 Chaoqiong Xiao Initial Version 6.0 */ +/* 09-30-2020 Chaoqiong Xiao Modified comment(s), */ +/* used UX prefix to refer to */ +/* TX symbols instead of using */ +/* them directly, */ +/* resulting in version 6.1 */ /* */ /**************************************************************************/ VOID _ux_device_class_dfu_thread(ULONG dfu_class) @@ -92,7 +97,7 @@ ULONG actual_flags; /* Wait until we have a event sent by the application. */ status = _ux_utility_event_flags_get(&dfu -> ux_slave_class_dfu_event_flags_group, (UX_DEVICE_CLASS_DFU_THREAD_EVENT_DISCONNECT | UX_DEVICE_CLASS_DFU_THREAD_EVENT_WAIT_RESET), - TX_OR_CLEAR, &actual_flags, TX_WAIT_FOREVER); + UX_OR_CLEAR, &actual_flags, UX_WAIT_FOREVER); /* Check the completion code and the actual flags returned. */ if (status == UX_SUCCESS) 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 fcb560a..749b7de 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.0 */ +/* 6.1 */ /* AUTHOR */ /* */ /* Chaoqiong Xiao, Microsoft Corporation */ @@ -63,6 +63,8 @@ /* 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 */ /* */ /**************************************************************************/ UINT _ux_device_class_hid_activate(UX_SLAVE_CLASS_COMMAND *command) diff --git a/common/usbx_device_classes/src/ux_device_class_hid_control_request.c b/common/usbx_device_classes/src/ux_device_class_hid_control_request.c index 64d1b1f..8df4d84 100644 --- a/common/usbx_device_classes/src/ux_device_class_hid_control_request.c +++ b/common/usbx_device_classes/src/ux_device_class_hid_control_request.c @@ -33,8 +33,8 @@ /* */ /* FUNCTION RELEASE */ /* */ -/* _ux_device_class_hid_control_request PORTABLE C */ -/* 6.0 */ +/* _ux_device_class_hid_control_request PORTABLE C */ +/* 6.1 */ /* AUTHOR */ /* */ /* Chaoqiong Xiao, Microsoft Corporation */ @@ -68,6 +68,12 @@ /* DATE NAME DESCRIPTION */ /* */ /* 05-19-2020 Chaoqiong Xiao Initial Version 6.0 */ +/* 09-30-2020 Chaoqiong Xiao Modified comment(s), */ +/* prefixed UX to MS_TO_TICK, */ +/* used UX prefix to refer to */ +/* TX symbols instead of using */ +/* them directly, */ +/* resulting in version 6.1 */ /* */ /**************************************************************************/ UINT _ux_device_class_hid_control_request(UX_SLAVE_CLASS_COMMAND *command) @@ -154,20 +160,20 @@ UX_SLAVE_CLASS_HID *hid; { /* No need to repeat last report, no timeout. */ - hid -> ux_device_class_hid_event_wait_timeout = TX_WAIT_FOREVER; + hid -> ux_device_class_hid_event_wait_timeout = UX_WAIT_FOREVER; } else { /* Calculate the timeout value. Weighted as 4ms. */ - hid -> ux_device_class_hid_event_wait_timeout = MS_TO_TICK((ULONG)duration << 2u); + hid -> ux_device_class_hid_event_wait_timeout = UX_MS_TO_TICK((ULONG)duration << 2u); /* Be sure to have a timeout that is not zero. */ if (hid -> ux_device_class_hid_event_wait_timeout == 0) hid -> ux_device_class_hid_event_wait_timeout ++; /* Set an event to wake up the interrupt thread. */ - _ux_utility_event_flags_set(&hid -> ux_device_class_hid_event_flags_group, UX_DEVICE_CLASS_HID_NEW_IDLE_RATE, TX_OR); + _ux_utility_event_flags_set(&hid -> ux_device_class_hid_event_flags_group, UX_DEVICE_CLASS_HID_NEW_IDLE_RATE, UX_OR); } } } diff --git a/common/usbx_device_classes/src/ux_device_class_hid_deactivate.c b/common/usbx_device_classes/src/ux_device_class_hid_deactivate.c index 4f4892d..0e5a0af 100644 --- a/common/usbx_device_classes/src/ux_device_class_hid_deactivate.c +++ b/common/usbx_device_classes/src/ux_device_class_hid_deactivate.c @@ -34,7 +34,7 @@ /* FUNCTION RELEASE */ /* */ /* _ux_device_class_hid_deactivate PORTABLE C */ -/* 6.0 */ +/* 6.1 */ /* AUTHOR */ /* */ /* Chaoqiong Xiao, Microsoft Corporation */ @@ -64,6 +64,8 @@ /* 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 */ /* */ /**************************************************************************/ UINT _ux_device_class_hid_deactivate(UX_SLAVE_CLASS_COMMAND *command) diff --git a/common/usbx_device_classes/src/ux_device_class_hid_descriptor_send.c b/common/usbx_device_classes/src/ux_device_class_hid_descriptor_send.c index 61b41f9..c7fcc32 100644 --- a/common/usbx_device_classes/src/ux_device_class_hid_descriptor_send.c +++ b/common/usbx_device_classes/src/ux_device_class_hid_descriptor_send.c @@ -32,10 +32,10 @@ /**************************************************************************/ /* */ -/* FUNCTION RELEASE */ +/* FUNCTION RELEASE */ /* */ -/* _ux_device_class_hid_descriptor_send PORTABLE C */ -/* 6.0 */ +/* _ux_device_class_hid_descriptor_send PORTABLE C */ +/* 6.1 */ /* AUTHOR */ /* */ /* Chaoqiong Xiao, Microsoft Corporation */ @@ -70,6 +70,10 @@ /* DATE NAME DESCRIPTION */ /* */ /* 05-19-2020 Chaoqiong Xiao Initial Version 6.0 */ +/* 09-30-2020 Chaoqiong Xiao Modified comment(s), */ +/* verified memset and memcpy */ +/* cases, */ +/* resulting in version 6.1 */ /* */ /**************************************************************************/ UINT _ux_device_class_hid_descriptor_send(UX_SLAVE_CLASS_HID *hid, ULONG descriptor_type, @@ -140,9 +144,24 @@ ULONG length; else length = host_length; + /* Check buffer length, since descriptor length may exceed buffer... */ + if (length > UX_SLAVE_REQUEST_CONTROL_MAX_LENGTH) + { + + /* Error trap. */ + _ux_system_error_handler(UX_SYSTEM_LEVEL_THREAD, UX_SYSTEM_CONTEXT_CLASS, UX_MEMORY_INSUFFICIENT); + + /* If trace is enabled, insert this event into the trace buffer. */ + UX_TRACE_IN_LINE_INSERT(UX_TRACE_ERROR, UX_MEMORY_INSUFFICIENT, hid, 0, 0, UX_TRACE_ERRORS, 0, 0) + + /* Stall the endpoint. */ + status = dcd -> ux_slave_dcd_function(dcd, UX_DCD_STALL_ENDPOINT, endpoint); + break; + } + /* Copy the device descriptor into the transfer request memory. */ _ux_utility_memory_copy(transfer_request -> ux_slave_transfer_request_data_pointer, - device_framework, length); + device_framework, length); /* Use case of memcpy is verified. */ /* We can return the configuration descriptor. */ status = _ux_device_stack_transfer_request(transfer_request, length, host_length); @@ -189,7 +208,7 @@ ULONG length; /* Copy the device descriptor into the transfer request memory. */ _ux_utility_memory_copy(transfer_request -> ux_slave_transfer_request_data_pointer, - hid -> ux_device_class_hid_report_address, length); + hid -> ux_device_class_hid_report_address, length); /* Use case of memcpy is verified. */ /* We can return the report descriptor. */ status = _ux_device_stack_transfer_request(transfer_request, length, host_length); 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 9a99766..384b8c2 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 @@ -33,8 +33,8 @@ /* */ /* FUNCTION RELEASE */ /* */ -/* _ux_class_device_hid_entry PORTABLE C */ -/* 6.0 */ +/* _ux_device_class_hid_entry PORTABLE C */ +/* 6.1 */ /* AUTHOR */ /* */ /* Chaoqiong Xiao, Microsoft Corporation */ @@ -71,6 +71,8 @@ /* 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 */ /* */ /**************************************************************************/ 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 ab1ce83..8d4308a 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_get PORTABLE C */ -/* 6.0 */ +/* 6.1 */ /* AUTHOR */ /* */ /* Chaoqiong Xiao, Microsoft Corporation */ @@ -65,6 +65,10 @@ /* DATE NAME DESCRIPTION */ /* */ /* 05-19-2020 Chaoqiong Xiao Initial Version 6.0 */ +/* 09-30-2020 Chaoqiong Xiao Modified comment(s), */ +/* verified memset and memcpy */ +/* cases, */ +/* resulting in version 6.1 */ /* */ /**************************************************************************/ UINT _ux_device_class_hid_event_get(UX_SLAVE_CLASS_HID *hid, @@ -93,11 +97,15 @@ UX_SLAVE_DEVICE *device; /* There is an event to report, get the current pointer to the event. */ current_hid_event = hid -> ux_device_class_hid_event_array_tail; - + + /* Keep the event data length inside buffer area. */ + if (current_hid_event -> ux_device_class_hid_event_length > UX_DEVICE_CLASS_HID_EVENT_BUFFER_LENGTH) + current_hid_event -> ux_device_class_hid_event_length = UX_DEVICE_CLASS_HID_EVENT_BUFFER_LENGTH; + /* fill in the event structure from the user. */ hid_event -> ux_device_class_hid_event_length = current_hid_event -> ux_device_class_hid_event_length; _ux_utility_memory_copy(hid_event -> ux_device_class_hid_event_buffer, current_hid_event -> ux_device_class_hid_event_buffer, - current_hid_event -> ux_device_class_hid_event_length); + current_hid_event -> ux_device_class_hid_event_length); /* Use case of memcpy is verified. */ /* Adjust the tail pointer. Check if we are at the end. */ if ((current_hid_event + 1) == hid -> ux_device_class_hid_event_array_end) 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 ce83453..988a074 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.0 */ +/* 6.1 */ /* AUTHOR */ /* */ /* Chaoqiong Xiao, Microsoft Corporation */ @@ -67,6 +67,12 @@ /* DATE NAME DESCRIPTION */ /* */ /* 05-19-2020 Chaoqiong Xiao Initial Version 6.0 */ +/* 09-30-2020 Chaoqiong Xiao Modified comment(s), */ +/* verified memset and memcpy */ +/* cases, used UX prefix to */ +/* refer to TX symbols instead */ +/* of using them directly, */ +/* resulting in version 6.1 */ /* */ /**************************************************************************/ UINT _ux_device_class_hid_event_set(UX_SLAVE_CLASS_HID *hid, @@ -132,7 +138,7 @@ UX_SLAVE_CLASS_HID_EVENT *next_hid_event; /* Store the data itself. */ _ux_utility_memory_copy(current_hid_event -> ux_device_class_hid_event_buffer + 1, hid_event -> ux_device_class_hid_event_buffer, - hid_event -> ux_device_class_hid_event_length); + hid_event -> ux_device_class_hid_event_length); /* Use case of memcpy is verified. */ /* fill in the event structure from the user. */ current_hid_event -> ux_device_class_hid_event_length = hid_event -> ux_device_class_hid_event_length + 1; @@ -142,14 +148,14 @@ UX_SLAVE_CLASS_HID_EVENT *next_hid_event; /* No report ID to consider. */ _ux_utility_memory_copy(current_hid_event -> ux_device_class_hid_event_buffer, hid_event -> ux_device_class_hid_event_buffer, - hid_event -> ux_device_class_hid_event_length); + hid_event -> ux_device_class_hid_event_length); /* Use case of memcpy is verified. */ /* fill in the event structure from the user. */ current_hid_event -> ux_device_class_hid_event_length = hid_event -> ux_device_class_hid_event_length; } /* Set an event to wake up the interrupt thread. */ - _ux_utility_event_flags_set(&hid -> ux_device_class_hid_event_flags_group, UX_DEVICE_CLASS_HID_NEW_EVENT, TX_OR); + _ux_utility_event_flags_set(&hid -> ux_device_class_hid_event_flags_group, UX_DEVICE_CLASS_HID_NEW_EVENT, UX_OR); /* Return event status to the user. */ return(UX_SUCCESS); 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 9141a98..7296277 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.0 */ +/* 6.1 */ /* AUTHOR */ /* */ /* Chaoqiong Xiao, Microsoft Corporation */ @@ -69,6 +69,11 @@ /* DATE NAME DESCRIPTION */ /* */ /* 05-19-2020 Chaoqiong Xiao Initial Version 6.0 */ +/* 09-30-2020 Chaoqiong Xiao Modified comment(s), */ +/* used UX prefix to refer to */ +/* TX symbols instead of using */ +/* them directly, */ +/* resulting in version 6.1 */ /* */ /**************************************************************************/ UINT _ux_device_class_hid_initialize(UX_SLAVE_CLASS_COMMAND *command) @@ -109,7 +114,7 @@ UINT status = UX_SUCCESS; _ux_device_class_hid_interrupt_thread, (ULONG) (ALIGN_TYPE) class, (VOID *) class -> ux_slave_class_thread_stack, UX_THREAD_STACK_SIZE, UX_THREAD_PRIORITY_CLASS, - UX_THREAD_PRIORITY_CLASS, UX_NO_TIME_SLICE, TX_DONT_START); + UX_THREAD_PRIORITY_CLASS, UX_NO_TIME_SLICE, UX_DONT_START); /* Check the creation of this thread. */ if (status == UX_SUCCESS) @@ -147,7 +152,7 @@ UINT status = UX_SUCCESS; hid -> ux_slave_class_hid_instance_deactivate = hid_parameter -> ux_slave_class_hid_instance_deactivate; /* By default no event wait timeout. */ - hid -> ux_device_class_hid_event_wait_timeout = TX_WAIT_FOREVER; + hid -> ux_device_class_hid_event_wait_timeout = UX_WAIT_FOREVER; /* Create a event flag group for the hid class to synchronize with the event interrupt thread. */ status = _ux_utility_event_flags_create(&hid -> ux_device_class_hid_event_flags_group, "ux_device_class_hid_event_flag"); 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 4274a06..cfc792d 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 @@ -34,7 +34,7 @@ /* FUNCTION RELEASE */ /* */ /* _ux_device_class_hid_interrupt_thread PORTABLE C */ -/* 6.0 */ +/* 6.1 */ /* AUTHOR */ /* */ /* Chaoqiong Xiao, Microsoft Corporation */ @@ -69,6 +69,12 @@ /* DATE NAME DESCRIPTION */ /* */ /* 05-19-2020 Chaoqiong Xiao Initial Version 6.0 */ +/* 09-30-2020 Chaoqiong Xiao Modified comment(s), */ +/* verified memset and memcpy */ +/* cases, used UX prefix to */ +/* refer to TX symbols instead */ +/* of using them directly, */ +/* resulting in version 6.1 */ /* */ /**************************************************************************/ VOID _ux_device_class_hid_interrupt_thread(ULONG hid_class) @@ -107,11 +113,11 @@ ULONG actual_flags; /* Wait until we have a event sent by the application or a change in the idle state to send last or empty report. */ status = _ux_utility_event_flags_get(&hid -> ux_device_class_hid_event_flags_group, - UX_DEVICE_CLASS_HID_EVENTS_MASK, TX_OR_CLEAR, &actual_flags, + UX_DEVICE_CLASS_HID_EVENTS_MASK, UX_OR_CLEAR, &actual_flags, hid -> ux_device_class_hid_event_wait_timeout); /* If there is no event, check if we have timeout defined. */ - if (status == TX_NO_EVENTS) + if (status == UX_NO_EVENTS) { /* There is no event exists on timeout, insert last. */ @@ -122,14 +128,14 @@ ULONG actual_flags; hid_event.ux_device_class_hid_event_length = transfer_request_in -> ux_slave_transfer_request_requested_length; _ux_utility_memory_copy(hid_event.ux_device_class_hid_event_buffer, transfer_request_in -> ux_slave_transfer_request_data_pointer, - hid_event.ux_device_class_hid_event_length); + hid_event.ux_device_class_hid_event_length); /* Use case of memcpy is verified. */ } else { hid_event.ux_device_class_hid_event_report_id = 0; hid_event.ux_device_class_hid_event_length = transfer_request_in -> ux_slave_transfer_request_endpoint -> ux_slave_endpoint_descriptor.wMaxPacketSize & 0x7FF; _ux_utility_memory_set(hid_event.ux_device_class_hid_event_buffer, 0, - hid_event.ux_device_class_hid_event_length); + hid_event.ux_device_class_hid_event_length); /* Use case of memset is verified. */ } _ux_device_class_hid_event_set(hid, &hid_event); @@ -157,7 +163,7 @@ ULONG actual_flags; buffer = transfer_request_in -> ux_slave_transfer_request_data_pointer; /* Copy the event buffer into the target buffer. */ - _ux_utility_memory_copy(buffer, hid_event.ux_device_class_hid_event_buffer, hid_event.ux_device_class_hid_event_length); + _ux_utility_memory_copy(buffer, hid_event.ux_device_class_hid_event_buffer, hid_event.ux_device_class_hid_event_length); /* Use case of memcpy is verified. */ /* Send the request to the device controller. */ status = _ux_device_stack_transfer_request(transfer_request_in, hid_event.ux_device_class_hid_event_length, 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 4782148..44d9910 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 @@ -32,10 +32,10 @@ /**************************************************************************/ /* */ -/* FUNCTION RELEASE */ +/* FUNCTION RELEASE */ /* */ -/* _ux_device_class_hid_report_set PORTABLE C */ -/* 6.0 */ +/* _ux_device_class_hid_report_get PORTABLE C */ +/* 6.1 */ /* AUTHOR */ /* */ /* Chaoqiong Xiao, Microsoft Corporation */ @@ -71,6 +71,10 @@ /* DATE NAME DESCRIPTION */ /* */ /* 05-19-2020 Chaoqiong Xiao Initial Version 6.0 */ +/* 09-30-2020 Chaoqiong Xiao Modified comment(s), */ +/* verified memset and memcpy */ +/* cases, */ +/* resulting in version 6.1 */ /* */ /**************************************************************************/ UINT _ux_device_class_hid_report_get(UX_SLAVE_CLASS_HID *hid, ULONG descriptor_type, @@ -141,12 +145,14 @@ UINT status = UX_ERROR; hid_event_length = host_length; else hid_event_length = hid_event.ux_device_class_hid_event_length; + if (hid_event_length > UX_SLAVE_REQUEST_CONTROL_MAX_LENGTH) + hid_event_length = UX_SLAVE_REQUEST_CONTROL_MAX_LENGTH; /* First reset it. */ - _ux_utility_memory_set(buffer, 0, hid_event_length); + _ux_utility_memory_set(buffer, 0, hid_event_length); /* Use case of memset is verified. */ /* Copy the event buffer into the target buffer. */ - _ux_utility_memory_copy(buffer, hid_event.ux_device_class_hid_event_buffer, hid_event_length); + _ux_utility_memory_copy(buffer, hid_event.ux_device_class_hid_event_buffer, hid_event_length); /* Use case of memcpy is verified. */ } else { @@ -160,7 +166,7 @@ UINT status = UX_ERROR; hid_event_length = UX_SLAVE_REQUEST_CONTROL_MAX_LENGTH; /* Reset it. */ - _ux_utility_memory_set(buffer, 0, hid_event_length); + _ux_utility_memory_set(buffer, 0, hid_event_length); /* Use case of memset is verified. */ } /* We can send the report. */ 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 69ec450..41b1373 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 @@ -32,10 +32,10 @@ /**************************************************************************/ /* */ -/* FUNCTION RELEASE */ +/* FUNCTION RELEASE */ /* */ -/* _ux_device_class_hid_report_set PORTABLE C */ -/* 6.0 */ +/* _ux_device_class_hid_report_set PORTABLE C */ +/* 6.1 */ /* AUTHOR */ /* */ /* Chaoqiong Xiao, Microsoft Corporation */ @@ -69,6 +69,10 @@ /* DATE NAME DESCRIPTION */ /* */ /* 05-19-2020 Chaoqiong Xiao Initial Version 6.0 */ +/* 09-30-2020 Chaoqiong Xiao Modified comment(s), */ +/* verified memset and memcpy */ +/* cases, */ +/* resulting in version 6.1 */ /* */ /**************************************************************************/ UINT _ux_device_class_hid_report_set(UX_SLAVE_CLASS_HID *hid, ULONG descriptor_type, @@ -132,7 +136,7 @@ UCHAR *hid_buffer; /* Now we can safely copy the payload. */ _ux_utility_memory_copy(hid_event.ux_device_class_hid_event_buffer, hid_buffer, - hid_event.ux_device_class_hid_event_length); + hid_event.ux_device_class_hid_event_length); /* Use case of memcpy is verified. */ /* If there is a callback defined by the application, send the hid event to it. */ if (hid -> ux_device_class_hid_callback != UX_NULL) 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 3477161..3086331 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.0 */ +/* 6.1 */ /* AUTHOR */ /* */ /* Chaoqiong Xiao, Microsoft Corporation */ @@ -66,6 +66,8 @@ /* 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 */ /* */ /**************************************************************************/ 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 06a1a02..e24938f 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.0 */ +/* 6.1 */ /* AUTHOR */ /* */ /* Chaoqiong Xiao, Microsoft Corporation */ @@ -63,6 +63,8 @@ /* 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 */ /* */ /**************************************************************************/ UINT _ux_device_class_pima_activate(UX_SLAVE_CLASS_COMMAND *command) diff --git a/common/usbx_device_classes/src/ux_device_class_pima_control_request.c b/common/usbx_device_classes/src/ux_device_class_pima_control_request.c index 65a3172..b6cc24f 100644 --- a/common/usbx_device_classes/src/ux_device_class_pima_control_request.c +++ b/common/usbx_device_classes/src/ux_device_class_pima_control_request.c @@ -33,8 +33,8 @@ /* */ /* FUNCTION RELEASE */ /* */ -/* _ux_device_class_pima_control_request PORTABLE C */ -/* 6.0 */ +/* _ux_device_class_pima_control_request PORTABLE C */ +/* 6.1 */ /* AUTHOR */ /* */ /* Chaoqiong Xiao, Microsoft Corporation */ @@ -68,6 +68,8 @@ /* 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 */ /* */ /**************************************************************************/ UINT _ux_device_class_pima_control_request(UX_SLAVE_CLASS_COMMAND *command) diff --git a/common/usbx_device_classes/src/ux_device_class_pima_data.c b/common/usbx_device_classes/src/ux_device_class_pima_data.c index 79eeb77..b29a98c 100644 --- a/common/usbx_device_classes/src/ux_device_class_pima_data.c +++ b/common/usbx_device_classes/src/ux_device_class_pima_data.c @@ -33,8 +33,8 @@ /* */ /* FUNCTION RELEASE */ /* */ -/* _ux_class_device_pima_data PORTABLE C */ -/* 6.0 */ +/* ux_device_class_pima_data.c PORTABLE C */ +/* 6.1 */ /* AUTHOR */ /* */ /* Chaoqiong Xiao, Microsoft Corporation */ @@ -60,6 +60,8 @@ /* 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 */ /* */ /**************************************************************************/ 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 63530ef..48a80ca 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.0 */ +/* 6.1 */ /* AUTHOR */ /* */ /* Chaoqiong Xiao, Microsoft Corporation */ @@ -64,6 +64,8 @@ /* 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 */ /* */ /**************************************************************************/ UINT _ux_device_class_pima_deactivate(UX_SLAVE_CLASS_COMMAND *command) 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 c9decae..7794f28 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 @@ -35,7 +35,7 @@ /* FUNCTION RELEASE */ /* */ /* _ux_device_class_pima_device_info_send PORTABLE C */ -/* 6.0 */ +/* 6.1 */ /* AUTHOR */ /* */ /* Chaoqiong Xiao, Microsoft Corporation */ @@ -70,6 +70,8 @@ /* 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 */ /* */ /**************************************************************************/ 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_desc_get.c b/common/usbx_device_classes/src/ux_device_class_pima_device_prop_desc_get.c index 173e517..c6d770d 100644 --- a/common/usbx_device_classes/src/ux_device_class_pima_device_prop_desc_get.c +++ b/common/usbx_device_classes/src/ux_device_class_pima_device_prop_desc_get.c @@ -35,7 +35,7 @@ /* FUNCTION RELEASE */ /* */ /* _ux_device_class_pima_device_prop_desc_get PORTABLE C */ -/* 6.0 */ +/* 6.1 */ /* AUTHOR */ /* */ /* Chaoqiong Xiao, Microsoft Corporation */ @@ -72,6 +72,10 @@ /* DATE NAME DESCRIPTION */ /* */ /* 05-19-2020 Chaoqiong Xiao Initial Version 6.0 */ +/* 09-30-2020 Chaoqiong Xiao Modified comment(s), */ +/* verified memset and memcpy */ +/* cases, */ +/* resulting in version 6.1 */ /* */ /**************************************************************************/ UINT _ux_device_class_pima_device_prop_desc_get(UX_SLAVE_CLASS_PIMA *pima, @@ -132,7 +136,7 @@ UCHAR *device_property_desc_dataset; } /* Copy the property dataset into the local buffer. */ - _ux_utility_memory_copy(pima_data_buffer + UX_DEVICE_CLASS_PIMA_DATA_HEADER_SIZE, device_property_desc_dataset, device_property_desc_dataset_length); + _ux_utility_memory_copy(pima_data_buffer + UX_DEVICE_CLASS_PIMA_DATA_HEADER_SIZE, device_property_desc_dataset, device_property_desc_dataset_length); /* Use case of memcpy is verified. */ /* Add the header size to the payload. */ device_property_desc_dataset_length += UX_DEVICE_CLASS_PIMA_DATA_HEADER_SIZE; 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 c4a21a4..9590e2b 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 @@ -30,12 +30,16 @@ #include "ux_device_stack.h" +#if UX_SLAVE_REQUEST_DATA_MAX_LENGTH < UX_DEVICE_CLASS_PIMA_DATA_HEADER_SIZE +#error UX_SLAVE_REQUEST_DATA_MAX_LENGTH too small, please check +#endif + /**************************************************************************/ /* */ /* FUNCTION RELEASE */ /* */ /* _ux_device_class_pima_device_prop_value_get PORTABLE C */ -/* 6.0 */ +/* 6.1 */ /* AUTHOR */ /* */ /* Chaoqiong Xiao, Microsoft Corporation */ @@ -72,6 +76,10 @@ /* DATE NAME DESCRIPTION */ /* */ /* 05-19-2020 Chaoqiong Xiao Initial Version 6.0 */ +/* 09-30-2020 Chaoqiong Xiao Modified comment(s), */ +/* verified memset and memcpy */ +/* cases, */ +/* resulting in version 6.1 */ /* */ /**************************************************************************/ UINT _ux_device_class_pima_device_prop_value_get(UX_SLAVE_CLASS_PIMA *pima, @@ -116,9 +124,23 @@ UCHAR *device_property_value; else { - + + /* Ensure the application's data can fit in the endpoint's data buffer. */ + if (device_property_value_length > UX_SLAVE_REQUEST_DATA_MAX_LENGTH - UX_DEVICE_CLASS_PIMA_DATA_HEADER_SIZE) + { + + /* If trace is enabled, insert this event into the trace buffer. */ + UX_TRACE_IN_LINE_INSERT(UX_TRACE_ERROR, UX_MEMORY_INSUFFICIENT, 0, 0, 0, UX_TRACE_ERRORS, 0, 0) + + /* We return an error. */ + _ux_device_class_pima_response_send(pima, UX_DEVICE_CLASS_PIMA_RC_GENERAL_ERROR, 0, 0, 0, 0); + + /* Return overflow error. */ + return(UX_MEMORY_INSUFFICIENT); + } + /* Copy the property dataset into the local buffer. */ - _ux_utility_memory_copy(pima_data_buffer + UX_DEVICE_CLASS_PIMA_DATA_HEADER_SIZE, device_property_value, device_property_value_length); + _ux_utility_memory_copy(pima_data_buffer + UX_DEVICE_CLASS_PIMA_DATA_HEADER_SIZE, device_property_value, device_property_value_length); /* Use case of memcpy is verified. */ /* Add the header size to the payload. */ device_property_value_length += UX_DEVICE_CLASS_PIMA_DATA_HEADER_SIZE; diff --git a/common/usbx_device_classes/src/ux_device_class_pima_device_prop_value_set.c b/common/usbx_device_classes/src/ux_device_class_pima_device_prop_value_set.c index 702744b..5391204 100644 --- a/common/usbx_device_classes/src/ux_device_class_pima_device_prop_value_set.c +++ b/common/usbx_device_classes/src/ux_device_class_pima_device_prop_value_set.c @@ -35,7 +35,7 @@ /* FUNCTION RELEASE */ /* */ /* _ux_device_class_pima_device_prop_value_set PORTABLE C */ -/* 6.0 */ +/* 6.1 */ /* AUTHOR */ /* */ /* Chaoqiong Xiao, Microsoft Corporation */ @@ -67,6 +67,8 @@ /* 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 */ /* */ /**************************************************************************/ UINT _ux_device_class_pima_device_prop_value_set(UX_SLAVE_CLASS_PIMA *pima, ULONG device_property_code) diff --git a/common/usbx_device_classes/src/ux_device_class_pima_device_reset.c b/common/usbx_device_classes/src/ux_device_class_pima_device_reset.c index 3a9c162..04c709f 100644 --- a/common/usbx_device_classes/src/ux_device_class_pima_device_reset.c +++ b/common/usbx_device_classes/src/ux_device_class_pima_device_reset.c @@ -35,7 +35,7 @@ /* FUNCTION RELEASE */ /* */ /* _ux_device_class_pima_device_reset PORTABLE C */ -/* 6.0 */ +/* 6.1 */ /* AUTHOR */ /* */ /* Chaoqiong Xiao, Microsoft Corporation */ @@ -66,6 +66,8 @@ /* 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 */ /* */ /**************************************************************************/ UINT _ux_device_class_pima_device_reset(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 380e987..de5de6b 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 @@ -33,8 +33,8 @@ /* */ /* FUNCTION RELEASE */ /* */ -/* _ux_class_device_pima_entry PORTABLE C */ -/* 6.0 */ +/* _ux_device_class_pima_entry PORTABLE C */ +/* 6.1 */ /* AUTHOR */ /* */ /* Chaoqiong Xiao, Microsoft Corporation */ @@ -70,6 +70,8 @@ /* 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 */ /* */ /**************************************************************************/ UINT _ux_device_class_pima_entry(UX_SLAVE_CLASS_COMMAND *command) diff --git a/common/usbx_device_classes/src/ux_device_class_pima_event_get.c b/common/usbx_device_classes/src/ux_device_class_pima_event_get.c index 5d83d7d..8030e21 100644 --- a/common/usbx_device_classes/src/ux_device_class_pima_event_get.c +++ b/common/usbx_device_classes/src/ux_device_class_pima_event_get.c @@ -34,7 +34,7 @@ /* FUNCTION RELEASE */ /* */ /* _ux_device_class_pima_event_get PORTABLE C */ -/* 6.0 */ +/* 6.1 */ /* AUTHOR */ /* */ /* Chaoqiong Xiao, Microsoft Corporation */ @@ -65,6 +65,8 @@ /* 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 */ /* */ /**************************************************************************/ UINT _ux_device_class_pima_event_get(UX_SLAVE_CLASS_PIMA *pima, 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 b360979..015c13e 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.0 */ +/* 6.1 */ /* AUTHOR */ /* */ /* Chaoqiong Xiao, Microsoft Corporation */ @@ -66,6 +66,8 @@ /* 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 */ /* */ /**************************************************************************/ UINT _ux_device_class_pima_event_set(UX_SLAVE_CLASS_PIMA *pima, 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 9afd7c4..b1e2f51 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 @@ -32,8 +32,8 @@ /* */ /* FUNCTION RELEASE */ /* */ -/* _ux_device_class_pima_activate PORTABLE C */ -/* 6.0 */ +/* _ux_device_class_pima_initialize PORTABLE C */ +/* 6.1 */ /* AUTHOR */ /* */ /* Chaoqiong Xiao, Microsoft Corporation */ @@ -65,6 +65,11 @@ /* DATE NAME DESCRIPTION */ /* */ /* 05-19-2020 Chaoqiong Xiao Initial Version 6.0 */ +/* 09-30-2020 Chaoqiong Xiao Modified comment(s), */ +/* used UX prefix to refer to */ +/* TX symbols instead of using */ +/* them directly, */ +/* resulting in version 6.1 */ /* */ /**************************************************************************/ UINT _ux_device_class_pima_initialize(UX_SLAVE_CLASS_COMMAND *command) @@ -107,7 +112,7 @@ UX_SLAVE_CLASS *class; _ux_device_class_pima_thread, (ULONG) (ALIGN_TYPE) class, (VOID *) class -> ux_slave_class_thread_stack, UX_THREAD_STACK_SIZE, UX_THREAD_PRIORITY_CLASS, - UX_THREAD_PRIORITY_CLASS, UX_NO_TIME_SLICE, TX_DONT_START); + UX_THREAD_PRIORITY_CLASS, UX_NO_TIME_SLICE, UX_DONT_START); /* Check the creation of this thread. */ if (status != UX_SUCCESS) 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 1f2f1ae..cc5bc59 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 @@ -34,7 +34,7 @@ /* FUNCTION RELEASE */ /* */ /* _ux_device_class_pima_interrupt_thread PORTABLE C */ -/* 6.0 */ +/* 6.1 */ /* AUTHOR */ /* */ /* Chaoqiong Xiao, Microsoft Corporation */ @@ -71,6 +71,8 @@ /* 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 */ /* */ /**************************************************************************/ VOID _ux_device_class_pima_interrupt_thread(ULONG pima_class) diff --git a/common/usbx_device_classes/src/ux_device_class_pima_object_add.c b/common/usbx_device_classes/src/ux_device_class_pima_object_add.c index cfb604c..90a90e8 100644 --- a/common/usbx_device_classes/src/ux_device_class_pima_object_add.c +++ b/common/usbx_device_classes/src/ux_device_class_pima_object_add.c @@ -35,7 +35,7 @@ /* FUNCTION RELEASE */ /* */ /* _ux_device_class_pima_object_add PORTABLE C */ -/* 6.0 */ +/* 6.1 */ /* AUTHOR */ /* */ /* Chaoqiong Xiao, Microsoft Corporation */ @@ -67,6 +67,8 @@ /* 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 */ /* */ /**************************************************************************/ UINT _ux_device_class_pima_object_add(UX_SLAVE_CLASS_PIMA *pima, ULONG object_handle) diff --git a/common/usbx_device_classes/src/ux_device_class_pima_object_data_get.c b/common/usbx_device_classes/src/ux_device_class_pima_object_data_get.c index 4786563..20b0d82 100644 --- a/common/usbx_device_classes/src/ux_device_class_pima_object_data_get.c +++ b/common/usbx_device_classes/src/ux_device_class_pima_object_data_get.c @@ -35,7 +35,7 @@ /* FUNCTION RELEASE */ /* */ /* _ux_device_class_pima_object_data_get PORTABLE C */ -/* 6.0 */ +/* 6.1 */ /* AUTHOR */ /* */ /* Chaoqiong Xiao, Microsoft Corporation */ @@ -69,6 +69,8 @@ /* 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 */ /* */ /**************************************************************************/ UINT _ux_device_class_pima_object_data_get(UX_SLAVE_CLASS_PIMA *pima, ULONG object_handle) diff --git a/common/usbx_device_classes/src/ux_device_class_pima_object_data_send.c b/common/usbx_device_classes/src/ux_device_class_pima_object_data_send.c index 50472ab..1411b0b 100644 --- a/common/usbx_device_classes/src/ux_device_class_pima_object_data_send.c +++ b/common/usbx_device_classes/src/ux_device_class_pima_object_data_send.c @@ -35,7 +35,7 @@ /* FUNCTION RELEASE */ /* */ /* _ux_device_class_pima_object_data_send PORTABLE C */ -/* 6.0 */ +/* 6.1 */ /* AUTHOR */ /* */ /* Chaoqiong Xiao, Microsoft Corporation */ @@ -66,6 +66,8 @@ /* 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 */ /* */ /**************************************************************************/ UINT _ux_device_class_pima_object_data_send(UX_SLAVE_CLASS_PIMA *pima) diff --git a/common/usbx_device_classes/src/ux_device_class_pima_object_delete.c b/common/usbx_device_classes/src/ux_device_class_pima_object_delete.c index e5b9519..e70f838 100644 --- a/common/usbx_device_classes/src/ux_device_class_pima_object_delete.c +++ b/common/usbx_device_classes/src/ux_device_class_pima_object_delete.c @@ -35,7 +35,7 @@ /* FUNCTION RELEASE */ /* */ /* _ux_device_class_pima_object_delete PORTABLE C */ -/* 6.0 */ +/* 6.1 */ /* AUTHOR */ /* */ /* Chaoqiong Xiao, Microsoft Corporation */ @@ -67,6 +67,8 @@ /* 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 */ /* */ /**************************************************************************/ UINT _ux_device_class_pima_object_delete(UX_SLAVE_CLASS_PIMA *pima, ULONG object_handle) diff --git a/common/usbx_device_classes/src/ux_device_class_pima_object_handles_send.c b/common/usbx_device_classes/src/ux_device_class_pima_object_handles_send.c index 60ee0f9..d4a707b 100644 --- a/common/usbx_device_classes/src/ux_device_class_pima_object_handles_send.c +++ b/common/usbx_device_classes/src/ux_device_class_pima_object_handles_send.c @@ -35,7 +35,7 @@ /* FUNCTION RELEASE */ /* */ /* _ux_device_class_pima_object_handles_send PORTABLE C */ -/* 6.0 */ +/* 6.1 */ /* AUTHOR */ /* */ /* Chaoqiong Xiao, Microsoft Corporation */ @@ -72,6 +72,8 @@ /* 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 */ /* */ /**************************************************************************/ UINT _ux_device_class_pima_object_handles_send(UX_SLAVE_CLASS_PIMA *pima, 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 fe6fe48..df22e7b 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.0 */ +/* 6.1 */ /* AUTHOR */ /* */ /* Chaoqiong Xiao, Microsoft Corporation */ @@ -70,6 +70,10 @@ /* DATE NAME DESCRIPTION */ /* */ /* 05-19-2020 Chaoqiong Xiao Initial Version 6.0 */ +/* 09-30-2020 Chaoqiong Xiao Modified comment(s), */ +/* verified memset and memcpy */ +/* cases, */ +/* resulting in version 6.1 */ /* */ /**************************************************************************/ UINT _ux_device_class_pima_object_info_get(UX_SLAVE_CLASS_PIMA *pima, ULONG object_handle) @@ -81,7 +85,11 @@ UX_SLAVE_CLASS_PIMA_OBJECT *object; ULONG object_info_length; UCHAR *object_info; UCHAR *object_info_pointer; -ULONG unicode_string_length; +ULONG file_name_length; +ULONG capture_date_length; +ULONG modification_date_length; +ULONG keywords_length; + /* If trace is enabled, insert this event into the trace buffer. */ UX_TRACE_IN_LINE_INSERT(UX_TRACE_DEVICE_CLASS_PIMA_OBJECT_INFO_GET, pima, object_handle, 0, 0, UX_TRACE_DEVICE_CLASS_EVENTS, 0, 0) @@ -98,13 +106,38 @@ ULONG unicode_string_length; else { + /* Length calculation and overflow check. */ + file_name_length = ((ULONG) *object -> ux_device_class_pima_object_filename * 2 ) + 1; + capture_date_length = ((ULONG) *object -> ux_device_class_pima_object_capture_date *2 ) + 1; + modification_date_length = ((ULONG) *object -> ux_device_class_pima_object_modification_date * 2 ) + 1; + keywords_length = ((ULONG) *object -> ux_device_class_pima_object_keywords * 2 ) +1; + object_info_length = UX_DEVICE_CLASS_PIMA_DATA_HEADER_SIZE + + UX_DEVICE_CLASS_PIMA_OBJECT_VARIABLE_OFFSET + + file_name_length + + capture_date_length + + modification_date_length + + keywords_length; + + /* Ensure the object info data can fit in the endpoint's data buffer. */ + if (object_info_length > UX_SLAVE_REQUEST_DATA_MAX_LENGTH) + { + + /* If trace is enabled, insert this event into the trace buffer. */ + UX_TRACE_IN_LINE_INSERT(UX_TRACE_ERROR, UX_MEMORY_INSUFFICIENT, 0, 0, 0, UX_TRACE_ERRORS, 0, 0) + + /* We return an error. */ + _ux_device_class_pima_response_send(pima, UX_DEVICE_CLASS_PIMA_RC_GENERAL_ERROR, 0, 0, 0, 0); + + /* Return overflow error. */ + return(UX_MEMORY_INSUFFICIENT); + } /* Obtain the pointer to the transfer request. */ transfer_request = &pima -> ux_device_class_pima_bulk_in_endpoint -> ux_slave_endpoint_transfer_request; /* Obtain memory for this object info. Use the transfer request pre-allocated memory. */ object_info = transfer_request -> ux_slave_transfer_request_data_pointer; - + /* Fill in the data container type. */ _ux_utility_short_put(object_info + UX_DEVICE_CLASS_PIMA_DATA_HEADER_TYPE, UX_DEVICE_CLASS_PIMA_CT_DATA_BLOCK); @@ -129,46 +162,29 @@ ULONG unicode_string_length; /* Copy the object filename field. Point to the beginning of the object description string. */ object_info_pointer += UX_DEVICE_CLASS_PIMA_OBJECT_VARIABLE_OFFSET; - /* Get the unicode string length for the filename. */ - unicode_string_length = ((ULONG) *object -> ux_device_class_pima_object_filename * 2 ) + 1; - /* Copy that string into the object description field. */ - _ux_utility_memory_copy(object_info_pointer, object -> ux_device_class_pima_object_filename, unicode_string_length); + _ux_utility_memory_copy(object_info_pointer, object -> ux_device_class_pima_object_filename, file_name_length); /* Use case of memcpy is verified. */ /* Point to the next field. */ - object_info_pointer += unicode_string_length; + object_info_pointer += file_name_length; - /* Get the unicode string length of the capture date. */ - unicode_string_length = ((ULONG) *object -> ux_device_class_pima_object_capture_date *2 ) + 1; - /* Copy that string into the capture date field. */ - _ux_utility_memory_copy(object_info_pointer, object -> ux_device_class_pima_object_capture_date, unicode_string_length); + _ux_utility_memory_copy(object_info_pointer, object -> ux_device_class_pima_object_capture_date, capture_date_length); /* Use case of memcpy is verified. */ /* Point to the next field. */ - object_info_pointer += unicode_string_length; - - + object_info_pointer += capture_date_length; - /* Get the unicode string length. */ - unicode_string_length = ((ULONG) *object -> ux_device_class_pima_object_modification_date * 2 ) + 1; - /* Copy that string into the modification date field. */ - _ux_utility_memory_copy(object_info_pointer, object -> ux_device_class_pima_object_modification_date, unicode_string_length); + _ux_utility_memory_copy(object_info_pointer, object -> ux_device_class_pima_object_modification_date, modification_date_length); /* Use case of memcpy is verified. */ /* Point to the next field. */ - object_info_pointer += unicode_string_length; + object_info_pointer += modification_date_length; - /* Get the unicode string length. */ - unicode_string_length = ((ULONG) *object -> ux_device_class_pima_object_keywords * 2 ) +1; - /* Copy that string into the keywords field. */ - _ux_utility_memory_copy(object_info_pointer, object -> ux_device_class_pima_object_keywords, unicode_string_length); + _ux_utility_memory_copy(object_info_pointer, object -> ux_device_class_pima_object_keywords, keywords_length); /* Use case of memcpy is verified. */ /* Point to the end of the variable length. */ - object_info_pointer += unicode_string_length; - - /* Compute the overall length of the device info structure. */ - object_info_length = (ULONG) ((ALIGN_TYPE) object_info_pointer - (ALIGN_TYPE) object_info); + object_info_pointer += keywords_length; /* Fill in the size of the response header. */ _ux_utility_long_put(object_info + UX_DEVICE_CLASS_PIMA_DATA_HEADER_LENGTH, diff --git a/common/usbx_device_classes/src/ux_device_class_pima_object_info_send.c b/common/usbx_device_classes/src/ux_device_class_pima_object_info_send.c index 1ff436d..25a7de6 100644 --- a/common/usbx_device_classes/src/ux_device_class_pima_object_info_send.c +++ b/common/usbx_device_classes/src/ux_device_class_pima_object_info_send.c @@ -35,7 +35,7 @@ /* FUNCTION RELEASE */ /* */ /* _ux_device_class_pima_object_info_send PORTABLE C */ -/* 6.0 */ +/* 6.1 */ /* AUTHOR */ /* */ /* Chaoqiong Xiao, Microsoft Corporation */ @@ -74,6 +74,10 @@ /* DATE NAME DESCRIPTION */ /* */ /* 05-19-2020 Chaoqiong Xiao Initial Version 6.0 */ +/* 09-30-2020 Chaoqiong Xiao Modified comment(s), */ +/* verified memset and memcpy */ +/* cases, */ +/* resulting in version 6.1 */ /* */ /**************************************************************************/ UINT _ux_device_class_pima_object_info_send(UX_SLAVE_CLASS_PIMA *pima, ULONG storage_id, ULONG parent_object_handle) @@ -145,7 +149,7 @@ ULONG object_handle; { /* Copy that string into the object description field. */ - _ux_utility_memory_copy(object -> ux_device_class_pima_object_filename, object_info_pointer, unicode_string_length); + _ux_utility_memory_copy(object -> ux_device_class_pima_object_filename, object_info_pointer, unicode_string_length); /* Use case of memcpy is verified. */ /* Point to the next field. */ object_info_pointer += unicode_string_length; @@ -165,7 +169,7 @@ ULONG object_handle; { /* Copy that string into the capture date field. */ - _ux_utility_memory_copy(object -> ux_device_class_pima_object_capture_date, object_info_pointer, unicode_string_length); + _ux_utility_memory_copy(object -> ux_device_class_pima_object_capture_date, object_info_pointer, unicode_string_length); /* Use case of memcpy is verified. */ /* Point to the next field. */ object_info_pointer += unicode_string_length; @@ -185,7 +189,7 @@ ULONG object_handle; { /* Copy that string into the modification date field. */ - _ux_utility_memory_copy(object -> ux_device_class_pima_object_modification_date, object_info_pointer, unicode_string_length); + _ux_utility_memory_copy(object -> ux_device_class_pima_object_modification_date, object_info_pointer, unicode_string_length); /* Use case of memcpy is verified. */ /* Point to the next field. */ object_info_pointer += unicode_string_length; @@ -205,7 +209,7 @@ ULONG object_handle; { /* Copy that string into the keywords field. */ - _ux_utility_memory_copy(object -> ux_device_class_pima_object_keywords, object_info_pointer, unicode_string_length); + _ux_utility_memory_copy(object -> ux_device_class_pima_object_keywords, object_info_pointer, unicode_string_length); /* Use case of memcpy is verified. */ /* Reset the rest of the other parameters. */ object -> ux_device_class_pima_object_state = 0; 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 374b1ce..f5d8446 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.0 */ +/* 6.1 */ /* AUTHOR */ /* */ /* Chaoqiong Xiao, Microsoft Corporation */ @@ -73,6 +73,10 @@ /* DATE NAME DESCRIPTION */ /* */ /* 05-19-2020 Chaoqiong Xiao Initial Version 6.0 */ +/* 09-30-2020 Chaoqiong Xiao Modified comment(s), */ +/* verified memset and memcpy */ +/* cases, */ +/* resulting in version 6.1 */ /* */ /**************************************************************************/ UINT _ux_device_class_pima_object_prop_desc_get(UX_SLAVE_CLASS_PIMA *pima, @@ -126,7 +130,7 @@ UCHAR *object_props_desc_end; /* Copy the object property array. */ _ux_utility_memory_copy(object_props_desc + UX_DEVICE_CLASS_PIMA_DATA_HEADER_SIZE, - object_prop_dataset, object_prop_dataset_length); + object_prop_dataset, object_prop_dataset_length); /* Use case of memcpy is verified. */ /* Add the header size. */ object_prop_dataset_length += UX_DEVICE_CLASS_PIMA_DATA_HEADER_SIZE; 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 0683fab..081d2ac 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.0 */ +/* 6.1 */ /* AUTHOR */ /* */ /* Chaoqiong Xiao, Microsoft Corporation */ @@ -76,6 +76,10 @@ /* DATE NAME DESCRIPTION */ /* */ /* 05-19-2020 Chaoqiong Xiao Initial Version 6.0 */ +/* 09-30-2020 Chaoqiong Xiao Modified comment(s), */ +/* verified memset and memcpy */ +/* cases, */ +/* resulting in version 6.1 */ /* */ /**************************************************************************/ UINT _ux_device_class_pima_object_prop_value_get(UX_SLAVE_CLASS_PIMA *pima, @@ -131,7 +135,7 @@ ULONG object_property_value_length; { /* Copy the property dataset into the local buffer. */ - _ux_utility_memory_copy(pima_data_buffer + UX_DEVICE_CLASS_PIMA_DATA_HEADER_SIZE, object_property_value, object_property_value_length); + _ux_utility_memory_copy(pima_data_buffer + UX_DEVICE_CLASS_PIMA_DATA_HEADER_SIZE, object_property_value, object_property_value_length); /* Use case of memcpy is verified. */ /* Add the header size to the payload. */ object_property_value_length += UX_DEVICE_CLASS_PIMA_DATA_HEADER_SIZE; diff --git a/common/usbx_device_classes/src/ux_device_class_pima_object_prop_value_set.c b/common/usbx_device_classes/src/ux_device_class_pima_object_prop_value_set.c index 0ac6a35..0b86955 100644 --- a/common/usbx_device_classes/src/ux_device_class_pima_object_prop_value_set.c +++ b/common/usbx_device_classes/src/ux_device_class_pima_object_prop_value_set.c @@ -35,7 +35,7 @@ /* FUNCTION RELEASE */ /* */ /* _ux_device_class_pima_object_prop_value_set PORTABLE C */ -/* 6.0 */ +/* 6.1 */ /* AUTHOR */ /* */ /* Chaoqiong Xiao, Microsoft Corporation */ @@ -71,6 +71,8 @@ /* 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 */ /* */ /**************************************************************************/ UINT _ux_device_class_pima_object_prop_value_set(UX_SLAVE_CLASS_PIMA *pima, diff --git a/common/usbx_device_classes/src/ux_device_class_pima_object_props_supported_get.c b/common/usbx_device_classes/src/ux_device_class_pima_object_props_supported_get.c index 3b4289b..f041021 100644 --- a/common/usbx_device_classes/src/ux_device_class_pima_object_props_supported_get.c +++ b/common/usbx_device_classes/src/ux_device_class_pima_object_props_supported_get.c @@ -34,8 +34,8 @@ /* */ /* FUNCTION RELEASE */ /* */ -/* _ux_device_class_pima_object_prop_supported_get PORTABLE C */ -/* 6.0 */ +/* _ux_device_class_pima_object_props_supported_get PORTABLE C */ +/* 6.1 */ /* AUTHOR */ /* */ /* Chaoqiong Xiao, Microsoft Corporation */ @@ -72,6 +72,8 @@ /* 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 */ /* */ /**************************************************************************/ UINT _ux_device_class_pima_object_props_supported_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 dfe537d..3162dca 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.0 */ +/* 6.1 */ /* AUTHOR */ /* */ /* Chaoqiong Xiao, Microsoft Corporation */ @@ -73,6 +73,10 @@ /* DATE NAME DESCRIPTION */ /* */ /* 05-19-2020 Chaoqiong Xiao Initial Version 6.0 */ +/* 09-30-2020 Chaoqiong Xiao Modified comment(s), */ +/* verified memset and memcpy */ +/* cases, */ +/* resulting in version 6.1 */ /* */ /**************************************************************************/ UINT _ux_device_class_pima_object_references_get(UX_SLAVE_CLASS_PIMA *pima, @@ -127,7 +131,7 @@ ULONG object_references_length; { /* Copy the property dataset into the local buffer. */ - _ux_utility_memory_copy(pima_data_buffer + UX_DEVICE_CLASS_PIMA_DATA_HEADER_SIZE, object_references, object_references_length); + _ux_utility_memory_copy(pima_data_buffer + UX_DEVICE_CLASS_PIMA_DATA_HEADER_SIZE, object_references, object_references_length); /* Use case of memcpy is verified. */ /* Add the header size to the payload. */ object_references_length += UX_DEVICE_CLASS_PIMA_DATA_HEADER_SIZE; diff --git a/common/usbx_device_classes/src/ux_device_class_pima_object_references_set.c b/common/usbx_device_classes/src/ux_device_class_pima_object_references_set.c index e569dc8..b2c8761 100644 --- a/common/usbx_device_classes/src/ux_device_class_pima_object_references_set.c +++ b/common/usbx_device_classes/src/ux_device_class_pima_object_references_set.c @@ -35,7 +35,7 @@ /* FUNCTION RELEASE */ /* */ /* _ux_device_class_pima_object_references_set PORTABLE C */ -/* 6.0 */ +/* 6.1 */ /* AUTHOR */ /* */ /* Chaoqiong Xiao, Microsoft Corporation */ @@ -72,6 +72,8 @@ /* 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 */ /* */ /**************************************************************************/ UINT _ux_device_class_pima_object_references_set(UX_SLAVE_CLASS_PIMA *pima, diff --git a/common/usbx_device_classes/src/ux_device_class_pima_objects_number_send.c b/common/usbx_device_classes/src/ux_device_class_pima_objects_number_send.c index 16a4d1e..f0449ca 100644 --- a/common/usbx_device_classes/src/ux_device_class_pima_objects_number_send.c +++ b/common/usbx_device_classes/src/ux_device_class_pima_objects_number_send.c @@ -34,8 +34,8 @@ /* */ /* FUNCTION RELEASE */ /* */ -/* _ux_device_class_pima_object_number_send PORTABLE C */ -/* 6.0 */ +/* _ux_device_class_pima_objects_number_send PORTABLE C */ +/* 6.1 */ /* AUTHOR */ /* */ /* Chaoqiong Xiao, Microsoft Corporation */ @@ -65,6 +65,8 @@ /* 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 */ /* */ /**************************************************************************/ UINT _ux_device_class_pima_objects_number_send(UX_SLAVE_CLASS_PIMA *pima, diff --git a/common/usbx_device_classes/src/ux_device_class_pima_partial_object_data_get.c b/common/usbx_device_classes/src/ux_device_class_pima_partial_object_data_get.c index 84a22f5..3a59fd6 100644 --- a/common/usbx_device_classes/src/ux_device_class_pima_partial_object_data_get.c +++ b/common/usbx_device_classes/src/ux_device_class_pima_partial_object_data_get.c @@ -35,7 +35,7 @@ /* FUNCTION RELEASE */ /* */ /* _ux_device_class_pima_partial_object_data_get PORTABLE C */ -/* 6.0 */ +/* 6.1 */ /* AUTHOR */ /* */ /* Chaoqiong Xiao, Microsoft Corporation */ @@ -69,6 +69,8 @@ /* 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 */ /* */ /**************************************************************************/ UINT _ux_device_class_pima_partial_object_data_get(UX_SLAVE_CLASS_PIMA *pima, diff --git a/common/usbx_device_classes/src/ux_device_class_pima_response_send.c b/common/usbx_device_classes/src/ux_device_class_pima_response_send.c index 02ec295..d4855d5 100644 --- a/common/usbx_device_classes/src/ux_device_class_pima_response_send.c +++ b/common/usbx_device_classes/src/ux_device_class_pima_response_send.c @@ -33,7 +33,7 @@ /* FUNCTION RELEASE */ /* */ /* _ux_device_class_pima_response_send PORTABLE C */ -/* 6.0 */ +/* 6.1 */ /* AUTHOR */ /* */ /* Chaoqiong Xiao, Microsoft Corporation */ @@ -67,6 +67,8 @@ /* 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 */ /* */ /**************************************************************************/ UINT _ux_device_class_pima_response_send(UX_SLAVE_CLASS_PIMA *pima, ULONG response_code, diff --git a/common/usbx_device_classes/src/ux_device_class_pima_storage_format.c b/common/usbx_device_classes/src/ux_device_class_pima_storage_format.c index f9d04a0..859f93f 100644 --- a/common/usbx_device_classes/src/ux_device_class_pima_storage_format.c +++ b/common/usbx_device_classes/src/ux_device_class_pima_storage_format.c @@ -35,7 +35,7 @@ /* FUNCTION RELEASE */ /* */ /* _ux_device_class_pima_storage_format PORTABLE C */ -/* 6.0 */ +/* 6.1 */ /* AUTHOR */ /* */ /* Chaoqiong Xiao, Microsoft Corporation */ @@ -67,6 +67,8 @@ /* 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 */ /* */ /**************************************************************************/ UINT _ux_device_class_pima_storage_format(UX_SLAVE_CLASS_PIMA *pima, ULONG storage_id) 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 8ab1ab6..635c99e 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 @@ -35,7 +35,7 @@ /* FUNCTION RELEASE */ /* */ /* _ux_device_class_pima_storage_id_send PORTABLE C */ -/* 6.0 */ +/* 6.1 */ /* AUTHOR */ /* */ /* Chaoqiong Xiao, Microsoft Corporation */ @@ -68,6 +68,8 @@ /* 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 */ /* */ /**************************************************************************/ UINT _ux_device_class_pima_storage_id_send(UX_SLAVE_CLASS_PIMA *pima) diff --git a/common/usbx_device_classes/src/ux_device_class_pima_storage_info_get.c b/common/usbx_device_classes/src/ux_device_class_pima_storage_info_get.c index 47581d9..60799e9 100644 --- a/common/usbx_device_classes/src/ux_device_class_pima_storage_info_get.c +++ b/common/usbx_device_classes/src/ux_device_class_pima_storage_info_get.c @@ -35,7 +35,7 @@ /* FUNCTION RELEASE */ /* */ /* _ux_device_class_pima_storage_info_get PORTABLE C */ -/* 6.0 */ +/* 6.1 */ /* AUTHOR */ /* */ /* Chaoqiong Xiao, Microsoft Corporation */ @@ -69,6 +69,8 @@ /* 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 */ /* */ /**************************************************************************/ UINT _ux_device_class_pima_storage_info_get(UX_SLAVE_CLASS_PIMA *pima, ULONG storage_id) diff --git a/common/usbx_device_classes/src/ux_device_class_pima_thread.c b/common/usbx_device_classes/src/ux_device_class_pima_thread.c index d1a4a19..ed50705 100644 --- a/common/usbx_device_classes/src/ux_device_class_pima_thread.c +++ b/common/usbx_device_classes/src/ux_device_class_pima_thread.c @@ -34,7 +34,7 @@ /* FUNCTION RELEASE */ /* */ /* _ux_device_class_pima_thread PORTABLE C */ -/* 6.0 */ +/* 6.1 */ /* AUTHOR */ /* */ /* Chaoqiong Xiao, Microsoft Corporation */ @@ -110,6 +110,11 @@ /* DATE NAME DESCRIPTION */ /* */ /* 05-19-2020 Chaoqiong Xiao Initial Version 6.0 */ +/* 09-30-2020 Chaoqiong Xiao Modified comment(s), */ +/* used UX prefix to refer to */ +/* TX symbols instead of using */ +/* them directly, */ +/* resulting in version 6.1 */ /* */ /**************************************************************************/ VOID _ux_device_class_pima_thread(ULONG pima_class) @@ -163,7 +168,7 @@ UINT status; _ux_device_class_pima_interrupt_thread, (ULONG) (ALIGN_TYPE) pima, (VOID *) pima -> ux_device_class_pima_interrupt_thread_stack, UX_THREAD_STACK_SIZE, UX_THREAD_PRIORITY_CLASS, - UX_THREAD_PRIORITY_CLASS, UX_NO_TIME_SLICE, TX_AUTO_START); + UX_THREAD_PRIORITY_CLASS, UX_NO_TIME_SLICE, UX_AUTO_START); /* Check the creation of this thread. */ if (status != UX_SUCCESS) 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 31c0c17..5f22683 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.0 */ +/* 6.1 */ /* AUTHOR */ /* */ /* Chaoqiong Xiao, Microsoft Corporation */ @@ -65,6 +65,10 @@ /* DATE NAME DESCRIPTION */ /* */ /* 05-19-2020 Chaoqiong Xiao Initial Version 6.0 */ +/* 09-30-2020 Chaoqiong Xiao Modified comment(s), */ +/* verified memset and memcpy */ +/* cases, */ +/* resulting in version 6.1 */ /* */ /**************************************************************************/ UINT _ux_device_class_rndis_activate(UX_SLAVE_CLASS_COMMAND *command) @@ -171,11 +175,11 @@ ULONG physical_address_lsw; /* Reset the endpoint buffers. */ _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); + ux_slave_transfer_request_data_pointer, 0, UX_SLAVE_REQUEST_DATA_MAX_LENGTH); /* 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); + ux_slave_transfer_request_data_pointer, 0, UX_SLAVE_REQUEST_DATA_MAX_LENGTH); /* Use case of memset is verified. */ _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); + ux_slave_transfer_request_data_pointer, 0, UX_SLAVE_REQUEST_DATA_MAX_LENGTH); /* Use case of memset is verified. */ /* Resume the endpoint threads. */ _ux_utility_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 2347b0c..eb960a0 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 @@ -34,7 +34,7 @@ /* FUNCTION RELEASE */ /* */ /* _ux_device_class_rndis_bulkin_thread PORTABLE C */ -/* 6.0 */ +/* 6.1 */ /* AUTHOR */ /* */ /* Chaoqiong Xiao, Microsoft Corporation */ @@ -72,6 +72,12 @@ /* DATE NAME DESCRIPTION */ /* */ /* 05-19-2020 Chaoqiong Xiao Initial Version 6.0 */ +/* 09-30-2020 Chaoqiong Xiao Modified comment(s), */ +/* verified memset and memcpy */ +/* cases, used UX prefix to */ +/* refer to TX symbols instead */ +/* of using them directly, */ +/* resulting in version 6.1 */ /* */ /**************************************************************************/ VOID _ux_device_class_rndis_bulkin_thread(ULONG rndis_class) @@ -111,7 +117,7 @@ ULONG transfer_length; on the interrupt pipe frequency or a change in the idle state forces us to send an empty report. */ status = _ux_utility_event_flags_get(&rndis -> ux_slave_class_rndis_event_flags_group, (UX_DEVICE_CLASS_RNDIS_NEW_BULKIN_EVENT | UX_DEVICE_CLASS_RNDIS_NEW_DEVICE_STATE_CHANGE_EVENT), - TX_OR_CLEAR, &actual_flags, TX_WAIT_FOREVER); + UX_OR_CLEAR, &actual_flags, UX_WAIT_FOREVER); /* Check the completion code and the actual flags returned. */ if (status == UX_SUCCESS && (actual_flags & UX_DEVICE_CLASS_RNDIS_NEW_DEVICE_STATE_CHANGE_EVENT) == 0) @@ -148,7 +154,7 @@ ULONG transfer_length; { /* Copy the packet in the transfer descriptor buffer. */ - _ux_utility_memory_copy (transfer_request -> ux_slave_transfer_request_data_pointer + UX_DEVICE_CLASS_RNDIS_PACKET_HEADER_LENGTH, packet_header, current_packet -> nx_packet_length); + _ux_utility_memory_copy (transfer_request -> ux_slave_transfer_request_data_pointer + UX_DEVICE_CLASS_RNDIS_PACKET_HEADER_LENGTH, packet_header, current_packet -> nx_packet_length); /* Use case of memcpy is verified. */ /* Add the RNDIS header to this packet. */ _ux_utility_long_put(transfer_request -> ux_slave_transfer_request_data_pointer + UX_DEVICE_CLASS_RNDIS_PACKET_MESSAGE_TYPE, UX_DEVICE_CLASS_RNDIS_PACKET_HEADER_MSG); 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 9bd016a..0dde156 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 @@ -33,7 +33,7 @@ /* FUNCTION RELEASE */ /* */ /* _ux_device_class_rndis_bulkout_thread PORTABLE C */ -/* 6.0 */ +/* 6.1 */ /* AUTHOR */ /* */ /* Chaoqiong Xiao, Microsoft Corporation */ @@ -71,6 +71,11 @@ /* DATE NAME DESCRIPTION */ /* */ /* 05-19-2020 Chaoqiong Xiao Initial Version 6.0 */ +/* 09-30-2020 Chaoqiong Xiao Modified comment(s), */ +/* prefixed UX to MS_TO_TICK, */ +/* verified memset and memcpy */ +/* cases, */ +/* resulting in version 6.1 */ /* */ /**************************************************************************/ VOID _ux_device_class_rndis_bulkout_thread(ULONG rndis_class) @@ -107,7 +112,7 @@ ULONG packet_payload; /* We can accept new reception. Get a NX Packet. */ status = nx_packet_allocate(&rndis -> ux_slave_class_rndis_packet_pool, &packet, - NX_RECEIVE_PACKET, MS_TO_TICK(UX_DEVICE_CLASS_RNDIS_PACKET_POOL_WAIT)); + NX_RECEIVE_PACKET, UX_MS_TO_TICK(UX_DEVICE_CLASS_RNDIS_PACKET_POOL_WAIT)); if (status == NX_SUCCESS) { @@ -161,7 +166,7 @@ ULONG packet_payload; /* Copy the received packet in the IP packet data area. */ - _ux_utility_memory_copy(packet -> nx_packet_prepend_ptr, transfer_request -> ux_slave_transfer_request_data_pointer + UX_DEVICE_CLASS_RNDIS_PACKET_BUFFER, packet_payload); + _ux_utility_memory_copy(packet -> nx_packet_prepend_ptr, transfer_request -> ux_slave_transfer_request_data_pointer + UX_DEVICE_CLASS_RNDIS_PACKET_BUFFER, packet_payload); /* Use case of memcpy is verified. */ /* Calculate the accurate packet length from ip header */ if((*(packet -> nx_packet_prepend_ptr + 12) == 0x08) && 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 b7ed5b1..edf09eb 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 @@ -28,12 +28,18 @@ #include "ux_device_class_rndis.h" #include "ux_device_stack.h" + +#if UX_SLAVE_REQUEST_CONTROL_MAX_LENGTH < UX_DEVICE_CLASS_RNDIS_INTERRUPT_RESPONSE_LENGTH ||\ + UX_SLAVE_REQUEST_CONTROL_MAX_LENGTH < UX_DEVICE_CLASS_RNDIS_MAX_CONTROL_RESPONSE_LENGTH +#error UX_SLAVE_REQUEST_CONTROL_MAX_LENGTH too small, please check +#endif + /**************************************************************************/ /* */ /* FUNCTION RELEASE */ /* */ /* _ux_device_class_rndis_control_request PORTABLE C */ -/* 6.0 */ +/* 6.1 */ /* AUTHOR */ /* */ /* Chaoqiong Xiao, Microsoft Corporation */ @@ -74,6 +80,12 @@ /* DATE NAME DESCRIPTION */ /* */ /* 05-19-2020 Chaoqiong Xiao Initial Version 6.0 */ +/* 09-30-2020 Chaoqiong Xiao Modified comment(s), */ +/* verified memset and memcpy */ +/* cases, used UX prefix to */ +/* refer to TX symbols instead */ +/* of using them directly, */ +/* resulting in version 6.1 */ /* */ /**************************************************************************/ UINT _ux_device_class_rndis_control_request(UX_SLAVE_CLASS_COMMAND *command) @@ -163,13 +175,13 @@ UX_SLAVE_CLASS_RNDIS *rndis; transfer_request_in = &rndis -> ux_slave_class_rndis_interrupt_endpoint -> ux_slave_endpoint_transfer_request; /* Reset the buffer. */ - _ux_utility_memory_set(transfer_request_in -> ux_slave_transfer_request_data_pointer, 0, UX_DEVICE_CLASS_RNDIS_INTERRUPT_RESPONSE_LENGTH); + _ux_utility_memory_set(transfer_request_in -> ux_slave_transfer_request_data_pointer, 0, UX_DEVICE_CLASS_RNDIS_INTERRUPT_RESPONSE_LENGTH); /* Use case of memset is verified. */ /* Set the buffer of this transfer request with the flag for response available. */ transfer_request_in -> ux_slave_transfer_request_data_pointer[0] = UX_DEVICE_CLASS_RNDIS_INTERRUPT_RESPONSE_AVAILABLE_FLAG; /* Set an event to wake up the interrupt thread. */ - _ux_utility_event_flags_set(&rndis -> ux_slave_class_rndis_event_flags_group, UX_DEVICE_CLASS_RNDIS_NEW_INTERRUPT_EVENT, TX_OR); + _ux_utility_event_flags_set(&rndis -> ux_slave_class_rndis_event_flags_group, UX_DEVICE_CLASS_RNDIS_NEW_INTERRUPT_EVENT, UX_OR); break; @@ -178,7 +190,7 @@ UX_SLAVE_CLASS_RNDIS *rndis; /* Copy the response into the request data buffer. */ _ux_utility_memory_copy(transfer_request -> ux_slave_transfer_request_data_pointer, rndis -> ux_slave_class_rndis_response, - rndis -> ux_slave_class_rndis_response_length); + rndis -> ux_slave_class_rndis_response_length); /* Use case of memcpy is verified. */ /* Set the phase of the transfer to data out. */ transfer_request -> ux_slave_transfer_request_phase = UX_TRANSFER_PHASE_DATA_OUT; diff --git a/common/usbx_device_classes/src/ux_device_class_rndis_deactivate.c b/common/usbx_device_classes/src/ux_device_class_rndis_deactivate.c index c47748c..2956aec 100644 --- a/common/usbx_device_classes/src/ux_device_class_rndis_deactivate.c +++ b/common/usbx_device_classes/src/ux_device_class_rndis_deactivate.c @@ -34,7 +34,7 @@ /* FUNCTION RELEASE */ /* */ /* _ux_device_class_rndis_deactivate PORTABLE C */ -/* 6.0 */ +/* 6.1 */ /* AUTHOR */ /* */ /* Chaoqiong Xiao, Microsoft Corporation */ @@ -67,6 +67,11 @@ /* DATE NAME DESCRIPTION */ /* */ /* 05-19-2020 Chaoqiong Xiao Initial Version 6.0 */ +/* 09-30-2020 Chaoqiong Xiao Modified comment(s), */ +/* used UX prefix to refer to */ +/* TX symbols instead of using */ +/* them directly, */ +/* resulting in version 6.1 */ /* */ /**************************************************************************/ UINT _ux_device_class_rndis_deactivate(UX_SLAVE_CLASS_COMMAND *command) @@ -104,7 +109,7 @@ UX_SLAVE_CLASS *class; /* We have 2 threads waiting for an event, interrupt and bulk in. We wake them up with a DEVICE_STATE_CHANGE event. In turn they will release the NetX resources used and suspend. */ - _ux_utility_event_flags_set(&rndis -> ux_slave_class_rndis_event_flags_group, UX_DEVICE_CLASS_RNDIS_NEW_DEVICE_STATE_CHANGE_EVENT, TX_OR); + _ux_utility_event_flags_set(&rndis -> ux_slave_class_rndis_event_flags_group, UX_DEVICE_CLASS_RNDIS_NEW_DEVICE_STATE_CHANGE_EVENT, UX_OR); /* If there is a deactivate function call it. */ if (rndis -> ux_slave_class_rndis_parameter.ux_slave_class_rndis_instance_deactivate != UX_NULL) diff --git a/common/usbx_device_classes/src/ux_device_class_rndis_entry.c b/common/usbx_device_classes/src/ux_device_class_rndis_entry.c index c8199b9..4976f9e 100644 --- a/common/usbx_device_classes/src/ux_device_class_rndis_entry.c +++ b/common/usbx_device_classes/src/ux_device_class_rndis_entry.c @@ -33,8 +33,8 @@ /* */ /* FUNCTION RELEASE */ /* */ -/* _ux_class_device_rndis_entry PORTABLE C */ -/* 6.0 */ +/* _ux_device_class_rndis_entry PORTABLE C */ +/* 6.1 */ /* AUTHOR */ /* */ /* Chaoqiong Xiao, Microsoft Corporation */ @@ -70,6 +70,8 @@ /* 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 */ /* */ /**************************************************************************/ UINT _ux_device_class_rndis_entry(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 43eab26..54aec46 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.0 */ +/* 6.1 */ /* AUTHOR */ /* */ /* Chaoqiong Xiao, Microsoft Corporation */ @@ -120,6 +120,12 @@ ULONG ux_device_class_rndis_oid_supported_list[UX_DEVICE_CLASS_RNDIS_OID_SUPPORT /* DATE NAME DESCRIPTION */ /* */ /* 05-19-2020 Chaoqiong Xiao Initial Version 6.0 */ +/* 09-30-2020 Chaoqiong Xiao Modified comment(s), */ +/* verified memset and memcpy */ +/* cases, used UX prefix to */ +/* refer to TX symbols instead */ +/* of using them directly, */ +/* resulting in version 6.1 */ /* */ /**************************************************************************/ UINT _ux_device_class_rndis_initialize(UX_SLAVE_CLASS_COMMAND *command) @@ -161,14 +167,14 @@ UINT status; /* Copy the local node ID. */ _ux_utility_memory_copy(rndis -> ux_slave_class_rndis_local_node_id, rndis_parameter -> ux_slave_class_rndis_parameter_local_node_id, - UX_DEVICE_CLASS_RNDIS_NODE_ID_LENGTH); + UX_DEVICE_CLASS_RNDIS_NODE_ID_LENGTH); /* Use case of memcpy is verified. */ /* Copy the remote node ID. */ _ux_utility_memory_copy(rndis -> ux_slave_class_rndis_remote_node_id, rndis_parameter -> ux_slave_class_rndis_parameter_remote_node_id, - UX_DEVICE_CLASS_RNDIS_NODE_ID_LENGTH); + UX_DEVICE_CLASS_RNDIS_NODE_ID_LENGTH); /* Use case of memcpy is verified. */ /* Store the rest of the parameters as they are in the local instance. */ - _ux_utility_memory_copy(&rndis -> ux_slave_class_rndis_parameter, rndis_parameter, sizeof (UX_SLAVE_CLASS_RNDIS_PARAMETER)); + _ux_utility_memory_copy(&rndis -> ux_slave_class_rndis_parameter, rndis_parameter, sizeof (UX_SLAVE_CLASS_RNDIS_PARAMETER)); /* Use case of memcpy is verified. */ /* Create a mutex to protect the RNDIS thread and the application messing up the transmit queue. */ status = _ux_utility_mutex_create(&rndis -> ux_slave_class_rndis_mutex, "ux_slave_class_rndis_mutex"); @@ -197,7 +203,7 @@ UINT status; _ux_device_class_rndis_interrupt_thread, (ULONG) (ALIGN_TYPE) class, (VOID *) rndis -> ux_slave_class_rndis_interrupt_thread_stack , UX_THREAD_STACK_SIZE, UX_THREAD_PRIORITY_CLASS, - UX_THREAD_PRIORITY_CLASS, UX_NO_TIME_SLICE, TX_DONT_START); + UX_THREAD_PRIORITY_CLASS, UX_NO_TIME_SLICE, UX_DONT_START); /* Check the creation of this thread. */ if (status != UX_SUCCESS) @@ -226,7 +232,7 @@ UINT status; _ux_device_class_rndis_bulkout_thread, (ULONG) (ALIGN_TYPE) class, (VOID *) rndis -> ux_slave_class_rndis_bulkout_thread_stack , UX_THREAD_STACK_SIZE, UX_THREAD_PRIORITY_CLASS, - UX_THREAD_PRIORITY_CLASS, UX_NO_TIME_SLICE, TX_DONT_START); + UX_THREAD_PRIORITY_CLASS, UX_NO_TIME_SLICE, UX_DONT_START); /* Check the creation of this thread. */ if (status != UX_SUCCESS) @@ -255,7 +261,7 @@ UINT status; _ux_device_class_rndis_bulkin_thread, (ULONG) (ALIGN_TYPE) class, (VOID *) rndis -> ux_slave_class_rndis_bulkin_thread_stack , UX_THREAD_STACK_SIZE, UX_THREAD_PRIORITY_CLASS, - UX_THREAD_PRIORITY_CLASS, UX_NO_TIME_SLICE, TX_DONT_START); + UX_THREAD_PRIORITY_CLASS, UX_NO_TIME_SLICE, UX_DONT_START); /* Check the creation of this thread. */ if (status != UX_SUCCESS) diff --git a/common/usbx_device_classes/src/ux_device_class_rndis_interrupt_thread.c b/common/usbx_device_classes/src/ux_device_class_rndis_interrupt_thread.c index 01e3463..ad55242 100644 --- a/common/usbx_device_classes/src/ux_device_class_rndis_interrupt_thread.c +++ b/common/usbx_device_classes/src/ux_device_class_rndis_interrupt_thread.c @@ -34,7 +34,7 @@ /* FUNCTION RELEASE */ /* */ /* _ux_device_class_rndis_interrupt_thread PORTABLE C */ -/* 6.0 */ +/* 6.1 */ /* AUTHOR */ /* */ /* Chaoqiong Xiao, Microsoft Corporation */ @@ -67,6 +67,11 @@ /* DATE NAME DESCRIPTION */ /* */ /* 05-19-2020 Chaoqiong Xiao Initial Version 6.0 */ +/* 09-30-2020 Chaoqiong Xiao Modified comment(s), */ +/* used UX prefix to refer to */ +/* TX symbols instead of using */ +/* them directly, */ +/* resulting in version 6.1 */ /* */ /**************************************************************************/ VOID _ux_device_class_rndis_interrupt_thread(ULONG rndis_class) @@ -104,7 +109,7 @@ ULONG actual_flags; on the interrupt pipe frequency or a change in the idle state forces us to send an empty report. */ status = _ux_utility_event_flags_get(&rndis -> ux_slave_class_rndis_event_flags_group, (UX_DEVICE_CLASS_RNDIS_NEW_INTERRUPT_EVENT | UX_DEVICE_CLASS_RNDIS_NEW_DEVICE_STATE_CHANGE_EVENT), - TX_OR_CLEAR, &actual_flags, TX_WAIT_FOREVER); + UX_OR_CLEAR, &actual_flags, UX_WAIT_FOREVER); /* If error log is enabled, insert this error message into the log buffer. */ diff --git a/common/usbx_device_classes/src/ux_device_class_rndis_msg_initialize.c b/common/usbx_device_classes/src/ux_device_class_rndis_msg_initialize.c index 6e1c7c3..1cc091b 100644 --- a/common/usbx_device_classes/src/ux_device_class_rndis_msg_initialize.c +++ b/common/usbx_device_classes/src/ux_device_class_rndis_msg_initialize.c @@ -34,7 +34,7 @@ /* FUNCTION RELEASE */ /* */ /* _ux_device_class_rndis_msg_initialize PORTABLE C */ -/* 6.0 */ +/* 6.1 */ /* AUTHOR */ /* */ /* Chaoqiong Xiao, Microsoft Corporation */ @@ -67,6 +67,8 @@ /* 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 */ /* */ /**************************************************************************/ UINT _ux_device_class_rndis_msg_initialize(UX_SLAVE_CLASS_RNDIS *rndis, UX_SLAVE_TRANSFER *transfer_request) diff --git a/common/usbx_device_classes/src/ux_device_class_rndis_msg_keep_alive.c b/common/usbx_device_classes/src/ux_device_class_rndis_msg_keep_alive.c index ad0abd0..481eff0 100644 --- a/common/usbx_device_classes/src/ux_device_class_rndis_msg_keep_alive.c +++ b/common/usbx_device_classes/src/ux_device_class_rndis_msg_keep_alive.c @@ -34,7 +34,7 @@ /* FUNCTION RELEASE */ /* */ /* _ux_device_class_rndis_msg_keep_alive PORTABLE C */ -/* 6.0 */ +/* 6.1 */ /* AUTHOR */ /* */ /* Chaoqiong Xiao, Microsoft Corporation */ @@ -66,6 +66,8 @@ /* 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 */ /* */ /**************************************************************************/ UINT _ux_device_class_rndis_msg_keep_alive(UX_SLAVE_CLASS_RNDIS *rndis, UX_SLAVE_TRANSFER *transfer_request) diff --git a/common/usbx_device_classes/src/ux_device_class_rndis_msg_query.c b/common/usbx_device_classes/src/ux_device_class_rndis_msg_query.c index a2b6b33..1cdee77 100644 --- a/common/usbx_device_classes/src/ux_device_class_rndis_msg_query.c +++ b/common/usbx_device_classes/src/ux_device_class_rndis_msg_query.c @@ -35,7 +35,7 @@ /* FUNCTION RELEASE */ /* */ /* _ux_device_class_rndis_msg_query PORTABLE C */ -/* 6.0 */ +/* 6.1 */ /* AUTHOR */ /* */ /* Chaoqiong Xiao, Microsoft Corporation */ @@ -69,6 +69,10 @@ /* DATE NAME DESCRIPTION */ /* */ /* 05-19-2020 Chaoqiong Xiao Initial Version 6.0 */ +/* 09-30-2020 Chaoqiong Xiao Modified comment(s), */ +/* verified memset and memcpy */ +/* cases, */ +/* resulting in version 6.1 */ /* */ /**************************************************************************/ UINT _ux_device_class_rndis_msg_query(UX_SLAVE_CLASS_RNDIS *rndis, UX_SLAVE_TRANSFER *transfer_request) @@ -255,7 +259,7 @@ ULONG status; rndis_response_length = (ULONG) rndis_response_string_length; /* Copy the vendor description. */ - _ux_utility_memory_copy(rndis_response + UX_DEVICE_CLASS_RNDIS_CMPLT_QUERY_INFO_BUFFER, rndis -> ux_slave_class_rndis_parameter.ux_slave_class_rndis_parameter_vendor_description, rndis_response_length); + _ux_utility_memory_copy(rndis_response + UX_DEVICE_CLASS_RNDIS_CMPLT_QUERY_INFO_BUFFER, rndis -> ux_slave_class_rndis_parameter.ux_slave_class_rndis_parameter_vendor_description, rndis_response_length); /* Use case of memcpy is verified. */ break; @@ -314,7 +318,7 @@ ULONG status; /* Save the Hardware address in the return message. */ _ux_utility_memory_copy(rndis_response + UX_DEVICE_CLASS_RNDIS_CMPLT_QUERY_INFO_BUFFER, - rndis -> ux_slave_class_rndis_remote_node_id, UX_DEVICE_CLASS_RNDIS_NODE_ID_LENGTH); + rndis -> ux_slave_class_rndis_remote_node_id, UX_DEVICE_CLASS_RNDIS_NODE_ID_LENGTH); /* Use case of memcpy is verified. */ /* Set the total response length. */ rndis_response_length = UX_DEVICE_CLASS_RNDIS_NODE_ID_LENGTH; diff --git a/common/usbx_device_classes/src/ux_device_class_rndis_msg_reset.c b/common/usbx_device_classes/src/ux_device_class_rndis_msg_reset.c index fbb4319..e40ecaa 100644 --- a/common/usbx_device_classes/src/ux_device_class_rndis_msg_reset.c +++ b/common/usbx_device_classes/src/ux_device_class_rndis_msg_reset.c @@ -34,7 +34,7 @@ /* FUNCTION RELEASE */ /* */ /* _ux_device_class_rndis_msg_reset PORTABLE C */ -/* 6.0 */ +/* 6.1 */ /* AUTHOR */ /* */ /* Chaoqiong Xiao, Microsoft Corporation */ @@ -65,6 +65,8 @@ /* 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 */ /* */ /**************************************************************************/ UINT _ux_device_class_rndis_msg_reset(UX_SLAVE_CLASS_RNDIS *rndis, UX_SLAVE_TRANSFER *transfer_request) diff --git a/common/usbx_device_classes/src/ux_device_class_rndis_msg_set.c b/common/usbx_device_classes/src/ux_device_class_rndis_msg_set.c index 1f5faa7..111bec7 100644 --- a/common/usbx_device_classes/src/ux_device_class_rndis_msg_set.c +++ b/common/usbx_device_classes/src/ux_device_class_rndis_msg_set.c @@ -33,7 +33,7 @@ /* FUNCTION RELEASE */ /* */ /* _ux_device_class_rndis_msg_set PORTABLE C */ -/* 6.0 */ +/* 6.1 */ /* AUTHOR */ /* */ /* Chaoqiong Xiao, Microsoft Corporation */ @@ -65,6 +65,8 @@ /* 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 */ /* */ /**************************************************************************/ UINT _ux_device_class_rndis_msg_set(UX_SLAVE_CLASS_RNDIS *rndis, UX_SLAVE_TRANSFER *transfer_request) diff --git a/common/usbx_device_classes/src/ux_device_class_rndis_write.c b/common/usbx_device_classes/src/ux_device_class_rndis_write.c index a21615f..4c695db 100644 --- a/common/usbx_device_classes/src/ux_device_class_rndis_write.c +++ b/common/usbx_device_classes/src/ux_device_class_rndis_write.c @@ -34,7 +34,7 @@ /* FUNCTION RELEASE */ /* */ /* _ux_device_class_rndis_write PORTABLE C */ -/* 6.0 */ +/* 6.1 */ /* AUTHOR */ /* */ /* Chaoqiong Xiao, Microsoft Corporation */ @@ -68,6 +68,11 @@ /* DATE NAME DESCRIPTION */ /* */ /* 05-19-2020 Chaoqiong Xiao Initial Version 6.0 */ +/* 09-30-2020 Chaoqiong Xiao Modified comment(s), */ +/* used UX prefix to refer to */ +/* TX symbols instead of using */ +/* them directly, */ +/* resulting in version 6.1 */ /* */ /**************************************************************************/ UINT _ux_device_class_rndis_write(VOID *rndis_class, NX_PACKET *packet) @@ -121,7 +126,7 @@ UX_SLAVE_CLASS_RNDIS *rndis; packet -> nx_packet_queue_next = NX_NULL; /* Set an event to wake up the bulkin thread. */ - _ux_utility_event_flags_set(&rndis -> ux_slave_class_rndis_event_flags_group, UX_DEVICE_CLASS_RNDIS_NEW_BULKIN_EVENT, TX_OR); + _ux_utility_event_flags_set(&rndis -> ux_slave_class_rndis_event_flags_group, UX_DEVICE_CLASS_RNDIS_NEW_BULKIN_EVENT, UX_OR); /* We are done here. */ return(UX_SUCCESS); 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 1429e09..2a45a2c 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.0 */ +/* 6.1 */ /* AUTHOR */ /* */ /* Chaoqiong Xiao, Microsoft Corporation */ @@ -65,6 +65,8 @@ /* 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 */ /* */ /**************************************************************************/ UINT _ux_device_class_storage_activate(UX_SLAVE_CLASS_COMMAND *command) diff --git a/common/usbx_device_classes/src/ux_device_class_storage_control_request.c b/common/usbx_device_classes/src/ux_device_class_storage_control_request.c index 895e674..bd9925d 100644 --- a/common/usbx_device_classes/src/ux_device_class_storage_control_request.c +++ b/common/usbx_device_classes/src/ux_device_class_storage_control_request.c @@ -35,7 +35,7 @@ /* FUNCTION RELEASE */ /* */ /* _ux_device_class_storage_control_request PORTABLE C */ -/* 6.0 */ +/* 6.1 */ /* AUTHOR */ /* */ /* Chaoqiong Xiao, Microsoft Corporation */ @@ -67,6 +67,9 @@ /* DATE NAME DESCRIPTION */ /* */ /* 05-19-2020 Chaoqiong Xiao Initial Version 6.0 */ +/* 09-30-2020 Chaoqiong Xiao Modified comment(s), */ +/* optimized command logic, */ +/* resulting in version 6.1 */ /* */ /**************************************************************************/ UINT _ux_device_class_storage_control_request(UX_SLAVE_CLASS_COMMAND *command) @@ -135,7 +138,7 @@ UX_SLAVE_ENDPOINT *endpoint_out; _ux_device_stack_transfer_abort(transfer_request, UX_TRANSFER_APPLICATION_RESET); /* Reset phase error. */ - storage -> ux_slave_class_storage_phase_error = UX_FALSE; + storage -> ux_slave_class_storage_csw_status = UX_SLAVE_CLASS_STORAGE_CSW_PASSED; break; 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 9df0fa6..8e9374a 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 @@ -29,12 +29,16 @@ #include "ux_device_class_storage.h" #include "ux_device_stack.h" +#if UX_SLAVE_REQUEST_DATA_MAX_LENGTH < UX_SLAVE_CLASS_STORAGE_CSW_LENGTH +#error UX_SLAVE_REQUEST_DATA_MAX_LENGTH too small, please check +#endif + /**************************************************************************/ /* */ /* FUNCTION RELEASE */ /* */ /* _ux_device_class_storage_csw_send PORTABLE C */ -/* 6.0 */ +/* 6.1 */ /* AUTHOR */ /* */ /* Chaoqiong Xiao, Microsoft Corporation */ @@ -71,6 +75,11 @@ /* DATE NAME DESCRIPTION */ /* */ /* 05-19-2020 Chaoqiong Xiao Initial Version 6.0 */ +/* 09-30-2020 Chaoqiong Xiao Modified comment(s), */ +/* optimized command logic, */ +/* verified memset and memcpy */ +/* cases, */ +/* resulting in version 6.1 */ /* */ /**************************************************************************/ UINT _ux_device_class_storage_csw_send(UX_SLAVE_CLASS_STORAGE *storage, ULONG lun, @@ -79,13 +88,23 @@ UINT _ux_device_class_storage_csw_send(UX_SLAVE_CLASS_STORAGE *storage, ULONG l UINT status; UX_SLAVE_TRANSFER *transfer_request; -UCHAR csw_buffer[UX_SLAVE_CLASS_STORAGE_CSW_LENGTH]; +UCHAR *csw_buffer; + + + UX_PARAMETER_NOT_USED(csw_status); + + /* If CSW skipped, just return. */ + if (UX_DEVICE_CLASS_STORAGE_CSW_SKIP(&storage -> ux_slave_class_storage_csw_status)) + return(UX_SUCCESS); /* Obtain the pointer to the transfer request. */ transfer_request = &endpoint_in -> ux_slave_endpoint_transfer_request; + /* Get CSW buffer pointer. */ + csw_buffer = transfer_request -> ux_slave_transfer_request_data_pointer; + /* Ensure it is cleaned. */ - _ux_utility_memory_set(csw_buffer, 0, UX_SLAVE_CLASS_STORAGE_CSW_LENGTH); + _ux_utility_memory_set(csw_buffer, 0, UX_SLAVE_CLASS_STORAGE_CSW_LENGTH); /* Use case of memset is verified. */ /* Store the signature of the CSW. */ _ux_utility_long_put(&csw_buffer[UX_SLAVE_CLASS_STORAGE_CSW_SIGNATURE], UX_SLAVE_CLASS_STORAGE_CSW_SIGNATURE_MASK); @@ -94,11 +113,7 @@ UCHAR csw_buffer[UX_SLAVE_CLASS_STORAGE_CSW_LENGTH]; _ux_utility_long_put(&csw_buffer[UX_SLAVE_CLASS_STORAGE_CSW_TAG], storage -> ux_slave_class_storage_lun[lun].ux_slave_class_storage_scsi_tag); /* Store the status of the previous operation. */ - csw_buffer[UX_SLAVE_CLASS_STORAGE_CSW_STATUS] = csw_status; - - /* Copy the CSW into the transfer request memory. */ - _ux_utility_memory_copy(transfer_request -> ux_slave_transfer_request_data_pointer, - csw_buffer, UX_SLAVE_CLASS_STORAGE_CSW_LENGTH); + csw_buffer[UX_SLAVE_CLASS_STORAGE_CSW_STATUS] = (UCHAR)storage -> ux_slave_class_storage_csw_status; /* We may be in a special state machine condition where the endpoint is stalled waiting for a CLEAR_FEATURE. We will wait until the host clears the endpoint. diff --git a/common/usbx_device_classes/src/ux_device_class_storage_deactivate.c b/common/usbx_device_classes/src/ux_device_class_storage_deactivate.c index ef20dd0..15aa953 100644 --- a/common/usbx_device_classes/src/ux_device_class_storage_deactivate.c +++ b/common/usbx_device_classes/src/ux_device_class_storage_deactivate.c @@ -35,7 +35,7 @@ /* FUNCTION RELEASE */ /* */ /* _ux_device_class_storage_deactivate PORTABLE C */ -/* 6.0 */ +/* 6.1 */ /* AUTHOR */ /* */ /* Chaoqiong Xiao, Microsoft Corporation */ @@ -65,6 +65,8 @@ /* 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 */ /* */ /**************************************************************************/ UINT _ux_device_class_storage_deactivate(UX_SLAVE_CLASS_COMMAND *command) 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 97cb88f..c030d54 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 @@ -34,8 +34,8 @@ /* */ /* FUNCTION RELEASE */ /* */ -/* _ux_class_device_storage_entry PORTABLE C */ -/* 6.0 */ +/* _ux_device_class_storage_entry PORTABLE C */ +/* 6.1 */ /* AUTHOR */ /* */ /* Chaoqiong Xiao, Microsoft Corporation */ @@ -73,6 +73,8 @@ /* 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 */ /* */ /**************************************************************************/ UINT _ux_device_class_storage_entry(UX_SLAVE_CLASS_COMMAND *command) diff --git a/common/usbx_device_classes/src/ux_device_class_storage_format.c b/common/usbx_device_classes/src/ux_device_class_storage_format.c index 66a83a5..b972ae7 100644 --- a/common/usbx_device_classes/src/ux_device_class_storage_format.c +++ b/common/usbx_device_classes/src/ux_device_class_storage_format.c @@ -35,7 +35,7 @@ /* FUNCTION RELEASE */ /* */ /* _ux_device_class_storage_format PORTABLE C */ -/* 6.0 */ +/* 6.1 */ /* AUTHOR */ /* */ /* Chaoqiong Xiao, Microsoft Corporation */ @@ -70,6 +70,9 @@ /* DATE NAME DESCRIPTION */ /* */ /* 05-19-2020 Chaoqiong Xiao Initial Version 6.0 */ +/* 09-30-2020 Chaoqiong Xiao Modified comment(s), */ +/* optimized command logic, */ +/* resulting in version 6.1 */ /* */ /**************************************************************************/ UINT _ux_device_class_storage_format(UX_SLAVE_CLASS_STORAGE *storage, ULONG lun, UX_SLAVE_ENDPOINT *endpoint_in, @@ -77,6 +80,7 @@ UINT _ux_device_class_storage_format(UX_SLAVE_CLASS_STORAGE *storage, ULONG lun { UX_PARAMETER_NOT_USED(cbwcb); + UX_PARAMETER_NOT_USED(endpoint_in); /* If trace is enabled, insert this event into the trace buffer. */ UX_TRACE_IN_LINE_INSERT(UX_TRACE_DEVICE_CLASS_STORAGE_FORMAT, storage, lun, 0, 0, UX_TRACE_DEVICE_CLASS_EVENTS, 0, 0) @@ -85,13 +89,12 @@ UINT _ux_device_class_storage_format(UX_SLAVE_CLASS_STORAGE *storage, ULONG lun OUT endpoint because we expect the host to send parameters. */ _ux_device_stack_endpoint_stall(endpoint_out); - /* Now we return a CSW with failure. */ - _ux_device_class_storage_csw_send(storage, lun, endpoint_in, UX_SLAVE_CLASS_STORAGE_CSW_FAILED); - /* And update the REQUEST_SENSE codes. */ - storage -> ux_slave_class_storage_lun[lun].ux_slave_class_storage_request_sense_key = 0x05; - storage -> ux_slave_class_storage_lun[lun].ux_slave_class_storage_request_code = 0x26; - storage -> ux_slave_class_storage_lun[lun].ux_slave_class_storage_request_code_qualifier = 0x01; + storage -> ux_slave_class_storage_lun[lun].ux_slave_class_storage_request_sense_status = + UX_DEVICE_CLASS_STORAGE_SENSE_STATUS(0x05,0x26,0x01); + + /* Now we set the CSW with failure. */ + storage -> ux_slave_class_storage_csw_status = UX_SLAVE_CLASS_STORAGE_CSW_FAILED; /* If trace is enabled, insert this event into the trace buffer. */ UX_TRACE_IN_LINE_INSERT(UX_TRACE_ERROR, UX_FUNCTION_NOT_SUPPORTED, 0, 0, 0, UX_TRACE_ERRORS, 0, 0) 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 8b50ab9..0948742 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 @@ -291,13 +291,18 @@ UCHAR usbx_device_class_storage_configuration_active_profile[] = { }; +#if (UX_SLAVE_REQUEST_DATA_MAX_LENGTH < USBX_DEVICE_CLASS_STORAGE_CONFIGURATION_ACTIVE_PROFILE_LENGTH) ||\ + (UX_SLAVE_REQUEST_DATA_MAX_LENGTH < USBX_DEVICE_CLASS_STORAGE_CONFIGURATION_PROFILE_LENGTH) +#error UX_SLAVE_REQUEST_DATA_MAX_LENGTH too small, please check +#endif + /**************************************************************************/ /* */ /* FUNCTION RELEASE */ /* */ /* _ux_device_class_storage_get_configuration PORTABLE C */ -/* 6.0 */ +/* 6.1 */ /* AUTHOR */ /* */ /* Chaoqiong Xiao, Microsoft Corporation */ @@ -335,6 +340,11 @@ UCHAR usbx_device_class_storage_configuration_active_profile[] = { /* DATE NAME DESCRIPTION */ /* */ /* 05-19-2020 Chaoqiong Xiao Initial Version 6.0 */ +/* 09-30-2020 Chaoqiong Xiao Modified comment(s), */ +/* optimized command logic, */ +/* verified memset and memcpy */ +/* cases, */ +/* resulting in version 6.1 */ /* */ /**************************************************************************/ UINT _ux_device_class_storage_get_configuration(UX_SLAVE_CLASS_STORAGE *storage, ULONG lun, @@ -371,6 +381,9 @@ ULONG feature; /* Get the allocation length. */ allocation_length = _ux_utility_short_get_big_endian(cbwcb + UX_SLAVE_CLASS_STORAGE_GET_CONFIGURATION_ALLOCATION_LENGTH); + /* Default CSW to success. */ + storage -> ux_slave_class_storage_csw_status = UX_SLAVE_CLASS_STORAGE_CSW_PASSED; + /* Is the request demanding all the features ? */ if (starting_feature == 0) { @@ -390,7 +403,7 @@ ULONG feature; /* Copy the CSW into the transfer request memory. */ _ux_utility_memory_copy(transfer_request -> ux_slave_transfer_request_data_pointer, usbx_device_class_storage_configuration_active_profile, - allocation_length); + allocation_length); /* Use case of memcpy is verified. */ } else { @@ -406,7 +419,7 @@ ULONG feature; /* Copy the CSW into the transfer request memory. */ _ux_utility_memory_copy(transfer_request -> ux_slave_transfer_request_data_pointer, usbx_device_class_storage_configuration_profile, - allocation_length); + allocation_length); /* Use case of memcpy is verified. */ } @@ -415,8 +428,8 @@ ULONG feature; allocation_length, allocation_length); - /* Now we return a CSW with success. */ - status = _ux_device_class_storage_csw_send(storage, lun, endpoint_in, UX_SLAVE_CLASS_STORAGE_CSW_PASSED); + /* Now success. */ + status = UX_SUCCESS; } else { @@ -451,15 +464,15 @@ ULONG feature; /* Copy the CSW into the transfer request memory. */ _ux_utility_memory_copy(transfer_request -> ux_slave_transfer_request_data_pointer, profile_pointer, - allocation_length); + allocation_length); /* Use case of memcpy is verified. */ /* Send a data payload with the read_capacity response buffer. */ _ux_device_stack_transfer_request(transfer_request, allocation_length, allocation_length); - /* Now we return a CSW with success. */ - status = _ux_device_class_storage_csw_send(storage, lun, endpoint_in, UX_SLAVE_CLASS_STORAGE_CSW_PASSED); + /* Now success. */ + status = UX_SUCCESS; /* Get out of the loop. */ break; @@ -474,13 +487,12 @@ ULONG feature; /* We are either at the end of the profile or the profile is corrupted. */ _ux_device_stack_endpoint_stall(endpoint_in); - /* Now we return a CSW with failure. */ - _ux_device_class_storage_csw_send(storage, lun, endpoint_in, UX_SLAVE_CLASS_STORAGE_CSW_FAILED); - /* And update the REQUEST_SENSE codes. */ - storage -> ux_slave_class_storage_lun[lun].ux_slave_class_storage_request_sense_key = UX_SLAVE_CLASS_STORAGE_SENSE_KEY_ILLEGAL_REQUEST; - storage -> ux_slave_class_storage_lun[lun].ux_slave_class_storage_request_code = 0x26; - storage -> ux_slave_class_storage_lun[lun].ux_slave_class_storage_request_code_qualifier = 0x02; + storage -> ux_slave_class_storage_lun[lun].ux_slave_class_storage_request_sense_status = + UX_DEVICE_CLASS_STORAGE_SENSE_STATUS(UX_SLAVE_CLASS_STORAGE_SENSE_KEY_ILLEGAL_REQUEST,0x26,0x02); + + /* Now we set the CSW with failure. */ + storage -> ux_slave_class_storage_csw_status = UX_SLAVE_CLASS_STORAGE_CSW_FAILED; /* Set status to error. */ status = UX_ERROR; 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 b50025b..5da7514 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 @@ -30,6 +30,9 @@ #include "ux_device_stack.h" #define USBX_DEVICE_CLASS_STORAGE_GET_PERFORMANCE_0_LENGTH 16 +#if UX_SLAVE_REQUEST_DATA_MAX_LENGTH < (USBX_DEVICE_CLASS_STORAGE_GET_PERFORMANCE_0_LENGTH + 8) +#error UX_SLAVE_REQUEST_DATA_MAX_LENGTH too small, please check +#endif UCHAR usbx_device_class_storage_performance[] = { 0x08, 0x00, 0x00, 0x00, 0x00, 0x23, 0x12, 0x80, @@ -41,7 +44,7 @@ UCHAR usbx_device_class_storage_performance[] = { /* FUNCTION RELEASE */ /* */ /* _ux_device_class_storage_get_performance PORTABLE C */ -/* 6.0 */ +/* 6.1 */ /* AUTHOR */ /* */ /* Chaoqiong Xiao, Microsoft Corporation */ @@ -78,6 +81,11 @@ UCHAR usbx_device_class_storage_performance[] = { /* DATE NAME DESCRIPTION */ /* */ /* 05-19-2020 Chaoqiong Xiao Initial Version 6.0 */ +/* 09-30-2020 Chaoqiong Xiao Modified comment(s), */ +/* optimized command logic, */ +/* verified memset and memcpy */ +/* cases, */ +/* resulting in version 6.1 */ /* */ /**************************************************************************/ UINT _ux_device_class_storage_get_performance(UX_SLAVE_CLASS_STORAGE *storage, @@ -91,6 +99,8 @@ UINT status; UX_SLAVE_TRANSFER *transfer_request; ULONG performance_page; + + UX_PARAMETER_NOT_USED(lun); UX_PARAMETER_NOT_USED(endpoint_out); /* If trace is enabled, insert this event into the trace buffer. */ @@ -100,7 +110,7 @@ ULONG performance_page; transfer_request = &endpoint_in -> ux_slave_endpoint_transfer_request; /* Ensure memory buffer cleaned. */ - _ux_utility_memory_set(transfer_request -> ux_slave_transfer_request_data_pointer, 0, 64); + _ux_utility_memory_set(transfer_request -> ux_slave_transfer_request_data_pointer, 0, 64); /* Use case of memset is verified. */ /* Get the performance page code. */ performance_page = (ULONG) *(cbwcb + UX_SLAVE_CLASS_STORAGE_GET_PERFORMANCE_PAGE); @@ -131,20 +141,16 @@ ULONG performance_page; /* Copy the CSW into the transfer request memory. */ _ux_utility_memory_copy(transfer_request -> ux_slave_transfer_request_data_pointer + 8, - usbx_device_class_storage_performance, USBX_DEVICE_CLASS_STORAGE_GET_PERFORMANCE_0_LENGTH); + usbx_device_class_storage_performance, USBX_DEVICE_CLASS_STORAGE_GET_PERFORMANCE_0_LENGTH); /* Use case of memcpy is verified. */ /* Send a data payload with the read_capacity response buffer. */ _ux_device_stack_transfer_request(transfer_request, USBX_DEVICE_CLASS_STORAGE_GET_PERFORMANCE_0_LENGTH + 8, USBX_DEVICE_CLASS_STORAGE_GET_PERFORMANCE_0_LENGTH + 8); break; } - /* Now we return a CSW with success. */ - status = _ux_device_class_storage_csw_send(storage, lun, endpoint_in, UX_SLAVE_CLASS_STORAGE_CSW_PASSED); - - /* And update the REQUEST_SENSE codes. */ - storage -> ux_slave_class_storage_lun[lun].ux_slave_class_storage_request_sense_key = 0x00; - storage -> ux_slave_class_storage_lun[lun].ux_slave_class_storage_request_code = 0x00; - storage -> ux_slave_class_storage_lun[lun].ux_slave_class_storage_request_code_qualifier = 0x00; + /* Now we set the CSW with success. */ + storage -> ux_slave_class_storage_csw_status = UX_SLAVE_CLASS_STORAGE_CSW_PASSED; + status = UX_SUCCESS; /* Return completion status. */ return(status); diff --git a/common/usbx_device_classes/src/ux_device_class_storage_get_status_notification.c b/common/usbx_device_classes/src/ux_device_class_storage_get_status_notification.c index aaffd92..27f8eec 100644 --- a/common/usbx_device_classes/src/ux_device_class_storage_get_status_notification.c +++ b/common/usbx_device_classes/src/ux_device_class_storage_get_status_notification.c @@ -35,7 +35,7 @@ /* FUNCTION RELEASE */ /* */ /* _ux_device_class_storage_get_status_notification PORTABLE C */ -/* 6.0 */ +/* 6.1 */ /* AUTHOR */ /* */ /* Chaoqiong Xiao, Microsoft Corporation */ @@ -72,6 +72,11 @@ /* DATE NAME DESCRIPTION */ /* */ /* 05-19-2020 Chaoqiong Xiao Initial Version 6.0 */ +/* 09-30-2020 Chaoqiong Xiao Modified comment(s), */ +/* optimized command logic, */ +/* verified memset and memcpy */ +/* cases, */ +/* resulting in version 6.1 */ /* */ /**************************************************************************/ UINT _ux_device_class_storage_get_status_notification(UX_SLAVE_CLASS_STORAGE *storage, ULONG lun, @@ -88,7 +93,10 @@ ULONG notification_class; UX_PARAMETER_NOT_USED(endpoint_out); /* If trace is enabled, insert this event into the trace buffer. */ - UX_TRACE_IN_LINE_INSERT(UX_TRACE_DEVICE_CLASS_STORAGE_READ_CAPACITY, storage, lun, 0, 0, UX_TRACE_DEVICE_CLASS_EVENTS, 0, 0) + UX_TRACE_IN_LINE_INSERT(UX_TRACE_DEVICE_CLASS_STORAGE_READ_CAPACITY, storage, lun, 0, 0, UX_TRACE_DEVICE_CLASS_EVENTS, 0, 0); + + /* Default CSW to failed. */ + storage -> ux_slave_class_storage_csw_status = UX_SLAVE_CLASS_STORAGE_CSW_FAILED; /* Ensure the callback has been initialized. */ if (storage -> ux_slave_class_storage_lun[lun].ux_slave_class_storage_media_notification == UX_NULL) @@ -97,8 +105,9 @@ ULONG notification_class; /* We need to STALL the IN endpoint. The endpoint will be reset by the host. */ _ux_device_stack_endpoint_stall(endpoint_in); - /* Now we return a CSW with Error. */ - _ux_device_class_storage_csw_send(storage, lun, endpoint_in, UX_SLAVE_CLASS_STORAGE_CSW_FAILED); + /* And update the REQUEST_SENSE codes. */ + storage -> ux_slave_class_storage_lun[lun].ux_slave_class_storage_request_sense_status = + UX_DEVICE_CLASS_STORAGE_SENSE_STATUS(0x05,0x26,0x01); /* Return error. */ return(UX_FUNCTION_NOT_SUPPORTED); @@ -114,15 +123,26 @@ ULONG notification_class; &media_notification, &media_notification_length); + /* Check the notification length. */ + if (media_notification_length > UX_SLAVE_REQUEST_DATA_MAX_LENGTH - sizeof(USHORT)) + { + + /* If trace is enabled, insert this event into the trace buffer. */ + UX_TRACE_IN_LINE_INSERT(UX_TRACE_ERROR, UX_MEMORY_INSUFFICIENT, 0, 0, 0, UX_TRACE_ERRORS, 0, 0) + + /* Error callback. */ + _ux_system_error_handler(UX_SYSTEM_LEVEL_THREAD, UX_SYSTEM_CONTEXT_CLASS, UX_MEMORY_INSUFFICIENT); + + /* Set status code. */ + status = UX_MEMORY_INSUFFICIENT; + } + /* Check the status for error. */ if (status != UX_SUCCESS) { /* We need to STALL the IN endpoint. The endpoint will be reset by the host. */ _ux_device_stack_endpoint_stall(endpoint_in); - - /* Now we return a CSW with Error. */ - _ux_device_class_storage_csw_send(storage, lun, endpoint_in, UX_SLAVE_CLASS_STORAGE_CSW_FAILED); } else { @@ -136,7 +156,7 @@ ULONG notification_class; /* Copy the CSW into the transfer request memory. */ _ux_utility_memory_copy(transfer_request -> ux_slave_transfer_request_data_pointer + sizeof (USHORT), media_notification, - media_notification_length); + media_notification_length); /* Use case of memcpy is verified. */ /* Update the notification length. */ media_notification_length += (ULONG)sizeof (USHORT); @@ -146,8 +166,9 @@ ULONG notification_class; media_notification_length, media_notification_length); - /* Now we return a CSW with success. */ - status = _ux_device_class_storage_csw_send(storage, lun, endpoint_in, UX_SLAVE_CLASS_STORAGE_CSW_PASSED); + /* Now we set the CSW with success. */ + storage -> ux_slave_class_storage_csw_status = UX_SLAVE_CLASS_STORAGE_CSW_PASSED; + status = UX_SUCCESS; } /* Return completion status. */ 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 5d01ace..2855498 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.0 */ +/* 6.1 */ /* AUTHOR */ /* */ /* Chaoqiong Xiao, Microsoft Corporation */ @@ -74,6 +74,11 @@ UCHAR _ux_system_slave_class_storage_product_serial[] = "123 /* DATE NAME DESCRIPTION */ /* */ /* 05-19-2020 Chaoqiong Xiao Initial Version 6.0 */ +/* 09-30-2020 Chaoqiong Xiao Modified comment(s), */ +/* used UX prefix to refer to */ +/* TX symbols instead of using */ +/* them directly, */ +/* resulting in version 6.1 */ /* */ /**************************************************************************/ UINT _ux_device_class_storage_initialize(UX_SLAVE_CLASS_COMMAND *command) @@ -116,7 +121,7 @@ ULONG lun_index; _ux_device_class_storage_thread, (ULONG) (ALIGN_TYPE) class, (VOID *) class -> ux_slave_class_thread_stack, UX_THREAD_STACK_SIZE, UX_THREAD_PRIORITY_CLASS, - UX_THREAD_PRIORITY_CLASS, UX_NO_TIME_SLICE, TX_DONT_START); + UX_THREAD_PRIORITY_CLASS, UX_NO_TIME_SLICE, UX_DONT_START); else status = UX_MEMORY_INSUFFICIENT; 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 aa77c82..1cd1d05 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 @@ -30,12 +30,16 @@ #include "ux_device_stack.h" +#if UX_SLAVE_REQUEST_DATA_MAX_LENGTH < 24 +#error UX_SLAVE_REQUEST_DATA_MAX_LENGTH is too small, please check +#endif + /**************************************************************************/ /* */ /* FUNCTION RELEASE */ /* */ /* _ux_device_class_storage_inquiry PORTABLE C */ -/* 6.0 */ +/* 6.1 */ /* AUTHOR */ /* */ /* Chaoqiong Xiao, Microsoft Corporation */ @@ -73,6 +77,11 @@ /* DATE NAME DESCRIPTION */ /* */ /* 05-19-2020 Chaoqiong Xiao Initial Version 6.0 */ +/* 09-30-2020 Chaoqiong Xiao Modified comment(s), */ +/* optimized command logic, */ +/* verified memset and memcpy */ +/* cases, */ +/* resulting in version 6.1 */ /* */ /**************************************************************************/ UINT _ux_device_class_storage_inquiry(UX_SLAVE_CLASS_STORAGE *storage, ULONG lun, UX_SLAVE_ENDPOINT *endpoint_in, @@ -83,7 +92,7 @@ UINT status; UX_SLAVE_TRANSFER *transfer_request; UCHAR inquiry_page_code; UCHAR inquiry_length; -UCHAR inquiry_buffer[UX_SLAVE_CLASS_STORAGE_INQUIRY_RESPONSE_LENGTH]; +UCHAR *inquiry_buffer; UX_PARAMETER_NOT_USED(endpoint_out); @@ -99,13 +108,19 @@ UCHAR inquiry_buffer[UX_SLAVE_CLASS_STORAGE_INQUIRY_RESPONSE_L /* Obtain the pointer to the transfer request. */ transfer_request = &endpoint_in -> ux_slave_endpoint_transfer_request; + /* Obtain inquiry buffer pointer. */ + inquiry_buffer = transfer_request -> ux_slave_transfer_request_data_pointer; + /* Ensure the data buffer is cleaned. */ - _ux_utility_memory_set(inquiry_buffer, 0, UX_SLAVE_CLASS_STORAGE_INQUIRY_RESPONSE_LENGTH); + _ux_utility_memory_set(inquiry_buffer, 0, UX_SLAVE_CLASS_STORAGE_INQUIRY_RESPONSE_LENGTH); /* Use case of memset is verified. */ /* Check for the maximum length to be returned. */ if (inquiry_length > UX_SLAVE_CLASS_STORAGE_INQUIRY_RESPONSE_LENGTH) inquiry_length = UX_SLAVE_CLASS_STORAGE_INQUIRY_RESPONSE_LENGTH; + /* Default CSW to passed. */ + storage -> ux_slave_class_storage_csw_status = UX_SLAVE_CLASS_STORAGE_CSW_PASSED; + /* Ensure we know about the page code. */ switch (inquiry_page_code) { @@ -132,29 +147,21 @@ UCHAR inquiry_buffer[UX_SLAVE_CLASS_STORAGE_INQUIRY_RESPONSE_L /* Fill in the storage vendor ID. */ _ux_utility_memory_copy(inquiry_buffer + UX_SLAVE_CLASS_STORAGE_INQUIRY_RESPONSE_VENDOR_INFORMATION, - storage -> ux_slave_class_storage_vendor_id, 8); + storage -> ux_slave_class_storage_vendor_id, 8); /* Use case of memcpy is verified. */ /* Fill in the product vendor ID. */ _ux_utility_memory_copy(inquiry_buffer + UX_SLAVE_CLASS_STORAGE_INQUIRY_RESPONSE_PRODUCT_ID, - storage -> ux_slave_class_storage_product_id, 16); + storage -> ux_slave_class_storage_product_id, 16); /* Use case of memcpy is verified. */ /* Fill in the product revision number. */ _ux_utility_memory_copy(inquiry_buffer + UX_SLAVE_CLASS_STORAGE_INQUIRY_RESPONSE_PRODUCT_REVISION, - storage -> ux_slave_class_storage_product_rev, 4); - - /* Copy the Inquiry Buffer into the transfer request memory. */ - _ux_utility_memory_copy(transfer_request -> ux_slave_transfer_request_data_pointer, inquiry_buffer, inquiry_length); + storage -> ux_slave_class_storage_product_rev, 4); /* Use case of memcpy is verified. */ /* Send a data payload with the inquiry response buffer. */ _ux_device_stack_transfer_request(transfer_request, inquiry_length, inquiry_length); - /* Now we return a CSW with success. */ - status = _ux_device_class_storage_csw_send(storage, lun, endpoint_in, UX_SLAVE_CLASS_STORAGE_CSW_PASSED); - - /* And update the REQUEST_SENSE codes. */ - storage -> ux_slave_class_storage_lun[lun].ux_slave_class_storage_request_sense_key = 0x00; - storage -> ux_slave_class_storage_lun[lun].ux_slave_class_storage_request_code = 0x00; - storage -> ux_slave_class_storage_lun[lun].ux_slave_class_storage_request_code_qualifier = 0x00; + /* Now success. */ + status = UX_SUCCESS; break; @@ -167,18 +174,13 @@ UCHAR inquiry_buffer[UX_SLAVE_CLASS_STORAGE_INQUIRY_RESPONSE_L _ux_utility_short_put_big_endian(transfer_request -> ux_slave_transfer_request_data_pointer + 2, 20); /* Copy the serial number buffer into the transfer request memory. */ - _ux_utility_memory_copy(transfer_request -> ux_slave_transfer_request_data_pointer + 4, storage -> ux_slave_class_storage_product_serial, 20); + _ux_utility_memory_copy(transfer_request -> ux_slave_transfer_request_data_pointer + 4, storage -> ux_slave_class_storage_product_serial, 20); /* Use case of memcpy is verified. */ /* Send a data payload with the inquiry response buffer. */ _ux_device_stack_transfer_request(transfer_request, 24, 24); - /* Now we return a CSW with success. */ - status = _ux_device_class_storage_csw_send(storage, lun, endpoint_in, UX_SLAVE_CLASS_STORAGE_CSW_PASSED); - - /* And update the REQUEST_SENSE codes. */ - storage -> ux_slave_class_storage_lun[lun].ux_slave_class_storage_request_sense_key = 0x00; - storage -> ux_slave_class_storage_lun[lun].ux_slave_class_storage_request_code = 0x00; - storage -> ux_slave_class_storage_lun[lun].ux_slave_class_storage_request_code_qualifier = 0x00; + /* Now success. */ + status = UX_SUCCESS; break; @@ -187,13 +189,12 @@ UCHAR inquiry_buffer[UX_SLAVE_CLASS_STORAGE_INQUIRY_RESPONSE_L /* The page code is not supported. */ _ux_device_stack_endpoint_stall(endpoint_in); - /* Now we return a CSW with failure. */ - _ux_device_class_storage_csw_send(storage, lun, endpoint_in, UX_SLAVE_CLASS_STORAGE_CSW_FAILED); - /* And update the REQUEST_SENSE codes. */ - storage -> ux_slave_class_storage_lun[lun].ux_slave_class_storage_request_sense_key = 0x05; - storage -> ux_slave_class_storage_lun[lun].ux_slave_class_storage_request_code = 0x26; - storage -> ux_slave_class_storage_lun[lun].ux_slave_class_storage_request_code_qualifier = 0x01; + storage -> ux_slave_class_storage_lun[lun].ux_slave_class_storage_request_sense_status = + UX_DEVICE_CLASS_STORAGE_SENSE_STATUS(0x05,0x26,0x01); + + /* Now we set the CSW with failure. */ + storage -> ux_slave_class_storage_csw_status = UX_SLAVE_CLASS_STORAGE_CSW_FAILED; /* Return error. */ status = UX_ERROR; diff --git a/common/usbx_device_classes/src/ux_device_class_storage_mode_select.c b/common/usbx_device_classes/src/ux_device_class_storage_mode_select.c index f314a52..08c3d7d 100644 --- a/common/usbx_device_classes/src/ux_device_class_storage_mode_select.c +++ b/common/usbx_device_classes/src/ux_device_class_storage_mode_select.c @@ -35,7 +35,7 @@ /* FUNCTION RELEASE */ /* */ /* _ux_device_class_storage_mode_select PORTABLE C */ -/* 6.0 */ +/* 6.1 */ /* AUTHOR */ /* */ /* Chaoqiong Xiao, Microsoft Corporation */ @@ -70,6 +70,9 @@ /* DATE NAME DESCRIPTION */ /* */ /* 05-19-2020 Chaoqiong Xiao Initial Version 6.0 */ +/* 09-30-2020 Chaoqiong Xiao Modified comment(s), */ +/* optimized command logic, */ +/* resulting in version 6.1 */ /* */ /**************************************************************************/ UINT _ux_device_class_storage_mode_select(UX_SLAVE_CLASS_STORAGE *storage, ULONG lun, @@ -77,6 +80,7 @@ UINT _ux_device_class_storage_mode_select(UX_SLAVE_CLASS_STORAGE *storage, ULON UX_SLAVE_ENDPOINT *endpoint_out, UCHAR * cbwcb) { + UX_PARAMETER_NOT_USED(endpoint_in); UX_PARAMETER_NOT_USED(cbwcb); /* If trace is enabled, insert this event into the trace buffer. */ @@ -85,13 +89,12 @@ UINT _ux_device_class_storage_mode_select(UX_SLAVE_CLASS_STORAGE *storage, ULON /* This command is not yet supported. So Stall the endpoint. */ _ux_device_stack_endpoint_stall(endpoint_out); - /* Now we return a CSW with failure. */ - _ux_device_class_storage_csw_send(storage, lun, endpoint_in, UX_SLAVE_CLASS_STORAGE_CSW_FAILED); - /* And update the REQUEST_SENSE codes. */ - storage -> ux_slave_class_storage_lun[lun].ux_slave_class_storage_request_sense_key = 0x05; - storage -> ux_slave_class_storage_lun[lun].ux_slave_class_storage_request_code = 0x26; - storage -> ux_slave_class_storage_lun[lun].ux_slave_class_storage_request_code_qualifier = 0x01; + storage -> ux_slave_class_storage_lun[lun].ux_slave_class_storage_request_sense_status = + UX_DEVICE_CLASS_STORAGE_SENSE_STATUS(0x05,0x26,0x01); + + /* Now we set the CSW with failure. */ + storage -> ux_slave_class_storage_csw_status = UX_SLAVE_CLASS_STORAGE_CSW_FAILED; /* Error trap. */ _ux_system_error_handler(UX_SYSTEM_LEVEL_THREAD, UX_SYSTEM_CONTEXT_CLASS, UX_FUNCTION_NOT_SUPPORTED); 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 c7a1829..cffc6cf 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 @@ -65,7 +65,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.0.2 */ +/* 6.1 */ /* AUTHOR */ /* */ /* Chaoqiong Xiao, Microsoft Corporation */ @@ -104,11 +104,11 @@ UCHAR usbx_device_class_storage_mode_sense_page_cdrom[USBX_DEVICE_CLASS_STORAGE_ /* DATE NAME DESCRIPTION */ /* */ /* 05-19-2020 Chaoqiong Xiao Initial Version 6.0 */ -/* 08-14-2020 Chaoqiong Xiao Modified comment(s), */ -/* used mode related macros, */ +/* 09-30-2020 Chaoqiong Xiao Modified comment(s), */ +/* optimized command logic, */ /* verified memset and memcpy */ /* cases, */ -/* resulting in version 6.0.2 */ +/* resulting in version 6.1 */ /* */ /**************************************************************************/ UINT _ux_device_class_storage_mode_sense(UX_SLAVE_CLASS_STORAGE *storage, @@ -254,13 +254,9 @@ ULONG page_length; /* Send a payload with the response buffer. */ _ux_device_stack_transfer_request(transfer_request, mode_sense_reply_length, mode_sense_reply_length); - /* Now we return a CSW with success. */ - status = _ux_device_class_storage_csw_send(storage, lun, endpoint_in, UX_SLAVE_CLASS_STORAGE_CSW_PASSED); - - /* And update the REQUEST_SENSE codes. */ - storage -> ux_slave_class_storage_lun[lun].ux_slave_class_storage_request_sense_key = 0x00; - storage -> ux_slave_class_storage_lun[lun].ux_slave_class_storage_request_code = 0x00; - storage -> ux_slave_class_storage_lun[lun].ux_slave_class_storage_request_code_qualifier = 0x00; + /* Now we set the CSW with success. */ + storage -> ux_slave_class_storage_csw_status = UX_SLAVE_CLASS_STORAGE_CSW_PASSED; + status = UX_SUCCESS; /* Return completion status. */ return(status); diff --git a/common/usbx_device_classes/src/ux_device_class_storage_prevent_allow_media_removal.c b/common/usbx_device_classes/src/ux_device_class_storage_prevent_allow_media_removal.c index 903922e..90d73df 100644 --- a/common/usbx_device_classes/src/ux_device_class_storage_prevent_allow_media_removal.c +++ b/common/usbx_device_classes/src/ux_device_class_storage_prevent_allow_media_removal.c @@ -34,8 +34,9 @@ /* */ /* FUNCTION RELEASE */ /* */ -/* _ux_device_class_storage_prevent_allow_media_removal PORTABLE C */ -/* 6.0 */ +/* _ux_device_class_storage_prevent_allow_media_removal */ +/* PORTABLE C */ +/* 6.1 */ /* AUTHOR */ /* */ /* Chaoqiong Xiao, Microsoft Corporation */ @@ -69,6 +70,9 @@ /* DATE NAME DESCRIPTION */ /* */ /* 05-19-2020 Chaoqiong Xiao Initial Version 6.0 */ +/* 09-30-2020 Chaoqiong Xiao Modified comment(s), */ +/* optimized command logic, */ +/* resulting in version 6.1 */ /* */ /**************************************************************************/ UINT _ux_device_class_storage_prevent_allow_media_removal(UX_SLAVE_CLASS_STORAGE *storage, ULONG lun, @@ -76,19 +80,16 @@ UINT _ux_device_class_storage_prevent_allow_media_removal(UX_SLAVE_CLASS_STORAG UX_SLAVE_ENDPOINT *endpoint_out, UCHAR * cbwcb) { - UX_PARAMETER_NOT_USED(cbwcb); + UX_PARAMETER_NOT_USED(lun); + UX_PARAMETER_NOT_USED(endpoint_in); UX_PARAMETER_NOT_USED(endpoint_out); + UX_PARAMETER_NOT_USED(cbwcb); /* If trace is enabled, insert this event into the trace buffer. */ UX_TRACE_IN_LINE_INSERT(UX_TRACE_DEVICE_CLASS_STORAGE_PREVENT_ALLOW_MEDIA_REMOVAL, storage, lun, 0, 0, UX_TRACE_DEVICE_CLASS_EVENTS, 0, 0) - /* We return a CSW with success. */ - _ux_device_class_storage_csw_send(storage, lun, endpoint_in, UX_SLAVE_CLASS_STORAGE_CSW_PASSED); - - /* And update the REQUEST_SENSE codes. */ - storage -> ux_slave_class_storage_lun[lun].ux_slave_class_storage_request_sense_key = 0x00; - storage -> ux_slave_class_storage_lun[lun].ux_slave_class_storage_request_code = 0x00; - storage -> ux_slave_class_storage_lun[lun].ux_slave_class_storage_request_code_qualifier = 0x00; + /* We set the CSW with success. */ + storage -> ux_slave_class_storage_csw_status = UX_SLAVE_CLASS_STORAGE_CSW_PASSED; /* Return successful completion. */ return(UX_SUCCESS); diff --git a/common/usbx_device_classes/src/ux_device_class_storage_read.c b/common/usbx_device_classes/src/ux_device_class_storage_read.c index 4fb48dd..79f00cf 100644 --- a/common/usbx_device_classes/src/ux_device_class_storage_read.c +++ b/common/usbx_device_classes/src/ux_device_class_storage_read.c @@ -35,7 +35,7 @@ /* FUNCTION RELEASE */ /* */ /* _ux_device_class_storage_read PORTABLE C */ -/* 6.0 */ +/* 6.1 */ /* AUTHOR */ /* */ /* Chaoqiong Xiao, Microsoft Corporation */ @@ -75,6 +75,9 @@ /* DATE NAME DESCRIPTION */ /* */ /* 05-19-2020 Chaoqiong Xiao Initial Version 6.0 */ +/* 09-30-2020 Chaoqiong Xiao Modified comment(s), */ +/* optimized command logic, */ +/* resulting in version 6.1 */ /* */ /**************************************************************************/ UINT _ux_device_class_storage_read(UX_SLAVE_CLASS_STORAGE *storage, ULONG lun, @@ -114,6 +117,9 @@ ULONG transfer_length; /* Compute the total length to transfer and how much remains. */ total_length = total_number_blocks * storage -> ux_slave_class_storage_lun[lun].ux_slave_class_storage_media_block_length; + /* Default CSW to failed. */ + storage -> ux_slave_class_storage_csw_status = UX_SLAVE_CLASS_STORAGE_CSW_FAILED; + /* It may take several transfers to send the requested data. */ while (total_number_blocks) { @@ -123,9 +129,7 @@ ULONG transfer_length; storage -> ux_slave_class_storage_lun[lun].ux_slave_class_storage_media_id, &media_status); /* Update the request sense. */ - storage -> ux_slave_class_storage_lun[lun].ux_slave_class_storage_request_sense_key = (UCHAR) (media_status & 0xff); - storage -> ux_slave_class_storage_lun[lun].ux_slave_class_storage_request_code = (UCHAR) ((media_status >> 8 ) & 0xff); - storage -> ux_slave_class_storage_lun[lun].ux_slave_class_storage_request_code_qualifier = (UCHAR) ((media_status >> 16 ) & 0xff); + storage -> ux_slave_class_storage_lun[lun].ux_slave_class_storage_request_sense_status = media_status; /* If there is a problem, return a failed command. */ if (status != UX_SUCCESS) @@ -135,9 +139,6 @@ ULONG transfer_length; REQUEST_SENSE command. */ _ux_device_stack_endpoint_stall(endpoint_in); - /* Now we return a CSW with failure. */ - _ux_device_class_storage_csw_send(storage, lun, endpoint_in, UX_SLAVE_CLASS_STORAGE_CSW_FAILED); - /* Return an error. */ return(UX_ERROR); } @@ -173,12 +174,7 @@ ULONG transfer_length; _ux_device_stack_endpoint_stall(endpoint_in); /* And update the REQUEST_SENSE codes. */ - storage -> ux_slave_class_storage_lun[lun].ux_slave_class_storage_request_sense_key = (UCHAR) (media_status & 0xff); - storage -> ux_slave_class_storage_lun[lun].ux_slave_class_storage_request_code = (UCHAR) ((media_status >> 8 ) & 0xff); - storage -> ux_slave_class_storage_lun[lun].ux_slave_class_storage_request_code_qualifier = (UCHAR) ((media_status >> 16 ) & 0xff); - - /* Now we return a CSW with failure. */ - _ux_device_class_storage_csw_send(storage, lun, endpoint_in, UX_SLAVE_CLASS_STORAGE_CSW_FAILED); + storage -> ux_slave_class_storage_lun[lun].ux_slave_class_storage_request_sense_status = media_status; /* Return an error. */ return(UX_ERROR); @@ -196,13 +192,9 @@ ULONG transfer_length; _ux_device_stack_endpoint_stall(endpoint_in); /* Update the REQUEST_SENSE codes. */ - storage -> ux_slave_class_storage_lun[lun].ux_slave_class_storage_request_sense_key = 0x02; - storage -> ux_slave_class_storage_lun[lun].ux_slave_class_storage_request_code = 0x54; - storage -> ux_slave_class_storage_lun[lun].ux_slave_class_storage_request_code_qualifier = 0x00; + storage -> ux_slave_class_storage_lun[lun].ux_slave_class_storage_request_sense_status = + UX_DEVICE_CLASS_STORAGE_SENSE_STATUS(0x02,0x54,0x00); - /* Now we return a CSW with failure. */ - _ux_device_class_storage_csw_send(storage, lun, endpoint_in, UX_SLAVE_CLASS_STORAGE_CSW_FAILED); - /* Return an error. */ return(UX_ERROR); @@ -218,8 +210,8 @@ ULONG transfer_length; total_number_blocks -= number_blocks; } - /* Now we return a CSW with success. */ - status = _ux_device_class_storage_csw_send(storage, lun, endpoint_in, UX_SLAVE_CLASS_STORAGE_CSW_PASSED); + /* Now we set the CSW with success. */ + storage -> ux_slave_class_storage_csw_status = UX_SLAVE_CLASS_STORAGE_CSW_PASSED; /* Return completion status. */ return(status); 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 cd3a63a..62d4cf6 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 @@ -30,12 +30,16 @@ #include "ux_device_stack.h" +#if UX_SLAVE_REQUEST_DATA_MAX_LENGTH < UX_SLAVE_CLASS_STORAGE_READ_CAPACITY_RESPONSE_LENGTH +#error UX_SLAVE_REQUEST_DATA_MAX_LENGTH is too small, please check +#endif + /**************************************************************************/ /* */ /* FUNCTION RELEASE */ /* */ /* _ux_device_class_storage_read_capacity PORTABLE C */ -/* 6.0 */ +/* 6.1 */ /* AUTHOR */ /* */ /* Chaoqiong Xiao, Microsoft Corporation */ @@ -73,6 +77,11 @@ /* DATE NAME DESCRIPTION */ /* */ /* 05-19-2020 Chaoqiong Xiao Initial Version 6.0 */ +/* 09-30-2020 Chaoqiong Xiao Modified comment(s), */ +/* optimized command logic, */ +/* verified memset and memcpy */ +/* cases, */ +/* resulting in version 6.1 */ /* */ /**************************************************************************/ UINT _ux_device_class_storage_read_capacity(UX_SLAVE_CLASS_STORAGE *storage, ULONG lun, @@ -83,7 +92,7 @@ UINT _ux_device_class_storage_read_capacity(UX_SLAVE_CLASS_STORAGE *storage, UL UINT status; ULONG media_status; UX_SLAVE_TRANSFER *transfer_request; -UCHAR read_capacity_buffer[UX_SLAVE_CLASS_STORAGE_READ_CAPACITY_RESPONSE_LENGTH]; +UCHAR *read_capacity_buffer; UX_PARAMETER_NOT_USED(cbwcb); UX_PARAMETER_NOT_USED(endpoint_out); @@ -96,9 +105,7 @@ UCHAR read_capacity_buffer[UX_SLAVE_CLASS_STORAGE_READ_CAPACIT storage -> ux_slave_class_storage_lun[lun].ux_slave_class_storage_media_id, &media_status); /* Update the request sense. */ - storage -> ux_slave_class_storage_lun[lun].ux_slave_class_storage_request_sense_key = (UCHAR) (media_status & 0xff); - storage -> ux_slave_class_storage_lun[lun].ux_slave_class_storage_request_code = (UCHAR) ((media_status >> 8 ) & 0xff); - storage -> ux_slave_class_storage_lun[lun].ux_slave_class_storage_request_code_qualifier = (UCHAR) ((media_status >> 16 ) & 0xff); + storage -> ux_slave_class_storage_lun[lun].ux_slave_class_storage_request_sense_status = media_status; /* Check the status for error. */ if (status != UX_SUCCESS) @@ -107,17 +114,21 @@ UCHAR read_capacity_buffer[UX_SLAVE_CLASS_STORAGE_READ_CAPACIT /* We need to STALL the IN endpoint. The endpoint will be reset by the host. */ _ux_device_stack_endpoint_stall(endpoint_in); - /* Now we return a CSW with Error. */ - status = _ux_device_class_storage_csw_send(storage, lun, endpoint_in, UX_SLAVE_CLASS_STORAGE_CSW_FAILED); + /* Now we set the CSW with Error. */ + storage -> ux_slave_class_storage_csw_status = UX_SLAVE_CLASS_STORAGE_CSW_FAILED; + status = UX_SUCCESS; } else { /* Obtain the pointer to the transfer request. */ transfer_request = &endpoint_in -> ux_slave_endpoint_transfer_request; + + /* Obtain read capacity response buffer. */ + read_capacity_buffer = transfer_request -> ux_slave_transfer_request_data_pointer; /* Ensure it is cleaned. */ - _ux_utility_memory_set(read_capacity_buffer, 0, UX_SLAVE_CLASS_STORAGE_READ_CAPACITY_RESPONSE_LENGTH); + _ux_utility_memory_set(read_capacity_buffer, 0, UX_SLAVE_CLASS_STORAGE_READ_CAPACITY_RESPONSE_LENGTH); /* Use case of memcpy is verified. */ /* Insert the last LBA address in the response. */ _ux_utility_long_put_big_endian(&read_capacity_buffer[UX_SLAVE_CLASS_STORAGE_READ_CAPACITY_RESPONSE_LAST_LBA], @@ -127,17 +138,14 @@ UCHAR read_capacity_buffer[UX_SLAVE_CLASS_STORAGE_READ_CAPACIT _ux_utility_long_put_big_endian(&read_capacity_buffer[UX_SLAVE_CLASS_STORAGE_READ_CAPACITY_RESPONSE_BLOCK_SIZE], storage -> ux_slave_class_storage_lun[lun].ux_slave_class_storage_media_block_length); - /* Copy the CSW into the transfer request memory. */ - _ux_utility_memory_copy(transfer_request -> ux_slave_transfer_request_data_pointer, - read_capacity_buffer, UX_SLAVE_CLASS_STORAGE_READ_CAPACITY_RESPONSE_LENGTH); - /* Send a data payload with the read_capacity response buffer. */ _ux_device_stack_transfer_request(transfer_request, UX_SLAVE_CLASS_STORAGE_READ_CAPACITY_RESPONSE_LENGTH, UX_SLAVE_CLASS_STORAGE_READ_CAPACITY_RESPONSE_LENGTH); - /* Now we return a CSW with success. */ - status = _ux_device_class_storage_csw_send(storage, lun, endpoint_in, UX_SLAVE_CLASS_STORAGE_CSW_PASSED); + /* Now we set the CSW with success. */ + storage -> ux_slave_class_storage_csw_status = UX_SLAVE_CLASS_STORAGE_CSW_PASSED; + status = UX_SUCCESS; } /* Return completion status. */ 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 ad52508..213f711 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 @@ -30,6 +30,9 @@ #include "ux_device_stack.h" #define USBX_DEVICE_CLASS_STORAGE_DISK_INFORMATION_LENGTH 34 +#if UX_SLAVE_REQUEST_DATA_MAX_LENGTH < USBX_DEVICE_CLASS_STORAGE_DISK_INFORMATION_LENGTH +#error UX_SLAVE_REQUEST_DATA_MAX_LENGTH is too small, please check +#endif UCHAR usbx_device_class_storage_disk_information[] = { 0x00, 0x00, /* Entire length of disk_information */ @@ -61,7 +64,7 @@ UCHAR usbx_device_class_storage_disk_information[] = { /* FUNCTION RELEASE */ /* */ /* _ux_device_class_storage_read_disk_information PORTABLE C */ -/* 6.0 */ +/* 6.1 */ /* AUTHOR */ /* */ /* Chaoqiong Xiao, Microsoft Corporation */ @@ -97,6 +100,11 @@ UCHAR usbx_device_class_storage_disk_information[] = { /* DATE NAME DESCRIPTION */ /* */ /* 05-19-2020 Chaoqiong Xiao Initial Version 6.0 */ +/* 09-30-2020 Chaoqiong Xiao Modified comment(s), */ +/* optimized command logic, */ +/* verified memset and memcpy */ +/* cases, */ +/* resulting in version 6.1 */ /* */ /**************************************************************************/ UINT _ux_device_class_storage_read_disk_information(UX_SLAVE_CLASS_STORAGE *storage, ULONG lun, @@ -143,15 +151,16 @@ ULONG allocation_length; /* Copy the CSW into the transfer request memory. */ _ux_utility_memory_copy(transfer_request -> ux_slave_transfer_request_data_pointer, usbx_device_class_storage_disk_information, - allocation_length); + allocation_length); /* Use case of memcpy is verified. */ /* Send a data payload with the read_capacity response buffer. */ _ux_device_stack_transfer_request(transfer_request, allocation_length, allocation_length); - /* Now we return a CSW with success. */ - status = _ux_device_class_storage_csw_send(storage, lun, endpoint_in, UX_SLAVE_CLASS_STORAGE_CSW_PASSED); + /* Now we set the CSW with success. */ + storage -> ux_slave_class_storage_csw_status = UX_SLAVE_CLASS_STORAGE_CSW_PASSED; + status = UX_SUCCESS; /* Return completion status. */ return(status); diff --git a/common/usbx_device_classes/src/ux_device_class_storage_read_dvd_structure.c b/common/usbx_device_classes/src/ux_device_class_storage_read_dvd_structure.c index 5375fd0..46151ea 100644 --- a/common/usbx_device_classes/src/ux_device_class_storage_read_dvd_structure.c +++ b/common/usbx_device_classes/src/ux_device_class_storage_read_dvd_structure.c @@ -162,7 +162,7 @@ UCHAR usbx_device_class_storage_dvd_structure[] = { /* FUNCTION RELEASE */ /* */ /* _ux_device_class_storage_read_dvd_structure PORTABLE C */ -/* 6.0 */ +/* 6.1 */ /* AUTHOR */ /* */ /* Chaoqiong Xiao, Microsoft Corporation */ @@ -198,6 +198,11 @@ UCHAR usbx_device_class_storage_dvd_structure[] = { /* DATE NAME DESCRIPTION */ /* */ /* 05-19-2020 Chaoqiong Xiao Initial Version 6.0 */ +/* 09-30-2020 Chaoqiong Xiao Modified comment(s), */ +/* optimized command logic, */ +/* verified memset and memcpy */ +/* cases, */ +/* resulting in version 6.1 */ /* */ /**************************************************************************/ UINT _ux_device_class_storage_read_dvd_structure(UX_SLAVE_CLASS_STORAGE *storage, ULONG lun, @@ -249,7 +254,7 @@ UCHAR *dvd_structure_pointer; /* Copy the CSW into the transfer request memory. */ _ux_utility_memory_copy(transfer_request -> ux_slave_transfer_request_data_pointer, dvd_structure_pointer, - transfer_length); + transfer_length); /* Use case of memcpy is verified. */ /* Send a data payload with the read_capacity response buffer. */ status = _ux_device_stack_transfer_request(transfer_request, @@ -267,8 +272,10 @@ UCHAR *dvd_structure_pointer; allocation_length -= transfer_length; } - /* Now we return a CSW with success. */ - status = _ux_device_class_storage_csw_send(storage, lun, endpoint_in, UX_SLAVE_CLASS_STORAGE_CSW_PASSED); + /* Now we set the CSW with success. */ + UX_PARAMETER_NOT_USED(lun); + storage -> ux_slave_class_storage_csw_status = UX_SLAVE_CLASS_STORAGE_CSW_PASSED; + status = UX_SUCCESS; /* Return completion status. */ return(status); 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 3be024e..18b0871 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 @@ -30,12 +30,16 @@ #include "ux_device_stack.h" +#if UX_SLAVE_CLASS_STORAGE_BUFFER_SIZE < UX_SLAVE_CLASS_STORAGE_READ_FORMAT_CAPACITY_RESPONSE_LENGTH +#error UX_SLAVE_CLASS_STORAGE_BUFFER_SIZE too small, please check +#endif + /**************************************************************************/ /* */ /* FUNCTION RELEASE */ /* */ /* _ux_device_class_storage_read_format_capacity PORTABLE C */ -/* 6.0 */ +/* 6.1 */ /* AUTHOR */ /* */ /* Chaoqiong Xiao, Microsoft Corporation */ @@ -72,6 +76,11 @@ /* DATE NAME DESCRIPTION */ /* */ /* 05-19-2020 Chaoqiong Xiao Initial Version 6.0 */ +/* 09-30-2020 Chaoqiong Xiao Modified comment(s), */ +/* optimized command logic, */ +/* verified memset and memcpy */ +/* cases, */ +/* resulting in version 6.1 */ /* */ /**************************************************************************/ UINT _ux_device_class_storage_read_format_capacity(UX_SLAVE_CLASS_STORAGE *storage, ULONG lun, @@ -81,7 +90,7 @@ UINT _ux_device_class_storage_read_format_capacity(UX_SLAVE_CLASS_STORAGE *stor UINT status; UX_SLAVE_TRANSFER *transfer_request; -UCHAR read_format_capacity_buffer[UX_SLAVE_CLASS_STORAGE_READ_FORMAT_CAPACITY_RESPONSE_LENGTH]; +UCHAR *read_format_capacity_buffer; UX_PARAMETER_NOT_USED(cbwcb); UX_PARAMETER_NOT_USED(endpoint_out); @@ -92,8 +101,11 @@ UCHAR read_format_capacity_buffer[UX_SLAVE_CLASS_STORAGE_READ_ /* Obtain the pointer to the transfer request. */ transfer_request = &endpoint_in -> ux_slave_endpoint_transfer_request; + /* Get read format capacity response buffer. */ + read_format_capacity_buffer = transfer_request -> ux_slave_transfer_request_data_pointer; + /* Ensure it is cleaned. */ - _ux_utility_memory_set(read_format_capacity_buffer, 0, UX_SLAVE_CLASS_STORAGE_READ_FORMAT_CAPACITY_RESPONSE_LENGTH); + _ux_utility_memory_set(read_format_capacity_buffer, 0, UX_SLAVE_CLASS_STORAGE_READ_FORMAT_CAPACITY_RESPONSE_LENGTH); /* Use case of memset is verified. */ /* Insert the size of the response block. */ _ux_utility_long_put_big_endian(&read_format_capacity_buffer[UX_SLAVE_CLASS_STORAGE_READ_FORMAT_CAPACITY_RESPONSE_SIZE], 8); @@ -109,17 +121,14 @@ UCHAR read_format_capacity_buffer[UX_SLAVE_CLASS_STORAGE_READ_ /* Insert the response code : always 2. */ read_format_capacity_buffer[UX_SLAVE_CLASS_STORAGE_READ_FORMAT_CAPACITY_RESPONSE_DESC_CODE] = 2; - /* Copy the CSW into the transfer request memory. */ - _ux_utility_memory_copy(transfer_request -> ux_slave_transfer_request_data_pointer, - read_format_capacity_buffer, UX_SLAVE_CLASS_STORAGE_READ_FORMAT_CAPACITY_RESPONSE_LENGTH); - /* Send a data payload with the read_capacity response buffer. */ _ux_device_stack_transfer_request(transfer_request, UX_SLAVE_CLASS_STORAGE_READ_FORMAT_CAPACITY_RESPONSE_LENGTH, UX_SLAVE_CLASS_STORAGE_READ_FORMAT_CAPACITY_RESPONSE_LENGTH); - /* Now we return a CSW with success. */ - status = _ux_device_class_storage_csw_send(storage, lun, endpoint_in, UX_SLAVE_CLASS_STORAGE_CSW_PASSED); + /* Now we set the CSW with success. */ + storage -> ux_slave_class_storage_csw_status = UX_SLAVE_CLASS_STORAGE_CSW_PASSED; + status = UX_SUCCESS; /* Return completion status. */ return(status); 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 515adfe..8a6486d 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 @@ -30,12 +30,16 @@ #include "ux_device_stack.h" +#if UX_SLAVE_CLASS_STORAGE_BUFFER_SIZE < 20 +#error UX_SLAVE_CLASS_STORAGE_BUFFER_SIZE too small, please check +#endif + /**************************************************************************/ /* */ /* FUNCTION RELEASE */ /* */ /* _ux_device_class_storage_read_toc PORTABLE C */ -/* 6.0 */ +/* 6.1 */ /* AUTHOR */ /* */ /* Chaoqiong Xiao, Microsoft Corporation */ @@ -73,6 +77,11 @@ /* DATE NAME DESCRIPTION */ /* */ /* 05-19-2020 Chaoqiong Xiao Initial Version 6.0 */ +/* 09-30-2020 Chaoqiong Xiao Modified comment(s), */ +/* optimized command logic, */ +/* verified memset and memcpy */ +/* cases, */ +/* resulting in version 6.1 */ /* */ /**************************************************************************/ UINT _ux_device_class_storage_read_toc(UX_SLAVE_CLASS_STORAGE *storage, ULONG lun, @@ -84,8 +93,10 @@ UINT status; UX_SLAVE_TRANSFER *transfer_request; ULONG allocation_length; ULONG toc_length; -UCHAR toc_buffer[20]; +UCHAR *toc_buffer; + + UX_PARAMETER_NOT_USED(lun); UX_PARAMETER_NOT_USED(endpoint_out); /* If trace is enabled, insert this event into the trace buffer. */ @@ -94,8 +105,11 @@ UCHAR toc_buffer[20]; /* Obtain the pointer to the transfer request. */ transfer_request = &endpoint_in -> ux_slave_endpoint_transfer_request; + /* Obtain TOC buffer. */ + toc_buffer = transfer_request -> ux_slave_transfer_request_data_pointer; + /* Reset this buffer. */ - _ux_utility_memory_set(toc_buffer,0,20); + _ux_utility_memory_set(toc_buffer,0,20); /* Use case of memset is verified. */ /* Get the allocation length. */ allocation_length = _ux_utility_short_get_big_endian(cbwcb + UX_SLAVE_CLASS_STORAGE_READ_TOC_ALLOCATION_LENGTH); @@ -166,9 +180,6 @@ UCHAR toc_buffer[20]; break; } - /* Copy the TOC Buffer into the transfer request memory. */ - _ux_utility_memory_copy(transfer_request -> ux_slave_transfer_request_data_pointer, toc_buffer, toc_length); - /* Check how much we can send back. */ if (allocation_length > toc_length) @@ -178,8 +189,9 @@ UCHAR toc_buffer[20]; /* Send a data payload with the TOC response buffer. */ _ux_device_stack_transfer_request(transfer_request, allocation_length, allocation_length); - /* Now we return a CSW with success. */ - status = _ux_device_class_storage_csw_send(storage, lun, endpoint_in, UX_SLAVE_CLASS_STORAGE_CSW_PASSED); + /* Now we set the CSW with success. */ + storage -> ux_slave_class_storage_csw_status = UX_SLAVE_CLASS_STORAGE_CSW_PASSED; + status = UX_SUCCESS; /* Return completion status. */ return(status); 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 4deb505..70b1662 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 @@ -29,12 +29,17 @@ #include "ux_device_class_storage.h" #include "ux_device_stack.h" + +#if UX_SLAVE_REQUEST_DATA_MAX_LENGTH < UX_SLAVE_CLASS_STORAGE_REPORT_KEY_ANSWER_LENGTH +#error UX_SLAVE_REQUEST_DATA_MAX_LENGTH too small, please check +#endif + /**************************************************************************/ /* */ /* FUNCTION RELEASE */ /* */ /* _ux_device_class_storage_report_key PORTABLE C */ -/* 6.0 */ +/* 6.1 */ /* AUTHOR */ /* */ /* Chaoqiong Xiao, Microsoft Corporation */ @@ -69,6 +74,11 @@ /* DATE NAME DESCRIPTION */ /* */ /* 05-19-2020 Chaoqiong Xiao Initial Version 6.0 */ +/* 09-30-2020 Chaoqiong Xiao Modified comment(s), */ +/* optimized command logic, */ +/* verified memset and memcpy */ +/* cases, */ +/* resulting in version 6.1 */ /* */ /**************************************************************************/ UINT _ux_device_class_storage_report_key(UX_SLAVE_CLASS_STORAGE *storage, @@ -83,6 +93,8 @@ UX_SLAVE_TRANSFER *transfer_request; ULONG allocation_length; ULONG key_format; + + UX_PARAMETER_NOT_USED(lun); UX_PARAMETER_NOT_USED(endpoint_out); /* If trace is enabled, insert this event into the trace buffer. */ @@ -98,7 +110,7 @@ ULONG key_format; allocation_length = _ux_utility_short_get_big_endian(cbwcb + UX_SLAVE_CLASS_STORAGE_REPORT_KEY_ALLOCATION_LENGTH); /* Ensure memory buffer cleaned. */ - _ux_utility_memory_set(transfer_request -> ux_slave_transfer_request_data_pointer, 0, 64); + _ux_utility_memory_set(transfer_request -> ux_slave_transfer_request_data_pointer, 0, UX_SLAVE_CLASS_STORAGE_REPORT_KEY_ANSWER_LENGTH); /* Use case of memset is verified. */ /* Filter page code. This is necessary to isolate the CD-ROM mode sense response. */ switch (key_format) @@ -127,7 +139,7 @@ ULONG key_format; allocation_length = UX_SLAVE_CLASS_STORAGE_REPORT_KEY_ANSWER_LENGTH; /* Send a data payload with the read_capacity response buffer. */ - _ux_device_stack_transfer_request(transfer_request, allocation_length, allocation_length); + _ux_device_stack_transfer_request(transfer_request, allocation_length, allocation_length); /* Use case of memset is verified. */ break; @@ -139,13 +151,8 @@ ULONG key_format; } - /* Now we return a CSW with success. */ - status = _ux_device_class_storage_csw_send(storage, lun, endpoint_in, UX_SLAVE_CLASS_STORAGE_CSW_PASSED); - - /* And update the REQUEST_SENSE codes. */ - storage -> ux_slave_class_storage_lun[lun].ux_slave_class_storage_request_sense_key = 0x00; - storage -> ux_slave_class_storage_lun[lun].ux_slave_class_storage_request_code = 0x00; - storage -> ux_slave_class_storage_lun[lun].ux_slave_class_storage_request_code_qualifier = 0x00; + /* Now we set the CSW with success. */ + storage -> ux_slave_class_storage_csw_status = UX_SLAVE_CLASS_STORAGE_CSW_PASSED; /* Return completion status. */ return(status); 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 8601187..6d7d4ef 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 @@ -30,12 +30,16 @@ #include "ux_device_stack.h" +#if UX_SLAVE_CLASS_STORAGE_BUFFER_SIZE < UX_SLAVE_CLASS_STORAGE_REQUEST_SENSE_RESPONSE_LENGTH +#error UX_SLAVE_CLASS_STORAGE_BUFFER_SIZE too small, please check +#endif + /**************************************************************************/ /* */ /* FUNCTION RELEASE */ /* */ /* _ux_device_class_storage_request_sense PORTABLE C */ -/* 6.0 */ +/* 6.1 */ /* AUTHOR */ /* */ /* Chaoqiong Xiao, Microsoft Corporation */ @@ -71,6 +75,11 @@ /* DATE NAME DESCRIPTION */ /* */ /* 05-19-2020 Chaoqiong Xiao Initial Version 6.0 */ +/* 09-30-2020 Chaoqiong Xiao Modified comment(s), */ +/* optimized command logic, */ +/* verified memset and memcpy */ +/* cases, */ +/* resulting in version 6.1 */ /* */ /**************************************************************************/ UINT _ux_device_class_storage_request_sense(UX_SLAVE_CLASS_STORAGE *storage, ULONG lun, UX_SLAVE_ENDPOINT *endpoint_in, @@ -79,7 +88,9 @@ UINT _ux_device_class_storage_request_sense(UX_SLAVE_CLASS_STORAGE *storage, UL UINT status; UX_SLAVE_TRANSFER *transfer_request; -UCHAR sense_buffer[UX_SLAVE_CLASS_STORAGE_INQUIRY_RESPONSE_LENGTH]; +UCHAR *sense_buffer; +UCHAR key, code, qualifier; + UX_PARAMETER_NOT_USED(cbwcb); UX_PARAMETER_NOT_USED(endpoint_out); @@ -87,44 +98,47 @@ UCHAR sense_buffer[UX_SLAVE_CLASS_STORAGE_INQUIRY_RESPONSE_LEN /* Obtain the pointer to the transfer request. */ transfer_request = &endpoint_in -> ux_slave_endpoint_transfer_request; + /* Obtain sense buffer. */ + sense_buffer = transfer_request -> ux_slave_transfer_request_data_pointer; + /* Ensure it is cleaned. */ - _ux_utility_memory_set(sense_buffer, 0, UX_SLAVE_CLASS_STORAGE_REQUEST_SENSE_RESPONSE_LENGTH); + _ux_utility_memory_set(sense_buffer, 0, UX_SLAVE_CLASS_STORAGE_REQUEST_SENSE_RESPONSE_LENGTH); /* Use case of memset is verified. */ /* Initialize the response buffer with the error code. */ sense_buffer[UX_SLAVE_CLASS_STORAGE_REQUEST_SENSE_RESPONSE_ERROR_CODE] = UX_SLAVE_CLASS_STORAGE_REQUEST_SENSE_RESPONSE_ERROR_CODE_VALUE; + /* Extract sense key, code, qualifier. */ + key = UX_DEVICE_CLASS_STORAGE_SENSE_KEY(storage -> ux_slave_class_storage_lun[lun]. + ux_slave_class_storage_request_sense_status); + code = UX_DEVICE_CLASS_STORAGE_SENSE_CODE(storage -> ux_slave_class_storage_lun[lun]. + ux_slave_class_storage_request_sense_status); + qualifier = UX_DEVICE_CLASS_STORAGE_SENSE_QUALIFIER(storage -> ux_slave_class_storage_lun[lun]. + ux_slave_class_storage_request_sense_status); + /* Initialize the response buffer with the sense key. */ - sense_buffer[UX_SLAVE_CLASS_STORAGE_REQUEST_SENSE_RESPONSE_SENSE_KEY] = - storage -> ux_slave_class_storage_lun[lun].ux_slave_class_storage_request_sense_key; + sense_buffer[UX_SLAVE_CLASS_STORAGE_REQUEST_SENSE_RESPONSE_SENSE_KEY] = key; /* Initialize the response buffer with the code. */ - sense_buffer[UX_SLAVE_CLASS_STORAGE_REQUEST_SENSE_RESPONSE_CODE] = - storage -> ux_slave_class_storage_lun[lun].ux_slave_class_storage_request_code; + sense_buffer[UX_SLAVE_CLASS_STORAGE_REQUEST_SENSE_RESPONSE_CODE] = code; /* Initialize the response buffer with the code qualifier. */ - sense_buffer[UX_SLAVE_CLASS_STORAGE_REQUEST_SENSE_RESPONSE_CODE_QUALIFIER] = - storage -> ux_slave_class_storage_lun[lun].ux_slave_class_storage_request_code_qualifier; + sense_buffer[UX_SLAVE_CLASS_STORAGE_REQUEST_SENSE_RESPONSE_CODE_QUALIFIER] = qualifier; /* If trace is enabled, insert this event into the trace buffer. */ UX_TRACE_IN_LINE_INSERT(UX_TRACE_DEVICE_CLASS_STORAGE_REQUEST_SENSE, storage, lun, - storage -> ux_slave_class_storage_lun[lun].ux_slave_class_storage_request_sense_key, - storage -> ux_slave_class_storage_lun[lun].ux_slave_class_storage_request_code, UX_TRACE_DEVICE_CLASS_EVENTS, 0, 0) + key, code, UX_TRACE_DEVICE_CLASS_EVENTS, 0, 0) /* Initialize the response buffer with the additional length. */ sense_buffer[UX_SLAVE_CLASS_STORAGE_REQUEST_SENSE_RESPONSE_ADD_LENGTH] = 10; - - /* Copy the request sense response into the transfer request memory. */ - _ux_utility_memory_copy(transfer_request -> ux_slave_transfer_request_data_pointer, - sense_buffer, UX_SLAVE_CLASS_STORAGE_REQUEST_SENSE_RESPONSE_LENGTH); - /* Send a data payload with the sense codes. */ _ux_device_stack_transfer_request(transfer_request, UX_SLAVE_CLASS_STORAGE_REQUEST_SENSE_RESPONSE_LENGTH, UX_SLAVE_CLASS_STORAGE_REQUEST_SENSE_RESPONSE_LENGTH); - /* Now we return a CSW with success. */ - status = _ux_device_class_storage_csw_send(storage, lun, endpoint_in, UX_SLAVE_CLASS_STORAGE_CSW_PASSED); + /* Now we set the CSW with success. */ + storage -> ux_slave_class_storage_csw_status = UX_SLAVE_CLASS_STORAGE_CSW_PASSED; + status = UX_SUCCESS; /* Return completion status. */ return(status); diff --git a/common/usbx_device_classes/src/ux_device_class_storage_start_stop.c b/common/usbx_device_classes/src/ux_device_class_storage_start_stop.c index 2bd9f12..fbd7ae7 100644 --- a/common/usbx_device_classes/src/ux_device_class_storage_start_stop.c +++ b/common/usbx_device_classes/src/ux_device_class_storage_start_stop.c @@ -35,7 +35,7 @@ /* FUNCTION RELEASE */ /* */ /* _ux_device_class_storage_start_stop PORTABLE C */ -/* 6.0 */ +/* 6.1 */ /* AUTHOR */ /* */ /* Chaoqiong Xiao, Microsoft Corporation */ @@ -69,6 +69,9 @@ /* DATE NAME DESCRIPTION */ /* */ /* 05-19-2020 Chaoqiong Xiao Initial Version 6.0 */ +/* 09-30-2020 Chaoqiong Xiao Modified comment(s), */ +/* optimized command logic, */ +/* resulting in version 6.1 */ /* */ /**************************************************************************/ UINT _ux_device_class_storage_start_stop(UX_SLAVE_CLASS_STORAGE *storage, ULONG lun, @@ -76,14 +79,16 @@ UINT _ux_device_class_storage_start_stop(UX_SLAVE_CLASS_STORAGE *storage, ULONG UX_SLAVE_ENDPOINT *endpoint_out, UCHAR * cbwcb) { - UX_PARAMETER_NOT_USED(cbwcb); + UX_PARAMETER_NOT_USED(lun); + UX_PARAMETER_NOT_USED(endpoint_in); UX_PARAMETER_NOT_USED(endpoint_out); + UX_PARAMETER_NOT_USED(cbwcb); /* If trace is enabled, insert this event into the trace buffer. */ UX_TRACE_IN_LINE_INSERT(UX_TRACE_DEVICE_CLASS_STORAGE_START_STOP, storage, lun, 0, 0, UX_TRACE_DEVICE_CLASS_EVENTS, 0, 0) - /* We return a CSW with success. */ - _ux_device_class_storage_csw_send(storage, lun, endpoint_in, UX_SLAVE_CLASS_STORAGE_CSW_PASSED); + /* We set the CSW with success. */ + storage -> ux_slave_class_storage_csw_status = UX_SLAVE_CLASS_STORAGE_CSW_PASSED; /* Return successful completion. */ return(UX_SUCCESS); diff --git a/common/usbx_device_classes/src/ux_device_class_storage_synchronize_cache.c b/common/usbx_device_classes/src/ux_device_class_storage_synchronize_cache.c index bff1623..5428a91 100644 --- a/common/usbx_device_classes/src/ux_device_class_storage_synchronize_cache.c +++ b/common/usbx_device_classes/src/ux_device_class_storage_synchronize_cache.c @@ -35,7 +35,7 @@ /* FUNCTION RELEASE */ /* */ /* _ux_device_class_storage_synchronize_cache PORTABLE C */ -/* 6.0 */ +/* 6.1 */ /* AUTHOR */ /* */ /* Chaoqiong Xiao, Microsoft Corporation */ @@ -75,6 +75,9 @@ /* DATE NAME DESCRIPTION */ /* */ /* 05-19-2020 Chaoqiong Xiao Initial Version 6.0 */ +/* 09-30-2020 Chaoqiong Xiao Modified comment(s), */ +/* optimized command logic, */ +/* resulting in version 6.1 */ /* */ /**************************************************************************/ UINT _ux_device_class_storage_synchronize_cache(UX_SLAVE_CLASS_STORAGE *storage, ULONG lun, @@ -92,15 +95,15 @@ UCHAR flags; UX_PARAMETER_NOT_USED(endpoint_out); UX_PARAMETER_NOT_USED(scsi_command); + /* By default status is passed. */ + storage -> ux_slave_class_storage_csw_status = UX_SLAVE_CLASS_STORAGE_CSW_PASSED; + /* Is there not an implementation? */ if (storage -> ux_slave_class_storage_lun[lun].ux_slave_class_storage_media_flush == UX_NULL) { /* This means the application is not using a cache. */ - /* Return a CSW with success. */ - _ux_device_class_storage_csw_send(storage, lun, endpoint_in, UX_SLAVE_CLASS_STORAGE_CSW_PASSED); - /* Return success. */ return(UX_SUCCESS); } @@ -119,9 +122,7 @@ UCHAR flags; lun, storage -> ux_slave_class_storage_lun[lun].ux_slave_class_storage_media_id, &media_status); /* Update the request sense. */ - storage -> ux_slave_class_storage_lun[lun].ux_slave_class_storage_request_sense_key = (UCHAR) (media_status & 0xff); - storage -> ux_slave_class_storage_lun[lun].ux_slave_class_storage_request_code = (UCHAR) ((media_status >> 8 ) & 0xff); - storage -> ux_slave_class_storage_lun[lun].ux_slave_class_storage_request_code_qualifier = (UCHAR) ((media_status >> 16 ) & 0xff); + storage -> ux_slave_class_storage_lun[lun].ux_slave_class_storage_request_sense_status = media_status; /* If there is a problem, return a failed command. */ if (status != UX_SUCCESS) @@ -131,7 +132,7 @@ UCHAR flags; REQUEST_SENSE command. */ _ux_device_stack_endpoint_stall(endpoint_in); - _ux_device_class_storage_csw_send(storage, lun, endpoint_in, UX_SLAVE_CLASS_STORAGE_CSW_FAILED); + storage -> ux_slave_class_storage_csw_status = UX_SLAVE_CLASS_STORAGE_CSW_FAILED; /* We are done here. */ return(UX_ERROR); @@ -145,13 +146,16 @@ UCHAR flags; status = storage -> ux_slave_class_storage_lun[lun].ux_slave_class_storage_media_flush(storage, lun, number_blocks, lba, &media_status); /* Update the request sense. */ - storage -> ux_slave_class_storage_lun[lun].ux_slave_class_storage_request_sense_key = (UCHAR) (media_status & 0xff); - storage -> ux_slave_class_storage_lun[lun].ux_slave_class_storage_request_code = (UCHAR) ((media_status >> 8 ) & 0xff); - storage -> ux_slave_class_storage_lun[lun].ux_slave_class_storage_request_code_qualifier = (UCHAR) ((media_status >> 16 ) & 0xff); + storage -> ux_slave_class_storage_lun[lun].ux_slave_class_storage_request_sense_status = media_status; /* If the immediate bit is set, we are already done, no matter what local operation status is. */ if ((flags & UX_SLAVE_CLASS_STORAGE_SYNCHRONIZE_CACHE_FLAGS_IMMED) != 0) + { + + /* CSW skipped since already sent in this function. */ + UX_DEVICE_CLASS_STORAGE_CSW_SKIP(&storage -> ux_slave_class_storage_csw_status) = UX_TRUE; return(status); + } /* If there is a problem, return a failed command. */ if (status != UX_SUCCESS) @@ -161,13 +165,11 @@ UCHAR flags; REQUEST_SENSE command. */ _ux_device_stack_endpoint_stall(endpoint_in); - _ux_device_class_storage_csw_send(storage, lun, endpoint_in, UX_SLAVE_CLASS_STORAGE_CSW_FAILED); + storage -> ux_slave_class_storage_csw_status = UX_SLAVE_CLASS_STORAGE_CSW_FAILED; /* Return an error. */ return(UX_ERROR); } - else - _ux_device_class_storage_csw_send(storage, lun, endpoint_in, UX_SLAVE_CLASS_STORAGE_CSW_PASSED); /* Return completion status. */ return(status); diff --git a/common/usbx_device_classes/src/ux_device_class_storage_test_ready.c b/common/usbx_device_classes/src/ux_device_class_storage_test_ready.c index 8444133..295ade0 100644 --- a/common/usbx_device_classes/src/ux_device_class_storage_test_ready.c +++ b/common/usbx_device_classes/src/ux_device_class_storage_test_ready.c @@ -35,7 +35,7 @@ /* FUNCTION RELEASE */ /* */ /* _ux_device_class_storage_test_ready PORTABLE C */ -/* 6.0 */ +/* 6.1 */ /* AUTHOR */ /* */ /* Chaoqiong Xiao, Microsoft Corporation */ @@ -72,6 +72,9 @@ /* DATE NAME DESCRIPTION */ /* */ /* 05-19-2020 Chaoqiong Xiao Initial Version 6.0 */ +/* 09-30-2020 Chaoqiong Xiao Modified comment(s), */ +/* optimized command logic, */ +/* resulting in version 6.1 */ /* */ /**************************************************************************/ UINT _ux_device_class_storage_test_ready(UX_SLAVE_CLASS_STORAGE *storage, ULONG lun, UX_SLAVE_ENDPOINT *endpoint_in, @@ -81,8 +84,10 @@ UINT _ux_device_class_storage_test_ready(UX_SLAVE_CLASS_STORAGE *storage, ULONG UINT status; ULONG media_status; - UX_PARAMETER_NOT_USED(cbwcb); + UX_PARAMETER_NOT_USED(lun); + UX_PARAMETER_NOT_USED(endpoint_in); UX_PARAMETER_NOT_USED(endpoint_out); + UX_PARAMETER_NOT_USED(cbwcb); /* If trace is enabled, insert this event into the trace buffer. */ UX_TRACE_IN_LINE_INSERT(UX_TRACE_DEVICE_CLASS_STORAGE_TEST_READY, storage, lun, 0, 0, UX_TRACE_DEVICE_CLASS_EVENTS, 0, 0) @@ -92,23 +97,12 @@ ULONG media_status; storage -> ux_slave_class_storage_lun[lun].ux_slave_class_storage_media_id, &media_status); /* Set the sense/code/qualifier codes for the REQUEST_SENSE command. */ - storage -> ux_slave_class_storage_lun[lun].ux_slave_class_storage_request_sense_key = (media_status & 0xff); - storage -> ux_slave_class_storage_lun[lun].ux_slave_class_storage_request_code = ((media_status >> 8) & 0xff); - storage -> ux_slave_class_storage_lun[lun].ux_slave_class_storage_request_code_qualifier = ((media_status >> 16) & 0xff); - - /* Check the status for error. */ - if (status != UX_SUCCESS) - { - - /* We return a CSW with error. */ - status = _ux_device_class_storage_csw_send(storage, lun, endpoint_in, UX_SLAVE_CLASS_STORAGE_CSW_FAILED); - } - else - { + storage -> ux_slave_class_storage_lun[lun].ux_slave_class_storage_request_sense_status = media_status; - /* We return a CSW with success. */ - status = _ux_device_class_storage_csw_send(storage, lun, endpoint_in, UX_SLAVE_CLASS_STORAGE_CSW_PASSED); - } + /* Return CSW with success/error. */ + storage -> ux_slave_class_storage_csw_status = (status == UX_SUCCESS) ? + UX_SLAVE_CLASS_STORAGE_CSW_PASSED : UX_SLAVE_CLASS_STORAGE_CSW_FAILED; + status = UX_SUCCESS; /* Return completion status. */ return(status); 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 790fec3..3fa1d29 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 @@ -35,7 +35,7 @@ /* FUNCTION RELEASE */ /* */ /* _ux_device_class_storage_thread PORTABLE C */ -/* 6.0 */ +/* 6.1 */ /* AUTHOR */ /* */ /* Chaoqiong Xiao, Microsoft Corporation */ @@ -80,6 +80,7 @@ /* _ux_utility_long_get Get 32-bit value */ /* _ux_utility_memory_allocate Allocate memory */ /* _ux_utility_semaphore_create Create semaphore */ +/* _ux_utility_delay_ms Sleep thread for several ms */ /* _ux_utility_thread_suspend Suspend thread */ /* */ /* CALLED BY */ @@ -91,6 +92,14 @@ /* DATE NAME DESCRIPTION */ /* */ /* 05-19-2020 Chaoqiong Xiao Initial Version 6.0 */ +/* 09-30-2020 Chaoqiong Xiao Modified comment(s), */ +/* used sleep instead of */ +/* relinquish on error, */ +/* optimized command logic, */ +/* used UX prefix to refer to */ +/* TX symbols instead of using */ +/* them directly, */ +/* resulting in version 6.1 */ /* */ /**************************************************************************/ VOID _ux_device_class_storage_thread(ULONG storage_class) @@ -158,7 +167,7 @@ UCHAR *scsi_command; /* Check state, they must be both RESET. */ if (endpoint_out -> ux_slave_endpoint_state == UX_ENDPOINT_RESET && - !storage -> ux_slave_class_storage_phase_error) + (UCHAR)storage -> ux_slave_class_storage_csw_status != UX_SLAVE_CLASS_STORAGE_CSW_PHASE_ERROR) { /* Send the request to the device controller. */ @@ -344,9 +353,9 @@ UCHAR *scsi_command; _ux_device_stack_endpoint_stall(endpoint_in); /* Initialize the request sense keys. */ - storage -> ux_slave_class_storage_lun[lun].ux_slave_class_storage_request_sense_key = UX_SLAVE_CLASS_STORAGE_SENSE_KEY_ILLEGAL_REQUEST; - storage -> ux_slave_class_storage_lun[lun].ux_slave_class_storage_request_code = UX_SLAVE_CLASS_STORAGE_ASC_KEY_INVALID_COMMAND; - storage -> ux_slave_class_storage_lun[lun].ux_slave_class_storage_request_code_qualifier = 0; + storage -> ux_slave_class_storage_lun[lun].ux_slave_class_storage_request_sense_status = + UX_DEVICE_CLASS_STORAGE_SENSE_STATUS(UX_SLAVE_CLASS_STORAGE_SENSE_KEY_ILLEGAL_REQUEST, + UX_SLAVE_CLASS_STORAGE_ASC_KEY_INVALID_COMMAND,0); /* This is the tricky part of the SCSI state machine. We must send the CSW BUT need to wait for the endpoint_in to be reset by the host. */ @@ -357,15 +366,8 @@ UCHAR *scsi_command; if (endpoint_in -> ux_slave_endpoint_state == UX_ENDPOINT_RESET) { - /* Now we return a CSW with failure. */ - status = _ux_device_class_storage_csw_send(storage, lun, endpoint_in, UX_SLAVE_CLASS_STORAGE_CSW_FAILED); - - /* Check error code. */ - if (status != UX_SUCCESS) - - /* Error trap. */ - _ux_system_error_handler(UX_SYSTEM_LEVEL_THREAD, UX_SYSTEM_CONTEXT_CLASS, status); - + /* Now we set the CSW with failure. */ + storage -> ux_slave_class_storage_csw_status = UX_SLAVE_CLASS_STORAGE_CSW_FAILED; break; } @@ -376,27 +378,36 @@ UCHAR *scsi_command; } break; } + + /* Send CSW if not SYNC_CACHE. */ + status = _ux_device_class_storage_csw_send(storage, lun, endpoint_in, 0 /* Don't care */); + + /* Check error code. */ + if (status != UX_SUCCESS) + + /* Error trap. */ + _ux_system_error_handler(UX_SYSTEM_LEVEL_THREAD, UX_SYSTEM_CONTEXT_CLASS, status); } else /* Phase error! */ - storage -> ux_slave_class_storage_phase_error = TX_TRUE; + storage -> ux_slave_class_storage_csw_status = UX_SLAVE_CLASS_STORAGE_CSW_PHASE_ERROR; } else /* Phase error! */ - storage -> ux_slave_class_storage_phase_error = TX_TRUE; + storage -> ux_slave_class_storage_csw_status = UX_SLAVE_CLASS_STORAGE_CSW_PHASE_ERROR; } else /* Phase error! */ - storage -> ux_slave_class_storage_phase_error = TX_TRUE; + storage -> ux_slave_class_storage_csw_status = UX_SLAVE_CLASS_STORAGE_CSW_PHASE_ERROR; } else { - if (storage -> ux_slave_class_storage_phase_error == TX_TRUE) + if ((UCHAR)storage -> ux_slave_class_storage_csw_status == UX_SLAVE_CLASS_STORAGE_CSW_PHASE_ERROR) { /* We should keep the endpoints stalled. */ @@ -405,7 +416,7 @@ UCHAR *scsi_command; } /* We must therefore wait a while. */ - _ux_utility_thread_relinquish(); + _ux_utility_delay_ms(2); } } 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 112225a..1785008 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.0 */ +/* 6.1 */ /* AUTHOR */ /* */ /* Chaoqiong Xiao, Microsoft Corporation */ @@ -66,6 +66,8 @@ /* 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 */ /* */ /**************************************************************************/ UINT _ux_device_class_storage_uninitialize(UX_SLAVE_CLASS_COMMAND *command) diff --git a/common/usbx_device_classes/src/ux_device_class_storage_verify.c b/common/usbx_device_classes/src/ux_device_class_storage_verify.c index c915ec6..2069cbd 100644 --- a/common/usbx_device_classes/src/ux_device_class_storage_verify.c +++ b/common/usbx_device_classes/src/ux_device_class_storage_verify.c @@ -35,7 +35,7 @@ /* FUNCTION RELEASE */ /* */ /* _ux_device_class_storage_verify PORTABLE C */ -/* 6.0 */ +/* 6.1 */ /* AUTHOR */ /* */ /* Chaoqiong Xiao, Microsoft Corporation */ @@ -69,6 +69,9 @@ /* DATE NAME DESCRIPTION */ /* */ /* 05-19-2020 Chaoqiong Xiao Initial Version 6.0 */ +/* 09-30-2020 Chaoqiong Xiao Modified comment(s), */ +/* optimized command logic, */ +/* resulting in version 6.1 */ /* */ /**************************************************************************/ UINT _ux_device_class_storage_verify(UX_SLAVE_CLASS_STORAGE *storage, ULONG lun, @@ -76,14 +79,16 @@ UINT _ux_device_class_storage_verify(UX_SLAVE_CLASS_STORAGE *storage, ULONG lun UX_SLAVE_ENDPOINT *endpoint_out, UCHAR * cbwcb) { + UX_PARAMETER_NOT_USED(lun); UX_PARAMETER_NOT_USED(cbwcb); + UX_PARAMETER_NOT_USED(endpoint_in); UX_PARAMETER_NOT_USED(endpoint_out); /* If trace is enabled, insert this event into the trace buffer. */ UX_TRACE_IN_LINE_INSERT(UX_TRACE_DEVICE_CLASS_STORAGE_VERIFY, storage, lun, 0, 0, UX_TRACE_DEVICE_CLASS_EVENTS, 0, 0) - /* We return a CSW with success. */ - _ux_device_class_storage_csw_send(storage, lun, endpoint_in, UX_SLAVE_CLASS_STORAGE_CSW_PASSED); + /* We set the CSW with success. */ + storage -> ux_slave_class_storage_csw_status = UX_SLAVE_CLASS_STORAGE_CSW_PASSED; /* Return success! */ return(UX_SUCCESS); diff --git a/common/usbx_device_classes/src/ux_device_class_storage_write.c b/common/usbx_device_classes/src/ux_device_class_storage_write.c index dbf0b49..c42bf10 100644 --- a/common/usbx_device_classes/src/ux_device_class_storage_write.c +++ b/common/usbx_device_classes/src/ux_device_class_storage_write.c @@ -34,7 +34,7 @@ /* FUNCTION RELEASE */ /* */ /* _ux_device_class_storage_write PORTABLE C */ -/* 6.0 */ +/* 6.1 */ /* AUTHOR */ /* */ /* Chaoqiong Xiao, Microsoft Corporation */ @@ -77,6 +77,9 @@ /* DATE NAME DESCRIPTION */ /* */ /* 05-19-2020 Chaoqiong Xiao Initial Version 6.0 */ +/* 09-30-2020 Chaoqiong Xiao Modified comment(s), */ +/* optimized command logic, */ +/* resulting in version 6.1 */ /* */ /**************************************************************************/ UINT _ux_device_class_storage_write(UX_SLAVE_CLASS_STORAGE *storage, ULONG lun, @@ -93,6 +96,8 @@ ULONG media_status; ULONG total_length; ULONG transfer_length; + UX_PARAMETER_NOT_USED(endpoint_in); + /* Get the LBA from the CBWCB. */ lba = _ux_utility_long_get_big_endian(cbwcb + UX_SLAVE_CLASS_STORAGE_WRITE_LBA); @@ -119,9 +124,10 @@ ULONG transfer_length; lun, storage -> ux_slave_class_storage_lun[lun].ux_slave_class_storage_media_id, &media_status); /* Update the request sense. */ - storage -> ux_slave_class_storage_lun[lun].ux_slave_class_storage_request_sense_key = (UCHAR) (media_status & 0xff); - storage -> ux_slave_class_storage_lun[lun].ux_slave_class_storage_request_code = (UCHAR) ((media_status >> 8 ) & 0xff); - storage -> ux_slave_class_storage_lun[lun].ux_slave_class_storage_request_code_qualifier = (UCHAR) ((media_status >> 16 ) & 0xff); + storage -> ux_slave_class_storage_lun[lun].ux_slave_class_storage_request_sense_status = media_status; + + /* Default CSW to failed. */ + storage -> ux_slave_class_storage_csw_status = UX_SLAVE_CLASS_STORAGE_CSW_FAILED; /* If there is a problem, return a failed command. */ if (status != UX_SUCCESS) @@ -131,9 +137,6 @@ ULONG transfer_length; REQUEST_SENSE command. */ _ux_device_stack_endpoint_stall(endpoint_out); - /* Now we return a CSW with failure. */ - _ux_device_class_storage_csw_send(storage, lun, endpoint_in, UX_SLAVE_CLASS_STORAGE_CSW_FAILED); - /* We are done here. */ return(UX_ERROR); } @@ -143,17 +146,14 @@ ULONG transfer_length; { /* Update the request sense. */ - storage -> ux_slave_class_storage_lun[lun].ux_slave_class_storage_request_sense_key = UX_SLAVE_CLASS_STORAGE_SENSE_KEY_DATA_PROTECT; - storage -> ux_slave_class_storage_lun[lun].ux_slave_class_storage_request_code = UX_SLAVE_CLASS_STORAGE_REQUEST_CODE_MEDIA_PROTECTED; - storage -> ux_slave_class_storage_lun[lun].ux_slave_class_storage_request_code_qualifier = 0; + storage -> ux_slave_class_storage_lun[lun].ux_slave_class_storage_request_sense_status = + UX_DEVICE_CLASS_STORAGE_SENSE_STATUS(UX_SLAVE_CLASS_STORAGE_SENSE_KEY_DATA_PROTECT, + UX_SLAVE_CLASS_STORAGE_REQUEST_CODE_MEDIA_PROTECTED,0); /* We have a problem, cannot write to RO drive. Return a bad completion and wait for the REQUEST_SENSE command. */ _ux_device_stack_endpoint_stall(endpoint_out); - /* Now we return a CSW with failure. */ - _ux_device_class_storage_csw_send(storage, lun, endpoint_in, UX_SLAVE_CLASS_STORAGE_CSW_FAILED); - /* We are done here. */ return(UX_ERROR); } @@ -186,13 +186,9 @@ ULONG transfer_length; _ux_device_stack_endpoint_stall(endpoint_out); /* And update the REQUEST_SENSE codes. */ - storage -> ux_slave_class_storage_lun[lun].ux_slave_class_storage_request_sense_key = 0x02; - storage -> ux_slave_class_storage_lun[lun].ux_slave_class_storage_request_code = 0x54; - storage -> ux_slave_class_storage_lun[lun].ux_slave_class_storage_request_code_qualifier = 0x00; + storage -> ux_slave_class_storage_lun[lun].ux_slave_class_storage_request_sense_status = + UX_DEVICE_CLASS_STORAGE_SENSE_STATUS(0x02,0x54,0x00); - /* Now we return a CSW with failure. */ - _ux_device_class_storage_csw_send(storage, lun, endpoint_in, UX_SLAVE_CLASS_STORAGE_CSW_FAILED); - /* Return an error. */ return(UX_ERROR); } @@ -212,13 +208,8 @@ ULONG transfer_length; _ux_device_stack_endpoint_stall(endpoint_out); /* And update the REQUEST_SENSE codes. */ - storage -> ux_slave_class_storage_lun[lun].ux_slave_class_storage_request_sense_key = (UCHAR) (media_status & 0xff); - storage -> ux_slave_class_storage_lun[lun].ux_slave_class_storage_request_code = (UCHAR) ((media_status >> 8 ) & 0xff); - storage -> ux_slave_class_storage_lun[lun].ux_slave_class_storage_request_code_qualifier = (UCHAR) ((media_status >> 16 ) & 0xff); + storage -> ux_slave_class_storage_lun[lun].ux_slave_class_storage_request_sense_status = media_status; - /* Now we return a CSW with failure. */ - _ux_device_class_storage_csw_send(storage, lun, endpoint_in, UX_SLAVE_CLASS_STORAGE_CSW_FAILED); - /* Return an error. */ return(UX_ERROR); } @@ -230,8 +221,8 @@ ULONG transfer_length; total_length -= transfer_length; } - /* Now we return a CSW with success. */ - status = _ux_device_class_storage_csw_send(storage, lun, endpoint_in, UX_SLAVE_CLASS_STORAGE_CSW_PASSED); + /* Now we set the CSW with success. */ + storage -> ux_slave_class_storage_csw_status = UX_SLAVE_CLASS_STORAGE_CSW_PASSED; /* Return completion status. */ return(status); diff --git a/common/usbx_host_classes/CMakeLists.txt b/common/usbx_host_classes/CMakeLists.txt index 5be86cc..35edc22 100644 --- a/common/usbx_host_classes/CMakeLists.txt +++ b/common/usbx_host_classes/CMakeLists.txt @@ -202,6 +202,8 @@ target_sources(${PROJECT_NAME} PRIVATE ${CMAKE_CURRENT_LIST_DIR}/src/ux_host_class_storage_media_capacity_get.c ${CMAKE_CURRENT_LIST_DIR}/src/ux_host_class_storage_media_characteristics_get.c ${CMAKE_CURRENT_LIST_DIR}/src/ux_host_class_storage_media_format_capacity_get.c + ${CMAKE_CURRENT_LIST_DIR}/src/ux_host_class_storage_media_get.c + ${CMAKE_CURRENT_LIST_DIR}/src/ux_host_class_storage_media_lock.c ${CMAKE_CURRENT_LIST_DIR}/src/ux_host_class_storage_media_mount.c ${CMAKE_CURRENT_LIST_DIR}/src/ux_host_class_storage_media_open.c ${CMAKE_CURRENT_LIST_DIR}/src/ux_host_class_storage_media_protection_check.c @@ -235,11 +237,13 @@ target_sources(${PROJECT_NAME} PRIVATE ${CMAKE_CURRENT_LIST_DIR}/src/ux_host_class_video_configure.c ${CMAKE_CURRENT_LIST_DIR}/src/ux_host_class_video_control_get.c ${CMAKE_CURRENT_LIST_DIR}/src/ux_host_class_video_control_list_get.c + ${CMAKE_CURRENT_LIST_DIR}/src/ux_host_class_video_control_request.c ${CMAKE_CURRENT_LIST_DIR}/src/ux_host_class_video_control_value_get.c ${CMAKE_CURRENT_LIST_DIR}/src/ux_host_class_video_control_value_set.c ${CMAKE_CURRENT_LIST_DIR}/src/ux_host_class_video_deactivate.c ${CMAKE_CURRENT_LIST_DIR}/src/ux_host_class_video_descriptor_get.c ${CMAKE_CURRENT_LIST_DIR}/src/ux_host_class_video_endpoints_get.c + ${CMAKE_CURRENT_LIST_DIR}/src/ux_host_class_video_entities_parse.c ${CMAKE_CURRENT_LIST_DIR}/src/ux_host_class_video_entry.c ${CMAKE_CURRENT_LIST_DIR}/src/ux_host_class_video_format_data_get.c ${CMAKE_CURRENT_LIST_DIR}/src/ux_host_class_video_frame_data_get.c diff --git a/common/usbx_host_classes/inc/ux_host_class_asix.h b/common/usbx_host_classes/inc/ux_host_class_asix.h index 71d1083..477b632 100644 --- a/common/usbx_host_classes/inc/ux_host_class_asix.h +++ b/common/usbx_host_classes/inc/ux_host_class_asix.h @@ -26,7 +26,7 @@ /* COMPONENT DEFINITION RELEASE */ /* */ /* ux_host_class_asix.h PORTABLE C */ -/* 6.0 */ +/* 6.1 */ /* AUTHOR */ /* */ /* Chaoqiong Xiao, Microsoft Corporation */ @@ -41,6 +41,11 @@ /* DATE NAME DESCRIPTION */ /* */ /* 05-19-2020 Chaoqiong Xiao Initial Version 6.0 */ +/* 09-30-2020 Chaoqiong Xiao Modified comment(s), */ +/* used UX prefix to refer to */ +/* TX symbols instead of using */ +/* them directly, */ +/* resulting in version 6.1 */ /* */ /**************************************************************************/ @@ -344,9 +349,9 @@ typedef struct UX_HOST_CLASS_ASIX_STRUCT UX_INTERFACE *ux_host_class_asix_interface; UINT ux_host_class_asix_instance_status; UINT ux_host_class_asix_state; - TX_SEMAPHORE ux_host_class_asix_semaphore; - TX_SEMAPHORE ux_host_class_asix_interrupt_notification_semaphore; - TX_THREAD ux_host_class_asix_thread; + UX_SEMAPHORE ux_host_class_asix_semaphore; + UX_SEMAPHORE ux_host_class_asix_interrupt_notification_semaphore; + UX_THREAD ux_host_class_asix_thread; UCHAR *ux_host_class_asix_thread_stack; ULONG ux_host_class_asix_notification_count; ULONG ux_host_class_asix_primary_phy_id; 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 c976e2d..db23a18 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.0 */ +/* 6.1 */ /* AUTHOR */ /* */ /* Chaoqiong Xiao, Microsoft Corporation */ @@ -41,6 +41,11 @@ /* DATE NAME DESCRIPTION */ /* */ /* 05-19-2020 Chaoqiong Xiao Initial Version 6.0 */ +/* 09-30-2020 Chaoqiong Xiao Modified comment(s), */ +/* used UX prefix to refer to */ +/* TX symbols instead of using */ +/* them directly, */ +/* resulting in version 6.1 */ /* */ /**************************************************************************/ @@ -338,7 +343,7 @@ typedef struct UX_HOST_CLASS_AUDIO_STRUCT UINT ux_host_class_audio_channels; ULONG ux_host_class_audio_channel_control[UX_HOST_CLASS_AUDIO_MAX_CHANNEL]; UCHAR ux_host_class_audio_name[UX_HOST_CLASS_AUDIO_NAME_LENGTH]; - TX_SEMAPHORE ux_host_class_audio_semaphore; + UX_SEMAPHORE ux_host_class_audio_semaphore; } UX_HOST_CLASS_AUDIO; @@ -352,7 +357,7 @@ typedef struct UX_HOST_CLASS_AUDIO_TRANSFER_REQUEST_STRUCT ULONG ux_host_class_audio_transfer_request_requested_length; ULONG ux_host_class_audio_transfer_request_actual_length; VOID (*ux_host_class_audio_transfer_request_completion_function) (struct UX_HOST_CLASS_AUDIO_TRANSFER_REQUEST_STRUCT *); - TX_SEMAPHORE ux_host_class_audio_transfer_request_semaphore; + UX_SEMAPHORE ux_host_class_audio_transfer_request_semaphore; VOID *ux_host_class_audio_transfer_request_class_instance; UINT ux_host_class_audio_transfer_request_completion_code; struct UX_HOST_CLASS_AUDIO_TRANSFER_REQUEST_STRUCT diff --git a/common/usbx_host_classes/inc/ux_host_class_cdc_acm.h b/common/usbx_host_classes/inc/ux_host_class_cdc_acm.h index 62ff9f9..0e0795a 100644 --- a/common/usbx_host_classes/inc/ux_host_class_cdc_acm.h +++ b/common/usbx_host_classes/inc/ux_host_class_cdc_acm.h @@ -26,7 +26,7 @@ /* COMPONENT DEFINITION RELEASE */ /* */ /* ux_host_class_cdc_acm.h PORTABLE C */ -/* 6.0 */ +/* 6.1 */ /* AUTHOR */ /* */ /* Chaoqiong Xiao, Microsoft Corporation */ @@ -41,6 +41,11 @@ /* DATE NAME DESCRIPTION */ /* */ /* 05-19-2020 Chaoqiong Xiao Initial Version 6.0 */ +/* 09-30-2020 Chaoqiong Xiao Modified comment(s), */ +/* used UX prefix to refer to */ +/* TX symbols instead of using */ +/* them directly, */ +/* resulting in version 6.1 */ /* */ /**************************************************************************/ @@ -194,7 +199,7 @@ typedef struct UX_HOST_CLASS_CDC_ACM_STRUCT UX_INTERFACE *ux_host_class_cdc_acm_interface; UINT ux_host_class_cdc_acm_instance_status; UINT ux_host_class_cdc_acm_state; - TX_SEMAPHORE ux_host_class_cdc_acm_semaphore; + UX_SEMAPHORE ux_host_class_cdc_acm_semaphore; ULONG ux_host_class_cdc_acm_notification_count; UCHAR ux_host_class_cdc_acm_capabilities; ULONG ux_host_class_cdc_acm_device_state; @@ -220,7 +225,7 @@ typedef struct UX_HOST_CLASS_CDC_DLC_STRUCT UX_INTERFACE *ux_host_class_cdc_dlc_interface; UINT ux_host_class_cdc_dlc_instance_status; UINT ux_host_class_cdc_dlc_state; - TX_SEMAPHORE ux_host_class_cdc_dlc_semaphore; + UX_SEMAPHORE ux_host_class_cdc_dlc_semaphore; ULONG ux_host_class_cdc_dlc_notification_count; UCHAR ux_host_class_cdc_dlc_capabilities; struct UX_HOST_CLASS_CDC_DLC_RECEPTION_STRUCT 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 a3f15d1..ae5e1c8 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.0 */ +/* 6.1 */ /* AUTHOR */ /* */ /* Chaoqiong Xiao, Microsoft Corporation */ @@ -41,6 +41,11 @@ /* DATE NAME DESCRIPTION */ /* */ /* 05-19-2020 Chaoqiong Xiao Initial Version 6.0 */ +/* 09-30-2020 Chaoqiong Xiao Modified comment(s), */ +/* used UX prefix to refer to */ +/* TX symbols instead of using */ +/* them directly, */ +/* resulting in version 6.1 */ /* */ /**************************************************************************/ @@ -220,14 +225,14 @@ typedef struct UX_HOST_CLASS_CDC_ECM_STRUCT UX_INTERFACE *ux_host_class_cdc_ecm_interface_control; UCHAR ux_host_class_cdc_ecm_bulk_in_transfer_check_and_arm_in_process; UCHAR ux_host_class_cdc_ecm_bulk_in_transfer_waiting_for_check_and_arm_to_finish; - TX_SEMAPHORE ux_host_class_cdc_ecm_bulk_in_transfer_waiting_for_check_and_arm_to_finish_semaphore; + UX_SEMAPHORE ux_host_class_cdc_ecm_bulk_in_transfer_waiting_for_check_and_arm_to_finish_semaphore; UCHAR ux_host_class_cdc_ecm_bulk_out_transfer_check_and_arm_in_process; UCHAR ux_host_class_cdc_ecm_bulk_out_transfer_waiting_for_check_and_arm_to_finish; - TX_SEMAPHORE ux_host_class_cdc_ecm_bulk_out_transfer_waiting_for_check_and_arm_to_finish_semaphore; + UX_SEMAPHORE ux_host_class_cdc_ecm_bulk_out_transfer_waiting_for_check_and_arm_to_finish_semaphore; UINT ux_host_class_cdc_ecm_instance_status; UINT ux_host_class_cdc_ecm_state; - TX_SEMAPHORE ux_host_class_cdc_ecm_interrupt_notification_semaphore; - TX_THREAD ux_host_class_cdc_ecm_thread; + UX_SEMAPHORE ux_host_class_cdc_ecm_interrupt_notification_semaphore; + UX_THREAD ux_host_class_cdc_ecm_thread; UCHAR *ux_host_class_cdc_ecm_thread_stack; ULONG ux_host_class_cdc_ecm_notification_count; ULONG ux_host_class_cdc_ecm_primary_phy_id; diff --git a/common/usbx_host_classes/inc/ux_host_class_gser.h b/common/usbx_host_classes/inc/ux_host_class_gser.h index a9d76b6..5b84686 100644 --- a/common/usbx_host_classes/inc/ux_host_class_gser.h +++ b/common/usbx_host_classes/inc/ux_host_class_gser.h @@ -26,7 +26,7 @@ /* COMPONENT DEFINITION RELEASE */ /* */ /* ux_host_class_gser.h PORTABLE C */ -/* 6.0 */ +/* 6.1 */ /* AUTHOR */ /* */ /* Chaoqiong Xiao, Microsoft Corporation */ @@ -41,6 +41,11 @@ /* DATE NAME DESCRIPTION */ /* */ /* 05-19-2020 Chaoqiong Xiao Initial Version 6.0 */ +/* 09-30-2020 Chaoqiong Xiao Modified comment(s), */ +/* used UX prefix to refer to */ +/* TX symbols instead of using */ +/* them directly, */ +/* resulting in version 6.1 */ /* */ /**************************************************************************/ @@ -155,7 +160,7 @@ typedef struct UX_HOST_CLASS_GSER_INTERFACE_STRUCT UX_INTERFACE *ux_host_class_gser_interface; UX_ENDPOINT *ux_host_class_gser_bulk_out_endpoint; UX_ENDPOINT *ux_host_class_gser_bulk_in_endpoint; - TX_SEMAPHORE ux_host_class_gser_semaphore; + UX_SEMAPHORE ux_host_class_gser_semaphore; struct UX_HOST_CLASS_GSER_RECEPTION_STRUCT *ux_host_class_gser_reception; ULONG ux_host_class_gser_notification_count; } UX_HOST_CLASS_GSER_INTERFACE; 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 d7aa0d5..49b1cec 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.0.2 */ +/* 6.1 */ /* AUTHOR */ /* */ /* Chaoqiong Xiao, Microsoft Corporation */ @@ -41,10 +41,12 @@ /* DATE NAME DESCRIPTION */ /* */ /* 05-19-2020 Chaoqiong Xiao Initial Version 6.0 */ -/* 08-14-2020 Chaoqiong Xiao Modified comment(s), */ -/* fixed struct field */ -/* definition issues, */ -/* resulting in version 6.0.2 */ +/* 09-30-2020 Chaoqiong Xiao Modified comment(s), */ +/* used UX prefix to refer to */ +/* TX symbols instead of using */ +/* them directly, fixed struct */ +/* field definition issues, */ +/* resulting in version 6.1 */ /* */ /**************************************************************************/ @@ -936,7 +938,7 @@ typedef struct UX_HOST_CLASS_HID_STRUCT ux_host_class_hid_parser; struct UX_HOST_CLASS_HID_CLIENT_STRUCT *ux_host_class_hid_client; - TX_SEMAPHORE ux_host_class_hid_semaphore; + UX_SEMAPHORE ux_host_class_hid_semaphore; } UX_HOST_CLASS_HID; diff --git a/common/usbx_host_classes/inc/ux_host_class_hid_keyboard.h b/common/usbx_host_classes/inc/ux_host_class_hid_keyboard.h index 1a6a5d2..229302a 100644 --- a/common/usbx_host_classes/inc/ux_host_class_hid_keyboard.h +++ b/common/usbx_host_classes/inc/ux_host_class_hid_keyboard.h @@ -26,7 +26,7 @@ /* COMPONENT DEFINITION RELEASE */ /* */ /* ux_host_class_hid_keyboard.h PORTABLE C */ -/* 6.0 */ +/* 6.1 */ /* AUTHOR */ /* */ /* Chaoqiong Xiao, Microsoft Corporation */ @@ -41,6 +41,11 @@ /* DATE NAME DESCRIPTION */ /* */ /* 05-19-2020 Chaoqiong Xiao Initial Version 6.0 */ +/* 09-30-2020 Chaoqiong Xiao Modified comment(s), */ +/* used UX prefix to refer to */ +/* TX symbols instead of using */ +/* them directly, */ +/* resulting in version 6.1 */ /* */ /**************************************************************************/ @@ -185,8 +190,8 @@ typedef struct UX_HOST_CLASS_HID_KEYBOARD_STRUCT ULONG ux_host_class_hid_keyboard_key_count; UX_HOST_CLASS_HID *ux_host_class_hid_keyboard_hid; USHORT ux_host_class_hid_keyboard_id; - TX_THREAD ux_host_class_hid_keyboard_thread; - TX_SEMAPHORE ux_host_class_hid_keyboard_semaphore; + UX_THREAD ux_host_class_hid_keyboard_thread; + UX_SEMAPHORE ux_host_class_hid_keyboard_semaphore; ULONG ux_host_class_hid_keyboard_alternate_key_state; ULONG ux_host_class_hid_keyboard_led_mask; VOID *ux_host_class_hid_keyboard_thread_stack; diff --git a/common/usbx_host_classes/inc/ux_host_class_hid_mouse.h b/common/usbx_host_classes/inc/ux_host_class_hid_mouse.h index 363611e..00846a7 100644 --- a/common/usbx_host_classes/inc/ux_host_class_hid_mouse.h +++ b/common/usbx_host_classes/inc/ux_host_class_hid_mouse.h @@ -26,7 +26,7 @@ /* COMPONENT DEFINITION RELEASE */ /* */ /* ux_host_class_hid_mouse.h PORTABLE C */ -/* 6.0 */ +/* 6.1 */ /* AUTHOR */ /* */ /* Chaoqiong Xiao, Microsoft Corporation */ @@ -41,6 +41,8 @@ /* 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 */ /* */ /**************************************************************************/ diff --git a/common/usbx_host_classes/inc/ux_host_class_hid_remote_control.h b/common/usbx_host_classes/inc/ux_host_class_hid_remote_control.h index 11d006f..a8685fa 100644 --- a/common/usbx_host_classes/inc/ux_host_class_hid_remote_control.h +++ b/common/usbx_host_classes/inc/ux_host_class_hid_remote_control.h @@ -26,7 +26,7 @@ /* COMPONENT DEFINITION RELEASE */ /* */ /* ux_host_class_hid_remote_control.h PORTABLE C */ -/* 6.0 */ +/* 6.1 */ /* AUTHOR */ /* */ /* Chaoqiong Xiao, Microsoft Corporation */ @@ -41,6 +41,8 @@ /* 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 */ /* */ /**************************************************************************/ 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 47a77d5..50f76d5 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.0 */ +/* 6.1 */ /* AUTHOR */ /* */ /* Chaoqiong Xiao, Microsoft Corporation */ @@ -41,6 +41,8 @@ /* 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 */ /* */ /**************************************************************************/ 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 009415c..5b3d0b6 100644 --- a/common/usbx_host_classes/inc/ux_host_class_pima.h +++ b/common/usbx_host_classes/inc/ux_host_class_pima.h @@ -25,8 +25,8 @@ /* */ /* COMPONENT DEFINITION RELEASE */ /* */ -/* ux_host_class_cdc_acm.h PORTABLE C */ -/* 6.0 */ +/* ux_host_class_pima.h PORTABLE C */ +/* 6.1 */ /* AUTHOR */ /* */ /* Chaoqiong Xiao, Microsoft Corporation */ @@ -41,6 +41,11 @@ /* DATE NAME DESCRIPTION */ /* */ /* 05-19-2020 Chaoqiong Xiao Initial Version 6.0 */ +/* 09-30-2020 Chaoqiong Xiao Modified comment(s), */ +/* used UX prefix to refer to */ +/* TX symbols instead of using */ +/* them directly, */ +/* resulting in version 6.1 */ /* */ /**************************************************************************/ @@ -367,7 +372,7 @@ 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; - TX_SEMAPHORE ux_host_class_pima_semaphore; + UX_SEMAPHORE ux_host_class_pima_semaphore; VOID *ux_host_class_pima_application; ULONG ux_host_class_pima_zlp_flag; 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 7cdf4b7..8caa2eb 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.0 */ +/* 6.1 */ /* AUTHOR */ /* */ /* Chaoqiong Xiao, Microsoft Corporation */ @@ -41,6 +41,11 @@ /* DATE NAME DESCRIPTION */ /* */ /* 05-19-2020 Chaoqiong Xiao Initial Version 6.0 */ +/* 09-30-2020 Chaoqiong Xiao Modified comment(s), */ +/* used UX prefix to refer to */ +/* TX symbols instead of using */ +/* them directly, */ +/* resulting in version 6.1 */ /* */ /**************************************************************************/ @@ -86,7 +91,7 @@ typedef struct UX_HOST_CLASS_PRINTER_STRUCT UX_ENDPOINT *ux_host_class_printer_bulk_in_endpoint; UINT ux_host_class_printer_state; UCHAR ux_host_class_printer_name[UX_HOST_CLASS_PRINTER_NAME_LENGTH]; - TX_SEMAPHORE ux_host_class_printer_semaphore; + UX_SEMAPHORE ux_host_class_printer_semaphore; } UX_HOST_CLASS_PRINTER; diff --git a/common/usbx_host_classes/inc/ux_host_class_prolific.h b/common/usbx_host_classes/inc/ux_host_class_prolific.h index 79b4918..5e69646 100644 --- a/common/usbx_host_classes/inc/ux_host_class_prolific.h +++ b/common/usbx_host_classes/inc/ux_host_class_prolific.h @@ -26,7 +26,7 @@ /* COMPONENT DEFINITION RELEASE */ /* */ /* ux_host_class_prolific.h PORTABLE C */ -/* 6.0 */ +/* 6.1 */ /* AUTHOR */ /* */ /* Chaoqiong Xiao, Microsoft Corporation */ @@ -41,6 +41,11 @@ /* DATE NAME DESCRIPTION */ /* */ /* 05-19-2020 Chaoqiong Xiao Initial Version 6.0 */ +/* 09-30-2020 Chaoqiong Xiao Modified comment(s), */ +/* used UX prefix to refer to */ +/* TX symbols instead of using */ +/* them directly, */ +/* resulting in version 6.1 */ /* */ /**************************************************************************/ @@ -191,7 +196,7 @@ typedef struct UX_HOST_CLASS_PROLIFIC_STRUCT UX_INTERFACE *ux_host_class_prolific_interface; UINT ux_host_class_prolific_instance_status; UINT ux_host_class_prolific_state; - TX_SEMAPHORE ux_host_class_prolific_semaphore; + UX_SEMAPHORE ux_host_class_prolific_semaphore; ULONG ux_host_class_prolific_notification_count; ULONG ux_host_class_prolific_device_state; VOID (*ux_host_class_prolific_device_status_change_callback)(struct UX_HOST_CLASS_PROLIFIC_STRUCT *prolific, 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 afe000d..359bbd1 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.0 */ +/* 6.1 */ /* AUTHOR */ /* */ /* Chaoqiong Xiao, Microsoft Corporation */ @@ -41,6 +41,17 @@ /* DATE NAME DESCRIPTION */ /* */ /* 05-19-2020 Chaoqiong Xiao Initial Version 6.0 */ +/* 09-30-2020 Chaoqiong Xiao Modified comment(s), */ +/* added option to disable FX */ +/* media integration, used UX_ */ +/* things instead of FX_ */ +/* things directly, used host */ +/* class extension pointer for */ +/* class specific structured */ +/* data, used UX prefix to */ +/* refer to TX symbols instead */ +/* of using them directly, */ +/* resulting in version 6.1 */ /* */ /**************************************************************************/ @@ -48,9 +59,49 @@ #define UX_HOST_CLASS_STORAGE_H +#if !defined(UX_HOST_CLASS_STORAGE_NO_FILEX) /* Include the FileX API. */ #include "fx_api.h" +/* Refine media stubs. */ + +#ifndef UX_MEDIA +#define UX_MEDIA FX_MEDIA +#endif + +#ifndef ux_media_id_get +#define ux_media_id_get(m) ((m)->fx_media_id) +#endif + +#ifndef ux_media_id_set +#define ux_media_id_set(m,id) ((m)->fx_media_id=(id)) +#endif + +#ifndef ux_media_driver_info_get +#define ux_media_driver_info_get(m) ((m)->fx_media_driver_info) +#endif + +#ifndef ux_media_driver_info_set +#define ux_media_driver_info_set(m,i) ((m)->fx_media_driver_info=(VOID*)(i)) +#endif + +#ifndef ux_media_reserved_for_user_get +#define ux_media_reserved_for_user_get(m) ((m)->fx_media_reserved_for_user) +#endif + +#ifndef ux_media_reserved_for_user_set +#define ux_media_reserved_for_user_set(m,u) ((m)->fx_media_reserved_for_user=(ALIGN_TYPE)(u)) +#endif + +#ifndef ux_media_open +#define ux_media_open fx_media_open +#endif + +#ifndef ux_media_close +#define ux_media_close fx_media_close +#endif +#endif + /* Define User configurable Storage Class constants. */ #ifndef UX_MAX_HOST_LUN @@ -356,8 +407,8 @@ #define UX_HOST_CLASS_STORAGE_CBW_LENGTH 31 #define UX_HOST_CLASS_STORAGE_CSW_LENGTH 13 -#define UX_HOST_CLASS_STORAGE_CBW_LENGTH_ALIGNED 64 -#define UX_HOST_CLASS_STORAGE_CSW_LENGTH_ALIGNED 64 +#define UX_HOST_CLASS_STORAGE_CBW_LENGTH_ALIGNED 32 +#define UX_HOST_CLASS_STORAGE_CSW_LENGTH_ALIGNED 16 typedef struct UX_HOST_CLASS_STORAGE_STRUCT @@ -381,26 +432,45 @@ typedef struct UX_HOST_CLASS_STORAGE_STRUCT UINT ux_host_class_storage_max_lun; UINT ux_host_class_storage_lun; UINT ux_host_class_storage_lun_types[UX_MAX_HOST_LUN]; +#if defined(UX_HOST_CLASS_STORAGE_NO_FILEX) + ULONG ux_host_class_storage_last_sector_number; +#endif ULONG ux_host_class_storage_sector_size; ULONG ux_host_class_storage_data_phase_length; UINT (*ux_host_class_storage_transport) (struct UX_HOST_CLASS_STORAGE_STRUCT *storage, UCHAR * data_pointer); ULONG ux_host_class_storage_sense_code; UCHAR *ux_host_class_storage_memory; - TX_SEMAPHORE ux_host_class_storage_semaphore; + UX_SEMAPHORE ux_host_class_storage_semaphore; } UX_HOST_CLASS_STORAGE; +typedef struct UX_HOST_CLASS_STORAGE_EXT_STRUCT +{ + UX_THREAD ux_host_class_thread; + CHAR ux_host_class_thread_stack[UX_HOST_CLASS_STORAGE_THREAD_STACK_SIZE]; +} UX_HOST_CLASS_STORAGE_EXT; + + /* Define Host Storage Class Media structure. */ typedef struct UX_HOST_CLASS_STORAGE_MEDIA_STRUCT { - FX_MEDIA ux_host_class_storage_media; +#if !defined(UX_HOST_CLASS_STORAGE_NO_FILEX) + UX_MEDIA ux_host_class_storage_media; + ULONG ux_host_class_storage_media_partition_start; + VOID *ux_host_class_storage_media_memory; ULONG ux_host_class_storage_media_status; ULONG ux_host_class_storage_media_lun; - ULONG ux_host_class_storage_media_partition_start; ULONG ux_host_class_storage_media_sector_size; - VOID *ux_host_class_storage_media_memory; +#else + struct UX_HOST_CLASS_STORAGE_STRUCT + *ux_host_class_storage_media_storage; + ULONG ux_host_class_storage_media_number_sectors; + USHORT ux_host_class_storage_media_sector_size; + UCHAR ux_host_class_storage_media_lun; + UCHAR reserved; +#endif } UX_HOST_CLASS_STORAGE_MEDIA; @@ -415,7 +485,15 @@ UINT _ux_host_class_storage_deactivate(UX_HOST_CLASS_COMMAND *command); UINT _ux_host_class_storage_device_initialize(UX_HOST_CLASS_STORAGE *storage); UINT _ux_host_class_storage_device_reset(UX_HOST_CLASS_STORAGE *storage); UINT _ux_host_class_storage_device_support_check(UX_HOST_CLASS_STORAGE *storage); -VOID _ux_host_class_storage_driver_entry(FX_MEDIA *media); +#if !defined(UX_HOST_CLASS_STORAGE_NO_FILEX) +VOID _ux_host_class_storage_driver_entry(UX_MEDIA *media); +#else +#define _ux_host_class_storage_lock(s,w) _ux_utility_semaphore_get(&(s) -> ux_host_class_storage_semaphore, (w)) +#define _ux_host_class_storage_unlock(s) _ux_utility_semaphore_put(&(s) -> ux_host_class_storage_semaphore) +UINT _ux_host_class_storage_media_get(UX_HOST_CLASS_STORAGE *storage, ULONG media_index, UX_HOST_CLASS_STORAGE_MEDIA **storage_media); +UINT _ux_host_class_storage_media_lock(UX_HOST_CLASS_STORAGE_MEDIA *storage_media, ULONG wait); +#define _ux_host_class_storage_media_unlock(m) _ux_host_class_storage_unlock((m) -> ux_host_class_storage_media_storage) +#endif UINT _ux_host_class_storage_endpoints_get(UX_HOST_CLASS_STORAGE *storage); UINT _ux_host_class_storage_entry(UX_HOST_CLASS_COMMAND *command); UINT _ux_host_class_storage_max_lun_get(UX_HOST_CLASS_STORAGE *storage); @@ -448,4 +526,10 @@ UINT _ux_host_class_storage_unit_ready_test(UX_HOST_CLASS_STORAGE *storage); #define ux_host_class_storage_media_read _ux_host_class_storage_media_read #define ux_host_class_storage_media_write _ux_host_class_storage_media_write +#if defined(UX_HOST_CLASS_STORAGE_NO_FILEX) +#define ux_host_class_storage_media_get _ux_host_class_storage_media_get +#define ux_host_class_storage_media_lock _ux_host_class_storage_media_lock +#define ux_host_class_storage_media_unlock _ux_host_class_storage_media_unlock +#endif + #endif diff --git a/common/usbx_host_classes/inc/ux_host_class_swar.h b/common/usbx_host_classes/inc/ux_host_class_swar.h index 2eecbd2..a5e9fb6 100644 --- a/common/usbx_host_classes/inc/ux_host_class_swar.h +++ b/common/usbx_host_classes/inc/ux_host_class_swar.h @@ -26,7 +26,7 @@ /* COMPONENT DEFINITION RELEASE */ /* */ /* ux_host_class_swar.h PORTABLE C */ -/* 6.0 */ +/* 6.1 */ /* AUTHOR */ /* */ /* Chaoqiong Xiao, Microsoft Corporation */ @@ -41,6 +41,11 @@ /* DATE NAME DESCRIPTION */ /* */ /* 05-19-2020 Chaoqiong Xiao Initial Version 6.0 */ +/* 09-30-2020 Chaoqiong Xiao Modified comment(s), */ +/* used UX prefix to refer to */ +/* TX symbols instead of using */ +/* them directly, */ +/* resulting in version 6.1 */ /* */ /**************************************************************************/ @@ -86,7 +91,7 @@ typedef struct UX_HOST_CLASS_SWAR_STRUCT UX_ENDPOINT *ux_host_class_swar_bulk_out_endpoint; UX_ENDPOINT *ux_host_class_swar_bulk_in_endpoint; UINT ux_host_class_swar_state; - TX_SEMAPHORE ux_host_class_swar_semaphore; + UX_SEMAPHORE ux_host_class_swar_semaphore; struct UX_HOST_CLASS_SWAR_RECEPTION_STRUCT *ux_host_class_swar_reception; 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 7308c87..2d5822b 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.0 */ +/* 6.1 */ /* AUTHOR */ /* */ /* Chaoqiong Xiao, Microsoft Corporation */ @@ -41,6 +41,14 @@ /* DATE NAME DESCRIPTION */ /* */ /* 05-19-2020 Chaoqiong Xiao Initial Version 6.0 */ +/* 09-30-2020 Chaoqiong Xiao Modified comment(s), */ +/* added new definition, field */ +/* and functions for video */ +/* control handling, used UX */ +/* prefix to refer to TX */ +/* symbols instead of using */ +/* them directly, */ +/* resulting in version 6.1 */ /* */ /**************************************************************************/ @@ -243,6 +251,7 @@ extern UCHAR _ux_system_host_class_video_name[]; #define UX_HOST_CLASS_VIDEO_WRONG_TYPE 0x90 #define UX_HOST_CLASS_VIDEO_WRONG_INTERFACE 0x91 #define UX_HOST_CLASS_VIDEO_PARAMETER_ERROR 0x92 +#define UX_HOST_CLASS_VIDEO_DEVICE_NOT_READY 0x93 /* Define Video Class Terminal Control Selectors. */ #define UX_HOST_CLASS_VIDEO_TCS_VC_CONTROL_UNDEFINED 0x00 @@ -481,7 +490,8 @@ typedef struct UX_HOST_CLASS_VIDEO_STRUCT UX_TRANSFER ux_host_class_video_transfer_requests[UX_HOST_CLASS_VIDEO_TRANSFER_REQUEST_COUNT]; ULONG ux_host_class_video_transfer_request_start_index; ULONG ux_host_class_video_transfer_request_end_index; - TX_SEMAPHORE ux_host_class_video_semaphore; + UX_SEMAPHORE ux_host_class_video_semaphore; + UX_SEMAPHORE ux_host_class_video_semaphore_control_request; VOID (*ux_host_class_video_transfer_completion_function)(UX_TRANSFER*); } UX_HOST_CLASS_VIDEO; @@ -497,7 +507,7 @@ typedef struct UX_HOST_CLASS_VIDEO_TRANSFER_REQUEST_STRUCT ULONG ux_host_class_video_transfer_request_requested_length; ULONG ux_host_class_video_transfer_request_actual_length; VOID (*ux_host_class_video_transfer_request_completion_function) (struct UX_HOST_CLASS_VIDEO_TRANSFER_REQUEST_STRUCT *); - TX_SEMAPHORE ux_host_class_video_transfer_request_semaphore; + UX_SEMAPHORE ux_host_class_video_transfer_request_semaphore; VOID *ux_host_class_video_transfer_request_class_instance; UINT ux_host_class_video_transfer_request_completion_code; struct UX_HOST_CLASS_VIDEO_TRANSFER_REQUEST_STRUCT @@ -612,7 +622,15 @@ ULONG _ux_host_class_video_max_payload_get(UX_HOST_CLASS_VIDEO *video); UINT _ux_host_class_video_transfer_buffer_add(UX_HOST_CLASS_VIDEO *video, UCHAR* buffer); UINT _ux_host_class_video_transfer_buffers_add(UX_HOST_CLASS_VIDEO *video, UCHAR** buffers, ULONG num_buffers); VOID _ux_host_class_video_transfer_callback_set(UX_HOST_CLASS_VIDEO *video, VOID (*callback_function)(UX_TRANSFER*)); - +UINT _ux_host_class_video_entities_parse(UX_HOST_CLASS_VIDEO *video, + UINT(*parse_function)(VOID *arg, + UCHAR *packed_interface_descriptor, + UCHAR *packed_entity_descriptor), + VOID* arg); +UINT _ux_host_class_video_control_request(UX_HOST_CLASS_VIDEO *video, + UINT request, UCHAR interface_index, + UINT entity_id, UINT control_selector, + UCHAR *parameter, UINT parameter_size); /* Define Video Class API prototypes. */ @@ -629,6 +647,8 @@ VOID _ux_host_class_video_transfer_callback_set(UX_HOST_CLASS_VIDEO *video, V #define ux_host_class_video_transfer_buffer_add _ux_host_class_video_transfer_buffer_add #define ux_host_class_video_transfer_buffers_add _ux_host_class_video_transfer_buffers_add #define ux_host_class_video_transfer_callback_set _ux_host_class_video_transfer_callback_set +#define ux_host_class_video_entities_parse _ux_host_class_video_entities_parse +#define ux_host_class_video_control_request _ux_host_class_video_control_request #endif 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 d5b2778..d39e31e 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 @@ -36,7 +36,7 @@ UX_HOST_CLASS_ASIX_NX_ETHERNET_POOL_ALLOCSIZE_ASSERT /* FUNCTION RELEASE */ /* */ /* _ux_host_class_asix_activate PORTABLE C */ -/* 6.0 */ +/* 6.1 */ /* AUTHOR */ /* */ /* Chaoqiong Xiao, Microsoft Corporation */ @@ -79,6 +79,11 @@ UX_HOST_CLASS_ASIX_NX_ETHERNET_POOL_ALLOCSIZE_ASSERT /* DATE NAME DESCRIPTION */ /* */ /* 05-19-2020 Chaoqiong Xiao Initial Version 6.0 */ +/* 09-30-2020 Chaoqiong Xiao Modified comment(s), */ +/* used UX prefix to refer to */ +/* TX symbols instead of using */ +/* them directly, */ +/* resulting in version 6.1 */ /* */ /**************************************************************************/ UINT _ux_host_class_asix_activate(UX_HOST_CLASS_COMMAND *command) @@ -166,7 +171,7 @@ UX_TRANSFER *transfer_request; UX_THREAD_STACK_SIZE, UX_THREAD_PRIORITY_CLASS, UX_THREAD_PRIORITY_CLASS, - TX_NO_TIME_SLICE, TX_AUTO_START); + TX_NO_TIME_SLICE, UX_AUTO_START); /* Check the completion status. */ if (status != UX_SUCCESS) 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 7e6f2c6..8e32a37 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.0 */ +/* 6.1 */ /* AUTHOR */ /* */ /* Chaoqiong Xiao, Microsoft Corporation */ @@ -70,6 +70,10 @@ /* DATE NAME DESCRIPTION */ /* */ /* 05-19-2020 Chaoqiong Xiao Initial Version 6.0 */ +/* 09-30-2020 Chaoqiong Xiao Modified comment(s), */ +/* optimized based on compile */ +/* definitions, */ +/* resulting in version 6.1 */ /* */ /**************************************************************************/ UINT _ux_host_class_asix_configure(UX_HOST_CLASS_ASIX *asix) @@ -77,7 +81,9 @@ UINT _ux_host_class_asix_configure(UX_HOST_CLASS_ASIX *asix) UINT status; UX_CONFIGURATION *configuration; +#if UX_MAX_DEVICES > 1 UX_DEVICE *parent_device; +#endif /* If the device has been configured already, we don't need to do it @@ -99,7 +105,8 @@ UX_DEVICE *parent_device; return(UX_CONFIGURATION_HANDLE_UNKNOWN); } - + +#if UX_MAX_DEVICES > 1 /* Check the asix power source and check the parent power source for incompatible connections. */ if (asix -> ux_host_class_asix_device -> ux_device_power_source == UX_DEVICE_BUS_POWERED) @@ -122,7 +129,8 @@ UX_DEVICE *parent_device; return(UX_CONNECTION_INCOMPATIBLE); } } - +#endif + /* We have the valid configuration. Ask the USBX stack to set this configuration. */ status = _ux_host_stack_device_configuration_select(configuration); if (status != UX_SUCCESS) diff --git a/common/usbx_host_classes/src/ux_host_class_asix_deactivate.c b/common/usbx_host_classes/src/ux_host_class_asix_deactivate.c index 349e785..de08299 100644 --- a/common/usbx_host_classes/src/ux_host_class_asix_deactivate.c +++ b/common/usbx_host_classes/src/ux_host_class_asix_deactivate.c @@ -35,7 +35,7 @@ /* FUNCTION RELEASE */ /* */ /* _ux_host_class_asix_deactivate PORTABLE C */ -/* 6.0 */ +/* 6.1 */ /* AUTHOR */ /* */ /* Chaoqiong Xiao, Microsoft Corporation */ @@ -75,6 +75,8 @@ /* 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 */ /* */ /**************************************************************************/ UINT _ux_host_class_asix_deactivate(UX_HOST_CLASS_COMMAND *command) diff --git a/common/usbx_host_classes/src/ux_host_class_asix_endpoints_get.c b/common/usbx_host_classes/src/ux_host_class_asix_endpoints_get.c index aef3b24..959c007 100644 --- a/common/usbx_host_classes/src/ux_host_class_asix_endpoints_get.c +++ b/common/usbx_host_classes/src/ux_host_class_asix_endpoints_get.c @@ -35,7 +35,7 @@ /* FUNCTION RELEASE */ /* */ /* _ux_host_class_asix_endpoints_get PORTABLE C */ -/* 6.0 */ +/* 6.1 */ /* AUTHOR */ /* */ /* Chaoqiong Xiao, Microsoft Corporation */ @@ -69,6 +69,8 @@ /* 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 */ /* */ /**************************************************************************/ UINT _ux_host_class_asix_endpoints_get(UX_HOST_CLASS_ASIX *asix) diff --git a/common/usbx_host_classes/src/ux_host_class_asix_entry.c b/common/usbx_host_classes/src/ux_host_class_asix_entry.c index aeed0ca..49d288c 100644 --- a/common/usbx_host_classes/src/ux_host_class_asix_entry.c +++ b/common/usbx_host_classes/src/ux_host_class_asix_entry.c @@ -35,7 +35,7 @@ /* FUNCTION RELEASE */ /* */ /* _ux_host_class_asix_entry PORTABLE C */ -/* 6.0 */ +/* 6.1 */ /* AUTHOR */ /* */ /* Chaoqiong Xiao, Microsoft Corporation */ @@ -69,6 +69,8 @@ /* 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 */ /* */ /**************************************************************************/ UINT _ux_host_class_asix_entry(UX_HOST_CLASS_COMMAND *command) diff --git a/common/usbx_host_classes/src/ux_host_class_asix_interrupt_notification.c b/common/usbx_host_classes/src/ux_host_class_asix_interrupt_notification.c index 706c5dc..077552c 100644 --- a/common/usbx_host_classes/src/ux_host_class_asix_interrupt_notification.c +++ b/common/usbx_host_classes/src/ux_host_class_asix_interrupt_notification.c @@ -35,7 +35,7 @@ /* FUNCTION RELEASE */ /* */ /* _ux_host_class_asix_interrupt_notification PORTABLE C */ -/* 6.0 */ +/* 6.1 */ /* AUTHOR */ /* */ /* Chaoqiong Xiao, Microsoft Corporation */ @@ -67,6 +67,8 @@ /* 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 */ /* */ /**************************************************************************/ VOID _ux_host_class_asix_interrupt_notification(UX_TRANSFER *transfer_request) diff --git a/common/usbx_host_classes/src/ux_host_class_asix_read.c b/common/usbx_host_classes/src/ux_host_class_asix_read.c index 643c625..68bea04 100644 --- a/common/usbx_host_classes/src/ux_host_class_asix_read.c +++ b/common/usbx_host_classes/src/ux_host_class_asix_read.c @@ -35,7 +35,7 @@ /* FUNCTION RELEASE */ /* */ /* _ux_host_class_asix_read PORTABLE C */ -/* 6.0 */ +/* 6.1 */ /* AUTHOR */ /* */ /* Chaoqiong Xiao, Microsoft Corporation */ @@ -72,6 +72,9 @@ /* DATE NAME DESCRIPTION */ /* */ /* 05-19-2020 Chaoqiong Xiao Initial Version 6.0 */ +/* 09-30-2020 Chaoqiong Xiao Modified comment(s), */ +/* prefixed UX to MS_TO_TICK, */ +/* resulting in version 6.1 */ /* */ /**************************************************************************/ UINT _ux_host_class_asix_read (UX_HOST_CLASS_ASIX *asix, UCHAR *data_pointer, @@ -127,7 +130,7 @@ ULONG transfer_request_length; { /* Wait for the completion of the transfer_request. */ - status = _ux_utility_semaphore_get(&transfer_request -> ux_transfer_request_semaphore, MS_TO_TICK(UX_HOST_CLASS_ASIX_CLASS_TRANSFER_TIMEOUT)); + status = _ux_utility_semaphore_get(&transfer_request -> ux_transfer_request_semaphore, UX_MS_TO_TICK(UX_HOST_CLASS_ASIX_CLASS_TRANSFER_TIMEOUT)); /* If the semaphore did not succeed we probably have a time out. */ if (status != UX_SUCCESS || transfer_request -> ux_transfer_request_completion_code != UX_SUCCESS) diff --git a/common/usbx_host_classes/src/ux_host_class_asix_reception_callback.c b/common/usbx_host_classes/src/ux_host_class_asix_reception_callback.c index 87d2fa4..7ae6664 100644 --- a/common/usbx_host_classes/src/ux_host_class_asix_reception_callback.c +++ b/common/usbx_host_classes/src/ux_host_class_asix_reception_callback.c @@ -35,7 +35,7 @@ /* FUNCTION RELEASE */ /* */ /* _ux_host_class_asix_reception_callback PORTABLE C */ -/* 6.0 */ +/* 6.1 */ /* AUTHOR */ /* */ /* Chaoqiong Xiao, Microsoft Corporation */ @@ -71,6 +71,8 @@ /* 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 */ /* */ /**************************************************************************/ VOID _ux_host_class_asix_reception_callback (UX_TRANSFER *transfer_request) diff --git a/common/usbx_host_classes/src/ux_host_class_asix_setup.c b/common/usbx_host_classes/src/ux_host_class_asix_setup.c index d4c8770..42cd764 100644 --- a/common/usbx_host_classes/src/ux_host_class_asix_setup.c +++ b/common/usbx_host_classes/src/ux_host_class_asix_setup.c @@ -35,7 +35,7 @@ /* FUNCTION RELEASE */ /* */ /* _ux_host_class_asix_setup PORTABLE C */ -/* 6.0 */ +/* 6.1 */ /* AUTHOR */ /* */ /* Chaoqiong Xiao, Microsoft Corporation */ @@ -67,6 +67,10 @@ /* DATE NAME DESCRIPTION */ /* */ /* 05-19-2020 Chaoqiong Xiao Initial Version 6.0 */ +/* 09-30-2020 Chaoqiong Xiao Modified comment(s), */ +/* verified memset and memcpy */ +/* cases, */ +/* resulting in version 6.1 */ /* */ /**************************************************************************/ UINT _ux_host_class_asix_setup(UX_HOST_CLASS_ASIX *asix) @@ -283,7 +287,7 @@ UINT status; /* Copy the node id into the Asix instance. */ - _ux_utility_memory_copy(asix -> ux_host_class_asix_node_id, setup_buffer, UX_HOST_CLASS_ASIX_NODE_ID_LENGTH); + _ux_utility_memory_copy(asix -> ux_host_class_asix_node_id, setup_buffer, UX_HOST_CLASS_ASIX_NODE_ID_LENGTH); /* Use case of memcpy is verified. */ /* Request ownership of Serial Management Interface. */ transfer_request -> ux_transfer_request_data_pointer = UX_NULL; diff --git a/common/usbx_host_classes/src/ux_host_class_asix_thread.c b/common/usbx_host_classes/src/ux_host_class_asix_thread.c index 02615fd..791458f 100644 --- a/common/usbx_host_classes/src/ux_host_class_asix_thread.c +++ b/common/usbx_host_classes/src/ux_host_class_asix_thread.c @@ -34,7 +34,7 @@ /* FUNCTION RELEASE */ /* */ /* _ux_host_class_asix_thread PORTABLE C */ -/* 6.0 */ +/* 6.1 */ /* AUTHOR */ /* */ /* Chaoqiong Xiao, Microsoft Corporation */ @@ -74,6 +74,10 @@ /* DATE NAME DESCRIPTION */ /* */ /* 05-19-2020 Chaoqiong Xiao Initial Version 6.0 */ +/* 09-30-2020 Chaoqiong Xiao Modified comment(s), */ +/* verified memset and memcpy */ +/* cases, */ +/* resulting in version 6.1 */ /* */ /**************************************************************************/ VOID _ux_host_class_asix_thread(ULONG parameter) @@ -280,7 +284,7 @@ ULONG physical_address_lsw; transfer_request -> ux_transfer_request_index = 0; /* Fill in the multicast filter. */ - _ux_utility_memory_set(setup_buffer, 0, 8); + _ux_utility_memory_set(setup_buffer, 0, 8); /* Use case of memset is verified. */ *(setup_buffer +1) = 0x40; /* Send request to HCD layer. */ 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 c1f6ce6..f21e96a 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.0 */ +/* 6.1 */ /* AUTHOR */ /* */ /* Chaoqiong Xiao, Microsoft Corporation */ @@ -69,6 +69,8 @@ /* 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 */ /* */ /**************************************************************************/ 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 dfe33c6..d42ff5d 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.0 */ +/* 6.1 */ /* AUTHOR */ /* */ /* Chaoqiong Xiao, Microsoft Corporation */ @@ -69,6 +69,8 @@ /* 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 */ /* */ /**************************************************************************/ 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 c6bafac..33e553b 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.0 */ +/* 6.1 */ /* AUTHOR */ /* */ /* Chaoqiong Xiao, Microsoft Corporation */ @@ -75,6 +75,8 @@ /* 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 */ /* */ /**************************************************************************/ UINT _ux_host_class_audio_activate(UX_HOST_CLASS_COMMAND *command) diff --git a/common/usbx_host_classes/src/ux_host_class_audio_alternate_setting_locate.c b/common/usbx_host_classes/src/ux_host_class_audio_alternate_setting_locate.c index 3712513..f8dde68 100644 --- a/common/usbx_host_classes/src/ux_host_class_audio_alternate_setting_locate.c +++ b/common/usbx_host_classes/src/ux_host_class_audio_alternate_setting_locate.c @@ -35,7 +35,7 @@ /* FUNCTION RELEASE */ /* */ /* _ux_host_class_audio_alternate_setting_locate PORTABLE C */ -/* 6.0 */ +/* 6.1 */ /* AUTHOR */ /* */ /* Chaoqiong Xiao, Microsoft Corporation */ @@ -69,6 +69,8 @@ /* 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 */ /* */ /**************************************************************************/ UINT _ux_host_class_audio_alternate_setting_locate(UX_HOST_CLASS_AUDIO *audio, UX_HOST_CLASS_AUDIO_SAMPLING *audio_sampling, diff --git a/common/usbx_host_classes/src/ux_host_class_audio_configure.c b/common/usbx_host_classes/src/ux_host_class_audio_configure.c index c78b876..2531061 100644 --- a/common/usbx_host_classes/src/ux_host_class_audio_configure.c +++ b/common/usbx_host_classes/src/ux_host_class_audio_configure.c @@ -35,7 +35,7 @@ /* FUNCTION RELEASE */ /* */ /* _ux_host_class_audio_configure PORTABLE C */ -/* 6.0 */ +/* 6.1 */ /* AUTHOR */ /* */ /* Chaoqiong Xiao, Microsoft Corporation */ @@ -69,6 +69,10 @@ /* DATE NAME DESCRIPTION */ /* */ /* 05-19-2020 Chaoqiong Xiao Initial Version 6.0 */ +/* 09-30-2020 Chaoqiong Xiao Modified comment(s), */ +/* optimized based on compile */ +/* definitions, */ +/* resulting in version 6.1 */ /* */ /**************************************************************************/ UINT _ux_host_class_audio_configure(UX_HOST_CLASS_AUDIO *audio) @@ -77,8 +81,10 @@ UINT _ux_host_class_audio_configure(UX_HOST_CLASS_AUDIO *audio) UINT status; UX_CONFIGURATION *configuration; UX_INTERFACE *interface; -UX_DEVICE *parent_device; ULONG interface_number; +#if UX_MAX_DEVICES > 1 +UX_DEVICE *parent_device; +#endif /* If the device has been configured already, we don't need to do it @@ -100,7 +106,9 @@ ULONG interface_number; return(UX_CONFIGURATION_HANDLE_UNKNOWN); - } + } + +#if UX_MAX_DEVICES > 1 /* Check the audio power source and check the parent power source for incompatible connections. */ if (audio -> ux_host_class_audio_device -> ux_device_power_source == UX_DEVICE_BUS_POWERED) @@ -123,7 +131,8 @@ ULONG interface_number; return(UX_CONNECTION_INCOMPATIBLE); } } - +#endif + /* We have the valid configuration. Ask the USBX stack to set this configuration */ status = _ux_host_stack_device_configuration_select(configuration); 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 f8f625a..926555d 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 @@ -35,7 +35,7 @@ /* FUNCTION RELEASE */ /* */ /* _ux_host_class_audio_control_get PORTABLE C */ -/* 6.0 */ +/* 6.1 */ /* AUTHOR */ /* */ /* Chaoqiong Xiao, Microsoft Corporation */ @@ -74,6 +74,8 @@ /* 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 */ /* */ /**************************************************************************/ UINT _ux_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_value_get.c b/common/usbx_host_classes/src/ux_host_class_audio_control_value_get.c index 1d402bc..d77e6df 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 @@ -35,7 +35,7 @@ /* FUNCTION RELEASE */ /* */ /* _ux_host_class_audio_control_value_get PORTABLE C */ -/* 6.0 */ +/* 6.1 */ /* AUTHOR */ /* */ /* Chaoqiong Xiao, Microsoft Corporation */ @@ -73,6 +73,8 @@ /* 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 */ /* */ /**************************************************************************/ UINT _ux_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 65f0b4e..e1d1017 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 @@ -35,7 +35,7 @@ /* FUNCTION RELEASE */ /* */ /* _ux_host_class_audio_control_value_set PORTABLE C */ -/* 6.0 */ +/* 6.1 */ /* AUTHOR */ /* */ /* Chaoqiong Xiao, Microsoft Corporation */ @@ -74,6 +74,8 @@ /* 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 */ /* */ /**************************************************************************/ UINT _ux_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 0d7f192..d81cc00 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.0 */ +/* 6.1 */ /* AUTHOR */ /* */ /* Chaoqiong Xiao, Microsoft Corporation */ @@ -71,6 +71,8 @@ /* 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 */ /* */ /**************************************************************************/ UINT _ux_host_class_audio_deactivate(UX_HOST_CLASS_COMMAND *command) diff --git a/common/usbx_host_classes/src/ux_host_class_audio_descriptor_get.c b/common/usbx_host_classes/src/ux_host_class_audio_descriptor_get.c index 41d7332..caf8d46 100644 --- a/common/usbx_host_classes/src/ux_host_class_audio_descriptor_get.c +++ b/common/usbx_host_classes/src/ux_host_class_audio_descriptor_get.c @@ -35,7 +35,7 @@ /* FUNCTION RELEASE */ /* */ /* _ux_host_class_audio_descriptor_get PORTABLE C */ -/* 6.0 */ +/* 6.1 */ /* AUTHOR */ /* */ /* Chaoqiong Xiao, Microsoft Corporation */ @@ -70,6 +70,8 @@ /* 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 */ /* */ /**************************************************************************/ UINT _ux_host_class_audio_descriptor_get(UX_HOST_CLASS_AUDIO *audio) diff --git a/common/usbx_host_classes/src/ux_host_class_audio_device_controls_list_get.c b/common/usbx_host_classes/src/ux_host_class_audio_device_controls_list_get.c index efaf0db..dd85165 100644 --- a/common/usbx_host_classes/src/ux_host_class_audio_device_controls_list_get.c +++ b/common/usbx_host_classes/src/ux_host_class_audio_device_controls_list_get.c @@ -35,7 +35,7 @@ /* FUNCTION RELEASE */ /* */ /* _ux_host_class_audio_device_controls_list_get PORTABLE C */ -/* 6.0 */ +/* 6.1 */ /* AUTHOR */ /* */ /* Chaoqiong Xiao, Microsoft Corporation */ @@ -67,6 +67,8 @@ /* 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 */ /* */ /**************************************************************************/ UINT _ux_host_class_audio_device_controls_list_get(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 36e1365..7ac539f 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.0 */ +/* 6.1 */ /* AUTHOR */ /* */ /* Chaoqiong Xiao, Microsoft Corporation */ @@ -65,6 +65,8 @@ /* 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 */ /* */ /**************************************************************************/ UINT _ux_host_class_audio_device_type_get(UX_HOST_CLASS_AUDIO *audio) diff --git a/common/usbx_host_classes/src/ux_host_class_audio_endpoints_get.c b/common/usbx_host_classes/src/ux_host_class_audio_endpoints_get.c index e566d59..f1cee1c 100644 --- a/common/usbx_host_classes/src/ux_host_class_audio_endpoints_get.c +++ b/common/usbx_host_classes/src/ux_host_class_audio_endpoints_get.c @@ -35,7 +35,7 @@ /* FUNCTION RELEASE */ /* */ /* _ux_host_class_audio_endpoints_get PORTABLE C */ -/* 6.0 */ +/* 6.1 */ /* AUTHOR */ /* */ /* Chaoqiong Xiao, Microsoft Corporation */ @@ -65,6 +65,8 @@ /* 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 */ /* */ /**************************************************************************/ UINT _ux_host_class_audio_endpoints_get(UX_HOST_CLASS_AUDIO *audio) diff --git a/common/usbx_host_classes/src/ux_host_class_audio_entry.c b/common/usbx_host_classes/src/ux_host_class_audio_entry.c index 528b74d..fca6b3a 100644 --- a/common/usbx_host_classes/src/ux_host_class_audio_entry.c +++ b/common/usbx_host_classes/src/ux_host_class_audio_entry.c @@ -35,7 +35,7 @@ /* FUNCTION RELEASE */ /* */ /* _ux_host_class_audio_entry PORTABLE C */ -/* 6.0 */ +/* 6.1 */ /* AUTHOR */ /* */ /* Chaoqiong Xiao, Microsoft Corporation */ @@ -69,6 +69,8 @@ /* 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 */ /* */ /**************************************************************************/ UINT _ux_host_class_audio_entry(UX_HOST_CLASS_COMMAND *command) 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 e145970..0e11056 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 @@ -35,7 +35,7 @@ /* FUNCTION RELEASE */ /* */ /* _ux_host_class_audio_read PORTABLE C */ -/* 6.0 */ +/* 6.1 */ /* AUTHOR */ /* */ /* Chaoqiong Xiao, Microsoft Corporation */ @@ -70,6 +70,8 @@ /* 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 */ /* */ /**************************************************************************/ UINT _ux_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_streaming_sampling_get.c b/common/usbx_host_classes/src/ux_host_class_audio_streaming_sampling_get.c index 2a9b040..411e0d1 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 @@ -35,7 +35,7 @@ /* FUNCTION RELEASE */ /* */ /* _ux_host_class_audio_streaming_sampling_get PORTABLE C */ -/* 6.0 */ +/* 6.1 */ /* AUTHOR */ /* */ /* Chaoqiong Xiao, Microsoft Corporation */ @@ -71,6 +71,8 @@ /* 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 */ /* */ /**************************************************************************/ UINT _ux_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 a69a932..447ffab 100644 --- a/common/usbx_host_classes/src/ux_host_class_audio_streaming_sampling_set.c +++ b/common/usbx_host_classes/src/ux_host_class_audio_streaming_sampling_set.c @@ -35,7 +35,7 @@ /* FUNCTION RELEASE */ /* */ /* _ux_host_class_audio_streaming_sampling_set PORTABLE C */ -/* 6.0 */ +/* 6.1 */ /* AUTHOR */ /* */ /* Chaoqiong Xiao, Microsoft Corporation */ @@ -75,6 +75,8 @@ /* 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 */ /* */ /**************************************************************************/ UINT _ux_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_streaming_terminal_get.c b/common/usbx_host_classes/src/ux_host_class_audio_streaming_terminal_get.c index 3146598..f063e93 100644 --- a/common/usbx_host_classes/src/ux_host_class_audio_streaming_terminal_get.c +++ b/common/usbx_host_classes/src/ux_host_class_audio_streaming_terminal_get.c @@ -35,7 +35,7 @@ /* FUNCTION RELEASE */ /* */ /* _ux_host_class_audio_streaming_terminal_get PORTABLE C */ -/* 6.0 */ +/* 6.1 */ /* AUTHOR */ /* */ /* Chaoqiong Xiao, Microsoft Corporation */ @@ -67,6 +67,8 @@ /* 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 */ /* */ /**************************************************************************/ UINT _ux_host_class_audio_streaming_terminal_get(UX_HOST_CLASS_AUDIO *audio) diff --git a/common/usbx_host_classes/src/ux_host_class_audio_transfer_request.c b/common/usbx_host_classes/src/ux_host_class_audio_transfer_request.c index 5c441e2..0a76bd4 100644 --- a/common/usbx_host_classes/src/ux_host_class_audio_transfer_request.c +++ b/common/usbx_host_classes/src/ux_host_class_audio_transfer_request.c @@ -35,7 +35,7 @@ /* FUNCTION RELEASE */ /* */ /* _ux_host_class_audio_transfer_request PORTABLE C */ -/* 6.0 */ +/* 6.1 */ /* AUTHOR */ /* */ /* Chaoqiong Xiao, Microsoft Corporation */ @@ -67,6 +67,8 @@ /* 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 */ /* */ /**************************************************************************/ UINT _ux_host_class_audio_transfer_request(UX_HOST_CLASS_AUDIO *audio, diff --git a/common/usbx_host_classes/src/ux_host_class_audio_transfer_request_completed.c b/common/usbx_host_classes/src/ux_host_class_audio_transfer_request_completed.c index b71bf7a..1388226 100644 --- a/common/usbx_host_classes/src/ux_host_class_audio_transfer_request_completed.c +++ b/common/usbx_host_classes/src/ux_host_class_audio_transfer_request_completed.c @@ -35,7 +35,7 @@ /* FUNCTION RELEASE */ /* */ /* _ux_host_class_audio_transfer_request_completed PORTABLE C */ -/* 6.0 */ +/* 6.1 */ /* AUTHOR */ /* */ /* Chaoqiong Xiao, Microsoft Corporation */ @@ -67,6 +67,8 @@ /* 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 */ /* */ /**************************************************************************/ VOID _ux_host_class_audio_transfer_request_completed(UX_TRANSFER *transfer_request) 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 ef197c5..481a741 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 @@ -35,7 +35,7 @@ /* FUNCTION RELEASE */ /* */ /* _ux_host_class_audio_write PORTABLE C */ -/* 6.0 */ +/* 6.1 */ /* AUTHOR */ /* */ /* Chaoqiong Xiao, Microsoft Corporation */ @@ -70,6 +70,8 @@ /* 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 */ /* */ /**************************************************************************/ UINT _ux_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 add46c5..26bd13e 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.0 */ +/* 6.1 */ /* AUTHOR */ /* */ /* Chaoqiong Xiao, Microsoft Corporation */ @@ -75,6 +75,8 @@ /* 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 */ /* */ /**************************************************************************/ UINT _ux_host_class_cdc_acm_activate(UX_HOST_CLASS_COMMAND *command) diff --git a/common/usbx_host_classes/src/ux_host_class_cdc_acm_capabilities_get.c b/common/usbx_host_classes/src/ux_host_class_cdc_acm_capabilities_get.c index 0b614a1..2a1c863 100644 --- a/common/usbx_host_classes/src/ux_host_class_cdc_acm_capabilities_get.c +++ b/common/usbx_host_classes/src/ux_host_class_cdc_acm_capabilities_get.c @@ -35,7 +35,7 @@ /* FUNCTION RELEASE */ /* */ /* _ux_host_class_cdc_acm_capabilities_get PORTABLE C */ -/* 6.0 */ +/* 6.1 */ /* AUTHOR */ /* */ /* Chaoqiong Xiao, Microsoft Corporation */ @@ -70,6 +70,8 @@ /* 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 */ /* */ /**************************************************************************/ UINT _ux_host_class_cdc_acm_capabilities_get(UX_HOST_CLASS_CDC_ACM *cdc_acm) 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 b53be8f..5a5ddb6 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.0 */ +/* 6.1 */ /* AUTHOR */ /* */ /* Chaoqiong Xiao, Microsoft Corporation */ @@ -77,6 +77,8 @@ /* 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 */ /* */ /**************************************************************************/ UINT _ux_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_configure.c b/common/usbx_host_classes/src/ux_host_class_cdc_acm_configure.c index 81191a6..d45151e 100644 --- a/common/usbx_host_classes/src/ux_host_class_cdc_acm_configure.c +++ b/common/usbx_host_classes/src/ux_host_class_cdc_acm_configure.c @@ -35,7 +35,7 @@ /* FUNCTION RELEASE */ /* */ /* _ux_host_class_cdc_acm_configure PORTABLE C */ -/* 6.0 */ +/* 6.1 */ /* AUTHOR */ /* */ /* Chaoqiong Xiao, Microsoft Corporation */ @@ -70,6 +70,10 @@ /* DATE NAME DESCRIPTION */ /* */ /* 05-19-2020 Chaoqiong Xiao Initial Version 6.0 */ +/* 09-30-2020 Chaoqiong Xiao Modified comment(s), */ +/* optimized based on compile */ +/* definitions, */ +/* resulting in version 6.1 */ /* */ /**************************************************************************/ UINT _ux_host_class_cdc_acm_configure(UX_HOST_CLASS_CDC_ACM *cdc_acm) @@ -77,7 +81,9 @@ UINT _ux_host_class_cdc_acm_configure(UX_HOST_CLASS_CDC_ACM *cdc_acm) UINT status; UX_CONFIGURATION *configuration; +#if UX_MAX_DEVICES > 1 UX_DEVICE *parent_device; +#endif /* If the device has been configured already, we don't need to do it @@ -99,7 +105,8 @@ UX_DEVICE *parent_device; return(UX_CONFIGURATION_HANDLE_UNKNOWN); } - + +#if UX_MAX_DEVICES > 1 /* Check the cdc_acm power source and check the parent power source for incompatible connections. */ if (cdc_acm -> ux_host_class_cdc_acm_device -> ux_device_power_source == UX_DEVICE_BUS_POWERED) @@ -122,7 +129,8 @@ UX_DEVICE *parent_device; return(UX_CONNECTION_INCOMPATIBLE); } } - +#endif + /* We have the valid configuration. Ask the USBX stack to set this configuration. */ status = _ux_host_stack_device_configuration_select(configuration); if (status != UX_SUCCESS) 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 4ea0de0..97d5917 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 @@ -35,7 +35,7 @@ /* FUNCTION RELEASE */ /* */ /* _ux_host_class_cdc_acm_deactivate PORTABLE C */ -/* 6.0 */ +/* 6.1 */ /* AUTHOR */ /* */ /* Chaoqiong Xiao, Microsoft Corporation */ @@ -73,6 +73,8 @@ /* 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 */ /* */ /**************************************************************************/ UINT _ux_host_class_cdc_acm_deactivate(UX_HOST_CLASS_COMMAND *command) 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 69fb96d..720ada1 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.0 */ +/* 6.1 */ /* AUTHOR */ /* */ /* Chaoqiong Xiao, Microsoft Corporation */ @@ -67,6 +67,8 @@ /* 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 */ /* */ /**************************************************************************/ UINT _ux_host_class_cdc_acm_endpoints_get(UX_HOST_CLASS_CDC_ACM *cdc_acm) 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 b74f88f..8a39be3 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 @@ -35,7 +35,7 @@ /* FUNCTION RELEASE */ /* */ /* _ux_host_class_cdc_acm_entry PORTABLE C */ -/* 6.0 */ +/* 6.1 */ /* AUTHOR */ /* */ /* Chaoqiong Xiao, Microsoft Corporation */ @@ -73,6 +73,8 @@ /* 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 */ /* */ /**************************************************************************/ UINT _ux_host_class_cdc_acm_entry(UX_HOST_CLASS_COMMAND *command) 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 ea54824..c05d2d6 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.0 */ +/* 6.1 */ /* AUTHOR */ /* */ /* Chaoqiong Xiao, Microsoft Corporation */ @@ -74,6 +74,8 @@ /* 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 */ /* */ /**************************************************************************/ UINT _ux_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 5f62be2..5fc8def 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 @@ -35,7 +35,7 @@ /* FUNCTION RELEASE */ /* */ /* _ux_host_class_cdc_acm_read PORTABLE C */ -/* 6.0 */ +/* 6.1 */ /* AUTHOR */ /* */ /* Chaoqiong Xiao, Microsoft Corporation */ @@ -72,6 +72,8 @@ /* 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 */ /* */ /**************************************************************************/ UINT _ux_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_callback.c b/common/usbx_host_classes/src/ux_host_class_cdc_acm_reception_callback.c index dbf6477..172af05 100644 --- a/common/usbx_host_classes/src/ux_host_class_cdc_acm_reception_callback.c +++ b/common/usbx_host_classes/src/ux_host_class_cdc_acm_reception_callback.c @@ -35,7 +35,7 @@ /* FUNCTION RELEASE */ /* */ /* _ux_host_class_cdc_acm_reception_callback PORTABLE C */ -/* 6.0 */ +/* 6.1 */ /* AUTHOR */ /* */ /* Chaoqiong Xiao, Microsoft Corporation */ @@ -67,6 +67,8 @@ /* 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 */ /* */ /**************************************************************************/ VOID _ux_host_class_cdc_acm_reception_callback (UX_TRANSFER *transfer_request) 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 c9ed01b..a74276f 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 @@ -35,7 +35,7 @@ /* FUNCTION RELEASE */ /* */ /* _ux_host_class_cdc_acm_reception_start PORTABLE C */ -/* 6.0 */ +/* 6.1 */ /* AUTHOR */ /* */ /* Chaoqiong Xiao, Microsoft Corporation */ @@ -70,6 +70,8 @@ /* 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 */ /* */ /**************************************************************************/ UINT _ux_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 73af01a..27a2b2c 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 @@ -35,7 +35,7 @@ /* FUNCTION RELEASE */ /* */ /* _ux_host_class_cdc_acm_reception_stop PORTABLE C */ -/* 6.0 */ +/* 6.1 */ /* AUTHOR */ /* */ /* Chaoqiong Xiao, Microsoft Corporation */ @@ -69,6 +69,8 @@ /* 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 */ /* */ /**************************************************************************/ UINT _ux_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_transfer_request_completed.c b/common/usbx_host_classes/src/ux_host_class_cdc_acm_transfer_request_completed.c index 3c54429..d3b207c 100644 --- a/common/usbx_host_classes/src/ux_host_class_cdc_acm_transfer_request_completed.c +++ b/common/usbx_host_classes/src/ux_host_class_cdc_acm_transfer_request_completed.c @@ -35,7 +35,7 @@ /* FUNCTION RELEASE */ /* */ /* _ux_host_class_cdc_acm_transfer_request_completed PORTABLE C */ -/* 6.0 */ +/* 6.1 */ /* AUTHOR */ /* */ /* Chaoqiong Xiao, Microsoft Corporation */ @@ -68,6 +68,8 @@ /* 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 */ /* */ /**************************************************************************/ VOID _ux_host_class_cdc_acm_transfer_request_completed(UX_TRANSFER *transfer_request) 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 ba2e7fa..2c6e34e 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 @@ -35,7 +35,7 @@ /* FUNCTION RELEASE */ /* */ /* _ux_host_class_cdc_acm_write PORTABLE C */ -/* 6.0 */ +/* 6.1 */ /* AUTHOR */ /* */ /* Chaoqiong Xiao, Microsoft Corporation */ @@ -72,6 +72,8 @@ /* 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 */ /* */ /**************************************************************************/ UINT _ux_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_ecm_activate.c b/common/usbx_host_classes/src/ux_host_class_cdc_ecm_activate.c index e448107..91b7f5b 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 @@ -36,7 +36,7 @@ UX_HOST_CLASS_CDC_ECM_NX_ETHERNET_POOL_ALLOCSIZE_ASSERT /* FUNCTION RELEASE */ /* */ /* _ux_host_class_cdc_ecm_activate PORTABLE C */ -/* 6.0 */ +/* 6.1 */ /* AUTHOR */ /* */ /* Chaoqiong Xiao, Microsoft Corporation */ @@ -80,6 +80,11 @@ UX_HOST_CLASS_CDC_ECM_NX_ETHERNET_POOL_ALLOCSIZE_ASSERT /* DATE NAME DESCRIPTION */ /* */ /* 05-19-2020 Chaoqiong Xiao Initial Version 6.0 */ +/* 09-30-2020 Chaoqiong Xiao Modified comment(s), */ +/* used UX prefix to refer to */ +/* TX symbols instead of using */ +/* them directly, */ +/* resulting in version 6.1 */ /* */ /**************************************************************************/ UINT _ux_host_class_cdc_ecm_activate(UX_HOST_CLASS_COMMAND *command) @@ -235,7 +240,7 @@ UX_INTERFACE *cur_interface; UX_THREAD_STACK_SIZE, UX_THREAD_PRIORITY_CLASS, UX_THREAD_PRIORITY_CLASS, - TX_NO_TIME_SLICE, TX_DONT_START); + UX_NO_TIME_SLICE, UX_DONT_START); if (status == UX_SUCCESS) { diff --git a/common/usbx_host_classes/src/ux_host_class_cdc_ecm_deactivate.c b/common/usbx_host_classes/src/ux_host_class_cdc_ecm_deactivate.c index 6b991b9..a2d1aae 100644 --- a/common/usbx_host_classes/src/ux_host_class_cdc_ecm_deactivate.c +++ b/common/usbx_host_classes/src/ux_host_class_cdc_ecm_deactivate.c @@ -35,7 +35,7 @@ /* FUNCTION RELEASE */ /* */ /* _ux_host_class_cdc_ecm_deactivate PORTABLE C */ -/* 6.0 */ +/* 6.1 */ /* AUTHOR */ /* */ /* Chaoqiong Xiao, Microsoft Corporation */ @@ -72,12 +72,17 @@ /* DATE NAME DESCRIPTION */ /* */ /* 05-19-2020 Chaoqiong Xiao Initial Version 6.0 */ +/* 09-30-2020 Chaoqiong Xiao Modified comment(s), */ +/* used UX prefix to refer to */ +/* TX symbols instead of using */ +/* them directly, */ +/* resulting in version 6.1 */ /* */ /**************************************************************************/ UINT _ux_host_class_cdc_ecm_deactivate(UX_HOST_CLASS_COMMAND *command) { -TX_INTERRUPT_SAVE_AREA +UX_INTERRUPT_SAVE_AREA UX_HOST_CLASS_CDC_ECM *cdc_ecm; UX_TRANSFER *transfer_request; @@ -118,7 +123,7 @@ UX_TRANSFER *transfer_request; we should wait until after the transfer is armed. We must look at the CDC-ECM thread's state. */ /* Disable interrupts while we check the link state and possibly set our state. */ - TX_DISABLE + UX_DISABLE /* Is it in the process of checking the link state and arming the transfer? */ if (cdc_ecm -> ux_host_class_cdc_ecm_bulk_in_transfer_check_and_arm_in_process == UX_TRUE) @@ -130,7 +135,7 @@ UX_TRANSFER *transfer_request; cdc_ecm -> ux_host_class_cdc_ecm_bulk_in_transfer_waiting_for_check_and_arm_to_finish = UX_TRUE; /* Restore interrupts. */ - TX_RESTORE + UX_RESTORE /* Wait for the transfer to be armed, or possibly an error. The CDC-ECM thread will wake us up. */ _ux_utility_semaphore_get(&cdc_ecm -> ux_host_class_cdc_ecm_bulk_in_transfer_waiting_for_check_and_arm_to_finish_semaphore, UX_WAIT_FOREVER); @@ -142,7 +147,7 @@ UX_TRANSFER *transfer_request; { /* Restore interrupts. */ - TX_RESTORE + UX_RESTORE } /* Now we can abort the transfer. */ 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 cb5fcfb..05ab707 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.0 */ +/* 6.1 */ /* AUTHOR */ /* */ /* Chaoqiong Xiao, Microsoft Corporation */ @@ -67,6 +67,8 @@ /* 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 */ /* */ /**************************************************************************/ UINT _ux_host_class_cdc_ecm_endpoints_get(UX_HOST_CLASS_CDC_ECM *cdc_ecm) diff --git a/common/usbx_host_classes/src/ux_host_class_cdc_ecm_entry.c b/common/usbx_host_classes/src/ux_host_class_cdc_ecm_entry.c index 8ecfec9..88f7095 100644 --- a/common/usbx_host_classes/src/ux_host_class_cdc_ecm_entry.c +++ b/common/usbx_host_classes/src/ux_host_class_cdc_ecm_entry.c @@ -35,7 +35,7 @@ /* FUNCTION RELEASE */ /* */ /* _ux_host_class_cdc_ecm_entry PORTABLE C */ -/* 6.0 */ +/* 6.1 */ /* AUTHOR */ /* */ /* Chaoqiong Xiao, Microsoft Corporation */ @@ -69,6 +69,8 @@ /* 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 */ /* */ /**************************************************************************/ UINT _ux_host_class_cdc_ecm_entry(UX_HOST_CLASS_COMMAND *command) diff --git a/common/usbx_host_classes/src/ux_host_class_cdc_ecm_interrupt_notification.c b/common/usbx_host_classes/src/ux_host_class_cdc_ecm_interrupt_notification.c index fb48507..870c13a 100644 --- a/common/usbx_host_classes/src/ux_host_class_cdc_ecm_interrupt_notification.c +++ b/common/usbx_host_classes/src/ux_host_class_cdc_ecm_interrupt_notification.c @@ -35,7 +35,7 @@ /* FUNCTION RELEASE */ /* */ /* _ux_host_class_cdc_ecm_interrupt_notification PORTABLE C */ -/* 6.0 */ +/* 6.1 */ /* AUTHOR */ /* */ /* Chaoqiong Xiao, Microsoft Corporation */ @@ -66,6 +66,8 @@ /* 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 */ /* */ /**************************************************************************/ VOID _ux_host_class_cdc_ecm_interrupt_notification(UX_TRANSFER *transfer_request) diff --git a/common/usbx_host_classes/src/ux_host_class_cdc_ecm_mac_address_get.c b/common/usbx_host_classes/src/ux_host_class_cdc_ecm_mac_address_get.c index d4dcfa4..cad6b7b 100644 --- a/common/usbx_host_classes/src/ux_host_class_cdc_ecm_mac_address_get.c +++ b/common/usbx_host_classes/src/ux_host_class_cdc_ecm_mac_address_get.c @@ -35,7 +35,7 @@ /* FUNCTION RELEASE */ /* */ /* _ux_host_class_cdc_ecm_mac_address_get PORTABLE C */ -/* 6.0 */ +/* 6.1 */ /* AUTHOR */ /* */ /* Chaoqiong Xiao, Microsoft Corporation */ @@ -69,6 +69,8 @@ /* 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 */ /* */ /**************************************************************************/ UINT _ux_host_class_cdc_ecm_mac_address_get(UX_HOST_CLASS_CDC_ECM *cdc_ecm) diff --git a/common/usbx_host_classes/src/ux_host_class_cdc_ecm_thread.c b/common/usbx_host_classes/src/ux_host_class_cdc_ecm_thread.c index 78aab54..af76f64 100644 --- a/common/usbx_host_classes/src/ux_host_class_cdc_ecm_thread.c +++ b/common/usbx_host_classes/src/ux_host_class_cdc_ecm_thread.c @@ -34,7 +34,7 @@ /* FUNCTION RELEASE */ /* */ /* _ux_host_class_cdc_ecm_thread PORTABLE C */ -/* 6.0 */ +/* 6.1 */ /* AUTHOR */ /* */ /* Chaoqiong Xiao, Microsoft Corporation */ @@ -76,6 +76,12 @@ /* DATE NAME DESCRIPTION */ /* */ /* 05-19-2020 Chaoqiong Xiao Initial Version 6.0 */ +/* 09-30-2020 Chaoqiong Xiao Modified comment(s), */ +/* prefixed UX to MS_TO_TICK, */ +/* used UX prefix to refer to */ +/* TX symbols instead of using */ +/* them directly, */ +/* resulting in version 6.1 */ /* */ /**************************************************************************/ VOID _ux_host_class_cdc_ecm_thread(ULONG parameter) @@ -114,7 +120,7 @@ UINT status; /* We can accept reception. Get a NX Packet. */ status = nx_packet_allocate(&cdc_ecm -> ux_host_class_cdc_ecm_packet_pool, &packet, - NX_RECEIVE_PACKET, MS_TO_TICK(UX_HOST_CLASS_CDC_ECM_PACKET_POOL_WAIT)); + NX_RECEIVE_PACKET, UX_MS_TO_TICK(UX_HOST_CLASS_CDC_ECM_PACKET_POOL_WAIT)); if (status == NX_SUCCESS) { @@ -158,7 +164,7 @@ UINT status; { /* Wait for the completion of the transfer request. */ - _ux_utility_semaphore_get(&transfer_request -> ux_transfer_request_semaphore, TX_WAIT_FOREVER); + _ux_utility_semaphore_get(&transfer_request -> ux_transfer_request_semaphore, UX_WAIT_FOREVER); /* Check the transfer status. If there is a transport error, we ignore the packet and restart it. */ diff --git a/common/usbx_host_classes/src/ux_host_class_cdc_ecm_transmission_callback.c b/common/usbx_host_classes/src/ux_host_class_cdc_ecm_transmission_callback.c index 9802e33..82095e6 100644 --- a/common/usbx_host_classes/src/ux_host_class_cdc_ecm_transmission_callback.c +++ b/common/usbx_host_classes/src/ux_host_class_cdc_ecm_transmission_callback.c @@ -35,7 +35,7 @@ /* FUNCTION RELEASE */ /* */ /* _ux_host_class_cdc_ecm_transmission_callback PORTABLE C */ -/* 6.0 */ +/* 6.1 */ /* AUTHOR */ /* */ /* Chaoqiong Xiao, Microsoft Corporation */ @@ -68,6 +68,8 @@ /* 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 */ /* */ /**************************************************************************/ VOID _ux_host_class_cdc_ecm_transmission_callback(UX_TRANSFER *transfer_request) diff --git a/common/usbx_host_classes/src/ux_host_class_cdc_ecm_transmit_queue_clean.c b/common/usbx_host_classes/src/ux_host_class_cdc_ecm_transmit_queue_clean.c index 843f7be..308be1d 100644 --- a/common/usbx_host_classes/src/ux_host_class_cdc_ecm_transmit_queue_clean.c +++ b/common/usbx_host_classes/src/ux_host_class_cdc_ecm_transmit_queue_clean.c @@ -34,7 +34,7 @@ /* FUNCTION RELEASE */ /* */ /* _ux_host_class_cdc_ecm_transmit_queue_clean PORTABLE C */ -/* 6.0 */ +/* 6.1 */ /* AUTHOR */ /* */ /* Chaoqiong Xiao, Microsoft Corporation */ @@ -66,19 +66,24 @@ /* DATE NAME DESCRIPTION */ /* */ /* 05-19-2020 Chaoqiong Xiao Initial Version 6.0 */ +/* 09-30-2020 Chaoqiong Xiao Modified comment(s), */ +/* used UX prefix to refer to */ +/* TX symbols instead of using */ +/* them directly, */ +/* resulting in version 6.1 */ /* */ /**************************************************************************/ VOID _ux_host_class_cdc_ecm_transmit_queue_clean(UX_HOST_CLASS_CDC_ECM *cdc_ecm) { -TX_INTERRUPT_SAVE_AREA +UX_INTERRUPT_SAVE_AREA NX_PACKET *current_packet; NX_PACKET *next_packet; /* Disable interrupts while we check the write in process flag and set our own state. */ - TX_DISABLE + UX_DISABLE /* Is there a write in process? */ if (cdc_ecm -> ux_host_class_cdc_ecm_bulk_out_transfer_check_and_arm_in_process == UX_TRUE) @@ -91,7 +96,7 @@ NX_PACKET *next_packet; cdc_ecm -> ux_host_class_cdc_ecm_bulk_out_transfer_waiting_for_check_and_arm_to_finish = UX_TRUE; /* Restore interrupts while we wait. */ - TX_RESTORE + UX_RESTORE /* Wait for write function to resume us. */ _ux_utility_semaphore_get(&cdc_ecm -> ux_host_class_cdc_ecm_bulk_out_transfer_waiting_for_check_and_arm_to_finish_semaphore, UX_WAIT_FOREVER); @@ -104,7 +109,7 @@ NX_PACKET *next_packet; /* No writes are in process. Restore interrupts and go on to free the xmit queue. */ - TX_RESTORE + UX_RESTORE } /* Abort transfers on the bulk out endpoint. Note we need to do this diff --git a/common/usbx_host_classes/src/ux_host_class_cdc_ecm_write.c b/common/usbx_host_classes/src/ux_host_class_cdc_ecm_write.c index 8a8f708..4c52d60 100644 --- a/common/usbx_host_classes/src/ux_host_class_cdc_ecm_write.c +++ b/common/usbx_host_classes/src/ux_host_class_cdc_ecm_write.c @@ -35,7 +35,7 @@ /* FUNCTION RELEASE */ /* */ /* _ux_host_class_cdc_ecm_write PORTABLE C */ -/* 6.0 */ +/* 6.1 */ /* AUTHOR */ /* */ /* Chaoqiong Xiao, Microsoft Corporation */ @@ -69,12 +69,17 @@ /* DATE NAME DESCRIPTION */ /* */ /* 05-19-2020 Chaoqiong Xiao Initial Version 6.0 */ +/* 09-30-2020 Chaoqiong Xiao Modified comment(s), */ +/* used UX prefix to refer to */ +/* TX symbols instead of using */ +/* them directly, */ +/* resulting in version 6.1 */ /* */ /**************************************************************************/ UINT _ux_host_class_cdc_ecm_write(VOID *cdc_ecm_class, NX_PACKET *packet) { -TX_INTERRUPT_SAVE_AREA +UX_INTERRUPT_SAVE_AREA UX_TRANSFER *transfer_request; UINT status; @@ -94,14 +99,14 @@ UX_HOST_CLASS_CDC_ECM *cdc_ecm; queue is non-null, it remains non-null until we have queued the packet. Note that we do not have to worry about the case where the queue is null, because we are the only ones that can change it from null to non-null. */ - TX_DISABLE + UX_DISABLE /* Ensure the instance is valid. */ if (cdc_ecm -> ux_host_class_cdc_ecm_state != UX_HOST_CLASS_INSTANCE_LIVE) { /* Restore interrupts. */ - TX_RESTORE + UX_RESTORE /* Error trap. */ _ux_system_error_handler(UX_SYSTEM_LEVEL_THREAD, UX_SYSTEM_CONTEXT_CLASS, UX_HOST_CLASS_INSTANCE_UNKNOWN); @@ -128,7 +133,7 @@ UX_HOST_CLASS_CDC_ECM *cdc_ecm; cdc_ecm -> ux_host_class_cdc_ecm_xmit_queue_tail = packet; /* Restore interrupts. */ - TX_RESTORE + UX_RESTORE /* Now we need to arm the transfer. */ @@ -180,7 +185,7 @@ UX_HOST_CLASS_CDC_ECM *cdc_ecm; cdc_ecm -> ux_host_class_cdc_ecm_xmit_queue_tail = packet; /* Restore interrupts. */ - TX_RESTORE + UX_RESTORE /* Successfully added to queue. */ status = UX_SUCCESS; @@ -192,7 +197,7 @@ UX_HOST_CLASS_CDC_ECM *cdc_ecm; /* Link was down. */ /* Restore interrupts. */ - TX_RESTORE + UX_RESTORE /* Release the packet. */ packet -> nx_packet_prepend_ptr = packet -> nx_packet_prepend_ptr + UX_HOST_CLASS_CDC_ECM_ETHERNET_SIZE; 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 fa49e51..6886bb9 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.0 */ +/* 6.1 */ /* AUTHOR */ /* */ /* Chaoqiong Xiao, Microsoft Corporation */ @@ -70,6 +70,8 @@ /* 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 */ /* */ /**************************************************************************/ UINT _ux_host_class_gser_activate(UX_HOST_CLASS_COMMAND *command) 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 6146204..2584875 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.0 */ +/* 6.1 */ /* AUTHOR */ /* */ /* Chaoqiong Xiao, Microsoft Corporation */ @@ -77,6 +77,8 @@ /* 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 */ /* */ /**************************************************************************/ UINT _ux_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 d0ab93b..3c2e901 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 @@ -34,8 +34,8 @@ /* */ /* FUNCTION RELEASE */ /* */ -/* _ux_host_class_gser_configure PORTABLE C */ -/* 6.0 */ +/* _ux_host_class_gser_configure PORTABLE C */ +/* 6.1 */ /* AUTHOR */ /* */ /* Chaoqiong Xiao, Microsoft Corporation */ @@ -70,6 +70,10 @@ /* DATE NAME DESCRIPTION */ /* */ /* 05-19-2020 Chaoqiong Xiao Initial Version 6.0 */ +/* 09-30-2020 Chaoqiong Xiao Modified comment(s), */ +/* optimized based on compile */ +/* definitions, */ +/* resulting in version 6.1 */ /* */ /**************************************************************************/ UINT _ux_host_class_gser_configure(UX_HOST_CLASS_GSER *gser) @@ -77,8 +81,11 @@ UINT _ux_host_class_gser_configure(UX_HOST_CLASS_GSER *gser) UINT status; UX_CONFIGURATION *configuration; -UX_DEVICE *parent_device; ULONG interface_index; +#if UX_MAX_DEVICES > 1 +UX_DEVICE *parent_device; +#endif + /* If the device has been configured already, we don't need to do it again. */ @@ -99,7 +106,8 @@ ULONG interface_index; return(UX_CONFIGURATION_HANDLE_UNKNOWN); } - + +#if UX_MAX_DEVICES > 1 /* Check the gser power source and check the parent power source for incompatible connections. */ if (gser -> ux_host_class_gser_device -> ux_device_power_source == UX_DEVICE_BUS_POWERED) @@ -122,7 +130,8 @@ ULONG interface_index; return(UX_CONNECTION_INCOMPATIBLE); } } - +#endif + /* We have the valid configuration. Ask the USBX stack to set this configuration. */ status = _ux_host_stack_device_configuration_select(configuration); if (status != UX_SUCCESS) diff --git a/common/usbx_host_classes/src/ux_host_class_gser_deactivate.c b/common/usbx_host_classes/src/ux_host_class_gser_deactivate.c index 4ecdfb8..921b9ff 100644 --- a/common/usbx_host_classes/src/ux_host_class_gser_deactivate.c +++ b/common/usbx_host_classes/src/ux_host_class_gser_deactivate.c @@ -35,7 +35,7 @@ /* FUNCTION RELEASE */ /* */ /* _ux_host_class_gser_deactivate PORTABLE C */ -/* 6.0 */ +/* 6.1 */ /* AUTHOR */ /* */ /* Chaoqiong Xiao, Microsoft Corporation */ @@ -72,6 +72,8 @@ /* 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 */ /* */ /**************************************************************************/ UINT _ux_host_class_gser_deactivate(UX_HOST_CLASS_COMMAND *command) diff --git a/common/usbx_host_classes/src/ux_host_class_gser_endpoints_get.c b/common/usbx_host_classes/src/ux_host_class_gser_endpoints_get.c index ca59f94..dbc2f2a 100644 --- a/common/usbx_host_classes/src/ux_host_class_gser_endpoints_get.c +++ b/common/usbx_host_classes/src/ux_host_class_gser_endpoints_get.c @@ -35,7 +35,7 @@ /* FUNCTION RELEASE */ /* */ /* _ux_host_class_gser_endpoints_get PORTABLE C */ -/* 6.0 */ +/* 6.1 */ /* AUTHOR */ /* */ /* Chaoqiong Xiao, Microsoft Corporation */ @@ -66,6 +66,8 @@ /* 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 */ /* */ /**************************************************************************/ UINT _ux_host_class_gser_endpoints_get(UX_HOST_CLASS_GSER *gser) diff --git a/common/usbx_host_classes/src/ux_host_class_gser_entry.c b/common/usbx_host_classes/src/ux_host_class_gser_entry.c index 122c9ff..11d51b4 100644 --- a/common/usbx_host_classes/src/ux_host_class_gser_entry.c +++ b/common/usbx_host_classes/src/ux_host_class_gser_entry.c @@ -35,7 +35,7 @@ /* FUNCTION RELEASE */ /* */ /* _ux_host_class_gser_entry PORTABLE C */ -/* 6.0 */ +/* 6.1 */ /* AUTHOR */ /* */ /* Chaoqiong Xiao, Microsoft Corporation */ @@ -68,6 +68,8 @@ /* 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 */ /* */ /**************************************************************************/ UINT _ux_host_class_gser_entry(UX_HOST_CLASS_COMMAND *command) 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 eff1cd7..4458c6a 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.0 */ +/* 6.1 */ /* AUTHOR */ /* */ /* Chaoqiong Xiao, Microsoft Corporation */ @@ -74,6 +74,8 @@ /* 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 */ /* */ /**************************************************************************/ UINT _ux_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 933d046..e3146d5 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 @@ -35,7 +35,7 @@ /* FUNCTION RELEASE */ /* */ /* _ux_host_class_gser_read PORTABLE C */ -/* 6.0 */ +/* 6.1 */ /* AUTHOR */ /* */ /* Chaoqiong Xiao, Microsoft Corporation */ @@ -73,6 +73,9 @@ /* DATE NAME DESCRIPTION */ /* */ /* 05-19-2020 Chaoqiong Xiao Initial Version 6.0 */ +/* 09-30-2020 Chaoqiong Xiao Modified comment(s), */ +/* prefixed UX to MS_TO_TICK, */ +/* resulting in version 6.1 */ /* */ /**************************************************************************/ UINT _ux_host_class_gser_read(UX_HOST_CLASS_GSER *gser, @@ -139,7 +142,7 @@ ULONG transfer_request_length; { /* Wait for the completion of the transfer_request. */ - status = _ux_utility_semaphore_get(&transfer_request -> ux_transfer_request_semaphore, MS_TO_TICK(UX_HOST_CLASS_GSER_CLASS_TRANSFER_TIMEOUT)); + status = _ux_utility_semaphore_get(&transfer_request -> ux_transfer_request_semaphore, UX_MS_TO_TICK(UX_HOST_CLASS_GSER_CLASS_TRANSFER_TIMEOUT)); /* If the semaphore did not succeed we probably have a time out. */ if (status != UX_SUCCESS) diff --git a/common/usbx_host_classes/src/ux_host_class_gser_reception_callback.c b/common/usbx_host_classes/src/ux_host_class_gser_reception_callback.c index 098aca0..fc2ca98 100644 --- a/common/usbx_host_classes/src/ux_host_class_gser_reception_callback.c +++ b/common/usbx_host_classes/src/ux_host_class_gser_reception_callback.c @@ -35,7 +35,7 @@ /* FUNCTION RELEASE */ /* */ /* _ux_host_class_gser_reception_callback PORTABLE C */ -/* 6.0 */ +/* 6.1 */ /* AUTHOR */ /* */ /* Chaoqiong Xiao, Microsoft Corporation */ @@ -67,6 +67,8 @@ /* 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 */ /* */ /**************************************************************************/ VOID _ux_host_class_gser_reception_callback (UX_TRANSFER *transfer_request) 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 551bd0e..4642b2e 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 @@ -35,7 +35,7 @@ /* FUNCTION RELEASE */ /* */ /* _ux_host_class_gser_reception_start PORTABLE C */ -/* 6.0 */ +/* 6.1 */ /* AUTHOR */ /* */ /* Chaoqiong Xiao, Microsoft Corporation */ @@ -70,6 +70,8 @@ /* 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 */ /* */ /**************************************************************************/ UINT _ux_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 7f9b4d4..c0cda17 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 @@ -35,7 +35,7 @@ /* FUNCTION RELEASE */ /* */ /* _ux_host_class_gser_reception_stop PORTABLE C */ -/* 6.0 */ +/* 6.1 */ /* AUTHOR */ /* */ /* Chaoqiong Xiao, Microsoft Corporation */ @@ -71,6 +71,8 @@ /* 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 */ /* */ /**************************************************************************/ UINT _ux_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 9fbb1cc..df45c95 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 @@ -34,7 +34,7 @@ /* FUNCTION RELEASE */ /* */ /* _ux_host_class_gser_write PORTABLE C */ -/* 6.0 */ +/* 6.1 */ /* AUTHOR */ /* */ /* Chaoqiong Xiao, Microsoft Corporation */ @@ -72,6 +72,9 @@ /* DATE NAME DESCRIPTION */ /* */ /* 05-19-2020 Chaoqiong Xiao Initial Version 6.0 */ +/* 09-30-2020 Chaoqiong Xiao Modified comment(s), */ +/* prefixed UX to MS_TO_TICK, */ +/* resulting in version 6.1 */ /* */ /**************************************************************************/ UINT _ux_host_class_gser_write(UX_HOST_CLASS_GSER *gser, @@ -134,7 +137,7 @@ ULONG transfer_request_length; { /* Wait for the completion of the transfer request. */ - status = _ux_utility_semaphore_get(&transfer_request -> ux_transfer_request_semaphore, MS_TO_TICK(UX_HOST_CLASS_GSER_CLASS_TRANSFER_TIMEOUT)); + status = _ux_utility_semaphore_get(&transfer_request -> ux_transfer_request_semaphore, UX_MS_TO_TICK(UX_HOST_CLASS_GSER_CLASS_TRANSFER_TIMEOUT)); /* If the semaphore did not succeed we probably have a time out. */ if (status != UX_SUCCESS) diff --git a/common/usbx_host_classes/src/ux_host_class_hid_activate.c b/common/usbx_host_classes/src/ux_host_class_hid_activate.c index 723e8a3..edcf715 100644 --- a/common/usbx_host_classes/src/ux_host_class_hid_activate.c +++ b/common/usbx_host_classes/src/ux_host_class_hid_activate.c @@ -35,7 +35,7 @@ /* FUNCTION RELEASE */ /* */ /* _ux_host_class_hid_activate PORTABLE C */ -/* 6.0 */ +/* 6.1 */ /* AUTHOR */ /* */ /* Chaoqiong Xiao, Microsoft Corporation */ @@ -74,6 +74,8 @@ /* 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 */ /* */ /**************************************************************************/ UINT _ux_host_class_hid_activate(UX_HOST_CLASS_COMMAND *command) 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 945ef98..df7c3ce 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 @@ -36,7 +36,7 @@ UX_COMPILE_TIME_ASSERT(!UX_OVERFLOW_CHECK_MULC_ULONG(UX_HOST_CLASS_HID_MAX_CLIEN /* FUNCTION RELEASE */ /* */ /* _ux_host_class_hid_client_register PORTABLE C */ -/* 6.0 */ +/* 6.1 */ /* AUTHOR */ /* */ /* Chaoqiong Xiao, Microsoft Corporation */ @@ -83,6 +83,10 @@ UX_COMPILE_TIME_ASSERT(!UX_OVERFLOW_CHECK_MULC_ULONG(UX_HOST_CLASS_HID_MAX_CLIEN /* DATE NAME DESCRIPTION */ /* */ /* 05-19-2020 Chaoqiong Xiao Initial Version 6.0 */ +/* 09-30-2020 Chaoqiong Xiao Modified comment(s), */ +/* verified memset and memcpy */ +/* cases, */ +/* resulting in version 6.1 */ /* */ /**************************************************************************/ UINT _ux_host_class_hid_client_register(UCHAR *hid_client_name, @@ -138,7 +142,7 @@ UINT client_name_length = 0; { /* We have found a free container for the HID client. Copy the name (with null-terminator). */ - _ux_utility_memory_copy(hid_client -> ux_host_class_hid_client_name, hid_client_name, client_name_length + 1); + _ux_utility_memory_copy(hid_client -> ux_host_class_hid_client_name, hid_client_name, client_name_length + 1); /* Use case of memcpy is verified. */ /* Memorize the handler address of this client. */ hid_client -> ux_host_class_hid_client_handler = hid_client_handler; diff --git a/common/usbx_host_classes/src/ux_host_class_hid_client_search.c b/common/usbx_host_classes/src/ux_host_class_hid_client_search.c index 1d96ce9..4ec136d 100644 --- a/common/usbx_host_classes/src/ux_host_class_hid_client_search.c +++ b/common/usbx_host_classes/src/ux_host_class_hid_client_search.c @@ -35,7 +35,7 @@ /* FUNCTION RELEASE */ /* */ /* _ux_host_class_hid_client_search PORTABLE C */ -/* 6.0 */ +/* 6.1 */ /* AUTHOR */ /* */ /* Chaoqiong Xiao, Microsoft Corporation */ @@ -66,6 +66,8 @@ /* 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 */ /* */ /**************************************************************************/ UINT _ux_host_class_hid_client_search(UX_HOST_CLASS_HID *hid) diff --git a/common/usbx_host_classes/src/ux_host_class_hid_configure.c b/common/usbx_host_classes/src/ux_host_class_hid_configure.c index 71641a2..5f7b11a 100644 --- a/common/usbx_host_classes/src/ux_host_class_hid_configure.c +++ b/common/usbx_host_classes/src/ux_host_class_hid_configure.c @@ -35,7 +35,7 @@ /* FUNCTION RELEASE */ /* */ /* _ux_host_class_hid_configure PORTABLE C */ -/* 6.0 */ +/* 6.1 */ /* AUTHOR */ /* */ /* Chaoqiong Xiao, Microsoft Corporation */ @@ -70,6 +70,10 @@ /* DATE NAME DESCRIPTION */ /* */ /* 05-19-2020 Chaoqiong Xiao Initial Version 6.0 */ +/* 09-30-2020 Chaoqiong Xiao Modified comment(s), */ +/* optimized based on compile */ +/* definitions, */ +/* resulting in version 6.1 */ /* */ /**************************************************************************/ UINT _ux_host_class_hid_configure(UX_HOST_CLASS_HID *hid) @@ -77,8 +81,10 @@ UINT _ux_host_class_hid_configure(UX_HOST_CLASS_HID *hid) UINT status; UX_CONFIGURATION *configuration; +#if UX_MAX_DEVICES > 1 UX_DEVICE *device; UX_DEVICE *parent_device; +#endif /* If the device has been configured already, we don't need to do it again. */ @@ -99,9 +105,10 @@ UX_DEVICE *parent_device; return(UX_CONFIGURATION_HANDLE_UNKNOWN); } +#if UX_MAX_DEVICES > 1 /* Get the device container for this configuration. */ device = configuration -> ux_configuration_device; - + /* Get the parent container for this device. */ parent_device = device -> ux_device_parent; @@ -124,7 +131,8 @@ UX_DEVICE *parent_device; return(UX_CONNECTION_INCOMPATIBLE); } } - +#endif + /* We have the valid configuration. Ask the USBX stack to set this configuration. */ status = _ux_host_stack_device_configuration_select(configuration); diff --git a/common/usbx_host_classes/src/ux_host_class_hid_deactivate.c b/common/usbx_host_classes/src/ux_host_class_hid_deactivate.c index 7b8574a..cc66138 100644 --- a/common/usbx_host_classes/src/ux_host_class_hid_deactivate.c +++ b/common/usbx_host_classes/src/ux_host_class_hid_deactivate.c @@ -35,7 +35,7 @@ /* FUNCTION RELEASE */ /* */ /* _ux_host_class_hid_deactivate PORTABLE C */ -/* 6.0 */ +/* 6.1 */ /* AUTHOR */ /* */ /* Chaoqiong Xiao, Microsoft Corporation */ @@ -75,6 +75,8 @@ /* 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 */ /* */ /**************************************************************************/ UINT _ux_host_class_hid_deactivate(UX_HOST_CLASS_COMMAND *command) diff --git a/common/usbx_host_classes/src/ux_host_class_hid_descriptor_parse.c b/common/usbx_host_classes/src/ux_host_class_hid_descriptor_parse.c index 10f0dbb..5df4c05 100644 --- a/common/usbx_host_classes/src/ux_host_class_hid_descriptor_parse.c +++ b/common/usbx_host_classes/src/ux_host_class_hid_descriptor_parse.c @@ -35,7 +35,7 @@ /* FUNCTION RELEASE */ /* */ /* _ux_host_class_hid_descriptor_parse PORTABLE C */ -/* 6.0 */ +/* 6.1 */ /* AUTHOR */ /* */ /* Chaoqiong Xiao, Microsoft Corporation */ @@ -70,6 +70,8 @@ /* 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 */ /* */ /**************************************************************************/ UINT _ux_host_class_hid_descriptor_parse(UX_HOST_CLASS_HID *hid) diff --git a/common/usbx_host_classes/src/ux_host_class_hid_entry.c b/common/usbx_host_classes/src/ux_host_class_hid_entry.c index c90d204..a0bbfc2 100644 --- a/common/usbx_host_classes/src/ux_host_class_hid_entry.c +++ b/common/usbx_host_classes/src/ux_host_class_hid_entry.c @@ -35,7 +35,7 @@ /* FUNCTION RELEASE */ /* */ /* _ux_host_class_hid_entry PORTABLE C */ -/* 6.0 */ +/* 6.1 */ /* AUTHOR */ /* */ /* Chaoqiong Xiao, Microsoft Corporation */ @@ -58,6 +58,7 @@ /* */ /* _ux_host_class_hid_activate Activate HID class */ /* _ux_host_class_hid_deactivate Deactivate HID class */ +/* _ux_utility_memory_free Free memory */ /* */ /* CALLED BY */ /* */ @@ -69,12 +70,18 @@ /* DATE NAME DESCRIPTION */ /* */ /* 05-19-2020 Chaoqiong Xiao Initial Version 6.0 */ +/* 09-30-2020 Chaoqiong Xiao Modified comment(s), */ +/* added destroy command, */ +/* resulting in version 6.1 */ /* */ /**************************************************************************/ UINT _ux_host_class_hid_entry(UX_HOST_CLASS_COMMAND *command) { -UINT status; +UINT status; +INT scan_index; +UX_HOST_CLASS_HID_CLIENT *client; +UX_HOST_CLASS_HID_CLIENT_COMMAND client_command; /* The command request will tell us we need to do here, either a enumeration @@ -99,7 +106,6 @@ UINT status; is ready to complete the enumeration. */ status = _ux_host_class_hid_activate(command); - return(status); @@ -107,9 +113,37 @@ UINT status; /* The deactivate command is used when the device has been extracted either directly or when its parents has been extracted. */ + status = _ux_host_class_hid_deactivate(command); return(status); + case UX_HOST_CLASS_COMMAND_DESTROY: + + /* The destroy command is used when the class is unregistered. */ + + /* Free allocated resources for clients. */ + if (command -> ux_host_class_command_class_ptr -> ux_host_class_client != UX_NULL) + { + + /* Get client. */ + client = command -> ux_host_class_command_class_ptr -> ux_host_class_client; + + /* Inform clients for destroy. */ + for (scan_index = 0; scan_index < UX_HOST_CLASS_HID_MAX_CLIENTS; scan_index ++) + { + + /* Inform client for destroy. */ + client_command.ux_host_class_hid_client_command_request = UX_HOST_CLASS_COMMAND_DESTROY; + client_command.ux_host_class_hid_client_command_container = (VOID *)command -> ux_host_class_command_class_ptr; + client -> ux_host_class_hid_client_handler(&client_command); + } + + /* Free clients memory. */ + _ux_utility_memory_free(command -> ux_host_class_command_class_ptr -> ux_host_class_client); + command -> ux_host_class_command_class_ptr -> ux_host_class_client = UX_NULL; + } + return(UX_SUCCESS); + default: /* Error trap. */ 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 9653466..afb7287 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.0 */ +/* 6.1 */ /* AUTHOR */ /* */ /* Chaoqiong Xiao, Microsoft Corporation */ @@ -67,6 +67,8 @@ /* 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 */ /* */ /**************************************************************************/ 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) diff --git a/common/usbx_host_classes/src/ux_host_class_hid_global_item_parse.c b/common/usbx_host_classes/src/ux_host_class_hid_global_item_parse.c index 58b176f..83cdd49 100644 --- a/common/usbx_host_classes/src/ux_host_class_hid_global_item_parse.c +++ b/common/usbx_host_classes/src/ux_host_class_hid_global_item_parse.c @@ -35,7 +35,7 @@ /* FUNCTION RELEASE */ /* */ /* _ux_host_class_hid_global_item_parse PORTABLE C */ -/* 6.0 */ +/* 6.1 */ /* AUTHOR */ /* */ /* Chaoqiong Xiao, Microsoft Corporation */ @@ -68,6 +68,10 @@ /* DATE NAME DESCRIPTION */ /* */ /* 05-19-2020 Chaoqiong Xiao Initial Version 6.0 */ +/* 09-30-2020 Chaoqiong Xiao Modified comment(s), */ +/* verified memset and memcpy */ +/* cases, */ +/* resulting in version 6.1 */ /* */ /**************************************************************************/ UINT _ux_host_class_hid_global_item_parse(UX_HOST_CLASS_HID *hid, UX_HOST_CLASS_HID_ITEM *item, UCHAR *descriptor) @@ -205,7 +209,7 @@ UX_HOST_CLASS_HID_PARSER *hid_parser; else _ux_utility_memory_copy(&hid_parser -> ux_host_class_hid_parser_global_pool[hid_parser -> ux_host_class_hid_parser_number_global++], - &hid_parser -> ux_host_class_hid_parser_global, sizeof(UX_HOST_CLASS_HID_GLOBAL_ITEM)); + &hid_parser -> ux_host_class_hid_parser_global, sizeof(UX_HOST_CLASS_HID_GLOBAL_ITEM)); /* Use case of memcpy is verified. */ break; @@ -226,7 +230,7 @@ UX_HOST_CLASS_HID_PARSER *hid_parser; else _ux_utility_memory_copy(&hid_parser -> ux_host_class_hid_parser_global, &hid_parser -> ux_host_class_hid_parser_global_pool[--hid_parser -> ux_host_class_hid_parser_number_global], - sizeof(UX_HOST_CLASS_HID_GLOBAL_ITEM)); + sizeof(UX_HOST_CLASS_HID_GLOBAL_ITEM)); /* Use case of memcpy is verified. */ break; 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 5deb535..c7d906c 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 @@ -35,7 +35,7 @@ /* FUNCTION RELEASE */ /* */ /* _ux_host_class_hid_idle_get PORTABLE C */ -/* 6.0.2 */ +/* 6.1 */ /* AUTHOR */ /* */ /* Chaoqiong Xiao, Microsoft Corporation */ @@ -70,10 +70,10 @@ /* DATE NAME DESCRIPTION */ /* */ /* 05-19-2020 Chaoqiong Xiao Initial Version 6.0 */ -/* 08-14-2020 Chaoqiong Xiao Modified comment(s), */ +/* 09-30-2020 Chaoqiong Xiao Modified comment(s), */ /* protected default control */ /* endpoint before using it, */ -/* resulting in version 6.0.2 */ +/* resulting in version 6.1 */ /* */ /**************************************************************************/ UINT _ux_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 42eaf96..eb7602f 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 @@ -35,7 +35,7 @@ /* FUNCTION RELEASE */ /* */ /* _ux_host_class_hid_idle_set PORTABLE C */ -/* 6.0.2 */ +/* 6.1 */ /* AUTHOR */ /* */ /* Chaoqiong Xiao, Microsoft Corporation */ @@ -70,10 +70,10 @@ /* DATE NAME DESCRIPTION */ /* */ /* 05-19-2020 Chaoqiong Xiao Initial Version 6.0 */ -/* 08-14-2020 Chaoqiong Xiao Modified comment(s), */ +/* 09-30-2020 Chaoqiong Xiao Modified comment(s), */ /* protected default control */ /* endpoint before using it, */ -/* resulting in version 6.0.2 */ +/* resulting in version 6.1 */ /* */ /**************************************************************************/ UINT _ux_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_instance_clean.c b/common/usbx_host_classes/src/ux_host_class_hid_instance_clean.c index 5e9d52c..f5ef2c3 100644 --- a/common/usbx_host_classes/src/ux_host_class_hid_instance_clean.c +++ b/common/usbx_host_classes/src/ux_host_class_hid_instance_clean.c @@ -35,7 +35,7 @@ /* FUNCTION RELEASE */ /* */ /* _ux_host_class_hid_instance_clean PORTABLE C */ -/* 6.0 */ +/* 6.1 */ /* AUTHOR */ /* */ /* Chaoqiong Xiao, Microsoft Corporation */ @@ -65,6 +65,8 @@ /* 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 */ /* */ /**************************************************************************/ UINT _ux_host_class_hid_instance_clean(UX_HOST_CLASS_HID *hid) diff --git a/common/usbx_host_classes/src/ux_host_class_hid_interrupt_endpoint_search.c b/common/usbx_host_classes/src/ux_host_class_hid_interrupt_endpoint_search.c index 4e8988d..34f807d 100644 --- a/common/usbx_host_classes/src/ux_host_class_hid_interrupt_endpoint_search.c +++ b/common/usbx_host_classes/src/ux_host_class_hid_interrupt_endpoint_search.c @@ -35,7 +35,7 @@ /* FUNCTION RELEASE */ /* */ /* _ux_host_class_hid_interrupt_endpoint_search PORTABLE C */ -/* 6.0 */ +/* 6.1 */ /* AUTHOR */ /* */ /* Chaoqiong Xiao, Microsoft Corporation */ @@ -69,6 +69,8 @@ /* 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 */ /* */ /**************************************************************************/ UINT _ux_host_class_hid_interrupt_endpoint_search(UX_HOST_CLASS_HID *hid) diff --git a/common/usbx_host_classes/src/ux_host_class_hid_item_data_get.c b/common/usbx_host_classes/src/ux_host_class_hid_item_data_get.c index 58bf853..1a8f90d 100644 --- a/common/usbx_host_classes/src/ux_host_class_hid_item_data_get.c +++ b/common/usbx_host_classes/src/ux_host_class_hid_item_data_get.c @@ -35,7 +35,7 @@ /* FUNCTION RELEASE */ /* */ /* _ux_host_class_hid_item_data_get PORTABLE C */ -/* 6.0 */ +/* 6.1 */ /* AUTHOR */ /* */ /* Chaoqiong Xiao, Microsoft Corporation */ @@ -67,6 +67,8 @@ /* 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 */ /* */ /**************************************************************************/ ULONG _ux_host_class_hid_item_data_get(UCHAR *descriptor, UX_HOST_CLASS_HID_ITEM *item) diff --git a/common/usbx_host_classes/src/ux_host_class_hid_keyboard_activate.c b/common/usbx_host_classes/src/ux_host_class_hid_keyboard_activate.c index 6712d00..fbdfced 100644 --- a/common/usbx_host_classes/src/ux_host_class_hid_keyboard_activate.c +++ b/common/usbx_host_classes/src/ux_host_class_hid_keyboard_activate.c @@ -98,7 +98,7 @@ UX_HOST_CLASS_HID_KEYBOARD_LAYOUT ux_host_class_hid_keyboard_layout = /* FUNCTION RELEASE */ /* */ /* _ux_host_class_hid_keyboard_activate PORTABLE C */ -/* 6.0 */ +/* 6.1 */ /* AUTHOR */ /* */ /* Chaoqiong Xiao, Microsoft Corporation */ @@ -140,6 +140,11 @@ UX_HOST_CLASS_HID_KEYBOARD_LAYOUT ux_host_class_hid_keyboard_layout = /* DATE NAME DESCRIPTION */ /* */ /* 05-19-2020 Chaoqiong Xiao Initial Version 6.0 */ +/* 09-30-2020 Chaoqiong Xiao Modified comment(s), */ +/* used UX prefix to refer to */ +/* TX symbols instead of using */ +/* them directly, */ +/* resulting in version 6.1 */ /* */ /**************************************************************************/ UINT _ux_host_class_hid_keyboard_activate(UX_HOST_CLASS_HID_CLIENT_COMMAND *command) @@ -307,7 +312,7 @@ UX_HOST_CLASS_HID_FIELD *field; status = _ux_utility_thread_create(&keyboard_instance -> ux_host_class_hid_keyboard_thread, "ux_host_stack_keyboard_thread",_ux_host_class_hid_keyboard_thread, (ULONG) (ALIGN_TYPE) keyboard_instance, keyboard_instance -> ux_host_class_hid_keyboard_thread_stack, UX_THREAD_STACK_SIZE, UX_THREAD_PRIORITY_KEYBOARD, - UX_THREAD_PRIORITY_KEYBOARD, UX_NO_TIME_SLICE, TX_AUTO_START); + UX_THREAD_PRIORITY_KEYBOARD, UX_NO_TIME_SLICE, UX_AUTO_START); /* If we are OK, go on. */ if (status == UX_SUCCESS) @@ -398,7 +403,7 @@ UX_HOST_CLASS_HID_FIELD *field; _ux_utility_memory_free(keyboard_instance -> ux_host_class_hid_keyboard_thread_stack); /* Delete semaphore. */ - if (keyboard_instance -> ux_host_class_hid_keyboard_semaphore.tx_semaphore_id != TX_EMPTY) + if (keyboard_instance -> ux_host_class_hid_keyboard_semaphore.tx_semaphore_id != UX_EMPTY) _ux_utility_semaphore_delete(&keyboard_instance -> ux_host_class_hid_keyboard_semaphore); /* Free usage array. */ diff --git a/common/usbx_host_classes/src/ux_host_class_hid_keyboard_callback.c b/common/usbx_host_classes/src/ux_host_class_hid_keyboard_callback.c index a9dedbd..d690a1f 100644 --- a/common/usbx_host_classes/src/ux_host_class_hid_keyboard_callback.c +++ b/common/usbx_host_classes/src/ux_host_class_hid_keyboard_callback.c @@ -35,7 +35,7 @@ /* FUNCTION RELEASE */ /* */ /* _ux_host_class_hid_keyboard_callback PORTABLE C */ -/* 6.0 */ +/* 6.1 */ /* AUTHOR */ /* */ /* Chaoqiong Xiao, Microsoft Corporation */ @@ -66,6 +66,10 @@ /* DATE NAME DESCRIPTION */ /* */ /* 05-19-2020 Chaoqiong Xiao Initial Version 6.0 */ +/* 09-30-2020 Chaoqiong Xiao Modified comment(s), */ +/* verified memset and memcpy */ +/* cases, */ +/* resulting in version 6.1 */ /* */ /**************************************************************************/ VOID _ux_host_class_hid_keyboard_callback(UX_HOST_CLASS_HID_REPORT_CALLBACK *callback) @@ -171,7 +175,7 @@ UCHAR *state_action; /* Get the current states of the lock keys and immediately initialize them to zero; if a lock key is not pressed in this report, it will remain zero (not pressed). */ current_lock_key_states = &keyboard_instance -> ux_host_class_hid_keyboard_key_state[3]; - _ux_utility_memory_set(current_lock_key_states, 0, 3); + _ux_utility_memory_set(current_lock_key_states, 0, 3); /* Use case of memset is verified. */ /* Scan the report buffer and decode it. */ while(report_buffer < report_buffer_end) @@ -191,9 +195,9 @@ UCHAR *state_action; state_action = state_value + keyboard_instance -> ux_host_class_hid_keyboard_key_count * 2; /* Reset state actions to DEL(not received). */ - _ux_utility_memory_set(state_usage + keyboard_instance -> ux_host_class_hid_keyboard_key_count, 0, keyboard_instance -> ux_host_class_hid_keyboard_key_count); - _ux_utility_memory_set(state_value + keyboard_instance -> ux_host_class_hid_keyboard_key_count, 0, keyboard_instance -> ux_host_class_hid_keyboard_key_count); - _ux_utility_memory_set(state_action, KEY_DEL, keyboard_instance -> ux_host_class_hid_keyboard_key_count * 2); + _ux_utility_memory_set(state_usage + keyboard_instance -> ux_host_class_hid_keyboard_key_count, 0, keyboard_instance -> ux_host_class_hid_keyboard_key_count); /* Use case of memset is verified. */ + _ux_utility_memory_set(state_value + keyboard_instance -> ux_host_class_hid_keyboard_key_count, 0, keyboard_instance -> ux_host_class_hid_keyboard_key_count); /* Use case of memset is verified. */ + _ux_utility_memory_set(state_action, KEY_DEL, keyboard_instance -> ux_host_class_hid_keyboard_key_count * 2); /* Use case of memset is verified. */ new_count = keyboard_instance -> ux_host_class_hid_keyboard_key_count; while(report_buffer < report_buffer_end) @@ -557,11 +561,11 @@ UCHAR *state_action; /* Copy the current lock key states to the previous states. Note that if a lock key wasn't down in this report, its current state would have remained zero (not pressed). */ - _ux_utility_memory_copy(previous_lock_key_states, current_lock_key_states, 3); + _ux_utility_memory_copy(previous_lock_key_states, current_lock_key_states, 3); /* Use case of memcpy is verified. */ #else /* Clear redundant data after last saved key. */ - _ux_utility_memory_set(state_usage + i_save, 0, keyboard_instance -> ux_host_class_hid_keyboard_key_count - i_save); + _ux_utility_memory_set(state_usage + i_save, 0, keyboard_instance -> ux_host_class_hid_keyboard_key_count - i_save); /* Use case of memset is verified. */ #endif /* Return to caller. */ 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 968cbd2..a78d34c 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.0 */ +/* 6.1 */ /* AUTHOR */ /* */ /* Chaoqiong Xiao, Microsoft Corporation */ @@ -70,6 +70,8 @@ /* 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 */ /* */ /**************************************************************************/ UINT _ux_host_class_hid_keyboard_deactivate(UX_HOST_CLASS_HID_CLIENT_COMMAND *command) diff --git a/common/usbx_host_classes/src/ux_host_class_hid_keyboard_entry.c b/common/usbx_host_classes/src/ux_host_class_hid_keyboard_entry.c index ae9e4c6..df8bd09 100644 --- a/common/usbx_host_classes/src/ux_host_class_hid_keyboard_entry.c +++ b/common/usbx_host_classes/src/ux_host_class_hid_keyboard_entry.c @@ -36,7 +36,7 @@ /* FUNCTION RELEASE */ /* */ /* _ux_host_class_hid_keyboard_entry PORTABLE C */ -/* 6.0 */ +/* 6.1 */ /* AUTHOR */ /* */ /* Chaoqiong Xiao, Microsoft Corporation */ @@ -71,6 +71,8 @@ /* 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 */ /* */ /**************************************************************************/ UINT _ux_host_class_hid_keyboard_entry(UX_HOST_CLASS_HID_CLIENT_COMMAND *command) 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 5a7574e..46aad27 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 @@ -37,7 +37,7 @@ extern UX_HOST_CLASS_HID_KEYBOARD_LAYOUT ux_host_class_hid_keyboard_layout; /* FUNCTION RELEASE */ /* */ /* _ux_host_class_hid_keyboard_ioctl PORTABLE C */ -/* 6.0 */ +/* 6.1 */ /* AUTHOR */ /* */ /* Chaoqiong Xiao, Microsoft Corporation */ @@ -70,6 +70,8 @@ extern UX_HOST_CLASS_HID_KEYBOARD_LAYOUT ux_host_class_hid_keyboard_layout; /* 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 */ /* */ /**************************************************************************/ UINT _ux_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 0e02029..ea5e69c 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 @@ -36,7 +36,7 @@ /* FUNCTION RELEASE */ /* */ /* _ux_host_class_hid_keyboard_key_get PORTABLE C */ -/* 6.0 */ +/* 6.1 */ /* AUTHOR */ /* */ /* Chaoqiong Xiao, Microsoft Corporation */ @@ -69,6 +69,8 @@ /* 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 */ /* */ /**************************************************************************/ UINT _ux_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_keyboard_thread.c b/common/usbx_host_classes/src/ux_host_class_hid_keyboard_thread.c index fbd52e7..23baf1f 100644 --- a/common/usbx_host_classes/src/ux_host_class_hid_keyboard_thread.c +++ b/common/usbx_host_classes/src/ux_host_class_hid_keyboard_thread.c @@ -36,7 +36,7 @@ /* FUNCTION RELEASE */ /* */ /* _ux_host_class_hid_keyboard_thread PORTABLE C */ -/* 6.0 */ +/* 6.1 */ /* AUTHOR */ /* */ /* Chaoqiong Xiao, Microsoft Corporation */ @@ -70,6 +70,8 @@ /* 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 */ /* */ /**************************************************************************/ VOID _ux_host_class_hid_keyboard_thread(ULONG thread_input) diff --git a/common/usbx_host_classes/src/ux_host_class_hid_local_item_parse.c b/common/usbx_host_classes/src/ux_host_class_hid_local_item_parse.c index 16677de..f7822f5 100644 --- a/common/usbx_host_classes/src/ux_host_class_hid_local_item_parse.c +++ b/common/usbx_host_classes/src/ux_host_class_hid_local_item_parse.c @@ -35,7 +35,7 @@ /* FUNCTION RELEASE */ /* */ /* _ux_host_class_hid_local_item_parse PORTABLE C */ -/* 6.0 */ +/* 6.1 */ /* AUTHOR */ /* */ /* Chaoqiong Xiao, Microsoft Corporation */ @@ -67,6 +67,8 @@ /* 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 */ /* */ /**************************************************************************/ UINT _ux_host_class_hid_local_item_parse(UX_HOST_CLASS_HID *hid, UX_HOST_CLASS_HID_ITEM *item, UCHAR *descriptor) diff --git a/common/usbx_host_classes/src/ux_host_class_hid_main_item_parse.c b/common/usbx_host_classes/src/ux_host_class_hid_main_item_parse.c index 352f900..5cf3f93 100644 --- a/common/usbx_host_classes/src/ux_host_class_hid_main_item_parse.c +++ b/common/usbx_host_classes/src/ux_host_class_hid_main_item_parse.c @@ -35,7 +35,7 @@ /* FUNCTION RELEASE */ /* */ /* _ux_host_class_hid_main_item_parse PORTABLE C */ -/* 6.0 */ +/* 6.1 */ /* AUTHOR */ /* */ /* Chaoqiong Xiao, Microsoft Corporation */ @@ -69,6 +69,10 @@ /* DATE NAME DESCRIPTION */ /* */ /* 05-19-2020 Chaoqiong Xiao Initial Version 6.0 */ +/* 09-30-2020 Chaoqiong Xiao Modified comment(s), */ +/* verified memset and memcpy */ +/* cases, */ +/* resulting in version 6.1 */ /* */ /**************************************************************************/ UINT _ux_host_class_hid_main_item_parse(UX_HOST_CLASS_HID *hid, UX_HOST_CLASS_HID_ITEM *item, UCHAR *descriptor) @@ -175,7 +179,7 @@ ULONG collection_type; } /* We have a new main item, so the local instances have to be cleaned. */ - _ux_utility_memory_set(&hid_parser -> ux_host_class_hid_parser_local, 0, sizeof(UX_HOST_CLASS_HID_LOCAL_ITEM)); + _ux_utility_memory_set(&hid_parser -> ux_host_class_hid_parser_local, 0, sizeof(UX_HOST_CLASS_HID_LOCAL_ITEM)); /* Use case of memset is verified. */ /* Return completion status. */ return(status); diff --git a/common/usbx_host_classes/src/ux_host_class_hid_mouse_activate.c b/common/usbx_host_classes/src/ux_host_class_hid_mouse_activate.c index 61cb418..96b0ac4 100644 --- a/common/usbx_host_classes/src/ux_host_class_hid_mouse_activate.c +++ b/common/usbx_host_classes/src/ux_host_class_hid_mouse_activate.c @@ -36,7 +36,7 @@ /* FUNCTION RELEASE */ /* */ /* _ux_host_class_hid_mouse_activate PORTABLE C */ -/* 6.0 */ +/* 6.1 */ /* AUTHOR */ /* */ /* Chaoqiong Xiao, Microsoft Corporation */ @@ -73,6 +73,8 @@ /* 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 */ /* */ /**************************************************************************/ UINT _ux_host_class_hid_mouse_activate(UX_HOST_CLASS_HID_CLIENT_COMMAND *command) 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 139c9f0..d1e5295 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 @@ -36,7 +36,7 @@ /* FUNCTION RELEASE */ /* */ /* _ux_host_class_hid_mouse_buttons_get PORTABLE C */ -/* 6.0 */ +/* 6.1 */ /* AUTHOR */ /* */ /* Chaoqiong Xiao, Microsoft Corporation */ @@ -67,6 +67,8 @@ /* 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 */ /* */ /**************************************************************************/ UINT _ux_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_callback.c b/common/usbx_host_classes/src/ux_host_class_hid_mouse_callback.c index 9e453e1..c95ed59 100644 --- a/common/usbx_host_classes/src/ux_host_class_hid_mouse_callback.c +++ b/common/usbx_host_classes/src/ux_host_class_hid_mouse_callback.c @@ -36,7 +36,7 @@ /* FUNCTION RELEASE */ /* */ /* _ux_host_class_hid_mouse_callback PORTABLE C */ -/* 6.0 */ +/* 6.1 */ /* AUTHOR */ /* */ /* Chaoqiong Xiao, Microsoft Corporation */ @@ -68,6 +68,8 @@ /* 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 */ /* */ /**************************************************************************/ VOID _ux_host_class_hid_mouse_callback(UX_HOST_CLASS_HID_REPORT_CALLBACK *callback) 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 8a06cf4..c7cf7db 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.0 */ +/* 6.1 */ /* AUTHOR */ /* */ /* Chaoqiong Xiao, Microsoft Corporation */ @@ -68,6 +68,8 @@ /* 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 */ /* */ /**************************************************************************/ UINT _ux_host_class_hid_mouse_deactivate(UX_HOST_CLASS_HID_CLIENT_COMMAND *command) diff --git a/common/usbx_host_classes/src/ux_host_class_hid_mouse_entry.c b/common/usbx_host_classes/src/ux_host_class_hid_mouse_entry.c index a81662d..322b332 100644 --- a/common/usbx_host_classes/src/ux_host_class_hid_mouse_entry.c +++ b/common/usbx_host_classes/src/ux_host_class_hid_mouse_entry.c @@ -36,7 +36,7 @@ /* FUNCTION RELEASE */ /* */ /* _ux_host_class_hid_mouse_entry PORTABLE C */ -/* 6.0 */ +/* 6.1 */ /* AUTHOR */ /* */ /* Chaoqiong Xiao, Microsoft Corporation */ @@ -69,6 +69,8 @@ /* 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 */ /* */ /**************************************************************************/ UINT _ux_host_class_hid_mouse_entry(UX_HOST_CLASS_HID_CLIENT_COMMAND *command) 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 3b582f7..df28dc1 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 @@ -36,7 +36,7 @@ /* FUNCTION RELEASE */ /* */ /* _ux_host_class_hid_mouse_position_get PORTABLE C */ -/* 6.0 */ +/* 6.1 */ /* AUTHOR */ /* */ /* Chaoqiong Xiao, Microsoft Corporation */ @@ -69,6 +69,8 @@ /* 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 */ /* */ /**************************************************************************/ UINT _ux_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 7b20092..f20ecef 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 @@ -36,7 +36,7 @@ /* FUNCTION RELEASE */ /* */ /* _ux_host_class_hid_mouse_wheel_get PORTABLE C */ -/* 6.0 */ +/* 6.1 */ /* AUTHOR */ /* */ /* Chaoqiong Xiao, Microsoft Corporation */ @@ -67,6 +67,8 @@ /* 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 */ /* */ /**************************************************************************/ UINT _ux_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 eb11b5d..aacb26e 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 @@ -35,7 +35,7 @@ /* FUNCTION RELEASE */ /* */ /* _ux_host_class_hid_periodic_report_start PORTABLE C */ -/* 6.0 */ +/* 6.1 */ /* AUTHOR */ /* */ /* Chaoqiong Xiao, Microsoft Corporation */ @@ -70,6 +70,8 @@ /* 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 */ /* */ /**************************************************************************/ UINT _ux_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 5b5845c..a2ee3cd 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 @@ -35,7 +35,7 @@ /* FUNCTION RELEASE */ /* */ /* _ux_host_class_hid_periodic_report_stop PORTABLE C */ -/* 6.0 */ +/* 6.1 */ /* AUTHOR */ /* */ /* Chaoqiong Xiao, Microsoft Corporation */ @@ -70,6 +70,8 @@ /* 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 */ /* */ /**************************************************************************/ UINT _ux_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_activate.c b/common/usbx_host_classes/src/ux_host_class_hid_remote_control_activate.c index 0cb1032..b5bc0be 100644 --- a/common/usbx_host_classes/src/ux_host_class_hid_remote_control_activate.c +++ b/common/usbx_host_classes/src/ux_host_class_hid_remote_control_activate.c @@ -36,7 +36,7 @@ /* FUNCTION RELEASE */ /* */ /* _ux_host_class_hid_remote_control_activate PORTABLE C */ -/* 6.0 */ +/* 6.1 */ /* AUTHOR */ /* */ /* Chaoqiong Xiao, Microsoft Corporation */ @@ -69,6 +69,8 @@ /* 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 */ /* */ /**************************************************************************/ UINT _ux_host_class_hid_remote_control_activate(UX_HOST_CLASS_HID_CLIENT_COMMAND *command) diff --git a/common/usbx_host_classes/src/ux_host_class_hid_remote_control_callback.c b/common/usbx_host_classes/src/ux_host_class_hid_remote_control_callback.c index 0997f2d..ef8ac8a 100644 --- a/common/usbx_host_classes/src/ux_host_class_hid_remote_control_callback.c +++ b/common/usbx_host_classes/src/ux_host_class_hid_remote_control_callback.c @@ -36,7 +36,7 @@ /* FUNCTION RELEASE */ /* */ /* _ux_host_class_hid_remote_control_callback PORTABLE C */ -/* 6.0 */ +/* 6.1 */ /* AUTHOR */ /* */ /* Chaoqiong Xiao, Microsoft Corporation */ @@ -66,6 +66,8 @@ /* 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 */ /* */ /**************************************************************************/ VOID _ux_host_class_hid_remote_control_callback(UX_HOST_CLASS_HID_REPORT_CALLBACK *callback) 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 8146336..d2083ba 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.0 */ +/* 6.1 */ /* AUTHOR */ /* */ /* Chaoqiong Xiao, Microsoft Corporation */ @@ -68,6 +68,8 @@ /* 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 */ /* */ /**************************************************************************/ UINT _ux_host_class_hid_remote_control_deactivate(UX_HOST_CLASS_HID_CLIENT_COMMAND *command) diff --git a/common/usbx_host_classes/src/ux_host_class_hid_remote_control_entry.c b/common/usbx_host_classes/src/ux_host_class_hid_remote_control_entry.c index 6fb8812..02336dd 100644 --- a/common/usbx_host_classes/src/ux_host_class_hid_remote_control_entry.c +++ b/common/usbx_host_classes/src/ux_host_class_hid_remote_control_entry.c @@ -36,7 +36,7 @@ /* FUNCTION RELEASE */ /* */ /* _ux_host_class_hid_remote_control_entry PORTABLE C */ -/* 6.0 */ +/* 6.1 */ /* AUTHOR */ /* */ /* Chaoqiong Xiao, Microsoft Corporation */ @@ -71,6 +71,8 @@ /* 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 */ /* */ /**************************************************************************/ UINT _ux_host_class_hid_remote_control_entry(UX_HOST_CLASS_HID_CLIENT_COMMAND *command) 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 8fbd9a1..7d48323 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 @@ -36,7 +36,7 @@ /* FUNCTION RELEASE */ /* */ /* _ux_host_class_hid_remote_control_usage_get PORTABLE C */ -/* 6.0 */ +/* 6.1 */ /* AUTHOR */ /* */ /* Chaoqiong Xiao, Microsoft Corporation */ @@ -69,6 +69,8 @@ /* 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 */ /* */ /**************************************************************************/ UINT _ux_host_class_hid_remote_control_usage_get(UX_HOST_CLASS_HID_REMOTE_CONTROL *remote_control_instance, ULONG *usage, ULONG *value) 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 59ca089..65bfaae 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.0 */ +/* 6.1 */ /* AUTHOR */ /* */ /* Chaoqiong Xiao, Microsoft Corporation */ @@ -71,6 +71,10 @@ /* DATE NAME DESCRIPTION */ /* */ /* 05-19-2020 Chaoqiong Xiao Initial Version 6.0 */ +/* 09-30-2020 Chaoqiong Xiao Modified comment(s), */ +/* verified memset and memcpy */ +/* cases, */ +/* resulting in version 6.1 */ /* */ /**************************************************************************/ UINT _ux_host_class_hid_report_add(UX_HOST_CLASS_HID *hid, UCHAR *descriptor, UX_HOST_CLASS_HID_ITEM *item) @@ -279,7 +283,7 @@ 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); + _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. */ } /* Save the number of usages. */ 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 960d810..1451e3a 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 @@ -35,7 +35,7 @@ /* FUNCTION RELEASE */ /* */ /* _ux_host_class_hid_report_callback_register PORTABLE C */ -/* 6.0 */ +/* 6.1 */ /* AUTHOR */ /* */ /* Chaoqiong Xiao, Microsoft Corporation */ @@ -74,6 +74,8 @@ /* 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 */ /* */ /**************************************************************************/ UINT _ux_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_compress.c b/common/usbx_host_classes/src/ux_host_class_hid_report_compress.c index 2264881..b185890 100644 --- a/common/usbx_host_classes/src/ux_host_class_hid_report_compress.c +++ b/common/usbx_host_classes/src/ux_host_class_hid_report_compress.c @@ -35,7 +35,7 @@ /* FUNCTION RELEASE */ /* */ /* _ux_host_class_hid_report_compress PORTABLE C */ -/* 6.0 */ +/* 6.1 */ /* AUTHOR */ /* */ /* Chaoqiong Xiao, Microsoft Corporation */ @@ -68,6 +68,8 @@ /* 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 */ /* */ /**************************************************************************/ UINT _ux_host_class_hid_report_compress(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_decompress.c b/common/usbx_host_classes/src/ux_host_class_hid_report_decompress.c index e3eedcd..91ed3bc 100644 --- a/common/usbx_host_classes/src/ux_host_class_hid_report_decompress.c +++ b/common/usbx_host_classes/src/ux_host_class_hid_report_decompress.c @@ -35,7 +35,7 @@ /* FUNCTION RELEASE */ /* */ /* _ux_host_class_hid_report_decompress PORTABLE C */ -/* 6.0 */ +/* 6.1 */ /* AUTHOR */ /* */ /* Chaoqiong Xiao, Microsoft Corporation */ @@ -68,6 +68,8 @@ /* 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 */ /* */ /**************************************************************************/ UINT _ux_host_class_hid_report_decompress(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_descriptor_get.c b/common/usbx_host_classes/src/ux_host_class_hid_report_descriptor_get.c index 628bebf..cb16409 100644 --- a/common/usbx_host_classes/src/ux_host_class_hid_report_descriptor_get.c +++ b/common/usbx_host_classes/src/ux_host_class_hid_report_descriptor_get.c @@ -35,7 +35,7 @@ /* FUNCTION RELEASE */ /* */ /* _ux_host_class_hid_report_descriptor_get PORTABLE C */ -/* 6.0 */ +/* 6.1 */ /* AUTHOR */ /* */ /* Chaoqiong Xiao, Microsoft Corporation */ @@ -72,6 +72,8 @@ /* 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 */ /* */ /**************************************************************************/ UINT _ux_host_class_hid_report_descriptor_get(UX_HOST_CLASS_HID *hid, ULONG length) 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 0c3cd1d..f1c8179 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 @@ -35,7 +35,7 @@ /* FUNCTION RELEASE */ /* */ /* _ux_host_class_hid_report_get PORTABLE C */ -/* 6.0.2 */ +/* 6.1 */ /* AUTHOR */ /* */ /* Chaoqiong Xiao, Microsoft Corporation */ @@ -75,11 +75,11 @@ /* DATE NAME DESCRIPTION */ /* */ /* 05-19-2020 Chaoqiong Xiao Initial Version 6.0 */ -/* 08-14-2020 Chaoqiong Xiao Modified comment(s), */ +/* 09-30-2020 Chaoqiong Xiao Modified comment(s), */ /* verified memset and memcpy */ /* cases, accepted both INPUT */ /* and FEATURE reports, */ -/* resulting in version 6.0.2 */ +/* resulting in version 6.1 */ /* */ /**************************************************************************/ UINT _ux_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 71d1a26..d5ca2e4 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 @@ -35,7 +35,7 @@ /* FUNCTION RELEASE */ /* */ /* _ux_host_class_hid_report_id_get PORTABLE C */ -/* 6.0 */ +/* 6.1 */ /* AUTHOR */ /* */ /* Chaoqiong Xiao, Microsoft Corporation */ @@ -73,6 +73,8 @@ /* 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 */ /* */ /**************************************************************************/ UINT _ux_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_item_analyse.c b/common/usbx_host_classes/src/ux_host_class_hid_report_item_analyse.c index d99351a..434b96b 100644 --- a/common/usbx_host_classes/src/ux_host_class_hid_report_item_analyse.c +++ b/common/usbx_host_classes/src/ux_host_class_hid_report_item_analyse.c @@ -35,7 +35,7 @@ /* FUNCTION RELEASE */ /* */ /* _ux_host_class_hid_report_item_analyse PORTABLE C */ -/* 6.0 */ +/* 6.1 */ /* AUTHOR */ /* */ /* Chaoqiong Xiao, Microsoft Corporation */ @@ -66,6 +66,8 @@ /* 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 */ /* */ /**************************************************************************/ UINT _ux_host_class_hid_report_item_analyse(UCHAR *descriptor, UX_HOST_CLASS_HID_ITEM *item) 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 688010a..63d8c42 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 @@ -35,7 +35,7 @@ /* FUNCTION RELEASE */ /* */ /* _ux_host_class_hid_report_set PORTABLE C */ -/* 6.0 */ +/* 6.1 */ /* AUTHOR */ /* */ /* Chaoqiong Xiao, Microsoft Corporation */ @@ -75,6 +75,10 @@ /* DATE NAME DESCRIPTION */ /* */ /* 05-19-2020 Chaoqiong Xiao Initial Version 6.0 */ +/* 09-30-2020 Chaoqiong Xiao Modified comment(s), */ +/* verified memset and memcpy */ +/* cases, */ +/* resulting in version 6.1 */ /* */ /**************************************************************************/ UINT _ux_host_class_hid_report_set(UX_HOST_CLASS_HID *hid, UX_HOST_CLASS_HID_CLIENT_REPORT *client_report) @@ -161,7 +165,7 @@ UINT status; { /* We have enough memory to store the raw buffer. */ - _ux_utility_memory_copy(current_report_buffer, client_report -> ux_host_class_hid_client_report_buffer, hid_report -> ux_host_class_hid_report_byte_length); + _ux_utility_memory_copy(current_report_buffer, client_report -> ux_host_class_hid_client_report_buffer, hid_report -> ux_host_class_hid_report_byte_length); /* Use case of memcpy is verified. */ } else { diff --git a/common/usbx_host_classes/src/ux_host_class_hid_resources_free.c b/common/usbx_host_classes/src/ux_host_class_hid_resources_free.c index 2cbacad..b04bb2e 100644 --- a/common/usbx_host_classes/src/ux_host_class_hid_resources_free.c +++ b/common/usbx_host_classes/src/ux_host_class_hid_resources_free.c @@ -35,7 +35,7 @@ /* FUNCTION RELEASE */ /* */ /* _ux_host_class_hid_resources_free PORTABLE C */ -/* 6.0 */ +/* 6.1 */ /* AUTHOR */ /* */ /* Chaoqiong Xiao, Microsoft Corporation */ @@ -65,6 +65,8 @@ /* 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 */ /* */ /**************************************************************************/ UINT _ux_host_class_hid_resources_free(UX_HOST_CLASS_HID *hid) diff --git a/common/usbx_host_classes/src/ux_host_class_hid_transfer_request_completed.c b/common/usbx_host_classes/src/ux_host_class_hid_transfer_request_completed.c index 6082c78..b4f8bb4 100644 --- a/common/usbx_host_classes/src/ux_host_class_hid_transfer_request_completed.c +++ b/common/usbx_host_classes/src/ux_host_class_hid_transfer_request_completed.c @@ -35,7 +35,7 @@ /* FUNCTION RELEASE */ /* */ /* _ux_host_class_hid_transfer_request_completed PORTABLE C */ -/* 6.0 */ +/* 6.1 */ /* AUTHOR */ /* */ /* Chaoqiong Xiao, Microsoft Corporation */ @@ -72,6 +72,8 @@ /* 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 */ /* */ /**************************************************************************/ VOID _ux_host_class_hid_transfer_request_completed(UX_TRANSFER *transfer_request) diff --git a/common/usbx_host_classes/src/ux_host_class_hub_activate.c b/common/usbx_host_classes/src/ux_host_class_hub_activate.c index af25734..404c2dd 100644 --- a/common/usbx_host_classes/src/ux_host_class_hub_activate.c +++ b/common/usbx_host_classes/src/ux_host_class_hub_activate.c @@ -35,7 +35,7 @@ /* FUNCTION RELEASE */ /* */ /* _ux_host_class_hub_activate PORTABLE C */ -/* 6.0 */ +/* 6.1 */ /* AUTHOR */ /* */ /* Chaoqiong Xiao, Microsoft Corporation */ @@ -77,6 +77,10 @@ /* DATE NAME DESCRIPTION */ /* */ /* 05-19-2020 Chaoqiong Xiao Initial Version 6.0 */ +/* 09-30-2020 Chaoqiong Xiao Modified comment(s), */ +/* optimized based on compile */ +/* definitions, */ +/* resulting in version 6.1 */ /* */ /**************************************************************************/ UINT _ux_host_class_hub_activate(UX_HOST_CLASS_COMMAND *command) @@ -87,11 +91,13 @@ UX_HOST_CLASS_HUB *hub; UINT status; +#if UX_MAX_DEVICES > 1 /* We need to make sure that the enumeration thread knows about at least one active HUB instance and the function to call when the thread is awaken. */ _ux_system_host -> ux_system_host_enum_hub_function = _ux_host_class_hub_change_detect; - +#endif + /* The HUB is always activated by the device descriptor and not the instance descriptor. */ device = (UX_DEVICE *) command -> ux_host_class_command_container; diff --git a/common/usbx_host_classes/src/ux_host_class_hub_change_detect.c b/common/usbx_host_classes/src/ux_host_class_hub_change_detect.c index 265a1ec..a2b4bcc 100644 --- a/common/usbx_host_classes/src/ux_host_class_hub_change_detect.c +++ b/common/usbx_host_classes/src/ux_host_class_hub_change_detect.c @@ -35,7 +35,7 @@ /* FUNCTION RELEASE */ /* */ /* _ux_host_class_hub_change_detect PORTABLE C */ -/* 6.0 */ +/* 6.1 */ /* AUTHOR */ /* */ /* Chaoqiong Xiao, Microsoft Corporation */ @@ -68,6 +68,8 @@ /* 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 */ /* */ /**************************************************************************/ VOID _ux_host_class_hub_change_detect(VOID) diff --git a/common/usbx_host_classes/src/ux_host_class_hub_change_process.c b/common/usbx_host_classes/src/ux_host_class_hub_change_process.c index 6fd50c5..b4a2acc 100644 --- a/common/usbx_host_classes/src/ux_host_class_hub_change_process.c +++ b/common/usbx_host_classes/src/ux_host_class_hub_change_process.c @@ -35,7 +35,7 @@ /* FUNCTION RELEASE */ /* */ /* _ux_host_class_hub_change_process PORTABLE C */ -/* 6.0 */ +/* 6.1 */ /* AUTHOR */ /* */ /* Chaoqiong Xiao, Microsoft Corporation */ @@ -68,6 +68,8 @@ /* 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 */ /* */ /**************************************************************************/ UINT _ux_host_class_hub_change_process(UX_HOST_CLASS_HUB *hub) diff --git a/common/usbx_host_classes/src/ux_host_class_hub_configure.c b/common/usbx_host_classes/src/ux_host_class_hub_configure.c index f5efdf5..111bbd2 100644 --- a/common/usbx_host_classes/src/ux_host_class_hub_configure.c +++ b/common/usbx_host_classes/src/ux_host_class_hub_configure.c @@ -35,7 +35,7 @@ /* FUNCTION RELEASE */ /* */ /* _ux_host_class_hub_configure PORTABLE C */ -/* 6.0 */ +/* 6.1 */ /* AUTHOR */ /* */ /* Chaoqiong Xiao, Microsoft Corporation */ @@ -75,6 +75,10 @@ /* DATE NAME DESCRIPTION */ /* */ /* 05-19-2020 Chaoqiong Xiao Initial Version 6.0 */ +/* 09-30-2020 Chaoqiong Xiao Modified comment(s), */ +/* optimized based on compile */ +/* definitions, */ +/* resulting in version 6.1 */ /* */ /**************************************************************************/ UINT _ux_host_class_hub_configure(UX_HOST_CLASS_HUB *hub) @@ -83,10 +87,12 @@ UINT _ux_host_class_hub_configure(UX_HOST_CLASS_HUB *hub) UINT status; UX_CONFIGURATION *configuration; UX_DEVICE *device; -UX_DEVICE *parent_device; UX_ENDPOINT *control_endpoint; UCHAR *device_status_data; UX_TRANSFER *transfer_request; +#if UX_MAX_DEVICES > 1 +UX_DEVICE *parent_device; +#endif /* A HUB normally has one configuration. So retrieve the 1st configuration @@ -96,9 +102,6 @@ UX_TRANSFER *transfer_request; /* Get the device container for this configuration. */ device = configuration -> ux_configuration_device; - /* Get the parent container for this device. */ - parent_device = device -> ux_device_parent; - /* To find the true source of the HUB power source, we need to do a GET_STATUS of the device. */ control_endpoint = &device -> ux_device_control_endpoint; @@ -148,12 +151,16 @@ UX_TRANSFER *transfer_request; /* Return an error. */ return(UX_CONNECTION_INCOMPATIBLE); } - + +#if UX_MAX_DEVICES > 1 /* Check the HUB power source and check the parent power source for incompatible connections. */ if (hub -> ux_host_class_hub_device -> ux_device_power_source == UX_DEVICE_BUS_POWERED) { + /* Get the parent container for this device. */ + parent_device = device -> ux_device_parent; + /* If the device is NULL, the parent is the root HUB and we don't have to worry if the parent is not the root HUB, check for its power source. */ if ((parent_device != UX_NULL) && (parent_device -> ux_device_power_source == UX_DEVICE_BUS_POWERED)) @@ -168,7 +175,8 @@ UX_TRANSFER *transfer_request; return(UX_CONNECTION_INCOMPATIBLE); } } - +#endif + /* We have the valid configuration. Ask the USBX stack to set this configuration. */ status = _ux_host_stack_device_configuration_select(configuration); 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 ed4ef2d..d3d46fc 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.0 */ +/* 6.1 */ /* AUTHOR */ /* */ /* Chaoqiong Xiao, Microsoft Corporation */ @@ -74,6 +74,10 @@ /* DATE NAME DESCRIPTION */ /* */ /* 05-19-2020 Chaoqiong Xiao Initial Version 6.0 */ +/* 09-30-2020 Chaoqiong Xiao Modified comment(s), */ +/* optimized based on compile */ +/* definitions, */ +/* resulting in version 6.1 */ /* */ /**************************************************************************/ UINT _ux_host_class_hub_deactivate(UX_HOST_CLASS_COMMAND *command) @@ -89,7 +93,7 @@ UINT port_index; hub = (UX_HOST_CLASS_HUB *) command -> ux_host_class_command_instance; /* Get the HCD used by this instance. */ - hcd = hub -> ux_host_class_hub_device -> ux_device_hcd; + hcd = UX_DEVICE_HCD_GET(hub -> ux_host_class_hub_device); /* The HUB is being shut down. */ hub -> ux_host_class_hub_state = UX_HOST_CLASS_INSTANCE_SHUTDOWN; 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 449e8a6..2001386 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 @@ -35,7 +35,7 @@ /* FUNCTION RELEASE */ /* */ /* _ux_host_class_hub_descriptor_get PORTABLE C */ -/* 6.0 */ +/* 6.1 */ /* AUTHOR */ /* */ /* Chaoqiong Xiao, Microsoft Corporation */ @@ -70,6 +70,10 @@ /* DATE NAME DESCRIPTION */ /* */ /* 05-19-2020 Chaoqiong Xiao Initial Version 6.0 */ +/* 09-30-2020 Chaoqiong Xiao Modified comment(s), */ +/* optimized based on compile */ +/* definitions, */ +/* resulting in version 6.1 */ /* */ /**************************************************************************/ UINT _ux_host_class_hub_descriptor_get(UX_HOST_CLASS_HUB *hub) @@ -79,7 +83,9 @@ UCHAR *descriptor; UX_ENDPOINT *control_endpoint; UX_TRANSFER *transfer_request; UINT status; +#if UX_MAX_DEVICES > 1 ULONG port_index; +#endif /* We need to get the default control endpoint transfer request pointer. */ @@ -110,6 +116,7 @@ ULONG port_index; if (transfer_request -> ux_transfer_request_actual_length == UX_HUB_DESCRIPTOR_LENGTH) { +#if UX_MAX_DEVICES > 1 /* Parse the device descriptor and create the local descriptor. */ _ux_utility_descriptor_parse(descriptor, _ux_system_hub_descriptor_structure, UX_HUB_DESCRIPTOR_ENTRIES, (UCHAR *) &hub -> ux_host_class_hub_descriptor); @@ -159,6 +166,7 @@ ULONG port_index; /* We should never get here. In this case the protocol value of the HUB is illegal. */ status = UX_DESCRIPTOR_CORRUPTED; } +#endif /* #if UX_MAX_DEVICES > 1 */ } else { 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 991612a..d6fbccb 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 @@ -35,7 +35,7 @@ /* FUNCTION RELEASE */ /* */ /* _ux_host_class_hub_entry PORTABLE C */ -/* 6.0 */ +/* 6.1 */ /* AUTHOR */ /* */ /* Chaoqiong Xiao, Microsoft Corporation */ @@ -68,6 +68,10 @@ /* DATE NAME DESCRIPTION */ /* */ /* 05-19-2020 Chaoqiong Xiao Initial Version 6.0 */ +/* 09-30-2020 Chaoqiong Xiao Modified comment(s), */ +/* used query usage of device */ +/* ClassSubclassProtocol, */ +/* resulting in version 6.1 */ /* */ /**************************************************************************/ UINT _ux_host_class_hub_entry(UX_HOST_CLASS_COMMAND *command) @@ -85,7 +89,7 @@ UINT status; /* The query command is used to let the stack enumeration process know if we want to own this device or not. */ - if ((command -> ux_host_class_command_usage == UX_HOST_CLASS_COMMAND_USAGE_CSP) && + if ((command -> ux_host_class_command_usage == UX_HOST_CLASS_COMMAND_USAGE_DCSP) && (command -> ux_host_class_command_class == UX_HOST_CLASS_HUB_CLASS)) return(UX_SUCCESS); else diff --git a/common/usbx_host_classes/src/ux_host_class_hub_feature.c b/common/usbx_host_classes/src/ux_host_class_hub_feature.c index fbf64d3..1e73979 100644 --- a/common/usbx_host_classes/src/ux_host_class_hub_feature.c +++ b/common/usbx_host_classes/src/ux_host_class_hub_feature.c @@ -35,7 +35,7 @@ /* FUNCTION RELEASE */ /* */ /* _ux_host_class_hub_feature PORTABLE C */ -/* 6.0 */ +/* 6.1 */ /* AUTHOR */ /* */ /* Chaoqiong Xiao, Microsoft Corporation */ @@ -69,6 +69,8 @@ /* 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 */ /* */ /**************************************************************************/ UINT _ux_host_class_hub_feature(UX_HOST_CLASS_HUB *hub, UINT port, UINT command, UINT function) diff --git a/common/usbx_host_classes/src/ux_host_class_hub_hub_change_process.c b/common/usbx_host_classes/src/ux_host_class_hub_hub_change_process.c index b386998..8409624 100644 --- a/common/usbx_host_classes/src/ux_host_class_hub_hub_change_process.c +++ b/common/usbx_host_classes/src/ux_host_class_hub_hub_change_process.c @@ -35,7 +35,7 @@ /* FUNCTION RELEASE */ /* */ /* _ux_host_class_hub_hub_change_process PORTABLE C */ -/* 6.0 */ +/* 6.1 */ /* AUTHOR */ /* */ /* Chaoqiong Xiao, Microsoft Corporation */ @@ -66,6 +66,8 @@ /* 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 */ /* */ /**************************************************************************/ UINT _ux_host_class_hub_hub_change_process(UX_HOST_CLASS_HUB *hub) diff --git a/common/usbx_host_classes/src/ux_host_class_hub_interrupt_endpoint_start.c b/common/usbx_host_classes/src/ux_host_class_hub_interrupt_endpoint_start.c index e82a0f2..4e5a076 100644 --- a/common/usbx_host_classes/src/ux_host_class_hub_interrupt_endpoint_start.c +++ b/common/usbx_host_classes/src/ux_host_class_hub_interrupt_endpoint_start.c @@ -35,7 +35,7 @@ /* FUNCTION RELEASE */ /* */ /* _ux_host_class_hub_interrupt_endpoint_start PORTABLE C */ -/* 6.0 */ +/* 6.1 */ /* AUTHOR */ /* */ /* Chaoqiong Xiao, Microsoft Corporation */ @@ -71,6 +71,8 @@ /* 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 */ /* */ /**************************************************************************/ UINT _ux_host_class_hub_interrupt_endpoint_start(UX_HOST_CLASS_HUB *hub) diff --git a/common/usbx_host_classes/src/ux_host_class_hub_port_change_connection_process.c b/common/usbx_host_classes/src/ux_host_class_hub_port_change_connection_process.c index 20a8831..fb4f7bf 100644 --- a/common/usbx_host_classes/src/ux_host_class_hub_port_change_connection_process.c +++ b/common/usbx_host_classes/src/ux_host_class_hub_port_change_connection_process.c @@ -35,7 +35,7 @@ /* FUNCTION RELEASE */ /* */ /* _ux_host_class_hub_port_change_connection_process PORTABLE C */ -/* 6.0 */ +/* 6.1 */ /* AUTHOR */ /* */ /* Chaoqiong Xiao, Microsoft Corporation */ @@ -73,6 +73,10 @@ /* DATE NAME DESCRIPTION */ /* */ /* 05-19-2020 Chaoqiong Xiao Initial Version 6.0 */ +/* 09-30-2020 Chaoqiong Xiao Modified comment(s), */ +/* optimized based on compile */ +/* definitions, */ +/* resulting in version 6.1 */ /* */ /**************************************************************************/ VOID _ux_host_class_hub_port_change_connection_process(UX_HOST_CLASS_HUB *hub, UINT port, UINT port_status) @@ -90,7 +94,7 @@ USHORT local_port_change; UX_TRACE_IN_LINE_INSERT(UX_TRACE_HOST_CLASS_HUB_PORT_CHANGE_CONNECTION_PROCESS, hub, port, port_status, 0, UX_TRACE_HOST_CLASS_EVENTS, 0, 0) /* Get the HCD used by this instance. */ - hcd = hub -> ux_host_class_hub_device -> ux_device_hcd; + hcd = UX_DEVICE_HCD_GET(hub -> ux_host_class_hub_device); /* If there is a device attached on this HUB, there is a new device and it should be enumerated. */ @@ -160,7 +164,7 @@ USHORT local_port_change; _ux_utility_delay_ms(UX_HOST_CLASS_HUB_ENUMERATION_RESET_RECOVERY_DELAY); /* Perform the device creation. */ - status = _ux_host_stack_new_device_create(hub -> ux_host_class_hub_device -> ux_device_hcd, + status = _ux_host_stack_new_device_create(UX_DEVICE_HCD_GET(hub -> ux_host_class_hub_device), hub -> ux_host_class_hub_device, port, device_speed, port_power); diff --git a/common/usbx_host_classes/src/ux_host_class_hub_port_change_enable_process.c b/common/usbx_host_classes/src/ux_host_class_hub_port_change_enable_process.c index 7a056e2..44c23fd 100644 --- a/common/usbx_host_classes/src/ux_host_class_hub_port_change_enable_process.c +++ b/common/usbx_host_classes/src/ux_host_class_hub_port_change_enable_process.c @@ -35,7 +35,7 @@ /* FUNCTION RELEASE */ /* */ /* _ux_host_class_hub_port_change_enable_process PORTABLE C */ -/* 6.0 */ +/* 6.1 */ /* AUTHOR */ /* */ /* Chaoqiong Xiao, Microsoft Corporation */ @@ -67,6 +67,8 @@ /* 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 */ /* */ /**************************************************************************/ VOID _ux_host_class_hub_port_change_enable_process(UX_HOST_CLASS_HUB *hub, UINT port, UINT port_status) diff --git a/common/usbx_host_classes/src/ux_host_class_hub_port_change_over_current_process.c b/common/usbx_host_classes/src/ux_host_class_hub_port_change_over_current_process.c index ad198bd..30c9ade 100644 --- a/common/usbx_host_classes/src/ux_host_class_hub_port_change_over_current_process.c +++ b/common/usbx_host_classes/src/ux_host_class_hub_port_change_over_current_process.c @@ -35,7 +35,7 @@ /* FUNCTION RELEASE */ /* */ /* _ux_host_class_hub_port_change_over_current_process PORTABLE C */ -/* 6.0 */ +/* 6.1 */ /* AUTHOR */ /* */ /* Chaoqiong Xiao, Microsoft Corporation */ @@ -67,6 +67,8 @@ /* 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 */ /* */ /**************************************************************************/ VOID _ux_host_class_hub_port_change_over_current_process(UX_HOST_CLASS_HUB *hub, UINT port, UINT port_status) diff --git a/common/usbx_host_classes/src/ux_host_class_hub_port_change_process.c b/common/usbx_host_classes/src/ux_host_class_hub_port_change_process.c index 246db51..15d66af 100644 --- a/common/usbx_host_classes/src/ux_host_class_hub_port_change_process.c +++ b/common/usbx_host_classes/src/ux_host_class_hub_port_change_process.c @@ -35,7 +35,7 @@ /* FUNCTION RELEASE */ /* */ /* _ux_host_class_hub_port_change_process PORTABLE C */ -/* 6.0 */ +/* 6.1 */ /* AUTHOR */ /* */ /* Chaoqiong Xiao, Microsoft Corporation */ @@ -76,6 +76,8 @@ /* 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 */ /* */ /**************************************************************************/ UINT _ux_host_class_hub_port_change_process(UX_HOST_CLASS_HUB *hub, UINT port) diff --git a/common/usbx_host_classes/src/ux_host_class_hub_port_change_reset_process.c b/common/usbx_host_classes/src/ux_host_class_hub_port_change_reset_process.c index 733fbe8..3448793 100644 --- a/common/usbx_host_classes/src/ux_host_class_hub_port_change_reset_process.c +++ b/common/usbx_host_classes/src/ux_host_class_hub_port_change_reset_process.c @@ -35,7 +35,7 @@ /* FUNCTION RELEASE */ /* */ /* _ux_host_class_hub_port_change_reset_process PORTABLE C */ -/* 6.0 */ +/* 6.1 */ /* AUTHOR */ /* */ /* Chaoqiong Xiao, Microsoft Corporation */ @@ -67,6 +67,8 @@ /* 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 */ /* */ /**************************************************************************/ VOID _ux_host_class_hub_port_change_reset_process(UX_HOST_CLASS_HUB *hub, UINT port, UINT port_status) diff --git a/common/usbx_host_classes/src/ux_host_class_hub_port_change_suspend_process.c b/common/usbx_host_classes/src/ux_host_class_hub_port_change_suspend_process.c index 270c954..7409358 100644 --- a/common/usbx_host_classes/src/ux_host_class_hub_port_change_suspend_process.c +++ b/common/usbx_host_classes/src/ux_host_class_hub_port_change_suspend_process.c @@ -35,7 +35,7 @@ /* FUNCTION RELEASE */ /* */ /* _ux_host_class_hub_port_change_suspend_process PORTABLE C */ -/* 6.0 */ +/* 6.1 */ /* AUTHOR */ /* */ /* Chaoqiong Xiao, Microsoft Corporation */ @@ -67,6 +67,8 @@ /* 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 */ /* */ /**************************************************************************/ VOID _ux_host_class_hub_port_change_suspend_process(UX_HOST_CLASS_HUB *hub, UINT port, UINT port_status) diff --git a/common/usbx_host_classes/src/ux_host_class_hub_port_reset.c b/common/usbx_host_classes/src/ux_host_class_hub_port_reset.c index 63106ba..3931eea 100644 --- a/common/usbx_host_classes/src/ux_host_class_hub_port_reset.c +++ b/common/usbx_host_classes/src/ux_host_class_hub_port_reset.c @@ -35,7 +35,7 @@ /* FUNCTION RELEASE */ /* */ /* _ux_host_class_hub_port_reset PORTABLE C */ -/* 6.0 */ +/* 6.1 */ /* AUTHOR */ /* */ /* Chaoqiong Xiao, Microsoft Corporation */ @@ -70,6 +70,8 @@ /* 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 */ /* */ /**************************************************************************/ UINT _ux_host_class_hub_port_reset(UX_HOST_CLASS_HUB *hub, UINT port) diff --git a/common/usbx_host_classes/src/ux_host_class_hub_ports_power.c b/common/usbx_host_classes/src/ux_host_class_hub_ports_power.c index a10e458..ddc1127 100644 --- a/common/usbx_host_classes/src/ux_host_class_hub_ports_power.c +++ b/common/usbx_host_classes/src/ux_host_class_hub_ports_power.c @@ -35,7 +35,7 @@ /* FUNCTION RELEASE */ /* */ /* _ux_host_class_hub_ports_power PORTABLE C */ -/* 6.0 */ +/* 6.1 */ /* AUTHOR */ /* */ /* Chaoqiong Xiao, Microsoft Corporation */ @@ -81,6 +81,8 @@ /* 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 */ /* */ /**************************************************************************/ UINT _ux_host_class_hub_ports_power(UX_HOST_CLASS_HUB *hub) diff --git a/common/usbx_host_classes/src/ux_host_class_hub_status_get.c b/common/usbx_host_classes/src/ux_host_class_hub_status_get.c index fb165af..d942346 100644 --- a/common/usbx_host_classes/src/ux_host_class_hub_status_get.c +++ b/common/usbx_host_classes/src/ux_host_class_hub_status_get.c @@ -35,7 +35,7 @@ /* FUNCTION RELEASE */ /* */ /* _ux_host_class_hub_status_get PORTABLE C */ -/* 6.0 */ +/* 6.1 */ /* AUTHOR */ /* */ /* Chaoqiong Xiao, Microsoft Corporation */ @@ -72,6 +72,8 @@ /* 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 */ /* */ /**************************************************************************/ UINT _ux_host_class_hub_status_get(UX_HOST_CLASS_HUB *hub, UINT port, USHORT *port_status, USHORT *port_change) diff --git a/common/usbx_host_classes/src/ux_host_class_hub_transfer_request_completed.c b/common/usbx_host_classes/src/ux_host_class_hub_transfer_request_completed.c index 6addc55..ccdb2e5 100644 --- a/common/usbx_host_classes/src/ux_host_class_hub_transfer_request_completed.c +++ b/common/usbx_host_classes/src/ux_host_class_hub_transfer_request_completed.c @@ -35,7 +35,7 @@ /* FUNCTION RELEASE */ /* */ /* _ux_host_class_hub_transfer_request_completed PORTABLE C */ -/* 6.0 */ +/* 6.1 */ /* AUTHOR */ /* */ /* Chaoqiong Xiao, Microsoft Corporation */ @@ -76,6 +76,8 @@ /* 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 */ /* */ /**************************************************************************/ VOID _ux_host_class_hub_transfer_request_completed(UX_TRANSFER *transfer_request) diff --git a/common/usbx_host_classes/src/ux_host_class_pima_activate.c b/common/usbx_host_classes/src/ux_host_class_pima_activate.c index 4c94a23..bbeda72 100644 --- a/common/usbx_host_classes/src/ux_host_class_pima_activate.c +++ b/common/usbx_host_classes/src/ux_host_class_pima_activate.c @@ -35,7 +35,7 @@ /* FUNCTION RELEASE */ /* */ /* _ux_host_class_pima_activate PORTABLE C */ -/* 6.0 */ +/* 6.1 */ /* AUTHOR */ /* */ /* Chaoqiong Xiao, Microsoft Corporation */ @@ -70,6 +70,8 @@ /* 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 */ /* */ /**************************************************************************/ UINT _ux_host_class_pima_activate(UX_HOST_CLASS_COMMAND *command) 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 2e63ddd..7f8bd65 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.0 */ +/* 6.1 */ /* AUTHOR */ /* */ /* Chaoqiong Xiao, Microsoft Corporation */ @@ -73,6 +73,9 @@ /* DATE NAME DESCRIPTION */ /* */ /* 05-19-2020 Chaoqiong Xiao Initial Version 6.0 */ +/* 09-30-2020 Chaoqiong Xiao Modified comment(s), */ +/* prefixed UX to MS_TO_TICK, */ +/* resulting in version 6.1 */ /* */ /**************************************************************************/ UINT _ux_host_class_pima_command(UX_HOST_CLASS_PIMA *pima, UX_HOST_CLASS_PIMA_COMMAND *command, @@ -136,7 +139,7 @@ UINT status; { /* Wait for the completion of the transfer request. */ - status = _ux_utility_semaphore_get(&transfer_request -> ux_transfer_request_semaphore, MS_TO_TICK(UX_HOST_CLASS_PIMA_CLASS_TRANSFER_TIMEOUT)); + status = _ux_utility_semaphore_get(&transfer_request -> ux_transfer_request_semaphore, UX_MS_TO_TICK(UX_HOST_CLASS_PIMA_CLASS_TRANSFER_TIMEOUT)); /* If the semaphore did not succeed we probably have a time out. */ if (status != UX_SUCCESS) @@ -230,7 +233,7 @@ UINT status; { /* Wait for the completion of the transfer request. */ - status = _ux_utility_semaphore_get(&transfer_request -> ux_transfer_request_semaphore, MS_TO_TICK(UX_HOST_CLASS_PIMA_CLASS_TRANSFER_TIMEOUT)); + status = _ux_utility_semaphore_get(&transfer_request -> ux_transfer_request_semaphore, UX_MS_TO_TICK(UX_HOST_CLASS_PIMA_CLASS_TRANSFER_TIMEOUT)); /* If the semaphore did not succeed we probably have a time out. */ if (status != UX_SUCCESS) diff --git a/common/usbx_host_classes/src/ux_host_class_pima_configure.c b/common/usbx_host_classes/src/ux_host_class_pima_configure.c index 90411f9..2b2fc05 100644 --- a/common/usbx_host_classes/src/ux_host_class_pima_configure.c +++ b/common/usbx_host_classes/src/ux_host_class_pima_configure.c @@ -35,7 +35,7 @@ /* FUNCTION RELEASE */ /* */ /* _ux_host_class_pima_configure PORTABLE C */ -/* 6.0 */ +/* 6.1 */ /* AUTHOR */ /* */ /* Chaoqiong Xiao, Microsoft Corporation */ @@ -70,6 +70,10 @@ /* DATE NAME DESCRIPTION */ /* */ /* 05-19-2020 Chaoqiong Xiao Initial Version 6.0 */ +/* 09-30-2020 Chaoqiong Xiao Modified comment(s), */ +/* optimized based on compile */ +/* definitions, */ +/* resulting in version 6.1 */ /* */ /**************************************************************************/ UINT _ux_host_class_pima_configure(UX_HOST_CLASS_PIMA *pima) @@ -77,7 +81,9 @@ UINT _ux_host_class_pima_configure(UX_HOST_CLASS_PIMA *pima) UINT status; UX_CONFIGURATION *configuration; +#if UX_MAX_DEVICES > 1 UX_DEVICE *parent_device; +#endif /* If the device has been configured already, we don't need to do it @@ -99,7 +105,8 @@ UX_DEVICE *parent_device; return(UX_CONFIGURATION_HANDLE_UNKNOWN); } - + +#if UX_MAX_DEVICES > 1 /* Check the pima power source and check the parent power source for incompatible connections. */ if (pima -> ux_host_class_pima_device -> ux_device_power_source == UX_DEVICE_BUS_POWERED) @@ -122,7 +129,8 @@ UX_DEVICE *parent_device; return(UX_CONNECTION_INCOMPATIBLE); } } - +#endif + /* We have the valid configuration. Ask the USBX stack to set this configuration. */ status = _ux_host_stack_device_configuration_select(configuration); if (status != UX_SUCCESS) 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 09fb56a..7fd22aa 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.0 */ +/* 6.1 */ /* AUTHOR */ /* */ /* Chaoqiong Xiao, Microsoft Corporation */ @@ -71,6 +71,8 @@ /* 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 */ /* */ /**************************************************************************/ UINT _ux_host_class_pima_deactivate(UX_HOST_CLASS_COMMAND *command) 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 5aa9be2..7d70474 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.0 */ +/* 6.1 */ /* AUTHOR */ /* */ /* Chaoqiong Xiao, Microsoft Corporation */ @@ -72,6 +72,10 @@ /* DATE NAME DESCRIPTION */ /* */ /* 05-19-2020 Chaoqiong Xiao Initial Version 6.0 */ +/* 09-30-2020 Chaoqiong Xiao Modified comment(s), */ +/* verified memset and memcpy */ +/* cases, */ +/* resulting in version 6.1 */ /* */ /**************************************************************************/ UINT _ux_host_class_pima_device_info_get(UX_HOST_CLASS_PIMA *pima, @@ -144,7 +148,7 @@ UINT status; { /* Copy that string into the object description field. */ - _ux_utility_memory_copy(pima_device -> ux_host_class_pima_device_vendor_extension_desc, device_pointer, unicode_string_length); + _ux_utility_memory_copy(pima_device -> ux_host_class_pima_device_vendor_extension_desc, device_pointer, unicode_string_length); /* Use case of memcpy is verified. */ /* Point to the next field. */ device_pointer += unicode_string_length + 1; @@ -170,7 +174,7 @@ UINT status; { /* Copy the array of supported operations. */ - _ux_utility_memory_copy(pima_device -> ux_host_class_pima_device_operations_supported, device_pointer, array_length); + _ux_utility_memory_copy(pima_device -> ux_host_class_pima_device_operations_supported, device_pointer, array_length); /* Use case of memcpy is verified. */ /* Point to the next field. */ device_pointer += array_length; @@ -190,7 +194,7 @@ UINT status; { /* Copy the array of events supported. */ - _ux_utility_memory_copy(pima_device -> ux_host_class_pima_device_events_supported, device_pointer, array_length); + _ux_utility_memory_copy(pima_device -> ux_host_class_pima_device_events_supported, device_pointer, array_length); /* Use case of memcpy is verified. */ /* Point to the next field. */ device_pointer += array_length; @@ -210,7 +214,7 @@ UINT status; { /* Copy the array of device properties. */ - _ux_utility_memory_copy(pima_device -> ux_host_class_pima_device_properties_supported, device_pointer, array_length); + _ux_utility_memory_copy(pima_device -> ux_host_class_pima_device_properties_supported, device_pointer, array_length); /* Use case of memcpy is verified. */ /* Point to the next field. */ device_pointer += array_length; @@ -230,7 +234,7 @@ UINT status; { /* Copy the array of capture formats. */ - _ux_utility_memory_copy(pima_device -> ux_host_class_pima_device_capture_formats, device_pointer, array_length); + _ux_utility_memory_copy(pima_device -> ux_host_class_pima_device_capture_formats, device_pointer, array_length); /* Use case of memcpy is verified. */ /* Point to the next field. */ device_pointer += array_length; @@ -250,7 +254,7 @@ UINT status; { /* Copy the array of supported operations. */ - _ux_utility_memory_copy(pima_device -> ux_host_class_pima_device_image_formats, device_pointer, array_length); + _ux_utility_memory_copy(pima_device -> ux_host_class_pima_device_image_formats, device_pointer, array_length); /* Use case of memcpy is verified. */ /* Point to the next field. */ device_pointer += array_length; @@ -270,7 +274,7 @@ UINT status; { /* Copy that string into the manufacturer field. */ - _ux_utility_memory_copy(pima_device -> ux_host_class_pima_device_manufacturer, device_pointer, unicode_string_length); + _ux_utility_memory_copy(pima_device -> ux_host_class_pima_device_manufacturer, device_pointer, unicode_string_length); /* Use case of memcpy is verified. */ /* Point to the next field. */ device_pointer += unicode_string_length + 1; @@ -290,7 +294,7 @@ UINT status; { /* Copy that string into the model date field. */ - _ux_utility_memory_copy(pima_device -> ux_host_class_pima_device_model, device_pointer, unicode_string_length); + _ux_utility_memory_copy(pima_device -> ux_host_class_pima_device_model, device_pointer, unicode_string_length); /* Use case of memcpy is verified. */ /* Point to the next field. */ device_pointer += unicode_string_length + 1; @@ -310,7 +314,7 @@ UINT status; { /* Copy that string into the version field. */ - _ux_utility_memory_copy(pima_device -> ux_host_class_pima_device_version, device_pointer, unicode_string_length); + _ux_utility_memory_copy(pima_device -> ux_host_class_pima_device_version, device_pointer, unicode_string_length); /* Use case of memcpy is verified. */ /* Point to the next field. */ device_pointer += unicode_string_length + 1; @@ -329,7 +333,7 @@ UINT status; if (status == UX_SUCCESS) /* Copy that string into the serial number field. */ - _ux_utility_memory_copy(pima_device -> ux_host_class_pima_device_serial_number, device_pointer, unicode_string_length); + _ux_utility_memory_copy(pima_device -> ux_host_class_pima_device_serial_number, device_pointer, unicode_string_length); /* Use case of memcpy is verified. */ else { diff --git a/common/usbx_host_classes/src/ux_host_class_pima_device_reset.c b/common/usbx_host_classes/src/ux_host_class_pima_device_reset.c index 24cc876..8d9268c 100644 --- a/common/usbx_host_classes/src/ux_host_class_pima_device_reset.c +++ b/common/usbx_host_classes/src/ux_host_class_pima_device_reset.c @@ -35,7 +35,7 @@ /* FUNCTION RELEASE */ /* */ /* _ux_host_class_pima_device_reset PORTABLE C */ -/* 6.0 */ +/* 6.1 */ /* AUTHOR */ /* */ /* Chaoqiong Xiao, Microsoft Corporation */ @@ -64,6 +64,8 @@ /* 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 */ /* */ /**************************************************************************/ UINT _ux_host_class_pima_device_reset(UX_HOST_CLASS_PIMA *pima) diff --git a/common/usbx_host_classes/src/ux_host_class_pima_endpoints_get.c b/common/usbx_host_classes/src/ux_host_class_pima_endpoints_get.c index abbd09e..0a8c499 100644 --- a/common/usbx_host_classes/src/ux_host_class_pima_endpoints_get.c +++ b/common/usbx_host_classes/src/ux_host_class_pima_endpoints_get.c @@ -35,7 +35,7 @@ /* FUNCTION RELEASE */ /* */ /* _ux_host_class_pima_endpoints_get PORTABLE C */ -/* 6.0 */ +/* 6.1 */ /* AUTHOR */ /* */ /* Chaoqiong Xiao, Microsoft Corporation */ @@ -66,6 +66,8 @@ /* 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 */ /* */ /**************************************************************************/ UINT _ux_host_class_pima_endpoints_get(UX_HOST_CLASS_PIMA *pima) diff --git a/common/usbx_host_classes/src/ux_host_class_pima_entry.c b/common/usbx_host_classes/src/ux_host_class_pima_entry.c index 909931a..83b57e3 100644 --- a/common/usbx_host_classes/src/ux_host_class_pima_entry.c +++ b/common/usbx_host_classes/src/ux_host_class_pima_entry.c @@ -35,7 +35,7 @@ /* FUNCTION RELEASE */ /* */ /* _ux_host_class_pima_entry PORTABLE C */ -/* 6.0 */ +/* 6.1 */ /* AUTHOR */ /* */ /* Chaoqiong Xiao, Microsoft Corporation */ @@ -69,6 +69,8 @@ /* 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 */ /* */ /**************************************************************************/ UINT _ux_host_class_pima_entry(UX_HOST_CLASS_COMMAND *command) diff --git a/common/usbx_host_classes/src/ux_host_class_pima_notification.c b/common/usbx_host_classes/src/ux_host_class_pima_notification.c index e7d60a3..5e735a1 100644 --- a/common/usbx_host_classes/src/ux_host_class_pima_notification.c +++ b/common/usbx_host_classes/src/ux_host_class_pima_notification.c @@ -35,7 +35,7 @@ /* FUNCTION RELEASE */ /* */ /* _ux_host_class_pima_notification PORTABLE C */ -/* 6.0 */ +/* 6.1 */ /* AUTHOR */ /* */ /* Chaoqiong Xiao, Microsoft Corporation */ @@ -70,6 +70,10 @@ /* DATE NAME DESCRIPTION */ /* */ /* 05-19-2020 Chaoqiong Xiao Initial Version 6.0 */ +/* 09-30-2020 Chaoqiong Xiao Modified comment(s), */ +/* verified memset and memcpy */ +/* cases, */ +/* resulting in version 6.1 */ /* */ /**************************************************************************/ VOID _ux_host_class_pima_notification(UX_TRANSFER *transfer_request) @@ -127,7 +131,7 @@ UX_HOST_CLASS_PIMA_EVENT pima_event; /* We copy the current payload into our event notification buffer. */ _ux_utility_memory_copy(pima -> ux_host_class_pima_event_buffer_current_offset, transfer_request -> ux_transfer_request_data_pointer, - transfer_request -> ux_transfer_request_actual_length); + transfer_request -> ux_transfer_request_actual_length); /* Use case of memcpy is verified. */ /* Set the new offset address. */ pima -> ux_host_class_pima_event_buffer_current_offset += transfer_request -> ux_transfer_request_actual_length; 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 1131219..9fd1ada 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 @@ -34,8 +34,8 @@ /* */ /* FUNCTION RELEASE */ /* */ -/* _ux_host_class_pima_num_object_get PORTABLE C */ -/* 6.0 */ +/* _ux_host_class_pima_num_objects_get PORTABLE C */ +/* 6.1 */ /* AUTHOR */ /* */ /* Chaoqiong Xiao, Microsoft Corporation */ @@ -66,6 +66,8 @@ /* 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 */ /* */ /**************************************************************************/ UINT _ux_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 d6843d7..17dc49b 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 @@ -35,7 +35,7 @@ /* FUNCTION RELEASE */ /* */ /* _ux_host_class_pima_object_close PORTABLE C */ -/* 6.0 */ +/* 6.1 */ /* AUTHOR */ /* */ /* Chaoqiong Xiao, Microsoft Corporation */ @@ -70,6 +70,9 @@ /* DATE NAME DESCRIPTION */ /* */ /* 05-19-2020 Chaoqiong Xiao Initial Version 6.0 */ +/* 09-30-2020 Chaoqiong Xiao Modified comment(s), */ +/* prefixed UX to MS_TO_TICK, */ +/* resulting in version 6.1 */ /* */ /**************************************************************************/ UINT _ux_host_class_pima_object_close(UX_HOST_CLASS_PIMA *pima, @@ -140,7 +143,7 @@ UINT status; { /* Wait for the completion of the transfer request. */ - status = _ux_utility_semaphore_get(&transfer_request -> ux_transfer_request_semaphore, MS_TO_TICK(UX_HOST_CLASS_PIMA_CLASS_TRANSFER_TIMEOUT)); + status = _ux_utility_semaphore_get(&transfer_request -> ux_transfer_request_semaphore, UX_MS_TO_TICK(UX_HOST_CLASS_PIMA_CLASS_TRANSFER_TIMEOUT)); /* If the semaphore did not succeed we probably have a time out. */ if (status != UX_SUCCESS) @@ -182,7 +185,7 @@ UINT status; { /* Wait for the completion of the transfer request. */ - status = _ux_utility_semaphore_get(&transfer_request -> ux_transfer_request_semaphore, MS_TO_TICK(UX_HOST_CLASS_PIMA_CLASS_TRANSFER_TIMEOUT)); + status = _ux_utility_semaphore_get(&transfer_request -> ux_transfer_request_semaphore, UX_MS_TO_TICK(UX_HOST_CLASS_PIMA_CLASS_TRANSFER_TIMEOUT)); /* If the semaphore did not succeed we probably have a time out. */ if (status != UX_SUCCESS) diff --git a/common/usbx_host_classes/src/ux_host_class_pima_object_copy.c b/common/usbx_host_classes/src/ux_host_class_pima_object_copy.c index b97375f..3016f1d 100644 --- a/common/usbx_host_classes/src/ux_host_class_pima_object_copy.c +++ b/common/usbx_host_classes/src/ux_host_class_pima_object_copy.c @@ -35,7 +35,7 @@ /* FUNCTION RELEASE */ /* */ /* _ux_host_class_pima_object_copy PORTABLE C */ -/* 6.0 */ +/* 6.1 */ /* AUTHOR */ /* */ /* Chaoqiong Xiao, Microsoft Corporation */ @@ -69,6 +69,8 @@ /* 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 */ /* */ /**************************************************************************/ UINT _ux_host_class_pima_object_copy(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 e7341f3..a0bf7fe 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 @@ -35,7 +35,7 @@ /* FUNCTION RELEASE */ /* */ /* _ux_host_class_pima_object_delete PORTABLE C */ -/* 6.0 */ +/* 6.1 */ /* AUTHOR */ /* */ /* Chaoqiong Xiao, Microsoft Corporation */ @@ -70,6 +70,8 @@ /* 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 */ /* */ /**************************************************************************/ UINT _ux_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 21c66cd..c86686c 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 @@ -35,7 +35,7 @@ /* FUNCTION RELEASE */ /* */ /* _ux_host_class_pima_object_get PORTABLE C */ -/* 6.0 */ +/* 6.1 */ /* AUTHOR */ /* */ /* Chaoqiong Xiao, Microsoft Corporation */ @@ -77,6 +77,11 @@ /* DATE NAME DESCRIPTION */ /* */ /* 05-19-2020 Chaoqiong Xiao Initial Version 6.0 */ +/* 09-30-2020 Chaoqiong Xiao Modified comment(s), */ +/* prefixed UX to MS_TO_TICK, */ +/* verified memset and memcpy */ +/* cases, */ +/* resulting in version 6.1 */ /* */ /**************************************************************************/ UINT _ux_host_class_pima_object_get(UX_HOST_CLASS_PIMA *pima, @@ -174,7 +179,7 @@ UINT status; { /* Wait for the completion of the transfer request. */ - status = _ux_utility_semaphore_get(&transfer_request -> ux_transfer_request_semaphore, MS_TO_TICK(UX_HOST_CLASS_PIMA_CLASS_TRANSFER_TIMEOUT)); + status = _ux_utility_semaphore_get(&transfer_request -> ux_transfer_request_semaphore, UX_MS_TO_TICK(UX_HOST_CLASS_PIMA_CLASS_TRANSFER_TIMEOUT)); /* If the semaphore did not succeed we probably have a time out. */ if (status != UX_SUCCESS || transfer_request -> ux_transfer_request_completion_code != UX_SUCCESS) @@ -234,7 +239,7 @@ UINT status; { /* Wait for the completion of the transfer request. */ - status = _ux_utility_semaphore_get(&transfer_request -> ux_transfer_request_semaphore, MS_TO_TICK(UX_HOST_CLASS_PIMA_CLASS_TRANSFER_TIMEOUT)); + status = _ux_utility_semaphore_get(&transfer_request -> ux_transfer_request_semaphore, UX_MS_TO_TICK(UX_HOST_CLASS_PIMA_CLASS_TRANSFER_TIMEOUT)); /* If the semaphore did not succeed we probably have a time out. */ if (status != UX_SUCCESS || transfer_request -> ux_transfer_request_completion_code != UX_SUCCESS) @@ -269,7 +274,7 @@ UINT status; /* We need to skip the header. Copying the necessary partial memory only. */ _ux_utility_memory_copy(object_buffer, ptp_payload + UX_HOST_CLASS_PIMA_DATA_HEADER_SIZE, - transfer_request -> ux_transfer_request_actual_length - UX_HOST_CLASS_PIMA_DATA_HEADER_SIZE); + transfer_request -> ux_transfer_request_actual_length - UX_HOST_CLASS_PIMA_DATA_HEADER_SIZE); /* Use case of memcpy is verified. */ /* Get the size of the entire data payload to be expected in this object transfer (data + header). If the size is on a boundary the pima protocol demands that the last packet is a ZLP. */ @@ -357,7 +362,7 @@ UINT status; { /* Wait for the completion of the transfer request. */ - status = _ux_utility_semaphore_get(&transfer_request -> ux_transfer_request_semaphore, MS_TO_TICK(UX_HOST_CLASS_PIMA_CLASS_TRANSFER_TIMEOUT)); + status = _ux_utility_semaphore_get(&transfer_request -> ux_transfer_request_semaphore, UX_MS_TO_TICK(UX_HOST_CLASS_PIMA_CLASS_TRANSFER_TIMEOUT)); /* If the semaphore did not succeed we probably have a time out. */ if (status != UX_SUCCESS || transfer_request -> ux_transfer_request_completion_code != UX_SUCCESS) 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 447a7dd..353ec6e 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 @@ -34,8 +34,8 @@ /* */ /* FUNCTION RELEASE */ /* */ -/* _ux_host_class_pima_storage_ids_get PORTABLE C */ -/* 6.0 */ +/* _ux_host_class_pima_object_handles_get PORTABLE C */ +/* 6.1 */ /* AUTHOR */ /* */ /* Chaoqiong Xiao, Microsoft Corporation */ @@ -78,6 +78,8 @@ /* 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 */ /* */ /**************************************************************************/ UINT _ux_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 dc52b40..73974c8 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.0 */ +/* 6.1 */ /* AUTHOR */ /* */ /* Chaoqiong Xiao, Microsoft Corporation */ @@ -72,6 +72,10 @@ /* DATE NAME DESCRIPTION */ /* */ /* 05-19-2020 Chaoqiong Xiao Initial Version 6.0 */ +/* 09-30-2020 Chaoqiong Xiao Modified comment(s), */ +/* verified memset and memcpy */ +/* cases, */ +/* resulting in version 6.1 */ /* */ /**************************************************************************/ UINT _ux_host_class_pima_object_info_get(UX_HOST_CLASS_PIMA *pima, @@ -146,7 +150,7 @@ UINT status; { /* Copy that string into the object description field. */ - _ux_utility_memory_copy(object -> ux_host_class_pima_object_filename, object_pointer, unicode_string_length); + _ux_utility_memory_copy(object -> ux_host_class_pima_object_filename, object_pointer, unicode_string_length); /* Use case of memcpy is verified. */ /* Point to the next field. */ object_pointer += unicode_string_length; @@ -166,7 +170,7 @@ UINT status; { /* Copy that string into the capture date field. */ - _ux_utility_memory_copy(object -> ux_host_class_pima_object_capture_date, object_pointer, unicode_string_length); + _ux_utility_memory_copy(object -> ux_host_class_pima_object_capture_date, object_pointer, unicode_string_length); /* Use case of memcpy is verified. */ /* Point to the next field. */ object_pointer += unicode_string_length; @@ -186,7 +190,7 @@ UINT status; { /* Copy that string into the modification date field. */ - _ux_utility_memory_copy(object -> ux_host_class_pima_object_modification_date, object_pointer, unicode_string_length); + _ux_utility_memory_copy(object -> ux_host_class_pima_object_modification_date, object_pointer, unicode_string_length); /* Use case of memcpy is verified. */ /* Point to the next field. */ object_pointer += unicode_string_length; @@ -206,7 +210,7 @@ UINT status; { /* Copy that string into the keywords field. */ - _ux_utility_memory_copy(object -> ux_host_class_pima_object_keywords, object_pointer, unicode_string_length); + _ux_utility_memory_copy(object -> ux_host_class_pima_object_keywords, object_pointer, unicode_string_length); /* Use case of memcpy is verified. */ /* Make the object closed. */ object -> ux_host_class_pima_object_state = UX_HOST_CLASS_PIMA_OBJECT_STATE_CLOSED; 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 863090a..1d375dd 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.0 */ +/* 6.1 */ /* AUTHOR */ /* */ /* Chaoqiong Xiao, Microsoft Corporation */ @@ -74,6 +74,10 @@ /* DATE NAME DESCRIPTION */ /* */ /* 05-19-2020 Chaoqiong Xiao Initial Version 6.0 */ +/* 09-30-2020 Chaoqiong Xiao Modified comment(s), */ +/* verified memset and memcpy */ +/* cases, */ +/* resulting in version 6.1 */ /* */ /**************************************************************************/ UINT _ux_host_class_pima_object_info_send(UX_HOST_CLASS_PIMA *pima, @@ -155,7 +159,7 @@ UINT status; { /* Copy that string into the object description field. */ - _ux_utility_memory_copy(object_pointer, object -> ux_host_class_pima_object_filename, unicode_string_length); + _ux_utility_memory_copy(object_pointer, object -> ux_host_class_pima_object_filename, unicode_string_length); /* Use case of memcpy is verified. */ /* Point to the next field. */ object_pointer += unicode_string_length; @@ -175,7 +179,7 @@ UINT status; { /* Copy that string into the capture date field. */ - _ux_utility_memory_copy(object_pointer, object -> ux_host_class_pima_object_capture_date, unicode_string_length); + _ux_utility_memory_copy(object_pointer, object -> ux_host_class_pima_object_capture_date, unicode_string_length); /* Use case of memcpy is verified. */ /* Point to the next field. */ object_pointer += unicode_string_length; @@ -195,7 +199,7 @@ UINT status; { /* Copy that string into the modification date field. */ - _ux_utility_memory_copy(object_pointer, object -> ux_host_class_pima_object_modification_date, unicode_string_length); + _ux_utility_memory_copy(object_pointer, object -> ux_host_class_pima_object_modification_date, unicode_string_length); /* Use case of memcpy is verified. */ /* Point to the next field. */ object_pointer += unicode_string_length; @@ -215,7 +219,7 @@ UINT status; { /* Copy that string into the keywords field. */ - _ux_utility_memory_copy(object_pointer, object -> ux_host_class_pima_object_keywords, unicode_string_length); + _ux_utility_memory_copy(object_pointer, object -> ux_host_class_pima_object_keywords, unicode_string_length); /* Use case of memcpy is verified. */ /* Point to the next field. */ object_pointer += unicode_string_length; diff --git a/common/usbx_host_classes/src/ux_host_class_pima_object_move.c b/common/usbx_host_classes/src/ux_host_class_pima_object_move.c index 46768a2..fd6f4d7 100644 --- a/common/usbx_host_classes/src/ux_host_class_pima_object_move.c +++ b/common/usbx_host_classes/src/ux_host_class_pima_object_move.c @@ -35,7 +35,7 @@ /* FUNCTION RELEASE */ /* */ /* _ux_host_class_pima_object_move PORTABLE C */ -/* 6.0 */ +/* 6.1 */ /* AUTHOR */ /* */ /* Chaoqiong Xiao, Microsoft Corporation */ @@ -69,6 +69,8 @@ /* 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 */ /* */ /**************************************************************************/ UINT _ux_host_class_pima_object_move(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 b8e0569..75d8560 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 @@ -35,7 +35,7 @@ /* FUNCTION RELEASE */ /* */ /* _ux_host_class_pima_object_open PORTABLE C */ -/* 6.0 */ +/* 6.1 */ /* AUTHOR */ /* */ /* Chaoqiong Xiao, Microsoft Corporation */ @@ -67,6 +67,8 @@ /* 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 */ /* */ /**************************************************************************/ UINT _ux_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 a2cf18c..de8b8e0 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 @@ -35,7 +35,7 @@ /* FUNCTION RELEASE */ /* */ /* _ux_host_class_pima_object_send PORTABLE C */ -/* 6.0 */ +/* 6.1 */ /* AUTHOR */ /* */ /* Chaoqiong Xiao, Microsoft Corporation */ @@ -78,6 +78,11 @@ /* DATE NAME DESCRIPTION */ /* */ /* 05-19-2020 Chaoqiong Xiao Initial Version 6.0 */ +/* 09-30-2020 Chaoqiong Xiao Modified comment(s), */ +/* prefixed UX to MS_TO_TICK, */ +/* verified memset and memcpy */ +/* cases, */ +/* resulting in version 6.1 */ /* */ /**************************************************************************/ UINT _ux_host_class_pima_object_send(UX_HOST_CLASS_PIMA *pima, @@ -163,7 +168,7 @@ UINT status; { /* Wait for the completion of the transfer request. */ - status = _ux_utility_semaphore_get(&transfer_request -> ux_transfer_request_semaphore, MS_TO_TICK(UX_HOST_CLASS_PIMA_CLASS_TRANSFER_TIMEOUT)); + status = _ux_utility_semaphore_get(&transfer_request -> ux_transfer_request_semaphore, UX_MS_TO_TICK(UX_HOST_CLASS_PIMA_CLASS_TRANSFER_TIMEOUT)); /* If the semaphore did not succeed we probably have a time out. */ if (status != UX_SUCCESS) @@ -233,7 +238,7 @@ UINT status; /* We need to skip the header. Copying the necessary partial memory only. */ _ux_utility_memory_copy(ptp_payload + UX_HOST_CLASS_PIMA_DATA_HEADER_SIZE, object_buffer, - requested_length - UX_HOST_CLASS_PIMA_DATA_HEADER_SIZE); + requested_length - UX_HOST_CLASS_PIMA_DATA_HEADER_SIZE); /* Use case of memcpy is verified. */ /* Update the offset. */ object -> ux_host_class_pima_object_offset += requested_length - UX_HOST_CLASS_PIMA_DATA_HEADER_SIZE; @@ -256,7 +261,7 @@ UINT status; { /* Wait for the completion of the transfer request. */ - status = _ux_utility_semaphore_get(&transfer_request -> ux_transfer_request_semaphore, MS_TO_TICK(UX_HOST_CLASS_PIMA_CLASS_TRANSFER_TIMEOUT)); + status = _ux_utility_semaphore_get(&transfer_request -> ux_transfer_request_semaphore, UX_MS_TO_TICK(UX_HOST_CLASS_PIMA_CLASS_TRANSFER_TIMEOUT)); /* If the semaphore did not succeed we probably have a time out. */ if (status != UX_SUCCESS) @@ -324,7 +329,7 @@ UINT status; { /* Wait for the completion of the transfer request. */ - status = _ux_utility_semaphore_get(&transfer_request -> ux_transfer_request_semaphore, MS_TO_TICK(UX_HOST_CLASS_PIMA_CLASS_TRANSFER_TIMEOUT)); + status = _ux_utility_semaphore_get(&transfer_request -> ux_transfer_request_semaphore, UX_MS_TO_TICK(UX_HOST_CLASS_PIMA_CLASS_TRANSFER_TIMEOUT)); /* If the semaphore did not succeed we probably have a time out. */ if (status != UX_SUCCESS) 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 1663b0d..4216741 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 @@ -35,7 +35,7 @@ /* FUNCTION RELEASE */ /* */ /* _ux_host_class_pima_object_transfer_abort PORTABLE C */ -/* 6.0 */ +/* 6.1 */ /* AUTHOR */ /* */ /* Chaoqiong Xiao, Microsoft Corporation */ @@ -67,6 +67,8 @@ /* 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 */ /* */ /**************************************************************************/ UINT _ux_host_class_pima_object_transfer_abort(UX_HOST_CLASS_PIMA *pima, diff --git a/common/usbx_host_classes/src/ux_host_class_pima_read.c b/common/usbx_host_classes/src/ux_host_class_pima_read.c index d775fcd..ee272a3 100644 --- a/common/usbx_host_classes/src/ux_host_class_pima_read.c +++ b/common/usbx_host_classes/src/ux_host_class_pima_read.c @@ -30,12 +30,16 @@ #include "ux_host_stack.h" +#if UX_SLAVE_REQUEST_DATA_MAX_LENGTH < UX_HOST_CLASS_PIMA_CONTAINER_SIZE +#error UX_SLAVE_REQUEST_DATA_MAX_LENGTH too small, please check +#endif + /**************************************************************************/ /* */ /* FUNCTION RELEASE */ /* */ /* _ux_host_class_pima_read PORTABLE C */ -/* 6.0 */ +/* 6.1 */ /* AUTHOR */ /* */ /* Chaoqiong Xiao, Microsoft Corporation */ @@ -78,6 +82,11 @@ /* DATE NAME DESCRIPTION */ /* */ /* 05-19-2020 Chaoqiong Xiao Initial Version 6.0 */ +/* 09-30-2020 Chaoqiong Xiao Modified comment(s), */ +/* prefixed UX to MS_TO_TICK, */ +/* verified memset and memcpy */ +/* cases, */ +/* resulting in version 6.1 */ /* */ /**************************************************************************/ UINT _ux_host_class_pima_read(UX_HOST_CLASS_PIMA *pima, UCHAR *data_pointer, @@ -117,7 +126,7 @@ ULONG payload_length; { /* Wait for the completion of the transfer request. */ - status = _ux_utility_semaphore_get(&transfer_request -> ux_transfer_request_semaphore, MS_TO_TICK(UX_HOST_CLASS_PIMA_CLASS_TRANSFER_TIMEOUT)); + status = _ux_utility_semaphore_get(&transfer_request -> ux_transfer_request_semaphore, UX_MS_TO_TICK(UX_HOST_CLASS_PIMA_CLASS_TRANSFER_TIMEOUT)); /* If the semaphore did not succeed we probably have a time out. */ if (status != UX_SUCCESS) @@ -171,7 +180,7 @@ ULONG payload_length; /* Copying the necessary partial memory. */ _ux_utility_memory_copy(data_pointer, ptp_payload + UX_HOST_CLASS_PIMA_DATA_HEADER_SIZE, - transfer_request -> ux_transfer_request_actual_length - UX_HOST_CLASS_PIMA_DATA_HEADER_SIZE); + transfer_request -> ux_transfer_request_actual_length - UX_HOST_CLASS_PIMA_DATA_HEADER_SIZE); /* Use case of memcpy is verified. */ /* Adjust the data payload pointer. */ data_pointer += (transfer_request -> ux_transfer_request_actual_length - UX_HOST_CLASS_PIMA_DATA_HEADER_SIZE); @@ -202,7 +211,7 @@ ULONG payload_length; { /* Wait for the completion of the transfer request. */ - status = _ux_utility_semaphore_get(&transfer_request -> ux_transfer_request_semaphore, MS_TO_TICK(UX_HOST_CLASS_PIMA_CLASS_TRANSFER_TIMEOUT)); + status = _ux_utility_semaphore_get(&transfer_request -> ux_transfer_request_semaphore, UX_MS_TO_TICK(UX_HOST_CLASS_PIMA_CLASS_TRANSFER_TIMEOUT)); /* If the semaphore did not succeed we probably have a time out. */ if (status != UX_SUCCESS) @@ -257,7 +266,7 @@ ULONG payload_length; { /* Wait for the completion of the transfer request. */ - status = _ux_utility_semaphore_get(&transfer_request -> ux_transfer_request_semaphore, MS_TO_TICK(UX_HOST_CLASS_PIMA_CLASS_TRANSFER_TIMEOUT)); + status = _ux_utility_semaphore_get(&transfer_request -> ux_transfer_request_semaphore, UX_MS_TO_TICK(UX_HOST_CLASS_PIMA_CLASS_TRANSFER_TIMEOUT)); /* If the semaphore did not succeed we probably have a time out. */ if (status != UX_SUCCESS) diff --git a/common/usbx_host_classes/src/ux_host_class_pima_request_cancel.c b/common/usbx_host_classes/src/ux_host_class_pima_request_cancel.c index 892ca76..728c2da 100644 --- a/common/usbx_host_classes/src/ux_host_class_pima_request_cancel.c +++ b/common/usbx_host_classes/src/ux_host_class_pima_request_cancel.c @@ -35,7 +35,7 @@ /* FUNCTION RELEASE */ /* */ /* _ux_host_class_pima_request_cancel PORTABLE C */ -/* 6.0 */ +/* 6.1 */ /* AUTHOR */ /* */ /* Chaoqiong Xiao, Microsoft Corporation */ @@ -70,6 +70,8 @@ /* 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 */ /* */ /**************************************************************************/ UINT _ux_host_class_pima_request_cancel(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 8f8ed6a..e982f8d 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 @@ -34,8 +34,8 @@ /* */ /* FUNCTION RELEASE */ /* */ -/* _ux_host_class_pima_session_close PORTABLE C */ -/* 6.0 */ +/* _ux_host_class_pima_session_close PORTABLE C */ +/* 6.1 */ /* AUTHOR */ /* */ /* Chaoqiong Xiao, Microsoft Corporation */ @@ -65,6 +65,8 @@ /* 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 */ /* */ /**************************************************************************/ UINT _ux_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 e72a481..1964c96 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 @@ -34,8 +34,8 @@ /* */ /* FUNCTION RELEASE */ /* */ -/* _ux_host_class_pima_session_open PORTABLE C */ -/* 6.0 */ +/* _ux_host_class_pima_session_open PORTABLE C */ +/* 6.1 */ /* AUTHOR */ /* */ /* Chaoqiong Xiao, Microsoft Corporation */ @@ -67,6 +67,8 @@ /* 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 */ /* */ /**************************************************************************/ UINT _ux_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 ace2003..72798be 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 @@ -36,7 +36,7 @@ UX_HOST_CLASS_PIMA_STORAGE_IDS_LENGTH_ASSERT /* FUNCTION RELEASE */ /* */ /* _ux_host_class_pima_storage_ids_get PORTABLE C */ -/* 6.0 */ +/* 6.1 */ /* AUTHOR */ /* */ /* Chaoqiong Xiao, Microsoft Corporation */ @@ -71,6 +71,8 @@ UX_HOST_CLASS_PIMA_STORAGE_IDS_LENGTH_ASSERT /* 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 */ /* */ /**************************************************************************/ UINT _ux_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 3f60e0a..d073e2b 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.0 */ +/* 6.1 */ /* AUTHOR */ /* */ /* Chaoqiong Xiao, Microsoft Corporation */ @@ -71,6 +71,10 @@ /* DATE NAME DESCRIPTION */ /* */ /* 05-19-2020 Chaoqiong Xiao Initial Version 6.0 */ +/* 09-30-2020 Chaoqiong Xiao Modified comment(s), */ +/* verified memset and memcpy */ +/* cases, */ +/* resulting in version 6.1 */ /* */ /**************************************************************************/ UINT _ux_host_class_pima_storage_info_get(UX_HOST_CLASS_PIMA *pima, @@ -135,7 +139,7 @@ ULONG unicode_string_length; unicode_string_length = (ULONG) *storage_pointer ; /* Copy that string into the storage description field. */ - _ux_utility_memory_copy(storage -> ux_host_class_pima_storage_description, storage_pointer, unicode_string_length); + _ux_utility_memory_copy(storage -> ux_host_class_pima_storage_description, storage_pointer, unicode_string_length); /* Use case of memcpy is verified. */ /* Point to the volume label. */ storage_pointer = storage_buffer + UX_HOST_CLASS_PIMA_STORAGE_VARIABLE_OFFSET + unicode_string_length; @@ -144,7 +148,7 @@ ULONG unicode_string_length; unicode_string_length = (ULONG) *storage_pointer ; /* Copy that string into the storage volume label field. */ - _ux_utility_memory_copy(storage -> ux_host_class_pima_storage_description, storage_pointer, unicode_string_length); + _ux_utility_memory_copy(storage -> ux_host_class_pima_storage_volume_label, storage_pointer, unicode_string_length); /* Use case of memcpy is verified. */ } 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 457aa87..dbdbc26 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 @@ -35,7 +35,7 @@ /* FUNCTION RELEASE */ /* */ /* _ux_host_class_pima_thumb_get PORTABLE C */ -/* 6.0 */ +/* 6.1 */ /* AUTHOR */ /* */ /* Chaoqiong Xiao, Microsoft Corporation */ @@ -76,6 +76,11 @@ /* DATE NAME DESCRIPTION */ /* */ /* 05-19-2020 Chaoqiong Xiao Initial Version 6.0 */ +/* 09-30-2020 Chaoqiong Xiao Modified comment(s), */ +/* prefixed UX to MS_TO_TICK, */ +/* verified memset and memcpy */ +/* cases, */ +/* resulting in version 6.1 */ /* */ /**************************************************************************/ UINT _ux_host_class_pima_thumb_get(UX_HOST_CLASS_PIMA *pima, @@ -172,7 +177,7 @@ UINT status; { /* Wait for the completion of the transfer request. */ - status = _ux_utility_semaphore_get(&transfer_request -> ux_transfer_request_semaphore, MS_TO_TICK(UX_HOST_CLASS_PIMA_CLASS_TRANSFER_TIMEOUT)); + status = _ux_utility_semaphore_get(&transfer_request -> ux_transfer_request_semaphore, UX_MS_TO_TICK(UX_HOST_CLASS_PIMA_CLASS_TRANSFER_TIMEOUT)); /* If the semaphore did not succeed we probably have a time out. */ if (status != UX_SUCCESS) @@ -228,7 +233,7 @@ UINT status; { /* Wait for the completion of the transfer request. */ - status = _ux_utility_semaphore_get(&transfer_request -> ux_transfer_request_semaphore, MS_TO_TICK(UX_HOST_CLASS_PIMA_CLASS_TRANSFER_TIMEOUT)); + status = _ux_utility_semaphore_get(&transfer_request -> ux_transfer_request_semaphore, UX_MS_TO_TICK(UX_HOST_CLASS_PIMA_CLASS_TRANSFER_TIMEOUT)); /* If the semaphore did not succeed we probably have a time out. */ if (status != UX_SUCCESS) @@ -271,7 +276,7 @@ UINT status; /* We need to skip the header. Copying the necessary partial memory only. */ _ux_utility_memory_copy(thumb_buffer, ptp_payload + UX_HOST_CLASS_PIMA_DATA_HEADER_SIZE, - transfer_request -> ux_transfer_request_actual_length - UX_HOST_CLASS_PIMA_DATA_HEADER_SIZE); + transfer_request -> ux_transfer_request_actual_length - UX_HOST_CLASS_PIMA_DATA_HEADER_SIZE); /* Use case of memcpy is verified. */ /* Update the actual length. */ *thumb_actual_length = transfer_request -> ux_transfer_request_actual_length - UX_HOST_CLASS_PIMA_DATA_HEADER_SIZE; @@ -319,7 +324,7 @@ UINT status; { /* Wait for the completion of the transfer request. */ - status = _ux_utility_semaphore_get(&transfer_request -> ux_transfer_request_semaphore, MS_TO_TICK(UX_HOST_CLASS_PIMA_CLASS_TRANSFER_TIMEOUT)); + status = _ux_utility_semaphore_get(&transfer_request -> ux_transfer_request_semaphore, UX_MS_TO_TICK(UX_HOST_CLASS_PIMA_CLASS_TRANSFER_TIMEOUT)); /* If the semaphore did not succeed we probably have a time out. */ if (status != UX_SUCCESS) diff --git a/common/usbx_host_classes/src/ux_host_class_pima_write.c b/common/usbx_host_classes/src/ux_host_class_pima_write.c index 2c464d8..60129e6 100644 --- a/common/usbx_host_classes/src/ux_host_class_pima_write.c +++ b/common/usbx_host_classes/src/ux_host_class_pima_write.c @@ -35,7 +35,7 @@ /* FUNCTION RELEASE */ /* */ /* _ux_host_class_pima_write PORTABLE C */ -/* 6.0 */ +/* 6.1 */ /* AUTHOR */ /* */ /* Chaoqiong Xiao, Microsoft Corporation */ @@ -77,6 +77,11 @@ /* DATE NAME DESCRIPTION */ /* */ /* 05-19-2020 Chaoqiong Xiao Initial Version 6.0 */ +/* 09-30-2020 Chaoqiong Xiao Modified comment(s), */ +/* prefixed UX to MS_TO_TICK, */ +/* verified memset and memcpy */ +/* cases, */ +/* resulting in version 6.1 */ /* */ /**************************************************************************/ UINT _ux_host_class_pima_write(UX_HOST_CLASS_PIMA *pima, UCHAR *data_pointer, @@ -140,7 +145,7 @@ ULONG payload_length; /* Add the data payload to fill that container. */ _ux_utility_memory_copy(ptp_payload + UX_HOST_CLASS_PIMA_DATA_HEADER_SIZE, data_pointer, - requested_length - UX_HOST_CLASS_PIMA_DATA_HEADER_SIZE); + requested_length - UX_HOST_CLASS_PIMA_DATA_HEADER_SIZE); /* Use case of memcpy is verified. */ /* Initialize the transfer of that container. */ transfer_request -> ux_transfer_request_requested_length = requested_length; @@ -153,7 +158,7 @@ ULONG payload_length; { /* Wait for the completion of the transfer request. */ - status = _ux_utility_semaphore_get(&transfer_request -> ux_transfer_request_semaphore, MS_TO_TICK(UX_HOST_CLASS_PIMA_CLASS_TRANSFER_TIMEOUT)); + status = _ux_utility_semaphore_get(&transfer_request -> ux_transfer_request_semaphore, UX_MS_TO_TICK(UX_HOST_CLASS_PIMA_CLASS_TRANSFER_TIMEOUT)); /* If the semaphore did not succeed we probably have a time out. */ if (status != UX_SUCCESS) @@ -212,7 +217,7 @@ ULONG payload_length; { /* Wait for the completion of the transfer request. */ - status = _ux_utility_semaphore_get(&transfer_request -> ux_transfer_request_semaphore, MS_TO_TICK(UX_HOST_CLASS_PIMA_CLASS_TRANSFER_TIMEOUT)); + status = _ux_utility_semaphore_get(&transfer_request -> ux_transfer_request_semaphore, UX_MS_TO_TICK(UX_HOST_CLASS_PIMA_CLASS_TRANSFER_TIMEOUT)); /* If the semaphore did not succeed we probably have a time out. */ if (status != UX_SUCCESS) @@ -267,7 +272,7 @@ ULONG payload_length; { /* Wait for the completion of the transfer request. */ - status = _ux_utility_semaphore_get(&transfer_request -> ux_transfer_request_semaphore, MS_TO_TICK(UX_HOST_CLASS_PIMA_CLASS_TRANSFER_TIMEOUT)); + status = _ux_utility_semaphore_get(&transfer_request -> ux_transfer_request_semaphore, UX_MS_TO_TICK(UX_HOST_CLASS_PIMA_CLASS_TRANSFER_TIMEOUT)); /* If the semaphore did not succeed we probably have a time out. */ if (status != UX_SUCCESS) diff --git a/common/usbx_host_classes/src/ux_host_class_printer_activate.c b/common/usbx_host_classes/src/ux_host_class_printer_activate.c index 2cc8787..c23eefc 100644 --- a/common/usbx_host_classes/src/ux_host_class_printer_activate.c +++ b/common/usbx_host_classes/src/ux_host_class_printer_activate.c @@ -35,7 +35,7 @@ /* FUNCTION RELEASE */ /* */ /* _ux_host_class_printer_activate PORTABLE C */ -/* 6.0 */ +/* 6.1 */ /* AUTHOR */ /* */ /* Chaoqiong Xiao, Microsoft Corporation */ @@ -72,6 +72,8 @@ /* 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 */ /* */ /**************************************************************************/ UINT _ux_host_class_printer_activate(UX_HOST_CLASS_COMMAND *command) diff --git a/common/usbx_host_classes/src/ux_host_class_printer_configure.c b/common/usbx_host_classes/src/ux_host_class_printer_configure.c index 00b7d1d..1069d47 100644 --- a/common/usbx_host_classes/src/ux_host_class_printer_configure.c +++ b/common/usbx_host_classes/src/ux_host_class_printer_configure.c @@ -35,7 +35,7 @@ /* FUNCTION RELEASE */ /* */ /* _ux_host_class_printer_configure PORTABLE C */ -/* 6.0 */ +/* 6.1 */ /* AUTHOR */ /* */ /* Chaoqiong Xiao, Microsoft Corporation */ @@ -69,6 +69,10 @@ /* DATE NAME DESCRIPTION */ /* */ /* 05-19-2020 Chaoqiong Xiao Initial Version 6.0 */ +/* 09-30-2020 Chaoqiong Xiao Modified comment(s), */ +/* optimized based on compile */ +/* definitions, */ +/* resulting in version 6.1 */ /* */ /**************************************************************************/ UINT _ux_host_class_printer_configure(UX_HOST_CLASS_PRINTER *printer) @@ -76,7 +80,9 @@ UINT _ux_host_class_printer_configure(UX_HOST_CLASS_PRINTER *printer) UINT status; UX_CONFIGURATION *configuration; +#if UX_MAX_DEVICES > 1 UX_DEVICE *parent_device; +#endif /* If the device has been configured already, we don't need to do it @@ -98,7 +104,8 @@ UX_DEVICE *parent_device; return(UX_CONFIGURATION_HANDLE_UNKNOWN); } - + +#if UX_MAX_DEVICES > 1 /* Check the printer power source and check the parent power source for incompatible connections. */ if (printer -> ux_host_class_printer_device -> ux_device_power_source == UX_DEVICE_BUS_POWERED) @@ -121,7 +128,8 @@ UX_DEVICE *parent_device; return(UX_CONNECTION_INCOMPATIBLE); } } - +#endif + /* We have the valid configuration. Ask the USBX stack to set this configuration. */ status = _ux_host_stack_device_configuration_select(configuration); if (status != UX_SUCCESS) diff --git a/common/usbx_host_classes/src/ux_host_class_printer_deactivate.c b/common/usbx_host_classes/src/ux_host_class_printer_deactivate.c index 1327c57..bfe648b 100644 --- a/common/usbx_host_classes/src/ux_host_class_printer_deactivate.c +++ b/common/usbx_host_classes/src/ux_host_class_printer_deactivate.c @@ -35,7 +35,7 @@ /* FUNCTION RELEASE */ /* */ /* _ux_host_class_printer_deactivate PORTABLE C */ -/* 6.0 */ +/* 6.1 */ /* AUTHOR */ /* */ /* Chaoqiong Xiao, Microsoft Corporation */ @@ -73,6 +73,8 @@ /* 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 */ /* */ /**************************************************************************/ UINT _ux_host_class_printer_deactivate(UX_HOST_CLASS_COMMAND *command) diff --git a/common/usbx_host_classes/src/ux_host_class_printer_endpoints_get.c b/common/usbx_host_classes/src/ux_host_class_printer_endpoints_get.c index 6e86543..ba8114a 100644 --- a/common/usbx_host_classes/src/ux_host_class_printer_endpoints_get.c +++ b/common/usbx_host_classes/src/ux_host_class_printer_endpoints_get.c @@ -35,7 +35,7 @@ /* FUNCTION RELEASE */ /* */ /* _ux_host_class_printer_endpoints_get PORTABLE C */ -/* 6.0 */ +/* 6.1 */ /* AUTHOR */ /* */ /* Chaoqiong Xiao, Microsoft Corporation */ @@ -66,6 +66,8 @@ /* 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 */ /* */ /**************************************************************************/ UINT _ux_host_class_printer_endpoints_get(UX_HOST_CLASS_PRINTER *printer) diff --git a/common/usbx_host_classes/src/ux_host_class_printer_entry.c b/common/usbx_host_classes/src/ux_host_class_printer_entry.c index ee7fa18..8ee7c02 100644 --- a/common/usbx_host_classes/src/ux_host_class_printer_entry.c +++ b/common/usbx_host_classes/src/ux_host_class_printer_entry.c @@ -35,7 +35,7 @@ /* FUNCTION RELEASE */ /* */ /* _ux_host_class_printer_entry PORTABLE C */ -/* 6.0 */ +/* 6.1 */ /* AUTHOR */ /* */ /* Chaoqiong Xiao, Microsoft Corporation */ @@ -68,6 +68,8 @@ /* 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 */ /* */ /**************************************************************************/ UINT _ux_host_class_printer_entry(UX_HOST_CLASS_COMMAND *command) 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 74d2e7a..073ffc7 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 @@ -35,7 +35,7 @@ /* FUNCTION RELEASE */ /* */ /* _ux_host_class_printer_name_get PORTABLE C */ -/* 6.0 */ +/* 6.1 */ /* AUTHOR */ /* */ /* Chaoqiong Xiao, Microsoft Corporation */ @@ -71,6 +71,10 @@ /* DATE NAME DESCRIPTION */ /* */ /* 05-19-2020 Chaoqiong Xiao Initial Version 6.0 */ +/* 09-30-2020 Chaoqiong Xiao Modified comment(s), */ +/* verified memset and memcpy */ +/* cases, */ +/* resulting in version 6.1 */ /* */ /**************************************************************************/ UINT _ux_host_class_printer_name_get(UX_HOST_CLASS_PRINTER *printer) @@ -163,7 +167,7 @@ UINT printer_name_length; { /* Use the generic USB printer name. */ - _ux_utility_memory_copy(printer -> ux_host_class_printer_name, UX_HOST_CLASS_PRINTER_GENERIC_NAME, 11); + _ux_utility_memory_copy(printer -> ux_host_class_printer_name, UX_HOST_CLASS_PRINTER_GENERIC_NAME, 11); /* Use case of memcpy is verified. */ } else { 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 42a1076..122bfb9 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 @@ -35,7 +35,7 @@ /* FUNCTION RELEASE */ /* */ /* _ux_host_class_printer_read PORTABLE C */ -/* 6.0 */ +/* 6.1 */ /* AUTHOR */ /* */ /* Chaoqiong Xiao, Microsoft Corporation */ @@ -76,6 +76,9 @@ /* DATE NAME DESCRIPTION */ /* */ /* 05-19-2020 Chaoqiong Xiao Initial Version 6.0 */ +/* 09-30-2020 Chaoqiong Xiao Modified comment(s), */ +/* prefixed UX to MS_TO_TICK, */ +/* resulting in version 6.1 */ /* */ /**************************************************************************/ UINT _ux_host_class_printer_read (UX_HOST_CLASS_PRINTER *printer, UCHAR *data_pointer, @@ -156,7 +159,7 @@ ULONG transfer_request_length; { /* Wait for the completion of the transfer_request. */ - status = _ux_utility_semaphore_get(&transfer_request -> ux_transfer_request_semaphore, MS_TO_TICK(UX_HOST_CLASS_PRINTER_CLASS_TRANSFER_TIMEOUT)); + status = _ux_utility_semaphore_get(&transfer_request -> ux_transfer_request_semaphore, UX_MS_TO_TICK(UX_HOST_CLASS_PRINTER_CLASS_TRANSFER_TIMEOUT)); /* If the semaphore did not succeed we probably have a time out. */ if (status != UX_SUCCESS) 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 450ce8d..3058896 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 @@ -35,7 +35,7 @@ /* FUNCTION RELEASE */ /* */ /* _ux_host_class_printer_soft_reset PORTABLE C */ -/* 6.0 */ +/* 6.1 */ /* AUTHOR */ /* */ /* Chaoqiong Xiao, Microsoft Corporation */ @@ -68,6 +68,8 @@ /* 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 */ /* */ /**************************************************************************/ UINT _ux_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 da8f071..164490c 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 @@ -35,7 +35,7 @@ /* FUNCTION RELEASE */ /* */ /* _ux_host_class_printer_status_get PORTABLE C */ -/* 6.0 */ +/* 6.1 */ /* AUTHOR */ /* */ /* Chaoqiong Xiao, Microsoft Corporation */ @@ -73,6 +73,8 @@ /* 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 */ /* */ /**************************************************************************/ UINT _ux_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 8fb6c6f..52f4c73 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 @@ -35,7 +35,7 @@ /* FUNCTION RELEASE */ /* */ /* _ux_host_class_printer_write PORTABLE C */ -/* 6.0 */ +/* 6.1 */ /* AUTHOR */ /* */ /* Chaoqiong Xiao, Microsoft Corporation */ @@ -73,6 +73,9 @@ /* DATE NAME DESCRIPTION */ /* */ /* 05-19-2020 Chaoqiong Xiao Initial Version 6.0 */ +/* 09-30-2020 Chaoqiong Xiao Modified comment(s), */ +/* prefixed UX to MS_TO_TICK, */ +/* resulting in version 6.1 */ /* */ /**************************************************************************/ UINT _ux_host_class_printer_write(UX_HOST_CLASS_PRINTER *printer, UCHAR * data_pointer, @@ -135,7 +138,7 @@ ULONG transfer_request_length; { /* Wait for the completion of the transfer request. */ - status = _ux_utility_semaphore_get(&transfer_request -> ux_transfer_request_semaphore, MS_TO_TICK(UX_HOST_CLASS_PRINTER_CLASS_TRANSFER_TIMEOUT)); + status = _ux_utility_semaphore_get(&transfer_request -> ux_transfer_request_semaphore, UX_MS_TO_TICK(UX_HOST_CLASS_PRINTER_CLASS_TRANSFER_TIMEOUT)); /* If the semaphore did not succeed we probably have a time out. */ if (status != UX_SUCCESS) diff --git a/common/usbx_host_classes/src/ux_host_class_prolific_activate.c b/common/usbx_host_classes/src/ux_host_class_prolific_activate.c index 44883af..b8d26a6 100644 --- a/common/usbx_host_classes/src/ux_host_class_prolific_activate.c +++ b/common/usbx_host_classes/src/ux_host_class_prolific_activate.c @@ -35,7 +35,7 @@ /* FUNCTION RELEASE */ /* */ /* _ux_host_class_prolific_activate PORTABLE C */ -/* 6.0 */ +/* 6.1 */ /* AUTHOR */ /* */ /* Chaoqiong Xiao, Microsoft Corporation */ @@ -73,6 +73,8 @@ /* 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 */ /* */ /**************************************************************************/ UINT _ux_host_class_prolific_activate(UX_HOST_CLASS_COMMAND *command) 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 8d8551f..c6d7f1e 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.0 */ +/* 6.1 */ /* AUTHOR */ /* */ /* Chaoqiong Xiao, Microsoft Corporation */ @@ -77,6 +77,8 @@ /* 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 */ /* */ /**************************************************************************/ UINT _ux_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 576aac0..cdb7909 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.0 */ +/* 6.1 */ /* AUTHOR */ /* */ /* Chaoqiong Xiao, Microsoft Corporation */ @@ -70,6 +70,10 @@ /* DATE NAME DESCRIPTION */ /* */ /* 05-19-2020 Chaoqiong Xiao Initial Version 6.0 */ +/* 09-30-2020 Chaoqiong Xiao Modified comment(s), */ +/* optimized based on compile */ +/* definitions, */ +/* resulting in version 6.1 */ /* */ /**************************************************************************/ UINT _ux_host_class_prolific_configure(UX_HOST_CLASS_PROLIFIC *prolific) @@ -77,7 +81,9 @@ UINT _ux_host_class_prolific_configure(UX_HOST_CLASS_PROLIFIC *prolific) UINT status; UX_CONFIGURATION *configuration; +#if UX_MAX_DEVICES > 1 UX_DEVICE *parent_device; +#endif /* If the device has been configured already, we don't need to do it @@ -99,7 +105,8 @@ UX_DEVICE *parent_device; return(UX_CONFIGURATION_HANDLE_UNKNOWN); } - + +#if UX_MAX_DEVICES > 1 /* Check the prolific power source and check the parent power source for incompatible connections. */ if (prolific -> ux_host_class_prolific_device -> ux_device_power_source == UX_DEVICE_BUS_POWERED) @@ -122,7 +129,8 @@ UX_DEVICE *parent_device; return(UX_CONNECTION_INCOMPATIBLE); } } - +#endif + /* We have the valid configuration. Ask the USBX stack to set this configuration. */ status = _ux_host_stack_device_configuration_select(configuration); if (status != UX_SUCCESS) diff --git a/common/usbx_host_classes/src/ux_host_class_prolific_deactivate.c b/common/usbx_host_classes/src/ux_host_class_prolific_deactivate.c index 9b168a1..1a3e68a 100644 --- a/common/usbx_host_classes/src/ux_host_class_prolific_deactivate.c +++ b/common/usbx_host_classes/src/ux_host_class_prolific_deactivate.c @@ -35,7 +35,7 @@ /* FUNCTION RELEASE */ /* */ /* _ux_host_class_prolific_deactivate PORTABLE C */ -/* 6.0 */ +/* 6.1 */ /* AUTHOR */ /* */ /* Chaoqiong Xiao, Microsoft Corporation */ @@ -73,6 +73,8 @@ /* 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 */ /* */ /**************************************************************************/ UINT _ux_host_class_prolific_deactivate(UX_HOST_CLASS_COMMAND *command) diff --git a/common/usbx_host_classes/src/ux_host_class_prolific_endpoints_get.c b/common/usbx_host_classes/src/ux_host_class_prolific_endpoints_get.c index f4d6463..584f90d 100644 --- a/common/usbx_host_classes/src/ux_host_class_prolific_endpoints_get.c +++ b/common/usbx_host_classes/src/ux_host_class_prolific_endpoints_get.c @@ -35,7 +35,7 @@ /* FUNCTION RELEASE */ /* */ /* _ux_host_class_prolific_endpoints_get PORTABLE C */ -/* 6.0 */ +/* 6.1 */ /* AUTHOR */ /* */ /* Chaoqiong Xiao, Microsoft Corporation */ @@ -69,6 +69,8 @@ /* 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 */ /* */ /**************************************************************************/ UINT _ux_host_class_prolific_endpoints_get(UX_HOST_CLASS_PROLIFIC *prolific) diff --git a/common/usbx_host_classes/src/ux_host_class_prolific_entry.c b/common/usbx_host_classes/src/ux_host_class_prolific_entry.c index 71e72d9..fc84bac 100644 --- a/common/usbx_host_classes/src/ux_host_class_prolific_entry.c +++ b/common/usbx_host_classes/src/ux_host_class_prolific_entry.c @@ -35,7 +35,7 @@ /* FUNCTION RELEASE */ /* */ /* _ux_host_class_prolific_entry PORTABLE C */ -/* 6.0 */ +/* 6.1 */ /* AUTHOR */ /* */ /* Chaoqiong Xiao, Microsoft Corporation */ @@ -69,6 +69,8 @@ /* 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 */ /* */ /**************************************************************************/ UINT _ux_host_class_prolific_entry(UX_HOST_CLASS_COMMAND *command) 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 6bcdb94..e1fbaff 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.0 */ +/* 6.1 */ /* AUTHOR */ /* */ /* Chaoqiong Xiao, Microsoft Corporation */ @@ -75,6 +75,8 @@ /* 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 */ /* */ /**************************************************************************/ UINT _ux_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 37f2a0e..cde7c27 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 @@ -35,7 +35,7 @@ /* FUNCTION RELEASE */ /* */ /* _ux_host_class_prolific_read PORTABLE C */ -/* 6.0 */ +/* 6.1 */ /* AUTHOR */ /* */ /* Chaoqiong Xiao, Microsoft Corporation */ @@ -73,6 +73,9 @@ /* DATE NAME DESCRIPTION */ /* */ /* 05-19-2020 Chaoqiong Xiao Initial Version 6.0 */ +/* 09-30-2020 Chaoqiong Xiao Modified comment(s), */ +/* prefixed UX to MS_TO_TICK, */ +/* resulting in version 6.1 */ /* */ /**************************************************************************/ UINT _ux_host_class_prolific_read (UX_HOST_CLASS_PROLIFIC *prolific, UCHAR *data_pointer, @@ -128,7 +131,7 @@ ULONG transfer_request_length; { /* Wait for the completion of the transfer_request. */ - status = _ux_utility_semaphore_get(&transfer_request -> ux_transfer_request_semaphore, MS_TO_TICK(UX_HOST_CLASS_PROLIFIC_CLASS_TRANSFER_TIMEOUT)); + status = _ux_utility_semaphore_get(&transfer_request -> ux_transfer_request_semaphore, UX_MS_TO_TICK(UX_HOST_CLASS_PROLIFIC_CLASS_TRANSFER_TIMEOUT)); /* If the semaphore did not succeed we probably have a time out. */ if (status != UX_SUCCESS) diff --git a/common/usbx_host_classes/src/ux_host_class_prolific_reception_callback.c b/common/usbx_host_classes/src/ux_host_class_prolific_reception_callback.c index edeff6c..b06470c 100644 --- a/common/usbx_host_classes/src/ux_host_class_prolific_reception_callback.c +++ b/common/usbx_host_classes/src/ux_host_class_prolific_reception_callback.c @@ -35,7 +35,7 @@ /* FUNCTION RELEASE */ /* */ /* _ux_host_class_prolific_reception_callback PORTABLE C */ -/* 6.0 */ +/* 6.1 */ /* AUTHOR */ /* */ /* Chaoqiong Xiao, Microsoft Corporation */ @@ -67,6 +67,8 @@ /* 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 */ /* */ /**************************************************************************/ VOID _ux_host_class_prolific_reception_callback (UX_TRANSFER *transfer_request) 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 d930320..65041c5 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 @@ -35,7 +35,7 @@ /* FUNCTION RELEASE */ /* */ /* _ux_host_class_prolific_reception_start PORTABLE C */ -/* 6.0 */ +/* 6.1 */ /* AUTHOR */ /* */ /* Chaoqiong Xiao, Microsoft Corporation */ @@ -70,6 +70,8 @@ /* 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 */ /* */ /**************************************************************************/ UINT _ux_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 e3bbae3..f73d35c 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 @@ -35,7 +35,7 @@ /* FUNCTION RELEASE */ /* */ /* _ux_host_class_prolific_reception_stop PORTABLE C */ -/* 6.0 */ +/* 6.1 */ /* AUTHOR */ /* */ /* Chaoqiong Xiao, Microsoft Corporation */ @@ -71,6 +71,8 @@ /* 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 */ /* */ /**************************************************************************/ UINT _ux_host_class_prolific_reception_stop (UX_HOST_CLASS_PROLIFIC *prolific, diff --git a/common/usbx_host_classes/src/ux_host_class_prolific_setup.c b/common/usbx_host_classes/src/ux_host_class_prolific_setup.c index 1c5e76d..8d4a91e 100644 --- a/common/usbx_host_classes/src/ux_host_class_prolific_setup.c +++ b/common/usbx_host_classes/src/ux_host_class_prolific_setup.c @@ -35,7 +35,7 @@ /* FUNCTION RELEASE */ /* */ /* _ux_host_class_prolific_setup PORTABLE C */ -/* 6.0 */ +/* 6.1 */ /* AUTHOR */ /* */ /* Chaoqiong Xiao, Microsoft Corporation */ @@ -69,6 +69,8 @@ /* 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 */ /* */ /**************************************************************************/ UINT _ux_host_class_prolific_setup(UX_HOST_CLASS_PROLIFIC *prolific) diff --git a/common/usbx_host_classes/src/ux_host_class_prolific_transfer_request_completed.c b/common/usbx_host_classes/src/ux_host_class_prolific_transfer_request_completed.c index 5bc4a72..8c3a8cb 100644 --- a/common/usbx_host_classes/src/ux_host_class_prolific_transfer_request_completed.c +++ b/common/usbx_host_classes/src/ux_host_class_prolific_transfer_request_completed.c @@ -35,7 +35,7 @@ /* FUNCTION RELEASE */ /* */ /* _ux_host_class_prolific_transfer_request_completed PORTABLE C */ -/* 6.0 */ +/* 6.1 */ /* AUTHOR */ /* */ /* Chaoqiong Xiao, Microsoft Corporation */ @@ -67,6 +67,8 @@ /* 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 */ /* */ /**************************************************************************/ VOID _ux_host_class_prolific_transfer_request_completed(UX_TRANSFER *transfer_request) 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 15f8bc0..ce43ca5 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 @@ -35,7 +35,7 @@ /* FUNCTION RELEASE */ /* */ /* _ux_host_class_prolific_write PORTABLE C */ -/* 6.0 */ +/* 6.1 */ /* AUTHOR */ /* */ /* Chaoqiong Xiao, Microsoft Corporation */ @@ -72,6 +72,9 @@ /* DATE NAME DESCRIPTION */ /* */ /* 05-19-2020 Chaoqiong Xiao Initial Version 6.0 */ +/* 09-30-2020 Chaoqiong Xiao Modified comment(s), */ +/* prefixed UX to MS_TO_TICK, */ +/* resulting in version 6.1 */ /* */ /**************************************************************************/ UINT _ux_host_class_prolific_write(UX_HOST_CLASS_PROLIFIC *prolific, UCHAR *data_pointer, @@ -127,7 +130,7 @@ ULONG transfer_request_length; { /* Wait for the completion of the transfer request. */ - status = _ux_utility_semaphore_get(&transfer_request -> ux_transfer_request_semaphore, MS_TO_TICK(UX_HOST_CLASS_PROLIFIC_CLASS_TRANSFER_TIMEOUT)); + status = _ux_utility_semaphore_get(&transfer_request -> ux_transfer_request_semaphore, UX_MS_TO_TICK(UX_HOST_CLASS_PROLIFIC_CLASS_TRANSFER_TIMEOUT)); /* If the semaphore did not succeed we probably have a time out. */ if (status != UX_SUCCESS) 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 d7fb0d2..4a6be49 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.0 */ +/* 6.1 */ /* AUTHOR */ /* */ /* Chaoqiong Xiao, Microsoft Corporation */ @@ -72,6 +72,8 @@ /* 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 */ /* */ /**************************************************************************/ UINT _ux_host_class_storage_activate(UX_HOST_CLASS_COMMAND *command) diff --git a/common/usbx_host_classes/src/ux_host_class_storage_cbw_initialize.c b/common/usbx_host_classes/src/ux_host_class_storage_cbw_initialize.c index 3892fc3..c056a17 100644 --- a/common/usbx_host_classes/src/ux_host_class_storage_cbw_initialize.c +++ b/common/usbx_host_classes/src/ux_host_class_storage_cbw_initialize.c @@ -35,7 +35,7 @@ /* FUNCTION RELEASE */ /* */ /* _ux_host_class_storage_cbw_initialize PORTABLE C */ -/* 6.0 */ +/* 6.1 */ /* AUTHOR */ /* */ /* Chaoqiong Xiao, Microsoft Corporation */ @@ -71,6 +71,10 @@ /* DATE NAME DESCRIPTION */ /* */ /* 05-19-2020 Chaoqiong Xiao Initial Version 6.0 */ +/* 09-30-2020 Chaoqiong Xiao Modified comment(s), */ +/* verified memset and memcpy */ +/* cases, */ +/* resulting in version 6.1 */ /* */ /**************************************************************************/ VOID _ux_host_class_storage_cbw_initialize(UX_HOST_CLASS_STORAGE *storage, UINT direction, @@ -103,7 +107,7 @@ UCHAR *cbw; *(cbw + UX_HOST_CLASS_STORAGE_CBW_CB_LENGTH) = (UCHAR)command_length; /* Reset the SCSI command block. */ - _ux_utility_memory_set(cbw + UX_HOST_CLASS_STORAGE_CBW_CB, 0, (ULONG) command_length); + _ux_utility_memory_set(cbw + UX_HOST_CLASS_STORAGE_CBW_CB, 0, (ULONG) command_length); /* Use case of memset is verified. */ /* Return to caller. */ return; diff --git a/common/usbx_host_classes/src/ux_host_class_storage_configure.c b/common/usbx_host_classes/src/ux_host_class_storage_configure.c index 62a147a..4bf84bb 100644 --- a/common/usbx_host_classes/src/ux_host_class_storage_configure.c +++ b/common/usbx_host_classes/src/ux_host_class_storage_configure.c @@ -35,7 +35,7 @@ /* FUNCTION RELEASE */ /* */ /* _ux_host_class_storage_configure PORTABLE C */ -/* 6.0 */ +/* 6.1 */ /* AUTHOR */ /* */ /* Chaoqiong Xiao, Microsoft Corporation */ @@ -69,6 +69,10 @@ /* DATE NAME DESCRIPTION */ /* */ /* 05-19-2020 Chaoqiong Xiao Initial Version 6.0 */ +/* 09-30-2020 Chaoqiong Xiao Modified comment(s), */ +/* optimized based on compile */ +/* definitions, */ +/* resulting in version 6.1 */ /* */ /**************************************************************************/ UINT _ux_host_class_storage_configure(UX_HOST_CLASS_STORAGE *storage) @@ -76,7 +80,9 @@ UINT _ux_host_class_storage_configure(UX_HOST_CLASS_STORAGE *storage) UINT status; UX_CONFIGURATION *configuration; +#if UX_MAX_DEVICES > 1 UX_DEVICE *parent_device; +#endif /* If the device has been configured already, we don't need to do it @@ -100,7 +106,8 @@ UX_DEVICE *parent_device; return(UX_CONFIGURATION_HANDLE_UNKNOWN); } - + +#if UX_MAX_DEVICES > 1 /* Check the storage device power source and check the parent power source for incompatible connections. */ if (storage -> ux_host_class_storage_device -> ux_device_power_source == UX_DEVICE_BUS_POWERED) @@ -123,7 +130,8 @@ UX_DEVICE *parent_device; return(UX_CONNECTION_INCOMPATIBLE); } } - +#endif + /* We have the valid configuration. Ask the USBX stack to set this configuration. */ status = _ux_host_stack_device_configuration_select(configuration); if (status != UX_SUCCESS) diff --git a/common/usbx_host_classes/src/ux_host_class_storage_deactivate.c b/common/usbx_host_classes/src/ux_host_class_storage_deactivate.c index 7ab5b0a..4d13624 100644 --- a/common/usbx_host_classes/src/ux_host_class_storage_deactivate.c +++ b/common/usbx_host_classes/src/ux_host_class_storage_deactivate.c @@ -35,7 +35,7 @@ /* FUNCTION RELEASE */ /* */ /* _ux_host_class_storage_deactivate PORTABLE C */ -/* 6.0 */ +/* 6.1 */ /* AUTHOR */ /* */ /* Chaoqiong Xiao, Microsoft Corporation */ @@ -56,7 +56,7 @@ /* */ /* CALLS */ /* */ -/* fx_media_close Close media */ +/* ux_media_close Close media */ /* _ux_host_stack_endpoint_transfer_abort Abort transfer request */ /* _ux_host_stack_class_instance_destroy Destroy class instance */ /* _ux_utility_memory_free Free memory block */ @@ -73,27 +73,38 @@ /* DATE NAME DESCRIPTION */ /* */ /* 05-19-2020 Chaoqiong Xiao Initial Version 6.0 */ +/* 09-30-2020 Chaoqiong Xiao Modified comment(s), */ +/* added option to disable FX */ +/* media integration, used UX_ */ +/* things instead of FX_ */ +/* things directly, used host */ +/* class extension pointer for */ +/* class specific structured */ +/* data, */ +/* resulting in version 6.1 */ /* */ /**************************************************************************/ UINT _ux_host_class_storage_deactivate(UX_HOST_CLASS_COMMAND *command) { UX_HOST_CLASS_STORAGE *storage; -UINT media_index; -FX_MEDIA *media; UX_HOST_CLASS_STORAGE_MEDIA *storage_media; -UX_HOST_CLASS *class; +UX_HOST_CLASS *class_inst; +UINT inst_index; +#if !defined(UX_HOST_CLASS_STORAGE_NO_FILEX) +UX_MEDIA *media; VOID *memory; +#endif /* Get the instance for this class. */ storage = (UX_HOST_CLASS_STORAGE *) command -> ux_host_class_command_instance; /* We need the class container. */ - class = storage -> ux_host_class_storage_class; - + class_inst = storage -> ux_host_class_storage_class; + /* Point the media structure to the first media in the container. */ - storage_media = (UX_HOST_CLASS_STORAGE_MEDIA *) class -> ux_host_class_media; + storage_media = (UX_HOST_CLASS_STORAGE_MEDIA *) class_inst -> ux_host_class_media; /* The storage device is being shut down. */ storage -> ux_host_class_storage_state = UX_HOST_CLASS_INSTANCE_SHUTDOWN; @@ -139,15 +150,17 @@ VOID *memory; endpoints to exit properly. */ _ux_utility_thread_schedule_other(UX_THREAD_PRIORITY_ENUM); - /* Inform FileX of the deactivation of all Media attached to this instance. */ - for (media_index = 0; media_index < UX_HOST_CLASS_STORAGE_MAX_MEDIA; media_index++) + + /* Inform UX_MEDIA (default FileX) of the deactivation of all Media attached to this instance. */ + for (inst_index = 0; inst_index < UX_HOST_CLASS_STORAGE_MAX_MEDIA; inst_index++) { - /* Get the FileX Media attached to this media. */ +#if !defined(UX_HOST_CLASS_STORAGE_NO_FILEX) + /* Get the UX_MEDIA (default FileX) attached to this media. */ media = &storage_media -> ux_host_class_storage_media; /* Check if the media belongs to the device being removed. */ - if (((UX_HOST_CLASS_STORAGE *) media -> fx_media_driver_info) == storage) + if (((UX_HOST_CLASS_STORAGE *) ux_media_driver_info_get(media)) == storage) { /* Check if the media was properly opened. */ @@ -157,19 +170,38 @@ VOID *memory; /* We preserve the memory used by this media. */ memory = storage_media -> ux_host_class_storage_media_memory; - /* Ask FileX to unmount the partition. */ - fx_media_close(media); + /* Ask UX_MEDIA (default FileX) to unmount the partition. */ + ux_media_close(media); /* This device is now unmounted. */ storage_media -> ux_host_class_storage_media_status = UX_HOST_CLASS_STORAGE_MEDIA_UNMOUNTED; /* Reset the media ID. */ - media -> fx_media_id = 0; + ux_media_id_set(media, 0); - /* Free the memory block used for data transfer on behalf of FileX. */ + /* Free the memory block used for data transfer on behalf of UX_MEDIA (default FileX). */ _ux_utility_memory_free(memory); } } +#else + + /* Check if the media is for this storage. */ + if (storage_media -> ux_host_class_storage_media_storage == storage) + { + + /* Invoke callback for media removal. */ + if (_ux_system_host -> ux_system_host_change_function != UX_NULL) + { + + /* Call system change function. */ + _ux_system_host -> ux_system_host_change_function(UX_STORAGE_MEDIA_REMOVAL, + storage -> ux_host_class_storage_class, (VOID *) storage_media); + } + + /* Free the storage media. */ + storage_media -> ux_host_class_storage_media_storage = UX_NULL; + } +#endif /* Move to next entry in the media array. */ storage_media++; 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 b2ddd55..e3798a9 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 @@ -35,7 +35,7 @@ /* FUNCTION RELEASE */ /* */ /* _ux_host_class_storage_device_initialize PORTABLE C */ -/* 6.0 */ +/* 6.1 */ /* AUTHOR */ /* */ /* Chaoqiong Xiao, Microsoft Corporation */ @@ -75,13 +75,23 @@ /* DATE NAME DESCRIPTION */ /* */ /* 05-19-2020 Chaoqiong Xiao Initial Version 6.0 */ +/* 09-30-2020 Chaoqiong Xiao Modified comment(s), */ +/* added option to disable FX */ +/* media integration, */ +/* resulting in version 6.1 */ /* */ /**************************************************************************/ UINT _ux_host_class_storage_device_initialize(UX_HOST_CLASS_STORAGE *storage) { -UINT status; -ULONG lun_index; +UINT status; +ULONG lun_index; +#if defined(UX_HOST_CLASS_STORAGE_NO_FILEX) +UX_HOST_CLASS_STORAGE_MEDIA *storage_media; +UX_HOST_CLASS *class_inst; +UINT inst_index; +#endif + /* Check the device protocol support and initialize the transport layer. */ status = _ux_host_class_storage_device_support_check(storage); @@ -106,6 +116,11 @@ ULONG lun_index; The default sleep value is 2 seconds. */ _ux_utility_delay_ms(UX_HOST_CLASS_STORAGE_DEVICE_INIT_DELAY); +#if defined(UX_HOST_CLASS_STORAGE_NO_FILEX) + /* We need the class container. */ + class_inst = storage -> ux_host_class_storage_class; +#endif + /* Each LUN must be parsed and mounted. */ for (lun_index = 0; lun_index <= storage -> ux_host_class_storage_max_lun; lun_index++) { @@ -147,9 +162,11 @@ ULONG lun_index; case UX_HOST_CLASS_STORAGE_MEDIA_OPTICAL_DISK: case UX_HOST_CLASS_STORAGE_MEDIA_IOMEGA_CLICK: +#if !defined(UX_HOST_CLASS_STORAGE_NO_FILEX) /* Try to read the device media in search for a partition table or boot sector. We are at the root of the disk, so use sector 0 as the starting point. */ _ux_host_class_storage_media_mount(storage, 0); +#endif break; case UX_HOST_CLASS_STORAGE_MEDIA_CDROM: @@ -160,6 +177,37 @@ ULONG lun_index; break; } + +#if defined(UX_HOST_CLASS_STORAGE_NO_FILEX) + + /* Find a free media slot for inserted media. */ + storage_media = (UX_HOST_CLASS_STORAGE_MEDIA *) class_inst -> ux_host_class_media; + for (inst_index = 0; inst_index < UX_HOST_CLASS_STORAGE_MAX_MEDIA; + storage_media ++, inst_index++) + { + + /* Skip used storage media slots. */ + if (storage_media -> ux_host_class_storage_media_storage != UX_NULL) + continue; + + /* Use this free storage media slot. */ + storage_media -> ux_host_class_storage_media_storage = storage; + + /* Save media information. */ + storage_media -> ux_host_class_storage_media_lun = (UCHAR)storage -> ux_host_class_storage_lun; + storage_media -> ux_host_class_storage_media_sector_size = (USHORT)storage -> ux_host_class_storage_sector_size; + storage_media -> ux_host_class_storage_media_number_sectors = storage -> ux_host_class_storage_last_sector_number + 1; + + /* Invoke callback for media insertion. */ + if (_ux_system_host -> ux_system_host_change_function != UX_NULL) + { + + /* Call system change function. */ + _ux_system_host -> ux_system_host_change_function(UX_STORAGE_MEDIA_INSERTION, + storage -> ux_host_class_storage_class, (VOID *) storage_media); + } + } +#endif } /* Some LUNs may succeed and some may fail. For simplicity's sake, we just diff --git a/common/usbx_host_classes/src/ux_host_class_storage_device_reset.c b/common/usbx_host_classes/src/ux_host_class_storage_device_reset.c index 1551a73..678016f 100644 --- a/common/usbx_host_classes/src/ux_host_class_storage_device_reset.c +++ b/common/usbx_host_classes/src/ux_host_class_storage_device_reset.c @@ -35,7 +35,7 @@ /* FUNCTION RELEASE */ /* */ /* _ux_host_class_storage_device_reset PORTABLE C */ -/* 6.0 */ +/* 6.1 */ /* AUTHOR */ /* */ /* Chaoqiong Xiao, Microsoft Corporation */ @@ -67,6 +67,8 @@ /* 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 */ /* */ /**************************************************************************/ UINT _ux_host_class_storage_device_reset(UX_HOST_CLASS_STORAGE *storage) diff --git a/common/usbx_host_classes/src/ux_host_class_storage_device_support_check.c b/common/usbx_host_classes/src/ux_host_class_storage_device_support_check.c index 0f95bf4..e27aef7 100644 --- a/common/usbx_host_classes/src/ux_host_class_storage_device_support_check.c +++ b/common/usbx_host_classes/src/ux_host_class_storage_device_support_check.c @@ -35,7 +35,7 @@ /* FUNCTION RELEASE */ /* */ /* _ux_host_class_storage_device_support_check PORTABLE C */ -/* 6.0 */ +/* 6.1 */ /* AUTHOR */ /* */ /* Chaoqiong Xiao, Microsoft Corporation */ @@ -67,6 +67,8 @@ /* 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 */ /* */ /**************************************************************************/ UINT _ux_host_class_storage_device_support_check(UX_HOST_CLASS_STORAGE *storage) diff --git a/common/usbx_host_classes/src/ux_host_class_storage_driver_entry.c b/common/usbx_host_classes/src/ux_host_class_storage_driver_entry.c index aa478d2..5db2917 100644 --- a/common/usbx_host_classes/src/ux_host_class_storage_driver_entry.c +++ b/common/usbx_host_classes/src/ux_host_class_storage_driver_entry.c @@ -30,12 +30,13 @@ #include "ux_host_stack.h" +#if !defined(UX_HOST_CLASS_STORAGE_NO_FILEX) /**************************************************************************/ /* */ /* FUNCTION RELEASE */ /* */ /* _ux_host_class_storage_driver_entry PORTABLE C */ -/* 6.0 */ +/* 6.1 */ /* AUTHOR */ /* */ /* Chaoqiong Xiao, Microsoft Corporation */ @@ -72,6 +73,10 @@ /* DATE NAME DESCRIPTION */ /* */ /* 05-19-2020 Chaoqiong Xiao Initial Version 6.0 */ +/* 09-30-2020 Chaoqiong Xiao Modified comment(s), */ +/* added option to disable FX */ +/* media integration, */ +/* resulting in version 6.1 */ /* */ /**************************************************************************/ VOID _ux_host_class_storage_driver_entry(FX_MEDIA *media) @@ -212,3 +217,4 @@ UX_HOST_CLASS_STORAGE_MEDIA *storage_media; /* Unprotect thread reentry to this instance. */ _ux_utility_semaphore_put(&storage -> ux_host_class_storage_semaphore); } +#endif /* !defined(UX_HOST_CLASS_STORAGE_NO_FILEX) */ 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 0224a89..616edb3 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.0 */ +/* 6.1 */ /* AUTHOR */ /* */ /* Chaoqiong Xiao, Microsoft Corporation */ @@ -67,6 +67,8 @@ /* 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 */ /* */ /**************************************************************************/ UINT _ux_host_class_storage_endpoints_get(UX_HOST_CLASS_STORAGE *storage) diff --git a/common/usbx_host_classes/src/ux_host_class_storage_entry.c b/common/usbx_host_classes/src/ux_host_class_storage_entry.c index 863c292..d9af70a 100644 --- a/common/usbx_host_classes/src/ux_host_class_storage_entry.c +++ b/common/usbx_host_classes/src/ux_host_class_storage_entry.c @@ -36,7 +36,7 @@ UX_COMPILE_TIME_ASSERT(!UX_OVERFLOW_CHECK_MULC_ULONG(sizeof(UX_HOST_CLASS_STORAG /* FUNCTION RELEASE */ /* */ /* _ux_host_class_storage_entry PORTABLE C */ -/* 6.0 */ +/* 6.1 */ /* AUTHOR */ /* */ /* Chaoqiong Xiao, Microsoft Corporation */ @@ -64,7 +64,8 @@ UX_COMPILE_TIME_ASSERT(!UX_OVERFLOW_CHECK_MULC_ULONG(sizeof(UX_HOST_CLASS_STORAG /* _ux_host_class_storage_deactivate Deactivate storage class */ /* _ux_utility_memory_allocate Allocate memory block */ /* _ux_utility_memory_free Free memory block */ -/* _ux_utility_thread_create Create storage class thread */ +/* _ux_utility_thread_create Create storage class thread */ +/* _ux_utility_thread_delete Delete storage class thread */ /* */ /* CALLED BY */ /* */ @@ -75,12 +76,24 @@ UX_COMPILE_TIME_ASSERT(!UX_OVERFLOW_CHECK_MULC_ULONG(sizeof(UX_HOST_CLASS_STORAG /* DATE NAME DESCRIPTION */ /* */ /* 05-19-2020 Chaoqiong Xiao Initial Version 6.0 */ +/* 09-30-2020 Chaoqiong Xiao Modified comment(s), */ +/* added destroy command, */ +/* used host class extension */ +/* pointer for class specific */ +/* structured data, */ +/* used UX prefix to refer to */ +/* TX symbols instead of using */ +/* them directly, */ +/* resulting in version 6.1 */ /* */ /**************************************************************************/ UINT _ux_host_class_storage_entry(UX_HOST_CLASS_COMMAND *command) -{ +{ + +UINT status; +UX_HOST_CLASS *class_inst; +UX_HOST_CLASS_STORAGE_EXT *class_ext; -UINT status; /* The command request will tell us we need to do here, either a enumeration query, an activation or a deactivation. */ @@ -103,57 +116,67 @@ UINT status; the storage class, we have to fire up one thread for the media insertion and acquire some memory for the media array. */ - /* Allocate some memory for the media structures used by FileX. */ - if (command -> ux_host_class_command_class_ptr -> ux_host_class_media == UX_NULL) - { + /* Get class. */ + class_inst = command -> ux_host_class_command_class_ptr; - /* UX_HOST_CLASS_STORAGE_MAX_MEDIA*sizeof(UX_HOST_CLASS_STORAGE_MEDIA) overflow - * is checked outside of function. - */ - command -> ux_host_class_command_class_ptr -> ux_host_class_media = - _ux_utility_memory_allocate(UX_NO_ALIGN, UX_REGULAR_MEMORY, UX_HOST_CLASS_STORAGE_MAX_MEDIA*sizeof(UX_HOST_CLASS_STORAGE_MEDIA)); - - /* Check the completion status. */ - if (command -> ux_host_class_command_class_ptr -> ux_host_class_media == UX_NULL) - return(UX_MEMORY_INSUFFICIENT); - } - - /* Allocate a Thread stack and create the thread. */ - if (command -> ux_host_class_command_class_ptr -> ux_host_class_thread_stack == UX_NULL) + /* Allocate UX_HOST_CLASS_STORAGE_EXT. */ + if (class_inst -> ux_host_class_ext == UX_NULL) { - /* Allocate a Thread stack. */ - command -> ux_host_class_command_class_ptr -> ux_host_class_thread_stack = - _ux_utility_memory_allocate(UX_NO_ALIGN, UX_REGULAR_MEMORY, UX_HOST_CLASS_STORAGE_THREAD_STACK_SIZE); + /* Need memory for extension fields. */ + class_ext = _ux_utility_memory_allocate(UX_NO_ALIGN, + UX_REGULAR_MEMORY, + sizeof(UX_HOST_CLASS_STORAGE_EXT)); - /* Check the completion status. */ - if (command -> ux_host_class_command_class_ptr -> ux_host_class_thread_stack == UX_NULL) + /* Check completion status. */ + if (class_ext == UX_NULL) return(UX_MEMORY_INSUFFICIENT); - + /* Create the storage class thread. */ - status = _ux_utility_thread_create(&command -> ux_host_class_command_class_ptr -> ux_host_class_thread, - "ux_host_storage_thread", _ux_host_class_storage_thread_entry, - (ULONG) (ALIGN_TYPE) command -> ux_host_class_command_class_ptr, - command -> ux_host_class_command_class_ptr -> ux_host_class_thread_stack, + status = _ux_utility_thread_create(&class_ext -> ux_host_class_thread, + "ux_host_storage_thread", + _ux_host_class_storage_thread_entry, + (ULONG) (ALIGN_TYPE) class_inst, + class_ext -> ux_host_class_thread_stack, UX_HOST_CLASS_STORAGE_THREAD_STACK_SIZE, UX_HOST_CLASS_STORAGE_THREAD_PRIORITY_CLASS, UX_HOST_CLASS_STORAGE_THREAD_PRIORITY_CLASS, - TX_NO_TIME_SLICE, TX_DONT_START); - + UX_NO_TIME_SLICE, UX_DONT_START); + /* Check the completion status. */ if (status != UX_SUCCESS) { - _ux_utility_memory_free(command -> ux_host_class_command_class_ptr -> ux_host_class_thread_stack); - command -> ux_host_class_command_class_ptr -> ux_host_class_thread_stack = UX_NULL; + _ux_utility_memory_free(class_ext); + class_inst -> ux_host_class_ext = UX_NULL; return(UX_THREAD_ERROR); } - UX_THREAD_EXTENSION_PTR_SET(&(command -> ux_host_class_command_class_ptr -> ux_host_class_thread), command -> ux_host_class_command_class_ptr) + /* Set thead ext ptr. */ + UX_THREAD_EXTENSION_PTR_SET(&(class_ext -> ux_host_class_thread), class_inst); + + /* Save extension. */ + class_inst -> ux_host_class_ext = (VOID *)class_ext; + } + + /* Allocate some memory for the media structures used by UX_MEDIA (default FileX). */ + if (class_inst -> ux_host_class_media == UX_NULL) + { + + /* UX_HOST_CLASS_STORAGE_MAX_MEDIA*sizeof(UX_HOST_CLASS_STORAGE_MEDIA) overflow + * is checked outside of function. + */ + class_inst -> ux_host_class_media = + _ux_utility_memory_allocate(UX_NO_ALIGN, UX_REGULAR_MEMORY, + UX_HOST_CLASS_STORAGE_MAX_MEDIA*sizeof(UX_HOST_CLASS_STORAGE_MEDIA)); - /* Now that the extension pointer has been set, resume the thread. */ - tx_thread_resume(&command -> ux_host_class_command_class_ptr -> ux_host_class_thread); + /* Check the completion status. */ + if (class_inst -> ux_host_class_media == UX_NULL) + return(UX_MEMORY_INSUFFICIENT); } + /* Now that the extension pointer has been set, resume the thread. */ + tx_thread_resume(&class_ext -> ux_host_class_thread); + /* The activate command is used when the device inserted has found a parent and is ready to complete the enumeration. */ status = _ux_host_class_storage_activate(command); @@ -170,6 +193,40 @@ UINT status; /* Return the completion status. */ return(status); + case UX_HOST_CLASS_COMMAND_DESTROY: + + /* The destroy command is used when the class is unregistered. */ + + /* Get class. */ + class_inst = command -> ux_host_class_command_class_ptr; + + /* Free allocated media structures. */ + if (class_inst -> ux_host_class_media) + { + _ux_utility_memory_free(class_inst -> ux_host_class_media); + class_inst -> ux_host_class_media = UX_NULL; + } + + /* Free class extension resources. */ + if (class_inst -> ux_host_class_ext) + { + + /* Get storage class extension. */ + class_ext = (UX_HOST_CLASS_STORAGE_EXT *)class_inst -> ux_host_class_ext; + + /* Delete storage thread. */ + _ux_utility_thread_delete(&class_ext -> ux_host_class_thread); + + /* Free class extension memory. */ + _ux_utility_memory_free(class_ext); + + /* Set extension pointer to NULL. */ + class_inst -> ux_host_class_ext = UX_NULL; + } + + /* Return success. */ + return(UX_SUCCESS); + default: /* Error trap. */ diff --git a/common/usbx_host_classes/src/ux_host_class_storage_max_lun_get.c b/common/usbx_host_classes/src/ux_host_class_storage_max_lun_get.c index 0a6542d..5522d06 100644 --- a/common/usbx_host_classes/src/ux_host_class_storage_max_lun_get.c +++ b/common/usbx_host_classes/src/ux_host_class_storage_max_lun_get.c @@ -35,7 +35,7 @@ /* FUNCTION RELEASE */ /* */ /* _ux_host_class_storage_max_lun_get PORTABLE C */ -/* 6.0 */ +/* 6.1 */ /* AUTHOR */ /* */ /* Chaoqiong Xiao, Microsoft Corporation */ @@ -68,6 +68,8 @@ /* 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 */ /* */ /**************************************************************************/ UINT _ux_host_class_storage_max_lun_get(UX_HOST_CLASS_STORAGE *storage) diff --git a/common/usbx_host_classes/src/ux_host_class_storage_media_capacity_get.c b/common/usbx_host_classes/src/ux_host_class_storage_media_capacity_get.c index d58848c..e575d99 100644 --- a/common/usbx_host_classes/src/ux_host_class_storage_media_capacity_get.c +++ b/common/usbx_host_classes/src/ux_host_class_storage_media_capacity_get.c @@ -35,7 +35,7 @@ /* FUNCTION RELEASE */ /* */ /* _ux_host_class_storage_media_capacity_get PORTABLE C */ -/* 6.0 */ +/* 6.1 */ /* AUTHOR */ /* */ /* Chaoqiong Xiao, Microsoft Corporation */ @@ -72,6 +72,10 @@ /* DATE NAME DESCRIPTION */ /* */ /* 05-19-2020 Chaoqiong Xiao Initial Version 6.0 */ +/* 09-30-2020 Chaoqiong Xiao Modified comment(s), */ +/* added option to disable FX */ +/* media integration, */ +/* resulting in version 6.1 */ /* */ /**************************************************************************/ UINT _ux_host_class_storage_media_capacity_get(UX_HOST_CLASS_STORAGE *storage) @@ -160,6 +164,11 @@ ULONG command_retry; if (storage -> ux_host_class_storage_sense_code == UX_SUCCESS) { +#if defined(UX_HOST_CLASS_STORAGE_NO_FILEX) + /* Save the number of sectors. */ + storage -> ux_host_class_storage_last_sector_number = _ux_utility_long_get_big_endian(capacity_response + UX_HOST_CLASS_STORAGE_READ_CAPACITY_DATA_LBA); +#endif + /* The data is valid, save the sector size. */ storage -> ux_host_class_storage_sector_size = _ux_utility_long_get_big_endian(capacity_response + UX_HOST_CLASS_STORAGE_READ_CAPACITY_DATA_SECTOR_SIZE); diff --git a/common/usbx_host_classes/src/ux_host_class_storage_media_characteristics_get.c b/common/usbx_host_classes/src/ux_host_class_storage_media_characteristics_get.c index 3d5975a..36c8794 100644 --- a/common/usbx_host_classes/src/ux_host_class_storage_media_characteristics_get.c +++ b/common/usbx_host_classes/src/ux_host_class_storage_media_characteristics_get.c @@ -35,7 +35,7 @@ /* FUNCTION RELEASE */ /* */ /* _ux_host_class_storage_media_characteristics_get PORTABLE C */ -/* 6.0 */ +/* 6.1 */ /* AUTHOR */ /* */ /* Chaoqiong Xiao, Microsoft Corporation */ @@ -71,6 +71,8 @@ /* 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 */ /* */ /**************************************************************************/ UINT _ux_host_class_storage_media_characteristics_get(UX_HOST_CLASS_STORAGE *storage) diff --git a/common/usbx_host_classes/src/ux_host_class_storage_media_format_capacity_get.c b/common/usbx_host_classes/src/ux_host_class_storage_media_format_capacity_get.c index 959cc45..4f1e005 100644 --- a/common/usbx_host_classes/src/ux_host_class_storage_media_format_capacity_get.c +++ b/common/usbx_host_classes/src/ux_host_class_storage_media_format_capacity_get.c @@ -35,7 +35,7 @@ /* FUNCTION RELEASE */ /* */ /* _ux_host_class_storage_media_format_capacity_get PORTABLE C */ -/* 6.0 */ +/* 6.1 */ /* AUTHOR */ /* */ /* Chaoqiong Xiao, Microsoft Corporation */ @@ -71,6 +71,8 @@ /* 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 */ /* */ /**************************************************************************/ UINT _ux_host_class_storage_media_format_capacity_get(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 new file mode 100644 index 0000000..86b3281 --- /dev/null +++ b/common/usbx_host_classes/src/ux_host_class_storage_media_get.c @@ -0,0 +1,120 @@ +/**************************************************************************/ +/* */ +/* 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 */ +/** */ +/** Storage Class */ +/** */ +/**************************************************************************/ +/**************************************************************************/ + + +/* Include necessary system files. */ + +#define UX_SOURCE_CODE + +#include "ux_api.h" +#include "ux_host_class_storage.h" +#include "ux_host_stack.h" + + +#if defined(UX_HOST_CLASS_STORAGE_NO_FILEX) +/**************************************************************************/ +/* */ +/* FUNCTION RELEASE */ +/* */ +/* _ux_host_class_storage_media_get PORTABLE C */ +/* 6.1 */ +/* AUTHOR */ +/* */ +/* Chaoqiong Xiao, Microsoft Corporation */ +/* */ +/* DESCRIPTION */ +/* */ +/* This function retrieves storage media from the storage device. */ +/* */ +/* INPUT */ +/* */ +/* storage Pointer to storage class */ +/* media_index Finding media index */ +/* storage_media Holds returned storage media */ +/* pointer */ +/* */ +/* OUTPUT */ +/* */ +/* Completion Status */ +/* */ +/* CALLS */ +/* */ +/* */ +/* CALLED BY */ +/* */ +/* Storage Class */ +/* */ +/* RELEASE HISTORY */ +/* */ +/* DATE NAME DESCRIPTION */ +/* */ +/* 09-30-2020 Chaoqiong Xiao Initial Version 6.1 */ +/* */ +/**************************************************************************/ +UINT _ux_host_class_storage_media_get(UX_HOST_CLASS_STORAGE *storage, + ULONG media_index, + UX_HOST_CLASS_STORAGE_MEDIA **storage_media) +{ +#if !defined(UX_HOST_CLASS_STORAGE_NO_FILEX) + UX_PARAMETER_NOT_USED(storage); + UX_PARAMETER_NOT_USED(media_index); + UX_PARAMETER_NOT_USED(storage_media); + return(UX_FUNCTION_NOT_SUPPORTED); +#else + +UX_HOST_CLASS_STORAGE_MEDIA *storage_medias; +UX_HOST_CLASS *class_inst; +UINT scan_index, found_index; + + + /* Get storage class instance. */ + class_inst = storage -> ux_host_class_storage_class; + + /* Get shared storage medias array. */ + storage_medias = (UX_HOST_CLASS_STORAGE_MEDIA *)class_inst -> ux_host_class_media; + + /* Search medias to find the right one. */ + for(scan_index = 0, found_index = 0; + scan_index < UX_HOST_CLASS_STORAGE_MAX_MEDIA; + scan_index ++) + { + + /* Skip storage media not belong to the storage. */ + if (storage_medias[scan_index].ux_host_class_storage_media_storage != storage) + continue; + + /* Check expected index. */ + if (found_index == media_index) + { + *storage_media = &storage_medias[scan_index]; + return(UX_SUCCESS); + } + + /* Find next related media. */ + found_index ++; + } + + /* Media not found. */ + return(UX_ERROR); +#endif +} +#endif 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 new file mode 100644 index 0000000..afba0ff --- /dev/null +++ b/common/usbx_host_classes/src/ux_host_class_storage_media_lock.c @@ -0,0 +1,101 @@ +/**************************************************************************/ +/* */ +/* 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 */ +/** */ +/** Storage Class */ +/** */ +/**************************************************************************/ +/**************************************************************************/ + + +/* Include necessary system files. */ + +#define UX_SOURCE_CODE + +#include "ux_api.h" +#include "ux_host_class_storage.h" +#include "ux_host_stack.h" + + +#if defined(UX_HOST_CLASS_STORAGE_NO_FILEX) +/**************************************************************************/ +/* */ +/* FUNCTION RELEASE */ +/* */ +/* _ux_host_class_storage_media_lock PORTABLE C */ +/* 6.1 */ +/* AUTHOR */ +/* */ +/* Chaoqiong Xiao, Microsoft Corporation */ +/* */ +/* DESCRIPTION */ +/* */ +/* This function lock storage and select storage media for read/write. */ +/* */ +/* INPUT */ +/* */ +/* storage_media Pointer to storage media to */ +/* select */ +/* wait Wait option */ +/* */ +/* OUTPUT */ +/* */ +/* Completion Status */ +/* */ +/* CALLS */ +/* */ +/* */ +/* CALLED BY */ +/* */ +/* Storage Class */ +/* */ +/* RELEASE HISTORY */ +/* */ +/* DATE NAME DESCRIPTION */ +/* */ +/* 09-30-2020 Chaoqiong Xiao Initial Version 6.1 */ +/* */ +/**************************************************************************/ +UINT _ux_host_class_storage_media_lock(UX_HOST_CLASS_STORAGE_MEDIA *storage_media, ULONG wait) +{ +#if !defined(UX_HOST_CLASS_STORAGE_NO_FILEX) + UX_PARAMETER_NOT_USED(storage_media); + UX_PARAMETER_NOT_USED(wait); + return(UX_FUNCTION_NOT_SUPPORTED); +#else + +UX_HOST_CLASS_STORAGE *storage; +UINT status; + + + /* Get storage instance. */ + storage = storage_media -> ux_host_class_storage_media_storage; + + /* Protect thread reentry to this instance. */ + status = _ux_utility_semaphore_get(&storage -> ux_host_class_storage_semaphore, wait); + if (status != UX_SUCCESS) + return(status); + + /* Select the media if success. */ + storage -> ux_host_class_storage_lun = storage_media -> ux_host_class_storage_media_lun; + storage -> ux_host_class_storage_sector_size = storage_media -> ux_host_class_storage_media_sector_size; + storage -> ux_host_class_storage_last_sector_number = storage_media -> ux_host_class_storage_media_number_sectors - 1; + + /* Return success. */ + return(UX_SUCCESS); +#endif +} +#endif diff --git a/common/usbx_host_classes/src/ux_host_class_storage_media_mount.c b/common/usbx_host_classes/src/ux_host_class_storage_media_mount.c index 3b56772..3719eae 100644 --- a/common/usbx_host_classes/src/ux_host_class_storage_media_mount.c +++ b/common/usbx_host_classes/src/ux_host_class_storage_media_mount.c @@ -35,7 +35,7 @@ /* FUNCTION RELEASE */ /* */ /* _ux_host_class_storage_media_mount PORTABLE C */ -/* 6.0 */ +/* 6.1 */ /* AUTHOR */ /* */ /* Chaoqiong Xiao, Microsoft Corporation */ @@ -45,13 +45,13 @@ /* This function tries to read the first sector on the media. It then */ /* determines if this is a partition sector or a boot sector. If the */ /* sector contains partition information, each partition is checked */ -/* for a DOS aware partition and mounted by FileX. */ +/* for a DOS aware partition and mounted by UX_MEDIA (default FileX). */ /* */ /* If there is no partition sector or boot sector, we simply inform */ -/* FileX that a device is present and that its boot sector should be */ -/* periodically read to see if the device is mounted. This mechanism */ -/* applies to storage where the media can be removed (floppy, ZIP, */ -/* flash/smart media readers). */ +/* UX_MEDIA (default FileX) that a device is present and that its boot */ +/* sector should be periodically read to see if the device is mounted.*/ +/* This mechanism applies to storage where the media can be removed */ +/* (floppy, ZIP, flash/smart media readers). */ /* */ /* INPUT */ /* */ @@ -84,11 +84,20 @@ /* DATE NAME DESCRIPTION */ /* */ /* 05-19-2020 Chaoqiong Xiao Initial Version 6.0 */ +/* 09-30-2020 Chaoqiong Xiao Modified comment(s), */ +/* added option to disable FX */ +/* media integration, */ +/* resulting in version 6.1 */ /* */ /**************************************************************************/ UINT _ux_host_class_storage_media_mount(UX_HOST_CLASS_STORAGE *storage, ULONG sector) { +#if defined(UX_HOST_CLASS_STORAGE_NO_FILEX) + UX_PARAMETER_NOT_USED(storage); + UX_PARAMETER_NOT_USED(sector); + return(UX_FUNCTION_NOT_SUPPORTED); +#else UCHAR *sector_memory; UINT status; @@ -186,5 +195,5 @@ UINT status; /* Return completion status. */ return(status); +#endif /* !defined(UX_HOST_CLASS_STORAGE_NO_FILEX) */ } - diff --git a/common/usbx_host_classes/src/ux_host_class_storage_media_open.c b/common/usbx_host_classes/src/ux_host_class_storage_media_open.c index 9f9f963..3da9480 100644 --- a/common/usbx_host_classes/src/ux_host_class_storage_media_open.c +++ b/common/usbx_host_classes/src/ux_host_class_storage_media_open.c @@ -35,15 +35,16 @@ /* FUNCTION RELEASE */ /* */ /* _ux_host_class_storage_media_open PORTABLE C */ -/* 6.0 */ +/* 6.1 */ /* AUTHOR */ /* */ /* Chaoqiong Xiao, Microsoft Corporation */ /* */ /* DESCRIPTION */ /* */ -/* This function will ask FileX to mount a new partition for this */ -/* device. This function has some FileX dependencies. */ +/* This function will ask UX_MEDIA (default FileX) to mount a new */ +/* partition for this device. This function has some */ +/* UX_MEDIA (default FileX) dependencies. */ /* */ /* INPUT */ /* */ @@ -56,7 +57,7 @@ /* */ /* CALLS */ /* */ -/* fx_media_open Media open */ +/* ux_media_open Media open */ /* _ux_host_class_storage_media_protection_check */ /* Check for protection */ /* _ux_utility_memory_allocate Allocate memory block */ @@ -71,37 +72,51 @@ /* DATE NAME DESCRIPTION */ /* */ /* 05-19-2020 Chaoqiong Xiao Initial Version 6.0 */ +/* 09-30-2020 Chaoqiong Xiao Modified comment(s), */ +/* added option to disable FX */ +/* media integration, used UX_ */ +/* things instead of FX_ */ +/* things directly, used host */ +/* class extension pointer for */ +/* class specific structured */ +/* data, */ +/* resulting in version 6.1 */ /* */ /**************************************************************************/ UINT _ux_host_class_storage_media_open(UX_HOST_CLASS_STORAGE *storage, ULONG hidden_sectors) { +#if defined(UX_HOST_CLASS_STORAGE_NO_FILEX) + UX_PARAMETER_NOT_USED(storage); + UX_PARAMETER_NOT_USED(hidden_sectors); + return(UX_FUNCTION_NOT_SUPPORTED); +#else UINT status; UINT media_index; UX_HOST_CLASS_STORAGE_MEDIA *storage_media; -FX_MEDIA *media; -UX_HOST_CLASS *class; +UX_MEDIA *media; +UX_HOST_CLASS *class_inst; /* We need the class container. */ - class = storage -> ux_host_class_storage_class; + class_inst = storage -> ux_host_class_storage_class; /* Point the media structure to the first media in the container. */ - storage_media = (UX_HOST_CLASS_STORAGE_MEDIA *) class -> ux_host_class_media; + storage_media = (UX_HOST_CLASS_STORAGE_MEDIA *) class_inst -> ux_host_class_media; /* Locate a free partition in the storage instance. */ for (media_index = 0; media_index < UX_HOST_CLASS_STORAGE_MAX_MEDIA; media_index++) { - /* Get the FileX media pointer for that media. */ + /* Get the USBX Integrated Media pointer for that media. */ media = &storage_media -> ux_host_class_storage_media; /* Is the media valid? */ - if (media -> fx_media_id == 0) + if (ux_media_id_get(media) == 0) { /* Save the storage instance in the media instance. */ - media -> fx_media_driver_info = (VOID *) storage; + ux_media_driver_info_set(media, storage); /* Save the number of hidden sectors in this partition. */ storage_media -> ux_host_class_storage_media_partition_start = hidden_sectors; @@ -112,10 +127,10 @@ UX_HOST_CLASS *class; /* Save the Sector size in the storage media instance. */ storage_media -> ux_host_class_storage_media_sector_size = storage -> ux_host_class_storage_sector_size; - /* Save the storage media instance in the user reserved area in the FX_MEDIA structure. */ - media -> fx_media_reserved_for_user = (ALIGN_TYPE) storage_media; + /* Save the storage media instance in the user reserved area in the UX_MEDIA structure. */ + ux_media_reserved_for_user_set(media, storage_media); - /* We now need to allocate a block of memory for FileX to use when doing transfers + /* We now need to allocate a block of memory for UX_MEDIA (default FileX) to use when doing transfers The default buffer size is 8K. The value used for the definition is UX_HOST_CLASS_STORAGE_MEMORY_BUFFER_SIZE. This value can be changed to save on memory space but should not be smaller than the media sector size (which should be 512 bytes). Because USB devices are SCSI @@ -128,8 +143,8 @@ UX_HOST_CLASS *class; /* If trace is enabled, insert this event into the trace buffer. */ UX_TRACE_IN_LINE_INSERT(UX_TRACE_HOST_CLASS_STORAGE_MEDIA_OPEN, storage, media, 0, 0, UX_TRACE_HOST_CLASS_EVENTS, 0, 0) - /* Ask FileX to mount the partition. */ - status = fx_media_open(media, UX_HOST_CLASS_STORAGE_MEDIA_NAME, _ux_host_class_storage_driver_entry, + /* Ask UX_MEDIA (default FileX) to mount the partition. */ + status = ux_media_open(media, UX_HOST_CLASS_STORAGE_MEDIA_NAME, _ux_host_class_storage_driver_entry, storage, storage_media -> ux_host_class_storage_media_memory, UX_HOST_CLASS_STORAGE_MEMORY_BUFFER_SIZE); @@ -158,5 +173,5 @@ UX_HOST_CLASS *class; /* Return error. */ return(UX_HOST_CLASS_MEMORY_ERROR); +#endif /* !defined(UX_HOST_CLASS_STORAGE_NO_FILEX) */ } - diff --git a/common/usbx_host_classes/src/ux_host_class_storage_media_protection_check.c b/common/usbx_host_classes/src/ux_host_class_storage_media_protection_check.c index f24d91a..a46b97e 100644 --- a/common/usbx_host_classes/src/ux_host_class_storage_media_protection_check.c +++ b/common/usbx_host_classes/src/ux_host_class_storage_media_protection_check.c @@ -35,7 +35,7 @@ /* FUNCTION RELEASE */ /* */ /* _ux_host_class_storage_media_protection_check PORTABLE C */ -/* 6.0 */ +/* 6.1 */ /* AUTHOR */ /* */ /* Chaoqiong Xiao, Microsoft Corporation */ @@ -71,6 +71,8 @@ /* 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 */ /* */ /**************************************************************************/ UINT _ux_host_class_storage_media_protection_check(UX_HOST_CLASS_STORAGE *storage) 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 a96afc5..dbc8330 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 @@ -35,7 +35,7 @@ /* FUNCTION RELEASE */ /* */ /* _ux_host_class_storage_media_read PORTABLE C */ -/* 6.0 */ +/* 6.1 */ /* AUTHOR */ /* */ /* Chaoqiong Xiao, Microsoft Corporation */ @@ -71,6 +71,8 @@ /* 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 */ /* */ /**************************************************************************/ UINT _ux_host_class_storage_media_read(UX_HOST_CLASS_STORAGE *storage, ULONG sector_start, @@ -137,7 +139,7 @@ UINT media_retry; /* We got an error during read. Packet not complete. */ _ux_system_error_handler(UX_SYSTEM_LEVEL_THREAD, UX_SYSTEM_CONTEXT_CLASS, UX_TRANSFER_DATA_LESS_THAN_EXPECTED); - /* Return to FileX. */ + /* Return to UX_MEDIA (default FileX). */ return(UX_ERROR); } @@ -149,7 +151,7 @@ UINT media_retry; } /* Check if the media in the device has been removed. If so - we have to tell FileX that the media is closed. */ + we have to tell UX_MEDIA (default FileX) that the media is closed. */ return(UX_HOST_CLASS_STORAGE_SENSE_ERROR); } diff --git a/common/usbx_host_classes/src/ux_host_class_storage_media_recovery_sense_get.c b/common/usbx_host_classes/src/ux_host_class_storage_media_recovery_sense_get.c index a865008..1885cad 100644 --- a/common/usbx_host_classes/src/ux_host_class_storage_media_recovery_sense_get.c +++ b/common/usbx_host_classes/src/ux_host_class_storage_media_recovery_sense_get.c @@ -35,7 +35,7 @@ /* FUNCTION RELEASE */ /* */ /* _ux_host_class_storage_media_recovery_sense_get PORTABLE C */ -/* 6.0 */ +/* 6.1 */ /* AUTHOR */ /* */ /* Chaoqiong Xiao, Microsoft Corporation */ @@ -70,6 +70,8 @@ /* 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 */ /* */ /**************************************************************************/ UINT _ux_host_class_storage_media_recovery_sense_get(UX_HOST_CLASS_STORAGE *storage) 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 d67fac9..38e74ee 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 @@ -35,7 +35,7 @@ /* FUNCTION RELEASE */ /* */ /* _ux_host_class_storage_media_write PORTABLE C */ -/* 6.0 */ +/* 6.1 */ /* AUTHOR */ /* */ /* Chaoqiong Xiao, Microsoft Corporation */ @@ -71,6 +71,8 @@ /* 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 */ /* */ /**************************************************************************/ UINT _ux_host_class_storage_media_write(UX_HOST_CLASS_STORAGE *storage, ULONG sector_start, diff --git a/common/usbx_host_classes/src/ux_host_class_storage_partition_read.c b/common/usbx_host_classes/src/ux_host_class_storage_partition_read.c index 7a79694..2931f50 100644 --- a/common/usbx_host_classes/src/ux_host_class_storage_partition_read.c +++ b/common/usbx_host_classes/src/ux_host_class_storage_partition_read.c @@ -35,7 +35,7 @@ /* FUNCTION RELEASE */ /* */ /* _ux_host_class_storage_partition_read PORTABLE C */ -/* 6.0 */ +/* 6.1 */ /* AUTHOR */ /* */ /* Chaoqiong Xiao, Microsoft Corporation */ @@ -71,11 +71,20 @@ /* DATE NAME DESCRIPTION */ /* */ /* 05-19-2020 Chaoqiong Xiao Initial Version 6.0 */ +/* 09-30-2020 Chaoqiong Xiao Modified comment(s), */ +/* added option to disable FX */ +/* media integration, */ +/* resulting in version 6.1 */ /* */ /**************************************************************************/ UINT _ux_host_class_storage_partition_read(UX_HOST_CLASS_STORAGE *storage, UCHAR *sector_memory, ULONG sector) { - +#if defined(UX_HOST_CLASS_STORAGE_NO_FILEX) + UX_PARAMETER_NOT_USED(storage); + UX_PARAMETER_NOT_USED(sector_memory); + UX_PARAMETER_NOT_USED(sector); + return(UX_FUNCTION_NOT_SUPPORTED); +#else UINT status = UX_ERROR; UINT partition_index; @@ -123,5 +132,6 @@ UINT partition_index; /* Return completion status. */ return(status); +#endif } diff --git a/common/usbx_host_classes/src/ux_host_class_storage_request_sense.c b/common/usbx_host_classes/src/ux_host_class_storage_request_sense.c index bf0701c..d2e220a 100644 --- a/common/usbx_host_classes/src/ux_host_class_storage_request_sense.c +++ b/common/usbx_host_classes/src/ux_host_class_storage_request_sense.c @@ -35,7 +35,7 @@ /* FUNCTION RELEASE */ /* */ /* _ux_host_class_storage_request_sense PORTABLE C */ -/* 6.0 */ +/* 6.1 */ /* AUTHOR */ /* */ /* Chaoqiong Xiao, Microsoft Corporation */ @@ -71,6 +71,10 @@ /* DATE NAME DESCRIPTION */ /* */ /* 05-19-2020 Chaoqiong Xiao Initial Version 6.0 */ +/* 09-30-2020 Chaoqiong Xiao Modified comment(s), */ +/* verified memset and memcpy */ +/* cases, */ +/* resulting in version 6.1 */ /* */ /**************************************************************************/ UINT _ux_host_class_storage_request_sense(UX_HOST_CLASS_STORAGE *storage) @@ -107,7 +111,7 @@ UINT command_length; /* Save the current command so that we can re-initiate it after the REQUEST_SENSE command. */ - _ux_utility_memory_copy(storage -> ux_host_class_storage_saved_cbw, storage -> ux_host_class_storage_cbw, UX_HOST_CLASS_STORAGE_CBW_LENGTH); + _ux_utility_memory_copy(storage -> ux_host_class_storage_saved_cbw, storage -> ux_host_class_storage_cbw, UX_HOST_CLASS_STORAGE_CBW_LENGTH); /* Use case of memcpy is verified. */ /* Initialize the CBW for this command. */ _ux_host_class_storage_cbw_initialize(storage, UX_HOST_CLASS_STORAGE_DATA_IN, UX_HOST_CLASS_STORAGE_REQUEST_SENSE_RESPONSE_LENGTH, command_length); @@ -144,7 +148,7 @@ UINT command_length; _ux_utility_memory_free(request_sense_response); /* Restore the current CBW command. */ - _ux_utility_memory_copy(storage -> ux_host_class_storage_cbw, storage -> ux_host_class_storage_saved_cbw, UX_HOST_CLASS_STORAGE_CBW_LENGTH); + _ux_utility_memory_copy(storage -> ux_host_class_storage_cbw, storage -> ux_host_class_storage_saved_cbw, UX_HOST_CLASS_STORAGE_CBW_LENGTH); /* Use case of memcpy is verified. */ /* Return completion code. */ return(status); diff --git a/common/usbx_host_classes/src/ux_host_class_storage_sense_code_translate.c b/common/usbx_host_classes/src/ux_host_class_storage_sense_code_translate.c index 9d630ce..2f4ea1c 100644 --- a/common/usbx_host_classes/src/ux_host_class_storage_sense_code_translate.c +++ b/common/usbx_host_classes/src/ux_host_class_storage_sense_code_translate.c @@ -35,7 +35,7 @@ /* FUNCTION RELEASE */ /* */ /* _ux_host_class_storage_sense_code_translate PORTABLE C */ -/* 6.0 */ +/* 6.1 */ /* AUTHOR */ /* */ /* Chaoqiong Xiao, Microsoft Corporation */ @@ -67,6 +67,8 @@ /* 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 */ /* */ /**************************************************************************/ UINT _ux_host_class_storage_sense_code_translate(UX_HOST_CLASS_STORAGE *storage, UINT status) diff --git a/common/usbx_host_classes/src/ux_host_class_storage_start_stop.c b/common/usbx_host_classes/src/ux_host_class_storage_start_stop.c index 53bf7e9..b86ba6a 100644 --- a/common/usbx_host_classes/src/ux_host_class_storage_start_stop.c +++ b/common/usbx_host_classes/src/ux_host_class_storage_start_stop.c @@ -34,8 +34,8 @@ /* */ /* FUNCTION RELEASE */ /* */ -/* _ux_host_class_storage_start_stop.c PORTABLE C */ -/* 6.0 */ +/* _ux_host_class_storage_start_stop PORTABLE C */ +/* 6.1 */ /* AUTHOR */ /* */ /* Chaoqiong Xiao, Microsoft Corporation */ @@ -67,6 +67,8 @@ /* 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 */ /* */ /**************************************************************************/ UINT _ux_host_class_storage_start_stop(UX_HOST_CLASS_STORAGE *storage, diff --git a/common/usbx_host_classes/src/ux_host_class_storage_thread_entry.c b/common/usbx_host_classes/src/ux_host_class_storage_thread_entry.c index 8d6b056..da46678 100644 --- a/common/usbx_host_classes/src/ux_host_class_storage_thread_entry.c +++ b/common/usbx_host_classes/src/ux_host_class_storage_thread_entry.c @@ -35,7 +35,7 @@ /* FUNCTION RELEASE */ /* */ /* _ux_host_class_storage_thread_entry PORTABLE C */ -/* 6.0 */ +/* 6.1 */ /* AUTHOR */ /* */ /* Chaoqiong Xiao, Microsoft Corporation */ @@ -45,8 +45,8 @@ /* This function is awaken every 2 seconds to check if there was a */ /* device insertion on a specific media. This is the only way we can */ /* remount a media after the storage instance has opened the media to */ -/* FileX and the media is either not present or was removed and is */ -/* being re-)inserted. */ +/* UX_MEDIA (default FileX) and the media is either not present */ +/* or was removed and is being re-inserted. */ /* */ /* INPUT */ /* */ @@ -58,7 +58,7 @@ /* */ /* CALLS */ /* */ -/* fx_media_close Close FileX media */ +/* ux_media_close Close media */ /* _ux_host_class_storage_device_reset Reset device */ /* _ux_host_class_storage_media_mount Mount the media */ /* _ux_host_class_storage_unit_ready_test */ @@ -81,23 +81,34 @@ /* DATE NAME DESCRIPTION */ /* */ /* 05-19-2020 Chaoqiong Xiao Initial Version 6.0 */ +/* 09-30-2020 Chaoqiong Xiao Modified comment(s), */ +/* added option to disable FX */ +/* media integration, used UX_ */ +/* things instead of FX_ */ +/* things directly, used host */ +/* class extension pointer for */ +/* class specific structured */ +/* data, */ +/* resulting in version 6.1 */ /* */ /**************************************************************************/ VOID _ux_host_class_storage_thread_entry(ULONG class_address) { -UX_HOST_CLASS *class; +UX_HOST_CLASS *class_inst; UX_HOST_CLASS_STORAGE *storage; UINT status; ULONG lun_index; UX_HOST_CLASS_STORAGE_MEDIA *storage_media; -FX_MEDIA *media; -UCHAR *memory; UINT media_index; +#if !defined(UX_HOST_CLASS_STORAGE_NO_FILEX) +UX_MEDIA *media; +UCHAR *memory; +#endif /* Setup pointer to class. */ - UX_THREAD_EXTENSION_PTR_GET(class, UX_HOST_CLASS, class_address) + UX_THREAD_EXTENSION_PTR_GET(class_inst, UX_HOST_CLASS, class_address) /* This thread goes on forever once started. */ while(1) @@ -108,7 +119,7 @@ UINT media_index; /* We need to parse all the storage instances and check for a removable media flag. */ - storage = (UX_HOST_CLASS_STORAGE *) class -> ux_host_class_first_instance; + storage = (UX_HOST_CLASS_STORAGE *) class_inst -> ux_host_class_first_instance; while (storage != UX_NULL) { @@ -162,46 +173,72 @@ UINT media_index; To do so, we need to parse the existing media instance and find out if this partition was already mounted. */ - storage_media = (UX_HOST_CLASS_STORAGE_MEDIA *) class -> ux_host_class_media; + storage_media = (UX_HOST_CLASS_STORAGE_MEDIA *) class_inst -> ux_host_class_media; /* Scan all instances of media. */ - for (media_index = 0; media_index < UX_HOST_CLASS_STORAGE_MAX_MEDIA; media_index++) + for (media_index = 0; media_index < UX_HOST_CLASS_STORAGE_MAX_MEDIA; + storage_media++, media_index++) { - - /* Get the FileX Media attached to this media. */ +#if !defined(UX_HOST_CLASS_STORAGE_NO_FILEX) + /* Get the UX_MEDIA (default FileX) Media attached to this media. */ media = &storage_media -> ux_host_class_storage_media; /* Check for the storage instance and lun number. */ - if ((media -> fx_media_id != 0) && (media -> fx_media_driver_info == (VOID *) storage) && + if ((ux_media_id_get(media) != 0) && (ux_media_driver_info_get(media) == (VOID *) storage) && (storage_media -> ux_host_class_storage_media_lun == storage -> ux_host_class_storage_lun)) { /* We preserve the memory used by this media. */ memory = storage_media -> ux_host_class_storage_media_memory; - /* Let FileX use this instance. */ + /* Let UX_MEDIA (default FileX) use this instance. */ status = _ux_utility_semaphore_put(&storage -> ux_host_class_storage_semaphore); - /* Ask FileX to unmount the partition. */ - fx_media_close(media); + /* Ask UX_MEDIA (default FileX) to unmount the partition. */ + ux_media_close(media); /* This device is now unmounted. */ storage_media -> ux_host_class_storage_media_status = UX_HOST_CLASS_STORAGE_MEDIA_UNMOUNTED; /* Reset the media ID. */ - media -> fx_media_id = 0; + ux_media_id_set(media, 0); /* Now, we protect the storage instance. */ status = _ux_utility_semaphore_get(&storage -> ux_host_class_storage_semaphore, UX_WAIT_FOREVER); if (status != UX_SUCCESS) break; - /* Free the memory block used for data transfer on behalf of FileX. */ + /* Free the memory block used for data transfer on behalf of UX_MEDIA (default FileX). */ _ux_utility_memory_free(memory); } +#else + + /* Check storage instance and lun number. */ + if (storage_media -> ux_host_class_storage_media_storage != storage) + continue; + if (storage_media -> ux_host_class_storage_media_lun != storage -> ux_host_class_storage_lun) + continue; + + /* Release the instance. */ + status = _ux_utility_semaphore_put(&storage -> ux_host_class_storage_semaphore); + + /* Invoke callback for media removal. */ + if (_ux_system_host -> ux_system_host_change_function != UX_NULL) + { + + /* Call system change function. */ + _ux_system_host -> ux_system_host_change_function(UX_STORAGE_MEDIA_REMOVAL, + storage -> ux_host_class_storage_class, (VOID *) storage_media); + } + + /* Free the storage media. */ + storage_media -> ux_host_class_storage_media_storage = UX_NULL; - /* Next entry in the media array. */ - storage_media++; + /* Now, we protect the storage instance. */ + status = _ux_utility_semaphore_get(&storage -> ux_host_class_storage_semaphore, UX_WAIT_FOREVER); + if (status != UX_SUCCESS) + break; +#endif } break; @@ -210,34 +247,36 @@ UINT media_index; /* We may need to unmount this partition if it was mounted before. To do so, we need to parse the existing media instance and find out if this partition was already mounted. */ - storage_media = (UX_HOST_CLASS_STORAGE_MEDIA *) class -> ux_host_class_media; + storage_media = (UX_HOST_CLASS_STORAGE_MEDIA *) class_inst -> ux_host_class_media; /* Scan all instances of media. */ - for (media_index = 0; media_index < UX_HOST_CLASS_STORAGE_MAX_MEDIA; media_index++) + for (media_index = 0; media_index < UX_HOST_CLASS_STORAGE_MAX_MEDIA; + storage_media++, media_index++) { - /* Get the FileX Media attached to this media. */ +#if !defined(UX_HOST_CLASS_STORAGE_NO_FILEX) + /* Get the UX_MEDIA (default FileX) Media attached to this media. */ media = &storage_media -> ux_host_class_storage_media; /* Check for the storage instance and lun number. */ - if ((media -> fx_media_id != 0) && (media -> fx_media_driver_info == (VOID *) storage) && + if ((ux_media_id_get(media) != 0) && (ux_media_driver_info_get(media) == (VOID *) storage) && (storage_media -> ux_host_class_storage_media_lun == storage -> ux_host_class_storage_lun)) { /* We preserve the memory used by this media. */ memory = storage_media -> ux_host_class_storage_media_memory; - /* Let FileX use this instance. */ + /* Let UX_MEDIA (default FileX) use this instance. */ status = _ux_utility_semaphore_put(&storage -> ux_host_class_storage_semaphore); - /* Ask FileX to unmount the partition. */ - fx_media_close(media); + /* Ask UX_MEDIA (default FileX) to unmount the partition. */ + ux_media_close(media); /* This device is now unmounted. */ storage_media -> ux_host_class_storage_media_status = UX_HOST_CLASS_STORAGE_MEDIA_UNMOUNTED; /* Reset the media ID. */ - media -> fx_media_id = 0; + ux_media_id_set(media, 0); /* Now, we protect the storage instance. */ status = _ux_utility_semaphore_get(&storage -> ux_host_class_storage_semaphore, UX_WAIT_FOREVER); @@ -247,9 +286,34 @@ UINT media_index; /* Free the memory block used for data transfer on behalf of FileX. */ _ux_utility_memory_free(memory); } +#else + + /* Check storage instance and lun number. */ + if (storage_media -> ux_host_class_storage_media_storage != storage) + continue; + if (storage_media -> ux_host_class_storage_media_lun != storage -> ux_host_class_storage_lun) + continue; + + /* Release the instance. */ + status = _ux_utility_semaphore_put(&storage -> ux_host_class_storage_semaphore); + + /* Invoke callback for media removal. */ + if (_ux_system_host -> ux_system_host_change_function != UX_NULL) + { + + /* Call system change function. */ + _ux_system_host -> ux_system_host_change_function(UX_STORAGE_MEDIA_REMOVAL, + storage -> ux_host_class_storage_class, (VOID *) storage_media); + } - /* Next entry in the media array. */ - storage_media++; + /* Free the storage media. */ + storage_media -> ux_host_class_storage_media_storage = UX_NULL; + + /* Now, we protect the storage instance. */ + status = _ux_utility_semaphore_get(&storage -> ux_host_class_storage_semaphore, UX_WAIT_FOREVER); + if (status != UX_SUCCESS) + break; +#endif } /* Now, we need to retest the media to see if it is there. */ @@ -278,11 +342,43 @@ UINT media_index; if (status != UX_SUCCESS) break; - /* Let FileX use this instance. */ + /* Let UX_MEDIA (default FileX) use this instance. */ _ux_utility_semaphore_put(&storage -> ux_host_class_storage_semaphore); +#if !defined(UX_HOST_CLASS_STORAGE_NO_FILEX) + /* The device seems to have been inserted, try to mount it. */ _ux_host_class_storage_media_mount(storage, 0); +#else + + /* Find a free media slot for inserted media. */ + storage_media = (UX_HOST_CLASS_STORAGE_MEDIA *) class_inst -> ux_host_class_media; + for (media_index = 0; media_index < UX_HOST_CLASS_STORAGE_MAX_MEDIA; + storage_media ++, media_index ++) + { + + /* Skip used storage media slots. */ + if (storage_media -> ux_host_class_storage_media_storage != UX_NULL) + continue; + + /* Use this free storage media slot. */ + storage_media -> ux_host_class_storage_media_storage = storage; + + /* Save media information. */ + storage_media -> ux_host_class_storage_media_lun = (UCHAR)storage -> ux_host_class_storage_lun; + storage_media -> ux_host_class_storage_media_sector_size = (USHORT)storage -> ux_host_class_storage_sector_size; + storage_media -> ux_host_class_storage_media_number_sectors = storage -> ux_host_class_storage_last_sector_number + 1; + + /* Invoke callback for media insertion. */ + if (_ux_system_host -> ux_system_host_change_function != UX_NULL) + { + + /* Call system change function. */ + _ux_system_host -> ux_system_host_change_function(UX_STORAGE_MEDIA_INSERTION, + storage -> ux_host_class_storage_class, (VOID *) storage_media); + } + } +#endif /* Now, we protect the storage instance. */ _ux_utility_semaphore_get(&storage -> ux_host_class_storage_semaphore, UX_WAIT_FOREVER); diff --git a/common/usbx_host_classes/src/ux_host_class_storage_transport.c b/common/usbx_host_classes/src/ux_host_class_storage_transport.c index 27f9d62..8458dbb 100644 --- a/common/usbx_host_classes/src/ux_host_class_storage_transport.c +++ b/common/usbx_host_classes/src/ux_host_class_storage_transport.c @@ -35,7 +35,7 @@ /* FUNCTION RELEASE */ /* */ /* _ux_host_class_storage_transport PORTABLE C */ -/* 6.0 */ +/* 6.1 */ /* AUTHOR */ /* */ /* Chaoqiong Xiao, Microsoft Corporation */ @@ -70,6 +70,8 @@ /* 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 */ /* */ /**************************************************************************/ UINT _ux_host_class_storage_transport(UX_HOST_CLASS_STORAGE *storage, UCHAR *data_pointer) diff --git a/common/usbx_host_classes/src/ux_host_class_storage_transport_bo.c b/common/usbx_host_classes/src/ux_host_class_storage_transport_bo.c index 26a6645..222e535 100644 --- a/common/usbx_host_classes/src/ux_host_class_storage_transport_bo.c +++ b/common/usbx_host_classes/src/ux_host_class_storage_transport_bo.c @@ -35,7 +35,7 @@ /* FUNCTION RELEASE */ /* */ /* _ux_host_class_storage_transport_bo PORTABLE C */ -/* 6.0 */ +/* 6.1 */ /* AUTHOR */ /* */ /* Chaoqiong Xiao, Microsoft Corporation */ @@ -75,6 +75,9 @@ /* DATE NAME DESCRIPTION */ /* */ /* 05-19-2020 Chaoqiong Xiao Initial Version 6.0 */ +/* 09-30-2020 Chaoqiong Xiao Modified comment(s), */ +/* prefixed UX to MS_TO_TICK, */ +/* resulting in version 6.1 */ /* */ /**************************************************************************/ UINT _ux_host_class_storage_transport_bo(UX_HOST_CLASS_STORAGE *storage, UCHAR *data_pointer) @@ -113,7 +116,7 @@ UCHAR *get_status_response; return(status); /* Wait for the completion of the transfer request. */ - status = _ux_utility_semaphore_get(&transfer_request -> ux_transfer_request_semaphore, MS_TO_TICK(UX_HOST_CLASS_STORAGE_TRANSFER_TIMEOUT)); + status = _ux_utility_semaphore_get(&transfer_request -> ux_transfer_request_semaphore, UX_MS_TO_TICK(UX_HOST_CLASS_STORAGE_TRANSFER_TIMEOUT)); /* If the semaphore did not succeed we probably have a time out. */ if (status != UX_SUCCESS) @@ -197,7 +200,7 @@ UCHAR *get_status_response; if (status == UX_SUCCESS) /* Wait for the completion of the transfer request. */ - status = _ux_utility_semaphore_get(&transfer_request -> ux_transfer_request_semaphore, MS_TO_TICK(UX_HOST_CLASS_STORAGE_TRANSFER_TIMEOUT)); + status = _ux_utility_semaphore_get(&transfer_request -> ux_transfer_request_semaphore, UX_MS_TO_TICK(UX_HOST_CLASS_STORAGE_TRANSFER_TIMEOUT)); /* If the semaphore did not succeed we may have a time out or if we had a problem during the preparation of the transaction we should abort the SCSI transaction. */ @@ -269,7 +272,7 @@ UCHAR *get_status_response; return(status); /* Wait for the completion of the transfer request. */ - status = _ux_utility_semaphore_get(&transfer_request -> ux_transfer_request_semaphore, MS_TO_TICK(UX_HOST_CLASS_STORAGE_TRANSFER_TIMEOUT)); + status = _ux_utility_semaphore_get(&transfer_request -> ux_transfer_request_semaphore, UX_MS_TO_TICK(UX_HOST_CLASS_STORAGE_TRANSFER_TIMEOUT)); /* Check semaphore status. */ if (status != UX_SUCCESS) diff --git a/common/usbx_host_classes/src/ux_host_class_storage_transport_cb.c b/common/usbx_host_classes/src/ux_host_class_storage_transport_cb.c index ab9af48..edb5c72 100644 --- a/common/usbx_host_classes/src/ux_host_class_storage_transport_cb.c +++ b/common/usbx_host_classes/src/ux_host_class_storage_transport_cb.c @@ -35,7 +35,7 @@ /* FUNCTION RELEASE */ /* */ /* _ux_host_class_storage_transport_cb PORTABLE C */ -/* 6.0 */ +/* 6.1 */ /* AUTHOR */ /* */ /* Chaoqiong Xiao, Microsoft Corporation */ @@ -71,6 +71,9 @@ /* DATE NAME DESCRIPTION */ /* */ /* 05-19-2020 Chaoqiong Xiao Initial Version 6.0 */ +/* 09-30-2020 Chaoqiong Xiao Modified comment(s), */ +/* prefixed UX to MS_TO_TICK, */ +/* resulting in version 6.1 */ /* */ /**************************************************************************/ UINT _ux_host_class_storage_transport_cb(UX_HOST_CLASS_STORAGE *storage, UCHAR *data_pointer) @@ -142,7 +145,7 @@ UX_ENDPOINT *control_endpoint; return(status); /* Wait for the completion of the transfer request. */ - status = _ux_utility_semaphore_get(&transfer_request -> ux_transfer_request_semaphore, MS_TO_TICK(UX_HOST_CLASS_STORAGE_TRANSFER_TIMEOUT)); + status = _ux_utility_semaphore_get(&transfer_request -> ux_transfer_request_semaphore, UX_MS_TO_TICK(UX_HOST_CLASS_STORAGE_TRANSFER_TIMEOUT)); /* Get the actual transfer length and update the cumulated stored value for upper layers. This could be a non complete packet. But we don't test here because it only matters for diff --git a/common/usbx_host_classes/src/ux_host_class_storage_transport_cbi.c b/common/usbx_host_classes/src/ux_host_class_storage_transport_cbi.c index 5fba387..22837b2 100644 --- a/common/usbx_host_classes/src/ux_host_class_storage_transport_cbi.c +++ b/common/usbx_host_classes/src/ux_host_class_storage_transport_cbi.c @@ -35,7 +35,7 @@ /* FUNCTION RELEASE */ /* */ /* _ux_host_class_storage_transport_cbi PORTABLE C */ -/* 6.0 */ +/* 6.1 */ /* AUTHOR */ /* */ /* Chaoqiong Xiao, Microsoft Corporation */ @@ -73,6 +73,9 @@ /* DATE NAME DESCRIPTION */ /* */ /* 05-19-2020 Chaoqiong Xiao Initial Version 6.0 */ +/* 09-30-2020 Chaoqiong Xiao Modified comment(s), */ +/* prefixed UX to MS_TO_TICK, */ +/* resulting in version 6.1 */ /* */ /**************************************************************************/ UINT _ux_host_class_storage_transport_cbi(UX_HOST_CLASS_STORAGE *storage, UCHAR *data_pointer) @@ -144,7 +147,7 @@ UX_ENDPOINT *control_endpoint; return(status); /* Wait for the completion of the transfer request. */ - status = _ux_utility_semaphore_get(&transfer_request -> ux_transfer_request_semaphore, MS_TO_TICK(UX_HOST_CLASS_STORAGE_TRANSFER_TIMEOUT)); + status = _ux_utility_semaphore_get(&transfer_request -> ux_transfer_request_semaphore, UX_MS_TO_TICK(UX_HOST_CLASS_STORAGE_TRANSFER_TIMEOUT)); /* Get the actual transfer length and update the cumulated stored value for upper layers. This could be a non complete packet. But we don't test here because it only matters for @@ -187,7 +190,7 @@ UX_ENDPOINT *control_endpoint; /* We must wait for the interrupt endpoint to return the status stage now. This can take a fairly long time. */ - status = _ux_utility_semaphore_get(&transfer_request -> ux_transfer_request_semaphore, MS_TO_TICK(UX_HOST_CLASS_STORAGE_CBI_STATUS_TIMEOUT)); + status = _ux_utility_semaphore_get(&transfer_request -> ux_transfer_request_semaphore, UX_MS_TO_TICK(UX_HOST_CLASS_STORAGE_CBI_STATUS_TIMEOUT)); /* If the status is not successful, we may have a timeout error. */ if (status != UX_SUCCESS) diff --git a/common/usbx_host_classes/src/ux_host_class_storage_unit_ready_test.c b/common/usbx_host_classes/src/ux_host_class_storage_unit_ready_test.c index ef97201..10b8208 100644 --- a/common/usbx_host_classes/src/ux_host_class_storage_unit_ready_test.c +++ b/common/usbx_host_classes/src/ux_host_class_storage_unit_ready_test.c @@ -35,7 +35,7 @@ /* FUNCTION RELEASE */ /* */ /* _ux_host_class_storage_unit_ready_test PORTABLE C */ -/* 6.0 */ +/* 6.1 */ /* AUTHOR */ /* */ /* Chaoqiong Xiao, Microsoft Corporation */ @@ -68,6 +68,8 @@ /* 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 */ /* */ /**************************************************************************/ UINT _ux_host_class_storage_unit_ready_test(UX_HOST_CLASS_STORAGE *storage) diff --git a/common/usbx_host_classes/src/ux_host_class_swar_activate.c b/common/usbx_host_classes/src/ux_host_class_swar_activate.c index c59f509..df2979b 100644 --- a/common/usbx_host_classes/src/ux_host_class_swar_activate.c +++ b/common/usbx_host_classes/src/ux_host_class_swar_activate.c @@ -35,7 +35,7 @@ /* FUNCTION RELEASE */ /* */ /* _ux_host_class_swar_activate PORTABLE C */ -/* 6.0 */ +/* 6.1 */ /* AUTHOR */ /* */ /* Chaoqiong Xiao, Microsoft Corporation */ @@ -71,6 +71,8 @@ /* 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 */ /* */ /**************************************************************************/ UINT _ux_host_class_swar_activate(UX_HOST_CLASS_COMMAND *command) 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 bc118b0..7474a23 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.0 */ +/* 6.1 */ /* AUTHOR */ /* */ /* Chaoqiong Xiao, Microsoft Corporation */ @@ -69,6 +69,10 @@ /* DATE NAME DESCRIPTION */ /* */ /* 05-19-2020 Chaoqiong Xiao Initial Version 6.0 */ +/* 09-30-2020 Chaoqiong Xiao Modified comment(s), */ +/* optimized based on compile */ +/* definitions, */ +/* resulting in version 6.1 */ /* */ /**************************************************************************/ UINT _ux_host_class_swar_configure(UX_HOST_CLASS_SWAR *swar) @@ -76,7 +80,9 @@ UINT _ux_host_class_swar_configure(UX_HOST_CLASS_SWAR *swar) UINT status; UX_CONFIGURATION *configuration; +#if UX_MAX_DEVICES > 1 UX_DEVICE *parent_device; +#endif /* If the device has been configured already, we don't need to do it @@ -98,7 +104,8 @@ UX_DEVICE *parent_device; return(UX_CONFIGURATION_HANDLE_UNKNOWN); } - + +#if UX_MAX_DEVICES > 1 /* Check the swar power source and check the parent power source for incompatible connections. */ if (swar -> ux_host_class_swar_device -> ux_device_power_source == UX_DEVICE_BUS_POWERED) @@ -121,7 +128,8 @@ UX_DEVICE *parent_device; return(UX_CONNECTION_INCOMPATIBLE); } } - +#endif + /* We have the valid configuration. Ask the USBX stack to set this configuration. */ status = _ux_host_stack_device_configuration_select(configuration); if (status != UX_SUCCESS) diff --git a/common/usbx_host_classes/src/ux_host_class_swar_deactivate.c b/common/usbx_host_classes/src/ux_host_class_swar_deactivate.c index 4f3adda..1eb731a 100644 --- a/common/usbx_host_classes/src/ux_host_class_swar_deactivate.c +++ b/common/usbx_host_classes/src/ux_host_class_swar_deactivate.c @@ -35,7 +35,7 @@ /* FUNCTION RELEASE */ /* */ /* _ux_host_class_swar_deactivate PORTABLE C */ -/* 6.0 */ +/* 6.1 */ /* AUTHOR */ /* */ /* Chaoqiong Xiao, Microsoft Corporation */ @@ -73,6 +73,8 @@ /* 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 */ /* */ /**************************************************************************/ UINT _ux_host_class_swar_deactivate(UX_HOST_CLASS_COMMAND *command) diff --git a/common/usbx_host_classes/src/ux_host_class_swar_endpoints_get.c b/common/usbx_host_classes/src/ux_host_class_swar_endpoints_get.c index 819aeae..b40c084 100644 --- a/common/usbx_host_classes/src/ux_host_class_swar_endpoints_get.c +++ b/common/usbx_host_classes/src/ux_host_class_swar_endpoints_get.c @@ -35,7 +35,7 @@ /* FUNCTION RELEASE */ /* */ /* _ux_host_class_swar_endpoints_get PORTABLE C */ -/* 6.0 */ +/* 6.1 */ /* AUTHOR */ /* */ /* Chaoqiong Xiao, Microsoft Corporation */ @@ -68,6 +68,8 @@ /* 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 */ /* */ /**************************************************************************/ UINT _ux_host_class_swar_endpoints_get(UX_HOST_CLASS_SWAR *swar) diff --git a/common/usbx_host_classes/src/ux_host_class_swar_entry.c b/common/usbx_host_classes/src/ux_host_class_swar_entry.c index b4a754a..b2dd9bf 100644 --- a/common/usbx_host_classes/src/ux_host_class_swar_entry.c +++ b/common/usbx_host_classes/src/ux_host_class_swar_entry.c @@ -35,7 +35,7 @@ /* FUNCTION RELEASE */ /* */ /* _ux_host_class_swar_entry PORTABLE C */ -/* 6.0 */ +/* 6.1 */ /* AUTHOR */ /* */ /* Chaoqiong Xiao, Microsoft Corporation */ @@ -68,6 +68,8 @@ /* 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 */ /* */ /**************************************************************************/ UINT _ux_host_class_swar_entry(UX_HOST_CLASS_COMMAND *command) 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 af31172..47f128a 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.0 */ +/* 6.1 */ /* AUTHOR */ /* */ /* Chaoqiong Xiao, Microsoft Corporation */ @@ -70,6 +70,8 @@ /* 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 */ /* */ /**************************************************************************/ UINT _ux_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 a57ed4c..2b1d7c6 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 @@ -35,7 +35,7 @@ /* FUNCTION RELEASE */ /* */ /* _ux_host_class_swar_read PORTABLE C */ -/* 6.0 */ +/* 6.1 */ /* AUTHOR */ /* */ /* Chaoqiong Xiao, Microsoft Corporation */ @@ -74,6 +74,9 @@ /* DATE NAME DESCRIPTION */ /* */ /* 05-19-2020 Chaoqiong Xiao Initial Version 6.0 */ +/* 09-30-2020 Chaoqiong Xiao Modified comment(s), */ +/* prefixed UX to MS_TO_TICK, */ +/* resulting in version 6.1 */ /* */ /**************************************************************************/ UINT _ux_host_class_swar_read(UX_HOST_CLASS_SWAR *swar, UCHAR *data_pointer, @@ -134,7 +137,7 @@ ULONG transfer_request_length; { /* Wait for the completion of the transfer_request. */ - status = _ux_utility_semaphore_get(&transfer_request -> ux_transfer_request_semaphore, MS_TO_TICK(UX_HOST_CLASS_SWAR_CLASS_TRANSFER_TIMEOUT)); + status = _ux_utility_semaphore_get(&transfer_request -> ux_transfer_request_semaphore, UX_MS_TO_TICK(UX_HOST_CLASS_SWAR_CLASS_TRANSFER_TIMEOUT)); /* If the semaphore did not succeed we probably have a time out. */ if (status != UX_SUCCESS) diff --git a/common/usbx_host_classes/src/ux_host_class_swar_reception_callback.c b/common/usbx_host_classes/src/ux_host_class_swar_reception_callback.c index a1807fa..61e1092 100644 --- a/common/usbx_host_classes/src/ux_host_class_swar_reception_callback.c +++ b/common/usbx_host_classes/src/ux_host_class_swar_reception_callback.c @@ -35,7 +35,7 @@ /* FUNCTION RELEASE */ /* */ /* _ux_host_class_swar_reception_callback PORTABLE C */ -/* 6.0 */ +/* 6.1 */ /* AUTHOR */ /* */ /* Chaoqiong Xiao, Microsoft Corporation */ @@ -67,6 +67,8 @@ /* 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 */ /* */ /**************************************************************************/ VOID _ux_host_class_swar_reception_callback (UX_TRANSFER *transfer_request) 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 650a31a..1aed62a 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 @@ -35,7 +35,7 @@ /* FUNCTION RELEASE */ /* */ /* _ux_host_class_swar_reception_start PORTABLE C */ -/* 6.0 */ +/* 6.1 */ /* AUTHOR */ /* */ /* Chaoqiong Xiao, Microsoft Corporation */ @@ -71,6 +71,8 @@ /* 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 */ /* */ /**************************************************************************/ UINT _ux_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 2eadac6..e52ea0a 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 @@ -35,7 +35,7 @@ /* FUNCTION RELEASE */ /* */ /* _ux_host_class_swar_reception_stop PORTABLE C */ -/* 6.0 */ +/* 6.1 */ /* AUTHOR */ /* */ /* Chaoqiong Xiao, Microsoft Corporation */ @@ -72,6 +72,8 @@ /* 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 */ /* */ /**************************************************************************/ UINT _ux_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 b7f2424..f7aa426 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 @@ -35,7 +35,7 @@ /* FUNCTION RELEASE */ /* */ /* _ux_host_class_swar_write PORTABLE C */ -/* 6.0 */ +/* 6.1 */ /* AUTHOR */ /* */ /* Chaoqiong Xiao, Microsoft Corporation */ @@ -74,6 +74,8 @@ /* 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 */ /* */ /**************************************************************************/ UINT _ux_host_class_swar_write(UX_HOST_CLASS_SWAR *swar, UCHAR * data_pointer, diff --git a/common/usbx_host_classes/src/ux_host_class_video_activate.c b/common/usbx_host_classes/src/ux_host_class_video_activate.c index 440c4ca..b46f89d 100644 --- a/common/usbx_host_classes/src/ux_host_class_video_activate.c +++ b/common/usbx_host_classes/src/ux_host_class_video_activate.c @@ -39,12 +39,127 @@ UCHAR _ux_system_class_video_frame_descriptor_structure[] = {1,1 UCHAR _ux_system_host_class_video_name[] = "ux_host_class_video"; +typedef struct UX_HOST_CLASS_VIDEO_DESCRIPTORS_PARSER_STRUCT +{ + UX_HOST_CLASS_VIDEO *video; + ULONG parsed_flags; +} UX_HOST_CLASS_VIDEO_DESCRIPTORS_PARSER; +#define UX_HOST_CLASS_VIDEO_DESCRIPTORS_PARSER_VC_HEADER 1 +#define UX_HOST_CLASS_VIDEO_DESCRIPTORS_PARSER_VC_IT 2 +#define UX_HOST_CLASS_VIDEO_DESCRIPTORS_PARSER_VC_PU 4 +#define UX_HOST_CLASS_VIDEO_DESCRIPTORS_PARSER_VS_HEADER 8 +#define UX_HOST_CLASS_VIDEO_DESCRIPTORS_PARSER_DONE (1|2|4|8) + + +static UINT _ux_host_class_video_descriptors_parser(VOID *arg, + UCHAR *packed_interface_descriptor, + UCHAR *packed_entity_descriptor) +{ + +UX_HOST_CLASS_VIDEO_DESCRIPTORS_PARSER *parser; +UX_HOST_CLASS_VIDEO *video; +UX_INTERFACE *streaming_interface; +UCHAR bInCollection; +UCHAR *baInterfaceNr; + + /* Get parse data. */ + parser = (UX_HOST_CLASS_VIDEO_DESCRIPTORS_PARSER *)arg; + + /* Get video instance. */ + video = parser -> video; + + if (packed_interface_descriptor[6] == UX_HOST_CLASS_VIDEO_SUBCLASS_CONTROL) + { + + /* Parse VC descriptors. */ + + /* Locate control interface. */ + if (video -> ux_host_class_video_control_interface_number == 0xFF) + { + + /* Parse header. */ + if (packed_entity_descriptor[2] == UX_HOST_CLASS_VIDEO_VC_HEADER) + { + + /* Get streaming interface. */ + streaming_interface = video -> ux_host_class_video_streaming_interface; + + /* Check if this the VC interface is expected. */ + bInCollection = packed_entity_descriptor[11]; + baInterfaceNr = packed_entity_descriptor + 12; + while(bInCollection) + { + + /* Streaming interface belongs to this control interface. */ + if (*baInterfaceNr == streaming_interface -> ux_interface_descriptor.bInterfaceNumber) + { + video -> ux_host_class_video_control_interface_number = packed_interface_descriptor[2]; + parser -> parsed_flags |= UX_HOST_CLASS_VIDEO_DESCRIPTORS_PARSER_VC_HEADER; + return(0); + } + } + } + + /* Not expected interface, just try next descriptor. */ + return(0); + } + else if (packed_interface_descriptor[2] == video -> ux_host_class_video_control_interface_number) + { + + /* It's the expected VC interface. */ + + /* Parse UX_HOST_CLASS_VIDEO_VC_PROCESSING_UNIT as feature_unit_id. */ + if (packed_entity_descriptor[2] == UX_HOST_CLASS_VIDEO_VC_PROCESSING_UNIT && + video -> ux_host_class_video_feature_unit_id == 0) + { + parser -> parsed_flags |= UX_HOST_CLASS_VIDEO_DESCRIPTORS_PARSER_VC_PU; + + /* Save as feature unit ID. */ + video -> ux_host_class_video_feature_unit_id = packed_entity_descriptor[3]; + } + + /* Parse UX_HOST_CLASS_VIDEO_VC_INPUT_TERMINAL and type (first only). */ + if (packed_entity_descriptor[2] == UX_HOST_CLASS_VIDEO_VC_INPUT_TERMINAL && + video -> ux_host_class_video_terminal_id == 0) + { + parser -> parsed_flags |= UX_HOST_CLASS_VIDEO_DESCRIPTORS_PARSER_VC_IT; + + /* Save the video terminal ID. */ + video -> ux_host_class_video_terminal_id = packed_entity_descriptor[3]; + + /* Save the video terminal type. */ + video -> ux_host_class_video_terminal_type = _ux_utility_short_get(packed_entity_descriptor + 4); + } + } + } + else + { + + /* Parse VS descriptors. */ + if (packed_entity_descriptor[2] == UX_HOST_CLASS_VIDEO_VS_INPUT_HEADER) + { + parser -> parsed_flags |= UX_HOST_CLASS_VIDEO_DESCRIPTORS_PARSER_VS_HEADER; + + /* Get the number of formats. */ + video -> ux_host_class_video_number_formats = packed_entity_descriptor[3]; + + /* Get the length of formats. */ + video -> ux_host_class_video_length_formats = _ux_utility_short_get(packed_entity_descriptor + 4); + + /* Save the descriptor where the formats reside. */ + video -> ux_host_class_video_format_address = packed_entity_descriptor; + } + } + return(0); +} + + /**************************************************************************/ /* */ /* FUNCTION RELEASE */ /* */ /* _ux_host_class_video_activate PORTABLE C */ -/* 6.0 */ +/* 6.1 */ /* AUTHOR */ /* */ /* Chaoqiong Xiao, Microsoft Corporation */ @@ -86,14 +201,20 @@ UCHAR _ux_system_host_class_video_name[] = "ux_ /* DATE NAME DESCRIPTION */ /* */ /* 05-19-2020 Chaoqiong Xiao Initial Version 6.0 */ +/* 09-30-2020 Chaoqiong Xiao Modified comment(s), */ +/* used entities parsing API, */ +/* created new semaphore to */ +/* protect control requests, */ +/* resulting in version 6.1 */ /* */ /**************************************************************************/ UINT _ux_host_class_video_activate(UX_HOST_CLASS_COMMAND *command) { -UX_INTERFACE *interface; -UX_HOST_CLASS_VIDEO *video; -UINT status; +UX_INTERFACE *interface; +UX_HOST_CLASS_VIDEO *video; +UINT status; +UX_HOST_CLASS_VIDEO_DESCRIPTORS_PARSER parser; /* The video is always activated by the interface descriptor and not the @@ -134,17 +255,19 @@ UINT status; if (status == UX_SUCCESS) status = _ux_host_class_video_descriptor_get(video); - /* Locate the video device streaming terminal. */ + /* Use parser to locate streaming terminal, formats and video controls. */ if (status == UX_SUCCESS) - status = _ux_host_class_video_input_terminal_get(video); - - /* In the input terminal streaming interface get the number of formats supported. */ - if (status == UX_SUCCESS) - status = _ux_host_class_video_input_format_get(video); + { + parser.video = video; + parser.parsed_flags = 0; + video -> ux_host_class_video_control_interface_number = 0xFF; + status = _ux_host_class_video_entities_parse(video, + _ux_host_class_video_descriptors_parser, (VOID *)&parser); + if (parser.parsed_flags != UX_HOST_CLASS_VIDEO_DESCRIPTORS_PARSER_DONE) - /* Get video controls. */ - if (status == UX_SUCCESS) - status = _ux_host_class_video_control_list_get(video); + /* Some of expected descriptors not found. */ + status = UX_HOST_CLASS_VIDEO_WRONG_TYPE; + } /* Create the semaphore to protect multiple threads from accessing the same video instance. */ @@ -155,6 +278,15 @@ UINT status; status = UX_SEMAPHORE_ERROR; } + /* Create the semaphore to protect multiple threads from issuing the control + request at the same time. */ + if (status == UX_SUCCESS) + { + status = _ux_utility_semaphore_create(&video -> ux_host_class_video_semaphore_control_request, "ux_video_semaphore_control", 1); + if (status != UX_SUCCESS) + status = UX_SEMAPHORE_ERROR; + } + if (status == UX_SUCCESS) { @@ -182,9 +314,13 @@ UINT status; /* There was error, free resources. */ - /* The last resource, video -> ux_host_class_video_semaphore is not created or created error, + /* The last resource, video -> ux_host_class_video_semaphore_control_request is not created or created error, no need to free. */ + /* Destroy the semaphore. */ + if (video -> ux_host_class_video_semaphore.tx_semaphore_id != 0) + _ux_utility_semaphore_delete(&video -> ux_host_class_video_semaphore); + /* Destroy the class instance. */ _ux_host_stack_class_instance_destroy(video -> ux_host_class_video_class, (VOID *) video); diff --git a/common/usbx_host_classes/src/ux_host_class_video_alternate_setting_locate.c b/common/usbx_host_classes/src/ux_host_class_video_alternate_setting_locate.c index 279edaa..9deb87e 100644 --- a/common/usbx_host_classes/src/ux_host_class_video_alternate_setting_locate.c +++ b/common/usbx_host_classes/src/ux_host_class_video_alternate_setting_locate.c @@ -35,7 +35,7 @@ /* FUNCTION RELEASE */ /* */ /* _ux_host_class_video_alternate_setting_locate PORTABLE C */ -/* 6.0 */ +/* 6.1 */ /* AUTHOR */ /* */ /* Chaoqiong Xiao, Microsoft Corporation */ @@ -67,6 +67,8 @@ /* 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 */ /* */ /**************************************************************************/ UINT _ux_host_class_video_alternate_setting_locate(UX_HOST_CLASS_VIDEO *video, UINT max_payload_size, UINT *alternate_setting) diff --git a/common/usbx_host_classes/src/ux_host_class_video_channel_start.c b/common/usbx_host_classes/src/ux_host_class_video_channel_start.c index d0e1f39..8595e37 100644 --- a/common/usbx_host_classes/src/ux_host_class_video_channel_start.c +++ b/common/usbx_host_classes/src/ux_host_class_video_channel_start.c @@ -35,7 +35,7 @@ /* FUNCTION RELEASE */ /* */ /* _ux_host_class_video_channel_start PORTABLE C */ -/* 6.0 */ +/* 6.1 */ /* AUTHOR */ /* */ /* Chaoqiong Xiao, Microsoft Corporation */ @@ -76,6 +76,8 @@ /* 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 */ /* */ /**************************************************************************/ UINT _ux_host_class_video_channel_start(UX_HOST_CLASS_VIDEO *video, UX_HOST_CLASS_VIDEO_PARAMETER_CHANNEL *video_parameter) diff --git a/common/usbx_host_classes/src/ux_host_class_video_configure.c b/common/usbx_host_classes/src/ux_host_class_video_configure.c index e9cca7b..2eea285 100644 --- a/common/usbx_host_classes/src/ux_host_class_video_configure.c +++ b/common/usbx_host_classes/src/ux_host_class_video_configure.c @@ -35,7 +35,7 @@ /* FUNCTION RELEASE */ /* */ /* _ux_host_class_video_configure PORTABLE C */ -/* 6.0 */ +/* 6.1 */ /* AUTHOR */ /* */ /* Chaoqiong Xiao, Microsoft Corporation */ @@ -73,6 +73,10 @@ /* DATE NAME DESCRIPTION */ /* */ /* 05-19-2020 Chaoqiong Xiao Initial Version 6.0 */ +/* 09-30-2020 Chaoqiong Xiao Modified comment(s), */ +/* optimized based on compile */ +/* definitions, */ +/* resulting in version 6.1 */ /* */ /**************************************************************************/ UINT _ux_host_class_video_configure(UX_HOST_CLASS_VIDEO *video) @@ -81,8 +85,10 @@ UINT _ux_host_class_video_configure(UX_HOST_CLASS_VIDEO *video) UINT status; UX_CONFIGURATION *configuration; UX_INTERFACE *interface; -UX_DEVICE *parent_device; ULONG interface_number; +#if UX_MAX_DEVICES > 1 +UX_DEVICE *parent_device; +#endif /* If the device has been configured already, we don't need to do it @@ -104,7 +110,9 @@ ULONG interface_number; return(UX_CONFIGURATION_HANDLE_UNKNOWN); - } + } + +#if UX_MAX_DEVICES > 1 /* Check the video power source and check the parent power source for incompatible connections. */ if (video -> ux_host_class_video_device -> ux_device_power_source == UX_DEVICE_BUS_POWERED) @@ -127,7 +135,8 @@ ULONG interface_number; return(UX_CONNECTION_INCOMPATIBLE); } } - +#endif + /* We have the valid configuration. Ask the USBX stack to set this configuration */ status = _ux_host_stack_device_configuration_select(configuration); 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 26602a3..1e6d701 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 @@ -35,7 +35,7 @@ /* FUNCTION RELEASE */ /* */ /* _ux_host_class_video_control_get PORTABLE C */ -/* 6.0 */ +/* 6.1 */ /* AUTHOR */ /* */ /* Chaoqiong Xiao, Microsoft Corporation */ @@ -74,6 +74,8 @@ /* 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 */ /* */ /**************************************************************************/ UINT _ux_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_list_get.c b/common/usbx_host_classes/src/ux_host_class_video_control_list_get.c index 184324e..9d1422a 100644 --- a/common/usbx_host_classes/src/ux_host_class_video_control_list_get.c +++ b/common/usbx_host_classes/src/ux_host_class_video_control_list_get.c @@ -35,7 +35,7 @@ /* FUNCTION RELEASE */ /* */ /* _ux_host_class_video_control_list_get PORTABLE C */ -/* 6.0 */ +/* 6.1 */ /* AUTHOR */ /* */ /* Chaoqiong Xiao, Microsoft Corporation */ @@ -66,6 +66,8 @@ /* 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 */ /* */ /**************************************************************************/ UINT _ux_host_class_video_control_list_get(UX_HOST_CLASS_VIDEO *video) 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 new file mode 100644 index 0000000..ac811bf --- /dev/null +++ b/common/usbx_host_classes/src/ux_host_class_video_control_request.c @@ -0,0 +1,201 @@ +/**************************************************************************/ +/* */ +/* 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 */ +/** */ +/** Video Class */ +/** */ +/**************************************************************************/ +/**************************************************************************/ + + +/* Include necessary system files. */ + +#define UX_SOURCE_CODE + +#include "ux_api.h" +#include "ux_host_class_video.h" +#include "ux_host_stack.h" + + +/**************************************************************************/ +/* */ +/* FUNCTION RELEASE */ +/* */ +/* _ux_host_class_video_control_request PORTABLE C */ +/* 6.1 */ +/* AUTHOR */ +/* */ +/* Chaoqiong Xiao, Microsoft Corporation */ +/* */ +/* DESCRIPTION */ +/* */ +/* This function issues a control request to a given video entity */ +/* (unit or terminal). */ +/* The unit or terminal IDs can be parsed once the video device is */ +/* ready, via ux_host_class_video_entities_parse. */ +/* */ +/* Note: only one VideoStreaming interface is supported for now. */ +/* */ +/* INPUT */ +/* */ +/* video Pointer to video class */ +/* request The request to issue */ +/* interface_index The interface index */ +/* 0: VideoControl interface */ +/* 1: VideoStreaming 1 */ +/* N: VideoStreaming N */ +/* entity_id The terminal or unit ID */ +/* control_selector The control selector */ +/* parameter Pointer to parameter block */ +/* parameter_size Size of parameter block */ +/* */ +/* OUTPUT */ +/* */ +/* Completion Status */ +/* */ +/* CALLS */ +/* */ +/* CALLED BY */ +/* */ +/* Application */ +/* */ +/* RELEASE HISTORY */ +/* */ +/* DATE NAME DESCRIPTION */ +/* */ +/* 09-30-2020 Chaoqiong Xiao Initial Version 6.1 */ +/* */ +/**************************************************************************/ +UINT _ux_host_class_video_control_request(UX_HOST_CLASS_VIDEO *video, + UINT request, UCHAR interface_index, + UINT entity_id, UINT control_selector, + UCHAR *parameter, UINT parameter_size) +{ + +UX_ENDPOINT *control_endpoint; +UX_TRANSFER *transfer_request; +UINT status; +UCHAR *control_buffer; +UCHAR request_direction; +UX_INTERFACE *interface; +UCHAR interface_number; + + + /* Ensure the instance is valid. */ + if (_ux_host_stack_class_instance_verify(_ux_system_host_class_video_name, (VOID *) video) != UX_SUCCESS) + return(UX_HOST_CLASS_INSTANCE_UNKNOWN); + + /* Protect thread reentry to this instance. */ + status = _ux_utility_semaphore_get(&video -> ux_host_class_video_semaphore_control_request, UX_WAIT_FOREVER); + if (status != UX_SUCCESS) + return(status); + + /* We need to get the default control endpoint transfer request pointer. */ + control_endpoint = &video -> ux_host_class_video_device -> ux_device_control_endpoint; + transfer_request = &control_endpoint -> ux_endpoint_transfer_request; + + /* Need to allocate memory for the control buffer. */ + control_buffer = _ux_utility_memory_allocate(UX_SAFE_ALIGN, UX_CACHE_SAFE_MEMORY, parameter_size); + if (control_buffer == UX_NULL) + { + + /* Unprotect thread reentry to this instance. */ + _ux_utility_semaphore_put(&video -> ux_host_class_video_semaphore_control_request); + + /* Return an error. */ + return(UX_MEMORY_INSUFFICIENT); + } + + /* Get the request direction from the control request ID. */ + request_direction = (request & 0x80); + + /* Are we setting a value? */ + if (request_direction == 0) + { + + /* Put parameter block in buffer. */ + if (parameter_size) + _ux_utility_memory_copy(control_buffer, parameter, parameter_size); /* Use case of memcpy is verified. */ + } + + /* Protect the control endpoint semaphore here. It will be unprotected in the + transfer request function. */ + status = _ux_utility_semaphore_get(&video -> ux_host_class_video_device -> ux_device_protection_semaphore, UX_WAIT_FOREVER); + + /* Check for status. */ + if (status != UX_SUCCESS) + { + + /* Something went wrong. */ + _ux_utility_memory_free(control_buffer); + _ux_utility_semaphore_put(&video -> ux_host_class_video_semaphore_control_request); + return(status); + } + + /* Get the interface number. */ + if (interface_index == 0) + interface_number = (UCHAR)video -> ux_host_class_video_control_interface_number; + else + { + + /* Only one streaming interface is supported now. */ + interface = video -> ux_host_class_video_streaming_interface; + interface_number = (UCHAR)interface -> ux_interface_descriptor.bInterfaceNumber; + } + + /* Create a transfer request for the request. */ + transfer_request -> ux_transfer_request_data_pointer = control_buffer; + transfer_request -> ux_transfer_request_requested_length = parameter_size; + transfer_request -> ux_transfer_request_function = request; + transfer_request -> ux_transfer_request_type = request_direction | UX_REQUEST_TYPE_CLASS | UX_REQUEST_TARGET_INTERFACE; + transfer_request -> ux_transfer_request_value = (control_selector << 8); + transfer_request -> ux_transfer_request_index = interface_number | (entity_id << 8); + + /* Send request to HCD layer. */ + status = _ux_host_stack_transfer_request(transfer_request); + + /* Check for correct transfer. */ + if (status != UX_SUCCESS) + { + + /* Free the previous control buffer. */ + _ux_utility_memory_free(control_buffer); + + /* Unprotect thread reentry to this instance. */ + _ux_utility_semaphore_put(&video -> ux_host_class_video_semaphore_control_request); + + /* Return completion status. */ + return(status); + } + + /* Are we getting a value? */ + if (request_direction) + { + + /* Then store it in the caller's buffer. */ + if (parameter_size) + _ux_utility_memory_copy(parameter, control_buffer, parameter_size); /* Use case of memcpy is verified. */ + } + + /* Free all used resources. */ + _ux_utility_memory_free(control_buffer); + + /* Unprotect thread reentry to this instance. */ + _ux_utility_semaphore_put(&video -> ux_host_class_video_semaphore_control_request); + + /* Return completion status. */ + return(status); +} 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 6e74320..acb7f2b 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 @@ -35,7 +35,7 @@ /* FUNCTION RELEASE */ /* */ /* _ux_host_class_video_control_value_get PORTABLE C */ -/* 6.0 */ +/* 6.1 */ /* AUTHOR */ /* */ /* Chaoqiong Xiao, Microsoft Corporation */ @@ -74,6 +74,8 @@ /* 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 */ /* */ /**************************************************************************/ UINT _ux_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 e5eaa5c..7c9cda3 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 @@ -35,7 +35,7 @@ /* FUNCTION RELEASE */ /* */ /* _ux_host_class_video_control_value_set PORTABLE C */ -/* 6.0 */ +/* 6.1 */ /* AUTHOR */ /* */ /* Chaoqiong Xiao, Microsoft Corporation */ @@ -73,6 +73,8 @@ /* 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 */ /* */ /**************************************************************************/ UINT _ux_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_deactivate.c b/common/usbx_host_classes/src/ux_host_class_video_deactivate.c index 928a77e..36b8ffa 100644 --- a/common/usbx_host_classes/src/ux_host_class_video_deactivate.c +++ b/common/usbx_host_classes/src/ux_host_class_video_deactivate.c @@ -35,7 +35,7 @@ /* FUNCTION RELEASE */ /* */ /* _ux_host_class_video_deactivate PORTABLE C */ -/* 6.0 */ +/* 6.1 */ /* AUTHOR */ /* */ /* Chaoqiong Xiao, Microsoft Corporation */ @@ -73,6 +73,12 @@ /* DATE NAME DESCRIPTION */ /* */ /* 05-19-2020 Chaoqiong Xiao Initial Version 6.0 */ +/* 09-30-2020 Chaoqiong Xiao Modified comment(s), */ +/* fixed issue of aborting */ +/* transfer without endpoint */ +/* ready, deleted new semaphore*/ +/* for control requests, */ +/* resulting in version 6.1 */ /* */ /**************************************************************************/ UINT _ux_host_class_video_deactivate(UX_HOST_CLASS_COMMAND *command) @@ -95,7 +101,8 @@ UINT status; return(status); /* We need to abort transactions on the iso out pipe. */ - _ux_host_stack_endpoint_transfer_abort(video -> ux_host_class_video_isochronous_endpoint); + if (video -> ux_host_class_video_isochronous_endpoint) + _ux_host_stack_endpoint_transfer_abort(video -> ux_host_class_video_isochronous_endpoint); /* The enumeration thread needs to sleep a while to allow the application or the class that may be using endpoints to exit properly. */ @@ -104,8 +111,9 @@ UINT status; /* Destroy the instance. */ _ux_host_stack_class_instance_destroy(video -> ux_host_class_video_class, (VOID *) video); - /* Destroy the semaphore. */ + /* Destroy the semaphores. */ _ux_utility_semaphore_delete(&video -> ux_host_class_video_semaphore); + _ux_utility_semaphore_delete(&video -> ux_host_class_video_semaphore_control_request); /* Before we free the device resources, we need to inform the application that the device is removed. */ diff --git a/common/usbx_host_classes/src/ux_host_class_video_descriptor_get.c b/common/usbx_host_classes/src/ux_host_class_video_descriptor_get.c index b2e68a0..2bf28a7 100644 --- a/common/usbx_host_classes/src/ux_host_class_video_descriptor_get.c +++ b/common/usbx_host_classes/src/ux_host_class_video_descriptor_get.c @@ -35,7 +35,7 @@ /* FUNCTION RELEASE */ /* */ /* _ux_host_class_video_descriptor_get PORTABLE C */ -/* 6.0 */ +/* 6.1 */ /* AUTHOR */ /* */ /* Chaoqiong Xiao, Microsoft Corporation */ @@ -70,6 +70,8 @@ /* 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 */ /* */ /**************************************************************************/ UINT _ux_host_class_video_descriptor_get(UX_HOST_CLASS_VIDEO *video) diff --git a/common/usbx_host_classes/src/ux_host_class_video_endpoints_get.c b/common/usbx_host_classes/src/ux_host_class_video_endpoints_get.c index f67c2d2..292aed9 100644 --- a/common/usbx_host_classes/src/ux_host_class_video_endpoints_get.c +++ b/common/usbx_host_classes/src/ux_host_class_video_endpoints_get.c @@ -35,7 +35,7 @@ /* FUNCTION RELEASE */ /* */ /* _ux_host_class_video_endpoints_get PORTABLE C */ -/* 6.0 */ +/* 6.1 */ /* AUTHOR */ /* */ /* Chaoqiong Xiao, Microsoft Corporation */ @@ -66,6 +66,8 @@ /* 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 */ /* */ /**************************************************************************/ UINT _ux_host_class_video_endpoints_get(UX_HOST_CLASS_VIDEO *video) 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 new file mode 100644 index 0000000..372f9f3 --- /dev/null +++ b/common/usbx_host_classes/src/ux_host_class_video_entities_parse.c @@ -0,0 +1,183 @@ +/**************************************************************************/ +/* */ +/* 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 */ +/** */ +/** Video Class */ +/** */ +/**************************************************************************/ +/**************************************************************************/ + + +/* Include necessary system files. */ + +#define UX_SOURCE_CODE + +#include "ux_api.h" +#include "ux_host_class_video.h" +#include "ux_host_stack.h" + + +/**************************************************************************/ +/* */ +/* FUNCTION RELEASE */ +/* */ +/* _ux_host_class_video_entities_parse PORTABLE C */ +/* 6.1 */ +/* AUTHOR */ +/* */ +/* Chaoqiong Xiao, Microsoft Corporation */ +/* */ +/* DESCRIPTION */ +/* */ +/* This function parsees all interface descriptors and their video */ +/* class specific descriptors. */ +/* */ +/* The function scans the device configuration descriptor. Once the */ +/* interface descriptors of the video instance are found, each video */ +/* class descriptors belong to the interface are passed to parse */ +/* function for caller one by one to parse. The interface descriptor */ +/* is also passed to provide more information. Another pointer to */ +/* arguments is also available as parse function parameter for caller */ +/* to pass necessary caller specific data to process in parse function.*/ +/* */ +/* The descriptor parsing can be terminated by returning non-zero */ +/* code in parse function. */ +/* */ +/* INPUT */ +/* */ +/* video Pointer to video instance */ +/* parse_function Parse function for each */ +/* video class descriptor */ +/* arg Parse function argument */ +/* */ +/* OUTPUT */ +/* */ +/* Completion Status */ +/* */ +/* CALLS */ +/* */ +/* CALLED BY */ +/* */ +/* Video Class */ +/* Application */ +/* */ +/* RELEASE HISTORY */ +/* */ +/* DATE NAME DESCRIPTION */ +/* */ +/* 09-30-2020 Chaoqiong Xiao Initial Version 6.1 */ +/* */ +/**************************************************************************/ +UINT _ux_host_class_video_entities_parse(UX_HOST_CLASS_VIDEO *video, + UINT(*parse_function)(VOID *arg, + UCHAR *packed_interface_descriptor, + UCHAR *packed_entity_descriptor), + VOID* arg) +{ + +UCHAR *descriptor; +UCHAR *interface_descriptor; +UX_INTERFACE *interface; +ULONG total_descriptor_length; +ULONG descriptor_length; +ULONG descriptor_type; +UINT status; + + + /* Device state check. */ + if (video -> ux_host_class_video_device -> ux_device_state != UX_DEVICE_CONFIGURED) + return(UX_HOST_CLASS_VIDEO_DEVICE_NOT_READY); + + /* Get the descriptor to the selected format. */ + descriptor = video -> ux_host_class_video_configuration_descriptor; + total_descriptor_length = video -> ux_host_class_video_configuration_descriptor_length; + + /* Haven't found interface yet. */ + interface_descriptor = UX_NULL; + + /* Scan the descriptor for the Video Streaming interface. */ + while (total_descriptor_length) + { + + /* Gather the length, type and subtype of the descriptor. */ + descriptor_length = *descriptor; + descriptor_type = *(descriptor + 1); + + /* Make sure this descriptor has at least the minimum length. */ + if (descriptor_length < 3) + return(UX_DESCRIPTOR_CORRUPTED); + + /* Process relative to descriptor type. */ + switch (descriptor_type) + { + + case UX_INTERFACE_DESCRIPTOR_ITEM: + + /* Haven't found it. */ + interface_descriptor = UX_NULL; + + /* Ensure we have the correct interface for Video Control/Streaming. */ + if (descriptor[5] == UX_HOST_CLASS_VIDEO_CLASS) + { + + /* VideoControl Inteface. */ + if (descriptor[6] == UX_HOST_CLASS_VIDEO_SUBCLASS_CONTROL) + + /* Mark we have found it. */ + interface_descriptor = descriptor; + else + { + + /* VideoStreaming interface, currently only one supported. */ + interface = video -> ux_host_class_video_streaming_interface; + if (descriptor[2] == interface -> ux_interface_descriptor.bInterfaceNumber) + + /* Mark we have found it. */ + interface_descriptor = descriptor; + } + } + break; + + case UX_HOST_CLASS_VIDEO_CS_INTERFACE: + + /* Have we found the video interface yet? */ + if (interface_descriptor != UX_NULL) + { + + /* Yes, parse the entity descriptor. */ + status = parse_function(arg, interface_descriptor, descriptor); + + /* Terminate the parsing if status is not 0. */ + if (status) + return(UX_SUCCESS); + } + break; + } + + /* Verify if the descriptor is still valid. */ + if (descriptor_length > total_descriptor_length) + return(UX_DESCRIPTOR_CORRUPTED); + + /* Jump to the next descriptor if we have not reached the end. */ + descriptor += descriptor_length; + + /* And adjust the length left to parse in the descriptor. */ + total_descriptor_length -= descriptor_length; + } + + /* We get here when all descriptors scanned. */ + return(UX_SUCCESS); +} diff --git a/common/usbx_host_classes/src/ux_host_class_video_entry.c b/common/usbx_host_classes/src/ux_host_class_video_entry.c index bc2049b..5ed8e88 100644 --- a/common/usbx_host_classes/src/ux_host_class_video_entry.c +++ b/common/usbx_host_classes/src/ux_host_class_video_entry.c @@ -35,7 +35,7 @@ /* FUNCTION RELEASE */ /* */ /* _ux_host_class_video_entry PORTABLE C */ -/* 6.0 */ +/* 6.1 */ /* AUTHOR */ /* */ /* Chaoqiong Xiao, Microsoft Corporation */ @@ -70,6 +70,8 @@ /* 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 */ /* */ /**************************************************************************/ UINT _ux_host_class_video_entry(UX_HOST_CLASS_COMMAND *command) 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 9c86a1c..3a8afd8 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 @@ -35,7 +35,7 @@ /* FUNCTION RELEASE */ /* */ /* _ux_host_class_video_format_data_get PORTABLE C */ -/* 6.0 */ +/* 6.1 */ /* AUTHOR */ /* */ /* Chaoqiong Xiao, Microsoft Corporation */ @@ -66,6 +66,8 @@ /* 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 */ /* */ /**************************************************************************/ UINT _ux_host_class_video_format_data_get(UX_HOST_CLASS_VIDEO *video, UX_HOST_CLASS_VIDEO_PARAMETER_FORMAT_DATA *format_parameter) 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 7abb99c..3baf531 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 @@ -35,7 +35,7 @@ /* FUNCTION RELEASE */ /* */ /* _ux_host_class_video_frame_data_get PORTABLE C */ -/* 6.0 */ +/* 6.1 */ /* AUTHOR */ /* */ /* Chaoqiong Xiao, Microsoft Corporation */ @@ -67,6 +67,8 @@ /* 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 */ /* */ /**************************************************************************/ UINT _ux_host_class_video_frame_data_get(UX_HOST_CLASS_VIDEO *video, UX_HOST_CLASS_VIDEO_PARAMETER_FRAME_DATA *frame_parameter) diff --git a/common/usbx_host_classes/src/ux_host_class_video_frame_interval_get.c b/common/usbx_host_classes/src/ux_host_class_video_frame_interval_get.c index 22a801a..12be1a7 100644 --- a/common/usbx_host_classes/src/ux_host_class_video_frame_interval_get.c +++ b/common/usbx_host_classes/src/ux_host_class_video_frame_interval_get.c @@ -35,7 +35,7 @@ /* FUNCTION RELEASE */ /* */ /* _ux_host_class_video_frame_interval_get PORTABLE C */ -/* 6.0 */ +/* 6.1 */ /* AUTHOR */ /* */ /* Chaoqiong Xiao, Microsoft Corporation */ @@ -68,6 +68,8 @@ /* 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 */ /* */ /**************************************************************************/ UINT _ux_host_class_video_frame_interval_get(UX_HOST_CLASS_VIDEO *video, UX_HOST_CLASS_VIDEO_PARAMETER_FRAME_INTERVAL *interval_parameter) 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 a9a86b2..13f5b19 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.0 */ +/* 6.1 */ /* AUTHOR */ /* */ /* Chaoqiong Xiao, Microsoft Corporation */ @@ -77,6 +77,8 @@ /* 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 */ /* */ /**************************************************************************/ UINT _ux_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_input_format_get.c b/common/usbx_host_classes/src/ux_host_class_video_input_format_get.c index e44338c..e016807 100644 --- a/common/usbx_host_classes/src/ux_host_class_video_input_format_get.c +++ b/common/usbx_host_classes/src/ux_host_class_video_input_format_get.c @@ -35,7 +35,7 @@ /* FUNCTION RELEASE */ /* */ /* _ux_host_class_video_input_format_get PORTABLE C */ -/* 6.0 */ +/* 6.1 */ /* AUTHOR */ /* */ /* Chaoqiong Xiao, Microsoft Corporation */ @@ -66,6 +66,8 @@ /* 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 */ /* */ /**************************************************************************/ UINT _ux_host_class_video_input_format_get(UX_HOST_CLASS_VIDEO *video) diff --git a/common/usbx_host_classes/src/ux_host_class_video_input_terminal_get.c b/common/usbx_host_classes/src/ux_host_class_video_input_terminal_get.c index 426764a..81b513e 100644 --- a/common/usbx_host_classes/src/ux_host_class_video_input_terminal_get.c +++ b/common/usbx_host_classes/src/ux_host_class_video_input_terminal_get.c @@ -35,7 +35,7 @@ /* FUNCTION RELEASE */ /* */ /* _ux_host_class_video_input_terminal_get PORTABLE C */ -/* 6.0 */ +/* 6.1 */ /* AUTHOR */ /* */ /* Chaoqiong Xiao, Microsoft Corporation */ @@ -66,6 +66,8 @@ /* 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 */ /* */ /**************************************************************************/ UINT _ux_host_class_video_input_terminal_get(UX_HOST_CLASS_VIDEO *video) 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 a3dbd7e..b77715d 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 @@ -34,8 +34,8 @@ /* */ /* FUNCTION RELEASE */ /* */ -/* _ux_host_class_cdc_acm_ioctl PORTABLE C */ -/* 6.0 */ +/* _ux_host_class_video_ioctl PORTABLE C */ +/* 6.1 */ /* AUTHOR */ /* */ /* Chaoqiong Xiao, Microsoft Corporation */ @@ -77,6 +77,8 @@ /* 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 */ /* */ /**************************************************************************/ UINT _ux_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 8402d8f..9b4e608 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 @@ -35,7 +35,7 @@ /* FUNCTION RELEASE */ /* */ /* _ux_host_class_video_max_payload_get PORTABLE C */ -/* 6.0 */ +/* 6.1 */ /* AUTHOR */ /* */ /* Chaoqiong Xiao, Microsoft Corporation */ @@ -66,6 +66,8 @@ /* 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 */ /* */ /**************************************************************************/ ULONG _ux_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 1e92c98..728d9e1 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 @@ -35,7 +35,7 @@ /* FUNCTION RELEASE */ /* */ /* _ux_host_class_video_read PORTABLE C */ -/* 6.0 */ +/* 6.1 */ /* AUTHOR */ /* */ /* Chaoqiong Xiao, Microsoft Corporation */ @@ -75,6 +75,8 @@ /* 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 */ /* */ /**************************************************************************/ UINT _ux_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 f3396cc..7b9fc83 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 @@ -35,7 +35,7 @@ /* FUNCTION RELEASE */ /* */ /* _ux_host_class_video_start PORTABLE C */ -/* 6.0 */ +/* 6.1 */ /* AUTHOR */ /* */ /* Chaoqiong Xiao, Microsoft Corporation */ @@ -65,6 +65,8 @@ /* 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 */ /* */ /**************************************************************************/ UINT _ux_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 6789430..156cf9e 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 @@ -35,7 +35,7 @@ /* FUNCTION RELEASE */ /* */ /* _ux_host_class_video_stop PORTABLE C */ -/* 6.0 */ +/* 6.1 */ /* AUTHOR */ /* */ /* Chaoqiong Xiao, Microsoft Corporation */ @@ -70,6 +70,8 @@ /* 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 */ /* */ /**************************************************************************/ UINT _ux_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 d7f6daa..1908c29 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.0 */ +/* 6.1 */ /* AUTHOR */ /* */ /* Chaoqiong Xiao, Microsoft Corporation */ @@ -70,6 +70,8 @@ /* 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 */ /* */ /**************************************************************************/ UINT _ux_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 1d36642..c27114b 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.0 */ +/* 6.1 */ /* AUTHOR */ /* */ /* Chaoqiong Xiao, Microsoft Corporation */ @@ -79,6 +79,8 @@ /* 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 */ /* */ /**************************************************************************/ UINT _ux_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 5702cff..4d61188 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 @@ -35,7 +35,7 @@ /* FUNCTION RELEASE */ /* */ /* _ux_host_class_video_transfer_callback_set PORTABLE C */ -/* 6.0 */ +/* 6.1 */ /* AUTHOR */ /* */ /* Chaoqiong Xiao, Microsoft Corporation */ @@ -66,6 +66,8 @@ /* 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 */ /* */ /**************************************************************************/ VOID _ux_host_class_video_transfer_callback_set(UX_HOST_CLASS_VIDEO *video, VOID (*callback_function)(UX_TRANSFER*)) diff --git a/common/usbx_host_classes/src/ux_host_class_video_transfer_request.c b/common/usbx_host_classes/src/ux_host_class_video_transfer_request.c index fc2f989..8c18bec 100644 --- a/common/usbx_host_classes/src/ux_host_class_video_transfer_request.c +++ b/common/usbx_host_classes/src/ux_host_class_video_transfer_request.c @@ -35,7 +35,7 @@ /* FUNCTION RELEASE */ /* */ /* _ux_host_class_video_transfer_request PORTABLE C */ -/* 6.0 */ +/* 6.1 */ /* AUTHOR */ /* */ /* Chaoqiong Xiao, Microsoft Corporation */ @@ -71,6 +71,8 @@ /* 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 */ /* */ /**************************************************************************/ UINT _ux_host_class_video_transfer_request(UX_HOST_CLASS_VIDEO *video, diff --git a/common/usbx_host_classes/src/ux_host_class_video_transfer_request_callback.c b/common/usbx_host_classes/src/ux_host_class_video_transfer_request_callback.c index 620ea34..764daa9 100644 --- a/common/usbx_host_classes/src/ux_host_class_video_transfer_request_callback.c +++ b/common/usbx_host_classes/src/ux_host_class_video_transfer_request_callback.c @@ -35,7 +35,7 @@ /* FUNCTION RELEASE */ /* */ /* _ux_host_class_video_transfer_request_callback PORTABLE C */ -/* 6.0 */ +/* 6.1 */ /* AUTHOR */ /* */ /* Chaoqiong Xiao, Microsoft Corporation */ @@ -67,6 +67,8 @@ /* 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 */ /* */ /**************************************************************************/ VOID _ux_host_class_video_transfer_request_callback(UX_TRANSFER *transfer_request) diff --git a/common/usbx_host_classes/src/ux_host_class_video_transfer_request_completed.c b/common/usbx_host_classes/src/ux_host_class_video_transfer_request_completed.c index 088eb58..b76ec04 100644 --- a/common/usbx_host_classes/src/ux_host_class_video_transfer_request_completed.c +++ b/common/usbx_host_classes/src/ux_host_class_video_transfer_request_completed.c @@ -35,7 +35,7 @@ /* FUNCTION RELEASE */ /* */ /* _ux_host_class_video_transfer_request_completed PORTABLE C */ -/* 6.0 */ +/* 6.1 */ /* AUTHOR */ /* */ /* Chaoqiong Xiao, Microsoft Corporation */ @@ -67,6 +67,8 @@ /* 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 */ /* */ /**************************************************************************/ VOID _ux_host_class_video_transfer_request_completed(UX_TRANSFER *transfer_request) diff --git a/common/usbx_host_controllers/inc/ux_hcd_ehci.h b/common/usbx_host_controllers/inc/ux_hcd_ehci.h index d4a4c49..01939a5 100644 --- a/common/usbx_host_controllers/inc/ux_hcd_ehci.h +++ b/common/usbx_host_controllers/inc/ux_hcd_ehci.h @@ -26,7 +26,7 @@ /* COMPONENT DEFINITION RELEASE */ /* */ /* ux_hcd_ehci.h PORTABLE C */ -/* 6.0 */ +/* 6.1 */ /* AUTHOR */ /* */ /* Chaoqiong Xiao, Microsoft Corporation */ @@ -41,6 +41,11 @@ /* DATE NAME DESCRIPTION */ /* */ /* 05-19-2020 Chaoqiong Xiao Initial Version 6.0 */ +/* 09-30-2020 Chaoqiong Xiao Modified comment(s), */ +/* used UX prefix to refer to */ +/* TX symbols instead of using */ +/* them directly, */ +/* resulting in version 6.1 */ /* */ /**************************************************************************/ @@ -347,9 +352,9 @@ typedef struct UX_HCD_EHCI_STRUCT *ux_hcd_ehci_iso_done_transfer_tail; struct UX_EHCI_ED_STRUCT *ux_hcd_ehci_interrupt_ed_list; - TX_MUTEX ux_hcd_ehci_periodic_mutex; - TX_SEMAPHORE ux_hcd_ehci_protect_semaphore; - TX_SEMAPHORE ux_hcd_ehci_doorbell_semaphore; + UX_MUTEX ux_hcd_ehci_periodic_mutex; + UX_SEMAPHORE ux_hcd_ehci_protect_semaphore; + UX_SEMAPHORE ux_hcd_ehci_doorbell_semaphore; ULONG ux_hcd_ehci_frame_list_size; ULONG ux_hcd_ehci_interrupt_count; ULONG ux_hcd_ehci_embedded_tt; diff --git a/common/usbx_host_controllers/inc/ux_hcd_ohci.h b/common/usbx_host_controllers/inc/ux_hcd_ohci.h index 2463440..0277794 100644 --- a/common/usbx_host_controllers/inc/ux_hcd_ohci.h +++ b/common/usbx_host_controllers/inc/ux_hcd_ohci.h @@ -26,7 +26,7 @@ /* COMPONENT DEFINITION RELEASE */ /* */ /* ux_hcd_ohci.h PORTABLE C */ -/* 6.0 */ +/* 6.1 */ /* AUTHOR */ /* */ /* Chaoqiong Xiao, Microsoft Corporation */ @@ -41,6 +41,8 @@ /* 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 */ /* */ /**************************************************************************/ diff --git a/common/usbx_host_controllers/src/ux_hcd_ehci_asynch_td_process.c b/common/usbx_host_controllers/src/ux_hcd_ehci_asynch_td_process.c index b0f1a58..991a790 100644 --- a/common/usbx_host_controllers/src/ux_hcd_ehci_asynch_td_process.c +++ b/common/usbx_host_controllers/src/ux_hcd_ehci_asynch_td_process.c @@ -35,7 +35,7 @@ /* FUNCTION RELEASE */ /* */ /* _ux_hcd_ehci_asynch_td_process PORTABLE C */ -/* 6.0 */ +/* 6.1 */ /* AUTHOR */ /* */ /* Chaoqiong Xiao, Microsoft Corporation */ @@ -71,6 +71,8 @@ /* 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 */ /* */ /**************************************************************************/ UX_EHCI_TD *_ux_hcd_ehci_asynch_td_process(UX_EHCI_ED *ed, UX_EHCI_TD *td) 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 f7e22d5..13c8087 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.0 */ +/* 6.1 */ /* AUTHOR */ /* */ /* Chaoqiong Xiao, Microsoft Corporation */ @@ -68,6 +68,10 @@ /* DATE NAME DESCRIPTION */ /* */ /* 05-19-2020 Chaoqiong Xiao Initial Version 6.0 */ +/* 09-30-2020 Chaoqiong Xiao Modified comment(s), */ +/* optimized based on compile */ +/* definitions, */ +/* resulting in version 6.1 */ /* */ /**************************************************************************/ UINT _ux_hcd_ehci_asynchronous_endpoint_create(UX_HCD_EHCI *hcd_ehci, UX_ENDPOINT *endpoint) @@ -134,6 +138,7 @@ UX_EHCI_LINK_POINTER queue_head; case UX_FULL_SPEED_DEVICE: +#if UX_MAX_DEVICES > 1 /* The device must be on a hub for this code to execute. We still do a sanity check. */ if (device -> ux_device_parent != UX_NULL) { @@ -144,6 +149,7 @@ UX_EHCI_LINK_POINTER queue_head; /* And the port index onto which this device is attached. */ ed -> ux_ehci_ed_cap1 |= device -> ux_device_port_location << UX_EHCI_QH_PORT_NUMBER_LOC; } +#endif break; } diff --git a/common/usbx_host_controllers/src/ux_hcd_ehci_asynchronous_endpoint_destroy.c b/common/usbx_host_controllers/src/ux_hcd_ehci_asynchronous_endpoint_destroy.c index 308c71e..f5c0511 100644 --- a/common/usbx_host_controllers/src/ux_hcd_ehci_asynchronous_endpoint_destroy.c +++ b/common/usbx_host_controllers/src/ux_hcd_ehci_asynchronous_endpoint_destroy.c @@ -35,7 +35,7 @@ /* FUNCTION RELEASE */ /* */ /* _ux_hcd_ehci_asynchronous_endpoint_destroy PORTABLE C */ -/* 6.0 */ +/* 6.1 */ /* AUTHOR */ /* */ /* Chaoqiong Xiao, Microsoft Corporation */ @@ -68,6 +68,8 @@ /* 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 */ /* */ /**************************************************************************/ UINT _ux_hcd_ehci_asynchronous_endpoint_destroy(UX_HCD_EHCI *hcd_ehci, UX_ENDPOINT *endpoint) diff --git a/common/usbx_host_controllers/src/ux_hcd_ehci_controller_disable.c b/common/usbx_host_controllers/src/ux_hcd_ehci_controller_disable.c index 4d8e648..d8c6ea2 100644 --- a/common/usbx_host_controllers/src/ux_hcd_ehci_controller_disable.c +++ b/common/usbx_host_controllers/src/ux_hcd_ehci_controller_disable.c @@ -35,7 +35,7 @@ /* FUNCTION RELEASE */ /* */ /* _ux_hcd_ehci_controller_disable PORTABLE C */ -/* 6.0 */ +/* 6.1 */ /* AUTHOR */ /* */ /* Chaoqiong Xiao, Microsoft Corporation */ @@ -71,6 +71,8 @@ /* 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 */ /* */ /**************************************************************************/ UINT _ux_hcd_ehci_controller_disable(UX_HCD_EHCI *hcd_ehci) diff --git a/common/usbx_host_controllers/src/ux_hcd_ehci_done_queue_process.c b/common/usbx_host_controllers/src/ux_hcd_ehci_done_queue_process.c index 722c3dc..f134626 100644 --- a/common/usbx_host_controllers/src/ux_hcd_ehci_done_queue_process.c +++ b/common/usbx_host_controllers/src/ux_hcd_ehci_done_queue_process.c @@ -35,7 +35,7 @@ /* FUNCTION RELEASE */ /* */ /* _ux_hcd_ehci_done_queue_process PORTABLE C */ -/* 6.0 */ +/* 6.1 */ /* AUTHOR */ /* */ /* Chaoqiong Xiao, Microsoft Corporation */ @@ -74,6 +74,8 @@ /* 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 */ /* */ /**************************************************************************/ VOID _ux_hcd_ehci_done_queue_process(UX_HCD_EHCI *hcd_ehci) diff --git a/common/usbx_host_controllers/src/ux_hcd_ehci_door_bell_wait.c b/common/usbx_host_controllers/src/ux_hcd_ehci_door_bell_wait.c index 39f8b87..9529da6 100644 --- a/common/usbx_host_controllers/src/ux_hcd_ehci_door_bell_wait.c +++ b/common/usbx_host_controllers/src/ux_hcd_ehci_door_bell_wait.c @@ -35,7 +35,7 @@ /* FUNCTION RELEASE */ /* */ /* _ux_hcd_ehci_door_bell_wait PORTABLE C */ -/* 6.0 */ +/* 6.1 */ /* AUTHOR */ /* */ /* Chaoqiong Xiao, Microsoft Corporation */ @@ -70,6 +70,8 @@ /* 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 */ /* */ /**************************************************************************/ VOID _ux_hcd_ehci_door_bell_wait(UX_HCD_EHCI *hcd_ehci) diff --git a/common/usbx_host_controllers/src/ux_hcd_ehci_ed_clean.c b/common/usbx_host_controllers/src/ux_hcd_ehci_ed_clean.c index a60653a..3d862e7 100644 --- a/common/usbx_host_controllers/src/ux_hcd_ehci_ed_clean.c +++ b/common/usbx_host_controllers/src/ux_hcd_ehci_ed_clean.c @@ -35,7 +35,7 @@ /* FUNCTION RELEASE */ /* */ /* _ux_hcd_ehci_ed_clean PORTABLE C */ -/* 6.0 */ +/* 6.1 */ /* AUTHOR */ /* */ /* Chaoqiong Xiao, Microsoft Corporation */ @@ -66,6 +66,8 @@ /* 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 */ /* */ /**************************************************************************/ UINT _ux_hcd_ehci_ed_clean(UX_EHCI_ED *ed) diff --git a/common/usbx_host_controllers/src/ux_hcd_ehci_ed_obtain.c b/common/usbx_host_controllers/src/ux_hcd_ehci_ed_obtain.c index 85d72fb..44267ba 100644 --- a/common/usbx_host_controllers/src/ux_hcd_ehci_ed_obtain.c +++ b/common/usbx_host_controllers/src/ux_hcd_ehci_ed_obtain.c @@ -35,7 +35,7 @@ /* FUNCTION RELEASE */ /* */ /* _ux_hcd_ehci_ed_obtain PORTABLE C */ -/* 6.0 */ +/* 6.1 */ /* AUTHOR */ /* */ /* Chaoqiong Xiao, Microsoft Corporation */ @@ -65,6 +65,10 @@ /* DATE NAME DESCRIPTION */ /* */ /* 05-19-2020 Chaoqiong Xiao Initial Version 6.0 */ +/* 09-30-2020 Chaoqiong Xiao Modified comment(s), */ +/* verified memset and memcpy */ +/* cases, */ +/* resulting in version 6.1 */ /* */ /**************************************************************************/ UX_EHCI_ED *_ux_hcd_ehci_ed_obtain(UX_HCD_EHCI *hcd_ehci) @@ -84,7 +88,7 @@ ULONG ed_index; { /* The ED may have been used, so we reset all fields. */ - _ux_utility_memory_set(ed, 0, sizeof(UX_EHCI_ED)); + _ux_utility_memory_set(ed, 0, sizeof(UX_EHCI_ED)); /* Use case of memset is verified. */ /* This ED is now marked as USED. */ ed -> ux_ehci_ed_status = UX_USED; diff --git a/common/usbx_host_controllers/src/ux_hcd_ehci_endpoint_reset.c b/common/usbx_host_controllers/src/ux_hcd_ehci_endpoint_reset.c index b69aaf9..1429bd7 100644 --- a/common/usbx_host_controllers/src/ux_hcd_ehci_endpoint_reset.c +++ b/common/usbx_host_controllers/src/ux_hcd_ehci_endpoint_reset.c @@ -35,7 +35,7 @@ /* FUNCTION RELEASE */ /* */ /* _ux_hcd_ehci_endpoint_reset PORTABLE C */ -/* 6.0 */ +/* 6.1 */ /* AUTHOR */ /* */ /* Chaoqiong Xiao, Microsoft Corporation */ @@ -66,6 +66,8 @@ /* 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 */ /* */ /**************************************************************************/ UINT _ux_hcd_ehci_endpoint_reset(UX_HCD_EHCI *hcd_ehci, UX_ENDPOINT *endpoint) diff --git a/common/usbx_host_controllers/src/ux_hcd_ehci_entry.c b/common/usbx_host_controllers/src/ux_hcd_ehci_entry.c index a9e2bf4..6177682 100644 --- a/common/usbx_host_controllers/src/ux_hcd_ehci_entry.c +++ b/common/usbx_host_controllers/src/ux_hcd_ehci_entry.c @@ -35,7 +35,7 @@ /* FUNCTION RELEASE */ /* */ /* _ux_hcd_ehci_entry PORTABLE C */ -/* 6.0 */ +/* 6.1 */ /* AUTHOR */ /* */ /* Chaoqiong Xiao, Microsoft Corporation */ @@ -87,6 +87,8 @@ /* 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 */ /* */ /**************************************************************************/ UINT _ux_hcd_ehci_entry(UX_HCD *hcd, UINT function, VOID *parameter) diff --git a/common/usbx_host_controllers/src/ux_hcd_ehci_frame_number_get.c b/common/usbx_host_controllers/src/ux_hcd_ehci_frame_number_get.c index a284f77..0fc524c 100644 --- a/common/usbx_host_controllers/src/ux_hcd_ehci_frame_number_get.c +++ b/common/usbx_host_controllers/src/ux_hcd_ehci_frame_number_get.c @@ -35,7 +35,7 @@ /* FUNCTION RELEASE */ /* */ /* _ux_hcd_ehci_frame_number_get PORTABLE C */ -/* 6.0 */ +/* 6.1 */ /* AUTHOR */ /* */ /* Chaoqiong Xiao, Microsoft Corporation */ @@ -67,6 +67,8 @@ /* 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 */ /* */ /**************************************************************************/ UINT _ux_hcd_ehci_frame_number_get(UX_HCD_EHCI *hcd_ehci, ULONG *frame_number) diff --git a/common/usbx_host_controllers/src/ux_hcd_ehci_frame_number_set.c b/common/usbx_host_controllers/src/ux_hcd_ehci_frame_number_set.c index a80b5ad..5f5db0b 100644 --- a/common/usbx_host_controllers/src/ux_hcd_ehci_frame_number_set.c +++ b/common/usbx_host_controllers/src/ux_hcd_ehci_frame_number_set.c @@ -35,7 +35,7 @@ /* FUNCTION RELEASE */ /* */ /* _ux_hcd_ehci_frame_number_set PORTABLE C */ -/* 6.0 */ +/* 6.1 */ /* AUTHOR */ /* */ /* Chaoqiong Xiao, Microsoft Corporation */ @@ -68,6 +68,8 @@ /* 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 */ /* */ /**************************************************************************/ VOID _ux_hcd_ehci_frame_number_set(UX_HCD_EHCI *hcd_ehci, ULONG frame_number) diff --git a/common/usbx_host_controllers/src/ux_hcd_ehci_fsisochronous_td_obtain.c b/common/usbx_host_controllers/src/ux_hcd_ehci_fsisochronous_td_obtain.c index 0bc0ce3..c31bec4 100644 --- a/common/usbx_host_controllers/src/ux_hcd_ehci_fsisochronous_td_obtain.c +++ b/common/usbx_host_controllers/src/ux_hcd_ehci_fsisochronous_td_obtain.c @@ -35,7 +35,7 @@ /* FUNCTION RELEASE */ /* */ /* _ux_hcd_ehci_fsisochronous_td_obtain PORTABLE C */ -/* 6.0 */ +/* 6.1 */ /* AUTHOR */ /* */ /* Chaoqiong Xiao, Microsoft Corporation */ @@ -66,6 +66,10 @@ /* DATE NAME DESCRIPTION */ /* */ /* 05-19-2020 Chaoqiong Xiao Initial Version 6.0 */ +/* 09-30-2020 Chaoqiong Xiao Modified comment(s), */ +/* verified memset and memcpy */ +/* cases, */ +/* resulting in version 6.1 */ /* */ /**************************************************************************/ UX_EHCI_FSISO_TD *_ux_hcd_ehci_fsisochronous_td_obtain(UX_HCD_EHCI *hcd_ehci) @@ -91,7 +95,7 @@ ULONG td_index; { /* The TD may have been used, so we reset all fields. */ - _ux_utility_memory_set(td, 0, sizeof(UX_EHCI_FSISO_TD)); + _ux_utility_memory_set(td, 0, sizeof(UX_EHCI_FSISO_TD)); /* Use case of memset is verified. */ /* This TD is now marked as USED. */ td -> ux_ehci_fsiso_td_status = UX_USED; diff --git a/common/usbx_host_controllers/src/ux_hcd_ehci_fsisochronous_tds_process.c b/common/usbx_host_controllers/src/ux_hcd_ehci_fsisochronous_tds_process.c index 463a985..99bcd1c 100644 --- a/common/usbx_host_controllers/src/ux_hcd_ehci_fsisochronous_tds_process.c +++ b/common/usbx_host_controllers/src/ux_hcd_ehci_fsisochronous_tds_process.c @@ -35,7 +35,7 @@ /* FUNCTION RELEASE */ /* */ /* _ux_hcd_ehci_fsisochronous_tds_process PORTABLE C */ -/* 6.0 */ +/* 6.1 */ /* AUTHOR */ /* */ /* Chaoqiong Xiao, Microsoft Corporation */ @@ -72,6 +72,8 @@ /* 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 */ /* */ /**************************************************************************/ UX_EHCI_FSISO_TD* _ux_hcd_ehci_fsisochronous_tds_process( diff --git a/common/usbx_host_controllers/src/ux_hcd_ehci_hsisochronous_td_obtain.c b/common/usbx_host_controllers/src/ux_hcd_ehci_hsisochronous_td_obtain.c index be4d295..e374fe3 100644 --- a/common/usbx_host_controllers/src/ux_hcd_ehci_hsisochronous_td_obtain.c +++ b/common/usbx_host_controllers/src/ux_hcd_ehci_hsisochronous_td_obtain.c @@ -35,7 +35,7 @@ /* FUNCTION RELEASE */ /* */ /* _ux_hcd_ehci_hsisochronous_td_obtain PORTABLE C */ -/* 6.0 */ +/* 6.1 */ /* AUTHOR */ /* */ /* Chaoqiong Xiao, Microsoft Corporation */ @@ -66,6 +66,10 @@ /* DATE NAME DESCRIPTION */ /* */ /* 05-19-2020 Chaoqiong Xiao Initial Version 6.0 */ +/* 09-30-2020 Chaoqiong Xiao Modified comment(s), */ +/* verified memset and memcpy */ +/* cases, */ +/* resulting in version 6.1 */ /* */ /**************************************************************************/ UX_EHCI_HSISO_TD *_ux_hcd_ehci_hsisochronous_td_obtain(UX_HCD_EHCI *hcd_ehci) @@ -91,7 +95,7 @@ ULONG td_index; { /* The TD may have been used, so we reset all fields. */ - _ux_utility_memory_set(td, 0, sizeof(UX_EHCI_HSISO_TD)); + _ux_utility_memory_set(td, 0, sizeof(UX_EHCI_HSISO_TD)); /* Use case of memset is verified. */ /* This TD is now marked as USED. */ td -> ux_ehci_hsiso_td_status = UX_USED; diff --git a/common/usbx_host_controllers/src/ux_hcd_ehci_hsisochronous_tds_process.c b/common/usbx_host_controllers/src/ux_hcd_ehci_hsisochronous_tds_process.c index b20af0d..c38974b 100644 --- a/common/usbx_host_controllers/src/ux_hcd_ehci_hsisochronous_tds_process.c +++ b/common/usbx_host_controllers/src/ux_hcd_ehci_hsisochronous_tds_process.c @@ -35,7 +35,7 @@ /* FUNCTION RELEASE */ /* */ /* _ux_hcd_ehci_hsisochronous_tds_process PORTABLE C */ -/* 6.0 */ +/* 6.1 */ /* AUTHOR */ /* */ /* Chaoqiong Xiao, Microsoft Corporation */ @@ -70,6 +70,8 @@ /* 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 */ /* */ /**************************************************************************/ UX_EHCI_HSISO_TD* _ux_hcd_ehci_hsisochronous_tds_process( diff --git a/common/usbx_host_controllers/src/ux_hcd_ehci_initialize.c b/common/usbx_host_controllers/src/ux_hcd_ehci_initialize.c index 49a1a6f..347bc09 100644 --- a/common/usbx_host_controllers/src/ux_hcd_ehci_initialize.c +++ b/common/usbx_host_controllers/src/ux_hcd_ehci_initialize.c @@ -60,7 +60,7 @@ /* FUNCTION RELEASE */ /* */ /* _ux_hcd_ehci_initialize PORTABLE C */ -/* 6.0 */ +/* 6.1 */ /* AUTHOR */ /* */ /* Chaoqiong Xiao, Microsoft Corporation */ @@ -104,6 +104,10 @@ /* DATE NAME DESCRIPTION */ /* */ /* 05-19-2020 Chaoqiong Xiao Initial Version 6.0 */ +/* 09-30-2020 Chaoqiong Xiao Modified comment(s), */ +/* optimized based on compile */ +/* definitions, */ +/* resulting in version 6.1 */ /* */ /**************************************************************************/ UINT _ux_hcd_ehci_initialize(UX_HCD *hcd) @@ -120,9 +124,11 @@ UINT status = UX_SUCCESS; /* The controller initialized here is of EHCI type. */ hcd -> ux_hcd_controller_type = UX_EHCI_CONTROLLER; +#if UX_MAX_DEVICES > 1 /* Initialize the max bandwidth for periodic endpoints. On EHCI, the spec says no more than 90% to be allocated for periodic. */ hcd -> ux_hcd_available_bandwidth = UX_EHCI_AVAILABLE_BANDWIDTH; +#endif /* Allocate memory for this EHCI HCD instance. */ hcd_ehci = _ux_utility_memory_allocate(UX_NO_ALIGN, UX_REGULAR_MEMORY, sizeof(UX_HCD_EHCI)); @@ -241,8 +247,11 @@ UINT status = UX_SUCCESS; if (status == UX_SUCCESS) { +#if UX_MAX_DEVICES > 1 + /* Since this is a USB 2.0 controller, we can safely hardwire the version. */ hcd -> ux_hcd_version = 0x200; +#endif /* The EHCI Controller should not be running. */ ehci_register = _ux_hcd_ehci_register_read(hcd_ehci, EHCI_HCOR_USB_COMMAND); @@ -305,7 +314,9 @@ UINT status = UX_SUCCESS; local ehci container. */ ehci_register = _ux_hcd_ehci_register_read(hcd_ehci, EHCI_HCCR_HCS_PARAMS); hcd -> ux_hcd_nb_root_hubs = (UINT) (ehci_register & 0xf); - hcd_ehci -> ux_hcd_ehci_nb_root_hubs = (UINT) (ehci_register & 0xf); + if (hcd -> ux_hcd_nb_root_hubs > UX_MAX_ROOTHUB_PORT) + hcd -> ux_hcd_nb_root_hubs = UX_MAX_ROOTHUB_PORT; + hcd_ehci -> ux_hcd_ehci_nb_root_hubs = hcd -> ux_hcd_nb_root_hubs; /* The controller transceiver can now send the device connection/extraction signals to the EHCI controller. */ 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 17166f1..f00ae02 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.0 */ +/* 6.1 */ /* AUTHOR */ /* */ /* Chaoqiong Xiao, Microsoft Corporation */ @@ -89,6 +89,10 @@ /* DATE NAME DESCRIPTION */ /* */ /* 05-19-2020 Chaoqiong Xiao Initial Version 6.0 */ +/* 09-30-2020 Chaoqiong Xiao Modified comment(s), */ +/* optimized based on compile */ +/* definitions, */ +/* resulting in version 6.1 */ /* */ /**************************************************************************/ UINT _ux_hcd_ehci_interrupt_endpoint_create(UX_HCD_EHCI *hcd_ehci, UX_ENDPOINT *endpoint) @@ -167,6 +171,7 @@ UINT i; /* Fall through. */ default: +#if UX_MAX_DEVICES > 1 /* The device must be on a hub for this code to execute. We still do a sanity check. */ if (device -> ux_device_parent != UX_NULL) { @@ -177,6 +182,7 @@ UINT i; /* And the port index onto which this device is attached. */ ed -> ux_ehci_ed_cap1 |= device -> ux_device_port_location << UX_EHCI_QH_PORT_NUMBER_LOC; } +#endif break; } diff --git a/common/usbx_host_controllers/src/ux_hcd_ehci_interrupt_endpoint_destroy.c b/common/usbx_host_controllers/src/ux_hcd_ehci_interrupt_endpoint_destroy.c index fbcc385..55dd017 100644 --- a/common/usbx_host_controllers/src/ux_hcd_ehci_interrupt_endpoint_destroy.c +++ b/common/usbx_host_controllers/src/ux_hcd_ehci_interrupt_endpoint_destroy.c @@ -35,7 +35,7 @@ /* FUNCTION RELEASE */ /* */ /* _ux_hcd_ehci_interrupt_endpoint_destroy PORTABLE C */ -/* 6.0 */ +/* 6.1 */ /* AUTHOR */ /* */ /* Chaoqiong Xiao, Microsoft Corporation */ @@ -70,6 +70,8 @@ /* 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 */ /* */ /**************************************************************************/ UINT _ux_hcd_ehci_interrupt_endpoint_destroy(UX_HCD_EHCI *hcd_ehci, UX_ENDPOINT *endpoint) diff --git a/common/usbx_host_controllers/src/ux_hcd_ehci_interrupt_handler.c b/common/usbx_host_controllers/src/ux_hcd_ehci_interrupt_handler.c index e304a7b..ee75d5b 100644 --- a/common/usbx_host_controllers/src/ux_hcd_ehci_interrupt_handler.c +++ b/common/usbx_host_controllers/src/ux_hcd_ehci_interrupt_handler.c @@ -35,7 +35,7 @@ /* FUNCTION RELEASE */ /* */ /* _ux_hcd_ehci_interrupt_handler PORTABLE C */ -/* 6.0 */ +/* 6.1 */ /* AUTHOR */ /* */ /* Chaoqiong Xiao, Microsoft Corporation */ @@ -77,6 +77,8 @@ /* 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 */ /* */ /**************************************************************************/ VOID _ux_hcd_ehci_interrupt_handler(VOID) 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 0b1ae42..f5af8a9 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.0 */ +/* 6.1 */ /* AUTHOR */ /* */ /* Chaoqiong Xiao, Microsoft Corporation */ @@ -74,6 +74,8 @@ /* 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 */ /* */ /**************************************************************************/ UINT _ux_hcd_ehci_isochronous_endpoint_create(UX_HCD_EHCI *hcd_ehci, UX_ENDPOINT *endpoint) diff --git a/common/usbx_host_controllers/src/ux_hcd_ehci_isochronous_endpoint_destroy.c b/common/usbx_host_controllers/src/ux_hcd_ehci_isochronous_endpoint_destroy.c index 819f522..6690c09 100644 --- a/common/usbx_host_controllers/src/ux_hcd_ehci_isochronous_endpoint_destroy.c +++ b/common/usbx_host_controllers/src/ux_hcd_ehci_isochronous_endpoint_destroy.c @@ -35,7 +35,7 @@ /* FUNCTION RELEASE */ /* */ /* _ux_hcd_ehci_isochronous_endpoint_destroy PORTABLE C */ -/* 6.0 */ +/* 6.1 */ /* AUTHOR */ /* */ /* Chaoqiong Xiao, Microsoft Corporation */ @@ -70,6 +70,8 @@ /* 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 */ /* */ /**************************************************************************/ UINT _ux_hcd_ehci_isochronous_endpoint_destroy(UX_HCD_EHCI *hcd_ehci, UX_ENDPOINT *endpoint) diff --git a/common/usbx_host_controllers/src/ux_hcd_ehci_least_traffic_list_get.c b/common/usbx_host_controllers/src/ux_hcd_ehci_least_traffic_list_get.c index 5d4d06c..fb9acd6 100644 --- a/common/usbx_host_controllers/src/ux_hcd_ehci_least_traffic_list_get.c +++ b/common/usbx_host_controllers/src/ux_hcd_ehci_least_traffic_list_get.c @@ -35,7 +35,7 @@ /* FUNCTION RELEASE */ /* */ /* _ux_hcd_ehci_least_traffic_list_get PORTABLE C */ -/* 6.0 */ +/* 6.1 */ /* AUTHOR */ /* */ /* Chaoqiong Xiao, Microsoft Corporation */ @@ -70,6 +70,8 @@ /* 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 */ /* */ /**************************************************************************/ UX_EHCI_ED *_ux_hcd_ehci_least_traffic_list_get(UX_HCD_EHCI *hcd_ehci, diff --git a/common/usbx_host_controllers/src/ux_hcd_ehci_next_td_clean.c b/common/usbx_host_controllers/src/ux_hcd_ehci_next_td_clean.c index a027df4..1be46b1 100644 --- a/common/usbx_host_controllers/src/ux_hcd_ehci_next_td_clean.c +++ b/common/usbx_host_controllers/src/ux_hcd_ehci_next_td_clean.c @@ -35,7 +35,7 @@ /* FUNCTION RELEASE */ /* */ /* _ux_hcd_ehci_next_td_clean PORTABLE C */ -/* 6.0 */ +/* 6.1 */ /* AUTHOR */ /* */ /* Chaoqiong Xiao, Microsoft Corporation */ @@ -66,6 +66,8 @@ /* 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 */ /* */ /**************************************************************************/ VOID _ux_hcd_ehci_next_td_clean(UX_EHCI_TD *td) diff --git a/common/usbx_host_controllers/src/ux_hcd_ehci_periodic_descriptor_link.c b/common/usbx_host_controllers/src/ux_hcd_ehci_periodic_descriptor_link.c index bbc7404..b1bc622 100644 --- a/common/usbx_host_controllers/src/ux_hcd_ehci_periodic_descriptor_link.c +++ b/common/usbx_host_controllers/src/ux_hcd_ehci_periodic_descriptor_link.c @@ -33,8 +33,8 @@ /* */ /* FUNCTION RELEASE */ /* */ -/* _ux_hcd_ehci_periodic_descriptor_link PORTABLE C */ -/* 6.0 */ +/* _ux_hcd_ehci_periodic_descriptor_link PORTABLE C */ +/* 6.1 */ /* AUTHOR */ /* */ /* Chaoqiong Xiao, Microsoft Corporation */ @@ -86,6 +86,8 @@ /* 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 */ /* */ /**************************************************************************/ void _ux_hcd_ehci_periodic_descriptor_link( diff --git a/common/usbx_host_controllers/src/ux_hcd_ehci_periodic_tree_create.c b/common/usbx_host_controllers/src/ux_hcd_ehci_periodic_tree_create.c index c0d14b9..9300230 100644 --- a/common/usbx_host_controllers/src/ux_hcd_ehci_periodic_tree_create.c +++ b/common/usbx_host_controllers/src/ux_hcd_ehci_periodic_tree_create.c @@ -35,7 +35,7 @@ /* FUNCTION RELEASE */ /* */ /* _ux_hcd_ehci_periodic_tree_create PORTABLE C */ -/* 6.0 */ +/* 6.1 */ /* AUTHOR */ /* */ /* Chaoqiong Xiao, Microsoft Corporation */ @@ -67,6 +67,8 @@ /* 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 */ /* */ /**************************************************************************/ UINT _ux_hcd_ehci_periodic_tree_create(UX_HCD_EHCI *hcd_ehci) diff --git a/common/usbx_host_controllers/src/ux_hcd_ehci_poll_rate_entry_get.c b/common/usbx_host_controllers/src/ux_hcd_ehci_poll_rate_entry_get.c index f47fba2..6eace03 100644 --- a/common/usbx_host_controllers/src/ux_hcd_ehci_poll_rate_entry_get.c +++ b/common/usbx_host_controllers/src/ux_hcd_ehci_poll_rate_entry_get.c @@ -35,7 +35,7 @@ /* FUNCTION RELEASE */ /* */ /* _ux_hcd_ehci_poll_rate_entry_get PORTABLE C */ -/* 6.0 */ +/* 6.1 */ /* AUTHOR */ /* */ /* Chaoqiong Xiao, Microsoft Corporation */ @@ -76,6 +76,8 @@ /* 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 */ /* */ /**************************************************************************/ UX_EHCI_ED *_ux_hcd_ehci_poll_rate_entry_get(UX_HCD_EHCI *hcd_ehci, diff --git a/common/usbx_host_controllers/src/ux_hcd_ehci_port_disable.c b/common/usbx_host_controllers/src/ux_hcd_ehci_port_disable.c index e833f52..c9ac6d5 100644 --- a/common/usbx_host_controllers/src/ux_hcd_ehci_port_disable.c +++ b/common/usbx_host_controllers/src/ux_hcd_ehci_port_disable.c @@ -35,7 +35,7 @@ /* FUNCTION RELEASE */ /* */ /* _ux_hcd_ehci_port_disable PORTABLE C */ -/* 6.0 */ +/* 6.1 */ /* AUTHOR */ /* */ /* Chaoqiong Xiao, Microsoft Corporation */ @@ -68,6 +68,8 @@ /* 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 */ /* */ /**************************************************************************/ UINT _ux_hcd_ehci_port_disable(UX_HCD_EHCI *hcd_ehci, ULONG port_index) diff --git a/common/usbx_host_controllers/src/ux_hcd_ehci_port_reset.c b/common/usbx_host_controllers/src/ux_hcd_ehci_port_reset.c index ae4ae87..10cdc2e 100644 --- a/common/usbx_host_controllers/src/ux_hcd_ehci_port_reset.c +++ b/common/usbx_host_controllers/src/ux_hcd_ehci_port_reset.c @@ -57,8 +57,8 @@ #elif defined(MIMXRT) #define UX_EHCI_USBPHY1 (0x400D9000u) #define UX_EHCI_USBPHY2 (0x400DA000u) -#define UX_EHCI_BASE1 (0x402E0000u) -#define UX_EHCI_BASE2 (0x402E0200u) +#define UX_EHCI_BASE1 (0x402E0100u) +#define UX_EHCI_BASE2 (0x402E0300u) #endif #define UX_EHCI_USBPHY_CTRL_SET_BIT1(base) ((*(volatile ULONG *) ( base + 0x34)) = 0x02) @@ -70,7 +70,7 @@ if ((ULONG)hcd_ehci -> ux_hcd_ehci_base == UX_EHCI_BASE1) \ base = (UX_EHCI_USBPHY1); \ else \ - base = (UX_EHCI_USBPHY1); \ + base = (UX_EHCI_USBPHY2); \ if (on_off) \ UX_EHCI_USBPHY_CTRL_SET_BIT1(base); \ else \ @@ -88,7 +88,7 @@ /* FUNCTION RELEASE */ /* */ /* _ux_hcd_ehci_port_reset PORTABLE C */ -/* 6.0 */ +/* 6.1 */ /* AUTHOR */ /* */ /* Chaoqiong Xiao, Microsoft Corporation */ @@ -121,6 +121,9 @@ /* DATE NAME DESCRIPTION */ /* */ /* 05-19-2020 Chaoqiong Xiao Initial Version 6.0 */ +/* 09-30-2020 Chaoqiong Xiao Modified comment(s), */ +/* fixed NXP register base, */ +/* resulting in version 6.1 */ /* */ /**************************************************************************/ UINT _ux_hcd_ehci_port_reset(UX_HCD_EHCI *hcd_ehci, ULONG port_index) diff --git a/common/usbx_host_controllers/src/ux_hcd_ehci_port_resume.c b/common/usbx_host_controllers/src/ux_hcd_ehci_port_resume.c index 25e33e7..b6cad23 100644 --- a/common/usbx_host_controllers/src/ux_hcd_ehci_port_resume.c +++ b/common/usbx_host_controllers/src/ux_hcd_ehci_port_resume.c @@ -35,7 +35,7 @@ /* FUNCTION RELEASE */ /* */ /* _ux_hcd_ehci_port_resume PORTABLE C */ -/* 6.0 */ +/* 6.1 */ /* AUTHOR */ /* */ /* Chaoqiong Xiao, Microsoft Corporation */ @@ -66,6 +66,8 @@ /* 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 */ /* */ /**************************************************************************/ UINT _ux_hcd_ehci_port_resume(UX_HCD_EHCI *hcd_ehci, UINT port_index) diff --git a/common/usbx_host_controllers/src/ux_hcd_ehci_port_status_get.c b/common/usbx_host_controllers/src/ux_hcd_ehci_port_status_get.c index 1ecb182..21fb027 100644 --- a/common/usbx_host_controllers/src/ux_hcd_ehci_port_status_get.c +++ b/common/usbx_host_controllers/src/ux_hcd_ehci_port_status_get.c @@ -57,8 +57,8 @@ #elif defined(MIMXRT) #define UX_EHCI_USBPHY1 (0x400D9000u) #define UX_EHCI_USBPHY2 (0x400DA000u) -#define UX_EHCI_BASE1 (0x402E0000u) -#define UX_EHCI_BASE2 (0x402E0200u) +#define UX_EHCI_BASE1 (0x402E0100u) +#define UX_EHCI_BASE2 (0x402E0300u) #endif #define UX_EHCI_USBPHY_CTRL_SET_BIT1(base) ((*(volatile ULONG *) ( base + 0x34)) = 0x02) @@ -70,7 +70,7 @@ if ((ULONG)hcd_ehci -> ux_hcd_ehci_base == UX_EHCI_BASE1) \ base = (UX_EHCI_USBPHY1); \ else \ - base = (UX_EHCI_USBPHY1); \ + base = (UX_EHCI_USBPHY2); \ if (on_off) \ UX_EHCI_USBPHY_CTRL_SET_BIT1(base); \ else \ @@ -88,7 +88,7 @@ /* FUNCTION RELEASE */ /* */ /* _ux_hcd_ehci_port_status_get PORTABLE C */ -/* 6.0 */ +/* 6.1 */ /* AUTHOR */ /* */ /* Chaoqiong Xiao, Microsoft Corporation */ @@ -144,6 +144,9 @@ /* DATE NAME DESCRIPTION */ /* */ /* 05-19-2020 Chaoqiong Xiao Initial Version 6.0 */ +/* 09-30-2020 Chaoqiong Xiao Modified comment(s), */ +/* fixed NXP register base, */ +/* resulting in version 6.1 */ /* */ /**************************************************************************/ ULONG _ux_hcd_ehci_port_status_get(UX_HCD_EHCI *hcd_ehci, ULONG port_index) diff --git a/common/usbx_host_controllers/src/ux_hcd_ehci_port_suspend.c b/common/usbx_host_controllers/src/ux_hcd_ehci_port_suspend.c index 224c8ea..df04ebe 100644 --- a/common/usbx_host_controllers/src/ux_hcd_ehci_port_suspend.c +++ b/common/usbx_host_controllers/src/ux_hcd_ehci_port_suspend.c @@ -35,7 +35,7 @@ /* FUNCTION RELEASE */ /* */ /* _ux_hcd_ehci_port_suspend PORTABLE C */ -/* 6.0 */ +/* 6.1 */ /* AUTHOR */ /* */ /* Chaoqiong Xiao, Microsoft Corporation */ @@ -67,6 +67,8 @@ /* 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 */ /* */ /**************************************************************************/ UINT _ux_hcd_ehci_port_suspend(UX_HCD_EHCI *hcd_ehci, ULONG port_index) diff --git a/common/usbx_host_controllers/src/ux_hcd_ehci_power_down_port.c b/common/usbx_host_controllers/src/ux_hcd_ehci_power_down_port.c index 60e3b52..496da78 100644 --- a/common/usbx_host_controllers/src/ux_hcd_ehci_power_down_port.c +++ b/common/usbx_host_controllers/src/ux_hcd_ehci_power_down_port.c @@ -35,7 +35,7 @@ /* FUNCTION RELEASE */ /* */ /* _ux_hcd_ehci_power_down_port PORTABLE C */ -/* 6.0 */ +/* 6.1 */ /* AUTHOR */ /* */ /* Chaoqiong Xiao, Microsoft Corporation */ @@ -67,6 +67,8 @@ /* 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 */ /* */ /**************************************************************************/ UINT _ux_hcd_ehci_power_down_port(UX_HCD_EHCI *hcd_ehci, ULONG port_index) diff --git a/common/usbx_host_controllers/src/ux_hcd_ehci_power_on_port.c b/common/usbx_host_controllers/src/ux_hcd_ehci_power_on_port.c index 2c3c70b..2ff3a89 100644 --- a/common/usbx_host_controllers/src/ux_hcd_ehci_power_on_port.c +++ b/common/usbx_host_controllers/src/ux_hcd_ehci_power_on_port.c @@ -35,7 +35,7 @@ /* FUNCTION RELEASE */ /* */ /* _ux_hcd_ehci_power_on_port PORTABLE C */ -/* 6.0 */ +/* 6.1 */ /* AUTHOR */ /* */ /* Chaoqiong Xiao, Microsoft Corporation */ @@ -66,6 +66,8 @@ /* 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 */ /* */ /**************************************************************************/ UINT _ux_hcd_ehci_power_on_port(UX_HCD_EHCI *hcd_ehci, ULONG port_index) diff --git a/common/usbx_host_controllers/src/ux_hcd_ehci_power_root_hubs.c b/common/usbx_host_controllers/src/ux_hcd_ehci_power_root_hubs.c index 0499c7a..d86233d 100644 --- a/common/usbx_host_controllers/src/ux_hcd_ehci_power_root_hubs.c +++ b/common/usbx_host_controllers/src/ux_hcd_ehci_power_root_hubs.c @@ -35,7 +35,7 @@ /* FUNCTION RELEASE */ /* */ /* _ux_hcd_ehci_power_root_hubs PORTABLE C */ -/* 6.0 */ +/* 6.1 */ /* AUTHOR */ /* */ /* Chaoqiong Xiao, Microsoft Corporation */ @@ -68,6 +68,8 @@ /* 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 */ /* */ /**************************************************************************/ VOID _ux_hcd_ehci_power_root_hubs(UX_HCD_EHCI *hcd_ehci) diff --git a/common/usbx_host_controllers/src/ux_hcd_ehci_register_read.c b/common/usbx_host_controllers/src/ux_hcd_ehci_register_read.c index 1a78a98..01d8fc7 100644 --- a/common/usbx_host_controllers/src/ux_hcd_ehci_register_read.c +++ b/common/usbx_host_controllers/src/ux_hcd_ehci_register_read.c @@ -35,7 +35,7 @@ /* FUNCTION RELEASE */ /* */ /* _ux_hcd_ehci_register_read PORTABLE C */ -/* 6.0 */ +/* 6.1 */ /* AUTHOR */ /* */ /* Chaoqiong Xiao, Microsoft Corporation */ @@ -67,6 +67,8 @@ /* 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 */ /* */ /**************************************************************************/ ULONG _ux_hcd_ehci_register_read(UX_HCD_EHCI *hcd_ehci, ULONG ehci_register) diff --git a/common/usbx_host_controllers/src/ux_hcd_ehci_register_write.c b/common/usbx_host_controllers/src/ux_hcd_ehci_register_write.c index 9b6ccb4..971c413 100644 --- a/common/usbx_host_controllers/src/ux_hcd_ehci_register_write.c +++ b/common/usbx_host_controllers/src/ux_hcd_ehci_register_write.c @@ -35,7 +35,7 @@ /* FUNCTION RELEASE */ /* */ /* _ux_hcd_ehci_register_write PORTABLE C */ -/* 6.0 */ +/* 6.1 */ /* AUTHOR */ /* */ /* Chaoqiong Xiao, Microsoft Corporation */ @@ -67,6 +67,8 @@ /* 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 */ /* */ /**************************************************************************/ VOID _ux_hcd_ehci_register_write(UX_HCD_EHCI *hcd_ehci, ULONG ehci_register, ULONG value) diff --git a/common/usbx_host_controllers/src/ux_hcd_ehci_regular_td_obtain.c b/common/usbx_host_controllers/src/ux_hcd_ehci_regular_td_obtain.c index 705f66b..7a5a08b 100644 --- a/common/usbx_host_controllers/src/ux_hcd_ehci_regular_td_obtain.c +++ b/common/usbx_host_controllers/src/ux_hcd_ehci_regular_td_obtain.c @@ -35,7 +35,7 @@ /* FUNCTION RELEASE */ /* */ /* _ux_hcd_ehci_regular_td_obtain PORTABLE C */ -/* 6.0 */ +/* 6.1 */ /* AUTHOR */ /* */ /* Chaoqiong Xiao, Microsoft Corporation */ @@ -67,6 +67,10 @@ /* DATE NAME DESCRIPTION */ /* */ /* 05-19-2020 Chaoqiong Xiao Initial Version 6.0 */ +/* 09-30-2020 Chaoqiong Xiao Modified comment(s), */ +/* verified memset and memcpy */ +/* cases, */ +/* resulting in version 6.1 */ /* */ /**************************************************************************/ UX_EHCI_TD *_ux_hcd_ehci_regular_td_obtain(UX_HCD_EHCI *hcd_ehci) @@ -90,7 +94,7 @@ ULONG td_element; { /* The TD may have been used, so we reset all fields. */ - _ux_utility_memory_set(td, 0, sizeof(UX_EHCI_TD)); + _ux_utility_memory_set(td, 0, sizeof(UX_EHCI_TD)); /* Use case of memset is verified. */ /* This TD is now marked as USED. */ td -> ux_ehci_td_status = UX_USED; diff --git a/common/usbx_host_controllers/src/ux_hcd_ehci_request_bulk_transfer.c b/common/usbx_host_controllers/src/ux_hcd_ehci_request_bulk_transfer.c index 9e62567..6e9d3f1 100644 --- a/common/usbx_host_controllers/src/ux_hcd_ehci_request_bulk_transfer.c +++ b/common/usbx_host_controllers/src/ux_hcd_ehci_request_bulk_transfer.c @@ -35,7 +35,7 @@ /* FUNCTION RELEASE */ /* */ /* _ux_hcd_ehci_request_bulk_transfer PORTABLE C */ -/* 6.0 */ +/* 6.1 */ /* AUTHOR */ /* */ /* Chaoqiong Xiao, Microsoft Corporation */ @@ -70,6 +70,8 @@ /* 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 */ /* */ /**************************************************************************/ UINT _ux_hcd_ehci_request_bulk_transfer(UX_HCD_EHCI *hcd_ehci, UX_TRANSFER *transfer_request) 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 bdc53da..5e0857f 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.0 */ +/* 6.1 */ /* AUTHOR */ /* */ /* Chaoqiong Xiao, Microsoft Corporation */ @@ -79,6 +79,9 @@ /* DATE NAME DESCRIPTION */ /* */ /* 05-19-2020 Chaoqiong Xiao Initial Version 6.0 */ +/* 09-30-2020 Chaoqiong Xiao Modified comment(s), */ +/* prefixed UX to MS_TO_TICK, */ +/* resulting in version 6.1 */ /* */ /**************************************************************************/ UINT _ux_hcd_ehci_request_control_transfer(UX_HCD_EHCI *hcd_ehci, UX_TRANSFER *transfer_request) @@ -205,7 +208,7 @@ UINT pid; ed -> ux_ehci_ed_queue_element = (UX_EHCI_TD *) td_component; /* Wait for the completion of the transfer request. */ - status = _ux_utility_semaphore_get(&transfer_request -> ux_transfer_request_semaphore, MS_TO_TICK(UX_CONTROL_TRANSFER_TIMEOUT)); + status = _ux_utility_semaphore_get(&transfer_request -> ux_transfer_request_semaphore, UX_MS_TO_TICK(UX_CONTROL_TRANSFER_TIMEOUT)); /* If the semaphore did not succeed we probably have a time out. */ if (status != UX_SUCCESS) diff --git a/common/usbx_host_controllers/src/ux_hcd_ehci_request_interrupt_transfer.c b/common/usbx_host_controllers/src/ux_hcd_ehci_request_interrupt_transfer.c index 740104f..64506d5 100644 --- a/common/usbx_host_controllers/src/ux_hcd_ehci_request_interrupt_transfer.c +++ b/common/usbx_host_controllers/src/ux_hcd_ehci_request_interrupt_transfer.c @@ -35,7 +35,7 @@ /* FUNCTION RELEASE */ /* */ /* _ux_hcd_ehci_request_interrupt_transfer PORTABLE C */ -/* 6.0 */ +/* 6.1 */ /* AUTHOR */ /* */ /* Chaoqiong Xiao, Microsoft Corporation */ @@ -69,6 +69,8 @@ /* 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 */ /* */ /**************************************************************************/ UINT _ux_hcd_ehci_request_interrupt_transfer(UX_HCD_EHCI *hcd_ehci, UX_TRANSFER *transfer_request) diff --git a/common/usbx_host_controllers/src/ux_hcd_ehci_request_isochronous_transfer.c b/common/usbx_host_controllers/src/ux_hcd_ehci_request_isochronous_transfer.c index 938cc5c..43e8405 100644 --- a/common/usbx_host_controllers/src/ux_hcd_ehci_request_isochronous_transfer.c +++ b/common/usbx_host_controllers/src/ux_hcd_ehci_request_isochronous_transfer.c @@ -35,7 +35,7 @@ /* FUNCTION RELEASE */ /* */ /* _ux_hcd_ehci_request_isochronous_transfer PORTABLE C */ -/* 6.0 */ +/* 6.1 */ /* AUTHOR */ /* */ /* Chaoqiong Xiao, Microsoft Corporation */ @@ -78,6 +78,8 @@ /* 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 */ /* */ /**************************************************************************/ UINT _ux_hcd_ehci_request_isochronous_transfer(UX_HCD_EHCI *hcd_ehci, UX_TRANSFER *transfer_request) diff --git a/common/usbx_host_controllers/src/ux_hcd_ehci_request_transfer.c b/common/usbx_host_controllers/src/ux_hcd_ehci_request_transfer.c index 11aa77d..4a2de47 100644 --- a/common/usbx_host_controllers/src/ux_hcd_ehci_request_transfer.c +++ b/common/usbx_host_controllers/src/ux_hcd_ehci_request_transfer.c @@ -35,7 +35,7 @@ /* FUNCTION RELEASE */ /* */ /* _ux_hcd_ehci_request_transfer PORTABLE C */ -/* 6.0 */ +/* 6.1 */ /* AUTHOR */ /* */ /* Chaoqiong Xiao, Microsoft Corporation */ @@ -75,6 +75,8 @@ /* 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 */ /* */ /**************************************************************************/ UINT _ux_hcd_ehci_request_transfer(UX_HCD_EHCI *hcd_ehci, UX_TRANSFER *transfer_request) diff --git a/common/usbx_host_controllers/src/ux_hcd_ehci_request_transfer_add.c b/common/usbx_host_controllers/src/ux_hcd_ehci_request_transfer_add.c index 599fdc5..7eb65d5 100644 --- a/common/usbx_host_controllers/src/ux_hcd_ehci_request_transfer_add.c +++ b/common/usbx_host_controllers/src/ux_hcd_ehci_request_transfer_add.c @@ -35,7 +35,7 @@ /* FUNCTION RELEASE */ /* */ /* _ux_hcd_ehci_request_transfer_add PORTABLE C */ -/* 6.0 */ +/* 6.1 */ /* AUTHOR */ /* */ /* Chaoqiong Xiao, Microsoft Corporation */ @@ -74,6 +74,8 @@ /* 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 */ /* */ /**************************************************************************/ UINT _ux_hcd_ehci_request_transfer_add(UX_HCD_EHCI *hcd_ehci, UX_EHCI_ED *ed, ULONG phase, ULONG pid, diff --git a/common/usbx_host_controllers/src/ux_hcd_ehci_transfer_abort.c b/common/usbx_host_controllers/src/ux_hcd_ehci_transfer_abort.c index 92d3619..771b218 100644 --- a/common/usbx_host_controllers/src/ux_hcd_ehci_transfer_abort.c +++ b/common/usbx_host_controllers/src/ux_hcd_ehci_transfer_abort.c @@ -35,7 +35,7 @@ /* FUNCTION RELEASE */ /* */ /* _ux_hcd_ehci_transfer_abort PORTABLE C */ -/* 6.0 */ +/* 6.1 */ /* AUTHOR */ /* */ /* Chaoqiong Xiao, Microsoft Corporation */ @@ -71,6 +71,8 @@ /* 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 */ /* */ /**************************************************************************/ UINT _ux_hcd_ehci_transfer_abort(UX_HCD_EHCI *hcd_ehci,UX_TRANSFER *transfer_request) diff --git a/common/usbx_host_controllers/src/ux_hcd_ehci_transfer_request_process.c b/common/usbx_host_controllers/src/ux_hcd_ehci_transfer_request_process.c index 8c1e2df..7744bc0 100644 --- a/common/usbx_host_controllers/src/ux_hcd_ehci_transfer_request_process.c +++ b/common/usbx_host_controllers/src/ux_hcd_ehci_transfer_request_process.c @@ -35,7 +35,7 @@ /* FUNCTION RELEASE */ /* */ /* _ux_hcd_ehci_transfer_request_process PORTABLE C */ -/* 6.0 */ +/* 6.1 */ /* AUTHOR */ /* */ /* Chaoqiong Xiao, Microsoft Corporation */ @@ -71,6 +71,8 @@ /* 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 */ /* */ /**************************************************************************/ VOID _ux_hcd_ehci_transfer_request_process(UX_TRANSFER *transfer_request) diff --git a/common/usbx_host_controllers/src/ux_hcd_ohci_asynchronous_endpoint_create.c b/common/usbx_host_controllers/src/ux_hcd_ohci_asynchronous_endpoint_create.c index 36127c4..6012699 100644 --- a/common/usbx_host_controllers/src/ux_hcd_ohci_asynchronous_endpoint_create.c +++ b/common/usbx_host_controllers/src/ux_hcd_ohci_asynchronous_endpoint_create.c @@ -35,7 +35,7 @@ /* FUNCTION RELEASE */ /* */ /* _ux_hcd_ohci_asynchronous_endpoint_create PORTABLE C */ -/* 6.0 */ +/* 6.1 */ /* AUTHOR */ /* */ /* Chaoqiong Xiao, Microsoft Corporation */ @@ -70,6 +70,8 @@ /* 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 */ /* */ /**************************************************************************/ UINT _ux_hcd_ohci_asynchronous_endpoint_create(UX_HCD_OHCI *hcd_ohci, UX_ENDPOINT *endpoint) diff --git a/common/usbx_host_controllers/src/ux_hcd_ohci_asynchronous_endpoint_destroy.c b/common/usbx_host_controllers/src/ux_hcd_ohci_asynchronous_endpoint_destroy.c index 4c30840..d197298 100644 --- a/common/usbx_host_controllers/src/ux_hcd_ohci_asynchronous_endpoint_destroy.c +++ b/common/usbx_host_controllers/src/ux_hcd_ohci_asynchronous_endpoint_destroy.c @@ -35,7 +35,7 @@ /* FUNCTION RELEASE */ /* */ /* _ux_hcd_ohci_asynchronous_endpoint_destroy PORTABLE C */ -/* 6.0.2 */ +/* 6.1 */ /* AUTHOR */ /* */ /* Chaoqiong Xiao, Microsoft Corporation */ @@ -70,10 +70,10 @@ /* DATE NAME DESCRIPTION */ /* */ /* 05-19-2020 Chaoqiong Xiao Initial Version 6.0 */ -/* 08-14-2020 Chaoqiong Xiao Modified comment(s), */ +/* 09-30-2020 Chaoqiong Xiao Modified comment(s), */ /* fixed physical and virtual */ /* address conversion, */ -/* resulting in version 6.0.2 */ +/* resulting in version 6.1 */ /* */ /**************************************************************************/ UINT _ux_hcd_ohci_asynchronous_endpoint_destroy(UX_HCD_OHCI *hcd_ohci, UX_ENDPOINT *endpoint) diff --git a/common/usbx_host_controllers/src/ux_hcd_ohci_controller_disable.c b/common/usbx_host_controllers/src/ux_hcd_ohci_controller_disable.c index 0edbc33..b4067f8 100644 --- a/common/usbx_host_controllers/src/ux_hcd_ohci_controller_disable.c +++ b/common/usbx_host_controllers/src/ux_hcd_ohci_controller_disable.c @@ -35,7 +35,7 @@ /* FUNCTION RELEASE */ /* */ /* _ux_hcd_ohci_controller_disable PORTABLE C */ -/* 6.0 */ +/* 6.1 */ /* AUTHOR */ /* */ /* Chaoqiong Xiao, Microsoft Corporation */ @@ -68,6 +68,8 @@ /* 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 */ /* */ /**************************************************************************/ UINT _ux_hcd_ohci_controller_disable(UX_HCD_OHCI *hcd_ohci) diff --git a/common/usbx_host_controllers/src/ux_hcd_ohci_done_queue_process.c b/common/usbx_host_controllers/src/ux_hcd_ohci_done_queue_process.c index a104172..2aa4e1c 100644 --- a/common/usbx_host_controllers/src/ux_hcd_ohci_done_queue_process.c +++ b/common/usbx_host_controllers/src/ux_hcd_ohci_done_queue_process.c @@ -35,7 +35,7 @@ /* FUNCTION RELEASE */ /* */ /* _ux_hcd_ohci_done_queue_process PORTABLE C */ -/* 6.0 */ +/* 6.1 */ /* AUTHOR */ /* */ /* Chaoqiong Xiao, Microsoft Corporation */ @@ -78,6 +78,8 @@ /* 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 */ /* */ /**************************************************************************/ VOID _ux_hcd_ohci_done_queue_process(UX_HCD_OHCI *hcd_ohci) diff --git a/common/usbx_host_controllers/src/ux_hcd_ohci_ed_obtain.c b/common/usbx_host_controllers/src/ux_hcd_ohci_ed_obtain.c index 1f8c660..05a3ba1 100644 --- a/common/usbx_host_controllers/src/ux_hcd_ohci_ed_obtain.c +++ b/common/usbx_host_controllers/src/ux_hcd_ohci_ed_obtain.c @@ -35,7 +35,7 @@ /* FUNCTION RELEASE */ /* */ /* _ux_hcd_ohci_ed_obtain PORTABLE C */ -/* 6.0 */ +/* 6.1 */ /* AUTHOR */ /* */ /* Chaoqiong Xiao, Microsoft Corporation */ @@ -65,6 +65,10 @@ /* DATE NAME DESCRIPTION */ /* */ /* 05-19-2020 Chaoqiong Xiao Initial Version 6.0 */ +/* 09-30-2020 Chaoqiong Xiao Modified comment(s), */ +/* verified memset and memcpy */ +/* cases, */ +/* resulting in version 6.1 */ /* */ /**************************************************************************/ UX_OHCI_ED *_ux_hcd_ohci_ed_obtain(UX_HCD_OHCI *hcd_ohci) @@ -84,7 +88,7 @@ ULONG ed_index; { /* The ED may have been used, so we reset all fields. */ - _ux_utility_memory_set(ed, 0, sizeof(UX_OHCI_ED)); + _ux_utility_memory_set(ed, 0, sizeof(UX_OHCI_ED)); /* Use case of memset is verified. */ /* This ED is now marked as USED. */ ed -> ux_ohci_ed_status = UX_USED; diff --git a/common/usbx_host_controllers/src/ux_hcd_ohci_endpoint_error_clear.c b/common/usbx_host_controllers/src/ux_hcd_ohci_endpoint_error_clear.c index 81ab6cd..6cdfd28 100644 --- a/common/usbx_host_controllers/src/ux_hcd_ohci_endpoint_error_clear.c +++ b/common/usbx_host_controllers/src/ux_hcd_ohci_endpoint_error_clear.c @@ -35,7 +35,7 @@ /* FUNCTION RELEASE */ /* */ /* _ux_hcd_ohci_endpoint_error_clear PORTABLE C */ -/* 6.0 */ +/* 6.1 */ /* AUTHOR */ /* */ /* Chaoqiong Xiao, Microsoft Corporation */ @@ -67,6 +67,8 @@ /* 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 */ /* */ /**************************************************************************/ UINT _ux_hcd_ohci_endpoint_error_clear(UX_HCD_OHCI *hcd_ohci, UX_ENDPOINT *endpoint) diff --git a/common/usbx_host_controllers/src/ux_hcd_ohci_endpoint_reset.c b/common/usbx_host_controllers/src/ux_hcd_ohci_endpoint_reset.c index 110242e..57a02a1 100644 --- a/common/usbx_host_controllers/src/ux_hcd_ohci_endpoint_reset.c +++ b/common/usbx_host_controllers/src/ux_hcd_ohci_endpoint_reset.c @@ -35,7 +35,7 @@ /* FUNCTION RELEASE */ /* */ /* _ux_hcd_ohci_endpoint_reset PORTABLE C */ -/* 6.0 */ +/* 6.1 */ /* AUTHOR */ /* */ /* Chaoqiong Xiao, Microsoft Corporation */ @@ -66,6 +66,8 @@ /* 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 */ /* */ /**************************************************************************/ UINT _ux_hcd_ohci_endpoint_reset(UX_HCD_OHCI *hcd_ohci, UX_ENDPOINT *endpoint) diff --git a/common/usbx_host_controllers/src/ux_hcd_ohci_entry.c b/common/usbx_host_controllers/src/ux_hcd_ohci_entry.c index 31ef6c0..5ce37ff 100644 --- a/common/usbx_host_controllers/src/ux_hcd_ohci_entry.c +++ b/common/usbx_host_controllers/src/ux_hcd_ohci_entry.c @@ -35,7 +35,7 @@ /* FUNCTION RELEASE */ /* */ /* _ux_hcd_ohci_entry PORTABLE C */ -/* 6.0 */ +/* 6.1 */ /* AUTHOR */ /* */ /* Chaoqiong Xiao, Microsoft Corporation */ @@ -87,6 +87,8 @@ /* 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 */ /* */ /**************************************************************************/ UINT _ux_hcd_ohci_entry(UX_HCD *hcd, UINT function, VOID *parameter) diff --git a/common/usbx_host_controllers/src/ux_hcd_ohci_frame_number_get.c b/common/usbx_host_controllers/src/ux_hcd_ohci_frame_number_get.c index 8eb44ca..92c6087 100644 --- a/common/usbx_host_controllers/src/ux_hcd_ohci_frame_number_get.c +++ b/common/usbx_host_controllers/src/ux_hcd_ohci_frame_number_get.c @@ -35,7 +35,7 @@ /* FUNCTION RELEASE */ /* */ /* _ux_hcd_ohci_frame_number_get PORTABLE C */ -/* 6.0 */ +/* 6.1 */ /* AUTHOR */ /* */ /* Chaoqiong Xiao, Microsoft Corporation */ @@ -69,6 +69,8 @@ /* 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 */ /* */ /**************************************************************************/ UINT _ux_hcd_ohci_frame_number_get(UX_HCD_OHCI *hcd_ohci, ULONG *frame_number) diff --git a/common/usbx_host_controllers/src/ux_hcd_ohci_frame_number_set.c b/common/usbx_host_controllers/src/ux_hcd_ohci_frame_number_set.c index 96d90c2..7beeacd 100644 --- a/common/usbx_host_controllers/src/ux_hcd_ohci_frame_number_set.c +++ b/common/usbx_host_controllers/src/ux_hcd_ohci_frame_number_set.c @@ -35,7 +35,7 @@ /* FUNCTION RELEASE */ /* */ /* _ux_hcd_ohci_frame_number_set PORTABLE C */ -/* 6.0 */ +/* 6.1 */ /* AUTHOR */ /* */ /* Chaoqiong Xiao, Microsoft Corporation */ @@ -69,6 +69,8 @@ /* 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 */ /* */ /**************************************************************************/ VOID _ux_hcd_ohci_frame_number_set(UX_HCD_OHCI *hcd_ohci, ULONG frame_number) diff --git a/common/usbx_host_controllers/src/ux_hcd_ohci_initialize.c b/common/usbx_host_controllers/src/ux_hcd_ohci_initialize.c index 509e424..5930ebf 100644 --- a/common/usbx_host_controllers/src/ux_hcd_ohci_initialize.c +++ b/common/usbx_host_controllers/src/ux_hcd_ohci_initialize.c @@ -35,7 +35,7 @@ /* FUNCTION RELEASE */ /* */ /* _ux_hcd_ohci_initialize PORTABLE C */ -/* 6.0 */ +/* 6.1 */ /* AUTHOR */ /* */ /* Chaoqiong Xiao, Microsoft Corporation */ @@ -75,6 +75,10 @@ /* DATE NAME DESCRIPTION */ /* */ /* 05-19-2020 Chaoqiong Xiao Initial Version 6.0 */ +/* 09-30-2020 Chaoqiong Xiao Modified comment(s), */ +/* optimized based on compile */ +/* definitions, */ +/* resulting in version 6.1 */ /* */ /**************************************************************************/ UINT _ux_hcd_ohci_initialize(UX_HCD *hcd) @@ -88,10 +92,12 @@ UINT status; /* The controller initialized here is of OHCI type. */ hcd -> ux_hcd_controller_type = UX_OHCI_CONTROLLER; - + +#if UX_MAX_DEVICES > 1 /* Initialize the max bandwidth for periodic endpoints. On OHCI, the spec says no more than 90% to be allocated for periodic. */ hcd -> ux_hcd_available_bandwidth = UX_OHCI_AVAILABLE_BANDWIDTH; +#endif /* Allocate memory for this OHCI HCD instance. */ hcd_ohci = _ux_utility_memory_allocate(UX_NO_ALIGN, UX_REGULAR_MEMORY, sizeof(UX_HCD_OHCI)); @@ -139,9 +145,12 @@ UINT status; if (status != UX_SUCCESS) return(status); +#if UX_MAX_DEVICES > 1 + /* Read the OHCI controller version, it is either USB 1.0 or 1.1. This is important for filtering INT out endpoints on a 1.0 OHCI. */ hcd -> ux_hcd_version = _ux_hcd_ohci_register_read(hcd_ohci, OHCI_HC_REVISION); +#endif /* Set the state of the OHCI controller to reset in the control register. This is not compulsory but some controllers demand to start in this state. */ @@ -213,7 +222,9 @@ UINT status; for the generic HCD container and the local OHCI container. */ ohci_register = _ux_hcd_ohci_register_read(hcd_ohci, OHCI_HC_RH_DESCRIPTOR_A); hcd -> ux_hcd_nb_root_hubs = (UINT) (ohci_register & 0xff); - hcd_ohci -> ux_hcd_ohci_nb_root_hubs = (UINT) (ohci_register & 0xff); + if (hcd -> ux_hcd_nb_root_hubs > UX_MAX_ROOTHUB_PORT) + hcd -> ux_hcd_nb_root_hubs = UX_MAX_ROOTHUB_PORT; + hcd_ohci -> ux_hcd_ohci_nb_root_hubs = hcd -> ux_hcd_nb_root_hubs; /* All ports must now be powered to pick up device insertion. */ _ux_hcd_ohci_power_root_hubs(hcd_ohci); diff --git a/common/usbx_host_controllers/src/ux_hcd_ohci_interrupt_endpoint_create.c b/common/usbx_host_controllers/src/ux_hcd_ohci_interrupt_endpoint_create.c index 932925e..0deb9f5 100644 --- a/common/usbx_host_controllers/src/ux_hcd_ohci_interrupt_endpoint_create.c +++ b/common/usbx_host_controllers/src/ux_hcd_ohci_interrupt_endpoint_create.c @@ -35,7 +35,7 @@ /* FUNCTION RELEASE */ /* */ /* _ux_hcd_ohci_interrupt_endpoint_create PORTABLE C */ -/* 6.0.2 */ +/* 6.1 */ /* AUTHOR */ /* */ /* Chaoqiong Xiao, Microsoft Corporation */ @@ -87,10 +87,10 @@ /* DATE NAME DESCRIPTION */ /* */ /* 05-19-2020 Chaoqiong Xiao Initial Version 6.0 */ -/* 08-14-2020 Chaoqiong Xiao Modified comment(s), */ +/* 09-30-2020 Chaoqiong Xiao Modified comment(s), */ /* fixed physical and virtual */ /* address conversion, */ -/* resulting in version 6.0.2 */ +/* resulting in version 6.1 */ /* */ /**************************************************************************/ UINT _ux_hcd_ohci_interrupt_endpoint_create(UX_HCD_OHCI *hcd_ohci, UX_ENDPOINT *endpoint) diff --git a/common/usbx_host_controllers/src/ux_hcd_ohci_interrupt_handler.c b/common/usbx_host_controllers/src/ux_hcd_ohci_interrupt_handler.c index c1877ed..c20e6ed 100644 --- a/common/usbx_host_controllers/src/ux_hcd_ohci_interrupt_handler.c +++ b/common/usbx_host_controllers/src/ux_hcd_ohci_interrupt_handler.c @@ -35,7 +35,7 @@ /* FUNCTION RELEASE */ /* */ /* _ux_hcd_ohci_interrupt_handler PORTABLE C */ -/* 6.0 */ +/* 6.1 */ /* AUTHOR */ /* */ /* Chaoqiong Xiao, Microsoft Corporation */ @@ -75,6 +75,8 @@ /* 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 */ /* */ /**************************************************************************/ VOID _ux_hcd_ohci_interrupt_handler(VOID) diff --git a/common/usbx_host_controllers/src/ux_hcd_ohci_isochronous_endpoint_create.c b/common/usbx_host_controllers/src/ux_hcd_ohci_isochronous_endpoint_create.c index 988be0e..2c342d2 100644 --- a/common/usbx_host_controllers/src/ux_hcd_ohci_isochronous_endpoint_create.c +++ b/common/usbx_host_controllers/src/ux_hcd_ohci_isochronous_endpoint_create.c @@ -35,7 +35,7 @@ /* FUNCTION RELEASE */ /* */ /* _ux_hcd_ohci_isochronous_endpoint_create PORTABLE C */ -/* 6.0 */ +/* 6.1 */ /* AUTHOR */ /* */ /* Chaoqiong Xiao, Microsoft Corporation */ @@ -69,6 +69,8 @@ /* 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 */ /* */ /**************************************************************************/ UINT _ux_hcd_ohci_isochronous_endpoint_create(UX_HCD_OHCI *hcd_ohci, UX_ENDPOINT *endpoint) diff --git a/common/usbx_host_controllers/src/ux_hcd_ohci_isochronous_td_obtain.c b/common/usbx_host_controllers/src/ux_hcd_ohci_isochronous_td_obtain.c index dfb0690..0b8767d 100644 --- a/common/usbx_host_controllers/src/ux_hcd_ohci_isochronous_td_obtain.c +++ b/common/usbx_host_controllers/src/ux_hcd_ohci_isochronous_td_obtain.c @@ -35,7 +35,7 @@ /* FUNCTION RELEASE */ /* */ /* _ux_hcd_ohci_isochronous_td_obtain PORTABLE C */ -/* 6.0 */ +/* 6.1 */ /* AUTHOR */ /* */ /* Chaoqiong Xiao, Microsoft Corporation */ @@ -65,6 +65,10 @@ /* DATE NAME DESCRIPTION */ /* */ /* 05-19-2020 Chaoqiong Xiao Initial Version 6.0 */ +/* 09-30-2020 Chaoqiong Xiao Modified comment(s), */ +/* verified memset and memcpy */ +/* cases, */ +/* resulting in version 6.1 */ /* */ /**************************************************************************/ UX_OHCI_ISO_TD *_ux_hcd_ohci_isochronous_td_obtain(UX_HCD_OHCI *hcd_ohci) @@ -84,7 +88,7 @@ ULONG td_index; { /* The TD may have been used, so we reset all fields. */ - _ux_utility_memory_set(td, 0, sizeof(UX_OHCI_ISO_TD)); + _ux_utility_memory_set(td, 0, sizeof(UX_OHCI_ISO_TD)); /* Use case of memset is verified. */ /* This TD is now marked as USED. */ td -> ux_ohci_iso_td_status = UX_USED; diff --git a/common/usbx_host_controllers/src/ux_hcd_ohci_least_traffic_list_get.c b/common/usbx_host_controllers/src/ux_hcd_ohci_least_traffic_list_get.c index 1ee868a..630d5b3 100644 --- a/common/usbx_host_controllers/src/ux_hcd_ohci_least_traffic_list_get.c +++ b/common/usbx_host_controllers/src/ux_hcd_ohci_least_traffic_list_get.c @@ -35,7 +35,7 @@ /* FUNCTION RELEASE */ /* */ /* _ux_hcd_ohci_least_traffic_list_get PORTABLE C */ -/* 6.0 */ +/* 6.1 */ /* AUTHOR */ /* */ /* Chaoqiong Xiao, Microsoft Corporation */ @@ -66,6 +66,8 @@ /* 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 */ /* */ /**************************************************************************/ UX_OHCI_ED *_ux_hcd_ohci_least_traffic_list_get(UX_HCD_OHCI *hcd_ohci) diff --git a/common/usbx_host_controllers/src/ux_hcd_ohci_next_td_clean.c b/common/usbx_host_controllers/src/ux_hcd_ohci_next_td_clean.c index b6b57e2..20bf887 100644 --- a/common/usbx_host_controllers/src/ux_hcd_ohci_next_td_clean.c +++ b/common/usbx_host_controllers/src/ux_hcd_ohci_next_td_clean.c @@ -35,7 +35,7 @@ /* FUNCTION RELEASE */ /* */ /* _ux_hcd_ohci_next_td_clean PORTABLE C */ -/* 6.0.2 */ +/* 6.1 */ /* AUTHOR */ /* */ /* Chaoqiong Xiao, Microsoft Corporation */ @@ -67,10 +67,10 @@ /* DATE NAME DESCRIPTION */ /* */ /* 05-19-2020 Chaoqiong Xiao Initial Version 6.0 */ -/* 08-14-2020 Chaoqiong Xiao Modified comment(s), */ +/* 09-30-2020 Chaoqiong Xiao Modified comment(s), */ /* fixed physical and virtual */ /* address conversion, */ -/* resulting in version 6.0.2 */ +/* resulting in version 6.1 */ /* */ /**************************************************************************/ VOID _ux_hcd_ohci_next_td_clean(UX_OHCI_TD *td) diff --git a/common/usbx_host_controllers/src/ux_hcd_ohci_periodic_endpoint_destroy.c b/common/usbx_host_controllers/src/ux_hcd_ohci_periodic_endpoint_destroy.c index 9e70d63..103e13b 100644 --- a/common/usbx_host_controllers/src/ux_hcd_ohci_periodic_endpoint_destroy.c +++ b/common/usbx_host_controllers/src/ux_hcd_ohci_periodic_endpoint_destroy.c @@ -35,7 +35,7 @@ /* FUNCTION RELEASE */ /* */ /* _ux_hcd_ohci_periodic_endpoint_destroy PORTABLE C */ -/* 6.0.2 */ +/* 6.1 */ /* AUTHOR */ /* */ /* Chaoqiong Xiao, Microsoft Corporation */ @@ -66,10 +66,10 @@ /* DATE NAME DESCRIPTION */ /* */ /* 05-19-2020 Chaoqiong Xiao Initial Version 6.0 */ -/* 08-14-2020 Chaoqiong Xiao Modified comment(s), */ +/* 09-30-2020 Chaoqiong Xiao Modified comment(s), */ /* fixed physical and virtual */ /* address conversion, */ -/* resulting in version 6.0.2 */ +/* resulting in version 6.1 */ /* */ /**************************************************************************/ UINT _ux_hcd_ohci_periodic_endpoint_destroy(UX_HCD_OHCI *hcd_ohci, UX_ENDPOINT *endpoint) diff --git a/common/usbx_host_controllers/src/ux_hcd_ohci_periodic_tree_create.c b/common/usbx_host_controllers/src/ux_hcd_ohci_periodic_tree_create.c index b193ac0..6d7e520 100644 --- a/common/usbx_host_controllers/src/ux_hcd_ohci_periodic_tree_create.c +++ b/common/usbx_host_controllers/src/ux_hcd_ohci_periodic_tree_create.c @@ -35,7 +35,7 @@ /* FUNCTION RELEASE */ /* */ /* _ux_hcd_ohci_periodic_tree_create PORTABLE C */ -/* 6.0 */ +/* 6.1 */ /* AUTHOR */ /* */ /* Chaoqiong Xiao, Microsoft Corporation */ @@ -67,6 +67,8 @@ /* 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 */ /* */ /**************************************************************************/ UINT _ux_hcd_ohci_periodic_tree_create(UX_HCD_OHCI *hcd_ohci) diff --git a/common/usbx_host_controllers/src/ux_hcd_ohci_port_disable.c b/common/usbx_host_controllers/src/ux_hcd_ohci_port_disable.c index 35f4bdb..de37fb3 100644 --- a/common/usbx_host_controllers/src/ux_hcd_ohci_port_disable.c +++ b/common/usbx_host_controllers/src/ux_hcd_ohci_port_disable.c @@ -35,7 +35,7 @@ /* FUNCTION RELEASE */ /* */ /* _ux_hcd_ohci_port_disable PORTABLE C */ -/* 6.0 */ +/* 6.1 */ /* AUTHOR */ /* */ /* Chaoqiong Xiao, Microsoft Corporation */ @@ -68,6 +68,8 @@ /* 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 */ /* */ /**************************************************************************/ UINT _ux_hcd_ohci_port_disable(UX_HCD_OHCI *hcd_ohci, ULONG port_index) diff --git a/common/usbx_host_controllers/src/ux_hcd_ohci_port_enable.c b/common/usbx_host_controllers/src/ux_hcd_ohci_port_enable.c index 377d572..9c4b4aa 100644 --- a/common/usbx_host_controllers/src/ux_hcd_ohci_port_enable.c +++ b/common/usbx_host_controllers/src/ux_hcd_ohci_port_enable.c @@ -35,7 +35,7 @@ /* FUNCTION RELEASE */ /* */ /* _ux_hcd_ohci_port_enable PORTABLE C */ -/* 6.0 */ +/* 6.1 */ /* AUTHOR */ /* */ /* Chaoqiong Xiao, Microsoft Corporation */ @@ -69,6 +69,8 @@ /* 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 */ /* */ /**************************************************************************/ UINT _ux_hcd_ohci_port_enable(UX_HCD_OHCI *hcd_ohci, ULONG port_index) diff --git a/common/usbx_host_controllers/src/ux_hcd_ohci_port_reset.c b/common/usbx_host_controllers/src/ux_hcd_ohci_port_reset.c index ab1cab9..654347a 100644 --- a/common/usbx_host_controllers/src/ux_hcd_ohci_port_reset.c +++ b/common/usbx_host_controllers/src/ux_hcd_ohci_port_reset.c @@ -35,7 +35,7 @@ /* FUNCTION RELEASE */ /* */ /* _ux_hcd_ohci_port_reset PORTABLE C */ -/* 6.0 */ +/* 6.1 */ /* AUTHOR */ /* */ /* Chaoqiong Xiao, Microsoft Corporation */ @@ -68,6 +68,8 @@ /* 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 */ /* */ /**************************************************************************/ UINT _ux_hcd_ohci_port_reset(UX_HCD_OHCI *hcd_ohci, ULONG port_index) diff --git a/common/usbx_host_controllers/src/ux_hcd_ohci_port_resume.c b/common/usbx_host_controllers/src/ux_hcd_ohci_port_resume.c index 36a6d98..b52596f 100644 --- a/common/usbx_host_controllers/src/ux_hcd_ohci_port_resume.c +++ b/common/usbx_host_controllers/src/ux_hcd_ohci_port_resume.c @@ -35,7 +35,7 @@ /* FUNCTION RELEASE */ /* */ /* _ux_hcd_ohci_port_resume PORTABLE C */ -/* 6.0 */ +/* 6.1 */ /* AUTHOR */ /* */ /* Chaoqiong Xiao, Microsoft Corporation */ @@ -67,6 +67,8 @@ /* 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 */ /* */ /**************************************************************************/ UINT _ux_hcd_ohci_port_resume(UX_HCD_OHCI *hcd_ohci, UINT port_index) diff --git a/common/usbx_host_controllers/src/ux_hcd_ohci_port_status_get.c b/common/usbx_host_controllers/src/ux_hcd_ohci_port_status_get.c index 5a935d5..983ab0a 100644 --- a/common/usbx_host_controllers/src/ux_hcd_ohci_port_status_get.c +++ b/common/usbx_host_controllers/src/ux_hcd_ohci_port_status_get.c @@ -35,7 +35,7 @@ /* FUNCTION RELEASE */ /* */ /* _ux_hcd_ohci_port_status_get PORTABLE C */ -/* 6.0 */ +/* 6.1 */ /* AUTHOR */ /* */ /* Chaoqiong Xiao, Microsoft Corporation */ @@ -92,6 +92,8 @@ /* 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 */ /* */ /**************************************************************************/ ULONG _ux_hcd_ohci_port_status_get(UX_HCD_OHCI *hcd_ohci, ULONG port_index) diff --git a/common/usbx_host_controllers/src/ux_hcd_ohci_port_suspend.c b/common/usbx_host_controllers/src/ux_hcd_ohci_port_suspend.c index b51c494..74bf105 100644 --- a/common/usbx_host_controllers/src/ux_hcd_ohci_port_suspend.c +++ b/common/usbx_host_controllers/src/ux_hcd_ohci_port_suspend.c @@ -35,7 +35,7 @@ /* FUNCTION RELEASE */ /* */ /* _ux_hcd_ohci_port_suspend PORTABLE C */ -/* 6.0 */ +/* 6.1 */ /* AUTHOR */ /* */ /* Chaoqiong Xiao, Microsoft Corporation */ @@ -67,6 +67,8 @@ /* 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 */ /* */ /**************************************************************************/ UINT _ux_hcd_ohci_port_suspend(UX_HCD_OHCI *hcd_ohci, ULONG port_index) diff --git a/common/usbx_host_controllers/src/ux_hcd_ohci_power_down_port.c b/common/usbx_host_controllers/src/ux_hcd_ohci_power_down_port.c index b52158c..f10c215 100644 --- a/common/usbx_host_controllers/src/ux_hcd_ohci_power_down_port.c +++ b/common/usbx_host_controllers/src/ux_hcd_ohci_power_down_port.c @@ -35,7 +35,7 @@ /* FUNCTION RELEASE */ /* */ /* _ux_hcd_ohci_power_down_port PORTABLE C */ -/* 6.0 */ +/* 6.1 */ /* AUTHOR */ /* */ /* Chaoqiong Xiao, Microsoft Corporation */ @@ -67,6 +67,8 @@ /* 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 */ /* */ /**************************************************************************/ UINT _ux_hcd_ohci_power_down_port(UX_HCD_OHCI *hcd_ohci, ULONG port_index) diff --git a/common/usbx_host_controllers/src/ux_hcd_ohci_power_on_port.c b/common/usbx_host_controllers/src/ux_hcd_ohci_power_on_port.c index 40c4f81..0b6ca5d 100644 --- a/common/usbx_host_controllers/src/ux_hcd_ohci_power_on_port.c +++ b/common/usbx_host_controllers/src/ux_hcd_ohci_power_on_port.c @@ -35,7 +35,7 @@ /* FUNCTION RELEASE */ /* */ /* _ux_hcd_ohci_power_on_port PORTABLE C */ -/* 6.0 */ +/* 6.1 */ /* AUTHOR */ /* */ /* Chaoqiong Xiao, Microsoft Corporation */ @@ -66,6 +66,8 @@ /* 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 */ /* */ /**************************************************************************/ UINT _ux_hcd_ohci_power_on_port(UX_HCD_OHCI *hcd_ohci, ULONG port_index) diff --git a/common/usbx_host_controllers/src/ux_hcd_ohci_power_root_hubs.c b/common/usbx_host_controllers/src/ux_hcd_ohci_power_root_hubs.c index a85cbf8..62fba5d 100644 --- a/common/usbx_host_controllers/src/ux_hcd_ohci_power_root_hubs.c +++ b/common/usbx_host_controllers/src/ux_hcd_ohci_power_root_hubs.c @@ -35,7 +35,7 @@ /* FUNCTION RELEASE */ /* */ /* _ux_hcd_ohci_power_root_hubs PORTABLE C */ -/* 6.0 */ +/* 6.1 */ /* AUTHOR */ /* */ /* Chaoqiong Xiao, Microsoft Corporation */ @@ -68,6 +68,8 @@ /* 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 */ /* */ /**************************************************************************/ VOID _ux_hcd_ohci_power_root_hubs(UX_HCD_OHCI *hcd_ohci) diff --git a/common/usbx_host_controllers/src/ux_hcd_ohci_register_read.c b/common/usbx_host_controllers/src/ux_hcd_ohci_register_read.c index 23ae571..e1bb2af 100644 --- a/common/usbx_host_controllers/src/ux_hcd_ohci_register_read.c +++ b/common/usbx_host_controllers/src/ux_hcd_ohci_register_read.c @@ -35,7 +35,7 @@ /* FUNCTION RELEASE */ /* */ /* _ux_hcd_ohci_register_read PORTABLE C */ -/* 6.0 */ +/* 6.1 */ /* AUTHOR */ /* */ /* Chaoqiong Xiao, Microsoft Corporation */ @@ -66,6 +66,8 @@ /* 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 */ /* */ /**************************************************************************/ ULONG _ux_hcd_ohci_register_read(UX_HCD_OHCI *hcd_ohci, ULONG ohci_register) diff --git a/common/usbx_host_controllers/src/ux_hcd_ohci_register_write.c b/common/usbx_host_controllers/src/ux_hcd_ohci_register_write.c index be3f026..611419a 100644 --- a/common/usbx_host_controllers/src/ux_hcd_ohci_register_write.c +++ b/common/usbx_host_controllers/src/ux_hcd_ohci_register_write.c @@ -35,7 +35,7 @@ /* FUNCTION RELEASE */ /* */ /* _ux_hcd_ohci_register_write PORTABLE C */ -/* 6.0 */ +/* 6.1 */ /* AUTHOR */ /* */ /* Chaoqiong Xiao, Microsoft Corporation */ @@ -67,6 +67,8 @@ /* 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 */ /* */ /**************************************************************************/ VOID _ux_hcd_ohci_register_write(UX_HCD_OHCI *hcd_ohci, ULONG ohci_register, ULONG value) diff --git a/common/usbx_host_controllers/src/ux_hcd_ohci_regular_td_obtain.c b/common/usbx_host_controllers/src/ux_hcd_ohci_regular_td_obtain.c index 8f9b275..71bf441 100644 --- a/common/usbx_host_controllers/src/ux_hcd_ohci_regular_td_obtain.c +++ b/common/usbx_host_controllers/src/ux_hcd_ohci_regular_td_obtain.c @@ -35,7 +35,7 @@ /* FUNCTION RELEASE */ /* */ /* _ux_hcd_ohci_regular_td_obtain PORTABLE C */ -/* 6.0 */ +/* 6.1 */ /* AUTHOR */ /* */ /* Chaoqiong Xiao, Microsoft Corporation */ @@ -67,6 +67,10 @@ /* DATE NAME DESCRIPTION */ /* */ /* 05-19-2020 Chaoqiong Xiao Initial Version 6.0 */ +/* 09-30-2020 Chaoqiong Xiao Modified comment(s), */ +/* verified memset and memcpy */ +/* cases, */ +/* resulting in version 6.1 */ /* */ /**************************************************************************/ UX_OHCI_TD *_ux_hcd_ohci_regular_td_obtain(UX_HCD_OHCI *hcd_ohci) @@ -90,7 +94,7 @@ ULONG td_index; { /* The TD may have been used, so we reset all fields. */ - _ux_utility_memory_set(td, 0, sizeof(UX_OHCI_TD)); + _ux_utility_memory_set(td, 0, sizeof(UX_OHCI_TD)); /* Use case of memset is verified. */ /* This TD is now marked as USED. */ td -> ux_ohci_td_status = UX_USED; diff --git a/common/usbx_host_controllers/src/ux_hcd_ohci_request_bulk_transfer.c b/common/usbx_host_controllers/src/ux_hcd_ohci_request_bulk_transfer.c index d65c88f..3b0af7b 100644 --- a/common/usbx_host_controllers/src/ux_hcd_ohci_request_bulk_transfer.c +++ b/common/usbx_host_controllers/src/ux_hcd_ohci_request_bulk_transfer.c @@ -35,7 +35,7 @@ /* FUNCTION RELEASE */ /* */ /* _ux_hcd_ohci_request_bulk_transfer PORTABLE C */ -/* 6.0 */ +/* 6.1 */ /* AUTHOR */ /* */ /* Chaoqiong Xiao, Microsoft Corporation */ @@ -74,6 +74,8 @@ /* 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 */ /* */ /**************************************************************************/ UINT _ux_hcd_ohci_request_bulk_transfer(UX_HCD_OHCI *hcd_ohci, UX_TRANSFER *transfer_request) diff --git a/common/usbx_host_controllers/src/ux_hcd_ohci_request_control_transfer.c b/common/usbx_host_controllers/src/ux_hcd_ohci_request_control_transfer.c index a7900b9..23685c7 100644 --- a/common/usbx_host_controllers/src/ux_hcd_ohci_request_control_transfer.c +++ b/common/usbx_host_controllers/src/ux_hcd_ohci_request_control_transfer.c @@ -35,7 +35,7 @@ /* FUNCTION RELEASE */ /* */ /* _ux_hcd_ohci_request_control_transfer PORTABLE C */ -/* 6.0 */ +/* 6.1 */ /* AUTHOR */ /* */ /* Chaoqiong Xiao, Microsoft Corporation */ @@ -82,6 +82,9 @@ /* DATE NAME DESCRIPTION */ /* */ /* 05-19-2020 Chaoqiong Xiao Initial Version 6.0 */ +/* 09-30-2020 Chaoqiong Xiao Modified comment(s), */ +/* prefixed UX to MS_TO_TICK, */ +/* resulting in version 6.1 */ /* */ /**************************************************************************/ UINT _ux_hcd_ohci_request_control_transfer(UX_HCD_OHCI *hcd_ohci, UX_TRANSFER *transfer_request) @@ -244,7 +247,7 @@ UINT status; _ux_hcd_ohci_register_write(hcd_ohci, OHCI_HC_COMMAND_STATUS, ohci_register); /* Wait for the completion of the transfer request. */ - status = _ux_utility_semaphore_get(&transfer_request -> ux_transfer_request_semaphore, MS_TO_TICK(UX_CONTROL_TRANSFER_TIMEOUT)); + status = _ux_utility_semaphore_get(&transfer_request -> ux_transfer_request_semaphore, UX_MS_TO_TICK(UX_CONTROL_TRANSFER_TIMEOUT)); /* If the semaphore did not succeed we probably have a time out. */ if (status != UX_SUCCESS) diff --git a/common/usbx_host_controllers/src/ux_hcd_ohci_request_interupt_transfer.c b/common/usbx_host_controllers/src/ux_hcd_ohci_request_interupt_transfer.c index a981267..93fc96d 100644 --- a/common/usbx_host_controllers/src/ux_hcd_ohci_request_interupt_transfer.c +++ b/common/usbx_host_controllers/src/ux_hcd_ohci_request_interupt_transfer.c @@ -35,7 +35,7 @@ /* FUNCTION RELEASE */ /* */ /* _ux_hcd_ohci_request_interrupt_transfer PORTABLE C */ -/* 6.0 */ +/* 6.1 */ /* AUTHOR */ /* */ /* Chaoqiong Xiao, Microsoft Corporation */ @@ -71,6 +71,8 @@ /* 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 */ /* */ /**************************************************************************/ UINT _ux_hcd_ohci_request_interrupt_transfer(UX_HCD_OHCI *hcd_ohci, UX_TRANSFER *transfer_request) diff --git a/common/usbx_host_controllers/src/ux_hcd_ohci_request_isochronous_transfer.c b/common/usbx_host_controllers/src/ux_hcd_ohci_request_isochronous_transfer.c index 9000e0c..e83fb09 100644 --- a/common/usbx_host_controllers/src/ux_hcd_ohci_request_isochronous_transfer.c +++ b/common/usbx_host_controllers/src/ux_hcd_ohci_request_isochronous_transfer.c @@ -35,7 +35,7 @@ /* FUNCTION RELEASE */ /* */ /* _ux_hcd_ohci_request_isochronous_transfer PORTABLE C */ -/* 6.0 */ +/* 6.1 */ /* AUTHOR */ /* */ /* Chaoqiong Xiao, Microsoft Corporation */ @@ -70,6 +70,8 @@ /* 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 */ /* */ /**************************************************************************/ UINT _ux_hcd_ohci_request_isochronous_transfer(UX_HCD_OHCI *hcd_ohci, UX_TRANSFER *transfer_request) diff --git a/common/usbx_host_controllers/src/ux_hcd_ohci_request_transfer.c b/common/usbx_host_controllers/src/ux_hcd_ohci_request_transfer.c index a962860..9c59a86 100644 --- a/common/usbx_host_controllers/src/ux_hcd_ohci_request_transfer.c +++ b/common/usbx_host_controllers/src/ux_hcd_ohci_request_transfer.c @@ -35,7 +35,7 @@ /* FUNCTION RELEASE */ /* */ /* _ux_hcd_ohci_request_transfer PORTABLE C */ -/* 6.0 */ +/* 6.1 */ /* AUTHOR */ /* */ /* Chaoqiong Xiao, Microsoft Corporation */ @@ -72,6 +72,8 @@ /* 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 */ /* */ /**************************************************************************/ UINT _ux_hcd_ohci_request_transfer(UX_HCD_OHCI *hcd_ohci, UX_TRANSFER *transfer_request) diff --git a/common/usbx_host_controllers/src/ux_hcd_ohci_transfer_abort.c b/common/usbx_host_controllers/src/ux_hcd_ohci_transfer_abort.c index e76fb2f..ab59731 100644 --- a/common/usbx_host_controllers/src/ux_hcd_ohci_transfer_abort.c +++ b/common/usbx_host_controllers/src/ux_hcd_ohci_transfer_abort.c @@ -35,7 +35,7 @@ /* FUNCTION RELEASE */ /* */ /* _ux_hcd_ohci_transfer_abort PORTABLE C */ -/* 6.0.2 */ +/* 6.1 */ /* AUTHOR */ /* */ /* Chaoqiong Xiao, Microsoft Corporation */ @@ -69,10 +69,10 @@ /* DATE NAME DESCRIPTION */ /* */ /* 05-19-2020 Chaoqiong Xiao Initial Version 6.0 */ -/* 08-14-2020 Chaoqiong Xiao Modified comment(s), */ +/* 09-30-2020 Chaoqiong Xiao Modified comment(s), */ /* fixed physical and virtual */ /* address conversion, */ -/* resulting in version 6.0.2 */ +/* resulting in version 6.1 */ /* */ /**************************************************************************/ UINT _ux_hcd_ohci_transfer_abort(UX_HCD_OHCI *hcd_ohci, UX_TRANSFER *transfer_request) diff --git a/common/usbx_host_controllers/src/ux_hcd_ohci_transfer_request_process.c b/common/usbx_host_controllers/src/ux_hcd_ohci_transfer_request_process.c index ae7bb7a..faeede6 100644 --- a/common/usbx_host_controllers/src/ux_hcd_ohci_transfer_request_process.c +++ b/common/usbx_host_controllers/src/ux_hcd_ohci_transfer_request_process.c @@ -35,7 +35,7 @@ /* FUNCTION RELEASE */ /* */ /* _ux_hcd_ohci_transfer_request_process PORTABLE C */ -/* 6.0 */ +/* 6.1 */ /* AUTHOR */ /* */ /* Chaoqiong Xiao, Microsoft Corporation */ @@ -71,6 +71,8 @@ /* 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 */ /* */ /**************************************************************************/ VOID _ux_hcd_ohci_transfer_request_process(UX_TRANSFER *transfer_request) diff --git a/common/usbx_network/inc/ux_network_driver.h b/common/usbx_network/inc/ux_network_driver.h index 1e35c1d..ddfc5db 100644 --- a/common/usbx_network/inc/ux_network_driver.h +++ b/common/usbx_network/inc/ux_network_driver.h @@ -26,7 +26,7 @@ /* COMPONENT DEFINITION RELEASE */ /* */ /* ux_network_driver.h PORTABLE C */ -/* 6.0 */ +/* 6.1 */ /* AUTHOR */ /* */ /* Chaoqiong Xiao, Microsoft Corporation */ @@ -41,6 +41,8 @@ /* 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 */ /* */ /**************************************************************************/ diff --git a/common/usbx_network/src/ux_network_driver.c b/common/usbx_network/src/ux_network_driver.c index ae22d83..ce1c982 100644 --- a/common/usbx_network/src/ux_network_driver.c +++ b/common/usbx_network/src/ux_network_driver.c @@ -36,7 +36,7 @@ static USB_NETWORK_DEVICE_TYPE usb_network_devices[USB_NETWORK_DEVICE_MAX_INSTAN /* FUNCTION RELEASE */ /* */ /* _ux_network_init PORTABLE C */ -/* 6.0 */ +/* 6.1 */ /* AUTHOR */ /* */ /* Chaoqiong Xiao, Microsoft Corporation */ @@ -65,6 +65,10 @@ static USB_NETWORK_DEVICE_TYPE usb_network_devices[USB_NETWORK_DEVICE_MAX_INSTAN /* DATE NAME DESCRIPTION */ /* */ /* 05-19-2020 Chaoqiong Xiao Initial Version 6.0 */ +/* 09-30-2020 Chaoqiong Xiao Modified comment(s), */ +/* verified memset and memcpy */ +/* cases, */ +/* resulting in version 6.1 */ /* */ /**************************************************************************/ UINT _ux_network_driver_init(VOID) @@ -80,7 +84,7 @@ UINT status = NX_SUCCESS; usb_network_driver_initialized = 1; /* Reset the network device memory array. */ - _ux_utility_memory_set(&usb_network_devices[0], 0, sizeof(usb_network_devices)); + _ux_utility_memory_set(&usb_network_devices[0], 0, sizeof(usb_network_devices)); /* Use case of memset is verified. */ } return(status); @@ -91,7 +95,7 @@ UINT status = NX_SUCCESS; /* FUNCTION RELEASE */ /* */ /* _ux_network_driver_activate PORTABLE C */ -/* 6.0 */ +/* 6.1 */ /* AUTHOR */ /* */ /* Chaoqiong Xiao, Microsoft Corporation */ @@ -136,6 +140,11 @@ UINT status = NX_SUCCESS; /* DATE NAME DESCRIPTION */ /* */ /* 05-19-2020 Chaoqiong Xiao Initial Version 6.0 */ +/* 09-30-2020 Chaoqiong Xiao Modified comment(s), */ +/* used UX prefix to refer to */ +/* TX symbols instead of using */ +/* them directly, */ +/* resulting in version 6.1 */ /* */ /**************************************************************************/ @@ -143,12 +152,12 @@ UINT _ux_network_driver_activate(VOID *ux_instance, UINT(*ux_network_device_writ VOID **ux_network_handle, ULONG physical_address_msw, ULONG physical_address_lsw) { -TX_INTERRUPT_SAVE_AREA +UX_INTERRUPT_SAVE_AREA UINT i; /* Critical section. */ - TX_DISABLE + UX_DISABLE /* Find an available entry in the usb_network_devices table. */ for (i = 0; i < USB_NETWORK_DEVICE_MAX_INSTANCES; i++) @@ -166,7 +175,7 @@ UINT i; } /* Unprotect the critical section. */ - TX_RESTORE + UX_RESTORE /* Did we reach the max number of instance ? */ if (i == USB_NETWORK_DEVICE_MAX_INSTANCES) @@ -236,7 +245,7 @@ UINT i; /* FUNCTION RELEASE */ /* */ /* _ux_network_driver_deactivate PORTABLE C */ -/* 6.0 */ +/* 6.1 */ /* AUTHOR */ /* */ /* Chaoqiong Xiao, Microsoft Corporation */ @@ -281,12 +290,17 @@ UINT i; /* DATE NAME DESCRIPTION */ /* */ /* 05-19-2020 Chaoqiong Xiao Initial Version 6.0 */ +/* 09-30-2020 Chaoqiong Xiao Modified comment(s), */ +/* used UX prefix to refer to */ +/* TX symbols instead of using */ +/* them directly, */ +/* resulting in version 6.1 */ /* */ /**************************************************************************/ UINT _ux_network_driver_deactivate(VOID *ux_instance, VOID *ux_network_handle) { -TX_INTERRUPT_SAVE_AREA +UX_INTERRUPT_SAVE_AREA USB_NETWORK_DEVICE_TYPE *usb_network_device; @@ -300,13 +314,13 @@ USB_NETWORK_DEVICE_TYPE *usb_network_device; usb_network_device = (USB_NETWORK_DEVICE_TYPE*) ux_network_handle; /* Critical section. */ - TX_DISABLE + UX_DISABLE /* The link is down. */ _ux_network_driver_link_down(ux_network_handle); /* Unprotect the critical section. */ - TX_RESTORE + UX_RESTORE /* Are the sync objects valid? */ if (usb_network_device -> ux_network_device_activated_by_thread) @@ -365,7 +379,7 @@ USB_NETWORK_DEVICE_TYPE *usb_network_device; /* FUNCTION RELEASE */ /* */ /* _ux_network_driver_entry PORTABLE C */ -/* 6.0 */ +/* 6.1 */ /* AUTHOR */ /* */ /* Chaoqiong Xiao, Microsoft Corporation */ @@ -397,13 +411,18 @@ USB_NETWORK_DEVICE_TYPE *usb_network_device; /* DATE NAME DESCRIPTION */ /* */ /* 05-19-2020 Chaoqiong Xiao Initial Version 6.0 */ +/* 09-30-2020 Chaoqiong Xiao Modified comment(s), */ +/* used UX prefix to refer to */ +/* TX symbols instead of using */ +/* them directly, */ +/* resulting in version 6.1 */ /* */ /**************************************************************************/ VOID _ux_network_driver_entry(NX_IP_DRIVER *nx_ip_driver) { -TX_INTERRUPT_SAVE_AREA +UX_INTERRUPT_SAVE_AREA NX_IP *nx_ip; NX_PACKET *packet_ptr; ULONG *ethernet_frame_ptr; @@ -425,7 +444,7 @@ UINT i; { /* Critical section. */ - TX_DISABLE + UX_DISABLE /* Find an available entry in the usb_network_devices table. */ for (i = 0; i < USB_NETWORK_DEVICE_MAX_INSTANCES; i++) @@ -460,7 +479,7 @@ UINT i; } /* Unprotect the critical section. */ - TX_RESTORE + UX_RESTORE } else { @@ -702,7 +721,7 @@ UINT i; /* FUNCTION RELEASE */ /* */ /* _ux_network_driver_packet_received PORTABLE C */ -/* 6.0 */ +/* 6.1 */ /* AUTHOR */ /* */ /* Chaoqiong Xiao, Microsoft Corporation */ @@ -735,6 +754,8 @@ UINT i; /* 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 */ /* */ /**************************************************************************/ @@ -830,7 +851,7 @@ NX_IP *nx_ip; /* FUNCTION RELEASE */ /* */ /* _ux_network_driver_link_up PORTABLE C */ -/* 6.0 */ +/* 6.1 */ /* AUTHOR */ /* */ /* Chaoqiong Xiao, Microsoft Corporation */ @@ -861,6 +882,8 @@ NX_IP *nx_ip; /* 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 */ /* */ /**************************************************************************/ @@ -890,7 +913,7 @@ USB_NETWORK_DEVICE_TYPE *usb_network_device_ptr = (USB_NETWORK_DEVICE_TYPE*)ux_n /* FUNCTION RELEASE */ /* */ /* _ux_network_driver_link_down PORTABLE C */ -/* 6.0 */ +/* 6.1 */ /* AUTHOR */ /* */ /* Chaoqiong Xiao, Microsoft Corporation */ @@ -921,6 +944,8 @@ USB_NETWORK_DEVICE_TYPE *usb_network_device_ptr = (USB_NETWORK_DEVICE_TYPE*)ux_n /* 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 */ /* */ /**************************************************************************/ VOID _ux_network_driver_link_down(VOID *ux_network_handle) diff --git a/common/usbx_pictbridge/inc/ux_pictbridge.h b/common/usbx_pictbridge/inc/ux_pictbridge.h index 6ec8a7e..012b0da 100644 --- a/common/usbx_pictbridge/inc/ux_pictbridge.h +++ b/common/usbx_pictbridge/inc/ux_pictbridge.h @@ -26,7 +26,7 @@ /* COMPONENT DEFINITION RELEASE */ /* */ /* ux_pictbridge.h PORTABLE C */ -/* 6.0 */ +/* 6.1 */ /* AUTHOR */ /* */ /* Chaoqiong Xiao, Microsoft Corporation */ @@ -41,6 +41,11 @@ /* DATE NAME DESCRIPTION */ /* */ /* 05-19-2020 Chaoqiong Xiao Initial Version 6.0 */ +/* 09-30-2020 Chaoqiong Xiao Modified comment(s), */ +/* used UX prefix to refer to */ +/* TX symbols instead of using */ +/* them directly, */ +/* resulting in version 6.1 */ /* */ /**************************************************************************/ @@ -623,10 +628,10 @@ typedef struct UX_PICTBRIDGE_STRUCT UX_PICTBRIDGE_EVENT *ux_pictbridge_event_array_head; UX_PICTBRIDGE_EVENT *ux_pictbridge_event_array_tail; UX_PICTBRIDGE_EVENT *ux_pictbridge_event_array_end; - TX_SEMAPHORE ux_pictbridge_notification_semaphore; + UX_SEMAPHORE ux_pictbridge_notification_semaphore; UCHAR *ux_pictbridge_thread_stack; - TX_THREAD ux_pictbridge_thread; - TX_EVENT_FLAGS_GROUP ux_pictbridge_event_flags_group; + UX_THREAD ux_pictbridge_thread; + UX_EVENT_FLAGS_GROUP ux_pictbridge_event_flags_group; ULONG ux_pictbridge_operation_result; ULONG ux_pictbridge_output_result; ULONG ux_pictbridge_xml_report_direction; 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 c555fa0..6944122 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.0 */ +/* 6.1 */ /* AUTHOR */ /* */ /* Chaoqiong Xiao, Microsoft Corporation */ @@ -64,6 +64,8 @@ /* 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 */ /* */ /**************************************************************************/ UINT _ux_pictbridge_array_element_to_array_hexa(UCHAR *element, ULONG *hexa_array) diff --git a/common/usbx_pictbridge/src/ux_pictbridge_data.c b/common/usbx_pictbridge/src/ux_pictbridge_data.c index 1c6f432..39c6ba4 100644 --- a/common/usbx_pictbridge/src/ux_pictbridge_data.c +++ b/common/usbx_pictbridge/src/ux_pictbridge_data.c @@ -31,8 +31,8 @@ /* */ /* COMPONENT DEFINITION RELEASE */ /* */ -/* ux_pictbridge_data PORTABLE C */ -/* 6.0 */ +/* ux_pictbridge_data.c PORTABLE C */ +/* 6.1 */ /* AUTHOR */ /* */ /* Chaoqiong Xiao, Microsoft Corporation */ @@ -46,6 +46,8 @@ /* 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 */ /* */ /**************************************************************************/ diff --git a/common/usbx_pictbridge/src/ux_pictbridge_dpsclient_api_abortjob.c b/common/usbx_pictbridge/src/ux_pictbridge_dpsclient_api_abortjob.c index ff6dc4f..58b576d 100644 --- a/common/usbx_pictbridge/src/ux_pictbridge_dpsclient_api_abortjob.c +++ b/common/usbx_pictbridge/src/ux_pictbridge_dpsclient_api_abortjob.c @@ -34,8 +34,8 @@ /* */ /* FUNCTION RELEASE */ /* */ -/* _ux_pictbridge_dpsclient_api_abort_job PORTABLE C */ -/* 6.0 */ +/* _ux_pictbridge_dpsclient_api_abort_job PORTABLE C */ +/* 6.1 */ /* */ /* AUTHOR */ /* */ @@ -65,6 +65,11 @@ /* DATE NAME DESCRIPTION */ /* */ /* 05-19-2020 Chaoqiong Xiao Initial Version 6.0 */ +/* 09-30-2020 Chaoqiong Xiao Modified comment(s), */ +/* used UX prefix to refer to */ +/* TX symbols instead of using */ +/* them directly, */ +/* resulting in version 6.1 */ /* */ /**************************************************************************/ UINT _ux_pictbridge_dpsclient_api_abort_job(UX_PICTBRIDGE *pictbridge) @@ -81,7 +86,7 @@ ULONG actual_flags; /* We should wait for the host to send a script with the response. */ status = _ux_utility_event_flags_get(&pictbridge -> ux_pictbridge_event_flags_group, UX_PICTBRIDGE_EVENT_FLAG_ABORT_JOB, - TX_AND_CLEAR, &actual_flags, UX_PICTBRIDGE_EVENT_TIMEOUT); + UX_AND_CLEAR, &actual_flags, UX_PICTBRIDGE_EVENT_TIMEOUT); /* Check status. */ if (status != UX_SUCCESS) diff --git a/common/usbx_pictbridge/src/ux_pictbridge_dpsclient_api_capability.c b/common/usbx_pictbridge/src/ux_pictbridge_dpsclient_api_capability.c index 2240449..c1c2f49 100644 --- a/common/usbx_pictbridge/src/ux_pictbridge_dpsclient_api_capability.c +++ b/common/usbx_pictbridge/src/ux_pictbridge_dpsclient_api_capability.c @@ -34,8 +34,8 @@ /* */ /* FUNCTION RELEASE */ /* */ -/* _ux_pictbridge_dpsclient_api_configure_print_service PORTABLE C */ -/* 6.0 */ +/* _ux_pictbridge_dpsclient_api_capability PORTABLE C */ +/* 6.1 */ /* AUTHOR */ /* */ /* Chaoqiong Xiao, Microsoft Corporation */ @@ -70,6 +70,11 @@ /* DATE NAME DESCRIPTION */ /* */ /* 05-19-2020 Chaoqiong Xiao Initial Version 6.0 */ +/* 09-30-2020 Chaoqiong Xiao Modified comment(s), */ +/* used UX prefix to refer to */ +/* TX symbols instead of using */ +/* them directly, */ +/* resulting in version 6.1 */ /* */ /**************************************************************************/ UINT _ux_pictbridge_dpsclient_api_capability(UX_PICTBRIDGE *pictbridge, ULONG capability_code, @@ -91,7 +96,7 @@ ULONG actual_flags; /* We should wait for the host to send a script with the response. */ status = _ux_utility_event_flags_get(&pictbridge -> ux_pictbridge_event_flags_group, UX_PICTBRIDGE_EVENT_FLAG_CAPABILITY, - TX_AND_CLEAR, &actual_flags, UX_PICTBRIDGE_EVENT_TIMEOUT); + UX_AND_CLEAR, &actual_flags, UX_PICTBRIDGE_EVENT_TIMEOUT); /* Check status. */ if (status != UX_SUCCESS) diff --git a/common/usbx_pictbridge/src/ux_pictbridge_dpsclient_api_configure_print_service.c b/common/usbx_pictbridge/src/ux_pictbridge_dpsclient_api_configure_print_service.c index 8a78915..5db16a3 100644 --- a/common/usbx_pictbridge/src/ux_pictbridge_dpsclient_api_configure_print_service.c +++ b/common/usbx_pictbridge/src/ux_pictbridge_dpsclient_api_configure_print_service.c @@ -34,8 +34,9 @@ /* */ /* FUNCTION RELEASE */ /* */ -/* _ux_pictbridge_dpsclient_api_configure_print_service PORTABLE C */ -/* 6.0 */ +/* _ux_pictbridge_dpsclient_api_configure_print_service */ +/* PORTABLE C */ +/* 6.1 */ /* */ /* AUTHOR */ /* */ @@ -67,6 +68,11 @@ /* DATE NAME DESCRIPTION */ /* */ /* 05-19-2020 Chaoqiong Xiao Initial Version 6.0 */ +/* 09-30-2020 Chaoqiong Xiao Modified comment(s), */ +/* used UX prefix to refer to */ +/* TX symbols instead of using */ +/* them directly, */ +/* resulting in version 6.1 */ /* */ /**************************************************************************/ UINT _ux_pictbridge_dpsclient_api_configure_print_service(UX_PICTBRIDGE *pictbridge) @@ -86,7 +92,7 @@ ULONG actual_flags; /* We should wait for the host to send a script with the response. */ status = _ux_utility_event_flags_get(&pictbridge -> ux_pictbridge_event_flags_group, UX_PICTBRIDGE_EVENT_FLAG_CONFIGURE_PRINT_SERVICE, - TX_AND_CLEAR, &actual_flags, UX_PICTBRIDGE_EVENT_TIMEOUT); + UX_AND_CLEAR, &actual_flags, UX_PICTBRIDGE_EVENT_TIMEOUT); /* Check status. */ if (status != UX_SUCCESS) diff --git a/common/usbx_pictbridge/src/ux_pictbridge_dpsclient_api_continuejob.c b/common/usbx_pictbridge/src/ux_pictbridge_dpsclient_api_continuejob.c index 7d34b5f..c25e96d 100644 --- a/common/usbx_pictbridge/src/ux_pictbridge_dpsclient_api_continuejob.c +++ b/common/usbx_pictbridge/src/ux_pictbridge_dpsclient_api_continuejob.c @@ -34,8 +34,8 @@ /* */ /* FUNCTION RELEASE */ /* */ -/* _ux_pictbridge_dpsclient_api_abort_job PORTABLE C */ -/* 6.0 */ +/* _ux_pictbridge_dpsclient_api_continue_job PORTABLE C */ +/* 6.1 */ /* AUTHOR */ /* */ /* Chaoqiong Xiao, Microsoft Corporation */ @@ -64,6 +64,11 @@ /* DATE NAME DESCRIPTION */ /* */ /* 05-19-2020 Chaoqiong Xiao Initial Version 6.0 */ +/* 09-30-2020 Chaoqiong Xiao Modified comment(s), */ +/* used UX prefix to refer to */ +/* TX symbols instead of using */ +/* them directly, */ +/* resulting in version 6.1 */ /* */ /**************************************************************************/ UINT _ux_pictbridge_dpsclient_api_continue_job(UX_PICTBRIDGE *pictbridge) @@ -80,7 +85,7 @@ ULONG actual_flags; /* We should wait for the host to send a script with the response. */ status = _ux_utility_event_flags_get(&pictbridge -> ux_pictbridge_event_flags_group, UX_PICTBRIDGE_EVENT_FLAG_CONTINUE_JOB, - TX_AND_CLEAR, &actual_flags, UX_PICTBRIDGE_EVENT_TIMEOUT); + UX_AND_CLEAR, &actual_flags, UX_PICTBRIDGE_EVENT_TIMEOUT); /* Check status. */ if (status != UX_SUCCESS) diff --git a/common/usbx_pictbridge/src/ux_pictbridge_dpsclient_api_device_status.c b/common/usbx_pictbridge/src/ux_pictbridge_dpsclient_api_device_status.c index 66a2416..97cf773 100644 --- a/common/usbx_pictbridge/src/ux_pictbridge_dpsclient_api_device_status.c +++ b/common/usbx_pictbridge/src/ux_pictbridge_dpsclient_api_device_status.c @@ -34,8 +34,8 @@ /* */ /* FUNCTION RELEASE */ /* */ -/* _ux_pictbridge_dpsclient_api_device_status PORTABLE C */ -/* 6.0 */ +/* _ux_pictbridge_dpsclient_api_device_status PORTABLE C */ +/* 6.1 */ /* */ /* AUTHOR */ /* */ @@ -66,6 +66,11 @@ /* DATE NAME DESCRIPTION */ /* */ /* 05-19-2020 Chaoqiong Xiao Initial Version 6.0 */ +/* 09-30-2020 Chaoqiong Xiao Modified comment(s), */ +/* used UX prefix to refer to */ +/* TX symbols instead of using */ +/* them directly, */ +/* resulting in version 6.1 */ /* */ /**************************************************************************/ UINT _ux_pictbridge_dpsclient_api_device_status(UX_PICTBRIDGE *pictbridge) @@ -85,7 +90,7 @@ ULONG actual_flags; /* We should wait for the host to send a script with the response. */ status = _ux_utility_event_flags_get(&pictbridge -> ux_pictbridge_event_flags_group, UX_PICTBRIDGE_EVENT_FLAG_DEVICE_STATUS, - TX_AND_CLEAR, &actual_flags, UX_PICTBRIDGE_EVENT_TIMEOUT); + UX_AND_CLEAR, &actual_flags, UX_PICTBRIDGE_EVENT_TIMEOUT); /* Check status. */ if (status != UX_SUCCESS) diff --git a/common/usbx_pictbridge/src/ux_pictbridge_dpsclient_api_startjob.c b/common/usbx_pictbridge/src/ux_pictbridge_dpsclient_api_startjob.c index 5e29c95..2158552 100644 --- a/common/usbx_pictbridge/src/ux_pictbridge_dpsclient_api_startjob.c +++ b/common/usbx_pictbridge/src/ux_pictbridge_dpsclient_api_startjob.c @@ -34,8 +34,8 @@ /* */ /* FUNCTION RELEASE */ /* */ -/* _ux_pictbridge_dpsclient_api_start_job PORTABLE C */ -/* 6.0 */ +/* _ux_pictbridge_dpsclient_api_start_job PORTABLE C */ +/* 6.1 */ /* */ /* AUTHOR */ /* */ @@ -65,6 +65,11 @@ /* DATE NAME DESCRIPTION */ /* */ /* 05-19-2020 Chaoqiong Xiao Initial Version 6.0 */ +/* 09-30-2020 Chaoqiong Xiao Modified comment(s), */ +/* used UX prefix to refer to */ +/* TX symbols instead of using */ +/* them directly, */ +/* resulting in version 6.1 */ /* */ /**************************************************************************/ UINT _ux_pictbridge_dpsclient_api_start_job(UX_PICTBRIDGE *pictbridge) @@ -81,7 +86,7 @@ ULONG actual_flags; /* We should wait for the host to send a script with the response. */ status = _ux_utility_event_flags_get(&pictbridge -> ux_pictbridge_event_flags_group, UX_PICTBRIDGE_EVENT_FLAG_START_JOB, - TX_AND_CLEAR, &actual_flags, UX_PICTBRIDGE_EVENT_TIMEOUT); + UX_AND_CLEAR, &actual_flags, UX_PICTBRIDGE_EVENT_TIMEOUT); /* Check status. */ if (status != UX_SUCCESS) diff --git a/common/usbx_pictbridge/src/ux_pictbridge_dpsclient_input_object_abortjob.c b/common/usbx_pictbridge/src/ux_pictbridge_dpsclient_input_object_abortjob.c index 3767e38..851acac 100644 --- a/common/usbx_pictbridge/src/ux_pictbridge_dpsclient_input_object_abortjob.c +++ b/common/usbx_pictbridge/src/ux_pictbridge_dpsclient_input_object_abortjob.c @@ -36,7 +36,7 @@ /* */ /* _ux_pictbridge_dpsclient_input_abortjob */ /* PORTABLE C */ -/* 6.0 */ +/* 6.1 */ /* AUTHOR */ /* */ /* Chaoqiong Xiao, Microsoft Corporation */ @@ -71,6 +71,8 @@ /* 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 */ /* */ /**************************************************************************/ UINT _ux_pictbridge_dpsclient_input_object_abortjob(UX_PICTBRIDGE *pictbridge, diff --git a/common/usbx_pictbridge/src/ux_pictbridge_dpsclient_input_object_configure_print_service.c b/common/usbx_pictbridge/src/ux_pictbridge_dpsclient_input_object_configure_print_service.c index 2f28bd0..f2b66e8 100644 --- a/common/usbx_pictbridge/src/ux_pictbridge_dpsclient_input_object_configure_print_service.c +++ b/common/usbx_pictbridge/src/ux_pictbridge_dpsclient_input_object_configure_print_service.c @@ -36,7 +36,7 @@ /* */ /* _ux_pictbridge_dpsclient_input_object_configure_print_service */ /* PORTABLE C */ -/* 6.0 */ +/* 6.1 */ /* */ /* AUTHOR */ /* */ @@ -72,6 +72,8 @@ /* 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 */ /* */ /**************************************************************************/ UINT _ux_pictbridge_dpsclient_input_object_configure_print_service(UX_PICTBRIDGE *pictbridge, diff --git a/common/usbx_pictbridge/src/ux_pictbridge_dpsclient_input_object_continuejob.c b/common/usbx_pictbridge/src/ux_pictbridge_dpsclient_input_object_continuejob.c index 1b49ef5..f2d344e 100644 --- a/common/usbx_pictbridge/src/ux_pictbridge_dpsclient_input_object_continuejob.c +++ b/common/usbx_pictbridge/src/ux_pictbridge_dpsclient_input_object_continuejob.c @@ -36,7 +36,7 @@ /* */ /* _ux_pictbridge_dpsclient_input_continuejob */ /* PORTABLE C */ -/* 6.0 */ +/* 6.1 */ /* AUTHOR */ /* */ /* Chaoqiong Xiao, Microsoft Corporation */ @@ -71,6 +71,8 @@ /* 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 */ /* */ /**************************************************************************/ UINT _ux_pictbridge_dpsclient_input_object_continuejob(UX_PICTBRIDGE *pictbridge, diff --git a/common/usbx_pictbridge/src/ux_pictbridge_dpsclient_input_object_get_capability.c b/common/usbx_pictbridge/src/ux_pictbridge_dpsclient_input_object_get_capability.c index 72e8ec4..1fc65b3 100644 --- a/common/usbx_pictbridge/src/ux_pictbridge_dpsclient_input_object_get_capability.c +++ b/common/usbx_pictbridge/src/ux_pictbridge_dpsclient_input_object_get_capability.c @@ -36,7 +36,7 @@ /* */ /* _ux_pictbridge_dpsclient_input_get_capability */ /* PORTABLE C */ -/* 6.0 */ +/* 6.1 */ /* */ /* AUTHOR */ /* */ @@ -72,6 +72,8 @@ /* 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 */ /* */ /**************************************************************************/ UINT _ux_pictbridge_dpsclient_input_object_get_capability(UX_PICTBRIDGE *pictbridge, diff --git a/common/usbx_pictbridge/src/ux_pictbridge_dpsclient_input_object_prepare.c b/common/usbx_pictbridge/src/ux_pictbridge_dpsclient_input_object_prepare.c index 0ddca53..ab83b67 100644 --- a/common/usbx_pictbridge/src/ux_pictbridge_dpsclient_input_object_prepare.c +++ b/common/usbx_pictbridge/src/ux_pictbridge_dpsclient_input_object_prepare.c @@ -35,7 +35,7 @@ /* FUNCTION RELEASE */ /* */ /* _ux_pictbridge_dpsclient_input_object_prepare PORTABLE C */ -/* 6.0 */ +/* 6.1 */ /* AUTHOR */ /* */ /* Chaoqiong Xiao, Microsoft Corporation */ @@ -67,6 +67,12 @@ /* DATE NAME DESCRIPTION */ /* */ /* 05-19-2020 Chaoqiong Xiao Initial Version 6.0 */ +/* 09-30-2020 Chaoqiong Xiao Modified comment(s), */ +/* verified memset and memcpy */ +/* cases, used UX prefix to */ +/* refer to TX symbols instead */ +/* of using them directly, */ +/* resulting in version 6.1 */ /* */ /**************************************************************************/ UINT _ux_pictbridge_dpsclient_input_object_prepare(UX_PICTBRIDGE *pictbridge, @@ -91,7 +97,7 @@ ULONG actual_flags; /* We should wait for the state machine to allow our operation. */ status = _ux_utility_event_flags_get(&pictbridge -> ux_pictbridge_event_flags_group, UX_PICTBRIDGE_EVENT_FLAG_STATE_MACHINE_READY, - TX_AND_CLEAR, &actual_flags, UX_PICTBRIDGE_EVENT_TIMEOUT); + UX_AND_CLEAR, &actual_flags, UX_PICTBRIDGE_EVENT_TIMEOUT); /* Check status. */ if (status != UX_SUCCESS) @@ -115,7 +121,7 @@ ULONG actual_flags; object_length = 0; /* Clear the object memory buffer. */ - _ux_utility_memory_set(pima_object_buffer, 0, UX_PICTBRIDGE_MAX_PIMA_OBJECT_BUFFER); + _ux_utility_memory_set(pima_object_buffer, 0, UX_PICTBRIDGE_MAX_PIMA_OBJECT_BUFFER); /* Use case of memset is verified. */ /* Add the line <?xml version="1.0"?> */ status = _ux_pictbridge_object_tag_line_add(pima_object_buffer, object_length, _ux_pictbridge_xml_tag_line_xmlversion, diff --git a/common/usbx_pictbridge/src/ux_pictbridge_dpsclient_input_object_startjob.c b/common/usbx_pictbridge/src/ux_pictbridge_dpsclient_input_object_startjob.c index 6d7bdec..ea2efb2 100644 --- a/common/usbx_pictbridge/src/ux_pictbridge_dpsclient_input_object_startjob.c +++ b/common/usbx_pictbridge/src/ux_pictbridge_dpsclient_input_object_startjob.c @@ -36,7 +36,7 @@ /* */ /* _ux_pictbridge_dpsclient_input_start_job */ /* PORTABLE C */ -/* 6.0 */ +/* 6.1 */ /* AUTHOR */ /* */ /* Chaoqiong Xiao, Microsoft Corporation */ @@ -71,6 +71,8 @@ /* 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 */ /* */ /**************************************************************************/ UINT _ux_pictbridge_dpsclient_input_object_startjob(UX_PICTBRIDGE *pictbridge, diff --git a/common/usbx_pictbridge/src/ux_pictbridge_dpsclient_object_data_get.c b/common/usbx_pictbridge/src/ux_pictbridge_dpsclient_object_data_get.c index 225dac6..3c46144 100644 --- a/common/usbx_pictbridge/src/ux_pictbridge_dpsclient_object_data_get.c +++ b/common/usbx_pictbridge/src/ux_pictbridge_dpsclient_object_data_get.c @@ -35,7 +35,7 @@ /* FUNCTION RELEASE */ /* */ /* _ux_pictbridge_dpsclient_object_data_get PORTABLE C */ -/* 6.0 */ +/* 6.1 */ /* AUTHOR */ /* */ /* Chaoqiong Xiao, Microsoft Corporation */ @@ -64,6 +64,12 @@ /* DATE NAME DESCRIPTION */ /* */ /* 05-19-2020 Chaoqiong Xiao Initial Version 6.0 */ +/* 09-30-2020 Chaoqiong Xiao Modified comment(s), */ +/* verified memset and memcpy */ +/* cases, used UX prefix to */ +/* refer to TX symbols instead */ +/* of using them directly, */ +/* resulting in version 6.1 */ /* */ /**************************************************************************/ UINT _ux_pictbridge_dpsclient_object_data_get(UX_SLAVE_CLASS_PIMA *pima, ULONG object_handle, UCHAR *object_buffer, ULONG object_offset, @@ -97,7 +103,7 @@ UINT status; pima_object_buffer = object_info -> ux_device_class_pima_object_buffer; /* Copy the demanded object data portion. */ - _ux_utility_memory_copy(object_buffer, pima_object_buffer + object_offset, object_length_requested); + _ux_utility_memory_copy(object_buffer, pima_object_buffer + object_offset, object_length_requested); /* Use case of memcpy is verified. */ /* Update the length requested. for a demo, we do not do any checking. */ *object_actual_length = object_length_requested; @@ -109,7 +115,7 @@ UINT status; if (pictbridge -> ux_pictbridge_host_client_state_machine & UX_PICTBRIDGE_STATE_MACHINE_CLIENT_REQUEST_PENDING) /* Yes we are pending, send an event to release the pending request. */ - _ux_utility_event_flags_set(&pictbridge -> ux_pictbridge_event_flags_group, UX_PICTBRIDGE_EVENT_FLAG_STATE_MACHINE_READY, TX_OR); + _ux_utility_event_flags_set(&pictbridge -> ux_pictbridge_event_flags_group, UX_PICTBRIDGE_EVENT_FLAG_STATE_MACHINE_READY, UX_OR); /* Since we are in host request, this indicates we are done with the cycle. */ pictbridge -> ux_pictbridge_host_client_state_machine = UX_PICTBRIDGE_STATE_MACHINE_IDLE; diff --git a/common/usbx_pictbridge/src/ux_pictbridge_dpsclient_object_data_send.c b/common/usbx_pictbridge/src/ux_pictbridge_dpsclient_object_data_send.c index fec5f5b..adcf743 100644 --- a/common/usbx_pictbridge/src/ux_pictbridge_dpsclient_object_data_send.c +++ b/common/usbx_pictbridge/src/ux_pictbridge_dpsclient_object_data_send.c @@ -35,7 +35,7 @@ /* FUNCTION RELEASE */ /* */ /* _ux_pictbridge_dpsclient_object_data_send PORTABLE C */ -/* 6.0 */ +/* 6.1 */ /* AUTHOR */ /* */ /* Chaoqiong Xiao, Microsoft Corporation */ @@ -64,6 +64,12 @@ /* DATE NAME DESCRIPTION */ /* */ /* 05-19-2020 Chaoqiong Xiao Initial Version 6.0 */ +/* 09-30-2020 Chaoqiong Xiao Modified comment(s), */ +/* verified memset and memcpy */ +/* cases, used UX prefix to */ +/* refer to TX symbols instead */ +/* of using them directly, */ +/* resulting in version 6.1 */ /* */ /**************************************************************************/ UINT _ux_pictbridge_dpsclient_object_data_send(UX_SLAVE_CLASS_PIMA *pima, ULONG object_handle, @@ -102,7 +108,7 @@ UCHAR *pima_object_buffer; return(UX_MEMORY_INSUFFICIENT); /* Copy the demanded object data portion. */ - _ux_utility_memory_copy(pima_object_buffer + object_offset, object_buffer, object_length); + _ux_utility_memory_copy(pima_object_buffer + object_offset, object_buffer, object_length); /* Use case of memcpy is verified. */ /* Save the length of this object. */ object_info -> ux_device_class_pima_object_length = object_length; @@ -218,7 +224,7 @@ UCHAR *pima_object_buffer; } /* Send event to the application. */ - _ux_utility_event_flags_set(&pictbridge -> ux_pictbridge_event_flags_group, event_flag, TX_OR); + _ux_utility_event_flags_set(&pictbridge -> ux_pictbridge_event_flags_group, event_flag, UX_OR); } @@ -226,7 +232,7 @@ UCHAR *pima_object_buffer; { /* We have an error of some kind. Wake up the application with error event. */ - _ux_utility_event_flags_set(&pictbridge -> ux_pictbridge_event_flags_group, UX_PICTBRIDGE_EVENT_FLAG_ERROR, TX_OR); + _ux_utility_event_flags_set(&pictbridge -> ux_pictbridge_event_flags_group, UX_PICTBRIDGE_EVENT_FLAG_ERROR, UX_OR); } diff --git a/common/usbx_pictbridge/src/ux_pictbridge_dpsclient_object_delete.c b/common/usbx_pictbridge/src/ux_pictbridge_dpsclient_object_delete.c index 154f0de..6eba8b9 100644 --- a/common/usbx_pictbridge/src/ux_pictbridge_dpsclient_object_delete.c +++ b/common/usbx_pictbridge/src/ux_pictbridge_dpsclient_object_delete.c @@ -35,7 +35,7 @@ /* FUNCTION RELEASE */ /* */ /* _ux_pictbridge_dpsclient_object_delete PORTABLE C */ -/* 6.0 */ +/* 6.1 */ /* AUTHOR */ /* */ /* Chaoqiong Xiao, Microsoft Corporation */ @@ -64,6 +64,8 @@ /* 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 */ /* */ /**************************************************************************/ UINT _ux_pictbridge_dpsclient_object_delete(UX_SLAVE_CLASS_PIMA *pima, ULONG object_handle) diff --git a/common/usbx_pictbridge/src/ux_pictbridge_dpsclient_object_handles_get.c b/common/usbx_pictbridge/src/ux_pictbridge_dpsclient_object_handles_get.c index a84ac90..6ea33a5 100644 --- a/common/usbx_pictbridge/src/ux_pictbridge_dpsclient_object_handles_get.c +++ b/common/usbx_pictbridge/src/ux_pictbridge_dpsclient_object_handles_get.c @@ -35,7 +35,7 @@ /* FUNCTION RELEASE */ /* */ /* _ux_pictbridge_dpsclient_object_handles_get PORTABLE C */ -/* 6.0 */ +/* 6.1 */ /* AUTHOR */ /* */ /* Chaoqiong Xiao, Microsoft Corporation */ @@ -64,6 +64,8 @@ /* 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 */ /* */ /**************************************************************************/ UINT _ux_pictbridge_dpsclient_object_handles_get(UX_SLAVE_CLASS_PIMA *pima, diff --git a/common/usbx_pictbridge/src/ux_pictbridge_dpsclient_object_info_get.c b/common/usbx_pictbridge/src/ux_pictbridge_dpsclient_object_info_get.c index ac18110..3bbc9b4 100644 --- a/common/usbx_pictbridge/src/ux_pictbridge_dpsclient_object_info_get.c +++ b/common/usbx_pictbridge/src/ux_pictbridge_dpsclient_object_info_get.c @@ -35,7 +35,7 @@ /* FUNCTION RELEASE */ /* */ /* _ux_pictbridge_dpsclient_object_info_get PORTABLE C */ -/* 6.0 */ +/* 6.1 */ /* AUTHOR */ /* */ /* Chaoqiong Xiao, Microsoft Corporation */ @@ -64,6 +64,8 @@ /* 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 */ /* */ /**************************************************************************/ UINT _ux_pictbridge_dpsclient_object_info_get(UX_SLAVE_CLASS_PIMA *pima, ULONG object_handle, diff --git a/common/usbx_pictbridge/src/ux_pictbridge_dpsclient_object_info_send.c b/common/usbx_pictbridge/src/ux_pictbridge_dpsclient_object_info_send.c index 1e14127..cf4317d 100644 --- a/common/usbx_pictbridge/src/ux_pictbridge_dpsclient_object_info_send.c +++ b/common/usbx_pictbridge/src/ux_pictbridge_dpsclient_object_info_send.c @@ -35,7 +35,7 @@ /* FUNCTION RELEASE */ /* */ /* _ux_pictbridge_dpsclient_object_info_send PORTABLE C */ -/* 6.0 */ +/* 6.1 */ /* AUTHOR */ /* */ /* Chaoqiong Xiao, Microsoft Corporation */ @@ -64,6 +64,12 @@ /* DATE NAME DESCRIPTION */ /* */ /* 05-19-2020 Chaoqiong Xiao Initial Version 6.0 */ +/* 09-30-2020 Chaoqiong Xiao Modified comment(s), */ +/* verified memset and memcpy */ +/* cases, used UX prefix to */ +/* refer to TX symbols instead */ +/* of using them directly, */ +/* resulting in version 6.1 */ /* */ /**************************************************************************/ UINT _ux_pictbridge_dpsclient_object_info_send(UX_SLAVE_CLASS_PIMA *pima, UX_SLAVE_CLASS_PIMA_OBJECT *object, @@ -86,7 +92,7 @@ UINT length, length1; object_info = (UX_SLAVE_CLASS_PIMA_OBJECT *) pictbridge -> ux_pictbridge_object_host; /* Copy the demanded object info set. */ - _ux_utility_memory_copy(object_info, object, UX_SLAVE_CLASS_PIMA_OBJECT_DATA_LENGTH); + _ux_utility_memory_copy(object_info, object, UX_SLAVE_CLASS_PIMA_OBJECT_DATA_LENGTH); /* Use case of memcpy is verified. */ /* Store the object handle. In Pictbridge we only receive XML scripts so the handle is hardwired to 1. */ object_info -> ux_device_class_pima_object_handle_id = 1; @@ -128,7 +134,7 @@ UINT length, length1; pictbridge -> ux_pictbridge_discovery_state = UX_PICTBRIDGE_DPSCLIENT_DISCOVERY_COMPLETE; /* Set an event flag if the application is listening. */ - _ux_utility_event_flags_set(&pictbridge -> ux_pictbridge_event_flags_group, UX_PICTBRIDGE_EVENT_FLAG_DISCOVERY, TX_OR); + _ux_utility_event_flags_set(&pictbridge -> ux_pictbridge_event_flags_group, UX_PICTBRIDGE_EVENT_FLAG_DISCOVERY, UX_OR); /* There is no object during the discovery cycle. */ return(UX_SUCCESS); diff --git a/common/usbx_pictbridge/src/ux_pictbridge_dpsclient_object_number_get.c b/common/usbx_pictbridge/src/ux_pictbridge_dpsclient_object_number_get.c index 232cfdb..9894b6d 100644 --- a/common/usbx_pictbridge/src/ux_pictbridge_dpsclient_object_number_get.c +++ b/common/usbx_pictbridge/src/ux_pictbridge_dpsclient_object_number_get.c @@ -35,7 +35,7 @@ /* FUNCTION RELEASE */ /* */ /* _ux_pictbridge_dpsclient_object_number_get PORTABLE C */ -/* 6.0 */ +/* 6.1 */ /* AUTHOR */ /* */ /* Chaoqiong Xiao, Microsoft Corporation */ @@ -64,6 +64,8 @@ /* 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 */ /* */ /**************************************************************************/ UINT _ux_pictbridge_dpsclient_object_number_get(UX_SLAVE_CLASS_PIMA *pima, diff --git a/common/usbx_pictbridge/src/ux_pictbridge_dpsclient_register_event_callback_function.c b/common/usbx_pictbridge/src/ux_pictbridge_dpsclient_register_event_callback_function.c index bd8d6ca..d38eb7e 100644 --- a/common/usbx_pictbridge/src/ux_pictbridge_dpsclient_register_event_callback_function.c +++ b/common/usbx_pictbridge/src/ux_pictbridge_dpsclient_register_event_callback_function.c @@ -35,8 +35,9 @@ /* */ /* FUNCTION RELEASE */ /* */ -/* _ux_pictbridge_dpsclient_register_ PORTABLE C */ -/* 6.0 */ +/* _ux_pictbridge_dpsclient_register_event_callback_function */ +/* PORTABLE C */ +/* 6.1 */ /* */ /* AUTHOR */ /* */ @@ -67,6 +68,8 @@ /* 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 */ /* */ /**************************************************************************/ UINT _ux_pictbridge_dpsclient_register_event_callback_function(UX_PICTBRIDGE *pictbridge, UINT (*event_callback_function)(struct UX_PICTBRIDGE_STRUCT *pictbridge, UINT event_flag)) diff --git a/common/usbx_pictbridge/src/ux_pictbridge_dpsclient_start.c b/common/usbx_pictbridge/src/ux_pictbridge_dpsclient_start.c index 6c6cea7..ab7e7ff 100644 --- a/common/usbx_pictbridge/src/ux_pictbridge_dpsclient_start.c +++ b/common/usbx_pictbridge/src/ux_pictbridge_dpsclient_start.c @@ -36,7 +36,7 @@ /* FUNCTION RELEASE */ /* */ /* _ux_pictbridge_dpsclient_start PORTABLE C */ -/* 6.0 */ +/* 6.1 */ /* AUTHOR */ /* */ /* Chaoqiong Xiao, Microsoft Corporation */ @@ -65,6 +65,11 @@ /* DATE NAME DESCRIPTION */ /* */ /* 05-19-2020 Chaoqiong Xiao Initial Version 6.0 */ +/* 09-30-2020 Chaoqiong Xiao Modified comment(s), */ +/* used UX prefix to refer to */ +/* TX symbols instead of using */ +/* them directly, */ +/* resulting in version 6.1 */ /* */ /**************************************************************************/ UINT _ux_pictbridge_dpsclient_start(UX_PICTBRIDGE *pictbridge) @@ -166,7 +171,7 @@ UX_SLAVE_CLASS_PIMA_OBJECT *object_info; UX_PICTBRIDGE_THREAD_STACK_SIZE, UX_PICTBRIDGE_THREAD_PRIORITY_CLASS, UX_PICTBRIDGE_THREAD_PRIORITY_CLASS, - TX_NO_TIME_SLICE, TX_AUTO_START); + UX_NO_TIME_SLICE, UX_AUTO_START); /* Check the completion status. */ if (status != UX_SUCCESS) @@ -236,13 +241,13 @@ UX_SLAVE_CLASS_PIMA_OBJECT *object_info; { /* Free resources allocated so far. */ - if (pictbridge -> ux_pictbridge_thread.tx_thread_id != TX_EMPTY) + if (pictbridge -> ux_pictbridge_thread.tx_thread_id != UX_EMPTY) _ux_utility_thread_delete(&pictbridge -> ux_pictbridge_thread); if (pictbridge -> ux_pictbridge_thread_stack) _ux_utility_memory_free(pictbridge -> ux_pictbridge_thread_stack); - if (pictbridge -> ux_pictbridge_notification_semaphore.tx_semaphore_id != TX_EMPTY) + if (pictbridge -> ux_pictbridge_notification_semaphore.tx_semaphore_id != UX_EMPTY) _ux_utility_semaphore_delete(&pictbridge -> ux_pictbridge_notification_semaphore); - if (pictbridge -> ux_pictbridge_event_flags_group.tx_event_flags_group_id != TX_EMPTY) + if (pictbridge -> ux_pictbridge_event_flags_group.tx_event_flags_group_id != UX_EMPTY) _ux_utility_event_flags_delete(&pictbridge -> ux_pictbridge_event_flags_group); if (pictbridge -> ux_pictbridge_jobinfo.ux_pictbridge_jobinfo_object) { diff --git a/common/usbx_pictbridge/src/ux_pictbridge_dpsclient_thread.c b/common/usbx_pictbridge/src/ux_pictbridge_dpsclient_thread.c index e6391e8..bdb2f47 100644 --- a/common/usbx_pictbridge/src/ux_pictbridge_dpsclient_thread.c +++ b/common/usbx_pictbridge/src/ux_pictbridge_dpsclient_thread.c @@ -35,7 +35,7 @@ /* FUNCTION RELEASE */ /* */ /* _ux_pictbridge_dpsclient_thread PORTABLE C */ -/* 6.0 */ +/* 6.1 */ /* AUTHOR */ /* */ /* Chaoqiong Xiao, Microsoft Corporation */ @@ -65,6 +65,12 @@ /* DATE NAME DESCRIPTION */ /* */ /* 05-19-2020 Chaoqiong Xiao Initial Version 6.0 */ +/* 09-30-2020 Chaoqiong Xiao Modified comment(s), */ +/* verified memset and memcpy */ +/* cases, used UX prefix to */ +/* refer to TX symbols instead */ +/* of using them directly, */ +/* resulting in version 6.1 */ /* */ /**************************************************************************/ VOID _ux_pictbridge_dpsclient_thread(ULONG parameter) @@ -92,7 +98,7 @@ UX_SLAVE_CLASS_PIMA_OBJECT *pima_object; /* We should wait for the host to send a script with a command. */ status = _ux_utility_event_flags_get(&pictbridge -> ux_pictbridge_event_flags_group, (UX_PICTBRIDGE_EVENT_FLAG_NOTIFY_JOB_STATUS | UX_PICTBRIDGE_EVENT_FLAG_NOTIFY_DEVICE_STATUS), - TX_OR_CLEAR, &actual_flags, UX_PICTBRIDGE_EVENT_TIMEOUT); + UX_OR_CLEAR, &actual_flags, UX_PICTBRIDGE_EVENT_TIMEOUT); /* Check the status. */ if (status == UX_SUCCESS) @@ -116,7 +122,7 @@ UX_SLAVE_CLASS_PIMA_OBJECT *pima_object; object_length = 0; /* Clear the object memory buffer. */ - _ux_utility_memory_set(pima_object_buffer, 0, UX_PICTBRIDGE_MAX_PIMA_OBJECT_BUFFER); + _ux_utility_memory_set(pima_object_buffer, 0, UX_PICTBRIDGE_MAX_PIMA_OBJECT_BUFFER); /* Use case of memset is verified. */ /* Add the line <?xml version="1.0"?> */ status = _ux_pictbridge_object_tag_line_add(pima_object_buffer, object_length, _ux_pictbridge_xml_tag_line_xmlversion, diff --git a/common/usbx_pictbridge/src/ux_pictbridge_dpshost_input_object_notify_device_status.c b/common/usbx_pictbridge/src/ux_pictbridge_dpshost_input_object_notify_device_status.c index 76f2231..e316f2e 100644 --- a/common/usbx_pictbridge/src/ux_pictbridge_dpshost_input_object_notify_device_status.c +++ b/common/usbx_pictbridge/src/ux_pictbridge_dpshost_input_object_notify_device_status.c @@ -34,10 +34,9 @@ /* */ /* FUNCTION RELEASE */ /* */ -/* _ux_pictbridge_dpshost_input_object_notify__device_status */ -/* PORTABLE C */ -/* 6.0 */ - +/* _ux_pictbridge_dpshost_input_object_notify_device_status */ +/* PORTABLE C */ +/* 6.1 */ /* */ /* AUTHOR */ /* */ @@ -73,6 +72,8 @@ /* 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 */ /* */ /**************************************************************************/ UINT _ux_pictbridge_dpshost_input_object_notify_device_status(UX_PICTBRIDGE *pictbridge, diff --git a/common/usbx_pictbridge/src/ux_pictbridge_dpshost_input_object_notify_job_status.c b/common/usbx_pictbridge/src/ux_pictbridge_dpshost_input_object_notify_job_status.c index 5f5092d..1a69f4e 100644 --- a/common/usbx_pictbridge/src/ux_pictbridge_dpshost_input_object_notify_job_status.c +++ b/common/usbx_pictbridge/src/ux_pictbridge_dpshost_input_object_notify_job_status.c @@ -35,8 +35,8 @@ /* FUNCTION RELEASE */ /* */ /* _ux_pictbridge_dpshost_input_object_notify_job_status */ -/* PORTABLE C */ -/* 6.0 */ +/* PORTABLE C */ +/* 6.1 */ /* */ /* AUTHOR */ /* */ @@ -72,6 +72,8 @@ /* 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 */ /* */ /**************************************************************************/ UINT _ux_pictbridge_dpshost_input_object_notify_job_status(UX_PICTBRIDGE *pictbridge, diff --git a/common/usbx_pictbridge/src/ux_pictbridge_dpshost_input_object_send.c b/common/usbx_pictbridge/src/ux_pictbridge_dpshost_input_object_send.c index 05deb33..b22c678 100644 --- a/common/usbx_pictbridge/src/ux_pictbridge_dpshost_input_object_send.c +++ b/common/usbx_pictbridge/src/ux_pictbridge_dpshost_input_object_send.c @@ -35,7 +35,7 @@ /* FUNCTION RELEASE */ /* */ /* _ux_pictbridge_dpshost_input_object_send PORTABLE C */ -/* 6.0 */ +/* 6.1 */ /* AUTHOR */ /* */ /* Chaoqiong Xiao, Microsoft Corporation */ @@ -65,6 +65,12 @@ /* DATE NAME DESCRIPTION */ /* */ /* 05-19-2020 Chaoqiong Xiao Initial Version 6.0 */ +/* 09-30-2020 Chaoqiong Xiao Modified comment(s), */ +/* verified memset and memcpy */ +/* cases, used UX prefix to */ +/* refer to TX symbols instead */ +/* of using them directly, */ +/* resulting in version 6.1 */ /* */ /**************************************************************************/ UINT _ux_pictbridge_dpshost_input_object_send(UX_PICTBRIDGE *pictbridge, ULONG input_function) @@ -89,7 +95,7 @@ ULONG actual_flags; /* Wait for the client event pending request to be completed. */ status = _ux_utility_event_flags_get(&pictbridge -> ux_pictbridge_event_flags_group, UX_PICTBRIDGE_EVENT_FLAG_STATE_MACHINE_READY, - TX_AND_CLEAR, &actual_flags, UX_PICTBRIDGE_EVENT_TIMEOUT); + UX_AND_CLEAR, &actual_flags, UX_PICTBRIDGE_EVENT_TIMEOUT); /* Reset the state machine to not Host Request pending. */ pictbridge -> ux_pictbridge_host_client_state_machine &= (UINT)~UX_PICTBRIDGE_STATE_MACHINE_HOST_REQUEST_PENDING; @@ -119,7 +125,7 @@ ULONG actual_flags; object_length = 0; /* Clear the object memory buffer. */ - _ux_utility_memory_set(pima_object_buffer, 0, UX_PICTBRIDGE_MAX_PIMA_OBJECT_BUFFER); + _ux_utility_memory_set(pima_object_buffer, 0, UX_PICTBRIDGE_MAX_PIMA_OBJECT_BUFFER); /* Use case of memset is verified. */ /* Add the line <?xml version="1.0"?> */ status = _ux_pictbridge_object_tag_line_add(pima_object_buffer, object_length, _ux_pictbridge_xml_tag_line_xmlversion, @@ -194,7 +200,7 @@ ULONG actual_flags; /* Yes, so we need to set the event that advertise the completion of the host request. */ _ux_utility_event_flags_set(&pictbridge -> ux_pictbridge_event_flags_group, UX_PICTBRIDGE_EVENT_FLAG_STATE_MACHINE_READY, - TX_AND); + UX_AND); } @@ -229,7 +235,7 @@ ULONG actual_flags; /* Yes, so we need to set the event that advertise the completion of the host request. */ status = _ux_utility_event_flags_set(&pictbridge -> ux_pictbridge_event_flags_group, UX_PICTBRIDGE_EVENT_FLAG_STATE_MACHINE_READY, - TX_AND); + UX_AND); } @@ -257,7 +263,7 @@ ULONG actual_flags; /* Yes, so we need to set the event that advertise the completion of the host request. */ status = _ux_utility_event_flags_set(&pictbridge -> ux_pictbridge_event_flags_group, UX_PICTBRIDGE_EVENT_FLAG_STATE_MACHINE_READY, - TX_AND); + UX_AND); } @@ -306,7 +312,7 @@ ULONG actual_flags; /* Yes, so we need to set the event that advertise the completion of the host request. */ status = _ux_utility_event_flags_set(&pictbridge -> ux_pictbridge_event_flags_group, UX_PICTBRIDGE_EVENT_FLAG_STATE_MACHINE_READY, - TX_AND); + UX_AND); } @@ -336,7 +342,7 @@ ULONG actual_flags; /* Yes, so we need to set the event that advertise the completion of the host request. */ status = _ux_utility_event_flags_set(&pictbridge -> ux_pictbridge_event_flags_group, UX_PICTBRIDGE_EVENT_FLAG_STATE_MACHINE_READY, - TX_AND); + UX_AND); } @@ -359,7 +365,7 @@ ULONG actual_flags; /* Yes, so we need to set the event that advertise the completion of the host request. */ status = _ux_utility_event_flags_set(&pictbridge -> ux_pictbridge_event_flags_group, UX_PICTBRIDGE_EVENT_FLAG_STATE_MACHINE_READY, - TX_AND); + UX_AND); } diff --git a/common/usbx_pictbridge/src/ux_pictbridge_dpshost_notification_callback.c b/common/usbx_pictbridge/src/ux_pictbridge_dpshost_notification_callback.c index f965b1a..ba8d0ef 100644 --- a/common/usbx_pictbridge/src/ux_pictbridge_dpshost_notification_callback.c +++ b/common/usbx_pictbridge/src/ux_pictbridge_dpshost_notification_callback.c @@ -35,7 +35,7 @@ /* FUNCTION RELEASE */ /* */ /* _ux_pictbridge_dpshost_notification_callback PORTABLE C */ -/* 6.0 */ +/* 6.1 */ /* AUTHOR */ /* */ /* Chaoqiong Xiao, Microsoft Corporation */ @@ -65,6 +65,8 @@ /* 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 */ /* */ /**************************************************************************/ VOID _ux_pictbridge_dpshost_notification_callback(UX_HOST_CLASS_PIMA_EVENT *pima_event) diff --git a/common/usbx_pictbridge/src/ux_pictbridge_dpshost_object_get.c b/common/usbx_pictbridge/src/ux_pictbridge_dpshost_object_get.c index 8ae7905..53b7664 100644 --- a/common/usbx_pictbridge/src/ux_pictbridge_dpshost_object_get.c +++ b/common/usbx_pictbridge/src/ux_pictbridge_dpshost_object_get.c @@ -35,7 +35,7 @@ /* FUNCTION RELEASE */ /* */ /* _ux_pictbridge_dpshost_object_get PORTABLE C */ -/* 6.0 */ +/* 6.1 */ /* AUTHOR */ /* */ /* Chaoqiong Xiao, Microsoft Corporation */ @@ -65,6 +65,8 @@ /* 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 */ /* */ /**************************************************************************/ UINT _ux_pictbridge_dpshost_object_get(UX_PICTBRIDGE *pictbridge, ULONG object_handle) diff --git a/common/usbx_pictbridge/src/ux_pictbridge_dpshost_output_object_configure_print_service.c b/common/usbx_pictbridge/src/ux_pictbridge_dpshost_output_object_configure_print_service.c index b24031a..864d5f4 100644 --- a/common/usbx_pictbridge/src/ux_pictbridge_dpshost_output_object_configure_print_service.c +++ b/common/usbx_pictbridge/src/ux_pictbridge_dpshost_output_object_configure_print_service.c @@ -33,10 +33,10 @@ /**************************************************************************/ /* */ /* FUNCTION RELEASE */ -/* */ -/* _ux_pictbridge_dpshost_output_object_configure PORTABLE C */ -/* _print_service */ -/* 6.0 */ +/* */ +/* _ux_pictbridge_dpshost_output_object_configure_print_service */ +/* PORTABLE C */ +/* 6.1 */ /* AUTHOR */ /* */ /* Chaoqiong Xiao, Microsoft Corporation */ @@ -71,6 +71,8 @@ /* 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 */ /* */ /**************************************************************************/ UINT _ux_pictbridge_dpshost_output_object_configure_print_service(UX_PICTBRIDGE *pictbridge, diff --git a/common/usbx_pictbridge/src/ux_pictbridge_dpshost_output_object_create.c b/common/usbx_pictbridge/src/ux_pictbridge_dpshost_output_object_create.c index 7b08340..9569c27 100644 --- a/common/usbx_pictbridge/src/ux_pictbridge_dpshost_output_object_create.c +++ b/common/usbx_pictbridge/src/ux_pictbridge_dpshost_output_object_create.c @@ -35,7 +35,7 @@ /* FUNCTION RELEASE */ /* */ /* _ux_pictbridge_dpshost_output_object_create PORTABLE C */ -/* 6.0 */ +/* 6.1 */ /* AUTHOR */ /* */ /* Chaoqiong Xiao, Microsoft Corporation */ @@ -65,6 +65,10 @@ /* DATE NAME DESCRIPTION */ /* */ /* 05-19-2020 Chaoqiong Xiao Initial Version 6.0 */ +/* 09-30-2020 Chaoqiong Xiao Modified comment(s), */ +/* verified memset and memcpy */ +/* cases, */ +/* resulting in version 6.1 */ /* */ /**************************************************************************/ UINT _ux_pictbridge_dpshost_output_object_create(UX_PICTBRIDGE *pictbridge) @@ -84,7 +88,7 @@ UX_HOST_CLASS_PIMA_OBJECT *pima_object; object_length = 0; /* Clear the object memory buffer. */ - _ux_utility_memory_set(pima_object_buffer, 0, UX_PICTBRIDGE_MAX_PIMA_OBJECT_BUFFER); + _ux_utility_memory_set(pima_object_buffer, 0, UX_PICTBRIDGE_MAX_PIMA_OBJECT_BUFFER); /* Use case of memset is verified. */ /* Add the line <?xml version="1.0"?> */ diff --git a/common/usbx_pictbridge/src/ux_pictbridge_dpshost_output_object_get_capability.c b/common/usbx_pictbridge/src/ux_pictbridge_dpshost_output_object_get_capability.c index 1177ae6..7d09050 100644 --- a/common/usbx_pictbridge/src/ux_pictbridge_dpshost_output_object_get_capability.c +++ b/common/usbx_pictbridge/src/ux_pictbridge_dpshost_output_object_get_capability.c @@ -34,8 +34,8 @@ /* */ /* FUNCTION RELEASE */ /* */ -/* _ux_pictbridge_dpshost_output_object_get_capability PORTABLE C */ -/* 6.0 */ +/* _ux_pictbridge_dpshost_output_object_get_capability PORTABLE C */ +/* 6.1 */ /* AUTHOR */ /* */ /* Chaoqiong Xiao, Microsoft Corporation */ @@ -69,6 +69,8 @@ /* 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 */ /* */ /**************************************************************************/ UINT _ux_pictbridge_dpshost_output_object_get_capability(UX_PICTBRIDGE *pictbridge, diff --git a/common/usbx_pictbridge/src/ux_pictbridge_dpshost_output_object_get_device_status.c b/common/usbx_pictbridge/src/ux_pictbridge_dpshost_output_object_get_device_status.c index 8425cdd..4c9aa16 100644 --- a/common/usbx_pictbridge/src/ux_pictbridge_dpshost_output_object_get_device_status.c +++ b/common/usbx_pictbridge/src/ux_pictbridge_dpshost_output_object_get_device_status.c @@ -36,7 +36,7 @@ /* */ /* _ux_pictbridge_dpshost_output_object_get_device_status */ /* PORTABLE C */ -/* 6.0 */ +/* 6.1 */ /* AUTHOR */ /* */ /* Chaoqiong Xiao, Microsoft Corporation */ @@ -70,6 +70,8 @@ /* 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 */ /* */ /**************************************************************************/ UINT _ux_pictbridge_dpshost_output_object_get_device_status(UX_PICTBRIDGE *pictbridge, diff --git a/common/usbx_pictbridge/src/ux_pictbridge_dpshost_response_get.c b/common/usbx_pictbridge/src/ux_pictbridge_dpshost_response_get.c index 325d1fe..91777ca 100644 --- a/common/usbx_pictbridge/src/ux_pictbridge_dpshost_response_get.c +++ b/common/usbx_pictbridge/src/ux_pictbridge_dpshost_response_get.c @@ -35,7 +35,7 @@ /* FUNCTION RELEASE */ /* */ /* _ux_pictbridge_dpshost_response_get PORTABLE C */ -/* 6.0 */ +/* 6.1 */ /* AUTHOR */ /* */ /* Chaoqiong Xiao, Microsoft Corporation */ @@ -64,6 +64,8 @@ /* 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 */ /* */ /**************************************************************************/ UINT _ux_pictbridge_dpshost_response_get(UX_PICTBRIDGE *pictbridge) diff --git a/common/usbx_pictbridge/src/ux_pictbridge_dpshost_start.c b/common/usbx_pictbridge/src/ux_pictbridge_dpshost_start.c index b9bc4d8..efabe8e 100644 --- a/common/usbx_pictbridge/src/ux_pictbridge_dpshost_start.c +++ b/common/usbx_pictbridge/src/ux_pictbridge_dpshost_start.c @@ -35,7 +35,7 @@ /* FUNCTION RELEASE */ /* */ /* _ux_pictbridge_dpshost_start PORTABLE C */ -/* 6.0 */ +/* 6.1 */ /* AUTHOR */ /* */ /* Chaoqiong Xiao, Microsoft Corporation */ @@ -64,6 +64,11 @@ /* DATE NAME DESCRIPTION */ /* */ /* 05-19-2020 Chaoqiong Xiao Initial Version 6.0 */ +/* 09-30-2020 Chaoqiong Xiao Modified comment(s), */ +/* used UX prefix to refer to */ +/* TX symbols instead of using */ +/* them directly, */ +/* resulting in version 6.1 */ /* */ /**************************************************************************/ UINT _ux_pictbridge_dpshost_start(UX_PICTBRIDGE *pictbridge, UX_HOST_CLASS_PIMA *pima) @@ -170,7 +175,7 @@ UINT length, length1; UX_PICTBRIDGE_THREAD_STACK_SIZE, UX_PICTBRIDGE_THREAD_PRIORITY_CLASS, UX_PICTBRIDGE_THREAD_PRIORITY_CLASS, - TX_NO_TIME_SLICE, TX_AUTO_START); + UX_NO_TIME_SLICE, UX_AUTO_START); /* Check the completion status. */ if (status != UX_SUCCESS) @@ -184,7 +189,7 @@ UINT length, length1; { /* Check and free pictbridge -> ux_pictbridge_thread. */ - if (pictbridge -> ux_pictbridge_thread.tx_thread_id != TX_EMPTY) + if (pictbridge -> ux_pictbridge_thread.tx_thread_id != UX_EMPTY) _ux_utility_thread_delete(&pictbridge -> ux_pictbridge_thread); /* Check and free pictbridge -> ux_pictbridge_thread_stack. */ @@ -192,7 +197,7 @@ UINT length, length1; _ux_utility_memory_free(pictbridge -> ux_pictbridge_thread_stack); /* Check and free pictbridge -> ux_pictbridge_notification_semaphore. */ - if (pictbridge -> ux_pictbridge_notification_semaphore.tx_semaphore_id != TX_EMPTY) + if (pictbridge -> ux_pictbridge_notification_semaphore.tx_semaphore_id != UX_EMPTY) _ux_utility_semaphore_delete(&pictbridge -> ux_pictbridge_notification_semaphore); /* Check and free pictbridge -> ux_pictbridge_device. */ diff --git a/common/usbx_pictbridge/src/ux_pictbridge_dpshost_startjob.c b/common/usbx_pictbridge/src/ux_pictbridge_dpshost_startjob.c index 56b9245..6933bcb 100644 --- a/common/usbx_pictbridge/src/ux_pictbridge_dpshost_startjob.c +++ b/common/usbx_pictbridge/src/ux_pictbridge_dpshost_startjob.c @@ -35,7 +35,7 @@ /* FUNCTION RELEASE */ /* */ /* _ux_pictbridge_dpshost_startjob PORTABLE C */ -/* 6.0 */ +/* 6.1 */ /* AUTHOR */ /* */ /* Chaoqiong Xiao, Microsoft Corporation */ @@ -65,6 +65,8 @@ /* 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 */ /* */ /**************************************************************************/ UINT _ux_pictbridge_dpshost_startjob(UX_PICTBRIDGE *pictbridge) diff --git a/common/usbx_pictbridge/src/ux_pictbridge_dpshost_thread.c b/common/usbx_pictbridge/src/ux_pictbridge_dpshost_thread.c index 5ed954c..c6eae64 100644 --- a/common/usbx_pictbridge/src/ux_pictbridge_dpshost_thread.c +++ b/common/usbx_pictbridge/src/ux_pictbridge_dpshost_thread.c @@ -35,7 +35,7 @@ /* FUNCTION RELEASE */ /* */ /* _ux_pictbridge_dpshost_thread PORTABLE C */ -/* 6.0 */ +/* 6.1 */ /* AUTHOR */ /* */ /* Chaoqiong Xiao, Microsoft Corporation */ @@ -65,6 +65,11 @@ /* DATE NAME DESCRIPTION */ /* */ /* 05-19-2020 Chaoqiong Xiao Initial Version 6.0 */ +/* 09-30-2020 Chaoqiong Xiao Modified comment(s), */ +/* used UX prefix to refer to */ +/* TX symbols instead of using */ +/* them directly, */ +/* resulting in version 6.1 */ /* */ /**************************************************************************/ VOID _ux_pictbridge_dpshost_thread(ULONG parameter) @@ -120,7 +125,7 @@ UINT status; /* Wait for the host pending request to be completed. */ status = _ux_utility_event_flags_get(&pictbridge -> ux_pictbridge_event_flags_group, UX_PICTBRIDGE_EVENT_FLAG_STATE_MACHINE_READY, - TX_AND_CLEAR, &actual_flags, UX_PICTBRIDGE_EVENT_TIMEOUT); + UX_AND_CLEAR, &actual_flags, UX_PICTBRIDGE_EVENT_TIMEOUT); /* Reset the state machine to not Host Request pending. */ pictbridge -> ux_pictbridge_host_client_state_machine &= (UINT)~UX_PICTBRIDGE_STATE_MACHINE_CLIENT_REQUEST_PENDING; @@ -145,7 +150,7 @@ UINT status; /* Yes, so we need to set the event that advertise the completion of the host request. */ status = _ux_utility_event_flags_set(&pictbridge -> ux_pictbridge_event_flags_group, UX_PICTBRIDGE_EVENT_FLAG_STATE_MACHINE_READY, - TX_AND); + UX_AND); /* Check status. */ if (status != UX_SUCCESS) break; diff --git a/common/usbx_pictbridge/src/ux_pictbridge_element_to_decimal.c b/common/usbx_pictbridge/src/ux_pictbridge_element_to_decimal.c index 0aa7aa1..3890424 100644 --- a/common/usbx_pictbridge/src/ux_pictbridge_element_to_decimal.c +++ b/common/usbx_pictbridge/src/ux_pictbridge_element_to_decimal.c @@ -33,8 +33,8 @@ /* */ /* FUNCTION RELEASE */ /* */ -/* _ux_pictbridge_element_to_hexa PORTABLE C */ -/* 6.0 */ +/* _ux_pictbridge_element_to_decimal PORTABLE C */ +/* 6.1 */ /* AUTHOR */ /* */ /* Chaoqiong Xiao, Microsoft Corporation */ @@ -64,6 +64,8 @@ /* 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 */ /* */ /**************************************************************************/ UINT _ux_pictbridge_element_to_decimal(UCHAR *element, ULONG *decimal_value) diff --git a/common/usbx_pictbridge/src/ux_pictbridge_element_to_hexa.c b/common/usbx_pictbridge/src/ux_pictbridge_element_to_hexa.c index 93fd4ff..23d50d6 100644 --- a/common/usbx_pictbridge/src/ux_pictbridge_element_to_hexa.c +++ b/common/usbx_pictbridge/src/ux_pictbridge_element_to_hexa.c @@ -34,7 +34,7 @@ /* FUNCTION RELEASE */ /* */ /* _ux_pictbridge_element_to_hexa PORTABLE C */ -/* 6.0 */ +/* 6.1 */ /* AUTHOR */ /* */ /* Chaoqiong Xiao, Microsoft Corporation */ @@ -64,6 +64,8 @@ /* 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 */ /* */ /**************************************************************************/ UINT _ux_pictbridge_element_to_hexa(UCHAR *element, ULONG *hexa_value) diff --git a/common/usbx_pictbridge/src/ux_pictbridge_hexa_to_decimal_string.c b/common/usbx_pictbridge/src/ux_pictbridge_hexa_to_decimal_string.c index 009cb9c..fa096df 100644 --- a/common/usbx_pictbridge/src/ux_pictbridge_hexa_to_decimal_string.c +++ b/common/usbx_pictbridge/src/ux_pictbridge_hexa_to_decimal_string.c @@ -34,7 +34,7 @@ /* FUNCTION RELEASE */ /* */ /* _ux_pictbridge_hexa_to_decimal_string PORTABLE C */ -/* 6.0 */ +/* 6.1 */ /* AUTHOR */ /* */ /* Chaoqiong Xiao, Microsoft Corporation */ @@ -74,6 +74,10 @@ /* DATE NAME DESCRIPTION */ /* */ /* 05-19-2020 Chaoqiong Xiao Initial Version 6.0 */ +/* 09-30-2020 Chaoqiong Xiao Modified comment(s), */ +/* verified memset and memcpy */ +/* cases, */ +/* resulting in version 6.1 */ /* */ /**************************************************************************/ UINT _ux_pictbridge_hexa_to_decimal_string(ULONG hexa_value, UCHAR *decimal_string, @@ -127,7 +131,7 @@ ULONG decimal_max[8] = {9, 99, 999, 9999, 99999, 999999, 99999 leading_flag = UX_TRUE; /* Reset the decimal_string buffer. */ - _ux_utility_memory_set(decimal_string, 0, max_digit_string_size); + _ux_utility_memory_set(decimal_string, 0, max_digit_string_size); /* Use case of memset is verified. */ /* We parse the hexa value and build the decimal string one byte at a type. */ while(decimal_string_shift) diff --git a/common/usbx_pictbridge/src/ux_pictbridge_hexa_to_element.c b/common/usbx_pictbridge/src/ux_pictbridge_hexa_to_element.c index 560347d..081cc88 100644 --- a/common/usbx_pictbridge/src/ux_pictbridge_hexa_to_element.c +++ b/common/usbx_pictbridge/src/ux_pictbridge_hexa_to_element.c @@ -33,8 +33,8 @@ /* */ /* FUNCTION RELEASE */ /* */ -/* _ux_pictbridge_element_to_hexa PORTABLE C */ -/* 6.0 */ +/* _ux_pictbridge_hexa_to_element PORTABLE C */ +/* 6.1 */ /* AUTHOR */ /* */ /* Chaoqiong Xiao, Microsoft Corporation */ @@ -67,6 +67,10 @@ /* DATE NAME DESCRIPTION */ /* */ /* 05-19-2020 Chaoqiong Xiao Initial Version 6.0 */ +/* 09-30-2020 Chaoqiong Xiao Modified comment(s), */ +/* verified memset and memcpy */ +/* cases, */ +/* resulting in version 6.1 */ /* */ /**************************************************************************/ UINT _ux_pictbridge_hexa_to_element(ULONG hexa_value, UCHAR *element) @@ -78,7 +82,7 @@ UCHAR element_hexa; ULONG element_shift; /* Reset the element buffer. */ - _ux_utility_memory_set(element, 0, 8); + _ux_utility_memory_set(element, 0, 8); /* Use case of memset is verified. */ /* Reset the value of the length.*/ element_length = 0; diff --git a/common/usbx_pictbridge/src/ux_pictbridge_hexa_to_major_minor.c b/common/usbx_pictbridge/src/ux_pictbridge_hexa_to_major_minor.c index efed0df..c334b36 100644 --- a/common/usbx_pictbridge/src/ux_pictbridge_hexa_to_major_minor.c +++ b/common/usbx_pictbridge/src/ux_pictbridge_hexa_to_major_minor.c @@ -35,7 +35,7 @@ /* FUNCTION RELEASE */ /* */ /* _ux_pictbridge_hexa_to_major_minor PORTABLE C */ -/* 6.0 */ +/* 6.1 */ /* AUTHOR */ /* */ /* Chaoqiong Xiao, Microsoft Corporation */ @@ -69,6 +69,10 @@ /* DATE NAME DESCRIPTION */ /* */ /* 05-19-2020 Chaoqiong Xiao Initial Version 6.0 */ +/* 09-30-2020 Chaoqiong Xiao Modified comment(s), */ +/* verified memset and memcpy */ +/* cases, */ +/* resulting in version 6.1 */ /* */ /**************************************************************************/ UINT _ux_pictbridge_hexa_to_major_minor(ULONG hexa_value, UCHAR *output_buffer) @@ -80,7 +84,7 @@ UINT status; /* Reset the output buffer. */ - _ux_utility_memory_set(output_buffer, 0, 5); + _ux_utility_memory_set(output_buffer, 0, 5); /* Use case of memset is verified. */ /* Isolate the major. */ hexa_major = (UCHAR)(hexa_value >> 16); diff --git a/common/usbx_pictbridge/src/ux_pictbridge_object_parse.c b/common/usbx_pictbridge/src/ux_pictbridge_object_parse.c index 3316b23..d544c13 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.0 */ +/* 6.1 */ /* AUTHOR */ /* */ /* Chaoqiong Xiao, Microsoft Corporation */ @@ -65,6 +65,8 @@ /* 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 */ /* */ /**************************************************************************/ UINT _ux_pictbridge_object_parse(UX_PICTBRIDGE *pictbridge, UCHAR *xml_object_buffer, diff --git a/common/usbx_pictbridge/src/ux_pictbridge_output_object_tag_line_add.c b/common/usbx_pictbridge/src/ux_pictbridge_output_object_tag_line_add.c index f3e4bc6..bbbc023 100644 --- a/common/usbx_pictbridge/src/ux_pictbridge_output_object_tag_line_add.c +++ b/common/usbx_pictbridge/src/ux_pictbridge_output_object_tag_line_add.c @@ -34,7 +34,7 @@ /* FUNCTION RELEASE */ /* */ /* _ux_pictbridge_object_tag_line_add PORTABLE C */ -/* 6.0 */ +/* 6.1 */ /* AUTHOR */ /* */ /* Chaoqiong Xiao, Microsoft Corporation */ @@ -72,6 +72,10 @@ /* DATE NAME DESCRIPTION */ /* */ /* 05-19-2020 Chaoqiong Xiao Initial Version 6.0 */ +/* 09-30-2020 Chaoqiong Xiao Modified comment(s), */ +/* verified memset and memcpy */ +/* cases, */ +/* resulting in version 6.1 */ /* */ /**************************************************************************/ UINT _ux_pictbridge_object_tag_line_add(UCHAR *pima_object_buffer, @@ -114,7 +118,7 @@ UINT status; *pima_object_buffer++ = UX_PICTBRIDGE_TAG_CHAR_START_BRACKET; /* Create the element string. */ - _ux_utility_memory_copy(pima_object_buffer, tag_element_string, element_length); + _ux_utility_memory_copy(pima_object_buffer, tag_element_string, element_length); /* Use case of memcpy is verified. */ /* Update the object pointer position. */ pima_object_buffer += element_length; @@ -156,7 +160,7 @@ UINT status; *pima_object_buffer++ = UX_PICTBRIDGE_TAG_CHAR_SPACE; /* Create the variable string. */ - _ux_utility_memory_copy(pima_object_buffer, tag_variable, element_length); + _ux_utility_memory_copy(pima_object_buffer, tag_variable, element_length); /* Use case of memcpy is verified. */ /* Update the object pointer position. */ pima_object_buffer += element_length; @@ -297,7 +301,7 @@ UINT status; return(UX_MEMORY_INSUFFICIENT); /* We have a string to insert. */ - _ux_utility_memory_copy(pima_object_buffer, (UCHAR *) tag_element, element_length); + _ux_utility_memory_copy(pima_object_buffer, (UCHAR *) tag_element, element_length); /* Use case of memcpy is verified. */ } /* Update the object pointer position. */ @@ -399,7 +403,7 @@ UINT status; return(UX_MEMORY_INSUFFICIENT); /* We have a string to insert. */ - _ux_utility_memory_copy(pima_object_buffer, (UCHAR *) (*((ALIGN_TYPE *)tag_element)), element_length); + _ux_utility_memory_copy(pima_object_buffer, (UCHAR *) (*((ALIGN_TYPE *)tag_element)), element_length); /* Use case of memcpy is verified. */ } /* Update the object pointer position. */ @@ -450,7 +454,7 @@ UINT status; *pima_object_buffer++ = UX_PICTBRIDGE_TAG_CHAR_SLASH; /* Create the element string. */ - _ux_utility_memory_copy(pima_object_buffer, tag_element_string, element_length); + _ux_utility_memory_copy(pima_object_buffer, tag_element_string, element_length); /* Use case of memcpy is verified. */ /* Update the object pointer position. */ pima_object_buffer += element_length; diff --git a/common/usbx_pictbridge/src/ux_pictbridge_tag_name_get.c b/common/usbx_pictbridge/src/ux_pictbridge_tag_name_get.c index 47d29a7..0fd9cba 100644 --- a/common/usbx_pictbridge/src/ux_pictbridge_tag_name_get.c +++ b/common/usbx_pictbridge/src/ux_pictbridge_tag_name_get.c @@ -34,7 +34,7 @@ /* FUNCTION RELEASE */ /* */ /* _ux_pictbridge_tag_name_get PORTABLE C */ -/* 6.0 */ +/* 6.1 */ /* AUTHOR */ /* */ /* Chaoqiong Xiao, Microsoft Corporation */ @@ -76,6 +76,10 @@ /* DATE NAME DESCRIPTION */ /* */ /* 05-19-2020 Chaoqiong Xiao Initial Version 6.0 */ +/* 09-30-2020 Chaoqiong Xiao Modified comment(s), */ +/* verified memset and memcpy */ +/* cases, */ +/* resulting in version 6.1 */ /* */ /**************************************************************************/ UINT _ux_pictbridge_tag_name_get(UCHAR *input_buffer, ULONG input_length, @@ -103,19 +107,19 @@ UCHAR *xml_parameter_end; char_count = 0; /* Reset the tag name buffer. */ - _ux_utility_memory_set(tag_name, 0, UX_PICTBRIDGE_MAX_TAG_SIZE); + _ux_utility_memory_set(tag_name, 0, UX_PICTBRIDGE_MAX_TAG_SIZE); /* Use case of memset is verified. */ tag_name_end = tag_name + UX_PICTBRIDGE_MAX_TAG_SIZE - 1; /* Reset the variable name buffer. */ - _ux_utility_memory_set(variable_name, 0, UX_PICTBRIDGE_MAX_VARIABLE_SIZE); + _ux_utility_memory_set(variable_name, 0, UX_PICTBRIDGE_MAX_VARIABLE_SIZE); /* Use case of memset is verified. */ variable_name_end = variable_name + UX_PICTBRIDGE_MAX_VARIABLE_SIZE - 1; /* Reset the variable string buffer. */ - _ux_utility_memory_set(variable_string, 0, UX_PICTBRIDGE_MAX_STRING_SIZE); + _ux_utility_memory_set(variable_string, 0, UX_PICTBRIDGE_MAX_STRING_SIZE); /* Use case of memset is verified. */ variable_string_end = variable_string + UX_PICTBRIDGE_MAX_STRING_SIZE - 1; /* Reset the xml parameter. */ - _ux_utility_memory_set(xml_parameter, 0, UX_PICTBRIDGE_MAX_STRING_SIZE); + _ux_utility_memory_set(xml_parameter, 0, UX_PICTBRIDGE_MAX_STRING_SIZE); /* Use case of memset is verified. */ xml_parameter_end = xml_parameter + UX_PICTBRIDGE_MAX_STRING_SIZE - 1; /* We parse the current xml tag line. We are now positioned at the "<". */ diff --git a/common/usbx_pictbridge/src/ux_pictbridge_tag_name_scan.c b/common/usbx_pictbridge/src/ux_pictbridge_tag_name_scan.c index fc1c152..4cc0cb3 100644 --- a/common/usbx_pictbridge/src/ux_pictbridge_tag_name_scan.c +++ b/common/usbx_pictbridge/src/ux_pictbridge_tag_name_scan.c @@ -34,7 +34,7 @@ /* FUNCTION RELEASE */ /* */ /* _ux_pictbridge_tag_name_scan PORTABLE C */ -/* 6.0 */ +/* 6.1 */ /* AUTHOR */ /* */ /* Chaoqiong Xiao, Microsoft Corporation */ @@ -65,6 +65,8 @@ /* 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 */ /* */ /**************************************************************************/ UINT _ux_pictbridge_tag_name_scan(UX_PICTBRIDGE_XML_ITEM *tag_item, diff --git a/common/usbx_pictbridge/src/ux_pictbridge_xml_function_input_getcapability_capability_layouts.c b/common/usbx_pictbridge/src/ux_pictbridge_xml_function_input_getcapability_capability_layouts.c index 1e25e0b..49b3e54 100644 --- a/common/usbx_pictbridge/src/ux_pictbridge_xml_function_input_getcapability_capability_layouts.c +++ b/common/usbx_pictbridge/src/ux_pictbridge_xml_function_input_getcapability_capability_layouts.c @@ -33,8 +33,9 @@ /* */ /* FUNCTION RELEASE */ /* */ -/* _ux_pictbridge_xml_function_input_ PORTABLE C */ -/* 6.0 */ +/* _ux_pictbridge_xml_function_input_getcapability_capability_layouts */ +/* PORTABLE C */ +/* 6.1 */ /* */ /* */ /* AUTHOR */ @@ -68,6 +69,8 @@ /* 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 */ /* */ /**************************************************************************/ UINT _ux_pictbridge_xml_function_input_getcapability_capability_layouts(UX_PICTBRIDGE *pictbridge, diff --git a/common/usbx_pictbridge/src/ux_pictbridge_xml_function_input_getcapability_capability_papertypes.c b/common/usbx_pictbridge/src/ux_pictbridge_xml_function_input_getcapability_capability_papertypes.c index bcceeba..491714f 100644 --- a/common/usbx_pictbridge/src/ux_pictbridge_xml_function_input_getcapability_capability_papertypes.c +++ b/common/usbx_pictbridge/src/ux_pictbridge_xml_function_input_getcapability_capability_papertypes.c @@ -33,8 +33,10 @@ /* */ /* FUNCTION RELEASE */ /* */ -/* _ux_pictbridge_xml_function_input_ PORTABLE C */ -/* 6.0 */ +/* _ux_pictbridge_xml_function_input_getcapability_ */ +/* capability_papertypes */ +/* PORTABLE C */ +/* 6.1 */ /* */ /* */ /* AUTHOR */ @@ -67,6 +69,8 @@ /* 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 */ /* */ /**************************************************************************/ UINT _ux_pictbridge_xml_function_input_getcapability_capability_papertypes(UX_PICTBRIDGE *pictbridge, diff --git a/common/usbx_pictbridge/src/ux_pictbridge_xml_function_input_notifydevicestatus_capabilitychanged.c b/common/usbx_pictbridge/src/ux_pictbridge_xml_function_input_notifydevicestatus_capabilitychanged.c index d09665b..7bdc0cb 100644 --- a/common/usbx_pictbridge/src/ux_pictbridge_xml_function_input_notifydevicestatus_capabilitychanged.c +++ b/common/usbx_pictbridge/src/ux_pictbridge_xml_function_input_notifydevicestatus_capabilitychanged.c @@ -33,8 +33,10 @@ /* */ /* FUNCTION RELEASE */ /* */ -/* _ux_pictbridge_xml_function_input_ PORTABLE C */ -/* 6.0 */ +/* _ux_pictbridge_xml_function_input_notifydevicestatus_ */ +/* capabilitychanged */ +/* PORTABLE C */ +/* 6.1 */ /* */ /* */ /* */ @@ -69,6 +71,8 @@ /* 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 */ /* */ /**************************************************************************/ UINT _ux_pictbridge_xml_function_input_notifydevicestatus_capabilitychanged(UX_PICTBRIDGE *pictbridge, diff --git a/common/usbx_pictbridge/src/ux_pictbridge_xml_function_input_notifydevicestatus_disconnectenable.c b/common/usbx_pictbridge/src/ux_pictbridge_xml_function_input_notifydevicestatus_disconnectenable.c index 05f8717..7e2c19a 100644 --- a/common/usbx_pictbridge/src/ux_pictbridge_xml_function_input_notifydevicestatus_disconnectenable.c +++ b/common/usbx_pictbridge/src/ux_pictbridge_xml_function_input_notifydevicestatus_disconnectenable.c @@ -36,7 +36,7 @@ /* _ux_pictbridge_xml_function_input_notifydevicestatus_ */ /* disconnectenable */ /* POTABLE C */ -/* 6.0 */ +/* 6.1 */ /* */ /* */ /* */ @@ -71,6 +71,8 @@ /* 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 */ /* */ /**************************************************************************/ UINT _ux_pictbridge_xml_function_input_notifydevicestatus_disconnectenable(UX_PICTBRIDGE *pictbridge, diff --git a/common/usbx_pictbridge/src/ux_pictbridge_xml_function_input_notifydevicestatus_dpsprintservicestatus.c b/common/usbx_pictbridge/src/ux_pictbridge_xml_function_input_notifydevicestatus_dpsprintservicestatus.c index 0a8f1b3..7a44233 100644 --- a/common/usbx_pictbridge/src/ux_pictbridge_xml_function_input_notifydevicestatus_dpsprintservicestatus.c +++ b/common/usbx_pictbridge/src/ux_pictbridge_xml_function_input_notifydevicestatus_dpsprintservicestatus.c @@ -33,8 +33,10 @@ /* */ /* FUNCTION RELEASE */ /* */ -/* _ux_pictbridge_xml_function_input_ PORTABLE C */ -/* 6.0 */ +/* _ux_pictbridge_xml_function_input_notifydevicestatus_ */ +/* dpsprintservicestatus */ +/* PORTABLE C */ +/* 6.1 */ /* */ /* */ /* AUTHOR */ @@ -69,6 +71,8 @@ /* 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 */ /* */ /**************************************************************************/ UINT _ux_pictbridge_xml_function_input_notifydevicestatus_dpsprintservicestatus(UX_PICTBRIDGE *pictbridge, diff --git a/common/usbx_pictbridge/src/ux_pictbridge_xml_function_input_notifydevicestatus_errorreason.c b/common/usbx_pictbridge/src/ux_pictbridge_xml_function_input_notifydevicestatus_errorreason.c index d2a9486..1744ae7 100644 --- a/common/usbx_pictbridge/src/ux_pictbridge_xml_function_input_notifydevicestatus_errorreason.c +++ b/common/usbx_pictbridge/src/ux_pictbridge_xml_function_input_notifydevicestatus_errorreason.c @@ -33,8 +33,9 @@ /* */ /* FUNCTION RELEASE */ /* */ -/* _ux_pictbridge_xml_function_input_ PORTABLE C */ -/* 6.0 */ +/* _ux_pictbridge_xml_function_input_notifydevicestatus_errorreason */ +/* PORTABLE C */ +/* 6.1 */ /* */ /* */ /* AUTHOR */ @@ -69,6 +70,8 @@ /* 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 */ /* */ /**************************************************************************/ UINT _ux_pictbridge_xml_function_input_notifydevicestatus_errorreason(UX_PICTBRIDGE *pictbridge, diff --git a/common/usbx_pictbridge/src/ux_pictbridge_xml_function_input_notifydevicestatus_errorstatus.c b/common/usbx_pictbridge/src/ux_pictbridge_xml_function_input_notifydevicestatus_errorstatus.c index 144ac4f..7d88c61 100644 --- a/common/usbx_pictbridge/src/ux_pictbridge_xml_function_input_notifydevicestatus_errorstatus.c +++ b/common/usbx_pictbridge/src/ux_pictbridge_xml_function_input_notifydevicestatus_errorstatus.c @@ -33,8 +33,9 @@ /* */ /* FUNCTION RELEASE */ /* */ -/* _ux_pictbridge_xml_function_input_ PORTABLE C */ -/* 6.0 */ +/* _ux_pictbridge_xml_function_input_notifydevicestatus_errorstatus */ +/* PORTABLE C */ +/* 6.1 */ /* */ /* */ /* AUTHOR */ @@ -69,6 +70,8 @@ /* 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 */ /* */ /**************************************************************************/ UINT _ux_pictbridge_xml_function_input_notifydevicestatus_errorstatus(UX_PICTBRIDGE *pictbridge, diff --git a/common/usbx_pictbridge/src/ux_pictbridge_xml_function_input_notifydevicestatus_jobendreason.c b/common/usbx_pictbridge/src/ux_pictbridge_xml_function_input_notifydevicestatus_jobendreason.c index 246cd5b..0d2e24b 100644 --- a/common/usbx_pictbridge/src/ux_pictbridge_xml_function_input_notifydevicestatus_jobendreason.c +++ b/common/usbx_pictbridge/src/ux_pictbridge_xml_function_input_notifydevicestatus_jobendreason.c @@ -33,8 +33,9 @@ /* */ /* FUNCTION RELEASE */ /* */ -/* _ux_pictbridge_xml_function_input_ PORTABLE C */ -/* 6.0 */ +/* _ux_pictbridge_xml_function_input_notifydevicestatus_jobendreason */ +/* PORTABLE C */ +/* 6.1 */ /* */ /* */ /* AUTHOR */ @@ -68,6 +69,8 @@ /* 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 */ /* */ /**************************************************************************/ UINT _ux_pictbridge_xml_function_input_notifydevicestatus_jobendreason(UX_PICTBRIDGE *pictbridge, diff --git a/common/usbx_pictbridge/src/ux_pictbridge_xml_function_input_notifydevicestatus_newjobok.c b/common/usbx_pictbridge/src/ux_pictbridge_xml_function_input_notifydevicestatus_newjobok.c index b856d65..61078db 100644 --- a/common/usbx_pictbridge/src/ux_pictbridge_xml_function_input_notifydevicestatus_newjobok.c +++ b/common/usbx_pictbridge/src/ux_pictbridge_xml_function_input_notifydevicestatus_newjobok.c @@ -33,8 +33,9 @@ /* */ /* FUNCTION RELEASE */ /* */ -/* _ux_pictbridge_xml_function_input_ PORTABLE C */ -/* 6.0 */ +/* _ux_pictbridge_xml_function_input_notifydevicestatus_newjobok */ +/* PORTABLE C */ +/* 6.1 */ /* */ /* */ /* AUTHOR */ @@ -68,6 +69,8 @@ /* 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 */ /* */ /**************************************************************************/ UINT _ux_pictbridge_xml_function_input_notifydevicestatus_newjobok(UX_PICTBRIDGE *pictbridge, diff --git a/common/usbx_pictbridge/src/ux_pictbridge_xml_function_input_startjob.c b/common/usbx_pictbridge/src/ux_pictbridge_xml_function_input_startjob.c index 4ddce0e..c8c2a8d 100644 --- a/common/usbx_pictbridge/src/ux_pictbridge_xml_function_input_startjob.c +++ b/common/usbx_pictbridge/src/ux_pictbridge_xml_function_input_startjob.c @@ -34,7 +34,7 @@ /* FUNCTION RELEASE */ /* */ /* _ux_pictbridge_xml_function_input_startjob PORTABLE C */ -/* 6.0 */ +/* 6.1 */ /* */ /* */ /* AUTHOR */ @@ -68,6 +68,8 @@ /* 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 */ /* */ /**************************************************************************/ UINT _ux_pictbridge_xml_function_input_startjob(UX_PICTBRIDGE *pictbridge, diff --git a/common/usbx_pictbridge/src/ux_pictbridge_xml_function_input_startjob_jobconfig_cropping.c b/common/usbx_pictbridge/src/ux_pictbridge_xml_function_input_startjob_jobconfig_cropping.c index f8646ae..ea61129 100644 --- a/common/usbx_pictbridge/src/ux_pictbridge_xml_function_input_startjob_jobconfig_cropping.c +++ b/common/usbx_pictbridge/src/ux_pictbridge_xml_function_input_startjob_jobconfig_cropping.c @@ -33,8 +33,9 @@ /* */ /* FUNCTION RELEASE */ /* */ -/* _ux_pictbridge_xml_function_input_ PORTABLE C */ -/* 6.0 */ +/* _ux_pictbridge_xml_function_input_startjob_jobconfig_cropping */ +/* PORTABLE C */ +/* 6.1 */ /* */ /* */ /* AUTHOR */ @@ -69,6 +70,8 @@ /* 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 */ /* */ /**************************************************************************/ UINT _ux_pictbridge_xml_function_input_startjob_jobconfig_cropping(UX_PICTBRIDGE *pictbridge, diff --git a/common/usbx_pictbridge/src/ux_pictbridge_xml_function_input_startjob_jobconfig_dateprint.c b/common/usbx_pictbridge/src/ux_pictbridge_xml_function_input_startjob_jobconfig_dateprint.c index df11cbe..8eeba21 100644 --- a/common/usbx_pictbridge/src/ux_pictbridge_xml_function_input_startjob_jobconfig_dateprint.c +++ b/common/usbx_pictbridge/src/ux_pictbridge_xml_function_input_startjob_jobconfig_dateprint.c @@ -33,8 +33,9 @@ /* */ /* FUNCTION RELEASE */ /* */ -/* _ux_pictbridge_xml_function_input_ PORTABLE C */ -/* 6.0 */ +/* _ux_pictbridge_xml_function_input_startjob_jobconfig_dateprint */ +/* PORTABLE C */ +/* 6.1 */ /* */ /* */ /* AUTHOR */ @@ -68,6 +69,8 @@ /* 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 */ /* */ /**************************************************************************/ UINT _ux_pictbridge_xml_function_input_startjob_jobconfig_dateprint(UX_PICTBRIDGE *pictbridge, diff --git a/common/usbx_pictbridge/src/ux_pictbridge_xml_function_input_startjob_jobconfig_filenameprint.c b/common/usbx_pictbridge/src/ux_pictbridge_xml_function_input_startjob_jobconfig_filenameprint.c index 1c8fb7f..c190715 100644 --- a/common/usbx_pictbridge/src/ux_pictbridge_xml_function_input_startjob_jobconfig_filenameprint.c +++ b/common/usbx_pictbridge/src/ux_pictbridge_xml_function_input_startjob_jobconfig_filenameprint.c @@ -33,8 +33,9 @@ /* */ /* FUNCTION RELEASE */ /* */ -/* _ux_pictbridge_xml_function_input_ PORTABLE C */ -/* 6.0 */ +/* _ux_pictbridge_xml_function_input_startjob_jobconfig_filenameprint */ +/* PORTABLE C */ +/* 6.1 */ /* */ /* */ /* AUTHOR */ @@ -69,6 +70,8 @@ /* 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 */ /* */ /**************************************************************************/ UINT _ux_pictbridge_xml_function_input_startjob_jobconfig_filenameprint(UX_PICTBRIDGE *pictbridge, diff --git a/common/usbx_pictbridge/src/ux_pictbridge_xml_function_input_startjob_jobconfig_filetype.c b/common/usbx_pictbridge/src/ux_pictbridge_xml_function_input_startjob_jobconfig_filetype.c index 4064d22..87cb05b 100644 --- a/common/usbx_pictbridge/src/ux_pictbridge_xml_function_input_startjob_jobconfig_filetype.c +++ b/common/usbx_pictbridge/src/ux_pictbridge_xml_function_input_startjob_jobconfig_filetype.c @@ -33,8 +33,9 @@ /* */ /* FUNCTION RELEASE */ /* */ -/* _ux_pictbridge_xml_function_input_ PORTABLE C */ -/* 6.0 */ +/* _ux_pictbridge_xml_function_input_startjob_jobconfig_filetype */ +/* PORTABLE C */ +/* 6.1 */ /* */ /* */ /* AUTHOR */ @@ -68,6 +69,8 @@ /* 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 */ /* */ /**************************************************************************/ UINT _ux_pictbridge_xml_function_input_startjob_jobconfig_filetype(UX_PICTBRIDGE *pictbridge, diff --git a/common/usbx_pictbridge/src/ux_pictbridge_xml_function_input_startjob_jobconfig_fixedsize.c b/common/usbx_pictbridge/src/ux_pictbridge_xml_function_input_startjob_jobconfig_fixedsize.c index f515889..370aaeb 100644 --- a/common/usbx_pictbridge/src/ux_pictbridge_xml_function_input_startjob_jobconfig_fixedsize.c +++ b/common/usbx_pictbridge/src/ux_pictbridge_xml_function_input_startjob_jobconfig_fixedsize.c @@ -33,8 +33,9 @@ /* */ /* FUNCTION RELEASE */ /* */ -/* _ux_pictbridge_xml_function_input_ PORTABLE C */ -/* 6.0 */ +/* _ux_pictbridge_xml_function_input_startjob_jobconfig_fixedsize */ +/* PORTABLE C */ +/* 6.1 */ /* */ /* */ /* AUTHOR */ @@ -68,6 +69,8 @@ /* 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 */ /* */ /**************************************************************************/ UINT _ux_pictbridge_xml_function_input_startjob_jobconfig_fixedsize(UX_PICTBRIDGE *pictbridge, diff --git a/common/usbx_pictbridge/src/ux_pictbridge_xml_function_input_startjob_jobconfig_imageoptimize.c b/common/usbx_pictbridge/src/ux_pictbridge_xml_function_input_startjob_jobconfig_imageoptimize.c index 340f3a4..d1d161a 100644 --- a/common/usbx_pictbridge/src/ux_pictbridge_xml_function_input_startjob_jobconfig_imageoptimize.c +++ b/common/usbx_pictbridge/src/ux_pictbridge_xml_function_input_startjob_jobconfig_imageoptimize.c @@ -33,8 +33,9 @@ /* */ /* FUNCTION RELEASE */ /* */ -/* _ux_pictbridge_xml_function_input_ PORTABLE C */ -/* 6.0 */ +/* _ux_pictbridge_xml_function_input_startjob_jobconfig_imageoptimize */ +/* PORTABLE C */ +/* 6.1 */ /* */ /* */ /* AUTHOR */ @@ -69,6 +70,8 @@ /* 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 */ /* */ /**************************************************************************/ UINT _ux_pictbridge_xml_function_input_startjob_jobconfig_imageoptimize(UX_PICTBRIDGE *pictbridge, diff --git a/common/usbx_pictbridge/src/ux_pictbridge_xml_function_input_startjob_jobconfig_layout.c b/common/usbx_pictbridge/src/ux_pictbridge_xml_function_input_startjob_jobconfig_layout.c index 8c1118e..e551790 100644 --- a/common/usbx_pictbridge/src/ux_pictbridge_xml_function_input_startjob_jobconfig_layout.c +++ b/common/usbx_pictbridge/src/ux_pictbridge_xml_function_input_startjob_jobconfig_layout.c @@ -33,8 +33,9 @@ /* */ /* FUNCTION RELEASE */ /* */ -/* _ux_pictbridge_xml_function_input_ PORTABLE C */ -/* 6.0 */ +/* _ux_pictbridge_xml_function_input_startjob_jobconfig_layout */ +/* PORTABLE C */ +/* 6.1 */ /* */ /* */ /* AUTHOR */ @@ -69,6 +70,8 @@ /* 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 */ /* */ /**************************************************************************/ UINT _ux_pictbridge_xml_function_input_startjob_jobconfig_layout(UX_PICTBRIDGE *pictbridge, diff --git a/common/usbx_pictbridge/src/ux_pictbridge_xml_function_input_startjob_jobconfig_papersize.c b/common/usbx_pictbridge/src/ux_pictbridge_xml_function_input_startjob_jobconfig_papersize.c index a328671..cde43dc 100644 --- a/common/usbx_pictbridge/src/ux_pictbridge_xml_function_input_startjob_jobconfig_papersize.c +++ b/common/usbx_pictbridge/src/ux_pictbridge_xml_function_input_startjob_jobconfig_papersize.c @@ -33,8 +33,9 @@ /* */ /* FUNCTION RELEASE */ /* */ -/* _ux_pictbridge_xml_function_input_ PORTABLE C */ -/* 6.0 */ +/* _ux_pictbridge_xml_function_input_startjob_jobconfig_papersize */ +/* PORTABLE C */ +/* 6.1 */ /* */ /* */ /* AUTHOR */ @@ -68,6 +69,8 @@ /* 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 */ /* */ /**************************************************************************/ UINT _ux_pictbridge_xml_function_input_startjob_jobconfig_papersize(UX_PICTBRIDGE *pictbridge, diff --git a/common/usbx_pictbridge/src/ux_pictbridge_xml_function_input_startjob_jobconfig_papertype.c b/common/usbx_pictbridge/src/ux_pictbridge_xml_function_input_startjob_jobconfig_papertype.c index ac3e173..330efb7 100644 --- a/common/usbx_pictbridge/src/ux_pictbridge_xml_function_input_startjob_jobconfig_papertype.c +++ b/common/usbx_pictbridge/src/ux_pictbridge_xml_function_input_startjob_jobconfig_papertype.c @@ -33,8 +33,9 @@ /* */ /* FUNCTION RELEASE */ /* */ -/* _ux_pictbridge_xml_function_input_ PORTABLE C */ -/* 6.0 */ +/* _ux_pictbridge_xml_function_input_startjob_jobconfig_papertype */ +/* PORTABLE C */ +/* 6.1 */ /* */ /* */ /* AUTHOR */ @@ -68,6 +69,8 @@ /* 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 */ /* */ /**************************************************************************/ UINT _ux_pictbridge_xml_function_input_startjob_jobconfig_papertype(UX_PICTBRIDGE *pictbridge, diff --git a/common/usbx_pictbridge/src/ux_pictbridge_xml_function_input_startjob_jobconfig_quality.c b/common/usbx_pictbridge/src/ux_pictbridge_xml_function_input_startjob_jobconfig_quality.c index 4e0bc6a..4bdec08 100644 --- a/common/usbx_pictbridge/src/ux_pictbridge_xml_function_input_startjob_jobconfig_quality.c +++ b/common/usbx_pictbridge/src/ux_pictbridge_xml_function_input_startjob_jobconfig_quality.c @@ -33,8 +33,9 @@ /* */ /* FUNCTION RELEASE */ /* */ -/* _ux_pictbridge_xml_function_input_ PORTABLE C */ -/* 6.0 */ +/* _ux_pictbridge_xml_function_input_startjob_jobconfig_quality */ +/* PORTABLE C */ +/* 6.1 */ /* */ /* */ /* AUTHOR */ @@ -68,6 +69,8 @@ /* 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 */ /* */ /**************************************************************************/ UINT _ux_pictbridge_xml_function_input_startjob_jobconfig_quality(UX_PICTBRIDGE *pictbridge, diff --git a/common/usbx_pictbridge/src/ux_pictbridge_xml_function_input_startjob_printinfo.c b/common/usbx_pictbridge/src/ux_pictbridge_xml_function_input_startjob_printinfo.c index 7990c23..4675a47 100644 --- a/common/usbx_pictbridge/src/ux_pictbridge_xml_function_input_startjob_printinfo.c +++ b/common/usbx_pictbridge/src/ux_pictbridge_xml_function_input_startjob_printinfo.c @@ -33,8 +33,9 @@ /* */ /* FUNCTION RELEASE */ /* */ -/* _ux_pictbridge_xml_function_input_startjob_ PORTABLE C */ -/* 6.0 */ +/* _ux_pictbridge_xml_function_input_startjob_printinfo */ +/* PORTABLE C */ +/* 6.1 */ /* */ /* */ /* AUTHOR */ @@ -70,6 +71,8 @@ /* 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 */ /* */ /**************************************************************************/ UINT _ux_pictbridge_xml_function_input_startjob_printinfo(UX_PICTBRIDGE *pictbridge, diff --git a/common/usbx_pictbridge/src/ux_pictbridge_xml_function_input_startjob_printinfo_copies.c b/common/usbx_pictbridge/src/ux_pictbridge_xml_function_input_startjob_printinfo_copies.c index e71c200..06bda18 100644 --- a/common/usbx_pictbridge/src/ux_pictbridge_xml_function_input_startjob_printinfo_copies.c +++ b/common/usbx_pictbridge/src/ux_pictbridge_xml_function_input_startjob_printinfo_copies.c @@ -33,8 +33,9 @@ /* */ /* FUNCTION RELEASE */ /* */ -/* _ux_pictbridge_xml_function_input_ PORTABLE C */ -/* 6.0 */ +/* _ux_pictbridge_xml_function_input_startjob_printinfo_copies */ +/* PORTABLE C */ +/* 6.1 */ /* */ /* */ /* AUTHOR */ @@ -68,6 +69,8 @@ /* 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 */ /* */ /**************************************************************************/ UINT _ux_pictbridge_xml_function_input_startjob_printinfo_copies(UX_PICTBRIDGE *pictbridge, diff --git a/common/usbx_pictbridge/src/ux_pictbridge_xml_function_input_startjob_printinfo_copyid.c b/common/usbx_pictbridge/src/ux_pictbridge_xml_function_input_startjob_printinfo_copyid.c index 0fb1a46..a7dd6ae 100644 --- a/common/usbx_pictbridge/src/ux_pictbridge_xml_function_input_startjob_printinfo_copyid.c +++ b/common/usbx_pictbridge/src/ux_pictbridge_xml_function_input_startjob_printinfo_copyid.c @@ -33,8 +33,9 @@ /* */ /* FUNCTION RELEASE */ /* */ -/* _ux_pictbridge_xml_function_input_ PORTABLE C */ -/* 6.0 */ +/* _ux_pictbridge_xml_function_input_startjob_printinfo_copyid */ +/* PORTABLE C */ +/* 6.1 */ /* */ /* */ /* AUTHOR */ @@ -68,6 +69,8 @@ /* 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 */ /* */ /**************************************************************************/ UINT _ux_pictbridge_xml_function_input_startjob_printinfo_copyid(UX_PICTBRIDGE *pictbridge, diff --git a/common/usbx_pictbridge/src/ux_pictbridge_xml_function_input_startjob_printinfo_croppingarea.c b/common/usbx_pictbridge/src/ux_pictbridge_xml_function_input_startjob_printinfo_croppingarea.c index 6221049..f7b66ef 100644 --- a/common/usbx_pictbridge/src/ux_pictbridge_xml_function_input_startjob_printinfo_croppingarea.c +++ b/common/usbx_pictbridge/src/ux_pictbridge_xml_function_input_startjob_printinfo_croppingarea.c @@ -33,8 +33,9 @@ /* */ /* FUNCTION RELEASE */ /* */ -/* _ux_pictbridge_xml_function_input_ PORTABLE C */ -/* 6.0 */ +/* _ux_pictbridge_xml_function_input_startjob_printinfo_croppingarea */ +/* PORTABLE C */ +/* 6.1 */ /* */ /* */ /* AUTHOR */ @@ -68,6 +69,10 @@ /* DATE NAME DESCRIPTION */ /* */ /* 05-19-2020 Chaoqiong Xiao Initial Version 6.0 */ +/* 09-30-2020 Chaoqiong Xiao Modified comment(s), */ +/* verified memset and memcpy */ +/* cases, */ +/* resulting in version 6.1 */ /* */ /**************************************************************************/ UINT _ux_pictbridge_xml_function_input_startjob_printinfo_croppingarea(UX_PICTBRIDGE *pictbridge, @@ -101,7 +106,7 @@ ULONG hexa_value; index = 0; /* Reset the element area. */ - _ux_utility_memory_set(element_string, 0, UX_PICTBRIDGE_MAX_ELEMENT_SIZE); + _ux_utility_memory_set(element_string, 0, UX_PICTBRIDGE_MAX_ELEMENT_SIZE); /* Use case of memset is verified. */ /* And its length. */ element_length = 0; @@ -165,7 +170,7 @@ ULONG hexa_value; index++; /* Reset the element area. */ - _ux_utility_memory_set(element_string, 0, UX_PICTBRIDGE_MAX_ELEMENT_SIZE); + _ux_utility_memory_set(element_string, 0, UX_PICTBRIDGE_MAX_ELEMENT_SIZE); /* Use case of memset is verified. */ /* And its length. */ element_length = 0; diff --git a/common/usbx_pictbridge/src/ux_pictbridge_xml_function_input_startjob_printinfo_date.c b/common/usbx_pictbridge/src/ux_pictbridge_xml_function_input_startjob_printinfo_date.c index c06790c..a71b910 100644 --- a/common/usbx_pictbridge/src/ux_pictbridge_xml_function_input_startjob_printinfo_date.c +++ b/common/usbx_pictbridge/src/ux_pictbridge_xml_function_input_startjob_printinfo_date.c @@ -33,8 +33,9 @@ /* */ /* FUNCTION RELEASE */ /* */ -/* _ux_pictbridge_xml_function_input_ PORTABLE C */ -/* 6.0 */ +/* _ux_pictbridge_xml_function_input_startjob_printinfo_date */ +/* PORTABLE C */ +/* 6.1 */ /* */ /* */ /* AUTHOR */ @@ -68,6 +69,10 @@ /* DATE NAME DESCRIPTION */ /* */ /* 05-19-2020 Chaoqiong Xiao Initial Version 6.0 */ +/* 09-30-2020 Chaoqiong Xiao Modified comment(s), */ +/* verified memset and memcpy */ +/* cases, */ +/* resulting in version 6.1 */ /* */ /**************************************************************************/ UINT _ux_pictbridge_xml_function_input_startjob_printinfo_date(UX_PICTBRIDGE *pictbridge, @@ -80,7 +85,7 @@ UINT length = 0; UX_PARAMETER_NOT_USED(input_variable); /* Get the length of the parameter. */ - status = _ux_utility_string_length_check(xml_parameter, &length, UX_PICTBRIDGE_MAX_TAG_SIZE); + status = _ux_utility_string_length_check(xml_parameter, &length, UX_PICTBRIDGE_MAX_STRING_SIZE); if (status != UX_SUCCESS) return(status); @@ -92,7 +97,7 @@ UINT length = 0; /* We need to copy the date. */ _ux_utility_memory_copy(pictbridge -> ux_pictbridge_jobinfo.ux_pictbridge_jobinfo_printinfo_current -> ux_pictbridge_printinfo_date, - xml_parameter, length); + xml_parameter, length); /* Use case of memcpy is verified. */ /* Operation is successful. */ return(UX_SUCCESS); diff --git a/common/usbx_pictbridge/src/ux_pictbridge_xml_function_input_startjob_printinfo_fileid.c b/common/usbx_pictbridge/src/ux_pictbridge_xml_function_input_startjob_printinfo_fileid.c index 5b3cdf9..6e4b15c 100644 --- a/common/usbx_pictbridge/src/ux_pictbridge_xml_function_input_startjob_printinfo_fileid.c +++ b/common/usbx_pictbridge/src/ux_pictbridge_xml_function_input_startjob_printinfo_fileid.c @@ -33,8 +33,9 @@ /* */ /* FUNCTION RELEASE */ /* */ -/* _ux_pictbridge_xml_function_input_ PORTABLE C */ -/* 6.0 */ +/* _ux_pictbridge_xml_function_input_startjob_printinfo_fileid */ +/* PORTABLE C */ +/* 6.1 */ /* */ /* */ /* AUTHOR */ @@ -68,6 +69,8 @@ /* 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 */ /* */ /**************************************************************************/ UINT _ux_pictbridge_xml_function_input_startjob_printinfo_fileid(UX_PICTBRIDGE *pictbridge, diff --git a/common/usbx_pictbridge/src/ux_pictbridge_xml_function_input_startjob_printinfo_filename.c b/common/usbx_pictbridge/src/ux_pictbridge_xml_function_input_startjob_printinfo_filename.c index e59ea5a..1219b92 100644 --- a/common/usbx_pictbridge/src/ux_pictbridge_xml_function_input_startjob_printinfo_filename.c +++ b/common/usbx_pictbridge/src/ux_pictbridge_xml_function_input_startjob_printinfo_filename.c @@ -33,8 +33,9 @@ /* */ /* FUNCTION RELEASE */ /* */ -/* _ux_pictbridge_xml_function_input_ PORTABLE C */ -/* 6.0 */ +/* _ux_pictbridge_xml_function_input_startjob_printinfo_filename */ +/* PORTABLE C */ +/* 6.1 */ /* */ /* */ /* AUTHOR */ @@ -68,6 +69,10 @@ /* DATE NAME DESCRIPTION */ /* */ /* 05-19-2020 Chaoqiong Xiao Initial Version 6.0 */ +/* 09-30-2020 Chaoqiong Xiao Modified comment(s), */ +/* verified memset and memcpy */ +/* cases, */ +/* resulting in version 6.1 */ /* */ /**************************************************************************/ UINT _ux_pictbridge_xml_function_input_startjob_printinfo_filename(UX_PICTBRIDGE *pictbridge, @@ -80,7 +85,7 @@ UINT length = 0; UX_PARAMETER_NOT_USED(input_variable); /* Get the length of the parameter. */ - status = _ux_utility_string_length_check(xml_parameter, &length, UX_PICTBRIDGE_MAX_TAG_SIZE); + status = _ux_utility_string_length_check(xml_parameter, &length, UX_PICTBRIDGE_MAX_STRING_SIZE); if (status != UX_SUCCESS) return(status); @@ -92,7 +97,7 @@ UINT length = 0; /* We need to copy the filename. */ _ux_utility_memory_copy(pictbridge -> ux_pictbridge_jobinfo.ux_pictbridge_jobinfo_printinfo_current -> ux_pictbridge_printinfo_filename, - xml_parameter, length); + xml_parameter, length); /* Use case of memcpy is verified. */ /* Operation is successful. */ return(UX_SUCCESS); diff --git a/common/usbx_pictbridge/src/ux_pictbridge_xml_function_input_startjob_printinfo_filepath.c b/common/usbx_pictbridge/src/ux_pictbridge_xml_function_input_startjob_printinfo_filepath.c index 64bdb82..c367763 100644 --- a/common/usbx_pictbridge/src/ux_pictbridge_xml_function_input_startjob_printinfo_filepath.c +++ b/common/usbx_pictbridge/src/ux_pictbridge_xml_function_input_startjob_printinfo_filepath.c @@ -33,8 +33,9 @@ /* */ /* FUNCTION RELEASE */ /* */ -/* _ux_pictbridge_xml_function_input_ PORTABLE C */ -/* 6.0 */ +/* _ux_pictbridge_xml_function_input_startjob_printinfo_filepath */ +/* PORTABLE C */ +/* 6.1 */ /* */ /* */ /* AUTHOR */ @@ -68,6 +69,10 @@ /* DATE NAME DESCRIPTION */ /* */ /* 05-19-2020 Chaoqiong Xiao Initial Version 6.0 */ +/* 09-30-2020 Chaoqiong Xiao Modified comment(s), */ +/* verified memset and memcpy */ +/* cases, */ +/* resulting in version 6.1 */ /* */ /**************************************************************************/ UINT _ux_pictbridge_xml_function_input_startjob_printinfo_filepath(UX_PICTBRIDGE *pictbridge, @@ -80,7 +85,7 @@ UINT length = 0; UX_PARAMETER_NOT_USED(input_variable); /* Get the length of the parameter. */ - status = _ux_utility_string_length_check(xml_parameter, &length, UX_PICTBRIDGE_MAX_TAG_SIZE); + status = _ux_utility_string_length_check(xml_parameter, &length, UX_PICTBRIDGE_MAX_STRING_SIZE); if (status != UX_SUCCESS) return(status); @@ -92,7 +97,7 @@ UINT length = 0; /* We need to copy the filepath. */ _ux_utility_memory_copy(pictbridge -> ux_pictbridge_jobinfo.ux_pictbridge_jobinfo_printinfo_current -> ux_pictbridge_printinfo_filepath, - xml_parameter, length); + xml_parameter, length); /* Use case of memcpy is verified. */ /* Operation is successful. */ return(UX_SUCCESS); diff --git a/common/usbx_pictbridge/src/ux_pictbridge_xml_function_input_startjob_printinfo_prtid.c b/common/usbx_pictbridge/src/ux_pictbridge_xml_function_input_startjob_printinfo_prtid.c index 9a2d3be..09b5a4f 100644 --- a/common/usbx_pictbridge/src/ux_pictbridge_xml_function_input_startjob_printinfo_prtid.c +++ b/common/usbx_pictbridge/src/ux_pictbridge_xml_function_input_startjob_printinfo_prtid.c @@ -33,8 +33,9 @@ /* */ /* FUNCTION RELEASE */ /* */ -/* _ux_pictbridge_xml_function_input_ PORTABLE C */ -/* 6.0 */ +/* _ux_pictbridge_xml_function_input_startjob_printinfo_prtpid */ +/* PORTABLE C */ +/* 6.1 */ /* */ /* */ /* */ @@ -69,6 +70,8 @@ /* 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 */ /* */ /**************************************************************************/ UINT _ux_pictbridge_xml_function_input_startjob_printinfo_prtpid(UX_PICTBRIDGE *pictbridge, diff --git a/common/usbx_pictbridge/src/ux_pictbridge_xml_function_null.c b/common/usbx_pictbridge/src/ux_pictbridge_xml_function_null.c index da87e59..71e2ec3 100644 --- a/common/usbx_pictbridge/src/ux_pictbridge_xml_function_null.c +++ b/common/usbx_pictbridge/src/ux_pictbridge_xml_function_null.c @@ -34,7 +34,7 @@ /* FUNCTION RELEASE */ /* */ /* _ux_pictbridge_xml_function_null PORTABLE C */ -/* 6.0 */ +/* 6.1 */ /* AUTHOR */ /* */ /* Chaoqiong Xiao, Microsoft Corporation */ @@ -65,6 +65,8 @@ /* 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 */ /* */ /**************************************************************************/ UINT _ux_pictbridge_xml_function_null(UX_PICTBRIDGE *pictbridge, UCHAR *input_variable, UCHAR *input_string, diff --git a/common/usbx_pictbridge/src/ux_pictbridge_xml_function_output_getcapability_capability_croppings.c b/common/usbx_pictbridge/src/ux_pictbridge_xml_function_output_getcapability_capability_croppings.c index adb2a8d..acbd0ae 100644 --- a/common/usbx_pictbridge/src/ux_pictbridge_xml_function_output_getcapability_capability_croppings.c +++ b/common/usbx_pictbridge/src/ux_pictbridge_xml_function_output_getcapability_capability_croppings.c @@ -36,7 +36,7 @@ /* _ux_pictbridge_xml_function_output_getcapability_capability_ */ /* croppings */ /* PORTABLE C */ -/* 6.0 */ +/* 6.1 */ /* */ /* */ /* AUTHOR */ @@ -70,6 +70,8 @@ /* 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 */ /* */ /**************************************************************************/ UINT _ux_pictbridge_xml_function_output_getcapability_capability_croppings(UX_PICTBRIDGE *pictbridge, diff --git a/common/usbx_pictbridge/src/ux_pictbridge_xml_function_output_getcapability_capability_dateprints.c b/common/usbx_pictbridge/src/ux_pictbridge_xml_function_output_getcapability_capability_dateprints.c index b93b937..828acdd 100644 --- a/common/usbx_pictbridge/src/ux_pictbridge_xml_function_output_getcapability_capability_dateprints.c +++ b/common/usbx_pictbridge/src/ux_pictbridge_xml_function_output_getcapability_capability_dateprints.c @@ -36,7 +36,7 @@ /* _ux_pictbridge_xml_function_output_getcapability_capability_ */ /* dateprints */ /* PORTABLE C */ -/* 6.0 */ +/* 6.1 */ /* */ /* */ /* AUTHOR */ @@ -70,6 +70,8 @@ /* 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 */ /* */ /**************************************************************************/ UINT _ux_pictbridge_xml_function_output_getcapability_capability_dateprints(UX_PICTBRIDGE *pictbridge, diff --git a/common/usbx_pictbridge/src/ux_pictbridge_xml_function_output_getcapability_capability_filenameprints.c b/common/usbx_pictbridge/src/ux_pictbridge_xml_function_output_getcapability_capability_filenameprints.c index f967652..731853e 100644 --- a/common/usbx_pictbridge/src/ux_pictbridge_xml_function_output_getcapability_capability_filenameprints.c +++ b/common/usbx_pictbridge/src/ux_pictbridge_xml_function_output_getcapability_capability_filenameprints.c @@ -36,7 +36,7 @@ /* _ux_pictbridge_xml_function_output_getcapability_capability_ */ /* filenameprints */ /* PORTABLE C */ -/* 6.0 */ +/* 6.1 */ /* */ /* */ /* AUTHOR */ @@ -70,6 +70,8 @@ /* 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 */ /* */ /**************************************************************************/ UINT _ux_pictbridge_xml_function_output_getcapability_capability_filenameprints(UX_PICTBRIDGE *pictbridge, diff --git a/common/usbx_pictbridge/src/ux_pictbridge_xml_function_output_getcapability_capability_filetypes.c b/common/usbx_pictbridge/src/ux_pictbridge_xml_function_output_getcapability_capability_filetypes.c index 1a56d8f..c1759f3 100644 --- a/common/usbx_pictbridge/src/ux_pictbridge_xml_function_output_getcapability_capability_filetypes.c +++ b/common/usbx_pictbridge/src/ux_pictbridge_xml_function_output_getcapability_capability_filetypes.c @@ -36,7 +36,7 @@ /* _ux_pictbridge_xml_function_output_getcapability_capability_ */ /* filetypes */ /* PORTABLE C */ -/* 6.0 */ +/* 6.1 */ /* */ /* */ /* AUTHOR */ @@ -70,6 +70,8 @@ /* 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 */ /* */ /**************************************************************************/ UINT _ux_pictbridge_xml_function_output_getcapability_capability_filetypes(UX_PICTBRIDGE *pictbridge, diff --git a/common/usbx_pictbridge/src/ux_pictbridge_xml_function_output_getcapability_capability_fixedsizes.c b/common/usbx_pictbridge/src/ux_pictbridge_xml_function_output_getcapability_capability_fixedsizes.c index e0fa087..a31c1d5 100644 --- a/common/usbx_pictbridge/src/ux_pictbridge_xml_function_output_getcapability_capability_fixedsizes.c +++ b/common/usbx_pictbridge/src/ux_pictbridge_xml_function_output_getcapability_capability_fixedsizes.c @@ -36,7 +36,7 @@ /* _ux_pictbridge_xml_function_output_getcapability_capability_ */ /* fixedsizes */ /* PORTABLE C */ -/* 6.0 */ +/* 6.1 */ /* */ /* */ /* AUTHOR */ @@ -70,6 +70,8 @@ /* 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 */ /* */ /**************************************************************************/ UINT _ux_pictbridge_xml_function_output_getcapability_capability_fixedsizes(UX_PICTBRIDGE *pictbridge, diff --git a/common/usbx_pictbridge/src/ux_pictbridge_xml_function_output_getcapability_capability_imageoptimizes.c b/common/usbx_pictbridge/src/ux_pictbridge_xml_function_output_getcapability_capability_imageoptimizes.c index c1bba66..b2dda19 100644 --- a/common/usbx_pictbridge/src/ux_pictbridge_xml_function_output_getcapability_capability_imageoptimizes.c +++ b/common/usbx_pictbridge/src/ux_pictbridge_xml_function_output_getcapability_capability_imageoptimizes.c @@ -36,7 +36,7 @@ /* _ux_pictbridge_xml_function_output_getcapability_capability_ */ /* imageoptimizes */ /* PORTABLE C */ -/* 6.0 */ +/* 6.1 */ /* */ /* */ /* AUTHOR */ @@ -70,6 +70,8 @@ /* 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 */ /* */ /**************************************************************************/ UINT _ux_pictbridge_xml_function_output_getcapability_capability_imageoptimizes(UX_PICTBRIDGE *pictbridge, diff --git a/common/usbx_pictbridge/src/ux_pictbridge_xml_function_output_getcapability_capability_layouts.c b/common/usbx_pictbridge/src/ux_pictbridge_xml_function_output_getcapability_capability_layouts.c index 0431d15..5cf01de 100644 --- a/common/usbx_pictbridge/src/ux_pictbridge_xml_function_output_getcapability_capability_layouts.c +++ b/common/usbx_pictbridge/src/ux_pictbridge_xml_function_output_getcapability_capability_layouts.c @@ -36,7 +36,7 @@ /* _ux_pictbridge_xml_function_output_getcapability_capability_ */ /* layouts */ /* PORTABLE C */ -/* 6.0 */ +/* 6.1 */ /* */ /* */ /* AUTHOR */ @@ -70,6 +70,8 @@ /* 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 */ /* */ /**************************************************************************/ UINT _ux_pictbridge_xml_function_output_getcapability_capability_layouts(UX_PICTBRIDGE *pictbridge, diff --git a/common/usbx_pictbridge/src/ux_pictbridge_xml_function_output_getcapability_capability_papersizes.c b/common/usbx_pictbridge/src/ux_pictbridge_xml_function_output_getcapability_capability_papersizes.c index 339eec6..5144085 100644 --- a/common/usbx_pictbridge/src/ux_pictbridge_xml_function_output_getcapability_capability_papersizes.c +++ b/common/usbx_pictbridge/src/ux_pictbridge_xml_function_output_getcapability_capability_papersizes.c @@ -36,7 +36,7 @@ /* _ux_pictbridge_xml_function_output_getcapability_capability_ */ /* papersizes */ /* PORTABLE C */ -/* 6.0 */ +/* 6.1 */ /* */ /* */ /* AUTHOR */ @@ -70,6 +70,8 @@ /* 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 */ /* */ /**************************************************************************/ UINT _ux_pictbridge_xml_function_output_getcapability_capability_papersizes(UX_PICTBRIDGE *pictbridge, diff --git a/common/usbx_pictbridge/src/ux_pictbridge_xml_function_output_getcapability_capability_papertypes.c b/common/usbx_pictbridge/src/ux_pictbridge_xml_function_output_getcapability_capability_papertypes.c index 8d839c2..0cee2c2 100644 --- a/common/usbx_pictbridge/src/ux_pictbridge_xml_function_output_getcapability_capability_papertypes.c +++ b/common/usbx_pictbridge/src/ux_pictbridge_xml_function_output_getcapability_capability_papertypes.c @@ -36,7 +36,7 @@ /* _ux_pictbridge_xml_function_output_getcapability_capability_ */ /* papertypes */ /* PORTABLE C */ -/* 6.0 */ +/* 6.1 */ /* */ /* */ /* AUTHOR */ @@ -70,6 +70,8 @@ /* 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 */ /* */ /**************************************************************************/ UINT _ux_pictbridge_xml_function_output_getcapability_capability_papertypes(UX_PICTBRIDGE *pictbridge, diff --git a/common/usbx_pictbridge/src/ux_pictbridge_xml_function_output_getcapability_capability_qualities.c b/common/usbx_pictbridge/src/ux_pictbridge_xml_function_output_getcapability_capability_qualities.c index 492ca63..72cb9e8 100644 --- a/common/usbx_pictbridge/src/ux_pictbridge_xml_function_output_getcapability_capability_qualities.c +++ b/common/usbx_pictbridge/src/ux_pictbridge_xml_function_output_getcapability_capability_qualities.c @@ -36,7 +36,7 @@ /* _ux_pictbridge_xml_function_output_getcapability_capability_ */ /* qualities */ /* PORTABLE C */ -/* 6.0 */ +/* 6.1 */ /* */ /* */ /* AUTHOR */ @@ -70,6 +70,8 @@ /* 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 */ /* */ /**************************************************************************/ UINT _ux_pictbridge_xml_function_output_getcapability_capability_qualities(UX_PICTBRIDGE *pictbridge, diff --git a/common/usbx_pictbridge/src/ux_pictbridge_xml_function_output_getdevicestatus_capabilitychanged.c b/common/usbx_pictbridge/src/ux_pictbridge_xml_function_output_getdevicestatus_capabilitychanged.c index 1e44efc..7df6cc8 100644 --- a/common/usbx_pictbridge/src/ux_pictbridge_xml_function_output_getdevicestatus_capabilitychanged.c +++ b/common/usbx_pictbridge/src/ux_pictbridge_xml_function_output_getdevicestatus_capabilitychanged.c @@ -36,7 +36,7 @@ /* _ux_pictbridge_xml_function_output_getdevicestatus_ */ /* capabilitychanged */ /* PORTABLE C */ -/* 6.0 */ +/* 6.1 */ /* */ /* */ /* AUTHOR */ @@ -70,6 +70,8 @@ /* 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 */ /* */ /**************************************************************************/ UINT _ux_pictbridge_xml_function_output_getdevicestatus_capabilitychanged(UX_PICTBRIDGE *pictbridge, diff --git a/common/usbx_pictbridge/src/ux_pictbridge_xml_function_output_getdevicestatus_disconnectenable.c b/common/usbx_pictbridge/src/ux_pictbridge_xml_function_output_getdevicestatus_disconnectenable.c index e957822..9fb3b81 100644 --- a/common/usbx_pictbridge/src/ux_pictbridge_xml_function_output_getdevicestatus_disconnectenable.c +++ b/common/usbx_pictbridge/src/ux_pictbridge_xml_function_output_getdevicestatus_disconnectenable.c @@ -36,7 +36,7 @@ /* _ux_pictbridge_xml_function_output_getdevicestatus_ */ /* disconnectenable */ /* PORTABLE C */ -/* 6.0 */ +/* 6.1 */ /* */ /* */ /* AUTHOR */ @@ -70,6 +70,8 @@ /* 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 */ /* */ /**************************************************************************/ UINT _ux_pictbridge_xml_function_output_getdevicestatus_disconnectenable(UX_PICTBRIDGE *pictbridge, diff --git a/common/usbx_pictbridge/src/ux_pictbridge_xml_function_output_getdevicestatus_dpsprintservicestatus.c b/common/usbx_pictbridge/src/ux_pictbridge_xml_function_output_getdevicestatus_dpsprintservicestatus.c index 9f06f1c..8ca6693 100644 --- a/common/usbx_pictbridge/src/ux_pictbridge_xml_function_output_getdevicestatus_dpsprintservicestatus.c +++ b/common/usbx_pictbridge/src/ux_pictbridge_xml_function_output_getdevicestatus_dpsprintservicestatus.c @@ -36,7 +36,7 @@ /* _ux_pictbridge_xml_function_output_getdevicestatus_ */ /* dpsprintservicestatus */ /* PORTABLE C */ -/* 6.0 */ +/* 6.1 */ /* */ /* */ /* AUTHOR */ @@ -70,6 +70,8 @@ /* 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 */ /* */ /**************************************************************************/ UINT _ux_pictbridge_xml_function_output_getdevicestatus_dpsprintservicestatus(UX_PICTBRIDGE *pictbridge, diff --git a/common/usbx_pictbridge/src/ux_pictbridge_xml_function_output_getdevicestatus_errorreason.c b/common/usbx_pictbridge/src/ux_pictbridge_xml_function_output_getdevicestatus_errorreason.c index 2623a84..38958e7 100644 --- a/common/usbx_pictbridge/src/ux_pictbridge_xml_function_output_getdevicestatus_errorreason.c +++ b/common/usbx_pictbridge/src/ux_pictbridge_xml_function_output_getdevicestatus_errorreason.c @@ -36,7 +36,7 @@ /* _ux_pictbridge_xml_function_output_getdevicestatus_ */ /* errorreason */ /* PORTABLE C */ -/* 6.0 */ +/* 6.1 */ /* */ /* */ /* AUTHOR */ @@ -70,6 +70,8 @@ /* 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 */ /* */ /**************************************************************************/ UINT _ux_pictbridge_xml_function_output_getdevicestatus_errorreason(UX_PICTBRIDGE *pictbridge, diff --git a/common/usbx_pictbridge/src/ux_pictbridge_xml_function_output_getdevicestatus_errorstatus.c b/common/usbx_pictbridge/src/ux_pictbridge_xml_function_output_getdevicestatus_errorstatus.c index 17ed993..0f0fc47 100644 --- a/common/usbx_pictbridge/src/ux_pictbridge_xml_function_output_getdevicestatus_errorstatus.c +++ b/common/usbx_pictbridge/src/ux_pictbridge_xml_function_output_getdevicestatus_errorstatus.c @@ -36,7 +36,7 @@ /* _ux_pictbridge_xml_function_output_getdevicestatus_ */ /* errorstatus */ /* PORTABLE C */ -/* 6.0 */ +/* 6.1 */ /* */ /* */ /* AUTHOR */ @@ -70,6 +70,8 @@ /* 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 */ /* */ /**************************************************************************/ UINT _ux_pictbridge_xml_function_output_getdevicestatus_errorstatus(UX_PICTBRIDGE *pictbridge, diff --git a/common/usbx_pictbridge/src/ux_pictbridge_xml_function_output_getdevicestatus_jobendreason.c b/common/usbx_pictbridge/src/ux_pictbridge_xml_function_output_getdevicestatus_jobendreason.c index 5700cb5..63d094b 100644 --- a/common/usbx_pictbridge/src/ux_pictbridge_xml_function_output_getdevicestatus_jobendreason.c +++ b/common/usbx_pictbridge/src/ux_pictbridge_xml_function_output_getdevicestatus_jobendreason.c @@ -36,7 +36,7 @@ /* _ux_pictbridge_xml_function_output_getdevicestatus_ */ /* jobendreason */ /* PORTABLE C */ -/* 6.0 */ +/* 6.1 */ /* */ /* */ /* AUTHOR */ @@ -70,6 +70,8 @@ /* 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 */ /* */ /**************************************************************************/ UINT _ux_pictbridge_xml_function_output_getdevicestatus_jobendreason(UX_PICTBRIDGE *pictbridge, diff --git a/common/usbx_pictbridge/src/ux_pictbridge_xml_function_output_getdevicestatus_newjobok.c b/common/usbx_pictbridge/src/ux_pictbridge_xml_function_output_getdevicestatus_newjobok.c index f0c6530..16a542d 100644 --- a/common/usbx_pictbridge/src/ux_pictbridge_xml_function_output_getdevicestatus_newjobok.c +++ b/common/usbx_pictbridge/src/ux_pictbridge_xml_function_output_getdevicestatus_newjobok.c @@ -34,10 +34,8 @@ /* FUNCTION RELEASE */ /* */ /* _ux_pictbridge_xml_function_output_getdevicestatus_newjobok */ -/* */ /* PORTABLE C */ -/* 6.0 */ -/* 6.0 */ +/* 6.1 */ /* */ /* */ /* AUTHOR */ @@ -71,6 +69,8 @@ /* 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 */ /* */ /**************************************************************************/ UINT _ux_pictbridge_xml_function_output_getdevicestatus_newjobok(UX_PICTBRIDGE *pictbridge, diff --git a/common/usbx_pictbridge/src/ux_pictbridge_xml_function_output_result.c b/common/usbx_pictbridge/src/ux_pictbridge_xml_function_output_result.c index dddf821..25ea078 100644 --- a/common/usbx_pictbridge/src/ux_pictbridge_xml_function_output_result.c +++ b/common/usbx_pictbridge/src/ux_pictbridge_xml_function_output_result.c @@ -34,7 +34,7 @@ /* FUNCTION RELEASE */ /* */ /* _ux_pictbridge_xml_function_output_result PORTABLE C */ -/* 6.0 */ +/* 6.1 */ /* */ /* */ /* AUTHOR */ @@ -68,6 +68,8 @@ /* 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 */ /* */ /**************************************************************************/ UINT _ux_pictbridge_xml_function_output_result(UX_PICTBRIDGE *pictbridge, diff --git a/common/usbx_pictbridge/src/ux_pictbridge_xml_function_root_dps.c b/common/usbx_pictbridge/src/ux_pictbridge_xml_function_root_dps.c index 6ac8224..55b6ad3 100644 --- a/common/usbx_pictbridge/src/ux_pictbridge_xml_function_root_dps.c +++ b/common/usbx_pictbridge/src/ux_pictbridge_xml_function_root_dps.c @@ -34,7 +34,7 @@ /* FUNCTION RELEASE */ /* */ /* _ux_pictbridge_xml_function_root_dps PORTABLE C */ -/* 6.0 */ +/* 6.1 */ /* AUTHOR */ /* */ /* Chaoqiong Xiao, Microsoft Corporation */ @@ -65,6 +65,8 @@ /* 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 */ /* */ /**************************************************************************/ UINT _ux_pictbridge_xml_function_root_dps(UX_PICTBRIDGE *pictbridge, UCHAR *input_variable, diff --git a/common/usbx_pictbridge/src/ux_pictbridge_xml_function_root_input.c b/common/usbx_pictbridge/src/ux_pictbridge_xml_function_root_input.c index 66cd82b..399405a 100644 --- a/common/usbx_pictbridge/src/ux_pictbridge_xml_function_root_input.c +++ b/common/usbx_pictbridge/src/ux_pictbridge_xml_function_root_input.c @@ -34,7 +34,7 @@ /* FUNCTION RELEASE */ /* */ /* _ux_pictbridge_xml_function_root_input PORTABLE C */ -/* 6.0 */ +/* 6.1 */ /* AUTHOR */ /* */ /* Chaoqiong Xiao, Microsoft Corporation */ @@ -66,6 +66,8 @@ /* 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 */ /* */ /**************************************************************************/ UINT _ux_pictbridge_xml_function_root_input(UX_PICTBRIDGE *pictbridge, UCHAR *input_variable, diff --git a/common/usbx_pictbridge/src/ux_pictbridge_xml_function_root_output.c b/common/usbx_pictbridge/src/ux_pictbridge_xml_function_root_output.c index a807567..729016b 100644 --- a/common/usbx_pictbridge/src/ux_pictbridge_xml_function_root_output.c +++ b/common/usbx_pictbridge/src/ux_pictbridge_xml_function_root_output.c @@ -34,7 +34,7 @@ /* FUNCTION RELEASE */ /* */ /* _ux_pictbridge_xml_function_root_output PORTABLE C */ -/* 6.0 */ +/* 6.1 */ /* AUTHOR */ /* */ /* Chaoqiong Xiao, Microsoft Corporation */ @@ -66,6 +66,8 @@ /* 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 */ /* */ /**************************************************************************/ UINT _ux_pictbridge_xml_function_root_output(UX_PICTBRIDGE *pictbridge, UCHAR *input_variable, diff --git a/common/usbx_pictbridge/src/ux_pictbridge_xml_function_root_xml.c b/common/usbx_pictbridge/src/ux_pictbridge_xml_function_root_xml.c index 8eac3cf..52d3d1c 100644 --- a/common/usbx_pictbridge/src/ux_pictbridge_xml_function_root_xml.c +++ b/common/usbx_pictbridge/src/ux_pictbridge_xml_function_root_xml.c @@ -34,7 +34,7 @@ /* FUNCTION RELEASE */ /* */ /* _ux_pictbridge_xml_function_root_xml PORTABLE C */ -/* 6.0 */ +/* 6.1 */ /* AUTHOR */ /* */ /* Chaoqiong Xiao, Microsoft Corporation */ @@ -65,6 +65,8 @@ /* 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 */ /* */ /**************************************************************************/ UINT _ux_pictbridge_xml_function_root_xml(UX_PICTBRIDGE *pictbridge, UCHAR *input_variable, diff --git a/ports/arm9/gnu/inc/ux_port.h b/ports/arm9/gnu/inc/ux_port.h index c689e22..7eb4e87 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.0.1 */ +/* 6.1 */ /* */ /* AUTHOR */ /* */ @@ -41,7 +41,7 @@ /* */ /* DATE NAME DESCRIPTION */ /* */ -/* 06-30-2020 Chaoqiong Xiao Initial Version 6.0.1 */ +/* 09-30-2020 Chaoqiong Xiao Initial Version 6.1 */ /* */ /**************************************************************************/ @@ -207,7 +207,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.0.1 *"; + "Copyright (c) Microsoft Corporation. All rights reserved. * USBX ARM9/GNU Version 6.1 *"; #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 d747134..30eeec4 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.0.1 */ +/* 6.1 */ /* */ /* AUTHOR */ /* */ @@ -41,7 +41,7 @@ /* */ /* DATE NAME DESCRIPTION */ /* */ -/* 06-30-2020 Chaoqiong Xiao Initial Version 6.0.1 */ +/* 09-30-2020 Chaoqiong Xiao Initial Version 6.1 */ /* */ /**************************************************************************/ @@ -214,7 +214,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.0.1 *"; + "Copyright (c) Microsoft Corporation. All rights reserved. * USBX ARM9/IAR Version 6.1 *"; #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 0f6cb9f..4a16f0b 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.0.1 */ +/* 6.1 */ /* */ /* AUTHOR */ /* */ @@ -41,7 +41,7 @@ /* */ /* DATE NAME DESCRIPTION */ /* */ -/* 06-30-2020 Chaoqiong Xiao Initial Version 6.0.1 */ +/* 09-30-2020 Chaoqiong Xiao Initial Version 6.1 */ /* */ /**************************************************************************/ @@ -203,7 +203,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.0.1 *"; + "Copyright (c) Microsoft Corporation. All rights reserved. * USBX Cortex-A15/GNU Version 6.1 *"; #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 ce74705..88097c2 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.0.1 */ +/* 6.1 */ /* */ /* AUTHOR */ /* */ @@ -41,7 +41,7 @@ /* */ /* DATE NAME DESCRIPTION */ /* */ -/* 06-30-2020 Chaoqiong Xiao Initial Version 6.0.1 */ +/* 09-30-2020 Chaoqiong Xiao Initial Version 6.1 */ /* */ /**************************************************************************/ @@ -210,7 +210,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.0.1 *"; + "Copyright (c) Microsoft Corporation. All rights reserved. * USBX Cortex-A5/GNU Version 6.1 *"; #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 0910d52..f248f5a 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.0.1 */ +/* 6.1 */ /* */ /* AUTHOR */ /* */ @@ -41,7 +41,7 @@ /* */ /* DATE NAME DESCRIPTION */ /* */ -/* 06-30-2020 Chaoqiong Xiao Initial Version 6.0.1 */ +/* 09-30-2020 Chaoqiong Xiao Initial Version 6.1 */ /* */ /**************************************************************************/ @@ -210,7 +210,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.0.1 *"; + "Copyright (c) Microsoft Corporation. All rights reserved. * USBX Cortex-A5/IAR Version 6.1 *"; #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 55a1011..6e6e825 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.0.1 */ +/* 6.1 */ /* */ /* AUTHOR */ /* */ @@ -41,7 +41,7 @@ /* */ /* DATE NAME DESCRIPTION */ /* */ -/* 06-30-2020 Chaoqiong Xiao Initial Version 6.0.1 */ +/* 09-30-2020 Chaoqiong Xiao Initial Version 6.1 */ /* */ /**************************************************************************/ @@ -227,7 +227,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.0.1 *"; + "Copyright (c) Microsoft Corporation. All rights reserved. * USBX Cortex-A5x/AC6 Version 6.1 *"; #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 0efe0c9..6021838 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.0.1 */ +/* 6.1 */ /* */ /* AUTHOR */ /* */ @@ -41,7 +41,7 @@ /* */ /* DATE NAME DESCRIPTION */ /* */ -/* 06-30-2020 Chaoqiong Xiao Initial Version 6.0.1 */ +/* 09-30-2020 Chaoqiong Xiao Initial Version 6.1 */ /* */ /**************************************************************************/ @@ -214,7 +214,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.0.1 *"; + "Copyright (c) Microsoft Corporation. All rights reserved. * USBX Cortex-A7/GNU Version 6.1 *"; #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 c63ec1f..c05bee3 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.0.1 */ +/* 6.1 */ /* */ /* AUTHOR */ /* */ @@ -41,7 +41,7 @@ /* */ /* DATE NAME DESCRIPTION */ /* */ -/* 06-30-2020 Chaoqiong Xiao Initial Version 6.0.1 */ +/* 09-30-2020 Chaoqiong Xiao Initial Version 6.1 */ /* */ /**************************************************************************/ @@ -214,7 +214,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.0.1 *"; + "Copyright (c) Microsoft Corporation. All rights reserved. * USBX Cortex-A7/IAR Version 6.1 *"; #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 ad3bea5..ac74a32 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.0.1 */ +/* 6.1 */ /* */ /* AUTHOR */ /* */ @@ -41,7 +41,7 @@ /* */ /* DATE NAME DESCRIPTION */ /* */ -/* 06-30-2020 Chaoqiong Xiao Initial Version 6.0.1 */ +/* 09-30-2020 Chaoqiong Xiao Initial Version 6.1 */ /* */ /**************************************************************************/ @@ -210,7 +210,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.0.1 *"; + "Copyright (c) Microsoft Corporation. All rights reserved. * USBX Cortex-A8/GNU Version 6.1 *"; #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 6521fa8..b60258d 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.0.1 */ +/* 6.1 */ /* */ /* AUTHOR */ /* */ @@ -41,7 +41,7 @@ /* */ /* DATE NAME DESCRIPTION */ /* */ -/* 06-30-2020 Chaoqiong Xiao Initial Version 6.0.1 */ +/* 09-30-2020 Chaoqiong Xiao Initial Version 6.1 */ /* */ /**************************************************************************/ @@ -210,7 +210,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.0.1 *"; + "Copyright (c) Microsoft Corporation. All rights reserved. * USBX Cortex-A8/IAR Version 6.1 *"; #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 d1eed79..d7e4f40 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.0.1 */ +/* 6.1 */ /* */ /* AUTHOR */ /* */ @@ -41,7 +41,7 @@ /* */ /* DATE NAME DESCRIPTION */ /* */ -/* 06-30-2020 Chaoqiong Xiao Initial Version 6.0.1 */ +/* 09-30-2020 Chaoqiong Xiao Initial Version 6.1 */ /* */ /**************************************************************************/ @@ -210,7 +210,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.0.1 *"; + "Copyright (c) Microsoft Corporation. All rights reserved. * USBX ARM9/GNU Version 6.1 *"; #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 8de41e2..7d27318 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.0.1 */ +/* 6.1 */ /* */ /* AUTHOR */ /* */ @@ -41,7 +41,7 @@ /* */ /* DATE NAME DESCRIPTION */ /* */ -/* 06-30-2020 Chaoqiong Xiao Initial Version 6.0.1 */ +/* 09-30-2020 Chaoqiong Xiao Initial Version 6.1 */ /* */ /**************************************************************************/ @@ -210,7 +210,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.0.1 *"; + "Copyright (c) Microsoft Corporation. All rights reserved. * USBX ARM9/IAR Version 6.1 *"; #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 ca1b561..0e6a70b 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.0 */ +/* 6.1 */ /* */ /* AUTHOR */ /* */ @@ -42,6 +42,8 @@ /* 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 */ /* */ /**************************************************************************/ @@ -206,7 +208,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.0 *"; + "Copyright (c) Microsoft Corporation. All rights reserved. * USBX Cortex-M0/GNU Version 6.1 *"; #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 5b9e7ce..70b3a51 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.0.1 */ +/* 6.1 */ /* */ /* AUTHOR */ /* */ @@ -41,7 +41,7 @@ /* */ /* DATE NAME DESCRIPTION */ /* */ -/* 06-30-2020 Chaoqiong Xiao Initial Version 6.0.1 */ +/* 09-30-2020 Chaoqiong Xiao Initial Version 6.1 */ /* */ /**************************************************************************/ @@ -210,7 +210,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.0.1 *"; + "Copyright (c) Microsoft Corporation. All rights reserved. * USBX Cortex-M0/IAR Version 6.1 *"; #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 db505f8..6b24b35 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.0 */ +/* 6.1 */ /* */ /* AUTHOR */ /* */ @@ -42,6 +42,8 @@ /* 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 */ /* */ /**************************************************************************/ @@ -206,7 +208,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.0 *"; + "Copyright (c) Microsoft Corporation. All rights reserved. * USBX Cortex-M3/GNU Version 6.1 *"; #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 7f8f383..178ed9e 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.0.1 */ +/* 6.1 */ /* */ /* AUTHOR */ /* */ @@ -41,7 +41,7 @@ /* */ /* DATE NAME DESCRIPTION */ /* */ -/* 06-30-2020 Chaoqiong Xiao Initial Version 6.0.1 */ +/* 09-30-2020 Chaoqiong Xiao Initial Version 6.1 */ /* */ /**************************************************************************/ @@ -210,7 +210,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.0.1 *"; + "Copyright (c) Microsoft Corporation. All rights reserved. * USBX Cortex-M3/IAR Version 6.1 *"; #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 b9a8656..68f0463 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.0 */ +/* 6.1 */ /* */ /* AUTHOR */ /* */ @@ -42,6 +42,8 @@ /* 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 */ /* */ /**************************************************************************/ @@ -206,7 +208,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.0 *"; + "Copyright (c) Microsoft Corporation. All rights reserved. * USBX Cortex-M4/GNU Version 6.1 *"; #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 fb4f6d5..9aa69dc 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.0.1 */ +/* 6.1 */ /* */ /* AUTHOR */ /* */ @@ -41,7 +41,7 @@ /* */ /* DATE NAME DESCRIPTION */ /* */ -/* 06-30-2020 Chaoqiong Xiao Initial Version 6.0.1 */ +/* 09-30-2020 Chaoqiong Xiao Initial Version 6.1 */ /* */ /**************************************************************************/ @@ -210,7 +210,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.0.1 *"; + "Copyright (c) Microsoft Corporation. All rights reserved. * USBX Cortex-M4/IAR Version 6.1 *"; #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 3411fed..7c3ec45 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.0 */ +/* 6.1 */ /* */ /* AUTHOR */ /* */ @@ -42,6 +42,8 @@ /* 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 */ /* */ /**************************************************************************/ @@ -206,7 +208,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.0 *"; + "Copyright (c) Microsoft Corporation. All rights reserved. * USBX Cortex-M7/GNU Version 6.1 *"; #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 9a104cb..0d59ebf 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.0.1 */ +/* 6.1 */ /* */ /* AUTHOR */ /* */ @@ -41,7 +41,7 @@ /* */ /* DATE NAME DESCRIPTION */ /* */ -/* 06-30-2020 Chaoqiong Xiao Initial Version 6.0.1 */ +/* 09-30-2020 Chaoqiong Xiao Initial Version 6.1 */ /* */ /**************************************************************************/ @@ -210,7 +210,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.0.1 *"; + "Copyright (c) Microsoft Corporation. All rights reserved. * USBX Cortex-M7/IAR Version 6.1 *"; #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 b874903..54c16d9 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.0.1 */ +/* 6.1 */ /* */ /* AUTHOR */ /* */ @@ -41,7 +41,7 @@ /* */ /* DATE NAME DESCRIPTION */ /* */ -/* 06-30-2020 Chaoqiong Xiao Initial Version 6.0.1 */ +/* 09-30-2020 Chaoqiong Xiao Initial Version 6.1 */ /* */ /**************************************************************************/ @@ -206,7 +206,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.0.1 *"; + "Copyright (c) Microsoft Corporation. All rights reserved. * USBX Cortex-R4/GNU Version 6.1 *"; #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 15183a1..5b81484 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.0.1 */ +/* 6.1 */ /* */ /* AUTHOR */ /* */ @@ -41,7 +41,7 @@ /* */ /* DATE NAME DESCRIPTION */ /* */ -/* 06-30-2020 Chaoqiong Xiao Initial Version 6.0.1 */ +/* 09-30-2020 Chaoqiong Xiao Initial Version 6.1 */ /* */ /**************************************************************************/ @@ -210,7 +210,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.0.1 *"; + "Copyright (c) Microsoft Corporation. All rights reserved. * USBX Cortex-R4/IAR Version 6.1 *"; #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 d9fab7c..9cd8400 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.0.1 */ +/* 6.1 */ /* */ /* AUTHOR */ /* */ @@ -41,7 +41,7 @@ /* */ /* DATE NAME DESCRIPTION */ /* */ -/* 06-30-2020 Chaoqiong Xiao Initial Version 6.0.1 */ +/* 09-30-2020 Chaoqiong Xiao Initial Version 6.1 */ /* */ /**************************************************************************/ @@ -210,7 +210,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.0.1 *"; + "Copyright (c) Microsoft Corporation. All rights reserved. * USBX Cortex-R5/GNU Version 6.1 *"; #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 bfbcc7e..5d0a8de 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.0.1 */ +/* 6.1 */ /* */ /* AUTHOR */ /* */ @@ -41,7 +41,7 @@ /* */ /* DATE NAME DESCRIPTION */ /* */ -/* 06-30-2020 Chaoqiong Xiao Initial Version 6.0.1 */ +/* 09-30-2020 Chaoqiong Xiao Initial Version 6.1 */ /* */ /**************************************************************************/ @@ -210,7 +210,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.0.1 *"; + "Copyright (c) Microsoft Corporation. All rights reserved. * USBX Cortex-R5/IAR Version 6.1 *"; #else extern CHAR _ux_version_id[]; #endif diff --git a/samples/demo_usbx.c b/samples/demo_usbx.c index 1d7de2b..09dcfb0 100644 --- a/samples/demo_usbx.c +++ b/samples/demo_usbx.c @@ -290,7 +290,7 @@ UX_HOST_CLASS *class; thread_0_counter++; /* Initialize the write buffer. */ - _ux_utility_memory_set(host_out_buffer, current_char, UX_HOST_CLASS_DPUMP_PACKET_SIZE); + _ux_utility_memory_set(host_out_buffer, current_char, UX_HOST_CLASS_DPUMP_PACKET_SIZE); /* Use case of memset is verified. */ /* Increment the character in buffer. */ current_char++; |
