diff --git a/common/core/CMakeLists.txt b/common/core/CMakeLists.txt
index 0e795d81..9f767540 100644
--- a/common/core/CMakeLists.txt
+++ b/common/core/CMakeLists.txt
@@ -10,6 +10,7 @@ target_sources(${PROJECT_NAME} PRIVATE
${CMAKE_CURRENT_LIST_DIR}/src/ux_dcd_sim_slave_function.c
${CMAKE_CURRENT_LIST_DIR}/src/ux_dcd_sim_slave_initialize.c
${CMAKE_CURRENT_LIST_DIR}/src/ux_dcd_sim_slave_initialize_complete.c
+ ${CMAKE_CURRENT_LIST_DIR}/src/ux_dcd_sim_slave_uninitialize.c
${CMAKE_CURRENT_LIST_DIR}/src/ux_dcd_sim_slave_state_change.c
${CMAKE_CURRENT_LIST_DIR}/src/ux_dcd_sim_slave_transfer_abort.c
${CMAKE_CURRENT_LIST_DIR}/src/ux_dcd_sim_slave_transfer_request.c
diff --git a/common/core/inc/ux_api.h b/common/core/inc/ux_api.h
index bdb5b83e..c6fa5aad 100644
--- a/common/core/inc/ux_api.h
+++ b/common/core/inc/ux_api.h
@@ -1,5 +1,6 @@
/***************************************************************************
* Copyright (c) 2024 Microsoft Corporation
+ * Copyright (c) 2026-present Eclipse ThreadX contributors
*
* This program and the accompanying materials are made available under the
* terms of the MIT License which is available at
@@ -38,116 +39,6 @@
/* Please note that basic data type definitions and other architecture-*/
/* specific information is contained in the file ux_port.h. */
/* */
-/* RELEASE HISTORY */
-/* */
-/* DATE NAME DESCRIPTION */
-/* */
-/* 05-19-2020 Chaoqiong Xiao Initial Version 6.0 */
-/* 09-30-2020 Chaoqiong Xiao Modified comment(s), */
-/* added query usage of device */
-/* 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 */
-/* 11-09-2020 Chaoqiong Xiao Modified comment(s), */
-/* used unsigned defines, */
-/* added HCD uninit command, */
-/* modified HCD status code, */
-/* fixed compile warnings, */
-/* resulting in version 6.1.2 */
-/* 12-31-2020 Chaoqiong Xiao Modified comment(s), */
-/* added BOS support, */
-/* resulting in version 6.1.3 */
-/* 02-02-2021 Chaoqiong Xiao Modified comment(s), */
-/* added configuration activate*/
-/* and deactivate support, */
-/* added host printer get */
-/* device ID support, */
-/* added host device string */
-/* descriptor get support, */
-/* added events for device */
-/* connection/disconnection, */
-/* resulting in version 6.1.4 */
-/* 03-02-2021 Chaoqiong Xiao Modified comment(s), */
-/* resulting in version 6.1.5 */
-/* 04-02-2021 Chaoqiong Xiao Modified comment(s), */
-/* added macros for Word/DWord */
-/* to bytes extraction, */
-/* resulting in version 6.1.6 */
-/* 06-02-2021 Chaoqiong Xiao Modified comment(s), */
-/* added trace dependency test,*/
-/* changed transfer timeout */
-/* value, */
-/* resulting in version 6.1.7 */
-/* 08-02-2021 Chaoqiong Xiao Modified comment(s), */
-/* fixed spelling error, */
-/* fixed trace ID order error, */
-/* resulting in version 6.1.8 */
-/* 10-15-2021 Chaoqiong Xiao Modified comment(s), */
-/* improved assert macros, */
-/* added transfer size field, */
-/* improved traceX support, */
-/* resulting in version 6.1.9 */
-/* 01-31-2022 Chaoqiong Xiao Modified comment(s), */
-/* added too many ports error, */
-/* moved tx_api.h include and */
-/* typedefs to ux_port.h, */
-/* added standalone support, */
-/* added device HID trace IDs, */
-/* added some general errors, */
-/* added printer trace IDs, */
-/* resulting in version 6.1.10 */
-/* 04-25-2022 Chaoqiong Xiao Modified comment(s), */
-/* assumed OS types to avoid */
-/* standalone compiling error, */
-/* added CCID trace IDs, */
-/* resulting in version 6.1.11 */
-/* 07-29-2022 Chaoqiong Xiao Modified comment(s), */
-/* fixed parameter/variable */
-/* names conflict C++ keyword, */
-/* added feedback size defs, */
-/* added shared device config */
-/* descriptor for enum scan, */
-/* resulting in version 6.1.12 */
-/* 10-31-2022 Chaoqiong Xiao Modified comment(s), */
-/* added some ETH error codes, */
-/* allowed align minimal def, */
-/* added interface instance */
-/* creation strategy control, */
-/* resulting in version 6.2.0 */
-/* 03-08-2023 Chaoqiong Xiao Modified comment(s), */
-/* accepted UX_MAX_CLASSES as */
-/* max class driver configure, */
-/* added a new error code, */
-/* resulting in version 6.2.1 */
-/* 10-31-2023 Chaoqiong Xiao Modified comment(s), */
-/* refined memory management, */
-/* added a new mode to manage */
-/* endpoint buffer in classes, */
-/* optimized USB descriptors, */
-/* added error checks support, */
-/* resulting in version 6.3.0 */
-/* 12-31-2023 Chaoqiong Xiao Modified comment(s), */
-/* resulting in version 6.4.0 */
-/* 03-01-2024 Tiejun Zhou Modified comment(s), */
-/* update version number, */
-/* resulting in version 6.4.1 */
-/* 02-19-2025 Frédéric Desbiens Modified comment(s), */
-/* update version number, */
-/* resulting in version 6.4.2 */
-/* */
/**************************************************************************/
#ifndef UX_API_H
@@ -347,10 +238,10 @@ typedef signed char SCHAR;
/* Define basic constants for the USBX Stack. */
#define AZURE_RTOS_USBX
#define USBX_MAJOR_VERSION 6
-#define USBX_MINOR_VERSION 4
-#define USBX_PATCH_VERSION 5
-#define USBX_BUILD_VERSION 202504
-#define USBX_HOTFIX_VERSION 'a'
+#define USBX_MINOR_VERSION 5
+#define USBX_PATCH_VERSION 0
+#define USBX_BUILD_VERSION 202601
+#define USBX_HOTFIX_VERSION ' '
/* Macros for concatenating tokens, where UX_CONCATn concatenates n tokens. */
diff --git a/common/core/inc/ux_class_audio10.h b/common/core/inc/ux_class_audio10.h
index 300d2f4a..6844c5bb 100644
--- a/common/core/inc/ux_class_audio10.h
+++ b/common/core/inc/ux_class_audio10.h
@@ -1,10 +1,11 @@
/***************************************************************************
- * Copyright (c) 2024 Microsoft Corporation
- *
+ * Copyright (c) 2024 Microsoft Corporation
+ * Copyright (c) 2026-present Eclipse ThreadX contributors
+ *
* This program and the accompanying materials are made available under the
* terms of the MIT License which is available at
* https://opensource.org/licenses/MIT.
- *
+ *
* SPDX-License-Identifier: MIT
**************************************************************************/
@@ -35,12 +36,6 @@
/* This file contains all the header and structures used by the */
/* USBX Audio Class (UAC) 1.0. */
/* */
-/* RELEASE HISTORY */
-/* */
-/* DATE NAME DESCRIPTION */
-/* */
-/* 07-29-2022 Chaoqiong Xiao Initial Version 6.1.12 */
-/* */
/**************************************************************************/
#ifndef UX_CLASS_AUDIO10_H
@@ -933,7 +928,7 @@ typedef struct UX_CLASS_AUDIO10_TYPE_I_FORMAT_TYPE_CONTINUOUS_DESCRIPTOR_STRUCT
UCHAR tLowerSamFreq[3];
UCHAR tUpperSamFreq[3];
}
-UX_CLASS_AUDIO10_TYPE_I_FORMAT_TYPE_CONTINUOUS_DESCRIPTOR,
+UX_CLASS_AUDIO10_TYPE_I_FORMAT_TYPE_CONTINUOUS_DESCRIPTOR,
UX_CLASS_AUDIO10_TYPE_I_FORMAT_TYPE_DESCRIPTOR_0;
typedef struct UX_CLASS_AUDIO10_TYPE_I_FORMAT_TYPE_DISCRETE_DESCRIPTOR_STRUCT
diff --git a/common/core/inc/ux_class_audio20.h b/common/core/inc/ux_class_audio20.h
index 8c7fcfb9..87378717 100644
--- a/common/core/inc/ux_class_audio20.h
+++ b/common/core/inc/ux_class_audio20.h
@@ -1,10 +1,11 @@
/***************************************************************************
- * Copyright (c) 2024 Microsoft Corporation
- *
+ * Copyright (c) 2024 Microsoft Corporation
+ * Copyright (c) 2026-present Eclipse ThreadX contributors
+ *
* This program and the accompanying materials are made available under the
* terms of the MIT License which is available at
* https://opensource.org/licenses/MIT.
- *
+ *
* SPDX-License-Identifier: MIT
**************************************************************************/
@@ -35,12 +36,6 @@
/* This file contains all the header and structures used by the */
/* USBX Audio Class (UAC) 2.0. */
/* */
-/* RELEASE HISTORY */
-/* */
-/* DATE NAME DESCRIPTION */
-/* */
-/* 07-29-2022 Chaoqiong Xiao Initial Version 6.1.12 */
-/* */
/**************************************************************************/
#ifndef UX_CLASS_AUDIO20_H
diff --git a/common/core/inc/ux_dcd_sim_slave.h b/common/core/inc/ux_dcd_sim_slave.h
index 8de3029f..d3f45172 100644
--- a/common/core/inc/ux_dcd_sim_slave.h
+++ b/common/core/inc/ux_dcd_sim_slave.h
@@ -1,18 +1,19 @@
/***************************************************************************
- * Copyright (c) 2024 Microsoft Corporation
- *
+ * Copyright (c) 2024 Microsoft Corporation
+ * Copyright (c) 2026-present Eclipse ThreadX contributors
+ *
* This program and the accompanying materials are made available under the
* terms of the MIT License which is available at
* https://opensource.org/licenses/MIT.
- *
+ *
* SPDX-License-Identifier: MIT
**************************************************************************/
/**************************************************************************/
/**************************************************************************/
-/** */
-/** USBX Component */
+/** */
+/** USBX Component */
/** */
/** Slave Simulator Controller Driver */
/** */
@@ -20,55 +21,36 @@
/**************************************************************************/
-/**************************************************************************/
-/* */
-/* COMPONENT DEFINITION RELEASE */
-/* */
-/* ux_dcd_sim_slave.h PORTABLE C */
+/**************************************************************************/
+/* */
+/* COMPONENT DEFINITION RELEASE */
+/* */
+/* ux_dcd_sim_slave.h PORTABLE C */
/* 6.1.10 */
/* AUTHOR */
/* */
/* Chaoqiong Xiao, Microsoft Corporation */
/* */
/* DESCRIPTION */
-/* */
+/* */
/* This file contains all the header and extern functions used by the */
-/* USBX slave simulator. It is designed to work ONLY with the USBX */
-/* host simulator. */
-/* */
-/* RELEASE HISTORY */
-/* */
-/* DATE NAME DESCRIPTION */
-/* */
-/* 05-19-2020 Chaoqiong Xiao Initial Version 6.0 */
-/* 09-30-2020 Chaoqiong Xiao Modified comment(s), */
-/* resulting in version 6.1 */
-/* 04-02-2021 Chaoqiong Xiao Modified comment(s), */
-/* added HCD connected to, */
-/* supported bi-dir-endpoints, */
-/* resulting in version 6.1.6 */
-/* 08-02-2021 Chaoqiong Xiao Modified comment(s), */
-/* added extern "C" keyword */
-/* for compatibility with C++, */
-/* resulting in version 6.1.8 */
-/* 01-31-2022 Chaoqiong Xiao Modified comment(s), */
-/* added standalone support, */
-/* resulting in version 6.1.10 */
+/* USBX slave simulator. It is designed to work ONLY with the USBX */
+/* host simulator. */
/* */
/**************************************************************************/
#ifndef UX_DCD_SIM_SLAVE_H
#define UX_DCD_SIM_SLAVE_H
-/* Determine if a C++ compiler is being used. If so, ensure that standard
- C is used to process the API information. */
+/* Determine if a C++ compiler is being used. If so, ensure that standard
+ C is used to process the API information. */
-#ifdef __cplusplus
+#ifdef __cplusplus
-/* Yes, C++ compiler is present. Use standard C. */
-extern "C" {
+/* Yes, C++ compiler is present. Use standard C. */
+extern "C" {
-#endif
+#endif
/* Define USB slave simulator major equivalences. */
@@ -110,7 +92,7 @@ extern "C" {
/* Define USB slave simulator physical endpoint structure. */
-typedef struct UX_DCD_SIM_SLAVE_ED_STRUCT
+typedef struct UX_DCD_SIM_SLAVE_ED_STRUCT
{
ULONG ux_sim_slave_ed_status;
@@ -119,7 +101,7 @@ typedef struct UX_DCD_SIM_SLAVE_ED_STRUCT
ULONG ux_sim_slave_ed_ping_pong;
ULONG ux_sim_slave_ed_status_register;
ULONG ux_sim_slave_ed_configuration_value;
- struct UX_SLAVE_ENDPOINT_STRUCT
+ struct UX_SLAVE_ENDPOINT_STRUCT
*ux_sim_slave_ed_endpoint;
} UX_DCD_SIM_SLAVE_ED;
@@ -127,14 +109,14 @@ typedef struct UX_DCD_SIM_SLAVE_ED_STRUCT
/* Define USB slave simulator DCD structure definition. */
typedef struct UX_DCD_SIM_SLAVE_STRUCT
-{
+{
- struct UX_SLAVE_DCD_STRUCT
+ struct UX_SLAVE_DCD_STRUCT
*ux_dcd_sim_slave_dcd_owner;
- struct UX_DCD_SIM_SLAVE_ED_STRUCT
+ struct UX_DCD_SIM_SLAVE_ED_STRUCT
ux_dcd_sim_slave_ed[UX_DCD_SIM_SLAVE_MAX_ED];
#ifdef UX_DEVICE_BIDIRECTIONAL_ENDPOINT_SUPPORT
- struct UX_DCD_SIM_SLAVE_ED_STRUCT
+ struct UX_DCD_SIM_SLAVE_ED_STRUCT
ux_dcd_sim_slave_ed_in[UX_DCD_SIM_SLAVE_MAX_ED];
#endif
UINT (*ux_dcd_sim_slave_dcd_control_request_process_hub)(UX_SLAVE_TRANSFER *transfer_request);
@@ -154,6 +136,7 @@ UINT _ux_dcd_sim_slave_frame_number_get(UX_DCD_SIM_SLAVE *dcd_sim_slave, ULON
UINT _ux_dcd_sim_slave_function(UX_SLAVE_DCD *dcd, UINT function, VOID *parameter);
UINT _ux_dcd_sim_slave_initialize(VOID);
UINT _ux_dcd_sim_slave_initialize_complete(VOID);
+UINT _ux_dcd_sim_slave_uninitialize(VOID);
UINT _ux_dcd_sim_slave_state_change(UX_DCD_SIM_SLAVE *dcd_sim_slave, ULONG state);
UINT _ux_dcd_sim_slave_transfer_request(UX_DCD_SIM_SLAVE *dcd_sim_slave, UX_SLAVE_TRANSFER *transfer_request);
UINT _ux_dcd_sim_slave_transfer_run(UX_DCD_SIM_SLAVE *dcd_sim_slave, UX_SLAVE_TRANSFER *transfer_request);
@@ -162,11 +145,12 @@ UINT _ux_dcd_sim_slave_transfer_abort(UX_DCD_SIM_SLAVE *dcd_sim_slave, UX_SLA
/* Define Device Simulator Class API prototypes. */
#define ux_dcd_sim_slave_initialize _ux_dcd_sim_slave_initialize
+#define ux_dcd_sim_slave_uninitialize _ux_dcd_sim_slave_uninitialize
-/* Determine if a C++ compiler is being used. If so, complete the standard
- C conditional started above. */
+/* Determine if a C++ compiler is being used. If so, complete the standard
+ C conditional started above. */
#ifdef __cplusplus
-}
+}
#endif
#endif
diff --git a/common/core/inc/ux_device_class_dpump.h b/common/core/inc/ux_device_class_dpump.h
index 1f1529db..87b11649 100644
--- a/common/core/inc/ux_device_class_dpump.h
+++ b/common/core/inc/ux_device_class_dpump.h
@@ -1,18 +1,19 @@
/***************************************************************************
- * Copyright (c) 2024 Microsoft Corporation
- *
+ * Copyright (c) 2024 Microsoft Corporation
+ * Copyright (c) 2026-present Eclipse ThreadX contributors
+ *
* This program and the accompanying materials are made available under the
* terms of the MIT License which is available at
* https://opensource.org/licenses/MIT.
- *
+ *
* SPDX-License-Identifier: MIT
**************************************************************************/
/**************************************************************************/
/**************************************************************************/
-/** */
-/** USBX Component */
+/** */
+/** USBX Component */
/** */
/** Device Data Pump Class */
/** */
@@ -20,54 +21,35 @@
/**************************************************************************/
-/**************************************************************************/
-/* */
-/* COMPONENT DEFINITION RELEASE */
-/* */
-/* ux_device_class_dpump.h PORTABLE C */
+/**************************************************************************/
+/* */
+/* COMPONENT DEFINITION RELEASE */
+/* */
+/* ux_device_class_dpump.h PORTABLE C */
/* 6.3.0 */
/* AUTHOR */
/* */
/* Chaoqiong Xiao, Microsoft Corporation */
/* */
/* DESCRIPTION */
-/* */
+/* */
/* This file contains all the header and extern functions used by the */
-/* USBX device dpump class. */
-/* */
-/* RELEASE HISTORY */
-/* */
-/* DATE NAME DESCRIPTION */
-/* */
-/* 05-19-2020 Chaoqiong Xiao Initial Version 6.0 */
-/* 09-30-2020 Chaoqiong Xiao Modified comment(s), */
-/* resulting in version 6.1 */
-/* 08-02-2021 Wen Wang Modified comment(s), */
-/* added extern "C" keyword */
-/* for compatibility with C++, */
-/* resulting in version 6.1.8 */
-/* 01-31-2022 Chaoqiong Xiao Modified comment(s), */
-/* added standalone support, */
-/* resulting in version 6.1.10 */
-/* 10-31-2023 Chaoqiong Xiao Modified comment(s), */
-/* added a new mode to manage */
-/* endpoint buffer in classes, */
-/* resulting in version 6.3.0 */
+/* USBX device dpump class. */
/* */
/**************************************************************************/
#ifndef UX_DEVICE_CLASS_DPUMP_H
#define UX_DEVICE_CLASS_DPUMP_H
-/* Determine if a C++ compiler is being used. If so, ensure that standard
- C is used to process the API information. */
+/* Determine if a C++ compiler is being used. If so, ensure that standard
+ C is used to process the API information. */
-#ifdef __cplusplus
+#ifdef __cplusplus
-/* Yes, C++ compiler is present. Use standard C. */
-extern "C" {
+/* Yes, C++ compiler is present. Use standard C. */
+extern "C" {
-#endif
+#endif
/* Bulk out endpoint / read buffer size, must be larger than max packet size in framework, and aligned in 4-bytes. */
@@ -139,16 +121,16 @@ UINT _ux_device_class_dpump_initialize(UX_SLAVE_CLASS_COMMAND *command);
UINT _ux_device_class_dpump_activate(UX_SLAVE_CLASS_COMMAND *command);
UINT _ux_device_class_dpump_deactivate(UX_SLAVE_CLASS_COMMAND *command);
UINT _ux_device_class_dpump_entry(UX_SLAVE_CLASS_COMMAND *command);
-UINT _ux_device_class_dpump_read(UX_SLAVE_CLASS_DPUMP *dpump, UCHAR *buffer,
+UINT _ux_device_class_dpump_read(UX_SLAVE_CLASS_DPUMP *dpump, UCHAR *buffer,
ULONG requested_length, ULONG *actual_length);
-UINT _ux_device_class_dpump_read_run(UX_SLAVE_CLASS_DPUMP *dpump, UCHAR *buffer,
+UINT _ux_device_class_dpump_read_run(UX_SLAVE_CLASS_DPUMP *dpump, UCHAR *buffer,
ULONG requested_length, ULONG *actual_length);
-UINT _ux_device_class_dpump_write(UX_SLAVE_CLASS_DPUMP *dpump, UCHAR *buffer,
+UINT _ux_device_class_dpump_write(UX_SLAVE_CLASS_DPUMP *dpump, UCHAR *buffer,
ULONG requested_length, ULONG *actual_length);
-UINT _ux_device_class_dpump_write_run(UX_SLAVE_CLASS_DPUMP *dpump, UCHAR *buffer,
+UINT _ux_device_class_dpump_write_run(UX_SLAVE_CLASS_DPUMP *dpump, UCHAR *buffer,
ULONG requested_length, ULONG *actual_length);
UINT _ux_device_class_dpump_change(UX_SLAVE_CLASS_COMMAND *command);
-
+
/* Define Device DPUMP Class API prototypes. */
#define ux_device_class_dpump_entry _ux_device_class_dpump_entry
@@ -157,10 +139,10 @@ UINT _ux_device_class_dpump_change(UX_SLAVE_CLASS_COMMAND *command);
#define ux_device_class_dpump_write _ux_device_class_dpump_write
#define ux_device_class_dpump_write_run _ux_device_class_dpump_write_run
-/* Determine if a C++ compiler is being used. If so, complete the standard
- C conditional started above. */
+/* Determine if a C++ compiler is being used. If so, complete the standard
+ C conditional started above. */
#ifdef __cplusplus
-}
+}
#endif
#endif
diff --git a/common/core/inc/ux_device_stack.h b/common/core/inc/ux_device_stack.h
index 65eb30a2..2c431b2d 100644
--- a/common/core/inc/ux_device_stack.h
+++ b/common/core/inc/ux_device_stack.h
@@ -1,75 +1,54 @@
/***************************************************************************
- * Copyright (c) 2024 Microsoft Corporation
- *
+ * Copyright (c) 2024 Microsoft Corporation
+ * Copyright (c) 2026-present Eclipse ThreadX contributors
+ *
* This program and the accompanying materials are made available under the
* terms of the MIT License which is available at
* https://opensource.org/licenses/MIT.
- *
+ *
* SPDX-License-Identifier: MIT
**************************************************************************/
/**************************************************************************/
/**************************************************************************/
-/** */
-/** USBX Component */
+/** */
+/** USBX Component */
/** */
/** Device Stack */
/** */
/**************************************************************************/
/**************************************************************************/
-/**************************************************************************/
-/* */
-/* COMPONENT DEFINITION RELEASE */
-/* */
-/* ux_device_stack.h PORTABLE C */
+/**************************************************************************/
+/* */
+/* COMPONENT DEFINITION RELEASE */
+/* */
+/* ux_device_stack.h PORTABLE C */
/* 6.3.0 */
/* AUTHOR */
/* */
/* Chaoqiong Xiao, Microsoft Corporation */
/* */
/* DESCRIPTION */
-/* */
-/* This file defines the equivalences for the USBX Device Stack */
-/* component. */
-/* */
-/* RELEASE HISTORY */
-/* */
-/* DATE NAME DESCRIPTION */
-/* */
-/* 05-19-2020 Chaoqiong Xiao Initial Version 6.0 */
-/* 09-30-2020 Chaoqiong Xiao Modified comment(s), */
-/* resulting in version 6.1 */
-/* 08-02-2021 Wen Wang Modified comment(s), */
-/* added extern "C" keyword */
-/* for compatibility with C++, */
-/* resulting in version 6.1.8 */
-/* 01-31-2022 Chaoqiong Xiao Modified comment(s), */
-/* added standalone support, */
-/* resulting in version 6.1.10 */
-/* 07-29-2022 Chaoqiong Xiao Modified comment(s), */
-/* fixed parameter/variable */
-/* names conflict C++ keyword, */
-/* resulting in version 6.1.12 */
-/* 10-31-2023 Chaoqiong Xiao Modified comment(s), */
-/* added error checks support, */
-/* resulting in version 6.3.0 */
+/* */
+/* This file defines the equivalences for the USBX Device Stack */
+/* component. */
/* */
/**************************************************************************/
#ifndef UX_DEVICE_STACK_H
#define UX_DEVICE_STACK_H
-/* Determine if a C++ compiler is being used. If so, ensure that standard
- C is used to process the API information. */
+/* Determine if a C++ compiler is being used. If so, ensure that standard
+ C is used to process the API information. */
-#ifdef __cplusplus
+#ifdef __cplusplus
-/* Yes, C++ compiler is present. Use standard C. */
-extern "C" {
+/* Yes, C++ compiler is present. Use standard C. */
+extern "C" {
-#endif
+#endif
/* Define USB Device Stack prototypes. */
@@ -126,10 +105,10 @@ UINT _uxe_device_stack_initialize(UCHAR * device_framework_high_speed, ULONG
UINT (*ux_system_slave_change_function)(ULONG));
-/* Determine if a C++ compiler is being used. If so, complete the standard
- C conditional started above. */
+/* Determine if a C++ compiler is being used. If so, complete the standard
+ C conditional started above. */
#ifdef __cplusplus
-}
+}
#endif
#endif
diff --git a/common/core/inc/ux_hcd_sim_host.h b/common/core/inc/ux_hcd_sim_host.h
index f61dbff2..d43cfedf 100644
--- a/common/core/inc/ux_hcd_sim_host.h
+++ b/common/core/inc/ux_hcd_sim_host.h
@@ -1,18 +1,19 @@
/***************************************************************************
- * Copyright (c) 2024 Microsoft Corporation
- *
+ * Copyright (c) 2024 Microsoft Corporation
+ * Copyright (c) 2026-present Eclipse ThreadX contributors
+ *
* This program and the accompanying materials are made available under the
* terms of the MIT License which is available at
* https://opensource.org/licenses/MIT.
- *
+ *
* SPDX-License-Identifier: MIT
**************************************************************************/
/**************************************************************************/
/**************************************************************************/
-/** */
-/** USBX Component */
+/** */
+/** USBX Component */
/** */
/** Host Simulator Controller Driver */
/** */
@@ -20,69 +21,44 @@
/**************************************************************************/
-/**************************************************************************/
-/* */
-/* COMPONENT DEFINITION RELEASE */
-/* */
-/* ux_hcd_sim_host.h PORTABLE C */
+/**************************************************************************/
+/* */
+/* COMPONENT DEFINITION RELEASE */
+/* */
+/* ux_hcd_sim_host.h PORTABLE C */
/* 6.1.10 */
/* AUTHOR */
/* */
/* Chaoqiong Xiao, Microsoft Corporation */
/* */
/* DESCRIPTION */
-/* */
+/* */
/* This file contains all the header and extern functions used by the */
-/* USBX host simulator. It is designed to work ONLY with the USBX */
-/* device (slave) simulator. */
-/* */
-/* RELEASE HISTORY */
-/* */
-/* 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 */
-/* 11-09-2020 Chaoqiong Xiao Modified comment(s), */
-/* added HCD uninitialize, */
-/* resulting in version 6.1.2 */
-/* 04-02-2021 Chaoqiong Xiao Modified comment(s), */
-/* added port status variable, */
-/* resulting in version 6.1.6 */
-/* 08-02-2021 Chaoqiong Xiao Modified comment(s), */
-/* added extern "C" keyword */
-/* for compatibility with C++, */
-/* resulting in version 6.1.8 */
-/* 01-31-2022 Chaoqiong Xiao Modified comment(s), */
-/* added standalone support, */
-/* resulting in version 6.1.10 */
+/* USBX host simulator. It is designed to work ONLY with the USBX */
+/* device (slave) simulator. */
/* */
/**************************************************************************/
#ifndef UX_HCD_SIM_HOST_H
#define UX_HCD_SIM_HOST_H
-/* Determine if a C++ compiler is being used. If so, ensure that standard
- C is used to process the API information. */
+/* Determine if a C++ compiler is being used. If so, ensure that standard
+ C is used to process the API information. */
-#ifdef __cplusplus
+#ifdef __cplusplus
-/* Yes, C++ compiler is present. Use standard C. */
-extern "C" {
+/* Yes, C++ compiler is present. Use standard C. */
+extern "C" {
-#endif
+#endif
/* Define simulator host generic definitions. */
#define UX_HCD_SIM_HOST_CONTROLLER 99
#define UX_HCD_SIM_HOST_MAX_PAYLOAD 4096
-#define UX_HCD_SIM_HOST_FRAME_DELAY 4
-#define UX_HCD_SIM_HOST_PERIODIC_ENTRY_NB 32
+#define UX_HCD_SIM_HOST_FRAME_DELAY 4
+#define UX_HCD_SIM_HOST_PERIODIC_ENTRY_NB 32
#define UX_HCD_SIM_HOST_PERIODIC_ENTRY_MASK 0x1f
#define UX_HCD_SIM_HOST_AVAILABLE_BANDWIDTH 6000
@@ -116,19 +92,19 @@ typedef struct UX_HCD_SIM_HOST_STRUCT
ULONG ux_hcd_sim_host_hcor;
UINT ux_hcd_sim_host_nb_root_hubs;
ULONG ux_hcd_sim_host_port_status[1];
- struct UX_HCD_SIM_HOST_ED_STRUCT
+ struct UX_HCD_SIM_HOST_ED_STRUCT
*ux_hcd_sim_host_ed_list;
- struct UX_HCD_SIM_HOST_TD_STRUCT
+ struct UX_HCD_SIM_HOST_TD_STRUCT
*ux_hcd_sim_host_td_list;
- struct UX_HCD_SIM_HOST_ISO_TD_STRUCT
+ struct UX_HCD_SIM_HOST_ISO_TD_STRUCT
*ux_hcd_sim_host_iso_td_list;
- struct UX_HCD_SIM_HOST_ED_STRUCT
+ struct UX_HCD_SIM_HOST_ED_STRUCT
*ux_hcd_sim_host_asynch_head_ed;
- struct UX_HCD_SIM_HOST_ED_STRUCT
+ struct UX_HCD_SIM_HOST_ED_STRUCT
*ux_hcd_sim_host_asynch_current_ed;
- struct UX_HCD_SIM_HOST_ED_STRUCT
+ struct UX_HCD_SIM_HOST_ED_STRUCT
*ux_hcd_sim_host_iso_head_ed;
- struct UX_HCD_SIM_HOST_ED_STRUCT
+ struct UX_HCD_SIM_HOST_ED_STRUCT
*ux_hcd_sim_host_interrupt_ed_list[32];
UINT ux_hcd_sim_host_queue_empty;
UINT ux_hcd_sim_host_periodic_scheduler_active;
@@ -145,19 +121,19 @@ typedef struct UX_HCD_SIM_HOST_STRUCT
typedef struct UX_HCD_SIM_HOST_ED_STRUCT
{
- struct UX_HCD_SIM_HOST_TD_STRUCT
+ struct UX_HCD_SIM_HOST_TD_STRUCT
*ux_sim_host_ed_tail_td;
- struct UX_HCD_SIM_HOST_TD_STRUCT
+ struct UX_HCD_SIM_HOST_TD_STRUCT
*ux_sim_host_ed_head_td;
- struct UX_HCD_SIM_HOST_ED_STRUCT
+ struct UX_HCD_SIM_HOST_ED_STRUCT
*ux_sim_host_ed_next_ed;
- struct UX_HCD_SIM_HOST_ED_STRUCT
+ struct UX_HCD_SIM_HOST_ED_STRUCT
*ux_sim_host_ed_previous_ed;
ULONG ux_sim_host_ed_status;
- struct UX_ENDPOINT_STRUCT
+ struct UX_ENDPOINT_STRUCT
*ux_sim_host_ed_endpoint;
- ULONG ux_sim_host_ed_toggle;
- ULONG ux_sim_host_ed_frame;
+ ULONG ux_sim_host_ed_toggle;
+ ULONG ux_sim_host_ed_frame;
} UX_HCD_SIM_HOST_ED;
@@ -171,17 +147,17 @@ typedef struct UX_HCD_SIM_HOST_ED_STRUCT
/* Define simulator host TD structure. */
typedef struct UX_HCD_SIM_HOST_TD_STRUCT
-{
+{
UCHAR * ux_sim_host_td_buffer;
ULONG ux_sim_host_td_length;
- struct UX_HCD_SIM_HOST_TD_STRUCT
+ struct UX_HCD_SIM_HOST_TD_STRUCT
*ux_sim_host_td_next_td;
- struct UX_TRANSFER_STRUCT
+ struct UX_TRANSFER_STRUCT
*ux_sim_host_td_transfer_request;
- struct UX_HCD_SIM_HOST_TD_STRUCT
+ struct UX_HCD_SIM_HOST_TD_STRUCT
*ux_sim_host_td_next_td_transfer_request;
- struct UX_HCD_SIM_HOST_ED_STRUCT
+ struct UX_HCD_SIM_HOST_ED_STRUCT
*ux_sim_host_td_ed;
ULONG ux_sim_host_td_actual_length;
ULONG ux_sim_host_td_status;
@@ -192,12 +168,12 @@ typedef struct UX_HCD_SIM_HOST_TD_STRUCT
/* Define simulator host TD bitmap. */
-#define UX_HCD_SIM_HOST_TD_SETUP_PHASE 0x00010000
-#define UX_HCD_SIM_HOST_TD_DATA_PHASE 0x00020000
-#define UX_HCD_SIM_HOST_TD_STATUS_PHASE 0x00040000
+#define UX_HCD_SIM_HOST_TD_SETUP_PHASE 0x00010000
+#define UX_HCD_SIM_HOST_TD_DATA_PHASE 0x00020000
+#define UX_HCD_SIM_HOST_TD_STATUS_PHASE 0x00040000
#define UX_HCD_SIM_HOST_TD_OUT 0x00000800
#define UX_HCD_SIM_HOST_TD_IN 0x00001000
-#define UX_HCD_SIM_HOST_TD_ACK_PENDING 0x00002000
+#define UX_HCD_SIM_HOST_TD_ACK_PENDING 0x00002000
#define UX_HCD_SIM_HOST_TD_TOGGLE_FROM_ED 0x80000000
@@ -208,13 +184,13 @@ typedef struct UX_HCD_SIM_HOST_ISO_TD_STRUCT
UCHAR * ux_sim_host_iso_td_buffer;
ULONG ux_sim_host_iso_td_length;
- struct UX_HCD_SIM_HOST_ISO_TD_STRUCT
+ struct UX_HCD_SIM_HOST_ISO_TD_STRUCT
*ux_sim_host_iso_td_next_td;
- struct UX_TRANSFER_STRUCT
+ struct UX_TRANSFER_STRUCT
*ux_sim_host_iso_td_transfer_request;
- struct UX_HCD_SIM_HOST_ISO_TD_STRUCT
+ struct UX_HCD_SIM_HOST_ISO_TD_STRUCT
*ux_sim_host_iso_td_next_td_transfer_request;
- struct UX_HCD_SIM_HOST_ED_STRUCT
+ struct UX_HCD_SIM_HOST_ED_STRUCT
*ux_sim_host_iso_td_ed;
ULONG ux_sim_host_iso_td_actual_length;
ULONG ux_sim_host_iso_td_status;
@@ -228,7 +204,7 @@ VOID _ux_hcd_sim_host_asynch_queue_process(UX_HCD_SIM_HOST *hcd_sim_host);
VOID _ux_hcd_sim_host_asynch_schedule(UX_HCD_SIM_HOST *hcd_sim_host);
UINT _ux_hcd_sim_host_asynchronous_endpoint_create(UX_HCD_SIM_HOST *hcd_sim_host, UX_ENDPOINT *endpoint);
UINT _ux_hcd_sim_host_asynchronous_endpoint_destroy(UX_HCD_SIM_HOST *hcd_sim_host, UX_ENDPOINT *endpoint);
-UX_HCD_SIM_HOST_ED
+UX_HCD_SIM_HOST_ED
*_ux_hcd_sim_host_ed_obtain(UX_HCD_SIM_HOST *hcd_sim_host);
VOID _ux_hcd_sim_host_ed_td_clean(UX_HCD_SIM_HOST_ED *ed);
UINT _ux_hcd_sim_host_endpoint_reset(UX_HCD_SIM_HOST *hcd_sim_host, UX_ENDPOINT *endpoint);
@@ -242,15 +218,15 @@ UINT _ux_hcd_sim_host_interrupt_endpoint_create(UX_HCD_SIM_HOST *hcd_sim_host
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);
UINT _ux_hcd_sim_host_isochronous_endpoint_create(UX_HCD_SIM_HOST *hcd_sim_host, UX_ENDPOINT *endpoint);
-UX_HCD_SIM_HOST_ISO_TD
+UX_HCD_SIM_HOST_ISO_TD
*_ux_hcd_sim_host_isochronous_td_obtain(UX_HCD_SIM_HOST *hcd_sim_host);
-UX_HCD_SIM_HOST_ED
+UX_HCD_SIM_HOST_ED
*_ux_hcd_sim_host_least_traffic_list_get(UX_HCD_SIM_HOST *hcd_sim_host);
UINT _ux_hcd_sim_host_periodic_endpoint_destroy(UX_HCD_SIM_HOST *hcd_sim_host, UX_ENDPOINT *endpoint);
VOID _ux_hcd_sim_host_periodic_schedule(UX_HCD_SIM_HOST *hcd_sim_host);
UINT _ux_hcd_sim_host_periodic_tree_create(UX_HCD_SIM_HOST *hcd_sim_host);
ULONG _ux_hcd_sim_host_port_status_get(UX_HCD_SIM_HOST *hcd_sim_host, ULONG port_index);
-UX_HCD_SIM_HOST_TD
+UX_HCD_SIM_HOST_TD
*_ux_hcd_sim_host_regular_td_obtain(UX_HCD_SIM_HOST *hcd_sim_host);
UINT _ux_hcd_sim_host_request_bulk_transfer(UX_HCD_SIM_HOST *hcd_sim_host, UX_TRANSFER *transfer_request);
UINT _ux_hcd_sim_host_request_control_transfer(UX_HCD_SIM_HOST *hcd_sim_host, UX_TRANSFER *transfer_request);
@@ -267,10 +243,10 @@ UINT _ux_hcd_sim_host_transfer_run(UX_HCD_SIM_HOST *hcd_sim_host, UX_TRANSFER
/* Define Device Simulator Class API prototypes. */
#define ux_hcd_sim_host_initialize _ux_hcd_sim_host_initialize
-/* Determine if a C++ compiler is being used. If so, complete the standard
- C conditional started above. */
+/* Determine if a C++ compiler is being used. If so, complete the standard
+ C conditional started above. */
#ifdef __cplusplus
-}
+}
#endif
#endif
diff --git a/common/core/inc/ux_host_class_dpump.h b/common/core/inc/ux_host_class_dpump.h
index 3cc24ba5..968f78a6 100644
--- a/common/core/inc/ux_host_class_dpump.h
+++ b/common/core/inc/ux_host_class_dpump.h
@@ -1,18 +1,19 @@
/***************************************************************************
- * Copyright (c) 2024 Microsoft Corporation
- *
+ * Copyright (c) 2024 Microsoft Corporation
+ * Copyright (c) 2026-present Eclipse ThreadX contributors
+ *
* This program and the accompanying materials are made available under the
* terms of the MIT License which is available at
* https://opensource.org/licenses/MIT.
- *
+ *
* SPDX-License-Identifier: MIT
**************************************************************************/
/**************************************************************************/
/**************************************************************************/
-/** */
-/** USBX Component */
+/** */
+/** USBX Component */
/** */
/** Host Data Pump Class */
/** */
@@ -20,50 +21,35 @@
/**************************************************************************/
-/**************************************************************************/
-/* */
-/* COMPONENT DEFINITION RELEASE */
-/* */
-/* ux_host_class_dpump.h PORTABLE C */
+/**************************************************************************/
+/* */
+/* COMPONENT DEFINITION RELEASE */
+/* */
+/* ux_host_class_dpump.h PORTABLE C */
/* 6.1.10 */
/* AUTHOR */
/* */
/* Chaoqiong Xiao, Microsoft Corporation */
/* */
/* DESCRIPTION */
-/* */
+/* */
/* This file contains all the header and extern functions used by the */
-/* USBX demo data pump class. */
-/* */
-/* RELEASE HISTORY */
-/* */
-/* DATE NAME DESCRIPTION */
-/* */
-/* 05-19-2020 Chaoqiong Xiao Initial Version 6.0 */
-/* 09-30-2020 Chaoqiong Xiao Modified comment(s), */
-/* resulting in version 6.1 */
-/* 08-02-2021 Wen Wang Modified comment(s), */
-/* added extern "C" keyword */
-/* for compatibility with C++, */
-/* resulting in version 6.1.8 */
-/* 01-31-2022 Chaoqiong Xiao Modified comment(s), */
-/* added standalone support, */
-/* resulting in version 6.1.10 */
+/* USBX demo data pump class. */
/* */
/**************************************************************************/
#ifndef UX_HOST_CLASS_DPUMP_H
#define UX_HOST_CLASS_DPUMP_H
-/* Determine if a C++ compiler is being used. If so, ensure that standard
- C is used to process the API information. */
+/* Determine if a C++ compiler is being used. If so, ensure that standard
+ C is used to process the API information. */
-#ifdef __cplusplus
+#ifdef __cplusplus
-/* Yes, C++ compiler is present. Use standard C. */
-extern "C" {
+/* Yes, C++ compiler is present. Use standard C. */
+extern "C" {
-#endif
+#endif
/* Define Data Pump Class constants. */
@@ -77,7 +63,7 @@ extern "C" {
#define UX_HOST_CLASS_DPUMP_PACKET_SIZE 128
/* Define Data Pump Class Ioctl functions. */
-#define UX_HOST_CLASS_DPUMP_SELECT_ALTERNATE_SETTING 1
+#define UX_HOST_CLASS_DPUMP_SELECT_ALTERNATE_SETTING 1
/* Define Data Pump Class string constants. */
@@ -95,9 +81,9 @@ UINT _ux_host_class_dpump_configure(UX_HOST_CLASS_DPUMP *dpump);
UINT _ux_host_class_dpump_deactivate(UX_HOST_CLASS_COMMAND *command);
UINT _ux_host_class_dpump_endpoints_get(UX_HOST_CLASS_DPUMP *dpump);
UINT _ux_host_class_dpump_entry(UX_HOST_CLASS_COMMAND *command);
-UINT _ux_host_class_dpump_read (UX_HOST_CLASS_DPUMP *dpump, UCHAR *data_pointer,
+UINT _ux_host_class_dpump_read (UX_HOST_CLASS_DPUMP *dpump, UCHAR *data_pointer,
ULONG requested_length, ULONG *actual_length);
-UINT _ux_host_class_dpump_write(UX_HOST_CLASS_DPUMP *dpump, UCHAR * data_pointer,
+UINT _ux_host_class_dpump_write(UX_HOST_CLASS_DPUMP *dpump, UCHAR * data_pointer,
ULONG requested_length, ULONG *actual_length);
UINT _ux_host_class_dpump_ioctl(UX_HOST_CLASS_DPUMP *dpump, ULONG ioctl_function,
VOID *parameter);
@@ -108,10 +94,10 @@ UINT _ux_host_class_dpump_ioctl(UX_HOST_CLASS_DPUMP *dpump, ULONG ioctl_funct
#define ux_host_class_dpump_write _ux_host_class_dpump_write
#define ux_host_class_dpump_ioctl _ux_host_class_dpump_ioctl
-/* Determine if a C++ compiler is being used. If so, complete the standard
- C conditional started above. */
+/* Determine if a C++ compiler is being used. If so, complete the standard
+ C conditional started above. */
#ifdef __cplusplus
-}
+}
#endif
#endif
diff --git a/common/core/inc/ux_host_stack.h b/common/core/inc/ux_host_stack.h
index 58162e96..60da8880 100644
--- a/common/core/inc/ux_host_stack.h
+++ b/common/core/inc/ux_host_stack.h
@@ -1,18 +1,19 @@
/***************************************************************************
- * Copyright (c) 2024 Microsoft Corporation
- *
+ * Copyright (c) 2024 Microsoft Corporation
+ * Copyright (c) 2026-present Eclipse ThreadX contributors
+ *
* This program and the accompanying materials are made available under the
* terms of the MIT License which is available at
* https://opensource.org/licenses/MIT.
- *
+ *
* SPDX-License-Identifier: MIT
**************************************************************************/
/**************************************************************************/
/**************************************************************************/
-/** */
-/** USBX Component */
+/** */
+/** USBX Component */
/** */
/** Host Stack */
/** */
@@ -20,68 +21,35 @@
/**************************************************************************/
-/**************************************************************************/
-/* */
-/* COMPONENT DEFINITION RELEASE */
-/* */
-/* ux_host_stack.h PORTABLE C */
+/**************************************************************************/
+/* */
+/* COMPONENT DEFINITION RELEASE */
+/* */
+/* ux_host_stack.h PORTABLE C */
/* 6.3.0 */
/* AUTHOR */
/* */
/* Chaoqiong Xiao, Microsoft Corporation */
/* */
/* DESCRIPTION */
-/* */
+/* */
/* This file contains all the header and extern functions used by the */
-/* USBX Host Stack component. */
-/* */
-/* RELEASE HISTORY */
-/* */
-/* 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 */
-/* 02-02-2021 Chaoqiong Xiao Modified comment(s), */
-/* added configuration activate*/
-/* and deactivate support, */
-/* added host device string */
-/* descriptor get support, */
-/* updated internal function, */
-/* resulting in version 6.1.4 */
-/* 08-02-2021 Chaoqiong Xiao Modified comment(s), */
-/* added extern "C" keyword */
-/* for compatibility with C++, */
-/* resulting in version 6.1.8 */
-/* 01-31-2022 Chaoqiong Xiao Modified comment(s), */
-/* added standalone support, */
-/* resulting in version 6.1.10 */
-/* 07-29-2022 Chaoqiong Xiao Modified comment(s), */
-/* fixed parameter/variable */
-/* names conflict C++ keyword, */
-/* added standalone HUB, */
-/* resulting in version 6.1.12 */
-/* 10-31-2023 Chaoqiong Xiao Modified comment(s), */
-/* added error checks support, */
-/* resulting in version 6.3.0 */
+/* USBX Host Stack component. */
/* */
/**************************************************************************/
#ifndef UX_HOST_STACK_H
#define UX_HOST_STACK_H
-/* Determine if a C++ compiler is being used. If so, ensure that standard
- C is used to process the API information. */
+/* Determine if a C++ compiler is being used. If so, ensure that standard
+ C is used to process the API information. */
-#ifdef __cplusplus
+#ifdef __cplusplus
-/* Yes, C++ compiler is present. Use standard C. */
-extern "C" {
+/* Yes, C++ compiler is present. Use standard C. */
+extern "C" {
-#endif
+#endif
/* Internal option: enable the basic USBX error checking. This define is typically used
@@ -145,7 +113,7 @@ UINT _ux_host_stack_configuration_descriptor_parse(UX_DEVICE *device, UX_CONF
UINT _ux_host_stack_configuration_enumerate(UX_DEVICE *device);
UINT _ux_host_stack_configuration_instance_create(UX_CONFIGURATION *configuration);
VOID _ux_host_stack_configuration_instance_delete(UX_CONFIGURATION *configuration);
-UINT _ux_host_stack_configuration_interface_get(UX_CONFIGURATION *configuration,
+UINT _ux_host_stack_configuration_interface_get(UX_CONFIGURATION *configuration,
UINT interface_index, UINT alternate_setting_index,
UX_INTERFACE **ux_interface);
UINT _ux_host_stack_configuration_interface_scan(UX_CONFIGURATION *configuration);
@@ -183,7 +151,7 @@ UINT _ux_host_stack_interface_setting_select(UX_INTERFACE *ux_interface);
UINT _ux_host_stack_interfaces_scan(UX_CONFIGURATION *configuration, UCHAR * descriptor);
VOID _ux_host_stack_new_configuration_create(UX_DEVICE *device, UX_CONFIGURATION *configuration);
UX_DEVICE *_ux_host_stack_new_device_get(VOID);
-UINT _ux_host_stack_new_device_create(UX_HCD *hcd, UX_DEVICE *device_owner,
+UINT _ux_host_stack_new_device_create(UX_HCD *hcd, UX_DEVICE *device_owner,
UINT port_index, UINT device_speed,
UINT port_max_power,
UX_DEVICE **created_device);
@@ -208,7 +176,7 @@ UINT _uxe_host_stack_class_get(UCHAR *class_name, UX_HOST_CLASS **ux_class);
UINT _uxe_host_stack_class_instance_get(UX_HOST_CLASS *class, UINT class_index, VOID **class_instance);
UINT _uxe_host_stack_class_register(UCHAR *class_name,
UINT (*class_entry_function)(struct UX_HOST_CLASS_COMMAND_STRUCT *));
-UINT _uxe_host_stack_configuration_interface_get(UX_CONFIGURATION *configuration,
+UINT _uxe_host_stack_configuration_interface_get(UX_CONFIGURATION *configuration,
UINT interface_index, UINT alternate_setting_index,
UX_INTERFACE **ux_interface);
UINT _uxe_host_stack_device_configuration_activate(UX_CONFIGURATION *configuration);
@@ -228,10 +196,10 @@ UINT _uxe_host_stack_transfer_request_abort(UX_TRANSFER *transfer_request);
UINT _uxe_host_stack_transfer_run(UX_TRANSFER *transfer_request);
-/* Determine if a C++ compiler is being used. If so, complete the standard
- C conditional started above. */
+/* Determine if a C++ compiler is being used. If so, complete the standard
+ C conditional started above. */
#ifdef __cplusplus
-}
+}
#endif
#endif
diff --git a/common/core/inc/ux_system.h b/common/core/inc/ux_system.h
index f9341ec6..a84bb292 100644
--- a/common/core/inc/ux_system.h
+++ b/common/core/inc/ux_system.h
@@ -1,18 +1,19 @@
/***************************************************************************
- * Copyright (c) 2024 Microsoft Corporation
- *
+ * Copyright (c) 2024 Microsoft Corporation
+ * Copyright (c) 2026-present Eclipse ThreadX contributors
+ *
* This program and the accompanying materials are made available under the
* terms of the MIT License which is available at
* https://opensource.org/licenses/MIT.
- *
+ *
* SPDX-License-Identifier: MIT
**************************************************************************/
/**************************************************************************/
/**************************************************************************/
-/** */
-/** USBX Component */
+/** */
+/** USBX Component */
/** */
/** System */
/** */
@@ -20,60 +21,39 @@
/**************************************************************************/
-/**************************************************************************/
-/* */
-/* COMPONENT DEFINITION RELEASE */
-/* */
-/* ux_system.h PORTABLE C */
+/**************************************************************************/
+/* */
+/* COMPONENT DEFINITION RELEASE */
+/* */
+/* ux_system.h PORTABLE C */
/* 6.3.0 */
/* AUTHOR */
/* */
/* Chaoqiong Xiao, Microsoft Corporation */
/* */
/* DESCRIPTION */
-/* */
+/* */
/* This file contains all the header and extern functions used by the */
-/* USBX main system component. */
-/* */
-/* RELEASE HISTORY */
-/* */
-/* DATE NAME DESCRIPTION */
-/* */
-/* 05-19-2020 Chaoqiong Xiao Initial Version 6.0 */
-/* 09-30-2020 Chaoqiong Xiao Modified comment(s), */
-/* resulting in version 6.1 */
-/* 12-31-2020 Chaoqiong Xiao Modified comment(s), */
-/* added BOS support, */
-/* resulting in version 6.1.3 */
-/* 01-31-2022 Chaoqiong Xiao Modified comment(s), */
-/* added standalone support, */
-/* added device printer name, */
-/* resulting in version 6.1.10 */
-/* 04-25-2022 Chaoqiong Xiao Modified comment(s), */
-/* added device CCID name, */
-/* resulting in version 6.1.11 */
-/* 10-31-2023 Chaoqiong Xiao Modified comment(s), */
-/* added error checks support, */
-/* resulting in version 6.3.0 */
+/* USBX main system component. */
/* */
/**************************************************************************/
#ifndef UX_SYSTEM_HOST_H
#define UX_SYSTEM_HOST_H
-/* Define System component function prototypes. Note that since ux_api.h
- includes this file, the APIs are only declared if this file is included
- by internal code in order to prevent duplicate declarations for
+/* Define System component function prototypes. Note that since ux_api.h
+ includes this file, the APIs are only declared if this file is included
+ by internal code in order to prevent duplicate declarations for
applications. */
#ifdef UX_SOURCE_CODE
-UINT _ux_system_initialize(VOID *regular_memory_pool_start, ULONG regular_memory_size,
+UINT _ux_system_initialize(VOID *regular_memory_pool_start, ULONG regular_memory_size,
VOID *cache_safe_memory_pool_start, ULONG cache_safe_memory_size);
UINT _ux_system_uninitialize(VOID);
UINT _ux_system_tasks_run(VOID);
-UINT _uxe_system_initialize(VOID *regular_memory_pool_start, ULONG regular_memory_size,
+UINT _uxe_system_initialize(VOID *regular_memory_pool_start, ULONG regular_memory_size,
VOID *cache_safe_memory_pool_start, ULONG cache_safe_memory_size);
#endif
@@ -106,50 +86,50 @@ extern UCHAR _ux_system_bos_descriptor_structure[];
extern UCHAR _ux_system_usb_2_0_extension_descriptor_structure[];
extern UCHAR _ux_system_container_id_descriptor_structure[];
-extern UINT _ux_system_host_hcd_periodic_tree_entries[32];
-
-extern UCHAR _ux_system_host_class_hub_name[];
-extern UCHAR _ux_system_host_class_printer_name[];
-extern UCHAR _ux_system_host_class_storage_name[];
-extern UCHAR _ux_system_host_class_hid_name[];
-extern UCHAR _ux_system_host_class_audio_name[];
-extern UCHAR _ux_system_host_class_cdc_acm_name[];
-extern UCHAR _ux_system_host_class_cdc_dlc_name[];
-extern UCHAR _ux_system_host_class_cdc_ecm_name[];
-extern UCHAR _ux_system_host_class_prolific_name[];
-extern UCHAR _ux_system_host_class_dpump_name[];
-extern UCHAR _ux_system_host_class_pima_name[];
-extern UCHAR _ux_system_host_class_asix_name[];
-extern UCHAR _ux_system_host_class_swar_name[];
-extern UCHAR _ux_system_host_class_gser_name[];
+extern UINT _ux_system_host_hcd_periodic_tree_entries[32];
+
+extern UCHAR _ux_system_host_class_hub_name[];
+extern UCHAR _ux_system_host_class_printer_name[];
+extern UCHAR _ux_system_host_class_storage_name[];
+extern UCHAR _ux_system_host_class_hid_name[];
+extern UCHAR _ux_system_host_class_audio_name[];
+extern UCHAR _ux_system_host_class_cdc_acm_name[];
+extern UCHAR _ux_system_host_class_cdc_dlc_name[];
+extern UCHAR _ux_system_host_class_cdc_ecm_name[];
+extern UCHAR _ux_system_host_class_prolific_name[];
+extern UCHAR _ux_system_host_class_dpump_name[];
+extern UCHAR _ux_system_host_class_pima_name[];
+extern UCHAR _ux_system_host_class_asix_name[];
+extern UCHAR _ux_system_host_class_swar_name[];
+extern UCHAR _ux_system_host_class_gser_name[];
extern UCHAR _ux_system_host_class_hid_client_remote_control_name[];
-extern UCHAR _ux_system_host_class_hid_client_mouse_name[];
-extern UCHAR _ux_system_host_class_hid_client_keyboard_name[];
-
-extern UCHAR _ux_system_host_hcd_ohci_name[];
-extern UCHAR _ux_system_host_hcd_ehci_name[];
-extern UCHAR _ux_system_host_hcd_isp1161_name[];
-extern UCHAR _ux_system_host_hcd_isp1362_name[];
-extern UCHAR _ux_system_host_hcd_sh2_name[];
-extern UCHAR _ux_system_host_hcd_rx_name[];
-extern UCHAR _ux_system_host_hcd_pic32_name[];
-extern UCHAR _ux_system_host_hcd_stm32_name[];
+extern UCHAR _ux_system_host_class_hid_client_mouse_name[];
+extern UCHAR _ux_system_host_class_hid_client_keyboard_name[];
+
+extern UCHAR _ux_system_host_hcd_ohci_name[];
+extern UCHAR _ux_system_host_hcd_ehci_name[];
+extern UCHAR _ux_system_host_hcd_isp1161_name[];
+extern UCHAR _ux_system_host_hcd_isp1362_name[];
+extern UCHAR _ux_system_host_hcd_sh2_name[];
+extern UCHAR _ux_system_host_hcd_rx_name[];
+extern UCHAR _ux_system_host_hcd_pic32_name[];
+extern UCHAR _ux_system_host_hcd_stm32_name[];
extern UCHAR _ux_system_host_hcd_musb_name[];
extern UCHAR _ux_system_host_hcd_atm7_name[];
-extern UCHAR _ux_system_host_hcd_simulator_name[];
-
-extern UCHAR _ux_system_slave_class_storage_name[];
-extern UCHAR _ux_system_slave_class_storage_vendor_id[];
-extern UCHAR _ux_system_slave_class_storage_product_id[];
-extern UCHAR _ux_system_slave_class_storage_product_rev[];
-extern UCHAR _ux_system_slave_class_storage_product_serial[];
-extern UCHAR _ux_system_slave_class_audio_name[];
-extern UCHAR _ux_system_slave_class_cdc_acm_name[];
-extern UCHAR _ux_system_slave_class_dpump_name[];
-extern UCHAR _ux_system_slave_class_pima_name[];
-extern UCHAR _ux_system_slave_class_hid_name[];
-extern UCHAR _ux_system_slave_class_rndis_name[];
-extern UCHAR _ux_system_slave_class_cdc_ecm_name[];
+extern UCHAR _ux_system_host_hcd_simulator_name[];
+
+extern UCHAR _ux_system_slave_class_storage_name[];
+extern UCHAR _ux_system_slave_class_storage_vendor_id[];
+extern UCHAR _ux_system_slave_class_storage_product_id[];
+extern UCHAR _ux_system_slave_class_storage_product_rev[];
+extern UCHAR _ux_system_slave_class_storage_product_serial[];
+extern UCHAR _ux_system_slave_class_audio_name[];
+extern UCHAR _ux_system_slave_class_cdc_acm_name[];
+extern UCHAR _ux_system_slave_class_dpump_name[];
+extern UCHAR _ux_system_slave_class_pima_name[];
+extern UCHAR _ux_system_slave_class_hid_name[];
+extern UCHAR _ux_system_slave_class_rndis_name[];
+extern UCHAR _ux_system_slave_class_cdc_ecm_name[];
extern UCHAR _ux_system_slave_class_dfu_name[];
extern UCHAR _ux_system_device_class_printer_name[];
diff --git a/common/core/inc/ux_user_sample.h b/common/core/inc/ux_user_sample.h
index 1246bbaa..107c8268 100644
--- a/common/core/inc/ux_user_sample.h
+++ b/common/core/inc/ux_user_sample.h
@@ -1,5 +1,6 @@
/***************************************************************************
* Copyright (c) 2024 Microsoft Corporation
+ * Copyright (c) 2026-present Eclipse ThreadX contributors
*
* This program and the accompanying materials are made available under the
* terms of the MIT License which is available at
@@ -39,75 +40,6 @@
/* Note that all the defines in this file may also be made on the */
/* command line when building USBX library and application objects. */
/* */
-/* RELEASE HISTORY */
-/* */
-/* DATE NAME DESCRIPTION */
-/* */
-/* 05-19-2020 Chaoqiong Xiao Initial Version 6.0 */
-/* 09-30-2020 Chaoqiong Xiao Modified comment(s), */
-/* resulting in version 6.1 */
-/* 02-02-2021 Xiuwen Cai Modified comment(s), added */
-/* compile option for using */
-/* packet pool from NetX, */
-/* resulting in version 6.1.4 */
-/* 04-02-2021 Chaoqiong Xiao Modified comment(s), */
-/* added DFU_UPLOAD option, */
-/* added macro to enable */
-/* device bi-dir-endpoints, */
-/* added macro to disable CDC- */
-/* ACM transmission support, */
-/* resulting in version 6.1.6 */
-/* 06-02-2021 Xiuwen Cai Modified comment(s), added */
-/* transfer timeout value */
-/* options, */
-/* resulting in version 6.1.7 */
-/* 08-02-2021 Wen Wang Modified comment(s), */
-/* fixed spelling error, */
-/* resulting in version 6.1.8 */
-/* 10-15-2021 Chaoqiong Xiao Modified comment(s), */
-/* added option for assert, */
-/* resulting in version 6.1.9 */
-/* 01-31-2022 Chaoqiong Xiao Modified comment(s), */
-/* added standalone support, */
-/* added option for device */
-/* audio feedback endpoint, */
-/* added option for MTP, */
-/* added options for HID */
-/* interrupt OUT support, */
-/* added option to validate */
-/* class code in enumeration, */
-/* resulting in version 6.1.10 */
-/* 07-29-2022 Chaoqiong Xiao Modified comment(s), */
-/* added audio class features, */
-/* added device CDC_ACM and */
-/* printer write auto ZLP, */
-/* resulting in version 6.1.12 */
-/* 10-31-2022 Chaoqiong Xiao Modified comment(s), */
-/* deprecated ECM pool option, */
-/* added align minimal config, */
-/* added host stack instance */
-/* creation strategy control, */
-/* resulting in version 6.2.0 */
-/* 03-08-2023 Chaoqiong Xiao Modified comment(s), */
-/* added option to disable dev */
-/* alternate setting support, */
-/* added option to disable dev */
-/* framework initialize scan, */
-/* added option to reference */
-/* names by pointer to chars, */
-/* added option to enable */
-/* basic USBX error checking, */
-/* resulting in version 6.2.1 */
-/* 10-31-2023 Xiuwen Cai, CQ Xiao Modified comment(s), */
-/* refined memory management, */
-/* added zero copy support */
-/* in many device classes, */
-/* added a new mode to manage */
-/* endpoint buffer in classes, */
-/* added option for get string */
-/* requests with zero wIndex, */
-/* resulting in version 6.3.0 */
-/* */
/**************************************************************************/
#ifndef UX_USER_H
diff --git a/common/core/inc/ux_utility.h b/common/core/inc/ux_utility.h
index 555bf635..9249e71b 100644
--- a/common/core/inc/ux_utility.h
+++ b/common/core/inc/ux_utility.h
@@ -1,5 +1,6 @@
/***************************************************************************
* Copyright (c) 2024 Microsoft Corporation
+ * Copyright (c) 2026-present Eclipse ThreadX contributors
*
* This program and the accompanying materials are made available under the
* terms of the MIT License which is available at
@@ -35,33 +36,6 @@
/* This file contains all the header and extern functions used by the */
/* USBX components that utilize utility functions. */
/* */
-/* RELEASE HISTORY */
-/* */
-/* DATE NAME DESCRIPTION */
-/* */
-/* 05-19-2020 Chaoqiong Xiao Initial Version 6.0 */
-/* 09-30-2020 Chaoqiong Xiao Modified comment(s), */
-/* added timer delete, used UX */
-/* prefix to refer to TX */
-/* symbols instead of using */
-/* them directly, */
-/* resulting in version 6.1 */
-/* 01-31-2022 Chaoqiong Xiao Modified comment(s), */
-/* added standalone support, */
-/* resulting in version 6.1.10 */
-/* 04-25-2022 Chaoqiong Xiao Modified comment(s), */
-/* fixed standalone compile, */
-/* resulting in version 6.1.11 */
-/* 07-29-2022 Chaoqiong Xiao Modified comment(s), */
-/* added macros for RTOS calls,*/
-/* fixed OHCI PRSC issue, */
-/* resulting in version 6.1.12 */
-/* 10-31-2023 Chaoqiong Xiao Modified comment(s), */
-/* refined memory management, */
-/* added new function to check */
-/* parsed size of descriptor, */
-/* resulting in version 6.3.0 */
-/* */
/**************************************************************************/
#ifndef UX_UTILITY_H
@@ -180,26 +154,31 @@ extern ALIGN_TYPE _ux_utility_time_elapsed(ALIGN_TYPE, ALIGN_TYPE);
#if !defined(UX_STANDALONE)
#define _ux_system_semaphore_create _ux_utility_semaphore_create
#define _ux_system_semaphore_create_norc _ux_utility_semaphore_create
-#define _ux_system_semaphore_created(sem) ((sem)->tx_semaphore_id != UX_EMPTY)
#define _ux_system_semaphore_get _ux_utility_semaphore_get
#define _ux_system_semaphore_get_norc _ux_utility_semaphore_get
-#define _ux_system_semaphore_waiting(sem) ((sem)->tx_semaphore_count != 0)
#define _ux_system_semaphore_delete _ux_utility_semaphore_delete
#define _ux_system_semaphore_put _ux_utility_semaphore_put
#define _ux_system_thread_create _ux_utility_thread_create
#define _ux_system_thread_create_norc _ux_utility_thread_create
-#define _ux_system_thread_created(t) ((t)->tx_thread_id != UX_EMPTY)
#define _ux_system_thread_delete _ux_utility_thread_delete
#define _ux_system_mutex_create _ux_utility_mutex_create
#define _ux_system_mutex_delete _ux_utility_mutex_delete
#define _ux_system_mutex_off _ux_utility_mutex_off
#define _ux_system_mutex_on _ux_utility_mutex_on
#define _ux_system_event_flags_create _ux_utility_event_flags_create
-#define _ux_system_event_flags_created(e) ((e)->tx_event_flags_group_id != UX_EMPTY)
#define _ux_system_event_flags_delete _ux_utility_event_flags_delete
#define _ux_system_event_flags_get _ux_utility_event_flags_get
#define _ux_system_event_flags_set _ux_utility_event_flags_set
#define _ux_system_event_flags_set_rc _ux_utility_event_flags_set
+#ifdef TX_API_H
+#define _ux_system_thread_entry(t) ((t)->tx_thread_entry)
+#define _ux_system_thread_created(t) ((t)->tx_thread_id != UX_EMPTY)
+#define _ux_system_semaphore_created(sem) ((sem)->tx_semaphore_id != UX_EMPTY)
+#define _ux_system_semaphore_waiting(sem) ((sem)->tx_semaphore_count != 0)
+#define _ux_system_event_flags_created(e) ((e)->tx_event_flags_group_id != UX_EMPTY)
+#define _ux_system_mutex_created(m) ((m)->tx_mutex_id != UX_EMPTY)
+#define _ux_system_mutex_suspended_count(m) ((m)->tx_mutex_suspended_count)
+#endif /* TX_API_H */
#else
#define _ux_system_semaphore_create(sem,name,cnt) (UX_SUCCESS)
#define _ux_system_semaphore_create_norc(sem,name,cnt) do{}while(0)
@@ -223,18 +202,16 @@ extern ALIGN_TYPE _ux_utility_time_elapsed(ALIGN_TYPE, ALIGN_TYPE);
#define _ux_system_event_flags_get(g,req,gopt,actual,wopt) (*actual = 0)
#define _ux_system_event_flags_set(g,flags,option) do{(void)flags;}while(0)
#define _ux_system_event_flags_set_rc(g,flags,option) (UX_SUCCESS)
+#define _ux_system_mutex_created(m) (UX_FALSE)
#endif
#if !defined(UX_DEVICE_STANDALONE)
#define _ux_device_thread_create _ux_utility_thread_create
#define _ux_device_thread_delete _ux_utility_thread_delete
-#define _ux_device_thread_entry(t) ((t)->tx_thread_entry)
#define _ux_device_thread_suspend _ux_utility_thread_suspend
#define _ux_device_thread_resume _ux_utility_thread_resume
#define _ux_device_thread_relinquish _ux_utility_thread_relinquish
#define _ux_device_semaphore_create _ux_utility_semaphore_create
-#define _ux_device_semaphore_created(sem) ((sem)->tx_semaphore_id != 0)
-#define _ux_device_semaphore_waiting(sem) ((sem)->tx_semaphore_count != 0)
#define _ux_device_semaphore_delete _ux_utility_semaphore_delete
#define _ux_device_semaphore_get _ux_utility_semaphore_get
#define _ux_device_semaphore_put _ux_utility_semaphore_put
@@ -246,6 +223,15 @@ extern ALIGN_TYPE _ux_utility_time_elapsed(ALIGN_TYPE, ALIGN_TYPE);
#define _ux_device_event_flags_delete _ux_utility_event_flags_delete
#define _ux_device_event_flags_get _ux_utility_event_flags_get
#define _ux_device_event_flags_set _ux_utility_event_flags_set
+#ifdef TX_API_H
+#define _ux_device_thread_entry(t) ((t)->tx_thread_entry)
+#define _ux_device_thread_created(t) ((t)->tx_thread_id != UX_EMPTY)
+#define _ux_device_semaphore_created(sem) ((sem)->tx_semaphore_id != UX_EMPTY)
+#define _ux_device_semaphore_waiting(sem) ((sem)->tx_semaphore_count != 0)
+#define _ux_device_event_flags_created(e) ((e)->tx_event_flags_group_id != UX_EMPTY)
+#define _ux_device_mutex_created(m) ((m)->tx_mutex_id != UX_EMPTY)
+#define _ux_device_mutex_suspended_count(m) ((m)->tx_mutex_suspended_count)
+#endif /* TX_API_H */
#else
#define _ux_device_thread_create(t,name,entry,entry_param,stack,stack_size,priority,preempt_threshold,time_slice,auto_start) (UX_SUCCESS)
#define _ux_device_thread_delete(t) do{}while(0)
@@ -267,20 +253,18 @@ extern ALIGN_TYPE _ux_utility_time_elapsed(ALIGN_TYPE, ALIGN_TYPE);
#define _ux_device_event_flags_delete(g) do{}while(0)
#define _ux_device_event_flags_get(g,req,gopt,actual,wopt) do{}while(0)
#define _ux_device_event_flags_set(g,flags,option) do{}while(0)
+#define _ux_device_event_flags_created(e) (UX_FALSE)
+#define _ux_device_mutex_created(m) (UX_FALSE)
#endif
#if !defined(UX_HOST_STANDALONE)
#define _ux_host_thread_create _ux_utility_thread_create
-#define _ux_host_thread_created(thr) ((thr)->tx_thread_id != 0)
#define _ux_host_thread_delete _ux_utility_thread_delete
-#define _ux_host_thread_entry(thr) ((thr)->tx_thread_entry)
#define _ux_host_thread_resume _ux_utility_thread_resume
#define _ux_host_thread_sleep _ux_utility_thread_sleep
#define _ux_host_thread_schedule_other _ux_utility_thread_schedule_other
#define _ux_host_semaphore_create _ux_utility_semaphore_create
-#define _ux_host_semaphore_created(sem) ((sem)->tx_semaphore_id != 0)
-#define _ux_host_semaphore_waiting(sem) ((sem)->tx_semaphore_count != 0)
#define _ux_host_semaphore_delete _ux_utility_semaphore_delete
#define _ux_host_semaphore_get _ux_utility_semaphore_get
#define _ux_host_semaphore_get_norc _ux_utility_semaphore_get
@@ -296,6 +280,15 @@ extern ALIGN_TYPE _ux_utility_time_elapsed(ALIGN_TYPE, ALIGN_TYPE);
#define _ux_host_event_flags_set _ux_utility_event_flags_set
#define _ux_host_timer_create _ux_utility_timer_create
#define _ux_host_timer_delete _ux_utility_timer_delete
+#ifdef TX_API_H
+#define _ux_host_thread_entry(t) ((t)->tx_thread_entry)
+#define _ux_host_thread_created(t) ((t)->tx_thread_id != UX_EMPTY)
+#define _ux_host_semaphore_created(sem) ((sem)->tx_semaphore_id != UX_EMPTY)
+#define _ux_host_semaphore_waiting(sem) ((sem)->tx_semaphore_count != 0)
+#define _ux_host_event_flags_created(e) ((e)->tx_event_flags_group_id != UX_EMPTY)
+#define _ux_host_mutex_created(m) ((m)->tx_mutex_id != UX_EMPTY)
+#define _ux_host_mutex_suspended_count(m) ((m)->tx_mutex_suspended_count)
+#endif /* TX_API_H */
#else
#define _ux_host_thread_create(t,name,entry,entry_param,stack,stack_size,priority,preempt_threshold,time_slice,auto_start) (UX_SUCCESS)
#define _ux_host_thread_created(t) (UX_FALSE)
@@ -322,6 +315,8 @@ extern ALIGN_TYPE _ux_utility_time_elapsed(ALIGN_TYPE, ALIGN_TYPE);
#define _ux_host_event_flags_set(g,flags,option) do{}while(0)
#define _ux_host_timer_create(t,name,func,arg,tick0,tick1,flag) (UX_SUCCESS)
#define _ux_host_timer_delete(t) do{}while(0)
+#define _ux_host_event_flags_created(e) (UX_FALSE)
+#define _ux_host_mutex_created(m) (UX_FALSE)
#endif
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 0d1dd572..a261c02f 100644
--- a/common/core/src/ux_dcd_sim_slave_address_set.c
+++ b/common/core/src/ux_dcd_sim_slave_address_set.c
@@ -1,18 +1,19 @@
/***************************************************************************
- * Copyright (c) 2024 Microsoft Corporation
- *
+ * Copyright (c) 2024 Microsoft Corporation
+ * Copyright (c) 2026-present Eclipse ThreadX contributors
+ *
* This program and the accompanying materials are made available under the
* terms of the MIT License which is available at
* https://opensource.org/licenses/MIT.
- *
+ *
* SPDX-License-Identifier: MIT
**************************************************************************/
/**************************************************************************/
/**************************************************************************/
-/** */
-/** USBX Component */
+/** */
+/** USBX Component */
/** */
/** Slave Simulator Controller Driver */
/** */
@@ -50,23 +51,15 @@
/* */
/* OUTPUT */
/* */
-/* Completion Status */
+/* Completion Status */
+/* */
+/* CALLS */
+/* */
+/* None */
+/* */
+/* CALLED BY */
/* */
-/* CALLS */
-/* */
-/* None */
-/* */
-/* CALLED BY */
-/* */
/* Slave Simulator Controller Driver */
-/* */
-/* RELEASE HISTORY */
-/* */
-/* DATE NAME DESCRIPTION */
-/* */
-/* 05-19-2020 Chaoqiong Xiao Initial Version 6.0 */
-/* 09-30-2020 Chaoqiong Xiao Modified comment(s), */
-/* resulting in version 6.1 */
/* */
/**************************************************************************/
UINT _ux_dcd_sim_slave_address_set(UX_DCD_SIM_SLAVE *dcd_sim_slave, ULONG address)
@@ -76,6 +69,6 @@ UINT _ux_dcd_sim_slave_address_set(UX_DCD_SIM_SLAVE *dcd_sim_slave, ULONG addre
UX_PARAMETER_NOT_USED(address);
/* This function always succeeds. */
- return(UX_SUCCESS);
+ return(UX_SUCCESS);
}
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 3c1fe6e7..b84409a7 100644
--- a/common/core/src/ux_dcd_sim_slave_endpoint_create.c
+++ b/common/core/src/ux_dcd_sim_slave_endpoint_create.c
@@ -1,18 +1,19 @@
/***************************************************************************
- * Copyright (c) 2024 Microsoft Corporation
- *
+ * Copyright (c) 2024 Microsoft Corporation
+ * Copyright (c) 2026-present Eclipse ThreadX contributors
+ *
* This program and the accompanying materials are made available under the
* terms of the MIT License which is available at
* https://opensource.org/licenses/MIT.
- *
+ *
* SPDX-License-Identifier: MIT
**************************************************************************/
/**************************************************************************/
/**************************************************************************/
-/** */
-/** USBX Component */
+/** */
+/** USBX Component */
/** */
/** Slave Simulator Controller Driver */
/** */
@@ -49,26 +50,15 @@
/* */
/* OUTPUT */
/* */
-/* Completion Status */
+/* Completion Status */
+/* */
+/* CALLS */
+/* */
+/* None */
+/* */
+/* CALLED BY */
/* */
-/* CALLS */
-/* */
-/* None */
-/* */
-/* CALLED BY */
-/* */
/* Slave Simulator Controller Driver */
-/* */
-/* RELEASE HISTORY */
-/* */
-/* DATE NAME DESCRIPTION */
-/* */
-/* 05-19-2020 Chaoqiong Xiao Initial Version 6.0 */
-/* 09-30-2020 Chaoqiong Xiao Modified comment(s), */
-/* resulting in version 6.1 */
-/* 04-02-2021 Chaoqiong Xiao Modified comment(s), */
-/* supported bi-dir-endpoints, */
-/* resulting in version 6.1.6 */
/* */
/**************************************************************************/
UINT _ux_dcd_sim_slave_endpoint_create(UX_DCD_SIM_SLAVE *dcd_sim_slave, UX_SLAVE_ENDPOINT *endpoint)
@@ -78,7 +68,7 @@ UX_DCD_SIM_SLAVE_ED *ed;
ULONG sim_slave_endpoint_index;
- /* The simulator slave controller has 16 endpoints maximum. Endpoint 0 is always control.
+ /* The simulator slave controller has 16 endpoints maximum. Endpoint 0 is always control.
The other endpoints are generic. We can use the endpoint number as an index. */
sim_slave_endpoint_index = endpoint ->ux_slave_endpoint_descriptor.bEndpointAddress & ~(ULONG)UX_ENDPOINT_DIRECTION;
@@ -96,7 +86,7 @@ ULONG sim_slave_endpoint_index;
/* Check the endpoint status, if it is free, reserve it. If not reject this endpoint. */
if ((ed -> ux_sim_slave_ed_status & UX_DCD_SIM_SLAVE_ED_STATUS_USED) == 0)
{
-
+
/* We can use this endpoint. */
ed -> ux_sim_slave_ed_status |= UX_DCD_SIM_SLAVE_ED_STATUS_USED;
@@ -114,7 +104,7 @@ ULONG sim_slave_endpoint_index;
ed -> ux_sim_slave_ed_status |= UX_DCD_SIM_SLAVE_ED_STATUS_TRANSFER;
/* Enable this endpoint. */
- return(UX_SUCCESS);
+ return(UX_SUCCESS);
}
/* Notify application. */
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 18572d31..671fdb42 100644
--- a/common/core/src/ux_dcd_sim_slave_endpoint_destroy.c
+++ b/common/core/src/ux_dcd_sim_slave_endpoint_destroy.c
@@ -1,18 +1,19 @@
/***************************************************************************
- * Copyright (c) 2024 Microsoft Corporation
- *
+ * Copyright (c) 2024 Microsoft Corporation
+ * Copyright (c) 2026-present Eclipse ThreadX contributors
+ *
* This program and the accompanying materials are made available under the
* terms of the MIT License which is available at
* https://opensource.org/licenses/MIT.
- *
+ *
* SPDX-License-Identifier: MIT
**************************************************************************/
/**************************************************************************/
/**************************************************************************/
-/** */
-/** USBX Component */
+/** */
+/** USBX Component */
/** */
/** Slave Simulator Controller Driver */
/** */
@@ -49,23 +50,15 @@
/* */
/* OUTPUT */
/* */
-/* Completion Status */
+/* Completion Status */
+/* */
+/* CALLS */
+/* */
+/* None */
+/* */
+/* CALLED BY */
/* */
-/* CALLS */
-/* */
-/* None */
-/* */
-/* CALLED BY */
-/* */
/* Slave Simulator Controller Driver */
-/* */
-/* RELEASE HISTORY */
-/* */
-/* DATE NAME DESCRIPTION */
-/* */
-/* 05-19-2020 Chaoqiong Xiao Initial Version 6.0 */
-/* 09-30-2020 Chaoqiong Xiao Modified comment(s), */
-/* resulting in version 6.1 */
/* */
/**************************************************************************/
UINT _ux_dcd_sim_slave_endpoint_destroy(UX_DCD_SIM_SLAVE *dcd_sim_slave, UX_SLAVE_ENDPOINT *endpoint)
@@ -82,6 +75,6 @@ UX_DCD_SIM_SLAVE_ED *ed;
ed -> ux_sim_slave_ed_status = UX_DCD_SIM_SLAVE_ED_STATUS_UNUSED;
/* This function never fails. */
- return(UX_SUCCESS);
+ return(UX_SUCCESS);
}
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 8d0c6d12..a39bb5a1 100644
--- a/common/core/src/ux_dcd_sim_slave_endpoint_reset.c
+++ b/common/core/src/ux_dcd_sim_slave_endpoint_reset.c
@@ -1,18 +1,19 @@
/***************************************************************************
- * Copyright (c) 2024 Microsoft Corporation
- *
+ * Copyright (c) 2024 Microsoft Corporation
+ * Copyright (c) 2026-present Eclipse ThreadX contributors
+ *
* This program and the accompanying materials are made available under the
* terms of the MIT License which is available at
* https://opensource.org/licenses/MIT.
- *
+ *
* SPDX-License-Identifier: MIT
**************************************************************************/
/**************************************************************************/
/**************************************************************************/
-/** */
-/** USBX Component */
+/** */
+/** USBX Component */
/** */
/** Slave Simulator Controller Driver */
/** */
@@ -49,30 +50,15 @@
/* */
/* OUTPUT */
/* */
-/* Completion Status */
+/* Completion Status */
+/* */
+/* CALLS */
+/* */
+/* None */
+/* */
+/* CALLED BY */
/* */
-/* CALLS */
-/* */
-/* None */
-/* */
-/* CALLED BY */
-/* */
/* Slave Simulator Controller Driver */
-/* */
-/* RELEASE HISTORY */
-/* */
-/* DATE NAME DESCRIPTION */
-/* */
-/* 05-19-2020 Chaoqiong Xiao Initial Version 6.0 */
-/* 09-30-2020 Chaoqiong Xiao Modified comment(s), */
-/* resulting in version 6.1 */
-/* 06-02-2021 Chaoqiong Xiao Modified comment(s), */
-/* cleared transfer flag and */
-/* waked up suspended thread, */
-/* resulting in version 6.1.7 */
-/* 01-31-2022 Chaoqiong Xiao Modified comment(s), */
-/* added standalone support, */
-/* resulting in version 6.1.10 */
/* */
/**************************************************************************/
UINT _ux_dcd_sim_slave_endpoint_reset(UX_DCD_SIM_SLAVE *dcd_sim_slave, UX_SLAVE_ENDPOINT *endpoint)
@@ -122,6 +108,6 @@ UX_SLAVE_TRANSFER *transfer;
#endif
/* This function never fails. */
- return(UX_SUCCESS);
+ return(UX_SUCCESS);
}
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 2057616f..64e971e2 100644
--- a/common/core/src/ux_dcd_sim_slave_endpoint_stall.c
+++ b/common/core/src/ux_dcd_sim_slave_endpoint_stall.c
@@ -1,18 +1,19 @@
/***************************************************************************
- * Copyright (c) 2024 Microsoft Corporation
- *
+ * Copyright (c) 2024 Microsoft Corporation
+ * Copyright (c) 2026-present Eclipse ThreadX contributors
+ *
* This program and the accompanying materials are made available under the
* terms of the MIT License which is available at
* https://opensource.org/licenses/MIT.
- *
+ *
* SPDX-License-Identifier: MIT
**************************************************************************/
/**************************************************************************/
/**************************************************************************/
-/** */
-/** USBX Component */
+/** */
+/** USBX Component */
/** */
/** Slave Simulator Controller Driver */
/** */
@@ -49,23 +50,15 @@
/* */
/* OUTPUT */
/* */
-/* Completion Status */
+/* Completion Status */
+/* */
+/* CALLS */
+/* */
+/* None */
+/* */
+/* CALLED BY */
/* */
-/* CALLS */
-/* */
-/* None */
-/* */
-/* CALLED BY */
-/* */
/* Slave Simulator Controller Driver */
-/* */
-/* RELEASE HISTORY */
-/* */
-/* DATE NAME DESCRIPTION */
-/* */
-/* 05-19-2020 Chaoqiong Xiao Initial Version 6.0 */
-/* 09-30-2020 Chaoqiong Xiao Modified comment(s), */
-/* resulting in version 6.1 */
/* */
/**************************************************************************/
UINT _ux_dcd_sim_slave_endpoint_stall(UX_DCD_SIM_SLAVE *dcd_sim_slave, UX_SLAVE_ENDPOINT *endpoint)
@@ -74,7 +67,7 @@ UINT _ux_dcd_sim_slave_endpoint_stall(UX_DCD_SIM_SLAVE *dcd_sim_slave, UX_SLAVE
UX_DCD_SIM_SLAVE_ED *ed;
UX_PARAMETER_NOT_USED(dcd_sim_slave);
-
+
/* Get the physical endpoint address in the endpoint container. */
ed = (UX_DCD_SIM_SLAVE_ED *) endpoint -> ux_slave_endpoint_ed;
@@ -82,6 +75,6 @@ UX_DCD_SIM_SLAVE_ED *ed;
ed -> ux_sim_slave_ed_status |= UX_DCD_SIM_SLAVE_ED_STATUS_STALLED;
/* This function never fails. */
- return(UX_SUCCESS);
+ return(UX_SUCCESS);
}
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 7b46fae0..c3252118 100644
--- a/common/core/src/ux_dcd_sim_slave_endpoint_status.c
+++ b/common/core/src/ux_dcd_sim_slave_endpoint_status.c
@@ -1,18 +1,19 @@
/***************************************************************************
- * Copyright (c) 2024 Microsoft Corporation
- *
+ * Copyright (c) 2024 Microsoft Corporation
+ * Copyright (c) 2026-present Eclipse ThreadX contributors
+ *
* This program and the accompanying materials are made available under the
* terms of the MIT License which is available at
* https://opensource.org/licenses/MIT.
- *
+ *
* SPDX-License-Identifier: MIT
**************************************************************************/
/**************************************************************************/
/**************************************************************************/
-/** */
-/** USBX Component */
+/** */
+/** USBX Component */
/** */
/** Slave Simulator Controller Driver */
/** */
@@ -49,26 +50,15 @@
/* */
/* OUTPUT */
/* */
-/* Completion Status */
+/* Completion Status */
+/* */
+/* CALLS */
+/* */
+/* None */
+/* */
+/* CALLED BY */
/* */
-/* CALLS */
-/* */
-/* None */
-/* */
-/* CALLED BY */
-/* */
/* Slave Simulator Controller Driver */
-/* */
-/* RELEASE HISTORY */
-/* */
-/* DATE NAME DESCRIPTION */
-/* */
-/* 05-19-2020 Chaoqiong Xiao Initial Version 6.0 */
-/* 09-30-2020 Chaoqiong Xiao Modified comment(s), */
-/* resulting in version 6.1 */
-/* 04-02-2021 Chaoqiong Xiao Modified comment(s), */
-/* supported bi-dir-endpoints, */
-/* resulting in version 6.1.6 */
/* */
/**************************************************************************/
UINT _ux_dcd_sim_slave_endpoint_status(UX_DCD_SIM_SLAVE *dcd_sim_slave, ULONG endpoint_index)
@@ -99,7 +89,7 @@ ULONG ed_index = ed_addr & ~UX_ENDPOINT_DIRECTION;
/* Check if the endpoint is stalled. */
if ((ed -> ux_sim_slave_ed_status & UX_DCD_SIM_SLAVE_ED_STATUS_STALLED) == 0)
return(UX_FALSE);
- else
+ else
return(UX_TRUE);
}
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 2a4cdbc0..5045eb03 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
@@ -1,18 +1,19 @@
/***************************************************************************
- * Copyright (c) 2024 Microsoft Corporation
- *
+ * Copyright (c) 2024 Microsoft Corporation
+ * Copyright (c) 2026-present Eclipse ThreadX contributors
+ *
* This program and the accompanying materials are made available under the
* terms of the MIT License which is available at
* https://opensource.org/licenses/MIT.
- *
+ *
* SPDX-License-Identifier: MIT
**************************************************************************/
/**************************************************************************/
/**************************************************************************/
-/** */
-/** USBX Component */
+/** */
+/** USBX Component */
/** */
/** Slave Simulator Controller Driver */
/** */
@@ -50,23 +51,15 @@
/* */
/* OUTPUT */
/* */
-/* Completion Status */
+/* Completion Status */
+/* */
+/* CALLS */
+/* */
+/* None */
+/* */
+/* CALLED BY */
/* */
-/* CALLS */
-/* */
-/* None */
-/* */
-/* CALLED BY */
-/* */
/* Slave Simulator Controller Driver */
-/* */
-/* RELEASE HISTORY */
-/* */
-/* DATE NAME DESCRIPTION */
-/* */
-/* 05-19-2020 Chaoqiong Xiao Initial Version 6.0 */
-/* 09-30-2020 Chaoqiong Xiao Modified comment(s), */
-/* resulting in version 6.1 */
/* */
/**************************************************************************/
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 6b3226f0..fcebfce8 100644
--- a/common/core/src/ux_dcd_sim_slave_function.c
+++ b/common/core/src/ux_dcd_sim_slave_function.c
@@ -1,18 +1,19 @@
/***************************************************************************
- * Copyright (c) 2024 Microsoft Corporation
- *
+ * Copyright (c) 2024 Microsoft Corporation
+ * Copyright (c) 2026-present Eclipse ThreadX contributors
+ *
* This program and the accompanying materials are made available under the
* terms of the MIT License which is available at
* https://opensource.org/licenses/MIT.
- *
+ *
* SPDX-License-Identifier: MIT
**************************************************************************/
/**************************************************************************/
/**************************************************************************/
-/** */
-/** USBX Component */
+/** */
+/** USBX Component */
/** */
/** Slave Simulator Controller Driver */
/** */
@@ -51,35 +52,24 @@
/* */
/* OUTPUT */
/* */
-/* Completion Status */
+/* Completion Status */
+/* */
+/* CALLS */
/* */
-/* CALLS */
-/* */
/* _ux_dcd_sim_slave_address_set Set address */
/* _ux_dcd_sim_slave_endpoint_create Create endpoint */
/* _ux_dcd_sim_slave_endpoint_destroy Destroy endpoint */
/* _ux_dcd_sim_slave_endpoint_reset Reset endpoint */
/* _ux_dcd_sim_slave_endpoint_stall Stall endpoint */
-/* _ux_dcd_sim_slave_endpoint_status Get endpoint status */
+/* _ux_dcd_sim_slave_endpoint_status Get endpoint status */
/* _ux_dcd_sim_slave_frame_number_get Get frame number */
/* _ux_dcd_sim_slave_state_change Change state */
/* _ux_dcd_sim_slave_transfer_abort Abort transfer */
/* _ux_dcd_sim_slave_transfer_request Request transfer */
-/* */
-/* CALLED BY */
-/* */
-/* USBX Device Stack */
-/* */
-/* RELEASE HISTORY */
-/* */
-/* DATE NAME DESCRIPTION */
-/* */
-/* 05-19-2020 Chaoqiong Xiao Initial Version 6.0 */
-/* 09-30-2020 Chaoqiong Xiao Modified comment(s), */
-/* resulting in version 6.1 */
-/* 01-31-2022 Chaoqiong Xiao Modified comment(s), */
-/* added standalone support, */
-/* resulting in version 6.1.10 */
+/* */
+/* CALLED BY */
+/* */
+/* USBX Device Stack */
/* */
/**************************************************************************/
UINT _ux_dcd_sim_slave_function(UX_SLAVE_DCD *dcd, UINT function, VOID *parameter)
@@ -87,7 +77,7 @@ UINT _ux_dcd_sim_slave_function(UX_SLAVE_DCD *dcd, UINT function, VOID *parame
UINT status;
UX_DCD_SIM_SLAVE *dcd_sim_slave;
-
+
/* Check the status of the controller. */
if (dcd -> ux_slave_dcd_status == UX_UNUSED)
@@ -101,7 +91,7 @@ UX_DCD_SIM_SLAVE *dcd_sim_slave;
return(UX_CONTROLLER_UNKNOWN);
}
-
+
/* Get the pointer to the Slave simulation DCD. */
dcd_sim_slave = (UX_DCD_SIM_SLAVE *) dcd -> ux_slave_dcd_controller_hardware;
@@ -110,7 +100,7 @@ UX_DCD_SIM_SLAVE *dcd_sim_slave;
{
case UX_DCD_GET_FRAME_NUMBER:
-
+
status = _ux_dcd_sim_slave_frame_number_get(dcd_sim_slave, (ULONG *) parameter);
break;
@@ -180,7 +170,7 @@ UX_DCD_SIM_SLAVE *dcd_sim_slave;
UX_TRACE_IN_LINE_INSERT(UX_TRACE_ERROR, UX_FUNCTION_NOT_SUPPORTED, 0, 0, 0, UX_TRACE_ERRORS, 0, 0)
status = UX_FUNCTION_NOT_SUPPORTED;
- }
+ }
/* Return completion status. */
return(status);
diff --git a/common/core/src/ux_dcd_sim_slave_initialize.c b/common/core/src/ux_dcd_sim_slave_initialize.c
index 164dbbf2..484a24d4 100644
--- a/common/core/src/ux_dcd_sim_slave_initialize.c
+++ b/common/core/src/ux_dcd_sim_slave_initialize.c
@@ -1,18 +1,19 @@
/***************************************************************************
- * Copyright (c) 2024 Microsoft Corporation
- *
+ * Copyright (c) 2024 Microsoft Corporation
+ * Copyright (c) 2026-present Eclipse ThreadX contributors
+ *
* This program and the accompanying materials are made available under the
* terms of the MIT License which is available at
* https://opensource.org/licenses/MIT.
- *
+ *
* SPDX-License-Identifier: MIT
**************************************************************************/
/**************************************************************************/
/**************************************************************************/
-/** */
-/** USBX Component */
+/** */
+/** USBX Component */
/** */
/** Slave Simulator Controller Driver */
/** */
@@ -45,31 +46,19 @@
/* */
/* INPUT */
/* */
-/* None */
+/* None */
/* */
/* OUTPUT */
/* */
-/* Completion Status */
+/* Completion Status */
+/* */
+/* CALLS */
+/* */
+/* _ux_utility_memory_allocate Allocate memory */
+/* */
+/* CALLED BY */
/* */
-/* CALLS */
-/* */
-/* _ux_utility_memory_allocate Allocate memory */
-/* */
-/* CALLED BY */
-/* */
/* Slave Simulator Controller Driver */
-/* */
-/* RELEASE HISTORY */
-/* */
-/* DATE NAME DESCRIPTION */
-/* */
-/* 05-19-2020 Chaoqiong Xiao Initial Version 6.0 */
-/* 09-30-2020 Chaoqiong Xiao Modified comment(s), */
-/* resulting in version 6.1 */
-/* 04-02-2021 Chaoqiong Xiao Modified comment(s), */
-/* added link with HCD, */
-/* set device to full speed, */
-/* resulting in version 6.1.6 */
/* */
/**************************************************************************/
UINT _ux_dcd_sim_slave_initialize(VOID)
@@ -79,13 +68,13 @@ UX_SLAVE_DCD *dcd;
UX_DCD_SIM_SLAVE *dcd_sim_slave;
UX_HCD *hcd;
-
+
/* Get the pointer to the DCD. */
dcd = &_ux_system_slave -> ux_system_slave_dcd;
/* The controller initialized here is of Slave simulation type. */
dcd -> ux_slave_dcd_controller_type = UX_DCD_SIM_SLAVE_SLAVE_CONTROLLER;
-
+
/* Allocate memory for this Slave simulation DCD instance. */
dcd_sim_slave = _ux_utility_memory_allocate(UX_NO_ALIGN, UX_REGULAR_MEMORY, sizeof(UX_DCD_SIM_SLAVE));
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 40f03d8d..af2b5aef 100644
--- a/common/core/src/ux_dcd_sim_slave_initialize_complete.c
+++ b/common/core/src/ux_dcd_sim_slave_initialize_complete.c
@@ -1,18 +1,19 @@
/***************************************************************************
- * Copyright (c) 2024 Microsoft Corporation
- *
+ * Copyright (c) 2024 Microsoft Corporation
+ * Copyright (c) 2026-present Eclipse ThreadX contributors
+ *
* This program and the accompanying materials are made available under the
* terms of the MIT License which is available at
* https://opensource.org/licenses/MIT.
- *
+ *
* SPDX-License-Identifier: MIT
**************************************************************************/
/**************************************************************************/
/**************************************************************************/
-/** */
-/** USBX Component */
+/** */
+/** USBX Component */
/** */
/** Slave Simulator Controller Driver */
/** */
@@ -45,35 +46,20 @@
/* */
/* INPUT */
/* */
-/* None */
+/* None */
/* */
/* OUTPUT */
/* */
-/* Completion Status */
+/* Completion Status */
+/* */
+/* CALLS */
+/* */
+/* (ux_slave_dcd_function) DCD dispatch function */
+/* _ux_utility_descriptor_parse Parse descriptor */
+/* */
+/* CALLED BY */
/* */
-/* CALLS */
-/* */
-/* (ux_slave_dcd_function) DCD dispatch function */
-/* _ux_utility_descriptor_parse Parse descriptor */
-/* */
-/* CALLED BY */
-/* */
/* Slave Simulator Controller Driver */
-/* */
-/* RELEASE HISTORY */
-/* */
-/* 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 */
-/* 04-02-2021 Chaoqiong Xiao Modified comment(s), */
-/* added framework init cases, */
-/* resulting in version 6.1.6 */
-/* 10-15-2021 Chaoqiong Xiao Modified comment(s), */
-/* filled payload size, */
-/* resulting in version 6.1.9 */
/* */
/**************************************************************************/
UINT _ux_dcd_sim_slave_initialize_complete(VOID)
@@ -83,7 +69,7 @@ UX_SLAVE_DCD *dcd;
UX_SLAVE_DEVICE *device;
UCHAR * device_framework;
UX_SLAVE_TRANSFER *transfer_request;
-
+
/* Get the pointer to the DCD. */
dcd = &_ux_system_slave -> ux_system_slave_dcd;
@@ -116,28 +102,28 @@ UX_SLAVE_TRANSFER *transfer_request;
_ux_system_device_descriptor_structure,
UX_DEVICE_DESCRIPTOR_ENTRIES,
(UCHAR *) &device -> ux_slave_device_descriptor);
-
+
/* Now we create a transfer request to accept the first SETUP packet
and get the ball running. First get the address of the endpoint
transfer request container. */
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 = UX_MS_TO_TICK(UX_CONTROL_TRANSFER_TIMEOUT);
-
+
/* Adjust the current data pointer as well. */
- transfer_request -> ux_slave_transfer_request_current_data_pointer =
+ transfer_request -> ux_slave_transfer_request_current_data_pointer =
transfer_request -> ux_slave_transfer_request_data_pointer;
-
+
/* Update the transfer request endpoint pointer with the default endpoint. */
transfer_request -> ux_slave_transfer_request_endpoint = &device -> ux_slave_device_control_endpoint;
/* The control endpoint max packet size needs to be filled manually in its descriptor. */
transfer_request -> ux_slave_transfer_request_endpoint -> ux_slave_endpoint_descriptor.wMaxPacketSize =
device -> ux_slave_device_descriptor.bMaxPacketSize0;
-
+
/* On the control endpoint, always expect the maximum. */
- transfer_request -> ux_slave_transfer_request_requested_length =
+ transfer_request -> ux_slave_transfer_request_requested_length =
device -> ux_slave_device_descriptor.bMaxPacketSize0;
transfer_request -> ux_slave_transfer_request_transfer_length =
device -> ux_slave_device_descriptor.bMaxPacketSize0;
@@ -147,15 +133,15 @@ UX_SLAVE_TRANSFER *transfer_request;
/* Create the default control endpoint attached to the device.
Once this endpoint is enabled, the host can then send a setup packet
- The device controller will receive it and will call the setup function
+ The device controller will receive it and will call the setup function
module. */
dcd -> ux_slave_dcd_function(dcd, UX_DCD_CREATE_ENDPOINT,
(VOID *) &device -> ux_slave_device_control_endpoint);
-
+
/* Ensure the control endpoint is properly reset. */
device -> ux_slave_device_control_endpoint.ux_slave_endpoint_state = UX_ENDPOINT_RESET;
- /* A SETUP packet is a DATA IN operation. */
+ /* A SETUP packet is a DATA IN operation. */
transfer_request -> ux_slave_transfer_request_phase = UX_TRANSFER_PHASE_DATA_IN;
/* We are now ready for the USB device to accept the first packet when connected. */
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 c2d0cc1a..cb295fd2 100644
--- a/common/core/src/ux_dcd_sim_slave_state_change.c
+++ b/common/core/src/ux_dcd_sim_slave_state_change.c
@@ -1,18 +1,19 @@
/***************************************************************************
- * Copyright (c) 2024 Microsoft Corporation
- *
+ * Copyright (c) 2024 Microsoft Corporation
+ * Copyright (c) 2026-present Eclipse ThreadX contributors
+ *
* This program and the accompanying materials are made available under the
* terms of the MIT License which is available at
* https://opensource.org/licenses/MIT.
- *
+ *
* SPDX-License-Identifier: MIT
**************************************************************************/
/**************************************************************************/
/**************************************************************************/
-/** */
-/** USBX Component */
+/** */
+/** USBX Component */
/** */
/** Slave Simulator Controller Driver */
/** */
@@ -51,29 +52,15 @@
/* */
/* OUTPUT */
/* */
-/* Completion Status */
+/* Completion Status */
+/* */
+/* CALLS */
+/* */
+/* None */
+/* */
+/* CALLED BY */
/* */
-/* CALLS */
-/* */
-/* None */
-/* */
-/* CALLED BY */
-/* */
/* Slave Simulator Controller Driver */
-/* */
-/* RELEASE HISTORY */
-/* */
-/* DATE NAME DESCRIPTION */
-/* */
-/* 05-19-2020 Chaoqiong Xiao Initial Version 6.0 */
-/* 09-30-2020 Chaoqiong Xiao Modified comment(s), */
-/* resulting in version 6.1 */
-/* 04-02-2021 Chaoqiong Xiao Modified comment(s), */
-/* simulate force disconnect, */
-/* resulting in version 6.1.6 */
-/* 01-31-2022 Chaoqiong Xiao Modified comment(s), */
-/* added standalone support, */
-/* resulting in version 6.1.10 */
/* */
/**************************************************************************/
UINT _ux_dcd_sim_slave_state_change(UX_DCD_SIM_SLAVE *dcd_sim_slave, ULONG state)
@@ -101,6 +88,6 @@ UX_HCD *hcd;
}
/* Nothing to do in simulation mode. */
- return(UX_SUCCESS);
+ return(UX_SUCCESS);
}
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 cf866b2e..b42995d3 100644
--- a/common/core/src/ux_dcd_sim_slave_transfer_abort.c
+++ b/common/core/src/ux_dcd_sim_slave_transfer_abort.c
@@ -1,18 +1,19 @@
/***************************************************************************
- * Copyright (c) 2024 Microsoft Corporation
- *
+ * Copyright (c) 2024 Microsoft Corporation
+ * Copyright (c) 2026-present Eclipse ThreadX contributors
+ *
* This program and the accompanying materials are made available under the
* terms of the MIT License which is available at
* https://opensource.org/licenses/MIT.
- *
+ *
* SPDX-License-Identifier: MIT
**************************************************************************/
/**************************************************************************/
/**************************************************************************/
-/** */
-/** USBX Component */
+/** */
+/** USBX Component */
/** */
/** Slave Simulator Controller Driver */
/** */
@@ -49,26 +50,15 @@
/* */
/* OUTPUT */
/* */
-/* Completion Status */
+/* Completion Status */
+/* */
+/* CALLS */
+/* */
+/* None */
+/* */
+/* CALLED BY */
/* */
-/* CALLS */
-/* */
-/* None */
-/* */
-/* CALLED BY */
-/* */
/* Slave Simulator Controller Driver */
-/* */
-/* RELEASE HISTORY */
-/* */
-/* DATE NAME DESCRIPTION */
-/* */
-/* 05-19-2020 Chaoqiong Xiao Initial Version 6.0 */
-/* 09-30-2020 Chaoqiong Xiao Modified comment(s), */
-/* resulting in version 6.1 */
-/* 01-31-2022 Chaoqiong Xiao Modified comment(s), */
-/* added standalone support, */
-/* resulting in version 6.1.10 */
/* */
/**************************************************************************/
UINT _ux_dcd_sim_slave_transfer_abort(UX_DCD_SIM_SLAVE *dcd_sim_slave, UX_SLAVE_TRANSFER *transfer_request)
@@ -90,6 +80,6 @@ UX_SLAVE_ENDPOINT *endpoint;
(UX_DCD_SIM_SLAVE_ED_STATUS_TRANSFER | UX_DCD_SIM_SLAVE_ED_STATUS_DONE);
/* This function never fails. */
- return(UX_SUCCESS);
+ return(UX_SUCCESS);
}
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 f6e53db0..5175df78 100644
--- a/common/core/src/ux_dcd_sim_slave_transfer_request.c
+++ b/common/core/src/ux_dcd_sim_slave_transfer_request.c
@@ -1,18 +1,19 @@
/***************************************************************************
- * Copyright (c) 2024 Microsoft Corporation
- *
+ * Copyright (c) 2024 Microsoft Corporation
+ * Copyright (c) 2026-present Eclipse ThreadX contributors
+ *
* This program and the accompanying materials are made available under the
* terms of the MIT License which is available at
* https://opensource.org/licenses/MIT.
- *
+ *
* SPDX-License-Identifier: MIT
**************************************************************************/
/**************************************************************************/
/**************************************************************************/
-/** */
-/** USBX Component */
+/** */
+/** USBX Component */
/** */
/** Slave Simulator Controller Driver */
/** */
@@ -54,30 +55,16 @@
/* */
/* OUTPUT */
/* */
-/* Completion Status */
+/* Completion Status */
+/* */
+/* CALLS */
/* */
-/* CALLS */
-/* */
-/* _ux_utility_semaphore_get Get semaphore */
+/* _ux_utility_semaphore_get Get semaphore */
/* _ux_dcd_sim_slave_transfer_abort Abort transfer */
-/* */
-/* CALLED BY */
-/* */
+/* */
+/* CALLED BY */
+/* */
/* Slave Simulator Controller Driver */
-/* */
-/* RELEASE HISTORY */
-/* */
-/* DATE NAME DESCRIPTION */
-/* */
-/* 05-19-2020 Chaoqiong Xiao Initial Version 6.0 */
-/* 09-30-2020 Chaoqiong Xiao Modified comment(s), */
-/* resulting in version 6.1 */
-/* 01-31-2022 Chaoqiong Xiao Modified comment(s), */
-/* added standalone support, */
-/* cleared transfer status */
-/* before semaphore wakeup to */
-/* avoid a race condition, */
-/* resulting in version 6.1.10 */
/* */
/**************************************************************************/
UINT _ux_dcd_sim_slave_transfer_request(UX_DCD_SIM_SLAVE *dcd_sim_slave, UX_SLAVE_TRANSFER *transfer_request)
@@ -93,7 +80,7 @@ UINT status;
/* Get the slave endpoint. */
ed = (UX_DCD_SIM_SLAVE_ED *) endpoint -> ux_slave_endpoint_ed;
-
+
/* We have a request for a OUT or IN transaction from the host.
If the endpoint is a Control endpoint, all this is happening under Interrupt and there is no
thread to suspend. */
@@ -106,7 +93,7 @@ UINT status;
/* We should wait for the semaphore to wake us up. */
status = _ux_device_semaphore_get(&transfer_request -> ux_slave_transfer_request_semaphore,
transfer_request -> ux_slave_transfer_request_timeout);
-
+
/* Check the completion code. */
if (status != UX_SUCCESS)
{
diff --git a/common/core/src/ux_dcd_sim_slave_transfer_run.c b/common/core/src/ux_dcd_sim_slave_transfer_run.c
index eee2379d..d4f3c612 100644
--- a/common/core/src/ux_dcd_sim_slave_transfer_run.c
+++ b/common/core/src/ux_dcd_sim_slave_transfer_run.c
@@ -1,10 +1,11 @@
/***************************************************************************
- * Copyright (c) 2024 Microsoft Corporation
- *
+ * Copyright (c) 2024 Microsoft Corporation
+ * Copyright (c) 2026-present Eclipse ThreadX contributors
+ *
* This program and the accompanying materials are made available under the
* terms of the MIT License which is available at
* https://opensource.org/licenses/MIT.
- *
+ *
* SPDX-License-Identifier: MIT
**************************************************************************/
@@ -71,12 +72,6 @@
/* */
/* Slave Simulator Controller Driver */
/* */
-/* RELEASE HISTORY */
-/* */
-/* DATE NAME DESCRIPTION */
-/* */
-/* 01-31-2022 Chaoqiong Xiao Initial Version 6.1.10 */
-/* */
/**************************************************************************/
UINT _ux_dcd_sim_slave_transfer_run(UX_DCD_SIM_SLAVE *dcd_sim_slave, UX_SLAVE_TRANSFER *transfer_request)
{
diff --git a/common/core/src/ux_dcd_sim_slave_uninitialize.c b/common/core/src/ux_dcd_sim_slave_uninitialize.c
new file mode 100644
index 00000000..0ac87213
--- /dev/null
+++ b/common/core/src/ux_dcd_sim_slave_uninitialize.c
@@ -0,0 +1,88 @@
+/***************************************************************************
+ * Copyright (c) 2025-present Eclipse ThreadX Contributors
+ *
+ * This program and the accompanying materials are made available under the
+ * terms of the MIT License which is available at
+ * https://opensource.org/licenses/MIT.
+ *
+ * SPDX-License-Identifier: MIT
+ **************************************************************************/
+
+
+/**************************************************************************/
+/**************************************************************************/
+/** */
+/** USBX Component */
+/** */
+/** Slave Simulator Controller Driver */
+/** */
+/**************************************************************************/
+/**************************************************************************/
+
+#define UX_SOURCE_CODE
+
+
+/* Include necessary system files. */
+
+#include "ux_api.h"
+#include "ux_dcd_sim_slave.h"
+
+
+/**************************************************************************/
+/* */
+/* FUNCTION RELEASE */
+/* */
+/* _ux_dcd_sim_slave_uninitialize PORTABLE C */
+/* */
+/* DESCRIPTION */
+/* */
+/* This function uninitializes the USB simulation slave controller. */
+/* The controller releases its resources (memory ...). */
+/* */
+/* INPUT */
+/* */
+/* None */
+/* */
+/* OUTPUT */
+/* */
+/* Completion Status */
+/* */
+/* CALLS */
+/* */
+/* _ux_utility_memory_free Free memory block */
+/* */
+/* CALLED BY */
+/* */
+/* Application */
+/* */
+/**************************************************************************/
+UINT _ux_dcd_sim_slave_uninitialize(VOID)
+{
+
+UX_SLAVE_DCD *dcd;
+UX_DCD_SIM_SLAVE *dcd_sim_slave;
+
+ /* Get the pointer to the DCD. */
+ dcd = &_ux_system_slave -> ux_system_slave_dcd;
+
+ /* If already unused, treat as success. */
+ if (dcd -> ux_slave_dcd_status == UX_UNUSED)
+ return(UX_SUCCESS);
+
+ /* Set the state of the controller to HALTED first. */
+ dcd -> ux_slave_dcd_status = UX_DCD_STATUS_HALTED;
+
+ /* Free the simulated slave controller. */
+ dcd_sim_slave = (UX_DCD_SIM_SLAVE *) dcd -> ux_slave_dcd_controller_hardware;
+ if (dcd_sim_slave != UX_NULL)
+ _ux_utility_memory_free(dcd_sim_slave);
+
+ /* Clear DCD bindings. */
+ dcd -> ux_slave_dcd_controller_hardware = UX_NULL;
+ dcd -> ux_slave_dcd_function = UX_NULL;
+
+ /* Set the state of the controller to UNUSED. */
+ dcd -> ux_slave_dcd_status = UX_UNUSED;
+
+ return(UX_SUCCESS);
+}
diff --git a/common/core/src/ux_device_class_dpump_activate.c b/common/core/src/ux_device_class_dpump_activate.c
index 8ac9a1f9..e39c7eba 100644
--- a/common/core/src/ux_device_class_dpump_activate.c
+++ b/common/core/src/ux_device_class_dpump_activate.c
@@ -1,18 +1,19 @@
/***************************************************************************
- * Copyright (c) 2024 Microsoft Corporation
- *
+ * Copyright (c) 2024 Microsoft Corporation
+ * Copyright (c) 2026-present Eclipse ThreadX contributors
+ *
* This program and the accompanying materials are made available under the
* terms of the MIT License which is available at
* https://opensource.org/licenses/MIT.
- *
+ *
* SPDX-License-Identifier: MIT
**************************************************************************/
/**************************************************************************/
/**************************************************************************/
-/** */
-/** USBX Component */
+/** */
+/** USBX Component */
/** */
/** Device Data Pump Class */
/** */
@@ -28,59 +29,40 @@
#include "ux_device_class_dpump.h"
-/**************************************************************************/
-/* */
-/* FUNCTION RELEASE */
-/* */
-/* _ux_device_class_dpump_activate PORTABLE C */
+/**************************************************************************/
+/* */
+/* FUNCTION RELEASE */
+/* */
+/* _ux_device_class_dpump_activate PORTABLE C */
/* 6.3.0 */
/* AUTHOR */
/* */
/* Chaoqiong Xiao, Microsoft Corporation */
/* */
/* DESCRIPTION */
-/* */
-/* This function activates the USB dpump device. */
-/* */
-/* INPUT */
-/* */
-/* command Pointer to dpump command */
-/* */
-/* OUTPUT */
-/* */
-/* Completion Status */
-/* */
-/* CALLS */
-/* */
+/* */
+/* This function activates the USB dpump device. */
+/* */
+/* INPUT */
+/* */
+/* command Pointer to dpump command */
+/* */
+/* OUTPUT */
+/* */
+/* Completion Status */
+/* */
+/* CALLS */
+/* */
/* None */
-/* */
-/* CALLED BY */
-/* */
-/* Device Data Pump Class */
-/* */
-/* RELEASE HISTORY */
-/* */
-/* DATE NAME DESCRIPTION */
-/* */
-/* 05-19-2020 Chaoqiong Xiao Initial Version 6.0 */
-/* 09-30-2020 Chaoqiong Xiao Modified comment(s), */
-/* resulting in version 6.1 */
-/* 01-31-2022 Chaoqiong Xiao Modified comment(s), */
-/* added standalone support, */
-/* resulting in version 6.1.10 */
-/* 07-29-2022 Chaoqiong Xiao Modified comment(s), */
-/* fixed parameter/variable */
-/* names conflict C++ keyword, */
-/* resulting in version 6.1.12 */
-/* 10-31-2023 Chaoqiong Xiao Modified comment(s), */
-/* added a new mode to manage */
-/* endpoint buffer in classes, */
-/* resulting in version 6.3.0 */
+/* */
+/* CALLED BY */
+/* */
+/* Device Data Pump Class */
/* */
/**************************************************************************/
UINT _ux_device_class_dpump_activate(UX_SLAVE_CLASS_COMMAND *command)
{
-
+
UX_SLAVE_INTERFACE *interface_ptr;
UX_SLAVE_CLASS_DPUMP *dpump;
UX_SLAVE_CLASS *class_ptr;
@@ -94,20 +76,20 @@ UX_SLAVE_ENDPOINT *endpoint;
/* Get the interface that owns this instance. */
interface_ptr = (UX_SLAVE_INTERFACE *) command -> ux_slave_class_command_interface;
-
+
/* Store the class instance into the interface. */
interface_ptr -> ux_slave_interface_class_instance = (VOID *)dpump;
-
+
/* Now the opposite, store the interface in the class instance. */
dpump -> ux_slave_class_dpump_interface = interface_ptr;
/* Locate the endpoints. Interrupt for Control and Bulk in/out for Data. */
endpoint = interface_ptr -> ux_slave_interface_first_endpoint;
-
+
/* Parse all endpoints. */
while (endpoint != UX_NULL)
{
-
+
/* Check the endpoint direction, and type. */
if ((endpoint -> ux_slave_endpoint_descriptor.bEndpointAddress & UX_ENDPOINT_DIRECTION) == UX_ENDPOINT_IN)
{
@@ -130,7 +112,7 @@ UX_SLAVE_ENDPOINT *endpoint;
/* Look at type for out endpoint. */
if ((endpoint -> ux_slave_endpoint_descriptor.bmAttributes & UX_MASK_ENDPOINT_TYPE) == UX_BULK_ENDPOINT)
{
-
+
/* We have found the bulk out endpoint, save it. */
dpump -> ux_slave_class_dpump_bulkout_endpoint = endpoint;
#if UX_DEVICE_ENDPOINT_BUFFER_OWNER == 1
@@ -139,7 +121,7 @@ UX_SLAVE_ENDPOINT *endpoint;
UX_DEVICE_CLASS_DPUMP_READ_BUFFER(dpump);
#endif
}
- }
+ }
/* Next endpoint. */
endpoint = endpoint -> ux_slave_endpoint_next_endpoint;
@@ -155,14 +137,14 @@ UX_SLAVE_ENDPOINT *endpoint;
/* If there is a activate function call it. */
if (dpump -> ux_slave_class_dpump_parameter.ux_slave_class_dpump_instance_activate != UX_NULL)
{
-
+
/* Invoke the application. */
dpump -> ux_slave_class_dpump_parameter.ux_slave_class_dpump_instance_activate(dpump);
}
/* If trace is enabled, insert this event into the trace buffer. */
UX_TRACE_IN_LINE_INSERT(UX_TRACE_DEVICE_CLASS_DPUMP_ACTIVATE, dpump, 0, 0, 0, UX_TRACE_DEVICE_CLASS_EVENTS, 0, 0)
-
+
/* If trace is enabled, register this object. */
UX_TRACE_OBJECT_REGISTER(UX_TRACE_DEVICE_OBJECT_TYPE_INTERFACE, dpump, 0, 0, 0)
diff --git a/common/core/src/ux_device_class_dpump_change.c b/common/core/src/ux_device_class_dpump_change.c
index c861e560..7e48aec9 100644
--- a/common/core/src/ux_device_class_dpump_change.c
+++ b/common/core/src/ux_device_class_dpump_change.c
@@ -1,16 +1,17 @@
/***************************************************************************
- * Copyright (c) 2024 Microsoft Corporation
- *
+ * Copyright (c) 2024 Microsoft Corporation
+ * Copyright (c) 2026-present Eclipse ThreadX contributors
+ *
* This program and the accompanying materials are made available under the
* terms of the MIT License which is available at
* https://opensource.org/licenses/MIT.
- *
+ *
* SPDX-License-Identifier: MIT
**************************************************************************/
/**************************************************************************/
-/** */
-/** USBX Component */
+/** */
+/** USBX Component */
/** */
/** Device DPUMP Class */
/** */
@@ -27,64 +28,43 @@
#include "ux_device_stack.h"
-/**************************************************************************/
-/* */
-/* FUNCTION RELEASE */
-/* */
-/* _ux_device_class_dpump_change PORTABLE C */
+/**************************************************************************/
+/* */
+/* FUNCTION RELEASE */
+/* */
+/* _ux_device_class_dpump_change PORTABLE C */
/* 6.3.0 */
/* AUTHOR */
/* */
/* Chaoqiong Xiao, Microsoft Corporation */
/* */
/* DESCRIPTION */
-/* */
-/* This function changes the interface of the DPUMP device */
-/* */
-/* INPUT */
-/* */
-/* command Pointer to dpump command */
-/* */
-/* OUTPUT */
-/* */
-/* Completion Status */
-/* */
-/* CALLS */
-/* */
+/* */
+/* This function changes the interface of the DPUMP device */
+/* */
+/* INPUT */
+/* */
+/* command Pointer to dpump command */
+/* */
+/* OUTPUT */
+/* */
+/* Completion Status */
+/* */
+/* CALLS */
+/* */
/* _ux_utility_memory_set Set memory */
/* _ux_device_stack_transfer_all_request_abort */
/* Abort request */
-/* */
-/* CALLED BY */
-/* */
-/* USBX Source Code */
-/* */
-/* RELEASE HISTORY */
-/* */
-/* DATE NAME DESCRIPTION */
-/* */
-/* 05-19-2020 Chaoqiong Xiao Initial Version 6.0 */
-/* 09-30-2020 Chaoqiong Xiao Modified comment(s), */
-/* verified memset and memcpy */
-/* cases, */
-/* resulting in version 6.1 */
-/* 01-31-2022 Chaoqiong Xiao Modified comment(s), */
-/* added standalone support, */
-/* resulting in version 6.1.10 */
-/* 07-29-2022 Chaoqiong Xiao Modified comment(s), */
-/* fixed parameter/variable */
-/* names conflict C++ keyword, */
-/* resulting in version 6.1.12 */
-/* 10-31-2023 Chaoqiong Xiao Modified comment(s), */
-/* added a new mode to manage */
-/* endpoint buffer in classes, */
-/* resulting in version 6.3.0 */
+/* */
+/* CALLED BY */
+/* */
+/* USBX Source Code */
/* */
/**************************************************************************/
UINT _ux_device_class_dpump_change(UX_SLAVE_CLASS_COMMAND *command)
{
-
-UX_SLAVE_INTERFACE *interface_ptr;
+
+UX_SLAVE_INTERFACE *interface_ptr;
UX_SLAVE_CLASS *class_ptr;
UX_SLAVE_CLASS_DPUMP *dpump;
UX_SLAVE_ENDPOINT *endpoint;
@@ -97,30 +77,30 @@ UX_SLAVE_ENDPOINT *endpoint;
/* Get the interface that owns this instance. */
interface_ptr = (UX_SLAVE_INTERFACE *) command -> ux_slave_class_command_interface;
-
+
/* Locate the endpoints. Control and Bulk in/out for data. */
endpoint = interface_ptr -> ux_slave_interface_first_endpoint;
-
+
/* Keep the alternate setting in the dpump structure. */
dpump -> ux_slave_class_dpump_alternate_setting = interface_ptr -> ux_slave_interface_descriptor.bAlternateSetting;
/* If the interface to mount has a non zero alternate setting, the class is really active with
the endpoints active. If the interface reverts to alternate setting 0, it needs to have
the pending transactions terminated. */
- if (interface_ptr -> ux_slave_interface_descriptor.bAlternateSetting != 0)
+ if (interface_ptr -> ux_slave_interface_descriptor.bAlternateSetting != 0)
{
-
+
/* Parse all endpoints. */
while (endpoint != UX_NULL)
{
-
+
/* Check the endpoint direction, and type. */
if ((endpoint -> ux_slave_endpoint_descriptor.bEndpointAddress & UX_ENDPOINT_DIRECTION) == UX_ENDPOINT_IN)
{
-
+
/* Look at type. */
if ((endpoint -> ux_slave_endpoint_descriptor.bmAttributes & UX_MASK_ENDPOINT_TYPE) == UX_BULK_ENDPOINT)
-
+
/* We have found the bulk in endpoint, save it. */
dpump -> ux_slave_class_dpump_bulkin_endpoint = endpoint;
#if UX_DEVICE_ENDPOINT_BUFFER_OWNER == 1
@@ -133,7 +113,7 @@ UX_SLAVE_ENDPOINT *endpoint;
{
/* Look at type for out endpoint. */
if ((endpoint -> ux_slave_endpoint_descriptor.bmAttributes & UX_MASK_ENDPOINT_TYPE) == UX_BULK_ENDPOINT)
-
+
/* We have found the bulk out endpoint, save it. */
dpump -> ux_slave_class_dpump_bulkout_endpoint = endpoint;
#if UX_DEVICE_ENDPOINT_BUFFER_OWNER == 1
@@ -141,8 +121,8 @@ UX_SLAVE_ENDPOINT *endpoint;
ux_slave_transfer_request_data_pointer =
UX_DEVICE_CLASS_DPUMP_READ_BUFFER(dpump);
#endif
- }
-
+ }
+
/* Next endpoint. */
endpoint = endpoint -> ux_slave_endpoint_next_endpoint;
}
@@ -155,9 +135,9 @@ UX_SLAVE_ENDPOINT *endpoint;
return(UX_ERROR);
/* Reset the endpoint buffers. */
- _ux_utility_memory_set(dpump -> ux_slave_class_dpump_bulkout_endpoint -> ux_slave_endpoint_transfer_request.
+ _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); /* Use case of memset is verified. */
- _ux_utility_memory_set(dpump -> ux_slave_class_dpump_bulkin_endpoint -> ux_slave_endpoint_transfer_request.
+ _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); /* Use case of memset is verified. */
/* Keep the alternate setting in the dpump structure. */
@@ -175,7 +155,7 @@ UX_SLAVE_ENDPOINT *endpoint;
/* Invoke the application. */
dpump -> ux_slave_class_dpump_parameter.ux_slave_class_dpump_instance_activate(dpump);
- }
+ }
else
{
diff --git a/common/core/src/ux_device_class_dpump_deactivate.c b/common/core/src/ux_device_class_dpump_deactivate.c
index a826f285..e1b54692 100644
--- a/common/core/src/ux_device_class_dpump_deactivate.c
+++ b/common/core/src/ux_device_class_dpump_deactivate.c
@@ -1,18 +1,19 @@
/***************************************************************************
- * Copyright (c) 2024 Microsoft Corporation
- *
+ * Copyright (c) 2024 Microsoft Corporation
+ * Copyright (c) 2026-present Eclipse ThreadX contributors
+ *
* This program and the accompanying materials are made available under the
* terms of the MIT License which is available at
* https://opensource.org/licenses/MIT.
- *
+ *
* SPDX-License-Identifier: MIT
**************************************************************************/
/**************************************************************************/
/**************************************************************************/
-/** */
-/** USBX Component */
+/** */
+/** USBX Component */
/** */
/** Device Data Pump Class */
/** */
@@ -29,52 +30,40 @@
#include "ux_device_stack.h"
-/**************************************************************************/
-/* */
-/* FUNCTION RELEASE */
-/* */
-/* _ux_device_class_dpump_deactivate PORTABLE C */
+/**************************************************************************/
+/* */
+/* FUNCTION RELEASE */
+/* */
+/* _ux_device_class_dpump_deactivate PORTABLE C */
/* 6.1.12 */
/* AUTHOR */
/* */
/* Chaoqiong Xiao, Microsoft Corporation */
/* */
/* DESCRIPTION */
-/* */
-/* This function deactivate an instance of the dpump class. */
-/* */
-/* INPUT */
-/* */
-/* command Pointer to a class command */
-/* */
-/* OUTPUT */
-/* */
-/* Completion Status */
-/* */
-/* CALLS */
-/* */
-/* _ux_device_stack_transfer_all_request_abort Abort all transfers */
-/* */
-/* CALLED BY */
-/* */
+/* */
+/* This function deactivate an instance of the dpump class. */
+/* */
+/* INPUT */
+/* */
+/* command Pointer to a class command */
+/* */
+/* OUTPUT */
+/* */
+/* Completion Status */
+/* */
+/* CALLS */
+/* */
+/* _ux_device_stack_transfer_all_request_abort Abort all transfers */
+/* */
+/* CALLED BY */
+/* */
/* Device Data Pump Class */
-/* */
-/* RELEASE HISTORY */
-/* */
-/* DATE NAME DESCRIPTION */
-/* */
-/* 05-19-2020 Chaoqiong Xiao Initial Version 6.0 */
-/* 09-30-2020 Chaoqiong Xiao Modified comment(s), */
-/* resulting in version 6.1 */
-/* 07-29-2022 Chaoqiong Xiao Modified comment(s), */
-/* fixed parameter/variable */
-/* names conflict C++ keyword, */
-/* resulting in version 6.1.12 */
/* */
/**************************************************************************/
UINT _ux_device_class_dpump_deactivate(UX_SLAVE_CLASS_COMMAND *command)
{
-
+
UX_SLAVE_INTERFACE *interface_ptr;
UX_SLAVE_CLASS *class_ptr;
UX_SLAVE_CLASS_DPUMP *dpump;
@@ -89,17 +78,17 @@ UX_SLAVE_ENDPOINT *endpoint_out;
/* We need the interface to the class. */
interface_ptr = dpump -> ux_slave_class_dpump_interface;
-
+
/* Locate the endpoints. */
endpoint_in = interface_ptr -> ux_slave_interface_first_endpoint;
-
+
/* Check the endpoint direction, if IN we have the correct endpoint. */
if ((endpoint_in -> ux_slave_endpoint_descriptor.bEndpointAddress & UX_ENDPOINT_DIRECTION) != UX_ENDPOINT_IN)
{
/* Wrong direction, we found the OUT endpoint first. */
endpoint_out = endpoint_in;
-
+
/* So the next endpoint has to be the IN endpoint. */
endpoint_in = endpoint_out -> ux_slave_endpoint_next_endpoint;
}
@@ -109,7 +98,7 @@ UX_SLAVE_ENDPOINT *endpoint_out;
/* We found the endpoint IN first, so next endpoint is OUT. */
endpoint_out = endpoint_in -> ux_slave_endpoint_next_endpoint;
}
-
+
/* Terminate the transactions pending on the endpoints. */
_ux_device_stack_transfer_all_request_abort(endpoint_in, UX_TRANSFER_BUS_RESET);
_ux_device_stack_transfer_all_request_abort(endpoint_out, UX_TRANSFER_BUS_RESET);
@@ -117,14 +106,14 @@ UX_SLAVE_ENDPOINT *endpoint_out;
/* If there is a deactivate function call it. */
if (dpump -> ux_slave_class_dpump_parameter.ux_slave_class_dpump_instance_deactivate != UX_NULL)
{
-
+
/* Invoke the application. */
dpump -> ux_slave_class_dpump_parameter.ux_slave_class_dpump_instance_deactivate(dpump);
}
/* If trace is enabled, insert this event into the trace buffer. */
UX_TRACE_IN_LINE_INSERT(UX_TRACE_DEVICE_CLASS_DPUMP_DEACTIVATE, dpump, 0, 0, 0, UX_TRACE_DEVICE_CLASS_EVENTS, 0, 0)
-
+
/* If trace is enabled, register this object. */
UX_TRACE_OBJECT_UNREGISTER(dpump);
diff --git a/common/core/src/ux_device_class_dpump_entry.c b/common/core/src/ux_device_class_dpump_entry.c
index 70575756..0cfd4ca9 100644
--- a/common/core/src/ux_device_class_dpump_entry.c
+++ b/common/core/src/ux_device_class_dpump_entry.c
@@ -1,18 +1,19 @@
/***************************************************************************
- * Copyright (c) 2024 Microsoft Corporation
- *
+ * Copyright (c) 2024 Microsoft Corporation
+ * Copyright (c) 2026-present Eclipse ThreadX contributors
+ *
* This program and the accompanying materials are made available under the
* terms of the MIT License which is available at
* https://opensource.org/licenses/MIT.
- *
+ *
* SPDX-License-Identifier: MIT
**************************************************************************/
/**************************************************************************/
/**************************************************************************/
-/** */
-/** USBX Component */
+/** */
+/** USBX Component */
/** */
/** Device Data Pump Class */
/** */
@@ -28,49 +29,41 @@
#include "ux_device_class_dpump.h"
-/**************************************************************************/
-/* */
-/* FUNCTION RELEASE */
-/* */
-/* _ux_device_class_dpump_entry PORTABLE C */
+/**************************************************************************/
+/* */
+/* FUNCTION RELEASE */
+/* */
+/* _ux_device_class_dpump_entry PORTABLE C */
/* 6.1 */
/* AUTHOR */
/* */
/* Chaoqiong Xiao, Microsoft Corporation */
/* */
/* DESCRIPTION */
-/* */
-/* This function is the entry point of the device dpump class. It */
-/* will be called by the device stack enumeration module when the */
+/* */
+/* This function is the entry point of the device dpump class. It */
+/* will be called by the device stack enumeration module when the */
/* host has sent a SET_CONFIGURATION command and the dpump interface */
/* needs to be mounted. */
-/* */
-/* INPUT */
-/* */
-/* command Pointer to class command */
-/* */
-/* OUTPUT */
-/* */
-/* Completion Status */
-/* */
-/* CALLS */
-/* */
+/* */
+/* INPUT */
+/* */
+/* command Pointer to class command */
+/* */
+/* OUTPUT */
+/* */
+/* Completion Status */
+/* */
+/* CALLS */
+/* */
/* _ux_device_class_dpump_initialize Initialize dpump class */
-/* _ux_device_class_dpump_activate Activate dpump class */
-/* _ux_device_class_dpump_deactivate Deactivate dpump class */
+/* _ux_device_class_dpump_activate Activate dpump class */
+/* _ux_device_class_dpump_deactivate Deactivate dpump class */
/* _ux_device_class_dpump_change Alternate setting change */
-/* */
-/* CALLED BY */
-/* */
+/* */
+/* CALLED BY */
+/* */
/* Device Data Pump Class */
-/* */
-/* RELEASE HISTORY */
-/* */
-/* DATE NAME DESCRIPTION */
-/* */
-/* 05-19-2020 Chaoqiong Xiao Initial Version 6.0 */
-/* 09-30-2020 Chaoqiong Xiao Modified comment(s), */
-/* resulting in version 6.1 */
/* */
/**************************************************************************/
UINT _ux_device_class_dpump_entry(UX_SLAVE_CLASS_COMMAND *command)
@@ -88,7 +81,7 @@ UINT status;
/* Call the init function of the DPUMP class. */
status = _ux_device_class_dpump_initialize(command);
-
+
/* Return the completion status. */
return(status);
@@ -118,13 +111,13 @@ UINT status;
/* Return the completion status. */
return(status);
-
+
case UX_SLAVE_CLASS_COMMAND_DEACTIVATE:
/* The deactivate command is used when the device has been extracted.
The device endpoints have to be dismounted and the dpump thread canceled. */
status = _ux_device_class_dpump_deactivate(command);
-
+
/* Return the completion status. */
return(status);
@@ -133,7 +126,7 @@ UINT status;
/* Return the completion status. */
return(UX_SUCCESS);
- default:
+ default:
/* Error trap. */
_ux_system_error_handler(UX_SYSTEM_LEVEL_THREAD, UX_SYSTEM_CONTEXT_CLASS, UX_FUNCTION_NOT_SUPPORTED);
@@ -143,6 +136,6 @@ UINT status;
/* Return an error. */
return(UX_FUNCTION_NOT_SUPPORTED);
- }
+ }
}
diff --git a/common/core/src/ux_device_class_dpump_initialize.c b/common/core/src/ux_device_class_dpump_initialize.c
index 310d3c47..713c5671 100644
--- a/common/core/src/ux_device_class_dpump_initialize.c
+++ b/common/core/src/ux_device_class_dpump_initialize.c
@@ -1,18 +1,19 @@
/***************************************************************************
- * Copyright (c) 2024 Microsoft Corporation
- *
+ * Copyright (c) 2024 Microsoft Corporation
+ * Copyright (c) 2026-present Eclipse ThreadX contributors
+ *
* This program and the accompanying materials are made available under the
* terms of the MIT License which is available at
* https://opensource.org/licenses/MIT.
- *
+ *
* SPDX-License-Identifier: MIT
**************************************************************************/
/**************************************************************************/
/**************************************************************************/
-/** */
-/** USBX Component */
+/** */
+/** USBX Component */
/** */
/** Device Data Pump Class */
/** */
@@ -28,56 +29,40 @@
#include "ux_device_class_dpump.h"
-/**************************************************************************/
-/* */
-/* FUNCTION RELEASE */
-/* */
-/* _ux_device_class_dpump_initialize PORTABLE C */
+/**************************************************************************/
+/* */
+/* FUNCTION RELEASE */
+/* */
+/* _ux_device_class_dpump_initialize PORTABLE C */
/* 6.3.0 */
/* AUTHOR */
/* */
/* Chaoqiong Xiao, Microsoft Corporation */
/* */
/* DESCRIPTION */
-/* */
-/* This function initializes the USB dpump device. */
-/* */
-/* INPUT */
-/* */
-/* command Pointer to dpump command */
-/* */
-/* OUTPUT */
-/* */
-/* Completion Status */
-/* */
-/* CALLS */
-/* */
+/* */
+/* This function initializes the USB dpump device. */
+/* */
+/* INPUT */
+/* */
+/* command Pointer to dpump command */
+/* */
+/* OUTPUT */
+/* */
+/* Completion Status */
+/* */
+/* CALLS */
+/* */
/* _ux_utility_memory_allocate Allocate memory */
-/* */
-/* CALLED BY */
-/* */
-/* Device Data Pump Class */
-/* */
-/* RELEASE HISTORY */
-/* */
-/* DATE NAME DESCRIPTION */
-/* */
-/* 05-19-2020 Chaoqiong Xiao Initial Version 6.0 */
-/* 09-30-2020 Chaoqiong Xiao Modified comment(s), */
-/* resulting in version 6.1 */
-/* 07-29-2022 Chaoqiong Xiao Modified comment(s), */
-/* fixed parameter/variable */
-/* names conflict C++ keyword, */
-/* resulting in version 6.1.12 */
-/* 10-31-2023 Chaoqiong Xiao Modified comment(s), */
-/* added a new mode to manage */
-/* endpoint buffer in classes, */
-/* resulting in version 6.3.0 */
+/* */
+/* CALLED BY */
+/* */
+/* Device Data Pump Class */
/* */
/**************************************************************************/
UINT _ux_device_class_dpump_initialize(UX_SLAVE_CLASS_COMMAND *command)
{
-
+
UX_SLAVE_CLASS_DPUMP *dpump;
UX_SLAVE_CLASS *class_ptr;
UX_SLAVE_CLASS_DPUMP_PARAMETER *dpump_parameter;
diff --git a/common/core/src/ux_device_class_dpump_read.c b/common/core/src/ux_device_class_dpump_read.c
index 223aeb74..f6712fe4 100644
--- a/common/core/src/ux_device_class_dpump_read.c
+++ b/common/core/src/ux_device_class_dpump_read.c
@@ -1,17 +1,18 @@
/***************************************************************************
- * Copyright (c) 2024 Microsoft Corporation
- *
+ * Copyright (c) 2024 Microsoft Corporation
+ * Copyright (c) 2026-present Eclipse ThreadX contributors
+ *
* This program and the accompanying materials are made available under the
* terms of the MIT License which is available at
* https://opensource.org/licenses/MIT.
- *
+ *
* SPDX-License-Identifier: MIT
**************************************************************************/
/**************************************************************************/
/**************************************************************************/
-/** */
-/** USBX Component */
+/** */
+/** USBX Component */
/** */
/** Device DPUMP Class */
/** */
@@ -28,54 +29,40 @@
#include "ux_device_stack.h"
-/**************************************************************************/
-/* */
-/* FUNCTION RELEASE */
-/* */
-/* _ux_device_class_dpump_read PORTABLE C */
+/**************************************************************************/
+/* */
+/* FUNCTION RELEASE */
+/* */
+/* _ux_device_class_dpump_read PORTABLE C */
/* 6.3.0 */
/* AUTHOR */
/* */
/* Chaoqiong Xiao, Microsoft Corporation */
/* */
/* DESCRIPTION */
-/* */
-/* This function reads from the DPUMP class. */
-/* */
-/* INPUT */
-/* */
-/* dpump Address of dpump class */
-/* instance */
-/* */
-/* OUTPUT */
-/* */
-/* None */
-/* */
-/* CALLS */
-/* */
-/* _ux_device_stack_transfer_request Request transfer */
-/* _ux_utility_memory_copy Copy memory */
-/* */
-/* CALLED BY */
-/* */
-/* ThreadX */
-/* */
-/* RELEASE HISTORY */
-/* */
-/* DATE NAME DESCRIPTION */
-/* */
-/* 05-19-2020 Chaoqiong Xiao Initial Version 6.0 */
-/* 09-30-2020 Chaoqiong Xiao Modified comment(s), */
-/* verified memset and memcpy */
-/* cases, */
-/* resulting in version 6.1 */
-/* 10-31-2023 Chaoqiong Xiao Modified comment(s), */
-/* added a new mode to manage */
-/* endpoint buffer in classes, */
-/* resulting in version 6.3.0 */
+/* */
+/* This function reads from the DPUMP class. */
+/* */
+/* INPUT */
+/* */
+/* dpump Address of dpump class */
+/* instance */
+/* */
+/* OUTPUT */
+/* */
+/* None */
+/* */
+/* CALLS */
+/* */
+/* _ux_device_stack_transfer_request Request transfer */
+/* _ux_utility_memory_copy Copy memory */
+/* */
+/* CALLED BY */
+/* */
+/* ThreadX */
/* */
/**************************************************************************/
-UINT _ux_device_class_dpump_read(UX_SLAVE_CLASS_DPUMP *dpump, UCHAR *buffer,
+UINT _ux_device_class_dpump_read(UX_SLAVE_CLASS_DPUMP *dpump, UCHAR *buffer,
ULONG requested_length, ULONG *actual_length)
{
@@ -87,14 +74,14 @@ ULONG local_requested_length;
/* If trace is enabled, insert this event into the trace buffer. */
UX_TRACE_IN_LINE_INSERT(UX_TRACE_DEVICE_CLASS_DPUMP_READ, dpump, buffer, requested_length, 0, UX_TRACE_DEVICE_CLASS_EVENTS, 0, 0)
-
+
/* Get the pointer to the device. */
device = &_ux_system_slave -> ux_system_slave_device;
-
+
/* As long as the device is in the CONFIGURED state. */
if (device -> ux_slave_device_state != UX_DEVICE_CONFIGURED)
- {
-
+ {
+
/* Error trap. */
_ux_system_error_handler(UX_SYSTEM_LEVEL_THREAD, UX_SYSTEM_CONTEXT_CLASS, UX_CONFIGURATION_HANDLE_UNKNOWN);
@@ -104,10 +91,10 @@ ULONG local_requested_length;
/* Cannot proceed with command, the interface is down. */
return(UX_CONFIGURATION_HANDLE_UNKNOWN);
}
-
+
/* Locate the OUT endpoint. */
endpoint = dpump -> ux_slave_class_dpump_bulkout_endpoint;
-
+
/* Check endpoint. If NULL, we have not yet received the proper SET_INTERFACE command. */
if (endpoint == UX_NULL)
{
@@ -116,61 +103,61 @@ ULONG local_requested_length;
return(UX_ENDPOINT_HANDLE_UNKNOWN);
}
-
+
/* All DPUMP reading are on the endpoint OUT, from the host. */
transfer_request = &endpoint -> ux_slave_endpoint_transfer_request;
-
+
/* Reset the actual length. */
*actual_length = 0;
-
+
/* Set return status to SUCCESS to make certain compilers happy. */
status = UX_SUCCESS;
-
+
/* Check if we need more transactions. */
while (device -> ux_slave_device_state == UX_DEVICE_CONFIGURED && requested_length != 0)
- {
-
+ {
+
/* Check if we have enough in the local buffer. */
if (requested_length > UX_DEVICE_CLASS_DPUMP_READ_BUFFER_SIZE)
-
+
/* We have too much to transfer. */
local_requested_length = UX_DEVICE_CLASS_DPUMP_READ_BUFFER_SIZE;
-
+
else
-
+
/* We can proceed with the demanded length. */
local_requested_length = requested_length;
-
+
/* Send the request to the device controller. */
status = _ux_device_stack_transfer_request(transfer_request, local_requested_length, local_requested_length);
-
- /* Check the status */
+
+ /* Check the status */
if (status == UX_SUCCESS)
{
/* We need to copy the buffer locally. */
- _ux_utility_memory_copy(buffer, transfer_request -> ux_slave_transfer_request_data_pointer,
+ _ux_utility_memory_copy(buffer, transfer_request -> ux_slave_transfer_request_data_pointer,
local_requested_length); /* Use case of memcpy is verified. */
-
+
/* Next buffer address. */
buffer += transfer_request -> ux_slave_transfer_request_actual_length;
-
+
/* Set the length actually received. */
- *actual_length += transfer_request -> ux_slave_transfer_request_actual_length;
-
+ *actual_length += transfer_request -> ux_slave_transfer_request_actual_length;
+
/* Decrement what left has to be done. */
requested_length -= transfer_request -> ux_slave_transfer_request_actual_length;
-
+
}
else
-
+
/* We got an error. */
return(status);
}
/* Check why we got here, either completion or device was extracted. */
if (device -> ux_slave_device_state != UX_DEVICE_CONFIGURED)
- {
+ {
/* Error trap. */
_ux_system_error_handler(UX_SYSTEM_LEVEL_THREAD, UX_SYSTEM_CONTEXT_CLASS, UX_TRANSFER_NO_ANSWER);
@@ -182,8 +169,8 @@ ULONG local_requested_length;
return (UX_TRANSFER_NO_ANSWER);
}
else
-
+
/* Simply return the last transaction result. */
- return(status);
+ return(status);
}
diff --git a/common/core/src/ux_device_class_dpump_read_run.c b/common/core/src/ux_device_class_dpump_read_run.c
index c47045b0..581f5313 100644
--- a/common/core/src/ux_device_class_dpump_read_run.c
+++ b/common/core/src/ux_device_class_dpump_read_run.c
@@ -1,10 +1,11 @@
/***************************************************************************
- * Copyright (c) 2024 Microsoft Corporation
- *
+ * Copyright (c) 2024 Microsoft Corporation
+ * Copyright (c) 2026-present Eclipse ThreadX contributors
+ *
* This program and the accompanying materials are made available under the
* terms of the MIT License which is available at
* https://opensource.org/licenses/MIT.
- *
+ *
* SPDX-License-Identifier: MIT
**************************************************************************/
@@ -72,16 +73,6 @@
/* */
/* Application */
/* */
-/* RELEASE HISTORY */
-/* */
-/* DATE NAME DESCRIPTION */
-/* */
-/* 01-31-2022 Chaoqiong Xiao Initial Version 6.1.10 */
-/* 10-31-2023 Chaoqiong Xiao Modified comment(s), */
-/* added a new mode to manage */
-/* endpoint buffer in classes, */
-/* resulting in version 6.3.0 */
-/* */
/**************************************************************************/
UINT _ux_device_class_dpump_read_run(UX_SLAVE_CLASS_DPUMP *dpump, UCHAR *buffer,
ULONG requested_length, ULONG *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 f4deb915..5ffe4447 100644
--- a/common/core/src/ux_device_class_dpump_thread.c
+++ b/common/core/src/ux_device_class_dpump_thread.c
@@ -1,18 +1,19 @@
/***************************************************************************
- * Copyright (c) 2024 Microsoft Corporation
- *
+ * Copyright (c) 2024 Microsoft Corporation
+ * Copyright (c) 2026-present Eclipse ThreadX contributors
+ *
* This program and the accompanying materials are made available under the
* terms of the MIT License which is available at
* https://opensource.org/licenses/MIT.
- *
+ *
* SPDX-License-Identifier: MIT
**************************************************************************/
/**************************************************************************/
/**************************************************************************/
-/** */
-/** USBX Component */
+/** */
+/** USBX Component */
/** */
/** Device Data Pump Class */
/** */
@@ -31,57 +32,40 @@
/* Remove compiling warning. */
VOID _ux_device_class_dpump_thread(ULONG dpump_class);
-/**************************************************************************/
-/* */
-/* FUNCTION RELEASE */
-/* */
-/* _ux_device_class_dpump_thread PORTABLE C */
+/**************************************************************************/
+/* */
+/* FUNCTION RELEASE */
+/* */
+/* _ux_device_class_dpump_thread PORTABLE C */
/* 6.1.12 */
/* AUTHOR */
/* */
/* Chaoqiong Xiao, Microsoft Corporation */
/* */
/* DESCRIPTION */
-/* */
-/* This function is the thread of the dpump class. */
+/* */
+/* This function is the thread of the dpump class. */
/* */
/* It's for RTOS mode. */
-/* */
-/* INPUT */
-/* */
-/* class Address of dpump class */
-/* container */
-/* */
-/* OUTPUT */
-/* */
-/* None */
-/* */
-/* CALLS */
-/* */
-/* _ux_device_stack_transfer_request Request transfer */
-/* _ux_utility_memory_copy Copy memory */
-/* _ux_utility_thread_suspend Suspend thread */
-/* */
-/* CALLED BY */
-/* */
-/* ThreadX */
-/* */
-/* RELEASE HISTORY */
-/* */
-/* DATE NAME DESCRIPTION */
-/* */
-/* 05-19-2020 Chaoqiong Xiao Initial Version 6.0 */
-/* 09-30-2020 Chaoqiong Xiao Modified comment(s), */
-/* verified memset and memcpy */
-/* cases, */
-/* resulting in version 6.1 */
-/* 01-31-2022 Chaoqiong Xiao Modified comment(s), */
-/* refined macros names, */
-/* resulting in version 6.1.10 */
-/* 07-29-2022 Chaoqiong Xiao Modified comment(s), */
-/* fixed parameter/variable */
-/* names conflict C++ keyword, */
-/* resulting in version 6.1.12 */
+/* */
+/* INPUT */
+/* */
+/* class Address of dpump class */
+/* container */
+/* */
+/* OUTPUT */
+/* */
+/* None */
+/* */
+/* CALLS */
+/* */
+/* _ux_device_stack_transfer_request Request transfer */
+/* _ux_utility_memory_copy Copy memory */
+/* _ux_utility_thread_suspend Suspend thread */
+/* */
+/* CALLED BY */
+/* */
+/* ThreadX */
/* */
/**************************************************************************/
VOID _ux_device_class_dpump_thread(ULONG dpump_class)
@@ -103,26 +87,26 @@ ULONG length;
/* Cast properly the dpump instance. */
UX_THREAD_EXTENSION_PTR_GET(class_ptr, UX_SLAVE_CLASS, dpump_class)
-
+
/* Get the dpump instance from this class container. */
dpump = (UX_SLAVE_CLASS_DPUMP *) class_ptr -> ux_slave_class_instance;
-
+
/* Get the pointer to the device. */
device = &_ux_system_slave -> ux_system_slave_device;
-
+
/* This is the first time we are activated. We need the interface to the class. */
interface_ptr = dpump -> ux_slave_class_dpump_interface;
-
+
/* Locate the endpoints. */
endpoint_in = interface_ptr -> ux_slave_interface_first_endpoint;
-
+
/* Check the endpoint direction, if IN we have the correct endpoint. */
if ((endpoint_in -> ux_slave_endpoint_descriptor.bEndpointAddress & UX_ENDPOINT_DIRECTION) != UX_ENDPOINT_IN)
{
/* Wrong direction, we found the OUT endpoint first. */
endpoint_out = endpoint_in;
-
+
/* So the next endpoint has to be the IN endpoint. */
endpoint_in = endpoint_out -> ux_slave_endpoint_next_endpoint;
}
@@ -132,18 +116,18 @@ ULONG length;
/* We found the endpoint IN first, so next endpoint is OUT. */
endpoint_out = endpoint_in -> ux_slave_endpoint_next_endpoint;
}
-
+
/* As long as the device is in the CONFIGURED state. */
while (device -> ux_slave_device_state == UX_DEVICE_CONFIGURED)
- {
-
+ {
+
/* We prepare to receive from the host on the OUT endpoint. */
transfer_request = &endpoint_out -> ux_slave_endpoint_transfer_request;
-
+
/* Send the request to the device controller. */
status = _ux_device_stack_transfer_request(transfer_request, UX_DEVICE_CLASS_DPUMP_PACKET_SIZE, UX_DEVICE_CLASS_DPUMP_PACKET_SIZE);
-
- /* Check the status */
+
+ /* Check the status */
if (status == UX_SUCCESS)
{
@@ -157,10 +141,10 @@ ULONG length;
/* Now we send the packet back to the host. On the endpoint In. */
transfer_request = &endpoint_in -> ux_slave_endpoint_transfer_request;
-
+
/* Sends the data payload back to the caller. */
status = _ux_device_stack_transfer_request(transfer_request, length, length);
-
+
/* Check error code. */
if (status != UX_SUCCESS)
@@ -169,7 +153,7 @@ ULONG length;
}
}
- /* We need to suspend ourselves. We will be resumed by the
+ /* We need to suspend ourselves. We will be resumed by the
device enumeration module. */
_ux_device_thread_suspend(&class_ptr -> ux_slave_class_thread);
}
diff --git a/common/core/src/ux_device_class_dpump_write.c b/common/core/src/ux_device_class_dpump_write.c
index 0bacc93b..cebe1be1 100644
--- a/common/core/src/ux_device_class_dpump_write.c
+++ b/common/core/src/ux_device_class_dpump_write.c
@@ -1,17 +1,18 @@
/***************************************************************************
- * Copyright (c) 2024 Microsoft Corporation
- *
+ * Copyright (c) 2024 Microsoft Corporation
+ * Copyright (c) 2026-present Eclipse ThreadX contributors
+ *
* This program and the accompanying materials are made available under the
* terms of the MIT License which is available at
* https://opensource.org/licenses/MIT.
- *
+ *
* SPDX-License-Identifier: MIT
**************************************************************************/
/**************************************************************************/
/**************************************************************************/
-/** */
-/** USBX Component */
+/** */
+/** USBX Component */
/** */
/** Device DPUMP Class */
/** */
@@ -28,54 +29,40 @@
#include "ux_device_stack.h"
-/**************************************************************************/
-/* */
-/* FUNCTION RELEASE */
-/* */
-/* _ux_device_class_dpump_write PORTABLE C */
+/**************************************************************************/
+/* */
+/* FUNCTION RELEASE */
+/* */
+/* _ux_device_class_dpump_write PORTABLE C */
/* 6.3.0 */
/* AUTHOR */
/* */
/* Chaoqiong Xiao, Microsoft Corporation */
/* */
/* DESCRIPTION */
-/* */
-/* This function writes to the DPUMP class. */
-/* */
-/* INPUT */
-/* */
-/* dpump Address of dpump class */
-/* instance */
-/* */
-/* OUTPUT */
-/* */
-/* None */
-/* */
-/* CALLS */
-/* */
-/* _ux_utility_memory_copy */
-/* _ux_device_stack_transfer_request */
-/* */
-/* CALLED BY */
-/* */
-/* ThreadX */
-/* */
-/* RELEASE HISTORY */
-/* */
-/* DATE NAME DESCRIPTION */
-/* */
-/* 05-19-2020 Chaoqiong Xiao Initial Version 6.0 */
-/* 09-30-2020 Chaoqiong Xiao Modified comment(s), */
-/* verified memset and memcpy */
-/* cases, */
-/* resulting in version 6.1 */
-/* 10-31-2023 Chaoqiong Xiao Modified comment(s), */
-/* added a new mode to manage */
-/* endpoint buffer in classes, */
-/* resulting in version 6.3.0 */
+/* */
+/* This function writes to the DPUMP class. */
+/* */
+/* INPUT */
+/* */
+/* dpump Address of dpump class */
+/* instance */
+/* */
+/* OUTPUT */
+/* */
+/* None */
+/* */
+/* CALLS */
+/* */
+/* _ux_utility_memory_copy */
+/* _ux_device_stack_transfer_request */
+/* */
+/* CALLED BY */
+/* */
+/* ThreadX */
/* */
/**************************************************************************/
-UINT _ux_device_class_dpump_write(UX_SLAVE_CLASS_DPUMP *dpump, UCHAR *buffer,
+UINT _ux_device_class_dpump_write(UX_SLAVE_CLASS_DPUMP *dpump, UCHAR *buffer,
ULONG requested_length, ULONG *actual_length)
{
@@ -84,13 +71,13 @@ UX_SLAVE_DEVICE *device;
UX_SLAVE_TRANSFER *transfer_request;
ULONG local_requested_length;
UINT status;
-
+
/* If trace is enabled, insert this event into the trace buffer. */
UX_TRACE_IN_LINE_INSERT(UX_TRACE_DEVICE_CLASS_DPUMP_WRITE, dpump, buffer, requested_length, 0, UX_TRACE_DEVICE_CLASS_EVENTS, 0, 0)
-
+
/* Get the pointer to the device. */
device = &_ux_system_slave -> ux_system_slave_device;
-
+
/* As long as the device is in the CONFIGURED state. */
if (device -> ux_slave_device_state != UX_DEVICE_CONFIGURED)
{
@@ -104,20 +91,20 @@ UINT status;
/* Cannot proceed with command, the interface is down. */
return(UX_CONFIGURATION_HANDLE_UNKNOWN);
}
-
+
/* Locate the IN endpoint. */
endpoint = dpump -> ux_slave_class_dpump_bulkin_endpoint;
-
+
/* Check endpoint. If NULL, we have not yet received the proper SET_INTERFACE command. */
if (endpoint == UX_NULL)
- {
+ {
/* Error trap. */
_ux_system_error_handler(UX_SYSTEM_LEVEL_THREAD, UX_SYSTEM_CONTEXT_CLASS, UX_ENDPOINT_HANDLE_UNKNOWN);
return(UX_ENDPOINT_HANDLE_UNKNOWN);
}
-
+
/* We are writing to the IN endpoint. */
transfer_request = &endpoint -> ux_slave_endpoint_transfer_request;
@@ -126,31 +113,31 @@ UINT status;
/* Set return status to SUCCESS to make certain compilers happy. */
status = UX_SUCCESS;
-
+
/* Check if we need more transactions. */
while (device -> ux_slave_device_state == UX_DEVICE_CONFIGURED && requested_length != 0)
- {
+ {
/* Check if we have enough in the local buffer. */
if (requested_length > UX_DEVICE_CLASS_DPUMP_WRITE_BUFFER_SIZE)
/* We have too much to transfer. */
local_requested_length = UX_DEVICE_CLASS_DPUMP_WRITE_BUFFER_SIZE;
-
+
else
-
+
/* We can proceed with the demanded length. */
local_requested_length = requested_length;
-
+
/* 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,
+ _ux_utility_memory_copy(transfer_request -> ux_slave_transfer_request_data_pointer,
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);
-
- /* Check the status */
+
+ /* Check the status */
if (status == UX_SUCCESS)
{
@@ -158,22 +145,22 @@ UINT status;
buffer += transfer_request -> ux_slave_transfer_request_actual_length;
/* Set the length actually received. */
- *actual_length += transfer_request -> ux_slave_transfer_request_actual_length;
+ *actual_length += transfer_request -> ux_slave_transfer_request_actual_length;
/* Decrement what left has to be done. */
requested_length -= transfer_request -> ux_slave_transfer_request_actual_length;
}
-
+
else
-
+
/* We had an error, abort. */
return(status);
}
/* Check why we got here, either completion or device was extracted. */
if (device -> ux_slave_device_state != UX_DEVICE_CONFIGURED)
- {
+ {
/* Error trap. */
_ux_system_error_handler(UX_SYSTEM_LEVEL_THREAD, UX_SYSTEM_CONTEXT_CLASS, UX_TRANSFER_NO_ANSWER);
@@ -185,9 +172,9 @@ UINT status;
return (UX_TRANSFER_NO_ANSWER);
}
else
-
+
/* Simply return the last transaction result. */
- return(status);
-
+ return(status);
+
}
diff --git a/common/core/src/ux_device_class_dpump_write_run.c b/common/core/src/ux_device_class_dpump_write_run.c
index 55611b6c..da41ecb3 100644
--- a/common/core/src/ux_device_class_dpump_write_run.c
+++ b/common/core/src/ux_device_class_dpump_write_run.c
@@ -1,10 +1,11 @@
/***************************************************************************
- * Copyright (c) 2024 Microsoft Corporation
- *
+ * Copyright (c) 2024 Microsoft Corporation
+ * Copyright (c) 2026-present Eclipse ThreadX contributors
+ *
* This program and the accompanying materials are made available under the
* terms of the MIT License which is available at
* https://opensource.org/licenses/MIT.
- *
+ *
* SPDX-License-Identifier: MIT
**************************************************************************/
@@ -72,16 +73,6 @@
/* */
/* Application */
/* */
-/* RELEASE HISTORY */
-/* */
-/* DATE NAME DESCRIPTION */
-/* */
-/* 01-31-2022 Chaoqiong Xiao Initial Version 6.1.10 */
-/* 10-31-2023 Chaoqiong Xiao Modified comment(s), */
-/* added a new mode to manage */
-/* endpoint buffer in classes, */
-/* resulting in version 6.3.0 */
-/* */
/**************************************************************************/
UINT _ux_device_class_dpump_write_run(UX_SLAVE_CLASS_DPUMP *dpump, UCHAR *buffer,
ULONG requested_length, ULONG *actual_length)
@@ -176,7 +167,7 @@ UINT read_state;
/* 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,
+ _ux_utility_memory_copy(transfer_request -> ux_slave_transfer_request_data_pointer,
dpump -> ux_device_class_dpump_write_buffer,
dpump -> ux_device_class_dpump_write_transfer_length); /* Use case of memcpy is verified. */
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 96a4f5f6..8d281970 100644
--- a/common/core/src/ux_device_stack_alternate_setting_get.c
+++ b/common/core/src/ux_device_stack_alternate_setting_get.c
@@ -1,18 +1,19 @@
/***************************************************************************
- * Copyright (c) 2024 Microsoft Corporation
- *
+ * Copyright (c) 2024 Microsoft Corporation
+ * Copyright (c) 2026-present Eclipse ThreadX contributors
+ *
* This program and the accompanying materials are made available under the
* terms of the MIT License which is available at
* https://opensource.org/licenses/MIT.
- *
+ *
* SPDX-License-Identifier: MIT
**************************************************************************/
/**************************************************************************/
/**************************************************************************/
-/** */
-/** USBX Component */
+/** */
+/** USBX Component */
/** */
/** Device Stack */
/** */
@@ -49,30 +50,16 @@
/* */
/* OUTPUT */
/* */
-/* Completion Status */
+/* Completion Status */
+/* */
+/* CALLS */
/* */
-/* CALLS */
-/* */
/* _ux_device_stack_transfer_request Process transfer request */
-/* */
-/* CALLED BY */
-/* */
-/* Application */
+/* */
+/* CALLED BY */
+/* */
+/* Application */
/* Device Stack */
-/* */
-/* 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 */
-/* 07-29-2022 Chaoqiong Xiao Modified comment(s), */
-/* fixed parameter/variable */
-/* names conflict C++ keyword, */
-/* resulting in version 6.1.12 */
/* */
/**************************************************************************/
UINT _ux_device_stack_alternate_setting_get(ULONG interface_value)
@@ -83,7 +70,7 @@ UX_SLAVE_INTERFACE *interface_ptr;
UX_SLAVE_DEVICE *device;
UX_SLAVE_ENDPOINT *endpoint;
UINT status;
-
+
/* If trace is enabled, insert this event into the trace buffer. */
UX_TRACE_IN_LINE_INSERT(UX_TRACE_DEVICE_STACK_ALTERNATE_SETTING_GET, interface_value, 0, 0, 0, UX_TRACE_DEVICE_STACK_EVENTS, 0, 0)
@@ -110,7 +97,7 @@ UINT status;
if (interface_ptr -> ux_slave_interface_descriptor.bInterfaceNumber == interface_value)
{
- /* Get the control endpoint of the device. */
+ /* Get the control endpoint of the device. */
endpoint = &device -> ux_slave_device_control_endpoint;
/* Get the pointer to the transfer request associated with the endpoint. */
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 69bc7972..8677655c 100644
--- a/common/core/src/ux_device_stack_alternate_setting_set.c
+++ b/common/core/src/ux_device_stack_alternate_setting_set.c
@@ -1,18 +1,19 @@
/***************************************************************************
- * Copyright (c) 2024 Microsoft Corporation
- *
+ * Copyright (c) 2024 Microsoft Corporation
+ * Copyright (c) 2026-present Eclipse ThreadX contributors
+ *
* This program and the accompanying materials are made available under the
* terms of the MIT License which is available at
* https://opensource.org/licenses/MIT.
- *
+ *
* SPDX-License-Identifier: MIT
**************************************************************************/
/**************************************************************************/
/**************************************************************************/
-/** */
-/** USBX Component */
+/** */
+/** USBX Component */
/** */
/** Device Stack */
/** */
@@ -52,38 +53,20 @@
/* */
/* OUTPUT */
/* */
-/* Completion Status */
+/* Completion Status */
+/* */
+/* CALLS */
/* */
-/* CALLS */
-/* */
-/* (ux_slave_dcd_function) DCD dispatch function */
+/* (ux_slave_dcd_function) DCD dispatch function */
/* _ux_utility_descriptor_parse Parse descriptor */
/* _ux_device_stack_transfer_all_request_abort */
/* Abort transfer */
/* _ux_utility_memory_copy Copy memory */
-/* */
-/* CALLED BY */
-/* */
-/* Application */
+/* */
+/* CALLED BY */
+/* */
+/* Application */
/* Device Stack */
-/* */
-/* 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 */
-/* 10-15-2021 Chaoqiong Xiao Modified comment(s), */
-/* calculated payload size, */
-/* resulting in version 6.1.9 */
-/* 07-29-2022 Chaoqiong Xiao Modified comment(s), */
-/* fixed parameter/variable */
-/* names conflict C++ keyword, */
-/* resulting in version 6.1.12 */
/* */
/**************************************************************************/
UINT _ux_device_stack_alternate_setting_set(ULONG interface_value, ULONG alternate_setting_value)
@@ -155,7 +138,7 @@ ULONG max_transfer_length, n_trans;
/* If the host is requesting a change of alternate setting to the current one,
we do not need to do any work. */
if (interface_ptr -> ux_slave_interface_descriptor.bAlternateSetting == alternate_setting_value)
- return(UX_SUCCESS);
+ return(UX_SUCCESS);
#if defined(UX_DEVICE_ALTERNATE_SETTING_SUPPORT_DISABLE)
@@ -184,7 +167,7 @@ ULONG max_transfer_length, n_trans;
/* And its length. */
descriptor_type =* (device_framework + 1);
-
+
/* Check if this is a configuration descriptor. */
if (descriptor_type == UX_CONFIGURATION_DESCRIPTOR_ITEM)
{
@@ -202,7 +185,7 @@ ULONG max_transfer_length, n_trans;
/* Limit the search in current configuration descriptor. */
device_framework_length = configuration_descriptor.wTotalLength;
- /* We have found the configuration value that was selected by the host
+ /* We have found the configuration value that was selected by the host
We need to scan all the interface descriptors following this
configuration descriptor and locate the interface for which the alternate
setting must be changed. */
@@ -213,8 +196,8 @@ ULONG max_transfer_length, n_trans;
descriptor_length = (ULONG) *device_framework;
/* And its type. */
- descriptor_type = *(device_framework + 1);
-
+ descriptor_type = *(device_framework + 1);
+
/* Check if this is an interface descriptor. */
if (descriptor_type == UX_INTERFACE_DESCRIPTOR_ITEM)
{
@@ -245,16 +228,16 @@ ULONG max_transfer_length, n_trans;
/* Get the next endpoint. */
next_endpoint = endpoint -> ux_slave_endpoint_next_endpoint;
-
+
/* Free the endpoint. */
endpoint -> ux_slave_endpoint_status = UX_UNUSED;
-
+
/* Make sure the endpoint instance is now cleaned up. */
endpoint -> ux_slave_endpoint_state = 0;
endpoint -> ux_slave_endpoint_next_endpoint = UX_NULL;
endpoint -> ux_slave_endpoint_interface = UX_NULL;
endpoint -> ux_slave_endpoint_device = UX_NULL;
-
+
/* Now we refresh the endpoint pointer. */
endpoint = next_endpoint;
}
@@ -265,24 +248,24 @@ ULONG max_transfer_length, n_trans;
/* Point beyond the interface descriptor. */
device_framework_length -= (ULONG) *device_framework;
device_framework += (ULONG) *device_framework;
-
+
/* Parse the device framework and locate endpoint descriptor(s). */
while (device_framework_length != 0)
{
-
+
/* Get the length of the current descriptor. */
descriptor_length = (ULONG) *device_framework;
-
+
/* And its type. */
descriptor_type = *(device_framework + 1);
-
+
/* Check if this is an endpoint descriptor. */
switch(descriptor_type)
{
-
+
case UX_ENDPOINT_DESCRIPTOR_ITEM:
-
- /* Find a free endpoint in the pool and hook it to the
+
+ /* Find a free endpoint in the pool and hook it to the
existing interface after it's created by DCD. */
endpoint = device -> ux_slave_device_endpoints_pool;
endpoints_pool_number = device -> ux_slave_device_endpoints_pool_number;
@@ -295,14 +278,14 @@ ULONG max_transfer_length, n_trans;
endpoint -> ux_slave_endpoint_status = UX_USED;
break;
}
-
+
/* Try the next endpoint. */
endpoint++;
-
+
/* Decrement the number of endpoints to scan from the pool. */
- endpoints_pool_number--;
+ endpoints_pool_number--;
}
-
+
/* Did we find a free endpoint ? */
if (endpoints_pool_number == 0)
return(UX_MEMORY_INSUFFICIENT);
@@ -315,7 +298,7 @@ ULONG max_transfer_length, n_trans;
/* Now we create a transfer request to accept transfer on this endpoint. */
transfer_request = &endpoint -> ux_slave_endpoint_transfer_request;
-
+
/* Validate descriptor wMaxPacketSize. */
UX_ASSERT(endpoint -> ux_slave_endpoint_descriptor.wMaxPacketSize != 0);
@@ -342,18 +325,18 @@ ULONG max_transfer_length, n_trans;
/* We store the endpoint in the transfer request as well. */
transfer_request -> ux_slave_transfer_request_endpoint = endpoint;
-
+
/* By default the timeout is infinite on request. */
transfer_request -> ux_slave_transfer_request_timeout = UX_WAIT_FOREVER;
-
+
/* Attach the interface to the endpoint. */
endpoint -> ux_slave_endpoint_interface = interface_ptr;
-
+
/* Attach the device to the endpoint. */
endpoint -> ux_slave_endpoint_device = device;
/* Create the endpoint at the DCD level. */
- status = dcd -> ux_slave_dcd_function(dcd, UX_DCD_CREATE_ENDPOINT, (VOID *) endpoint);
+ status = dcd -> ux_slave_dcd_function(dcd, UX_DCD_CREATE_ENDPOINT, (VOID *) endpoint);
/* Do a sanity check on endpoint creation. */
if (status != UX_SUCCESS)
@@ -367,7 +350,7 @@ ULONG max_transfer_length, n_trans;
/* Attach this endpoint to the end of the endpoint chain. */
if (interface_ptr -> ux_slave_interface_first_endpoint == UX_NULL)
{
-
+
interface_ptr -> ux_slave_interface_first_endpoint = endpoint;
}
else
@@ -378,36 +361,36 @@ ULONG max_transfer_length, n_trans;
endpoint_link = endpoint_link -> ux_slave_endpoint_next_endpoint;
endpoint_link -> ux_slave_endpoint_next_endpoint = endpoint;
}
-
+
break;
-
+
case UX_CONFIGURATION_DESCRIPTOR_ITEM:
case UX_INTERFACE_DESCRIPTOR_ITEM:
-
+
/* We have found a new configuration or interface descriptor, this is the end of the current
- interface. The search for the endpoints must be terminated as if it was the end of the
+ interface. The search for the endpoints must be terminated as if it was the end of the
entire descriptor. */
device_framework_length = descriptor_length;
-
+
break;
default:
-
+
/* We have found another descriptor embedded in the interface. Ignore it. */
break;
}
-
+
/* Adjust what is left of the device framework. */
device_framework_length -= descriptor_length;
-
+
/* Point to the next descriptor. */
device_framework += descriptor_length;
}
/* The interface descriptor in the current class must be changed to the new alternate setting. */
_ux_utility_memory_copy(&interface_ptr -> ux_slave_interface_descriptor, &interface_descriptor, sizeof(UX_INTERFACE_DESCRIPTOR)); /* Use case of memcpy is verified. */
-
+
/* Get the class for the interface. */
class_ptr = _ux_system_slave -> ux_system_slave_interface_class_array[interface_ptr -> ux_slave_interface_descriptor.bInterfaceNumber];
@@ -417,7 +400,7 @@ ULONG max_transfer_length, n_trans;
return (UX_NO_CLASS_MATCH);
}
-
+
/* The interface attached to this configuration must be changed at the class
level. */
class_command.ux_slave_class_command_request = UX_SLAVE_CLASS_COMMAND_CHANGE;
@@ -425,17 +408,17 @@ ULONG max_transfer_length, n_trans;
/* And store it. */
class_command.ux_slave_class_command_class_ptr = class_ptr;
-
+
/* We can now memorize the interface pointer associated with this class. */
class_ptr -> ux_slave_class_interface = interface_ptr;
-
+
/* We have found a potential candidate. Call this registered class entry function to change the alternate setting. */
status = class_ptr -> ux_slave_class_entry_function(&class_command);
/* We are done here. */
- return(status);
+ return(status);
}
- }
+ }
/* Adjust what is left of the device framework. */
device_framework_length -= descriptor_length;
diff --git a/common/core/src/ux_device_stack_class_register.c b/common/core/src/ux_device_stack_class_register.c
index 29ba630b..22f120a5 100644
--- a/common/core/src/ux_device_stack_class_register.c
+++ b/common/core/src/ux_device_stack_class_register.c
@@ -1,18 +1,19 @@
/***************************************************************************
- * Copyright (c) 2024 Microsoft Corporation
- *
+ * Copyright (c) 2024 Microsoft Corporation
+ * Copyright (c) 2026-present Eclipse ThreadX contributors
+ *
* This program and the accompanying materials are made available under the
* terms of the MIT License which is available at
* https://opensource.org/licenses/MIT.
- *
+ *
* SPDX-License-Identifier: MIT
**************************************************************************/
/**************************************************************************/
/**************************************************************************/
-/** */
-/** USBX Component */
+/** */
+/** USBX Component */
/** */
/** Device Stack */
/** */
@@ -56,28 +57,17 @@
/* */
/* OUTPUT */
/* */
-/* Completion Status */
+/* Completion Status */
+/* */
+/* CALLS */
/* */
-/* CALLS */
-/* */
/* _ux_utility_string_length_check Check C string and return */
/* its length if null-terminated */
-/* _ux_utility_memory_copy Memory copy */
-/* */
-/* 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 */
+/* _ux_utility_memory_copy Memory copy */
+/* */
+/* CALLED BY */
+/* */
+/* Application */
/* */
/**************************************************************************/
UINT _ux_device_stack_class_register(UCHAR *class_name,
@@ -123,19 +113,19 @@ ULONG class_index;
/* We have found a free container for the class. Copy the name (with null-terminator). */
_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_inst -> ux_slave_class_entry_function = class_entry_function;
/* Memorize the pointer to the application parameter. */
class_inst -> ux_slave_class_interface_parameter = parameter;
-
+
/* Memorize the configuration number on which this instance will be called. */
class_inst -> ux_slave_class_configuration_number = configuration_number;
-
+
/* Memorize the interface number on which this instance will be called. */
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;
@@ -143,11 +133,11 @@ ULONG class_index;
/* Call the class initialization routine. */
status = class_entry_function(&command);
-
+
/* Check the status. */
if (status != UX_SUCCESS)
return(status);
-
+
/* Make this class used now. */
class_inst -> ux_slave_class_status = UX_USED;
@@ -158,7 +148,7 @@ ULONG class_index;
#if UX_MAX_SLAVE_CLASS_DRIVER > 1
/* Move to the next class. */
class_inst ++;
- }
+ }
#endif
/* No more entries in the class table. */
@@ -201,12 +191,6 @@ ULONG class_index;
/* */
/* Application */
/* */
-/* RELEASE HISTORY */
-/* */
-/* DATE NAME DESCRIPTION */
-/* */
-/* 10-31-2023 Chaoqiong Xiao Initial Version 6.3.0 */
-/* */
/**************************************************************************/
UINT _uxe_device_stack_class_register(UCHAR *class_name,
UINT (*class_entry_function)(struct UX_SLAVE_CLASS_COMMAND_STRUCT *),
diff --git a/common/core/src/ux_device_stack_class_unregister.c b/common/core/src/ux_device_stack_class_unregister.c
index f6cb0dde..04fd4501 100644
--- a/common/core/src/ux_device_stack_class_unregister.c
+++ b/common/core/src/ux_device_stack_class_unregister.c
@@ -1,18 +1,19 @@
/***************************************************************************
- * Copyright (c) 2024 Microsoft Corporation
- *
+ * Copyright (c) 2024 Microsoft Corporation
+ * Copyright (c) 2026-present Eclipse ThreadX contributors
+ *
* This program and the accompanying materials are made available under the
* terms of the MIT License which is available at
* https://opensource.org/licenses/MIT.
- *
+ *
* SPDX-License-Identifier: MIT
**************************************************************************/
/**************************************************************************/
/**************************************************************************/
-/** */
-/** USBX Component */
+/** */
+/** USBX Component */
/** */
/** Device Stack */
/** */
@@ -53,27 +54,17 @@
/* */
/* OUTPUT */
/* */
-/* Completion Status */
+/* Completion Status */
+/* */
+/* CALLS */
/* */
-/* CALLS */
-/* */
/* _ux_utility_string_length_check Check C string and return */
/* its length if null-terminated */
-/* _ux_utility_memory_compare Memory compare */
-/* */
-/* 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, */
-/* resulting in version 6.1 */
+/* _ux_utility_memory_compare Memory compare */
+/* */
+/* CALLED BY */
+/* */
+/* Application */
/* */
/**************************************************************************/
UINT _ux_device_stack_class_unregister(UCHAR *class_name,
@@ -116,21 +107,21 @@ ULONG class_index;
/* We have found a used container with a class. Compare the name (include null-terminator). */
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_inst;
/* Call the class uninitialization routine. */
status = class_entry_function(&command);
-
+
/* Check the status. */
if (status != UX_SUCCESS)
return(status);
-
+
/* Make this class unused now. */
class_inst -> ux_slave_class_status = UX_UNUSED;
-
+
/* Erase the instance of the class. */
class_inst -> ux_slave_class_instance = UX_NULL;
@@ -142,7 +133,7 @@ ULONG class_index;
#if UX_MAX_SLAVE_CLASS_DRIVER > 1
/* Move to the next class. */
class_inst ++;
- }
+ }
#endif
/* No class match. */
@@ -182,12 +173,6 @@ ULONG class_index;
/* */
/* Application */
/* */
-/* RELEASE HISTORY */
-/* */
-/* DATE NAME DESCRIPTION */
-/* */
-/* 10-31-2023 Chaoqiong Xiao Initial Version 6.3.0 */
-/* */
/**************************************************************************/
UINT _uxe_device_stack_class_unregister(UCHAR *class_name,
UINT (*class_entry_function)(struct UX_SLAVE_CLASS_COMMAND_STRUCT *))
diff --git a/common/core/src/ux_device_stack_clear_feature.c b/common/core/src/ux_device_stack_clear_feature.c
index 23df3efd..fa7e7e24 100644
--- a/common/core/src/ux_device_stack_clear_feature.c
+++ b/common/core/src/ux_device_stack_clear_feature.c
@@ -1,18 +1,19 @@
/***************************************************************************
- * Copyright (c) 2024 Microsoft Corporation
- *
+ * Copyright (c) 2024 Microsoft Corporation
+ * Copyright (c) 2026-present Eclipse ThreadX contributors
+ *
* This program and the accompanying materials are made available under the
* terms of the MIT License which is available at
* https://opensource.org/licenses/MIT.
- *
+ *
* SPDX-License-Identifier: MIT
**************************************************************************/
/**************************************************************************/
/**************************************************************************/
-/** */
-/** USBX Component */
+/** */
+/** USBX Component */
/** */
/** Device Stack */
/** */
@@ -45,35 +46,21 @@
/* */
/* INPUT */
/* */
-/* request_type Request type */
+/* request_type Request type */
/* request_value Request value */
/* request_index Request index */
/* */
/* OUTPUT */
/* */
-/* Completion Status */
+/* Completion Status */
+/* */
+/* CALLS */
+/* */
+/* (ux_slave_dcd_function) DCD dispatch function */
+/* */
+/* CALLED BY */
/* */
-/* CALLS */
-/* */
-/* (ux_slave_dcd_function) DCD dispatch function */
-/* */
-/* CALLED BY */
-/* */
/* Device Stack */
-/* */
-/* 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 */
-/* 07-29-2022 Chaoqiong Xiao Modified comment(s), */
-/* fixed parameter/variable */
-/* names conflict C++ keyword, */
-/* resulting in version 6.1.12 */
/* */
/**************************************************************************/
UINT _ux_device_stack_clear_feature(ULONG request_type, ULONG request_value, ULONG request_index)
@@ -84,7 +71,7 @@ UX_SLAVE_DEVICE *device;
UX_SLAVE_INTERFACE *interface_ptr;
UX_SLAVE_ENDPOINT *endpoint;
UX_SLAVE_ENDPOINT *endpoint_target;
-
+
UX_PARAMETER_NOT_USED(request_value);
/* If trace is enabled, insert this event into the trace buffer. */
@@ -102,7 +89,7 @@ UX_SLAVE_ENDPOINT *endpoint_target;
/* The request can be for either the device or the endpoint. */
switch (request_type & UX_REQUEST_TARGET)
{
-
+
case UX_REQUEST_TARGET_DEVICE:
/* Check if we have a DEVICE_REMOTE_WAKEUP Feature. */
@@ -124,11 +111,11 @@ UX_SLAVE_ENDPOINT *endpoint_target;
}
break;
-
+
case UX_REQUEST_TARGET_ENDPOINT:
/* The only clear feature for endpoint is ENDPOINT_STALL. This clears
- the endpoint of the stall situation and resets its data toggle.
+ the endpoint of the stall situation and resets its data toggle.
We need to find the endpoint through the interface(s). */
interface_ptr = device -> ux_slave_device_first_interface;
@@ -139,7 +126,7 @@ UX_SLAVE_ENDPOINT *endpoint_target;
/* Get the first endpoint for this interface. */
endpoint_target = interface_ptr -> ux_slave_interface_first_endpoint;
-
+
/* Parse all the endpoints. */
while (endpoint_target != UX_NULL)
{
@@ -150,7 +137,7 @@ UX_SLAVE_ENDPOINT *endpoint_target;
/* Reset the endpoint. */
dcd -> ux_slave_dcd_function(dcd, UX_DCD_RESET_ENDPOINT, endpoint_target);
-
+
/* Mark its state now. */
endpoint_target -> ux_slave_endpoint_state = UX_ENDPOINT_RESET;
@@ -173,12 +160,12 @@ UX_SLAVE_ENDPOINT *endpoint_target;
/* We get here when the endpoint is wrong. Should not happen though. */
default:
-
+
/* We stall the command. */
dcd -> ux_slave_dcd_function(dcd, UX_DCD_STALL_ENDPOINT, endpoint);
-
+
/* No more work to do here. The command failed but the upper layer does not depend on it. */
- return(UX_SUCCESS);
+ return(UX_SUCCESS);
}
/* Return the function status. */
diff --git a/common/core/src/ux_device_stack_configuration_get.c b/common/core/src/ux_device_stack_configuration_get.c
index 5a6dc66f..c9c58582 100644
--- a/common/core/src/ux_device_stack_configuration_get.c
+++ b/common/core/src/ux_device_stack_configuration_get.c
@@ -1,18 +1,19 @@
/***************************************************************************
- * Copyright (c) 2024 Microsoft Corporation
- *
+ * Copyright (c) 2024 Microsoft Corporation
+ * Copyright (c) 2026-present Eclipse ThreadX contributors
+ *
* This program and the accompanying materials are made available under the
* terms of the MIT License which is available at
* https://opensource.org/licenses/MIT.
- *
+ *
* SPDX-License-Identifier: MIT
**************************************************************************/
/**************************************************************************/
/**************************************************************************/
-/** */
-/** USBX Component */
+/** */
+/** USBX Component */
/** */
/** Device Stack */
/** */
@@ -44,28 +45,20 @@
/* */
/* INPUT */
/* */
-/* None */
+/* None */
/* */
/* OUTPUT */
/* */
-/* Completion Status */
+/* Completion Status */
+/* */
+/* CALLS */
+/* */
+/* _ux_device_stack_transfer_request Transfer request */
+/* */
+/* CALLED BY */
/* */
-/* CALLS */
-/* */
-/* _ux_device_stack_transfer_request Transfer request */
-/* */
-/* CALLED BY */
-/* */
-/* Application */
+/* Application */
/* Device Stack */
-/* */
-/* RELEASE HISTORY */
-/* */
-/* DATE NAME DESCRIPTION */
-/* */
-/* 05-19-2020 Chaoqiong Xiao Initial Version 6.0 */
-/* 09-30-2020 Chaoqiong Xiao Modified comment(s), */
-/* resulting in version 6.1 */
/* */
/**************************************************************************/
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 e4447c8f..31d41a00 100644
--- a/common/core/src/ux_device_stack_configuration_set.c
+++ b/common/core/src/ux_device_stack_configuration_set.c
@@ -1,18 +1,19 @@
/***************************************************************************
- * Copyright (c) 2024 Microsoft Corporation
- *
+ * Copyright (c) 2024 Microsoft Corporation
+ * Copyright (c) 2026-present Eclipse ThreadX contributors
+ *
* This program and the accompanying materials are made available under the
* terms of the MIT License which is available at
* https://opensource.org/licenses/MIT.
- *
+ *
* SPDX-License-Identifier: MIT
**************************************************************************/
/**************************************************************************/
/**************************************************************************/
-/** */
-/** USBX Component */
+/** */
+/** USBX Component */
/** */
/** Device Stack */
/** */
@@ -51,34 +52,20 @@
/* */
/* OUTPUT */
/* */
-/* Completion Status */
+/* Completion Status */
/* */
-/* CALLS */
+/* CALLS */
/* */
-/* (ux_slave_class_entry_function) Device class entry function */
-/* (ux_slave_dcd_function) DCD dispatch function */
+/* (ux_slave_class_entry_function) Device class entry function */
+/* (ux_slave_dcd_function) DCD dispatch function */
/* _ux_device_stack_interface_delete Delete interface */
-/* _ux_device_stack_interface_set Set interface */
-/* _ux_utility_descriptor_parse Parse descriptor */
-/* */
-/* CALLED BY */
-/* */
-/* Application */
+/* _ux_device_stack_interface_set Set interface */
+/* _ux_utility_descriptor_parse Parse descriptor */
+/* */
+/* CALLED BY */
+/* */
+/* Application */
/* Device Stack */
-/* */
-/* 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 */
-/* 07-29-2022 Chaoqiong Xiao Modified comment(s), */
-/* fixed parameter/variable */
-/* names conflict C++ keyword, */
-/* resulting in version 6.1.12 */
/* */
/**************************************************************************/
UINT _ux_device_stack_configuration_set(ULONG configuration_value)
@@ -91,9 +78,9 @@ ULONG descriptor_length;
UCHAR descriptor_type;
UX_CONFIGURATION_DESCRIPTOR configuration_descriptor = { 0 };
UX_INTERFACE_DESCRIPTOR interface_descriptor;
-UX_SLAVE_INTERFACE *interface_ptr;
+UX_SLAVE_INTERFACE *interface_ptr;
#if !defined(UX_DEVICE_INITIALIZE_FRAMEWORK_SCAN_DISABLE) || UX_MAX_DEVICE_INTERFACES > 1
-UX_SLAVE_INTERFACE *next_interface;
+UX_SLAVE_INTERFACE *next_interface;
#endif
UX_SLAVE_CLASS *class_inst;
UX_SLAVE_CLASS *current_class = UX_NULL;
@@ -115,7 +102,7 @@ ULONG class_index;
/* Get the pointer to the device. */
device = &_ux_system_slave -> ux_system_slave_device;
-
+
/* Reset the IAD flag. */
iad_flag = UX_FALSE;
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 0916b435..013c3452 100644
--- a/common/core/src/ux_device_stack_control_request_process.c
+++ b/common/core/src/ux_device_stack_control_request_process.c
@@ -1,18 +1,19 @@
/***************************************************************************
- * Copyright (c) 2024 Microsoft Corporation
- *
+ * Copyright (c) 2024 Microsoft Corporation
+ * Copyright (c) 2026-present Eclipse ThreadX contributors
+ *
* This program and the accompanying materials are made available under the
* terms of the MIT License which is available at
* https://opensource.org/licenses/MIT.
- *
+ *
* SPDX-License-Identifier: MIT
**************************************************************************/
/**************************************************************************/
/**************************************************************************/
-/** */
-/** USBX Component */
+/** */
+/** USBX Component */
/** */
/** Device Stack */
/** */
@@ -48,55 +49,29 @@
/* */
/* OUTPUT */
/* */
-/* Completion Status */
+/* Completion Status */
+/* */
+/* CALLS */
/* */
-/* CALLS */
-/* */
-/* (ux_slave_class_entry_function) Device class entry function */
-/* (ux_slave_dcd_function) DCD dispatch function */
+/* (ux_slave_class_entry_function) Device class entry function */
+/* (ux_slave_dcd_function) DCD dispatch function */
/* _ux_device_stack_transfer_request Transfer request */
/* _ux_device_stack_endpoint_stall Stall endpoint */
/* _ux_device_stack_alternate_setting_get */
-/* Get alternate settings */
+/* Get alternate settings */
/* _ux_device_stack_alternate_setting_set */
-/* Set alternate settings */
-/* _ux_device_stack_clear_feature Clear feature */
-/* _ux_device_stack_configuration_get Get configuration */
-/* _ux_device_stack_configuration_set Set configuration */
-/* _ux_device_stack_descriptor_send Send descriptor */
-/* _ux_device_stack_get_status Get status */
-/* _ux_device_stack_set_feature Set feature */
-/* _ux_utility_short_get Get short value */
-/* */
-/* CALLED BY */
-/* */
+/* Set alternate settings */
+/* _ux_device_stack_clear_feature Clear feature */
+/* _ux_device_stack_configuration_get Get configuration */
+/* _ux_device_stack_configuration_set Set configuration */
+/* _ux_device_stack_descriptor_send Send descriptor */
+/* _ux_device_stack_get_status Get status */
+/* _ux_device_stack_set_feature Set feature */
+/* _ux_utility_short_get Get short value */
+/* */
+/* CALLED BY */
+/* */
/* Device Stack */
-/* */
-/* RELEASE HISTORY */
-/* */
-/* DATE NAME DESCRIPTION */
-/* */
-/* 05-19-2020 Chaoqiong Xiao Initial Version 6.0 */
-/* 09-30-2020 Chaoqiong Xiao Modified comment(s), */
-/* resulting in version 6.1 */
-/* 10-15-2021 Chaoqiong Xiao Modified comment(s), */
-/* fixed possible buffer issue */
-/* for control vendor request, */
-/* resulting in version 6.1.9 */
-/* 01-31-2022 Chaoqiong Xiao Modified comment(s), */
-/* added printer support, */
-/* resulting in version 6.1.10 */
-/* 07-29-2022 Chaoqiong Xiao Modified comment(s), */
-/* fixed parameter/variable */
-/* names conflict C++ keyword, */
-/* resulting in version 6.1.12 */
-/* 03-08-2023 Chaoqiong Xiao Modified comment(s), */
-/* fixed vendor request issue, */
-/* resulting in version 6.2.1 */
-/* 10-31-2023 Chaoqiong Xiao Modified comment(s), */
-/* improved interface request */
-/* process with print class, */
-/* resulting in version 6.3.0 */
/* */
/**************************************************************************/
UINT _ux_device_stack_control_request_process(UX_SLAVE_TRANSFER *transfer_request)
@@ -137,12 +112,12 @@ ULONG application_data_length;
/* Filter for GET_DESCRIPTOR/SET_DESCRIPTOR commands. If the descriptor to be returned is not a standard descriptor,
treat the command as a CLASS command. */
if ((request == UX_GET_DESCRIPTOR || request == UX_SET_DESCRIPTOR) && (((request_value >> 8) & UX_REQUEST_TYPE) != UX_REQUEST_TYPE_STANDARD))
- {
+ {
/* This request is to be handled by the class layer. */
request_type &= (UINT)~UX_REQUEST_TYPE;
request_type |= UX_REQUEST_TYPE_CLASS;
- }
+ }
/* Check if there is a vendor registered function at the application layer. If the request
is VENDOR and the request match, pass the request to the application. */
@@ -154,24 +129,24 @@ ULONG application_data_length;
request == _ux_system_slave -> ux_system_slave_device_vendor_request)
{
- /* This is a Microsoft extended function. It happens before the device is configured.
+ /* This is a Microsoft extended function. It happens before the device is configured.
The request is passed to the application directly. */
application_data_length = UX_SLAVE_REQUEST_CONTROL_MAX_LENGTH;
- status = _ux_system_slave -> ux_system_slave_device_vendor_request_function(request, request_value,
- request_index, request_length,
+ status = _ux_system_slave -> ux_system_slave_device_vendor_request_function(request, request_value,
+ request_index, request_length,
transfer_request -> ux_slave_transfer_request_data_pointer,
&application_data_length);
/* Check the status from the application. */
if (status == UX_SUCCESS)
{
-
+
/* Get the control endpoint associated with the device. */
endpoint = &device -> ux_slave_device_control_endpoint;
-
+
/* Get the pointer to the transfer request associated with the control endpoint. */
transfer_request = &endpoint -> ux_slave_endpoint_transfer_request;
-
+
/* Set the direction to OUT. */
transfer_request -> ux_slave_transfer_request_phase = UX_TRANSFER_PHASE_DATA_OUT;
@@ -186,7 +161,7 @@ ULONG application_data_length;
/* The application did not like the vendor command format, stall the control endpoint. */
_ux_device_stack_endpoint_stall(&device -> ux_slave_device_control_endpoint);
-
+
/* We are done here. */
return(UX_SUCCESS);
}
@@ -217,10 +192,10 @@ ULONG application_data_length;
if ((request_type & UX_REQUEST_TARGET) == UX_REQUEST_TARGET_INTERFACE)
{
- /* Yes, so the request index contains the index of the interface
- the request is for. So if the current index does not match
+ /* Yes, so the request index contains the index of the interface
+ the request is for. So if the current index does not match
the request index, we should go to the next one. */
- /* For printer class (0x07) GET_DEVICE_ID (0x00) the high byte of
+ /* For printer class (0x07) GET_DEVICE_ID (0x00) the high byte of
wIndex is interface index (for recommended index sequence the interface
number is same as interface index inside configuration).
*/
@@ -247,8 +222,8 @@ ULONG application_data_length;
/* We have found a potential candidate. Call this registered class entry function. */
status = class_ptr -> ux_slave_class_entry_function(&class_command);
- /* The status simply tells us if the registered class handled the
- command - if there was an issue processing the command, it would've
+ /* The status simply tells us if the registered class handled the
+ command - if there was an issue processing the command, it would've
stalled the control endpoint, notifying the host (and not us). */
if (status == UX_SUCCESS)
@@ -288,7 +263,7 @@ ULONG application_data_length;
break;
case UX_SET_ADDRESS:
-
+
/* Memorize the address. Some controllers memorize the address here. Some don't. */
dcd -> ux_slave_dcd_device_address = request_value;
@@ -320,12 +295,12 @@ ULONG application_data_length;
status = _ux_device_stack_alternate_setting_get(request_index);
break;
-
+
case UX_SET_INTERFACE:
status = _ux_device_stack_alternate_setting_set(request_index,request_value);
break;
-
+
case UX_SYNCH_FRAME:
diff --git a/common/core/src/ux_device_stack_descriptor_send.c b/common/core/src/ux_device_stack_descriptor_send.c
index d0655474..0d731da4 100644
--- a/common/core/src/ux_device_stack_descriptor_send.c
+++ b/common/core/src/ux_device_stack_descriptor_send.c
@@ -1,10 +1,11 @@
/***************************************************************************
- * Copyright (c) 2024 Microsoft Corporation
- *
+ * Copyright (c) 2024 Microsoft Corporation
+ * Copyright (c) 2026-present Eclipse ThreadX contributors
+ *
* This program and the accompanying materials are made available under the
* terms of the MIT License which is available at
* https://opensource.org/licenses/MIT.
- *
+ *
* SPDX-License-Identifier: MIT
**************************************************************************/
@@ -72,28 +73,6 @@
/* Application */
/* Device Stack */
/* */
-/* 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 */
-/* 12-31-2020 Chaoqiong Xiao Modified comment(s), */
-/* added BOS support, */
-/* resulting in version 6.1.3 */
-/* 04-25-2022 Chaoqiong Xiao Modified comment(s), */
-/* internal clean up, */
-/* resulting in version 6.1.11 */
-/* 10-31-2023 Chaoqiong Xiao Modified comment(s), */
-/* moved compile option check, */
-/* added support for get string*/
-/* requests with zero wIndex, */
-/* resulting in version 6.3.0 */
-/* */
/**************************************************************************/
UINT _ux_device_stack_descriptor_send(ULONG descriptor_type, ULONG request_index, ULONG host_length)
{
diff --git a/common/core/src/ux_device_stack_disconnect.c b/common/core/src/ux_device_stack_disconnect.c
index 17ade423..de90c302 100644
--- a/common/core/src/ux_device_stack_disconnect.c
+++ b/common/core/src/ux_device_stack_disconnect.c
@@ -1,18 +1,19 @@
/***************************************************************************
- * Copyright (c) 2024 Microsoft Corporation
- *
+ * Copyright (c) 2024 Microsoft Corporation
+ * Copyright (c) 2026-present Eclipse ThreadX contributors
+ *
* This program and the accompanying materials are made available under the
* terms of the MIT License which is available at
* https://opensource.org/licenses/MIT.
- *
+ *
* SPDX-License-Identifier: MIT
**************************************************************************/
/**************************************************************************/
/**************************************************************************/
-/** */
-/** USBX Component */
+/** */
+/** USBX Component */
/** */
/** Device Stack */
/** */
@@ -46,36 +47,22 @@
/* */
/* INPUT */
/* */
-/* None */
+/* None */
/* */
/* OUTPUT */
/* */
-/* Completion Status */
+/* Completion Status */
+/* */
+/* CALLS */
/* */
-/* CALLS */
-/* */
-/* (ux_slave_class_entry_function) Device class entry function */
-/* (ux_slave_dcd_function) DCD dispatch function */
+/* (ux_slave_class_entry_function) Device class entry function */
+/* (ux_slave_dcd_function) DCD dispatch function */
/* _ux_device_stack_interface_delete Delete interface */
-/* */
-/* CALLED BY */
-/* */
-/* Application */
+/* */
+/* CALLED BY */
+/* */
+/* Application */
/* Device Stack */
-/* */
-/* 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 */
-/* 07-29-2022 Chaoqiong Xiao Modified comment(s), */
-/* fixed parameter/variable */
-/* names conflict C++ keyword, */
-/* resulting in version 6.1.12 */
/* */
/**************************************************************************/
UINT _ux_device_stack_disconnect(VOID)
@@ -83,14 +70,14 @@ UINT _ux_device_stack_disconnect(VOID)
UX_SLAVE_DCD *dcd;
UX_SLAVE_DEVICE *device;
-UX_SLAVE_INTERFACE *interface_ptr;
+UX_SLAVE_INTERFACE *interface_ptr;
#if !defined(UX_DEVICE_INITIALIZE_FRAMEWORK_SCAN_DISABLE) || UX_MAX_DEVICE_INTERFACES > 1
-UX_SLAVE_INTERFACE *next_interface;
+UX_SLAVE_INTERFACE *next_interface;
#endif
UX_SLAVE_CLASS *class_ptr;
UX_SLAVE_CLASS_COMMAND class_command;
UINT status = UX_ERROR;
-
+
/* Get the pointer to the DCD. */
dcd = &_ux_system_slave -> ux_system_slave_dcd;
@@ -122,13 +109,13 @@ UINT status = UX_ERROR;
/* Get the pointer to the class container of this interface. */
class_ptr = interface_ptr -> ux_slave_interface_class;
-
+
/* Store the class container. */
class_command.ux_slave_class_command_class_ptr = class_ptr;
/* If there is a class container for this instance, deactivate it. */
if (class_ptr != UX_NULL)
-
+
/* Call the class with the DEACTIVATE signal. */
class_ptr -> ux_slave_class_entry_function(&class_command);
diff --git a/common/core/src/ux_device_stack_endpoint_stall.c b/common/core/src/ux_device_stack_endpoint_stall.c
index 71236425..301cf7b1 100644
--- a/common/core/src/ux_device_stack_endpoint_stall.c
+++ b/common/core/src/ux_device_stack_endpoint_stall.c
@@ -1,18 +1,19 @@
/***************************************************************************
- * Copyright (c) 2024 Microsoft Corporation
- *
+ * Copyright (c) 2024 Microsoft Corporation
+ * Copyright (c) 2026-present Eclipse ThreadX contributors
+ *
* This program and the accompanying materials are made available under the
* terms of the MIT License which is available at
* https://opensource.org/licenses/MIT.
- *
+ *
* SPDX-License-Identifier: MIT
**************************************************************************/
/**************************************************************************/
/**************************************************************************/
-/** */
-/** USBX Component */
+/** */
+/** USBX Component */
/** */
/** Device Stack */
/** */
@@ -49,29 +50,15 @@
/* */
/* OUTPUT */
/* */
-/* Completion Status */
+/* Completion Status */
+/* */
+/* CALLS */
+/* */
+/* (ux_slave_dcd_function) DCD dispatch function */
+/* */
+/* CALLED BY */
/* */
-/* CALLS */
-/* */
-/* (ux_slave_dcd_function) DCD dispatch function */
-/* */
-/* 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), */
-/* used UX prefix to refer to */
-/* TX symbols instead of using */
-/* them directly, */
-/* resulting in version 6.1 */
-/* 01-31-2022 Chaoqiong Xiao Modified comment(s), */
-/* added standalone support, */
-/* resulting in version 6.1.10 */
+/* Application */
/* */
/**************************************************************************/
UINT _ux_device_stack_endpoint_stall(UX_SLAVE_ENDPOINT *endpoint)
@@ -88,7 +75,7 @@ UINT status;
/* Get the pointer to the DCD. */
dcd = &_ux_system_slave -> ux_system_slave_dcd;
- /* Assume device is in an invalid state here in order to reduce code in following
+ /* Assume device is in an invalid state here in order to reduce code in following
section where interrupts are disabled. */
status = UX_ERROR;
@@ -96,7 +83,7 @@ UINT status;
resets it. */
UX_DISABLE
- /* Check if the device is in a valid state; as soon as the device is out
+ /* 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. */
if (_ux_system_slave -> ux_system_slave_device.ux_slave_device_state != UX_DEVICE_RESET &&
endpoint -> ux_slave_endpoint_state != UX_ENDPOINT_HALTED)
@@ -115,6 +102,6 @@ UINT status;
UX_RESTORE
/* Return completion status. */
- return(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 a17dd754..3b4866d7 100644
--- a/common/core/src/ux_device_stack_get_status.c
+++ b/common/core/src/ux_device_stack_get_status.c
@@ -1,18 +1,19 @@
/***************************************************************************
- * Copyright (c) 2024 Microsoft Corporation
- *
+ * Copyright (c) 2024 Microsoft Corporation
+ * Copyright (c) 2026-present Eclipse ThreadX contributors
+ *
* This program and the accompanying materials are made available under the
* terms of the MIT License which is available at
* https://opensource.org/licenses/MIT.
- *
+ *
* SPDX-License-Identifier: MIT
**************************************************************************/
/**************************************************************************/
/**************************************************************************/
-/** */
-/** USBX Component */
+/** */
+/** USBX Component */
/** */
/** Device Stack */
/** */
@@ -51,27 +52,16 @@
/* */
/* OUTPUT */
/* */
-/* Completion Status */
+/* Completion Status */
+/* */
+/* CALLS */
/* */
-/* CALLS */
-/* */
/* _ux_device_stack_transfer_request Transfer request */
-/* (ux_slave_dcd_function) DCD dispatch function */
-/* */
-/* CALLED BY */
-/* */
+/* (ux_slave_dcd_function) DCD dispatch function */
+/* */
+/* CALLED BY */
+/* */
/* Device Stack */
-/* */
-/* RELEASE HISTORY */
-/* */
-/* DATE NAME DESCRIPTION */
-/* */
-/* 05-19-2020 Chaoqiong Xiao Initial Version 6.0 */
-/* 09-30-2020 Chaoqiong Xiao Modified comment(s), */
-/* resulting in version 6.1 */
-/* 04-02-2021 Chaoqiong Xiao Modified comment(s), */
-/* supported bi-dir-endpoints, */
-/* resulting in version 6.1.6 */
/* */
/**************************************************************************/
UINT _ux_device_stack_get_status(ULONG request_type, ULONG request_index, ULONG request_length)
@@ -104,29 +94,29 @@ ULONG data_length;
/* Reset the status buffer. */
*transfer_request -> ux_slave_transfer_request_data_pointer = 0;
*(transfer_request -> ux_slave_transfer_request_data_pointer + 1) = 0;
-
+
/* The default length for GET_STATUS is 2, except for OTG get Status. */
data_length = 2;
-
+
/* The status can be for either the device or the endpoint. */
switch (request_type & UX_REQUEST_TARGET)
{
-
+
case UX_REQUEST_TARGET_DEVICE:
- /* When the device is probed, it is either for the power/remote capabilities or OTG role swap.
+ /* When the device is probed, it is either for the power/remote capabilities or OTG role swap.
We differentiate with the Windex, 0 or OTG status Selector. */
if (request_index == UX_OTG_STATUS_SELECTOR)
{
/* Set the data length to 1. */
data_length = 1;
-
+
#ifdef UX_OTG_SUPPORT
/* Store the Role Swap flag. */
*transfer_request -> ux_slave_transfer_request_data_pointer = (UCHAR) _ux_system_otg -> ux_system_otg_slave_role_swap_flag;
#endif
-
+
}
else
{
@@ -140,9 +130,9 @@ ULONG data_length;
if (_ux_system_slave -> ux_system_slave_remote_wakeup_enabled)
*transfer_request -> ux_slave_transfer_request_data_pointer |= 2;
}
-
+
break;
-
+
case UX_REQUEST_TARGET_ENDPOINT:
#ifndef UX_DEVICE_BIDIRECTIONAL_ENDPOINT_SUPPORT
@@ -163,27 +153,27 @@ ULONG data_length;
if (status == UX_TRUE)
*transfer_request -> ux_slave_transfer_request_data_pointer = 1;
- }
+ }
else
{
-
+
/* We stall the command. Endpoint is wrong. */
dcd -> ux_slave_dcd_function(dcd, UX_DCD_STALL_ENDPOINT, endpoint);
-
+
/* No more work to do here. The command failed but the upper layer does not depend on it. */
- return(UX_SUCCESS);
+ return(UX_SUCCESS);
}
break;
default:
-
+
/* We stall the command. */
dcd -> ux_slave_dcd_function(dcd, UX_DCD_STALL_ENDPOINT, endpoint);
-
+
/* No more work to do here. The command failed but the upper layer does not depend on it. */
- return(UX_SUCCESS);
+ return(UX_SUCCESS);
}
-
+
/* 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/core/src/ux_device_stack_host_wakeup.c b/common/core/src/ux_device_stack_host_wakeup.c
index ff30e9c8..7eab111e 100644
--- a/common/core/src/ux_device_stack_host_wakeup.c
+++ b/common/core/src/ux_device_stack_host_wakeup.c
@@ -1,18 +1,19 @@
/***************************************************************************
- * Copyright (c) 2024 Microsoft Corporation
- *
+ * Copyright (c) 2024 Microsoft Corporation
+ * Copyright (c) 2026-present Eclipse ThreadX contributors
+ *
* This program and the accompanying materials are made available under the
* terms of the MIT License which is available at
* https://opensource.org/licenses/MIT.
- *
+ *
* SPDX-License-Identifier: MIT
**************************************************************************/
/**************************************************************************/
/**************************************************************************/
-/** */
-/** USBX Component */
+/** */
+/** USBX Component */
/** */
/** Device Stack */
/** */
@@ -49,23 +50,15 @@
/* */
/* OUTPUT */
/* */
-/* Completion Status */
+/* Completion Status */
+/* */
+/* CALLS */
+/* */
+/* (ux_slave_dcd_function) DCD dispatch function */
/* */
-/* CALLS */
-/* */
-/* (ux_slave_dcd_function) DCD dispatch function */
-/* */
-/* 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), */
-/* resulting in version 6.1 */
+/* CALLED BY */
+/* */
+/* Application */
/* */
/**************************************************************************/
UINT _ux_device_stack_host_wakeup(VOID)
@@ -73,10 +66,10 @@ UINT _ux_device_stack_host_wakeup(VOID)
UX_SLAVE_DCD *dcd;
UINT status = UX_FUNCTION_NOT_SUPPORTED;
-
+
/* If trace is enabled, insert this event into the trace buffer. */
UX_TRACE_IN_LINE_INSERT(UX_TRACE_DEVICE_STACK_HOST_WAKEUP, 0, 0, 0, 0, UX_TRACE_DEVICE_STACK_EVENTS, 0, 0)
-
+
/* Get the pointer to the DCD. */
dcd = &_ux_system_slave -> ux_system_slave_dcd;
diff --git a/common/core/src/ux_device_stack_initialize.c b/common/core/src/ux_device_stack_initialize.c
index 9947ed2b..ee82790a 100644
--- a/common/core/src/ux_device_stack_initialize.c
+++ b/common/core/src/ux_device_stack_initialize.c
@@ -1,18 +1,19 @@
/***************************************************************************
- * Copyright (c) 2024 Microsoft Corporation
- *
+ * Copyright (c) 2024 Microsoft Corporation
+ * Copyright (c) 2026-present Eclipse ThreadX contributors
+ *
* This program and the accompanying materials are made available under the
* terms of the MIT License which is available at
* https://opensource.org/licenses/MIT.
- *
+ *
* SPDX-License-Identifier: MIT
**************************************************************************/
/**************************************************************************/
/**************************************************************************/
-/** */
-/** USBX Component */
+/** */
+/** USBX Component */
/** */
/** Device Stack */
/** */
@@ -65,53 +66,31 @@ UX_SYSTEM_SLAVE *_ux_system_slave;
/* */
/* INPUT */
/* */
-/* device_framework_high_speed Pointer to high speed FW */
-/* device_framework_length_high_speed Length of high speed FW */
-/* device_framework_full_speed Pointer to full speed FW */
-/* device_framework_length_full_speed Length of full speed FW */
-/* string_framework Pointer to string FW */
-/* string_framework_length Length of string FW */
-/* language_id_framework Pointer to language ID FW */
-/* language_id_framework_length Length of language ID FW */
-/* (ux_system_slave_change_function) Pointer to callback function */
-/* for device changes */
+/* device_framework_high_speed Pointer to high speed FW */
+/* device_framework_length_high_speed Length of high speed FW */
+/* device_framework_full_speed Pointer to full speed FW */
+/* device_framework_length_full_speed Length of full speed FW */
+/* string_framework Pointer to string FW */
+/* string_framework_length Length of string FW */
+/* language_id_framework Pointer to language ID FW */
+/* language_id_framework_length Length of language ID FW */
+/* (ux_system_slave_change_function) Pointer to callback function */
+/* for device changes */
/* */
/* OUTPUT */
/* */
-/* Completion Status */
+/* Completion Status */
+/* */
+/* CALLS */
/* */
-/* CALLS */
-/* */
-/* _ux_utility_memory_allocate Allocate memory */
-/* _ux_utility_memory_free Free memory */
+/* _ux_utility_memory_allocate Allocate memory */
+/* _ux_utility_memory_free Free memory */
/* _ux_utility_semaphore_create Create semaphore */
/* _ux_utility_semaphore_delete Delete semaphore */
-/* */
-/* 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, */
-/* resulting in version 6.1 */
-/* 01-31-2022 Chaoqiong Xiao Modified comment(s), */
-/* added standalone support, */
-/* added printer support, */
-/* resulting in version 6.1.10 */
-/* 04-25-2022 Chaoqiong Xiao Modified comment(s), */
-/* added CCID support, */
-/* added video support, */
-/* resulting in version 6.1.11 */
-/* 10-31-2023 Chaoqiong Xiao Modified comment(s), */
-/* added a new mode to manage */
-/* endpoint buffer in classes, */
-/* resulting in version 6.3.0 */
+/* */
+/* CALLED BY */
+/* */
+/* Application */
/* */
/**************************************************************************/
UINT _ux_device_stack_initialize(UCHAR * device_framework_high_speed, ULONG device_framework_length_high_speed,
@@ -163,7 +142,7 @@ UCHAR *memory;
/* Store the max number of slave class drivers in the project structure. */
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;
@@ -174,11 +153,11 @@ UCHAR *memory;
memory = _ux_utility_memory_allocate(UX_NO_ALIGN, UX_REGULAR_MEMORY, sizeof(UX_SLAVE_CLASS) * UX_MAX_SLAVE_CLASS_DRIVER);
if (memory == UX_NULL)
return(UX_MEMORY_INSUFFICIENT);
-
+
/* Save this memory allocation in the USBX project. */
_ux_system_slave -> ux_system_slave_class_array = (UX_SLAVE_CLASS *) ((void *) memory);
- /* Allocate some memory for the Control Endpoint. First get the address of the transfer request for the
+ /* Allocate some memory for the Control Endpoint. First get the address of the transfer request for the
control endpoint. */
transfer_request = &device -> ux_slave_device_control_endpoint.ux_slave_endpoint_transfer_request;
@@ -208,7 +187,7 @@ UCHAR *memory;
if (status == UX_SUCCESS)
{
- /* We need to determine the maximum number of interfaces and endpoints declared in the device framework.
+ /* We need to determine the maximum number of interfaces and endpoints declared in the device framework.
This mechanism requires that both framework behave the same way regarding the number of interfaces
and endpoints. */
device_framework = _ux_system_slave -> ux_system_slave_device_framework_full_speed;
@@ -225,17 +204,17 @@ UCHAR *memory;
/* Get the length of this descriptor. */
descriptor_length = (ULONG) *device_framework;
-
+
/* And its type. */
descriptor_type = *(device_framework + 1);
-
+
/* Check if this is an endpoint descriptor. */
switch(descriptor_type)
{
case UX_INTERFACE_DESCRIPTOR_ITEM:
- /* Check if this is alternate setting 0. If not, do not add another interface found.
+ /* Check if this is alternate setting 0. If not, do not add another interface found.
If this is alternate setting 0, reset the endpoints count for this interface. */
if (*(device_framework + 3) == 0)
{
@@ -245,16 +224,16 @@ UCHAR *memory;
/* Read the number of endpoints for this alternate setting. */
endpoints_in_interface_found = (ULONG) *(device_framework + 4);
-
+
/* Increment the number of interfaces found in the current configuration. */
local_interfaces_found++;
- }
+ }
else
{
/* Compare the number of endpoints found in this non 0 alternate setting. */
if (endpoints_in_interface_found < (ULONG) *(device_framework + 4))
-
+
/* Adjust the number of maximum endpoints in this interface. */
endpoints_in_interface_found = (ULONG) *(device_framework + 4);
}
@@ -269,7 +248,7 @@ UCHAR *memory;
/* Check if the number of interfaces found in this configuration is the maximum so far. */
if (local_interfaces_found > interfaces_found)
-
+
/* We need to adjust the number of maximum interfaces. */
interfaces_found = local_interfaces_found;
@@ -281,7 +260,7 @@ UCHAR *memory;
/* Check if the number of endpoints found in the previous configuration is the maximum so far. */
if (local_endpoints_found > endpoints_found)
-
+
/* We need to adjust the number of maximum endpoints. */
endpoints_found = local_endpoints_found;
@@ -301,20 +280,20 @@ UCHAR *memory;
/* Point to the next descriptor. */
device_framework += descriptor_length;
}
-
+
/* Add the cumulated number of endpoints in the previous interface. */
local_endpoints_found += endpoints_in_interface_found;
/* Check if the number of endpoints found in the previous interface is the maximum so far. */
if (local_endpoints_found > endpoints_found)
-
+
/* We need to adjust the number of maximum endpoints. */
endpoints_found = local_endpoints_found;
/* Check if the number of interfaces found in this configuration is the maximum so far. */
if (local_interfaces_found > interfaces_found)
-
+
/* We need to adjust the number of maximum interfaces. */
interfaces_found = local_interfaces_found;
@@ -389,7 +368,7 @@ UCHAR *memory;
#if UX_DEVICE_ENDPOINT_BUFFER_OWNER == 0
/* Obtain some memory. */
- endpoints_pool -> ux_slave_endpoint_transfer_request.ux_slave_transfer_request_data_pointer =
+ endpoints_pool -> ux_slave_endpoint_transfer_request.ux_slave_transfer_request_data_pointer =
_ux_utility_memory_allocate(UX_NO_ALIGN, UX_CACHE_SAFE_MEMORY, UX_SLAVE_REQUEST_DATA_MAX_LENGTH);
/* Ensure we could allocate memory. */
@@ -410,7 +389,7 @@ UCHAR *memory;
status = UX_SEMAPHORE_ERROR;
break;
}
-
+
/* Next endpoint. */
endpoints_pool++;
}
@@ -422,7 +401,7 @@ UCHAR *memory;
/* Return successful completion. */
if (status == UX_SUCCESS)
return(UX_SUCCESS);
-
+
/* Free resources when there is error. */
/* Free device -> ux_slave_device_endpoints_pool. */
@@ -500,12 +479,6 @@ UCHAR *memory;
/* */
/* Application */
/* */
-/* RELEASE HISTORY */
-/* */
-/* DATE NAME DESCRIPTION */
-/* */
-/* 10-31-2023 Chaoqiong Xiao Initial Version 6.3.0 */
-/* */
/**************************************************************************/
UINT _uxe_device_stack_initialize(UCHAR * device_framework_high_speed, ULONG device_framework_length_high_speed,
UCHAR * device_framework_full_speed, ULONG device_framework_length_full_speed,
diff --git a/common/core/src/ux_device_stack_interface_delete.c b/common/core/src/ux_device_stack_interface_delete.c
index 6dbd0030..a01e05e1 100644
--- a/common/core/src/ux_device_stack_interface_delete.c
+++ b/common/core/src/ux_device_stack_interface_delete.c
@@ -1,18 +1,19 @@
/***************************************************************************
- * Copyright (c) 2024 Microsoft Corporation
- *
+ * Copyright (c) 2024 Microsoft Corporation
+ * Copyright (c) 2026-present Eclipse ThreadX contributors
+ *
* This program and the accompanying materials are made available under the
* terms of the MIT License which is available at
* https://opensource.org/licenses/MIT.
- *
+ *
* SPDX-License-Identifier: MIT
**************************************************************************/
/**************************************************************************/
/**************************************************************************/
-/** */
-/** USBX Component */
+/** */
+/** USBX Component */
/** */
/** Device Stack */
/** */
@@ -42,7 +43,7 @@
/* */
/* This function deletes an interface. Semaphore and memory are */
/* released and the controller driver is invoked to disable the */
-/* hardware endpoint. The interface is then removed from the */
+/* hardware endpoint. The interface is then removed from the */
/* configuration. */
/* */
/* INPUT */
@@ -51,27 +52,15 @@
/* */
/* OUTPUT */
/* */
-/* Completion Status */
+/* Completion Status */
+/* */
+/* CALLS */
+/* */
+/* (ux_slave_dcd_function) DCD dispatch function */
+/* */
+/* CALLED BY */
/* */
-/* CALLS */
-/* */
-/* (ux_slave_dcd_function) DCD dispatch function */
-/* */
-/* 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), */
-/* resulting in version 6.1 */
-/* 07-29-2022 Chaoqiong Xiao Modified comment(s), */
-/* fixed parameter/variable */
-/* names conflict C++ keyword, */
-/* resulting in version 6.1.12 */
+/* Application */
/* */
/**************************************************************************/
UINT _ux_device_stack_interface_delete(UX_SLAVE_INTERFACE *interface_ptr)
@@ -91,19 +80,19 @@ UX_SLAVE_ENDPOINT *next_endpoint;
/* Get the pointer to the device. */
device = &_ux_system_slave -> ux_system_slave_device;
- /* Find the first endpoints associated with this interface. */
- next_endpoint = interface_ptr -> ux_slave_interface_first_endpoint;
-
- /* Parse all the endpoints. */
+ /* Find the first endpoints associated with this interface. */
+ next_endpoint = interface_ptr -> ux_slave_interface_first_endpoint;
+
+ /* Parse all the endpoints. */
while (next_endpoint != UX_NULL)
{
/* Save this endpoint. */
endpoint = next_endpoint;
-
+
/* Find the next endpoint. */
next_endpoint = endpoint -> ux_slave_endpoint_next_endpoint;
-
+
/* Get the pointer to the DCD. */
dcd = &_ux_system_slave->ux_system_slave_dcd;
@@ -118,7 +107,7 @@ UX_SLAVE_ENDPOINT *next_endpoint;
endpoint -> ux_slave_endpoint_next_endpoint = UX_NULL;
endpoint -> ux_slave_endpoint_interface = UX_NULL;
endpoint -> ux_slave_endpoint_device = UX_NULL;
- }
+ }
/* It's always from first one (to delete). */
/* Rebuild the first link. */
@@ -131,7 +120,7 @@ UX_SLAVE_ENDPOINT *next_endpoint;
interface_ptr -> ux_slave_interface_first_endpoint = UX_NULL;
interface_ptr -> ux_slave_interface_status = UX_UNUSED;
- /* Return successful completion. */
- return(UX_SUCCESS);
+ /* Return successful completion. */
+ return(UX_SUCCESS);
}
diff --git a/common/core/src/ux_device_stack_interface_get.c b/common/core/src/ux_device_stack_interface_get.c
index 746d9d01..5dc6c5fb 100644
--- a/common/core/src/ux_device_stack_interface_get.c
+++ b/common/core/src/ux_device_stack_interface_get.c
@@ -1,18 +1,19 @@
/***************************************************************************
- * Copyright (c) 2024 Microsoft Corporation
- *
+ * Copyright (c) 2024 Microsoft Corporation
+ * Copyright (c) 2026-present Eclipse ThreadX contributors
+ *
* This program and the accompanying materials are made available under the
* terms of the MIT License which is available at
* https://opensource.org/licenses/MIT.
- *
+ *
* SPDX-License-Identifier: MIT
**************************************************************************/
/**************************************************************************/
/**************************************************************************/
-/** */
-/** USBX Component */
+/** */
+/** USBX Component */
/** */
/** Device Stack */
/** */
@@ -51,29 +52,15 @@
/* */
/* OUTPUT */
/* */
-/* Completion Status */
+/* Completion Status */
+/* */
+/* CALLS */
+/* */
+/* (ux_slave_dcd_function) DCD dispatch function */
/* */
-/* CALLS */
+/* CALLED BY */
/* */
-/* (ux_slave_dcd_function) DCD dispatch function */
-/* */
-/* 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, */
-/* resulting in version 6.1 */
-/* 07-29-2022 Chaoqiong Xiao Modified comment(s), */
-/* fixed parameter/variable */
-/* names conflict C++ keyword, */
-/* resulting in version 6.1.12 */
+/* Application */
/* */
/**************************************************************************/
UINT _ux_device_stack_interface_get(UINT interface_value)
diff --git a/common/core/src/ux_device_stack_interface_set.c b/common/core/src/ux_device_stack_interface_set.c
index fef63178..0b854810 100644
--- a/common/core/src/ux_device_stack_interface_set.c
+++ b/common/core/src/ux_device_stack_interface_set.c
@@ -1,18 +1,19 @@
/***************************************************************************
- * Copyright (c) 2024 Microsoft Corporation
- *
+ * Copyright (c) 2024 Microsoft Corporation
+ * Copyright (c) 2026-present Eclipse ThreadX contributors
+ *
* This program and the accompanying materials are made available under the
* terms of the MIT License which is available at
* https://opensource.org/licenses/MIT.
- *
+ *
* SPDX-License-Identifier: MIT
**************************************************************************/
/**************************************************************************/
/**************************************************************************/
-/** */
-/** USBX Component */
+/** */
+/** USBX Component */
/** */
/** Device Stack */
/** */
@@ -46,42 +47,25 @@
/* */
/* INPUT */
/* */
-/* device_framework Address in device framework */
+/* device_framework Address in device framework */
/* for selected alternate setting*/
-/* device_framework_length Length of device framework */
-/* alternate_setting_value Alternate setting */
+/* device_framework_length Length of device framework */
+/* alternate_setting_value Alternate setting */
/* */
/* OUTPUT */
/* */
-/* Completion Status */
+/* Completion Status */
+/* */
+/* CALLS */
/* */
-/* CALLS */
+/* (ux_slave_dcd_function) DCD dispatch function */
+/* _ux_device_stack_interface_start Start interface */
+/* _ux_utility_descriptor_parse Parse descriptor */
/* */
-/* (ux_slave_dcd_function) DCD dispatch function */
-/* _ux_device_stack_interface_start Start interface */
-/* _ux_utility_descriptor_parse Parse descriptor */
-/* */
-/* CALLED BY */
-/* */
-/* Application */
+/* CALLED BY */
+/* */
+/* Application */
/* Device Stack */
-/* */
-/* 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 */
-/* 10-15-2021 Chaoqiong Xiao Modified comment(s), */
-/* calculated payload size, */
-/* resulting in version 6.1.9 */
-/* 07-29-2022 Chaoqiong Xiao Modified comment(s), */
-/* fixed parameter/variable */
-/* names conflict C++ keyword, */
-/* resulting in version 6.1.12 */
/* */
/**************************************************************************/
UINT _ux_device_stack_interface_set(UCHAR * device_framework, ULONG device_framework_length,
@@ -115,7 +99,7 @@ ULONG max_transfer_length, n_trans;
/* Get the pointer to the device. */
device = &_ux_system_slave -> ux_system_slave_device;
- /* Find a free interface in the pool and hook it to the
+ /* Find a free interface in the pool and hook it to the
existing interface. */
interface_ptr = device -> ux_slave_device_interfaces_pool;
@@ -126,10 +110,10 @@ ULONG max_transfer_length, n_trans;
/* Check if this interface is free. */
if (interface_ptr -> ux_slave_interface_status == UX_UNUSED)
break;
-
+
/* Try the next interface. */
interface_ptr++;
-
+
/* Decrement the number of interfaces left to scan in the pool. */
interfaces_pool_number--;
}
@@ -142,7 +126,7 @@ ULONG max_transfer_length, n_trans;
/* Check if this interface is free. */
if (interface_ptr -> ux_slave_interface_status != UX_UNUSED)
return(UX_MEMORY_INSUFFICIENT);
-
+
#endif
/* Mark this interface as used now. */
@@ -192,14 +176,14 @@ ULONG max_transfer_length, n_trans;
/* And its type. */
descriptor_type = *(device_framework + 1);
-
+
/* Check if this is an endpoint descriptor. */
switch(descriptor_type)
{
case UX_ENDPOINT_DESCRIPTOR_ITEM:
- /* Find a free endpoint in the pool and hook it to the
+ /* Find a free endpoint in the pool and hook it to the
existing interface after it's created by DCD. */
endpoint = device -> ux_slave_device_endpoints_pool;
endpoints_pool_number = device -> ux_slave_device_endpoints_pool_number;
@@ -212,12 +196,12 @@ ULONG max_transfer_length, n_trans;
endpoint -> ux_slave_endpoint_status = UX_USED;
break;
}
-
+
/* Try the next endpoint. */
endpoint++;
-
+
/* Decrement the number of endpoints to scan from the pool. */
- endpoints_pool_number--;
+ endpoints_pool_number--;
}
/* Did we find a free endpoint ? */
@@ -232,7 +216,7 @@ ULONG max_transfer_length, n_trans;
/* Now we create a transfer request to accept transfer on this endpoint. */
transfer_request = &endpoint -> ux_slave_endpoint_transfer_request;
-
+
/* Validate endpoint descriptor wMaxPacketSize. */
UX_ASSERT(endpoint -> ux_slave_endpoint_descriptor.wMaxPacketSize != 0);
@@ -259,19 +243,19 @@ ULONG max_transfer_length, n_trans;
/* We store the endpoint in the transfer request as well. */
transfer_request -> ux_slave_transfer_request_endpoint = endpoint;
-
+
/* By default the timeout is infinite on request. */
transfer_request -> ux_slave_transfer_request_timeout = UX_WAIT_FOREVER;
-
+
/* Attach the interface to the endpoint. */
endpoint -> ux_slave_endpoint_interface = interface_ptr;
-
+
/* Attach the device to the endpoint. */
endpoint -> ux_slave_endpoint_device = device;
-
+
/* Create the endpoint at the DCD level. */
- status = dcd -> ux_slave_dcd_function(dcd, UX_DCD_CREATE_ENDPOINT, (VOID *) endpoint);
-
+ status = dcd -> ux_slave_dcd_function(dcd, UX_DCD_CREATE_ENDPOINT, (VOID *) endpoint);
+
/* Do a sanity check on endpoint creation. */
if (status != UX_SUCCESS)
{
@@ -301,7 +285,7 @@ ULONG max_transfer_length, n_trans;
case UX_INTERFACE_DESCRIPTOR_ITEM:
/* If the descriptor is a configuration or interface,
- we have parsed and mounted all endpoints.
+ we have parsed and mounted all endpoints.
The interface attached to this configuration must be started at the class level. */
status = _ux_device_stack_interface_start(interface_ptr);
diff --git a/common/core/src/ux_device_stack_interface_start.c b/common/core/src/ux_device_stack_interface_start.c
index e5c4bbef..8c03a54c 100644
--- a/common/core/src/ux_device_stack_interface_start.c
+++ b/common/core/src/ux_device_stack_interface_start.c
@@ -1,18 +1,19 @@
/***************************************************************************
- * Copyright (c) 2024 Microsoft Corporation
- *
+ * Copyright (c) 2024 Microsoft Corporation
+ * Copyright (c) 2026-present Eclipse ThreadX contributors
+ *
* This program and the accompanying materials are made available under the
* terms of the MIT License which is available at
* https://opensource.org/licenses/MIT.
- *
+ *
* SPDX-License-Identifier: MIT
**************************************************************************/
/**************************************************************************/
/**************************************************************************/
-/** */
-/** USBX Component */
+/** */
+/** USBX Component */
/** */
/** Device Stack */
/** */
@@ -45,32 +46,20 @@
/* */
/* INPUT */
/* */
-/* interface Pointer to interface */
+/* interface Pointer to interface */
/* */
/* OUTPUT */
/* */
-/* Completion Status */
+/* Completion Status */
+/* */
+/* CALLS */
+/* */
+/* (ux_slave_class_entry_function) Device class entry function */
+/* */
+/* CALLED BY */
/* */
-/* CALLS */
-/* */
-/* (ux_slave_class_entry_function) Device class entry function */
-/* */
-/* CALLED BY */
-/* */
-/* Application */
+/* Application */
/* Device Stack */
-/* */
-/* RELEASE HISTORY */
-/* */
-/* DATE NAME DESCRIPTION */
-/* */
-/* 05-19-2020 Chaoqiong Xiao Initial Version 6.0 */
-/* 09-30-2020 Chaoqiong Xiao Modified comment(s), */
-/* resulting in version 6.1 */
-/* 07-29-2022 Chaoqiong Xiao Modified comment(s), */
-/* fixed parameter/variable */
-/* names conflict C++ keyword, */
-/* resulting in version 6.1.12 */
/* */
/**************************************************************************/
UINT _ux_device_stack_interface_start(UX_SLAVE_INTERFACE *interface_ptr)
@@ -105,7 +94,7 @@ UX_SLAVE_CLASS_COMMAND class_command;
/* We can now memorize the interface pointer associated with this class. */
class_ptr -> ux_slave_class_interface = interface_ptr;
-
+
/* We have found a potential candidate. Call this registered class entry function. */
status = class_ptr -> ux_slave_class_entry_function(&class_command);
@@ -115,10 +104,10 @@ UX_SLAVE_CLASS_COMMAND class_command;
/* Store the class container. */
class_command.ux_slave_class_command_class_ptr = class_ptr;
-
+
/* Store the command. */
class_command.ux_slave_class_command_request = UX_SLAVE_CLASS_COMMAND_ACTIVATE;
-
+
/* Activate the class. */
status = class_ptr -> ux_slave_class_entry_function(&class_command);
@@ -126,7 +115,7 @@ UX_SLAVE_CLASS_COMMAND class_command;
if(status == UX_SUCCESS)
interface_ptr -> ux_slave_interface_class = class_ptr;
- return(status);
+ return(status);
}
/* There is no driver who want to own this class! */
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 4a3ad240..1a24fae5 100644
--- a/common/core/src/ux_device_stack_microsoft_extension_register.c
+++ b/common/core/src/ux_device_stack_microsoft_extension_register.c
@@ -1,5 +1,6 @@
/***************************************************************************
* Copyright (c) 2024 Microsoft Corporation
+ * Copyright (c) 2026-present Eclipse ThreadX contributors
*
* This program and the accompanying materials are made available under the
* terms of the MIT License which is available at
@@ -60,14 +61,6 @@
/* */
/* Application */
/* */
-/* RELEASE HISTORY */
-/* */
-/* DATE NAME DESCRIPTION */
-/* */
-/* 05-19-2020 Chaoqiong Xiao Initial Version 6.0 */
-/* 09-30-2020 Chaoqiong Xiao Modified comment(s), */
-/* resulting in version 6.1 */
-/* */
/**************************************************************************/
UINT _ux_device_stack_microsoft_extension_register(ULONG vendor_request,
UINT (*vendor_request_function)(ULONG, ULONG, ULONG, ULONG, UCHAR *, ULONG *))
diff --git a/common/core/src/ux_device_stack_set_feature.c b/common/core/src/ux_device_stack_set_feature.c
index 04694f67..63080eca 100644
--- a/common/core/src/ux_device_stack_set_feature.c
+++ b/common/core/src/ux_device_stack_set_feature.c
@@ -1,18 +1,19 @@
/***************************************************************************
- * Copyright (c) 2024 Microsoft Corporation
- *
+ * Copyright (c) 2024 Microsoft Corporation
+ * Copyright (c) 2026-present Eclipse ThreadX contributors
+ *
* This program and the accompanying materials are made available under the
* terms of the MIT License which is available at
* https://opensource.org/licenses/MIT.
- *
+ *
* SPDX-License-Identifier: MIT
**************************************************************************/
/**************************************************************************/
/**************************************************************************/
-/** */
-/** USBX Component */
+/** */
+/** USBX Component */
/** */
/** Device Stack */
/** */
@@ -51,30 +52,15 @@
/* */
/* OUTPUT */
/* */
-/* Completion Status */
+/* Completion Status */
+/* */
+/* CALLS */
+/* */
+/* (ux_slave_dcd_function) DCD controller function */
+/* */
+/* CALLED BY */
/* */
-/* CALLS */
-/* */
-/* (ux_slave_dcd_function) DCD controller function */
-/* */
-/* CALLED BY */
-/* */
/* Device Stack */
-/* */
-/* 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, stalled on not */
-/* supported device requests, */
-/* resulting in version 6.1 */
-/* 07-29-2022 Chaoqiong Xiao Modified comment(s), */
-/* fixed parameter/variable */
-/* names conflict C++ keyword, */
-/* resulting in version 6.1.12 */
/* */
/**************************************************************************/
UINT _ux_device_stack_set_feature(ULONG request_type, ULONG request_value, ULONG request_index)
@@ -103,7 +89,7 @@ UX_SLAVE_ENDPOINT *endpoint_target;
/* The feature can be for either the device or the endpoint. */
switch (request_type & UX_REQUEST_TARGET)
{
-
+
case UX_REQUEST_TARGET_DEVICE:
/* Check if we have a DEVICE_REMOTE_WAKEUP Feature. */
@@ -166,7 +152,7 @@ UX_SLAVE_ENDPOINT *endpoint_target;
#endif
/* Get the first endpoint for this interface. */
endpoint_target = interface_ptr -> ux_slave_interface_first_endpoint;
-
+
/* Parse all the endpoints. */
while (endpoint_target != UX_NULL)
{
@@ -196,11 +182,11 @@ UX_SLAVE_ENDPOINT *endpoint_target;
/* Intentionally fall through into the default case. */
/* fall through */
default:
-
+
/* We stall the command. */
dcd -> ux_slave_dcd_function(dcd, UX_DCD_STALL_ENDPOINT, endpoint);
-
+
/* No more work to do here. The command failed but the upper layer does not depend on it. */
- return(UX_SUCCESS);
+ return(UX_SUCCESS);
}
}
diff --git a/common/core/src/ux_device_stack_tasks_run.c b/common/core/src/ux_device_stack_tasks_run.c
index 24c9bf26..b2c69847 100644
--- a/common/core/src/ux_device_stack_tasks_run.c
+++ b/common/core/src/ux_device_stack_tasks_run.c
@@ -1,10 +1,11 @@
/***************************************************************************
- * Copyright (c) 2024 Microsoft Corporation
- *
+ * Copyright (c) 2024 Microsoft Corporation
+ * Copyright (c) 2026-present Eclipse ThreadX contributors
+ *
* This program and the accompanying materials are made available under the
* terms of the MIT License which is available at
* https://opensource.org/licenses/MIT.
- *
+ *
* SPDX-License-Identifier: MIT
**************************************************************************/
@@ -63,12 +64,6 @@
/* */
/* Application */
/* */
-/* RELEASE HISTORY */
-/* */
-/* DATE NAME DESCRIPTION */
-/* */
-/* 01-31-2022 Chaoqiong Xiao Initial Version 6.1.10 */
-/* */
/**************************************************************************/
UINT _ux_device_stack_tasks_run(VOID)
{
diff --git a/common/core/src/ux_device_stack_transfer_abort.c b/common/core/src/ux_device_stack_transfer_abort.c
index f340c2d4..db0bfe37 100644
--- a/common/core/src/ux_device_stack_transfer_abort.c
+++ b/common/core/src/ux_device_stack_transfer_abort.c
@@ -1,18 +1,19 @@
/***************************************************************************
- * Copyright (c) 2024 Microsoft Corporation
- *
+ * Copyright (c) 2024 Microsoft Corporation
+ * Copyright (c) 2026-present Eclipse ThreadX contributors
+ *
* This program and the accompanying materials are made available under the
* terms of the MIT License which is available at
* https://opensource.org/licenses/MIT.
- *
+ *
* SPDX-License-Identifier: MIT
**************************************************************************/
/**************************************************************************/
/**************************************************************************/
-/** */
-/** USBX Component */
+/** */
+/** USBX Component */
/** */
/** Device Stack */
/** */
@@ -54,31 +55,16 @@
/* */
/* OUTPUT */
/* */
-/* Completion Status */
+/* Completion Status */
+/* */
+/* CALLS */
+/* */
+/* _ux_utility_semaphore_put Put semaphore */
+/* */
+/* CALLED BY */
/* */
-/* CALLS */
-/* */
-/* _ux_utility_semaphore_put Put semaphore */
-/* */
-/* CALLED BY */
-/* */
-/* Application */
+/* Application */
/* Device Stack */
-/* */
-/* RELEASE HISTORY */
-/* */
-/* 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 */
-/* 01-31-2022 Chaoqiong Xiao Modified comment(s), */
-/* added standalone support, */
-/* assigned aborting code, */
-/* resulting in version 6.1.10 */
/* */
/**************************************************************************/
UINT _ux_device_stack_transfer_abort(UX_SLAVE_TRANSFER *transfer_request, ULONG completion_code)
@@ -113,8 +99,8 @@ UX_SLAVE_DCD *dcd;
UX_RESTORE
/* We need to set the completion code for the transfer to aborted. Note
- that the transfer request function cannot simultaneously modify this
- because if the transfer was pending, then the transfer's thread is
+ that the transfer request function cannot simultaneously modify this
+ because if the transfer was pending, then the transfer's thread is
currently waiting for it to complete. */
transfer_request -> ux_slave_transfer_request_status = UX_TRANSFER_STATUS_ABORT;
@@ -129,6 +115,6 @@ UX_SLAVE_DCD *dcd;
}
/* This function never fails. */
- return(UX_SUCCESS);
+ return(UX_SUCCESS);
}
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 ddf00f5e..540d84a7 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
@@ -1,18 +1,19 @@
/***************************************************************************
- * Copyright (c) 2024 Microsoft Corporation
- *
+ * Copyright (c) 2024 Microsoft Corporation
+ * Copyright (c) 2026-present Eclipse ThreadX contributors
+ *
* This program and the accompanying materials are made available under the
* terms of the MIT License which is available at
* https://opensource.org/licenses/MIT.
- *
+ *
* SPDX-License-Identifier: MIT
**************************************************************************/
/**************************************************************************/
/**************************************************************************/
-/** */
-/** USBX Component */
+/** */
+/** USBX Component */
/** */
/** Device Stack */
/** */
@@ -51,36 +52,28 @@
/* */
/* OUTPUT */
/* */
-/* Completion Status */
+/* Completion Status */
+/* */
+/* CALLS */
+/* */
+/* _ux_device_stack_transfer_abort Transfer abort */
+/* */
+/* CALLED BY */
/* */
-/* CALLS */
-/* */
-/* _ux_device_stack_transfer_abort Transfer abort */
-/* */
-/* CALLED BY */
-/* */
/* Device Stack */
-/* */
-/* RELEASE HISTORY */
-/* */
-/* DATE NAME DESCRIPTION */
-/* */
-/* 05-19-2020 Chaoqiong Xiao Initial Version 6.0 */
-/* 09-30-2020 Chaoqiong Xiao Modified comment(s), */
-/* resulting in version 6.1 */
/* */
/**************************************************************************/
UINT _ux_device_stack_transfer_all_request_abort(UX_SLAVE_ENDPOINT *endpoint, ULONG completion_code)
{
-UX_SLAVE_TRANSFER *transfer_request;
+UX_SLAVE_TRANSFER *transfer_request;
/* If trace is enabled, insert this event into the trace buffer. */
UX_TRACE_IN_LINE_INSERT(UX_TRACE_DEVICE_STACK_TRANSFER_ALL_REQUEST_ABORT, endpoint, completion_code, 0, 0, UX_TRACE_DEVICE_STACK_EVENTS, 0, 0)
/* Get the transfer request for this endpoint. */
transfer_request = &endpoint -> ux_slave_endpoint_transfer_request;
-
+
/* Abort this request. */
_ux_device_stack_transfer_abort(transfer_request, 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 dba68792..78f3c424 100644
--- a/common/core/src/ux_device_stack_transfer_request.c
+++ b/common/core/src/ux_device_stack_transfer_request.c
@@ -1,18 +1,19 @@
/***************************************************************************
- * Copyright (c) 2024 Microsoft Corporation
- *
+ * Copyright (c) 2024 Microsoft Corporation
+ * Copyright (c) 2026-present Eclipse ThreadX contributors
+ *
* This program and the accompanying materials are made available under the
* terms of the MIT License which is available at
* https://opensource.org/licenses/MIT.
- *
+ *
* SPDX-License-Identifier: MIT
**************************************************************************/
/**************************************************************************/
/**************************************************************************/
-/** */
-/** USBX Component */
+/** */
+/** USBX Component */
/** */
/** Device Stack */
/** */
@@ -53,35 +54,21 @@
/* */
/* OUTPUT */
/* */
-/* Completion Status */
+/* Completion Status */
+/* */
+/* CALLS */
+/* */
+/* (ux_slave_dcd_function) Slave DCD dispatch function */
+/* _ux_utility_delay_ms Delay ms */
+/* */
+/* CALLED BY */
/* */
-/* CALLS */
-/* */
-/* (ux_slave_dcd_function) Slave DCD dispatch function */
-/* _ux_utility_delay_ms Delay ms */
-/* */
-/* CALLED BY */
-/* */
-/* Application */
+/* Application */
/* Device Stack */
-/* */
-/* RELEASE HISTORY */
-/* */
-/* 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 */
-/* 01-31-2022 Chaoqiong Xiao Modified comment(s), */
-/* added standalone support, */
-/* resulting in version 6.1.10 */
/* */
/**************************************************************************/
-UINT _ux_device_stack_transfer_request(UX_SLAVE_TRANSFER *transfer_request,
- ULONG slave_length,
+UINT _ux_device_stack_transfer_request(UX_SLAVE_TRANSFER *transfer_request,
+ ULONG slave_length,
ULONG host_length)
{
#if defined(UX_DEVICE_STANDALONE)
@@ -122,7 +109,7 @@ ULONG device_state;
|| (device_state == UX_DEVICE_CONFIGURED))
/* Set the transfer to pending. */
- transfer_request -> ux_slave_transfer_request_status = UX_TRANSFER_STATUS_PENDING;
+ transfer_request -> ux_slave_transfer_request_status = UX_TRANSFER_STATUS_PENDING;
else
{
@@ -134,7 +121,7 @@ ULONG device_state;
/* Restore interrupts. */
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)
@@ -143,7 +130,7 @@ ULONG device_state;
/* Get the endpoint associated with this transaction. */
endpoint = transfer_request -> ux_slave_transfer_request_endpoint;
-
+
/* If the endpoint is non Control, check the endpoint direction and set the data phase direction. */
if ((endpoint -> ux_slave_endpoint_descriptor.bmAttributes & UX_MASK_ENDPOINT_TYPE) != UX_CONTROL_ENDPOINT)
{
@@ -158,16 +145,16 @@ ULONG device_state;
/* Isolate the direction from the endpoint address. */
if ((endpoint -> ux_slave_endpoint_descriptor.bEndpointAddress & UX_ENDPOINT_DIRECTION) == UX_ENDPOINT_IN)
transfer_request -> ux_slave_transfer_request_phase = UX_TRANSFER_PHASE_DATA_OUT;
- else
+ else
transfer_request -> ux_slave_transfer_request_phase = UX_TRANSFER_PHASE_DATA_IN;
- }
+ }
- /* See if we need to force a zero length packet at the end of the transfer.
+ /* See if we need to force a zero length packet at the end of the transfer.
This happens on a DATA IN and when the host requested length is not met
- and the last packet is on a boundary. If slave_length is zero, then it is
+ and the last packet is on a boundary. If slave_length is zero, then it is
a explicit ZLP request, no need to force ZLP. */
if ((transfer_request -> ux_slave_transfer_request_phase == UX_TRANSFER_PHASE_DATA_OUT) &&
- (slave_length != 0) && (host_length != slave_length) &&
+ (slave_length != 0) && (host_length != slave_length) &&
(slave_length % endpoint -> ux_slave_endpoint_descriptor.wMaxPacketSize) == 0)
{
@@ -190,7 +177,7 @@ ULONG device_state;
transfer_request -> ux_slave_transfer_request_in_transfer_length = slave_length;
/* Save the buffer pointer. */
- transfer_request -> ux_slave_transfer_request_current_data_pointer =
+ transfer_request -> ux_slave_transfer_request_current_data_pointer =
transfer_request -> ux_slave_transfer_request_data_pointer;
/* Call the DCD driver transfer function. */
diff --git a/common/core/src/ux_device_stack_transfer_run.c b/common/core/src/ux_device_stack_transfer_run.c
index 3be1ddd6..bafd7513 100644
--- a/common/core/src/ux_device_stack_transfer_run.c
+++ b/common/core/src/ux_device_stack_transfer_run.c
@@ -1,10 +1,11 @@
/***************************************************************************
- * Copyright (c) 2024 Microsoft Corporation
- *
+ * Copyright (c) 2024 Microsoft Corporation
+ * Copyright (c) 2026-present Eclipse ThreadX contributors
+ *
* This program and the accompanying materials are made available under the
* terms of the MIT License which is available at
* https://opensource.org/licenses/MIT.
- *
+ *
* SPDX-License-Identifier: MIT
**************************************************************************/
@@ -74,12 +75,6 @@
/* Application */
/* Device Stack */
/* */
-/* RELEASE HISTORY */
-/* */
-/* DATE NAME DESCRIPTION */
-/* */
-/* 01-31-2022 Chaoqiong Xiao Initial Version 6.1.10 */
-/* */
/**************************************************************************/
UINT _ux_device_stack_transfer_run(UX_SLAVE_TRANSFER *transfer_request, ULONG slave_length, ULONG host_length)
{
diff --git a/common/core/src/ux_device_stack_uninitialize.c b/common/core/src/ux_device_stack_uninitialize.c
index f9b98075..85ec0673 100644
--- a/common/core/src/ux_device_stack_uninitialize.c
+++ b/common/core/src/ux_device_stack_uninitialize.c
@@ -1,18 +1,19 @@
/***************************************************************************
- * Copyright (c) 2024 Microsoft Corporation
- *
+ * Copyright (c) 2024 Microsoft Corporation
+ * Copyright (c) 2026-present Eclipse ThreadX contributors
+ *
* This program and the accompanying materials are made available under the
* terms of the MIT License which is available at
* https://opensource.org/licenses/MIT.
- *
+ *
* SPDX-License-Identifier: MIT
**************************************************************************/
/**************************************************************************/
/**************************************************************************/
-/** */
-/** USBX Component */
+/** */
+/** USBX Component */
/** */
/** Device Stack */
/** */
@@ -46,35 +47,16 @@
/* */
/* OUTPUT */
/* */
-/* Completion Status */
+/* Completion Status */
+/* */
+/* CALLS */
/* */
-/* CALLS */
-/* */
-/* _ux_utility_memory_free Free */
+/* _ux_utility_memory_free Free */
/* _ux_utility_semaphore_delete Delete semaphore */
-/* */
-/* 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), */
-/* resulting in version 6.1 */
-/* 04-02-2021 Chaoqiong Xiao Modified comment(s), */
-/* fixed uninitialize in case */
-/* there is no EP except EP0, */
-/* resulting in version 6.1.6 */
-/* 01-31-2022 Chaoqiong Xiao Modified comment(s), */
-/* added standalone support, */
-/* resulting in version 6.1.10 */
-/* 10-31-2023 Chaoqiong Xiao Modified comment(s), */
-/* added a new mode to manage */
-/* endpoint buffer in classes, */
-/* resulting in version 6.3.0 */
+/* */
+/* CALLED BY */
+/* */
+/* Application */
/* */
/**************************************************************************/
UINT _ux_device_stack_uninitialize(VOID)
@@ -93,7 +75,7 @@ ULONG endpoints_found;
/* Free class memory. */
_ux_utility_memory_free(_ux_system_slave -> ux_system_slave_class_array);
- /* Allocate some memory for the Control Endpoint. First get the address of the transfer request for the
+ /* Allocate some memory for the Control Endpoint. First get the address of the transfer request for the
control endpoint. */
transfer_request = &device -> ux_slave_device_control_endpoint.ux_slave_endpoint_transfer_request;
@@ -102,7 +84,7 @@ ULONG endpoints_found;
/* Get the number of endpoints found in the device framework. */
endpoints_found = device -> ux_slave_device_endpoints_pool_number;
-
+
/* Get the endpoint pool address in the device container. */
endpoints_pool = device -> ux_slave_device_endpoints_pool;
@@ -118,7 +100,7 @@ ULONG endpoints_found;
/* Remove the TX semaphore for the endpoint. */
_ux_device_semaphore_delete(&endpoints_pool -> ux_slave_endpoint_transfer_request.ux_slave_transfer_request_semaphore);
-
+
/* Next endpoint. */
endpoints_pool++;
}
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 4c1516e5..b1c1189f 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
@@ -1,18 +1,19 @@
/***************************************************************************
- * Copyright (c) 2024 Microsoft Corporation
- *
+ * Copyright (c) 2024 Microsoft Corporation
+ * Copyright (c) 2026-present Eclipse ThreadX contributors
+ *
* This program and the accompanying materials are made available under the
* terms of the MIT License which is available at
* https://opensource.org/licenses/MIT.
- *
+ *
* SPDX-License-Identifier: MIT
**************************************************************************/
/**************************************************************************/
/**************************************************************************/
-/** */
-/** USBX Component */
+/** */
+/** USBX Component */
/** */
/** Host Simulator Controller Driver */
/** */
@@ -28,45 +29,37 @@
#include "ux_hcd_sim_host.h"
-/**************************************************************************/
-/* */
-/* FUNCTION RELEASE */
-/* */
-/* _ux_hcd_sim_host_asynch_queue_process PORTABLE C */
+/**************************************************************************/
+/* */
+/* FUNCTION RELEASE */
+/* */
+/* _ux_hcd_sim_host_asynch_queue_process PORTABLE C */
/* 6.1 */
/* AUTHOR */
/* */
/* Chaoqiong Xiao, Microsoft Corporation */
/* */
/* DESCRIPTION */
-/* */
-/* This function process the asynchronous transactions that happened */
-/* in the last frame. We read the ATL buffer and search for completed */
-/* PTDs and reflect the completion in the higher level ED/TD. */
-/* */
-/* INPUT */
-/* */
-/* hcd_sim_host Pointer to host controller */
-/* */
-/* OUTPUT */
-/* */
-/* None */
-/* */
-/* CALLS */
-/* */
-/* None */
-/* */
-/* CALLED BY */
-/* */
+/* */
+/* This function process the asynchronous transactions that happened */
+/* in the last frame. We read the ATL buffer and search for completed */
+/* PTDs and reflect the completion in the higher level ED/TD. */
+/* */
+/* INPUT */
+/* */
+/* hcd_sim_host Pointer to host controller */
+/* */
+/* OUTPUT */
+/* */
+/* None */
+/* */
+/* CALLS */
+/* */
+/* None */
+/* */
+/* CALLED BY */
+/* */
/* Host Simulator Controller Driver */
-/* */
-/* RELEASE HISTORY */
-/* */
-/* DATE NAME DESCRIPTION */
-/* */
-/* 05-19-2020 Chaoqiong Xiao Initial Version 6.0 */
-/* 09-30-2020 Chaoqiong Xiao Modified comment(s), */
-/* resulting in version 6.1 */
/* */
/**************************************************************************/
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 1427f80c..609fe9b3 100644
--- a/common/core/src/ux_hcd_sim_host_asynch_schedule.c
+++ b/common/core/src/ux_hcd_sim_host_asynch_schedule.c
@@ -1,18 +1,19 @@
/***************************************************************************
- * Copyright (c) 2024 Microsoft Corporation
- *
+ * Copyright (c) 2024 Microsoft Corporation
+ * Copyright (c) 2026-present Eclipse ThreadX contributors
+ *
* This program and the accompanying materials are made available under the
* terms of the MIT License which is available at
* https://opensource.org/licenses/MIT.
- *
+ *
* SPDX-License-Identifier: MIT
**************************************************************************/
/**************************************************************************/
/**************************************************************************/
-/** */
-/** USBX Component */
+/** */
+/** USBX Component */
/** */
/** Host Simulator Controller Driver */
/** */
@@ -28,43 +29,35 @@
#include "ux_hcd_sim_host.h"
-/**************************************************************************/
-/* */
-/* FUNCTION RELEASE */
-/* */
-/* _ux_hcd_sim_host_asynch_schedule PORTABLE C */
+/**************************************************************************/
+/* */
+/* FUNCTION RELEASE */
+/* */
+/* _ux_hcd_sim_host_asynch_schedule PORTABLE C */
/* 6.1 */
/* AUTHOR */
/* */
/* Chaoqiong Xiao, Microsoft Corporation */
/* */
/* DESCRIPTION */
-/* */
-/* This function schedules new transfers from the control/bulk lists. */
-/* */
-/* INPUT */
-/* */
-/* hcd_sim_host Pointer to host controller */
-/* */
-/* OUTPUT */
-/* */
-/* None */
-/* */
-/* CALLS */
-/* */
-/* _ux_hcd_sim_host_transaction_schedule Schedule simulator transaction*/
-/* */
-/* CALLED BY */
-/* */
+/* */
+/* This function schedules new transfers from the control/bulk lists. */
+/* */
+/* INPUT */
+/* */
+/* hcd_sim_host Pointer to host controller */
+/* */
+/* OUTPUT */
+/* */
+/* None */
+/* */
+/* CALLS */
+/* */
+/* _ux_hcd_sim_host_transaction_schedule Schedule simulator transaction*/
+/* */
+/* CALLED BY */
+/* */
/* Host Simulator Controller Driver */
-/* */
-/* RELEASE HISTORY */
-/* */
-/* DATE NAME DESCRIPTION */
-/* */
-/* 05-19-2020 Chaoqiong Xiao Initial Version 6.0 */
-/* 09-30-2020 Chaoqiong Xiao Modified comment(s), */
-/* resulting in version 6.1 */
/* */
/**************************************************************************/
VOID _ux_hcd_sim_host_asynch_schedule(UX_HCD_SIM_HOST *hcd_sim_host)
@@ -73,7 +66,7 @@ VOID _ux_hcd_sim_host_asynch_schedule(UX_HCD_SIM_HOST *hcd_sim_host)
UX_HCD_SIM_HOST_ED *ed;
UX_HCD_SIM_HOST_ED *first_ed;
UINT status;
-
+
/* Get the pointer to the current ED in the asynchronous list. */
ed = hcd_sim_host -> ux_hcd_sim_host_asynch_current_ed;
@@ -93,7 +86,7 @@ UINT status;
first_ed = ed;
/* In simulation, we are not tied to bandwidth limitation. */
- do
+ do
{
/* Check if this ED has a tail and head TD different. */
@@ -103,15 +96,15 @@ UINT status;
/* Schedule this transaction with the device simulator. */
status = _ux_hcd_sim_host_transaction_schedule(hcd_sim_host, ed);
- /* If the TD has been added to the list, we can memorize this ED has
- being served and make the next ED as the one to be first scanned
+ /* If the TD has been added to the list, we can memorize this ED has
+ being served and make the next ED as the one to be first scanned
at the next SOF. */
if (status == UX_SUCCESS)
{
if (ed -> ux_sim_host_ed_next_ed == UX_NULL)
hcd_sim_host -> ux_hcd_sim_host_asynch_current_ed = hcd_sim_host -> ux_hcd_sim_host_asynch_head_ed;
- else
+ else
hcd_sim_host -> ux_hcd_sim_host_asynch_current_ed = ed -> ux_sim_host_ed_next_ed;
}
}
@@ -119,7 +112,7 @@ UINT status;
/* Point to the next ED in the list. Check if at end of list. */
if (ed -> ux_sim_host_ed_next_ed == UX_NULL)
ed = hcd_sim_host -> ux_hcd_sim_host_asynch_head_ed;
- else
+ else
ed = ed -> ux_sim_host_ed_next_ed;
} while ((ed) && (ed != first_ed));
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 ebbced9b..77faa4b5 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
@@ -1,18 +1,19 @@
/***************************************************************************
- * Copyright (c) 2024 Microsoft Corporation
- *
+ * Copyright (c) 2024 Microsoft Corporation
+ * Copyright (c) 2026-present Eclipse ThreadX contributors
+ *
* This program and the accompanying materials are made available under the
* terms of the MIT License which is available at
* https://opensource.org/licenses/MIT.
- *
+ *
* SPDX-License-Identifier: MIT
**************************************************************************/
/**************************************************************************/
/**************************************************************************/
-/** */
-/** USBX Component */
+/** */
+/** USBX Component */
/** */
/** Host Simulator Controller Driver */
/** */
@@ -28,46 +29,38 @@
#include "ux_hcd_sim_host.h"
-/**************************************************************************/
-/* */
-/* FUNCTION RELEASE */
-/* */
-/* _ux_hcd_sim_host_asynchronous_endpoint_create PORTABLE C */
+/**************************************************************************/
+/* */
+/* FUNCTION RELEASE */
+/* */
+/* _ux_hcd_sim_host_asynchronous_endpoint_create PORTABLE C */
/* 6.1 */
/* AUTHOR */
/* */
/* Chaoqiong Xiao, Microsoft Corporation */
/* */
/* DESCRIPTION */
-/* */
+/* */
/* This function will create an asynchronous endpoint. The control */
-/* and bulk endpoints fall into this category. */
-/* */
-/* INPUT */
-/* */
-/* hcd_sim_host Pointer to host controller */
-/* endpoint Pointer to endpoint */
-/* */
-/* OUTPUT */
-/* */
-/* Completion Status */
-/* */
-/* CALLS */
-/* */
-/* _ux_hcd_sim_host_ed_obtain Obtain host ED */
-/* _ux_hcd_sim_host_regular_td_obtain Obtain host regular TD */
-/* */
-/* CALLED BY */
-/* */
+/* and bulk endpoints fall into this category. */
+/* */
+/* INPUT */
+/* */
+/* hcd_sim_host Pointer to host controller */
+/* endpoint Pointer to endpoint */
+/* */
+/* OUTPUT */
+/* */
+/* Completion Status */
+/* */
+/* CALLS */
+/* */
+/* _ux_hcd_sim_host_ed_obtain Obtain host ED */
+/* _ux_hcd_sim_host_regular_td_obtain Obtain host regular TD */
+/* */
+/* CALLED BY */
+/* */
/* Host Simulator Controller Driver */
-/* */
-/* RELEASE HISTORY */
-/* */
-/* DATE NAME DESCRIPTION */
-/* */
-/* 05-19-2020 Chaoqiong Xiao Initial Version 6.0 */
-/* 09-30-2020 Chaoqiong Xiao Modified comment(s), */
-/* resulting in version 6.1 */
/* */
/**************************************************************************/
UINT _ux_hcd_sim_host_asynchronous_endpoint_create(UX_HCD_SIM_HOST *hcd_sim_host, UX_ENDPOINT *endpoint)
@@ -81,8 +74,8 @@ UX_HCD_SIM_HOST_TD *td;
/* We need to take into account the nature of the HCD to define the max size
of any transfer in the transfer request. */
endpoint -> ux_endpoint_transfer_request.ux_transfer_request_maximum_length = UX_HCD_SIM_HOST_MAX_PAYLOAD;
-
- /* Obtain a ED for this new endpoint. This ED will live as long as the endpoint is active
+
+ /* Obtain a ED for this new endpoint. This ED will live as long as the endpoint is active
and will be the container for the TDs. */
ed = _ux_hcd_sim_host_ed_obtain(hcd_sim_host);
if (ed == UX_NULL)
@@ -102,11 +95,11 @@ UX_HCD_SIM_HOST_TD *td;
/* Now do the opposite, attach the ED container to the physical ED. */
ed -> ux_sim_host_ed_endpoint = endpoint;
-
+
/* Hook the TD to both the tail and head of the ED. */
ed -> ux_sim_host_ed_tail_td = td;
ed -> ux_sim_host_ed_head_td = td;
-
+
/* Attach this ED to the asynch list. */
head_ed = hcd_sim_host -> ux_hcd_sim_host_asynch_head_ed;
ed -> ux_sim_host_ed_next_ed = head_ed;
@@ -118,6 +111,6 @@ UX_HCD_SIM_HOST_TD *td;
head_ed -> ux_sim_host_ed_previous_ed = ed;
/* Return successful completion. */
- return(UX_SUCCESS);
+ return(UX_SUCCESS);
}
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 0fbff1a4..694a5ba1 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
@@ -1,18 +1,19 @@
/***************************************************************************
- * Copyright (c) 2024 Microsoft Corporation
- *
+ * Copyright (c) 2024 Microsoft Corporation
+ * Copyright (c) 2026-present Eclipse ThreadX contributors
+ *
* This program and the accompanying materials are made available under the
* terms of the MIT License which is available at
* https://opensource.org/licenses/MIT.
- *
+ *
* SPDX-License-Identifier: MIT
**************************************************************************/
/**************************************************************************/
/**************************************************************************/
-/** */
-/** USBX Component */
+/** */
+/** USBX Component */
/** */
/** Host Simulator Controller Driver */
/** */
@@ -28,45 +29,37 @@
#include "ux_hcd_sim_host.h"
-/**************************************************************************/
-/* */
-/* FUNCTION RELEASE */
-/* */
-/* _ux_hcd_sim_host_asynchronous_endpoint_destroy PORTABLE C */
+/**************************************************************************/
+/* */
+/* FUNCTION RELEASE */
+/* */
+/* _ux_hcd_sim_host_asynchronous_endpoint_destroy PORTABLE C */
/* 6.1 */
/* AUTHOR */
/* */
/* Chaoqiong Xiao, Microsoft Corporation */
/* */
/* DESCRIPTION */
-/* */
+/* */
/* This function will destroy an asynchronous endpoint. The control */
-/* and bulk endpoints fall into this category. */
-/* */
-/* INPUT */
-/* */
-/* hcd_sim_host Pointer to host controller */
-/* endpoint Pointer to endpoint */
-/* */
-/* OUTPUT */
-/* */
-/* Completion Status */
-/* */
-/* CALLS */
-/* */
-/* None */
-/* */
-/* CALLED BY */
-/* */
+/* and bulk endpoints fall into this category. */
+/* */
+/* INPUT */
+/* */
+/* hcd_sim_host Pointer to host controller */
+/* endpoint Pointer to endpoint */
+/* */
+/* OUTPUT */
+/* */
+/* Completion Status */
+/* */
+/* CALLS */
+/* */
+/* None */
+/* */
+/* CALLED BY */
+/* */
/* Host Simulator Controller Driver */
-/* */
-/* RELEASE HISTORY */
-/* */
-/* DATE NAME DESCRIPTION */
-/* */
-/* 05-19-2020 Chaoqiong Xiao Initial Version 6.0 */
-/* 09-30-2020 Chaoqiong Xiao Modified comment(s), */
-/* resulting in version 6.1 */
/* */
/**************************************************************************/
UINT _ux_hcd_sim_host_asynchronous_endpoint_destroy(UX_HCD_SIM_HOST *hcd_sim_host, UX_ENDPOINT *endpoint)
@@ -77,7 +70,7 @@ UX_HCD_SIM_HOST_ED *previous_ed;
UX_HCD_SIM_HOST_ED *next_ed;
UX_HCD_SIM_HOST_TD *td;
-
+
/* From the endpoint container fetch the host simulator ED descriptor. */
ed = (UX_HCD_SIM_HOST_ED *) endpoint -> ux_endpoint_ed;
@@ -100,11 +93,11 @@ UX_HCD_SIM_HOST_TD *td;
/* Update the previous ED pointer in the next ED if exists. */
if (next_ed != UX_NULL)
next_ed -> ux_sim_host_ed_previous_ed = previous_ed;
-
+
/* Determine if we need to adjust the current ED. */
if (hcd_sim_host -> ux_hcd_sim_host_asynch_current_ed == ed)
{
-
+
/* Move the current to the next. */
hcd_sim_host -> ux_hcd_sim_host_asynch_current_ed = next_ed;
}
@@ -117,6 +110,6 @@ UX_HCD_SIM_HOST_TD *td;
ed -> ux_sim_host_ed_status = UX_UNUSED;
/* Return successful completion. */
- return(UX_SUCCESS);
+ return(UX_SUCCESS);
}
diff --git a/common/core/src/ux_hcd_sim_host_controller_disable.c b/common/core/src/ux_hcd_sim_host_controller_disable.c
index 316750d6..d0e8aff7 100644
--- a/common/core/src/ux_hcd_sim_host_controller_disable.c
+++ b/common/core/src/ux_hcd_sim_host_controller_disable.c
@@ -1,10 +1,11 @@
/***************************************************************************
- * Copyright (c) 2024 Microsoft Corporation
- *
+ * Copyright (c) 2024 Microsoft Corporation
+ * Copyright (c) 2026-present Eclipse ThreadX contributors
+ *
* This program and the accompanying materials are made available under the
* terms of the MIT License which is available at
* https://opensource.org/licenses/MIT.
- *
+ *
* SPDX-License-Identifier: MIT
**************************************************************************/
@@ -59,15 +60,6 @@
/* */
/* Host Simulator Controller Driver */
/* */
-/* RELEASE HISTORY */
-/* */
-/* DATE NAME DESCRIPTION */
-/* */
-/* 09-30-2020 Chaoqiong Xiao Initial Version 6.1 */
-/* 11-09-2020 Chaoqiong Xiao Modified comment(s), */
-/* did controller halt only, */
-/* resulting in version 6.1.2 */
-/* */
/**************************************************************************/
UINT _ux_hcd_sim_host_controller_disable(UX_HCD_SIM_HOST *hcd_sim_host)
{
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 2cb5f349..6333b8f8 100644
--- a/common/core/src/ux_hcd_sim_host_ed_obtain.c
+++ b/common/core/src/ux_hcd_sim_host_ed_obtain.c
@@ -1,18 +1,19 @@
/***************************************************************************
- * Copyright (c) 2024 Microsoft Corporation
- *
+ * Copyright (c) 2024 Microsoft Corporation
+ * Copyright (c) 2026-present Eclipse ThreadX contributors
+ *
* This program and the accompanying materials are made available under the
* terms of the MIT License which is available at
* https://opensource.org/licenses/MIT.
- *
+ *
* SPDX-License-Identifier: MIT
**************************************************************************/
/**************************************************************************/
/**************************************************************************/
-/** */
-/** USBX Component */
+/** */
+/** USBX Component */
/** */
/** Host Simulator Controller Driver */
/** */
@@ -28,45 +29,35 @@
#include "ux_hcd_sim_host.h"
-/**************************************************************************/
-/* */
-/* FUNCTION RELEASE */
-/* */
-/* _ux_hcd_sim_host_ed_obtain PORTABLE C */
+/**************************************************************************/
+/* */
+/* FUNCTION RELEASE */
+/* */
+/* _ux_hcd_sim_host_ed_obtain PORTABLE C */
/* 6.1 */
/* AUTHOR */
/* */
/* Chaoqiong Xiao, Microsoft Corporation */
/* */
/* DESCRIPTION */
-/* */
-/* This function obtains a free ED from the ED list. */
-/* */
-/* INPUT */
-/* */
-/* hcd_sim_host Pointer to host controller */
-/* */
-/* OUTPUT */
-/* */
-/* UX_HCD_SIM_HOST_ED * Pointer to ED */
-/* */
-/* CALLS */
-/* */
-/* _ux_utility_memory_set Set memory block */
-/* */
-/* CALLED BY */
-/* */
+/* */
+/* This function obtains a free ED from the ED list. */
+/* */
+/* INPUT */
+/* */
+/* hcd_sim_host Pointer to host controller */
+/* */
+/* OUTPUT */
+/* */
+/* UX_HCD_SIM_HOST_ED * Pointer to ED */
+/* */
+/* CALLS */
+/* */
+/* _ux_utility_memory_set Set memory block */
+/* */
+/* CALLED BY */
+/* */
/* Host Simulator Controller Driver */
-/* */
-/* RELEASE HISTORY */
-/* */
-/* DATE NAME DESCRIPTION */
-/* */
-/* 05-19-2020 Chaoqiong Xiao Initial Version 6.0 */
-/* 09-30-2020 Chaoqiong Xiao Modified comment(s), */
-/* verified memset and memcpy */
-/* cases, */
-/* resulting in version 6.1 */
/* */
/**************************************************************************/
UX_HCD_SIM_HOST_ED *_ux_hcd_sim_host_ed_obtain(UX_HCD_SIM_HOST *hcd_sim_host)
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 ce674015..e836cf9b 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
@@ -1,18 +1,19 @@
/***************************************************************************
- * Copyright (c) 2024 Microsoft Corporation
- *
+ * Copyright (c) 2024 Microsoft Corporation
+ * Copyright (c) 2026-present Eclipse ThreadX contributors
+ *
* This program and the accompanying materials are made available under the
* terms of the MIT License which is available at
* https://opensource.org/licenses/MIT.
- *
+ *
* SPDX-License-Identifier: MIT
**************************************************************************/
/**************************************************************************/
/**************************************************************************/
-/** */
-/** USBX Component */
+/** */
+/** USBX Component */
/** */
/** Host Simulator Controller Driver */
/** */
@@ -28,44 +29,36 @@
#include "ux_hcd_sim_host.h"
-/**************************************************************************/
-/* */
-/* FUNCTION RELEASE */
-/* */
-/* _ux_hcd_sim_host_ed_td_clean PORTABLE C */
+/**************************************************************************/
+/* */
+/* FUNCTION RELEASE */
+/* */
+/* _ux_hcd_sim_host_ed_td_clean PORTABLE C */
/* 6.1 */
/* AUTHOR */
/* */
/* Chaoqiong Xiao, Microsoft Corporation */
/* */
/* DESCRIPTION */
-/* */
-/* This function process cleans the ED of all TDs except the last */
-/* dummy TD. */
-/* */
-/* INPUT */
-/* */
-/* ed Pointer to ED */
-/* */
-/* OUTPUT */
-/* */
-/* None */
-/* */
-/* CALLS */
-/* */
-/* None */
-/* */
-/* CALLED BY */
-/* */
+/* */
+/* This function process cleans the ED of all TDs except the last */
+/* dummy TD. */
+/* */
+/* INPUT */
+/* */
+/* ed Pointer to ED */
+/* */
+/* OUTPUT */
+/* */
+/* None */
+/* */
+/* CALLS */
+/* */
+/* None */
+/* */
+/* CALLED BY */
+/* */
/* Host Simulator Controller Driver */
-/* */
-/* RELEASE HISTORY */
-/* */
-/* DATE NAME DESCRIPTION */
-/* */
-/* 05-19-2020 Chaoqiong Xiao Initial Version 6.0 */
-/* 09-30-2020 Chaoqiong Xiao Modified comment(s), */
-/* resulting in version 6.1 */
/* */
/**************************************************************************/
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 76c85156..e1c6366d 100644
--- a/common/core/src/ux_hcd_sim_host_endpoint_reset.c
+++ b/common/core/src/ux_hcd_sim_host_endpoint_reset.c
@@ -1,18 +1,19 @@
/***************************************************************************
- * Copyright (c) 2024 Microsoft Corporation
- *
+ * Copyright (c) 2024 Microsoft Corporation
+ * Copyright (c) 2026-present Eclipse ThreadX contributors
+ *
* This program and the accompanying materials are made available under the
* terms of the MIT License which is available at
* https://opensource.org/licenses/MIT.
- *
+ *
* SPDX-License-Identifier: MIT
**************************************************************************/
/**************************************************************************/
/**************************************************************************/
-/** */
-/** USBX Component */
+/** */
+/** USBX Component */
/** */
/** Host Simulator Controller Driver */
/** */
@@ -28,54 +29,43 @@
#include "ux_hcd_sim_host.h"
-/**************************************************************************/
-/* */
-/* FUNCTION RELEASE */
-/* */
-/* _ux_hcd_sim_host_endpoint_reset PORTABLE C */
+/**************************************************************************/
+/* */
+/* FUNCTION RELEASE */
+/* */
+/* _ux_hcd_sim_host_endpoint_reset PORTABLE C */
/* 6.1.10 */
/* AUTHOR */
/* */
/* Chaoqiong Xiao, Microsoft Corporation */
/* */
/* DESCRIPTION */
-/* */
-/* This function will reset an endpoint. */
-/* */
-/* INPUT */
-/* */
-/* hcd_sim_host Pointer to host controller */
-/* endpoint Pointer to endpoint */
-/* */
-/* OUTPUT */
-/* */
-/* Completion Status */
-/* */
-/* CALLS */
-/* */
-/* None */
-/* */
-/* CALLED BY */
-/* */
+/* */
+/* This function will reset an endpoint. */
+/* */
+/* INPUT */
+/* */
+/* hcd_sim_host Pointer to host controller */
+/* endpoint Pointer to endpoint */
+/* */
+/* OUTPUT */
+/* */
+/* Completion Status */
+/* */
+/* CALLS */
+/* */
+/* None */
+/* */
+/* CALLED BY */
+/* */
/* Host Simulator Controller Driver */
-/* */
-/* RELEASE HISTORY */
-/* */
-/* DATE NAME DESCRIPTION */
-/* */
-/* 05-19-2020 Chaoqiong Xiao Initial Version 6.0 */
-/* 09-30-2020 Chaoqiong Xiao Modified comment(s), */
-/* resulting in version 6.1 */
-/* 01-31-2022 Chaoqiong Xiao Modified comment(s), */
-/* added standalone support, */
-/* resulting in version 6.1.10 */
/* */
/**************************************************************************/
UINT _ux_hcd_sim_host_endpoint_reset(UX_HCD_SIM_HOST *hcd_sim_host, UX_ENDPOINT *endpoint)
{
UX_HCD_SIM_HOST_ED *ed;
-
+
UX_PARAMETER_NOT_USED(hcd_sim_host);
/* From the endpoint container fetch the host simulator ED descriptor. */
@@ -90,6 +80,6 @@ UX_HCD_SIM_HOST_ED *ed;
#endif
/* This operation never fails. */
- return(UX_SUCCESS);
+ return(UX_SUCCESS);
}
diff --git a/common/core/src/ux_hcd_sim_host_entry.c b/common/core/src/ux_hcd_sim_host_entry.c
index 577e5264..65f79833 100644
--- a/common/core/src/ux_hcd_sim_host_entry.c
+++ b/common/core/src/ux_hcd_sim_host_entry.c
@@ -1,18 +1,19 @@
/***************************************************************************
- * Copyright (c) 2024 Microsoft Corporation
- *
+ * Copyright (c) 2024 Microsoft Corporation
+ * Copyright (c) 2026-present Eclipse ThreadX contributors
+ *
* This program and the accompanying materials are made available under the
* terms of the MIT License which is available at
* https://opensource.org/licenses/MIT.
- *
+ *
* SPDX-License-Identifier: MIT
**************************************************************************/
/**************************************************************************/
/**************************************************************************/
-/** */
-/** USBX Component */
+/** */
+/** USBX Component */
/** */
/** Host Simulator Controller Driver */
/** */
@@ -28,68 +29,53 @@
#include "ux_hcd_sim_host.h"
-/**************************************************************************/
-/* */
-/* FUNCTION RELEASE */
-/* */
-/* _ux_hcd_sim_host_entry PORTABLE C */
+/**************************************************************************/
+/* */
+/* FUNCTION RELEASE */
+/* */
+/* _ux_hcd_sim_host_entry PORTABLE C */
/* 6.1.10 */
/* AUTHOR */
/* */
/* Chaoqiong Xiao, Microsoft Corporation */
/* */
/* DESCRIPTION */
-/* */
+/* */
/* This function dispatch the HCD function internally to the simulator */
-/* controller driver. */
-/* */
-/* INPUT */
-/* */
-/* hcd Pointer to HCD */
-/* function Function for driver to perform*/
-/* parameter Pointer to parameter(s) */
-/* */
-/* OUTPUT */
-/* */
-/* Completion Status */
-/* */
-/* CALLS */
-/* */
-/* _ux_hcd_sim_host_asynch_queue_process Process asynch queue */
-/* _ux_hcd_sim_host_asynch_schedule Schedule async work */
-/* _ux_hcd_sim_host_asynchronous_endpoint_create Create async endpoint */
-/* _ux_hcd_sim_host_asynchronous_endpoint_destroy Destroy async endpoint */
-/* _ux_hcd_sim_host_endpoint_reset Reset endpoint */
-/* _ux_hcd_sim_host_frame_number_get Get frame number */
-/* _ux_hcd_sim_host_interrupt_endpoint_create Create endpoint */
-/* _ux_hcd_sim_host_iso_queue_process Process iso queue */
-/* _ux_hcd_sim_host_iso_schedule Schedule iso work */
-/* _ux_hcd_sim_host_isochronous_endpoint_create Create iso endpoint */
-/* _ux_hcd_sim_host_periodic_endpoint_destroy Destroy endpoint */
-/* _ux_hcd_sim_host_periodic_schedule Schedule periodic */
-/* _ux_hcd_sim_host_port_status_get Get port status */
+/* controller driver. */
+/* */
+/* INPUT */
+/* */
+/* hcd Pointer to HCD */
+/* function Function for driver to perform*/
+/* parameter Pointer to parameter(s) */
+/* */
+/* OUTPUT */
+/* */
+/* Completion Status */
+/* */
+/* CALLS */
+/* */
+/* _ux_hcd_sim_host_asynch_queue_process Process asynch queue */
+/* _ux_hcd_sim_host_asynch_schedule Schedule async work */
+/* _ux_hcd_sim_host_asynchronous_endpoint_create Create async endpoint */
+/* _ux_hcd_sim_host_asynchronous_endpoint_destroy Destroy async endpoint */
+/* _ux_hcd_sim_host_endpoint_reset Reset endpoint */
+/* _ux_hcd_sim_host_frame_number_get Get frame number */
+/* _ux_hcd_sim_host_interrupt_endpoint_create Create endpoint */
+/* _ux_hcd_sim_host_iso_queue_process Process iso queue */
+/* _ux_hcd_sim_host_iso_schedule Schedule iso work */
+/* _ux_hcd_sim_host_isochronous_endpoint_create Create iso endpoint */
+/* _ux_hcd_sim_host_periodic_endpoint_destroy Destroy endpoint */
+/* _ux_hcd_sim_host_periodic_schedule Schedule periodic */
+/* _ux_hcd_sim_host_port_status_get Get port status */
/* _ux_hcd_sim_host_port_reset Reset port */
-/* _ux_hcd_sim_host_request_transfer Request transfer */
-/* _ux_hcd_sim_host_transfer_abort Abort transfer */
-/* */
-/* CALLED BY */
-/* */
-/* Host Stack */
-/* */
-/* RELEASE HISTORY */
-/* */
-/* 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 */
-/* 11-09-2020 Chaoqiong Xiao Modified comment(s), */
-/* added HCD uninitialize, */
-/* resulting in version 6.1.2 */
-/* 01-31-2022 Chaoqiong Xiao Modified comment(s), */
-/* added standalone support, */
-/* resulting in version 6.1.10 */
+/* _ux_hcd_sim_host_request_transfer Request transfer */
+/* _ux_hcd_sim_host_transfer_abort Abort transfer */
+/* */
+/* CALLED BY */
+/* */
+/* Host Stack */
/* */
/**************************************************************************/
UINT _ux_hcd_sim_host_entry(UX_HCD *hcd, UINT function, VOID *parameter)
@@ -97,12 +83,12 @@ UINT _ux_hcd_sim_host_entry(UX_HCD *hcd, UINT function, VOID *parameter)
UINT status = 0;
UX_HCD_SIM_HOST *hcd_sim_host;
-
+
/* Check the status of the controller. */
if (hcd -> ux_hcd_status == UX_UNUSED)
{
-
+
/* Error trap. */
_ux_system_error_handler(UX_SYSTEM_LEVEL_THREAD, UX_SYSTEM_CONTEXT_HCD, UX_CONTROLLER_UNKNOWN);
@@ -111,7 +97,7 @@ UX_HCD_SIM_HOST *hcd_sim_host;
return(UX_CONTROLLER_UNKNOWN);
}
-
+
/* Get the pointer to the host simulator HCD. */
hcd_sim_host = (UX_HCD_SIM_HOST *) hcd -> ux_hcd_controller_hardware;
@@ -134,14 +120,14 @@ UX_HCD_SIM_HOST *hcd_sim_host;
status = _ux_hcd_sim_host_port_status_get(hcd_sim_host, (ULONG) (ALIGN_TYPE) parameter);
break;
-
-
+
+
case UX_HCD_ENABLE_PORT:
-
+
status = UX_SUCCESS;
break;
-
-
+
+
case UX_HCD_DISABLE_PORT:
status = UX_SUCCESS;
@@ -149,7 +135,7 @@ UX_HCD_SIM_HOST *hcd_sim_host;
case UX_HCD_POWER_ON_PORT:
-
+
status = UX_SUCCESS;
break;
@@ -213,19 +199,19 @@ UX_HCD_SIM_HOST *hcd_sim_host;
case UX_CONTROL_ENDPOINT:
case UX_BULK_ENDPOINT:
-
+
status = _ux_hcd_sim_host_asynchronous_endpoint_create(hcd_sim_host, (UX_ENDPOINT*) parameter);
break;
-
+
case UX_INTERRUPT_ENDPOINT:
-
+
status = _ux_hcd_sim_host_interrupt_endpoint_create(hcd_sim_host, (UX_ENDPOINT*) parameter);
break;
case UX_ISOCHRONOUS_ENDPOINT:
-
+
status = _ux_hcd_sim_host_isochronous_endpoint_create(hcd_sim_host, (UX_ENDPOINT*) parameter);
break;
@@ -273,7 +259,7 @@ UX_HCD_SIM_HOST *hcd_sim_host;
default:
-
+
/* Error trap. */
_ux_system_error_handler(UX_SYSTEM_LEVEL_THREAD, UX_SYSTEM_CONTEXT_HCD, UX_FUNCTION_NOT_SUPPORTED);
@@ -282,8 +268,8 @@ UX_HCD_SIM_HOST *hcd_sim_host;
/* Unknown request, return an error. */
status = UX_FUNCTION_NOT_SUPPORTED;
- }
-
+ }
+
/* Return completion status. */
return(status);
}
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 de22d384..75a04325 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
@@ -1,18 +1,19 @@
/***************************************************************************
- * Copyright (c) 2024 Microsoft Corporation
- *
+ * Copyright (c) 2024 Microsoft Corporation
+ * Copyright (c) 2026-present Eclipse ThreadX contributors
+ *
* This program and the accompanying materials are made available under the
* terms of the MIT License which is available at
* https://opensource.org/licenses/MIT.
- *
+ *
* SPDX-License-Identifier: MIT
**************************************************************************/
/**************************************************************************/
/**************************************************************************/
-/** */
-/** USBX Component */
+/** */
+/** USBX Component */
/** */
/** Host Simulator Controller Driver */
/** */
@@ -28,45 +29,37 @@
#include "ux_hcd_sim_host.h"
-/**************************************************************************/
-/* */
-/* FUNCTION RELEASE */
-/* */
-/* _ux_hcd_sim_host_frame_number_get PORTABLE C */
+/**************************************************************************/
+/* */
+/* FUNCTION RELEASE */
+/* */
+/* _ux_hcd_sim_host_frame_number_get PORTABLE C */
/* 6.1 */
/* AUTHOR */
/* */
/* Chaoqiong Xiao, Microsoft Corporation */
/* */
/* DESCRIPTION */
-/* */
+/* */
/* This function will return the frame number currently used by the */
-/* controller. This function is mostly used for isochronous purposes. */
-/* */
-/* INPUT */
-/* */
-/* hcd_sim_host Pointer to host controller */
-/* frame_number Frame number to set */
-/* */
-/* OUTPUT */
-/* */
-/* Completion Status */
-/* */
-/* CALLS */
-/* */
-/* None */
-/* */
-/* CALLED BY */
-/* */
+/* controller. This function is mostly used for isochronous purposes. */
+/* */
+/* INPUT */
+/* */
+/* hcd_sim_host Pointer to host controller */
+/* frame_number Frame number to set */
+/* */
+/* OUTPUT */
+/* */
+/* Completion Status */
+/* */
+/* CALLS */
+/* */
+/* None */
+/* */
+/* CALLED BY */
+/* */
/* Host Simulator Controller Driver */
-/* */
-/* RELEASE HISTORY */
-/* */
-/* DATE NAME DESCRIPTION */
-/* */
-/* 05-19-2020 Chaoqiong Xiao Initial Version 6.0 */
-/* 09-30-2020 Chaoqiong Xiao Modified comment(s), */
-/* resulting in version 6.1 */
/* */
/**************************************************************************/
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 2382b74b..f5a6e7bc 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
@@ -1,18 +1,19 @@
/***************************************************************************
- * Copyright (c) 2024 Microsoft Corporation
- *
+ * Copyright (c) 2024 Microsoft Corporation
+ * Copyright (c) 2026-present Eclipse ThreadX contributors
+ *
* This program and the accompanying materials are made available under the
* terms of the MIT License which is available at
* https://opensource.org/licenses/MIT.
- *
+ *
* SPDX-License-Identifier: MIT
**************************************************************************/
/**************************************************************************/
/**************************************************************************/
-/** */
-/** USBX Component */
+/** */
+/** USBX Component */
/** */
/** Host Simulator Controller Driver */
/** */
@@ -28,45 +29,37 @@
#include "ux_hcd_sim_host.h"
-/**************************************************************************/
-/* */
-/* FUNCTION RELEASE */
-/* */
-/* _ux_hcd_sim_host_frame_number_set PORTABLE C */
+/**************************************************************************/
+/* */
+/* FUNCTION RELEASE */
+/* */
+/* _ux_hcd_sim_host_frame_number_set PORTABLE C */
/* 6.1 */
/* AUTHOR */
/* */
/* Chaoqiong Xiao, Microsoft Corporation */
/* */
/* DESCRIPTION */
-/* */
-/* This function will set the current frame number to the one */
-/* specified. This function is mostly used for isochronous purposes. */
-/* */
-/* INPUT */
-/* */
-/* hcd_sim_host Pointer to host controller */
-/* frame_number Frame number to set */
-/* */
-/* OUTPUT */
-/* */
-/* None */
-/* */
-/* CALLS */
-/* */
-/* None */
-/* */
-/* CALLED BY */
-/* */
+/* */
+/* This function will set the current frame number to the one */
+/* specified. This function is mostly used for isochronous purposes. */
+/* */
+/* INPUT */
+/* */
+/* hcd_sim_host Pointer to host controller */
+/* frame_number Frame number to set */
+/* */
+/* OUTPUT */
+/* */
+/* None */
+/* */
+/* CALLS */
+/* */
+/* None */
+/* */
+/* CALLED BY */
+/* */
/* Host Simulator Controller Driver */
-/* */
-/* RELEASE HISTORY */
-/* */
-/* DATE NAME DESCRIPTION */
-/* */
-/* 05-19-2020 Chaoqiong Xiao Initial Version 6.0 */
-/* 09-30-2020 Chaoqiong Xiao Modified comment(s), */
-/* resulting in version 6.1 */
/* */
/**************************************************************************/
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 82aed14d..09658190 100644
--- a/common/core/src/ux_hcd_sim_host_initialize.c
+++ b/common/core/src/ux_hcd_sim_host_initialize.c
@@ -1,10 +1,11 @@
/***************************************************************************
- * Copyright (c) 2024 Microsoft Corporation
- *
+ * Copyright (c) 2024 Microsoft Corporation
+ * Copyright (c) 2026-present Eclipse ThreadX contributors
+ *
* This program and the accompanying materials are made available under the
* terms of the MIT License which is available at
* https://opensource.org/licenses/MIT.
- *
+ *
* SPDX-License-Identifier: MIT
**************************************************************************/
@@ -62,28 +63,6 @@
/* */
/* Host Simulator Controller Driver */
/* */
-/* 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, used UX prefix */
-/* to refer to TX symbols */
-/* instead of using them */
-/* directly, */
-/* resulting in version 6.1 */
-/* 04-02-2021 Chaoqiong Xiao Modified comment(s), */
-/* added link with DCD, */
-/* resulting in version 6.1.6 */
-/* 01-31-2022 Chaoqiong Xiao Modified comment(s), */
-/* added standalone support, */
-/* resulting in version 6.1.10 */
-/* 10-31-2023 Yajun Xia Modified comment(s), */
-/* refined memory management, */
-/* resulting in version 6.3.0 */
-/* */
/**************************************************************************/
UINT _ux_hcd_sim_host_initialize(UX_HCD *hcd)
{
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 c793bd09..ee63469f 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
@@ -1,18 +1,19 @@
/***************************************************************************
- * Copyright (c) 2024 Microsoft Corporation
- *
+ * Copyright (c) 2024 Microsoft Corporation
+ * Copyright (c) 2026-present Eclipse ThreadX contributors
+ *
* This program and the accompanying materials are made available under the
* terms of the MIT License which is available at
* https://opensource.org/licenses/MIT.
- *
+ *
* SPDX-License-Identifier: MIT
**************************************************************************/
/**************************************************************************/
/**************************************************************************/
-/** */
-/** USBX Component */
+/** */
+/** USBX Component */
/** */
/** Host Simulator Controller Driver */
/** */
@@ -28,65 +29,57 @@
#include "ux_hcd_sim_host.h"
-/**************************************************************************/
-/* */
-/* FUNCTION RELEASE */
-/* */
-/* _ux_hcd_sim_host_interrupt_endpoint_create PORTABLE C */
+/**************************************************************************/
+/* */
+/* FUNCTION RELEASE */
+/* */
+/* _ux_hcd_sim_host_interrupt_endpoint_create PORTABLE C */
/* 6.1 */
/* AUTHOR */
/* */
/* Chaoqiong Xiao, Microsoft Corporation */
/* */
/* DESCRIPTION */
-/* */
-/* This function will create an interrupt endpoint. The interrupt */
+/* */
+/* This function will create an interrupt endpoint. The interrupt */
/* endpoint has an interval of operation from 1 to 255. The host */
-/* has no hardware scheduler but we still build an interrupt tree */
+/* has no hardware scheduler but we still build an interrupt tree */
/* similar to the host simulator controller. */
/* */
-/* This routine will match the best interval for the host */
-/* simulator. It will also determine the best node to hook the */
-/* endpoint based on the load that already exists on the horizontal */
+/* This routine will match the best interval for the host */
+/* simulator. It will also determine the best node to hook the */
+/* endpoint based on the load that already exists on the horizontal */
/* ED chain. */
/* */
/* For the ones curious about this coding. The tricky part is to */
-/* understand how the interrupt matrix is constructed. We have used */
-/* EDs with the skip bit on to build a frame of anchor EDs. Each ED */
-/* creates a node for an appropriate combination of interval frequency */
-/* in the list. */
+/* understand how the interrupt matrix is constructed. We have used */
+/* EDs with the skip bit on to build a frame of anchor EDs. Each ED */
+/* creates a node for an appropriate combination of interval frequency */
+/* in the list. */
/* */
/* After obtaining a pointer to the list with the lowest traffic, we */
-/* traverse the list from the highest interval until we reach the */
-/* interval required. At that node, we anchor our real ED to the node */
-/* and link the ED that was attached to the node to our ED. */
-/* */
-/* INPUT */
-/* */
-/* hcd_sim_host Pointer to host controller */
-/* endpoint Pointer to endpoint */
-/* */
-/* OUTPUT */
-/* */
-/* Completion Status */
-/* */
-/* CALLS */
-/* */
-/* _ux_hcd_sim_host_ed_obtain Obtain ED */
-/* _ux_hcd_sim_host_regular_td_obtain Obtain regular TD */
-/* _ux_hcd_sim_host_least_traffic_list_get Get least traffic list */
-/* */
-/* CALLED BY */
-/* */
+/* traverse the list from the highest interval until we reach the */
+/* interval required. At that node, we anchor our real ED to the node */
+/* and link the ED that was attached to the node to our ED. */
+/* */
+/* INPUT */
+/* */
+/* hcd_sim_host Pointer to host controller */
+/* endpoint Pointer to endpoint */
+/* */
+/* OUTPUT */
+/* */
+/* Completion Status */
+/* */
+/* CALLS */
+/* */
+/* _ux_hcd_sim_host_ed_obtain Obtain ED */
+/* _ux_hcd_sim_host_regular_td_obtain Obtain regular TD */
+/* _ux_hcd_sim_host_least_traffic_list_get Get least traffic list */
+/* */
+/* CALLED BY */
+/* */
/* Host Simulator Controller Driver */
-/* */
-/* RELEASE HISTORY */
-/* */
-/* DATE NAME DESCRIPTION */
-/* */
-/* 05-19-2020 Chaoqiong Xiao Initial Version 6.0 */
-/* 09-30-2020 Chaoqiong Xiao Modified comment(s), */
-/* resulting in version 6.1 */
/* */
/**************************************************************************/
UINT _ux_hcd_sim_host_interrupt_endpoint_create(UX_HCD_SIM_HOST *hcd_sim_host, UX_ENDPOINT *endpoint)
@@ -118,7 +111,7 @@ UINT interval_sim_host;
/* Attach the ED to the endpoint container. */
endpoint -> ux_endpoint_ed = (VOID *)ed;
-
+
/* Now do the opposite, attach the ED container to the physical ED. */
ed -> ux_sim_host_ed_endpoint = endpoint;
@@ -128,8 +121,8 @@ UINT interval_sim_host;
/* Get the list index with the least traffic. */
ed_list = _ux_hcd_sim_host_least_traffic_list_get(hcd_sim_host);
-
- /* Get the interval for the endpoint and match it to a host simulator list. We match anything
+
+ /* Get the interval for the endpoint and match it to a host simulator list. We match anything
that is > 32ms to the 32ms interval list, the 32ms list is list 0, 16ms list is 1...
the 1ms list is number 5. */
interval = endpoint -> ux_endpoint_descriptor.bInterval;
@@ -145,15 +138,15 @@ UINT interval_sim_host;
while (interval_index < 32)
{
-
+
if (interval&interval_index)
interval_sim_host--;
interval_index = interval_index << 1;
}
}
- /* Now we need to scan the list of eds from the lowest load entry until we reach
- the appropriate interval node. The depth index is the interval_sim_host value
+ /* Now we need to scan the list of eds from the lowest load entry until we reach
+ the appropriate interval node. The depth index is the interval_sim_host value
and the 1st entry is pointed by the ED list entry. */
while (interval_sim_host--)
{
@@ -161,9 +154,9 @@ UINT interval_sim_host;
ed_list = ed_list -> ux_sim_host_ed_next_ed;
while (!(ed_list -> ux_sim_host_ed_status & UX_HCD_SIM_HOST_ED_STATIC))
ed_list = ed_list -> ux_sim_host_ed_next_ed;
- }
+ }
- /* We found the node entry of the ED pointer that will be the anchor for this interrupt
+ /* We found the node entry of the ED pointer that will be the anchor for this interrupt
endpoint. Now we attach this endpoint to the anchor and rebuild the chain . */
next_ed = ed_list -> ux_sim_host_ed_next_ed;
/* Note that if there is a crash here, it is most likely due to an invalid bInterval. */
@@ -176,6 +169,6 @@ UINT interval_sim_host;
hcd_sim_host -> ux_hcd_sim_host_periodic_scheduler_active++;
/* Return successful completion. */
- return(UX_SUCCESS);
+ return(UX_SUCCESS);
}
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 fcbccb15..58e1e528 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
@@ -1,18 +1,19 @@
/***************************************************************************
- * Copyright (c) 2024 Microsoft Corporation
- *
+ * Copyright (c) 2024 Microsoft Corporation
+ * Copyright (c) 2026-present Eclipse ThreadX contributors
+ *
* This program and the accompanying materials are made available under the
* terms of the MIT License which is available at
* https://opensource.org/licenses/MIT.
- *
+ *
* SPDX-License-Identifier: MIT
**************************************************************************/
/**************************************************************************/
/**************************************************************************/
-/** */
-/** USBX Component */
+/** */
+/** USBX Component */
/** */
/** Host Simulator Controller Driver */
/** */
@@ -28,44 +29,36 @@
#include "ux_hcd_sim_host.h"
-/**************************************************************************/
-/* */
-/* FUNCTION RELEASE */
-/* */
-/* _ux_hcd_sim_host_iso_queue_process PORTABLE C */
+/**************************************************************************/
+/* */
+/* FUNCTION RELEASE */
+/* */
+/* _ux_hcd_sim_host_iso_queue_process PORTABLE C */
/* 6.1 */
/* AUTHOR */
/* */
/* Chaoqiong Xiao, Microsoft Corporation */
/* */
/* DESCRIPTION */
-/* */
-/* This function process the isochronous transactions that happened */
-/* in the last frame. */
-/* */
-/* INPUT */
-/* */
-/* hcd_sim_host Pointer to host controller */
-/* */
-/* OUTPUT */
-/* */
-/* None */
-/* */
-/* CALLS */
-/* */
-/* None */
-/* */
-/* CALLED BY */
-/* */
+/* */
+/* This function process the isochronous transactions that happened */
+/* in the last frame. */
+/* */
+/* INPUT */
+/* */
+/* hcd_sim_host Pointer to host controller */
+/* */
+/* OUTPUT */
+/* */
+/* None */
+/* */
+/* CALLS */
+/* */
+/* None */
+/* */
+/* CALLED BY */
+/* */
/* Host Simulator Controller Driver */
-/* */
-/* RELEASE HISTORY */
-/* */
-/* DATE NAME DESCRIPTION */
-/* */
-/* 05-19-2020 Chaoqiong Xiao Initial Version 6.0 */
-/* 09-30-2020 Chaoqiong Xiao Modified comment(s), */
-/* resulting in version 6.1 */
/* */
/**************************************************************************/
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 eb9c3af4..1c3f3e25 100644
--- a/common/core/src/ux_hcd_sim_host_iso_schedule.c
+++ b/common/core/src/ux_hcd_sim_host_iso_schedule.c
@@ -1,18 +1,19 @@
/***************************************************************************
- * Copyright (c) 2024 Microsoft Corporation
- *
+ * Copyright (c) 2024 Microsoft Corporation
+ * Copyright (c) 2026-present Eclipse ThreadX contributors
+ *
* This program and the accompanying materials are made available under the
* terms of the MIT License which is available at
* https://opensource.org/licenses/MIT.
- *
+ *
* SPDX-License-Identifier: MIT
**************************************************************************/
/**************************************************************************/
/**************************************************************************/
-/** */
-/** USBX Component */
+/** */
+/** USBX Component */
/** */
/** Host Simulator Controller Driver */
/** */
@@ -28,43 +29,35 @@
#include "ux_hcd_sim_host.h"
-/**************************************************************************/
-/* */
-/* FUNCTION RELEASE */
-/* */
-/* _ux_hcd_sim_host_iso_schedule PORTABLE C */
+/**************************************************************************/
+/* */
+/* FUNCTION RELEASE */
+/* */
+/* _ux_hcd_sim_host_iso_schedule PORTABLE C */
/* 6.1 */
/* AUTHOR */
/* */
/* Chaoqiong Xiao, Microsoft Corporation */
/* */
/* DESCRIPTION */
-/* */
-/* This function schedules new transfers from isochronous list. */
-/* */
-/* INPUT */
-/* */
-/* hcd_sim_host Pointer to host controller */
-/* */
-/* OUTPUT */
-/* */
-/* None */
-/* */
-/* CALLS */
-/* */
-/* None */
-/* */
-/* CALLED BY */
-/* */
+/* */
+/* This function schedules new transfers from isochronous list. */
+/* */
+/* INPUT */
+/* */
+/* hcd_sim_host Pointer to host controller */
+/* */
+/* OUTPUT */
+/* */
+/* None */
+/* */
+/* CALLS */
+/* */
+/* None */
+/* */
+/* CALLED BY */
+/* */
/* Host Simulator Controller Driver */
-/* */
-/* RELEASE HISTORY */
-/* */
-/* DATE NAME DESCRIPTION */
-/* */
-/* 05-19-2020 Chaoqiong Xiao Initial Version 6.0 */
-/* 09-30-2020 Chaoqiong Xiao Modified comment(s), */
-/* resulting in version 6.1 */
/* */
/**************************************************************************/
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 7578d5d6..c5684218 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
@@ -1,18 +1,19 @@
/***************************************************************************
- * Copyright (c) 2024 Microsoft Corporation
- *
+ * Copyright (c) 2024 Microsoft Corporation
+ * Copyright (c) 2026-present Eclipse ThreadX contributors
+ *
* This program and the accompanying materials are made available under the
* terms of the MIT License which is available at
* https://opensource.org/licenses/MIT.
- *
+ *
* SPDX-License-Identifier: MIT
**************************************************************************/
/**************************************************************************/
/**************************************************************************/
-/** */
-/** USBX Component */
+/** */
+/** USBX Component */
/** */
/** Host Simulator Controller Driver */
/** */
@@ -28,45 +29,37 @@
#include "ux_hcd_sim_host.h"
-/**************************************************************************/
-/* */
-/* FUNCTION RELEASE */
-/* */
-/* _ux_hcd_sim_host_isochronous_endpoint_create PORTABLE C */
+/**************************************************************************/
+/* */
+/* FUNCTION RELEASE */
+/* */
+/* _ux_hcd_sim_host_isochronous_endpoint_create PORTABLE C */
/* 6.1 */
/* AUTHOR */
/* */
/* Chaoqiong Xiao, Microsoft Corporation */
/* */
/* DESCRIPTION */
-/* */
-/* This function creates an isochronous endpoint. */
-/* */
-/* INPUT */
-/* */
-/* hcd_sim_host Pointer to host controller */
-/* endpoint Pointer to endpoint */
-/* */
-/* OUTPUT */
-/* */
-/* Completion Status */
-/* */
-/* CALLS */
-/* */
-/* _ux_hcd_sim_host_ed_obtain Obtain host ED */
-/* _ux_hcd_sim_host_isochronous_td_obtain Obtain host ISO TD */
-/* */
-/* CALLED BY */
-/* */
+/* */
+/* This function creates an isochronous endpoint. */
+/* */
+/* INPUT */
+/* */
+/* hcd_sim_host Pointer to host controller */
+/* endpoint Pointer to endpoint */
+/* */
+/* OUTPUT */
+/* */
+/* Completion Status */
+/* */
+/* CALLS */
+/* */
+/* _ux_hcd_sim_host_ed_obtain Obtain host ED */
+/* _ux_hcd_sim_host_isochronous_td_obtain Obtain host ISO TD */
+/* */
+/* CALLED BY */
+/* */
/* Host Simulator Controller Driver */
-/* */
-/* RELEASE HISTORY */
-/* */
-/* DATE NAME DESCRIPTION */
-/* */
-/* 05-19-2020 Chaoqiong Xiao Initial Version 6.0 */
-/* 09-30-2020 Chaoqiong Xiao Modified comment(s), */
-/* resulting in version 6.1 */
/* */
/**************************************************************************/
UINT _ux_hcd_sim_host_isochronous_endpoint_create(UX_HCD_SIM_HOST *hcd_sim_host, UX_ENDPOINT *endpoint)
@@ -77,7 +70,7 @@ UX_HCD_SIM_HOST_ED *head_ed;
UX_HCD_SIM_HOST_ISO_TD *td;
- /* Obtain a ED for this new endpoint. This ED will live as long as the endpoint is
+ /* Obtain a ED for this new endpoint. This ED will live as long as the endpoint is
active and will be the container for the TDs. */
ed = _ux_hcd_sim_host_ed_obtain(hcd_sim_host);
if (ed == UX_NULL)
@@ -94,7 +87,7 @@ UX_HCD_SIM_HOST_ISO_TD *td;
/* Attach the ED to the endpoint container. */
endpoint -> ux_endpoint_ed = (VOID *) ed;
-
+
/* Hook the TD to both the tail and head of the ED. */
ed -> ux_sim_host_ed_tail_td = (UX_HCD_SIM_HOST_TD *) ((void *) td);
ed -> ux_sim_host_ed_head_td = (UX_HCD_SIM_HOST_TD *) ((void *) td);
@@ -108,8 +101,8 @@ UX_HCD_SIM_HOST_ISO_TD *td;
inserted ED. */
if (head_ed != UX_NULL)
head_ed -> ux_sim_host_ed_previous_ed = ed;
-
+
/* Return successful completion. */
- return(UX_SUCCESS);
+ return(UX_SUCCESS);
}
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 3355ac90..68f48e44 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
@@ -1,18 +1,19 @@
/***************************************************************************
- * Copyright (c) 2024 Microsoft Corporation
- *
+ * Copyright (c) 2024 Microsoft Corporation
+ * Copyright (c) 2026-present Eclipse ThreadX contributors
+ *
* This program and the accompanying materials are made available under the
* terms of the MIT License which is available at
* https://opensource.org/licenses/MIT.
- *
+ *
* SPDX-License-Identifier: MIT
**************************************************************************/
/**************************************************************************/
/**************************************************************************/
-/** */
-/** USBX Component */
+/** */
+/** USBX Component */
/** */
/** Host Simulator Controller Driver */
/** */
@@ -28,45 +29,35 @@
#include "ux_hcd_sim_host.h"
-/**************************************************************************/
-/* */
-/* FUNCTION RELEASE */
-/* */
-/* _ux_hcd_sim_host_isochronous_td_obtain PORTABLE C */
+/**************************************************************************/
+/* */
+/* FUNCTION RELEASE */
+/* */
+/* _ux_hcd_sim_host_isochronous_td_obtain PORTABLE C */
/* 6.1 */
/* AUTHOR */
/* */
/* Chaoqiong Xiao, Microsoft Corporation */
/* */
/* DESCRIPTION */
-/* */
-/* This function obtains a free TD from the isochronous TD list. */
-/* */
-/* INPUT */
-/* */
-/* hcd_sim_host Pointer to host controller */
-/* */
-/* OUTPUT */
-/* */
-/* UX_HCD_SIM_HOST_ISO_TD * Pointer to host ISO ED */
-/* */
-/* CALLS */
-/* */
-/* _ux_utility_memory_set Set memory block */
-/* */
-/* CALLED BY */
-/* */
+/* */
+/* This function obtains a free TD from the isochronous TD list. */
+/* */
+/* INPUT */
+/* */
+/* hcd_sim_host Pointer to host controller */
+/* */
+/* OUTPUT */
+/* */
+/* UX_HCD_SIM_HOST_ISO_TD * Pointer to host ISO ED */
+/* */
+/* CALLS */
+/* */
+/* _ux_utility_memory_set Set memory block */
+/* */
+/* CALLED BY */
+/* */
/* Host Simulator Controller Driver */
-/* */
-/* RELEASE HISTORY */
-/* */
-/* DATE NAME DESCRIPTION */
-/* */
-/* 05-19-2020 Chaoqiong Xiao Initial Version 6.0 */
-/* 09-30-2020 Chaoqiong Xiao Modified comment(s), */
-/* verified memset and memcpy */
-/* 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)
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 b04aabc7..67e1c649 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
@@ -1,18 +1,19 @@
/***************************************************************************
- * Copyright (c) 2024 Microsoft Corporation
- *
+ * Copyright (c) 2024 Microsoft Corporation
+ * Copyright (c) 2026-present Eclipse ThreadX contributors
+ *
* This program and the accompanying materials are made available under the
* terms of the MIT License which is available at
* https://opensource.org/licenses/MIT.
- *
+ *
* SPDX-License-Identifier: MIT
**************************************************************************/
/**************************************************************************/
/**************************************************************************/
-/** */
-/** USBX Component */
+/** */
+/** USBX Component */
/** */
/** Host Simulator Controller Driver */
/** */
@@ -28,49 +29,41 @@
#include "ux_hcd_sim_host.h"
-/**************************************************************************/
-/* */
-/* FUNCTION RELEASE */
-/* */
-/* _ux_hcd_sim_host_least_traffic_list_get PORTABLE C */
+/**************************************************************************/
+/* */
+/* FUNCTION RELEASE */
+/* */
+/* _ux_hcd_sim_host_least_traffic_list_get PORTABLE C */
/* 6.1 */
/* AUTHOR */
/* */
/* Chaoqiong Xiao, Microsoft Corporation */
/* */
/* DESCRIPTION */
-/* */
-/* This function return a pointer to the first ED in the periodic */
-/* tree that has the least traffic registered. */
-/* */
-/* INPUT */
-/* */
-/* hcd_sim_host Pointer to host controller */
-/* */
-/* OUTPUT */
-/* */
-/* UX_HCD_SIM_HOST_ED * Pointer to host ED */
-/* */
-/* CALLS */
-/* */
-/* None */
-/* */
-/* CALLED BY */
-/* */
+/* */
+/* This function return a pointer to the first ED in the periodic */
+/* tree that has the least traffic registered. */
+/* */
+/* INPUT */
+/* */
+/* hcd_sim_host Pointer to host controller */
+/* */
+/* OUTPUT */
+/* */
+/* UX_HCD_SIM_HOST_ED * Pointer to host ED */
+/* */
+/* CALLS */
+/* */
+/* None */
+/* */
+/* CALLED BY */
+/* */
/* Host Simulator Controller Driver */
-/* */
-/* RELEASE HISTORY */
-/* */
-/* DATE NAME DESCRIPTION */
-/* */
-/* 05-19-2020 Chaoqiong Xiao Initial Version 6.0 */
-/* 09-30-2020 Chaoqiong Xiao Modified comment(s), */
-/* resulting in version 6.1 */
/* */
/**************************************************************************/
UX_HCD_SIM_HOST_ED *_ux_hcd_sim_host_least_traffic_list_get(UX_HCD_SIM_HOST *hcd_sim_host)
{
-
+
UX_HCD_SIM_HOST_ED *min_bandwidth_ed;
UX_HCD_SIM_HOST_ED *begin_ed;
UX_HCD_SIM_HOST_ED *ed;
@@ -85,7 +78,7 @@ ULONG bandwidth_used;
/* The first ED is the list candidate for now. */
min_bandwidth_ed = hcd_sim_host -> ux_hcd_sim_host_interrupt_ed_list[0];
-
+
/* All list will be scanned. */
for (list_index = 0; list_index < 32; list_index++)
{
@@ -108,30 +101,30 @@ ULONG bandwidth_used;
if (endpoint != UX_NULL)
{
-
+
/* Add to the bandwidth used the max packet size pointed by this ED. */
bandwidth_used += (ULONG) endpoint -> ux_endpoint_descriptor.wMaxPacketSize;
}
- /* Move to next ED. */
+ /* Move to next ED. */
ed = ed -> ux_sim_host_ed_next_ed;
}
/* We have processed a list, check the bandwidth used by this list.
- If this bandwidth is the minimum, we memorize the ED. */
+ If this bandwidth is the minimum, we memorize the ED. */
if (bandwidth_used < min_bandwidth_used)
{
- /* We have found a better list with a lower used bandwidth, memorize the bandwidth
+ /* We have found a better list with a lower used bandwidth, memorize the bandwidth
for this list. */
min_bandwidth_used = bandwidth_used;
-
+
/* Memorize the begin ED for this list. */
min_bandwidth_ed = begin_ed;
}
}
-
+
/* Return the ED list with the lowest bandwidth. */
- return(min_bandwidth_ed);
+ return(min_bandwidth_ed);
}
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 80e28eeb..cb6ceded 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
@@ -1,18 +1,19 @@
/***************************************************************************
- * Copyright (c) 2024 Microsoft Corporation
- *
+ * Copyright (c) 2024 Microsoft Corporation
+ * Copyright (c) 2026-present Eclipse ThreadX contributors
+ *
* This program and the accompanying materials are made available under the
* terms of the MIT License which is available at
* https://opensource.org/licenses/MIT.
- *
+ *
* SPDX-License-Identifier: MIT
**************************************************************************/
/**************************************************************************/
/**************************************************************************/
-/** */
-/** USBX Component */
+/** */
+/** USBX Component */
/** */
/** Host Simulator Controller Driver */
/** */
@@ -28,44 +29,36 @@
#include "ux_hcd_sim_host.h"
-/**************************************************************************/
-/* */
-/* FUNCTION RELEASE */
-/* */
-/* _ux_hcd_sim_host_periodic_endpoint_destroy PORTABLE C */
+/**************************************************************************/
+/* */
+/* FUNCTION RELEASE */
+/* */
+/* _ux_hcd_sim_host_periodic_endpoint_destroy PORTABLE C */
/* 6.1 */
/* AUTHOR */
/* */
/* Chaoqiong Xiao, Microsoft Corporation */
/* */
/* DESCRIPTION */
-/* */
-/* This function will destroy an interrupt or isochronous endpoint. */
-/* */
-/* INPUT */
-/* */
-/* hcd_sim_host Pointer to host controller */
-/* endpoint Pointer to endpoint */
-/* */
-/* OUTPUT */
-/* */
-/* Completion Status */
-/* */
-/* CALLS */
-/* */
-/* None */
-/* */
-/* CALLED BY */
-/* */
+/* */
+/* This function will destroy an interrupt or isochronous endpoint. */
+/* */
+/* INPUT */
+/* */
+/* hcd_sim_host Pointer to host controller */
+/* endpoint Pointer to endpoint */
+/* */
+/* OUTPUT */
+/* */
+/* Completion Status */
+/* */
+/* CALLS */
+/* */
+/* None */
+/* */
+/* CALLED BY */
+/* */
/* Host Simulator Controller Driver */
-/* */
-/* RELEASE HISTORY */
-/* */
-/* DATE NAME DESCRIPTION */
-/* */
-/* 05-19-2020 Chaoqiong Xiao Initial Version 6.0 */
-/* 09-30-2020 Chaoqiong Xiao Modified comment(s), */
-/* resulting in version 6.1 */
/* */
/**************************************************************************/
UINT _ux_hcd_sim_host_periodic_endpoint_destroy(UX_HCD_SIM_HOST *hcd_sim_host, UX_ENDPOINT *endpoint)
@@ -75,7 +68,7 @@ UX_HCD_SIM_HOST_ED *ed;
UX_HCD_SIM_HOST_ED *previous_ed;
UX_HCD_SIM_HOST_ED *next_ed;
UX_HCD_SIM_HOST_TD *td;
-
+
/* From the endpoint container fetch the host simulator ED descriptor. */
ed = (UX_HCD_SIM_HOST_ED *) endpoint -> ux_endpoint_ed;
@@ -106,6 +99,6 @@ UX_HCD_SIM_HOST_TD *td;
hcd_sim_host -> ux_hcd_sim_host_periodic_scheduler_active--;
/* Return successful completion. */
- return(UX_SUCCESS);
+ return(UX_SUCCESS);
}
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 ba6ff66c..6cd4f69d 100644
--- a/common/core/src/ux_hcd_sim_host_periodic_schedule.c
+++ b/common/core/src/ux_hcd_sim_host_periodic_schedule.c
@@ -1,18 +1,19 @@
/***************************************************************************
- * Copyright (c) 2024 Microsoft Corporation
- *
+ * Copyright (c) 2024 Microsoft Corporation
+ * Copyright (c) 2026-present Eclipse ThreadX contributors
+ *
* This program and the accompanying materials are made available under the
* terms of the MIT License which is available at
* https://opensource.org/licenses/MIT.
- *
+ *
* SPDX-License-Identifier: MIT
**************************************************************************/
/**************************************************************************/
/**************************************************************************/
-/** */
-/** USBX Component */
+/** */
+/** USBX Component */
/** */
/** Host Simulator Controller Driver */
/** */
@@ -28,45 +29,37 @@
#include "ux_hcd_sim_host.h"
-/**************************************************************************/
-/* */
-/* FUNCTION RELEASE */
-/* */
-/* _ux_hcd_sim_host_periodic_schedule PORTABLE C */
+/**************************************************************************/
+/* */
+/* FUNCTION RELEASE */
+/* */
+/* _ux_hcd_sim_host_periodic_schedule PORTABLE C */
/* 6.1 */
/* AUTHOR */
/* */
/* Chaoqiong Xiao, Microsoft Corporation */
/* */
/* DESCRIPTION */
-/* */
-/* This function schedules new transfers from the periodic interrupt */
-/* list. */
-/* */
-/* INPUT */
-/* */
-/* hcd_sim_host Pointer to host controller */
-/* */
-/* OUTPUT */
-/* */
-/* None */
-/* */
-/* CALLS */
-/* */
-/* _ux_hcd_sim_host_frame_number_get Get frame number */
+/* */
+/* This function schedules new transfers from the periodic interrupt */
+/* list. */
+/* */
+/* INPUT */
+/* */
+/* hcd_sim_host Pointer to host controller */
+/* */
+/* OUTPUT */
+/* */
+/* None */
+/* */
+/* CALLS */
+/* */
+/* _ux_hcd_sim_host_frame_number_get Get frame number */
/* _ux_hcd_sim_host_transaction_schedule Schedule the transaction */
-/* */
-/* CALLED BY */
-/* */
+/* */
+/* CALLED BY */
+/* */
/* Host Simulator Controller Driver */
-/* */
-/* RELEASE HISTORY */
-/* */
-/* DATE NAME DESCRIPTION */
-/* */
-/* 05-19-2020 Chaoqiong Xiao Initial Version 6.0 */
-/* 09-30-2020 Chaoqiong Xiao Modified comment(s), */
-/* resulting in version 6.1 */
/* */
/**************************************************************************/
VOID _ux_hcd_sim_host_periodic_schedule(UX_HCD_SIM_HOST *hcd_sim_host)
@@ -77,7 +70,7 @@ ULONG frame_number;
/* Get the current frame number. */
_ux_hcd_sim_host_frame_number_get(hcd_sim_host, &frame_number);
-
+
/* Isolate the low bits to match an entry in the upper periodic entry list. */
frame_number &= UX_HCD_SIM_HOST_PERIODIC_ENTRY_MASK;
@@ -85,7 +78,7 @@ ULONG frame_number;
ed = hcd_sim_host -> ux_hcd_sim_host_interrupt_ed_list[frame_number];
/* Search for an entry in the periodic tree. */
- while (ed != UX_NULL)
+ while (ed != UX_NULL)
{
/* The ED has to be a real ED (not static) and has to have a different tail and head TD. */
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 1b4eadcc..ebe070f7 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
@@ -1,18 +1,19 @@
/***************************************************************************
- * Copyright (c) 2024 Microsoft Corporation
- *
+ * Copyright (c) 2024 Microsoft Corporation
+ * Copyright (c) 2026-present Eclipse ThreadX contributors
+ *
* This program and the accompanying materials are made available under the
* terms of the MIT License which is available at
* https://opensource.org/licenses/MIT.
- *
+ *
* SPDX-License-Identifier: MIT
**************************************************************************/
/**************************************************************************/
/**************************************************************************/
-/** */
-/** USBX Component */
+/** */
+/** USBX Component */
/** */
/** Host Simulator Controller Driver */
/** */
@@ -28,44 +29,36 @@
#include "ux_hcd_sim_host.h"
-/**************************************************************************/
-/* */
-/* FUNCTION RELEASE */
-/* */
-/* _ux_hcd_sim_host_periodic_tree_create PORTABLE C */
+/**************************************************************************/
+/* */
+/* FUNCTION RELEASE */
+/* */
+/* _ux_hcd_sim_host_periodic_tree_create PORTABLE C */
/* 6.1 */
/* AUTHOR */
/* */
/* Chaoqiong Xiao, Microsoft Corporation */
/* */
/* DESCRIPTION */
-/* */
-/* This function creates the periodic static tree for the interrupt */
-/* and isochronous EDs. */
-/* */
-/* INPUT */
-/* */
-/* hcd_sim_host Pointer to host controller */
-/* */
-/* OUTPUT */
-/* */
-/* Completion Status */
-/* */
-/* CALLS */
-/* */
-/* _ux_hcd_sim_host_ed_obtain Obtain host ED */
-/* */
-/* CALLED BY */
-/* */
+/* */
+/* This function creates the periodic static tree for the interrupt */
+/* and isochronous EDs. */
+/* */
+/* INPUT */
+/* */
+/* hcd_sim_host Pointer to host controller */
+/* */
+/* OUTPUT */
+/* */
+/* Completion Status */
+/* */
+/* CALLS */
+/* */
+/* _ux_hcd_sim_host_ed_obtain Obtain host ED */
+/* */
+/* CALLED BY */
+/* */
/* Host Simulator Controller Driver */
-/* */
-/* RELEASE HISTORY */
-/* */
-/* DATE NAME DESCRIPTION */
-/* */
-/* 05-19-2020 Chaoqiong Xiao Initial Version 6.0 */
-/* 09-30-2020 Chaoqiong Xiao Modified comment(s), */
-/* resulting in version 6.1 */
/* */
/**************************************************************************/
UINT _ux_hcd_sim_host_periodic_tree_create(UX_HCD_SIM_HOST *hcd_sim_host)
@@ -77,8 +70,8 @@ UINT list_entries;
UINT current_list_entry;
UX_HCD_SIM_HOST_ED *ed_list[32];
UX_HCD_SIM_HOST_ED *ed_start_list[32];
-
-
+
+
/* Start with the 1st list - it has 32 entries. */
list_entries = 32;
@@ -95,7 +88,7 @@ UX_HCD_SIM_HOST_ED *ed_start_list[32];
if (ed == UX_NULL)
return(UX_NO_ED_AVAILABLE);
- /* Mark this anchor ED as static by putting it as SKIPPED, the host simulator controller will
+ /* Mark this anchor ED as static by putting it as SKIPPED, the host simulator controller will
not look into its tail and head list and will simply jump to the next ED. */
ed -> ux_sim_host_ed_status = UX_HCD_SIM_HOST_ED_STATIC;
@@ -123,8 +116,8 @@ UX_HCD_SIM_HOST_ED *ed_start_list[32];
}
/* The tree has been completed but the entries in the interrupt list are in the wrong order.
- We need to swap each entry according to the host simulator specified entry order list
- so that we have a fair interval frequency for each periodic ED. The primary EDs are
+ We need to swap each entry according to the host simulator specified entry order list
+ so that we have a fair interval frequency for each periodic ED. The primary EDs are
fetched from the start list, and stored in the interrupt list. */
for (current_list_entry = 0; current_list_entry < 32; current_list_entry++)
{
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 253079ac..311911a5 100644
--- a/common/core/src/ux_hcd_sim_host_port_reset.c
+++ b/common/core/src/ux_hcd_sim_host_port_reset.c
@@ -1,18 +1,19 @@
/***************************************************************************
- * Copyright (c) 2024 Microsoft Corporation
- *
+ * Copyright (c) 2024 Microsoft Corporation
+ * Copyright (c) 2026-present Eclipse ThreadX contributors
+ *
* This program and the accompanying materials are made available under the
* terms of the MIT License which is available at
* https://opensource.org/licenses/MIT.
- *
+ *
* SPDX-License-Identifier: MIT
**************************************************************************/
/**************************************************************************/
/**************************************************************************/
-/** */
-/** USBX Component */
+/** */
+/** USBX Component */
/** */
/** Host Simulator Controller Driver */
/** */
@@ -30,57 +31,43 @@
#include "ux_device_stack.h"
-/**************************************************************************/
-/* */
-/* FUNCTION RELEASE */
-/* */
-/* _ux_hcd_sim_host_port_reset PORTABLE C */
+/**************************************************************************/
+/* */
+/* FUNCTION RELEASE */
+/* */
+/* _ux_hcd_sim_host_port_reset PORTABLE C */
/* 6.1.10 */
/* AUTHOR */
/* */
/* Chaoqiong Xiao, Microsoft Corporation */
/* */
/* DESCRIPTION */
-/* */
+/* */
/* Implements the PORT_RESET request. */
-/* */
-/* INPUT */
-/* */
-/* hcd_sim_host Pointer to host controller */
-/* port_index Port index to reset */
-/* */
-/* OUTPUT */
-/* */
-/* Completion Status */
-/* */
-/* CALLS */
-/* */
-/* _ux_device_stack_disconnect Simulate device disconnection */
+/* */
+/* INPUT */
+/* */
+/* hcd_sim_host Pointer to host controller */
+/* port_index Port index to reset */
+/* */
+/* OUTPUT */
+/* */
+/* Completion Status */
+/* */
+/* CALLS */
+/* */
+/* _ux_device_stack_disconnect Simulate device disconnection */
/* _ux_dcd_sim_slave_initialize_complete Complete device initialization*/
-/* */
-/* CALLED BY */
-/* */
+/* */
+/* CALLED BY */
+/* */
/* Host Simulator Controller Driver */
-/* */
-/* RELEASE HISTORY */
-/* */
-/* DATE NAME DESCRIPTION */
-/* */
-/* 05-19-2020 Chaoqiong Xiao Initial Version 6.0 */
-/* 09-30-2020 Chaoqiong Xiao Modified comment(s), */
-/* resulting in version 6.1 */
-/* 08-02-2021 Wen Wang Modified comment(s), */
-/* fixed spelling error, */
-/* resulting in version 6.1.8 */
-/* 01-31-2022 Chaoqiong Xiao Modified comment(s), */
-/* added standalone support, */
-/* resulting in version 6.1.10 */
/* */
/**************************************************************************/
UINT _ux_hcd_sim_host_port_reset(UX_HCD_SIM_HOST *hcd_sim_host, ULONG port_index)
{
-UX_SLAVE_DEVICE *device;
+UX_SLAVE_DEVICE *device;
#if defined(UX_HOST_STANDALONE)
/* No port reset wait simulated, return _STATE_NEXT later to move state. */
@@ -102,9 +89,9 @@ UX_SLAVE_DEVICE *device;
else
{
- /* Host sent a PORT_RESET when the device is Attached, Addressed, or
- Configured. Per the USB spec, we should go back to the default state.
- We do this by 1) simulating disconnect to get rid of class and device
+ /* Host sent a PORT_RESET when the device is Attached, Addressed, or
+ Configured. Per the USB spec, we should go back to the default state.
+ We do this by 1) simulating disconnect to get rid of class and device
resources and 2) recreating necessary entities for control transfers. */
_ux_device_stack_disconnect();
_ux_dcd_sim_slave_initialize_complete();
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 87b6575b..1ca897b5 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
@@ -1,18 +1,19 @@
/***************************************************************************
- * Copyright (c) 2024 Microsoft Corporation
- *
+ * Copyright (c) 2024 Microsoft Corporation
+ * Copyright (c) 2026-present Eclipse ThreadX contributors
+ *
* This program and the accompanying materials are made available under the
* terms of the MIT License which is available at
* https://opensource.org/licenses/MIT.
- *
+ *
* SPDX-License-Identifier: MIT
**************************************************************************/
/**************************************************************************/
/**************************************************************************/
-/** */
-/** USBX Component */
+/** */
+/** USBX Component */
/** */
/** Host Simulator Controller Driver */
/** */
@@ -28,32 +29,32 @@
#include "ux_hcd_sim_host.h"
-/**************************************************************************/
-/* */
-/* FUNCTION RELEASE */
-/* */
-/* _ux_hcd_sim_host_port_status_get PORTABLE C */
+/**************************************************************************/
+/* */
+/* FUNCTION RELEASE */
+/* */
+/* _ux_hcd_sim_host_port_status_get PORTABLE C */
/* 6.1.6 */
/* AUTHOR */
/* */
/* Chaoqiong Xiao, Microsoft Corporation */
/* */
/* DESCRIPTION */
-/* */
+/* */
/* This function will return the status for each port attached to the */
-/* root HUB. */
-/* */
-/* INPUT */
-/* */
-/* hcd_sim_host Pointer to host controller */
-/* port_index Port index */
-/* */
-/* OUTPUT */
-/* */
-/* Host Simulator Port Status */
-/* */
+/* root HUB. */
+/* */
+/* INPUT */
+/* */
+/* hcd_sim_host Pointer to host controller */
+/* port_index Port index */
+/* */
+/* OUTPUT */
+/* */
+/* Host Simulator Port Status */
+/* */
/* Where port status has the following format: */
-/* */
+/* */
/* bit 0 device connection status */
/* if 0 : no device connected */
/* if 1 : device connected to the port */
@@ -76,25 +77,14 @@
/* if 00 : low speed device attached */
/* if 01 : full speed device attached */
/* if 10 : high speed device attached */
-/* */
-/* CALLS */
-/* */
-/* None */
-/* */
-/* CALLED BY */
-/* */
+/* */
+/* CALLS */
+/* */
+/* None */
+/* */
+/* CALLED BY */
+/* */
/* Host Simulator Controller Driver */
-/* */
-/* RELEASE HISTORY */
-/* */
-/* DATE NAME DESCRIPTION */
-/* */
-/* 05-19-2020 Chaoqiong Xiao Initial Version 6.0 */
-/* 09-30-2020 Chaoqiong Xiao Modified comment(s), */
-/* resulting in version 6.1 */
-/* 04-02-2021 Chaoqiong Xiao Modified comment(s), */
-/* used changeable status, */
-/* resulting in version 6.1.6 */
/* */
/**************************************************************************/
ULONG _ux_hcd_sim_host_port_status_get(UX_HCD_SIM_HOST *hcd_sim_host, ULONG port_index)
@@ -115,11 +105,11 @@ ULONG port_status;
return(UX_PORT_INDEX_UNKNOWN);
}
-
+
/* Returns current port status. */
port_status = hcd_sim_host -> ux_hcd_sim_host_port_status[port_index];
/* Return port status. */
- return(port_status);
+ return(port_status);
}
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 2dfa484a..30ce5960 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
@@ -1,18 +1,19 @@
/***************************************************************************
- * Copyright (c) 2024 Microsoft Corporation
- *
+ * Copyright (c) 2024 Microsoft Corporation
+ * Copyright (c) 2026-present Eclipse ThreadX contributors
+ *
* This program and the accompanying materials are made available under the
* terms of the MIT License which is available at
* https://opensource.org/licenses/MIT.
- *
+ *
* SPDX-License-Identifier: MIT
**************************************************************************/
/**************************************************************************/
/**************************************************************************/
-/** */
-/** USBX Component */
+/** */
+/** USBX Component */
/** */
/** Host Simulator Controller Driver */
/** */
@@ -28,50 +29,37 @@
#include "ux_hcd_sim_host.h"
-/**************************************************************************/
-/* */
-/* FUNCTION RELEASE */
-/* */
-/* _ux_hcd_sim_host_regular_td_obtain PORTABLE C */
+/**************************************************************************/
+/* */
+/* FUNCTION RELEASE */
+/* */
+/* _ux_hcd_sim_host_regular_td_obtain PORTABLE C */
/* 6.1.10 */
/* AUTHOR */
/* */
/* Chaoqiong Xiao, Microsoft Corporation */
/* */
/* DESCRIPTION */
-/* */
-/* This function obtains a free TD from the regular TD list. */
-/* */
-/* INPUT */
-/* */
-/* hcd_sim_host Pointer to host controller */
-/* */
-/* OUTPUT */
-/* */
-/* UX_HCD_SIM_HOST_TD * Pointer to host TD */
-/* */
-/* CALLS */
-/* */
-/* _ux_utility_memory_set Set memory block */
-/* _ux_utility_mutex_on Get mutex protection */
-/* _ux_utility_mutex_off Release mutex protection */
-/* */
-/* CALLED BY */
-/* */
+/* */
+/* This function obtains a free TD from the regular TD list. */
+/* */
+/* INPUT */
+/* */
+/* hcd_sim_host Pointer to host controller */
+/* */
+/* OUTPUT */
+/* */
+/* UX_HCD_SIM_HOST_TD * Pointer to host TD */
+/* */
+/* CALLS */
+/* */
+/* _ux_utility_memory_set Set memory block */
+/* _ux_utility_mutex_on Get mutex protection */
+/* _ux_utility_mutex_off Release mutex protection */
+/* */
+/* CALLED BY */
+/* */
/* Host Simulator Controller Driver */
-/* */
-/* RELEASE HISTORY */
-/* */
-/* DATE NAME DESCRIPTION */
-/* */
-/* 05-19-2020 Chaoqiong Xiao Initial Version 6.0 */
-/* 09-30-2020 Chaoqiong Xiao Modified comment(s), */
-/* verified memset and memcpy */
-/* cases, */
-/* resulting in version 6.1 */
-/* 01-31-2022 Chaoqiong Xiao Modified comment(s), */
-/* added standalone support, */
-/* resulting in version 6.1.10 */
/* */
/**************************************************************************/
UX_HCD_SIM_HOST_TD *_ux_hcd_sim_host_regular_td_obtain(UX_HCD_SIM_HOST *hcd_sim_host)
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 39d8c5cd..9fa4f638 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
@@ -1,18 +1,19 @@
/***************************************************************************
- * Copyright (c) 2024 Microsoft Corporation
- *
+ * Copyright (c) 2024 Microsoft Corporation
+ * Copyright (c) 2026-present Eclipse ThreadX contributors
+ *
* This program and the accompanying materials are made available under the
* terms of the MIT License which is available at
* https://opensource.org/licenses/MIT.
- *
+ *
* SPDX-License-Identifier: MIT
**************************************************************************/
/**************************************************************************/
/**************************************************************************/
-/** */
-/** USBX Component */
+/** */
+/** USBX Component */
/** */
/** Host Simulator Controller Driver */
/** */
@@ -28,51 +29,40 @@
#include "ux_hcd_sim_host.h"
-/**************************************************************************/
-/* */
-/* FUNCTION RELEASE */
-/* */
-/* _ux_hcd_sim_host_request_bulk_transfer PORTABLE C */
+/**************************************************************************/
+/* */
+/* FUNCTION RELEASE */
+/* */
+/* _ux_hcd_sim_host_request_bulk_transfer PORTABLE C */
/* 6.1.3 */
/* AUTHOR */
/* */
/* Chaoqiong Xiao, Microsoft Corporation */
/* */
/* DESCRIPTION */
-/* */
-/* This function performs a bulk transfer request. A bulk transfer */
-/* can be larger than the size of the sim_host buffer so it may be */
-/* required to chain multiple TDs to accommodate this transfer */
-/* request. A bulk transfer is non blocking, so we return before the */
-/* transfer request is completed. */
-/* */
-/* INPUT */
-/* */
-/* hcd_sim_host Pointer to host controller */
-/* transfer_request Pointer to transfer request */
-/* */
-/* OUTPUT */
-/* */
-/* Completion Status */
-/* */
-/* CALLS */
-/* */
-/* _ux_hcd_sim_host_regular_td_obtain Obtain regular TD */
-/* */
-/* CALLED BY */
-/* */
+/* */
+/* This function performs a bulk transfer request. A bulk transfer */
+/* can be larger than the size of the sim_host buffer so it may be */
+/* required to chain multiple TDs to accommodate this transfer */
+/* request. A bulk transfer is non blocking, so we return before the */
+/* transfer request is completed. */
+/* */
+/* INPUT */
+/* */
+/* hcd_sim_host Pointer to host controller */
+/* transfer_request Pointer to transfer request */
+/* */
+/* OUTPUT */
+/* */
+/* Completion Status */
+/* */
+/* CALLS */
+/* */
+/* _ux_hcd_sim_host_regular_td_obtain Obtain regular TD */
+/* */
+/* CALLED BY */
+/* */
/* Host Simulator Controller Driver */
-/* */
-/* RELEASE HISTORY */
-/* */
-/* DATE NAME DESCRIPTION */
-/* */
-/* 05-19-2020 Chaoqiong Xiao Initial Version 6.0 */
-/* 09-30-2020 Chaoqiong Xiao Modified comment(s), */
-/* resulting in version 6.1 */
-/* 12-31-2020 Chaoqiong Xiao Modified comment(s), */
-/* fixed ZLP sending, */
-/* resulting in version 6.1.3 */
/* */
/**************************************************************************/
UINT _ux_hcd_sim_host_request_bulk_transfer(UX_HCD_SIM_HOST *hcd_sim_host, UX_TRANSFER *transfer_request)
@@ -88,7 +78,7 @@ UX_HCD_SIM_HOST_ED *ed;
ULONG transfer_request_payload_length;
ULONG bulk_packet_payload_length;
UCHAR * data_pointer;
-
+
/* Get the pointer to the Endpoint. */
endpoint = (UX_ENDPOINT *) transfer_request -> ux_transfer_request_endpoint;
@@ -101,16 +91,16 @@ UCHAR * data_pointer;
data_td = ed -> ux_sim_host_ed_tail_td;
previous_td = data_td;
- /* Reset the first obtained data TD in case there is a TD shortage while building
+ /* Reset the first obtained data TD in case there is a TD shortage while building
the list of TDs. */
start_data_td = 0;
/* It may take more than one TD if the transfer_request length is more than the
- maximum length for a host simulator TD (this is irrelevant of the MaxPacketSize value
+ maximum length for a host simulator TD (this is irrelevant of the MaxPacketSize value
in the endpoint descriptor). Host simulator data payload has a maximum size of 4K. */
transfer_request_payload_length = transfer_request -> ux_transfer_request_requested_length;
data_pointer = transfer_request -> ux_transfer_request_data_pointer;
-
+
do
{
@@ -178,14 +168,14 @@ UCHAR * data_pointer;
if (start_data_td == UX_NULL)
start_data_td = data_td;
- /* Attach this new TD to the previous one. */
+ /* Attach this new TD to the previous one. */
previous_td -> ux_sim_host_td_next_td = data_td;
previous_td -> ux_sim_host_td_next_td_transfer_request = data_td;
previous_td = data_td;
}
} while (transfer_request_payload_length != 0);
-
- /* At this stage, the Head and Tail in the ED are still the same and the host simulator
+
+ /* At this stage, the Head and Tail in the ED are still the same and the host simulator
controller will skip this ED until we have hooked the new tail TD. */
tail_td = _ux_hcd_sim_host_regular_td_obtain(hcd_sim_host);
if (tail_td == UX_NULL)
@@ -194,7 +184,7 @@ UCHAR * data_pointer;
/* If there was already a TD chain in progress, free it. */
if (start_data_td != UX_NULL)
{
-
+
data_td = start_data_td;
while (data_td)
{
@@ -218,6 +208,6 @@ UCHAR * data_pointer;
hcd_sim_host -> ux_hcd_sim_host_queue_empty = UX_FALSE;
/* Return successful completion. */
- return(UX_SUCCESS);
+ return(UX_SUCCESS);
}
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 878a56e8..d341bdd0 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
@@ -1,18 +1,19 @@
/***************************************************************************
- * Copyright (c) 2024 Microsoft Corporation
- *
+ * Copyright (c) 2024 Microsoft Corporation
+ * Copyright (c) 2026-present Eclipse ThreadX contributors
+ *
* This program and the accompanying materials are made available under the
* terms of the MIT License which is available at
* https://opensource.org/licenses/MIT.
- *
+ *
* SPDX-License-Identifier: MIT
**************************************************************************/
/**************************************************************************/
/**************************************************************************/
-/** */
-/** USBX Component */
+/** */
+/** USBX Component */
/** */
/** Host Simulator Controller Driver */
/** */
@@ -29,56 +30,44 @@
#include "ux_host_stack.h"
-/**************************************************************************/
-/* */
-/* FUNCTION RELEASE */
-/* */
-/* _ux_hcd_sim_host_request_control_transfer PORTABLE C */
+/**************************************************************************/
+/* */
+/* FUNCTION RELEASE */
+/* */
+/* _ux_hcd_sim_host_request_control_transfer PORTABLE C */
/* 6.1.10 */
/* AUTHOR */
/* */
/* Chaoqiong Xiao, Microsoft Corporation */
/* */
/* DESCRIPTION */
-/* */
-/* This function performs a control transfer from a transfer request. */
+/* */
+/* This function performs a control transfer from a transfer request. */
/* The USB control transfer is in 3 phases (setup, data, status). */
/* This function will chain all phases of the control sequence before */
-/* setting the sim_host endpoint as a candidate for transfer. */
-/* */
-/* INPUT */
-/* */
-/* hcd_sim_host Pointer to host controller */
-/* transfer_request Pointer to transfer request */
-/* */
-/* OUTPUT */
-/* */
-/* Completion Status */
-/* */
-/* CALLS */
-/* */
-/* _ux_hcd_sim_host_regular_td_obtain Obtain regular TD */
-/* _ux_host_stack_transfer_request_abort Abort transfer request */
-/* _ux_utility_memory_allocate Allocate memory block */
-/* _ux_utility_memory_free Release memory block */
-/* _ux_utility_semaphore_get Get semaphore */
-/* _ux_utility_short_put Write 16-bit value */
-/* */
-/* CALLED BY */
-/* */
+/* setting the sim_host endpoint as a candidate for transfer. */
+/* */
+/* INPUT */
+/* */
+/* hcd_sim_host Pointer to host controller */
+/* transfer_request Pointer to transfer request */
+/* */
+/* OUTPUT */
+/* */
+/* Completion Status */
+/* */
+/* CALLS */
+/* */
+/* _ux_hcd_sim_host_regular_td_obtain Obtain regular TD */
+/* _ux_host_stack_transfer_request_abort Abort transfer request */
+/* _ux_utility_memory_allocate Allocate memory block */
+/* _ux_utility_memory_free Release memory block */
+/* _ux_utility_semaphore_get Get semaphore */
+/* _ux_utility_short_put Write 16-bit value */
+/* */
+/* CALLED BY */
+/* */
/* Host Simulator Controller Driver */
-/* */
-/* RELEASE HISTORY */
-/* */
-/* 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 */
-/* 01-31-2022 Chaoqiong Xiao Modified comment(s), */
-/* added standalone support, */
-/* resulting in version 6.1.10 */
/* */
/**************************************************************************/
UINT _ux_hcd_sim_host_request_control_transfer(UX_HCD_SIM_HOST *hcd_sim_host, UX_TRANSFER *transfer_request)
@@ -140,7 +129,7 @@ UINT status;
setup_td -> ux_sim_host_td_status |= UX_HCD_SIM_HOST_TD_SETUP_PHASE;
/* Check if there is a data phase, if not jump to status phase. */
- data_td = UX_NULL;
+ data_td = UX_NULL;
start_data_td = UX_NULL;
/* Use local variables to manipulate data pointer and length. */
@@ -219,7 +208,7 @@ UINT status;
if (start_data_td == UX_NULL)
start_data_td = data_td;
- /* Attach this new TD to the previous one. */
+ /* Attach this new TD to the previous one. */
chain_td -> ux_sim_host_td_next_td = data_td;
chain_td -> ux_sim_host_td_next_td_transfer_request = data_td;
chain_td = data_td;
@@ -274,7 +263,7 @@ UINT status;
/* Hook the status phase to the previous TD. */
chain_td -> ux_sim_host_td_next_td = status_td;
- /* Since we have consumed out tail TD for the setup packet, we must get another one
+ /* Since we have consumed out tail TD for the setup packet, we must get another one
and hook it to the ED's tail. */
tail_td = _ux_hcd_sim_host_regular_td_obtain(hcd_sim_host);
if (tail_td == UX_NULL)
@@ -289,7 +278,7 @@ UINT status;
/* Hook the new TD to the status TD. */
status_td -> ux_sim_host_td_next_td = tail_td;
-
+
/* At this stage, the Head and Tail in the ED are still the same and
the host simulator controller will skip this ED until we have hooked the new
tail TD. */
@@ -311,22 +300,22 @@ UINT status;
/* All transfers pending need to abort. There may have been a partial transfer. */
_ux_host_stack_transfer_request_abort(transfer_request);
-
+
/* There was an error, return to the caller. */
transfer_request -> ux_transfer_request_completion_code = UX_TRANSFER_TIMEOUT;
-
+
/* Error trap. */
_ux_system_error_handler(UX_SYSTEM_LEVEL_THREAD, UX_SYSTEM_CONTEXT_HCD, UX_TRANSFER_TIMEOUT);
/* If trace is enabled, insert this event into the trace buffer. */
UX_TRACE_IN_LINE_INSERT(UX_TRACE_ERROR, UX_TRANSFER_TIMEOUT, transfer_request, 0, 0, UX_TRACE_ERRORS, 0, 0)
-
- }
+
+ }
/* Free the resources. */
_ux_utility_memory_free(setup_request);
/* Return completion to caller. */
- return(transfer_request -> ux_transfer_request_completion_code);
+ return(transfer_request -> ux_transfer_request_completion_code);
#endif
}
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 3bf0985e..8530d135 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
@@ -1,18 +1,19 @@
/***************************************************************************
- * Copyright (c) 2024 Microsoft Corporation
- *
+ * Copyright (c) 2024 Microsoft Corporation
+ * Copyright (c) 2026-present Eclipse ThreadX contributors
+ *
* This program and the accompanying materials are made available under the
* terms of the MIT License which is available at
* https://opensource.org/licenses/MIT.
- *
+ *
* SPDX-License-Identifier: MIT
**************************************************************************/
/**************************************************************************/
/**************************************************************************/
-/** */
-/** USBX Component */
+/** */
+/** USBX Component */
/** */
/** Host Simulator Controller Driver */
/** */
@@ -28,52 +29,44 @@
#include "ux_hcd_sim_host.h"
-/**************************************************************************/
-/* */
-/* FUNCTION RELEASE */
-/* */
-/* _ux_hcd_sim_host_request_interrupt_transfer PORTABLE C */
+/**************************************************************************/
+/* */
+/* FUNCTION RELEASE */
+/* */
+/* _ux_hcd_sim_host_request_interrupt_transfer PORTABLE C */
/* 6.1 */
/* AUTHOR */
/* */
/* Chaoqiong Xiao, Microsoft Corporation */
/* */
/* DESCRIPTION */
-/* */
-/* This function performs an interrupt transfer request. An interrupt */
-/* transfer can only be as large as the Maxpacket Field in the */
-/* endpoint descriptor. This was verified at the USB layer and does */
-/* not need to be reverified here. */
-/* */
-/* INPUT */
-/* */
-/* hcd_sim_host Pointer to host controller */
-/* transfer_request Pointer to transfer request */
-/* */
-/* OUTPUT */
-/* */
-/* Completion Status */
-/* */
-/* CALLS */
-/* */
-/* _ux_hcd_sim_host_regular_td_obtain Obtain regular TD */
-/* */
-/* CALLED BY */
-/* */
+/* */
+/* This function performs an interrupt transfer request. An interrupt */
+/* transfer can only be as large as the Maxpacket Field in the */
+/* endpoint descriptor. This was verified at the USB layer and does */
+/* not need to be reverified here. */
+/* */
+/* INPUT */
+/* */
+/* hcd_sim_host Pointer to host controller */
+/* transfer_request Pointer to transfer request */
+/* */
+/* OUTPUT */
+/* */
+/* Completion Status */
+/* */
+/* CALLS */
+/* */
+/* _ux_hcd_sim_host_regular_td_obtain Obtain regular TD */
+/* */
+/* CALLED BY */
+/* */
/* Host Simulator Controller Driver */
-/* */
-/* RELEASE HISTORY */
-/* */
-/* DATE NAME DESCRIPTION */
-/* */
-/* 05-19-2020 Chaoqiong Xiao Initial Version 6.0 */
-/* 09-30-2020 Chaoqiong Xiao Modified comment(s), */
-/* resulting in version 6.1 */
/* */
/**************************************************************************/
UINT _ux_hcd_sim_host_request_interrupt_transfer(UX_HCD_SIM_HOST *hcd_sim_host, UX_TRANSFER *transfer_request)
{
-
+
UX_ENDPOINT *endpoint;
UX_HCD_SIM_HOST_ED *ed;
UX_HCD_SIM_HOST_TD *data_td;
@@ -131,6 +124,6 @@ UX_HCD_SIM_HOST_TD *tail_td;
/* There is no need to wake up the sim_host controller on this transfer
since periodic transactions will be picked up when the interrupt
tree is scanned. */
- return(UX_SUCCESS);
+ return(UX_SUCCESS);
}
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 17221256..3d65f253 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
@@ -1,18 +1,19 @@
/***************************************************************************
- * Copyright (c) 2024 Microsoft Corporation
- *
+ * Copyright (c) 2024 Microsoft Corporation
+ * Copyright (c) 2026-present Eclipse ThreadX contributors
+ *
* This program and the accompanying materials are made available under the
* terms of the MIT License which is available at
* https://opensource.org/licenses/MIT.
- *
+ *
* SPDX-License-Identifier: MIT
**************************************************************************/
/**************************************************************************/
/**************************************************************************/
-/** */
-/** USBX Component */
+/** */
+/** USBX Component */
/** */
/** Host Simulator Controller Driver */
/** */
@@ -28,59 +29,42 @@
#include "ux_hcd_sim_host.h"
-/**************************************************************************/
-/* */
-/* FUNCTION RELEASE */
-/* */
-/* _ux_hcd_sim_host_request_isochronous_transfer PORTABLE C */
+/**************************************************************************/
+/* */
+/* FUNCTION RELEASE */
+/* */
+/* _ux_hcd_sim_host_request_isochronous_transfer PORTABLE C */
/* 6.1.12 */
/* AUTHOR */
/* */
/* Chaoqiong Xiao, Microsoft Corporation */
/* */
/* DESCRIPTION */
-/* */
-/* This function performs an isochronous transfer request. */
-/* */
-/* INPUT */
-/* */
-/* hcd_sim_host Pointer to host controller */
-/* transfer_request Pointer to transfer request */
-/* */
-/* OUTPUT */
-/* */
-/* Completion Status */
-/* */
-/* CALLS */
-/* */
-/* _ux_hcd_sim_host_frame_number_get Get frame number */
-/* _ux_hcd_sim_host_isochronous_td_obtain Obtain isochronous TD */
-/* */
-/* CALLED BY */
-/* */
+/* */
+/* This function performs an isochronous transfer request. */
+/* */
+/* INPUT */
+/* */
+/* hcd_sim_host Pointer to host controller */
+/* transfer_request Pointer to transfer request */
+/* */
+/* OUTPUT */
+/* */
+/* Completion Status */
+/* */
+/* CALLS */
+/* */
+/* _ux_hcd_sim_host_frame_number_get Get frame number */
+/* _ux_hcd_sim_host_isochronous_td_obtain Obtain isochronous TD */
+/* */
+/* CALLED BY */
+/* */
/* Host Simulator Controller Driver */
-/* */
-/* RELEASE HISTORY */
-/* */
-/* DATE NAME DESCRIPTION */
-/* */
-/* 05-19-2020 Chaoqiong Xiao Initial Version 6.0 */
-/* 09-30-2020 Chaoqiong Xiao Modified comment(s), */
-/* resulting in version 6.1 */
-/* 10-15-2021 Chaoqiong Xiao Modified comment(s), */
-/* fixed payload calculation, */
-/* resulting in version 6.1.9 */
-/* 01-31-2022 Chaoqiong Xiao Modified comment(s), */
-/* added standalone support, */
-/* resulting in version 6.1.10 */
-/* 07-29-2022 Chaoqiong Xiao Modified comment(s), */
-/* fixed partial transfer, */
-/* resulting in version 6.1.12 */
/* */
/**************************************************************************/
UINT _ux_hcd_sim_host_request_isochronous_transfer(UX_HCD_SIM_HOST *hcd_sim_host, UX_TRANSFER *transfer_request)
{
-
+
UX_ENDPOINT *endpoint;
UX_HCD_SIM_HOST_ISO_TD *data_td;
UX_HCD_SIM_HOST_ISO_TD *start_data_td;
@@ -93,7 +77,7 @@ ULONG isoch_packet_payload_length;
UCHAR * data_pointer;
ULONG current_frame_number;
ULONG n_trans, packet_size;
-
+
/* Get the pointer to the Endpoint. */
endpoint = (UX_ENDPOINT *) transfer_request -> ux_transfer_request_endpoint;
@@ -132,7 +116,7 @@ ULONG n_trans, packet_size;
/* Reset the first obtained data TD in case there is a TD shortage while building the list of TDs. */
start_data_td = UX_NULL;
- /* Calculate the frame number to be used to send this payload. If there are no current transfers,
+ /* Calculate the frame number to be used to send this payload. If there are no current transfers,
we take the current frame number and add a safety value (2-5) to it. If here is pending transactions,
we use the frame number stored in the transfer request. */
if (ed -> ux_sim_host_ed_tail_td == ed -> ux_sim_host_ed_head_td)
@@ -150,7 +134,7 @@ ULONG n_trans, packet_size;
/* Load the start buffer address and URB length to split the URB in multiple TD transfer. */
transfer_request_payload_length = transfer_request -> ux_transfer_request_requested_length;
data_pointer = transfer_request -> ux_transfer_request_data_pointer;
-
+
while (transfer_request_payload_length != 0)
{
@@ -215,16 +199,16 @@ ULONG n_trans, packet_size;
if (start_data_td == UX_NULL)
start_data_td = data_td;
- /* Attach this new TD to the previous one. */
+ /* Attach this new TD to the previous one. */
previous_td -> ux_sim_host_iso_td_next_td = data_td;
previous_td = data_td;
}
}
-
+
/* Memorize the next frame number for this ED. */
ed -> ux_sim_host_ed_frame = current_frame_number;
- /* At this stage, the Head and Tail in the ED are still the same and the host simulator controller
+ /* At this stage, the Head and Tail in the ED are still the same and the host simulator controller
will skip this ED until we have hooked the new tail TD. */
tail_td = _ux_hcd_sim_host_isochronous_td_obtain(hcd_sim_host);
if (tail_td == UX_NULL)
@@ -255,6 +239,6 @@ ULONG n_trans, packet_size;
ed -> ux_sim_host_ed_tail_td = (UX_HCD_SIM_HOST_TD *) ((void *) tail_td);
/* Return successful completion. */
- return(UX_SUCCESS);
+ return(UX_SUCCESS);
}
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 6bb4de65..7749a35f 100644
--- a/common/core/src/ux_hcd_sim_host_request_transfer.c
+++ b/common/core/src/ux_hcd_sim_host_request_transfer.c
@@ -1,18 +1,19 @@
/***************************************************************************
- * Copyright (c) 2024 Microsoft Corporation
- *
+ * Copyright (c) 2024 Microsoft Corporation
+ * Copyright (c) 2026-present Eclipse ThreadX contributors
+ *
* This program and the accompanying materials are made available under the
* terms of the MIT License which is available at
* https://opensource.org/licenses/MIT.
- *
+ *
* SPDX-License-Identifier: MIT
**************************************************************************/
/**************************************************************************/
/**************************************************************************/
-/** */
-/** USBX Component */
+/** */
+/** USBX Component */
/** */
/** Host Simulator Controller Driver */
/** */
@@ -29,57 +30,46 @@
#if !defined(UX_HOST_STANDALONE)
-/**************************************************************************/
-/* */
-/* FUNCTION RELEASE */
-/* */
-/* _ux_hcd_sim_host_request_transfer PORTABLE C */
+/**************************************************************************/
+/* */
+/* FUNCTION RELEASE */
+/* */
+/* _ux_hcd_sim_host_request_transfer PORTABLE C */
/* 6.1.10 */
/* AUTHOR */
/* */
/* Chaoqiong Xiao, Microsoft Corporation */
/* */
/* DESCRIPTION */
-/* */
+/* */
/* This function is the handler for all the transactions on the USB. */
-/* The transfer request passed as parameter contains the endpoint and */
-/* the device descriptors in addition to the type of transaction de */
-/* be executed. This function routes the transfer request to */
-/* according to the type of transfer to be executed. */
-/* */
-/* INPUT */
-/* */
-/* hcd_sim_host Pointer to host controller */
-/* transfer_request Pointer to transfer request */
-/* */
-/* OUTPUT */
-/* */
-/* Completion Status */
-/* */
-/* CALLS */
-/* */
-/* _ux_hcd_sim_host_request_bulk_transfer Request bulk transfer */
-/* _ux_hcd_sim_host_request_control_transfer Request control */
-/* transfer */
-/* _ux_hcd_sim_host_request_interrupt_transfer Request interrupt */
-/* transfer */
-/* _ux_hcd_sim_host_request_isochronous_transfer Request isochronous */
-/* transfer */
-/* */
-/* CALLED BY */
-/* */
+/* The transfer request passed as parameter contains the endpoint and */
+/* the device descriptors in addition to the type of transaction de */
+/* be executed. This function routes the transfer request to */
+/* according to the type of transfer to be executed. */
+/* */
+/* INPUT */
+/* */
+/* hcd_sim_host Pointer to host controller */
+/* transfer_request Pointer to transfer request */
+/* */
+/* OUTPUT */
+/* */
+/* Completion Status */
+/* */
+/* CALLS */
+/* */
+/* _ux_hcd_sim_host_request_bulk_transfer Request bulk transfer */
+/* _ux_hcd_sim_host_request_control_transfer Request control */
+/* transfer */
+/* _ux_hcd_sim_host_request_interrupt_transfer Request interrupt */
+/* transfer */
+/* _ux_hcd_sim_host_request_isochronous_transfer Request isochronous */
+/* transfer */
+/* */
+/* CALLED BY */
+/* */
/* Host Simulator Controller Driver */
-/* */
-/* RELEASE HISTORY */
-/* */
-/* DATE NAME DESCRIPTION */
-/* */
-/* 05-19-2020 Chaoqiong Xiao Initial Version 6.0 */
-/* 09-30-2020 Chaoqiong Xiao Modified comment(s), */
-/* resulting in version 6.1 */
-/* 01-31-2022 Chaoqiong Xiao Modified comment(s), */
-/* added standalone support, */
-/* resulting in version 6.1.10 */
/* */
/**************************************************************************/
UINT _ux_hcd_sim_host_request_transfer(UX_HCD_SIM_HOST *hcd_sim_host, UX_TRANSFER *transfer_request)
@@ -87,14 +77,14 @@ UINT _ux_hcd_sim_host_request_transfer(UX_HCD_SIM_HOST *hcd_sim_host, UX_TRANSF
UX_ENDPOINT *endpoint;
UINT status = 0;
-
-
+
+
/* Get the pointer to the Endpoint. */
endpoint = (UX_ENDPOINT *) transfer_request -> ux_transfer_request_endpoint;
/* We reset the actual length field of the transfer request as a safety measure. */
transfer_request -> ux_transfer_request_actual_length = 0;
-
+
/* Isolate the endpoint type and route the transfer request. */
switch ((endpoint -> ux_endpoint_descriptor.bmAttributes) & UX_MASK_ENDPOINT_TYPE)
{
@@ -124,6 +114,6 @@ UINT status = 0;
/* Note that it is physically impossible to have a wrong endpoint type here
so no error checking. */
- return(status);
+ return(status);
}
#endif
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 b91cd8ca..ed20c343 100644
--- a/common/core/src/ux_hcd_sim_host_timer_function.c
+++ b/common/core/src/ux_hcd_sim_host_timer_function.c
@@ -1,18 +1,19 @@
/***************************************************************************
- * Copyright (c) 2024 Microsoft Corporation
- *
+ * Copyright (c) 2024 Microsoft Corporation
+ * Copyright (c) 2026-present Eclipse ThreadX contributors
+ *
* This program and the accompanying materials are made available under the
* terms of the MIT License which is available at
* https://opensource.org/licenses/MIT.
- *
+ *
* SPDX-License-Identifier: MIT
**************************************************************************/
/**************************************************************************/
/**************************************************************************/
-/** */
-/** USBX Component */
+/** */
+/** USBX Component */
/** */
/** Host Simulator Controller Driver */
/** */
@@ -31,50 +32,38 @@
#include "tx_timer.h"
-/**************************************************************************/
-/* */
-/* FUNCTION RELEASE */
-/* */
-/* _ux_hcd_sim_host_timer_function PORTABLE C */
+/**************************************************************************/
+/* */
+/* FUNCTION RELEASE */
+/* */
+/* _ux_hcd_sim_host_timer_function PORTABLE C */
/* 6.1.10 */
/* AUTHOR */
/* */
/* Chaoqiong Xiao, Microsoft Corporation */
/* */
/* DESCRIPTION */
-/* */
+/* */
/* This function is the timer function of the simulator. It is */
-/* invoked on a timer every tick. */
+/* invoked on a timer every tick. */
/* */
/* It's for RTOS mode. */
-/* */
-/* INPUT */
-/* */
-/* hcd_sim_host_addr Address of host controller */
-/* */
-/* OUTPUT */
-/* */
-/* None */
-/* */
-/* CALLS */
-/* */
-/* _ux_utility_semaphore_put Put semaphore */
-/* */
-/* CALLED BY */
-/* */
-/* ThreadX */
-/* */
-/* RELEASE HISTORY */
-/* */
-/* DATE NAME DESCRIPTION */
-/* */
-/* 05-19-2020 Chaoqiong Xiao Initial Version 6.0 */
-/* 09-30-2020 Chaoqiong Xiao Modified comment(s), */
-/* resulting in version 6.1 */
-/* 01-31-2022 Chaoqiong Xiao Modified comment(s), */
-/* used macros to configure */
-/* for RTOS mode compile, */
-/* resulting in version 6.1.10 */
+/* */
+/* INPUT */
+/* */
+/* hcd_sim_host_addr Address of host controller */
+/* */
+/* OUTPUT */
+/* */
+/* None */
+/* */
+/* CALLS */
+/* */
+/* _ux_utility_semaphore_put Put semaphore */
+/* */
+/* CALLED BY */
+/* */
+/* ThreadX */
/* */
/**************************************************************************/
VOID _ux_hcd_sim_host_timer_function(ULONG hcd_sim_host_addr)
@@ -82,7 +71,7 @@ VOID _ux_hcd_sim_host_timer_function(ULONG hcd_sim_host_addr)
UX_HCD_SIM_HOST *hcd_sim_host;
UX_HCD *hcd;
-
+
/* Setup pointer to simulator host structure. */
UX_TIMER_EXTENSION_PTR_GET(hcd_sim_host, UX_HCD_SIM_HOST, 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 226ee2cf..f5da8a21 100644
--- a/common/core/src/ux_hcd_sim_host_transaction_schedule.c
+++ b/common/core/src/ux_hcd_sim_host_transaction_schedule.c
@@ -1,10 +1,11 @@
/***************************************************************************
- * Copyright (c) 2024 Microsoft Corporation
- *
+ * Copyright (c) 2024 Microsoft Corporation
+ * Copyright (c) 2026-present Eclipse ThreadX contributors
+ *
* This program and the accompanying materials are made available under the
* terms of the MIT License which is available at
* https://opensource.org/licenses/MIT.
- *
+ *
* SPDX-License-Identifier: MIT
**************************************************************************/
@@ -67,35 +68,6 @@
/* */
/* Host Simulator Controller Driver */
/* */
-/* RELEASE HISTORY */
-/* */
-/* DATE NAME DESCRIPTION */
-/* */
-/* 05-19-2020 Chaoqiong Xiao Initial Version 6.0 */
-/* 09-30-2020 Chaoqiong Xiao Modified comment(s), */
-/* verified memset and memcpy */
-/* cases, */
-/* resulting in version 6.1 */
-/* 04-02-2021 Chaoqiong Xiao Modified comment(s), */
-/* fixed control OUT transfer, */
-/* supported bi-dir-endpoints, */
-/* resulting in version 6.1.6 */
-/* 10-15-2021 Chaoqiong Xiao Modified comment(s), */
-/* improved check for tests, */
-/* added error trap case, */
-/* resulting in version 6.1.9 */
-/* 01-31-2022 Chaoqiong Xiao Modified comment(s), */
-/* added standalone support, */
-/* cleared transfer status */
-/* before semaphore wakeup to */
-/* avoid a race condition, */
-/* resulting in version 6.1.10 */
-/* 07-29-2022 Chaoqiong Xiao Modified comment(s), */
-/* refined device ZLP flow, */
-/* adjusted control request */
-/* data length handling, */
-/* resulting in version 6.1.12 */
-/* */
/**************************************************************************/
UINT _ux_hcd_sim_host_transaction_schedule(UX_HCD_SIM_HOST *hcd_sim_host, UX_HCD_SIM_HOST_ED *ed)
{
@@ -167,10 +139,10 @@ UX_SLAVE_DCD *dcd;
/* Get the pointer to the transfer request. */
slave_transfer_request = &slave_endpoint -> ux_slave_endpoint_transfer_request;
- /* Check the phase for this transfer, if this is the SETUP phase, treatment is different. Explanation of how
- control transfers are handled in the simulator: if the data phase is OUT, we handle it immediately, meaning we
- send all the data to the device and remove the STATUS TD in the same scheduler call. If the data phase is IN, we
- only take out the SETUP TD and handle the data phase like any other non-control transactions (i.e. the scheduler
+ /* Check the phase for this transfer, if this is the SETUP phase, treatment is different. Explanation of how
+ control transfers are handled in the simulator: if the data phase is OUT, we handle it immediately, meaning we
+ send all the data to the device and remove the STATUS TD in the same scheduler call. If the data phase is IN, we
+ only take out the SETUP TD and handle the data phase like any other non-control transactions (i.e. the scheduler
calls us again with the DATA TDs). */
if (td -> ux_sim_host_td_status & UX_HCD_SIM_HOST_TD_SETUP_PHASE)
{
@@ -286,10 +258,10 @@ UX_SLAVE_DCD *dcd;
else
{
- /* There is a hub. We need to call the correct Control Transfer dispatcher.
- If the device is a hub and this transfer is for one of the devices on the
- hub, then we must invoke a separate Control Transfer dispatcher besides
- the regular device stack's. This is because the current device stack doesn't
+ /* There is a hub. We need to call the correct Control Transfer dispatcher.
+ If the device is a hub and this transfer is for one of the devices on the
+ hub, then we must invoke a separate Control Transfer dispatcher besides
+ the regular device stack's. This is because the current device stack doesn't
handle control transfers to device's other than itself. */
/* Is this meant for the device itself? */
@@ -517,7 +489,7 @@ UX_SLAVE_DCD *dcd;
if (wake_host == UX_TRUE)
{
- /* If the slave has less data to send than the host wants to receive, then there may still be
+ /* If the slave has less data to send than the host wants to receive, then there may still be
TDs left to free. Note that this should only happen for IN transactions, since the only way
an OUT transfer can complete is if all the data was sent i.e. all the TDs were sent and freed. */
if (ed -> ux_sim_host_ed_head_td != ed -> ux_sim_host_ed_tail_td)
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 e46e7f75..06c4f98b 100644
--- a/common/core/src/ux_hcd_sim_host_transfer_abort.c
+++ b/common/core/src/ux_hcd_sim_host_transfer_abort.c
@@ -1,18 +1,19 @@
/***************************************************************************
- * Copyright (c) 2024 Microsoft Corporation
- *
+ * Copyright (c) 2024 Microsoft Corporation
+ * Copyright (c) 2026-present Eclipse ThreadX contributors
+ *
* This program and the accompanying materials are made available under the
* terms of the MIT License which is available at
* https://opensource.org/licenses/MIT.
- *
+ *
* SPDX-License-Identifier: MIT
**************************************************************************/
/**************************************************************************/
/**************************************************************************/
-/** */
-/** USBX Component */
+/** */
+/** USBX Component */
/** */
/** Host Simulator Controller Driver */
/** */
@@ -29,48 +30,37 @@
#include "ux_host_stack.h"
-/**************************************************************************/
-/* */
-/* FUNCTION RELEASE */
-/* */
-/* _ux_hcd_sim_host_transfer_abort PORTABLE C */
+/**************************************************************************/
+/* */
+/* FUNCTION RELEASE */
+/* */
+/* _ux_hcd_sim_host_transfer_abort PORTABLE C */
/* 6.1.10 */
/* AUTHOR */
/* */
/* Chaoqiong Xiao, Microsoft Corporation */
/* */
/* DESCRIPTION */
-/* */
-/* This function will abort transactions attached to a transfer */
-/* request. */
-/* */
-/* INPUT */
-/* */
-/* hcd_sim_host Pointer to host controller */
-/* transfer_request Pointer to transfer request */
-/* */
-/* OUTPUT */
-/* */
-/* Completion Status */
-/* */
-/* CALLS */
-/* */
-/* _ux_utility_delay_ms Delay */
-/* */
-/* CALLED BY */
-/* */
+/* */
+/* This function will abort transactions attached to a transfer */
+/* request. */
+/* */
+/* INPUT */
+/* */
+/* hcd_sim_host Pointer to host controller */
+/* transfer_request Pointer to transfer request */
+/* */
+/* OUTPUT */
+/* */
+/* Completion Status */
+/* */
+/* CALLS */
+/* */
+/* _ux_utility_delay_ms Delay */
+/* */
+/* CALLED BY */
+/* */
/* Host Simulator Controller Driver */
-/* */
-/* RELEASE HISTORY */
-/* */
-/* DATE NAME DESCRIPTION */
-/* */
-/* 05-19-2020 Chaoqiong Xiao Initial Version 6.0 */
-/* 09-30-2020 Chaoqiong Xiao Modified comment(s), */
-/* resulting in version 6.1 */
-/* 01-31-2022 Chaoqiong Xiao Modified comment(s), */
-/* added standalone support, */
-/* resulting in version 6.1.10 */
/* */
/**************************************************************************/
UINT _ux_hcd_sim_host_transfer_abort(UX_HCD_SIM_HOST *hcd_sim_host, UX_TRANSFER *transfer_request)
@@ -80,19 +70,19 @@ UX_ENDPOINT *endpoint;
UX_HCD_SIM_HOST_ED *ed;
UX_HCD_SIM_HOST_TD *head_td;
UX_HCD_SIM_HOST_TD *tail_td;
-
+
UX_PARAMETER_NOT_USED(hcd_sim_host);
/* Get the pointer to the endpoint associated with the transfer request. */
endpoint = (UX_ENDPOINT *) transfer_request -> ux_transfer_request_endpoint;
-
+
/* From the endpoint container, get the address of the physical endpoint. */
ed = (UX_HCD_SIM_HOST_ED *) endpoint -> ux_endpoint_ed;
-
+
/* Check if this physical endpoint has been initialized properly! */
if (ed == UX_NULL)
{
-
+
/* Error trap. */
_ux_system_error_handler(UX_SYSTEM_LEVEL_THREAD, UX_SYSTEM_CONTEXT_HCD, UX_ENDPOINT_HANDLE_UNKNOWN);
@@ -107,7 +97,7 @@ UX_HCD_SIM_HOST_TD *tail_td;
#else
/* The endpoint may be active. If so, set the skip bit. */
ed -> ux_sim_host_ed_status |= UX_HCD_SIM_HOST_ED_SKIP;
-
+
/* Wait for the controller to finish the current frame processing. */
_ux_utility_delay_ms(1);
#endif
@@ -139,6 +129,6 @@ UX_HCD_SIM_HOST_TD *tail_td;
#endif
/* Return successful completion. */
- return(UX_SUCCESS);
+ return(UX_SUCCESS);
}
diff --git a/common/core/src/ux_hcd_sim_host_transfer_run.c b/common/core/src/ux_hcd_sim_host_transfer_run.c
index a570b6bb..d1cad858 100644
--- a/common/core/src/ux_hcd_sim_host_transfer_run.c
+++ b/common/core/src/ux_hcd_sim_host_transfer_run.c
@@ -1,10 +1,11 @@
/***************************************************************************
- * Copyright (c) 2024 Microsoft Corporation
- *
+ * Copyright (c) 2024 Microsoft Corporation
+ * Copyright (c) 2026-present Eclipse ThreadX contributors
+ *
* This program and the accompanying materials are made available under the
* terms of the MIT License which is available at
* https://opensource.org/licenses/MIT.
- *
+ *
* SPDX-License-Identifier: MIT
**************************************************************************/
@@ -72,12 +73,6 @@
/* */
/* Host Simulator Controller Driver */
/* */
-/* RELEASE HISTORY */
-/* */
-/* DATE NAME DESCRIPTION */
-/* */
-/* 01-31-2022 Chaoqiong Xiao Initial Version 6.1.10 */
-/* */
/**************************************************************************/
UINT _ux_hcd_sim_host_transfer_run(UX_HCD_SIM_HOST *hcd_sim_host, UX_TRANSFER *transfer_request)
{
diff --git a/common/core/src/ux_hcd_sim_host_uninitialize.c b/common/core/src/ux_hcd_sim_host_uninitialize.c
index 09a0329c..24ac9e7a 100644
--- a/common/core/src/ux_hcd_sim_host_uninitialize.c
+++ b/common/core/src/ux_hcd_sim_host_uninitialize.c
@@ -1,10 +1,11 @@
/***************************************************************************
- * Copyright (c) 2024 Microsoft Corporation
- *
+ * Copyright (c) 2024 Microsoft Corporation
+ * Copyright (c) 2026-present Eclipse ThreadX contributors
+ *
* This program and the accompanying materials are made available under the
* terms of the MIT License which is available at
* https://opensource.org/licenses/MIT.
- *
+ *
* SPDX-License-Identifier: MIT
**************************************************************************/
@@ -61,18 +62,6 @@
/* */
/* Host Simulator Controller Driver */
/* */
-/* RELEASE HISTORY */
-/* */
-/* DATE NAME DESCRIPTION */
-/* */
-/* 11-09-2020 Chaoqiong Xiao Initial Version 6.1.2 */
-/* 01-31-2022 Chaoqiong Xiao Modified comment(s), */
-/* added standalone support, */
-/* resulting in version 6.1.10 */
-/* 10-31-2023 Yajun Xia Modified comment(s), */
-/* refined memory management, */
-/* resulting in version 6.3.0 */
-/* */
/**************************************************************************/
UINT _ux_hcd_sim_host_uninitialize(UX_HCD_SIM_HOST *hcd_sim_host)
{
diff --git a/common/core/src/ux_host_class_dpump_activate.c b/common/core/src/ux_host_class_dpump_activate.c
index 69cef36b..04c280ba 100644
--- a/common/core/src/ux_host_class_dpump_activate.c
+++ b/common/core/src/ux_host_class_dpump_activate.c
@@ -1,18 +1,19 @@
/***************************************************************************
- * Copyright (c) 2024 Microsoft Corporation
- *
+ * Copyright (c) 2024 Microsoft Corporation
+ * Copyright (c) 2026-present Eclipse ThreadX contributors
+ *
* This program and the accompanying materials are made available under the
* terms of the MIT License which is available at
* https://opensource.org/licenses/MIT.
- *
+ *
* SPDX-License-Identifier: MIT
**************************************************************************/
/**************************************************************************/
/**************************************************************************/
-/** */
-/** USBX Component */
+/** */
+/** USBX Component */
/** */
/** Host Data Pump Class */
/** */
@@ -29,58 +30,40 @@
#include "ux_host_stack.h"
-/**************************************************************************/
-/* */
-/* FUNCTION RELEASE */
-/* */
-/* _ux_host_class_dpump_activate PORTABLE C */
+/**************************************************************************/
+/* */
+/* FUNCTION RELEASE */
+/* */
+/* _ux_host_class_dpump_activate PORTABLE C */
/* 6.1.12 */
/* AUTHOR */
/* */
/* Chaoqiong Xiao, Microsoft Corporation */
/* */
/* DESCRIPTION */
-/* */
-/* This function calls the USBX stack to activate the class. */
-/* */
-/* INPUT */
-/* */
-/* command Dpump class command pointer */
-/* */
-/* OUTPUT */
-/* */
-/* Completion Status */
-/* */
-/* CALLS */
-/* */
-/* _ux_host_class_dpump_configure Configure dpump class */
-/* _ux_host_class_dpump_endpoints_get Get endpoints of dpump */
-/* _ux_host_stack_class_instance_create Create class instance */
-/* _ux_host_stack_class_instance_destroy Destroy the class instance */
-/* _ux_utility_memory_allocate Allocate memory block */
-/* _ux_utility_semaphore_create Create dpump semaphore */
-/* */
-/* CALLED BY */
-/* */
-/* _ux_host_class_dpump_entry Entry of dpump class */
-/* */
-/* RELEASE HISTORY */
-/* */
-/* DATE NAME DESCRIPTION */
-/* */
-/* 05-19-2020 Chaoqiong Xiao Initial Version 6.0 */
-/* 09-30-2020 Chaoqiong Xiao Modified comment(s), */
-/* resulting in version 6.1 */
-/* 01-31-2022 Chaoqiong Xiao Modified comment(s), */
-/* added standalone support, */
-/* resulting in version 6.1.10 */
-/* 04-25-2022 Chaoqiong Xiao Modified comment(s), */
-/* internal clean up, */
-/* resulting in version 6.1.11 */
-/* 07-29-2022 Chaoqiong Xiao Modified comment(s), */
-/* fixed parameter/variable */
-/* names conflict C++ keyword, */
-/* resulting in version 6.1.12 */
+/* */
+/* This function calls the USBX stack to activate the class. */
+/* */
+/* INPUT */
+/* */
+/* command Dpump class command pointer */
+/* */
+/* OUTPUT */
+/* */
+/* Completion Status */
+/* */
+/* CALLS */
+/* */
+/* _ux_host_class_dpump_configure Configure dpump class */
+/* _ux_host_class_dpump_endpoints_get Get endpoints of dpump */
+/* _ux_host_stack_class_instance_create Create class instance */
+/* _ux_host_stack_class_instance_destroy Destroy the class instance */
+/* _ux_utility_memory_allocate Allocate memory block */
+/* _ux_utility_semaphore_create Create dpump semaphore */
+/* */
+/* CALLED BY */
+/* */
+/* _ux_host_class_dpump_entry Entry of dpump class */
/* */
/**************************************************************************/
UINT _ux_host_class_dpump_activate(UX_HOST_CLASS_COMMAND *command)
@@ -89,7 +72,7 @@ UINT _ux_host_class_dpump_activate(UX_HOST_CLASS_COMMAND *command)
UX_INTERFACE *interface_ptr;
UX_HOST_CLASS_DPUMP *dpump;
UINT status;
-
+
/* The data pump is always activated by the interface descriptor and not the
device descriptor. */
@@ -116,7 +99,7 @@ UINT status;
_ux_host_stack_class_instance_create(dpump -> ux_host_class_dpump_class, (VOID *) dpump);
/* Configure the dpump. */
- status = _ux_host_class_dpump_configure(dpump);
+ status = _ux_host_class_dpump_configure(dpump);
if (status != UX_SUCCESS)
{
@@ -140,18 +123,18 @@ UINT status;
if a function has been programmed in the system structure. */
if ((status == UX_SUCCESS) && (_ux_system_host -> ux_system_host_change_function != UX_NULL))
{
-
+
/* Call system change function. */
_ux_system_host -> ux_system_host_change_function(UX_DEVICE_INSERTION, dpump -> ux_host_class_dpump_class, (VOID *) dpump);
}
/* If trace is enabled, insert this event into the trace buffer. */
UX_TRACE_IN_LINE_INSERT(UX_TRACE_HOST_CLASS_DPUMP_ACTIVATE, dpump, 0, 0, 0, UX_TRACE_HOST_CLASS_EVENTS, 0, 0)
-
+
/* If trace is enabled, register this object. */
UX_TRACE_OBJECT_REGISTER(UX_TRACE_HOST_OBJECT_TYPE_INTERFACE, dpump, 0, 0, 0)
/* Return completion status. */
- return(status);
+ return(status);
}
diff --git a/common/core/src/ux_host_class_dpump_configure.c b/common/core/src/ux_host_class_dpump_configure.c
index 59d78556..5d8dc74b 100644
--- a/common/core/src/ux_host_class_dpump_configure.c
+++ b/common/core/src/ux_host_class_dpump_configure.c
@@ -1,18 +1,19 @@
/***************************************************************************
- * Copyright (c) 2024 Microsoft Corporation
- *
+ * Copyright (c) 2024 Microsoft Corporation
+ * Copyright (c) 2026-present Eclipse ThreadX contributors
+ *
* This program and the accompanying materials are made available under the
* terms of the MIT License which is available at
* https://opensource.org/licenses/MIT.
- *
+ *
* SPDX-License-Identifier: MIT
**************************************************************************/
/**************************************************************************/
/**************************************************************************/
-/** */
-/** USBX Component */
+/** */
+/** USBX Component */
/** */
/** Host Data Pump Class */
/** */
@@ -29,49 +30,39 @@
#include "ux_host_stack.h"
-/**************************************************************************/
-/* */
-/* FUNCTION RELEASE */
-/* */
-/* _ux_host_class_dpump_configure PORTABLE C */
+/**************************************************************************/
+/* */
+/* FUNCTION RELEASE */
+/* */
+/* _ux_host_class_dpump_configure PORTABLE C */
/* 6.1 */
/* AUTHOR */
/* */
/* Chaoqiong Xiao, Microsoft Corporation */
/* */
/* DESCRIPTION */
-/* */
+/* */
/* This function calls the USBX stack to do a SET_CONFIGURATION to the */
-/* dpump. Once the dpump is configured, its interface will be */
-/* activated. The bulk endpoints enumerated(1 IN, 1 OUT ). */
-/* */
-/* INPUT */
-/* */
-/* dpump Pointer to dpump class */
-/* */
-/* OUTPUT */
-/* */
-/* Completion Status */
-/* */
-/* CALLS */
-/* */
-/* _ux_host_stack_configuration_interface_get Get interface */
-/* _ux_host_stack_device_configuration_get Get configuration */
-/* _ux_host_stack_device_configuration_select Select configuration */
-/* */
-/* CALLED BY */
-/* */
-/* _ux_host_class_dpump_activate Data Pump class activate */
-/* */
-/* 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 */
+/* dpump. Once the dpump is configured, its interface will be */
+/* activated. The bulk endpoints enumerated(1 IN, 1 OUT ). */
+/* */
+/* INPUT */
+/* */
+/* dpump Pointer to dpump class */
+/* */
+/* OUTPUT */
+/* */
+/* Completion Status */
+/* */
+/* CALLS */
+/* */
+/* _ux_host_stack_configuration_interface_get Get interface */
+/* _ux_host_stack_device_configuration_get Get configuration */
+/* _ux_host_stack_device_configuration_select Select configuration */
+/* */
+/* CALLED BY */
+/* */
+/* _ux_host_class_dpump_activate Data Pump class activate */
/* */
/**************************************************************************/
UINT _ux_host_class_dpump_configure(UX_HOST_CLASS_DPUMP *dpump)
@@ -94,52 +85,52 @@ UX_DEVICE *parent_device;
status = _ux_host_stack_device_configuration_get(dpump -> ux_host_class_dpump_device, 0, &configuration);
if (status != UX_SUCCESS)
{
-
+
/* Error trap. */
_ux_system_error_handler(UX_SYSTEM_LEVEL_THREAD, UX_SYSTEM_CONTEXT_CLASS, UX_CONFIGURATION_HANDLE_UNKNOWN);
/* If trace is enabled, insert this event into the trace buffer. */
UX_TRACE_IN_LINE_INSERT(UX_TRACE_ERROR, UX_CONFIGURATION_HANDLE_UNKNOWN, dpump -> ux_host_class_dpump_device, 0, 0, UX_TRACE_ERRORS, 0, 0)
-
+
return(UX_CONFIGURATION_HANDLE_UNKNOWN);
}
#if UX_MAX_DEVICES > 1
- /* Check the dpump power source and check the parent power source for
+ /* 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)
{
/* Get parent device pointer. */
parent_device = dpump -> ux_host_class_dpump_device -> ux_device_parent;
-
- /* If the device is NULL, the parent is the root dpump and we don't have to worry
+
+ /* If the device is NULL, the parent is the root dpump and we don't have to worry
if the parent is not the root dpump, check for its power source. */
if ((parent_device != UX_NULL) && (parent_device -> ux_device_power_source == UX_DEVICE_BUS_POWERED))
- {
+ {
/* If trace is enabled, insert this event into the trace buffer. */
UX_TRACE_IN_LINE_INSERT(UX_TRACE_ERROR, UX_CONNECTION_INCOMPATIBLE, dpump, 0, 0, UX_TRACE_ERRORS, 0, 0)
return(UX_CONNECTION_INCOMPATIBLE);
- }
+ }
}
#endif
-
- /* We have the valid configuration. Ask the USBX stack to set this configuration. */
+
+ /* 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)
return(status);
- /* If the operation went well, the dpump default alternate setting for the dpump interface is
- active and the interrupt endpoint is now enabled. We have to memorize the first interface since
+ /* If the operation went well, the dpump default alternate setting for the dpump interface is
+ active and the interrupt endpoint is now enabled. We have to memorize the first interface since
the interrupt endpoint is hooked to it. */
status = _ux_host_stack_configuration_interface_get(configuration, 0, 0, &dpump -> ux_host_class_dpump_interface);
if (status != UX_SUCCESS)
{
/* Store the instance in the interface container, this is for the USB stack
- when it needs to invoke the class. */
+ when it needs to invoke the class. */
dpump -> ux_host_class_dpump_interface -> ux_interface_class_instance = (VOID *) dpump;
}
diff --git a/common/core/src/ux_host_class_dpump_deactivate.c b/common/core/src/ux_host_class_dpump_deactivate.c
index 7fd6d0cb..8a3594f1 100644
--- a/common/core/src/ux_host_class_dpump_deactivate.c
+++ b/common/core/src/ux_host_class_dpump_deactivate.c
@@ -1,18 +1,19 @@
/***************************************************************************
- * Copyright (c) 2024 Microsoft Corporation
- *
+ * Copyright (c) 2024 Microsoft Corporation
+ * Copyright (c) 2026-present Eclipse ThreadX contributors
+ *
* This program and the accompanying materials are made available under the
* terms of the MIT License which is available at
* https://opensource.org/licenses/MIT.
- *
+ *
* SPDX-License-Identifier: MIT
**************************************************************************/
/**************************************************************************/
/**************************************************************************/
-/** */
-/** USBX Component */
+/** */
+/** USBX Component */
/** */
/** Host Data Pump Class */
/** */
@@ -29,53 +30,42 @@
#include "ux_host_stack.h"
-/**************************************************************************/
-/* */
-/* FUNCTION RELEASE */
-/* */
-/* _ux_host_class_dpump_deactivate PORTABLE C */
+/**************************************************************************/
+/* */
+/* FUNCTION RELEASE */
+/* */
+/* _ux_host_class_dpump_deactivate PORTABLE C */
/* 6.1.10 */
/* AUTHOR */
/* */
/* Chaoqiong Xiao, Microsoft Corporation */
/* */
/* DESCRIPTION */
-/* */
+/* */
/* This function is called when this instance of the dpump has been */
-/* removed from the bus either directly or indirectly. The bulk in\out */
-/* pipes will be destroyed and the instanced removed. */
-/* */
-/* INPUT */
-/* */
-/* command Data Pump class command pointer */
-/* */
-/* OUTPUT */
-/* */
-/* Completion Status */
-/* */
-/* CALLS */
-/* */
-/* _ux_host_stack_class_instance_destroy Destroy the class instance */
-/* _ux_host_stack_endpoint_transfer_abort Abort endpoint transfer */
-/* _ux_utility_memory_free Free memory block */
-/* _ux_utility_semaphore_get Get protection semaphore */
-/* _ux_utility_semaphore_delete Delete protection semaphore */
+/* removed from the bus either directly or indirectly. The bulk in\out */
+/* pipes will be destroyed and the instanced removed. */
+/* */
+/* INPUT */
+/* */
+/* command Data Pump class command pointer */
+/* */
+/* OUTPUT */
+/* */
+/* Completion Status */
+/* */
+/* CALLS */
+/* */
+/* _ux_host_stack_class_instance_destroy Destroy the class instance */
+/* _ux_host_stack_endpoint_transfer_abort Abort endpoint transfer */
+/* _ux_utility_memory_free Free memory block */
+/* _ux_utility_semaphore_get Get protection semaphore */
+/* _ux_utility_semaphore_delete Delete protection semaphore */
/* _ux_utility_thread_sleep Sleep thread */
-/* */
-/* CALLED BY */
-/* */
-/* _ux_host_class_dpump_entry Entry of dpump class */
-/* */
-/* RELEASE HISTORY */
-/* */
-/* DATE NAME DESCRIPTION */
-/* */
-/* 05-19-2020 Chaoqiong Xiao Initial Version 6.0 */
-/* 09-30-2020 Chaoqiong Xiao Modified comment(s), */
-/* resulting in version 6.1 */
-/* 01-31-2022 Chaoqiong Xiao Modified comment(s), */
-/* added standalone support, */
-/* resulting in version 6.1.10 */
+/* */
+/* CALLED BY */
+/* */
+/* _ux_host_class_dpump_entry Entry of dpump class */
/* */
/**************************************************************************/
UINT _ux_host_class_dpump_deactivate(UX_HOST_CLASS_COMMAND *command)
@@ -94,14 +84,14 @@ UINT status;
/* Protect thread reentry to this instance. */
status = _ux_host_semaphore_get(&dpump -> ux_host_class_dpump_semaphore, UX_WAIT_FOREVER);
if (status != UX_SUCCESS)
- {
+ {
/* If trace is enabled, insert this event into the trace buffer. */
UX_TRACE_IN_LINE_INSERT(UX_TRACE_ERROR, UX_HOST_CLASS_INSTANCE_UNKNOWN, dpump, 0, 0, UX_TRACE_ERRORS, 0, 0)
return(UX_HOST_CLASS_INSTANCE_UNKNOWN);
}
-
+
/* We need to abort transactions on the bulk Out pipe. */
_ux_host_stack_endpoint_transfer_abort(dpump -> ux_host_class_dpump_bulk_out_endpoint);
@@ -109,7 +99,7 @@ UINT status;
_ux_host_stack_endpoint_transfer_abort(dpump -> ux_host_class_dpump_bulk_in_endpoint);
/* If the class instance was busy, let it finish properly and not return. */
- _ux_host_thread_sleep(UX_ENUMERATION_THREAD_WAIT);
+ _ux_host_thread_sleep(UX_ENUMERATION_THREAD_WAIT);
/* Destroy the instance. */
_ux_host_stack_class_instance_destroy(dpump -> ux_host_class_dpump_class, (VOID *) dpump);
@@ -121,7 +111,7 @@ UINT status;
that the device is removed. */
if (_ux_system_host -> ux_system_host_change_function != UX_NULL)
{
-
+
/* Inform the application the device is removed. */
_ux_system_host -> ux_system_host_change_function(UX_DEVICE_REMOVAL, dpump -> ux_host_class_dpump_class, (VOID *) dpump);
}
@@ -135,6 +125,6 @@ UINT status;
_ux_utility_memory_free(dpump);
/* Return successful status. */
- return(UX_SUCCESS);
+ return(UX_SUCCESS);
}
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 5f2c47c2..4e62235b 100644
--- a/common/core/src/ux_host_class_dpump_endpoints_get.c
+++ b/common/core/src/ux_host_class_dpump_endpoints_get.c
@@ -1,18 +1,19 @@
/***************************************************************************
- * Copyright (c) 2024 Microsoft Corporation
- *
+ * Copyright (c) 2024 Microsoft Corporation
+ * Copyright (c) 2026-present Eclipse ThreadX contributors
+ *
* This program and the accompanying materials are made available under the
* terms of the MIT License which is available at
* https://opensource.org/licenses/MIT.
- *
+ *
* SPDX-License-Identifier: MIT
**************************************************************************/
/**************************************************************************/
/**************************************************************************/
-/** */
-/** USBX Component */
+/** */
+/** USBX Component */
/** */
/** Host Data Pump Class */
/** */
@@ -29,47 +30,36 @@
#include "ux_host_stack.h"
-/**************************************************************************/
-/* */
-/* FUNCTION RELEASE */
-/* */
-/* _ux_host_class_dpump_endpoints_get PORTABLE C */
+/**************************************************************************/
+/* */
+/* FUNCTION RELEASE */
+/* */
+/* _ux_host_class_dpump_endpoints_get PORTABLE C */
/* 6.1.10 */
/* AUTHOR */
/* */
/* Chaoqiong Xiao, Microsoft Corporation */
/* */
/* DESCRIPTION */
-/* */
+/* */
/* This function search for the handle of the bulk out and bulk in */
-/* endpoints. */
-/* */
-/* INPUT */
-/* */
-/* dpump Pointer to dpump class */
-/* */
-/* OUTPUT */
-/* */
-/* Completion Status */
-/* */
-/* CALLS */
-/* */
-/* _ux_host_stack_interface_endpoint_get Get interface endpoint */
-/* */
-/* CALLED BY */
-/* */
-/* _ux_host_class_dpump_activate Activate dpump class */
-/* */
-/* RELEASE HISTORY */
-/* */
-/* DATE NAME DESCRIPTION */
-/* */
-/* 05-19-2020 Chaoqiong Xiao Initial Version 6.0 */
-/* 09-30-2020 Chaoqiong Xiao Modified comment(s), */
-/* resulting in version 6.1 */
-/* 01-31-2022 Chaoqiong Xiao Modified comment(s), */
-/* added standalone support, */
-/* resulting in version 6.1.10 */
+/* endpoints. */
+/* */
+/* INPUT */
+/* */
+/* dpump Pointer to dpump class */
+/* */
+/* OUTPUT */
+/* */
+/* Completion Status */
+/* */
+/* CALLS */
+/* */
+/* _ux_host_stack_interface_endpoint_get Get interface endpoint */
+/* */
+/* CALLED BY */
+/* */
+/* _ux_host_class_dpump_activate Activate dpump class */
/* */
/**************************************************************************/
UINT _ux_host_class_dpump_endpoints_get(UX_HOST_CLASS_DPUMP *dpump)
@@ -83,7 +73,7 @@ UX_ENDPOINT *endpoint;
/* Search the bulk OUT endpoint. It is attached to the interface container. */
for (endpoint_index = 0; endpoint_index < dpump -> ux_host_class_dpump_interface -> ux_interface_descriptor.bNumEndpoints;
endpoint_index++)
- {
+ {
/* Get interface endpoint. */
status = _ux_host_stack_interface_endpoint_get(dpump -> ux_host_class_dpump_interface, endpoint_index, &endpoint);
@@ -108,8 +98,8 @@ UX_ENDPOINT *endpoint;
dpump -> ux_host_class_dpump_bulk_out_endpoint = endpoint;
break;
}
- }
- }
+ }
+ }
/* The bulk out endpoint is mandatory. */
if (dpump -> ux_host_class_dpump_bulk_out_endpoint == UX_NULL)
@@ -123,12 +113,12 @@ UX_ENDPOINT *endpoint;
return(UX_ENDPOINT_HANDLE_UNKNOWN);
}
-
+
/* Search the bulk IN endpoint. It is attached to the interface container. */
for (endpoint_index = 0; endpoint_index < dpump -> ux_host_class_dpump_interface -> ux_interface_descriptor.bNumEndpoints;
endpoint_index++)
- {
+ {
/* Get the endpoint handle. */
status = _ux_host_stack_interface_endpoint_get(dpump -> ux_host_class_dpump_interface, endpoint_index, &endpoint);
@@ -153,12 +143,12 @@ UX_ENDPOINT *endpoint;
dpump -> ux_host_class_dpump_bulk_in_endpoint = endpoint;
break;
}
- }
- }
+ }
+ }
/* The bulk in endpoint is mandatory. */
if (dpump -> ux_host_class_dpump_bulk_in_endpoint == UX_NULL)
- {
+ {
/* Error trap. */
_ux_system_error_handler(UX_SYSTEM_LEVEL_THREAD, UX_SYSTEM_CONTEXT_CLASS, UX_ENDPOINT_HANDLE_UNKNOWN);
@@ -168,7 +158,7 @@ UX_ENDPOINT *endpoint;
return(UX_ENDPOINT_HANDLE_UNKNOWN);
}
-
+
/* All endpoints have been mounted. */
return(UX_SUCCESS);
}
diff --git a/common/core/src/ux_host_class_dpump_entry.c b/common/core/src/ux_host_class_dpump_entry.c
index 6f7a66e9..988396fb 100644
--- a/common/core/src/ux_host_class_dpump_entry.c
+++ b/common/core/src/ux_host_class_dpump_entry.c
@@ -1,18 +1,19 @@
/***************************************************************************
- * Copyright (c) 2024 Microsoft Corporation
- *
+ * Copyright (c) 2024 Microsoft Corporation
+ * Copyright (c) 2026-present Eclipse ThreadX contributors
+ *
* This program and the accompanying materials are made available under the
* terms of the MIT License which is available at
* https://opensource.org/licenses/MIT.
- *
+ *
* SPDX-License-Identifier: MIT
**************************************************************************/
/**************************************************************************/
/**************************************************************************/
-/** */
-/** USBX Component */
+/** */
+/** USBX Component */
/** */
/** Host Data Pump Class */
/** */
@@ -29,49 +30,38 @@
#include "ux_host_stack.h"
-/**************************************************************************/
-/* */
-/* FUNCTION RELEASE */
-/* */
-/* _ux_host_class_dpump_entry PORTABLE C */
+/**************************************************************************/
+/* */
+/* FUNCTION RELEASE */
+/* */
+/* _ux_host_class_dpump_entry PORTABLE C */
/* 6.1.10 */
/* AUTHOR */
/* */
/* Chaoqiong Xiao, Microsoft Corporation */
/* */
/* DESCRIPTION */
-/* */
-/* This function is the entry point of the dpump class. It will be */
-/* called by the USBX stack enumeration module when there is a new */
-/* dpump on the bus or when the USB dpump is removed. */
-/* */
-/* INPUT */
-/* */
+/* */
+/* This function is the entry point of the dpump class. It will be */
+/* called by the USBX stack enumeration module when there is a new */
+/* dpump on the bus or when the USB dpump is removed. */
+/* */
+/* INPUT */
+/* */
/* command Data pump class command */
-/* */
-/* OUTPUT */
-/* */
-/* Completion Status */
-/* */
-/* CALLS */
-/* */
-/* _ux_host_class_dpump_activate Activate dpump class */
-/* _ux_host_class_dpump_deactivate Deactivate dpump class */
-/* */
-/* CALLED BY */
-/* */
-/* Data pump Class */
-/* */
-/* RELEASE HISTORY */
-/* */
-/* DATE NAME DESCRIPTION */
-/* */
-/* 05-19-2020 Chaoqiong Xiao Initial Version 6.0 */
-/* 09-30-2020 Chaoqiong Xiao Modified comment(s), */
-/* resulting in version 6.1 */
-/* 01-31-2022 Chaoqiong Xiao Modified comment(s), */
-/* added standalone support, */
-/* resulting in version 6.1.10 */
+/* */
+/* OUTPUT */
+/* */
+/* Completion Status */
+/* */
+/* CALLS */
+/* */
+/* _ux_host_class_dpump_activate Activate dpump class */
+/* _ux_host_class_dpump_deactivate Deactivate dpump class */
+/* */
+/* CALLED BY */
+/* */
+/* Data pump Class */
/* */
/**************************************************************************/
UINT _ux_host_class_dpump_entry(UX_HOST_CLASS_COMMAND *command)
@@ -93,10 +83,10 @@ UINT status;
(command -> ux_host_class_command_class == UX_HOST_CLASS_DPUMP_CLASS) &&
(command -> ux_host_class_command_subclass == UX_HOST_CLASS_DPUMP_SUBCLASS) &&
(command -> ux_host_class_command_protocol == UX_HOST_CLASS_DPUMP_PROTOCOL))
- return(UX_SUCCESS);
- else
- return(UX_NO_CLASS_MATCH);
-
+ return(UX_SUCCESS);
+ else
+ return(UX_NO_CLASS_MATCH);
+
case UX_HOST_CLASS_COMMAND_ACTIVATE:
/* The activate command is used when the device inserted has found a parent and
@@ -109,13 +99,13 @@ UINT status;
case UX_HOST_CLASS_COMMAND_DEACTIVATE:
- /* The deactivate command is used when the device has been extracted either
+ /* The deactivate command is used when the device has been extracted either
directly or when its parents has been extracted. */
status = _ux_host_class_dpump_deactivate(command);
return(status);
- default:
-
+ default:
+
/* Error trap. */
_ux_system_error_handler(UX_SYSTEM_LEVEL_THREAD, UX_SYSTEM_CONTEXT_CLASS, UX_FUNCTION_NOT_SUPPORTED);
@@ -123,6 +113,6 @@ UINT status;
UX_TRACE_IN_LINE_INSERT(UX_TRACE_ERROR, UX_FUNCTION_NOT_SUPPORTED, 0, 0, 0, UX_TRACE_ERRORS, 0, 0)
return(UX_FUNCTION_NOT_SUPPORTED);
- }
+ }
}
diff --git a/common/core/src/ux_host_class_dpump_ioctl.c b/common/core/src/ux_host_class_dpump_ioctl.c
index 288f03ba..ee4d4bc9 100644
--- a/common/core/src/ux_host_class_dpump_ioctl.c
+++ b/common/core/src/ux_host_class_dpump_ioctl.c
@@ -1,18 +1,19 @@
/***************************************************************************
- * Copyright (c) 2024 Microsoft Corporation
- *
+ * Copyright (c) 2024 Microsoft Corporation
+ * Copyright (c) 2026-present Eclipse ThreadX contributors
+ *
* This program and the accompanying materials are made available under the
* terms of the MIT License which is available at
* https://opensource.org/licenses/MIT.
- *
+ *
* SPDX-License-Identifier: MIT
**************************************************************************/
/**************************************************************************/
/**************************************************************************/
-/** */
-/** USBX Component */
+/** */
+/** USBX Component */
/** */
/** Host Data Pump Class */
/** */
@@ -29,51 +30,39 @@
#include "ux_host_stack.h"
-/**************************************************************************/
-/* */
-/* FUNCTION RELEASE */
-/* */
-/* _ux_host_class_dpump_ioctl PORTABLE C */
+/**************************************************************************/
+/* */
+/* FUNCTION RELEASE */
+/* */
+/* _ux_host_class_dpump_ioctl PORTABLE C */
/* 6.1.12 */
/* AUTHOR */
/* */
/* Chaoqiong Xiao, Microsoft Corporation */
/* */
/* DESCRIPTION */
-/* */
-/* This function is called by the application to change the alternate */
-/* setting of the dpump class. */
-/* */
-/* INPUT */
-/* */
-/* dpump Pointer to the dpump class */
-/* ioctl_function ioctl function */
-/* parameter pointer to structure */
-/* */
-/* */
-/* OUTPUT */
-/* */
-/* Completion Status */
-/* */
-/* CALLS */
-/* */
+/* */
+/* This function is called by the application to change the alternate */
+/* setting of the dpump class. */
+/* */
+/* INPUT */
+/* */
+/* dpump Pointer to the dpump class */
+/* ioctl_function ioctl function */
+/* parameter pointer to structure */
+/* */
+/* */
+/* OUTPUT */
+/* */
+/* Completion Status */
+/* */
+/* CALLS */
+/* */
/* _ux_host_stack_interface_setting_select */
/* Select alternate setting */
-/* */
-/* CALLED BY */
-/* */
-/* */
-/* RELEASE HISTORY */
-/* */
-/* DATE NAME DESCRIPTION */
-/* */
-/* 05-19-2020 Chaoqiong Xiao Initial Version 6.0 */
-/* 09-30-2020 Chaoqiong Xiao Modified comment(s), */
-/* resulting in version 6.1 */
-/* 07-29-2022 Chaoqiong Xiao Modified comment(s), */
-/* fixed parameter/variable */
-/* names conflict C++ keyword, */
-/* resulting in version 6.1.12 */
+/* */
+/* CALLED BY */
+/* */
/* */
/**************************************************************************/
UINT _ux_host_class_dpump_ioctl(UX_HOST_CLASS_DPUMP *dpump, ULONG ioctl_function,
@@ -85,9 +74,9 @@ UX_INTERFACE *interface_ptr;
UINT status;
/* Ensure the instance is valid. */
- if ((dpump -> ux_host_class_dpump_state != UX_HOST_CLASS_INSTANCE_LIVE) &&
+ if ((dpump -> ux_host_class_dpump_state != UX_HOST_CLASS_INSTANCE_LIVE) &&
(dpump -> ux_host_class_dpump_state != UX_HOST_CLASS_INSTANCE_MOUNTING))
- {
+ {
/* Error trap. */
_ux_system_error_handler(UX_SYSTEM_LEVEL_THREAD, UX_SYSTEM_CONTEXT_CLASS, UX_HOST_CLASS_INSTANCE_UNKNOWN);
@@ -102,24 +91,24 @@ UINT status;
switch (ioctl_function)
{
- case UX_HOST_CLASS_DPUMP_SELECT_ALTERNATE_SETTING:
+ case UX_HOST_CLASS_DPUMP_SELECT_ALTERNATE_SETTING:
- /* The parameter value has the alternate setting number.
+ /* The parameter value has the alternate setting number.
We need to scan the entire device framework. Only one configuration for data pump device framework. */
interface_ptr = dpump -> ux_host_class_dpump_interface;
configuration = interface_ptr -> ux_interface_configuration;
/* Do some verification just in case ! */
if (configuration == UX_NULL)
- {
+ {
/* Error trap. */
_ux_system_error_handler(UX_SYSTEM_LEVEL_THREAD, UX_SYSTEM_CONTEXT_CLASS, UX_HOST_CLASS_INSTANCE_UNKNOWN);
return(UX_HOST_CLASS_INSTANCE_UNKNOWN);
}
-
+
/* Point to the first interface. */
interface_ptr = configuration -> ux_configuration_first_interface;
@@ -133,11 +122,11 @@ UINT status;
/* We have found the alternate setting. Select it now. */
status = _ux_host_stack_interface_setting_select(interface_ptr);
-
+
/* We are done here. */
return(status);
}
-
+
/* Next interface. */
interface_ptr = interface_ptr -> ux_interface_next_interface;
}
@@ -150,7 +139,7 @@ UINT status;
break;
- default:
+ default:
/* 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)
@@ -161,7 +150,7 @@ UINT status;
/* Error trap. */
_ux_system_error_handler(UX_SYSTEM_LEVEL_THREAD, UX_SYSTEM_CONTEXT_CLASS, status);
- }
+ }
/* Return status to caller. */
return(status);
diff --git a/common/core/src/ux_host_class_dpump_read.c b/common/core/src/ux_host_class_dpump_read.c
index 37b15670..d7217dcc 100644
--- a/common/core/src/ux_host_class_dpump_read.c
+++ b/common/core/src/ux_host_class_dpump_read.c
@@ -1,18 +1,19 @@
/***************************************************************************
- * Copyright (c) 2024 Microsoft Corporation
- *
+ * Copyright (c) 2024 Microsoft Corporation
+ * Copyright (c) 2026-present Eclipse ThreadX contributors
+ *
* This program and the accompanying materials are made available under the
* terms of the MIT License which is available at
* https://opensource.org/licenses/MIT.
- *
+ *
* SPDX-License-Identifier: MIT
**************************************************************************/
/**************************************************************************/
/**************************************************************************/
-/** */
-/** USBX Component */
+/** */
+/** USBX Component */
/** */
/** Host Data Pump Class */
/** */
@@ -29,58 +30,47 @@
#include "ux_host_stack.h"
-/**************************************************************************/
-/* */
-/* FUNCTION RELEASE */
-/* */
-/* _ux_host_class_dpump_read PORTABLE C */
+/**************************************************************************/
+/* */
+/* FUNCTION RELEASE */
+/* */
+/* _ux_host_class_dpump_read PORTABLE C */
/* 6.1.10 */
/* AUTHOR */
/* */
/* Chaoqiong Xiao, Microsoft Corporation */
/* */
/* DESCRIPTION */
-/* */
-/* This function reads from the dpump interface. The call is */
-/* blocking and only returns when there is either an error or when */
+/* */
+/* This function reads from the dpump interface. The call is */
+/* blocking and only returns when there is either an error or when */
/* the transfer is complete. */
/* */
-/* INPUT */
-/* */
-/* dpump Pointer to dpump class */
+/* INPUT */
+/* */
+/* dpump Pointer to dpump class */
/* data_pointer Pointer to buffer */
/* requested_length Requested data read */
/* actual_length Actual data read */
-/* */
-/* OUTPUT */
-/* */
-/* Completion Status */
-/* */
-/* CALLS */
-/* */
-/* _ux_host_stack_class_instance_verify Verify the class instance */
-/* _ux_host_stack_transfer_request Process transfer request */
-/* _ux_host_stack_transfer_request_abort Abort transfer request */
-/* _ux_utility_semaphore_get Get protection semaphore */
-/* _ux_utility_semaphore_put Release protection semaphore */
-/* */
-/* 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), */
-/* resulting in version 6.1 */
-/* 01-31-2022 Chaoqiong Xiao Modified comment(s), */
-/* added standalone support, */
-/* resulting in version 6.1.10 */
+/* */
+/* OUTPUT */
+/* */
+/* Completion Status */
+/* */
+/* CALLS */
+/* */
+/* _ux_host_stack_class_instance_verify Verify the class instance */
+/* _ux_host_stack_transfer_request Process transfer request */
+/* _ux_host_stack_transfer_request_abort Abort transfer request */
+/* _ux_utility_semaphore_get Get protection semaphore */
+/* _ux_utility_semaphore_put Release protection semaphore */
+/* */
+/* CALLED BY */
+/* */
+/* Application */
/* */
/**************************************************************************/
-UINT _ux_host_class_dpump_read(UX_HOST_CLASS_DPUMP *dpump, UCHAR *data_pointer,
+UINT _ux_host_class_dpump_read(UX_HOST_CLASS_DPUMP *dpump, UCHAR *data_pointer,
ULONG requested_length, ULONG *actual_length)
{
@@ -90,13 +80,13 @@ UX_INTERRUPT_SAVE_AREA
UX_TRANSFER *transfer_request;
UINT status;
ULONG transfer_request_length;
-
+
/* If trace is enabled, insert this event into the trace buffer. */
UX_TRACE_IN_LINE_INSERT(UX_TRACE_HOST_CLASS_DPUMP_READ, dpump, data_pointer, requested_length, 0, UX_TRACE_HOST_CLASS_EVENTS, 0, 0)
-
+
/* Ensure the instance is valid. */
if (_ux_host_stack_class_instance_verify(_ux_system_host_class_dpump_name, (VOID *) dpump) != UX_SUCCESS)
- {
+ {
/* Error trap. */
_ux_system_error_handler(UX_SYSTEM_LEVEL_THREAD, UX_SYSTEM_CONTEXT_CLASS, UX_HOST_CLASS_INSTANCE_UNKNOWN);
@@ -145,11 +135,11 @@ ULONG transfer_request_length;
transfer_request_length = transfer_request -> ux_transfer_request_maximum_length;
else
transfer_request_length = requested_length;
-
+
/* Initialize the transfer request. */
transfer_request -> ux_transfer_request_data_pointer = data_pointer;
transfer_request -> ux_transfer_request_requested_length = transfer_request_length;
-
+
/* Perform the transfer. */
status = _ux_host_stack_transfer_request(transfer_request);
@@ -166,7 +156,7 @@ ULONG transfer_request_length;
/* If the transfer is successful, we need to wait for the transfer request to be completed. */
if (status == UX_SUCCESS)
{
-
+
/* Wait for the completion of the transfer_request. */
status = _ux_host_semaphore_get(&transfer_request -> ux_transfer_request_semaphore, UX_HOST_CLASS_DPUMP_CLASS_TRANSFER_TIMEOUT);
@@ -176,26 +166,26 @@ ULONG transfer_request_length;
/* All transfers pending need to abort. There may have been a partial transfer. */
_ux_host_stack_transfer_request_abort(transfer_request);
-
- /* Update the length of the actual data transferred. We do this after the
+
+ /* Update the length of the actual data transferred. We do this after the
abort of the transfer request in case some data was actually received. */
*actual_length += transfer_request -> ux_transfer_request_actual_length;
-
+
/* Unprotect thread reentry to this instance. */
_ux_host_semaphore_put(&dpump -> ux_host_class_dpump_semaphore);
/* Set the completion code. */
transfer_request -> ux_transfer_request_completion_code = UX_TRANSFER_TIMEOUT;
-
+
/* Error trap. */
_ux_system_error_handler(UX_SYSTEM_LEVEL_THREAD, UX_SYSTEM_CONTEXT_CLASS, UX_TRANSFER_TIMEOUT);
/* If trace is enabled, insert this event into the trace buffer. */
UX_TRACE_IN_LINE_INSERT(UX_TRACE_ERROR, UX_TRANSFER_TIMEOUT, transfer_request, 0, 0, UX_TRACE_ERRORS, 0, 0)
-
+
/* There was an error, return to the caller */
return(UX_TRANSFER_TIMEOUT);
- }
+ }
}
else
{
@@ -210,26 +200,26 @@ ULONG transfer_request_length;
/* Update the length of the transfer. Normally all the data has to be received. */
*actual_length += transfer_request -> ux_transfer_request_actual_length;
-
+
/* Check for completion of transfer. If the transfer is partial, return to caller.
The transfer is marked as successful but the caller will need to check the length
actually received and determine if a partial transfer is OK. */
if (transfer_request_length != transfer_request -> ux_transfer_request_actual_length)
{
-
+
/* Unprotect thread reentry to this instance. */
_ux_host_semaphore_put(&dpump -> ux_host_class_dpump_semaphore);
-
+
/* Return success to caller. */
return(UX_SUCCESS);
}
- /* Update the data pointer for next transfer. */
+ /* Update the data pointer for next transfer. */
data_pointer += transfer_request_length;
-
+
/* Update what is left to receive. */
- requested_length -= transfer_request_length;
- }
+ requested_length -= transfer_request_length;
+ }
/* Unprotect thread reentry to this instance. */
#if defined(UX_HOST_STANDALONE)
@@ -239,6 +229,6 @@ ULONG transfer_request_length;
#endif
/* We get here when all the transfers went through without errors. */
- return(UX_SUCCESS);
+ return(UX_SUCCESS);
}
diff --git a/common/core/src/ux_host_class_dpump_write.c b/common/core/src/ux_host_class_dpump_write.c
index d5e47fa1..26decb29 100644
--- a/common/core/src/ux_host_class_dpump_write.c
+++ b/common/core/src/ux_host_class_dpump_write.c
@@ -1,18 +1,19 @@
/***************************************************************************
- * Copyright (c) 2024 Microsoft Corporation
- *
+ * Copyright (c) 2024 Microsoft Corporation
+ * Copyright (c) 2026-present Eclipse ThreadX contributors
+ *
* This program and the accompanying materials are made available under the
* terms of the MIT License which is available at
* https://opensource.org/licenses/MIT.
- *
+ *
* SPDX-License-Identifier: MIT
**************************************************************************/
/**************************************************************************/
/**************************************************************************/
-/** */
-/** USBX Component */
+/** */
+/** USBX Component */
/** */
/** Host Data Pump Class */
/** */
@@ -29,61 +30,47 @@
#include "ux_host_stack.h"
-/**************************************************************************/
-/* */
-/* FUNCTION RELEASE */
-/* */
-/* _ux_host_class_dpump_write PORTABLE C */
+/**************************************************************************/
+/* */
+/* FUNCTION RELEASE */
+/* */
+/* _ux_host_class_dpump_write PORTABLE C */
/* 6.1.11 */
/* AUTHOR */
/* */
/* Chaoqiong Xiao, Microsoft Corporation */
/* */
/* DESCRIPTION */
-/* */
-/* This function writes to the dpump interface. The call is blocking */
-/* and only returns when there is either an error or when the transfer */
-/* is complete. */
-/* */
-/* INPUT */
-/* */
-/* dpump Pointer to dpump class */
-/* data_pointer Pointer to data to write */
-/* requested_length Length of data to write */
-/* actual_length Actual length of data written */
-/* */
-/* OUTPUT */
-/* */
-/* Completion Status */
-/* */
-/* CALLS */
-/* */
-/* _ux_host_stack_class_instance_verify Verify the class instance */
-/* _ux_host_stack_transfer_request Process transfer request */
-/* _ux_host_stack_transfer_request_abort Abort transfer request */
-/* _ux_utility_semaphore_get Get protection semaphore */
-/* _ux_utility_semaphore_put Release protection semaphore */
-/* */
-/* 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), */
-/* resulting in version 6.1 */
-/* 01-31-2022 Chaoqiong Xiao Modified comment(s), */
-/* added standalone support, */
-/* resulting in version 6.1.10 */
-/* 04-25-2022 Chaoqiong Xiao Modified comment(s), */
-/* internal clean up, */
-/* resulting in version 6.1.11 */
+/* */
+/* This function writes to the dpump interface. The call is blocking */
+/* and only returns when there is either an error or when the transfer */
+/* is complete. */
+/* */
+/* INPUT */
+/* */
+/* dpump Pointer to dpump class */
+/* data_pointer Pointer to data to write */
+/* requested_length Length of data to write */
+/* actual_length Actual length of data written */
+/* */
+/* OUTPUT */
+/* */
+/* Completion Status */
+/* */
+/* CALLS */
+/* */
+/* _ux_host_stack_class_instance_verify Verify the class instance */
+/* _ux_host_stack_transfer_request Process transfer request */
+/* _ux_host_stack_transfer_request_abort Abort transfer request */
+/* _ux_utility_semaphore_get Get protection semaphore */
+/* _ux_utility_semaphore_put Release protection semaphore */
+/* */
+/* CALLED BY */
+/* */
+/* Application */
/* */
/**************************************************************************/
-UINT _ux_host_class_dpump_write(UX_HOST_CLASS_DPUMP *dpump, UCHAR * data_pointer,
+UINT _ux_host_class_dpump_write(UX_HOST_CLASS_DPUMP *dpump, UCHAR * data_pointer,
ULONG requested_length, ULONG *actual_length)
{
@@ -93,13 +80,13 @@ UX_INTERRUPT_SAVE_AREA
UX_TRANSFER *transfer_request;
UINT status;
ULONG transfer_request_length;
-
+
/* If trace is enabled, insert this event into the trace buffer. */
UX_TRACE_IN_LINE_INSERT(UX_TRACE_HOST_CLASS_DPUMP_WRITE, dpump, data_pointer, requested_length, 0, UX_TRACE_HOST_CLASS_EVENTS, 0, 0)
-
+
/* Ensure the instance is valid. */
if(_ux_host_stack_class_instance_verify((UCHAR *) _ux_system_host_class_dpump_name, (VOID *) dpump) != UX_SUCCESS)
- {
+ {
/* Error trap. */
_ux_system_error_handler(UX_SYSTEM_LEVEL_THREAD, UX_SYSTEM_CONTEXT_CLASS, UX_HOST_CLASS_INSTANCE_UNKNOWN);
@@ -148,11 +135,11 @@ ULONG transfer_request_length;
transfer_request_length = transfer_request -> ux_transfer_request_maximum_length;
else
transfer_request_length = requested_length;
-
+
/* Initialize the transfer_request. */
transfer_request -> ux_transfer_request_data_pointer = data_pointer;
transfer_request -> ux_transfer_request_requested_length = transfer_request_length;
-
+
/* Perform the transfer. */
status = _ux_host_stack_transfer_request(transfer_request);
@@ -168,7 +155,7 @@ ULONG transfer_request_length;
/* If the transfer is successful, we need to wait for the transfer request to be completed. */
if (status == UX_SUCCESS)
{
-
+
/* Wait for the completion of the transfer request. */
status = _ux_host_semaphore_get(&transfer_request -> ux_transfer_request_semaphore, UX_HOST_CLASS_DPUMP_CLASS_TRANSFER_TIMEOUT);
@@ -178,26 +165,26 @@ ULONG transfer_request_length;
/* All transfers pending need to abort. There may have been a partial transfer. */
_ux_host_stack_transfer_request_abort(transfer_request);
-
- /* Update the length of the actual data transferred. We do this after the
+
+ /* Update the length of the actual data transferred. We do this after the
abort of the transfer_request in case some data actually went out. */
*actual_length += transfer_request -> ux_transfer_request_actual_length;
-
+
/* Unprotect thread reentry to this instance. */
_ux_host_semaphore_put(&dpump -> ux_host_class_dpump_semaphore);
/* Set the completion code. */
transfer_request -> ux_transfer_request_completion_code = UX_TRANSFER_TIMEOUT;
-
+
/* Error trap. */
_ux_system_error_handler(UX_SYSTEM_LEVEL_THREAD, UX_SYSTEM_CONTEXT_CLASS, UX_TRANSFER_TIMEOUT);
/* If trace is enabled, insert this event into the trace buffer. */
UX_TRACE_IN_LINE_INSERT(UX_TRACE_ERROR, UX_TRANSFER_TIMEOUT, transfer_request, 0, 0, UX_TRACE_ERRORS, 0, 0)
-
+
/* There was an error, return to the caller. */
return(UX_TRANSFER_TIMEOUT);
- }
+ }
}
else
{
@@ -212,7 +199,7 @@ ULONG transfer_request_length;
/* Update the length of the transfer. Normally all the data has to be sent. */
*actual_length += transfer_request -> ux_transfer_request_actual_length;
-
+
/* Check for completion of transfer. If the transfer is partial, return to caller.
The transfer is marked as successful but the caller will need to check the length
actually sent and determine if a partial transfer is OK. */
@@ -226,12 +213,12 @@ ULONG transfer_request_length;
return(UX_SUCCESS);
}
- /* Update the data pointer for next transfer. */
+ /* Update the data pointer for next transfer. */
data_pointer += transfer_request_length;
-
+
/* Update what is left to send out. */
- requested_length -= transfer_request_length;
- }
+ requested_length -= transfer_request_length;
+ }
/* Unprotect thread reentry to this instance. */
#if defined(UX_HOST_STANDALONE)
@@ -241,6 +228,6 @@ ULONG transfer_request_length;
#endif
/* We get here when all the transfers went through without errors. */
- return(UX_SUCCESS);
+ return(UX_SUCCESS);
}
diff --git a/common/core/src/ux_host_stack_bandwidth_check.c b/common/core/src/ux_host_stack_bandwidth_check.c
index 0ee1201d..1f6cef8c 100644
--- a/common/core/src/ux_host_stack_bandwidth_check.c
+++ b/common/core/src/ux_host_stack_bandwidth_check.c
@@ -1,18 +1,19 @@
/***************************************************************************
- * Copyright (c) 2024 Microsoft Corporation
- *
+ * Copyright (c) 2024 Microsoft Corporation
+ * Copyright (c) 2026-present Eclipse ThreadX contributors
+ *
* This program and the accompanying materials are made available under the
* terms of the MIT License which is available at
* https://opensource.org/licenses/MIT.
- *
+ *
* SPDX-License-Identifier: MIT
**************************************************************************/
/**************************************************************************/
/**************************************************************************/
-/** */
-/** USBX Component */
+/** */
+/** USBX Component */
/** */
/** Host Stack */
/** */
@@ -29,56 +30,46 @@
#if UX_MAX_DEVICES > 1
-/**************************************************************************/
-/* */
-/* FUNCTION RELEASE */
-/* */
-/* _ux_host_stack_bandwidth_check PORTABLE C */
+/**************************************************************************/
+/* */
+/* FUNCTION RELEASE */
+/* */
+/* _ux_host_stack_bandwidth_check PORTABLE C */
/* 6.1 */
/* AUTHOR */
/* */
/* Chaoqiong Xiao, Microsoft Corporation */
/* */
/* DESCRIPTION */
-/* */
-/* This function will check if there is enough bandwidth on the USB */
-/* for the specified endpoint. The bandwidth requirement is calculated */
-/* by the MaxPacketSize field of endpoint and the speed of the */
-/* endpoint. If the device is on a 1.1 bus or it is a 1.1 device */
-/* behind a 2.0 hub on a 2.0 bus, the device bandwidth must be */
+/* */
+/* This function will check if there is enough bandwidth on the USB */
+/* for the specified endpoint. The bandwidth requirement is calculated */
+/* by the MaxPacketSize field of endpoint and the speed of the */
+/* endpoint. If the device is on a 1.1 bus or it is a 1.1 device */
+/* behind a 2.0 hub on a 2.0 bus, the device bandwidth must be */
/* multiplied by 8 on the 1.1 segment. */
/* */
-/* This algorithm takes into account both TT bandwidth and HCD */
-/* bandwidth. The TTs are attached to the device structure and not */
-/* the hub structure in order to make the stack agnostic of the hub */
-/* class. */
-/* */
-/* INPUT */
-/* */
-/* HCD Pointer to HCD */
-/* endpoint Pointer to endpoint */
-/* */
-/* OUTPUT */
-/* */
-/* Completion Status */
-/* */
-/* CALLS */
-/* */
-/* None */
-/* */
-/* 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 */
+/* This algorithm takes into account both TT bandwidth and HCD */
+/* bandwidth. The TTs are attached to the device structure and not */
+/* the hub structure in order to make the stack agnostic of the hub */
+/* class. */
+/* */
+/* INPUT */
+/* */
+/* HCD Pointer to HCD */
+/* endpoint Pointer to endpoint */
+/* */
+/* OUTPUT */
+/* */
+/* Completion Status */
+/* */
+/* CALLS */
+/* */
+/* None */
+/* */
+/* CALLED BY */
+/* */
+/* USBX Components */
/* */
/**************************************************************************/
UINT _ux_host_stack_bandwidth_check(UX_HCD *hcd, UX_ENDPOINT *endpoint)
@@ -112,14 +103,14 @@ const UCHAR overheads[4][3] = {
* Low Speed 187.5 40 8
* Full Speed 1500 5 1
* High Speed 7500 1 1/5
- *
+ *
* The overhead is like follow:
* Control Isochronous Bulk Interrupt
* bmAttribute (0) (1) (2) (3)
* Low Speed 63 -- -- 19
* Full Speed 45 9 13 13
* High Speed 173 38 55 55
- *
+ *
* Worst case bit stuffing is calculated as 1.1667 (7/6) times the raw time.
*/
@@ -161,7 +152,7 @@ const UCHAR overheads[4][3] = {
hcd_bandwidth_claimed = (USHORT)max_packet_size;
}
}
- else
+ else
{
hcd_bandwidth_claimed = (USHORT)max_packet_size;
@@ -185,9 +176,9 @@ const UCHAR overheads[4][3] = {
return(UX_NO_BANDWIDTH_AVAILABLE);
}
-
- /* We need to take care of the case where the endpoint belongs to a USB 1.1
- device that sits behind a 2.0 hub. We ignore cases where the device
+
+ /* We need to take care of the case where the endpoint belongs to a USB 1.1
+ device that sits behind a 2.0 hub. We ignore cases where the device
is either high speed or the bus is 1.1. */
if ((device -> ux_device_speed == UX_HIGH_SPEED_DEVICE) || (hcd -> ux_hcd_version != 0x200))
{
@@ -202,12 +193,12 @@ const UCHAR overheads[4][3] = {
{
/* We are at the root, this controller must support 1.1 then! */
- return(UX_SUCCESS);
+ return(UX_SUCCESS);
}
- /* We get here when the parent is a hub. The problem occurs when the hub is itself
- connected to a chain of hubs. We need to find the first 2.0 hub parent to this
- chain to check the TT. We need to remember the port on which the first 1.1
+ /* We get here when the parent is a hub. The problem occurs when the hub is itself
+ connected to a chain of hubs. We need to find the first 2.0 hub parent to this
+ chain to check the TT. We need to remember the port on which the first 1.1
device is hooked to. */
port_index = device -> ux_device_port_location - 1;
@@ -219,8 +210,8 @@ const UCHAR overheads[4][3] = {
if (parent_device -> ux_device_speed == UX_HIGH_SPEED_DEVICE)
{
- /* The device is a high speed hub, find the TT that manages the port.
- The first 1.1 device is connected to. First we calculate the port
+ /* The device is a high speed hub, find the TT that manages the port.
+ The first 1.1 device is connected to. First we calculate the port
mapping bit. */
port_map = (ULONG)(1 << port_index);
@@ -245,7 +236,7 @@ const UCHAR overheads[4][3] = {
return(UX_NO_BANDWIDTH_AVAILABLE);
}
-
+
else
return(UX_SUCCESS);
}
@@ -263,7 +254,7 @@ const UCHAR overheads[4][3] = {
/* We now remember where this hub is located on the parent. */
port_index = parent_device -> ux_device_port_location - 1;
-
+
/* We go up one level in the hub chain. */
parent_device = parent_device -> ux_device_parent;
}
diff --git a/common/core/src/ux_host_stack_bandwidth_claim.c b/common/core/src/ux_host_stack_bandwidth_claim.c
index 865bd2dd..2782e7db 100644
--- a/common/core/src/ux_host_stack_bandwidth_claim.c
+++ b/common/core/src/ux_host_stack_bandwidth_claim.c
@@ -1,18 +1,19 @@
/***************************************************************************
- * Copyright (c) 2024 Microsoft Corporation
- *
+ * Copyright (c) 2024 Microsoft Corporation
+ * Copyright (c) 2026-present Eclipse ThreadX contributors
+ *
* This program and the accompanying materials are made available under the
* terms of the MIT License which is available at
* https://opensource.org/licenses/MIT.
- *
+ *
* SPDX-License-Identifier: MIT
**************************************************************************/
/**************************************************************************/
/**************************************************************************/
-/** */
-/** USBX Component */
+/** */
+/** USBX Component */
/** */
/** Host Stack */
/** */
@@ -29,55 +30,45 @@
#if UX_MAX_DEVICES > 1
-/**************************************************************************/
-/* */
-/* FUNCTION RELEASE */
-/* */
-/* _ux_host_stack_bandwidth_claim PORTABLE C */
+/**************************************************************************/
+/* */
+/* FUNCTION RELEASE */
+/* */
+/* _ux_host_stack_bandwidth_claim PORTABLE C */
/* 6.1 */
/* AUTHOR */
/* */
/* Chaoqiong Xiao, Microsoft Corporation */
/* */
/* DESCRIPTION */
-/* */
-/* This function will reserve bandwidth for a periodic endpoint. The */
+/* */
+/* This function will reserve bandwidth for a periodic endpoint. The */
/* bandwidth requirement is calculated by the MaxPacketSize field of */
-/* endpoint and the speed of the endpoint. If the device is on a 1.1 */
+/* endpoint and the speed of the endpoint. If the device is on a 1.1 */
/* bus or it is a 1.1 device behind a 2.0 hub on a 2.0 bus, the device */
/* bandwidth must be multiplied by 8 on the 1.1 segment. */
/* */
-/* This algorithm takes into account both TT bandwidth and HCD */
-/* bandwidth. The TTs are attached to the device structure and not */
-/* the hub structure in order to make the stack agnostic of the hub */
-/* class. */
-/* */
-/* INPUT */
-/* */
-/* HCD Pointer to HCD */
-/* endpoint Pointer to endpoint */
-/* */
-/* OUTPUT */
-/* */
-/* None */
-/* */
-/* CALLS */
-/* */
-/* None */
-/* */
-/* 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 */
+/* This algorithm takes into account both TT bandwidth and HCD */
+/* bandwidth. The TTs are attached to the device structure and not */
+/* the hub structure in order to make the stack agnostic of the hub */
+/* class. */
+/* */
+/* INPUT */
+/* */
+/* HCD Pointer to HCD */
+/* endpoint Pointer to endpoint */
+/* */
+/* OUTPUT */
+/* */
+/* None */
+/* */
+/* CALLS */
+/* */
+/* None */
+/* */
+/* CALLED BY */
+/* */
+/* USBX Components */
/* */
/**************************************************************************/
VOID _ux_host_stack_bandwidth_claim(UX_HCD *hcd, UX_ENDPOINT *endpoint)
@@ -111,14 +102,14 @@ const UCHAR overheads[4][3] = {
* Low Speed 187.5 40 8
* Full Speed 1500 5 1
* High Speed 7500 1 1/5
- *
+ *
* The overhead is like follow:
* Control Isochronous Bulk Interrupt
* bmAttribute (0) (1) (2) (3)
* Low Speed 63 -- -- 19
* Full Speed 45 9 13 13
* High Speed 173 38 55 55
- *
+ *
* Worst case bit stuffing is calculated as 1.1667 (7/6) times the raw time.
*/
@@ -160,7 +151,7 @@ const UCHAR overheads[4][3] = {
hcd_bandwidth_claimed = (USHORT)max_packet_size;
}
}
- else
+ else
{
hcd_bandwidth_claimed = (USHORT)max_packet_size;
@@ -194,9 +185,9 @@ const UCHAR overheads[4][3] = {
return;
}
- /* We get here when the parent is a hub. The problem occurs when the hub is
- itself connected to a chain of hubs. We need to find the first 2.0 hub
- parent to this chain to check the TT. We need to remember the port on
+ /* We get here when the parent is a hub. The problem occurs when the hub is
+ itself connected to a chain of hubs. We need to find the first 2.0 hub
+ parent to this chain to check the TT. We need to remember the port on
which the first 1.1 device is hooked to. */
port_index = device -> ux_device_port_location - 1;
@@ -208,8 +199,8 @@ const UCHAR overheads[4][3] = {
if (parent_device -> ux_device_speed == UX_HIGH_SPEED_DEVICE)
{
- /* The device is a high speed hub, find the TT that manages the port.
- The first 1.1 device is connected to. First we calculate the port
+ /* The device is a high speed hub, find the TT that manages the port.
+ The first 1.1 device is connected to. First we calculate the port
mapping bit. */
port_map = (ULONG)(1 << port_index);
@@ -237,7 +228,7 @@ const UCHAR overheads[4][3] = {
/* We now remember where this hub is located on the parent. */
port_index = parent_device -> ux_device_port_location - 1;
-
+
/* We go up one level in the hub chain. */
parent_device = parent_device -> ux_device_parent;
}
diff --git a/common/core/src/ux_host_stack_bandwidth_release.c b/common/core/src/ux_host_stack_bandwidth_release.c
index 4ecd3e95..87229418 100644
--- a/common/core/src/ux_host_stack_bandwidth_release.c
+++ b/common/core/src/ux_host_stack_bandwidth_release.c
@@ -1,18 +1,19 @@
/***************************************************************************
- * Copyright (c) 2024 Microsoft Corporation
- *
+ * Copyright (c) 2024 Microsoft Corporation
+ * Copyright (c) 2026-present Eclipse ThreadX contributors
+ *
* This program and the accompanying materials are made available under the
* terms of the MIT License which is available at
* https://opensource.org/licenses/MIT.
- *
+ *
* SPDX-License-Identifier: MIT
**************************************************************************/
/**************************************************************************/
/**************************************************************************/
-/** */
-/** USBX Component */
+/** */
+/** USBX Component */
/** */
/** Host Stack */
/** */
@@ -29,54 +30,44 @@
#if UX_MAX_DEVICES > 1
-/**************************************************************************/
-/* */
-/* FUNCTION RELEASE */
-/* */
-/* _ux_host_stack_bandwidth_release PORTABLE C */
+/**************************************************************************/
+/* */
+/* FUNCTION RELEASE */
+/* */
+/* _ux_host_stack_bandwidth_release PORTABLE C */
/* 6.1 */
/* AUTHOR */
/* */
/* Chaoqiong Xiao, Microsoft Corporation */
/* */
/* DESCRIPTION */
-/* */
-/* This function will release bandwidth for a periodic endpoint. The */
+/* */
+/* This function will release bandwidth for a periodic endpoint. The */
/* bandwidth requirement is calculated by the MaxPacketSize field of */
-/* endpoint and the speed of the endpoint. If the device is on a 1.1 */
+/* endpoint and the speed of the endpoint. If the device is on a 1.1 */
/* bus or it is a 1.1 device behind a 2.0 hub on a 2.0 bus, the device */
/* bandwidth must be multiplied by 8 on the 1.1 segment. */
/* */
-/* This algorithm takes into account both TT bandwidth and HCD */
-/* bandwidth. The TTs are attached to the device structure and not the */
-/* hub structure in order to make the stack agnostic of the hub class. */
-/* */
-/* INPUT */
-/* */
-/* HCD Pointer to HCD */
-/* endpoint Pointer to endpoint */
-/* */
-/* OUTPUT */
-/* */
-/* None */
-/* */
-/* CALLS */
-/* */
-/* None */
-/* */
-/* 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 */
+/* This algorithm takes into account both TT bandwidth and HCD */
+/* bandwidth. The TTs are attached to the device structure and not the */
+/* hub structure in order to make the stack agnostic of the hub class. */
+/* */
+/* INPUT */
+/* */
+/* HCD Pointer to HCD */
+/* endpoint Pointer to endpoint */
+/* */
+/* OUTPUT */
+/* */
+/* None */
+/* */
+/* CALLS */
+/* */
+/* None */
+/* */
+/* CALLED BY */
+/* */
+/* USBX Components */
/* */
/**************************************************************************/
VOID _ux_host_stack_bandwidth_release(UX_HCD *hcd, UX_ENDPOINT *endpoint)
@@ -110,14 +101,14 @@ const UCHAR overheads[4][3] = {
* Low Speed 187.5 40 8
* Full Speed 1500 5 1
* High Speed 7500 1 1/5
- *
+ *
* The overhead is like follow:
* Control Isochronous Bulk Interrupt
* bmAttribute (0) (1) (2) (3)
* Low Speed 63 -- -- 19
* Full Speed 45 9 13 13
* High Speed 173 38 55 55
- *
+ *
* Worst case bit stuffing is calculated as 1.1667 (7/6) times the raw time.
*/
@@ -159,9 +150,9 @@ const UCHAR overheads[4][3] = {
hcd_bandwidth_claimed = (USHORT)max_packet_size;
}
}
- else
+ else
{
-
+
hcd_bandwidth_claimed = (USHORT)max_packet_size;
if (device -> ux_device_speed == UX_LOW_SPEED_DEVICE)
/* Low speed transfer takes 8x more units than full speed. */
@@ -193,9 +184,9 @@ const UCHAR overheads[4][3] = {
return;
}
- /* We get here when the parent is a hub. The problem occurs when the hub is itself
- connected to a chain of hubs. We need to find the first 2.0 hub parent to this chain
- to check the TT. We need to remember the port on which the first 1.1 device is
+ /* We get here when the parent is a hub. The problem occurs when the hub is itself
+ connected to a chain of hubs. We need to find the first 2.0 hub parent to this chain
+ to check the TT. We need to remember the port on which the first 1.1 device is
hooked to. */
port_index = device -> ux_device_port_location - 1;
@@ -207,7 +198,7 @@ const UCHAR overheads[4][3] = {
if (parent_device -> ux_device_speed == UX_HIGH_SPEED_DEVICE)
{
- /* The device is a high speed hub, find the TT that manages the port.
+ /* The device is a high speed hub, find the TT that manages the port.
The first 1.1 device is connected to. First we calculate the port mapping bit. */
port_map = (ULONG)(1 << port_index);
@@ -232,7 +223,7 @@ const UCHAR overheads[4][3] = {
/* We now remember where this hub is located on the parent. */
port_index = parent_device -> ux_device_port_location - 1;
-
+
/* We go up one level in the hub chain. */
parent_device = parent_device -> ux_device_parent;
}
diff --git a/common/core/src/ux_host_stack_class_call.c b/common/core/src/ux_host_stack_class_call.c
index e5dcad04..b53ca12b 100644
--- a/common/core/src/ux_host_stack_class_call.c
+++ b/common/core/src/ux_host_stack_class_call.c
@@ -1,18 +1,19 @@
/***************************************************************************
- * Copyright (c) 2024 Microsoft Corporation
- *
+ * Copyright (c) 2024 Microsoft Corporation
+ * Copyright (c) 2026-present Eclipse ThreadX contributors
+ *
* This program and the accompanying materials are made available under the
* terms of the MIT License which is available at
* https://opensource.org/licenses/MIT.
- *
+ *
* SPDX-License-Identifier: MIT
**************************************************************************/
/**************************************************************************/
/**************************************************************************/
-/** */
-/** USBX Component */
+/** */
+/** USBX Component */
/** */
/** Host Stack */
/** */
@@ -28,47 +29,37 @@
#include "ux_host_stack.h"
-/**************************************************************************/
-/* */
-/* FUNCTION RELEASE */
-/* */
-/* _ux_host_stack_class_call PORTABLE C */
+/**************************************************************************/
+/* */
+/* FUNCTION RELEASE */
+/* */
+/* _ux_host_stack_class_call PORTABLE C */
/* 6.1 */
/* AUTHOR */
/* */
/* Chaoqiong Xiao, Microsoft Corporation */
/* */
/* DESCRIPTION */
-/* */
+/* */
/* This function will call all the registered classes to the USBX */
/* stack. Each class will have the possibility to own the device or */
-/* one of the interfaces of a device. */
-/* */
-/* INPUT */
-/* */
-/* class_command Class command structure */
-/* */
-/* OUTPUT */
-/* */
-/* Number of owners */
-/* */
-/* CALLS */
-/* */
-/* (ux_host_class_entry_function) Class entry function */
-/* */
-/* 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 */
+/* one of the interfaces of a device. */
+/* */
+/* INPUT */
+/* */
+/* class_command Class command structure */
+/* */
+/* OUTPUT */
+/* */
+/* Number of owners */
+/* */
+/* CALLS */
+/* */
+/* (ux_host_class_entry_function) Class entry function */
+/* */
+/* CALLED BY */
+/* */
+/* USBX Components */
/* */
/**************************************************************************/
UX_HOST_CLASS *_ux_host_stack_class_call(UX_HOST_CLASS_COMMAND *class_command)
@@ -101,9 +92,9 @@ ULONG class_index;
{
/* Yes, return this class pointer. */
- return(class_inst);
+ return(class_inst);
}
- }
+ }
#if UX_MAX_CLASS_DRIVER > 1
/* Move to the next registered class. */
class_inst ++;
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 86b3a395..a0790cfe 100644
--- a/common/core/src/ux_host_stack_class_device_scan.c
+++ b/common/core/src/ux_host_stack_class_device_scan.c
@@ -1,18 +1,19 @@
/***************************************************************************
- * Copyright (c) 2024 Microsoft Corporation
- *
+ * Copyright (c) 2024 Microsoft Corporation
+ * Copyright (c) 2026-present Eclipse ThreadX contributors
+ *
* This program and the accompanying materials are made available under the
* terms of the MIT License which is available at
* https://opensource.org/licenses/MIT.
- *
+ *
* SPDX-License-Identifier: MIT
**************************************************************************/
/**************************************************************************/
/**************************************************************************/
-/** */
-/** USBX Component */
+/** */
+/** USBX Component */
/** */
/** Host Stack */
/** */
@@ -35,54 +36,38 @@
#endif
#endif
-/**************************************************************************/
-/* */
-/* FUNCTION RELEASE */
-/* */
-/* _ux_host_stack_class_device_scan PORTABLE C */
+/**************************************************************************/
+/* */
+/* FUNCTION RELEASE */
+/* */
+/* _ux_host_stack_class_device_scan PORTABLE C */
/* 6.1.10 */
/* AUTHOR */
/* */
/* Chaoqiong Xiao, Microsoft Corporation */
/* */
/* DESCRIPTION */
-/* */
-/* This function will scan all registered classes with a device */
-/* candidate. Priority is given to the PID/VID and then the */
-/* Class/Subclass/Protocol. */
-/* */
-/* INPUT */
-/* */
-/* device Pointer to device */
-/* */
-/* OUTPUT */
-/* */
-/* Completion Status */
-/* */
-/* CALLS */
-/* */
-/* _ux_host_stack_class_call Call host stack class */
-/* (ux_host_class_entry_function) Class entry function */
-/* */
-/* 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), */
-/* used query usage of device */
-/* ClassSubclassProtocol, */
-/* resulting in version 6.1 */
-/* 06-02-2021 Bhupendra Naphade Modified comment(s), */
-/* removed duplicate line, */
-/* resulting in version 6.1.7 */
-/* 01-31-2022 Chaoqiong Xiao Modified comment(s), */
-/* added standalone support, */
-/* resulting in version 6.1.10 */
+/* */
+/* This function will scan all registered classes with a device */
+/* candidate. Priority is given to the PID/VID and then the */
+/* Class/Subclass/Protocol. */
+/* */
+/* INPUT */
+/* */
+/* device Pointer to device */
+/* */
+/* OUTPUT */
+/* */
+/* Completion Status */
+/* */
+/* CALLS */
+/* */
+/* _ux_host_stack_class_call Call host stack class */
+/* (ux_host_class_entry_function) Class entry function */
+/* */
+/* CALLED BY */
+/* */
+/* USBX Components */
/* */
/**************************************************************************/
UINT _ux_host_stack_class_device_scan(UX_DEVICE *device)
@@ -116,7 +101,7 @@ UX_HOST_CLASS_COMMAND class_command;
if (class_inst == UX_NULL)
{
- /* It the PID/VID did not work, we continue looking for the Class\Subclass\Protocol match. */
+ /* 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);
diff --git a/common/core/src/ux_host_stack_class_get.c b/common/core/src/ux_host_stack_class_get.c
index d8875505..6f1b6245 100644
--- a/common/core/src/ux_host_stack_class_get.c
+++ b/common/core/src/ux_host_stack_class_get.c
@@ -1,18 +1,19 @@
/***************************************************************************
- * Copyright (c) 2024 Microsoft Corporation
- *
+ * Copyright (c) 2024 Microsoft Corporation
+ * Copyright (c) 2026-present Eclipse ThreadX contributors
+ *
* This program and the accompanying materials are made available under the
* terms of the MIT License which is available at
* https://opensource.org/licenses/MIT.
- *
+ *
* SPDX-License-Identifier: MIT
**************************************************************************/
/**************************************************************************/
/**************************************************************************/
-/** */
-/** USBX Component */
+/** */
+/** USBX Component */
/** */
/** Host Stack */
/** */
@@ -28,57 +29,45 @@
#include "ux_host_stack.h"
-/**************************************************************************/
-/* */
-/* FUNCTION RELEASE */
-/* */
-/* _ux_host_stack_class_get PORTABLE C */
+/**************************************************************************/
+/* */
+/* FUNCTION RELEASE */
+/* */
+/* _ux_host_stack_class_get PORTABLE C */
/* 6.3.0 */
/* AUTHOR */
/* */
/* Chaoqiong Xiao, Microsoft Corporation */
/* */
/* DESCRIPTION */
-/* */
-/* This function returns a pointer to the class container. A class */
-/* needs to obtain its container from the USBX stack to search for */
-/* instances when a driver or an application wants to open a device. */
+/* */
+/* This function returns a pointer to the class container. A class */
+/* needs to obtain its container from the USBX stack to search for */
+/* instances when a driver or an application wants to open a device. */
/* */
/* 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 */
-/* host_class Class pointer */
-/* */
-/* OUTPUT */
-/* */
-/* Completion Status */
-/* */
-/* CALLS */
-/* */
+/* */
+/* INPUT */
+/* */
+/* class_name Name of class */
+/* host_class Class pointer */
+/* */
+/* OUTPUT */
+/* */
+/* Completion Status */
+/* */
+/* CALLS */
+/* */
/* _ux_utility_string_length_check Check C string and return its */
/* length if null-terminated */
-/* _ux_utility_memory_compare Compare memory blocks */
-/* */
-/* 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, */
-/* resulting in version 6.1 */
-/* 10-31-2023 Chaoqiong Xiao Modified comment(s), */
-/* resulting in version 6.3.0 */
+/* _ux_utility_memory_compare Compare memory blocks */
+/* */
+/* CALLED BY */
+/* */
+/* Application */
+/* USBX Components */
/* */
/**************************************************************************/
UINT _ux_host_stack_class_get(UCHAR *class_name, UX_HOST_CLASS **host_class)
@@ -115,7 +104,7 @@ ULONG class_index;
/* We have found a container. Check if this is the one we need (compare including null-terminator). */
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. */
*host_class = class_ptr;
@@ -134,7 +123,7 @@ ULONG class_index;
/* 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)
- /* This class does not exist, return an error. */
+ /* This class does not exist, return an error. */
return(UX_HOST_CLASS_UNKNOWN);
}
@@ -170,12 +159,6 @@ ULONG class_index;
/* */
/* Application */
/* */
-/* RELEASE HISTORY */
-/* */
-/* DATE NAME DESCRIPTION */
-/* */
-/* 10-31-2023 Chaoqiong Xiao Initial Version 6.3.0 */
-/* */
/**************************************************************************/
UINT _uxe_host_stack_class_get(UCHAR *class_name, UX_HOST_CLASS **host_class)
{
diff --git a/common/core/src/ux_host_stack_class_instance_create.c b/common/core/src/ux_host_stack_class_instance_create.c
index 61896b45..cee19684 100644
--- a/common/core/src/ux_host_stack_class_instance_create.c
+++ b/common/core/src/ux_host_stack_class_instance_create.c
@@ -1,18 +1,19 @@
/***************************************************************************
- * Copyright (c) 2024 Microsoft Corporation
- *
+ * Copyright (c) 2024 Microsoft Corporation
+ * Copyright (c) 2026-present Eclipse ThreadX contributors
+ *
* This program and the accompanying materials are made available under the
* terms of the MIT License which is available at
* https://opensource.org/licenses/MIT.
- *
+ *
* SPDX-License-Identifier: MIT
**************************************************************************/
/**************************************************************************/
/**************************************************************************/
-/** */
-/** USBX Component */
+/** */
+/** USBX Component */
/** */
/** Host Stack */
/** */
@@ -28,55 +29,47 @@
#include "ux_host_stack.h"
-/**************************************************************************/
-/* */
-/* FUNCTION RELEASE */
-/* */
-/* _ux_host_stack_class_instance_create PORTABLE C */
+/**************************************************************************/
+/* */
+/* FUNCTION RELEASE */
+/* */
+/* _ux_host_stack_class_instance_create PORTABLE C */
/* 6.1 */
/* AUTHOR */
/* */
/* Chaoqiong Xiao, Microsoft Corporation */
/* */
/* DESCRIPTION */
-/* */
+/* */
/* This function creates a new class instance for a class container. */
-/* The instance of a class is not contained in the class code to */
-/* reduce the class driver complexity. Rather, each class instance is */
-/* attached to class container. */
-/* */
-/* INPUT */
-/* */
-/* class Pointer to class */
-/* class_instance Pointer to class instance */
-/* */
-/* OUTPUT */
-/* */
-/* Completion Status */
-/* */
-/* CALLS */
-/* */
-/* None */
-/* */
-/* 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), */
-/* resulting in version 6.1 */
+/* The instance of a class is not contained in the class code to */
+/* reduce the class driver complexity. Rather, each class instance is */
+/* attached to class container. */
+/* */
+/* INPUT */
+/* */
+/* class Pointer to class */
+/* class_instance Pointer to class instance */
+/* */
+/* OUTPUT */
+/* */
+/* Completion Status */
+/* */
+/* CALLS */
+/* */
+/* None */
+/* */
+/* CALLED BY */
+/* */
+/* Application */
+/* USBX Components */
/* */
/**************************************************************************/
UINT _ux_host_stack_class_instance_create(UX_HOST_CLASS *host_class, VOID *class_instance)
{
-
+
VOID **current_class_instance;
-
+
/* If trace is enabled, insert this event into the trace buffer. */
UX_TRACE_IN_LINE_INSERT(UX_TRACE_HOST_STACK_CLASS_INSTANCE_CREATE, host_class, class_instance, 0, 0, UX_TRACE_HOST_STACK_EVENTS, 0, 0)
@@ -85,7 +78,7 @@ VOID **current_class_instance;
/* Start with the first class instance attached to the class container. */
current_class_instance = host_class -> ux_host_class_first_instance;
-
+
/* Check if there are any instances attached. */
if (current_class_instance == UX_NULL)
{
@@ -97,7 +90,7 @@ VOID **current_class_instance;
return(UX_SUCCESS);
}
- /* Traverse the list of the class instances until we find the last class. */
+ /* Traverse the list of the class instances until we find the last class. */
while (*current_class_instance != UX_NULL)
{
@@ -108,7 +101,7 @@ VOID **current_class_instance;
/* We have reached the last class, hook the new class to the end. This way, we preserve
the chronological order of the class instances. */
*current_class_instance = class_instance;
-
+
/* Return successful completion to caller. */
return(UX_SUCCESS);
}
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 edca44b7..e3d68205 100644
--- a/common/core/src/ux_host_stack_class_instance_destroy.c
+++ b/common/core/src/ux_host_stack_class_instance_destroy.c
@@ -1,18 +1,19 @@
/***************************************************************************
- * Copyright (c) 2024 Microsoft Corporation
- *
+ * Copyright (c) 2024 Microsoft Corporation
+ * Copyright (c) 2026-present Eclipse ThreadX contributors
+ *
* This program and the accompanying materials are made available under the
* terms of the MIT License which is available at
* https://opensource.org/licenses/MIT.
- *
+ *
* SPDX-License-Identifier: MIT
**************************************************************************/
/**************************************************************************/
/**************************************************************************/
-/** */
-/** USBX Component */
+/** */
+/** USBX Component */
/** */
/** Host Stack */
/** */
@@ -28,53 +29,45 @@
#include "ux_host_stack.h"
-/**************************************************************************/
-/* */
-/* FUNCTION RELEASE */
-/* */
-/* _ux_host_stack_class_instance_destroy PORTABLE C */
+/**************************************************************************/
+/* */
+/* FUNCTION RELEASE */
+/* */
+/* _ux_host_stack_class_instance_destroy PORTABLE C */
/* 6.1 */
/* AUTHOR */
/* */
/* Chaoqiong Xiao, Microsoft Corporation */
/* */
/* DESCRIPTION */
-/* */
-/* This function destroys a class instance for a class container. */
-/* */
-/* INPUT */
-/* */
-/* class Pointer to class */
-/* class_instance Pointer to class instance */
-/* */
-/* OUTPUT */
-/* */
-/* Completion Status */
-/* */
-/* CALLS */
-/* */
-/* None */
-/* */
-/* 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), */
-/* resulting in version 6.1 */
+/* */
+/* This function destroys a class instance for a class container. */
+/* */
+/* INPUT */
+/* */
+/* class Pointer to class */
+/* class_instance Pointer to class instance */
+/* */
+/* OUTPUT */
+/* */
+/* Completion Status */
+/* */
+/* CALLS */
+/* */
+/* None */
+/* */
+/* CALLED BY */
+/* */
+/* Application */
+/* USBX Components */
/* */
/**************************************************************************/
UINT _ux_host_stack_class_instance_destroy(UX_HOST_CLASS *host_class, VOID *class_instance)
{
-
+
VOID **current_class_instance;
VOID **next_class_instance;
-
+
/* If trace is enabled, insert this event into the trace buffer. */
UX_TRACE_IN_LINE_INSERT(UX_TRACE_HOST_STACK_CLASS_INSTANCE_DESTROY, host_class, class_instance, 0, 0, UX_TRACE_HOST_STACK_EVENTS, 0, 0)
@@ -84,13 +77,13 @@ VOID **next_class_instance;
/* Get the pointer to the instance pointed by the instance to destroy. */
next_class_instance = class_instance;
next_class_instance = *next_class_instance;
-
+
/* Start with the first class instance attached to the class container. */
current_class_instance = host_class -> ux_host_class_first_instance;
-
+
/* Check if there are any instances attached. */
if (current_class_instance == UX_NULL)
- {
+ {
/* Error trap. */
_ux_system_error_handler(UX_SYSTEM_LEVEL_THREAD, UX_SYSTEM_CONTEXT_ENUMERATOR, UX_HOST_CLASS_INSTANCE_UNKNOWN);
@@ -108,12 +101,12 @@ VOID **next_class_instance;
/* Point to next class instance. */
host_class -> ux_host_class_first_instance = next_class_instance;
-
+
/* Return success. */
return(UX_SUCCESS);
}
-
- /* Traverse the list of the class instances until we found the right one. */
+
+ /* Traverse the list of the class instances until we found the right one. */
while (*current_class_instance != UX_NULL)
{
@@ -131,7 +124,7 @@ VOID **next_class_instance;
/* Points to the next class instance. */
current_class_instance = *current_class_instance;
}
-
+
/* Error trap. */
_ux_system_error_handler(UX_SYSTEM_LEVEL_THREAD, UX_SYSTEM_CONTEXT_ENUMERATOR, UX_HOST_CLASS_INSTANCE_UNKNOWN);
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 3b902d0a..2de7510e 100644
--- a/common/core/src/ux_host_stack_class_instance_get.c
+++ b/common/core/src/ux_host_stack_class_instance_get.c
@@ -1,18 +1,19 @@
/***************************************************************************
- * Copyright (c) 2024 Microsoft Corporation
- *
+ * Copyright (c) 2024 Microsoft Corporation
+ * Copyright (c) 2026-present Eclipse ThreadX contributors
+ *
* This program and the accompanying materials are made available under the
* terms of the MIT License which is available at
* https://opensource.org/licenses/MIT.
- *
+ *
* SPDX-License-Identifier: MIT
**************************************************************************/
/**************************************************************************/
/**************************************************************************/
-/** */
-/** USBX Component */
+/** */
+/** USBX Component */
/** */
/** Host Stack */
/** */
@@ -28,69 +29,61 @@
#include "ux_host_stack.h"
-/**************************************************************************/
-/* */
-/* FUNCTION RELEASE */
-/* */
-/* _ux_host_stack_class_instance_get PORTABLE C */
+/**************************************************************************/
+/* */
+/* FUNCTION RELEASE */
+/* */
+/* _ux_host_stack_class_instance_get PORTABLE C */
/* 6.1 */
/* AUTHOR */
/* */
/* Chaoqiong Xiao, Microsoft Corporation */
/* */
/* DESCRIPTION */
-/* */
-/* This function returns a class instance pointer for a specific */
-/* class. The instance of a class is not contained in the class code */
-/* to reduce the class complexity. Rather, each class instance is */
-/* attached to class container. */
-/* */
-/* INPUT */
-/* */
-/* class Pointer to class */
-/* class_index Index of class */
-/* class_instance Destination of class instance */
-/* pointer */
-/* */
-/* OUTPUT */
-/* */
-/* Completion Status */
-/* */
-/* CALLS */
-/* */
-/* None */
-/* */
-/* 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), */
-/* resulting in version 6.1 */
+/* */
+/* This function returns a class instance pointer for a specific */
+/* class. The instance of a class is not contained in the class code */
+/* to reduce the class complexity. Rather, each class instance is */
+/* attached to class container. */
+/* */
+/* INPUT */
+/* */
+/* class Pointer to class */
+/* class_index Index of class */
+/* class_instance Destination of class instance */
+/* pointer */
+/* */
+/* OUTPUT */
+/* */
+/* Completion Status */
+/* */
+/* CALLS */
+/* */
+/* None */
+/* */
+/* CALLED BY */
+/* */
+/* Application */
+/* USBX Components */
/* */
/**************************************************************************/
UINT _ux_host_stack_class_instance_get(UX_HOST_CLASS *host_class, UINT class_index, VOID **class_instance)
{
-
+
VOID **current_class_instance;
-
+
/* Start with the first class instance attached to the class container. */
current_class_instance = host_class -> ux_host_class_first_instance;
-
+
/* Check if there are any instances attached. */
if(current_class_instance == UX_NULL)
- {
+ {
return(UX_HOST_CLASS_INSTANCE_UNKNOWN);
}
- /* Traverse the list of the class instances until we found the right one. */
+ /* Traverse the list of the class instances until we found the right one. */
while (class_index-- != 0)
{
@@ -99,7 +92,7 @@ VOID **current_class_instance;
/* Check if we have reached the end of the list of the class instances. */
if (current_class_instance == UX_NULL)
- {
+ {
return(UX_HOST_CLASS_INSTANCE_UNKNOWN);
}
@@ -107,7 +100,7 @@ VOID **current_class_instance;
/* Update the class instance pointer from the caller. */
*class_instance = current_class_instance;
-
+
/* Return successful completion. */
return(UX_SUCCESS);
}
@@ -146,12 +139,6 @@ VOID **current_class_instance;
/* */
/* Application */
/* */
-/* RELEASE HISTORY */
-/* */
-/* DATE NAME DESCRIPTION */
-/* */
-/* 10-31-2023 Chaoqiong Xiao Initial Version 6.3.0 */
-/* */
/**************************************************************************/
UINT _uxe_host_stack_class_instance_get(UX_HOST_CLASS *host_class, UINT class_index, VOID **class_instance)
{
diff --git a/common/core/src/ux_host_stack_class_instance_verify.c b/common/core/src/ux_host_stack_class_instance_verify.c
index b119aa36..61728179 100644
--- a/common/core/src/ux_host_stack_class_instance_verify.c
+++ b/common/core/src/ux_host_stack_class_instance_verify.c
@@ -1,18 +1,19 @@
/***************************************************************************
- * Copyright (c) 2024 Microsoft Corporation
- *
+ * Copyright (c) 2024 Microsoft Corporation
+ * Copyright (c) 2026-present Eclipse ThreadX contributors
+ *
* This program and the accompanying materials are made available under the
* terms of the MIT License which is available at
* https://opensource.org/licenses/MIT.
- *
+ *
* SPDX-License-Identifier: MIT
**************************************************************************/
/**************************************************************************/
/**************************************************************************/
-/** */
-/** USBX Component */
+/** */
+/** USBX Component */
/** */
/** Host Stack */
/** */
@@ -28,51 +29,41 @@
#include "ux_host_stack.h"
-/**************************************************************************/
-/* */
-/* FUNCTION RELEASE */
-/* */
-/* _ux_host_stack_class_instance_verify PORTABLE C */
+/**************************************************************************/
+/* */
+/* FUNCTION RELEASE */
+/* */
+/* _ux_host_stack_class_instance_verify PORTABLE C */
/* 6.1 */
/* AUTHOR */
/* */
/* Chaoqiong Xiao, Microsoft Corporation */
/* */
/* DESCRIPTION */
-/* */
+/* */
/* This function ensures that a given instance exists. An application */
-/* is not responsible for keeping the instance valid pointer. The */
-/* class is responsible for the instance checks if the instance is */
-/* still valid. */
-/* */
-/* INPUT */
-/* */
-/* class_name Name of class */
-/* class_instance Pointer to class instance */
-/* */
-/* OUTPUT */
-/* */
-/* Completion Status */
-/* */
-/* CALLS */
-/* */
+/* is not responsible for keeping the instance valid pointer. The */
+/* class is responsible for the instance checks if the instance is */
+/* still valid. */
+/* */
+/* INPUT */
+/* */
+/* class_name Name of class */
+/* class_instance Pointer to class instance */
+/* */
+/* OUTPUT */
+/* */
+/* Completion Status */
+/* */
+/* CALLS */
+/* */
/* _ux_utility_string_length_check Check C string and return its */
/* length if null-terminated */
-/* _ux_utility_memory_compare Compare blocks of memory */
-/* */
-/* CALLED BY */
-/* */
-/* USBX Components */
-/* */
-/* RELEASE HISTORY */
-/* */
-/* DATE NAME DESCRIPTION */
-/* */
-/* 05-19-2020 Chaoqiong Xiao Initial Version 6.0 */
-/* 09-30-2020 Chaoqiong Xiao Modified comment(s), */
-/* optimized based on compile */
-/* definitions, */
-/* resulting in version 6.1 */
+/* _ux_utility_memory_compare Compare blocks of memory */
+/* */
+/* CALLED BY */
+/* */
+/* USBX Components */
/* */
/**************************************************************************/
UINT _ux_host_stack_class_instance_verify(UCHAR *class_name, VOID *class_instance)
@@ -110,8 +101,8 @@ UINT class_name_length = 0;
/* Start with the first class instance attached to the class container. */
current_class_instance = class_inst -> ux_host_class_first_instance;
-
- /* Traverse the list of the class instances until we find the correct instance. */
+
+ /* Traverse the list of the class instances until we find the correct instance. */
while (current_class_instance != UX_NULL)
{
@@ -133,12 +124,12 @@ UINT class_name_length = 0;
/* Move to the next 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)
- /* This class does not exist. */
+ /* 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 ece7d984..6c10373e 100644
--- a/common/core/src/ux_host_stack_class_interface_scan.c
+++ b/common/core/src/ux_host_stack_class_interface_scan.c
@@ -1,18 +1,19 @@
/***************************************************************************
- * Copyright (c) 2024 Microsoft Corporation
- *
+ * Copyright (c) 2024 Microsoft Corporation
+ * Copyright (c) 2026-present Eclipse ThreadX contributors
+ *
* This program and the accompanying materials are made available under the
* terms of the MIT License which is available at
* https://opensource.org/licenses/MIT.
- *
+ *
* SPDX-License-Identifier: MIT
**************************************************************************/
/**************************************************************************/
/**************************************************************************/
-/** */
-/** USBX Component */
+/** */
+/** USBX Component */
/** */
/** Host Stack */
/** */
@@ -28,20 +29,20 @@
#include "ux_host_stack.h"
-/**************************************************************************/
-/* */
-/* FUNCTION RELEASE */
-/* */
-/* _ux_host_stack_class_interface_scan PORTABLE C */
+/**************************************************************************/
+/* */
+/* FUNCTION RELEASE */
+/* */
+/* _ux_host_stack_class_interface_scan PORTABLE C */
/* 6.1.4 */
/* AUTHOR */
/* */
/* Chaoqiong Xiao, Microsoft Corporation */
/* */
/* DESCRIPTION */
-/* */
-/* This function will scan all default interfaces for a single */
-/* configuration and call the registered class with the */
+/* */
+/* This function will scan all default interfaces for a single */
+/* configuration and call the registered class with the */
/* Class/SubClass/Protocol of the interface. */
/* */
/* If the device has multiple configurations (like the Apple iPod), */
@@ -51,41 +52,29 @@
/* class at the device level claims the entire device. */
/* */
/* */
-/* For the interface, there is no reason to use the PID/VID has a */
-/* binding element as classes that trigger on PID/VID will be called */
-/* by the device descriptor scanning process. */
-/* */
-/* INPUT */
-/* */
-/* device Device pointer */
-/* */
-/* OUTPUT */
-/* */
-/* Result of operation */
-/* */
-/* CALLS */
-/* */
+/* For the interface, there is no reason to use the PID/VID has a */
+/* binding element as classes that trigger on PID/VID will be called */
+/* by the device descriptor scanning process. */
+/* */
+/* INPUT */
+/* */
+/* device Device pointer */
+/* */
+/* OUTPUT */
+/* */
+/* Result of operation */
+/* */
+/* CALLS */
+/* */
/* _ux_host_stack_class_call Call class command */
/* _ux_host_stack_device_configuration_select */
-/* Select configuration */
-/* (ux_host_stack_class_call) Call class from host stack */
-/* (ux_host_class_entry_function) Class entry function */
-/* */
-/* CALLED BY */
-/* */
-/* USBX Components */
-/* */
-/* RELEASE HISTORY */
-/* */
-/* DATE NAME DESCRIPTION */
-/* */
-/* 05-19-2020 Chaoqiong Xiao Initial Version 6.0 */
-/* 09-30-2020 Chaoqiong Xiao Modified comment(s), */
-/* resulting in version 6.1 */
-/* 02-02-2021 Chaoqiong Xiao Modified comment(s), */
-/* used internal function call */
-/* to scan interfaces, */
-/* resulting in version 6.1.4 */
+/* Select configuration */
+/* (ux_host_stack_class_call) Call class from host stack */
+/* (ux_host_class_entry_function) Class entry function */
+/* */
+/* CALLED BY */
+/* */
+/* USBX Components */
/* */
/**************************************************************************/
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 6bdd4e16..6a6bcbf8 100644
--- a/common/core/src/ux_host_stack_class_register.c
+++ b/common/core/src/ux_host_stack_class_register.c
@@ -1,10 +1,11 @@
/***************************************************************************
- * Copyright (c) 2024 Microsoft Corporation
- *
+ * Copyright (c) 2024 Microsoft Corporation
+ * Copyright (c) 2026-present Eclipse ThreadX contributors
+ *
* This program and the accompanying materials are made available under the
* terms of the MIT License which is available at
* https://opensource.org/licenses/MIT.
- *
+ *
* SPDX-License-Identifier: MIT
**************************************************************************/
@@ -72,17 +73,6 @@
/* 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 *))
@@ -206,12 +196,6 @@ ULONG class_index;
/* */
/* Application */
/* */
-/* RELEASE HISTORY */
-/* */
-/* DATE NAME DESCRIPTION */
-/* */
-/* 10-31-2023 Chaoqiong Xiao Initial Version 6.3.0 */
-/* */
/**************************************************************************/
UINT _uxe_host_stack_class_register(UCHAR *class_name,
UINT (*class_entry_function)(struct UX_HOST_CLASS_COMMAND_STRUCT *))
diff --git a/common/core/src/ux_host_stack_class_unregister.c b/common/core/src/ux_host_stack_class_unregister.c
index db741da5..a563f4e8 100644
--- a/common/core/src/ux_host_stack_class_unregister.c
+++ b/common/core/src/ux_host_stack_class_unregister.c
@@ -1,10 +1,11 @@
/***************************************************************************
- * Copyright (c) 2024 Microsoft Corporation
- *
+ * Copyright (c) 2024 Microsoft Corporation
+ * Copyright (c) 2026-present Eclipse ThreadX contributors
+ *
* This program and the accompanying materials are made available under the
* terms of the MIT License which is available at
* https://opensource.org/licenses/MIT.
- *
+ *
* SPDX-License-Identifier: MIT
**************************************************************************/
@@ -65,12 +66,6 @@
/* 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 *))
{
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 2acbda2c..1ca2d2ed 100644
--- a/common/core/src/ux_host_stack_configuration_descriptor_parse.c
+++ b/common/core/src/ux_host_stack_configuration_descriptor_parse.c
@@ -1,18 +1,19 @@
/***************************************************************************
- * Copyright (c) 2024 Microsoft Corporation
- *
+ * Copyright (c) 2024 Microsoft Corporation
+ * Copyright (c) 2026-present Eclipse ThreadX contributors
+ *
* This program and the accompanying materials are made available under the
* terms of the MIT License which is available at
* https://opensource.org/licenses/MIT.
- *
+ *
* SPDX-License-Identifier: MIT
**************************************************************************/
/**************************************************************************/
/**************************************************************************/
-/** */
-/** USBX Component */
+/** */
+/** USBX Component */
/** */
/** Host Stack */
/** */
@@ -28,52 +29,44 @@
#include "ux_host_stack.h"
-/**************************************************************************/
-/* */
-/* FUNCTION RELEASE */
-/* */
-/* _ux_host_stack_configuration_descriptor_parse PORTABLE C */
+/**************************************************************************/
+/* */
+/* FUNCTION RELEASE */
+/* */
+/* _ux_host_stack_configuration_descriptor_parse PORTABLE C */
/* 6.1 */
/* AUTHOR */
/* */
/* Chaoqiong Xiao, Microsoft Corporation */
/* */
/* DESCRIPTION */
-/* */
-/* This function reads the entire configuration descriptor and */
+/* */
+/* This function reads the entire configuration descriptor and */
/* enumerates the interfaces, binds the interface to a class driver... */
-/* if the device has multiple configurations, we read all the */
-/* configurations but do not instantiate any configuration. Rather we */
+/* if the device has multiple configurations, we read all the */
+/* configurations but do not instantiate any configuration. Rather we */
/* let a class driver do the work. */
-/* */
-/* INPUT */
-/* */
-/* device Pointer to device */
-/* configuration Pointer to configuration */
-/* configuration_index Index of configuration */
-/* */
-/* OUTPUT */
-/* */
-/* Completion Status */
-/* */
-/* CALLS */
-/* */
-/* _ux_host_stack_interfaces_scan Scan host interfaces */
-/* _ux_host_stack_transfer_request Process transfer request */
+/* */
+/* INPUT */
+/* */
+/* device Pointer to device */
+/* configuration Pointer to configuration */
+/* configuration_index Index of configuration */
+/* */
+/* OUTPUT */
+/* */
+/* Completion Status */
+/* */
+/* CALLS */
+/* */
+/* _ux_host_stack_interfaces_scan Scan host interfaces */
+/* _ux_host_stack_transfer_request Process transfer request */
/* _ux_utility_memory_allocate Allocate block of memory */
-/* _ux_utility_memory_free Free block of memory */
-/* */
-/* CALLED BY */
-/* */
-/* USBX Components */
-/* */
-/* RELEASE HISTORY */
-/* */
-/* DATE NAME DESCRIPTION */
-/* */
-/* 05-19-2020 Chaoqiong Xiao Initial Version 6.0 */
-/* 09-30-2020 Chaoqiong Xiao Modified comment(s), */
-/* resulting in version 6.1 */
+/* _ux_utility_memory_free Free block of memory */
+/* */
+/* CALLED BY */
+/* */
+/* USBX Components */
/* */
/**************************************************************************/
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 3ae12703..a4c4655a 100644
--- a/common/core/src/ux_host_stack_configuration_enumerate.c
+++ b/common/core/src/ux_host_stack_configuration_enumerate.c
@@ -1,18 +1,19 @@
/***************************************************************************
- * Copyright (c) 2024 Microsoft Corporation
- *
+ * Copyright (c) 2024 Microsoft Corporation
+ * Copyright (c) 2026-present Eclipse ThreadX contributors
+ *
* This program and the accompanying materials are made available under the
* terms of the MIT License which is available at
* https://opensource.org/licenses/MIT.
- *
+ *
* SPDX-License-Identifier: MIT
**************************************************************************/
/**************************************************************************/
/**************************************************************************/
-/** */
-/** USBX Component */
+/** */
+/** USBX Component */
/** */
/** Host Stack */
/** */
@@ -28,58 +29,50 @@
#include "ux_host_stack.h"
-/**************************************************************************/
-/* */
-/* FUNCTION RELEASE */
-/* */
-/* _ux_host_stack_configuration_enumerate PORTABLE C */
+/**************************************************************************/
+/* */
+/* FUNCTION RELEASE */
+/* */
+/* _ux_host_stack_configuration_enumerate PORTABLE C */
/* 6.1 */
/* AUTHOR */
/* */
/* Chaoqiong Xiao, Microsoft Corporation */
/* */
/* DESCRIPTION */
-/* */
+/* */
/* This function reads the configuration descriptor, creates the */
/* configuration container(s) for the device, and enumerates all found */
/* configurations. */
/* */
-/* At this stage, only the containers for each subcomponents are */
-/* linked. No configuration, interface or endpoints are active unless */
+/* At this stage, only the containers for each subcomponents are */
+/* linked. No configuration, interface or endpoints are active unless */
/* a class issues a SET_CONFIGURATION. */
-/* */
-/* INPUT */
-/* */
-/* device Pointer to device */
-/* */
-/* OUTPUT */
-/* */
-/* Completion Status */
-/* */
-/* CALLS */
-/* */
-/* _ux_host_stack_configuration_descriptor_parse */
-/* Parse configuration descriptor*/
-/* _ux_host_stack_configuration_instance_delete */
-/* Delete configuration instance */
-/* _ux_host_stack_new_configuration_create */
-/* Create new configuration */
-/* _ux_host_stack_transfer_request Process transfer request */
-/* _ux_utility_descriptor_parse Parse descriptor */
+/* */
+/* INPUT */
+/* */
+/* device Pointer to device */
+/* */
+/* OUTPUT */
+/* */
+/* Completion Status */
+/* */
+/* CALLS */
+/* */
+/* _ux_host_stack_configuration_descriptor_parse */
+/* Parse configuration descriptor*/
+/* _ux_host_stack_configuration_instance_delete */
+/* Delete configuration instance */
+/* _ux_host_stack_new_configuration_create */
+/* Create new configuration */
+/* _ux_host_stack_transfer_request Process transfer request */
+/* _ux_utility_descriptor_parse Parse descriptor */
/* _ux_utility_memory_allocate Allocate block of memory */
-/* _ux_utility_memory_free Free block of memory */
-/* */
-/* CALLED BY */
-/* */
-/* USBX Components */
-/* */
-/* RELEASE HISTORY */
-/* */
-/* DATE NAME DESCRIPTION */
-/* */
-/* 05-19-2020 Chaoqiong Xiao Initial Version 6.0 */
-/* 09-30-2020 Chaoqiong Xiao Modified comment(s), */
-/* resulting in version 6.1 */
+/* _ux_utility_memory_free Free block of memory */
+/* */
+/* CALLED BY */
+/* */
+/* USBX Components */
/* */
/**************************************************************************/
UINT _ux_host_stack_configuration_enumerate(UX_DEVICE *device)
@@ -100,8 +93,8 @@ ULONG configuration_index;
control_endpoint = &device -> ux_device_control_endpoint;
transfer_request = &control_endpoint -> ux_endpoint_transfer_request;
- /* Need to allocate memory for the configuration descriptor the first time we read
- only the configuration descriptor when we have the configuration descriptor, we have
+ /* Need to allocate memory for the configuration descriptor the first time we read
+ only the configuration descriptor when we have the configuration descriptor, we have
the length of the entire configuration\interface\endpoint descriptors. */
descriptor = _ux_utility_memory_allocate(UX_SAFE_ALIGN, UX_CACHE_SAFE_MEMORY, UX_CONFIGURATION_DESCRIPTOR_LENGTH);
if (descriptor == UX_NULL)
@@ -110,7 +103,7 @@ ULONG configuration_index;
/* There maybe multiple configurations for this device. */
nb_configurations = device -> ux_device_descriptor.bNumConfigurations;
- /* Parse all the configurations attached to the device. We start with the first index.
+ /* Parse all the configurations attached to the device. We start with the first index.
The index and the actual configuration value may be different according to the USB specification! */
for (configuration_index = 0; configuration_index < nb_configurations; configuration_index++)
{
@@ -139,12 +132,12 @@ ULONG configuration_index;
/* This configuration must be linked to the device. */
_ux_host_stack_new_configuration_create(device, configuration);
-
- /* The descriptor is in a packed format, parse it locally. */
+
+ /* The descriptor is in a packed format, parse it locally. */
_ux_utility_descriptor_parse(descriptor, _ux_system_configuration_descriptor_structure,
UX_CONFIGURATION_DESCRIPTOR_ENTRIES, (UCHAR *) &configuration -> ux_configuration_descriptor);
- /* Parse the device descriptor so that we can retrieve the length
+ /* Parse the device descriptor so that we can retrieve the length
of the entire configuration. */
status = _ux_host_stack_configuration_descriptor_parse(device, configuration, configuration_index);
@@ -162,7 +155,7 @@ ULONG configuration_index;
status = UX_MEMORY_INSUFFICIENT;
break;
- }
+ }
}
else
{
@@ -177,14 +170,14 @@ ULONG configuration_index;
status = UX_DESCRIPTOR_CORRUPTED;
break;
- }
-
+ }
+
}
/* Free all used resources. */
_ux_utility_memory_free(descriptor);
/* Return completion status. */
- return(status);
+ return(status);
}
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 7a1eb670..9864e542 100644
--- a/common/core/src/ux_host_stack_configuration_instance_create.c
+++ b/common/core/src/ux_host_stack_configuration_instance_create.c
@@ -1,18 +1,19 @@
/***************************************************************************
- * Copyright (c) 2024 Microsoft Corporation
- *
+ * Copyright (c) 2024 Microsoft Corporation
+ * Copyright (c) 2026-present Eclipse ThreadX contributors
+ *
* This program and the accompanying materials are made available under the
* terms of the MIT License which is available at
* https://opensource.org/licenses/MIT.
- *
+ *
* SPDX-License-Identifier: MIT
**************************************************************************/
/**************************************************************************/
/**************************************************************************/
-/** */
-/** USBX Component */
+/** */
+/** USBX Component */
/** */
/** Host Stack */
/** */
@@ -28,53 +29,37 @@
#include "ux_host_stack.h"
-/**************************************************************************/
-/* */
-/* FUNCTION RELEASE */
-/* */
-/* _ux_host_stack_configuration_instance_create PORTABLE C */
+/**************************************************************************/
+/* */
+/* FUNCTION RELEASE */
+/* */
+/* _ux_host_stack_configuration_instance_create PORTABLE C */
/* 6.2.0 */
/* AUTHOR */
/* */
/* Chaoqiong Xiao, Microsoft Corporation */
/* */
/* DESCRIPTION */
-/* */
+/* */
/* This function will create a configuration instance. It scan all the */
/* interfaces hooked to the configuration and enable each interface */
-/* with the alternate setting 0. */
-/* */
-/* INPUT */
-/* */
-/* configuration Pointer to configuration */
-/* */
-/* OUTPUT */
-/* */
-/* Completion Status */
-/* */
-/* CALLS */
-/* */
-/* _ux_host_stack_interface_instance_create Create interface instance */
-/* */
-/* CALLED BY */
-/* */
-/* USBX Components */
-/* */
-/* RELEASE HISTORY */
-/* */
-/* DATE NAME DESCRIPTION */
-/* */
-/* 05-19-2020 Chaoqiong Xiao Initial Version 6.0 */
-/* 09-30-2020 Chaoqiong Xiao Modified comment(s), */
-/* resulting in version 6.1 */
-/* 07-29-2022 Chaoqiong Xiao Modified comment(s), */
-/* fixed parameter/variable */
-/* names conflict C++ keyword, */
-/* resulting in version 6.1.12 */
-/* 10-31-2022 Chaoqiong Xiao Modified comment(s), */
-/* added interface instance */
-/* creation strategy control, */
-/* resulting in version 6.2.0 */
+/* with the alternate setting 0. */
+/* */
+/* INPUT */
+/* */
+/* configuration Pointer to configuration */
+/* */
+/* OUTPUT */
+/* */
+/* Completion Status */
+/* */
+/* CALLS */
+/* */
+/* _ux_host_stack_interface_instance_create Create interface instance */
+/* */
+/* CALLED BY */
+/* */
+/* USBX Components */
/* */
/**************************************************************************/
UINT _ux_host_stack_configuration_instance_create(UX_CONFIGURATION *configuration)
@@ -82,7 +67,7 @@ UINT _ux_host_stack_configuration_instance_create(UX_CONFIGURATION *configurati
UX_INTERFACE *interface_ptr;
UINT status;
-
+
/* If trace is enabled, insert this event into the trace buffer. */
UX_TRACE_IN_LINE_INSERT(UX_TRACE_HOST_STACK_CONFIGURATION_INSTANCE_CREATE, configuration, 0, 0, 0, UX_TRACE_HOST_STACK_EVENTS, 0, 0)
@@ -107,7 +92,7 @@ UINT status;
/* Check status, the controller may have refused the endpoint creation. */
if (status != UX_SUCCESS)
-
+
/* An error occurred. The interface cannot be mounted. */
return(status);
}
@@ -118,6 +103,6 @@ UINT status;
}
/* Return successful completion. */
- return(UX_SUCCESS);
+ return(UX_SUCCESS);
}
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 32712fd0..38d41c2a 100644
--- a/common/core/src/ux_host_stack_configuration_instance_delete.c
+++ b/common/core/src/ux_host_stack_configuration_instance_delete.c
@@ -1,18 +1,19 @@
/***************************************************************************
- * Copyright (c) 2024 Microsoft Corporation
- *
+ * Copyright (c) 2024 Microsoft Corporation
+ * Copyright (c) 2026-present Eclipse ThreadX contributors
+ *
* This program and the accompanying materials are made available under the
* terms of the MIT License which is available at
* https://opensource.org/licenses/MIT.
- *
+ *
* SPDX-License-Identifier: MIT
**************************************************************************/
/**************************************************************************/
/**************************************************************************/
-/** */
-/** USBX Component */
+/** */
+/** USBX Component */
/** */
/** Host Stack */
/** */
@@ -28,53 +29,37 @@
#include "ux_host_stack.h"
-/**************************************************************************/
-/* */
-/* FUNCTION RELEASE */
-/* */
-/* _ux_host_stack_configuration_instance_delete PORTABLE C */
+/**************************************************************************/
+/* */
+/* FUNCTION RELEASE */
+/* */
+/* _ux_host_stack_configuration_instance_delete PORTABLE C */
/* 6.2.0 */
/* AUTHOR */
/* */
/* Chaoqiong Xiao, Microsoft Corporation */
/* */
/* DESCRIPTION */
-/* */
-/* This function will delete a configuration instance. It does not */
-/* delete configuration container but it deletes all the alternate */
-/* current alternate settings for each interface it owns. */
-/* */
-/* INPUT */
-/* */
-/* configuration Pointer to configuration */
-/* */
-/* OUTPUT */
-/* */
-/* Completion Status */
-/* */
-/* CALLS */
-/* */
-/* _ux_host_stack_interface_instance_delete Delete interface instance */
-/* */
-/* CALLED BY */
-/* */
-/* USBX Components */
-/* */
-/* RELEASE HISTORY */
-/* */
-/* DATE NAME DESCRIPTION */
-/* */
-/* 05-19-2020 Chaoqiong Xiao Initial Version 6.0 */
-/* 09-30-2020 Chaoqiong Xiao Modified comment(s), */
-/* resulting in version 6.1 */
-/* 07-29-2022 Chaoqiong Xiao Modified comment(s), */
-/* fixed parameter/variable */
-/* names conflict C++ keyword, */
-/* resulting in version 6.1.12 */
-/* 10-31-2022 Chaoqiong Xiao Modified comment(s), */
-/* added interface instance */
-/* creation strategy control, */
-/* resulting in version 6.2.0 */
+/* */
+/* This function will delete a configuration instance. It does not */
+/* delete configuration container but it deletes all the alternate */
+/* current alternate settings for each interface it owns. */
+/* */
+/* INPUT */
+/* */
+/* configuration Pointer to configuration */
+/* */
+/* OUTPUT */
+/* */
+/* Completion Status */
+/* */
+/* CALLS */
+/* */
+/* _ux_host_stack_interface_instance_delete Delete interface instance */
+/* */
+/* CALLED BY */
+/* */
+/* USBX Components */
/* */
/**************************************************************************/
VOID _ux_host_stack_configuration_instance_delete(UX_CONFIGURATION *configuration)
@@ -82,13 +67,13 @@ VOID _ux_host_stack_configuration_instance_delete(UX_CONFIGURATION *configurati
UX_INTERFACE *interface_ptr;
ULONG current_alternate_setting;
-
+
/* If trace is enabled, insert this event into the trace buffer. */
UX_TRACE_IN_LINE_INSERT(UX_TRACE_HOST_STACK_CONFIGURATION_INSTANCE_DELETE, configuration, 0, 0, 0, UX_TRACE_HOST_STACK_EVENTS, 0, 0)
/* Obtain the first interface for this configuration. */
interface_ptr = configuration -> ux_configuration_first_interface;
-
+
/* In order to keep the compiler happy, we reset the alternate setting. */
current_alternate_setting = 0;
@@ -102,7 +87,7 @@ ULONG current_alternate_setting;
current_alternate_setting = interface_ptr -> ux_interface_current_alternate_setting;
}
-
+
if (interface_ptr -> ux_interface_descriptor.bAlternateSetting == current_alternate_setting)
{
@@ -117,6 +102,6 @@ ULONG current_alternate_setting;
interface_ptr = interface_ptr -> ux_interface_next_interface;
}
- return;
+ return;
}
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 6dc42f75..f8e6dceb 100644
--- a/common/core/src/ux_host_stack_configuration_interface_get.c
+++ b/common/core/src/ux_host_stack_configuration_interface_get.c
@@ -1,18 +1,19 @@
/***************************************************************************
- * Copyright (c) 2024 Microsoft Corporation
- *
+ * Copyright (c) 2024 Microsoft Corporation
+ * Copyright (c) 2026-present Eclipse ThreadX contributors
+ *
* This program and the accompanying materials are made available under the
* terms of the MIT License which is available at
* https://opensource.org/licenses/MIT.
- *
+ *
* SPDX-License-Identifier: MIT
**************************************************************************/
/**************************************************************************/
/**************************************************************************/
-/** */
-/** USBX Component */
+/** */
+/** USBX Component */
/** */
/** Host Stack */
/** */
@@ -28,61 +29,49 @@
#include "ux_host_stack.h"
-/**************************************************************************/
-/* */
-/* FUNCTION RELEASE */
-/* */
-/* _ux_host_stack_configuration_interface_get PORTABLE C */
+/**************************************************************************/
+/* */
+/* FUNCTION RELEASE */
+/* */
+/* _ux_host_stack_configuration_interface_get PORTABLE C */
/* 6.1.12 */
/* AUTHOR */
/* */
/* Chaoqiong Xiao, Microsoft Corporation */
/* */
/* DESCRIPTION */
-/* */
-/* This function returns an interface container based on a */
-/* configuration handle, an interface index and an alternate setting */
-/* index. */
-/* */
-/* INPUT */
-/* */
-/* configuration Pointer to configuration */
-/* interface_index Index of interface */
-/* alternate_setting_index Index of alternate setting */
-/* interface Destination of interface */
-/* pointer */
-/* */
-/* OUTPUT */
-/* */
-/* Completion Status */
-/* */
-/* CALLS */
-/* */
-/* None */
-/* */
-/* 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), */
-/* resulting in version 6.1 */
-/* 07-29-2022 Chaoqiong Xiao Modified comment(s), */
-/* fixed parameter/variable */
-/* names conflict C++ keyword, */
-/* resulting in version 6.1.12 */
+/* */
+/* This function returns an interface container based on a */
+/* configuration handle, an interface index and an alternate setting */
+/* index. */
+/* */
+/* INPUT */
+/* */
+/* configuration Pointer to configuration */
+/* interface_index Index of interface */
+/* alternate_setting_index Index of alternate setting */
+/* interface Destination of interface */
+/* pointer */
+/* */
+/* OUTPUT */
+/* */
+/* Completion Status */
+/* */
+/* CALLS */
+/* */
+/* None */
+/* */
+/* CALLED BY */
+/* */
+/* Application */
+/* USBX Components */
/* */
/**************************************************************************/
-UINT _ux_host_stack_configuration_interface_get(UX_CONFIGURATION *configuration,
+UINT _ux_host_stack_configuration_interface_get(UX_CONFIGURATION *configuration,
UINT interface_index, UINT alternate_setting_index,
UX_INTERFACE **ux_interface)
{
-
+
UINT current_interface_number;
UINT container_index;
UX_INTERFACE *current_interface;
@@ -94,20 +83,20 @@ UX_INTERFACE *current_interface;
/* If trace is enabled, insert this event into the trace buffer. */
UX_TRACE_IN_LINE_INSERT(UX_TRACE_ERROR, UX_CONFIGURATION_HANDLE_UNKNOWN, configuration, 0, 0, UX_TRACE_ERRORS, 0, 0)
-
+
return(UX_CONFIGURATION_HANDLE_UNKNOWN);
}
-
+
/* Start with the interface attached to the configuration. */
current_interface = configuration -> ux_configuration_first_interface;
- /* The first interface has the index 0 */
+ /* The first interface has the index 0 */
container_index = 0;
-
+
/* Reset the interface number */
current_interface_number = 0;
-
- /* Traverse the list of the interfaces until we found the right one */
+
+ /* Traverse the list of the interfaces until we found the right one */
while (current_interface != UX_NULL)
{
@@ -118,7 +107,7 @@ UX_INTERFACE *current_interface;
/* We have found the correct interface, now search for the alternate setting. */
current_interface_number = current_interface -> ux_interface_descriptor.bInterfaceNumber;
- /* The first alternate setting has the index 0. */
+ /* The first alternate setting has the index 0. */
container_index = 0;
/* Loop on all the alternate settings for this interface. */
@@ -143,11 +132,11 @@ UX_INTERFACE *current_interface;
/* Move to the next alternate setting. */
current_interface = current_interface -> ux_interface_next_interface;
-
+
/* Check new interface pointer, might be the end. */
if (current_interface != UX_NULL)
{
-
+
/* And verify that we are still in the same interface. */
if (current_interface -> ux_interface_descriptor.bInterfaceNumber != current_interface_number)
{
@@ -159,23 +148,23 @@ UX_INTERFACE *current_interface;
UX_TRACE_IN_LINE_INSERT(UX_TRACE_ERROR, UX_INTERFACE_HANDLE_UNKNOWN, ux_interface, 0, 0, UX_TRACE_ERRORS, 0, 0)
return(UX_INTERFACE_HANDLE_UNKNOWN);
- }
+ }
}
- }
+ }
}
-
+
/* Check the current interface, we may already be at the end ... */
if (current_interface != UX_NULL)
{
-
+
/* Move to the next interface. */
current_interface = current_interface -> ux_interface_next_interface;
-
+
/* Move to the next interface index. */
container_index++;
- }
+ }
}
-
+
/* Error trap. */
_ux_system_error_handler(UX_SYSTEM_LEVEL_THREAD, UX_SYSTEM_CONTEXT_ENUMERATOR, UX_INTERFACE_HANDLE_UNKNOWN);
@@ -222,14 +211,8 @@ UX_INTERFACE *current_interface;
/* */
/* Application */
/* */
-/* RELEASE HISTORY */
-/* */
-/* DATE NAME DESCRIPTION */
-/* */
-/* 10-31-2023 Chaoqiong Xiao Initial Version 6.3.0 */
-/* */
/**************************************************************************/
-UINT _uxe_host_stack_configuration_interface_get(UX_CONFIGURATION *configuration,
+UINT _uxe_host_stack_configuration_interface_get(UX_CONFIGURATION *configuration,
UINT interface_index, UINT alternate_setting_index,
UX_INTERFACE **ux_interface)
{
diff --git a/common/core/src/ux_host_stack_configuration_interface_scan.c b/common/core/src/ux_host_stack_configuration_interface_scan.c
index 979ecced..31cf85b1 100644
--- a/common/core/src/ux_host_stack_configuration_interface_scan.c
+++ b/common/core/src/ux_host_stack_configuration_interface_scan.c
@@ -1,10 +1,11 @@
/***************************************************************************
- * Copyright (c) 2024 Microsoft Corporation
- *
+ * Copyright (c) 2024 Microsoft Corporation
+ * Copyright (c) 2026-present Eclipse ThreadX contributors
+ *
* This program and the accompanying materials are made available under the
* terms of the MIT License which is available at
* https://opensource.org/licenses/MIT.
- *
+ *
* SPDX-License-Identifier: MIT
**************************************************************************/
@@ -64,19 +65,6 @@
/* */
/* USBX Components */
/* */
-/* RELEASE HISTORY */
-/* */
-/* DATE NAME DESCRIPTION */
-/* */
-/* 02-02-2021 Chaoqiong Xiao Initial Version 6.1.4 */
-/* 01-31-2022 Chaoqiong Xiao Modified comment(s), */
-/* added standalone support, */
-/* resulting in version 6.1.10 */
-/* 07-29-2022 Chaoqiong Xiao Modified comment(s), */
-/* fixed parameter/variable */
-/* names conflict C++ keyword, */
-/* resulting in version 6.1.12 */
-/* */
/**************************************************************************/
UINT _ux_host_stack_configuration_interface_scan(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 5d03013a..2022fe9a 100644
--- a/common/core/src/ux_host_stack_configuration_set.c
+++ b/common/core/src/ux_host_stack_configuration_set.c
@@ -1,18 +1,19 @@
/***************************************************************************
- * Copyright (c) 2024 Microsoft Corporation
- *
+ * Copyright (c) 2024 Microsoft Corporation
+ * Copyright (c) 2026-present Eclipse ThreadX contributors
+ *
* This program and the accompanying materials are made available under the
* terms of the MIT License which is available at
* https://opensource.org/licenses/MIT.
- *
+ *
* SPDX-License-Identifier: MIT
**************************************************************************/
/**************************************************************************/
/**************************************************************************/
-/** */
-/** USBX Component */
+/** */
+/** USBX Component */
/** */
/** Host Stack */
/** */
@@ -28,62 +29,44 @@
#include "ux_host_stack.h"
-/**************************************************************************/
-/* */
-/* FUNCTION RELEASE */
-/* */
-/* _ux_host_stack_configuration_set PORTABLE C */
+/**************************************************************************/
+/* */
+/* FUNCTION RELEASE */
+/* */
+/* _ux_host_stack_configuration_set PORTABLE C */
/* 6.1.10 */
/* AUTHOR */
/* */
/* Chaoqiong Xiao, Microsoft Corporation */
/* */
/* DESCRIPTION */
-/* */
-/* This function performs a setting of a device configuration. */
+/* */
+/* This function performs a setting of a device configuration. */
/* */
/* In RTOS mode, this function is blocking. */
-/* If the host is OTG capable and the device has an OTG descriptor */
-/* that supports HNP we perform a SET_FEATURE with b_hnp_support. */
-/* */
+/* If the host is OTG capable and the device has an OTG descriptor */
+/* that supports HNP we perform a SET_FEATURE with b_hnp_support. */
+/* */
/* In standalone mode, when device enumeration is in progress, this */
/* function is non-blocking, it prepares transfer for enum step of */
/* SET_CONFIGURE request. Otherwise it blocks until transfer request */
/* done. */
-/* */
-/* INPUT */
-/* */
-/* configuration Pointer to configuration */
-/* */
-/* OUTPUT */
-/* */
-/* Completion Status */
-/* */
-/* CALLS */
-/* */
-/* _ux_host_stack_transfer_request Process transfer request */
-/* */
-/* 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 */
-/* 02-02-2021 Chaoqiong Xiao Modified comment(s), */
-/* used pointer for current */
-/* selected configuration, */
-/* resulting in version 6.1.4 */
-/* 01-31-2022 Chaoqiong Xiao Modified comment(s), */
-/* added standalone support, */
-/* set device power source, */
-/* resulting in version 6.1.10 */
+/* */
+/* INPUT */
+/* */
+/* configuration Pointer to configuration */
+/* */
+/* OUTPUT */
+/* */
+/* Completion Status */
+/* */
+/* CALLS */
+/* */
+/* _ux_host_stack_transfer_request Process transfer request */
+/* */
+/* CALLED BY */
+/* */
+/* USBX Components */
/* */
/**************************************************************************/
UINT _ux_host_stack_configuration_set(UX_CONFIGURATION *configuration)
@@ -98,7 +81,7 @@ UX_HCD *hcd;
#endif
- /* A configuration is selected. Retrieve the pointer to the control endpoint
+ /* A configuration is selected. Retrieve the pointer to the control endpoint
and its transfer request. */
device = configuration -> ux_configuration_device;
control_endpoint = &device -> ux_device_control_endpoint;
@@ -116,11 +99,11 @@ UX_HCD *hcd;
/* With the device we have the pointer to the 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)
{
-
+
/* The Host controller is OTG aware. Perform a SET_FEATURE with b_hnp_support. */
transfer_request -> ux_transfer_request_data_pointer = UX_NULL;
transfer_request -> ux_transfer_request_requested_length = 0;
@@ -128,10 +111,10 @@ UX_HCD *hcd;
transfer_request -> ux_transfer_request_type = UX_REQUEST_OUT| UX_REQUEST_TYPE_STANDARD | UX_REQUEST_TARGET_DEVICE;
transfer_request -> ux_transfer_request_value = UX_OTG_FEATURE_A_HNP_SUPPORT;
transfer_request -> ux_transfer_request_index = 0;
-
+
/* Send request to HCD layer. */
status = _ux_host_stack_transfer_request(transfer_request);
-
+
/* If the device fails this command we turn off its OTG capabilities. */
if (status != UX_SUCCESS)
@@ -175,7 +158,7 @@ UX_HCD *hcd;
/* Change the device state to configured. */
device -> ux_device_state = UX_DEVICE_CONFIGURED;
-
+
/* Store the new configuration value in the device container. */
device -> ux_device_current_configuration = configuration;
diff --git a/common/core/src/ux_host_stack_delay_ms.c b/common/core/src/ux_host_stack_delay_ms.c
index cb036ea6..1345c68d 100644
--- a/common/core/src/ux_host_stack_delay_ms.c
+++ b/common/core/src/ux_host_stack_delay_ms.c
@@ -1,18 +1,19 @@
/***************************************************************************
- * Copyright (c) 2024 Microsoft Corporation
- *
+ * Copyright (c) 2024 Microsoft Corporation
+ * Copyright (c) 2026-present Eclipse ThreadX contributors
+ *
* This program and the accompanying materials are made available under the
* terms of the MIT License which is available at
* https://opensource.org/licenses/MIT.
- *
+ *
* SPDX-License-Identifier: MIT
**************************************************************************/
/**************************************************************************/
/**************************************************************************/
-/** */
-/** USBX Component */
+/** */
+/** USBX Component */
/** */
/** Host Stack */
/** */
@@ -28,48 +29,40 @@
#include "ux_host_stack.h"
-/**************************************************************************/
-/* */
-/* FUNCTION RELEASE */
-/* */
-/* _ux_host_stack_delay_ms PORTABLE C */
+/**************************************************************************/
+/* */
+/* FUNCTION RELEASE */
+/* */
+/* _ux_host_stack_delay_ms PORTABLE C */
/* 6.1 */
/* AUTHOR */
/* */
/* Chaoqiong Xiao, Microsoft Corporation */
/* */
/* DESCRIPTION */
-/* */
-/* This function is now obsolete. */
-/* */
-/* INPUT */
-/* */
-/* time Number of milliseconds to */
-/* wait for */
-/* */
-/* OUTPUT */
-/* */
-/* None */
-/* */
-/* CALLS */
-/* */
-/* (ux_hcd_entry_function) HCD entry function */
-/* */
-/* CALLED BY */
-/* */
-/* USBX Components */
-/* */
-/* RELEASE HISTORY */
-/* */
-/* DATE NAME DESCRIPTION */
-/* */
-/* 05-19-2020 Chaoqiong Xiao Initial Version 6.0 */
-/* 09-30-2020 Chaoqiong Xiao Modified comment(s), */
-/* resulting in version 6.1 */
+/* */
+/* This function is now obsolete. */
+/* */
+/* INPUT */
+/* */
+/* time Number of milliseconds to */
+/* wait for */
+/* */
+/* OUTPUT */
+/* */
+/* None */
+/* */
+/* CALLS */
+/* */
+/* (ux_hcd_entry_function) HCD entry function */
+/* */
+/* CALLED BY */
+/* */
+/* USBX Components */
/* */
/**************************************************************************/
VOID _ux_host_stack_delay_ms(ULONG time)
{
UX_PARAMETER_NOT_USED(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 07850401..0dce1022 100644
--- a/common/core/src/ux_host_stack_device_address_set.c
+++ b/common/core/src/ux_host_stack_device_address_set.c
@@ -1,18 +1,19 @@
/***************************************************************************
- * Copyright (c) 2024 Microsoft Corporation
- *
+ * Copyright (c) 2024 Microsoft Corporation
+ * Copyright (c) 2026-present Eclipse ThreadX contributors
+ *
* This program and the accompanying materials are made available under the
* terms of the MIT License which is available at
* https://opensource.org/licenses/MIT.
- *
+ *
* SPDX-License-Identifier: MIT
**************************************************************************/
/**************************************************************************/
/**************************************************************************/
-/** */
-/** USBX Component */
+/** */
+/** USBX Component */
/** */
/** Host Stack */
/** */
@@ -28,49 +29,36 @@
#include "ux_host_stack.h"
-/**************************************************************************/
-/* */
-/* FUNCTION RELEASE */
-/* */
-/* _ux_host_stack_device_address_set PORTABLE C */
+/**************************************************************************/
+/* */
+/* FUNCTION RELEASE */
+/* */
+/* _ux_host_stack_device_address_set PORTABLE C */
/* 6.1.10 */
/* AUTHOR */
/* */
/* Chaoqiong Xiao, Microsoft Corporation */
/* */
/* DESCRIPTION */
-/* */
-/* This function sets the device address to the new device. */
-/* */
-/* INPUT */
-/* */
-/* device Pointer to device */
-/* */
-/* OUTPUT */
-/* */
-/* Completion Status */
-/* */
-/* CALLS */
-/* */
-/* _ux_utility_delay_ms Thread sleep */
-/* _ux_host_stack_transfer_request Process transfer request */
-/* */
-/* 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 */
-/* 01-31-2022 Chaoqiong Xiao Modified comment(s), */
-/* added standalone support, */
-/* resulting in version 6.1.10 */
+/* */
+/* This function sets the device address to the new device. */
+/* */
+/* INPUT */
+/* */
+/* device Pointer to device */
+/* */
+/* OUTPUT */
+/* */
+/* Completion Status */
+/* */
+/* CALLS */
+/* */
+/* _ux_utility_delay_ms Thread sleep */
+/* _ux_host_stack_transfer_request Process transfer request */
+/* */
+/* CALLED BY */
+/* */
+/* USBX Components */
/* */
/**************************************************************************/
UINT _ux_host_stack_device_address_set(UX_DEVICE *device)
@@ -185,7 +173,7 @@ UCHAR device_address_byte;
/* 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. */
+ we will try again either at the root hub or regular hub. */
return(status);
}
#endif
diff --git a/common/core/src/ux_host_stack_device_configuration_activate.c b/common/core/src/ux_host_stack_device_configuration_activate.c
index 0b5fb58d..ff17342b 100644
--- a/common/core/src/ux_host_stack_device_configuration_activate.c
+++ b/common/core/src/ux_host_stack_device_configuration_activate.c
@@ -1,10 +1,11 @@
/***************************************************************************
- * Copyright (c) 2024 Microsoft Corporation
- *
+ * Copyright (c) 2024 Microsoft Corporation
+ * Copyright (c) 2026-present Eclipse ThreadX contributors
+ *
* This program and the accompanying materials are made available under the
* terms of the MIT License which is available at
* https://opensource.org/licenses/MIT.
- *
+ *
* SPDX-License-Identifier: MIT
**************************************************************************/
@@ -65,18 +66,6 @@
/* Application */
/* USBX Components */
/* */
-/* RELEASE HISTORY */
-/* */
-/* DATE NAME DESCRIPTION */
-/* */
-/* 02-02-2021 Chaoqiong Xiao Initial Version 6.1.4 */
-/* 06-02-2021 Chaoqiong Xiao Modified comment(s), */
-/* fixed trace enabled error, */
-/* resulting in version 6.1.7 */
-/* 01-31-2022 Chaoqiong Xiao Modified comment(s), */
-/* added standalone support, */
-/* resulting in version 6.1.10 */
-/* */
/**************************************************************************/
UINT _ux_host_stack_device_configuration_activate(UX_CONFIGURATION *configuration)
{
@@ -217,12 +206,6 @@ UINT status;
/* */
/* Application */
/* */
-/* RELEASE HISTORY */
-/* */
-/* DATE NAME DESCRIPTION */
-/* */
-/* 10-31-2023 Chaoqiong Xiao Initial Version 6.3.0 */
-/* */
/**************************************************************************/
UINT _uxe_host_stack_device_configuration_activate(UX_CONFIGURATION *configuration)
{
diff --git a/common/core/src/ux_host_stack_device_configuration_deactivate.c b/common/core/src/ux_host_stack_device_configuration_deactivate.c
index 76834305..f628d50f 100644
--- a/common/core/src/ux_host_stack_device_configuration_deactivate.c
+++ b/common/core/src/ux_host_stack_device_configuration_deactivate.c
@@ -1,10 +1,11 @@
/***************************************************************************
- * Copyright (c) 2024 Microsoft Corporation
- *
+ * Copyright (c) 2024 Microsoft Corporation
+ * Copyright (c) 2026-present Eclipse ThreadX contributors
+ *
* This program and the accompanying materials are made available under the
* terms of the MIT License which is available at
* https://opensource.org/licenses/MIT.
- *
+ *
* SPDX-License-Identifier: MIT
**************************************************************************/
@@ -62,25 +63,6 @@
/* Application */
/* USBX Components */
/* */
-/* RELEASE HISTORY */
-/* */
-/* DATE NAME DESCRIPTION */
-/* */
-/* 02-02-2021 Chaoqiong Xiao Initial Version 6.1.4 */
-/* 06-02-2021 Chaoqiong Xiao Modified comment(s), */
-/* fixed trace enabled error, */
-/* resulting in version 6.1.7 */
-/* 01-31-2022 Chaoqiong Xiao Modified comment(s), */
-/* added standalone support, */
-/* resulting in version 6.1.10 */
-/* 04-25-2022 Chaoqiong Xiao Modified comment(s), */
-/* internal clean up, */
-/* resulting in version 6.1.11 */
-/* 07-29-2022 Chaoqiong Xiao Modified comment(s), */
-/* fixed parameter/variable */
-/* names conflict C++ keyword, */
-/* resulting in version 6.1.12 */
-/* */
/**************************************************************************/
UINT _ux_host_stack_device_configuration_deactivate(UX_DEVICE *device)
{
@@ -226,12 +208,6 @@ UINT status;
/* */
/* Application */
/* */
-/* RELEASE HISTORY */
-/* */
-/* DATE NAME DESCRIPTION */
-/* */
-/* 10-31-2023 Chaoqiong Xiao Initial Version 6.3.0 */
-/* */
/**************************************************************************/
UINT _uxe_host_stack_device_configuration_deactivate(UX_DEVICE *device)
{
diff --git a/common/core/src/ux_host_stack_device_configuration_get.c b/common/core/src/ux_host_stack_device_configuration_get.c
index 100ddf4f..e85dfca8 100644
--- a/common/core/src/ux_host_stack_device_configuration_get.c
+++ b/common/core/src/ux_host_stack_device_configuration_get.c
@@ -1,18 +1,19 @@
/***************************************************************************
- * Copyright (c) 2024 Microsoft Corporation
- *
+ * Copyright (c) 2024 Microsoft Corporation
+ * Copyright (c) 2026-present Eclipse ThreadX contributors
+ *
* This program and the accompanying materials are made available under the
* terms of the MIT License which is available at
* https://opensource.org/licenses/MIT.
- *
+ *
* SPDX-License-Identifier: MIT
**************************************************************************/
/**************************************************************************/
/**************************************************************************/
-/** */
-/** USBX Component */
+/** */
+/** USBX Component */
/** */
/** Host Stack */
/** */
@@ -28,48 +29,40 @@
#include "ux_host_stack.h"
-/**************************************************************************/
-/* */
-/* FUNCTION RELEASE */
-/* */
-/* _ux_host_stack_device_configuration_get PORTABLE C */
+/**************************************************************************/
+/* */
+/* FUNCTION RELEASE */
+/* */
+/* _ux_host_stack_device_configuration_get PORTABLE C */
/* 6.1 */
/* AUTHOR */
/* */
/* Chaoqiong Xiao, Microsoft Corporation */
/* */
/* DESCRIPTION */
-/* */
+/* */
/* This function returns a configuration container based on a device */
-/* handle and a configuration index. */
-/* */
-/* INPUT */
-/* */
-/* device Pointer to device */
-/* configuration_index Index of configuration */
-/* configuration Pointer to configuration */
-/* destination */
-/* */
-/* OUTPUT */
-/* */
-/* Completion Status */
-/* */
-/* CALLS */
-/* */
-/* None */
-/* */
-/* 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), */
-/* resulting in version 6.1 */
+/* handle and a configuration index. */
+/* */
+/* INPUT */
+/* */
+/* device Pointer to device */
+/* configuration_index Index of configuration */
+/* configuration Pointer to configuration */
+/* destination */
+/* */
+/* OUTPUT */
+/* */
+/* Completion Status */
+/* */
+/* CALLS */
+/* */
+/* None */
+/* */
+/* CALLED BY */
+/* */
+/* Application */
+/* USBX Components */
/* */
/**************************************************************************/
UINT _ux_host_stack_device_configuration_get(UX_DEVICE *device, UINT configuration_index,
@@ -82,7 +75,7 @@ UX_CONFIGURATION *current_configuration;
/* Do a sanity check on the device handle. */
if (device -> ux_device_handle != (ULONG) (ALIGN_TYPE) device)
{
-
+
/* Error trap. */
_ux_system_error_handler(UX_SYSTEM_LEVEL_THREAD, UX_SYSTEM_CONTEXT_ENUMERATOR, UX_DEVICE_HANDLE_UNKNOWN);
@@ -91,14 +84,14 @@ UX_CONFIGURATION *current_configuration;
return(UX_DEVICE_HANDLE_UNKNOWN);
}
-
+
/* Start with the configuration attached to the device. */
current_configuration = device -> ux_device_first_configuration;
- /* The first configuration has the index 0. */
+ /* The first configuration has the index 0. */
current_configuration_index = 0;
-
- /* Traverse the list of the configurations until we found the right one. */
+
+ /* Traverse the list of the configurations until we found the right one. */
while (current_configuration != UX_NULL)
{
@@ -115,20 +108,20 @@ UX_CONFIGURATION *current_configuration;
/* Return successful completion. */
return(UX_SUCCESS);
}
-
+
/* Move to the next configuration. */
current_configuration = current_configuration -> ux_configuration_next_configuration;
-
+
/* Move to the next index. */
current_configuration_index++;
}
-
+
/* Error trap. */
_ux_system_error_handler(UX_SYSTEM_LEVEL_THREAD, UX_SYSTEM_CONTEXT_ENUMERATOR, UX_CONFIGURATION_HANDLE_UNKNOWN);
/* If trace is enabled, insert this event into the trace buffer. */
UX_TRACE_IN_LINE_INSERT(UX_TRACE_ERROR, UX_CONFIGURATION_HANDLE_UNKNOWN, configuration, 0, 0, UX_TRACE_ERRORS, 0, 0)
-
+
/* Return an error. */
return(UX_CONFIGURATION_HANDLE_UNKNOWN);
}
@@ -168,12 +161,6 @@ UX_CONFIGURATION *current_configuration;
/* */
/* Application */
/* */
-/* RELEASE HISTORY */
-/* */
-/* DATE NAME DESCRIPTION */
-/* */
-/* 10-31-2023 Chaoqiong Xiao Initial Version 6.3.0 */
-/* */
/**************************************************************************/
UINT _uxe_host_stack_device_configuration_get(UX_DEVICE *device, UINT configuration_index,
UX_CONFIGURATION **configuration)
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 99288a21..34cb7110 100644
--- a/common/core/src/ux_host_stack_device_configuration_reset.c
+++ b/common/core/src/ux_host_stack_device_configuration_reset.c
@@ -1,18 +1,19 @@
/***************************************************************************
- * Copyright (c) 2024 Microsoft Corporation
- *
+ * Copyright (c) 2024 Microsoft Corporation
+ * Copyright (c) 2026-present Eclipse ThreadX contributors
+ *
* This program and the accompanying materials are made available under the
* terms of the MIT License which is available at
* https://opensource.org/licenses/MIT.
- *
+ *
* SPDX-License-Identifier: MIT
**************************************************************************/
/**************************************************************************/
/**************************************************************************/
-/** */
-/** USBX Component */
+/** */
+/** USBX Component */
/** */
/** Host Stack */
/** */
@@ -28,56 +29,36 @@
#include "ux_host_stack.h"
-/**************************************************************************/
-/* */
-/* FUNCTION RELEASE */
-/* */
-/* _ux_host_stack_device_configuration_reset PORTABLE C */
+/**************************************************************************/
+/* */
+/* FUNCTION RELEASE */
+/* */
+/* _ux_host_stack_device_configuration_reset PORTABLE C */
/* 6.1.12 */
/* AUTHOR */
/* */
/* Chaoqiong Xiao, Microsoft Corporation */
/* */
/* DESCRIPTION */
-/* */
+/* */
/* This function resets the configuration of the device to zero. */
-/* */
-/* INPUT */
-/* */
-/* configuration Pointer to configuration */
-/* */
-/* OUTPUT */
-/* */
-/* Completion Status */
-/* */
-/* CALLS */
-/* */
+/* */
+/* INPUT */
+/* */
+/* configuration Pointer to configuration */
+/* */
+/* OUTPUT */
+/* */
+/* Completion Status */
+/* */
+/* CALLS */
+/* */
/* _ux_host_stack_configuration_instance_delete */
-/* Delete configuration instance*/
-/* */
-/* CALLED BY */
-/* */
-/* USBX Components */
-/* */
-/* RELEASE HISTORY */
-/* */
-/* DATE NAME DESCRIPTION */
-/* */
-/* 05-19-2020 Chaoqiong Xiao Initial Version 6.0 */
-/* 09-30-2020 Chaoqiong Xiao Modified comment(s), */
-/* resulting in version 6.1 */
-/* 02-02-2021 Chaoqiong Xiao Modified comment(s), */
-/* used pointer for current */
-/* selected configuration, */
-/* resulting in version 6.1.4 */
-/* 01-31-2022 Chaoqiong Xiao Modified comment(s), */
-/* fixed device state support, */
-/* reset device power source, */
-/* resulting in version 6.1.10 */
-/* 07-29-2022 Chaoqiong Xiao Modified comment(s), */
-/* reset shared device config */
-/* descriptor for enum scan, */
-/* resulting in version 6.1.12 */
+/* Delete configuration instance*/
+/* */
+/* CALLED BY */
+/* */
+/* USBX Components */
/* */
/**************************************************************************/
UINT _ux_host_stack_device_configuration_reset(UX_DEVICE *device)
@@ -87,16 +68,16 @@ UX_TRANSFER *transfer_request;
UX_ENDPOINT *control_endpoint;
UX_CONFIGURATION *current_configuration;
UINT status;
-
+
/* If trace is enabled, insert this event into the trace buffer. */
UX_TRACE_IN_LINE_INSERT(UX_TRACE_HOST_STACK_DEVICE_CONFIGURATION_SELECT, device, 0, 0, 0, UX_TRACE_HOST_STACK_EVENTS, 0, 0)
- /* A configuration is selected. Retrieve the pointer to the control endpoint
+ /* A configuration is selected. Retrieve the pointer to the control endpoint
and its transfer request. */
control_endpoint = &device -> ux_device_control_endpoint;
transfer_request = &control_endpoint -> ux_endpoint_transfer_request;
- /* Check for the state of the device . If the device is already configured,
+ /* Check for the state of the device . If the device is already configured,
we need to cancel the existing configuration before resetting it. */
if (device -> ux_device_state == UX_DEVICE_CONFIGURED)
{
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 3ef26125..1bb95ee5 100644
--- a/common/core/src/ux_host_stack_device_configuration_select.c
+++ b/common/core/src/ux_host_stack_device_configuration_select.c
@@ -1,18 +1,19 @@
/***************************************************************************
- * Copyright (c) 2024 Microsoft Corporation
- *
+ * Copyright (c) 2024 Microsoft Corporation
+ * Copyright (c) 2026-present Eclipse ThreadX contributors
+ *
* This program and the accompanying materials are made available under the
* terms of the MIT License which is available at
* https://opensource.org/licenses/MIT.
- *
+ *
* SPDX-License-Identifier: MIT
**************************************************************************/
/**************************************************************************/
/**************************************************************************/
-/** */
-/** USBX Component */
+/** */
+/** USBX Component */
/** */
/** Host Stack */
/** */
@@ -28,62 +29,45 @@
#include "ux_host_stack.h"
-/**************************************************************************/
-/* */
-/* FUNCTION RELEASE */
-/* */
-/* _ux_host_stack_device_configuration_select PORTABLE C */
+/**************************************************************************/
+/* */
+/* FUNCTION RELEASE */
+/* */
+/* _ux_host_stack_device_configuration_select PORTABLE C */
/* 6.1.10 */
/* AUTHOR */
/* */
/* Chaoqiong Xiao, Microsoft Corporation */
/* */
/* DESCRIPTION */
-/* */
+/* */
/* This function selects a specific configuration for a device. */
/* When this configuration is set to the device, by default all the */
-/* device interface and their associated alternate setting 0 is */
-/* activated on the device. If the device/interface class driver */
-/* wishes to change the setting of a particular interface, it needs */
-/* to issue a select interface setting function. */
-/* */
-/* INPUT */
-/* */
-/* configuration Pointer to configuration */
-/* */
-/* OUTPUT */
-/* */
-/* Completion Status */
-/* */
-/* CALLS */
-/* */
-/* _ux_host_stack_configuration_instance_create Create configuration */
-/* instance */
-/* _ux_host_stack_configuration_instance_delete Delete configuration */
-/* instance */
-/* _ux_host_stack_configuration_set Set configuration */
-/* */
-/* 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, */
-/* resulting in version 6.1 */
-/* 02-02-2021 Chaoqiong Xiao Modified comment(s), */
-/* used pointer for current */
-/* selected configuration, */
-/* resulting in version 6.1.4 */
-/* 01-31-2022 Chaoqiong Xiao Modified comment(s), */
-/* refine power usage check, */
-/* resulting in version 6.1.10 */
+/* device interface and their associated alternate setting 0 is */
+/* activated on the device. If the device/interface class driver */
+/* wishes to change the setting of a particular interface, it needs */
+/* to issue a select interface setting function. */
+/* */
+/* INPUT */
+/* */
+/* configuration Pointer to configuration */
+/* */
+/* OUTPUT */
+/* */
+/* Completion Status */
+/* */
+/* CALLS */
+/* */
+/* _ux_host_stack_configuration_instance_create Create configuration */
+/* instance */
+/* _ux_host_stack_configuration_instance_delete Delete configuration */
+/* instance */
+/* _ux_host_stack_configuration_set Set configuration */
+/* */
+/* CALLED BY */
+/* */
+/* Application */
+/* USBX Components */
/* */
/**************************************************************************/
UINT _ux_host_stack_device_configuration_select(UX_CONFIGURATION *configuration)
@@ -92,23 +76,23 @@ UINT _ux_host_stack_device_configuration_select(UX_CONFIGURATION *configuration
UX_DEVICE *device;
UX_CONFIGURATION *current_configuration;
UINT status;
-
+
/* Check for validity of the configuration handle. */
if (configuration -> ux_configuration_handle != (ULONG) (ALIGN_TYPE) configuration)
{
-
+
/* Error trap. */
_ux_system_error_handler(UX_SYSTEM_LEVEL_THREAD, UX_SYSTEM_CONTEXT_ENUMERATOR, UX_CONFIGURATION_HANDLE_UNKNOWN);
/* If trace is enabled, insert this event into the trace buffer. */
UX_TRACE_IN_LINE_INSERT(UX_TRACE_ERROR, UX_CONFIGURATION_HANDLE_UNKNOWN, configuration, 0, 0, UX_TRACE_ERRORS, 0, 0)
-
+
return(UX_CONFIGURATION_HANDLE_UNKNOWN);
}
- /* Get the device container for this configuration. */
+ /* Get the device container for this configuration. */
device = configuration -> ux_configuration_device;
-
+
/* If trace is enabled, insert this event into the trace buffer. */
UX_TRACE_IN_LINE_INSERT(UX_TRACE_HOST_STACK_DEVICE_CONFIGURATION_SELECT, device, configuration, 0, 0, UX_TRACE_HOST_STACK_EVENTS, 0, 0)
@@ -128,7 +112,7 @@ UINT status;
return(UX_OVER_CURRENT_CONDITION);
}
- /* Check for the state of the device . If the device is already configured,
+ /* Check for the state of the device . If the device is already configured,
we need to cancel the existing configuration before enabling this one. */
if (device -> ux_device_state == UX_DEVICE_CONFIGURED)
{
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 d530d029..ef77202f 100644
--- a/common/core/src/ux_host_stack_device_descriptor_read.c
+++ b/common/core/src/ux_host_stack_device_descriptor_read.c
@@ -1,18 +1,19 @@
/***************************************************************************
- * Copyright (c) 2024 Microsoft Corporation
- *
+ * Copyright (c) 2024 Microsoft Corporation
+ * Copyright (c) 2026-present Eclipse ThreadX contributors
+ *
* This program and the accompanying materials are made available under the
* terms of the MIT License which is available at
* https://opensource.org/licenses/MIT.
- *
+ *
* SPDX-License-Identifier: MIT
**************************************************************************/
/**************************************************************************/
/**************************************************************************/
-/** */
-/** USBX Component */
+/** */
+/** USBX Component */
/** */
/** Host Stack */
/** */
@@ -28,53 +29,38 @@
#include "ux_host_stack.h"
-/**************************************************************************/
-/* */
-/* FUNCTION RELEASE */
-/* */
-/* _ux_host_stack_device_descriptor_read PORTABLE C */
+/**************************************************************************/
+/* */
+/* FUNCTION RELEASE */
+/* */
+/* _ux_host_stack_device_descriptor_read PORTABLE C */
/* 6.1.10 */
/* AUTHOR */
/* */
/* Chaoqiong Xiao, Microsoft Corporation */
/* */
/* DESCRIPTION */
-/* */
-/* This function reads the device descriptor. */
-/* */
-/* INPUT */
-/* */
-/* device Pointer to device */
-/* */
-/* OUTPUT */
-/* */
-/* Completion Status */
-/* */
-/* CALLS */
-/* */
-/* _ux_host_stack_transfer_request Process transfer request */
-/* _ux_utility_descriptor_parse Parse descriptor */
-/* _ux_utility_memory_allocate Allocate memory block */
-/* _ux_utility_memory_free Free memory block */
-/* */
-/* CALLED BY */
-/* */
-/* USBX Components */
-/* */
-/* RELEASE HISTORY */
-/* */
-/* DATE NAME DESCRIPTION */
-/* */
-/* 05-19-2020 Chaoqiong Xiao Initial Version 6.0 */
-/* 09-30-2020 Chaoqiong Xiao Modified comment(s), */
-/* resulting in version 6.1 */
-/* 10-15-2021 Chaoqiong Xiao Modified comment(s), */
-/* added bMaxPacketSize0 check,*/
-/* resulting in version 6.1.9 */
-/* 01-31-2022 Chaoqiong Xiao Modified comment(s), */
-/* added standalone support, */
-/* added class code checking, */
-/* resulting in version 6.1.10 */
+/* */
+/* This function reads the device descriptor. */
+/* */
+/* INPUT */
+/* */
+/* device Pointer to device */
+/* */
+/* OUTPUT */
+/* */
+/* Completion Status */
+/* */
+/* CALLS */
+/* */
+/* _ux_host_stack_transfer_request Process transfer request */
+/* _ux_utility_descriptor_parse Parse descriptor */
+/* _ux_utility_memory_allocate Allocate memory block */
+/* _ux_utility_memory_free Free memory block */
+/* */
+/* CALLED BY */
+/* */
+/* USBX Components */
/* */
/**************************************************************************/
UINT _ux_host_stack_device_descriptor_read(UX_DEVICE *device)
@@ -97,7 +83,7 @@ UX_ENDPOINT *control_endpoint;
if (descriptor == UX_NULL)
return(UX_MEMORY_INSUFFICIENT);
- /* Create a transfer_request for the GET_DESCRIPTOR request. The first transfer_request asks
+ /* Create a transfer_request for the GET_DESCRIPTOR request. The first transfer_request asks
for the first 8 bytes only. This way we will know the real MaxPacketSize
value for the control endpoint. */
transfer_request -> ux_transfer_request_data_pointer = descriptor;
@@ -131,7 +117,7 @@ UX_ENDPOINT *control_endpoint;
_ux_utility_memory_free(descriptor);
/* Return completion status. */
- return(status);
+ return(status);
}
/* Validate the bMaxPacketSize0. */
@@ -200,7 +186,7 @@ UX_ENDPOINT *control_endpoint;
/* The device descriptor does not contain the right amount of data. Maybe corruption. */
status = UX_DESCRIPTOR_CORRUPTED;
}
-
+
/* Free all used resources. */
_ux_utility_memory_free(descriptor);
diff --git a/common/core/src/ux_host_stack_device_get.c b/common/core/src/ux_host_stack_device_get.c
index 2443ceba..ff6b4542 100644
--- a/common/core/src/ux_host_stack_device_get.c
+++ b/common/core/src/ux_host_stack_device_get.c
@@ -1,10 +1,11 @@
/***************************************************************************
- * Copyright (c) 2024 Microsoft Corporation
- *
+ * Copyright (c) 2024 Microsoft Corporation
+ * Copyright (c) 2026-present Eclipse ThreadX contributors
+ *
* This program and the accompanying materials are made available under the
* terms of the MIT License which is available at
* https://opensource.org/licenses/MIT.
- *
+ *
* SPDX-License-Identifier: MIT
**************************************************************************/
@@ -63,16 +64,6 @@
/* 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, */
-/* resulting in version 6.1 */
-/* */
/**************************************************************************/
UINT _ux_host_stack_device_get(ULONG device_index, UX_DEVICE **device)
{
@@ -180,12 +171,6 @@ ULONG current_device_index;
/* */
/* Application */
/* */
-/* RELEASE HISTORY */
-/* */
-/* DATE NAME DESCRIPTION */
-/* */
-/* 10-31-2023 Chaoqiong Xiao Initial Version 6.3.0 */
-/* */
/**************************************************************************/
UINT _uxe_host_stack_device_get(ULONG device_index, UX_DEVICE **device)
{
diff --git a/common/core/src/ux_host_stack_device_remove.c b/common/core/src/ux_host_stack_device_remove.c
index 67d024ff..65f29180 100644
--- a/common/core/src/ux_host_stack_device_remove.c
+++ b/common/core/src/ux_host_stack_device_remove.c
@@ -1,10 +1,11 @@
/***************************************************************************
- * Copyright (c) 2024 Microsoft Corporation
- *
+ * Copyright (c) 2024 Microsoft Corporation
+ * Copyright (c) 2026-present Eclipse ThreadX contributors
+ *
* This program and the accompanying materials are made available under the
* terms of the MIT License which is available at
* https://opensource.org/licenses/MIT.
- *
+ *
* SPDX-License-Identifier: MIT
**************************************************************************/
@@ -61,29 +62,6 @@
/* */
/* 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 */
-/* 02-02-2021 Chaoqiong Xiao Modified comment(s), */
-/* used pointer for current */
-/* selected configuration, */
-/* added notification for */
-/* device disconnection, */
-/* resulting in version 6.1.4 */
-/* 01-31-2022 Chaoqiong Xiao Modified comment(s), */
-/* added standalone support, */
-/* resulting in version 6.1.10 */
-/* 07-29-2022 Chaoqiong Xiao Modified comment(s), */
-/* fixed parameter/variable */
-/* names conflict C++ keyword, */
-/* resulting in version 6.1.12 */
-/* */
/**************************************************************************/
UINT _ux_host_stack_device_remove(UX_HCD *hcd, UX_DEVICE *parent, UINT port_index)
{
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 d58b0c7b..f9f9c665 100644
--- a/common/core/src/ux_host_stack_device_resources_free.c
+++ b/common/core/src/ux_host_stack_device_resources_free.c
@@ -1,18 +1,19 @@
/***************************************************************************
- * Copyright (c) 2024 Microsoft Corporation
- *
+ * Copyright (c) 2024 Microsoft Corporation
+ * Copyright (c) 2026-present Eclipse ThreadX contributors
+ *
* This program and the accompanying materials are made available under the
* terms of the MIT License which is available at
* https://opensource.org/licenses/MIT.
- *
+ *
* SPDX-License-Identifier: MIT
**************************************************************************/
/**************************************************************************/
/**************************************************************************/
-/** */
-/** USBX Component */
+/** */
+/** USBX Component */
/** */
/** Host Stack */
/** */
@@ -28,65 +29,44 @@
#include "ux_host_stack.h"
-/**************************************************************************/
-/* */
-/* FUNCTION RELEASE */
-/* */
-/* _ux_host_stack_device_resources_free PORTABLE C */
+/**************************************************************************/
+/* */
+/* FUNCTION RELEASE */
+/* */
+/* _ux_host_stack_device_resources_free PORTABLE C */
/* 6.1.12 */
/* AUTHOR */
/* */
/* Chaoqiong Xiao, Microsoft Corporation */
/* */
/* DESCRIPTION */
-/* */
-/* This function will free all the device resources allocated. */
-/* */
-/* INPUT */
-/* */
-/* device Device pointer */
-/* */
-/* OUTPUT */
-/* */
-/* Completion Status */
-/* */
-/* CALLS */
-/* */
+/* */
+/* This function will free all the device resources allocated. */
+/* */
+/* INPUT */
+/* */
+/* device Device pointer */
+/* */
+/* OUTPUT */
+/* */
+/* Completion Status */
+/* */
+/* CALLS */
+/* */
/* _ux_host_stack_endpoint_transfer_abort */
/* Abort transfer */
/* _ux_host_stack_endpoint_instance_delete */
-/* Delete endpoint instance */
-/* _ux_utility_memory_free Free memory block */
-/* _ux_utility_memory_set Set memory with a value */
-/* _ux_utility_semaphore_delete Semaphore delete */
+/* Delete endpoint instance */
+/* _ux_utility_memory_free Free memory block */
+/* _ux_utility_memory_set Set memory with a value */
+/* _ux_utility_semaphore_delete Semaphore delete */
/* _ux_utility_thread_schedule_other Sleep thread to let others */
/* run */
-/* (ux_hcd_entry_function) HCD entry function */
-/* */
-/* 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, verified */
-/* memset and memcpy cases, */
-/* resulting in version 6.1 */
-/* 01-31-2022 Chaoqiong Xiao Modified comment(s), */
-/* added standalone support, */
-/* resulting in version 6.1.10 */
-/* 07-29-2022 Chaoqiong Xiao Modified comment(s), */
-/* fixed parameter/variable */
-/* names conflict C++ keyword, */
-/* fixed standalone enum free, */
-/* freed shared device config */
-/* descriptor for enum scan, */
-/* resulting in version 6.1.12 */
+/* (ux_hcd_entry_function) HCD entry function */
+/* */
+/* CALLED BY */
+/* */
+/* USBX Components */
/* */
/**************************************************************************/
UINT _ux_host_stack_device_resources_free(UX_DEVICE *device)
@@ -152,7 +132,7 @@ UX_DEVICE *enum_next;
/* Parse all the configurations, remove all resources for the possible configuration. */
while (configuration != UX_NULL)
{
-
+
/* We have the correct configuration, search the interface(s). */
interface_ptr = configuration -> ux_configuration_first_interface;
@@ -164,10 +144,10 @@ UX_DEVICE *enum_next;
if (interface_ptr -> ux_interface_descriptor.bAlternateSetting == 0)
current_alternate_setting = interface_ptr -> ux_interface_current_alternate_setting;
- /* If this is the selected interface, we need to free all the endpoints
+ /* If this is the selected interface, we need to free all the endpoints
attached to the alternate setting for this interface. */
endpoint = interface_ptr -> ux_interface_first_endpoint;
-
+
/* Parse all the endpoints. */
while (endpoint != UX_NULL)
{
@@ -181,20 +161,20 @@ UX_DEVICE *enum_next;
}
/* Memorize the endpoint container address. */
- container = (VOID *) endpoint;
-
- /* Get the next endpoint. */
+ container = (VOID *) endpoint;
+
+ /* Get the next endpoint. */
endpoint = endpoint -> ux_endpoint_next_endpoint;
-
+
/* Delete the endpoint container. */
_ux_utility_memory_free(container);
}
-
-
+
+
/* Memorize the interface container address. */
- container = (VOID *) interface_ptr;
-
- /* Get the next interface. */
+ container = (VOID *) interface_ptr;
+
+ /* Get the next interface. */
interface_ptr = interface_ptr -> ux_interface_next_interface;
/* Delete the interface container. */
@@ -205,11 +185,11 @@ UX_DEVICE *enum_next;
container = (VOID *) configuration;
/* Move to the next configuration in the list. */
- configuration = configuration -> ux_configuration_next_configuration;
+ configuration = configuration -> ux_configuration_next_configuration;
/* Free the configuration. */
_ux_utility_memory_free(container);
- }
+ }
/* If there was a copy of packed descriptor, free it. */
if (device -> ux_device_packed_configuration)
@@ -229,11 +209,11 @@ UX_DEVICE *enum_next;
/* There may be pending transactions on the control endpoint. They need to be aborted. */
_ux_host_stack_endpoint_transfer_abort(&device -> ux_device_control_endpoint);
-
+
/* The enumeration thread needs to sleep a while to allow the application or the class that may be using
the control endpoint to exit properly. */
- _ux_host_thread_schedule_other(UX_THREAD_PRIORITY_ENUM);
-
+ _ux_host_thread_schedule_other(UX_THREAD_PRIORITY_ENUM);
+
/* The control endpoint should be destroyed at the HCD level. */
hcd -> ux_hcd_entry_function(hcd, UX_HCD_DESTROY_ENDPOINT, (VOID *) &device -> ux_device_control_endpoint);
}
@@ -243,17 +223,17 @@ UX_DEVICE *enum_next;
#if UX_MAX_DEVICES > 1
/* Check if the device had an assigned address. */
- if (device -> ux_device_address != 0)
+ if (device -> ux_device_address != 0)
{
/* The USB address of this device can now be returned to the pool
We need the HCD pointer for this operation. */
/* Calculate in which byte index the device address belongs. */
- device_address_byte_index = (UINT) (device -> ux_device_address-1)/8;
+ device_address_byte_index = (UINT) (device -> ux_device_address-1)/8;
/* Now calculate the amount left in the byte index in bit. */
- device_address_bit_index = (UINT) (device -> ux_device_address-1)%8;
+ device_address_bit_index = (UINT) (device -> ux_device_address-1)%8;
/* Build the mask for the address. */
device_address_byte = (UCHAR)(1 << device_address_bit_index);
diff --git a/common/core/src/ux_host_stack_device_string_get.c b/common/core/src/ux_host_stack_device_string_get.c
index 6c6d1e23..2a48ba89 100644
--- a/common/core/src/ux_host_stack_device_string_get.c
+++ b/common/core/src/ux_host_stack_device_string_get.c
@@ -1,10 +1,11 @@
/***************************************************************************
- * Copyright (c) 2024 Microsoft Corporation
- *
+ * Copyright (c) 2024 Microsoft Corporation
+ * Copyright (c) 2026-present Eclipse ThreadX contributors
+ *
* This program and the accompanying materials are made available under the
* terms of the MIT License which is available at
* https://opensource.org/licenses/MIT.
- *
+ *
* SPDX-License-Identifier: MIT
**************************************************************************/
@@ -66,18 +67,6 @@
/* */
/* Application */
/* */
-/* RELEASE HISTORY */
-/* */
-/* DATE NAME DESCRIPTION */
-/* */
-/* 02-02-2021 Chaoqiong Xiao Initial Version 6.1.4 */
-/* 06-02-2021 Chaoqiong Xiao Modified comment(s), and */
-/* removed unnecessary header, */
-/* resulting in version 6.1.7 */
-/* 01-31-2022 Chaoqiong Xiao Modified comment(s), */
-/* added standalone support, */
-/* resulting in version 6.1.10 */
-/* */
/**************************************************************************/
UINT _ux_host_stack_device_string_get(UX_DEVICE *device, UCHAR *descriptor_buffer, ULONG length, ULONG language_id, ULONG string_index)
{
@@ -92,7 +81,7 @@ UINT status;
/* Do a sanity check on the device handle. */
if (device -> ux_device_handle != (ULONG) (ALIGN_TYPE) device)
{
-
+
/* Error trap. */
_ux_system_error_handler(UX_SYSTEM_LEVEL_THREAD, UX_SYSTEM_CONTEXT_ENUMERATOR, UX_DEVICE_HANDLE_UNKNOWN);
@@ -185,12 +174,6 @@ UINT status;
/* */
/* Application */
/* */
-/* RELEASE HISTORY */
-/* */
-/* DATE NAME DESCRIPTION */
-/* */
-/* 10-31-2023 Chaoqiong Xiao Initial Version 6.3.0 */
-/* */
/**************************************************************************/
UINT _uxe_host_stack_device_string_get(UX_DEVICE *device, UCHAR *descriptor_buffer, ULONG length, ULONG language_id, ULONG string_index)
{
diff --git a/common/core/src/ux_host_stack_endpoint_instance_create.c b/common/core/src/ux_host_stack_endpoint_instance_create.c
index 4f02c850..4a05d692 100644
--- a/common/core/src/ux_host_stack_endpoint_instance_create.c
+++ b/common/core/src/ux_host_stack_endpoint_instance_create.c
@@ -1,18 +1,19 @@
/***************************************************************************
- * Copyright (c) 2024 Microsoft Corporation
- *
+ * Copyright (c) 2024 Microsoft Corporation
+ * Copyright (c) 2026-present Eclipse ThreadX contributors
+ *
* This program and the accompanying materials are made available under the
* terms of the MIT License which is available at
* https://opensource.org/licenses/MIT.
- *
+ *
* SPDX-License-Identifier: MIT
**************************************************************************/
/**************************************************************************/
/**************************************************************************/
-/** */
-/** USBX Component */
+/** */
+/** USBX Component */
/** */
/** Host Stack */
/** */
@@ -28,58 +29,40 @@
#include "ux_host_stack.h"
-/**************************************************************************/
-/* */
-/* FUNCTION RELEASE */
-/* */
-/* _ux_host_stack_endpoint_instance_create PORTABLE C */
+/**************************************************************************/
+/* */
+/* FUNCTION RELEASE */
+/* */
+/* _ux_host_stack_endpoint_instance_create PORTABLE C */
/* 6.1.10 */
/* AUTHOR */
/* */
/* Chaoqiong Xiao, Microsoft Corporation */
/* */
/* DESCRIPTION */
-/* */
+/* */
/* This function will create an endpoint instance. The HCD layer is */
/* invoked to create each endpoint and the bandwidth claimed by each */
-/* endpoint is allocated. */
-/* */
-/* INPUT */
-/* */
-/* endpoint Endpoint to delete */
-/* */
-/* OUTPUT */
-/* */
-/* Completion Status */
-/* */
-/* CALLS */
-/* */
-/* _ux_host_stack_bandwidth_check Check bandwidth */
-/* _ux_host_stack_bandwidth_claim Claim bandwidth */
-/* _ux_utility_semaphore_create Semaphore create */
-/* (ux_hcd_entry_function) HCD entry function */
-/* */
-/* 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 */
-/* 06-02-2021 Chaoqiong Xiao Modified comment(s), */
-/* fixed trace enabled error, */
-/* filled default endpoint */
-/* request endpoint pointer, */
-/* resulting in version 6.1.7 */
-/* 01-31-2022 Chaoqiong Xiao Modified comment(s), */
-/* added standalone support, */
-/* resulting in version 6.1.10 */
+/* endpoint is allocated. */
+/* */
+/* INPUT */
+/* */
+/* endpoint Endpoint to delete */
+/* */
+/* OUTPUT */
+/* */
+/* Completion Status */
+/* */
+/* CALLS */
+/* */
+/* _ux_host_stack_bandwidth_check Check bandwidth */
+/* _ux_host_stack_bandwidth_claim Claim bandwidth */
+/* _ux_utility_semaphore_create Semaphore create */
+/* (ux_hcd_entry_function) HCD entry function */
+/* */
+/* CALLED BY */
+/* */
+/* USBX Components */
/* */
/**************************************************************************/
UINT _ux_host_stack_endpoint_instance_create(UX_ENDPOINT *endpoint)
@@ -96,7 +79,7 @@ UCHAR endpoint_type;
/* If trace is enabled, insert this event into the trace buffer. */
UX_TRACE_IN_LINE_INSERT(UX_TRACE_HOST_STACK_ENDPOINT_INSTANCE_CREATE, endpoint -> ux_endpoint_device, endpoint, 0, 0, UX_TRACE_HOST_STACK_EVENTS, 0, 0)
-
+
/* If the endpoint needs guaranteed bandwidth, check if we have enough */
endpoint_type = (endpoint -> ux_endpoint_descriptor.bmAttributes) & UX_MASK_ENDPOINT_TYPE;
switch (endpoint_type)
@@ -104,7 +87,7 @@ UCHAR endpoint_type;
case UX_CONTROL_ENDPOINT:
case UX_BULK_ENDPOINT:
-
+
break;
default:
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 32d1165f..56476898 100644
--- a/common/core/src/ux_host_stack_endpoint_instance_delete.c
+++ b/common/core/src/ux_host_stack_endpoint_instance_delete.c
@@ -1,18 +1,19 @@
/***************************************************************************
- * Copyright (c) 2024 Microsoft Corporation
- *
+ * Copyright (c) 2024 Microsoft Corporation
+ * Copyright (c) 2026-present Eclipse ThreadX contributors
+ *
* This program and the accompanying materials are made available under the
* terms of the MIT License which is available at
* https://opensource.org/licenses/MIT.
- *
+ *
* SPDX-License-Identifier: MIT
**************************************************************************/
/**************************************************************************/
/**************************************************************************/
-/** */
-/** USBX Component */
+/** */
+/** USBX Component */
/** */
/** Host Stack */
/** */
@@ -28,55 +29,39 @@
#include "ux_host_stack.h"
-/**************************************************************************/
-/* */
-/* FUNCTION RELEASE */
-/* */
-/* _ux_host_stack_endpoint_instance_delete PORTABLE C */
+/**************************************************************************/
+/* */
+/* FUNCTION RELEASE */
+/* */
+/* _ux_host_stack_endpoint_instance_delete PORTABLE C */
/* 6.1.10 */
/* AUTHOR */
/* */
/* Chaoqiong Xiao, Microsoft Corporation */
/* */
/* DESCRIPTION */
-/* */
-/* This function will delete an endpoint instance. It does not delete */
-/* the endpoint container but it removes the HCD endpoint and reclaims */
-/* the bandwidth. */
-/* */
-/* INPUT */
-/* */
-/* endpoint Endpoint to delete */
-/* */
-/* OUTPUT */
-/* */
-/* None */
-/* */
-/* CALLS */
-/* */
-/* _ux_host_stack_bandwidth_release Release bandwidth */
-/* _ux_utility_semaphore_delete Semaphore delete */
-/* (ux_hcd_entry_function) HCD entry function */
-/* */
-/* 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 */
-/* 06-02-2021 Chaoqiong Xiao Modified comment(s), */
-/* fixed trace enabled error, */
-/* resulting in version 6.1.7 */
-/* 01-31-2022 Chaoqiong Xiao Modified comment(s), */
-/* added standalone support, */
-/* resulting in version 6.1.10 */
+/* */
+/* This function will delete an endpoint instance. It does not delete */
+/* the endpoint container but it removes the HCD endpoint and reclaims */
+/* the bandwidth. */
+/* */
+/* INPUT */
+/* */
+/* endpoint Endpoint to delete */
+/* */
+/* OUTPUT */
+/* */
+/* None */
+/* */
+/* CALLS */
+/* */
+/* _ux_host_stack_bandwidth_release Release bandwidth */
+/* _ux_utility_semaphore_delete Semaphore delete */
+/* (ux_hcd_entry_function) HCD entry function */
+/* */
+/* CALLED BY */
+/* */
+/* USBX Components */
/* */
/**************************************************************************/
VOID _ux_host_stack_endpoint_instance_delete(UX_ENDPOINT *endpoint)
@@ -84,20 +69,20 @@ VOID _ux_host_stack_endpoint_instance_delete(UX_ENDPOINT *endpoint)
UX_HCD *hcd;
-
+
/* Obtain the HCD for this endpoint. */
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, endpoint -> ux_endpoint_device, endpoint, 0, 0, UX_TRACE_HOST_STACK_EVENTS, 0, 0)
-
+
/* Ensure the endpoint had its physical ED allocated. */
if (endpoint -> ux_endpoint_ed != UX_NULL)
- {
+ {
/* Destroy this endpoint. */
hcd -> ux_hcd_entry_function(hcd, UX_HCD_DESTROY_ENDPOINT, (VOID *) endpoint);
-
+
/* Free the semaphore previously attached to the transfer_request of this endpoint. */
_ux_host_semaphore_delete(&endpoint -> ux_endpoint_transfer_request.ux_transfer_request_semaphore);
}
@@ -121,6 +106,6 @@ UX_HCD *hcd;
UX_TRACE_OBJECT_UNREGISTER(endpoint);
/* Return to caller. */
- return;
+ return;
}
diff --git a/common/core/src/ux_host_stack_endpoint_reset.c b/common/core/src/ux_host_stack_endpoint_reset.c
index 639d1db7..b6184f2d 100644
--- a/common/core/src/ux_host_stack_endpoint_reset.c
+++ b/common/core/src/ux_host_stack_endpoint_reset.c
@@ -1,18 +1,19 @@
/***************************************************************************
- * Copyright (c) 2024 Microsoft Corporation
- *
+ * Copyright (c) 2024 Microsoft Corporation
+ * Copyright (c) 2026-present Eclipse ThreadX contributors
+ *
* This program and the accompanying materials are made available under the
* terms of the MIT License which is available at
* https://opensource.org/licenses/MIT.
- *
+ *
* SPDX-License-Identifier: MIT
**************************************************************************/
/**************************************************************************/
/**************************************************************************/
-/** */
-/** USBX Component */
+/** */
+/** USBX Component */
/** */
/** Host Stack */
/** */
@@ -28,47 +29,37 @@
#include "ux_host_stack.h"
-/**************************************************************************/
-/* */
-/* FUNCTION RELEASE */
-/* */
-/* _ux_host_stack_endpoint_reset PORTABLE C */
+/**************************************************************************/
+/* */
+/* FUNCTION RELEASE */
+/* */
+/* _ux_host_stack_endpoint_reset PORTABLE C */
/* 6.1 */
/* AUTHOR */
/* */
/* Chaoqiong Xiao, Microsoft Corporation */
/* */
/* DESCRIPTION */
-/* */
-/* This function resets an endpoint after a stall or other error */
-/* condition. */
-/* */
-/* INPUT */
-/* */
-/* endpoint Endpoint to abort transfer */
-/* */
-/* OUTPUT */
-/* */
-/* Completion Status */
-/* */
-/* CALLS */
-/* */
-/* _ux_host_stack_transfer_request Send transfer request */
-/* (ux_hcd_entry_function) HCD entry function */
-/* */
-/* 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 */
+/* */
+/* This function resets an endpoint after a stall or other error */
+/* condition. */
+/* */
+/* INPUT */
+/* */
+/* endpoint Endpoint to abort transfer */
+/* */
+/* OUTPUT */
+/* */
+/* Completion Status */
+/* */
+/* CALLS */
+/* */
+/* _ux_host_stack_transfer_request Send transfer request */
+/* (ux_hcd_entry_function) HCD entry function */
+/* */
+/* CALLED BY */
+/* */
+/* USBX Components */
/* */
/**************************************************************************/
UINT _ux_host_stack_endpoint_reset(UX_ENDPOINT *endpoint)
@@ -76,7 +67,7 @@ UINT _ux_host_stack_endpoint_reset(UX_ENDPOINT *endpoint)
UX_ENDPOINT *control_endpoint;
UX_TRANSFER *transfer_request;
-UX_DEVICE *device;
+UX_DEVICE *device;
UX_HCD *hcd;
UINT status;
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 ac226d96..24228a90 100644
--- a/common/core/src/ux_host_stack_endpoint_transfer_abort.c
+++ b/common/core/src/ux_host_stack_endpoint_transfer_abort.c
@@ -1,18 +1,19 @@
/***************************************************************************
- * Copyright (c) 2024 Microsoft Corporation
- *
+ * Copyright (c) 2024 Microsoft Corporation
+ * Copyright (c) 2026-present Eclipse ThreadX contributors
+ *
* This program and the accompanying materials are made available under the
* terms of the MIT License which is available at
* https://opensource.org/licenses/MIT.
- *
+ *
* SPDX-License-Identifier: MIT
**************************************************************************/
/**************************************************************************/
/**************************************************************************/
-/** */
-/** USBX Component */
+/** */
+/** USBX Component */
/** */
/** Host Stack */
/** */
@@ -28,62 +29,54 @@
#include "ux_host_stack.h"
-/**************************************************************************/
-/* */
-/* FUNCTION RELEASE */
-/* */
-/* _ux_host_stack_endpoint_transfer_abort PORTABLE C */
+/**************************************************************************/
+/* */
+/* FUNCTION RELEASE */
+/* */
+/* _ux_host_stack_endpoint_transfer_abort PORTABLE C */
/* 6.1 */
/* AUTHOR */
/* */
/* Chaoqiong Xiao, Microsoft Corporation */
/* */
/* DESCRIPTION */
-/* */
-/* This function cancel all the transfer_requests attached to an */
-/* endpoint. The endpoint is not reset and its toggle state is left */
+/* */
+/* This function cancel all the transfer_requests attached to an */
+/* endpoint. The endpoint is not reset and its toggle state is left */
/* the same. */
/* */
-/* In this version of USBX, there can only be one transfer request */
-/* pending for an endpoint. It is not known at this stage if having */
-/* multiple transfer request is a benefit for USBX but this function */
+/* In this version of USBX, there can only be one transfer request */
+/* pending for an endpoint. It is not known at this stage if having */
+/* multiple transfer request is a benefit for USBX but this function */
/* may be changed one day to add such functionality. */
-/* */
-/* INPUT */
-/* */
-/* endpoint Endpoint to abort transfer */
-/* */
-/* OUTPUT */
-/* */
-/* Completion Status */
-/* */
-/* CALLS */
-/* */
-/* _ux_host_stack_transfer_request_abort Transfer request abort */
-/* */
-/* 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), */
-/* resulting in version 6.1 */
+/* */
+/* INPUT */
+/* */
+/* endpoint Endpoint to abort transfer */
+/* */
+/* OUTPUT */
+/* */
+/* Completion Status */
+/* */
+/* CALLS */
+/* */
+/* _ux_host_stack_transfer_request_abort Transfer request abort */
+/* */
+/* CALLED BY */
+/* */
+/* Application */
+/* USBX Components */
/* */
/**************************************************************************/
UINT _ux_host_stack_endpoint_transfer_abort(UX_ENDPOINT *endpoint)
{
UINT status;
-
+
/* If trace is enabled, insert this event into the trace buffer. */
UX_TRACE_IN_LINE_INSERT(UX_TRACE_HOST_STACK_ENDPOINT_TRANSFER_ABORT, endpoint, 0, 0, 0, UX_TRACE_HOST_STACK_EVENTS, 0, 0)
- /* Since we only have one transfer_request per endpoint, use the regular
+ /* Since we only have one transfer_request per endpoint, use the regular
abort transfer request function. */
status = _ux_host_stack_transfer_request_abort(&endpoint -> ux_endpoint_transfer_request);
@@ -124,12 +117,6 @@ UINT status;
/* */
/* Application */
/* */
-/* RELEASE HISTORY */
-/* */
-/* DATE NAME DESCRIPTION */
-/* */
-/* 10-31-2023 Chaoqiong Xiao Initial Version 6.3.0 */
-/* */
/**************************************************************************/
UINT _uxe_host_stack_endpoint_transfer_abort(UX_ENDPOINT *endpoint)
{
@@ -137,7 +124,7 @@ UINT _uxe_host_stack_endpoint_transfer_abort(UX_ENDPOINT *endpoint)
/* Sanity check. */
if (endpoint == UX_NULL)
return(UX_INVALID_PARAMETER);
-
+
/* Invoke transfer abort function. */
return(_ux_host_stack_endpoint_transfer_abort(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 770d2d09..a1a0ce39 100644
--- a/common/core/src/ux_host_stack_enum_thread_entry.c
+++ b/common/core/src/ux_host_stack_enum_thread_entry.c
@@ -1,18 +1,19 @@
/***************************************************************************
- * Copyright (c) 2024 Microsoft Corporation
- *
+ * Copyright (c) 2024 Microsoft Corporation
+ * Copyright (c) 2026-present Eclipse ThreadX contributors
+ *
* This program and the accompanying materials are made available under the
* terms of the MIT License which is available at
* https://opensource.org/licenses/MIT.
- *
+ *
* SPDX-License-Identifier: MIT
**************************************************************************/
/**************************************************************************/
/**************************************************************************/
-/** */
-/** USBX Component */
+/** */
+/** USBX Component */
/** */
/** Host Stack */
/** */
@@ -28,64 +29,51 @@
#include "ux_host_stack.h"
-/**************************************************************************/
-/* */
-/* FUNCTION RELEASE */
-/* */
-/* _ux_host_stack_enum_thread_entry PORTABLE C */
+/**************************************************************************/
+/* */
+/* FUNCTION RELEASE */
+/* */
+/* _ux_host_stack_enum_thread_entry PORTABLE C */
/* 6.1.10 */
/* AUTHOR */
/* */
/* Chaoqiong Xiao, Microsoft Corporation */
/* */
/* DESCRIPTION */
-/* */
+/* */
/* This file contains the enum thread for USBX. It is in charge of */
-/* the topology changes either from device insertion\extraction on */
+/* the topology changes either from device insertion\extraction on */
/* the root hub or on a regular hub. */
/* */
/* This thread ensures we never have more that 2 instances trying to */
-/* perform a change to the topology (mostly enumeration) for fear that */
+/* perform a change to the topology (mostly enumeration) for fear that */
/* more than one device could answer to address 0. */
/* */
-/* This function is the entry point of the topology thread. It waits */
+/* This function is the entry point of the topology thread. It waits */
/* until one of the HCDs or a hub sets the semaphore to indicate */
/* there has been a change in the USB topology which could be either */
-/* a insertion or extraction or eventually a hub downstream port */
+/* a insertion or extraction or eventually a hub downstream port */
/* signal. */
/* */
/* This is for RTOS mode. */
-/* */
-/* INPUT */
-/* */
-/* input Not used input */
-/* */
-/* OUTPUT */
-/* */
-/* None */
-/* */
-/* CALLS */
-/* */
-/* _ux_host_stack_rh_change_process Root hub processing */
-/* _ux_utility_semaphore_get Get signal semaphore */
-/* (ux_system_host_enum_hub_function) HUB enum processing function */
-/* */
-/* CALLED BY */
-/* */
-/* ThreadX */
-/* */
-/* 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 */
-/* 01-31-2022 Chaoqiong Xiao Modified comment(s), */
-/* refined macros names, */
-/* resulting in version 6.1.10 */
+/* */
+/* INPUT */
+/* */
+/* input Not used input */
+/* */
+/* OUTPUT */
+/* */
+/* None */
+/* */
+/* CALLS */
+/* */
+/* _ux_host_stack_rh_change_process Root hub processing */
+/* _ux_utility_semaphore_get Get signal semaphore */
+/* (ux_system_host_enum_hub_function) HUB enum processing function */
+/* */
+/* CALLED BY */
+/* */
+/* ThreadX */
/* */
/**************************************************************************/
VOID _ux_host_stack_enum_thread_entry(ULONG input)
@@ -93,9 +81,9 @@ VOID _ux_host_stack_enum_thread_entry(ULONG input)
UX_PARAMETER_NOT_USED(input);
- /* Loop forever waiting for changes signaled through the semaphore. */
+ /* Loop forever waiting for changes signaled through the semaphore. */
while (1)
- {
+ {
/* Wait for the semaphore to be put by the root hub or a regular hub. */
_ux_host_semaphore_get_norc(&_ux_system_host -> ux_system_host_enum_semaphore, UX_WAIT_FOREVER);
diff --git a/common/core/src/ux_host_stack_hcd_register.c b/common/core/src/ux_host_stack_hcd_register.c
index cc31541e..fbeaf8ac 100644
--- a/common/core/src/ux_host_stack_hcd_register.c
+++ b/common/core/src/ux_host_stack_hcd_register.c
@@ -1,10 +1,11 @@
/***************************************************************************
- * Copyright (c) 2024 Microsoft Corporation
- *
+ * Copyright (c) 2024 Microsoft Corporation
+ * Copyright (c) 2026-present Eclipse ThreadX contributors
+ *
* This program and the accompanying materials are made available under the
* terms of the MIT License which is available at
* https://opensource.org/licenses/MIT.
- *
+ *
* SPDX-License-Identifier: MIT
**************************************************************************/
@@ -70,17 +71,6 @@
/* */
/* 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,
UINT (*hcd_init_function)(struct UX_HCD_STRUCT *), ULONG hcd_param1, ULONG hcd_param2)
@@ -188,12 +178,6 @@ ULONG hcd_index;
/* */
/* Application */
/* */
-/* RELEASE HISTORY */
-/* */
-/* DATE NAME DESCRIPTION */
-/* */
-/* 10-31-2023 Chaoqiong Xiao Initial Version 6.3.0 */
-/* */
/**************************************************************************/
UINT _uxe_host_stack_hcd_register(UCHAR *hcd_name,
UINT (*hcd_init_function)(struct UX_HCD_STRUCT *), ULONG hcd_param1, ULONG hcd_param2)
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 9aa6bcdb..06cdef54 100644
--- a/common/core/src/ux_host_stack_hcd_thread_entry.c
+++ b/common/core/src/ux_host_stack_hcd_thread_entry.c
@@ -1,18 +1,19 @@
/***************************************************************************
- * Copyright (c) 2024 Microsoft Corporation
- *
+ * Copyright (c) 2024 Microsoft Corporation
+ * Copyright (c) 2026-present Eclipse ThreadX contributors
+ *
* This program and the accompanying materials are made available under the
* terms of the MIT License which is available at
* https://opensource.org/licenses/MIT.
- *
+ *
* SPDX-License-Identifier: MIT
**************************************************************************/
/**************************************************************************/
/**************************************************************************/
-/** */
-/** USBX Component */
+/** */
+/** USBX Component */
/** */
/** Host Stack */
/** */
@@ -28,57 +29,41 @@
#include "ux_host_stack.h"
-/**************************************************************************/
-/* */
-/* FUNCTION RELEASE */
-/* */
-/* _ux_host_stack_hcd_thread_entry PORTABLE C */
+/**************************************************************************/
+/* */
+/* FUNCTION RELEASE */
+/* */
+/* _ux_host_stack_hcd_thread_entry PORTABLE C */
/* 6.1.10 */
/* AUTHOR */
/* */
/* Chaoqiong Xiao, Microsoft Corporation */
/* */
/* DESCRIPTION */
-/* */
+/* */
/* This function is the entry point of the host controller thread. */
-/* The HCD thread is initialized at the system level and the thread */
-/* entry routine is invoked right away. This thread suspends until */
+/* The HCD thread is initialized at the system level and the thread */
+/* entry routine is invoked right away. This thread suspends until */
/* one of the HCD resumes it due to HCD activities. */
/* */
/* It's for RTOS mode. */
-/* */
-/* INPUT */
-/* */
-/* input Not used input */
-/* */
-/* OUTPUT */
-/* */
-/* None */
-/* */
-/* CALLS */
-/* */
-/* _ux_utility_semaphore_get Get signal semaphore */
-/* (ux_hcd_entry_function) HCD's entry function */
-/* */
-/* CALLED BY */
-/* */
-/* ThreadX */
-/* */
-/* 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 */
-/* 11-09-2020 Chaoqiong Xiao Modified comment(s), */
-/* fixed registered HCD scan, */
-/* resulting in version 6.1.2 */
-/* 01-31-2022 Chaoqiong Xiao Modified comment(s), */
-/* refined macros names, */
-/* resulting in version 6.1.10 */
+/* */
+/* INPUT */
+/* */
+/* input Not used input */
+/* */
+/* OUTPUT */
+/* */
+/* None */
+/* */
+/* CALLS */
+/* */
+/* _ux_utility_semaphore_get Get signal semaphore */
+/* (ux_hcd_entry_function) HCD's entry function */
+/* */
+/* CALLED BY */
+/* */
+/* ThreadX */
/* */
/**************************************************************************/
VOID _ux_host_stack_hcd_thread_entry(ULONG input)
@@ -87,21 +72,21 @@ VOID _ux_host_stack_hcd_thread_entry(ULONG input)
UINT hcd_index;
UX_HCD *hcd;
UX_INTERRUPT_SAVE_AREA
-
+
UX_PARAMETER_NOT_USED(input);
- /* Loop forever on the semaphore. The semaphore is used to signal that
- there is work for one or more HCDs. */
+ /* Loop forever on the semaphore. The semaphore is used to signal that
+ there is work for one or more HCDs. */
while (1)
- {
+ {
/* Get the semaphore that signals something is available for this
thread to process. */
_ux_host_semaphore_get_norc(&_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. */
+ /* 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_max_hcd; hcd_index++)
{
#else
@@ -120,7 +105,7 @@ UX_INTERRUPT_SAVE_AREA
UX_DISABLE
hcd -> ux_hcd_thread_signal--;
UX_RESTORE
- }
+ }
#if UX_MAX_HCD > 1
}
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 c25fd73a..6f48d2d1 100644
--- a/common/core/src/ux_host_stack_hcd_transfer_request.c
+++ b/common/core/src/ux_host_stack_hcd_transfer_request.c
@@ -1,18 +1,19 @@
/***************************************************************************
- * Copyright (c) 2024 Microsoft Corporation
- *
+ * Copyright (c) 2024 Microsoft Corporation
+ * Copyright (c) 2026-present Eclipse ThreadX contributors
+ *
* This program and the accompanying materials are made available under the
* terms of the MIT License which is available at
* https://opensource.org/licenses/MIT.
- *
+ *
* SPDX-License-Identifier: MIT
**************************************************************************/
/**************************************************************************/
/**************************************************************************/
-/** */
-/** USBX Component */
+/** */
+/** USBX Component */
/** */
/** Host Stack */
/** */
@@ -28,46 +29,36 @@
#include "ux_host_stack.h"
-/**************************************************************************/
-/* */
-/* FUNCTION RELEASE */
-/* */
-/* _ux_host_stack_hcd_transfer_request PORTABLE C */
+/**************************************************************************/
+/* */
+/* FUNCTION RELEASE */
+/* */
+/* _ux_host_stack_hcd_transfer_request PORTABLE C */
/* 6.1 */
/* AUTHOR */
/* */
/* Chaoqiong Xiao, Microsoft Corporation */
/* */
/* DESCRIPTION */
-/* */
-/* This function will route the transfer_request to the appropriate */
-/* HCD for transfer. */
-/* */
-/* INPUT */
-/* */
-/* transfer_request Pointer to transfer request */
-/* */
-/* OUTPUT */
-/* */
-/* Completion Status */
-/* */
-/* CALLS */
-/* */
-/* (ux_hcd_entry_function) HCD's entry function */
-/* */
-/* 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 */
+/* */
+/* This function will route the transfer_request to the appropriate */
+/* HCD for transfer. */
+/* */
+/* INPUT */
+/* */
+/* transfer_request Pointer to transfer request */
+/* */
+/* OUTPUT */
+/* */
+/* Completion Status */
+/* */
+/* CALLS */
+/* */
+/* (ux_hcd_entry_function) HCD's entry function */
+/* */
+/* CALLED BY */
+/* */
+/* USBX Components */
/* */
/**************************************************************************/
UINT _ux_host_stack_hcd_transfer_request(UX_TRANSFER *transfer_request)
@@ -75,7 +66,7 @@ UINT _ux_host_stack_hcd_transfer_request(UX_TRANSFER *transfer_request)
UINT status;
UX_HCD *hcd;
-
+
/* Obtain the HCD. */
hcd = UX_DEVICE_HCD_GET(transfer_request -> ux_transfer_request_endpoint -> ux_endpoint_device);
@@ -83,6 +74,6 @@ UX_HCD *hcd;
status = hcd -> ux_hcd_entry_function(hcd, UX_HCD_TRANSFER_REQUEST, (VOID *) transfer_request);
/* Return completion status. */
- return(status);
-}
+ return(status);
+}
diff --git a/common/core/src/ux_host_stack_hcd_unregister.c b/common/core/src/ux_host_stack_hcd_unregister.c
index db81bda8..adbaf3a9 100644
--- a/common/core/src/ux_host_stack_hcd_unregister.c
+++ b/common/core/src/ux_host_stack_hcd_unregister.c
@@ -1,10 +1,11 @@
/***************************************************************************
- * Copyright (c) 2024 Microsoft Corporation
- *
+ * Copyright (c) 2024 Microsoft Corporation
+ * Copyright (c) 2026-present Eclipse ThreadX contributors
+ *
* This program and the accompanying materials are made available under the
* terms of the MIT License which is available at
* https://opensource.org/licenses/MIT.
- *
+ *
* SPDX-License-Identifier: MIT
**************************************************************************/
@@ -69,17 +70,6 @@
/* */
/* Application */
/* */
-/* RELEASE HISTORY */
-/* */
-/* DATE NAME DESCRIPTION */
-/* */
-/* 09-30-2020 Chaoqiong Xiao Initial Version 6.1 */
-/* 11-09-2020 Chaoqiong Xiao Modified comment(s), */
-/* fixed HCD devices scan, */
-/* used HCD uninit command, */
-/* fixed HCD status scan, */
-/* resulting in version 6.1.2 */
-/* */
/**************************************************************************/
UINT _ux_host_stack_hcd_unregister(UCHAR *hcd_name,
ULONG hcd_param1, ULONG hcd_param2)
@@ -229,12 +219,6 @@ UINT hcd_name_length = 0;
/* */
/* Application */
/* */
-/* RELEASE HISTORY */
-/* */
-/* DATE NAME DESCRIPTION */
-/* */
-/* 10-31-2023 Chaoqiong Xiao Initial Version 6.3.0 */
-/* */
/**************************************************************************/
UINT _uxe_host_stack_hcd_unregister(UCHAR *hcd_name,
ULONG hcd_param1, ULONG hcd_param2)
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 bf764698..e5e4b2da 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
@@ -1,18 +1,19 @@
/***************************************************************************
- * Copyright (c) 2024 Microsoft Corporation
- *
+ * Copyright (c) 2024 Microsoft Corporation
+ * Copyright (c) 2026-present Eclipse ThreadX contributors
+ *
* This program and the accompanying materials are made available under the
* terms of the MIT License which is available at
* https://opensource.org/licenses/MIT.
- *
+ *
* SPDX-License-Identifier: MIT
**************************************************************************/
/**************************************************************************/
/**************************************************************************/
-/** */
-/** USBX Component */
+/** */
+/** USBX Component */
/** */
/** Host Stack */
/** */
@@ -29,59 +30,42 @@
#if defined(UX_OTG_SUPPORT)
-/**************************************************************************/
-/* */
-/* FUNCTION RELEASE */
-/* */
-/* _ux_host_stack_hnp_polling_thread_entry PORTABLE C */
+/**************************************************************************/
+/* */
+/* FUNCTION RELEASE */
+/* */
+/* _ux_host_stack_hnp_polling_thread_entry PORTABLE C */
/* 6.1.10 */
/* AUTHOR */
/* */
/* Chaoqiong Xiao, Microsoft Corporation */
/* */
/* DESCRIPTION */
-/* */
-/* This function is awaken every 2 seconds to check if there is a */
-/* OTG device on the bus and if so perform a GET_STATUS as the device */
-/* may request a change of role. */
-/* */
-/* INPUT */
-/* */
-/* none */
-/* */
-/* OUTPUT */
-/* */
-/* None */
-/* */
-/* CALLS */
-/* */
+/* */
+/* This function is awaken every 2 seconds to check if there is a */
+/* OTG device on the bus and if so perform a GET_STATUS as the device */
+/* may request a change of role. */
+/* */
+/* INPUT */
+/* */
+/* none */
+/* */
+/* OUTPUT */
+/* */
+/* None */
+/* */
+/* CALLS */
+/* */
/* _ux_host_stack_transfer_request Transfer request */
/* _ux_utility_thread_sleep Sleep thread */
/* _ux_utility_semaphore_get Get semaphore */
/* _ux_utility_memory_allocate Allocate memory */
/* _ux_utility_memory_free Free memory */
/* _ux_host_stack_role_swap Swapping role */
-/* */
-/* CALLED BY */
-/* */
-/* ThreadX */
-/* */
-/* 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 */
-/* 02-02-2021 Chaoqiong Xiao Modified comment(s), */
-/* used pointer for current */
-/* selected configuration, */
-/* resulting in version 6.1.4 */
-/* 01-31-2022 Chaoqiong Xiao Modified comment(s), */
-/* refined macros names, */
-/* resulting in version 6.1.10 */
+/* */
+/* CALLED BY */
+/* */
+/* ThreadX */
/* */
/**************************************************************************/
VOID _ux_host_stack_hnp_polling_thread_entry(ULONG argument)
@@ -98,7 +82,7 @@ ULONG port_index;
ULONG port_status;
ULONG container_index;
UINT status;
-
+
UX_PARAMETER_NOT_USED(argument);
/* This thread goes on forever once started. */
@@ -106,9 +90,9 @@ UINT status;
{
/* We need to wake every 2 seconds or so. */
- _ux_utility_thread_sleep(UX_OTG_HNP_THREAD_SLEEP_TIME);
+ _ux_utility_thread_sleep(UX_OTG_HNP_THREAD_SLEEP_TIME);
- /* We need to parse the controller driver table to find all controllers that registered
+ /* We need to parse the controller driver table to find all controllers that registered
as OTG. */
for (hcd_index = 0; hcd_index < _ux_system_host -> ux_system_host_registered_hcd; hcd_index++)
{
@@ -127,56 +111,56 @@ UINT status;
/* Call HCD for port status. */
port_status = hcd -> ux_hcd_entry_function(hcd, UX_HCD_GET_PORT_STATUS, (VOID *)((ALIGN_TYPE)port_index));
-
+
/* Check return status. */
if (port_status != UX_PORT_INDEX_UNKNOWN)
{
-
+
/* the port_status value is valid and will tell us if there is
a device attached\detached on the downstream port and if the port is powered. */
if ((port_status & UX_PS_CCS) && (port_status & UX_PS_PPS))
{
-
+
/* There is a device attached to one of the root hub port. Parse the device
to find out which one it is. */
- device = _ux_system_host -> ux_system_host_device_array;
+ device = _ux_system_host -> ux_system_host_device_array;
/* Start at the beginning of the list. */
container_index = 0;
-
+
/* Search the list until the end. */
while (container_index++ < UX_SYSTEM_HOST_MAX_DEVICES_GET())
{
-
+
/* Until we have found a used entry. */
if (device -> ux_device_handle != UX_UNUSED)
{
-
+
/* Check for the parent device and the port location and the controller. */
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 ?
+ /* We have a device on a OTG port. But is it a OTG HNP capable device ?
We need to parse the configuration until we find the one current. */
configuration = device -> ux_device_current_configuration;
/* Check for OTG HNP support. */
if (configuration -> ux_configuration_otg_capabilities & UX_OTG_HNP_SUPPORT)
{
-
+
/* Allocate memory for the OTG status. */
otg_status = _ux_utility_memory_allocate(UX_SAFE_ALIGN, UX_CACHE_SAFE_MEMORY, 16);
/* Check for status. */
if (otg_status == UX_NULL)
return;
-
+
/* Retrieve the control endpoint and the transfer request associated with it. */
control_endpoint = &device -> ux_device_control_endpoint;
transfer_request = &control_endpoint -> ux_endpoint_transfer_request;
- /* Protect the control endpoint semaphore here. It will be unprotected in the
+ /* Protect the control endpoint semaphore here. It will be unprotected in the
transfer request function. */
status = _ux_host_semaphore_get(&device -> ux_device_protection_semaphore, UX_WAIT_FOREVER);
@@ -188,14 +172,14 @@ UINT status;
transfer_request -> ux_transfer_request_type = UX_REQUEST_IN | UX_REQUEST_TYPE_STANDARD | UX_REQUEST_TARGET_DEVICE;
transfer_request -> ux_transfer_request_value = 0;
transfer_request -> ux_transfer_request_index = UX_OTG_STATUS_SELECTOR;
-
+
/* Send request to HCD layer. */
status = _ux_host_stack_transfer_request(transfer_request);
-
+
/* Check completion status. */
if(status == UX_SUCCESS && transfer_request -> ux_transfer_request_actual_length == 1)
{
-
+
/* We have an answer from the device. Check the HNP flag. */
if (*otg_status & UX_OTG_HOST_REQUEST_FLAG)
{
@@ -204,9 +188,9 @@ UINT status;
stopping of the host. */
_ux_host_stack_role_swap(device);
}
-
+
}
-
+
/* Free all used resources. */
_ux_utility_memory_free(otg_status);
@@ -216,12 +200,12 @@ UINT status;
/* Move to the next device entry. */
device++;
-
+
}
}
}
}
- }
+ }
}
}
}
diff --git a/common/core/src/ux_host_stack_initialize.c b/common/core/src/ux_host_stack_initialize.c
index dba88221..cc5bf011 100644
--- a/common/core/src/ux_host_stack_initialize.c
+++ b/common/core/src/ux_host_stack_initialize.c
@@ -1,18 +1,19 @@
/***************************************************************************
- * Copyright (c) 2024 Microsoft Corporation
- *
+ * Copyright (c) 2024 Microsoft Corporation
+ * Copyright (c) 2026-present Eclipse ThreadX contributors
+ *
* This program and the accompanying materials are made available under the
* terms of the MIT License which is available at
* https://opensource.org/licenses/MIT.
- *
+ *
* SPDX-License-Identifier: MIT
**************************************************************************/
/**************************************************************************/
/**************************************************************************/
-/** */
-/** USBX Component */
+/** */
+/** USBX Component */
/** */
/** Host Stack */
/** */
@@ -41,7 +42,7 @@ UX_SYSTEM_HOST *_ux_system_host;
/* Define table of periodic tree entries, properly indexed. */
-UINT _ux_system_host_hcd_periodic_tree_entries[32] = {
+UINT _ux_system_host_hcd_periodic_tree_entries[32] = {
0x00, 0x10, 0x08, 0x18, 0x04, 0x14, 0x0c, 0x1c,
0x02, 0x12, 0x0a, 0x1a, 0x06, 0x16, 0x0e, 0x1e,
0x01, 0x11, 0x09, 0x19, 0x05, 0x15, 0x0d, 0x1d,
@@ -81,58 +82,42 @@ UCHAR _ux_system_host_hcd_musb_name[] = "ux_
UCHAR _ux_system_host_hcd_atm7_name[] = "ux_hcd_atm7";
UCHAR _ux_system_host_hcd_simulator_name[] = "ux_hcd_simulator";
-/**************************************************************************/
-/* */
-/* FUNCTION RELEASE */
-/* */
-/* _ux_host_stack_initialize PORTABLE C */
+/**************************************************************************/
+/* */
+/* FUNCTION RELEASE */
+/* */
+/* _ux_host_stack_initialize PORTABLE C */
/* 6.1.10 */
/* AUTHOR */
/* */
/* Chaoqiong Xiao, Microsoft Corporation */
/* */
/* DESCRIPTION */
-/* */
-/* This function initializes all the host code for USBX to work on a */
-/* specific platform. */
-/* */
-/* INPUT */
-/* */
-/* (ux_system_host_change_function) Function pointer to the */
-/* callback function for a */
-/* device change */
-/* */
-/* OUTPUT */
-/* */
-/* Completion Status */
-/* */
-/* */
-/* CALLS */
-/* */
-/* _ux_utility_memory_allocate Allocate host memory */
-/* _ux_utility_semaphore_create Create host semaphore */
-/* _ux_utility_mutex_create Create host mutex */
-/* _ux_utility_thread_create Create host thread */
-/* */
-/* 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, used UX prefix */
-/* to refer to TX symbols */
-/* instead of using them */
-/* directly, */
-/* resulting in version 6.1 */
-/* 01-31-2022 Chaoqiong Xiao Modified comment(s), */
-/* added standalone support, */
-/* resulting in version 6.1.10 */
+/* */
+/* This function initializes all the host code for USBX to work on a */
+/* specific platform. */
+/* */
+/* INPUT */
+/* */
+/* (ux_system_host_change_function) Function pointer to the */
+/* callback function for a */
+/* device change */
+/* */
+/* OUTPUT */
+/* */
+/* Completion Status */
+/* */
+/* */
+/* CALLS */
+/* */
+/* _ux_utility_memory_allocate Allocate host memory */
+/* _ux_utility_semaphore_create Create host semaphore */
+/* _ux_utility_mutex_create Create host mutex */
+/* _ux_utility_thread_create Create host thread */
+/* */
+/* CALLED BY */
+/* */
+/* Application */
/* */
/**************************************************************************/
UINT _ux_host_stack_initialize(UINT (*ux_system_host_change_function)(ULONG, UX_HOST_CLASS *, VOID *))
@@ -156,7 +141,7 @@ UX_DEVICE *device;
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;
@@ -274,7 +259,7 @@ UX_DEVICE *device;
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, UX_AUTO_START);
-
+
/* Check the completion status. */
if(status != UX_SUCCESS)
status = UX_THREAD_ERROR;
@@ -305,7 +290,7 @@ UX_DEVICE *device;
if (_ux_system_host -> ux_system_host_hnp_polling_thread_stack == UX_NULL)
status = UX_MEMORY_INSUFFICIENT;
}
-
+
/* Create the HNP polling thread of USBX. */
if (status == UX_SUCCESS)
{
@@ -333,7 +318,7 @@ UX_DEVICE *device;
_ux_utility_memory_free(_ux_system_host -> ux_system_host_hnp_polling_thread_stack);
/* Delete _ux_system_host -> ux_system_host_hcd_thread. */
- if (_ux_system_host -> ux_system_host_hcd_thread.tx_thread_id != 0)
+ if (_ux_host_thread_created(&_ux_system_host -> ux_system_host_hcd_thread))
_ux_utility_thread_delete(&_ux_system_host -> ux_system_host_hcd_thread);
#else
@@ -349,15 +334,15 @@ UX_DEVICE *device;
#if !defined(UX_HOST_STANDALONE)
/* Delete _ux_system_host -> ux_system_host_enum_thread. */
- if (_ux_system_host -> ux_system_host_enum_thread.tx_thread_id != 0)
+ if (_ux_system_thread_created(&_ux_system_host -> ux_system_host_enum_thread))
_ux_utility_thread_delete(&_ux_system_host -> ux_system_host_enum_thread);
-
+
/* Delete _ux_system_host -> ux_system_host_hcd_semaphore. */
- if (_ux_system_host -> ux_system_host_hcd_semaphore.tx_semaphore_id != 0)
+ if (_ux_host_semaphore_created(&_ux_system_host -> ux_system_host_hcd_semaphore))
_ux_utility_semaphore_delete(&_ux_system_host -> ux_system_host_hcd_semaphore);
/* Delete _ux_system_host -> ux_system_host_enum_semaphore. */
- if (_ux_system_host -> ux_system_host_enum_semaphore.tx_semaphore_id != 0)
+ if (_ux_host_semaphore_created(&_ux_system_host -> ux_system_host_enum_semaphore))
_ux_utility_semaphore_delete(&_ux_system_host -> ux_system_host_enum_semaphore);
/* Free _ux_system_host -> ux_system_host_hcd_thread_stack. */
@@ -372,7 +357,7 @@ UX_DEVICE *device;
/* Free _ux_system_host -> ux_system_host_device_array. */
if (_ux_system_host -> ux_system_host_device_array)
_ux_utility_memory_free(_ux_system_host -> ux_system_host_device_array);
-
+
/* Free _ux_system_host -> ux_system_host_class_array. */
if (_ux_system_host -> ux_system_host_class_array)
_ux_utility_memory_free(_ux_system_host -> ux_system_host_class_array);
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 4d0d7c3b..e9aa98eb 100644
--- a/common/core/src/ux_host_stack_interface_endpoint_get.c
+++ b/common/core/src/ux_host_stack_interface_endpoint_get.c
@@ -1,18 +1,19 @@
/***************************************************************************
- * Copyright (c) 2024 Microsoft Corporation
- *
+ * Copyright (c) 2024 Microsoft Corporation
+ * Copyright (c) 2026-present Eclipse ThreadX contributors
+ *
* This program and the accompanying materials are made available under the
* terms of the MIT License which is available at
* https://opensource.org/licenses/MIT.
- *
+ *
* SPDX-License-Identifier: MIT
**************************************************************************/
/**************************************************************************/
/**************************************************************************/
-/** */
-/** USBX Component */
+/** */
+/** USBX Component */
/** */
/** Host Stack */
/** */
@@ -28,51 +29,39 @@
#include "ux_host_stack.h"
-/**************************************************************************/
-/* */
-/* FUNCTION RELEASE */
-/* */
-/* _ux_host_stack_interface_endpoint_get PORTABLE C */
+/**************************************************************************/
+/* */
+/* FUNCTION RELEASE */
+/* */
+/* _ux_host_stack_interface_endpoint_get PORTABLE C */
/* 6.1.12 */
/* AUTHOR */
/* */
/* Chaoqiong Xiao, Microsoft Corporation */
/* */
/* DESCRIPTION */
-/* */
+/* */
/* This function returns an endpoint container based on the interface */
-/* handle and an endpoint index. */
-/* */
-/* INPUT */
-/* */
-/* interface Pointer to interface */
-/* endpoint_index Index of endpoint to get */
-/* endpoint Destination for endpoint */
-/* */
-/* OUTPUT */
-/* */
-/* Completion Status */
-/* */
-/* CALLS */
-/* */
-/* None */
-/* */
-/* 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), */
-/* resulting in version 6.1 */
-/* 07-29-2022 Chaoqiong Xiao Modified comment(s), */
-/* fixed parameter/variable */
-/* names conflict C++ keyword, */
-/* resulting in version 6.1.12 */
+/* handle and an endpoint index. */
+/* */
+/* INPUT */
+/* */
+/* interface Pointer to interface */
+/* endpoint_index Index of endpoint to get */
+/* endpoint Destination for endpoint */
+/* */
+/* OUTPUT */
+/* */
+/* Completion Status */
+/* */
+/* CALLS */
+/* */
+/* None */
+/* */
+/* CALLED BY */
+/* */
+/* Application */
+/* USBX Components */
/* */
/**************************************************************************/
UINT _ux_host_stack_interface_endpoint_get(UX_INTERFACE *interface_ptr, UINT endpoint_index, UX_ENDPOINT **endpoint)
@@ -96,14 +85,14 @@ UX_ENDPOINT *current_endpoint;
return(UX_INTERFACE_HANDLE_UNKNOWN);
}
-
+
/* Start with the endpoint attached to the interface. */
current_endpoint = interface_ptr -> ux_interface_first_endpoint;
- /* The first endpoint has the index 0. */
+ /* The first endpoint has the index 0. */
current_endpoint_index = 0;
-
- /* Traverse the list of the endpoints until we found the right one. */
+
+ /* Traverse the list of the endpoints until we found the right one. */
while (current_endpoint != UX_NULL)
{
@@ -117,10 +106,10 @@ UX_ENDPOINT *current_endpoint;
/* Return success to the caller. */
return(UX_SUCCESS);
}
-
+
/* Move to the next endpoint. */
current_endpoint = current_endpoint -> ux_endpoint_next_endpoint;
-
+
/* Move to the next index. */
current_endpoint_index++;
}
@@ -153,9 +142,9 @@ UX_ENDPOINT *current_endpoint;
/* */
/* INPUT */
/* */
-/* interface_ptr Pointer to interface */
-/* endpoint_index Index of endpoint to get */
-/* endpoint Destination for endpoint */
+/* interface_ptr Pointer to interface */
+/* endpoint_index Index of endpoint to get */
+/* endpoint Destination for endpoint */
/* */
/* OUTPUT */
/* */
@@ -169,12 +158,6 @@ UX_ENDPOINT *current_endpoint;
/* */
/* Application */
/* */
-/* RELEASE HISTORY */
-/* */
-/* DATE NAME DESCRIPTION */
-/* */
-/* 10-31-2023 Chaoqiong Xiao Initial Version 6.3.0 */
-/* */
/**************************************************************************/
UINT _uxe_host_stack_interface_endpoint_get(UX_INTERFACE *interface_ptr, UINT endpoint_index, UX_ENDPOINT **endpoint)
{
diff --git a/common/core/src/ux_host_stack_interface_instance_create.c b/common/core/src/ux_host_stack_interface_instance_create.c
index 655a1bb3..d03dc2c5 100644
--- a/common/core/src/ux_host_stack_interface_instance_create.c
+++ b/common/core/src/ux_host_stack_interface_instance_create.c
@@ -1,18 +1,19 @@
/***************************************************************************
- * Copyright (c) 2024 Microsoft Corporation
- *
+ * Copyright (c) 2024 Microsoft Corporation
+ * Copyright (c) 2026-present Eclipse ThreadX contributors
+ *
* This program and the accompanying materials are made available under the
* terms of the MIT License which is available at
* https://opensource.org/licenses/MIT.
- *
+ *
* SPDX-License-Identifier: MIT
**************************************************************************/
/**************************************************************************/
/**************************************************************************/
-/** */
-/** USBX Component */
+/** */
+/** USBX Component */
/** */
/** Host Stack */
/** */
@@ -28,48 +29,36 @@
#include "ux_host_stack.h"
-/**************************************************************************/
-/* */
-/* FUNCTION RELEASE */
-/* */
-/* _ux_host_stack_interface_instance_create PORTABLE C */
+/**************************************************************************/
+/* */
+/* FUNCTION RELEASE */
+/* */
+/* _ux_host_stack_interface_instance_create PORTABLE C */
/* 6.1.12 */
/* AUTHOR */
/* */
/* Chaoqiong Xiao, Microsoft Corporation */
/* */
/* DESCRIPTION */
-/* */
+/* */
/* This function will create an interface instance. It creates each */
-/* endpoint associated with the interface. */
-/* */
-/* INPUT */
-/* */
-/* interface Pointer to interface */
-/* */
-/* OUTPUT */
-/* */
-/* Completion Status */
-/* */
-/* CALLS */
-/* */
-/* _ux_host_stack_endpoint_instance_create Create instance endpoint */
-/* */
-/* CALLED BY */
-/* */
-/* USBX Components */
-/* */
-/* RELEASE HISTORY */
-/* */
-/* DATE NAME DESCRIPTION */
-/* */
-/* 05-19-2020 Chaoqiong Xiao Initial Version 6.0 */
-/* 09-30-2020 Chaoqiong Xiao Modified comment(s), */
-/* resulting in version 6.1 */
-/* 07-29-2022 Chaoqiong Xiao Modified comment(s), */
-/* fixed parameter/variable */
-/* names conflict C++ keyword, */
-/* resulting in version 6.1.12 */
+/* endpoint associated with the interface. */
+/* */
+/* INPUT */
+/* */
+/* interface Pointer to interface */
+/* */
+/* OUTPUT */
+/* */
+/* Completion Status */
+/* */
+/* CALLS */
+/* */
+/* _ux_host_stack_endpoint_instance_create Create instance endpoint */
+/* */
+/* CALLED BY */
+/* */
+/* USBX Components */
/* */
/**************************************************************************/
UINT _ux_host_stack_interface_instance_create(UX_INTERFACE *interface_ptr)
@@ -90,13 +79,13 @@ UINT status;
/* Create an endpoint for the instance. */
status = _ux_host_stack_endpoint_instance_create(endpoint);
-
+
/* Check status, the controller may have refused the endpoint creation. */
if (status != UX_SUCCESS)
-
+
/* An error occurred at the controller level. */
return(status);
-
+
/* Move to next endpoint. */
endpoint = endpoint -> ux_endpoint_next_endpoint;
}
@@ -105,6 +94,6 @@ UINT status;
UX_TRACE_OBJECT_REGISTER(UX_TRACE_HOST_OBJECT_TYPE_INTERFACE, interface_ptr, 0, 0, 0);
/* Return completion status. */
- return(UX_SUCCESS);
+ return(UX_SUCCESS);
}
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 e3357318..136bff67 100644
--- a/common/core/src/ux_host_stack_interface_instance_delete.c
+++ b/common/core/src/ux_host_stack_interface_instance_delete.c
@@ -1,18 +1,19 @@
/***************************************************************************
- * Copyright (c) 2024 Microsoft Corporation
- *
+ * Copyright (c) 2024 Microsoft Corporation
+ * Copyright (c) 2026-present Eclipse ThreadX contributors
+ *
* This program and the accompanying materials are made available under the
* terms of the MIT License which is available at
* https://opensource.org/licenses/MIT.
- *
+ *
* SPDX-License-Identifier: MIT
**************************************************************************/
/**************************************************************************/
/**************************************************************************/
-/** */
-/** USBX Component */
+/** */
+/** USBX Component */
/** */
/** Host Stack */
/** */
@@ -28,49 +29,37 @@
#include "ux_host_stack.h"
-/**************************************************************************/
-/* */
-/* FUNCTION RELEASE */
-/* */
-/* _ux_host_stack_interface_instance_delete PORTABLE C */
+/**************************************************************************/
+/* */
+/* FUNCTION RELEASE */
+/* */
+/* _ux_host_stack_interface_instance_delete PORTABLE C */
/* 6.1.12 */
/* AUTHOR */
/* */
/* Chaoqiong Xiao, Microsoft Corporation */
/* */
/* DESCRIPTION */
-/* */
-/* This function will delete an interface instance. It does not delete */
-/* the interface container, but it removes all the endpoints */
-/* associated with alternate setting. */
-/* */
-/* INPUT */
-/* */
-/* interface Pointer to interface */
-/* */
-/* OUTPUT */
-/* */
-/* None */
-/* */
-/* CALLS */
-/* */
-/* _ux_host_stack_endpoint_instance_delete Delete endpoint */
-/* */
-/* CALLED BY */
-/* */
-/* USBX Components */
-/* */
-/* RELEASE HISTORY */
-/* */
-/* DATE NAME DESCRIPTION */
-/* */
-/* 05-19-2020 Chaoqiong Xiao Initial Version 6.0 */
-/* 09-30-2020 Chaoqiong Xiao Modified comment(s), */
-/* resulting in version 6.1 */
-/* 07-29-2022 Chaoqiong Xiao Modified comment(s), */
-/* fixed parameter/variable */
-/* names conflict C++ keyword, */
-/* resulting in version 6.1.12 */
+/* */
+/* This function will delete an interface instance. It does not delete */
+/* the interface container, but it removes all the endpoints */
+/* associated with alternate setting. */
+/* */
+/* INPUT */
+/* */
+/* interface Pointer to interface */
+/* */
+/* OUTPUT */
+/* */
+/* None */
+/* */
+/* CALLS */
+/* */
+/* _ux_host_stack_endpoint_instance_delete Delete endpoint */
+/* */
+/* CALLED BY */
+/* */
+/* USBX Components */
/* */
/**************************************************************************/
VOID _ux_host_stack_interface_instance_delete(UX_INTERFACE *interface_ptr)
@@ -99,6 +88,6 @@ UX_ENDPOINT *endpoint;
}
/* Return to caller. */
- return;
+ return;
}
diff --git a/common/core/src/ux_host_stack_interface_set.c b/common/core/src/ux_host_stack_interface_set.c
index 9eba940e..b616279f 100644
--- a/common/core/src/ux_host_stack_interface_set.c
+++ b/common/core/src/ux_host_stack_interface_set.c
@@ -1,18 +1,19 @@
/***************************************************************************
- * Copyright (c) 2024 Microsoft Corporation
- *
+ * Copyright (c) 2024 Microsoft Corporation
+ * Copyright (c) 2026-present Eclipse ThreadX contributors
+ *
* This program and the accompanying materials are made available under the
* terms of the MIT License which is available at
* https://opensource.org/licenses/MIT.
- *
+ *
* SPDX-License-Identifier: MIT
**************************************************************************/
/**************************************************************************/
/**************************************************************************/
-/** */
-/** USBX Component */
+/** */
+/** USBX Component */
/** */
/** Host Stack */
/** */
@@ -28,51 +29,36 @@
#include "ux_host_stack.h"
-/**************************************************************************/
-/* */
-/* FUNCTION RELEASE */
-/* */
-/* _ux_host_stack_interface_set PORTABLE C */
+/**************************************************************************/
+/* */
+/* FUNCTION RELEASE */
+/* */
+/* _ux_host_stack_interface_set PORTABLE C */
/* 6.1.12 */
/* AUTHOR */
/* */
/* Chaoqiong Xiao, Microsoft Corporation */
/* */
/* DESCRIPTION */
-/* */
-/* This function performs a setting of an alternate setting for a */
-/* specific interface. */
-/* */
-/* INPUT */
-/* */
-/* interface Pointer to interface */
-/* */
-/* OUTPUT */
-/* */
-/* Completion Status */
-/* */
-/* CALLS */
-/* */
-/* _ux_host_stack_hcd_transfer_request HCD transfer request */
-/* */
-/* CALLED BY */
-/* */
-/* USBX Components */
-/* */
-/* RELEASE HISTORY */
-/* */
-/* DATE NAME DESCRIPTION */
-/* */
-/* 05-19-2020 Chaoqiong Xiao Initial Version 6.0 */
-/* 09-30-2020 Chaoqiong Xiao Modified comment(s), */
-/* resulting in version 6.1 */
-/* 01-31-2022 Chaoqiong Xiao Modified comment(s), */
-/* added standalone support, */
-/* resulting in version 6.1.10 */
-/* 07-29-2022 Chaoqiong Xiao Modified comment(s), */
-/* fixed parameter/variable */
-/* names conflict C++ keyword, */
-/* resulting in version 6.1.12 */
+/* */
+/* This function performs a setting of an alternate setting for a */
+/* specific interface. */
+/* */
+/* INPUT */
+/* */
+/* interface Pointer to interface */
+/* */
+/* OUTPUT */
+/* */
+/* Completion Status */
+/* */
+/* CALLS */
+/* */
+/* _ux_host_stack_hcd_transfer_request HCD transfer request */
+/* */
+/* CALLED BY */
+/* */
+/* USBX Components */
/* */
/**************************************************************************/
UINT _ux_host_stack_interface_set(UX_INTERFACE *interface_ptr)
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 ab3244af..bb1a2ec1 100644
--- a/common/core/src/ux_host_stack_interface_setting_select.c
+++ b/common/core/src/ux_host_stack_interface_setting_select.c
@@ -1,18 +1,19 @@
/***************************************************************************
- * Copyright (c) 2024 Microsoft Corporation
- *
+ * Copyright (c) 2024 Microsoft Corporation
+ * Copyright (c) 2026-present Eclipse ThreadX contributors
+ *
* This program and the accompanying materials are made available under the
* terms of the MIT License which is available at
* https://opensource.org/licenses/MIT.
- *
+ *
* SPDX-License-Identifier: MIT
**************************************************************************/
/**************************************************************************/
/**************************************************************************/
-/** */
-/** USBX Component */
+/** */
+/** USBX Component */
/** */
/** Host Stack */
/** */
@@ -28,52 +29,41 @@
#include "ux_host_stack.h"
-/**************************************************************************/
-/* */
-/* FUNCTION RELEASE */
-/* */
-/* _ux_host_stack_interface_setting_select PORTABLE C */
+/**************************************************************************/
+/* */
+/* FUNCTION RELEASE */
+/* */
+/* _ux_host_stack_interface_setting_select PORTABLE C */
/* 6.1.12 */
/* AUTHOR */
/* */
/* Chaoqiong Xiao, Microsoft Corporation */
/* */
/* DESCRIPTION */
-/* */
+/* */
/* This function selects a specific alternate setting for a given */
-/* interface belonging to the selected configuration. */
-/* */
-/* INPUT */
-/* */
-/* interface Pointer to interface */
-/* */
-/* OUTPUT */
-/* */
-/* Completion Status */
-/* */
-/* CALLS */
-/* */
-/* _ux_host_stack_interface_instance_create Create interface instance */
-/* _ux_host_stack_interface_instance_delete Delete interface instance */
-/* _ux_host_stack_interface_set Set interface instance */
+/* interface belonging to the selected configuration. */
+/* */
+/* INPUT */
+/* */
+/* interface Pointer to interface */
+/* */
+/* OUTPUT */
+/* */
+/* Completion Status */
+/* */
+/* CALLS */
+/* */
+/* _ux_host_stack_interface_instance_create Create interface instance */
+/* _ux_host_stack_interface_instance_delete Delete interface instance */
+/* _ux_host_stack_interface_set Set interface instance */
/* _ux_host_semaphore_get Get semaphore */
/* _ux_host_semaphore_put Put semaphore */
-/* */
-/* 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), */
-/* resulting in version 6.1 */
-/* 07-29-2022 Chaoqiong Xiao Modified comment(s), */
-/* protected control request, */
-/* resulting in version 6.1.12 */
+/* */
+/* CALLED BY */
+/* */
+/* Application */
+/* USBX Components */
/* */
/**************************************************************************/
UINT _ux_host_stack_interface_setting_select(UX_INTERFACE *interface_ptr)
@@ -86,7 +76,7 @@ UX_INTERFACE *main_interface;
UINT current_interface_number;
UINT current_alternate_setting;
UINT status;
-
+
/* If trace is enabled, insert this event into the trace buffer. */
UX_TRACE_IN_LINE_INSERT(UX_TRACE_HOST_STACK_INTERFACE_SETTING_SELECT, interface_ptr, 0, 0, 0, UX_TRACE_HOST_STACK_EVENTS, 0, 0)
@@ -101,7 +91,7 @@ UINT status;
}
/* From the interface, get the configuration container and the first
- interface hooked to this configuration. */
+ interface hooked to this configuration. */
configuration = interface_ptr -> ux_interface_configuration;
current_interface_number = interface_ptr -> ux_interface_descriptor.bInterfaceNumber;
current_interface = configuration -> ux_configuration_first_interface;
@@ -154,7 +144,7 @@ UINT status;
break;
}
- }
+ }
/* Move to the next interface. */
current_interface = current_interface -> ux_interface_next_interface;
@@ -209,7 +199,7 @@ UINT status;
_ux_host_semaphore_put(&configuration -> ux_configuration_device -> ux_device_protection_semaphore);
return(status);
}
-
+
/* Return to caller. */
return(status);
}
@@ -247,12 +237,6 @@ UINT status;
/* */
/* Application */
/* */
-/* RELEASE HISTORY */
-/* */
-/* DATE NAME DESCRIPTION */
-/* */
-/* 10-31-2023 Chaoqiong Xiao Initial Version 6.3.0 */
-/* */
/**************************************************************************/
UINT _uxe_host_stack_interface_setting_select(UX_INTERFACE *interface_ptr)
{
diff --git a/common/core/src/ux_host_stack_interfaces_scan.c b/common/core/src/ux_host_stack_interfaces_scan.c
index 953b0c2e..df535401 100644
--- a/common/core/src/ux_host_stack_interfaces_scan.c
+++ b/common/core/src/ux_host_stack_interfaces_scan.c
@@ -1,18 +1,19 @@
/***************************************************************************
- * Copyright (c) 2024 Microsoft Corporation
- *
+ * Copyright (c) 2024 Microsoft Corporation
+ * Copyright (c) 2026-present Eclipse ThreadX contributors
+ *
* This program and the accompanying materials are made available under the
* terms of the MIT License which is available at
* https://opensource.org/licenses/MIT.
- *
+ *
* SPDX-License-Identifier: MIT
**************************************************************************/
/**************************************************************************/
/**************************************************************************/
-/** */
-/** USBX Component */
+/** */
+/** USBX Component */
/** */
/** Host Stack */
/** */
@@ -28,48 +29,40 @@
#include "ux_host_stack.h"
-/**************************************************************************/
-/* */
-/* FUNCTION RELEASE */
-/* */
-/* _ux_host_stack_interfaces_scan PORTABLE C */
+/**************************************************************************/
+/* */
+/* FUNCTION RELEASE */
+/* */
+/* _ux_host_stack_interfaces_scan PORTABLE C */
/* 6.1 */
/* AUTHOR */
/* */
/* Chaoqiong Xiao, Microsoft Corporation */
/* */
/* DESCRIPTION */
-/* */
+/* */
/* This function scans all the interfaces and alternate settings for */
-/* particular configuration. */
-/* */
-/* INPUT */
-/* */
-/* configuration Where the interface(s) will */
+/* particular configuration. */
+/* */
+/* INPUT */
+/* */
+/* configuration Where the interface(s) will */
/* be attached */
-/* descriptor Contains the entire descriptor*/
+/* descriptor Contains the entire descriptor*/
/* for this configuration */
-/* */
-/* OUTPUT */
-/* */
-/* None */
-/* */
-/* CALLS */
-/* */
+/* */
+/* OUTPUT */
+/* */
+/* None */
+/* */
+/* CALLS */
+/* */
/* _ux_utility_descriptor_parse Parse interface descriptor */
-/* _ux_host_stack_new_interface_create Create new interface */
-/* */
-/* CALLED BY */
-/* */
-/* USBX Components */
-/* */
-/* RELEASE HISTORY */
-/* */
-/* DATE NAME DESCRIPTION */
-/* */
-/* 05-19-2020 Chaoqiong Xiao Initial Version 6.0 */
-/* 09-30-2020 Chaoqiong Xiao Modified comment(s), */
-/* resulting in version 6.1 */
+/* _ux_host_stack_new_interface_create Create new interface */
+/* */
+/* CALLED BY */
+/* */
+/* USBX Components */
/* */
/**************************************************************************/
UINT _ux_host_stack_interfaces_scan(UX_CONFIGURATION *configuration, UCHAR * descriptor)
@@ -77,7 +70,7 @@ UINT _ux_host_stack_interfaces_scan(UX_CONFIGURATION *configuration, UCHAR * de
ULONG total_configuration_length;
UINT descriptor_length;
-UINT descriptor_type;
+UINT descriptor_type;
ULONG status;
ULONG interface_association_descriptor_present;
ULONG interface_in_iad_count;
@@ -85,14 +78,14 @@ UX_INTERFACE_ASSOCIATION_DESCRIPTOR interface_association;
/* Retrieve the size of all the configuration descriptor. */
total_configuration_length = configuration -> ux_configuration_descriptor.wTotalLength;
-
+
/* Set the IAD to false. */
interface_association_descriptor_present = UX_FALSE;
/* Set the IAD interface count to zero. */
interface_in_iad_count = 0;
- /* Scan the entire descriptor and search for interfaces. We should also ensure that
+ /* Scan the entire descriptor and search for interfaces. We should also ensure that
the descriptor is valid by verifying the length of each descriptor scanned. */
while (total_configuration_length)
{
@@ -112,7 +105,7 @@ UX_INTERFACE_ASSOCIATION_DESCRIPTOR interface_association;
UX_TRACE_IN_LINE_INSERT(UX_TRACE_ERROR, UX_DESCRIPTOR_CORRUPTED, descriptor, 0, 0, UX_TRACE_ERRORS, 0, 0)
return(UX_DESCRIPTOR_CORRUPTED);
- }
+ }
/* Check the type for an interface association descriptor. */
if (descriptor_type == UX_INTERFACE_ASSOCIATION_DESCRIPTOR_ITEM)
@@ -131,16 +124,16 @@ UX_INTERFACE_ASSOCIATION_DESCRIPTOR interface_association;
/* We have an IAD. */
interface_association_descriptor_present = UX_TRUE;
-
+
/* Memorize the number of interfaces attached to this IAD. */
interface_in_iad_count = interface_association.bInterfaceCount;
}
-
+
/* Check the type for an interface descriptor. */
if (descriptor_type == UX_INTERFACE_DESCRIPTOR_ITEM)
{
- /* We have found an interface descriptor. This descriptor contains at least
+ /* We have found an interface descriptor. This descriptor contains at least
the default alternate setting (with value 0) and may have others. */
status = _ux_host_stack_new_interface_create(configuration, descriptor, total_configuration_length);
@@ -150,11 +143,11 @@ UX_INTERFACE_ASSOCIATION_DESCRIPTOR interface_association;
/* Decrement the number of interfaces attached here. */
interface_in_iad_count--;
-
+
/* Are we at the end of the interface count ? */
if (interface_in_iad_count == 0)
{
-
+
/* Set the IAD to false now. */
interface_association_descriptor_present = UX_FALSE;
@@ -169,11 +162,11 @@ UX_INTERFACE_ASSOCIATION_DESCRIPTOR interface_association;
/* Check return status. */
if(status != UX_SUCCESS)
return(status);
- }
+ }
/* Check the type for an OTG descriptor. */
if (descriptor_type == UX_OTG_DESCRIPTOR_ITEM)
-
+
/* Retrieve the bmAttributes for SRP/HNP support. */
configuration -> ux_configuration_otg_capabilities = (ULONG) *(descriptor + UX_OTG_BM_ATTRIBUTES);
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 d965bbce..328122a7 100644
--- a/common/core/src/ux_host_stack_new_configuration_create.c
+++ b/common/core/src/ux_host_stack_new_configuration_create.c
@@ -1,18 +1,19 @@
/***************************************************************************
- * Copyright (c) 2024 Microsoft Corporation
- *
+ * Copyright (c) 2024 Microsoft Corporation
+ * Copyright (c) 2026-present Eclipse ThreadX contributors
+ *
* This program and the accompanying materials are made available under the
* terms of the MIT License which is available at
* https://opensource.org/licenses/MIT.
- *
+ *
* SPDX-License-Identifier: MIT
**************************************************************************/
/**************************************************************************/
/**************************************************************************/
-/** */
-/** USBX Component */
+/** */
+/** USBX Component */
/** */
/** Host Stack */
/** */
@@ -28,47 +29,39 @@
#include "ux_host_stack.h"
-/**************************************************************************/
-/* */
-/* FUNCTION RELEASE */
-/* */
-/* _ux_host_stack_new_configuration_create PORTABLE C */
+/**************************************************************************/
+/* */
+/* FUNCTION RELEASE */
+/* */
+/* _ux_host_stack_new_configuration_create PORTABLE C */
/* 6.1 */
/* AUTHOR */
/* */
/* Chaoqiong Xiao, Microsoft Corporation */
/* */
/* DESCRIPTION */
-/* */
+/* */
/* This function creates a new configuration for the current device */
-/* a device can have multiple configurations. */
-/* */
-/* INPUT */
-/* */
-/* device Pointer to the descriptor */
+/* a device can have multiple configurations. */
+/* */
+/* INPUT */
+/* */
+/* device Pointer to the descriptor */
/* for the device */
-/* configuration_descriptor Configuration descriptor */
+/* configuration_descriptor Configuration descriptor */
/* previously parsed */
-/* */
-/* OUTPUT */
-/* */
-/* None */
-/* */
-/* CALLS */
-/* */
-/* None */
-/* */
-/* CALLED BY */
-/* */
-/* USBX Components */
-/* */
-/* RELEASE HISTORY */
-/* */
-/* DATE NAME DESCRIPTION */
-/* */
-/* 05-19-2020 Chaoqiong Xiao Initial Version 6.0 */
-/* 09-30-2020 Chaoqiong Xiao Modified comment(s), */
-/* resulting in version 6.1 */
+/* */
+/* OUTPUT */
+/* */
+/* None */
+/* */
+/* CALLS */
+/* */
+/* None */
+/* */
+/* CALLED BY */
+/* */
+/* USBX Components */
/* */
/**************************************************************************/
VOID _ux_host_stack_new_configuration_create(UX_DEVICE *device, UX_CONFIGURATION *configuration)
@@ -79,7 +72,7 @@ UX_CONFIGURATION *list_configuration;
/* If trace is enabled, insert this event into the trace buffer. */
UX_TRACE_IN_LINE_INSERT(UX_TRACE_HOST_STACK_NEW_CONFIGURATION_CREATE, device, configuration, 0, 0, UX_TRACE_HOST_STACK_EVENTS, 0, 0)
- /* The device that owns this configuration is memorized in the
+ /* The device that owns this configuration is memorized in the
configuration container itself, easier for back chaining. */
configuration -> ux_configuration_device = device;
@@ -87,9 +80,9 @@ UX_CONFIGURATION *list_configuration;
configuration container is not corrupted. */
configuration -> ux_configuration_handle = (ULONG) (ALIGN_TYPE) configuration;
- /* There is 2 cases for the creation of the configuration descriptor
+ /* There is 2 cases for the creation of the configuration descriptor
if this is the first one, the configuration descriptor is hooked
- to the device. If it is not the first one, the configuration is
+ to the device. If it is not the first one, the configuration is
hooked to the end of the chain of configurations. */
if (device -> ux_device_first_configuration == UX_NULL)
{
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 17be38d2..31621f55 100644
--- a/common/core/src/ux_host_stack_new_device_create.c
+++ b/common/core/src/ux_host_stack_new_device_create.c
@@ -1,10 +1,11 @@
/***************************************************************************
- * Copyright (c) 2024 Microsoft Corporation
- *
+ * Copyright (c) 2024 Microsoft Corporation
+ * Copyright (c) 2026-present Eclipse ThreadX contributors
+ *
* This program and the accompanying materials are made available under the
* terms of the MIT License which is available at
* https://opensource.org/licenses/MIT.
- *
+ *
* SPDX-License-Identifier: MIT
**************************************************************************/
@@ -88,28 +89,6 @@
/* */
/* 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 */
-/* 02-02-2021 Chaoqiong Xiao Modified comment(s), */
-/* added a new parameter to */
-/* return created device, */
-/* resulting in version 6.1.4 */
-/* 01-31-2022 Chaoqiong Xiao Modified comment(s), */
-/* added standalone support, */
-/* reset device power source, */
-/* resulting in version 6.1.10 */
-/* 07-29-2022 Chaoqiong Xiao Modified comment(s), */
-/* freed shared device config */
-/* descriptor after enum scan, */
-/* resulting in version 6.1.12 */
-/* */
/**************************************************************************/
UINT _ux_host_stack_new_device_create(UX_HCD *hcd, UX_DEVICE *device_owner,
UINT port_index, UINT device_speed,
@@ -295,7 +274,7 @@ UX_ENDPOINT *control_endpoint;
}
#endif
- /* Return status. If there's an error, device resources that have been
+ /* Return status. If there's an error, device resources that have been
allocated until this point should be freed by the caller via _ux_host_stack_device_resources_free. */
return(status);
}
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 42c78ea4..3fd5c3c3 100644
--- a/common/core/src/ux_host_stack_new_device_get.c
+++ b/common/core/src/ux_host_stack_new_device_get.c
@@ -1,18 +1,19 @@
/***************************************************************************
- * Copyright (c) 2024 Microsoft Corporation
- *
+ * Copyright (c) 2024 Microsoft Corporation
+ * Copyright (c) 2026-present Eclipse ThreadX contributors
+ *
* This program and the accompanying materials are made available under the
* terms of the MIT License which is available at
* https://opensource.org/licenses/MIT.
- *
+ *
* SPDX-License-Identifier: MIT
**************************************************************************/
/**************************************************************************/
/**************************************************************************/
-/** */
-/** USBX Component */
+/** */
+/** USBX Component */
/** */
/** Host Stack */
/** */
@@ -28,49 +29,35 @@
#include "ux_host_stack.h"
-/**************************************************************************/
-/* */
-/* FUNCTION RELEASE */
-/* */
-/* _ux_host_stack_new_device_get PORTABLE C */
+/**************************************************************************/
+/* */
+/* FUNCTION RELEASE */
+/* */
+/* _ux_host_stack_new_device_get PORTABLE C */
/* 6.1.12 */
/* AUTHOR */
/* */
/* Chaoqiong Xiao, Microsoft Corporation */
/* */
/* DESCRIPTION */
-/* */
-/* This function obtains a free device container for the new device. */
-/* */
-/* INPUT */
-/* */
-/* None */
-/* */
-/* OUTPUT */
-/* */
-/* UX_DEVICE pointer */
-/* */
-/* CALLS */
-/* */
-/* _ux_utility_memory_set Set memory to a value */
-/* */
-/* 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, verified */
-/* memset and memcpy cases, */
-/* resulting in version 6.1 */
-/* 07-29-2022 Chaoqiong Xiao Modified comment(s), */
-/* fixed standalone enum init, */
-/* resulting in version 6.1.12 */
+/* */
+/* This function obtains a free device container for the new device. */
+/* */
+/* INPUT */
+/* */
+/* None */
+/* */
+/* OUTPUT */
+/* */
+/* UX_DEVICE pointer */
+/* */
+/* CALLS */
+/* */
+/* _ux_utility_memory_set Set memory to a value */
+/* */
+/* CALLED BY */
+/* */
+/* USBX Components */
/* */
/**************************************************************************/
UX_DEVICE *_ux_host_stack_new_device_get(VOID)
@@ -82,10 +69,10 @@ ULONG container_index;
UX_DEVICE *device;
#if defined(UX_HOST_STANDALONE)
UX_DEVICE *enum_next;
-#endif
+#endif
/* Start with the first device. */
- device = _ux_system_host -> ux_system_host_device_array;
+ device = _ux_system_host -> ux_system_host_device_array;
#if UX_MAX_DEVICES > 1
/* Reset the container index. */
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 d671090b..bd5d3b71 100644
--- a/common/core/src/ux_host_stack_new_endpoint_create.c
+++ b/common/core/src/ux_host_stack_new_endpoint_create.c
@@ -1,18 +1,19 @@
/***************************************************************************
- * Copyright (c) 2024 Microsoft Corporation
- *
+ * Copyright (c) 2024 Microsoft Corporation
+ * Copyright (c) 2026-present Eclipse ThreadX contributors
+ *
* This program and the accompanying materials are made available under the
* terms of the MIT License which is available at
* https://opensource.org/licenses/MIT.
- *
+ *
* SPDX-License-Identifier: MIT
**************************************************************************/
/**************************************************************************/
/**************************************************************************/
-/** */
-/** USBX Component */
+/** */
+/** USBX Component */
/** */
/** Host Stack */
/** */
@@ -28,58 +29,43 @@
#include "ux_host_stack.h"
-/**************************************************************************/
-/* */
-/* FUNCTION RELEASE */
-/* */
-/* _ux_host_stack_new_endpoint_create PORTABLE C */
+/**************************************************************************/
+/* */
+/* FUNCTION RELEASE */
+/* */
+/* _ux_host_stack_new_endpoint_create PORTABLE C */
/* 6.1.11 */
/* AUTHOR */
/* */
/* Chaoqiong Xiao, Microsoft Corporation */
/* */
/* DESCRIPTION */
-/* */
-/* This function creates a new endpoint for the current interface */
-/* scanned. The endpoint is hooked to the interface that owns it. */
-/* It is not active yet until either the default interface for the */
-/* configuration is selected by a SET_CONFIGURATION or when an */
+/* */
+/* This function creates a new endpoint for the current interface */
+/* scanned. The endpoint is hooked to the interface that owns it. */
+/* It is not active yet until either the default interface for the */
+/* configuration is selected by a SET_CONFIGURATION or when an */
/* alternate setting for this interface is set. */
-/* */
-/* INPUT */
-/* */
-/* interface Interface container that owns */
+/* */
+/* INPUT */
+/* */
+/* interface Interface container that owns */
/* this endpoint */
-/* endpoint_pointer Pointer to a unparsed */
+/* endpoint_pointer Pointer to a unparsed */
/* endpoint descriptor */
-/* */
-/* OUTPUT */
-/* */
-/* Completion Status */
-/* */
-/* CALLS */
-/* */
-/* _ux_utility_descriptor_parse Parse the descriptor */
-/* _ux_utility_memory_allocate Allocate memory block */
-/* */
-/* CALLED BY */
-/* */
-/* USBX Components */
-/* */
-/* RELEASE HISTORY */
-/* */
-/* DATE NAME DESCRIPTION */
-/* */
-/* 05-19-2020 Chaoqiong Xiao Initial Version 6.0 */
-/* 09-30-2020 Chaoqiong Xiao Modified comment(s), */
-/* resulting in version 6.1 */
-/* 10-15-2021 Chaoqiong Xiao Modified comment(s), */
-/* added descriptor validate, */
-/* resulting in version 6.1.9 */
-/* 04-25-2022 Chaoqiong Xiao Modified comment(s), */
-/* internal clean up, */
-/* fixed size calculation, */
-/* resulting in version 6.1.11 */
+/* */
+/* OUTPUT */
+/* */
+/* Completion Status */
+/* */
+/* CALLS */
+/* */
+/* _ux_utility_descriptor_parse Parse the descriptor */
+/* _ux_utility_memory_allocate Allocate memory block */
+/* */
+/* CALLED BY */
+/* */
+/* USBX Components */
/* */
/**************************************************************************/
UINT _ux_host_stack_new_endpoint_create(UX_INTERFACE *interface_ptr,
@@ -104,7 +90,7 @@ ULONG n_tran;
endpoint container is not corrupted. */
endpoint -> ux_endpoint = (ULONG) (ALIGN_TYPE) endpoint;
- /* The endpoint container has a built in transfer_request.
+ /* The endpoint container has a built in transfer_request.
The transfer_request needs to point to the endpoint as well. */
endpoint -> ux_endpoint_transfer_request.ux_transfer_request_endpoint = endpoint;
@@ -191,13 +177,13 @@ ULONG n_tran;
/* Save transfer packet size. */
endpoint -> ux_endpoint_transfer_request.ux_transfer_request_packet_length = packet_size;
- /* The interface that owns this endpoint is memorized in the
+ /* The interface that owns this endpoint is memorized in the
endpoint container itself, easier for back chaining. */
endpoint -> ux_endpoint_interface = interface_ptr;
- /* There is 2 cases for the creation of the endpoint descriptor
+ /* There is 2 cases for the creation of the endpoint descriptor
if this is the first one, the endpoint descriptor is hooked
- to the interface.
+ to the interface.
If it is not the first one, the endpoint is hooked to the
end of the chain of endpoints. */
if (interface_ptr -> ux_interface_first_endpoint == UX_NULL)
@@ -209,7 +195,7 @@ ULONG n_tran;
{
list_endpoint = interface_ptr -> ux_interface_first_endpoint;
-
+
/* Traverse the list until the end. */
while (list_endpoint -> ux_endpoint_next_endpoint != UX_NULL)
list_endpoint = list_endpoint -> ux_endpoint_next_endpoint;
@@ -221,4 +207,4 @@ ULONG n_tran;
/* Return successful status. */
return(UX_SUCCESS);
}
-
+
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 8d43726e..a8a3c124 100644
--- a/common/core/src/ux_host_stack_new_interface_create.c
+++ b/common/core/src/ux_host_stack_new_interface_create.c
@@ -1,18 +1,19 @@
/***************************************************************************
- * Copyright (c) 2024 Microsoft Corporation
- *
+ * Copyright (c) 2024 Microsoft Corporation
+ * Copyright (c) 2026-present Eclipse ThreadX contributors
+ *
* This program and the accompanying materials are made available under the
* terms of the MIT License which is available at
* https://opensource.org/licenses/MIT.
- *
+ *
* SPDX-License-Identifier: MIT
**************************************************************************/
/**************************************************************************/
/**************************************************************************/
-/** */
-/** USBX Component */
+/** */
+/** USBX Component */
/** */
/** Host Stack */
/** */
@@ -28,61 +29,49 @@
#include "ux_host_stack.h"
-/**************************************************************************/
-/* */
-/* FUNCTION RELEASE */
-/* */
-/* _ux_host_stack_new_interface_create PORTABLE C */
+/**************************************************************************/
+/* */
+/* FUNCTION RELEASE */
+/* */
+/* _ux_host_stack_new_interface_create PORTABLE C */
/* 6.1.12 */
/* AUTHOR */
/* */
/* Chaoqiong Xiao, Microsoft Corporation */
/* */
/* DESCRIPTION */
-/* */
+/* */
/* This function creates a new interface for the current configuration */
-/* scanned. A device has at least 1 alternate setting per interface */
+/* scanned. A device has at least 1 alternate setting per interface */
/* which is the default one. */
/* */
/* The interface is hooked to the configuration that owns it. */
/* */
/* From the interface descriptor, all the endpoints are hooked but */
-/* not activated. */
-/* */
-/* INPUT */
-/* */
-/* configuration Configuration container that */
+/* not activated. */
+/* */
+/* INPUT */
+/* */
+/* configuration Configuration container that */
/* owns this interface */
-/* interface_pointer Pointer to a unparsed */
+/* interface_pointer Pointer to a unparsed */
/* interface descriptor */
-/* length Length remaining in this */
+/* length Length remaining in this */
/* descriptor */
-/* */
-/* OUTPUT */
-/* */
-/* Completion Status */
-/* */
-/* CALLS */
-/* */
-/* _ux_host_stack_new_endpoint_create Create new endpoint */
-/* _ux_utility_descriptor_parse Parse the descriptor */
-/* _ux_utility_memory_allocate Allocate memory block */
-/* */
-/* CALLED BY */
-/* */
-/* USBX Components */
-/* */
-/* RELEASE HISTORY */
-/* */
-/* DATE NAME DESCRIPTION */
-/* */
-/* 05-19-2020 Chaoqiong Xiao Initial Version 6.0 */
-/* 09-30-2020 Chaoqiong Xiao Modified comment(s), */
-/* resulting in version 6.1 */
-/* 07-29-2022 Chaoqiong Xiao Modified comment(s), */
-/* fixed parameter/variable */
-/* names conflict C++ keyword, */
-/* resulting in version 6.1.12 */
+/* */
+/* OUTPUT */
+/* */
+/* Completion Status */
+/* */
+/* CALLS */
+/* */
+/* _ux_host_stack_new_endpoint_create Create new endpoint */
+/* _ux_utility_descriptor_parse Parse the descriptor */
+/* _ux_utility_memory_allocate Allocate memory block */
+/* */
+/* CALLED BY */
+/* */
+/* USBX Components */
/* */
/**************************************************************************/
UINT _ux_host_stack_new_interface_create(UX_CONFIGURATION *configuration,
@@ -99,8 +88,8 @@ UCHAR *this_interface_descriptor;
/* Obtain memory for storing this new interface. */
interface_ptr = (UX_INTERFACE *) _ux_utility_memory_allocate(UX_NO_ALIGN, UX_REGULAR_MEMORY, sizeof(UX_INTERFACE));
-
- /* If no memory left, exit with error. */
+
+ /* If no memory left, exit with error. */
if (interface_ptr == UX_NULL)
return(UX_MEMORY_INSUFFICIENT);
@@ -114,18 +103,18 @@ UCHAR *this_interface_descriptor;
UX_INTERFACE_DESCRIPTOR_ENTRIES,
(UCHAR *) &interface_ptr -> ux_interface_descriptor);
- /* The configuration that owns this interface is memorized in the
+ /* The configuration that owns this interface is memorized in the
interface container itself, easier for back chaining. */
interface_ptr -> ux_interface_configuration = configuration;
-
+
/* If the interface belongs to an IAD, remember the IAD Class/SubClass/Protocol. */
interface_ptr -> ux_interface_iad_class = configuration -> ux_configuration_iad_class;
interface_ptr -> ux_interface_iad_subclass = configuration -> ux_configuration_iad_subclass;
interface_ptr -> ux_interface_iad_protocol = configuration -> ux_configuration_iad_protocol;
- /* There is 2 cases for the creation of the interface descriptor
+ /* There is 2 cases for the creation of the interface descriptor
if this is the first one, the interface descriptor is hooked
- to the configuration. If it is not the first one, the interface
+ to the configuration. If it is not the first one, the interface
is hooked to the end of the chain of interfaces. */
if (configuration -> ux_configuration_first_interface == UX_NULL)
{
@@ -133,9 +122,9 @@ UCHAR *this_interface_descriptor;
}
else
{
-
+
list_interface = configuration -> ux_configuration_first_interface;
-
+
/* Traverse the list until we reach the end */
while (list_interface -> ux_interface_next_interface != UX_NULL)
{
@@ -172,7 +161,7 @@ UCHAR *this_interface_descriptor;
UX_TRACE_IN_LINE_INSERT(UX_TRACE_ERROR, UX_DESCRIPTOR_CORRUPTED, descriptor, 0, 0, UX_TRACE_ERRORS, 0, 0)
return(UX_DESCRIPTOR_CORRUPTED);
- }
+ }
/* Check the type for an interface descriptor. */
if (descriptor_type == UX_ENDPOINT_DESCRIPTOR_ITEM)
@@ -186,7 +175,7 @@ UCHAR *this_interface_descriptor;
return(status);
number_endpoints--;
- }
+ }
/* Verify if the descriptor is still valid, or we moved to next interface. */
if ((descriptor_length > length) || (descriptor_type == UX_INTERFACE_DESCRIPTOR_ITEM && descriptor != this_interface_descriptor))
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 cb4b40bd..7ce96d4c 100644
--- a/common/core/src/ux_host_stack_rh_change_process.c
+++ b/common/core/src/ux_host_stack_rh_change_process.c
@@ -1,18 +1,19 @@
/***************************************************************************
- * Copyright (c) 2024 Microsoft Corporation
- *
+ * Copyright (c) 2024 Microsoft Corporation
+ * Copyright (c) 2026-present Eclipse ThreadX contributors
+ *
* This program and the accompanying materials are made available under the
* terms of the MIT License which is available at
* https://opensource.org/licenses/MIT.
- *
+ *
* SPDX-License-Identifier: MIT
**************************************************************************/
/**************************************************************************/
/**************************************************************************/
-/** */
-/** USBX Component */
+/** */
+/** USBX Component */
/** */
/** Host Stack */
/** */
@@ -28,50 +29,38 @@
#include "ux_host_stack.h"
-/**************************************************************************/
-/* */
-/* FUNCTION RELEASE */
-/* */
-/* _ux_host_stack_rh_change_process PORTABLE C */
+/**************************************************************************/
+/* */
+/* FUNCTION RELEASE */
+/* */
+/* _ux_host_stack_rh_change_process PORTABLE C */
/* 6.1.2 */
/* AUTHOR */
/* */
/* Chaoqiong Xiao, Microsoft Corporation */
/* */
/* DESCRIPTION */
-/* */
-/* This function checks for changes in topology in each of the */
-/* installed HCDs. */
-/* */
-/* INPUT */
-/* */
-/* None */
-/* */
-/* OUTPUT */
-/* */
-/* None */
-/* */
-/* CALLS */
-/* */
-/* _ux_host_stack_rh_device_insertion Process device insertion */
-/* _ux_host_stack_rh_device_extraction Process device extraction */
-/* (ux_hcd_entry_function) HCD entry function */
-/* */
-/* 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), */
-/* used new interrupt macros, */
-/* resulting in version 6.1 */
-/* 11-09-2020 Chaoqiong Xiao Modified comment(s), */
-/* fixed registered HCD scan, */
-/* resulting in version 6.1.2 */
+/* */
+/* This function checks for changes in topology in each of the */
+/* installed HCDs. */
+/* */
+/* INPUT */
+/* */
+/* None */
+/* */
+/* OUTPUT */
+/* */
+/* None */
+/* */
+/* CALLS */
+/* */
+/* _ux_host_stack_rh_device_insertion Process device insertion */
+/* _ux_host_stack_rh_device_extraction Process device extraction */
+/* (ux_hcd_entry_function) HCD entry function */
+/* */
+/* CALLED BY */
+/* */
+/* USBX Components */
/* */
/**************************************************************************/
VOID _ux_host_stack_rh_change_process(VOID)
@@ -83,7 +72,7 @@ ULONG port_status;
UINT port_index;
UX_INTERRUPT_SAVE_AREA
- /* This thread was maybe awaken by one or more HCD controllers. Check each
+ /* 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. */
for(hcd_index = 0; hcd_index < UX_SYSTEM_HOST_MAX_HCD_GET(); hcd_index++)
{
@@ -113,22 +102,22 @@ UX_INTERRUPT_SAVE_AREA
/* Call HCD for port status. */
port_status = hcd -> ux_hcd_entry_function(hcd, UX_HCD_GET_PORT_STATUS, (VOID *)((ALIGN_TYPE)port_index));
-
+
/* Check return status. */
if (port_status != UX_PORT_INDEX_UNKNOWN)
{
-
+
/* The port_status value is valid and will tell us if there is
a device attached\detached on the downstream port. */
if (port_status & UX_PS_CCS)
{
-
- /* There is a device attached to this port. Check if we know
+
+ /* There is a device attached to this port. Check if we know
about it. If not, this is a device insertion signal. */
if ((hcd -> ux_hcd_rh_device_connection & (ULONG)(1 << port_index)) == 0)
{
-
- /* We have a simple device insertion, we have not lost any signals.
+
+ /* We have a simple device insertion, we have not lost any signals.
the root hub and the stack enumeration module are in synch. */
_ux_host_stack_rh_device_insertion(hcd,port_index);
}
@@ -139,7 +128,7 @@ UX_INTERRUPT_SAVE_AREA
We check the number of events in the root hub signal. If it is not zero
we are out of synch, meaning we got a disconnection followed very quickly
by a insertion. */
-
+
if (hcd -> ux_hcd_root_hub_signal[port_index] != 0)
{
@@ -147,13 +136,13 @@ UX_INTERRUPT_SAVE_AREA
UX_DISABLE
hcd -> ux_hcd_root_hub_signal[port_index] = 0;
UX_RESTORE
-
+
/* First extract the device. */
_ux_host_stack_rh_device_extraction(hcd,port_index);
-
+
/* Now, insert it again. */
_ux_host_stack_rh_device_insertion(hcd,port_index);
-
+
}
@@ -161,8 +150,8 @@ UX_INTERRUPT_SAVE_AREA
}
else
{
-
- /* There is no device attached to this port. Check if we know
+
+ /* There is no device attached to this port. Check if we know
about it. If not, this is a device removal signal. */
if ((hcd -> ux_hcd_rh_device_connection & (ULONG)(1 << port_index)) !=0)
{
@@ -172,7 +161,7 @@ UX_INTERRUPT_SAVE_AREA
}
}
}
- }
+ }
}
}
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 24e8c358..6c01ea04 100644
--- a/common/core/src/ux_host_stack_rh_device_extraction.c
+++ b/common/core/src/ux_host_stack_rh_device_extraction.c
@@ -1,18 +1,19 @@
/***************************************************************************
- * Copyright (c) 2024 Microsoft Corporation
- *
+ * Copyright (c) 2024 Microsoft Corporation
+ * Copyright (c) 2026-present Eclipse ThreadX contributors
+ *
* This program and the accompanying materials are made available under the
* terms of the MIT License which is available at
* https://opensource.org/licenses/MIT.
- *
+ *
* SPDX-License-Identifier: MIT
**************************************************************************/
/**************************************************************************/
/**************************************************************************/
-/** */
-/** USBX Component */
+/** */
+/** USBX Component */
/** */
/** Host Stack */
/** */
@@ -28,45 +29,37 @@
#include "ux_host_stack.h"
-/**************************************************************************/
-/* */
-/* FUNCTION RELEASE */
-/* */
-/* _ux_host_stack_rh_device_extraction PORTABLE C */
+/**************************************************************************/
+/* */
+/* FUNCTION RELEASE */
+/* */
+/* _ux_host_stack_rh_device_extraction PORTABLE C */
/* 6.1 */
/* AUTHOR */
/* */
/* Chaoqiong Xiao, Microsoft Corporation */
/* */
/* DESCRIPTION */
-/* */
-/* This function handles a device extraction on a downstream port */
-/* of the root hub pointed by HCD. */
-/* */
-/* INPUT */
-/* */
-/* HCD Pointer to HCD structure */
-/* port_index Port index of insertion */
-/* */
-/* OUTPUT */
-/* */
-/* Completion Status */
-/* */
-/* CALLS */
-/* */
-/* _ux_host_stack_device_remove Remove device */
-/* */
-/* CALLED BY */
-/* */
-/* USBX Components */
-/* */
-/* RELEASE HISTORY */
-/* */
-/* DATE NAME DESCRIPTION */
-/* */
-/* 05-19-2020 Chaoqiong Xiao Initial Version 6.0 */
-/* 09-30-2020 Chaoqiong Xiao Modified comment(s), */
-/* resulting in version 6.1 */
+/* */
+/* This function handles a device extraction on a downstream port */
+/* of the root hub pointed by HCD. */
+/* */
+/* INPUT */
+/* */
+/* HCD Pointer to HCD structure */
+/* port_index Port index of insertion */
+/* */
+/* OUTPUT */
+/* */
+/* Completion Status */
+/* */
+/* CALLS */
+/* */
+/* _ux_host_stack_device_remove Remove device */
+/* */
+/* CALLED BY */
+/* */
+/* USBX Components */
/* */
/**************************************************************************/
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 4843e4f0..d00e5263 100644
--- a/common/core/src/ux_host_stack_rh_device_insertion.c
+++ b/common/core/src/ux_host_stack_rh_device_insertion.c
@@ -1,10 +1,11 @@
/***************************************************************************
- * Copyright (c) 2024 Microsoft Corporation
- *
+ * Copyright (c) 2024 Microsoft Corporation
+ * Copyright (c) 2026-present Eclipse ThreadX contributors
+ *
* This program and the accompanying materials are made available under the
* terms of the MIT License which is available at
* https://opensource.org/licenses/MIT.
- *
+ *
* SPDX-License-Identifier: MIT
**************************************************************************/
@@ -63,30 +64,6 @@
/* */
/* USBX Components */
/* */
-/* RELEASE HISTORY */
-/* */
-/* 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 */
-/* 02-02-2021 Chaoqiong Xiao Modified comment(s), */
-/* handled more fail cases, */
-/* updated internal call, */
-/* added notification for */
-/* device connection, */
-/* added disconnection check */
-/* in enumeration retries, */
-/* resulting in version 6.1.4 */
-/* 01-31-2022 Chaoqiong Xiao Modified comment(s), */
-/* added standalone support, */
-/* resulting in version 6.1.10 */
-/* 04-25-2022 Chaoqiong Xiao Modified comment(s), */
-/* internal clean up, */
-/* resulting in version 6.1.11 */
-/* */
/**************************************************************************/
UINT _ux_host_stack_rh_device_insertion(UX_HCD *hcd, UINT port_index)
{
diff --git a/common/core/src/ux_host_stack_role_swap.c b/common/core/src/ux_host_stack_role_swap.c
index c6ee7be5..bb57e0c0 100644
--- a/common/core/src/ux_host_stack_role_swap.c
+++ b/common/core/src/ux_host_stack_role_swap.c
@@ -1,18 +1,19 @@
/***************************************************************************
- * Copyright (c) 2024 Microsoft Corporation
- *
+ * Copyright (c) 2024 Microsoft Corporation
+ * Copyright (c) 2026-present Eclipse ThreadX contributors
+ *
* This program and the accompanying materials are made available under the
* terms of the MIT License which is available at
* https://opensource.org/licenses/MIT.
- *
+ *
* SPDX-License-Identifier: MIT
**************************************************************************/
/**************************************************************************/
/**************************************************************************/
-/** */
-/** USBX Component */
+/** */
+/** USBX Component */
/** */
/** Host Stack */
/** */
@@ -28,52 +29,39 @@
#include "ux_host_stack.h"
-/**************************************************************************/
-/* */
-/* FUNCTION RELEASE */
-/* */
-/* _ux_host_stack_role_swap PORTABLE C */
+/**************************************************************************/
+/* */
+/* FUNCTION RELEASE */
+/* */
+/* _ux_host_stack_role_swap PORTABLE C */
/* 6.1.10 */
/* AUTHOR */
/* */
/* Chaoqiong Xiao, Microsoft Corporation */
/* */
/* DESCRIPTION */
-/* */
-/* This function is called when the host or the device demand a role */
-/* swap. This function may be called by an application or by the HNP */
-/* thread. */
-/* */
-/* INPUT */
-/* */
-/* hcd Pointer to HCD */
-/* device Device pointer */
-/* */
-/* OUTPUT */
-/* */
-/* Status */
-/* */
-/* CALLS */
-/* */
+/* */
+/* This function is called when the host or the device demand a role */
+/* swap. This function may be called by an application or by the HNP */
+/* thread. */
+/* */
+/* INPUT */
+/* */
+/* hcd Pointer to HCD */
+/* device Device pointer */
+/* */
+/* OUTPUT */
+/* */
+/* Status */
+/* */
+/* CALLS */
+/* */
/* _ux_utility_semaphore_get Get semaphore */
/* _ux_host_stack_transfer_request Transfer request */
-/* */
-/* CALLED BY */
-/* */
-/* Application of HNP thread. */
-/* */
-/* 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 */
-/* 01-31-2022 Chaoqiong Xiao Modified comment(s), */
-/* refined macros names, */
-/* resulting in version 6.1.10 */
+/* */
+/* CALLED BY */
+/* */
+/* Application of HNP thread. */
/* */
/**************************************************************************/
UINT _ux_host_stack_role_swap(UX_DEVICE *device)
@@ -88,12 +76,12 @@ UINT _ux_host_stack_role_swap(UX_DEVICE *device)
UX_ENDPOINT *control_endpoint;
UX_TRANSFER *transfer_request;
UINT status;
-
+
/* Retrieve the control endpoint and the transfer request associated with it. */
control_endpoint = &device -> ux_device_control_endpoint;
transfer_request = &control_endpoint -> ux_endpoint_transfer_request;
- /* Protect the control endpoint semaphore here. It will be unprotected in the
+ /* Protect the control endpoint semaphore here. It will be unprotected in the
transfer request function. */
status = _ux_host_semaphore_get(&device -> ux_device_protection_semaphore, UX_WAIT_FOREVER);
@@ -103,13 +91,13 @@ UINT status;
transfer_request -> ux_transfer_request_type = UX_REQUEST_OUT | UX_REQUEST_TYPE_STANDARD | UX_REQUEST_TARGET_DEVICE;
transfer_request -> ux_transfer_request_value = UX_OTG_FEATURE_B_HNP_ENABLE;
transfer_request -> ux_transfer_request_index = 0;
-
+
/* Send request to HCD layer. */
status = _ux_host_stack_transfer_request(transfer_request);
/* If the status fails, simply ignore the command but do not proceed. */
if (status != UX_SUCCESS)
-
+
/* We have an error. Do not proceed. */
return(status);
@@ -118,10 +106,10 @@ UINT status;
/* Call the OTG function that will perform the swap. */
_ux_system_otg -> ux_system_otg_function(UX_OTG_HOST_TO_SLAVE);
-
+
/* Reset the event. */
_ux_system_otg -> ux_system_otg_change_mode_event = 0;
-
+
return(UX_SUCCESS);
#endif
}
diff --git a/common/core/src/ux_host_stack_tasks_run.c b/common/core/src/ux_host_stack_tasks_run.c
index 8821dc00..d5111da1 100644
--- a/common/core/src/ux_host_stack_tasks_run.c
+++ b/common/core/src/ux_host_stack_tasks_run.c
@@ -1,10 +1,11 @@
/***************************************************************************
- * Copyright (c) 2024 Microsoft Corporation
- *
+ * Copyright (c) 2024 Microsoft Corporation
+ * Copyright (c) 2026-present Eclipse ThreadX contributors
+ *
* This program and the accompanying materials are made available under the
* terms of the MIT License which is available at
* https://opensource.org/licenses/MIT.
- *
+ *
* SPDX-License-Identifier: MIT
**************************************************************************/
@@ -94,25 +95,6 @@ static inline VOID _ux_host_stack_pending_transfers_run(VOID);
/* */
/* Application */
/* */
-/* RELEASE HISTORY */
-/* */
-/* DATE NAME DESCRIPTION */
-/* */
-/* 01-31-2022 Chaoqiong Xiao Initial Version 6.1.10 */
-/* 07-29-2022 Chaoqiong Xiao Modified comment(s), */
-/* added standalone hub, */
-/* used shared descriptor in */
-/* device instance for enum, */
-/* resulting in version 6.1.12 */
-/* 10-31-2022 Chaoqiong Xiao Modified comment(s), */
-/* improved internal logic, */
-/* fixed activation issue on */
-/* no class linked interfaces, */
-/* resulting in version 6.2.0 */
-/* 10-31-2023 Chaoqiong Xiao Modified comment(s), */
-/* improved enum transfer, */
-/* resulting in version 6.3.0 */
-/* */
/**************************************************************************/
UINT _ux_host_stack_tasks_run(VOID)
{
@@ -841,7 +823,7 @@ INT immediate_state = UX_TRUE;
/* The device is now in the unconfigured state. We need to deal
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. */
+ current fault. */
configuration = device -> ux_device_enum_inst.configuration;
if (((configuration -> ux_configuration_descriptor.bmAttributes &
UX_CONFIGURATION_DEVICE_SELF_POWERED) == 0) &&
diff --git a/common/core/src/ux_host_stack_transfer_request.c b/common/core/src/ux_host_stack_transfer_request.c
index 0ed316fa..3b15f88a 100644
--- a/common/core/src/ux_host_stack_transfer_request.c
+++ b/common/core/src/ux_host_stack_transfer_request.c
@@ -1,18 +1,19 @@
/***************************************************************************
- * Copyright (c) 2024 Microsoft Corporation
- *
+ * Copyright (c) 2024 Microsoft Corporation
+ * Copyright (c) 2026-present Eclipse ThreadX contributors
+ *
* This program and the accompanying materials are made available under the
* terms of the MIT License which is available at
* https://opensource.org/licenses/MIT.
- *
+ *
* SPDX-License-Identifier: MIT
**************************************************************************/
/**************************************************************************/
/**************************************************************************/
-/** */
-/** USBX Component */
+/** */
+/** USBX Component */
/** */
/** Host Stack */
/** */
@@ -28,65 +29,49 @@
#include "ux_host_stack.h"
-/**************************************************************************/
-/* */
-/* FUNCTION RELEASE */
-/* */
-/* _ux_host_stack_transfer_request PORTABLE C */
+/**************************************************************************/
+/* */
+/* FUNCTION RELEASE */
+/* */
+/* _ux_host_stack_transfer_request PORTABLE C */
/* 6.1.10 */
/* AUTHOR */
/* */
/* Chaoqiong Xiao, Microsoft Corporation */
/* */
/* DESCRIPTION */
-/* */
-/* This function performs a USB transaction. On entry the transfer */
-/* request gives the endpoint pipe selected for this transaction and */
-/* the parameters associated with the transfer (data payload, length */
+/* */
+/* This function performs a USB transaction. On entry the transfer */
+/* request gives the endpoint pipe selected for this transaction and */
+/* the parameters associated with the transfer (data payload, length */
/* of transaction) */
/* */
-/* For Control pipe, the transaction is blocking and will only return */
-/* when the 3 phases of the control transfer have been completed or if */
-/* there is a previous error. For other pipes, the USB stack will */
-/* schedule the transaction on the USB but will not wait for its */
-/* completion. Each request for non blocking pipes has to specify a */
+/* For Control pipe, the transaction is blocking and will only return */
+/* when the 3 phases of the control transfer have been completed or if */
+/* there is a previous error. For other pipes, the USB stack will */
+/* schedule the transaction on the USB but will not wait for its */
+/* completion. Each request for non blocking pipes has to specify a */
/* completion routine. */
-/* */
-/* INPUT */
-/* */
-/* transfer_request Transfer request structure */
-/* */
-/* OUTPUT */
-/* */
-/* Completion Status If UX_SUCCESS, transfer was */
-/* successfully started */
-/* */
-/* CALLS */
-/* */
-/* HCD Entry Function */
+/* */
+/* INPUT */
+/* */
+/* transfer_request Transfer request structure */
+/* */
+/* OUTPUT */
+/* */
+/* Completion Status If UX_SUCCESS, transfer was */
+/* successfully started */
+/* */
+/* CALLS */
+/* */
+/* HCD Entry Function */
/* _ux_utility_semaphore_put Put semaphore */
/* _ux_utility_semaphore_get Get semaphore */
-/* */
-/* 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, used UX prefix */
-/* to refer to TX symbols */
-/* instead of using them */
-/* directly, */
-/* resulting in version 6.1 */
-/* 01-31-2022 Chaoqiong Xiao Modified comment(s), */
-/* added standalone support, */
-/* resulting in version 6.1.10 */
+/* */
+/* CALLED BY */
+/* */
+/* Application */
+/* USBX Components */
/* */
/**************************************************************************/
UINT _ux_host_stack_transfer_request(UX_TRANSFER *transfer_request)
@@ -124,11 +109,11 @@ UINT status;
#else
UX_INTERRUPT_SAVE_AREA
-UX_ENDPOINT *endpoint;
-UX_DEVICE *device;
+UX_ENDPOINT *endpoint;
+UX_DEVICE *device;
UX_HCD *hcd;
UINT status;
-
+
/* Get the endpoint container from the transfer_request */
endpoint = transfer_request -> ux_transfer_request_endpoint;
@@ -136,7 +121,7 @@ UINT status;
/* Get the device container from the endpoint. */
device = endpoint -> ux_endpoint_device;
- /* Ensure we are not preempted by the enum thread while we check the device
+ /* Ensure we are not preempted by the enum thread while we check the device
state and set the transfer status. */
UX_DISABLE
@@ -180,7 +165,7 @@ UINT status;
/* 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 = UX_DEVICE_HCD_GET(device);
@@ -189,21 +174,21 @@ UINT status;
{
/* Check if the class has already protected it. */
- if (_ux_host_semaphore_waiting(&device -> ux_device_protection_semaphore))
+ if (_ux_host_semaphore_waiting(&device -> ux_device_protection_semaphore))
{
/* We are using endpoint 0. Protect with semaphore. */
status = _ux_host_semaphore_get(&device -> ux_device_protection_semaphore, UX_WAIT_FOREVER);
-
+
/* Check for status. */
if (status != UX_SUCCESS)
-
+
/* Something went wrong. */
return(status);
- }
- }
-
- /* Send the command to the controller. */
+ }
+ }
+
+ /* Send the command to the controller. */
status = hcd -> ux_hcd_entry_function(hcd, UX_HCD_TRANSFER_REQUEST, transfer_request);
/* If this is endpoint 0, we unprotect the endpoint. */
@@ -248,12 +233,6 @@ UINT status;
/* */
/* Application */
/* */
-/* RELEASE HISTORY */
-/* */
-/* DATE NAME DESCRIPTION */
-/* */
-/* 10-31-2023 Chaoqiong Xiao Initial Version 6.3.0 */
-/* */
/**************************************************************************/
UINT _uxe_host_stack_transfer_request(UX_TRANSFER *transfer_request)
{
diff --git a/common/core/src/ux_host_stack_transfer_request_abort.c b/common/core/src/ux_host_stack_transfer_request_abort.c
index 0059c5d4..7f7e533d 100644
--- a/common/core/src/ux_host_stack_transfer_request_abort.c
+++ b/common/core/src/ux_host_stack_transfer_request_abort.c
@@ -1,18 +1,19 @@
/***************************************************************************
- * Copyright (c) 2024 Microsoft Corporation
- *
+ * Copyright (c) 2024 Microsoft Corporation
+ * Copyright (c) 2026-present Eclipse ThreadX contributors
+ *
* This program and the accompanying materials are made available under the
* terms of the MIT License which is available at
* https://opensource.org/licenses/MIT.
- *
+ *
* SPDX-License-Identifier: MIT
**************************************************************************/
/**************************************************************************/
/**************************************************************************/
-/** */
-/** USBX Component */
+/** */
+/** USBX Component */
/** */
/** Host Stack */
/** */
@@ -28,62 +29,44 @@
#include "ux_host_stack.h"
-/**************************************************************************/
-/* */
-/* FUNCTION RELEASE */
-/* */
-/* _ux_host_stack_transfer_request_abort PORTABLE C */
+/**************************************************************************/
+/* */
+/* FUNCTION RELEASE */
+/* */
+/* _ux_host_stack_transfer_request_abort PORTABLE C */
/* 6.2.0 */
/* AUTHOR */
/* */
/* Chaoqiong Xiao, Microsoft Corporation */
/* */
/* DESCRIPTION */
-/* */
-/* This function aborts a pending transfer request that has been */
-/* previously submitted. This function only cancels the specific */
+/* */
+/* This function aborts a pending transfer request that has been */
+/* previously submitted. This function only cancels the specific */
/* transfer request. */
/* */
-/* The call back to the function will have the */
-/* UX_TRANSFER_STATUS_ABORT status. */
-/* */
-/* INPUT */
-/* */
-/* transfer_request Transfer request structure */
-/* */
-/* OUTPUT */
-/* */
-/* Completion Status If UX_SUCCESS, transfer was */
-/* successfully aborted */
-/* */
-/* CALLS */
-/* */
-/* HCD Entry Function */
-/* Transfer Completion Function */
+/* The call back to the function will have the */
+/* UX_TRANSFER_STATUS_ABORT status. */
+/* */
+/* INPUT */
+/* */
+/* transfer_request Transfer request structure */
+/* */
+/* OUTPUT */
+/* */
+/* Completion Status If UX_SUCCESS, transfer was */
+/* successfully aborted */
+/* */
+/* CALLS */
+/* */
+/* HCD Entry Function */
+/* Transfer Completion Function */
/* _ux_utility_semaphore_put Put semaphore */
-/* */
-/* 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, */
-/* resulting in version 6.1 */
-/* 06-02-2021 Chaoqiong Xiao Modified comment(s), */
-/* fixed trace enabled error, */
-/* resulting in version 6.1.7 */
-/* 01-31-2022 Chaoqiong Xiao Modified comment(s), */
-/* added standalone support, */
-/* resulting in version 6.1.10 */
-/* 10-31-2022 Chaoqiong Xiao Modified comment(s), */
-/* resulting in version 6.2.0 */
+/* */
+/* CALLED BY */
+/* */
+/* Application */
+/* USBX Components */
/* */
/**************************************************************************/
UINT _ux_host_stack_transfer_request_abort(UX_TRANSFER *transfer_request)
@@ -98,7 +81,7 @@ ULONG completion_code;
transfer_request -> ux_transfer_request_endpoint -> ux_endpoint_device,
transfer_request -> ux_transfer_request_endpoint,
transfer_request, 0, UX_TRACE_HOST_STACK_EVENTS, 0, 0)
-
+
/* With the device we have the pointer to the HCD. */
hcd = UX_DEVICE_HCD_GET(transfer_request -> ux_transfer_request_endpoint -> ux_endpoint_device);
@@ -106,7 +89,7 @@ ULONG completion_code;
if (transfer_request -> ux_transfer_request_completion_code == UX_TRANSFER_STATUS_PENDING)
{
- /* Send the abort command to the controller. */
+ /* Send the abort command to the controller. */
hcd -> ux_hcd_entry_function(hcd, UX_HCD_TRANSFER_ABORT, transfer_request);
/* Save the completion code since we're about to set it to ABORT. The
@@ -123,17 +106,17 @@ ULONG completion_code;
/* Set the transfer_request status to abort. */
transfer_request -> ux_transfer_request_completion_code = UX_TRANSFER_STATUS_ABORT;
- /* We need to inform the class that owns this transfer_request of the
+ /* We need to inform the class that owns this transfer_request of the
abort if there is a call back mechanism. */
if (transfer_request -> ux_transfer_request_completion_function != UX_NULL)
transfer_request -> ux_transfer_request_completion_function(transfer_request);
-
+
/* Is a thread waiting on the semaphore? */
if (/* Is the transfer pending? */
completion_code == UX_TRANSFER_STATUS_PENDING &&
#if !defined(UX_HOST_STANDALONE)
/* Is the thread waiting not this one? (clearly we're not waiting!) */
- transfer_request -> ux_transfer_request_thread_pending != _ux_utility_thread_identify() &&
+ transfer_request -> ux_transfer_request_thread_pending != _ux_utility_thread_identify() &&
#endif
/* Does the transfer request not have a completion function? */
transfer_request -> ux_transfer_request_completion_function == UX_NULL)
@@ -141,9 +124,9 @@ ULONG completion_code;
/* Wake up the semaphore for this request. */
_ux_host_semaphore_put(&transfer_request -> ux_transfer_request_semaphore);
}
-
+
/* This function never fails! */
- return(UX_SUCCESS);
+ return(UX_SUCCESS);
}
@@ -178,12 +161,6 @@ ULONG completion_code;
/* */
/* Application */
/* */
-/* RELEASE HISTORY */
-/* */
-/* DATE NAME DESCRIPTION */
-/* */
-/* 10-31-2023 Chaoqiong Xiao Initial Version 6.3.0 */
-/* */
/**************************************************************************/
UINT _uxe_host_stack_transfer_request_abort(UX_TRANSFER *transfer_request)
{
diff --git a/common/core/src/ux_host_stack_transfer_run.c b/common/core/src/ux_host_stack_transfer_run.c
index de158283..73f4e870 100644
--- a/common/core/src/ux_host_stack_transfer_run.c
+++ b/common/core/src/ux_host_stack_transfer_run.c
@@ -1,10 +1,11 @@
/***************************************************************************
- * Copyright (c) 2024 Microsoft Corporation
- *
+ * Copyright (c) 2024 Microsoft Corporation
+ * Copyright (c) 2026-present Eclipse ThreadX contributors
+ *
* This program and the accompanying materials are made available under the
* terms of the MIT License which is available at
* https://opensource.org/licenses/MIT.
- *
+ *
* SPDX-License-Identifier: MIT
**************************************************************************/
@@ -80,12 +81,6 @@ static inline void _ux_host_stack_transfer_retire(UX_TRANSFER *transfer);
/* Application */
/* USBX Components */
/* */
-/* RELEASE HISTORY */
-/* */
-/* DATE NAME DESCRIPTION */
-/* */
-/* 01-31-2022 Chaoqiong Xiao Initial Version 6.1.10 */
-/* */
/**************************************************************************/
UINT _ux_host_stack_transfer_run(UX_TRANSFER *transfer_request)
{
@@ -196,10 +191,10 @@ UINT status;
/* All transfers pending need to abort. There may have been a partial transfer. */
_ux_host_stack_transfer_request_abort(transfer_request);
-
+
/* Set the completion code. */
transfer_request -> ux_transfer_request_completion_code = UX_TRANSFER_TIMEOUT;
-
+
/* There was an error: simplify to idle. */
UX_DISABLE
UX_TRANSFER_STATE_IDLE(transfer_request);
@@ -324,12 +319,6 @@ UX_TRANSFER *previous;
/* */
/* Application */
/* */
-/* RELEASE HISTORY */
-/* */
-/* DATE NAME DESCRIPTION */
-/* */
-/* 10-31-2023 Chaoqiong Xiao Initial Version 6.3.0 */
-/* */
/**************************************************************************/
UINT _uxe_host_stack_transfer_run(UX_TRANSFER *transfer_request)
{
diff --git a/common/core/src/ux_host_stack_uninitialize.c b/common/core/src/ux_host_stack_uninitialize.c
index fa5a95bb..36b1f8b0 100644
--- a/common/core/src/ux_host_stack_uninitialize.c
+++ b/common/core/src/ux_host_stack_uninitialize.c
@@ -1,10 +1,11 @@
/***************************************************************************
- * Copyright (c) 2024 Microsoft Corporation
- *
+ * Copyright (c) 2024 Microsoft Corporation
+ * Copyright (c) 2026-present Eclipse ThreadX contributors
+ *
* This program and the accompanying materials are made available under the
* terms of the MIT License which is available at
* https://opensource.org/licenses/MIT.
- *
+ *
* SPDX-License-Identifier: MIT
**************************************************************************/
@@ -66,18 +67,6 @@
/* */
/* Application */
/* */
-/* RELEASE HISTORY */
-/* */
-/* DATE NAME DESCRIPTION */
-/* */
-/* 09-30-2020 Chaoqiong Xiao Initial Version 6.1 */
-/* 08-02-2021 Xiuwen Cai Modified comment(s), */
-/* fixed compile issue, */
-/* resulting in version 6.1.8 */
-/* 01-31-2022 Chaoqiong Xiao Modified comment(s), */
-/* added standalone support, */
-/* resulting in version 6.1.10 */
-/* */
/**************************************************************************/
UINT _ux_host_stack_uninitialize(VOID)
{
diff --git a/common/core/src/ux_system_error_handler.c b/common/core/src/ux_system_error_handler.c
index 5e1c2d82..1ea326a4 100644
--- a/common/core/src/ux_system_error_handler.c
+++ b/common/core/src/ux_system_error_handler.c
@@ -1,18 +1,19 @@
/***************************************************************************
- * Copyright (c) 2024 Microsoft Corporation
- *
+ * Copyright (c) 2024 Microsoft Corporation
+ * Copyright (c) 2026-present Eclipse ThreadX contributors
+ *
* This program and the accompanying materials are made available under the
* terms of the MIT License which is available at
* https://opensource.org/licenses/MIT.
- *
+ *
* SPDX-License-Identifier: MIT
**************************************************************************/
/**************************************************************************/
/**************************************************************************/
-/** */
-/** USBX Component */
+/** */
+/** USBX Component */
/** */
/** System */
/** */
@@ -27,46 +28,38 @@
#ifndef UX_DISABLE_ERROR_HANDLER
-/**************************************************************************/
-/* */
-/* FUNCTION RELEASE */
-/* */
-/* _ux_system_error_handler PORTABLE C */
+/**************************************************************************/
+/* */
+/* FUNCTION RELEASE */
+/* */
+/* _ux_system_error_handler PORTABLE C */
/* 6.1 */
/* AUTHOR */
/* */
/* Chaoqiong Xiao, Microsoft Corporation */
/* */
/* DESCRIPTION */
-/* */
-/* This function saves the last critical error from USBX functions. */
-/* It is mainly used for debugging purpose to trap where error occurred*/
-/* */
-/* */
-/* INPUT */
-/* */
-/* error_code */
-/* */
-/* */
-/* OUTPUT */
-/* */
+/* */
+/* This function saves the last critical error from USBX functions. */
+/* It is mainly used for debugging purpose to trap where error occurred*/
+/* */
+/* */
+/* INPUT */
+/* */
+/* error_code */
+/* */
+/* */
+/* OUTPUT */
+/* */
/* None */
-/* */
-/* CALLS */
-/* */
+/* */
+/* CALLS */
+/* */
/* None */
-/* */
-/* 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), */
-/* resulting in version 6.1 */
+/* */
+/* CALLED BY */
+/* */
+/* Application */
/* */
/**************************************************************************/
VOID _ux_system_error_handler(UINT system_level, UINT system_context, UINT error_code)
@@ -74,13 +67,13 @@ VOID _ux_system_error_handler(UINT system_level, UINT system_context, UINT err
/* Save the last system error code. */
_ux_system -> ux_system_last_error = error_code;
-
+
/* Increment the total number of system errors. */
_ux_system -> ux_system_error_count++;
/* Is there an application call back function to call ? */
if (_ux_system -> ux_system_error_callback_function != UX_NULL)
- {
+ {
/* The callback function is defined, call it. */
_ux_system -> ux_system_error_callback_function(system_level, system_context, error_code);
diff --git a/common/core/src/ux_system_initialize.c b/common/core/src/ux_system_initialize.c
index a3e27c47..4c684722 100644
--- a/common/core/src/ux_system_initialize.c
+++ b/common/core/src/ux_system_initialize.c
@@ -1,10 +1,11 @@
/***************************************************************************
- * Copyright (c) 2024 Microsoft Corporation
- *
+ * Copyright (c) 2024 Microsoft Corporation
+ * Copyright (c) 2026-present Eclipse ThreadX contributors
+ *
* This program and the accompanying materials are made available under the
* terms of the MIT License which is available at
* https://opensource.org/licenses/MIT.
- *
+ *
* SPDX-License-Identifier: MIT
**************************************************************************/
@@ -99,27 +100,6 @@ UCHAR _ux_system_container_id_descriptor_structure[] = {1,1
/* */
/* Application */
/* */
-/* RELEASE HISTORY */
-/* */
-/* DATE NAME DESCRIPTION */
-/* */
-/* 05-19-2020 Chaoqiong Xiao Initial Version 6.0 */
-/* 09-30-2020 Chaoqiong Xiao Modified comment(s), */
-/* verified memset and memcpy */
-/* cases, */
-/* resulting in version 6.1 */
-/* 12-31-2020 Chaoqiong Xiao Modified comment(s), */
-/* added BOS support, */
-/* resulting in version 6.1.3 */
-/* 01-31-2022 Chaoqiong Xiao Modified comment(s), */
-/* added standalone support, */
-/* resulting in version 6.1.10 */
-/* 10-31-2023 Chaoqiong Xiao Modified comment(s), */
-/* refined memory management, */
-/* added UX_ASSERT check for */
-/* STD descriptor parse size, */
-/* resulting in version 6.3.0 */
-/* */
/**************************************************************************/
UINT _ux_system_initialize(VOID *regular_memory_pool_start, ULONG regular_memory_size,
VOID *cache_safe_memory_pool_start, ULONG cache_safe_memory_size)
@@ -261,6 +241,14 @@ ULONG pool_size;
/* Other fields are kept zero. */
#endif
+#if !defined(UX_STANDALONE)
+
+ /* Create the Mutex object used by USBX to control critical sections. */
+ status = _ux_system_mutex_create(&_ux_system -> ux_system_mutex, "ux_system_mutex");
+ if(status != UX_SUCCESS)
+ return(UX_MUTEX_ERROR);
+#endif
+
#ifdef UX_ENABLE_DEBUG_LOG
/* Obtain memory for storing the debug log. */
@@ -277,14 +265,6 @@ ULONG pool_size;
#endif
-#if !defined(UX_STANDALONE)
-
- /* Create the Mutex object used by USBX to control critical sections. */
- status = _ux_system_mutex_create(&_ux_system -> ux_system_mutex, "ux_system_mutex");
- if(status != UX_SUCCESS)
- return(UX_MUTEX_ERROR);
-#endif
-
return(UX_SUCCESS);
}
@@ -322,12 +302,6 @@ ULONG pool_size;
/* */
/* Application */
/* */
-/* RELEASE HISTORY */
-/* */
-/* DATE NAME DESCRIPTION */
-/* */
-/* 10-31-2023 Chaoqiong Xiao Initial Version 6.3.0 */
-/* */
/**************************************************************************/
UINT _uxe_system_initialize(VOID *regular_memory_pool_start, ULONG regular_memory_size,
VOID *cache_safe_memory_pool_start, ULONG cache_safe_memory_size)
diff --git a/common/core/src/ux_system_tasks_run.c b/common/core/src/ux_system_tasks_run.c
index eb75381e..6f161cd1 100644
--- a/common/core/src/ux_system_tasks_run.c
+++ b/common/core/src/ux_system_tasks_run.c
@@ -1,10 +1,11 @@
/***************************************************************************
- * Copyright (c) 2024 Microsoft Corporation
- *
+ * Copyright (c) 2024 Microsoft Corporation
+ * Copyright (c) 2026-present Eclipse ThreadX contributors
+ *
* This program and the accompanying materials are made available under the
* terms of the MIT License which is available at
* https://opensource.org/licenses/MIT.
- *
+ *
* SPDX-License-Identifier: MIT
**************************************************************************/
@@ -64,12 +65,6 @@
/* */
/* Application */
/* */
-/* RELEASE HISTORY */
-/* */
-/* DATE NAME DESCRIPTION */
-/* */
-/* 01-31-2022 Chaoqiong Xiao Initial Version 6.1.10 */
-/* */
/**************************************************************************/
UINT _ux_system_tasks_run(VOID)
{
diff --git a/common/core/src/ux_system_uninitialize.c b/common/core/src/ux_system_uninitialize.c
index 46873ee7..bc05547a 100644
--- a/common/core/src/ux_system_uninitialize.c
+++ b/common/core/src/ux_system_uninitialize.c
@@ -1,5 +1,6 @@
/***************************************************************************
* Copyright (c) 2024 Microsoft Corporation
+ * Copyright (c) 2026-present Eclipse ThreadX contributors
*
* This program and the accompanying materials are made available under the
* terms of the MIT License which is available at
@@ -58,17 +59,6 @@
/* */
/* Application */
/* */
-/* RELEASE HISTORY */
-/* */
-/* DATE NAME DESCRIPTION */
-/* */
-/* 05-19-2020 Chaoqiong Xiao Initial Version 6.0 */
-/* 09-30-2020 Chaoqiong Xiao Modified comment(s), */
-/* resulting in version 6.1 */
-/* 01-31-2022 Chaoqiong Xiao Modified comment(s), */
-/* added standalone support, */
-/* resulting in version 6.1.10 */
-/* */
/**************************************************************************/
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 9edcf31a..a20a8140 100644
--- a/common/core/src/ux_trace_event_insert.c
+++ b/common/core/src/ux_trace_event_insert.c
@@ -1,18 +1,19 @@
/***************************************************************************
- * Copyright (c) 2024 Microsoft Corporation
- *
+ * Copyright (c) 2024 Microsoft Corporation
+ * Copyright (c) 2026-present Eclipse ThreadX contributors
+ *
* This program and the accompanying materials are made available under the
* terms of the MIT License which is available at
* https://opensource.org/licenses/MIT.
- *
+ *
* SPDX-License-Identifier: MIT
**************************************************************************/
/**************************************************************************/
/**************************************************************************/
-/** */
-/** USBX Component */
+/** */
+/** USBX Component */
/** */
/** Trace */
/** */
@@ -29,61 +30,47 @@
#include "ux_api.h"
-/**************************************************************************/
-/* */
-/* FUNCTION RELEASE */
-/* */
-/* _ux_trace_event_insert PORTABLE C */
+/**************************************************************************/
+/* */
+/* FUNCTION RELEASE */
+/* */
+/* _ux_trace_event_insert PORTABLE C */
/* 6.1.9 */
/* AUTHOR */
/* */
/* Chaoqiong Xiao, Microsoft Corporation */
/* */
/* DESCRIPTION */
-/* */
-/* This function inserts a USBX event into the current trace buffer. */
-/* */
-/* INPUT */
-/* */
-/* event_id User Event ID */
-/* info_field_1 First information field */
-/* info_field_2 First information field */
-/* info_field_3 First information field */
-/* info_field_4 First information field */
-/* current_event Current event pointer for */
-/* post event update */
-/* current_timestamp Timestamp for post event */
-/* update */
-/* */
-/* OUTPUT */
-/* */
+/* */
+/* This function inserts a USBX event into the current trace buffer. */
+/* */
+/* INPUT */
+/* */
+/* event_id User Event ID */
+/* info_field_1 First information field */
+/* info_field_2 First information field */
+/* info_field_3 First information field */
+/* info_field_4 First information field */
+/* current_event Current event pointer for */
+/* post event update */
+/* current_timestamp Timestamp for post event */
+/* update */
+/* */
+/* OUTPUT */
+/* */
+/* None */
+/* */
+/* CALLS */
+/* */
/* None */
-/* */
-/* CALLS */
-/* */
-/* None */
-/* */
-/* CALLED BY */
-/* */
-/* Internal USBX Functions */
-/* */
-/* RELEASE HISTORY */
-/* */
-/* 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 */
-/* 10-15-2021 Chaoqiong Xiao Modified comment(s), */
-/* improved traceX support, */
-/* resulting in version 6.1.9 */
+/* */
+/* CALLED BY */
+/* */
+/* Internal USBX Functions */
/* */
/**************************************************************************/
#ifdef UX_ENABLE_EVENT_TRACE
-VOID _ux_trace_event_insert(ULONG event_id, ULONG info_field_1, ULONG info_field_2, ULONG info_field_3, ULONG info_field_4,
+VOID _ux_trace_event_insert(ULONG event_id, ULONG info_field_1, ULONG info_field_2, ULONG info_field_3, ULONG info_field_4,
ULONG filter, TX_TRACE_BUFFER_ENTRY **current_event, ULONG *current_timestamp)
{
@@ -98,7 +85,7 @@ ULONG timestamp;
/* Pickup the current event. */
event = _tx_trace_buffer_current_ptr;
-
+
/* Insert this event into the trace buffer. */
TX_TRACE_IN_LINE_INSERT(event_id, info_field_1, info_field_2, info_field_3, info_field_4, filter)
@@ -108,34 +95,34 @@ ULONG timestamp;
/* Determine if the event was inserted. */
if (event)
{
-
+
/* Was the event inserted? */
if (event -> tx_trace_buffer_entry_event_id == event_id)
{
-
+
/* Yes, the event was inserted in the event trace so pickup the timestamp. */
timestamp = event -> tx_trace_buffer_entry_time_stamp;
}
else
{
-
+
/* Event was not inserted, simply set the event pointer to NULL. */
event = UX_NULL;
}
}
-
+
/* Now determine if the caller requested the current event. */
if (current_event)
{
-
+
/* Yes, return the event pointer of potential subsequent update. */
*current_event = event;
}
-
+
/* Now determine if the current timestamp was requested. */
if (current_timestamp)
{
-
+
/* Yes, return the current timestamp. */
*current_timestamp = timestamp;
}
diff --git a/common/core/src/ux_trace_event_update.c b/common/core/src/ux_trace_event_update.c
index ffd4f402..45a24c60 100644
--- a/common/core/src/ux_trace_event_update.c
+++ b/common/core/src/ux_trace_event_update.c
@@ -1,18 +1,19 @@
/***************************************************************************
- * Copyright (c) 2024 Microsoft Corporation
- *
+ * Copyright (c) 2024 Microsoft Corporation
+ * Copyright (c) 2026-present Eclipse ThreadX contributors
+ *
* This program and the accompanying materials are made available under the
* terms of the MIT License which is available at
* https://opensource.org/licenses/MIT.
- *
+ *
* SPDX-License-Identifier: MIT
**************************************************************************/
/**************************************************************************/
/**************************************************************************/
-/** */
-/** USBX Component */
+/** */
+/** USBX Component */
/** */
/** Trace */
/** */
@@ -29,55 +30,41 @@
#include "ux_api.h"
-/**************************************************************************/
-/* */
-/* FUNCTION RELEASE */
-/* */
-/* _ux_trace_event_update PORTABLE C */
+/**************************************************************************/
+/* */
+/* FUNCTION RELEASE */
+/* */
+/* _ux_trace_event_update PORTABLE C */
/* 6.1.9 */
/* AUTHOR */
/* */
/* Chaoqiong Xiao, Microsoft Corporation */
/* */
/* DESCRIPTION */
-/* */
-/* This function inserts a USBX event into the current trace buffer. */
-/* */
-/* INPUT */
-/* */
-/* event Event pointer */
-/* timestamp Timestamp of the event */
-/* event_id User Event ID */
-/* info_field_1 First information field */
-/* info_field_2 First information field */
-/* info_field_3 First information field */
-/* info_field_4 First information field */
-/* */
-/* OUTPUT */
-/* */
+/* */
+/* This function inserts a USBX event into the current trace buffer. */
+/* */
+/* INPUT */
+/* */
+/* event Event pointer */
+/* timestamp Timestamp of the event */
+/* event_id User Event ID */
+/* info_field_1 First information field */
+/* info_field_2 First information field */
+/* info_field_3 First information field */
+/* info_field_4 First information field */
+/* */
+/* OUTPUT */
+/* */
+/* None */
+/* */
+/* CALLS */
+/* */
/* None */
-/* */
-/* CALLS */
-/* */
-/* None */
-/* */
-/* CALLED BY */
-/* */
-/* Internal USBX Functions */
-/* */
-/* RELEASE HISTORY */
-/* */
-/* 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 */
-/* 10-15-2021 Chaoqiong Xiao Modified comment(s), */
-/* improved traceX support, */
-/* resulting in version 6.1.9 */
+/* */
+/* CALLED BY */
+/* */
+/* Internal USBX Functions */
/* */
/**************************************************************************/
#ifdef UX_ENABLE_EVENT_TRACE
@@ -93,13 +80,13 @@ UX_INTERRUPT_SAVE_AREA
/* 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))
{
-
+
/* Yes, update this trace entry based on the info input parameters. */
-
+
/* Check for info field 1 update. */
if (info_field_1)
{
-
+
/* Yes, update info field 1. */
event -> tx_trace_buffer_entry_information_field_1 = info_field_1;
}
@@ -107,7 +94,7 @@ UX_INTERRUPT_SAVE_AREA
/* Check for info field 2 update. */
if (info_field_2)
{
-
+
/* Yes, update info field 2. */
event -> tx_trace_buffer_entry_information_field_2 = info_field_2;
}
@@ -115,7 +102,7 @@ UX_INTERRUPT_SAVE_AREA
/* Check for info field 3 update. */
if (info_field_3)
{
-
+
/* Yes, update info field 3. */
event -> tx_trace_buffer_entry_information_field_3 = info_field_3;
}
@@ -123,7 +110,7 @@ UX_INTERRUPT_SAVE_AREA
/* Check for info field 4 update. */
if (info_field_4)
{
-
+
/* Yes, update info field 4. */
event -> tx_trace_buffer_entry_information_field_4 = info_field_4;
}
diff --git a/common/core/src/ux_trace_object_register.c b/common/core/src/ux_trace_object_register.c
index ad724480..6c8aaebe 100644
--- a/common/core/src/ux_trace_object_register.c
+++ b/common/core/src/ux_trace_object_register.c
@@ -1,18 +1,19 @@
/***************************************************************************
- * Copyright (c) 2024 Microsoft Corporation
- *
+ * Copyright (c) 2024 Microsoft Corporation
+ * Copyright (c) 2026-present Eclipse ThreadX contributors
+ *
* This program and the accompanying materials are made available under the
* terms of the MIT License which is available at
* https://opensource.org/licenses/MIT.
- *
+ *
* SPDX-License-Identifier: MIT
**************************************************************************/
/**************************************************************************/
/**************************************************************************/
-/** */
-/** USBX Component */
+/** */
+/** USBX Component */
/** */
/** Trace */
/** */
@@ -30,53 +31,39 @@
#ifdef UX_ENABLE_EVENT_TRACE
extern VOID _tx_trace_object_register(UCHAR , VOID *, CHAR *, ULONG , ULONG );
-/**************************************************************************/
-/* */
-/* FUNCTION RELEASE */
-/* */
-/* _ux_trace_object_register PORTABLE C */
+/**************************************************************************/
+/* */
+/* FUNCTION RELEASE */
+/* */
+/* _ux_trace_object_register PORTABLE C */
/* 6.1.9 */
/* AUTHOR */
/* */
/* Chaoqiong Xiao, Microsoft Corporation */
/* */
/* DESCRIPTION */
-/* */
-/* This function registers a USBX object in the trace registry. */
-/* */
-/* INPUT */
-/* */
-/* object_type Type of system object */
-/* object_ptr Address of system object */
-/* object_name Name of system object */
-/* parameter_1 Supplemental parameter 1 */
-/* parameter_2 Supplemental parameter 2 */
-/* */
-/* OUTPUT */
-/* */
+/* */
+/* This function registers a USBX object in the trace registry. */
+/* */
+/* INPUT */
+/* */
+/* object_type Type of system object */
+/* object_ptr Address of system object */
+/* object_name Name of system object */
+/* parameter_1 Supplemental parameter 1 */
+/* parameter_2 Supplemental parameter 2 */
+/* */
+/* OUTPUT */
+/* */
/* None */
-/* */
-/* CALLS */
-/* */
-/* _tx_trace_object_register Actual register function */
-/* */
-/* CALLED BY */
-/* */
-/* Application Initialization */
-/* */
-/* RELEASE HISTORY */
-/* */
-/* 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 */
-/* 10-15-2021 Chaoqiong Xiao Modified comment(s), */
-/* improved traceX support, */
-/* resulting in version 6.1.9 */
+/* */
+/* CALLS */
+/* */
+/* _tx_trace_object_register Actual register function */
+/* */
+/* CALLED BY */
+/* */
+/* Application Initialization */
/* */
/**************************************************************************/
VOID _ux_trace_object_register(UCHAR object_type, VOID *object_ptr, CHAR *object_name, ULONG parameter_1, ULONG parameter_2)
diff --git a/common/core/src/ux_trace_object_unregister.c b/common/core/src/ux_trace_object_unregister.c
index 756e0fbe..1c5921a4 100644
--- a/common/core/src/ux_trace_object_unregister.c
+++ b/common/core/src/ux_trace_object_unregister.c
@@ -1,18 +1,19 @@
/***************************************************************************
- * Copyright (c) 2024 Microsoft Corporation
- *
+ * Copyright (c) 2024 Microsoft Corporation
+ * Copyright (c) 2026-present Eclipse ThreadX contributors
+ *
* This program and the accompanying materials are made available under the
* terms of the MIT License which is available at
* https://opensource.org/licenses/MIT.
- *
+ *
* SPDX-License-Identifier: MIT
**************************************************************************/
/**************************************************************************/
/**************************************************************************/
-/** */
-/** USBX Component */
+/** */
+/** USBX Component */
/** */
/** Trace */
/** */
@@ -30,49 +31,35 @@
#ifdef UX_ENABLE_EVENT_TRACE
extern VOID _tx_trace_object_unregister(VOID *);
-/**************************************************************************/
-/* */
-/* FUNCTION RELEASE */
-/* */
-/* _ux_trace_object_unregister PORTABLE C */
+/**************************************************************************/
+/* */
+/* FUNCTION RELEASE */
+/* */
+/* _ux_trace_object_unregister PORTABLE C */
/* 6.1.9 */
/* AUTHOR */
/* */
/* Chaoqiong Xiao, Microsoft Corporation */
/* */
/* DESCRIPTION */
-/* */
-/* This function unregisters a USBX object in the trace registry. */
-/* */
-/* INPUT */
-/* */
-/* object_pointer Address of system object */
-/* */
-/* OUTPUT */
-/* */
+/* */
+/* This function unregisters a USBX object in the trace registry. */
+/* */
+/* INPUT */
+/* */
+/* object_pointer Address of system object */
+/* */
+/* OUTPUT */
+/* */
/* None */
-/* */
-/* CALLS */
-/* */
-/* _tx_trace_object_unregister Actual unregister function */
-/* */
-/* CALLED BY */
-/* */
-/* USBX delete functions */
-/* */
-/* RELEASE HISTORY */
-/* */
-/* 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 */
-/* 10-15-2021 Chaoqiong Xiao Modified comment(s), */
-/* improved traceX support, */
-/* resulting in version 6.1.9 */
+/* */
+/* CALLS */
+/* */
+/* _tx_trace_object_unregister Actual unregister function */
+/* */
+/* CALLED BY */
+/* */
+/* USBX delete functions */
/* */
/**************************************************************************/
VOID _ux_trace_object_unregister(VOID *object_ptr)
diff --git a/common/core/src/ux_utility_debug_callback_register.c b/common/core/src/ux_utility_debug_callback_register.c
index 0c75a4cb..d489bfb6 100644
--- a/common/core/src/ux_utility_debug_callback_register.c
+++ b/common/core/src/ux_utility_debug_callback_register.c
@@ -1,18 +1,19 @@
/***************************************************************************
- * Copyright (c) 2024 Microsoft Corporation
- *
+ * Copyright (c) 2024 Microsoft Corporation
+ * Copyright (c) 2026-present Eclipse ThreadX contributors
+ *
* This program and the accompanying materials are made available under the
* terms of the MIT License which is available at
* https://opensource.org/licenses/MIT.
- *
+ *
* SPDX-License-Identifier: MIT
**************************************************************************/
/**************************************************************************/
/**************************************************************************/
-/** */
-/** USBX Component */
+/** */
+/** USBX Component */
/** */
/** Utility */
/** */
@@ -28,46 +29,38 @@
#ifdef UX_ENABLE_DEBUG_LOG
-/**************************************************************************/
-/* */
-/* FUNCTION RELEASE */
-/* */
-/* _ux_utility_debug_callback_register PORTABLE C */
+/**************************************************************************/
+/* */
+/* FUNCTION RELEASE */
+/* */
+/* _ux_utility_debug_callback_register PORTABLE C */
/* 6.1 */
/* AUTHOR */
/* */
/* Chaoqiong Xiao, Microsoft Corporation */
/* */
/* DESCRIPTION */
-/* */
-/* This function registers a callback for sending formatted debug */
-/* messages to the application. */
-/* */
-/* */
-/* INPUT */
-/* */
-/* debug_callback */
-/* */
-/* */
-/* OUTPUT */
-/* */
+/* */
+/* This function registers a callback for sending formatted debug */
+/* messages to the application. */
+/* */
+/* */
+/* INPUT */
+/* */
+/* debug_callback */
+/* */
+/* */
+/* OUTPUT */
+/* */
/* None */
-/* */
-/* CALLS */
-/* */
+/* */
+/* CALLS */
+/* */
/* None */
-/* */
-/* 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), */
-/* resulting in version 6.1 */
+/* */
+/* CALLED BY */
+/* */
+/* Application */
/* */
/**************************************************************************/
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 34b4172d..634e62ba 100644
--- a/common/core/src/ux_utility_debug_log.c
+++ b/common/core/src/ux_utility_debug_log.c
@@ -1,5 +1,6 @@
/***************************************************************************
* Copyright (c) 2024 Microsoft Corporation
+ * Copyright (c) 2026-present Eclipse ThreadX contributors
*
* This program and the accompanying materials are made available under the
* terms of the MIT License which is available at
@@ -68,22 +69,6 @@
/* */
/* Application */
/* */
-/* RELEASE HISTORY */
-/* */
-/* DATE NAME DESCRIPTION */
-/* */
-/* 05-19-2020 Chaoqiong Xiao Initial Version 6.0 */
-/* 09-30-2020 Chaoqiong Xiao Modified comment(s), */
-/* verified memset and memcpy */
-/* cases, used UX prefix to */
-/* refer to TX symbols instead */
-/* of using them directly, */
-/* resulting in version 6.1 */
-/* 30-11-2025 Mohamed Ayed Modified comment(s), */
-/* used UX prefix to refer to */
-/* TX symbols instead of using */
-/* them directly, */
-/* */
/**************************************************************************/
VOID _ux_utility_debug_log(UCHAR *debug_location, UCHAR *debug_message, ULONG debug_code,
ULONG debug_parameter_1, ULONG debug_parameter_2)
diff --git a/common/core/src/ux_utility_delay_ms.c b/common/core/src/ux_utility_delay_ms.c
index 706b4508..6d55c9ed 100644
--- a/common/core/src/ux_utility_delay_ms.c
+++ b/common/core/src/ux_utility_delay_ms.c
@@ -1,18 +1,19 @@
/***************************************************************************
- * Copyright (c) 2024 Microsoft Corporation
- *
+ * Copyright (c) 2024 Microsoft Corporation
+ * Copyright (c) 2026-present Eclipse ThreadX contributors
+ *
* This program and the accompanying materials are made available under the
* terms of the MIT License which is available at
* https://opensource.org/licenses/MIT.
- *
+ *
* SPDX-License-Identifier: MIT
**************************************************************************/
/**************************************************************************/
/**************************************************************************/
-/** */
-/** USBX Component */
+/** */
+/** USBX Component */
/** */
/** Host Stack */
/** */
@@ -27,51 +28,37 @@
#include "ux_api.h"
-/**************************************************************************/
-/* */
-/* FUNCTION RELEASE */
-/* */
-/* _ux_utility_delay_ms PORTABLE C */
+/**************************************************************************/
+/* */
+/* FUNCTION RELEASE */
+/* */
+/* _ux_utility_delay_ms PORTABLE C */
/* 6.1.10 */
/* AUTHOR */
/* */
/* Chaoqiong Xiao, Microsoft Corporation */
/* */
/* DESCRIPTION */
-/* */
-/* This function causes the calling thread to sleep for the */
-/* specified number of milliseconds */
-/* */
-/* INPUT */
-/* */
-/* ms_wait Number of milliseconds to */
-/* wait for */
-/* */
-/* OUTPUT */
-/* */
-/* None */
-/* */
-/* CALLS */
-/* */
-/* tx_thread_sleep ThreadX sleep function */
-/* */
-/* CALLED BY */
-/* */
-/* USBX Components */
-/* */
-/* RELEASE HISTORY */
-/* */
-/* DATE NAME DESCRIPTION */
-/* */
-/* 05-19-2020 Chaoqiong Xiao Initial Version 6.0 */
-/* 09-30-2020 Chaoqiong Xiao Modified comment(s), */
-/* resulting in version 6.1 */
-/* 11-09-2020 Chaoqiong Xiao Modified comment(s), */
-/* fixed compile warnings 64b, */
-/* resulting in version 6.1.2 */
-/* 01-31-2022 Chaoqiong Xiao Modified comment(s), */
-/* added standalone support, */
-/* resulting in version 6.1.10 */
+/* */
+/* This function causes the calling thread to sleep for the */
+/* specified number of milliseconds */
+/* */
+/* INPUT */
+/* */
+/* ms_wait Number of milliseconds to */
+/* wait for */
+/* */
+/* OUTPUT */
+/* */
+/* None */
+/* */
+/* CALLS */
+/* */
+/* _ux_utility_thread_sleep RTOS sleep function */
+/* */
+/* CALLED BY */
+/* */
+/* USBX Components */
/* */
/**************************************************************************/
VOID _ux_utility_delay_ms(ULONG ms_wait)
@@ -91,12 +78,12 @@ ULONG ticks;
/* translate ms into ticks. */
ticks = (ULONG)(ms_wait * UX_PERIODIC_RATE) / 1000;
-
+
/* For safety add 1 to ticks. */
ticks++;
- /* Call ThreadX sleep function. */
- tx_thread_sleep(ticks);
+ /* Call RTOS sleep function. */
+ _ux_utility_thread_sleep(ticks);
#endif
/* Return completion status. */
diff --git a/common/core/src/ux_utility_descriptor_pack.c b/common/core/src/ux_utility_descriptor_pack.c
index 6d15fbd4..07747aac 100644
--- a/common/core/src/ux_utility_descriptor_pack.c
+++ b/common/core/src/ux_utility_descriptor_pack.c
@@ -1,10 +1,11 @@
/***************************************************************************
- * Copyright (c) 2024 Microsoft Corporation
- *
+ * Copyright (c) 2024 Microsoft Corporation
+ * Copyright (c) 2026-present Eclipse ThreadX contributors
+ *
* This program and the accompanying materials are made available under the
* terms of the MIT License which is available at
* https://opensource.org/licenses/MIT.
- *
+ *
* SPDX-License-Identifier: MIT
**************************************************************************/
@@ -64,17 +65,6 @@
/* */
/* USBX Components */
/* */
-/* RELEASE HISTORY */
-/* */
-/* DATE NAME DESCRIPTION */
-/* */
-/* 05-19-2020 Chaoqiong Xiao Initial Version 6.0 */
-/* 09-30-2020 Chaoqiong Xiao Modified comment(s), */
-/* resulting in version 6.1 */
-/* 10-31-2023 Chaoqiong Xiao Modified comment(s), */
-/* optimized USB descriptors, */
-/* resulting in version 6.3.0 */
-/* */
/**************************************************************************/
VOID _ux_utility_descriptor_pack(UCHAR * descriptor, UCHAR * descriptor_structure,
UINT descriptor_entries, UCHAR * raw_descriptor)
diff --git a/common/core/src/ux_utility_descriptor_parse.c b/common/core/src/ux_utility_descriptor_parse.c
index f61b58ac..699fe4c7 100644
--- a/common/core/src/ux_utility_descriptor_parse.c
+++ b/common/core/src/ux_utility_descriptor_parse.c
@@ -1,10 +1,11 @@
/***************************************************************************
- * Copyright (c) 2024 Microsoft Corporation
- *
+ * Copyright (c) 2024 Microsoft Corporation
+ * Copyright (c) 2026-present Eclipse ThreadX contributors
+ *
* This program and the accompanying materials are made available under the
* terms of the MIT License which is available at
* https://opensource.org/licenses/MIT.
- *
+ *
* SPDX-License-Identifier: MIT
**************************************************************************/
@@ -64,17 +65,6 @@
/* */
/* USBX Components */
/* */
-/* RELEASE HISTORY */
-/* */
-/* DATE NAME DESCRIPTION */
-/* */
-/* 05-19-2020 Chaoqiong Xiao Initial Version 6.0 */
-/* 09-30-2020 Chaoqiong Xiao Modified comment(s), */
-/* resulting in version 6.1 */
-/* 10-31-2023 Chaoqiong Xiao Modified comment(s), */
-/* optimized USB descriptors, */
-/* resulting in version 6.3.0 */
-/* */
/**************************************************************************/
VOID _ux_utility_descriptor_parse(UCHAR * raw_descriptor, UCHAR * descriptor_structure,
UINT descriptor_entries, UCHAR * descriptor)
@@ -160,12 +150,6 @@ VOID _ux_utility_descriptor_parse(UCHAR * raw_descriptor, UCHAR * descriptor_st
/* */
/* USBX Components */
/* */
-/* RELEASE HISTORY */
-/* */
-/* DATE NAME DESCRIPTION */
-/* */
-/* 10-31-2023 Chaoqiong Xiao Initial Version 6.3.0 */
-/* */
/**************************************************************************/
ULONG _ux_utility_descriptor_parse_size(UCHAR * descriptor_structure, UINT descriptor_entries, UINT size_align_mask)
{
diff --git a/common/core/src/ux_utility_error_callback_register.c b/common/core/src/ux_utility_error_callback_register.c
index 404186a1..3feee9ae 100644
--- a/common/core/src/ux_utility_error_callback_register.c
+++ b/common/core/src/ux_utility_error_callback_register.c
@@ -1,18 +1,19 @@
/***************************************************************************
- * Copyright (c) 2024 Microsoft Corporation
- *
+ * Copyright (c) 2024 Microsoft Corporation
+ * Copyright (c) 2026-present Eclipse ThreadX contributors
+ *
* This program and the accompanying materials are made available under the
* terms of the MIT License which is available at
* https://opensource.org/licenses/MIT.
- *
+ *
* SPDX-License-Identifier: MIT
**************************************************************************/
/**************************************************************************/
/**************************************************************************/
-/** */
-/** USBX Component */
+/** */
+/** USBX Component */
/** */
/** Utility */
/** */
@@ -27,46 +28,38 @@
#ifndef UX_DISABLE_ERROR_HANDLER
-/**************************************************************************/
-/* */
-/* FUNCTION RELEASE */
-/* */
-/* _ux_utility_error_callback_register PORTABLE C */
+/**************************************************************************/
+/* */
+/* FUNCTION RELEASE */
+/* */
+/* _ux_utility_error_callback_register PORTABLE C */
/* 6.1 */
/* AUTHOR */
/* */
/* Chaoqiong Xiao, Microsoft Corporation */
/* */
/* DESCRIPTION */
-/* */
-/* This function registers a callback for sending formatted errors to */
-/* the application. */
-/* */
-/* */
-/* INPUT */
-/* */
-/* error_callback */
-/* */
-/* */
-/* OUTPUT */
-/* */
+/* */
+/* This function registers a callback for sending formatted errors to */
+/* the application. */
+/* */
+/* */
+/* INPUT */
+/* */
+/* error_callback */
+/* */
+/* */
+/* OUTPUT */
+/* */
/* None */
-/* */
-/* CALLS */
-/* */
+/* */
+/* CALLS */
+/* */
/* None */
-/* */
-/* 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), */
-/* resulting in version 6.1 */
+/* */
+/* CALLED BY */
+/* */
+/* Application */
/* */
/**************************************************************************/
VOID _ux_utility_error_callback_register(VOID (*error_callback)(UINT system_level, UINT system_context, UINT error_code))
diff --git a/common/core/src/ux_utility_event_flags_create.c b/common/core/src/ux_utility_event_flags_create.c
index bd3723c0..0510e57c 100644
--- a/common/core/src/ux_utility_event_flags_create.c
+++ b/common/core/src/ux_utility_event_flags_create.c
@@ -1,18 +1,19 @@
/***************************************************************************
- * Copyright (c) 2024 Microsoft Corporation
- *
+ * Copyright (c) 2024 Microsoft Corporation
+ * Copyright (c) 2026-present Eclipse ThreadX contributors
+ *
* This program and the accompanying materials are made available under the
* terms of the MIT License which is available at
* https://opensource.org/licenses/MIT.
- *
+ *
* SPDX-License-Identifier: MIT
**************************************************************************/
/**************************************************************************/
/**************************************************************************/
-/** */
-/** USBX Component */
+/** */
+/** USBX Component */
/** */
/** Utility */
/** */
@@ -28,50 +29,36 @@
#if !defined(UX_STANDALONE)
-/**************************************************************************/
-/* */
-/* FUNCTION RELEASE */
-/* */
-/* _ux_utility_event_flags_create PORTABLE C */
+/**************************************************************************/
+/* */
+/* FUNCTION RELEASE */
+/* */
+/* _ux_utility_event_flags_create PORTABLE C */
/* 6.1.11 */
/* AUTHOR */
/* */
/* Chaoqiong Xiao, Microsoft Corporation */
/* */
/* DESCRIPTION */
-/* */
-/* This function creates a threadx group of flags */
-/* */
-/* INPUT */
-/* */
-/* group_ptr Event flag control group */
-/* name Pointer to thread name string */
-/* */
-/* OUTPUT */
-/* */
-/* Completion Status */
-/* */
-/* CALLS */
-/* */
-/* tx_event_flags_create ThreadX create event flag */
-/* */
-/* 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), */
-/* used UX prefix to refer to */
-/* TX symbols instead of using */
-/* them directly, */
-/* resulting in version 6.1 */
-/* 04-25-2022 Chaoqiong Xiao Modified comment(s), */
-/* off in standalone build, */
-/* resulting in version 6.1.11 */
+/* */
+/* This function creates a threadx group of flags */
+/* */
+/* INPUT */
+/* */
+/* group_ptr Event flag control group */
+/* name Pointer to thread name string */
+/* */
+/* OUTPUT */
+/* */
+/* Completion Status */
+/* */
+/* CALLS */
+/* */
+/* tx_event_flags_create ThreadX create event flag */
+/* */
+/* CALLED BY */
+/* */
+/* USBX Components */
/* */
/**************************************************************************/
UINT _ux_utility_event_flags_create(UX_EVENT_FLAGS_GROUP*group_ptr, CHAR *name)
diff --git a/common/core/src/ux_utility_event_flags_delete.c b/common/core/src/ux_utility_event_flags_delete.c
index 8324ae6f..dbb66f80 100644
--- a/common/core/src/ux_utility_event_flags_delete.c
+++ b/common/core/src/ux_utility_event_flags_delete.c
@@ -1,18 +1,19 @@
/***************************************************************************
- * Copyright (c) 2024 Microsoft Corporation
- *
+ * Copyright (c) 2024 Microsoft Corporation
+ * Copyright (c) 2026-present Eclipse ThreadX contributors
+ *
* This program and the accompanying materials are made available under the
* terms of the MIT License which is available at
* https://opensource.org/licenses/MIT.
- *
+ *
* SPDX-License-Identifier: MIT
**************************************************************************/
/**************************************************************************/
/**************************************************************************/
-/** */
-/** USBX Component */
+/** */
+/** USBX Component */
/** */
/** Utility */
/** */
@@ -28,52 +29,38 @@
#if !defined(UX_STANDALONE)
-/**************************************************************************/
-/* */
-/* FUNCTION RELEASE */
-/* */
-/* _ux_utility_event_flags_delete PORTABLE C */
+/**************************************************************************/
+/* */
+/* FUNCTION RELEASE */
+/* */
+/* _ux_utility_event_flags_delete PORTABLE C */
/* 6.1.11 */
/* AUTHOR */
/* */
/* Chaoqiong Xiao, Microsoft Corporation */
/* */
/* DESCRIPTION */
-/* */
-/* This function creates a threadx group of flags */
-/* */
-/* INPUT */
-/* */
-/* group_ptr Event flag control group */
-/* */
-/* OUTPUT */
-/* */
-/* Completion Status */
-/* */
-/* CALLS */
-/* */
-/* tx_event_flags_delete ThreadX delete event flag */
-/* */
-/* 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), */
-/* used UX prefix to refer to */
-/* TX symbols instead of using */
-/* them directly, */
-/* resulting in version 6.1 */
-/* 04-25-2022 Chaoqiong Xiao Modified comment(s), */
-/* off in standalone build, */
-/* resulting in version 6.1.11 */
+/* */
+/* This function creates a threadx group of flags */
+/* */
+/* INPUT */
+/* */
+/* group_ptr Event flag control group */
+/* */
+/* OUTPUT */
+/* */
+/* Completion Status */
+/* */
+/* CALLS */
+/* */
+/* tx_event_flags_delete ThreadX delete event flag */
+/* */
+/* CALLED BY */
+/* */
+/* USBX Components */
/* */
/**************************************************************************/
-UINT _ux_utility_event_flags_delete(UX_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 7c47d1e2..7e2ebf7b 100644
--- a/common/core/src/ux_utility_event_flags_get.c
+++ b/common/core/src/ux_utility_event_flags_get.c
@@ -1,18 +1,19 @@
/***************************************************************************
- * Copyright (c) 2024 Microsoft Corporation
- *
+ * Copyright (c) 2024 Microsoft Corporation
+ * Copyright (c) 2026-present Eclipse ThreadX contributors
+ *
* This program and the accompanying materials are made available under the
* terms of the MIT License which is available at
* https://opensource.org/licenses/MIT.
- *
+ *
* SPDX-License-Identifier: MIT
**************************************************************************/
/**************************************************************************/
/**************************************************************************/
-/** */
-/** USBX Component */
+/** */
+/** USBX Component */
/** */
/** Utility */
/** */
@@ -28,57 +29,43 @@
#if !defined(UX_STANDALONE)
-/**************************************************************************/
-/* */
-/* FUNCTION RELEASE */
-/* */
-/* _ux_utility_event_flags_get PORTABLE C */
+/**************************************************************************/
+/* */
+/* FUNCTION RELEASE */
+/* */
+/* _ux_utility_event_flags_get PORTABLE C */
/* 6.1.11 */
/* AUTHOR */
/* */
/* Chaoqiong Xiao, Microsoft Corporation */
/* */
/* DESCRIPTION */
-/* */
-/* This function get event flags from event flag group */
-/* */
-/* INPUT */
-/* */
-/* group_ptr Event flag control group */
-/* requested_flags 32 bits variable event flags */
-/* get_option AND/OR/CLEAR ... options */
-/* actual_flag_ptr where the flags are placed */
-/* wait_option waiting option */
-/* */
-/* */
-/* OUTPUT */
-/* */
-/* Completion Status */
-/* */
-/* CALLS */
-/* */
-/* tx_event_flags_get ThreadX get event flag */
-/* */
-/* 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), */
-/* used UX prefix to refer to */
-/* TX symbols instead of using */
-/* them directly, */
-/* resulting in version 6.1 */
-/* 04-25-2022 Chaoqiong Xiao Modified comment(s), */
-/* off in standalone build, */
-/* resulting in version 6.1.11 */
+/* */
+/* This function get event flags from event flag group */
+/* */
+/* INPUT */
+/* */
+/* group_ptr Event flag control group */
+/* requested_flags 32 bits variable event flags */
+/* get_option AND/OR/CLEAR ... options */
+/* actual_flag_ptr where the flags are placed */
+/* wait_option waiting option */
+/* */
+/* */
+/* OUTPUT */
+/* */
+/* Completion Status */
+/* */
+/* CALLS */
+/* */
+/* tx_event_flags_get ThreadX get event flag */
+/* */
+/* CALLED BY */
+/* */
+/* USBX Components */
/* */
/**************************************************************************/
-UINT _ux_utility_event_flags_get(UX_EVENT_FLAGS_GROUP*group_ptr, ULONG requested_flags,
+UINT _ux_utility_event_flags_get(UX_EVENT_FLAGS_GROUP*group_ptr, ULONG requested_flags,
UINT get_option, ULONG *actual_flags_ptr, ULONG wait_option)
{
@@ -90,7 +77,7 @@ ULONG local_actual_flags_ptr;
/* Update the actual flags. */
*actual_flags_ptr = local_actual_flags_ptr;
-
+
/* Return completion status. */
return(status);
}
diff --git a/common/core/src/ux_utility_event_flags_set.c b/common/core/src/ux_utility_event_flags_set.c
index 51dd85ad..feb179a7 100644
--- a/common/core/src/ux_utility_event_flags_set.c
+++ b/common/core/src/ux_utility_event_flags_set.c
@@ -1,18 +1,19 @@
/***************************************************************************
- * Copyright (c) 2024 Microsoft Corporation
- *
+ * Copyright (c) 2024 Microsoft Corporation
+ * Copyright (c) 2026-present Eclipse ThreadX contributors
+ *
* This program and the accompanying materials are made available under the
* terms of the MIT License which is available at
* https://opensource.org/licenses/MIT.
- *
+ *
* SPDX-License-Identifier: MIT
**************************************************************************/
/**************************************************************************/
/**************************************************************************/
-/** */
-/** USBX Component */
+/** */
+/** USBX Component */
/** */
/** Utility */
/** */
@@ -28,52 +29,38 @@
#if !defined(UX_STANDALONE)
-/**************************************************************************/
-/* */
-/* FUNCTION RELEASE */
-/* */
-/* _ux_utility_event_flags_set PORTABLE C */
+/**************************************************************************/
+/* */
+/* FUNCTION RELEASE */
+/* */
+/* _ux_utility_event_flags_set PORTABLE C */
/* 6.1.11 */
/* AUTHOR */
/* */
/* Chaoqiong Xiao, Microsoft Corporation */
/* */
/* DESCRIPTION */
-/* */
-/* This function set event flags from event flag group */
-/* */
-/* INPUT */
-/* */
-/* group_ptr Event flag control group */
-/* flags_to_set 32 bits variable event flags */
-/* set_option set option */
-/* */
-/* */
-/* OUTPUT */
-/* */
-/* Completion Status */
-/* */
-/* CALLS */
-/* */
-/* tx_event_flags_set ThreadX set event flag */
-/* */
-/* 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), */
-/* used UX prefix to refer to */
-/* TX symbols instead of using */
-/* them directly, */
-/* resulting in version 6.1 */
-/* 04-25-2022 Chaoqiong Xiao Modified comment(s), */
-/* off in standalone build, */
-/* resulting in version 6.1.11 */
+/* */
+/* This function set event flags from event flag group */
+/* */
+/* INPUT */
+/* */
+/* group_ptr Event flag control group */
+/* flags_to_set 32 bits variable event flags */
+/* set_option set option */
+/* */
+/* */
+/* OUTPUT */
+/* */
+/* Completion Status */
+/* */
+/* CALLS */
+/* */
+/* tx_event_flags_set ThreadX set event flag */
+/* */
+/* CALLED BY */
+/* */
+/* USBX Components */
/* */
/**************************************************************************/
UINT _ux_utility_event_flags_set(UX_EVENT_FLAGS_GROUP*group_ptr, ULONG flags_to_set,
diff --git a/common/core/src/ux_utility_long_get.c b/common/core/src/ux_utility_long_get.c
index 3a612062..fd98fb23 100644
--- a/common/core/src/ux_utility_long_get.c
+++ b/common/core/src/ux_utility_long_get.c
@@ -1,18 +1,19 @@
/***************************************************************************
- * Copyright (c) 2024 Microsoft Corporation
- *
+ * Copyright (c) 2024 Microsoft Corporation
+ * Copyright (c) 2026-present Eclipse ThreadX contributors
+ *
* This program and the accompanying materials are made available under the
* terms of the MIT License which is available at
* https://opensource.org/licenses/MIT.
- *
+ *
* SPDX-License-Identifier: MIT
**************************************************************************/
/**************************************************************************/
/**************************************************************************/
-/** */
-/** USBX Component */
+/** */
+/** USBX Component */
/** */
/** Utility */
/** */
@@ -27,43 +28,35 @@
#include "ux_api.h"
-/**************************************************************************/
-/* */
-/* FUNCTION RELEASE */
-/* */
-/* _ux_utility_long_get PORTABLE C */
+/**************************************************************************/
+/* */
+/* FUNCTION RELEASE */
+/* */
+/* _ux_utility_long_get PORTABLE C */
/* 6.1 */
/* AUTHOR */
/* */
/* Chaoqiong Xiao, Microsoft Corporation */
/* */
/* DESCRIPTION */
-/* */
-/* This function reads a 32-bit value. */
-/* */
-/* INPUT */
-/* */
-/* address Source address */
-/* */
-/* OUTPUT */
-/* */
-/* 32-bit value */
-/* */
-/* CALLS */
-/* */
+/* */
+/* This function reads a 32-bit value. */
+/* */
+/* INPUT */
+/* */
+/* address Source address */
+/* */
+/* OUTPUT */
+/* */
+/* 32-bit value */
+/* */
+/* CALLS */
+/* */
/* None */
-/* */
-/* CALLED BY */
-/* */
-/* USBX Components */
-/* */
-/* RELEASE HISTORY */
-/* */
-/* DATE NAME DESCRIPTION */
-/* */
-/* 05-19-2020 Chaoqiong Xiao Initial Version 6.0 */
-/* 09-30-2020 Chaoqiong Xiao Modified comment(s), */
-/* resulting in version 6.1 */
+/* */
+/* CALLED BY */
+/* */
+/* USBX Components */
/* */
/**************************************************************************/
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 9d972e94..acc1eced 100644
--- a/common/core/src/ux_utility_long_get_big_endian.c
+++ b/common/core/src/ux_utility_long_get_big_endian.c
@@ -1,18 +1,19 @@
/***************************************************************************
- * Copyright (c) 2024 Microsoft Corporation
- *
+ * Copyright (c) 2024 Microsoft Corporation
+ * Copyright (c) 2026-present Eclipse ThreadX contributors
+ *
* This program and the accompanying materials are made available under the
* terms of the MIT License which is available at
* https://opensource.org/licenses/MIT.
- *
+ *
* SPDX-License-Identifier: MIT
**************************************************************************/
/**************************************************************************/
/**************************************************************************/
-/** */
-/** USBX Component */
+/** */
+/** USBX Component */
/** */
/** Utility */
/** */
@@ -27,43 +28,35 @@
#include "ux_api.h"
-/**************************************************************************/
-/* */
-/* FUNCTION RELEASE */
-/* */
-/* _ux_utility_long_get_big_endian PORTABLE C */
+/**************************************************************************/
+/* */
+/* FUNCTION RELEASE */
+/* */
+/* _ux_utility_long_get_big_endian PORTABLE C */
/* 6.1 */
/* AUTHOR */
/* */
/* Chaoqiong Xiao, Microsoft Corporation */
/* */
/* DESCRIPTION */
-/* */
-/* This function reads a 32-bit value in big endian format. */
-/* */
-/* INPUT */
-/* */
-/* address Source address */
-/* */
-/* OUTPUT */
-/* */
-/* 16-bit value */
-/* */
-/* CALLS */
-/* */
+/* */
+/* This function reads a 32-bit value in big endian format. */
+/* */
+/* INPUT */
+/* */
+/* address Source address */
+/* */
+/* OUTPUT */
+/* */
+/* 16-bit value */
+/* */
+/* CALLS */
+/* */
/* None */
-/* */
-/* CALLED BY */
-/* */
-/* USBX Components */
-/* */
-/* RELEASE HISTORY */
-/* */
-/* DATE NAME DESCRIPTION */
-/* */
-/* 05-19-2020 Chaoqiong Xiao Initial Version 6.0 */
-/* 09-30-2020 Chaoqiong Xiao Modified comment(s), */
-/* resulting in version 6.1 */
+/* */
+/* CALLED BY */
+/* */
+/* USBX Components */
/* */
/**************************************************************************/
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 bd8366f0..aad467a5 100644
--- a/common/core/src/ux_utility_long_put.c
+++ b/common/core/src/ux_utility_long_put.c
@@ -1,18 +1,19 @@
/***************************************************************************
- * Copyright (c) 2024 Microsoft Corporation
- *
+ * Copyright (c) 2024 Microsoft Corporation
+ * Copyright (c) 2026-present Eclipse ThreadX contributors
+ *
* This program and the accompanying materials are made available under the
* terms of the MIT License which is available at
* https://opensource.org/licenses/MIT.
- *
+ *
* SPDX-License-Identifier: MIT
**************************************************************************/
/**************************************************************************/
/**************************************************************************/
-/** */
-/** USBX Component */
+/** */
+/** USBX Component */
/** */
/** Utility */
/** */
@@ -27,44 +28,36 @@
#include "ux_api.h"
-/**************************************************************************/
-/* */
-/* FUNCTION RELEASE */
-/* */
-/* _ux_utility_long_put PORTABLE C */
+/**************************************************************************/
+/* */
+/* FUNCTION RELEASE */
+/* */
+/* _ux_utility_long_put PORTABLE C */
/* 6.1 */
/* AUTHOR */
/* */
/* Chaoqiong Xiao, Microsoft Corporation */
/* */
/* DESCRIPTION */
-/* */
-/* This function writes a 32-bit value. */
-/* */
-/* INPUT */
-/* */
-/* address Destination address */
-/* value 32-bit value */
-/* */
-/* OUTPUT */
-/* */
-/* None */
-/* */
-/* CALLS */
-/* */
+/* */
+/* This function writes a 32-bit value. */
+/* */
+/* INPUT */
+/* */
+/* address Destination address */
+/* value 32-bit value */
+/* */
+/* OUTPUT */
+/* */
/* None */
-/* */
-/* CALLED BY */
-/* */
-/* USBX Components */
-/* */
-/* RELEASE HISTORY */
-/* */
-/* DATE NAME DESCRIPTION */
-/* */
-/* 05-19-2020 Chaoqiong Xiao Initial Version 6.0 */
-/* 09-30-2020 Chaoqiong Xiao Modified comment(s), */
-/* resulting in version 6.1 */
+/* */
+/* CALLS */
+/* */
+/* None */
+/* */
+/* CALLED BY */
+/* */
+/* USBX Components */
/* */
/**************************************************************************/
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 1860936c..818875d2 100644
--- a/common/core/src/ux_utility_long_put_big_endian.c
+++ b/common/core/src/ux_utility_long_put_big_endian.c
@@ -1,18 +1,19 @@
/***************************************************************************
- * Copyright (c) 2024 Microsoft Corporation
- *
+ * Copyright (c) 2024 Microsoft Corporation
+ * Copyright (c) 2026-present Eclipse ThreadX contributors
+ *
* This program and the accompanying materials are made available under the
* terms of the MIT License which is available at
* https://opensource.org/licenses/MIT.
- *
+ *
* SPDX-License-Identifier: MIT
**************************************************************************/
/**************************************************************************/
/**************************************************************************/
-/** */
-/** USBX Component */
+/** */
+/** USBX Component */
/** */
/** Utility */
/** */
@@ -27,44 +28,36 @@
#include "ux_api.h"
-/**************************************************************************/
-/* */
-/* FUNCTION RELEASE */
-/* */
-/* _ux_utility_long_put_big_endian PORTABLE C */
+/**************************************************************************/
+/* */
+/* FUNCTION RELEASE */
+/* */
+/* _ux_utility_long_put_big_endian PORTABLE C */
/* 6.1 */
/* AUTHOR */
/* */
/* Chaoqiong Xiao, Microsoft Corporation */
/* */
/* DESCRIPTION */
-/* */
-/* This function writes a 32-bit value in big endian format. */
-/* */
-/* INPUT */
-/* */
-/* address Destination address */
-/* value 32-bit value */
-/* */
-/* OUTPUT */
-/* */
-/* None */
-/* */
-/* CALLS */
-/* */
+/* */
+/* This function writes a 32-bit value in big endian format. */
+/* */
+/* INPUT */
+/* */
+/* address Destination address */
+/* value 32-bit value */
+/* */
+/* OUTPUT */
+/* */
/* None */
-/* */
-/* CALLED BY */
-/* */
-/* USBX Components */
-/* */
-/* RELEASE HISTORY */
-/* */
-/* DATE NAME DESCRIPTION */
-/* */
-/* 05-19-2020 Chaoqiong Xiao Initial Version 6.0 */
-/* 09-30-2020 Chaoqiong Xiao Modified comment(s), */
-/* resulting in version 6.1 */
+/* */
+/* CALLS */
+/* */
+/* None */
+/* */
+/* CALLED BY */
+/* */
+/* USBX Components */
/* */
/**************************************************************************/
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 d23c71a5..49dc3c4b 100644
--- a/common/core/src/ux_utility_memory_allocate.c
+++ b/common/core/src/ux_utility_memory_allocate.c
@@ -1,10 +1,11 @@
/***************************************************************************
- * Copyright (c) 2024 Microsoft Corporation
- *
+ * Copyright (c) 2024 Microsoft Corporation
+ * Copyright (c) 2026-present Eclipse ThreadX contributors
+ *
* This program and the accompanying materials are made available under the
* terms of the MIT License which is available at
* https://opensource.org/licenses/MIT.
- *
+ *
* SPDX-License-Identifier: MIT
**************************************************************************/
@@ -60,26 +61,6 @@
/* */
/* USBX Components */
/* */
-/* RELEASE HISTORY */
-/* */
-/* DATE NAME DESCRIPTION */
-/* */
-/* 05-19-2020 Chaoqiong Xiao Initial Version 6.0 */
-/* 09-30-2020 Chaoqiong Xiao Modified comment(s), */
-/* verified memset and memcpy */
-/* cases, */
-/* resulting in version 6.1 */
-/* 01-31-2022 Chaoqiong Xiao Modified comment(s), */
-/* added standalone support, */
-/* resulting in version 6.1.10 */
-/* 04-25-2022 Chaoqiong Xiao Modified comment(s), */
-/* internal clean up, */
-/* resulting in version 6.1.11 */
-/* 10-31-2023 Chaoqiong Xiao Modified comment(s), */
-/* refined memory management, */
-/* fixed issue in 64-bit env, */
-/* resulting in version 6.3.0 */
-/* */
/**************************************************************************/
VOID *_ux_utility_memory_allocate(ULONG memory_alignment, ULONG memory_cache_flag,
ULONG memory_size_requested)
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 9253533e..d380423e 100644
--- a/common/core/src/ux_utility_memory_allocate_add_safe.c
+++ b/common/core/src/ux_utility_memory_allocate_add_safe.c
@@ -1,10 +1,11 @@
/***************************************************************************
- * Copyright (c) 2024 Microsoft Corporation
- *
+ * Copyright (c) 2024 Microsoft Corporation
+ * Copyright (c) 2026-present Eclipse ThreadX contributors
+ *
* This program and the accompanying materials are made available under the
* terms of the MIT License which is available at
* https://opensource.org/licenses/MIT.
- *
+ *
* SPDX-License-Identifier: MIT
**************************************************************************/
@@ -62,14 +63,6 @@
/* */
/* USBX Components */
/* */
-/* RELEASE HISTORY */
-/* */
-/* DATE NAME DESCRIPTION */
-/* */
-/* 05-19-2020 Chaoqiong Xiao Initial Version 6.0 */
-/* 09-30-2020 Chaoqiong Xiao Modified comment(s), */
-/* resulting in version 6.1 */
-/* */
/**************************************************************************/
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 31a0102d..3c22d459 100644
--- a/common/core/src/ux_utility_memory_allocate_mulc_safe.c
+++ b/common/core/src/ux_utility_memory_allocate_mulc_safe.c
@@ -1,10 +1,11 @@
/***************************************************************************
- * Copyright (c) 2024 Microsoft Corporation
- *
+ * Copyright (c) 2024 Microsoft Corporation
+ * Copyright (c) 2026-present Eclipse ThreadX contributors
+ *
* This program and the accompanying materials are made available under the
* terms of the MIT License which is available at
* https://opensource.org/licenses/MIT.
- *
+ *
* SPDX-License-Identifier: MIT
**************************************************************************/
@@ -66,14 +67,6 @@
/* */
/* USBX Components */
/* */
-/* RELEASE HISTORY */
-/* */
-/* DATE NAME DESCRIPTION */
-/* */
-/* 05-19-2020 Chaoqiong Xiao Initial Version 6.0 */
-/* 09-30-2020 Chaoqiong Xiao Modified comment(s), */
-/* resulting in version 6.1 */
-/* */
/**************************************************************************/
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 9bf24cac..9e81edc7 100644
--- a/common/core/src/ux_utility_memory_allocate_mulv_safe.c
+++ b/common/core/src/ux_utility_memory_allocate_mulv_safe.c
@@ -1,10 +1,11 @@
/***************************************************************************
- * Copyright (c) 2024 Microsoft Corporation
- *
+ * Copyright (c) 2024 Microsoft Corporation
+ * Copyright (c) 2026-present Eclipse ThreadX contributors
+ *
* This program and the accompanying materials are made available under the
* terms of the MIT License which is available at
* https://opensource.org/licenses/MIT.
- *
+ *
* SPDX-License-Identifier: MIT
**************************************************************************/
@@ -66,14 +67,6 @@
/* */
/* USBX Components */
/* */
-/* RELEASE HISTORY */
-/* */
-/* DATE NAME DESCRIPTION */
-/* */
-/* 05-19-2020 Chaoqiong Xiao Initial Version 6.0 */
-/* 09-30-2020 Chaoqiong Xiao Modified comment(s), */
-/* resulting in version 6.1 */
-/* */
/**************************************************************************/
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_byte_pool_create.c b/common/core/src/ux_utility_memory_byte_pool_create.c
index ffd34d22..c6812d51 100644
--- a/common/core/src/ux_utility_memory_byte_pool_create.c
+++ b/common/core/src/ux_utility_memory_byte_pool_create.c
@@ -1,10 +1,11 @@
/***************************************************************************
- * Copyright (c) 2024 Microsoft Corporation
- *
+ * Copyright (c) 2024 Microsoft Corporation
+ * Copyright (c) 2026-present Eclipse ThreadX contributors
+ *
* This program and the accompanying materials are made available under the
* terms of the MIT License which is available at
* https://opensource.org/licenses/MIT.
- *
+ *
* SPDX-License-Identifier: MIT
**************************************************************************/
@@ -60,12 +61,6 @@
/* */
/* USBX Components */
/* */
-/* RELEASE HISTORY */
-/* */
-/* DATE NAME DESCRIPTION */
-/* */
-/* 10-31-2023 Yajun Xia Initial Version 6.3.0 */
-/* */
/**************************************************************************/
UINT _ux_utility_memory_byte_pool_create(UX_MEMORY_BYTE_POOL *pool_ptr, VOID *pool_start, ULONG pool_size)
{
diff --git a/common/core/src/ux_utility_memory_byte_pool_search.c b/common/core/src/ux_utility_memory_byte_pool_search.c
index 18ccd32f..022feef8 100644
--- a/common/core/src/ux_utility_memory_byte_pool_search.c
+++ b/common/core/src/ux_utility_memory_byte_pool_search.c
@@ -1,10 +1,11 @@
/***************************************************************************
- * Copyright (c) 2024 Microsoft Corporation
- *
+ * Copyright (c) 2024 Microsoft Corporation
+ * Copyright (c) 2026-present Eclipse ThreadX contributors
+ *
* This program and the accompanying materials are made available under the
* terms of the MIT License which is available at
* https://opensource.org/licenses/MIT.
- *
+ *
* SPDX-License-Identifier: MIT
**************************************************************************/
@@ -62,12 +63,6 @@
/* */
/* USBX Components */
/* */
-/* RELEASE HISTORY */
-/* */
-/* DATE NAME DESCRIPTION */
-/* */
-/* 10-31-2023 Yajun Xia Initial Version 6.3.0 */
-/* */
/**************************************************************************/
UCHAR *_ux_utility_memory_byte_pool_search(UX_MEMORY_BYTE_POOL *pool_ptr, ULONG memory_size)
{
diff --git a/common/core/src/ux_utility_memory_compare.c b/common/core/src/ux_utility_memory_compare.c
index c33d6b82..740b43a8 100644
--- a/common/core/src/ux_utility_memory_compare.c
+++ b/common/core/src/ux_utility_memory_compare.c
@@ -1,18 +1,19 @@
/***************************************************************************
- * Copyright (c) 2024 Microsoft Corporation
- *
+ * Copyright (c) 2024 Microsoft Corporation
+ * Copyright (c) 2026-present Eclipse ThreadX contributors
+ *
* This program and the accompanying materials are made available under the
* terms of the MIT License which is available at
* https://opensource.org/licenses/MIT.
- *
+ *
* SPDX-License-Identifier: MIT
**************************************************************************/
/**************************************************************************/
/**************************************************************************/
-/** */
-/** USBX Component */
+/** */
+/** USBX Component */
/** */
/** Utility */
/** */
@@ -27,46 +28,38 @@
#include "ux_api.h"
-/**************************************************************************/
-/* */
-/* FUNCTION RELEASE */
-/* */
-/* _ux_utility_memory_compare PORTABLE C */
+/**************************************************************************/
+/* */
+/* FUNCTION RELEASE */
+/* */
+/* _ux_utility_memory_compare PORTABLE C */
/* 6.1 */
/* AUTHOR */
/* */
/* Chaoqiong Xiao, Microsoft Corporation */
/* */
/* DESCRIPTION */
-/* */
-/* This function compares two memory blocks. */
-/* */
-/* INPUT */
-/* */
-/* memory_source Pointer to source */
-/* memory_destination Pointer to destination */
-/* length Number of bytes to compare */
-/* */
-/* OUTPUT */
-/* */
-/* UX_SUCCESS If blocks are equal */
-/* UX_ERROR If blocks are not equal */
-/* */
-/* CALLS */
-/* */
-/* None */
-/* */
-/* CALLED BY */
-/* */
-/* USBX Components */
-/* */
-/* RELEASE HISTORY */
-/* */
-/* DATE NAME DESCRIPTION */
-/* */
-/* 05-19-2020 Chaoqiong Xiao Initial Version 6.0 */
-/* 09-30-2020 Chaoqiong Xiao Modified comment(s), */
-/* resulting in version 6.1 */
+/* */
+/* This function compares two memory blocks. */
+/* */
+/* INPUT */
+/* */
+/* memory_source Pointer to source */
+/* memory_destination Pointer to destination */
+/* length Number of bytes to compare */
+/* */
+/* OUTPUT */
+/* */
+/* UX_SUCCESS If blocks are equal */
+/* UX_ERROR If blocks are not equal */
+/* */
+/* CALLS */
+/* */
+/* None */
+/* */
+/* CALLED BY */
+/* */
+/* USBX Components */
/* */
/**************************************************************************/
UINT _ux_utility_memory_compare(VOID *memory_source, VOID *memory_destination, ULONG length)
@@ -91,9 +84,9 @@ UCHAR * destination;
/* Not equal, return an error. */
return(UX_ERROR);
}
- }
-
- /* Blocks are equal, return success. */
- return(UX_SUCCESS);
+ }
+
+ /* Blocks are equal, return success. */
+ return(UX_SUCCESS);
}
diff --git a/common/core/src/ux_utility_memory_copy.c b/common/core/src/ux_utility_memory_copy.c
index bfde5be0..0d65afb0 100644
--- a/common/core/src/ux_utility_memory_copy.c
+++ b/common/core/src/ux_utility_memory_copy.c
@@ -1,18 +1,19 @@
/***************************************************************************
- * Copyright (c) 2024 Microsoft Corporation
- *
+ * Copyright (c) 2024 Microsoft Corporation
+ * Copyright (c) 2026-present Eclipse ThreadX contributors
+ *
* This program and the accompanying materials are made available under the
* terms of the MIT License which is available at
* https://opensource.org/licenses/MIT.
- *
+ *
* SPDX-License-Identifier: MIT
**************************************************************************/
/**************************************************************************/
/**************************************************************************/
-/** */
-/** USBX Component */
+/** */
+/** USBX Component */
/** */
/** Utility */
/** */
@@ -27,46 +28,38 @@
#include "ux_api.h"
-/**************************************************************************/
-/* */
-/* FUNCTION RELEASE */
-/* */
-/* _ux_utility_memory_copy PORTABLE C */
+/**************************************************************************/
+/* */
+/* FUNCTION RELEASE */
+/* */
+/* _ux_utility_memory_copy PORTABLE C */
/* 6.1 */
/* AUTHOR */
/* */
/* Chaoqiong Xiao, Microsoft Corporation */
/* */
/* DESCRIPTION */
-/* */
-/* This function copies a block of memory from a source to a */
-/* destination. */
-/* */
-/* INPUT */
-/* */
-/* memory_destination Pointer to destination */
-/* memory_source Pointer to source */
-/* length Number of bytes to copy */
-/* */
-/* OUTPUT */
-/* */
-/* None */
-/* */
-/* CALLS */
-/* */
-/* None */
-/* */
-/* CALLED BY */
-/* */
-/* USBX Components */
-/* */
-/* RELEASE HISTORY */
-/* */
-/* DATE NAME DESCRIPTION */
-/* */
-/* 05-19-2020 Chaoqiong Xiao Initial Version 6.0 */
-/* 09-30-2020 Chaoqiong Xiao Modified comment(s), */
-/* resulting in version 6.1 */
+/* */
+/* This function copies a block of memory from a source to a */
+/* destination. */
+/* */
+/* INPUT */
+/* */
+/* memory_destination Pointer to destination */
+/* memory_source Pointer to source */
+/* length Number of bytes to copy */
+/* */
+/* OUTPUT */
+/* */
+/* None */
+/* */
+/* CALLS */
+/* */
+/* None */
+/* */
+/* CALLED BY */
+/* */
+/* USBX Components */
/* */
/**************************************************************************/
VOID _ux_utility_memory_copy(VOID *memory_destination, VOID *memory_source, ULONG length)
@@ -88,6 +81,6 @@ UCHAR * destination;
}
/* Return to caller. */
- return;
+ return;
}
diff --git a/common/core/src/ux_utility_memory_free.c b/common/core/src/ux_utility_memory_free.c
index 12ff8f5d..10c96755 100644
--- a/common/core/src/ux_utility_memory_free.c
+++ b/common/core/src/ux_utility_memory_free.c
@@ -1,10 +1,11 @@
/***************************************************************************
- * Copyright (c) 2024 Microsoft Corporation
- *
+ * Copyright (c) 2024 Microsoft Corporation
+ * Copyright (c) 2026-present Eclipse ThreadX contributors
+ *
* This program and the accompanying materials are made available under the
* terms of the MIT License which is available at
* https://opensource.org/licenses/MIT.
- *
+ *
* SPDX-License-Identifier: MIT
**************************************************************************/
@@ -58,21 +59,6 @@
/* */
/* USBX Components */
/* */
-/* RELEASE HISTORY */
-/* */
-/* DATE NAME DESCRIPTION */
-/* */
-/* 05-19-2020 Chaoqiong Xiao Initial Version 6.0 */
-/* 09-30-2020 Chaoqiong Xiao Modified comment(s), */
-/* resulting in version 6.1 */
-/* 01-31-2022 Chaoqiong Xiao Modified comment(s), */
-/* added standalone support, */
-/* resulting in version 6.1.10 */
-/* 10-31-2023 Yajun Xia, CQ Xiao Modified comment(s), */
-/* added some error traps, */
-/* refined memory management, */
-/* resulting in version 6.3.0 */
-/* */
/**************************************************************************/
VOID _ux_utility_memory_free(VOID *memory)
{
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 db0b86ad..33174611 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
@@ -1,10 +1,11 @@
/***************************************************************************
- * Copyright (c) 2024 Microsoft Corporation
- *
+ * Copyright (c) 2024 Microsoft Corporation
+ * Copyright (c) 2026-present Eclipse ThreadX contributors
+ *
* This program and the accompanying materials are made available under the
* terms of the MIT License which is available at
* https://opensource.org/licenses/MIT.
- *
+ *
* SPDX-License-Identifier: MIT
**************************************************************************/
@@ -60,18 +61,6 @@
/* */
/* USBX Components */
/* */
-/* RELEASE HISTORY */
-/* */
-/* DATE NAME DESCRIPTION */
-/* */
-/* 05-19-2020 Chaoqiong Xiao Initial Version 6.0 */
-/* 09-30-2020 Chaoqiong Xiao Modified comment(s), */
-/* resulting in version 6.1 */
-/* 10-31-2023 Yajun Xia Modified comment(s), */
-/* deprecated for memory */
-/* footprint optimization, */
-/* resulting in version 6.3.0 */
-/* */
/**************************************************************************/
#if 0
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 edcab9a3..7c72466f 100644
--- a/common/core/src/ux_utility_memory_set.c
+++ b/common/core/src/ux_utility_memory_set.c
@@ -1,18 +1,19 @@
/***************************************************************************
- * Copyright (c) 2024 Microsoft Corporation
- *
+ * Copyright (c) 2024 Microsoft Corporation
+ * Copyright (c) 2026-present Eclipse ThreadX contributors
+ *
* This program and the accompanying materials are made available under the
* terms of the MIT License which is available at
* https://opensource.org/licenses/MIT.
- *
+ *
* SPDX-License-Identifier: MIT
**************************************************************************/
/**************************************************************************/
/**************************************************************************/
-/** */
-/** USBX Component */
+/** */
+/** USBX Component */
/** */
/** Utility */
/** */
@@ -27,45 +28,37 @@
#include "ux_api.h"
-/**************************************************************************/
-/* */
-/* FUNCTION RELEASE */
-/* */
-/* _ux_utility_memory_set PORTABLE C */
+/**************************************************************************/
+/* */
+/* FUNCTION RELEASE */
+/* */
+/* _ux_utility_memory_set PORTABLE C */
/* 6.1 */
/* AUTHOR */
/* */
/* Chaoqiong Xiao, Microsoft Corporation */
/* */
/* DESCRIPTION */
-/* */
-/* This function sets a memory block with a specific value. */
-/* */
-/* INPUT */
-/* */
-/* destination Destination address */
-/* value 8-bit value */
-/* length Size of memory to set */
-/* */
-/* OUTPUT */
-/* */
-/* None */
-/* */
-/* CALLS */
-/* */
+/* */
+/* This function sets a memory block with a specific value. */
+/* */
+/* INPUT */
+/* */
+/* destination Destination address */
+/* value 8-bit value */
+/* length Size of memory to set */
+/* */
+/* OUTPUT */
+/* */
/* None */
-/* */
-/* CALLED BY */
-/* */
-/* USBX Components */
-/* */
-/* RELEASE HISTORY */
-/* */
-/* DATE NAME DESCRIPTION */
-/* */
-/* 05-19-2020 Chaoqiong Xiao Initial Version 6.0 */
-/* 09-30-2020 Chaoqiong Xiao Modified comment(s), */
-/* resulting in version 6.1 */
+/* */
+/* CALLS */
+/* */
+/* None */
+/* */
+/* CALLED BY */
+/* */
+/* USBX Components */
/* */
/**************************************************************************/
VOID _ux_utility_memory_set(VOID *destination, UCHAR value, ULONG length)
@@ -86,6 +79,6 @@ UCHAR * work_ptr;
}
/* Return to caller. */
- return;
+ return;
}
diff --git a/common/core/src/ux_utility_mutex_create.c b/common/core/src/ux_utility_mutex_create.c
index e3ba0720..09a8c83e 100644
--- a/common/core/src/ux_utility_mutex_create.c
+++ b/common/core/src/ux_utility_mutex_create.c
@@ -1,18 +1,19 @@
/***************************************************************************
- * Copyright (c) 2024 Microsoft Corporation
- *
+ * Copyright (c) 2024 Microsoft Corporation
+ * Copyright (c) 2026-present Eclipse ThreadX contributors
+ *
* This program and the accompanying materials are made available under the
* terms of the MIT License which is available at
* https://opensource.org/licenses/MIT.
- *
+ *
* SPDX-License-Identifier: MIT
**************************************************************************/
/**************************************************************************/
/**************************************************************************/
-/** */
-/** USBX Component */
+/** */
+/** USBX Component */
/** */
/** Utility */
/** */
@@ -28,50 +29,36 @@
#if !defined(UX_STANDALONE)
-/**************************************************************************/
-/* */
-/* FUNCTION RELEASE */
-/* */
-/* _ux_utility_mutex_create PORTABLE C */
+/**************************************************************************/
+/* */
+/* FUNCTION RELEASE */
+/* */
+/* _ux_utility_mutex_create PORTABLE C */
/* 6.1.11 */
/* AUTHOR */
/* */
/* Chaoqiong Xiao, Microsoft Corporation */
/* */
/* DESCRIPTION */
-/* */
-/* This function creates a protection mutex. */
-/* */
-/* INPUT */
-/* */
-/* mutex Pointer to mutex */
-/* mutex_name Name of mutex */
-/* */
-/* OUTPUT */
-/* */
-/* Completion Status */
-/* */
-/* CALLS */
-/* */
+/* */
+/* This function creates a protection mutex. */
+/* */
+/* INPUT */
+/* */
+/* mutex Pointer to mutex */
+/* mutex_name Name of mutex */
+/* */
+/* OUTPUT */
+/* */
+/* Completion Status */
+/* */
+/* CALLS */
+/* */
/* tx_mutex_create ThreadX mutex create */
-/* */
-/* 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), */
-/* used UX prefix to refer to */
-/* TX symbols instead of using */
-/* them directly, */
-/* resulting in version 6.1 */
-/* 04-25-2022 Chaoqiong Xiao Modified comment(s), */
-/* off in standalone build, */
-/* resulting in version 6.1.11 */
+/* */
+/* CALLED BY */
+/* */
+/* USBX Components */
/* */
/**************************************************************************/
UINT _ux_utility_mutex_create(UX_MUTEX *mutex, CHAR *mutex_name)
@@ -81,7 +68,7 @@ UINT status;
/* Call ThreadX to create the Mutex object. */
- status = tx_mutex_create(mutex, (CHAR *) mutex_name, TX_NO_INHERIT);
+ status = tx_mutex_create(mutex, (CHAR *) mutex_name, TX_NO_INHERIT);
/* Check for status. */
if (status != UX_SUCCESS)
diff --git a/common/core/src/ux_utility_mutex_delete.c b/common/core/src/ux_utility_mutex_delete.c
index d5522ac5..c1e95de1 100644
--- a/common/core/src/ux_utility_mutex_delete.c
+++ b/common/core/src/ux_utility_mutex_delete.c
@@ -1,18 +1,19 @@
/***************************************************************************
- * Copyright (c) 2024 Microsoft Corporation
- *
+ * Copyright (c) 2024 Microsoft Corporation
+ * Copyright (c) 2026-present Eclipse ThreadX contributors
+ *
* This program and the accompanying materials are made available under the
* terms of the MIT License which is available at
* https://opensource.org/licenses/MIT.
- *
+ *
* SPDX-License-Identifier: MIT
**************************************************************************/
/**************************************************************************/
/**************************************************************************/
-/** */
-/** USBX Component */
+/** */
+/** USBX Component */
/** */
/** Utility */
/** */
@@ -28,49 +29,35 @@
#if !defined(UX_STANDALONE)
-/**************************************************************************/
-/* */
-/* FUNCTION RELEASE */
-/* */
-/* _ux_utility_mutex_delete PORTABLE C */
+/**************************************************************************/
+/* */
+/* FUNCTION RELEASE */
+/* */
+/* _ux_utility_mutex_delete PORTABLE C */
/* 6.1.11 */
/* AUTHOR */
/* */
/* Chaoqiong Xiao, Microsoft Corporation */
/* */
/* DESCRIPTION */
-/* */
-/* This function deletes a protection mutex. */
-/* */
-/* INPUT */
-/* */
-/* mutex Pointer to mutex */
-/* */
-/* OUTPUT */
-/* */
-/* Completion Status */
-/* */
-/* CALLS */
-/* */
+/* */
+/* This function deletes a protection mutex. */
+/* */
+/* INPUT */
+/* */
+/* mutex Pointer to mutex */
+/* */
+/* OUTPUT */
+/* */
+/* Completion Status */
+/* */
+/* CALLS */
+/* */
/* tx_mutex_create ThreadX mutex create */
-/* */
-/* 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), */
-/* used UX prefix to refer to */
-/* TX symbols instead of using */
-/* them directly, */
-/* resulting in version 6.1 */
-/* 04-25-2022 Chaoqiong Xiao Modified comment(s), */
-/* off in standalone build, */
-/* resulting in version 6.1.11 */
+/* */
+/* CALLED BY */
+/* */
+/* USBX Components */
/* */
/**************************************************************************/
UINT _ux_utility_mutex_delete(UX_MUTEX *mutex)
diff --git a/common/core/src/ux_utility_mutex_off.c b/common/core/src/ux_utility_mutex_off.c
index 2bc3359b..1bda7a8d 100644
--- a/common/core/src/ux_utility_mutex_off.c
+++ b/common/core/src/ux_utility_mutex_off.c
@@ -1,18 +1,19 @@
/***************************************************************************
- * Copyright (c) 2024 Microsoft Corporation
- *
+ * Copyright (c) 2024 Microsoft Corporation
+ * Copyright (c) 2026-present Eclipse ThreadX contributors
+ *
* This program and the accompanying materials are made available under the
* terms of the MIT License which is available at
* https://opensource.org/licenses/MIT.
- *
+ *
* SPDX-License-Identifier: MIT
**************************************************************************/
/**************************************************************************/
/**************************************************************************/
-/** */
-/** USBX Component */
+/** */
+/** USBX Component */
/** */
/** Utility */
/** */
@@ -28,49 +29,35 @@
#if !defined(UX_STANDALONE)
-/**************************************************************************/
-/* */
-/* FUNCTION RELEASE */
-/* */
-/* _ux_utility_mutex_off PORTABLE C */
+/**************************************************************************/
+/* */
+/* FUNCTION RELEASE */
+/* */
+/* _ux_utility_mutex_off PORTABLE C */
/* 6.1.11 */
/* AUTHOR */
/* */
/* Chaoqiong Xiao, Microsoft Corporation */
/* */
/* DESCRIPTION */
-/* */
-/* This function releases system protection. */
-/* */
-/* INPUT */
-/* */
-/* Mutex */
-/* */
-/* OUTPUT */
-/* */
-/* None */
-/* */
-/* CALLS */
-/* */
+/* */
+/* This function releases system protection. */
+/* */
+/* INPUT */
+/* */
+/* Mutex */
+/* */
+/* OUTPUT */
+/* */
+/* None */
+/* */
+/* CALLS */
+/* */
/* tx_mutex_put ThreadX mutex put */
-/* */
-/* 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), */
-/* used UX prefix to refer to */
-/* TX symbols instead of using */
-/* them directly, */
-/* resulting in version 6.1 */
-/* 04-25-2022 Chaoqiong Xiao Modified comment(s), */
-/* off in standalone build, */
-/* resulting in version 6.1.11 */
+/* */
+/* CALLED BY */
+/* */
+/* USBX Components */
/* */
/**************************************************************************/
VOID _ux_utility_mutex_off(UX_MUTEX *mutex)
diff --git a/common/core/src/ux_utility_mutex_on.c b/common/core/src/ux_utility_mutex_on.c
index 8402a19a..da9c836b 100644
--- a/common/core/src/ux_utility_mutex_on.c
+++ b/common/core/src/ux_utility_mutex_on.c
@@ -1,18 +1,19 @@
/***************************************************************************
- * Copyright (c) 2024 Microsoft Corporation
- *
+ * Copyright (c) 2024 Microsoft Corporation
+ * Copyright (c) 2026-present Eclipse ThreadX contributors
+ *
* This program and the accompanying materials are made available under the
* terms of the MIT License which is available at
* https://opensource.org/licenses/MIT.
- *
+ *
* SPDX-License-Identifier: MIT
**************************************************************************/
/**************************************************************************/
/**************************************************************************/
-/** */
-/** USBX Component */
+/** */
+/** USBX Component */
/** */
/** Utility */
/** */
@@ -28,49 +29,35 @@
#if !defined(UX_STANDALONE)
-/**************************************************************************/
-/* */
-/* FUNCTION RELEASE */
-/* */
-/* _ux_utility_mutex_on PORTABLE C */
+/**************************************************************************/
+/* */
+/* FUNCTION RELEASE */
+/* */
+/* _ux_utility_mutex_on PORTABLE C */
/* 6.1.11 */
/* AUTHOR */
/* */
/* Chaoqiong Xiao, Microsoft Corporation */
/* */
/* DESCRIPTION */
-/* */
-/* This function gets system protection. */
-/* */
-/* INPUT */
-/* */
-/* Mutex */
-/* */
-/* OUTPUT */
-/* */
-/* None */
-/* */
-/* CALLS */
-/* */
+/* */
+/* This function gets system protection. */
+/* */
+/* INPUT */
+/* */
+/* Mutex */
+/* */
+/* OUTPUT */
+/* */
+/* None */
+/* */
+/* CALLS */
+/* */
/* tx_mutex_get ThreadX mutex get */
-/* */
-/* 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), */
-/* used UX prefix to refer to */
-/* TX symbols instead of using */
-/* them directly, */
-/* resulting in version 6.1 */
-/* 04-25-2022 Chaoqiong Xiao Modified comment(s), */
-/* off in standalone build, */
-/* resulting in version 6.1.11 */
+/* */
+/* CALLED BY */
+/* */
+/* USBX Components */
/* */
/**************************************************************************/
VOID _ux_utility_mutex_on(UX_MUTEX *mutex)
diff --git a/common/core/src/ux_utility_pci_class_scan.c b/common/core/src/ux_utility_pci_class_scan.c
index 4ff850c5..9a4c499c 100644
--- a/common/core/src/ux_utility_pci_class_scan.c
+++ b/common/core/src/ux_utility_pci_class_scan.c
@@ -1,18 +1,19 @@
/***************************************************************************
- * Copyright (c) 2024 Microsoft Corporation
- *
+ * Copyright (c) 2024 Microsoft Corporation
+ * Copyright (c) 2026-present Eclipse ThreadX contributors
+ *
* This program and the accompanying materials are made available under the
* terms of the MIT License which is available at
* https://opensource.org/licenses/MIT.
- *
+ *
* SPDX-License-Identifier: MIT
**************************************************************************/
/**************************************************************************/
/**************************************************************************/
-/** */
-/** USBX Component */
+/** */
+/** USBX Component */
/** */
/** Utility */
/** */
@@ -27,53 +28,45 @@
#include "ux_api.h"
-/**************************************************************************/
-/* */
-/* FUNCTION RELEASE */
-/* */
-/* _ux_utility_pci_class_scan PORTABLE C */
+/**************************************************************************/
+/* */
+/* FUNCTION RELEASE */
+/* */
+/* _ux_utility_pci_class_scan PORTABLE C */
/* 6.1 */
/* AUTHOR */
/* */
/* Chaoqiong Xiao, Microsoft Corporation */
/* */
/* DESCRIPTION */
-/* */
-/* This function scans the PCI bus from a certain position for a */
-/* specific PCI class. */
-/* */
-/* INPUT */
-/* */
-/* pci_class PCI class requested */
-/* bus_number PCI bus number */
-/* device_number Device number */
-/* function_number Function number */
-/* current_bus_number Current bus number */
-/* current_device_number Current device number */
-/* current_function_number Current function number */
-/* */
-/* OUTPUT */
-/* */
-/* 32-bit value */
-/* */
-/* CALLS */
-/* */
-/* _ux_utility_pci_read PCI read utility */
-/* */
-/* CALLED BY */
-/* */
-/* USBX Components */
-/* */
-/* RELEASE HISTORY */
-/* */
-/* DATE NAME DESCRIPTION */
-/* */
-/* 05-19-2020 Chaoqiong Xiao Initial Version 6.0 */
-/* 09-30-2020 Chaoqiong Xiao Modified comment(s), */
-/* resulting in version 6.1 */
+/* */
+/* This function scans the PCI bus from a certain position for a */
+/* specific PCI class. */
+/* */
+/* INPUT */
+/* */
+/* pci_class PCI class requested */
+/* bus_number PCI bus number */
+/* device_number Device number */
+/* function_number Function number */
+/* current_bus_number Current bus number */
+/* current_device_number Current device number */
+/* current_function_number Current function number */
+/* */
+/* OUTPUT */
+/* */
+/* 32-bit value */
+/* */
+/* CALLS */
+/* */
+/* _ux_utility_pci_read PCI read utility */
+/* */
+/* CALLED BY */
+/* */
+/* USBX Components */
/* */
/**************************************************************************/
-ULONG _ux_utility_pci_class_scan(ULONG pci_class, ULONG bus_number, ULONG device_number,
+ULONG _ux_utility_pci_class_scan(ULONG pci_class, ULONG bus_number, ULONG device_number,
ULONG function_number, ULONG *current_bus_number,
ULONG *current_device_number, ULONG *current_function_number)
{
diff --git a/common/core/src/ux_utility_pci_read.c b/common/core/src/ux_utility_pci_read.c
index 2cd809f6..cd526f95 100644
--- a/common/core/src/ux_utility_pci_read.c
+++ b/common/core/src/ux_utility_pci_read.c
@@ -1,18 +1,19 @@
/***************************************************************************
- * Copyright (c) 2024 Microsoft Corporation
- *
+ * Copyright (c) 2024 Microsoft Corporation
+ * Copyright (c) 2026-present Eclipse ThreadX contributors
+ *
* This program and the accompanying materials are made available under the
* terms of the MIT License which is available at
* https://opensource.org/licenses/MIT.
- *
+ *
* SPDX-License-Identifier: MIT
**************************************************************************/
/**************************************************************************/
/**************************************************************************/
-/** */
-/** USBX Component */
+/** */
+/** USBX Component */
/** */
/** Utility */
/** */
@@ -27,51 +28,43 @@
#include "ux_api.h"
-/**************************************************************************/
-/* */
-/* FUNCTION RELEASE */
-/* */
-/* _ux_utility_pci_read PORTABLE C */
+/**************************************************************************/
+/* */
+/* FUNCTION RELEASE */
+/* */
+/* _ux_utility_pci_read PORTABLE C */
/* 6.1 */
/* AUTHOR */
/* */
/* Chaoqiong Xiao, Microsoft Corporation */
/* */
/* DESCRIPTION */
-/* */
-/* This function reads a 32/16/8 bit value from a specific PCI bus */
-/* at a certain offset. */
-/* */
-/* INPUT */
-/* */
-/* bus_number PCI bus number */
-/* device_number Device number */
-/* function_number Function number */
-/* offset Offset */
-/* read_size Size of read */
-/* */
-/* OUTPUT */
-/* */
-/* 32-bit value */
-/* */
-/* CALLS */
-/* */
-/* inpl PCI input long */
-/* inpw PCI input word */
-/* inpb PCI input byte */
+/* */
+/* This function reads a 32/16/8 bit value from a specific PCI bus */
+/* at a certain offset. */
+/* */
+/* INPUT */
+/* */
+/* bus_number PCI bus number */
+/* device_number Device number */
+/* function_number Function number */
+/* offset Offset */
+/* read_size Size of read */
+/* */
+/* OUTPUT */
+/* */
+/* 32-bit value */
+/* */
+/* CALLS */
+/* */
+/* inpl PCI input long */
+/* inpw PCI input word */
+/* inpb PCI input byte */
/* outpl PCI output function */
-/* */
-/* CALLED BY */
-/* */
-/* USBX Components */
-/* */
-/* RELEASE HISTORY */
-/* */
-/* DATE NAME DESCRIPTION */
-/* */
-/* 05-19-2020 Chaoqiong Xiao Initial Version 6.0 */
-/* 09-30-2020 Chaoqiong Xiao Modified comment(s), */
-/* resulting in version 6.1 */
+/* */
+/* CALLED BY */
+/* */
+/* USBX Components */
/* */
/**************************************************************************/
ULONG _ux_utility_pci_read(ULONG bus_number, ULONG device_number, ULONG function_number,
@@ -81,7 +74,7 @@ ULONG _ux_utility_pci_read(ULONG bus_number, ULONG device_number, ULONG functio
ULONG destination_address;
ULONG cfg_ctrl;
-
+
/* Calculate the destination address. */
destination_address = (((bus_number << 16) & 0x00ff0000) | ((device_number << 11) & 0x0000f800) |
((function_number << 8) & 0x00000700));
@@ -100,7 +93,7 @@ ULONG cfg_ctrl;
/* Return the 32 bit content of this address. */
return(inpl(UX_PCI_CFG_DATA_ADDRESS));
-
+
case 16:
/* Write the address we need to read from. */
diff --git a/common/core/src/ux_utility_pci_write.c b/common/core/src/ux_utility_pci_write.c
index 30358665..f37629c8 100644
--- a/common/core/src/ux_utility_pci_write.c
+++ b/common/core/src/ux_utility_pci_write.c
@@ -1,18 +1,19 @@
/***************************************************************************
- * Copyright (c) 2024 Microsoft Corporation
- *
+ * Copyright (c) 2024 Microsoft Corporation
+ * Copyright (c) 2026-present Eclipse ThreadX contributors
+ *
* This program and the accompanying materials are made available under the
* terms of the MIT License which is available at
* https://opensource.org/licenses/MIT.
- *
+ *
* SPDX-License-Identifier: MIT
**************************************************************************/
/**************************************************************************/
/**************************************************************************/
-/** */
-/** USBX Component */
+/** */
+/** USBX Component */
/** */
/** Utility */
/** */
@@ -27,51 +28,43 @@
#include "ux_api.h"
-/**************************************************************************/
-/* */
-/* FUNCTION RELEASE */
-/* */
-/* _ux_utility_pci_write PORTABLE C */
+/**************************************************************************/
+/* */
+/* FUNCTION RELEASE */
+/* */
+/* _ux_utility_pci_write PORTABLE C */
/* 6.1 */
/* AUTHOR */
/* */
/* Chaoqiong Xiao, Microsoft Corporation */
/* */
/* DESCRIPTION */
-/* */
-/* This function writes a 32/16/8 bit value to a specific PCI bus */
-/* at a certain offset. */
-/* */
-/* INPUT */
-/* */
-/* bus_number PCI bus number */
-/* device_number Device number */
-/* function_number Function number */
-/* offset Offset */
-/* value Value to write */
-/* write_size Size of write */
-/* */
-/* OUTPUT */
-/* */
-/* None */
-/* */
-/* CALLS */
-/* */
+/* */
+/* This function writes a 32/16/8 bit value to a specific PCI bus */
+/* at a certain offset. */
+/* */
+/* INPUT */
+/* */
+/* bus_number PCI bus number */
+/* device_number Device number */
+/* function_number Function number */
+/* offset Offset */
+/* value Value to write */
+/* write_size Size of write */
+/* */
+/* OUTPUT */
+/* */
+/* None */
+/* */
+/* CALLS */
+/* */
/* outpl PCI output long function */
-/* outpw PCI output word function */
-/* outpb PCI output byte function */
-/* */
-/* CALLED BY */
-/* */
-/* USBX Components */
-/* */
-/* RELEASE HISTORY */
-/* */
-/* DATE NAME DESCRIPTION */
-/* */
-/* 05-19-2020 Chaoqiong Xiao Initial Version 6.0 */
-/* 09-30-2020 Chaoqiong Xiao Modified comment(s), */
-/* resulting in version 6.1 */
+/* outpw PCI output word function */
+/* outpb PCI output byte function */
+/* */
+/* CALLED BY */
+/* */
+/* USBX Components */
/* */
/**************************************************************************/
VOID _ux_utility_pci_write(ULONG bus_number, ULONG device_number, ULONG function_number,
@@ -101,16 +94,16 @@ ULONG cfg_ctrl;
/* Write the 32 bit content of this address. */
outpl(UX_PCI_CFG_DATA_ADDRESS, value);
break;
-
+
case 16:
-
+
/* Write the address we need to write to. */
outpl(UX_PCI_CFG_CTRL_ADDRESS, cfg_ctrl);
/* Write the 16 bit content of this address. */
outpw(UX_PCI_CFG_DATA_ADDRESS + (offset & 2), (USHORT) value);
break;
-
+
case 8:
/* Write the address we need to write to. */
@@ -121,7 +114,7 @@ ULONG cfg_ctrl;
break;
default:
-
+
break;
}
}
diff --git a/common/core/src/ux_utility_physical_address.c b/common/core/src/ux_utility_physical_address.c
index e9549786..a6879105 100644
--- a/common/core/src/ux_utility_physical_address.c
+++ b/common/core/src/ux_utility_physical_address.c
@@ -1,18 +1,19 @@
/***************************************************************************
- * Copyright (c) 2024 Microsoft Corporation
- *
+ * Copyright (c) 2024 Microsoft Corporation
+ * Copyright (c) 2026-present Eclipse ThreadX contributors
+ *
* This program and the accompanying materials are made available under the
* terms of the MIT License which is available at
* https://opensource.org/licenses/MIT.
- *
+ *
* SPDX-License-Identifier: MIT
**************************************************************************/
/**************************************************************************/
/**************************************************************************/
-/** */
-/** USBX Component */
+/** */
+/** USBX Component */
/** */
/** Utility */
/** */
@@ -27,44 +28,36 @@
#include "ux_api.h"
-/**************************************************************************/
-/* */
-/* FUNCTION RELEASE */
-/* */
-/* _ux_utility_physical_address PORTABLE C */
+/**************************************************************************/
+/* */
+/* FUNCTION RELEASE */
+/* */
+/* _ux_utility_physical_address PORTABLE C */
/* 6.1 */
/* AUTHOR */
/* */
/* Chaoqiong Xiao, Microsoft Corporation */
/* */
/* DESCRIPTION */
-/* */
-/* This function returns a physical address given the supplied */
-/* virtual address. */
-/* */
-/* INPUT */
-/* */
-/* virtual_address Physical address */
-/* */
-/* OUTPUT */
-/* */
-/* physical_address Virtual address */
-/* */
-/* CALLS */
-/* */
+/* */
+/* This function returns a physical address given the supplied */
+/* virtual address. */
+/* */
+/* INPUT */
+/* */
+/* virtual_address Physical address */
+/* */
+/* OUTPUT */
+/* */
+/* physical_address Virtual address */
+/* */
+/* CALLS */
+/* */
/* None */
-/* */
-/* CALLED BY */
-/* */
-/* USBX Components */
-/* */
-/* RELEASE HISTORY */
-/* */
-/* DATE NAME DESCRIPTION */
-/* */
-/* 05-19-2020 Chaoqiong Xiao Initial Version 6.0 */
-/* 09-30-2020 Chaoqiong Xiao Modified comment(s), */
-/* resulting in version 6.1 */
+/* */
+/* CALLED BY */
+/* */
+/* USBX Components */
/* */
/**************************************************************************/
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 95574c3e..51d0ffd8 100644
--- a/common/core/src/ux_utility_semaphore_create.c
+++ b/common/core/src/ux_utility_semaphore_create.c
@@ -1,18 +1,19 @@
/***************************************************************************
- * Copyright (c) 2024 Microsoft Corporation
- *
+ * Copyright (c) 2024 Microsoft Corporation
+ * Copyright (c) 2026-present Eclipse ThreadX contributors
+ *
* This program and the accompanying materials are made available under the
* terms of the MIT License which is available at
* https://opensource.org/licenses/MIT.
- *
+ *
* SPDX-License-Identifier: MIT
**************************************************************************/
/**************************************************************************/
/**************************************************************************/
-/** */
-/** USBX Component */
+/** */
+/** USBX Component */
/** */
/** Utility */
/** */
@@ -28,51 +29,37 @@
#if !defined(UX_STANDALONE)
-/**************************************************************************/
-/* */
-/* FUNCTION RELEASE */
-/* */
-/* _ux_utility_semaphore_create PORTABLE C */
+/**************************************************************************/
+/* */
+/* FUNCTION RELEASE */
+/* */
+/* _ux_utility_semaphore_create PORTABLE C */
/* 6.1.11 */
/* AUTHOR */
/* */
/* Chaoqiong Xiao, Microsoft Corporation */
/* */
/* DESCRIPTION */
-/* */
-/* This function creates a semaphore. */
-/* */
-/* INPUT */
-/* */
-/* semaphore Semaphore to create */
-/* semaphore_name Semaphore name */
-/* initial_count Initial semaphore count */
-/* */
-/* OUTPUT */
-/* */
+/* */
+/* This function creates a semaphore. */
+/* */
+/* INPUT */
+/* */
+/* semaphore Semaphore to create */
+/* semaphore_name Semaphore name */
+/* initial_count Initial semaphore count */
+/* */
+/* OUTPUT */
+/* */
/* Completion Status */
-/* */
-/* CALLS */
-/* */
+/* */
+/* CALLS */
+/* */
/* tx_semaphore_create ThreadX semaphore create */
-/* */
-/* 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), */
-/* used UX prefix to refer to */
-/* TX symbols instead of using */
-/* them directly, */
-/* resulting in version 6.1 */
-/* 04-25-2022 Chaoqiong Xiao Modified comment(s), */
-/* off in standalone build, */
-/* resulting in version 6.1.11 */
+/* */
+/* CALLED BY */
+/* */
+/* USBX Components */
/* */
/**************************************************************************/
UINT _ux_utility_semaphore_create(UX_SEMAPHORE *semaphore, CHAR *semaphore_name, UINT initial_count)
diff --git a/common/core/src/ux_utility_semaphore_delete.c b/common/core/src/ux_utility_semaphore_delete.c
index e5aa7dc7..20863815 100644
--- a/common/core/src/ux_utility_semaphore_delete.c
+++ b/common/core/src/ux_utility_semaphore_delete.c
@@ -1,18 +1,19 @@
/***************************************************************************
- * Copyright (c) 2024 Microsoft Corporation
- *
+ * Copyright (c) 2024 Microsoft Corporation
+ * Copyright (c) 2026-present Eclipse ThreadX contributors
+ *
* This program and the accompanying materials are made available under the
* terms of the MIT License which is available at
* https://opensource.org/licenses/MIT.
- *
+ *
* SPDX-License-Identifier: MIT
**************************************************************************/
/**************************************************************************/
/**************************************************************************/
-/** */
-/** USBX Component */
+/** */
+/** USBX Component */
/** */
/** Utility */
/** */
@@ -28,49 +29,35 @@
#if !defined(UX_STANDALONE)
-/**************************************************************************/
-/* */
-/* FUNCTION RELEASE */
-/* */
-/* _ux_utility_semaphore_delete PORTABLE C */
+/**************************************************************************/
+/* */
+/* FUNCTION RELEASE */
+/* */
+/* _ux_utility_semaphore_delete PORTABLE C */
/* 6.1.11 */
/* AUTHOR */
/* */
/* Chaoqiong Xiao, Microsoft Corporation */
/* */
/* DESCRIPTION */
-/* */
-/* This function deletes the specified semaphore. */
-/* */
-/* INPUT */
-/* */
-/* semaphore Semaphore to delete */
-/* */
-/* OUTPUT */
-/* */
+/* */
+/* This function deletes the specified semaphore. */
+/* */
+/* INPUT */
+/* */
+/* semaphore Semaphore to delete */
+/* */
+/* OUTPUT */
+/* */
/* Completion Status */
-/* */
-/* CALLS */
-/* */
+/* */
+/* CALLS */
+/* */
/* tx_semaphore_delete ThreadX semaphore delete */
-/* */
-/* 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), */
-/* used UX prefix to refer to */
-/* TX symbols instead of using */
-/* them directly, */
-/* resulting in version 6.1 */
-/* 04-25-2022 Chaoqiong Xiao Modified comment(s), */
-/* off in standalone build, */
-/* resulting in version 6.1.11 */
+/* */
+/* CALLED BY */
+/* */
+/* USBX Components */
/* */
/**************************************************************************/
UINT _ux_utility_semaphore_delete(UX_SEMAPHORE *semaphore)
diff --git a/common/core/src/ux_utility_semaphore_get.c b/common/core/src/ux_utility_semaphore_get.c
index 6df0e469..b0cb5783 100644
--- a/common/core/src/ux_utility_semaphore_get.c
+++ b/common/core/src/ux_utility_semaphore_get.c
@@ -1,18 +1,19 @@
/***************************************************************************
- * Copyright (c) 2024 Microsoft Corporation
- *
+ * Copyright (c) 2024 Microsoft Corporation
+ * Copyright (c) 2026-present Eclipse ThreadX contributors
+ *
* This program and the accompanying materials are made available under the
* terms of the MIT License which is available at
* https://opensource.org/licenses/MIT.
- *
+ *
* SPDX-License-Identifier: MIT
**************************************************************************/
/**************************************************************************/
/**************************************************************************/
-/** */
-/** USBX Component */
+/** */
+/** USBX Component */
/** */
/** Utility */
/** */
@@ -28,51 +29,37 @@
#if !defined(UX_STANDALONE)
-/**************************************************************************/
-/* */
-/* FUNCTION RELEASE */
-/* */
-/* _ux_utility_semaphore_get PORTABLE C */
+/**************************************************************************/
+/* */
+/* FUNCTION RELEASE */
+/* */
+/* _ux_utility_semaphore_get PORTABLE C */
/* 6.1.11 */
/* AUTHOR */
/* */
/* Chaoqiong Xiao, Microsoft Corporation */
/* */
/* DESCRIPTION */
-/* */
-/* This function gets a semaphore signal. */
-/* */
-/* INPUT */
-/* */
-/* semaphore Semaphore to get signal from */
-/* */
-/* OUTPUT */
-/* */
+/* */
+/* This function gets a semaphore signal. */
+/* */
+/* INPUT */
+/* */
+/* semaphore Semaphore to get signal from */
+/* */
+/* OUTPUT */
+/* */
/* Completion Status */
-/* */
-/* CALLS */
-/* */
+/* */
+/* CALLS */
+/* */
/* tx_thread_identify ThreadX identify thread */
/* tx_thread_info_get ThreadX get thread info */
/* tx_semaphore_get ThreadX semaphore get */
-/* */
-/* 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), */
-/* used UX prefix to refer to */
-/* TX symbols instead of using */
-/* them directly, */
-/* resulting in version 6.1 */
-/* 04-25-2022 Chaoqiong Xiao Modified comment(s), */
-/* off in standalone build, */
-/* resulting in version 6.1.11 */
+/* */
+/* CALLED BY */
+/* */
+/* USBX Components */
/* */
/**************************************************************************/
UINT _ux_utility_semaphore_get(UX_SEMAPHORE *semaphore, ULONG semaphore_signal)
@@ -103,7 +90,7 @@ UX_THREAD *suspended_thread;
/* We need to remember this thread priority. */
_ux_system -> ux_system_thread_lowest_priority = priority;
-
+
}
/* Get ThreadX semaphore instance. */
diff --git a/common/core/src/ux_utility_semaphore_put.c b/common/core/src/ux_utility_semaphore_put.c
index 7ca6d382..8ea5ae63 100644
--- a/common/core/src/ux_utility_semaphore_put.c
+++ b/common/core/src/ux_utility_semaphore_put.c
@@ -1,18 +1,19 @@
/***************************************************************************
- * Copyright (c) 2024 Microsoft Corporation
- *
+ * Copyright (c) 2024 Microsoft Corporation
+ * Copyright (c) 2026-present Eclipse ThreadX contributors
+ *
* This program and the accompanying materials are made available under the
* terms of the MIT License which is available at
* https://opensource.org/licenses/MIT.
- *
+ *
* SPDX-License-Identifier: MIT
**************************************************************************/
/**************************************************************************/
/**************************************************************************/
-/** */
-/** USBX Component */
+/** */
+/** USBX Component */
/** */
/** Utility */
/** */
@@ -28,49 +29,35 @@
#if !defined(UX_STANDALONE)
-/**************************************************************************/
-/* */
-/* FUNCTION RELEASE */
-/* */
-/* _ux_utility_semaphore_put PORTABLE C */
+/**************************************************************************/
+/* */
+/* FUNCTION RELEASE */
+/* */
+/* _ux_utility_semaphore_put PORTABLE C */
/* 6.1.11 */
/* AUTHOR */
/* */
/* Chaoqiong Xiao, Microsoft Corporation */
/* */
/* DESCRIPTION */
-/* */
-/* This function sets a semaphore signal. */
-/* */
-/* INPUT */
-/* */
-/* semaphore Semaphore to signal */
-/* */
-/* OUTPUT */
-/* */
+/* */
+/* This function sets a semaphore signal. */
+/* */
+/* INPUT */
+/* */
+/* semaphore Semaphore to signal */
+/* */
+/* OUTPUT */
+/* */
/* Completion Status */
-/* */
-/* CALLS */
-/* */
+/* */
+/* CALLS */
+/* */
/* tx_semaphore_put ThreadX semaphore put */
-/* */
-/* 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), */
-/* used UX prefix to refer to */
-/* TX symbols instead of using */
-/* them directly, */
-/* resulting in version 6.1 */
-/* 04-25-2022 Chaoqiong Xiao Modified comment(s), */
-/* off in standalone build, */
-/* resulting in version 6.1.11 */
+/* */
+/* CALLED BY */
+/* */
+/* USBX Components */
/* */
/**************************************************************************/
UINT _ux_utility_semaphore_put(UX_SEMAPHORE *semaphore)
diff --git a/common/core/src/ux_utility_set_interrupt_handler.c b/common/core/src/ux_utility_set_interrupt_handler.c
index 10b5c0ee..1511fffe 100644
--- a/common/core/src/ux_utility_set_interrupt_handler.c
+++ b/common/core/src/ux_utility_set_interrupt_handler.c
@@ -1,18 +1,19 @@
/***************************************************************************
- * Copyright (c) 2024 Microsoft Corporation
- *
+ * Copyright (c) 2024 Microsoft Corporation
+ * Copyright (c) 2026-present Eclipse ThreadX contributors
+ *
* This program and the accompanying materials are made available under the
* terms of the MIT License which is available at
* https://opensource.org/licenses/MIT.
- *
+ *
* SPDX-License-Identifier: MIT
**************************************************************************/
/**************************************************************************/
/**************************************************************************/
-/** */
-/** USBX Component */
+/** */
+/** USBX Component */
/** */
/** Utility */
/** */
@@ -27,44 +28,36 @@
#include "ux_api.h"
-/**************************************************************************/
-/* */
-/* FUNCTION RELEASE */
-/* */
-/* _ux_utility_set_interrupt_handler PORTABLE C */
+/**************************************************************************/
+/* */
+/* FUNCTION RELEASE */
+/* */
+/* _ux_utility_set_interrupt_handler PORTABLE C */
/* 6.1 */
/* AUTHOR */
/* */
/* Chaoqiong Xiao, Microsoft Corporation */
/* */
/* DESCRIPTION */
-/* */
-/* This function installs an interrupt handler for USBX. */
-/* */
-/* INPUT */
-/* */
-/* irq Interrupt to install */
-/* interrupt_handler Pointer to interrupt handler */
-/* */
-/* OUTPUT */
-/* */
+/* */
+/* This function installs an interrupt handler for USBX. */
+/* */
+/* INPUT */
+/* */
+/* irq Interrupt to install */
+/* interrupt_handler Pointer to interrupt handler */
+/* */
+/* OUTPUT */
+/* */
/* None */
-/* */
-/* CALLS */
-/* */
+/* */
+/* CALLS */
+/* */
/* None */
-/* */
-/* CALLED BY */
-/* */
-/* USBX Components */
-/* */
-/* RELEASE HISTORY */
-/* */
-/* DATE NAME DESCRIPTION */
-/* */
-/* 05-19-2020 Chaoqiong Xiao Initial Version 6.0 */
-/* 09-30-2020 Chaoqiong Xiao Modified comment(s), */
-/* resulting in version 6.1 */
+/* */
+/* CALLED BY */
+/* */
+/* USBX Components */
/* */
/**************************************************************************/
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 d9acbb5b..6556b6f1 100644
--- a/common/core/src/ux_utility_short_get.c
+++ b/common/core/src/ux_utility_short_get.c
@@ -1,18 +1,19 @@
/***************************************************************************
- * Copyright (c) 2024 Microsoft Corporation
- *
+ * Copyright (c) 2024 Microsoft Corporation
+ * Copyright (c) 2026-present Eclipse ThreadX contributors
+ *
* This program and the accompanying materials are made available under the
* terms of the MIT License which is available at
* https://opensource.org/licenses/MIT.
- *
+ *
* SPDX-License-Identifier: MIT
**************************************************************************/
/**************************************************************************/
/**************************************************************************/
-/** */
-/** USBX Component */
+/** */
+/** USBX Component */
/** */
/** Utility */
/** */
@@ -27,43 +28,35 @@
#include "ux_api.h"
-/**************************************************************************/
-/* */
-/* FUNCTION RELEASE */
-/* */
-/* _ux_utility_short_get PORTABLE C */
+/**************************************************************************/
+/* */
+/* FUNCTION RELEASE */
+/* */
+/* _ux_utility_short_get PORTABLE C */
/* 6.1 */
/* AUTHOR */
/* */
/* Chaoqiong Xiao, Microsoft Corporation */
/* */
/* DESCRIPTION */
-/* */
-/* This function reads a 16-bit value. */
-/* */
-/* INPUT */
-/* */
-/* address Source address */
-/* */
-/* OUTPUT */
-/* */
-/* 16-bit value */
-/* */
-/* CALLS */
-/* */
+/* */
+/* This function reads a 16-bit value. */
+/* */
+/* INPUT */
+/* */
+/* address Source address */
+/* */
+/* OUTPUT */
+/* */
+/* 16-bit value */
+/* */
+/* CALLS */
+/* */
/* None */
-/* */
-/* CALLED BY */
-/* */
-/* USBX Components */
-/* */
-/* RELEASE HISTORY */
-/* */
-/* DATE NAME DESCRIPTION */
-/* */
-/* 05-19-2020 Chaoqiong Xiao Initial Version 6.0 */
-/* 09-30-2020 Chaoqiong Xiao Modified comment(s), */
-/* resulting in version 6.1 */
+/* */
+/* CALLED BY */
+/* */
+/* USBX Components */
/* */
/**************************************************************************/
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 fead23f1..4ec3a92f 100644
--- a/common/core/src/ux_utility_short_get_big_endian.c
+++ b/common/core/src/ux_utility_short_get_big_endian.c
@@ -1,18 +1,19 @@
/***************************************************************************
- * Copyright (c) 2024 Microsoft Corporation
- *
+ * Copyright (c) 2024 Microsoft Corporation
+ * Copyright (c) 2026-present Eclipse ThreadX contributors
+ *
* This program and the accompanying materials are made available under the
* terms of the MIT License which is available at
* https://opensource.org/licenses/MIT.
- *
+ *
* SPDX-License-Identifier: MIT
**************************************************************************/
/**************************************************************************/
/**************************************************************************/
-/** */
-/** USBX Component */
+/** */
+/** USBX Component */
/** */
/** Utility */
/** */
@@ -27,43 +28,35 @@
#include "ux_api.h"
-/**************************************************************************/
-/* */
-/* FUNCTION RELEASE */
-/* */
-/* _ux_utility_short_get_big_endian PORTABLE C */
+/**************************************************************************/
+/* */
+/* FUNCTION RELEASE */
+/* */
+/* _ux_utility_short_get_big_endian PORTABLE C */
/* 6.1 */
/* AUTHOR */
/* */
/* Chaoqiong Xiao, Microsoft Corporation */
/* */
/* DESCRIPTION */
-/* */
-/* This function reads a 16-bit value in big endian format. */
-/* */
-/* INPUT */
-/* */
-/* address Source address */
-/* */
-/* OUTPUT */
-/* */
-/* 16-bit value */
-/* */
-/* CALLS */
-/* */
+/* */
+/* This function reads a 16-bit value in big endian format. */
+/* */
+/* INPUT */
+/* */
+/* address Source address */
+/* */
+/* OUTPUT */
+/* */
+/* 16-bit value */
+/* */
+/* CALLS */
+/* */
/* None */
-/* */
-/* CALLED BY */
-/* */
-/* USBX Components */
-/* */
-/* RELEASE HISTORY */
-/* */
-/* DATE NAME DESCRIPTION */
-/* */
-/* 05-19-2020 Chaoqiong Xiao Initial Version 6.0 */
-/* 09-30-2020 Chaoqiong Xiao Modified comment(s), */
-/* resulting in version 6.1 */
+/* */
+/* CALLED BY */
+/* */
+/* USBX Components */
/* */
/**************************************************************************/
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 4bc06436..91560819 100644
--- a/common/core/src/ux_utility_short_put.c
+++ b/common/core/src/ux_utility_short_put.c
@@ -1,18 +1,19 @@
/***************************************************************************
- * Copyright (c) 2024 Microsoft Corporation
- *
+ * Copyright (c) 2024 Microsoft Corporation
+ * Copyright (c) 2026-present Eclipse ThreadX contributors
+ *
* This program and the accompanying materials are made available under the
* terms of the MIT License which is available at
* https://opensource.org/licenses/MIT.
- *
+ *
* SPDX-License-Identifier: MIT
**************************************************************************/
/**************************************************************************/
/**************************************************************************/
-/** */
-/** USBX Component */
+/** */
+/** USBX Component */
/** */
/** Utility */
/** */
@@ -27,44 +28,36 @@
#include "ux_api.h"
-/**************************************************************************/
-/* */
-/* FUNCTION RELEASE */
-/* */
-/* _ux_utility_short_put PORTABLE C */
+/**************************************************************************/
+/* */
+/* FUNCTION RELEASE */
+/* */
+/* _ux_utility_short_put PORTABLE C */
/* 6.1 */
/* AUTHOR */
/* */
/* Chaoqiong Xiao, Microsoft Corporation */
/* */
/* DESCRIPTION */
-/* */
-/* This function writes a 16-bit value. */
-/* */
-/* INPUT */
-/* */
-/* address Destination address */
-/* value 16-bit value */
-/* */
-/* OUTPUT */
-/* */
-/* None */
-/* */
-/* CALLS */
-/* */
+/* */
+/* This function writes a 16-bit value. */
+/* */
+/* INPUT */
+/* */
+/* address Destination address */
+/* value 16-bit value */
+/* */
+/* OUTPUT */
+/* */
/* None */
-/* */
-/* CALLED BY */
-/* */
-/* USBX Components */
-/* */
-/* RELEASE HISTORY */
-/* */
-/* DATE NAME DESCRIPTION */
-/* */
-/* 05-19-2020 Chaoqiong Xiao Initial Version 6.0 */
-/* 09-30-2020 Chaoqiong Xiao Modified comment(s), */
-/* resulting in version 6.1 */
+/* */
+/* CALLS */
+/* */
+/* None */
+/* */
+/* CALLED BY */
+/* */
+/* USBX Components */
/* */
/**************************************************************************/
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 e1f73848..34385c95 100644
--- a/common/core/src/ux_utility_short_put_big_endian.c
+++ b/common/core/src/ux_utility_short_put_big_endian.c
@@ -1,18 +1,19 @@
/***************************************************************************
- * Copyright (c) 2024 Microsoft Corporation
- *
+ * Copyright (c) 2024 Microsoft Corporation
+ * Copyright (c) 2026-present Eclipse ThreadX contributors
+ *
* This program and the accompanying materials are made available under the
* terms of the MIT License which is available at
* https://opensource.org/licenses/MIT.
- *
+ *
* SPDX-License-Identifier: MIT
**************************************************************************/
/**************************************************************************/
/**************************************************************************/
-/** */
-/** USBX Component */
+/** */
+/** USBX Component */
/** */
/** Utility */
/** */
@@ -27,44 +28,36 @@
#include "ux_api.h"
-/**************************************************************************/
-/* */
-/* FUNCTION RELEASE */
-/* */
-/* _ux_utility_short_put_big_endian PORTABLE C */
+/**************************************************************************/
+/* */
+/* FUNCTION RELEASE */
+/* */
+/* _ux_utility_short_put_big_endian PORTABLE C */
/* 6.1 */
/* AUTHOR */
/* */
/* Chaoqiong Xiao, Microsoft Corporation */
/* */
/* DESCRIPTION */
-/* */
-/* This function writes a 16-bit value in big endian format. */
-/* */
-/* INPUT */
-/* */
-/* address Destination address */
-/* value 16-bit value */
-/* */
-/* OUTPUT */
-/* */
-/* None */
-/* */
-/* CALLS */
-/* */
+/* */
+/* This function writes a 16-bit value in big endian format. */
+/* */
+/* INPUT */
+/* */
+/* address Destination address */
+/* value 16-bit value */
+/* */
+/* OUTPUT */
+/* */
+/* None */
+/* */
+/* CALLS */
+/* */
/* None */
-/* */
-/* CALLED BY */
-/* */
-/* USBX Components */
-/* */
-/* RELEASE HISTORY */
-/* */
-/* DATE NAME DESCRIPTION */
-/* */
-/* 05-19-2020 Chaoqiong Xiao Initial Version 6.0 */
-/* 09-30-2020 Chaoqiong Xiao Modified comment(s), */
-/* resulting in version 6.1 */
+/* */
+/* CALLED BY */
+/* */
+/* USBX Components */
/* */
/**************************************************************************/
VOID _ux_utility_short_put_big_endian(UCHAR * address, USHORT value)
@@ -73,7 +66,7 @@ VOID _ux_utility_short_put_big_endian(UCHAR * address, USHORT value)
USHORT low_byte_value;
USHORT high_byte_value;
-
+
/* First we swap the value bytes. */
low_byte_value = value >> 8;
high_byte_value = (USHORT)(value<< 8);
diff --git a/common/core/src/ux_utility_string_length_check.c b/common/core/src/ux_utility_string_length_check.c
index 47ef7ce5..3a7757e6 100644
--- a/common/core/src/ux_utility_string_length_check.c
+++ b/common/core/src/ux_utility_string_length_check.c
@@ -1,18 +1,19 @@
/***************************************************************************
- * Copyright (c) 2024 Microsoft Corporation
- *
+ * Copyright (c) 2024 Microsoft Corporation
+ * Copyright (c) 2026-present Eclipse ThreadX contributors
+ *
* This program and the accompanying materials are made available under the
* terms of the MIT License which is available at
* https://opensource.org/licenses/MIT.
- *
+ *
* SPDX-License-Identifier: MIT
**************************************************************************/
/**************************************************************************/
/**************************************************************************/
-/** */
-/** USBX Component */
+/** */
+/** USBX Component */
/** */
/** Utility */
/** */
@@ -27,57 +28,47 @@
#include "ux_api.h"
-/**************************************************************************/
-/* */
-/* FUNCTION RELEASE */
-/* */
-/* _ux_utility_string_length_check PORTABLE C */
+/**************************************************************************/
+/* */
+/* FUNCTION RELEASE */
+/* */
+/* _ux_utility_string_length_check PORTABLE C */
/* 6.1.12 */
/* AUTHOR */
/* */
/* Chaoqiong Xiao, Microsoft Corporation */
/* */
/* DESCRIPTION */
-/* */
-/* This function checks if a NULL-terminated C string reaches its end */
-/* before specified length exceeds. */
-/* */
-/* On success the actual length of C string is written back to UINT */
-/* variable pointed by string_length_ptr (if not NULL). */
-/* Otherwise the variable keeps untouched. */
+/* */
+/* This function checks if a NULL-terminated C string reaches its end */
+/* before specified length exceeds. */
+/* */
+/* On success the actual length of C string is written back to UINT */
+/* variable pointed by string_length_ptr (if not NULL). */
+/* Otherwise the variable keeps untouched. */
/* */
/* Note NULL terminator is not counted in string length */
/* (same as C strlen). */
-/* */
-/* INPUT */
-/* */
-/* string Pointer to string */
-/* string_length_ptr Pointer to UINT to receive */
-/* the string length */
-/* max_string_length Max string length */
-/* */
-/* OUTPUT */
-/* */
-/* returns success if the string length was less than the max length, */
-/* else it returns error */
-/* */
-/* CALLS */
-/* */
-/* None */
-/* */
-/* CALLED BY */
-/* */
-/* USBX Components */
-/* */
-/* RELEASE HISTORY */
-/* */
-/* DATE NAME DESCRIPTION */
-/* */
-/* 05-19-2020 Chaoqiong Xiao Initial Version 6.0 */
-/* 09-30-2020 Chaoqiong Xiao Modified comment(s), */
-/* resulting in version 6.1 */
-/* 07-29-2022 Chaoqiong Xiao Modified comment(s), */
-/* resulting in version 6.1.12 */
+/* */
+/* INPUT */
+/* */
+/* string Pointer to string */
+/* string_length_ptr Pointer to UINT to receive */
+/* the string length */
+/* max_string_length Max string length */
+/* */
+/* OUTPUT */
+/* */
+/* returns success if the string length was less than the max length, */
+/* else it returns error */
+/* */
+/* CALLS */
+/* */
+/* None */
+/* */
+/* CALLED BY */
+/* */
+/* USBX Components */
/* */
/**************************************************************************/
UINT _ux_utility_string_length_check(UCHAR *string, UINT *string_length_ptr, UINT max_string_length)
@@ -111,6 +102,6 @@ UINT string_length;
if (string_length_ptr)
*string_length_ptr = string_length;
- return(UX_SUCCESS);
+ return(UX_SUCCESS);
}
diff --git a/common/core/src/ux_utility_string_length_get.c b/common/core/src/ux_utility_string_length_get.c
index 83e69465..3c34c8e2 100644
--- a/common/core/src/ux_utility_string_length_get.c
+++ b/common/core/src/ux_utility_string_length_get.c
@@ -1,18 +1,19 @@
/***************************************************************************
- * Copyright (c) 2024 Microsoft Corporation
- *
+ * Copyright (c) 2024 Microsoft Corporation
+ * Copyright (c) 2026-present Eclipse ThreadX contributors
+ *
* This program and the accompanying materials are made available under the
* terms of the MIT License which is available at
* https://opensource.org/licenses/MIT.
- *
+ *
* SPDX-License-Identifier: MIT
**************************************************************************/
/**************************************************************************/
/**************************************************************************/
-/** */
-/** USBX Component */
+/** */
+/** USBX Component */
/** */
/** Utility */
/** */
@@ -27,49 +28,41 @@
#include "ux_api.h"
-/**************************************************************************/
-/* */
-/* FUNCTION RELEASE */
-/* */
-/* _ux_utility_string_length_get PORTABLE C */
+/**************************************************************************/
+/* */
+/* FUNCTION RELEASE */
+/* */
+/* _ux_utility_string_length_get PORTABLE C */
/* 6.1 */
/* AUTHOR */
/* */
/* Chaoqiong Xiao, Microsoft Corporation */
/* */
/* DESCRIPTION */
-/* */
-/* This function derives the length of a NULL-terminated string. */
+/* */
+/* This function derives the length of a NULL-terminated string. */
/* */
/* This function is deprecated, for the possible issue of operating on */
/* a buffer that is not NULL-terminated. As a replacement, */
/* _ux_utility_string_length_check should be used, where the length of */
/* the buffer is introduced to validate the string by checking for the */
/* NULL-terminator within the buffer length. */
-/* */
-/* INPUT */
-/* */
-/* string Pointer to string */
-/* */
-/* OUTPUT */
-/* */
-/* length of string */
-/* */
-/* CALLS */
-/* */
-/* None */
-/* */
-/* CALLED BY */
-/* */
-/* USBX Components */
-/* */
-/* RELEASE HISTORY */
-/* */
-/* DATE NAME DESCRIPTION */
-/* */
-/* 05-19-2020 Chaoqiong Xiao Initial Version 6.0 */
-/* 09-30-2020 Chaoqiong Xiao Modified comment(s), */
-/* resulting in version 6.1 */
+/* */
+/* INPUT */
+/* */
+/* string Pointer to string */
+/* */
+/* OUTPUT */
+/* */
+/* length of string */
+/* */
+/* CALLS */
+/* */
+/* None */
+/* */
+/* CALLED BY */
+/* */
+/* USBX Components */
/* */
/**************************************************************************/
ULONG _ux_utility_string_length_get(UCHAR *string)
@@ -87,6 +80,6 @@ ULONG length = 0;
}
/* Return length to caller. */
- return(length);
+ return(length);
}
diff --git a/common/core/src/ux_utility_string_to_unicode.c b/common/core/src/ux_utility_string_to_unicode.c
index 72d90ea3..8a3ec711 100644
--- a/common/core/src/ux_utility_string_to_unicode.c
+++ b/common/core/src/ux_utility_string_to_unicode.c
@@ -1,18 +1,19 @@
/***************************************************************************
- * Copyright (c) 2024 Microsoft Corporation
- *
+ * Copyright (c) 2024 Microsoft Corporation
+ * Copyright (c) 2026-present Eclipse ThreadX contributors
+ *
* This program and the accompanying materials are made available under the
* terms of the MIT License which is available at
* https://opensource.org/licenses/MIT.
- *
+ *
* SPDX-License-Identifier: MIT
**************************************************************************/
/**************************************************************************/
/**************************************************************************/
-/** */
-/** USBX Component */
+/** */
+/** USBX Component */
/** */
/** Utility */
/** */
@@ -27,19 +28,19 @@
#include "ux_api.h"
-/**************************************************************************/
-/* */
-/* FUNCTION RELEASE */
-/* */
-/* _ux_utility_string_to_unicode PORTABLE C */
+/**************************************************************************/
+/* */
+/* FUNCTION RELEASE */
+/* */
+/* _ux_utility_string_to_unicode PORTABLE C */
/* 6.1 */
/* AUTHOR */
/* */
/* Chaoqiong Xiao, Microsoft Corporation */
/* */
/* DESCRIPTION */
-/* */
-/* This function converts a ascii string to a unicode string. */
+/* */
+/* This function converts a ascii string to a unicode string. */
/* */
/* Note: */
/* The unicode string length (including NULL-terminator) is limited by */
@@ -48,32 +49,24 @@
/* are converted if the string is too long. */
/* The buffer of destination must have enough space for result, at */
/* least 1 + (strlen(source) + 1) * 2 bytes. */
-/* */
-/* INPUT */
-/* */
-/* source Ascii String */
-/* destination Unicode String */
-/* */
-/* OUTPUT */
-/* */
-/* none */
-/* */
-/* CALLS */
-/* */
+/* */
+/* INPUT */
+/* */
+/* source Ascii String */
+/* destination Unicode String */
+/* */
+/* OUTPUT */
+/* */
+/* none */
+/* */
+/* CALLS */
+/* */
/* _ux_utility_string_length_check Check and return C string */
/* length */
-/* */
-/* CALLED BY */
-/* */
-/* USBX Components */
-/* */
-/* RELEASE HISTORY */
-/* */
-/* DATE NAME DESCRIPTION */
-/* */
-/* 05-19-2020 Chaoqiong Xiao Initial Version 6.0 */
-/* 09-30-2020 Chaoqiong Xiao Modified comment(s), */
-/* resulting in version 6.1 */
+/* */
+/* CALLED BY */
+/* */
+/* USBX Components */
/* */
/**************************************************************************/
VOID _ux_utility_string_to_unicode(UCHAR *source, UCHAR *destination)
@@ -85,7 +78,7 @@ UINT string_length;
string_length = 254;
_ux_utility_string_length_check(source, &string_length, 254);
- /* Set the length of the string as the first byte of the unicode string.
+ /* Set the length of the string as the first byte of the unicode string.
The length is casted as a byte since Unicode strings cannot be more than 255 chars. */
*destination++ = (UCHAR)(string_length + 1);
@@ -96,7 +89,7 @@ UINT string_length;
/* Second character of unicode word is 0. */
*destination++ = 0;
- }
+ }
/* Finish with a 0. */
*destination++ = 0;
diff --git a/common/core/src/ux_utility_thread_create.c b/common/core/src/ux_utility_thread_create.c
index 0707fe77..8b65049d 100644
--- a/common/core/src/ux_utility_thread_create.c
+++ b/common/core/src/ux_utility_thread_create.c
@@ -1,18 +1,19 @@
/***************************************************************************
- * Copyright (c) 2024 Microsoft Corporation
- *
+ * Copyright (c) 2024 Microsoft Corporation
+ * Copyright (c) 2026-present Eclipse ThreadX contributors
+ *
* This program and the accompanying materials are made available under the
* terms of the MIT License which is available at
* https://opensource.org/licenses/MIT.
- *
+ *
* SPDX-License-Identifier: MIT
**************************************************************************/
/**************************************************************************/
/**************************************************************************/
-/** */
-/** USBX Component */
+/** */
+/** USBX Component */
/** */
/** Utility */
/** */
@@ -28,63 +29,49 @@
#if !defined(UX_STANDALONE)
-/**************************************************************************/
-/* */
-/* FUNCTION RELEASE */
-/* */
-/* _ux_utility_thread_create PORTABLE C */
+/**************************************************************************/
+/* */
+/* FUNCTION RELEASE */
+/* */
+/* _ux_utility_thread_create PORTABLE C */
/* 6.1.11 */
/* AUTHOR */
/* */
/* Chaoqiong Xiao, Microsoft Corporation */
/* */
/* DESCRIPTION */
-/* */
-/* This function creates a thread for USBX. */
-/* */
-/* INPUT */
-/* */
-/* thread_ptr Thread control block pointer */
-/* name Pointer to thread name string */
-/* entry_function Entry function of the thread */
-/* entry_input 32-bit input value to thread */
-/* stack_start Pointer to start of stack */
-/* stack_size Stack size in bytes */
-/* priority Priority of thread (0-31) */
+/* */
+/* This function creates a thread for USBX. */
+/* */
+/* INPUT */
+/* */
+/* thread_ptr Thread control block pointer */
+/* name Pointer to thread name string */
+/* entry_function Entry function of the thread */
+/* entry_input 32-bit input value to thread */
+/* stack_start Pointer to start of stack */
+/* stack_size Stack size in bytes */
+/* priority Priority of thread (0-31) */
/* preempt_threshold Preemption threshold */
-/* time_slice Thread time-slice value */
-/* auto_start Automatic start selection */
-/* */
-/* OUTPUT */
-/* */
-/* Completion Status */
-/* */
-/* CALLS */
-/* */
-/* tx_thread_create ThreadX create thread function*/
-/* */
-/* 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), */
-/* used UX prefix to refer to */
-/* TX symbols instead of using */
-/* them directly, */
-/* resulting in version 6.1 */
-/* 04-25-2022 Chaoqiong Xiao Modified comment(s), */
-/* off in standalone build, */
-/* resulting in version 6.1.11 */
+/* time_slice Thread time-slice value */
+/* auto_start Automatic start selection */
+/* */
+/* OUTPUT */
+/* */
+/* Completion Status */
+/* */
+/* CALLS */
+/* */
+/* tx_thread_create ThreadX create thread function*/
+/* */
+/* CALLED BY */
+/* */
+/* USBX Components */
/* */
/**************************************************************************/
-UINT _ux_utility_thread_create(UX_THREAD *thread_ptr, CHAR *name,
+UINT _ux_utility_thread_create(UX_THREAD *thread_ptr, CHAR *name,
VOID (*entry_function)(ULONG), ULONG entry_input,
- VOID *stack_start, ULONG stack_size,
+ VOID *stack_start, ULONG stack_size,
UINT priority, UINT preempt_threshold,
ULONG time_slice, UINT auto_start)
{
diff --git a/common/core/src/ux_utility_thread_delete.c b/common/core/src/ux_utility_thread_delete.c
index b2a9f527..4d4c0702 100644
--- a/common/core/src/ux_utility_thread_delete.c
+++ b/common/core/src/ux_utility_thread_delete.c
@@ -1,18 +1,19 @@
/***************************************************************************
- * Copyright (c) 2024 Microsoft Corporation
- *
+ * Copyright (c) 2024 Microsoft Corporation
+ * Copyright (c) 2026-present Eclipse ThreadX contributors
+ *
* This program and the accompanying materials are made available under the
* terms of the MIT License which is available at
* https://opensource.org/licenses/MIT.
- *
+ *
* SPDX-License-Identifier: MIT
**************************************************************************/
/**************************************************************************/
/**************************************************************************/
-/** */
-/** USBX Component */
+/** */
+/** USBX Component */
/** */
/** Utility */
/** */
@@ -28,50 +29,36 @@
#if !defined(UX_STANDALONE)
-/**************************************************************************/
-/* */
-/* FUNCTION RELEASE */
-/* */
-/* _ux_utility_thread_delete PORTABLE C */
+/**************************************************************************/
+/* */
+/* FUNCTION RELEASE */
+/* */
+/* _ux_utility_thread_delete PORTABLE C */
/* 6.1.11 */
/* AUTHOR */
/* */
/* Chaoqiong Xiao, Microsoft Corporation */
/* */
/* DESCRIPTION */
-/* */
-/* This function deletes a thread for USBX. */
-/* */
-/* INPUT */
-/* */
-/* thread_ptr Thread control block pointer */
-/* */
-/* OUTPUT */
-/* */
-/* Completion Status */
-/* */
-/* CALLS */
-/* */
+/* */
+/* This function deletes a thread for USBX. */
+/* */
+/* INPUT */
+/* */
+/* thread_ptr Thread control block pointer */
+/* */
+/* OUTPUT */
+/* */
+/* Completion Status */
+/* */
+/* CALLS */
+/* */
/* tx_thread_terminate ThreadX terminate thread */
-/* tx_thread_delete ThreadX delete thread service */
-/* */
-/* 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), */
-/* used UX prefix to refer to */
-/* TX symbols instead of using */
-/* them directly, */
-/* resulting in version 6.1 */
-/* 04-25-2022 Chaoqiong Xiao Modified comment(s), */
-/* off in standalone build, */
-/* resulting in version 6.1.11 */
+/* tx_thread_delete ThreadX delete thread service */
+/* */
+/* CALLED BY */
+/* */
+/* USBX Components */
/* */
/**************************************************************************/
UINT _ux_utility_thread_delete(UX_THREAD *thread_ptr)
diff --git a/common/core/src/ux_utility_thread_identify.c b/common/core/src/ux_utility_thread_identify.c
index 1248d65b..9aa3d304 100644
--- a/common/core/src/ux_utility_thread_identify.c
+++ b/common/core/src/ux_utility_thread_identify.c
@@ -1,10 +1,11 @@
/***************************************************************************
- * Copyright (c) 2024 Microsoft Corporation
- *
+ * Copyright (c) 2024 Microsoft Corporation
+ * Copyright (c) 2026-present Eclipse ThreadX contributors
+ *
* This program and the accompanying materials are made available under the
* terms of the MIT License which is available at
* https://opensource.org/licenses/MIT.
- *
+ *
* SPDX-License-Identifier: MIT
**************************************************************************/
@@ -59,20 +60,6 @@
/* */
/* USBX Components */
/* */
-/* RELEASE HISTORY */
-/* */
-/* 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 */
-/* 04-25-2022 Chaoqiong Xiao Modified comment(s), */
-/* off in standalone build, */
-/* resulting in version 6.1.11 */
-/* */
/**************************************************************************/
UX_THREAD *_ux_utility_thread_identify(VOID)
{
diff --git a/common/core/src/ux_utility_thread_relinquish.c b/common/core/src/ux_utility_thread_relinquish.c
index 45f129ec..45958894 100644
--- a/common/core/src/ux_utility_thread_relinquish.c
+++ b/common/core/src/ux_utility_thread_relinquish.c
@@ -1,18 +1,19 @@
/***************************************************************************
- * Copyright (c) 2024 Microsoft Corporation
- *
+ * Copyright (c) 2024 Microsoft Corporation
+ * Copyright (c) 2026-present Eclipse ThreadX contributors
+ *
* This program and the accompanying materials are made available under the
* terms of the MIT License which is available at
* https://opensource.org/licenses/MIT.
- *
+ *
* SPDX-License-Identifier: MIT
**************************************************************************/
/**************************************************************************/
/**************************************************************************/
-/** */
-/** USBX Component */
+/** */
+/** USBX Component */
/** */
/** Utility */
/** */
@@ -28,44 +29,33 @@
#if !defined(UX_STANDALONE)
-/**************************************************************************/
-/* */
-/* FUNCTION RELEASE */
-/* */
-/* _ux_utility_thread_relinquish PORTABLE C */
+/**************************************************************************/
+/* */
+/* FUNCTION RELEASE */
+/* */
+/* _ux_utility_thread_relinquish PORTABLE C */
/* 6.1.11 */
/* AUTHOR */
/* */
/* Chaoqiong Xiao, Microsoft Corporation */
/* */
/* DESCRIPTION */
-/* */
-/* This function helps the thread relinquish its control. */
-/* */
-/* INPUT */
-/* */
-/* */
-/* OUTPUT */
-/* */
-/* */
-/* CALLS */
-/* */
-/* tx_thread_relinquish ThreadX relinquish thread */
-/* */
-/* CALLED BY */
-/* */
-/* USBX Components */
-/* */
-/* RELEASE HISTORY */
-/* */
-/* DATE NAME DESCRIPTION */
-/* */
-/* 05-19-2020 Chaoqiong Xiao Initial Version 6.0 */
-/* 09-30-2020 Chaoqiong Xiao Modified comment(s), */
-/* resulting in version 6.1 */
-/* 04-25-2022 Chaoqiong Xiao Modified comment(s), */
-/* off in standalone build, */
-/* resulting in version 6.1.11 */
+/* */
+/* This function helps the thread relinquish its control. */
+/* */
+/* INPUT */
+/* */
+/* */
+/* OUTPUT */
+/* */
+/* */
+/* CALLS */
+/* */
+/* tx_thread_relinquish ThreadX relinquish thread */
+/* */
+/* CALLED BY */
+/* */
+/* USBX Components */
/* */
/**************************************************************************/
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 5e4af2b7..cdea668d 100644
--- a/common/core/src/ux_utility_thread_resume.c
+++ b/common/core/src/ux_utility_thread_resume.c
@@ -1,18 +1,19 @@
/***************************************************************************
- * Copyright (c) 2024 Microsoft Corporation
- *
+ * Copyright (c) 2024 Microsoft Corporation
+ * Copyright (c) 2026-present Eclipse ThreadX contributors
+ *
* This program and the accompanying materials are made available under the
* terms of the MIT License which is available at
* https://opensource.org/licenses/MIT.
- *
+ *
* SPDX-License-Identifier: MIT
**************************************************************************/
/**************************************************************************/
/**************************************************************************/
-/** */
-/** USBX Component */
+/** */
+/** USBX Component */
/** */
/** Utility */
/** */
@@ -28,49 +29,35 @@
#if !defined(UX_STANDALONE)
-/**************************************************************************/
-/* */
-/* FUNCTION RELEASE */
-/* */
-/* _ux_utility_thread_resume PORTABLE C */
+/**************************************************************************/
+/* */
+/* FUNCTION RELEASE */
+/* */
+/* _ux_utility_thread_resume PORTABLE C */
/* 6.1.11 */
/* AUTHOR */
/* */
/* Chaoqiong Xiao, Microsoft Corporation */
/* */
/* DESCRIPTION */
-/* */
-/* This function resumes a thread for USBX. */
-/* */
-/* INPUT */
-/* */
-/* thread_ptr Thread control block pointer */
-/* */
-/* OUTPUT */
-/* */
-/* Completion Status */
-/* */
-/* CALLS */
-/* */
-/* tx_thread_resume ThreadX resume thread function*/
-/* */
-/* 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), */
-/* used UX prefix to refer to */
-/* TX symbols instead of using */
-/* them directly, */
-/* resulting in version 6.1 */
-/* 04-25-2022 Chaoqiong Xiao Modified comment(s), */
-/* off in standalone build, */
-/* resulting in version 6.1.11 */
+/* */
+/* This function resumes a thread for USBX. */
+/* */
+/* INPUT */
+/* */
+/* thread_ptr Thread control block pointer */
+/* */
+/* OUTPUT */
+/* */
+/* Completion Status */
+/* */
+/* CALLS */
+/* */
+/* tx_thread_resume ThreadX resume thread function*/
+/* */
+/* CALLED BY */
+/* */
+/* USBX Components */
/* */
/**************************************************************************/
UINT _ux_utility_thread_resume(UX_THREAD *thread_ptr)
diff --git a/common/core/src/ux_utility_thread_schedule_other.c b/common/core/src/ux_utility_thread_schedule_other.c
index f6f82a2b..f991f5d0 100644
--- a/common/core/src/ux_utility_thread_schedule_other.c
+++ b/common/core/src/ux_utility_thread_schedule_other.c
@@ -1,18 +1,19 @@
/***************************************************************************
- * Copyright (c) 2024 Microsoft Corporation
- *
+ * Copyright (c) 2024 Microsoft Corporation
+ * Copyright (c) 2026-present Eclipse ThreadX contributors
+ *
* This program and the accompanying materials are made available under the
* terms of the MIT License which is available at
* https://opensource.org/licenses/MIT.
- *
+ *
* SPDX-License-Identifier: MIT
**************************************************************************/
/**************************************************************************/
/**************************************************************************/
-/** */
-/** USBX Component */
+/** */
+/** USBX Component */
/** */
/** Utility */
/** */
@@ -28,51 +29,37 @@
#if !defined(UX_STANDALONE)
-/**************************************************************************/
-/* */
-/* FUNCTION RELEASE */
-/* */
-/* _ux_utility_thread_schedule_other PORTABLE C */
+/**************************************************************************/
+/* */
+/* FUNCTION RELEASE */
+/* */
+/* _ux_utility_thread_schedule_other PORTABLE C */
/* 6.1.11 */
/* AUTHOR */
/* */
/* Chaoqiong Xiao, Microsoft Corporation */
/* */
/* DESCRIPTION */
-/* */
-/* This function force the scheduling of all other threads. */
-/* */
-/* INPUT */
-/* */
-/* caller_priority Priority to restore. */
-/* */
-/* OUTPUT */
-/* */
-/* Completion Status */
-/* */
-/* CALLS */
-/* */
-/* tx_thread_identify ThreadX identify */
-/* tx_thread_priority_change ThreadX priority change */
-/* tx_thread_relinquish ThreadX relinquish */
-/* */
-/* 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), */
-/* used UX prefix to refer to */
-/* TX symbols instead of using */
-/* them directly, */
-/* resulting in version 6.1 */
-/* 04-25-2022 Chaoqiong Xiao Modified comment(s), */
-/* off in standalone build, */
-/* resulting in version 6.1.11 */
+/* */
+/* This function force the scheduling of all other threads. */
+/* */
+/* INPUT */
+/* */
+/* caller_priority Priority to restore. */
+/* */
+/* OUTPUT */
+/* */
+/* Completion Status */
+/* */
+/* CALLS */
+/* */
+/* tx_thread_identify ThreadX identify */
+/* tx_thread_priority_change ThreadX priority change */
+/* tx_thread_relinquish ThreadX relinquish */
+/* */
+/* CALLED BY */
+/* */
+/* USBX Components */
/* */
/**************************************************************************/
UINT _ux_utility_thread_schedule_other(UINT caller_priority)
@@ -89,17 +76,17 @@ UX_THREAD *my_thread;
/* Call ThreadX to change thread priority . */
status = tx_thread_priority_change(my_thread, _ux_system -> ux_system_thread_lowest_priority, &old_priority);
-
+
/* Check for error. */
if (status == TX_SUCCESS)
{
-
+
/* Wait until all other threads passed into the scheduler. */
_ux_utility_thread_relinquish();
-
+
/* And now return the priority of the thread to normal. */
status = tx_thread_priority_change(my_thread, old_priority, &old_priority);
-
+
}
/* Return completion status. */
diff --git a/common/core/src/ux_utility_thread_sleep.c b/common/core/src/ux_utility_thread_sleep.c
index 19db51e3..0c814cd1 100644
--- a/common/core/src/ux_utility_thread_sleep.c
+++ b/common/core/src/ux_utility_thread_sleep.c
@@ -1,18 +1,19 @@
/***************************************************************************
- * Copyright (c) 2024 Microsoft Corporation
- *
+ * Copyright (c) 2024 Microsoft Corporation
+ * Copyright (c) 2026-present Eclipse ThreadX contributors
+ *
* This program and the accompanying materials are made available under the
* terms of the MIT License which is available at
* https://opensource.org/licenses/MIT.
- *
+ *
* SPDX-License-Identifier: MIT
**************************************************************************/
/**************************************************************************/
/**************************************************************************/
-/** */
-/** USBX Component */
+/** */
+/** USBX Component */
/** */
/** Utility */
/** */
@@ -28,47 +29,36 @@
#if !defined(UX_STANDALONE)
-/**************************************************************************/
-/* */
-/* FUNCTION RELEASE */
-/* */
-/* _ux_utility_thread_sleep PORTABLE C */
+/**************************************************************************/
+/* */
+/* FUNCTION RELEASE */
+/* */
+/* _ux_utility_thread_sleep PORTABLE C */
/* 6.1.11 */
/* AUTHOR */
/* */
/* Chaoqiong Xiao, Microsoft Corporation */
/* */
/* DESCRIPTION */
-/* */
-/* This function causes the calling thread to sleep for the */
-/* specified number of ticks. */
-/* */
-/* INPUT */
-/* */
-/* ticks Number of ticks to sleep */
-/* */
-/* OUTPUT */
-/* */
-/* Completion Status */
-/* */
-/* CALLS */
-/* */
-/* tx_thread_sleep ThreadX sleep function */
-/* */
-/* CALLED BY */
-/* */
-/* USBX Components */
-/* */
-/* RELEASE HISTORY */
-/* */
-/* DATE NAME DESCRIPTION */
-/* */
-/* 05-19-2020 Chaoqiong Xiao Initial Version 6.0 */
-/* 09-30-2020 Chaoqiong Xiao Modified comment(s), */
-/* resulting in version 6.1 */
-/* 04-25-2022 Chaoqiong Xiao Modified comment(s), */
-/* off in standalone build, */
-/* resulting in version 6.1.11 */
+/* */
+/* This function causes the calling thread to sleep for the */
+/* specified number of ticks. */
+/* */
+/* INPUT */
+/* */
+/* ticks Number of ticks to sleep */
+/* */
+/* OUTPUT */
+/* */
+/* Completion Status */
+/* */
+/* CALLS */
+/* */
+/* tx_thread_sleep ThreadX sleep function */
+/* */
+/* CALLED BY */
+/* */
+/* USBX Components */
/* */
/**************************************************************************/
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 c78f154e..b36f90ea 100644
--- a/common/core/src/ux_utility_thread_suspend.c
+++ b/common/core/src/ux_utility_thread_suspend.c
@@ -1,18 +1,19 @@
/***************************************************************************
- * Copyright (c) 2024 Microsoft Corporation
- *
+ * Copyright (c) 2024 Microsoft Corporation
+ * Copyright (c) 2026-present Eclipse ThreadX contributors
+ *
* This program and the accompanying materials are made available under the
* terms of the MIT License which is available at
* https://opensource.org/licenses/MIT.
- *
+ *
* SPDX-License-Identifier: MIT
**************************************************************************/
/**************************************************************************/
/**************************************************************************/
-/** */
-/** USBX Component */
+/** */
+/** USBX Component */
/** */
/** Utility */
/** */
@@ -28,49 +29,35 @@
#if !defined(UX_STANDALONE)
-/**************************************************************************/
-/* */
-/* FUNCTION RELEASE */
-/* */
-/* _ux_utility_thread_suspend PORTABLE C */
+/**************************************************************************/
+/* */
+/* FUNCTION RELEASE */
+/* */
+/* _ux_utility_thread_suspend PORTABLE C */
/* 6.1.11 */
/* AUTHOR */
/* */
/* Chaoqiong Xiao, Microsoft Corporation */
/* */
/* DESCRIPTION */
-/* */
-/* This function suspends thread for USBX. */
-/* */
-/* INPUT */
-/* */
-/* thread_ptr Thread control block pointer */
-/* */
-/* OUTPUT */
-/* */
-/* Completion Status */
-/* */
-/* CALLS */
-/* */
-/* tx_thread_suspend ThreadX suspend thread service*/
-/* */
-/* 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), */
-/* used UX prefix to refer to */
-/* TX symbols instead of using */
-/* them directly, */
-/* resulting in version 6.1 */
-/* 04-25-2022 Chaoqiong Xiao Modified comment(s), */
-/* off in standalone build, */
-/* resulting in version 6.1.11 */
+/* */
+/* This function suspends thread for USBX. */
+/* */
+/* INPUT */
+/* */
+/* thread_ptr Thread control block pointer */
+/* */
+/* OUTPUT */
+/* */
+/* Completion Status */
+/* */
+/* CALLS */
+/* */
+/* tx_thread_suspend ThreadX suspend thread service*/
+/* */
+/* CALLED BY */
+/* */
+/* USBX Components */
/* */
/**************************************************************************/
UINT _ux_utility_thread_suspend(UX_THREAD *thread_ptr)
diff --git a/common/core/src/ux_utility_timer_create.c b/common/core/src/ux_utility_timer_create.c
index 40bb6615..e4d46527 100644
--- a/common/core/src/ux_utility_timer_create.c
+++ b/common/core/src/ux_utility_timer_create.c
@@ -1,5 +1,6 @@
/***************************************************************************
* Copyright (c) 2024 Microsoft Corporation
+ * Copyright (c) 2026-present Eclipse ThreadX contributors
*
* This program and the accompanying materials are made available under the
* terms of the MIT License which is available at
@@ -59,22 +60,6 @@
/* */
/* USBX Components */
/* */
-/* RELEASE HISTORY */
-/* */
-/* DATE NAME DESCRIPTION */
-/* */
-/* 05-19-2020 Chaoqiong Xiao Initial Version 6.0 */
-/* 09-30-2020 Chaoqiong Xiao Modified comment(s), */
-/* resulting in version 6.1 */
-/* 04-25-2022 Chaoqiong Xiao Modified comment(s), */
-/* off in standalone build, */
-/* resulting in version 6.1.11 */
-/* xx-xx-xxxx Chaoqiong Xiao Modified comment(s), */
-/* used UX prefix to refer to */
-/* TX symbols instead of using */
-/* them directly, */
-/* resulting in version 6.x */
-/* */
/**************************************************************************/
UINT _ux_utility_timer_create(UX_TIMER *timer, CHAR *timer_name, VOID (*expiration_function) (ULONG),
ULONG expiration_input, ULONG initial_ticks, ULONG reschedule_ticks,
diff --git a/common/core/src/ux_utility_timer_delete.c b/common/core/src/ux_utility_timer_delete.c
index 8878708a..8718595b 100644
--- a/common/core/src/ux_utility_timer_delete.c
+++ b/common/core/src/ux_utility_timer_delete.c
@@ -1,5 +1,6 @@
/***************************************************************************
* Copyright (c) 2024 Microsoft Corporation
+ * Copyright (c) 2026-present Eclipse ThreadX contributors
*
* This program and the accompanying materials are made available under the
* terms of the MIT License which is available at
@@ -58,20 +59,6 @@
/* */
/* USBX Components */
/* */
-/* RELEASE HISTORY */
-/* */
-/* DATE NAME DESCRIPTION */
-/* */
-/* 09-30-2020 Chaoqiong Xiao Initial Version 6.1 */
-/* 04-25-2022 Chaoqiong Xiao Modified comment(s), */
-/* off in standalone build, */
-/* resulting in version 6.1.11 */
-/* xx-xx-xxxx Chaoqiong Xiao Modified comment(s), */
-/* used UX prefix to refer to */
-/* TX symbols instead of using */
-/* them directly, */
-/* resulting in version 6.x */
-/* */
/**************************************************************************/
UINT _ux_utility_timer_delete(UX_TIMER *timer)
{
diff --git a/common/core/src/ux_utility_unicode_to_string.c b/common/core/src/ux_utility_unicode_to_string.c
index e61c1bcb..a8631336 100644
--- a/common/core/src/ux_utility_unicode_to_string.c
+++ b/common/core/src/ux_utility_unicode_to_string.c
@@ -1,18 +1,19 @@
/***************************************************************************
- * Copyright (c) 2024 Microsoft Corporation
- *
+ * Copyright (c) 2024 Microsoft Corporation
+ * Copyright (c) 2026-present Eclipse ThreadX contributors
+ *
* This program and the accompanying materials are made available under the
* terms of the MIT License which is available at
* https://opensource.org/licenses/MIT.
- *
+ *
* SPDX-License-Identifier: MIT
**************************************************************************/
/**************************************************************************/
/**************************************************************************/
-/** */
-/** USBX Component */
+/** */
+/** USBX Component */
/** */
/** Utility */
/** */
@@ -27,45 +28,37 @@
#include "ux_api.h"
-/**************************************************************************/
-/* */
-/* FUNCTION RELEASE */
-/* */
-/* _ux_utility_unicode_to_string PORTABLE C */
+/**************************************************************************/
+/* */
+/* FUNCTION RELEASE */
+/* */
+/* _ux_utility_unicode_to_string PORTABLE C */
/* 6.1 */
/* AUTHOR */
/* */
/* Chaoqiong Xiao, Microsoft Corporation */
/* */
/* DESCRIPTION */
-/* */
-/* This function converts a unicode string to a zero terminated */
-/* ascii string. */
-/* */
-/* INPUT */
-/* */
-/* source Unicode String */
-/* destination Ascii String */
-/* */
-/* OUTPUT */
-/* */
-/* none */
-/* */
-/* CALLS */
-/* */
+/* */
+/* This function converts a unicode string to a zero terminated */
+/* ascii string. */
+/* */
+/* INPUT */
+/* */
+/* source Unicode String */
+/* destination Ascii String */
+/* */
+/* OUTPUT */
+/* */
+/* none */
+/* */
+/* CALLS */
+/* */
/* None */
-/* */
-/* CALLED BY */
-/* */
-/* USBX Components */
-/* */
-/* RELEASE HISTORY */
-/* */
-/* DATE NAME DESCRIPTION */
-/* */
-/* 05-19-2020 Chaoqiong Xiao Initial Version 6.0 */
-/* 09-30-2020 Chaoqiong Xiao Modified comment(s), */
-/* resulting in version 6.1 */
+/* */
+/* CALLED BY */
+/* */
+/* USBX Components */
/* */
/**************************************************************************/
VOID _ux_utility_unicode_to_string(UCHAR *source, UCHAR *destination)
@@ -75,7 +68,7 @@ ULONG string_length;
/* Obtain the length of the unicode string. This is the first byte*/
string_length = (ULONG) *source++;
- /* Parse the unicode string. First byte is always 0, second byte is the
+ /* Parse the unicode string. First byte is always 0, second byte is the
ASCII character. */
while(string_length--)
{
@@ -84,11 +77,11 @@ ULONG string_length;
/* Second character of unicode word is 0. */
source++;
- }
+ }
/* We are done with the ascii string. Insert a zero at the end. */
*destination = 0;
-
+
/* Finished. */
return;
}
diff --git a/common/core/src/ux_utility_virtual_address.c b/common/core/src/ux_utility_virtual_address.c
index 91a56e74..a0e963fc 100644
--- a/common/core/src/ux_utility_virtual_address.c
+++ b/common/core/src/ux_utility_virtual_address.c
@@ -1,18 +1,19 @@
/***************************************************************************
- * Copyright (c) 2024 Microsoft Corporation
- *
+ * Copyright (c) 2024 Microsoft Corporation
+ * Copyright (c) 2026-present Eclipse ThreadX contributors
+ *
* This program and the accompanying materials are made available under the
* terms of the MIT License which is available at
* https://opensource.org/licenses/MIT.
- *
+ *
* SPDX-License-Identifier: MIT
**************************************************************************/
/**************************************************************************/
/**************************************************************************/
-/** */
-/** USBX Component */
+/** */
+/** USBX Component */
/** */
/** Utility */
/** */
@@ -27,44 +28,36 @@
#include "ux_api.h"
-/**************************************************************************/
-/* */
-/* FUNCTION RELEASE */
-/* */
-/* _ux_utility_virtual_address PORTABLE C */
+/**************************************************************************/
+/* */
+/* FUNCTION RELEASE */
+/* */
+/* _ux_utility_virtual_address PORTABLE C */
/* 6.1 */
/* AUTHOR */
/* */
/* Chaoqiong Xiao, Microsoft Corporation */
/* */
/* DESCRIPTION */
-/* */
-/* This function returns a virtual address given the supplied */
-/* physical address. */
-/* */
-/* INPUT */
-/* */
-/* physical_address Virtual address */
-/* */
-/* OUTPUT */
-/* */
-/* virtual_address Physical address */
-/* */
-/* CALLS */
-/* */
+/* */
+/* This function returns a virtual address given the supplied */
+/* physical address. */
+/* */
+/* INPUT */
+/* */
+/* physical_address Virtual address */
+/* */
+/* OUTPUT */
+/* */
+/* virtual_address Physical address */
+/* */
+/* CALLS */
+/* */
/* None */
-/* */
-/* CALLED BY */
-/* */
-/* USBX Components */
-/* */
-/* RELEASE HISTORY */
-/* */
-/* DATE NAME DESCRIPTION */
-/* */
-/* 05-19-2020 Chaoqiong Xiao Initial Version 6.0 */
-/* 09-30-2020 Chaoqiong Xiao Modified comment(s), */
-/* resulting in version 6.1 */
+/* */
+/* CALLED BY */
+/* */
+/* USBX Components */
/* */
/**************************************************************************/
VOID *_ux_utility_virtual_address(VOID *physical_address)
@@ -76,7 +69,7 @@ VOID *virtual_address;
will be below. If there is no translation, the physical address=
the virtual address. */
- virtual_address = physical_address;
+ virtual_address = physical_address;
return(virtual_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 6b7411d3..bc0e508b 100644
--- a/common/usbx_device_classes/inc/ux_device_class_audio.h
+++ b/common/usbx_device_classes/inc/ux_device_class_audio.h
@@ -1,10 +1,11 @@
/***************************************************************************
- * Copyright (c) 2024 Microsoft Corporation
- *
+ * Copyright (c) 2024 Microsoft Corporation
+ * Copyright (c) 2026-present Eclipse ThreadX contributors
+ *
* This program and the accompanying materials are made available under the
* terms of the MIT License which is available at
* https://opensource.org/licenses/MIT.
- *
+ *
* SPDX-License-Identifier: MIT
**************************************************************************/
@@ -35,41 +36,6 @@
/* This file contains all the header and extern functions used by the */
/* USBX audio class. */
/* */
-/* RELEASE HISTORY */
-/* */
-/* 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 */
-/* 08-02-2021 Wen Wang Modified comment(s), */
-/* added extern "C" keyword */
-/* for compatibility with C++, */
-/* resulting in version 6.1.8 */
-/* 01-31-2022 Chaoqiong Xiao Modified comment(s), */
-/* added feedback support, */
-/* resulting in version 6.1.10 */
-/* 04-25-2022 Chaoqiong Xiao Modified comment(s), */
-/* fixed standalone compile, */
-/* resulting in version 6.1.11 */
-/* 07-29-2022 Chaoqiong Xiao Modified comment(s), */
-/* added interrupt support, */
-/* resulting in version 6.1.12 */
-/* 10-31-2022 Yajun Xia Modified comment(s), */
-/* added standalone support, */
-/* resulting in version 6.2.0 */
-/* 03-08-2023 Chaoqiong Xiao Modified comment(s), */
-/* added error checks support, */
-/* resulting in version 6.2.1 */
-/* 10-31-2023 Chaoqiong Xiao Modified comment(s), */
-/* added a new mode to manage */
-/* endpoint buffer in classes */
-/* with zero copy enabled, */
-/* resulting in version 6.3.0 */
-/* */
/**************************************************************************/
#ifndef UX_DEVICE_CLASS_AUDIO_H
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 d4ade424..d38d4b02 100644
--- a/common/usbx_device_classes/inc/ux_device_class_audio10.h
+++ b/common/usbx_device_classes/inc/ux_device_class_audio10.h
@@ -1,10 +1,11 @@
/***************************************************************************
- * Copyright (c) 2024 Microsoft Corporation
- *
+ * Copyright (c) 2024 Microsoft Corporation
+ * Copyright (c) 2026-present Eclipse ThreadX contributors
+ *
* This program and the accompanying materials are made available under the
* terms of the MIT License which is available at
* https://opensource.org/licenses/MIT.
- *
+ *
* SPDX-License-Identifier: MIT
**************************************************************************/
@@ -35,45 +36,20 @@
/* This file contains all the header and extern functions used by the */
/* USBX audio class version 1.0. */
/* */
-/* RELEASE HISTORY */
-/* */
-/* DATE NAME DESCRIPTION */
-/* */
-/* 05-19-2020 Chaoqiong Xiao Initial Version 6.0 */
-/* 09-30-2020 Chaoqiong Xiao Modified comment(s), */
-/* resulting in version 6.1 */
-/* 04-02-2021 Chaoqiong Xiao Modified comment(s), */
-/* added volume RES support, */
-/* resulting in version 6.1.6 */
-/* 08-02-2021 Chaoqiong Xiao Modified comment(s), */
-/* added extern "C" keyword */
-/* for compatibility with C++, */
-/* resulting in version 6.1.8 */
-/* 07-29-2022 Chaoqiong Xiao Modified comment(s), */
-/* added sampling control, */
-/* resulting in version 6.1.12 */
-/* 03-08-2023 Chaoqiong Xiao Modified comment(s), */
-/* added error checks support, */
-/* fixed a macro name, */
-/* resulting in version 6.2.1 */
-/* 10-31-2023 Chaoqiong Xiao Modified comment(s), */
-/* optimized USB descriptors, */
-/* resulting in version 6.3.0 */
-/* */
/**************************************************************************/
#ifndef UX_DEVICE_CLASS_AUDIO10_H
#define UX_DEVICE_CLASS_AUDIO10_H
-/* Determine if a C++ compiler is being used. If so, ensure that standard
- C is used to process the API information. */
+/* Determine if a C++ compiler is being used. If so, ensure that standard
+ C is used to process the API information. */
-#ifdef __cplusplus
+#ifdef __cplusplus
-/* Yes, C++ compiler is present. Use standard C. */
-extern "C" {
+/* Yes, C++ compiler is present. Use standard C. */
+extern "C" {
-#endif
+#endif
/* Internal option: enable the basic USBX error checking. This define is typically used
@@ -432,10 +408,10 @@ UINT _uxe_device_class_audio10_control_process(UX_DEVICE_CLASS_AUDIO *audio,
#endif
-/* Determine if a C++ compiler is being used. If so, complete the standard
- C conditional started above. */
+/* Determine if a C++ compiler is being used. If so, complete the standard
+ C conditional started above. */
#ifdef __cplusplus
-}
-#endif
+}
+#endif
#endif /* ifndef UX_DEVICE_CLASS_AUDIO10_H */
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 76bde571..7b85d573 100644
--- a/common/usbx_device_classes/inc/ux_device_class_audio20.h
+++ b/common/usbx_device_classes/inc/ux_device_class_audio20.h
@@ -1,10 +1,11 @@
/***************************************************************************
- * Copyright (c) 2024 Microsoft Corporation
- *
+ * Copyright (c) 2024 Microsoft Corporation
+ * Copyright (c) 2026-present Eclipse ThreadX contributors
+ *
* This program and the accompanying materials are made available under the
* terms of the MIT License which is available at
* https://opensource.org/licenses/MIT.
- *
+ *
* SPDX-License-Identifier: MIT
**************************************************************************/
@@ -35,46 +36,20 @@
/* This file contains all the header and extern functions used by the */
/* USBX audio class version 2.0. */
/* */
-/* RELEASE HISTORY */
-/* */
-/* DATE NAME DESCRIPTION */
-/* */
-/* 05-19-2020 Chaoqiong Xiao Initial Version 6.0 */
-/* 09-30-2020 Chaoqiong Xiao Modified comment(s), */
-/* resulting in version 6.1 */
-/* 04-02-2021 Chaoqiong Xiao Modified comment(s), */
-/* added volume RES support, */
-/* resulting in version 6.1.6 */
-/* 08-02-2021 Chaoqiong Xiao Modified comment(s), */
-/* added extern "C" keyword */
-/* for compatibility with C++, */
-/* resulting in version 6.1.8 */
-/* 07-29-2022 Chaoqiong Xiao Modified comment(s), */
-/* added support of multiple */
-/* sampling frequencies, */
-/* added clock multiplier DEFs,*/
-/* resulting in version 6.1.12 */
-/* 03-08-2023 Chaoqiong Xiao Modified comment(s), */
-/* added error checks support, */
-/* resulting in version 6.2.1 */
-/* 10-31-2023 Chaoqiong Xiao Modified comment(s), */
-/* optimized USB descriptors, */
-/* resulting in version 6.3.0 */
-/* */
/**************************************************************************/
#ifndef UX_DEVICE_CLASS_AUDIO20_H
#define UX_DEVICE_CLASS_AUDIO20_H
-/* Determine if a C++ compiler is being used. If so, ensure that standard
- C is used to process the API information. */
+/* Determine if a C++ compiler is being used. If so, ensure that standard
+ C is used to process the API information. */
-#ifdef __cplusplus
+#ifdef __cplusplus
-/* Yes, C++ compiler is present. Use standard C. */
-extern "C" {
+/* Yes, C++ compiler is present. Use standard C. */
+extern "C" {
-#endif
+#endif
/* Internal option: enable the basic USBX error checking. This define is typically used
@@ -494,10 +469,10 @@ UINT _uxe_device_class_audio20_control_process(UX_DEVICE_CLASS_AUDIO *audio,
#endif
-/* Determine if a C++ compiler is being used. If so, complete the standard
- C conditional started above. */
+/* Determine if a C++ compiler is being used. If so, complete the standard
+ C conditional started above. */
#ifdef __cplusplus
-}
-#endif
+}
+#endif
#endif /* ifndef UX_DEVICE_CLASS_AUDIO20_H */
diff --git a/common/usbx_device_classes/inc/ux_device_class_ccid.h b/common/usbx_device_classes/inc/ux_device_class_ccid.h
index 7797d0d5..a5b54a8a 100644
--- a/common/usbx_device_classes/inc/ux_device_class_ccid.h
+++ b/common/usbx_device_classes/inc/ux_device_class_ccid.h
@@ -1,10 +1,11 @@
/***************************************************************************
- * Copyright (c) 2024 Microsoft Corporation
- *
+ * Copyright (c) 2024 Microsoft Corporation
+ * Copyright (c) 2026-present Eclipse ThreadX contributors
+ *
* This program and the accompanying materials are made available under the
* terms of the MIT License which is available at
* https://opensource.org/licenses/MIT.
- *
+ *
* SPDX-License-Identifier: MIT
**************************************************************************/
@@ -33,18 +34,6 @@
/* This file defines the equivalences for the USBX Device Class CCID */
/* (Smart-Card Integrated Circuit(s) Card) component. */
/* */
-/* RELEASE HISTORY */
-/* */
-/* DATE NAME DESCRIPTION */
-/* */
-/* 04-25-2022 Chaoqiong Xiao Initial Version 6.1.11 */
-/* 03-08-2023 Chaoqiong Xiao Modified comment(s), */
-/* added standalone support, */
-/* resulting in version 6.2.1 */
-/* 10-31-2023 Yajun xia, CQ Xiao Modified comment(s), */
-/* added error checks support, */
-/* resulting in version 6.3.0 */
-/* */
/**************************************************************************/
#ifndef UX_DEVICE_CLASS_CCID_H
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 e973676c..6eebb200 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
@@ -1,83 +1,53 @@
/***************************************************************************
- * Copyright (c) 2024 Microsoft Corporation
- *
+ * Copyright (c) 2024 Microsoft Corporation
+ * Copyright (c) 2026-present Eclipse ThreadX contributors
+ *
* This program and the accompanying materials are made available under the
* terms of the MIT License which is available at
* https://opensource.org/licenses/MIT.
- *
+ *
* SPDX-License-Identifier: MIT
**************************************************************************/
/**************************************************************************/
/**************************************************************************/
-/** */
-/** USBX Component */
+/** */
+/** USBX Component */
/** */
/** CDC Class */
/** */
/**************************************************************************/
/**************************************************************************/
-/**************************************************************************/
-/* */
-/* COMPONENT DEFINITION RELEASE */
-/* */
-/* ux_device_class_cdc_acm.h PORTABLE C */
+/**************************************************************************/
+/* */
+/* COMPONENT DEFINITION RELEASE */
+/* */
+/* ux_device_class_cdc_acm.h PORTABLE C */
/* 6.3.0 */
/* AUTHOR */
/* */
/* Chaoqiong Xiao, Microsoft Corporation */
/* */
/* DESCRIPTION */
-/* */
-/* This file defines the equivalences for the USBX Device Class CDC */
-/* ACM component. */
-/* */
-/* RELEASE HISTORY */
-/* */
-/* 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 */
-/* 04-02-2021 Chaoqiong Xiao Modified comment(s), */
-/* added macro to disable */
-/* transmission support, */
-/* resulting in version 6.1.6 */
-/* 08-02-2021 Chaoqiong Xiao Modified comment(s), */
-/* added extern "C" keyword */
-/* for compatibility with C++, */
-/* resulting in version 6.1.8 */
-/* 01-31-2022 Chaoqiong Xiao Modified comment(s), */
-/* added standalone support, */
-/* resulting in version 6.1.10 */
-/* 07-29-2022 Chaoqiong Xiao Modified comment(s), */
-/* added write auto ZLP, */
-/* resulting in version 6.1.12 */
-/* 10-31-2023 Yajun xia, CQ Xiao Modified comment(s), */
-/* added zero copy support, */
-/* added a new mode to manage */
-/* endpoint buffer in classes, */
-/* added error checks support, */
-/* resulting in version 6.3.0 */
+/* */
+/* This file defines the equivalences for the USBX Device Class CDC */
+/* ACM component. */
/* */
/**************************************************************************/
#ifndef UX_DEVICE_CLASS_CDC_ACM_H
#define UX_DEVICE_CLASS_CDC_ACM_H
-/* Determine if a C++ compiler is being used. If so, ensure that standard
- C is used to process the API information. */
+/* Determine if a C++ compiler is being used. If so, ensure that standard
+ C is used to process the API information. */
-#ifdef __cplusplus
+#ifdef __cplusplus
-/* Yes, C++ compiler is present. Use standard C. */
-extern "C" {
+/* Yes, C++ compiler is present. Use standard C. */
+extern "C" {
-#endif
+#endif
/* Internal option: enable the basic USBX error checking. This define is typically used
while debugging application. */
@@ -289,23 +259,23 @@ typedef struct UX_SLAVE_CLASS_CDC_ACM_STRUCT
/* Define some CDC Class structures */
-typedef struct UX_SLAVE_CLASS_CDC_ACM_LINE_CODING_PARAMETER_STRUCT
+typedef struct UX_SLAVE_CLASS_CDC_ACM_LINE_CODING_PARAMETER_STRUCT
{
ULONG ux_slave_class_cdc_acm_parameter_baudrate;
UCHAR ux_slave_class_cdc_acm_parameter_stop_bit;
UCHAR ux_slave_class_cdc_acm_parameter_parity;
UCHAR ux_slave_class_cdc_acm_parameter_data_bit;
-
+
} UX_SLAVE_CLASS_CDC_ACM_LINE_CODING_PARAMETER;
-typedef struct UX_SLAVE_CLASS_CDC_ACM_LINE_STATE_PARAMETER_STRUCT
+typedef struct UX_SLAVE_CLASS_CDC_ACM_LINE_STATE_PARAMETER_STRUCT
{
UCHAR ux_slave_class_cdc_acm_parameter_rts;
UCHAR ux_slave_class_cdc_acm_parameter_dtr;
-
+
} UX_SLAVE_CLASS_CDC_ACM_LINE_STATE_PARAMETER;
-typedef struct UX_SLAVE_CLASS_CDC_ACM_CALLBACK_PARAMETER_STRUCT
+typedef struct UX_SLAVE_CLASS_CDC_ACM_CALLBACK_PARAMETER_STRUCT
{
UINT (*ux_device_class_cdc_acm_parameter_write_callback)(struct UX_SLAVE_CLASS_CDC_ACM_STRUCT *cdc_acm, UINT status, ULONG length);
UINT (*ux_device_class_cdc_acm_parameter_read_callback)(struct UX_SLAVE_CLASS_CDC_ACM_STRUCT *cdc_acm, UINT status, UCHAR *data_pointer, ULONG length);
@@ -316,22 +286,22 @@ typedef struct UX_SLAVE_CLASS_CDC_ACM_CALLBACK_PARAMETER_STRUCT
/* Requests - Ethernet Networking Control Model */
-#define UX_SLAVE_CLASS_CDC_ACM_SEND_ENCAPSULATED_COMMAND 0x00
+#define UX_SLAVE_CLASS_CDC_ACM_SEND_ENCAPSULATED_COMMAND 0x00
/* Issues a command in the format of the supported control
protocol. The intent of this mechanism is to support
networking devices (e.g., host-based cable modems)
that require an additional vendor-defined interface for
media specific hardware configuration and
management. */
-#define UX_SLAVE_CLASS_CDC_ACM_GET_ENCAPSULATED_RESPONSE 0x01
+#define UX_SLAVE_CLASS_CDC_ACM_GET_ENCAPSULATED_RESPONSE 0x01
/* Requests a response in the format of the supported
control protocol. */
-#define UX_SLAVE_CLASS_CDC_ACM_SET_ETHERNET_MULTICAST_FILTERS 0x40
+#define UX_SLAVE_CLASS_CDC_ACM_SET_ETHERNET_MULTICAST_FILTERS 0x40
/* As applications are loaded and unloaded on the host,
the networking transport will instruct the device's MAC
driver to change settings of the Networking device's
multicast filters. */
-#define UX_SLAVE_CLASS_CDC_ACM_SET_ETHERNET_POWER_MANAGEMENT_PATTERN_FILTER 0x41
+#define UX_SLAVE_CLASS_CDC_ACM_SET_ETHERNET_POWER_MANAGEMENT_PATTERN_FILTER 0x41
/* Some hosts are able to conserve energy and stay quiet
in a 'sleeping' state while not being used. USB
Networking devices may provide special pattern filtering
@@ -340,13 +310,13 @@ typedef struct UX_SLAVE_CLASS_CDC_ACM_CALLBACK_PARAMETER_STRUCT
host (e.g., an incoming web browser connection).
Primitives are needed in management plane to negotiate
the setting of these special filters */
-#define UX_SLAVE_CLASS_CDC_ACM_GET_ETHERNET_POWER_MANAGEMENT_PATTERN_FILTER 0x42
+#define UX_SLAVE_CLASS_CDC_ACM_GET_ETHERNET_POWER_MANAGEMENT_PATTERN_FILTER 0x42
/* Retrieves the status of the above power management
pattern filter setting */
-#define UX_SLAVE_CLASS_CDC_ACM_SET_ETHERNET_PACKET_FILTER 0x43
+#define UX_SLAVE_CLASS_CDC_ACM_SET_ETHERNET_PACKET_FILTER 0x43
/* Sets device filter for running a network analyzer
application on the host machine */
-#define UX_SLAVE_CLASS_CDC_ACM_GET_ETHERNET_STATISTIC 0x44
+#define UX_SLAVE_CLASS_CDC_ACM_GET_ETHERNET_STATISTIC 0x44
/* Retrieves Ethernet device statistics such as frames
transmitted, frames received, and bad frames received. */
@@ -363,20 +333,20 @@ UINT _ux_device_class_cdc_acm_deactivate(UX_SLAVE_CLASS_COMMAND *command);
UINT _ux_device_class_cdc_acm_entry(UX_SLAVE_CLASS_COMMAND *command);
UINT _ux_device_class_cdc_acm_initialize(UX_SLAVE_CLASS_COMMAND *command);
UINT _ux_device_class_cdc_acm_uninitialize(UX_SLAVE_CLASS_COMMAND *command);
-UINT _ux_device_class_cdc_acm_write(UX_SLAVE_CLASS_CDC_ACM *cdc_acm, UCHAR *buffer,
+UINT _ux_device_class_cdc_acm_write(UX_SLAVE_CLASS_CDC_ACM *cdc_acm, UCHAR *buffer,
ULONG requested_length, ULONG *actual_length);
-UINT _ux_device_class_cdc_acm_read(UX_SLAVE_CLASS_CDC_ACM *cdc_acm, UCHAR *buffer,
+UINT _ux_device_class_cdc_acm_read(UX_SLAVE_CLASS_CDC_ACM *cdc_acm, UCHAR *buffer,
ULONG requested_length, ULONG *actual_length);
UINT _ux_device_class_cdc_acm_ioctl(UX_SLAVE_CLASS_CDC_ACM *cdc_acm, ULONG ioctl_function,
VOID *parameter);
VOID _ux_device_class_cdc_acm_bulkin_thread(ULONG class_pointer);
VOID _ux_device_class_cdc_acm_bulkout_thread(ULONG class_pointer);
-UINT _ux_device_class_cdc_acm_write_with_callback(UX_SLAVE_CLASS_CDC_ACM *cdc_acm, UCHAR *buffer,
+UINT _ux_device_class_cdc_acm_write_with_callback(UX_SLAVE_CLASS_CDC_ACM *cdc_acm, UCHAR *buffer,
ULONG requested_length);
-UINT _ux_device_class_cdc_acm_write_run(UX_SLAVE_CLASS_CDC_ACM *cdc_acm, UCHAR *buffer,
+UINT _ux_device_class_cdc_acm_write_run(UX_SLAVE_CLASS_CDC_ACM *cdc_acm, UCHAR *buffer,
ULONG requested_length, ULONG *actual_length);
-UINT _ux_device_class_cdc_acm_read_run(UX_SLAVE_CLASS_CDC_ACM *cdc_acm, UCHAR *buffer,
+UINT _ux_device_class_cdc_acm_read_run(UX_SLAVE_CLASS_CDC_ACM *cdc_acm, UCHAR *buffer,
ULONG requested_length, ULONG *actual_length);
UINT _ux_device_class_cdc_acm_tasks_run(VOID *instance);
@@ -419,10 +389,10 @@ UINT _uxe_device_class_cdc_acm_read_run(UX_SLAVE_CLASS_CDC_ACM *cdc_acm, UCHAR
#endif
-/* Determine if a C++ compiler is being used. If so, complete the standard
- C conditional started above. */
+/* Determine if a C++ compiler is being used. If so, complete the standard
+ C conditional started above. */
#ifdef __cplusplus
-}
-#endif
+}
+#endif
#endif /* UX_DEVICE_CLASS_CDC_ACM_H */
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 1331cc35..7a8f03cc 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
@@ -1,5 +1,6 @@
/***************************************************************************
* Copyright (c) 2024 Microsoft Corporation
+ * Copyright (c) 2026-present Eclipse ThreadX contributors
*
* This program and the accompanying materials are made available under the
* terms of the MIT License which is available at
@@ -33,33 +34,6 @@
/* This file defines the equivalences for the USBX Device Class */
/* CDC_ECM component. */
/* */
-/* RELEASE HISTORY */
-/* */
-/* 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 */
-/* 08-02-2021 Wen Wang Modified comment(s), */
-/* fixed spelling error, */
-/* added extern "C" keyword */
-/* for compatibility with C++, */
-/* resulting in version 6.1.8 */
-/* 04-25-2022 Chaoqiong Xiao Modified comment(s), */
-/* fixed standalone compile, */
-/* resulting in version 6.1.11 */
-/* 10-31-2022 Chaoqiong Xiao Modified comment(s), */
-/* added wait definitions, */
-/* resulting in version 6.2.0 */
-/* 10-31-2023 Chaoqiong Xiao Modified comment(s), */
-/* added zero copy support, */
-/* added a new mode to manage */
-/* endpoint buffer in classes, */
-/* resulting in version 6.3.0 */
-/* */
/**************************************************************************/
#ifndef UX_DEVICE_CLASS_CDC_ECM_H
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 33f2c26a..e1cec3a3 100644
--- a/common/usbx_device_classes/inc/ux_device_class_dfu.h
+++ b/common/usbx_device_classes/inc/ux_device_class_dfu.h
@@ -1,5 +1,6 @@
/***************************************************************************
* Copyright (c) 2024 Microsoft Corporation
+ * Copyright (c) 2026-present Eclipse ThreadX contributors
*
* This program and the accompanying materials are made available under the
* terms of the MIT License which is available at
@@ -33,40 +34,6 @@
/* This file defines the equivalences for the USBX Device Class DFU */
/* ACM component. */
/* */
-/* RELEASE HISTORY */
-/* */
-/* 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 */
-/* 04-02-2021 Chaoqiong Xiao Modified comment(s), */
-/* added DFU_UPLOAD support, */
-/* refined dfu_read prototype, */
-/* removed block count (it's */
-/* from host request wValue), */
-/* resulting in version 6.1.6 */
-/* 08-02-2021 Chaoqiong Xiao Modified comment(s), */
-/* added extern "C" keyword */
-/* for compatibility with C++, */
-/* resulting in version 6.1.8 */
-/* 01-31-2022 Chaoqiong Xiao Modified comment(s), */
-/* added standalone support, */
-/* resulting in version 6.1.10 */
-/* 07-29-2022 Chaoqiong Xiao Modified comment(s), */
-/* added macros for req types, */
-/* resulting in version 6.1.12 */
-/* 10-31-2023 Yajun xia Modified comment(s), */
-/* added error checks support, */
-/* resulting in version 6.3.0 */
-/* xx-xx-xxxx Mohamed ayed Modified comment(s), */
-/* added dfu deinit function, */
-/* remove extra spaces, */
-/* resulting in version 6.x */
-/* */
/**************************************************************************/
#ifndef UX_DEVICE_CLASS_DFU_H
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 dfa588a1..f5a48f4a 100644
--- a/common/usbx_device_classes/inc/ux_device_class_hid.h
+++ b/common/usbx_device_classes/inc/ux_device_class_hid.h
@@ -1,5 +1,6 @@
/***************************************************************************
* Copyright (c) 2024 Microsoft Corporation
+ * Copyright (c) 2026-present Eclipse ThreadX contributors
*
* This program and the accompanying materials are made available under the
* terms of the MIT License which is available at
@@ -35,41 +36,6 @@
/* This file contains all the header and extern functions used by the */
/* USBX HID class. */
/* */
-/* RELEASE HISTORY */
-/* */
-/* 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 */
-/* 12-31-2020 Chaoqiong Xiao Modified comment(s), */
-/* added Get/Set Protocol */
-/* request support, */
-/* resulting in version 6.1.3 */
-/* 08-02-2021 Chaoqiong Xiao Modified comment(s), */
-/* added extern "C" keyword */
-/* for compatibility with C++, */
-/* resulting in version 6.1.8 */
-/* 01-31-2022 Chaoqiong Xiao Modified comment(s), */
-/* added standalone support, */
-/* added interrupt OUT support,*/
-/* resulting in version 6.1.10 */
-/* 04-25-2022 Chaoqiong Xiao Modified comment(s), */
-/* added receiver callback, */
-/* resulting in version 6.1.11 */
-/* 07-29-2022 Chaoqiong Xiao Modified comment(s), */
-/* added standalone int out, */
-/* resulting in version 6.1.12 */
-/* 10-31-2023 Chaoqiong Xiao Modified comment(s), */
-/* added zero copy support, */
-/* added a new mode to manage */
-/* endpoint buffer in classes, */
-/* moved build option check, */
-/* resulting in version 6.3.0 */
-/* */
/**************************************************************************/
#ifndef UX_DEVICE_CLASS_HID_H
@@ -249,6 +215,7 @@ typedef struct UX_SLAVE_CLASS_HID_STRUCT
UINT ux_device_class_hid_state;
UINT (*ux_device_class_hid_callback)(struct UX_SLAVE_CLASS_HID_STRUCT *hid, UX_SLAVE_CLASS_HID_EVENT *);
UINT (*ux_device_class_hid_get_callback)(struct UX_SLAVE_CLASS_HID_STRUCT *hid, UX_SLAVE_CLASS_HID_EVENT *);
+ VOID (*ux_device_class_hid_set_protocol_callback)(struct UX_SLAVE_CLASS_HID_STRUCT *hid, ULONG protocol);
VOID (*ux_slave_class_hid_instance_activate)(VOID *);
VOID (*ux_slave_class_hid_instance_deactivate)(VOID *);
UCHAR *ux_device_class_hid_report_address;
@@ -365,6 +332,10 @@ typedef struct UX_SLAVE_CLASS_HID_PARAMETER_STRUCT
ULONG ux_device_class_hid_parameter_report_length;
UINT (*ux_device_class_hid_parameter_callback)(struct UX_SLAVE_CLASS_HID_STRUCT *hid, UX_SLAVE_CLASS_HID_EVENT *);
UINT (*ux_device_class_hid_parameter_get_callback)(struct UX_SLAVE_CLASS_HID_STRUCT *hid, UX_SLAVE_CLASS_HID_EVENT *);
+
+ /* Optional callback invoked when protocol changes (boot/report). */
+ VOID (*ux_device_class_hid_parameter_set_protocol_callback)(struct UX_SLAVE_CLASS_HID_STRUCT *hid, ULONG protocol);
+
#if defined(UX_DEVICE_CLASS_HID_FLEXIBLE_EVENTS_QUEUE)
ULONG ux_device_class_hid_parameter_event_max_number;
ULONG ux_device_class_hid_parameter_event_max_length;
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 695a58ab..da7aaad2 100644
--- a/common/usbx_device_classes/inc/ux_device_class_pima.h
+++ b/common/usbx_device_classes/inc/ux_device_class_pima.h
@@ -1,5 +1,6 @@
/***************************************************************************
* Copyright (c) 2024 Microsoft Corporation
+ * Copyright (c) 2026-present Eclipse ThreadX contributors
*
* This program and the accompanying materials are made available under the
* terms of the MIT License which is available at
@@ -35,39 +36,6 @@
/* This file contains all the header and extern functions used by the */
/* USBX PIMA class. */
/* */
-/* RELEASE HISTORY */
-/* */
-/* 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 */
-/* 08-02-2021 Wen Wang Modified comment(s), */
-/* added extern "C" keyword */
-/* for compatibility with C++, */
-/* resulting in version 6.1.8 */
-/* 01-31-2022 Chaoqiong Xiao Modified comment(s), */
-/* updated definitions, */
-/* improved internal function, */
-/* added cancel callback, */
-/* resulting in version 6.1.10 */
-/* 04-25-2022 Chaoqiong Xiao Modified comment(s), */
-/* fixed standalone compile, */
-/* resulting in version 6.1.11 */
-/* 10-31-2023 Chaoqiong Xiao Modified comment(s), */
-/* optimized PIMA data sets, */
-/* added a new mode to manage */
-/* endpoint buffer in classes, */
-/* added error checks support, */
-/* resulting in version 6.3.0 */
-/* xx-xx-xxxx Mohamed ayed Modified comment(s), */
-/* added pima deinit function, */
-/* remove extra spaces, */
-/* resulting in version 6.x */
-/* */
/**************************************************************************/
#ifndef UX_DEVICE_CLASS_PIMA_H
diff --git a/common/usbx_device_classes/inc/ux_device_class_printer.h b/common/usbx_device_classes/inc/ux_device_class_printer.h
index 8f9fc024..2d257dc6 100644
--- a/common/usbx_device_classes/inc/ux_device_class_printer.h
+++ b/common/usbx_device_classes/inc/ux_device_class_printer.h
@@ -1,10 +1,11 @@
/***************************************************************************
- * Copyright (c) 2024 Microsoft Corporation
- *
+ * Copyright (c) 2024 Microsoft Corporation
+ * Copyright (c) 2026-present Eclipse ThreadX contributors
+ *
* This program and the accompanying materials are made available under the
* terms of the MIT License which is available at
* https://opensource.org/licenses/MIT.
- *
+ *
* SPDX-License-Identifier: MIT
**************************************************************************/
@@ -33,28 +34,6 @@
/* This file defines the equivalences for the USBX Device Class */
/* Printer component. */
/* */
-/* RELEASE HISTORY */
-/* */
-/* DATE NAME DESCRIPTION */
-/* */
-/* 01-31-2022 Chaoqiong Xiao Initial Version 6.1.10 */
-/* 04-25-2022 Chaoqiong Xiao Modified comment(s), */
-/* fixed standalone compile, */
-/* resulting in version 6.1.11 */
-/* 07-29-2022 Chaoqiong Xiao Modified comment(s), */
-/* resulting in version 6.1.12 */
-/* 10-31-2022 Yajun xia Modified comment(s), */
-/* added standalone support, */
-/* resulting in version 6.2.0 */
-/* 03-08-2023 Yajun xia Modified comment(s), */
-/* added error checks support, */
-/* resulting in version 6.2.1 */
-/* 10-31-2023 Yajun Xia, CQ Xiao Modified comment(s), */
-/* added a new mode to manage */
-/* endpoint buffer in classes, */
-/* fixed error checking issue, */
-/* resulting in version 6.3.0 */
-/* */
/**************************************************************************/
#ifndef UX_DEVICE_CLASS_PRINTER_H
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 6eda3fad..9f67e3cc 100644
--- a/common/usbx_device_classes/inc/ux_device_class_rndis.h
+++ b/common/usbx_device_classes/inc/ux_device_class_rndis.h
@@ -1,5 +1,6 @@
/***************************************************************************
* Copyright (c) 2024 Microsoft Corporation
+ * Copyright (c) 2026-present Eclipse ThreadX contributors
*
* This program and the accompanying materials are made available under the
* terms of the MIT License which is available at
@@ -33,38 +34,6 @@
/* This file defines the equivalences for the USBX Device Class RNDIS */
/* component. */
/* */
-/* RELEASE HISTORY */
-/* */
-/* 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 */
-/* 08-02-2021 Wen Wang Modified comment(s), */
-/* fixed spelling error, */
-/* added extern "C" keyword */
-/* for compatibility with C++, */
-/* resulting in version 6.1.8 */
-/* 04-25-2022 Chaoqiong Xiao Modified comment(s), */
-/* fixed standalone compile, */
-/* resulting in version 6.1.11 */
-/* 10-31-2022 Chaoqiong Xiao Modified comment(s), */
-/* added wait and length DEFs, */
-/* resulting in version 6.2.0 */
-/* 10-31-2023 Chaoqiong Xiao Modified comment(s), */
-/* added zero copy support, */
-/* added a new mode to manage */
-/* endpoint buffer in classes, */
-/* improved error checking, */
-/* resulting in version 6.3.0 */
-/* xx-xx-xxxx Mohamed ayed Modified comment(s), */
-/* added rndis deinit function,*/
-/* remove extra spaces, */
-/* resulting in version 6.x */
-/* */
/**************************************************************************/
#ifndef UX_DEVICE_CLASS_RNDIS_H
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 8151695e..07b78dd3 100644
--- a/common/usbx_device_classes/inc/ux_device_class_storage.h
+++ b/common/usbx_device_classes/inc/ux_device_class_storage.h
@@ -1,10 +1,11 @@
/***************************************************************************
- * Copyright (c) 2024 Microsoft Corporation
- *
+ * Copyright (c) 2024 Microsoft Corporation
+ * Copyright (c) 2026-present Eclipse ThreadX contributors
+ *
* This program and the accompanying materials are made available under the
* terms of the MIT License which is available at
* https://opensource.org/licenses/MIT.
- *
+ *
* SPDX-License-Identifier: MIT
**************************************************************************/
@@ -35,47 +36,20 @@
/* This file contains all the header and extern functions used by the */
/* USBX device storage class. */
/* */
-/* RELEASE HISTORY */
-/* */
-/* 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 */
-/* 12-31-2020 Chaoqiong Xiao Modified comment(s), */
-/* fixed USB CV test issues, */
-/* resulting in version 6.1.3 */
-/* 08-02-2021 Chaoqiong Xiao Modified comment(s), */
-/* added extern "C" keyword */
-/* for compatibility with C++, */
-/* resulting in version 6.1.8 */
-/* 10-15-2021 Chaoqiong Xiao Modified comment(s), */
-/* improved TAG management, */
-/* resulting in version 6.1.9 */
-/* 01-31-2022 Chaoqiong Xiao Modified comment(s), */
-/* added standalone support, */
-/* resulting in version 6.1.10 */
-/* 10-31-2023 Chaoqiong Xiao Modified comment(s), */
-/* added a new mode to manage */
-/* endpoint buffer in classes, */
-/* added error checks support, */
-/* resulting in version 6.3.0 */
-/* */
/**************************************************************************/
#ifndef UX_DEVICE_CLASS_STORAGE_H
#define UX_DEVICE_CLASS_STORAGE_H
-/* Determine if a C++ compiler is being used. If so, ensure that standard
- C is used to process the API information. */
+/* Determine if a C++ compiler is being used. If so, ensure that standard
+ C is used to process the API information. */
-#ifdef __cplusplus
+#ifdef __cplusplus
-/* Yes, C++ compiler is present. Use standard C. */
-extern "C" {
+/* Yes, C++ compiler is present. Use standard C. */
+extern "C" {
-#endif
+#endif
/* Internal option: enable the basic USBX error checking. This define is typically used
@@ -112,7 +86,10 @@ extern "C" {
#define UX_SLAVE_CLASS_STORAGE_MEDIA_OPTICAL_DISK 7
#define UX_SLAVE_CLASS_STORAGE_MEDIA_IOMEGA_CLICK 0x55
+/* Define Storage Class USB medium removable type. */
+#define UX_SLAVE_CLASS_STORAGE_MEDIA_IS_NOT_REMOVABLE 0x00
+#define UX_SLAVE_CLASS_STORAGE_MEDIA_IS_REMOVABLE (1u<<8)
/* Define Storage Class SCSI command constants. */
@@ -321,6 +298,10 @@ extern "C" {
#define UX_SLAVE_CLASS_STORAGE_SENSE_KEY_VOLUME_OVERFLOW 0x0d
#define UX_SLAVE_CLASS_STORAGE_SENSE_KEY_MISCOMPARE 0x0e
+#define UX_SLAVE_CLASS_STORAGE_SENSE_CODE_NOT_READY 0x04
+#define UX_SLAVE_CLASS_STORAGE_SENSE_CODE_WRITE_PROTECTED 0x27
+#define UX_SLAVE_CLASS_STORAGE_SENSE_CODE_NOT_READY_TO_READY 0x28
+#define UX_SLAVE_CLASS_STORAGE_SENSE_CODE_NOT_PRESENT 0x3A
/* Define Storage Class SCSI sense key definition constants. */
@@ -361,6 +342,23 @@ extern "C" {
#define UX_SLAVE_CLASS_STORAGE_READ_DISK_INFORMATION_ALLOCATION_LENGTH 7
#define UX_SLAVE_CLASS_STORAGE_READ_DISK_INFORMATION_LENGTH 10
+/* Define Storage Class (SBC-4) POWER CONDITION constants. */
+
+#define UX_SLAVE_CLASS_STORAGE_POWER_CONDITION_START_VALID 0x00
+#define UX_SLAVE_CLASS_STORAGE_POWER_CONDITION_ACTIVE 0x01
+#define UX_SLAVE_CLASS_STORAGE_POWER_CONDITION_IDLE 0x02
+#define UX_SLAVE_CLASS_STORAGE_POWER_CONDITION_STANDBY 0x03
+#define UX_SLAVE_CLASS_STORAGE_POWER_CONDITION_LU_CONTROL 0x07
+#define UX_SLAVE_CLASS_STORAGE_POWER_CONDITION_FORCE_IDLE_0 0x0A
+#define UX_SLAVE_CLASS_STORAGE_POWER_CONDITION_FORCE_STANDBY_0 0x0B
+
+/* Define Storage Class (SBC-4) PREVENT constants. */
+
+#define UX_SLAVE_CLASS_STORAGE_MEDIUM_REMOVAL_IS_ALLOWED 0x00
+#define UX_SLAVE_CLASS_STORAGE_MEDIUM_REMOVAL_SHALL_BE_PREVENTED 0x01
+#define UX_SLAVE_CLASS_STORAGE_MEDIUM_PREVENT_OBSOLETE_2 0x02
+#define UX_SLAVE_CLASS_STORAGE_MEDIUM_PREVENT_OBSOLETE_3 0x03
+
/* Define Storage Class Feature Descriptor generic format. */
#define USBX_DEVICE_CLASS_STORAGE_FEATURE_DESCRIPTOR_FEATURE_CODE 0
@@ -504,12 +502,17 @@ typedef struct UX_SLAVE_CLASS_STORAGE_LUN_STRUCT
ULONG ux_slave_class_storage_request_sense_status;
ULONG ux_slave_class_storage_disk_status;
ULONG ux_slave_class_storage_last_session_state;
+ ULONG ux_slave_class_storage_prevent_medium_removal;
+ ULONG ux_slave_class_storage_medium_loaded_status;
UINT (*ux_slave_class_storage_media_read)(VOID *storage, ULONG lun, UCHAR *data_pointer, ULONG number_blocks, ULONG lba, ULONG *media_status);
UINT (*ux_slave_class_storage_media_write)(VOID *storage, ULONG lun, UCHAR *data_pointer, ULONG number_blocks, ULONG lba, ULONG *media_status);
UINT (*ux_slave_class_storage_media_flush)(VOID *storage, ULONG lun, ULONG number_blocks, ULONG lba, ULONG *media_status);
UINT (*ux_slave_class_storage_media_status)(VOID *storage, ULONG lun, ULONG media_id, ULONG *media_status);
UINT (*ux_slave_class_storage_media_notification)(VOID *storage, ULONG lun, ULONG media_id, ULONG notification_class, UCHAR **media_notification, ULONG *media_notification_length);
+
+ /* Optional callback invoked when load/eject media is requested. */
+ UINT (*ux_slave_class_storage_media_start_stop)(VOID *storage, ULONG lun, ULONG power_condition, ULONG start, ULONG load_eject);
} UX_SLAVE_CLASS_STORAGE_LUN;
/* Sense status value (key at bit0-7, code at bit8-15 and qualifier at bit16-23). */
@@ -674,10 +677,10 @@ UINT _uxe_device_class_storage_initialize(UX_SLAVE_CLASS_COMMAND *command);
#define ux_device_class_storage_entry _ux_device_class_storage_entry
-/* Determine if a C++ compiler is being used. If so, complete the standard
- C conditional started above. */
+/* Determine if a C++ compiler is being used. If so, complete the standard
+ C conditional started above. */
#ifdef __cplusplus
-}
-#endif
+}
+#endif
#endif
diff --git a/common/usbx_device_classes/inc/ux_device_class_video.h b/common/usbx_device_classes/inc/ux_device_class_video.h
index c716f7dd..6247008a 100644
--- a/common/usbx_device_classes/inc/ux_device_class_video.h
+++ b/common/usbx_device_classes/inc/ux_device_class_video.h
@@ -1,10 +1,11 @@
/***************************************************************************
- * Copyright (c) 2024 Microsoft Corporation
- *
+ * Copyright (c) 2024 Microsoft Corporation
+ * Copyright (c) 2026-present Eclipse ThreadX contributors
+ *
* This program and the accompanying materials are made available under the
* terms of the MIT License which is available at
* https://opensource.org/licenses/MIT.
- *
+ *
* SPDX-License-Identifier: MIT
**************************************************************************/
@@ -35,21 +36,6 @@
/* This file contains all the header and extern functions used by the */
/* USBX device video class. */
/* */
-/* RELEASE HISTORY */
-/* */
-/* DATE NAME DESCRIPTION */
-/* */
-/* 04-25-2022 Chaoqiong Xiao Initial Version 6.1.11 */
-/* 10-31-2022 Chaoqiong Xiao Modified comment(s), */
-/* added standalone support, */
-/* resulting in version 6.2.0 */
-/* 10-31-2023 Yajun xia, CQ Xiao Modified comment(s), */
-/* added a new mode to manage */
-/* endpoint buffer in classes */
-/* with zero copy enabled, */
-/* added error checks support, */
-/* resulting in version 6.3.0 */
-/* */
/**************************************************************************/
#ifndef UX_DEVICE_CLASS_VIDEO_H
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 cd9f1210..650fc723 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
@@ -1,10 +1,11 @@
/***************************************************************************
- * Copyright (c) 2024 Microsoft Corporation
- *
+ * Copyright (c) 2024 Microsoft Corporation
+ * Copyright (c) 2026-present Eclipse ThreadX contributors
+ *
* This program and the accompanying materials are made available under the
* terms of the MIT License which is available at
* https://opensource.org/licenses/MIT.
- *
+ *
* SPDX-License-Identifier: MIT
**************************************************************************/
@@ -67,26 +68,6 @@
/* */
/* Application */
/* */
-/* RELEASE HISTORY */
-/* */
-/* DATE NAME DESCRIPTION */
-/* */
-/* 05-19-2020 Chaoqiong Xiao Initial Version 6.0 */
-/* 09-30-2020 Chaoqiong Xiao Modified comment(s), */
-/* resulting in version 6.1 */
-/* 04-02-2021 Chaoqiong Xiao Modified comment(s), */
-/* added volume RES support, */
-/* resulting in version 6.1.6 */
-/* 04-25-2022 Chaoqiong Xiao Modified comment(s), */
-/* internal clean up, */
-/* resulting in version 6.1.11 */
-/* 07-29-2022 Chaoqiong Xiao Modified comment(s), */
-/* added sampling control, */
-/* resulting in version 6.1.12 */
-/* 03-08-2023 Chaoqiong Xiao Modified comment(s), */
-/* fixed a macro name, */
-/* resulting in version 6.2.1 */
-/* */
/**************************************************************************/
UINT _ux_device_class_audio10_control_process(UX_DEVICE_CLASS_AUDIO *audio,
UX_SLAVE_TRANSFER *transfer, UX_DEVICE_CLASS_AUDIO10_CONTROL_GROUP *group)
@@ -374,12 +355,6 @@ ULONG i;
/* */
/* Application */
/* */
-/* RELEASE HISTORY */
-/* */
-/* DATE NAME DESCRIPTION */
-/* */
-/* 03-08-2023 Chaoqiong Xiao Initial Version 6.2.1 */
-/* */
/**************************************************************************/
UINT _uxe_device_class_audio10_control_process(UX_DEVICE_CLASS_AUDIO *audio,
UX_SLAVE_TRANSFER *transfer, UX_DEVICE_CLASS_AUDIO10_CONTROL_GROUP *group)
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 3a7bd361..637f5555 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
@@ -1,10 +1,11 @@
/***************************************************************************
- * Copyright (c) 2024 Microsoft Corporation
- *
+ * Copyright (c) 2024 Microsoft Corporation
+ * Copyright (c) 2026-present Eclipse ThreadX contributors
+ *
* This program and the accompanying materials are made available under the
* terms of the MIT License which is available at
* https://opensource.org/licenses/MIT.
- *
+ *
* SPDX-License-Identifier: MIT
**************************************************************************/
@@ -70,27 +71,6 @@
/* */
/* Application */
/* */
-/* RELEASE HISTORY */
-/* */
-/* DATE NAME DESCRIPTION */
-/* */
-/* 05-19-2020 Chaoqiong Xiao Initial Version 6.0 */
-/* 09-30-2020 Chaoqiong Xiao Modified comment(s), */
-/* resulting in version 6.1 */
-/* 04-02-2021 Chaoqiong Xiao Modified comment(s), */
-/* added volume RES support, */
-/* resulting in version 6.1.6 */
-/* 01-31-2022 Chaoqiong Xiao Modified comment(s), */
-/* allowed answer length only */
-/* when requesting range, */
-/* resulting in version 6.1.10 */
-/* 07-29-2022 Chaoqiong Xiao Modified comment(s), */
-/* added support of multiple */
-/* sampling frequencies, */
-/* resulting in version 6.1.12 */
-/* 03-08-2023 Chaoqiong Xiao Modified comment(s), */
-/* resulting in version 6.2.1 */
-/* */
/**************************************************************************/
UINT _ux_device_class_audio20_control_process(UX_DEVICE_CLASS_AUDIO *audio,
UX_SLAVE_TRANSFER *transfer,
@@ -433,12 +413,6 @@ ULONG n_sub, pos, min, max, res, freq;
/* */
/* Application */
/* */
-/* RELEASE HISTORY */
-/* */
-/* DATE NAME DESCRIPTION */
-/* */
-/* 03-08-2023 Chaoqiong Xiao Initial Version 6.2.1 */
-/* */
/**************************************************************************/
UINT _uxe_device_class_audio20_control_process(UX_DEVICE_CLASS_AUDIO *audio,
UX_SLAVE_TRANSFER *transfer,
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 9cfe9aa6..9aaf5bfe 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
@@ -1,10 +1,11 @@
/***************************************************************************
- * Copyright (c) 2024 Microsoft Corporation
- *
+ * Copyright (c) 2024 Microsoft Corporation
+ * Copyright (c) 2026-present Eclipse ThreadX contributors
+ *
* This program and the accompanying materials are made available under the
* terms of the MIT License which is available at
* https://opensource.org/licenses/MIT.
- *
+ *
* SPDX-License-Identifier: MIT
**************************************************************************/
@@ -57,27 +58,6 @@
/* */
/* Device Audio Class */
/* */
-/* RELEASE HISTORY */
-/* */
-/* DATE NAME DESCRIPTION */
-/* */
-/* 05-19-2020 Chaoqiong Xiao Initial Version 6.0 */
-/* 09-30-2020 Chaoqiong Xiao Modified comment(s), */
-/* resulting in version 6.1 */
-/* 07-29-2022 Chaoqiong Xiao Modified comment(s), */
-/* fixed parameter/variable */
-/* names conflict C++ keyword, */
-/* added interrupt support, */
-/* resulting in version 6.1.12 */
-/* 10-31-2022 Yajun Xia Modified comment(s), */
-/* added standalone support, */
-/* resulting in version 6.2.0 */
-/* 10-31-2023 Chaoqiong Xiao Modified comment(s), */
-/* added a new mode to manage */
-/* endpoint buffer in classes */
-/* with zero copy enabled, */
-/* resulting in version 6.3.0 */
-/* */
/**************************************************************************/
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 6bb78a37..c9c4553b 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
@@ -1,10 +1,11 @@
/***************************************************************************
- * Copyright (c) 2024 Microsoft Corporation
- *
+ * Copyright (c) 2024 Microsoft Corporation
+ * Copyright (c) 2026-present Eclipse ThreadX contributors
+ *
* This program and the accompanying materials are made available under the
* terms of the MIT License which is available at
* https://opensource.org/licenses/MIT.
- *
+ *
* SPDX-License-Identifier: MIT
**************************************************************************/
@@ -51,44 +52,13 @@
/* */
/* CALLS */
/* */
+/* _ux_utility_thread_resume Resume a suspended thread */
/* _ux_system_error_handler System error trap */
/* */
/* CALLED BY */
/* */
/* Device Audio Class */
/* */
-/* RELEASE HISTORY */
-/* */
-/* DATE NAME DESCRIPTION */
-/* */
-/* 05-19-2020 Chaoqiong Xiao Initial Version 6.0 */
-/* 09-30-2020 Chaoqiong Xiao Modified comment(s), */
-/* resulting in version 6.1 */
-/* 10-15-2021 Chaoqiong Xiao Modified comment(s), */
-/* replaced wMaxPacketSize by */
-/* calculated payload size, */
-/* resulting in version 6.1.9 */
-/* 01-31-2022 Chaoqiong Xiao Modified comment(s), */
-/* added feedback support, */
-/* resulting in version 6.1.10 */
-/* 04-25-2022 Chaoqiong Xiao Modified comment(s), */
-/* fixed standalone compile, */
-/* resulting in version 6.1.11 */
-/* 07-29-2022 Chaoqiong Xiao Modified comment(s), */
-/* fixed parameter/variable */
-/* names conflict C++ keyword, */
-/* rx full packet for */
-/* feedback, */
-/* resulting in version 6.1.12 */
-/* 10-31-2022 Yajun Xia Modified comment(s), */
-/* added standalone support, */
-/* resulting in version 6.2.0 */
-/* 10-31-2023 Chaoqiong Xiao Modified comment(s), */
-/* added a new mode to manage */
-/* endpoint buffer in classes */
-/* with zero copy enabled, */
-/* resulting in version 6.3.0 */
-/* */
/**************************************************************************/
UINT _ux_device_class_audio_change(UX_SLAVE_CLASS_COMMAND *command)
{
@@ -149,7 +119,7 @@ ULONG endpoint_dir;
UX_ENDPOINT_OUT: UX_ENDPOINT_IN;
#else
- endpoint_dir = (stream -> ux_device_class_audio_stream_thread.tx_thread_entry ==
+ endpoint_dir = (_ux_device_thread_entry(&stream -> ux_device_class_audio_stream_thread) ==
_ux_device_class_audio_read_thread_entry) ?
UX_ENDPOINT_OUT : UX_ENDPOINT_IN;
#endif
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 98e113a5..fc29ee16 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
@@ -1,10 +1,11 @@
/***************************************************************************
- * Copyright (c) 2024 Microsoft Corporation
- *
+ * Copyright (c) 2024 Microsoft Corporation
+ * Copyright (c) 2026-present Eclipse ThreadX contributors
+ *
* This program and the accompanying materials are made available under the
* terms of the MIT License which is available at
* https://opensource.org/licenses/MIT.
- *
+ *
* SPDX-License-Identifier: MIT
**************************************************************************/
@@ -59,18 +60,6 @@
/* */
/* Device Audio Class */
/* */
-/* RELEASE HISTORY */
-/* */
-/* DATE NAME DESCRIPTION */
-/* */
-/* 05-19-2020 Chaoqiong Xiao Initial Version 6.0 */
-/* 09-30-2020 Chaoqiong Xiao Modified comment(s), */
-/* resulting in version 6.1 */
-/* 07-29-2022 Chaoqiong Xiao Modified comment(s), */
-/* fixed parameter/variable */
-/* names conflict C++ keyword, */
-/* resulting in version 6.1.12 */
-/* */
/**************************************************************************/
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 cb062500..67158799 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
@@ -1,10 +1,11 @@
/***************************************************************************
- * Copyright (c) 2024 Microsoft Corporation
- *
+ * Copyright (c) 2024 Microsoft Corporation
+ * Copyright (c) 2026-present Eclipse ThreadX contributors
+ *
* This program and the accompanying materials are made available under the
* terms of the MIT License which is available at
* https://opensource.org/licenses/MIT.
- *
+ *
* SPDX-License-Identifier: MIT
**************************************************************************/
@@ -59,18 +60,6 @@
/* */
/* Device Audio Class */
/* */
-/* RELEASE HISTORY */
-/* */
-/* DATE NAME DESCRIPTION */
-/* */
-/* 05-19-2020 Chaoqiong Xiao Initial Version 6.0 */
-/* 09-30-2020 Chaoqiong Xiao Modified comment(s), */
-/* resulting in version 6.1 */
-/* 07-29-2022 Chaoqiong Xiao Modified comment(s), */
-/* fixed parameter/variable */
-/* names conflict C++ keyword, */
-/* resulting in version 6.1.12 */
-/* */
/**************************************************************************/
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 3517a9f5..5dc3b798 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
@@ -1,5 +1,6 @@
/***************************************************************************
* Copyright (c) 2024 Microsoft Corporation
+ * Copyright (c) 2026-present Eclipse ThreadX contributors
*
* This program and the accompanying materials are made available under the
* terms of the MIT License which is available at
@@ -66,23 +67,6 @@
/* */
/* Device Stack */
/* */
-/* RELEASE HISTORY */
-/* */
-/* DATE NAME DESCRIPTION */
-/* */
-/* 05-19-2020 Chaoqiong Xiao Initial Version 6.0 */
-/* 09-30-2020 Chaoqiong Xiao Modified comment(s), */
-/* resulting in version 6.1 */
-/* 07-29-2022 Chaoqiong Xiao Modified comment(s), */
-/* returned request status, */
-/* resulting in version 6.1.12 */
-/* 03-08-2023 Chaoqiong Xiao Modified comment(s), */
-/* added error checks support, */
-/* resulting in version 6.2.1 */
-/* xx-xx-xxxx Mohamed ayed Modified comment(s), */
-/* fix typo, */
-/* resulting in version 6.x */
-/* */
/**************************************************************************/
UINT _ux_device_class_audio_entry(UX_SLAVE_CLASS_COMMAND *command)
{
diff --git a/common/usbx_device_classes/src/ux_device_class_audio_feedback_get.c b/common/usbx_device_classes/src/ux_device_class_audio_feedback_get.c
index 0e242d52..b4793867 100644
--- a/common/usbx_device_classes/src/ux_device_class_audio_feedback_get.c
+++ b/common/usbx_device_classes/src/ux_device_class_audio_feedback_get.c
@@ -1,10 +1,11 @@
/***************************************************************************
- * Copyright (c) 2024 Microsoft Corporation
- *
+ * Copyright (c) 2024 Microsoft Corporation
+ * Copyright (c) 2026-present Eclipse ThreadX contributors
+ *
* This program and the accompanying materials are made available under the
* terms of the MIT License which is available at
* https://opensource.org/licenses/MIT.
- *
+ *
* SPDX-License-Identifier: MIT
**************************************************************************/
@@ -59,12 +60,6 @@
/* */
/* Application */
/* */
-/* RELEASE HISTORY */
-/* */
-/* DATE NAME DESCRIPTION */
-/* */
-/* 01-31-2022 Chaoqiong Xiao Initial Version 6.1.10 */
-/* */
/**************************************************************************/
UINT _ux_device_class_audio_feedback_get(UX_DEVICE_CLASS_AUDIO_STREAM *stream,
UCHAR *encoded_feedback)
@@ -148,12 +143,6 @@ UCHAR *buffer;
/* */
/* Application */
/* */
-/* RELEASE HISTORY */
-/* */
-/* DATE NAME DESCRIPTION */
-/* */
-/* 03-08-2023 Chaoqiong Xiao Initial Version 6.2.1 */
-/* */
/**************************************************************************/
UINT _uxe_device_class_audio_feedback_get(UX_DEVICE_CLASS_AUDIO_STREAM *stream,
UCHAR *encoded_feedback)
diff --git a/common/usbx_device_classes/src/ux_device_class_audio_feedback_set.c b/common/usbx_device_classes/src/ux_device_class_audio_feedback_set.c
index abef9896..ee5af299 100644
--- a/common/usbx_device_classes/src/ux_device_class_audio_feedback_set.c
+++ b/common/usbx_device_classes/src/ux_device_class_audio_feedback_set.c
@@ -1,10 +1,11 @@
/***************************************************************************
- * Copyright (c) 2024 Microsoft Corporation
- *
+ * Copyright (c) 2024 Microsoft Corporation
+ * Copyright (c) 2026-present Eclipse ThreadX contributors
+ *
* This program and the accompanying materials are made available under the
* terms of the MIT License which is available at
* https://opensource.org/licenses/MIT.
- *
+ *
* SPDX-License-Identifier: MIT
**************************************************************************/
@@ -59,12 +60,6 @@
/* */
/* Application */
/* */
-/* RELEASE HISTORY */
-/* */
-/* DATE NAME DESCRIPTION */
-/* */
-/* 01-31-2022 Chaoqiong Xiao Initial Version 6.1.10 */
-/* */
/**************************************************************************/
UINT _ux_device_class_audio_feedback_set(UX_DEVICE_CLASS_AUDIO_STREAM *stream,
UCHAR *encoded_feedback)
@@ -148,12 +143,6 @@ UCHAR *buffer;
/* */
/* Application */
/* */
-/* RELEASE HISTORY */
-/* */
-/* DATE NAME DESCRIPTION */
-/* */
-/* 03-08-2023 Chaoqiong Xiao Initial Version 6.2.1 */
-/* */
/**************************************************************************/
UINT _uxe_device_class_audio_feedback_set(UX_DEVICE_CLASS_AUDIO_STREAM *stream,
UCHAR *encoded_feedback)
diff --git a/common/usbx_device_classes/src/ux_device_class_audio_feedback_task_function.c b/common/usbx_device_classes/src/ux_device_class_audio_feedback_task_function.c
index f3a96827..6dfd1a7f 100644
--- a/common/usbx_device_classes/src/ux_device_class_audio_feedback_task_function.c
+++ b/common/usbx_device_classes/src/ux_device_class_audio_feedback_task_function.c
@@ -1,10 +1,11 @@
/***************************************************************************
- * Copyright (c) 2024 Microsoft Corporation
- *
+ * Copyright (c) 2024 Microsoft Corporation
+ * Copyright (c) 2026-present Eclipse ThreadX contributors
+ *
* This program and the accompanying materials are made available under the
* terms of the MIT License which is available at
* https://opensource.org/licenses/MIT.
- *
+ *
* SPDX-License-Identifier: MIT
**************************************************************************/
@@ -66,12 +67,6 @@
/* */
/* Audio Class (task) */
/* */
-/* RELEASE HISTORY */
-/* */
-/* DATE NAME DESCRIPTION */
-/* */
-/* 10-31-2022 Yajun Xia Initial Version 6.2.0 */
-/* */
/**************************************************************************/
UINT _ux_device_class_audio_feedback_task_function(UX_DEVICE_CLASS_AUDIO_STREAM *stream)
{
diff --git a/common/usbx_device_classes/src/ux_device_class_audio_feedback_thread_entry.c b/common/usbx_device_classes/src/ux_device_class_audio_feedback_thread_entry.c
index 7d20a205..576b3689 100644
--- a/common/usbx_device_classes/src/ux_device_class_audio_feedback_thread_entry.c
+++ b/common/usbx_device_classes/src/ux_device_class_audio_feedback_thread_entry.c
@@ -1,10 +1,11 @@
/***************************************************************************
- * Copyright (c) 2024 Microsoft Corporation
- *
+ * Copyright (c) 2024 Microsoft Corporation
+ * Copyright (c) 2026-present Eclipse ThreadX contributors
+ *
* This program and the accompanying materials are made available under the
* terms of the MIT License which is available at
* https://opensource.org/licenses/MIT.
- *
+ *
* SPDX-License-Identifier: MIT
**************************************************************************/
@@ -64,15 +65,6 @@
/* */
/* ThreadX */
/* */
-/* RELEASE HISTORY */
-/* */
-/* DATE NAME DESCRIPTION */
-/* */
-/* 01-31-2022 Chaoqiong Xiao Initial Version 6.1.10 */
-/* 10-31-2022 Yajun Xia Modified comment(s), */
-/* added standalone support, */
-/* resulting in version 6.2.0 */
-/* */
/**************************************************************************/
VOID _ux_device_class_audio_feedback_thread_entry(ULONG audio_stream)
{
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 d4dfa01a..c8880bef 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
@@ -1,10 +1,11 @@
/***************************************************************************
- * Copyright (c) 2024 Microsoft Corporation
- *
+ * Copyright (c) 2024 Microsoft Corporation
+ * Copyright (c) 2026-present Eclipse ThreadX contributors
+ *
* This program and the accompanying materials are made available under the
* terms of the MIT License which is available at
* https://opensource.org/licenses/MIT.
- *
+ *
* SPDX-License-Identifier: MIT
**************************************************************************/
@@ -62,21 +63,6 @@
/* */
/* Application */
/* */
-/* RELEASE HISTORY */
-/* */
-/* DATE NAME DESCRIPTION */
-/* */
-/* 05-19-2020 Chaoqiong Xiao Initial Version 6.0 */
-/* 09-30-2020 Chaoqiong Xiao Modified comment(s), */
-/* verified memset and memcpy */
-/* cases, */
-/* resulting in version 6.1 */
-/* 01-31-2022 Chaoqiong Xiao Modified comment(s), */
-/* fixed frame length check, */
-/* resulting in version 6.1.10 */
-/* 03-08-2023 Chaoqiong Xiao Modified comment(s), */
-/* resulting in version 6.2.1 */
-/* */
/**************************************************************************/
UINT _ux_device_class_audio_frame_write(UX_DEVICE_CLASS_AUDIO_STREAM *stream, UCHAR *frame, ULONG length)
{
@@ -167,12 +153,6 @@ ULONG frame_buffer_size;
/* */
/* Application */
/* */
-/* RELEASE HISTORY */
-/* */
-/* DATE NAME DESCRIPTION */
-/* */
-/* 03-08-2023 Chaoqiong Xiao Initial Version 6.2.1 */
-/* */
/**************************************************************************/
UINT _uxe_device_class_audio_frame_write(UX_DEVICE_CLASS_AUDIO_STREAM *stream, UCHAR *frame, ULONG length)
{
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 231f16da..aea3772b 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
@@ -1,10 +1,11 @@
/***************************************************************************
- * Copyright (c) 2024 Microsoft Corporation
- *
+ * Copyright (c) 2024 Microsoft Corporation
+ * Copyright (c) 2026-present Eclipse ThreadX contributors
+ *
* This program and the accompanying materials are made available under the
* terms of the MIT License which is available at
* https://opensource.org/licenses/MIT.
- *
+ *
* SPDX-License-Identifier: MIT
**************************************************************************/
@@ -61,37 +62,6 @@
/* */
/* Device Audio Class */
/* */
-/* RELEASE HISTORY */
-/* */
-/* DATE NAME DESCRIPTION */
-/* */
-/* 05-19-2020 Chaoqiong Xiao Initial Version 6.0 */
-/* 09-30-2020 Chaoqiong Xiao Modified comment(s), */
-/* verified memset and memcpy */
-/* cases, used UX prefix to */
-/* refer to TX symbols instead */
-/* of using them directly, */
-/* resulting in version 6.1 */
-/* 01-31-2022 Chaoqiong Xiao Modified comment(s), */
-/* refined macros names, */
-/* added feedback support, */
-/* resulting in version 6.1.10 */
-/* 04-25-2022 Chaoqiong Xiao Modified comment(s), */
-/* fixed standalone compile, */
-/* resulting in version 6.1.11 */
-/* 07-29-2022 Chaoqiong Xiao Modified comment(s), */
-/* added interrupt support, */
-/* refined internal logic, */
-/* resulting in version 6.1.12 */
-/* 10-31-2022 Yajun Xia Modified comment(s), */
-/* added standalone support, */
-/* resulting in version 6.2.0 */
-/* 10-31-2023 Chaoqiong Xiao Modified comment(s), */
-/* added a new mode to manage */
-/* endpoint buffer in classes */
-/* with zero copy enabled, */
-/* resulting in version 6.3.0 */
-/* */
/**************************************************************************/
UINT _ux_device_class_audio_initialize(UX_SLAVE_CLASS_COMMAND *command)
{
@@ -520,15 +490,6 @@ ULONG i;
/* */
/* Device Audio Class */
/* */
-/* RELEASE HISTORY */
-/* */
-/* DATE NAME DESCRIPTION */
-/* */
-/* 03-08-2023 Chaoqiong Xiao Initial Version 6.2.1 */
-/* 10-31-2023 Yajun Xia Modified comment(s), */
-/* fixed error checking issue, */
-/* resulting in version 6.3.0 */
-/* */
/**************************************************************************/
UINT _uxe_device_class_audio_initialize(UX_SLAVE_CLASS_COMMAND *command)
{
diff --git a/common/usbx_device_classes/src/ux_device_class_audio_interrupt_send.c b/common/usbx_device_classes/src/ux_device_class_audio_interrupt_send.c
index e4ca10a8..2d0d7ddf 100644
--- a/common/usbx_device_classes/src/ux_device_class_audio_interrupt_send.c
+++ b/common/usbx_device_classes/src/ux_device_class_audio_interrupt_send.c
@@ -1,10 +1,11 @@
/***************************************************************************
- * Copyright (c) 2024 Microsoft Corporation
- *
+ * Copyright (c) 2024 Microsoft Corporation
+ * Copyright (c) 2026-present Eclipse ThreadX contributors
+ *
* This program and the accompanying materials are made available under the
* terms of the MIT License which is available at
* https://opensource.org/licenses/MIT.
- *
+ *
* SPDX-License-Identifier: MIT
**************************************************************************/
@@ -62,15 +63,6 @@
/* */
/* Application */
/* */
-/* RELEASE HISTORY */
-/* */
-/* DATE NAME DESCRIPTION */
-/* */
-/* 07-29-2022 Chaoqiong Xiao Initial Version 6.1.12 */
-/* 10-31-2022 Yajun Xia Modified comment(s), */
-/* added standalone support, */
-/* resulting in version 6.2.0 */
-/* */
/**************************************************************************/
UINT _ux_device_class_audio_interrupt_send(UX_DEVICE_CLASS_AUDIO *audio, UCHAR *int_data)
{
@@ -205,12 +197,6 @@ ULONG i;
/* */
/* Application */
/* */
-/* RELEASE HISTORY */
-/* */
-/* DATE NAME DESCRIPTION */
-/* */
-/* 03-08-2023 Chaoqiong Xiao Initial Version 6.2.1 */
-/* */
/**************************************************************************/
UINT _uxe_device_class_audio_interrupt_send(UX_DEVICE_CLASS_AUDIO *audio, UCHAR *int_data)
{
diff --git a/common/usbx_device_classes/src/ux_device_class_audio_interrupt_task_function.c b/common/usbx_device_classes/src/ux_device_class_audio_interrupt_task_function.c
index e29e13d6..0415e777 100644
--- a/common/usbx_device_classes/src/ux_device_class_audio_interrupt_task_function.c
+++ b/common/usbx_device_classes/src/ux_device_class_audio_interrupt_task_function.c
@@ -1,10 +1,11 @@
/***************************************************************************
- * Copyright (c) 2024 Microsoft Corporation
- *
+ * Copyright (c) 2024 Microsoft Corporation
+ * Copyright (c) 2026-present Eclipse ThreadX contributors
+ *
* This program and the accompanying materials are made available under the
* terms of the MIT License which is available at
* https://opensource.org/licenses/MIT.
- *
+ *
* SPDX-License-Identifier: MIT
**************************************************************************/
@@ -65,15 +66,6 @@
/* */
/* Audio Class (task) */
/* */
-/* RELEASE HISTORY */
-/* */
-/* DATE NAME DESCRIPTION */
-/* */
-/* 10-31-2022 Yajun Xia Initial Version 6.2.0 */
-/* 10-31-2023 Chaoqiong Xiao Modified comment(s), */
-/* removed an error trap, */
-/* resulting in version 6.3.0 */
-/* */
/**************************************************************************/
UINT _ux_device_class_audio_interrupt_task_function(UX_DEVICE_CLASS_AUDIO *audio)
{
@@ -98,7 +90,7 @@ UCHAR *buff;
audio -> ux_device_class_audio_interrupt_task_state = UX_STATE_EXIT;
return(UX_STATE_EXIT);
}
-
+
/* Get endpoint instance. */
endpoint = audio -> ux_device_class_audio_interrupt;
@@ -150,7 +142,7 @@ UCHAR *buff;
case UX_DEVICE_CLASS_AUDIO_INTERRUPT_WAIT:
/* Start frame transfer anyway. */
- status = _ux_device_stack_transfer_run(transfer, audio -> ux_device_class_audio_status_size,
+ status = _ux_device_stack_transfer_run(transfer, audio -> ux_device_class_audio_status_size,
audio -> ux_device_class_audio_status_size);
/* Any error or success case. */
@@ -161,7 +153,7 @@ UCHAR *buff;
_ux_system_error_handler(UX_SYSTEM_LEVEL_THREAD, UX_SYSTEM_CONTEXT_CLASS, UX_TRANSFER_ERROR);
audio -> ux_device_class_audio_interrupt_task_state = UX_STATE_RESET;
- audio -> ux_device_class_audio_interrupt_task_status =
+ audio -> ux_device_class_audio_interrupt_task_status =
transfer -> ux_slave_transfer_request_completion_code;
return(UX_STATE_EXIT);
}
@@ -174,11 +166,11 @@ UCHAR *buff;
if (buff >= (audio -> ux_device_class_audio_status_queue + audio -> ux_device_class_audio_status_queue_bytes))
buff = audio -> ux_device_class_audio_status_queue;
-
+
audio -> ux_device_class_audio_status_tail = buff;
audio -> ux_device_class_audio_status_queued -= audio -> ux_device_class_audio_status_size;
audio -> ux_device_class_audio_interrupt_task_state = UX_DEVICE_CLASS_AUDIO_INTERRUPT_START;
- audio -> ux_device_class_audio_interrupt_task_status =
+ audio -> ux_device_class_audio_interrupt_task_status =
transfer -> ux_slave_transfer_request_completion_code;
}
diff --git a/common/usbx_device_classes/src/ux_device_class_audio_interrupt_thread_entry.c b/common/usbx_device_classes/src/ux_device_class_audio_interrupt_thread_entry.c
index 21d8e2bc..60d2d781 100644
--- a/common/usbx_device_classes/src/ux_device_class_audio_interrupt_thread_entry.c
+++ b/common/usbx_device_classes/src/ux_device_class_audio_interrupt_thread_entry.c
@@ -1,10 +1,11 @@
/***************************************************************************
- * Copyright (c) 2024 Microsoft Corporation
- *
+ * Copyright (c) 2024 Microsoft Corporation
+ * Copyright (c) 2026-present Eclipse ThreadX contributors
+ *
* This program and the accompanying materials are made available under the
* terms of the MIT License which is available at
* https://opensource.org/licenses/MIT.
- *
+ *
* SPDX-License-Identifier: MIT
**************************************************************************/
@@ -64,12 +65,6 @@
/* */
/* ThreadX */
/* */
-/* RELEASE HISTORY */
-/* */
-/* DATE NAME DESCRIPTION */
-/* */
-/* 07-29-2022 Chaoqiong Xiao Initial Version 6.1.12 */
-/* */
/**************************************************************************/
VOID _ux_device_class_audio_interrupt_thread_entry(ULONG audio_inst)
{
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 da6f26a5..25bbace7 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
@@ -1,10 +1,11 @@
/***************************************************************************
- * Copyright (c) 2024 Microsoft Corporation
- *
+ * Copyright (c) 2024 Microsoft Corporation
+ * Copyright (c) 2026-present Eclipse ThreadX contributors
+ *
* This program and the accompanying materials are made available under the
* terms of the MIT License which is available at
* https://opensource.org/licenses/MIT.
- *
+ *
* SPDX-License-Identifier: MIT
**************************************************************************/
@@ -60,16 +61,6 @@
/* */
/* Application */
/* */
-/* RELEASE HISTORY */
-/* */
-/* DATE NAME DESCRIPTION */
-/* */
-/* 05-19-2020 Chaoqiong Xiao Initial Version 6.0 */
-/* 09-30-2020 Chaoqiong Xiao Modified comment(s), */
-/* resulting in version 6.1 */
-/* 03-08-2023 Chaoqiong Xiao Modified comment(s), */
-/* resulting in version 6.2.1 */
-/* */
/**************************************************************************/
UINT _ux_device_class_audio_ioctl(UX_DEVICE_CLASS_AUDIO *audio, ULONG ioctl_function,
VOID *parameter)
@@ -140,12 +131,6 @@ VOID **pptr_parameter;
/* */
/* Application */
/* */
-/* RELEASE HISTORY */
-/* */
-/* DATE NAME DESCRIPTION */
-/* */
-/* 03-08-2023 Chaoqiong Xiao Initial Version 6.2.1 */
-/* */
/**************************************************************************/
UINT _uxe_device_class_audio_ioctl(UX_DEVICE_CLASS_AUDIO *audio, ULONG ioctl_function,
VOID *parameter)
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 85e69a03..4bc00b3c 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
@@ -1,10 +1,11 @@
/***************************************************************************
- * Copyright (c) 2024 Microsoft Corporation
- *
+ * Copyright (c) 2024 Microsoft Corporation
+ * Copyright (c) 2026-present Eclipse ThreadX contributors
+ *
* This program and the accompanying materials are made available under the
* terms of the MIT License which is available at
* https://opensource.org/licenses/MIT.
- *
+ *
* SPDX-License-Identifier: MIT
**************************************************************************/
@@ -58,16 +59,6 @@
/* */
/* Application */
/* */
-/* RELEASE HISTORY */
-/* */
-/* DATE NAME DESCRIPTION */
-/* */
-/* 05-19-2020 Chaoqiong Xiao Initial Version 6.0 */
-/* 09-30-2020 Chaoqiong Xiao Modified comment(s), */
-/* resulting in version 6.1 */
-/* 03-08-2023 Chaoqiong Xiao Modified comment(s), */
-/* resulting in version 6.2.1 */
-/* */
/**************************************************************************/
UINT _ux_device_class_audio_read_frame_free(UX_DEVICE_CLASS_AUDIO_STREAM *stream)
{
@@ -159,12 +150,6 @@ UCHAR *next_frame;
/* */
/* Application */
/* */
-/* RELEASE HISTORY */
-/* */
-/* DATE NAME DESCRIPTION */
-/* */
-/* 03-08-2023 Chaoqiong Xiao Initial Version 6.2.1 */
-/* */
/**************************************************************************/
UINT _uxe_device_class_audio_read_frame_free(UX_DEVICE_CLASS_AUDIO_STREAM *stream)
{
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 6b4e6248..cf06a294 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
@@ -1,10 +1,11 @@
/***************************************************************************
- * Copyright (c) 2024 Microsoft Corporation
- *
+ * Copyright (c) 2024 Microsoft Corporation
+ * Copyright (c) 2026-present Eclipse ThreadX contributors
+ *
* This program and the accompanying materials are made available under the
* terms of the MIT License which is available at
* https://opensource.org/licenses/MIT.
- *
+ *
* SPDX-License-Identifier: MIT
**************************************************************************/
@@ -62,16 +63,6 @@
/* */
/* Application */
/* */
-/* RELEASE HISTORY */
-/* */
-/* DATE NAME DESCRIPTION */
-/* */
-/* 05-19-2020 Chaoqiong Xiao Initial Version 6.0 */
-/* 09-30-2020 Chaoqiong Xiao Modified comment(s), */
-/* resulting in version 6.1 */
-/* 03-08-2023 Chaoqiong Xiao Modified comment(s), */
-/* resulting in version 6.2.1 */
-/* */
/**************************************************************************/
UINT _ux_device_class_audio_read_frame_get(UX_DEVICE_CLASS_AUDIO_STREAM *stream,
UCHAR **frame_data, ULONG *frame_length)
@@ -149,12 +140,6 @@ UX_SLAVE_DEVICE *device;
/* */
/* Application */
/* */
-/* RELEASE HISTORY */
-/* */
-/* DATE NAME DESCRIPTION */
-/* */
-/* 03-08-2023 Chaoqiong Xiao Initial Version 6.2.1 */
-/* */
/**************************************************************************/
UINT _uxe_device_class_audio_read_frame_get(UX_DEVICE_CLASS_AUDIO_STREAM *stream,
UCHAR **frame_data, ULONG *frame_length)
diff --git a/common/usbx_device_classes/src/ux_device_class_audio_read_task_function.c b/common/usbx_device_classes/src/ux_device_class_audio_read_task_function.c
index 92421fdd..5bd4285d 100644
--- a/common/usbx_device_classes/src/ux_device_class_audio_read_task_function.c
+++ b/common/usbx_device_classes/src/ux_device_class_audio_read_task_function.c
@@ -1,10 +1,11 @@
/***************************************************************************
- * Copyright (c) 2024 Microsoft Corporation
- *
+ * Copyright (c) 2024 Microsoft Corporation
+ * Copyright (c) 2026-present Eclipse ThreadX contributors
+ *
* This program and the accompanying materials are made available under the
* terms of the MIT License which is available at
* https://opensource.org/licenses/MIT.
- *
+ *
* SPDX-License-Identifier: MIT
**************************************************************************/
@@ -65,17 +66,6 @@
/* */
/* USBX Device Stack */
/* */
-/* RELEASE HISTORY */
-/* */
-/* DATE NAME DESCRIPTION */
-/* */
-/* 10-31-2022 Yajun Xia Initial Version 6.2.0 */
-/* 10-31-2023 Chaoqiong Xiao Modified comment(s), */
-/* added a new mode to manage */
-/* endpoint buffer in classes */
-/* with zero copy enabled, */
-/* resulting in version 6.3.0 */
-/* */
/**************************************************************************/
UINT _ux_device_class_audio_read_task_function(UX_DEVICE_CLASS_AUDIO_STREAM *stream)
{
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 fa38ecba..0badadd9 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
@@ -1,10 +1,11 @@
/***************************************************************************
- * Copyright (c) 2024 Microsoft Corporation
- *
+ * Copyright (c) 2024 Microsoft Corporation
+ * Copyright (c) 2026-present Eclipse ThreadX contributors
+ *
* This program and the accompanying materials are made available under the
* terms of the MIT License which is available at
* https://opensource.org/licenses/MIT.
- *
+ *
* SPDX-License-Identifier: MIT
**************************************************************************/
@@ -64,31 +65,6 @@
/* */
/* ThreadX */
/* */
-/* RELEASE HISTORY */
-/* */
-/* DATE NAME DESCRIPTION */
-/* */
-/* 05-19-2020 Chaoqiong Xiao Initial Version 6.0 */
-/* 09-30-2020 Chaoqiong Xiao Modified comment(s), */
-/* verified memset and memcpy */
-/* cases, */
-/* resulting in version 6.1 */
-/* 10-15-2021 Chaoqiong Xiao Modified comment(s), */
-/* replaced wMaxPacketSize by */
-/* calculated payload size, */
-/* resulting in version 6.1.9 */
-/* 01-31-2022 Chaoqiong Xiao Modified comment(s), */
-/* refined macros names, */
-/* resulting in version 6.1.10 */
-/* 10-31-2022 Yajun Xia Modified comment(s), */
-/* added standalone support, */
-/* resulting in version 6.2.0 */
-/* 10-31-2023 Chaoqiong Xiao Modified comment(s), */
-/* added a new mode to manage */
-/* endpoint buffer in classes */
-/* with zero copy enabled, */
-/* resulting in version 6.3.0 */
-/* */
/**************************************************************************/
VOID _ux_device_class_audio_read_thread_entry(ULONG audio_stream)
{
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 0dff5f1d..b06b68fd 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
@@ -1,10 +1,11 @@
/***************************************************************************
- * Copyright (c) 2024 Microsoft Corporation
- *
+ * Copyright (c) 2024 Microsoft Corporation
+ * Copyright (c) 2026-present Eclipse ThreadX contributors
+ *
* This program and the accompanying materials are made available under the
* terms of the MIT License which is available at
* https://opensource.org/licenses/MIT.
- *
+ *
* SPDX-License-Identifier: MIT
**************************************************************************/
@@ -59,22 +60,6 @@
/* */
/* Application */
/* */
-/* RELEASE HISTORY */
-/* */
-/* DATE NAME DESCRIPTION */
-/* */
-/* 05-19-2020 Chaoqiong Xiao Initial Version 6.0 */
-/* 09-30-2020 Chaoqiong Xiao Modified comment(s), */
-/* resulting in version 6.1 */
-/* 01-31-2022 Chaoqiong Xiao Modified comment(s), */
-/* refined macros names, */
-/* resulting in version 6.1.10 */
-/* 10-31-2022 Yajun Xia Modified comment(s), */
-/* added standalone support, */
-/* resulting in version 6.2.0 */
-/* 03-08-2023 Chaoqiong Xiao Modified comment(s), */
-/* resulting in version 6.2.1 */
-/* */
/**************************************************************************/
UINT _ux_device_class_audio_reception_start(UX_DEVICE_CLASS_AUDIO_STREAM *stream)
{
@@ -153,12 +138,6 @@ UX_SLAVE_DEVICE *device;
/* */
/* Application */
/* */
-/* RELEASE HISTORY */
-/* */
-/* DATE NAME DESCRIPTION */
-/* */
-/* 03-08-2023 Chaoqiong Xiao Initial Version 6.2.1 */
-/* */
/**************************************************************************/
UINT _uxe_device_class_audio_reception_start(UX_DEVICE_CLASS_AUDIO_STREAM *stream)
{
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 4b4e24fa..f7e1e67b 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
@@ -1,10 +1,11 @@
/***************************************************************************
- * Copyright (c) 2024 Microsoft Corporation
- *
+ * Copyright (c) 2024 Microsoft Corporation
+ * Copyright (c) 2026-present Eclipse ThreadX contributors
+ *
* This program and the accompanying materials are made available under the
* terms of the MIT License which is available at
* https://opensource.org/licenses/MIT.
- *
+ *
* SPDX-License-Identifier: MIT
**************************************************************************/
@@ -60,16 +61,6 @@
/* */
/* Application */
/* */
-/* RELEASE HISTORY */
-/* */
-/* DATE NAME DESCRIPTION */
-/* */
-/* 05-19-2020 Chaoqiong Xiao Initial Version 6.0 */
-/* 09-30-2020 Chaoqiong Xiao Modified comment(s), */
-/* resulting in version 6.1 */
-/* 03-08-2023 Chaoqiong Xiao Modified comment(s), */
-/* resulting in version 6.2.1 */
-/* */
/**************************************************************************/
UINT _ux_device_class_audio_sample_read16(UX_DEVICE_CLASS_AUDIO_STREAM *stream,
USHORT *buffer)
@@ -176,12 +167,6 @@ ULONG next_frame_sample;
/* */
/* Application */
/* */
-/* RELEASE HISTORY */
-/* */
-/* DATE NAME DESCRIPTION */
-/* */
-/* 03-08-2023 Chaoqiong Xiao Initial Version 6.2.1 */
-/* */
/**************************************************************************/
UINT _uxe_device_class_audio_sample_read16(UX_DEVICE_CLASS_AUDIO_STREAM *stream,
USHORT *buffer)
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 dc3c79e3..0c6fa241 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
@@ -1,10 +1,11 @@
/***************************************************************************
- * Copyright (c) 2024 Microsoft Corporation
- *
+ * Copyright (c) 2024 Microsoft Corporation
+ * Copyright (c) 2026-present Eclipse ThreadX contributors
+ *
* This program and the accompanying materials are made available under the
* terms of the MIT License which is available at
* https://opensource.org/licenses/MIT.
- *
+ *
* SPDX-License-Identifier: MIT
**************************************************************************/
@@ -60,16 +61,6 @@
/* */
/* Application */
/* */
-/* RELEASE HISTORY */
-/* */
-/* DATE NAME DESCRIPTION */
-/* */
-/* 05-19-2020 Chaoqiong Xiao Initial Version 6.0 */
-/* 09-30-2020 Chaoqiong Xiao Modified comment(s), */
-/* resulting in version 6.1 */
-/* 03-08-2023 Chaoqiong Xiao Modified comment(s), */
-/* resulting in version 6.2.1 */
-/* */
/**************************************************************************/
UINT _ux_device_class_audio_sample_read24(UX_DEVICE_CLASS_AUDIO_STREAM *stream,
ULONG *buffer)
@@ -176,12 +167,6 @@ ULONG next_frame_sample;
/* */
/* Application */
/* */
-/* RELEASE HISTORY */
-/* */
-/* DATE NAME DESCRIPTION */
-/* */
-/* 03-08-2023 Chaoqiong Xiao Initial Version 6.2.1 */
-/* */
/**************************************************************************/
UINT _uxe_device_class_audio_sample_read24(UX_DEVICE_CLASS_AUDIO_STREAM *stream,
ULONG *buffer)
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 5661713b..5be8fec1 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
@@ -1,10 +1,11 @@
/***************************************************************************
- * Copyright (c) 2024 Microsoft Corporation
- *
+ * Copyright (c) 2024 Microsoft Corporation
+ * Copyright (c) 2026-present Eclipse ThreadX contributors
+ *
* This program and the accompanying materials are made available under the
* terms of the MIT License which is available at
* https://opensource.org/licenses/MIT.
- *
+ *
* SPDX-License-Identifier: MIT
**************************************************************************/
@@ -60,16 +61,6 @@
/* */
/* Application */
/* */
-/* RELEASE HISTORY */
-/* */
-/* DATE NAME DESCRIPTION */
-/* */
-/* 05-19-2020 Chaoqiong Xiao Initial Version 6.0 */
-/* 09-30-2020 Chaoqiong Xiao Modified comment(s), */
-/* resulting in version 6.1 */
-/* 03-08-2023 Chaoqiong Xiao Modified comment(s), */
-/* resulting in version 6.2.1 */
-/* */
/**************************************************************************/
UINT _ux_device_class_audio_sample_read32(UX_DEVICE_CLASS_AUDIO_STREAM *stream, ULONG *buffer)
{
@@ -178,12 +169,6 @@ ULONG next_frame_sample;
/* */
/* Application */
/* */
-/* RELEASE HISTORY */
-/* */
-/* DATE NAME DESCRIPTION */
-/* */
-/* 03-08-2023 Chaoqiong Xiao Initial Version 6.2.1 */
-/* */
/**************************************************************************/
UINT _uxe_device_class_audio_sample_read32(UX_DEVICE_CLASS_AUDIO_STREAM *stream,
ULONG *buffer)
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 ae975bfa..318ac8da 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
@@ -1,10 +1,11 @@
/***************************************************************************
- * Copyright (c) 2024 Microsoft Corporation
- *
+ * Copyright (c) 2024 Microsoft Corporation
+ * Copyright (c) 2026-present Eclipse ThreadX contributors
+ *
* This program and the accompanying materials are made available under the
* terms of the MIT License which is available at
* https://opensource.org/licenses/MIT.
- *
+ *
* SPDX-License-Identifier: MIT
**************************************************************************/
@@ -60,16 +61,6 @@
/* */
/* Application */
/* */
-/* RELEASE HISTORY */
-/* */
-/* DATE NAME DESCRIPTION */
-/* */
-/* 05-19-2020 Chaoqiong Xiao Initial Version 6.0 */
-/* 09-30-2020 Chaoqiong Xiao Modified comment(s), */
-/* resulting in version 6.1 */
-/* 03-08-2023 Chaoqiong Xiao Modified comment(s), */
-/* resulting in version 6.2.1 */
-/* */
/**************************************************************************/
UINT _ux_device_class_audio_sample_read8(UX_DEVICE_CLASS_AUDIO_STREAM *stream,
UCHAR *buffer)
@@ -175,12 +166,6 @@ ULONG next_frame_sample;
/* */
/* Application */
/* */
-/* RELEASE HISTORY */
-/* */
-/* DATE NAME DESCRIPTION */
-/* */
-/* 03-08-2023 Chaoqiong Xiao Initial Version 6.2.1 */
-/* */
/**************************************************************************/
UINT _uxe_device_class_audio_sample_read8(UX_DEVICE_CLASS_AUDIO_STREAM *stream,
UCHAR *buffer)
diff --git a/common/usbx_device_classes/src/ux_device_class_audio_speed_get.c b/common/usbx_device_classes/src/ux_device_class_audio_speed_get.c
index 11619a3b..24573371 100644
--- a/common/usbx_device_classes/src/ux_device_class_audio_speed_get.c
+++ b/common/usbx_device_classes/src/ux_device_class_audio_speed_get.c
@@ -1,10 +1,11 @@
/***************************************************************************
- * Copyright (c) 2024 Microsoft Corporation
- *
+ * Copyright (c) 2024 Microsoft Corporation
+ * Copyright (c) 2026-present Eclipse ThreadX contributors
+ *
* This program and the accompanying materials are made available under the
* terms of the MIT License which is available at
* https://opensource.org/licenses/MIT.
- *
+ *
* SPDX-License-Identifier: MIT
**************************************************************************/
@@ -58,12 +59,6 @@
/* */
/* Application */
/* */
-/* RELEASE HISTORY */
-/* */
-/* DATE NAME DESCRIPTION */
-/* */
-/* 01-31-2022 Chaoqiong Xiao Initial Version 6.1.10 */
-/* */
/**************************************************************************/
ULONG _ux_device_class_audio_speed_get(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 86fb934c..0de7699c 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
@@ -1,10 +1,11 @@
/***************************************************************************
- * Copyright (c) 2024 Microsoft Corporation
- *
+ * Copyright (c) 2024 Microsoft Corporation
+ * Copyright (c) 2026-present Eclipse ThreadX contributors
+ *
* This program and the accompanying materials are made available under the
* terms of the MIT License which is available at
* https://opensource.org/licenses/MIT.
- *
+ *
* SPDX-License-Identifier: MIT
**************************************************************************/
@@ -61,19 +62,6 @@
/* */
/* Application */
/* */
-/* RELEASE HISTORY */
-/* */
-/* DATE NAME DESCRIPTION */
-/* */
-/* 05-19-2020 Chaoqiong Xiao Initial Version 6.0 */
-/* 09-30-2020 Chaoqiong Xiao Modified comment(s), */
-/* resulting in version 6.1 */
-/* 01-31-2022 Chaoqiong Xiao Modified comment(s), */
-/* resulting in version 6.1.10 */
-/* 03-08-2023 Chaoqiong Xiao Modified comment(s), */
-/* added error checks support, */
-/* resulting in version 6.2.1 */
-/* */
/**************************************************************************/
UINT _ux_device_class_audio_stream_get(UX_DEVICE_CLASS_AUDIO *audio,
ULONG stream_index, UX_DEVICE_CLASS_AUDIO_STREAM **stream)
@@ -120,12 +108,6 @@ UINT _ux_device_class_audio_stream_get(UX_DEVICE_CLASS_AUDIO *audio,
/* */
/* Application */
/* */
-/* RELEASE HISTORY */
-/* */
-/* DATE NAME DESCRIPTION */
-/* */
-/* 03-08-2023 Chaoqiong Xiao Initial Version 6.2.1 */
-/* */
/**************************************************************************/
UINT _uxe_device_class_audio_stream_get(UX_DEVICE_CLASS_AUDIO *audio,
ULONG stream_index, UX_DEVICE_CLASS_AUDIO_STREAM **stream)
diff --git a/common/usbx_device_classes/src/ux_device_class_audio_tasks_run.c b/common/usbx_device_classes/src/ux_device_class_audio_tasks_run.c
index ea622bdf..4e99aee6 100644
--- a/common/usbx_device_classes/src/ux_device_class_audio_tasks_run.c
+++ b/common/usbx_device_classes/src/ux_device_class_audio_tasks_run.c
@@ -1,10 +1,11 @@
/***************************************************************************
- * Copyright (c) 2024 Microsoft Corporation
- *
+ * Copyright (c) 2024 Microsoft Corporation
+ * Copyright (c) 2026-present Eclipse ThreadX contributors
+ *
* This program and the accompanying materials are made available under the
* terms of the MIT License which is available at
* https://opensource.org/licenses/MIT.
- *
+ *
* SPDX-License-Identifier: MIT
**************************************************************************/
@@ -67,12 +68,6 @@
/* */
/* USBX Device Stack */
/* */
-/* RELEASE HISTORY */
-/* */
-/* DATE NAME DESCRIPTION */
-/* */
-/* 10-31-2022 Yajun Xia Initial Version 6.2.0 */
-/* */
/**************************************************************************/
UINT _ux_device_class_audio_tasks_run(VOID *instance)
{
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 1123e267..be12e5db 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
@@ -1,10 +1,11 @@
/***************************************************************************
- * Copyright (c) 2024 Microsoft Corporation
- *
+ * Copyright (c) 2024 Microsoft Corporation
+ * Copyright (c) 2026-present Eclipse ThreadX contributors
+ *
* This program and the accompanying materials are made available under the
* terms of the MIT License which is available at
* https://opensource.org/licenses/MIT.
- *
+ *
* SPDX-License-Identifier: MIT
**************************************************************************/
@@ -59,22 +60,6 @@
/* */
/* Application */
/* */
-/* RELEASE HISTORY */
-/* */
-/* DATE NAME DESCRIPTION */
-/* */
-/* 05-19-2020 Chaoqiong Xiao Initial Version 6.0 */
-/* 09-30-2020 Chaoqiong Xiao Modified comment(s), */
-/* resulting in version 6.1 */
-/* 01-31-2022 Chaoqiong Xiao Modified comment(s), */
-/* refined macros names, */
-/* resulting in version 6.1.10 */
-/* 10-31-2022 Yajun Xia Modified comment(s), */
-/* added standalone support, */
-/* resulting in version 6.2.0 */
-/* 03-08-2023 Chaoqiong Xiao Modified comment(s), */
-/* resulting in version 6.2.1 */
-/* */
/**************************************************************************/
UINT _ux_device_class_audio_transmission_start(UX_DEVICE_CLASS_AUDIO_STREAM *stream)
{
@@ -153,12 +138,6 @@ UX_SLAVE_DEVICE *device;
/* */
/* Application */
/* */
-/* RELEASE HISTORY */
-/* */
-/* DATE NAME DESCRIPTION */
-/* */
-/* 03-08-2023 Chaoqiong Xiao Initial Version 6.2.1 */
-/* */
/**************************************************************************/
UINT _uxe_device_class_audio_transmission_start(UX_DEVICE_CLASS_AUDIO_STREAM *stream)
{
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 caec0766..112b63a1 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
@@ -1,10 +1,11 @@
/***************************************************************************
- * Copyright (c) 2024 Microsoft Corporation
- *
+ * Copyright (c) 2024 Microsoft Corporation
+ * Copyright (c) 2026-present Eclipse ThreadX contributors
+ *
* This program and the accompanying materials are made available under the
* terms of the MIT License which is available at
* https://opensource.org/licenses/MIT.
- *
+ *
* SPDX-License-Identifier: MIT
**************************************************************************/
@@ -59,27 +60,6 @@
/* */
/* Device Audio Class */
/* */
-/* RELEASE HISTORY */
-/* */
-/* DATE NAME DESCRIPTION */
-/* */
-/* 05-19-2020 Chaoqiong Xiao Initial Version 6.0 */
-/* 09-30-2020 Chaoqiong Xiao Modified comment(s), */
-/* resulting in version 6.1 */
-/* 01-31-2022 Chaoqiong Xiao Modified comment(s), */
-/* refined macros names, */
-/* added feedback support, */
-/* fixed stream uninitialize, */
-/* resulting in version 6.1.10 */
-/* 04-25-2022 Chaoqiong Xiao Modified comment(s), */
-/* fixed standalone compile, */
-/* resulting in version 6.1.11 */
-/* 10-31-2023 Chaoqiong Xiao Modified comment(s), */
-/* added a new mode to manage */
-/* endpoint buffer in classes */
-/* with zero copy enabled, */
-/* resulting in version 6.3.0 */
-/* */
/**************************************************************************/
UINT _ux_device_class_audio_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 b9815693..364953d0 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
@@ -1,10 +1,11 @@
/***************************************************************************
- * Copyright (c) 2024 Microsoft Corporation
- *
+ * Copyright (c) 2024 Microsoft Corporation
+ * Copyright (c) 2026-present Eclipse ThreadX contributors
+ *
* This program and the accompanying materials are made available under the
* terms of the MIT License which is available at
* https://opensource.org/licenses/MIT.
- *
+ *
* SPDX-License-Identifier: MIT
**************************************************************************/
@@ -61,19 +62,6 @@
/* */
/* Application */
/* */
-/* RELEASE HISTORY */
-/* */
-/* DATE NAME DESCRIPTION */
-/* */
-/* 05-19-2020 Chaoqiong Xiao Initial Version 6.0 */
-/* 09-30-2020 Chaoqiong Xiao Modified comment(s), */
-/* resulting in version 6.1 */
-/* 01-31-2022 Chaoqiong Xiao Modified comment(s), */
-/* fixed frame length check, */
-/* resulting in version 6.1.10 */
-/* 03-08-2023 Chaoqiong Xiao Modified comment(s), */
-/* resulting in version 6.2.1 */
-/* */
/**************************************************************************/
UINT _ux_device_class_audio_write_frame_commit(UX_DEVICE_CLASS_AUDIO_STREAM *stream, ULONG length)
{
@@ -166,12 +154,6 @@ UCHAR *next_pos;
/* */
/* Application */
/* */
-/* RELEASE HISTORY */
-/* */
-/* DATE NAME DESCRIPTION */
-/* */
-/* 03-08-2023 Chaoqiong Xiao Initial Version 6.2.1 */
-/* */
/**************************************************************************/
UINT _uxe_device_class_audio_write_frame_commit(UX_DEVICE_CLASS_AUDIO_STREAM *stream, ULONG length)
{
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 b41a0bdf..b19114af 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
@@ -1,10 +1,11 @@
/***************************************************************************
- * Copyright (c) 2024 Microsoft Corporation
- *
+ * Copyright (c) 2024 Microsoft Corporation
+ * Copyright (c) 2026-present Eclipse ThreadX contributors
+ *
* This program and the accompanying materials are made available under the
* terms of the MIT License which is available at
* https://opensource.org/licenses/MIT.
- *
+ *
* SPDX-License-Identifier: MIT
**************************************************************************/
@@ -62,16 +63,6 @@
/* */
/* Application */
/* */
-/* RELEASE HISTORY */
-/* */
-/* DATE NAME DESCRIPTION */
-/* */
-/* 05-19-2020 Chaoqiong Xiao Initial Version 6.0 */
-/* 09-30-2020 Chaoqiong Xiao Modified comment(s), */
-/* resulting in version 6.1 */
-/* 03-08-2023 Chaoqiong Xiao Modified comment(s), */
-/* resulting in version 6.2.1 */
-/* */
/**************************************************************************/
UINT _ux_device_class_audio_write_frame_get(UX_DEVICE_CLASS_AUDIO_STREAM *stream, UCHAR **frame, ULONG *length)
{
@@ -151,12 +142,6 @@ UX_SLAVE_DEVICE *device;
/* */
/* Application */
/* */
-/* RELEASE HISTORY */
-/* */
-/* DATE NAME DESCRIPTION */
-/* */
-/* 03-08-2023 Chaoqiong Xiao Initial Version 6.2.1 */
-/* */
/**************************************************************************/
UINT _uxe_device_class_audio_write_frame_get(UX_DEVICE_CLASS_AUDIO_STREAM *stream, UCHAR **frame, ULONG *length)
{
diff --git a/common/usbx_device_classes/src/ux_device_class_audio_write_task_function.c b/common/usbx_device_classes/src/ux_device_class_audio_write_task_function.c
index 5aca9572..54b81616 100644
--- a/common/usbx_device_classes/src/ux_device_class_audio_write_task_function.c
+++ b/common/usbx_device_classes/src/ux_device_class_audio_write_task_function.c
@@ -1,10 +1,11 @@
/***************************************************************************
- * Copyright (c) 2024 Microsoft Corporation
- *
+ * Copyright (c) 2024 Microsoft Corporation
+ * Copyright (c) 2026-present Eclipse ThreadX contributors
+ *
* This program and the accompanying materials are made available under the
* terms of the MIT License which is available at
* https://opensource.org/licenses/MIT.
- *
+ *
* SPDX-License-Identifier: MIT
**************************************************************************/
@@ -66,17 +67,6 @@
/* */
/* USBX Device Stack */
/* */
-/* RELEASE HISTORY */
-/* */
-/* DATE NAME DESCRIPTION */
-/* */
-/* 10-31-2022 Yajun Xia Initial Version 6.2.0 */
-/* 10-31-2023 Chaoqiong Xiao Modified comment(s), */
-/* added a new mode to manage */
-/* endpoint buffer in classes */
-/* with zero copy enabled, */
-/* resulting in version 6.3.0 */
-/* */
/**************************************************************************/
UINT _ux_device_class_audio_write_task_function(UX_DEVICE_CLASS_AUDIO_STREAM *stream)
{
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 6a2bde86..3f1ba1cf 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
@@ -1,10 +1,11 @@
/***************************************************************************
- * Copyright (c) 2024 Microsoft Corporation
- *
+ * Copyright (c) 2024 Microsoft Corporation
+ * Copyright (c) 2026-present Eclipse ThreadX contributors
+ *
* This program and the accompanying materials are made available under the
* terms of the MIT License which is available at
* https://opensource.org/licenses/MIT.
- *
+ *
* SPDX-License-Identifier: MIT
**************************************************************************/
@@ -62,27 +63,6 @@
/* */
/* ThreadX */
/* */
-/* RELEASE HISTORY */
-/* */
-/* DATE NAME DESCRIPTION */
-/* */
-/* 05-19-2020 Chaoqiong Xiao Initial Version 6.0 */
-/* 09-30-2020 Chaoqiong Xiao Modified comment(s), */
-/* verified memset and memcpy */
-/* cases, */
-/* resulting in version 6.1 */
-/* 01-31-2022 Chaoqiong Xiao Modified comment(s), */
-/* refined macros names, */
-/* resulting in version 6.1.10 */
-/* 10-31-2022 Yajun Xia Modified comment(s), */
-/* added standalone support, */
-/* resulting in version 6.2.0 */
-/* 10-31-2023 Chaoqiong Xiao Modified comment(s), */
-/* added a new mode to manage */
-/* endpoint buffer in classes */
-/* with zero copy enabled, */
-/* resulting in version 6.3.0 */
-/* */
/**************************************************************************/
VOID _ux_device_class_audio_write_thread_entry(ULONG audio_stream)
{
diff --git a/common/usbx_device_classes/src/ux_device_class_ccid_activate.c b/common/usbx_device_classes/src/ux_device_class_ccid_activate.c
index 43548ac9..96de5cf8 100644
--- a/common/usbx_device_classes/src/ux_device_class_ccid_activate.c
+++ b/common/usbx_device_classes/src/ux_device_class_ccid_activate.c
@@ -1,10 +1,11 @@
/***************************************************************************
- * Copyright (c) 2024 Microsoft Corporation
- *
+ * Copyright (c) 2024 Microsoft Corporation
+ * Copyright (c) 2026-present Eclipse ThreadX contributors
+ *
* This program and the accompanying materials are made available under the
* terms of the MIT License which is available at
* https://opensource.org/licenses/MIT.
- *
+ *
* SPDX-License-Identifier: MIT
**************************************************************************/
@@ -57,23 +58,6 @@
/* */
/* USBX Device CCID */
/* */
-/* RELEASE HISTORY */
-/* */
-/* DATE NAME DESCRIPTION */
-/* */
-/* 04-25-2022 Chaoqiong Xiao Initial Version 6.1.11 */
-/* 07-29-2022 Chaoqiong Xiao Modified comment(s), */
-/* fixed parameter/variable */
-/* names conflict C++ keyword, */
-/* resulting in version 6.1.12 */
-/* 03-08-2023 Chaoqiong Xiao Modified comment(s), */
-/* added standalone support, */
-/* resulting in version 6.2.1 */
-/* 10-31-2023 Chaoqiong Xiao Modified comment(s), */
-/* added a new mode to manage */
-/* endpoint buffer in classes, */
-/* resulting in version 6.3.0 */
-/* */
/**************************************************************************/
UINT _ux_device_class_ccid_activate(UX_SLAVE_CLASS_COMMAND *command)
{
diff --git a/common/usbx_device_classes/src/ux_device_class_ccid_auto_seq_done.c b/common/usbx_device_classes/src/ux_device_class_ccid_auto_seq_done.c
index e69b8a10..e1876939 100644
--- a/common/usbx_device_classes/src/ux_device_class_ccid_auto_seq_done.c
+++ b/common/usbx_device_classes/src/ux_device_class_ccid_auto_seq_done.c
@@ -1,10 +1,11 @@
/***************************************************************************
- * Copyright (c) 2024 Microsoft Corporation
- *
+ * Copyright (c) 2024 Microsoft Corporation
+ * Copyright (c) 2026-present Eclipse ThreadX contributors
+ *
* This program and the accompanying materials are made available under the
* terms of the MIT License which is available at
* https://opensource.org/licenses/MIT.
- *
+ *
* SPDX-License-Identifier: MIT
**************************************************************************/
@@ -61,17 +62,6 @@
/* */
/* Application */
/* */
-/* RELEASE HISTORY */
-/* */
-/* DATE NAME DESCRIPTION */
-/* */
-/* 04-25-2022 Chaoqiong Xiao Initial Version 6.1.11 */
-/* 03-08-2023 Chaoqiong Xiao Modified comment(s), */
-/* added standalone support, */
-/* resulting in version 6.2.1 */
-/* 10-31-2023 Yajun Xia Modified comment(s), */
-/* resulting in version 6.3.0 */
-/* */
/**************************************************************************/
UINT _ux_device_class_ccid_auto_seq_done(UX_DEVICE_CLASS_CCID *ccid, ULONG slot, ULONG icc_status)
{
@@ -137,12 +127,6 @@ UX_DEVICE_CLASS_CCID_SLOT *ccid_slot;
/* */
/* Application */
/* */
-/* RELEASE HISTORY */
-/* */
-/* DATE NAME DESCRIPTION */
-/* */
-/* 10-31-2023 Yajun Xia Initial Version 6.3.0 */
-/* */
/**************************************************************************/
UINT _uxe_device_class_ccid_auto_seq_done(UX_DEVICE_CLASS_CCID *ccid, ULONG slot, ULONG icc_status)
{
diff --git a/common/usbx_device_classes/src/ux_device_class_ccid_auto_seq_start.c b/common/usbx_device_classes/src/ux_device_class_ccid_auto_seq_start.c
index 20d8af3f..5fce407b 100644
--- a/common/usbx_device_classes/src/ux_device_class_ccid_auto_seq_start.c
+++ b/common/usbx_device_classes/src/ux_device_class_ccid_auto_seq_start.c
@@ -1,10 +1,11 @@
/***************************************************************************
- * Copyright (c) 2024 Microsoft Corporation
- *
+ * Copyright (c) 2024 Microsoft Corporation
+ * Copyright (c) 2026-present Eclipse ThreadX contributors
+ *
* This program and the accompanying materials are made available under the
* terms of the MIT License which is available at
* https://opensource.org/licenses/MIT.
- *
+ *
* SPDX-License-Identifier: MIT
**************************************************************************/
@@ -57,15 +58,6 @@
/* */
/* USBX Source Code */
/* */
-/* RELEASE HISTORY */
-/* */
-/* DATE NAME DESCRIPTION */
-/* */
-/* 04-25-2022 Chaoqiong Xiao Initial Version 6.1.11 */
-/* 03-08-2023 Chaoqiong Xiao Modified comment(s), */
-/* added standalone support, */
-/* resulting in version 6.2.1 */
-/* */
/**************************************************************************/
UINT _ux_device_class_ccid_auto_seq_start(UX_DEVICE_CLASS_CCID *ccid, ULONG slot)
{
diff --git a/common/usbx_device_classes/src/ux_device_class_ccid_control_abort.c b/common/usbx_device_classes/src/ux_device_class_ccid_control_abort.c
index 7be5e108..08fdb04f 100644
--- a/common/usbx_device_classes/src/ux_device_class_ccid_control_abort.c
+++ b/common/usbx_device_classes/src/ux_device_class_ccid_control_abort.c
@@ -1,10 +1,11 @@
/***************************************************************************
- * Copyright (c) 2024 Microsoft Corporation
- *
+ * Copyright (c) 2024 Microsoft Corporation
+ * Copyright (c) 2026-present Eclipse ThreadX contributors
+ *
* This program and the accompanying materials are made available under the
* terms of the MIT License which is available at
* https://opensource.org/licenses/MIT.
- *
+ *
* SPDX-License-Identifier: MIT
**************************************************************************/
@@ -58,15 +59,6 @@
/* */
/* USBX Source Code */
/* */
-/* RELEASE HISTORY */
-/* */
-/* DATE NAME DESCRIPTION */
-/* */
-/* 04-25-2022 Chaoqiong Xiao Initial Version 6.1.11 */
-/* 03-08-2023 Chaoqiong Xiao Modified comment(s), */
-/* added standalone support, */
-/* resulting in version 6.2.1 */
-/* */
/**************************************************************************/
UINT _ux_device_class_ccid_control_abort(UX_DEVICE_CLASS_CCID *ccid, ULONG slot, ULONG seq)
{
diff --git a/common/usbx_device_classes/src/ux_device_class_ccid_control_request.c b/common/usbx_device_classes/src/ux_device_class_ccid_control_request.c
index 03a3dbe7..8059b0bb 100644
--- a/common/usbx_device_classes/src/ux_device_class_ccid_control_request.c
+++ b/common/usbx_device_classes/src/ux_device_class_ccid_control_request.c
@@ -1,10 +1,11 @@
/***************************************************************************
- * Copyright (c) 2024 Microsoft Corporation
- *
+ * Copyright (c) 2024 Microsoft Corporation
+ * Copyright (c) 2026-present Eclipse ThreadX contributors
+ *
* This program and the accompanying materials are made available under the
* terms of the MIT License which is available at
* https://opensource.org/licenses/MIT.
- *
+ *
* SPDX-License-Identifier: MIT
**************************************************************************/
@@ -61,12 +62,6 @@
/* */
/* CCID Class */
/* */
-/* RELEASE HISTORY */
-/* */
-/* DATE NAME DESCRIPTION */
-/* */
-/* 04-25-2022 Chaoqiong Xiao Initial Version 6.1.11 */
-/* */
/**************************************************************************/
UINT _ux_device_class_ccid_control_request(UX_SLAVE_CLASS_COMMAND *command)
{
diff --git a/common/usbx_device_classes/src/ux_device_class_ccid_deactivate.c b/common/usbx_device_classes/src/ux_device_class_ccid_deactivate.c
index 243f50df..8c538a99 100644
--- a/common/usbx_device_classes/src/ux_device_class_ccid_deactivate.c
+++ b/common/usbx_device_classes/src/ux_device_class_ccid_deactivate.c
@@ -1,10 +1,11 @@
/***************************************************************************
- * Copyright (c) 2024 Microsoft Corporation
- *
+ * Copyright (c) 2024 Microsoft Corporation
+ * Copyright (c) 2026-present Eclipse ThreadX contributors
+ *
* This program and the accompanying materials are made available under the
* terms of the MIT License which is available at
* https://opensource.org/licenses/MIT.
- *
+ *
* SPDX-License-Identifier: MIT
**************************************************************************/
@@ -59,12 +60,6 @@
/* */
/* CCID Class */
/* */
-/* RELEASE HISTORY */
-/* */
-/* DATE NAME DESCRIPTION */
-/* */
-/* 04-25-2022 Chaoqiong Xiao Initial Version 6.1.11 */
-/* */
/**************************************************************************/
UINT _ux_device_class_ccid_deactivate(UX_SLAVE_CLASS_COMMAND *command)
{
diff --git a/common/usbx_device_classes/src/ux_device_class_ccid_entry.c b/common/usbx_device_classes/src/ux_device_class_ccid_entry.c
index 81509083..78e72a41 100644
--- a/common/usbx_device_classes/src/ux_device_class_ccid_entry.c
+++ b/common/usbx_device_classes/src/ux_device_class_ccid_entry.c
@@ -1,5 +1,6 @@
/***************************************************************************
* Copyright (c) 2024 Microsoft Corporation
+ * Copyright (c) 2026-present Eclipse ThreadX contributors
*
* This program and the accompanying materials are made available under the
* terms of the MIT License which is available at
@@ -65,15 +66,6 @@
/* */
/* USBX Device Stack */
/* */
-/* RELEASE HISTORY */
-/* */
-/* DATE NAME DESCRIPTION */
-/* */
-/* 04-25-2022 Chaoqiong Xiao Initial Version 6.1.11 */
-/* xx-xx-xxxx Mohamed ayed Modified comment(s), */
-/* fix typo, */
-/* resulting in version 6.x */
-/* */
/**************************************************************************/
UINT _ux_device_class_ccid_entry(UX_SLAVE_CLASS_COMMAND *command)
{
diff --git a/common/usbx_device_classes/src/ux_device_class_ccid_hardware_error.c b/common/usbx_device_classes/src/ux_device_class_ccid_hardware_error.c
index d02e4c3b..030c5cfd 100644
--- a/common/usbx_device_classes/src/ux_device_class_ccid_hardware_error.c
+++ b/common/usbx_device_classes/src/ux_device_class_ccid_hardware_error.c
@@ -1,10 +1,11 @@
/***************************************************************************
- * Copyright (c) 2024 Microsoft Corporation
- *
+ * Copyright (c) 2024 Microsoft Corporation
+ * Copyright (c) 2026-present Eclipse ThreadX contributors
+ *
* This program and the accompanying materials are made available under the
* terms of the MIT License which is available at
* https://opensource.org/licenses/MIT.
- *
+ *
* SPDX-License-Identifier: MIT
**************************************************************************/
@@ -58,17 +59,6 @@
/* */
/* Application */
/* */
-/* RELEASE HISTORY */
-/* */
-/* DATE NAME DESCRIPTION */
-/* */
-/* 04-25-2022 Chaoqiong Xiao Initial Version 6.1.11 */
-/* 03-08-2023 Chaoqiong Xiao Modified comment(s), */
-/* added standalone support, */
-/* resulting in version 6.2.1 */
-/* 10-31-2023 Yajun Xia Modified comment(s), */
-/* resulting in version 6.3.0 */
-/* */
/**************************************************************************/
UINT _ux_device_class_ccid_hardware_error(UX_DEVICE_CLASS_CCID *ccid, ULONG slot, ULONG error)
{
@@ -173,12 +163,6 @@ UX_DEVICE_CLASS_CCID_RDR_TO_PC_SLOT_STATUS_HEADER *rsp;
/* */
/* Application */
/* */
-/* RELEASE HISTORY */
-/* */
-/* DATE NAME DESCRIPTION */
-/* */
-/* 10-31-2023 Yajun Xia Initial Version 6.3.0 */
-/* */
/**************************************************************************/
UINT _uxe_device_class_ccid_hardware_error(UX_DEVICE_CLASS_CCID *ccid, ULONG slot, ULONG error)
{
diff --git a/common/usbx_device_classes/src/ux_device_class_ccid_icc_insert.c b/common/usbx_device_classes/src/ux_device_class_ccid_icc_insert.c
index 2fc57f6b..a3ecdde4 100644
--- a/common/usbx_device_classes/src/ux_device_class_ccid_icc_insert.c
+++ b/common/usbx_device_classes/src/ux_device_class_ccid_icc_insert.c
@@ -1,10 +1,11 @@
/***************************************************************************
- * Copyright (c) 2024 Microsoft Corporation
- *
+ * Copyright (c) 2024 Microsoft Corporation
+ * Copyright (c) 2026-present Eclipse ThreadX contributors
+ *
* This program and the accompanying materials are made available under the
* terms of the MIT License which is available at
* https://opensource.org/licenses/MIT.
- *
+ *
* SPDX-License-Identifier: MIT
**************************************************************************/
@@ -61,17 +62,6 @@
/* */
/* Application */
/* */
-/* RELEASE HISTORY */
-/* */
-/* DATE NAME DESCRIPTION */
-/* */
-/* 04-25-2022 Chaoqiong Xiao Initial Version 6.1.11 */
-/* 03-08-2023 Chaoqiong Xiao Modified comment(s), */
-/* added standalone support, */
-/* resulting in version 6.2.1 */
-/* 10-31-2023 Yajun Xia Modified comment(s), */
-/* resulting in version 6.3.0 */
-/* */
/**************************************************************************/
UINT _ux_device_class_ccid_icc_insert(UX_DEVICE_CLASS_CCID *ccid, ULONG slot, ULONG seq_start)
{
@@ -160,12 +150,6 @@ UX_DEVICE_CLASS_CCID_SLOT *ccid_slot;
/* */
/* Application */
/* */
-/* RELEASE HISTORY */
-/* */
-/* DATE NAME DESCRIPTION */
-/* */
-/* 10-31-2023 Yajun Xia Initial Version 6.3.0 */
-/* */
/**************************************************************************/
UINT _uxe_device_class_ccid_icc_insert(UX_DEVICE_CLASS_CCID *ccid, ULONG slot, ULONG seq_start)
{
diff --git a/common/usbx_device_classes/src/ux_device_class_ccid_icc_remove.c b/common/usbx_device_classes/src/ux_device_class_ccid_icc_remove.c
index 5d22c562..08562caa 100644
--- a/common/usbx_device_classes/src/ux_device_class_ccid_icc_remove.c
+++ b/common/usbx_device_classes/src/ux_device_class_ccid_icc_remove.c
@@ -1,10 +1,11 @@
/***************************************************************************
- * Copyright (c) 2024 Microsoft Corporation
- *
+ * Copyright (c) 2024 Microsoft Corporation
+ * Copyright (c) 2026-present Eclipse ThreadX contributors
+ *
* This program and the accompanying materials are made available under the
* terms of the MIT License which is available at
* https://opensource.org/licenses/MIT.
- *
+ *
* SPDX-License-Identifier: MIT
**************************************************************************/
@@ -57,17 +58,6 @@
/* */
/* Application */
/* */
-/* RELEASE HISTORY */
-/* */
-/* DATE NAME DESCRIPTION */
-/* */
-/* 04-25-2022 Chaoqiong Xiao Initial Version 6.1.11 */
-/* 03-08-2023 Chaoqiong Xiao Modified comment(s), */
-/* added standalone support, */
-/* resulting in version 6.2.1 */
-/* 10-31-2023 Yajun Xia Modified comment(s), */
-/* resulting in version 6.3.0 */
-/* */
/**************************************************************************/
UINT _ux_device_class_ccid_icc_remove(UX_DEVICE_CLASS_CCID *ccid, ULONG slot)
{
@@ -152,12 +142,6 @@ UX_DEVICE_CLASS_CCID_SLOT *ccid_slot;
/* */
/* Application */
/* */
-/* RELEASE HISTORY */
-/* */
-/* DATE NAME DESCRIPTION */
-/* */
-/* 10-31-2023 Yajun Xia Initial Version 6.3.0 */
-/* */
/**************************************************************************/
UINT _uxe_device_class_ccid_icc_remove(UX_DEVICE_CLASS_CCID *ccid, ULONG slot)
{
diff --git a/common/usbx_device_classes/src/ux_device_class_ccid_initialize.c b/common/usbx_device_classes/src/ux_device_class_ccid_initialize.c
index f3f07746..0e6d647d 100644
--- a/common/usbx_device_classes/src/ux_device_class_ccid_initialize.c
+++ b/common/usbx_device_classes/src/ux_device_class_ccid_initialize.c
@@ -1,10 +1,11 @@
/***************************************************************************
- * Copyright (c) 2024 Microsoft Corporation
- *
+ * Copyright (c) 2024 Microsoft Corporation
+ * Copyright (c) 2026-present Eclipse ThreadX contributors
+ *
* This program and the accompanying materials are made available under the
* terms of the MIT License which is available at
* https://opensource.org/licenses/MIT.
- *
+ *
* SPDX-License-Identifier: MIT
**************************************************************************/
@@ -66,19 +67,6 @@
/* */
/* USBX Source Code */
/* */
-/* RELEASE HISTORY */
-/* */
-/* DATE NAME DESCRIPTION */
-/* */
-/* 04-25-2022 Chaoqiong Xiao Initial Version 6.1.11 */
-/* 03-08-2023 Chaoqiong Xiao Modified comment(s), */
-/* added standalone support, */
-/* resulting in version 6.2.1 */
-/* 10-31-2023 Chaoqiong Xiao Modified comment(s), */
-/* added a new mode to manage */
-/* endpoint buffer in classes, */
-/* resulting in version 6.3.0 */
-/* */
/**************************************************************************/
UINT _ux_device_class_ccid_initialize(UX_SLAVE_CLASS_COMMAND *command)
{
diff --git a/common/usbx_device_classes/src/ux_device_class_ccid_notify_task_run.c b/common/usbx_device_classes/src/ux_device_class_ccid_notify_task_run.c
index d974dfb2..e93d45c6 100644
--- a/common/usbx_device_classes/src/ux_device_class_ccid_notify_task_run.c
+++ b/common/usbx_device_classes/src/ux_device_class_ccid_notify_task_run.c
@@ -1,10 +1,11 @@
/***************************************************************************
- * Copyright (c) 2024 Microsoft Corporation
- *
+ * Copyright (c) 2024 Microsoft Corporation
+ * Copyright (c) 2026-present Eclipse ThreadX contributors
+ *
* This program and the accompanying materials are made available under the
* terms of the MIT License which is available at
* https://opensource.org/licenses/MIT.
- *
+ *
* SPDX-License-Identifier: MIT
**************************************************************************/
@@ -65,12 +66,6 @@
/* */
/* USBX Device Stack */
/* */
-/* RELEASE HISTORY */
-/* */
-/* DATE NAME DESCRIPTION */
-/* */
-/* 03-08-2023 Chaoqiong Xiao Initial Version 6.2.1 */
-/* */
/**************************************************************************/
UINT _ux_device_class_ccid_notify_task_run(UX_DEVICE_CLASS_CCID *ccid)
{
diff --git a/common/usbx_device_classes/src/ux_device_class_ccid_notify_thread_entry.c b/common/usbx_device_classes/src/ux_device_class_ccid_notify_thread_entry.c
index f24ba98d..98edd4d7 100644
--- a/common/usbx_device_classes/src/ux_device_class_ccid_notify_thread_entry.c
+++ b/common/usbx_device_classes/src/ux_device_class_ccid_notify_thread_entry.c
@@ -1,10 +1,11 @@
/***************************************************************************
- * Copyright (c) 2024 Microsoft Corporation
- *
+ * Copyright (c) 2024 Microsoft Corporation
+ * Copyright (c) 2026-present Eclipse ThreadX contributors
+ *
* This program and the accompanying materials are made available under the
* terms of the MIT License which is available at
* https://opensource.org/licenses/MIT.
- *
+ *
* SPDX-License-Identifier: MIT
**************************************************************************/
@@ -62,15 +63,6 @@
/* */
/* ThreadX */
/* */
-/* RELEASE HISTORY */
-/* */
-/* DATE NAME DESCRIPTION */
-/* */
-/* 04-25-2022 Chaoqiong Xiao Initial Version 6.1.11 */
-/* 03-08-2023 Chaoqiong Xiao Modified comment(s), */
-/* added standalone support, */
-/* resulting in version 6.2.1 */
-/* */
/**************************************************************************/
VOID _ux_device_class_ccid_notify_thread_entry(ULONG ccid_inst)
{
diff --git a/common/usbx_device_classes/src/ux_device_class_ccid_response.c b/common/usbx_device_classes/src/ux_device_class_ccid_response.c
index 3306628b..ece56604 100644
--- a/common/usbx_device_classes/src/ux_device_class_ccid_response.c
+++ b/common/usbx_device_classes/src/ux_device_class_ccid_response.c
@@ -1,10 +1,11 @@
/***************************************************************************
- * Copyright (c) 2024 Microsoft Corporation
- *
+ * Copyright (c) 2024 Microsoft Corporation
+ * Copyright (c) 2026-present Eclipse ThreadX contributors
+ *
* This program and the accompanying materials are made available under the
* terms of the MIT License which is available at
* https://opensource.org/licenses/MIT.
- *
+ *
* SPDX-License-Identifier: MIT
**************************************************************************/
@@ -58,15 +59,6 @@
/* */
/* USBX Source Code */
/* */
-/* RELEASE HISTORY */
-/* */
-/* DATE NAME DESCRIPTION */
-/* */
-/* 04-25-2022 Chaoqiong Xiao Initial Version 6.1.11 */
-/* 03-08-2023 Chaoqiong Xiao Modified comment(s), */
-/* added standalone support, */
-/* resulting in version 6.2.1 */
-/* */
/**************************************************************************/
UINT _ux_device_class_ccid_response(UX_DEVICE_CLASS_CCID *ccid, UCHAR *buffer, ULONG length)
{
diff --git a/common/usbx_device_classes/src/ux_device_class_ccid_runner_task_run.c b/common/usbx_device_classes/src/ux_device_class_ccid_runner_task_run.c
index c947192d..054d16ef 100644
--- a/common/usbx_device_classes/src/ux_device_class_ccid_runner_task_run.c
+++ b/common/usbx_device_classes/src/ux_device_class_ccid_runner_task_run.c
@@ -1,10 +1,11 @@
/***************************************************************************
- * Copyright (c) 2024 Microsoft Corporation
- *
+ * Copyright (c) 2024 Microsoft Corporation
+ * Copyright (c) 2026-present Eclipse ThreadX contributors
+ *
* This program and the accompanying materials are made available under the
* terms of the MIT License which is available at
* https://opensource.org/licenses/MIT.
- *
+ *
* SPDX-License-Identifier: MIT
**************************************************************************/
@@ -65,12 +66,6 @@
/* */
/* USBX Device Stack */
/* */
-/* RELEASE HISTORY */
-/* */
-/* DATE NAME DESCRIPTION */
-/* */
-/* 03-08-2023 Chaoqiong Xiao Initial Version 6.2.1 */
-/* */
/**************************************************************************/
UINT _ux_device_class_ccid_runner_task_run(UX_DEVICE_CLASS_CCID *ccid)
{
diff --git a/common/usbx_device_classes/src/ux_device_class_ccid_runner_thread_entry.c b/common/usbx_device_classes/src/ux_device_class_ccid_runner_thread_entry.c
index c4033e85..2ae0bc37 100644
--- a/common/usbx_device_classes/src/ux_device_class_ccid_runner_thread_entry.c
+++ b/common/usbx_device_classes/src/ux_device_class_ccid_runner_thread_entry.c
@@ -1,10 +1,11 @@
/***************************************************************************
- * Copyright (c) 2024 Microsoft Corporation
- *
+ * Copyright (c) 2024 Microsoft Corporation
+ * Copyright (c) 2026-present Eclipse ThreadX contributors
+ *
* This program and the accompanying materials are made available under the
* terms of the MIT License which is available at
* https://opensource.org/licenses/MIT.
- *
+ *
* SPDX-License-Identifier: MIT
**************************************************************************/
@@ -60,15 +61,6 @@
/* */
/* ThreadX */
/* */
-/* RELEASE HISTORY */
-/* */
-/* DATE NAME DESCRIPTION */
-/* */
-/* 04-25-2022 Chaoqiong Xiao Initial Version 6.1.11 */
-/* 03-08-2023 Chaoqiong Xiao Modified comment(s), */
-/* added standalone support, */
-/* resulting in version 6.2.1 */
-/* */
/**************************************************************************/
VOID _ux_device_class_ccid_runner_thread_entry(ULONG ccid_runner)
{
diff --git a/common/usbx_device_classes/src/ux_device_class_ccid_tasks_run.c b/common/usbx_device_classes/src/ux_device_class_ccid_tasks_run.c
index 730e65e7..be24506f 100644
--- a/common/usbx_device_classes/src/ux_device_class_ccid_tasks_run.c
+++ b/common/usbx_device_classes/src/ux_device_class_ccid_tasks_run.c
@@ -1,10 +1,11 @@
/***************************************************************************
- * Copyright (c) 2024 Microsoft Corporation
- *
+ * Copyright (c) 2024 Microsoft Corporation
+ * Copyright (c) 2026-present Eclipse ThreadX contributors
+ *
* This program and the accompanying materials are made available under the
* terms of the MIT License which is available at
* https://opensource.org/licenses/MIT.
- *
+ *
* SPDX-License-Identifier: MIT
**************************************************************************/
@@ -70,12 +71,6 @@ static inline UINT _ux_device_class_ccid_rsp_task(UX_DEVICE_CLASS_CCID *ccid);
/* */
/* USBX Device Stack */
/* */
-/* RELEASE HISTORY */
-/* */
-/* DATE NAME DESCRIPTION */
-/* */
-/* 03-08-2023 Chaoqiong Xiao Initial Version 6.2.1 */
-/* */
/**************************************************************************/
UINT _ux_device_class_ccid_tasks_run(VOID *instance)
{
diff --git a/common/usbx_device_classes/src/ux_device_class_ccid_thread_entry.c b/common/usbx_device_classes/src/ux_device_class_ccid_thread_entry.c
index b341b1ac..398dc34c 100644
--- a/common/usbx_device_classes/src/ux_device_class_ccid_thread_entry.c
+++ b/common/usbx_device_classes/src/ux_device_class_ccid_thread_entry.c
@@ -1,10 +1,11 @@
/***************************************************************************
- * Copyright (c) 2024 Microsoft Corporation
- *
+ * Copyright (c) 2024 Microsoft Corporation
+ * Copyright (c) 2026-present Eclipse ThreadX contributors
+ *
* This program and the accompanying materials are made available under the
* terms of the MIT License which is available at
* https://opensource.org/licenses/MIT.
- *
+ *
* SPDX-License-Identifier: MIT
**************************************************************************/
@@ -62,15 +63,6 @@
/* */
/* ThreadX */
/* */
-/* RELEASE HISTORY */
-/* */
-/* DATE NAME DESCRIPTION */
-/* */
-/* 04-25-2022 Chaoqiong Xiao Initial Version 6.1.11 */
-/* 03-08-2023 Chaoqiong Xiao Modified comment(s), */
-/* added standalone support, */
-/* resulting in version 6.2.1 */
-/* */
/**************************************************************************/
VOID _ux_device_class_ccid_thread_entry(ULONG ccid_inst)
{
diff --git a/common/usbx_device_classes/src/ux_device_class_ccid_time_extension.c b/common/usbx_device_classes/src/ux_device_class_ccid_time_extension.c
index bd3bf43a..cd2ac18c 100644
--- a/common/usbx_device_classes/src/ux_device_class_ccid_time_extension.c
+++ b/common/usbx_device_classes/src/ux_device_class_ccid_time_extension.c
@@ -1,10 +1,11 @@
/***************************************************************************
- * Copyright (c) 2024 Microsoft Corporation
- *
+ * Copyright (c) 2024 Microsoft Corporation
+ * Copyright (c) 2026-present Eclipse ThreadX contributors
+ *
* This program and the accompanying materials are made available under the
* terms of the MIT License which is available at
* https://opensource.org/licenses/MIT.
- *
+ *
* SPDX-License-Identifier: MIT
**************************************************************************/
@@ -58,14 +59,6 @@
/* */
/* Application */
/* */
-/* RELEASE HISTORY */
-/* */
-/* DATE NAME DESCRIPTION */
-/* */
-/* 04-25-2022 Chaoqiong Xiao Initial Version 6.1.11 */
-/* 10-31-2023 Yajun Xia Modified comment(s), */
-/* resulting in version 6.3.0 */
-/* */
/**************************************************************************/
UINT _ux_device_class_ccid_time_extension(UX_DEVICE_CLASS_CCID *ccid, ULONG slot, ULONG wt)
{
@@ -162,12 +155,6 @@ UINT status;
/* */
/* Application */
/* */
-/* RELEASE HISTORY */
-/* */
-/* DATE NAME DESCRIPTION */
-/* */
-/* 10-31-2023 Yajun Xia Initial Version 6.3.0 */
-/* */
/**************************************************************************/
UINT _uxe_device_class_ccid_time_extension(UX_DEVICE_CLASS_CCID *ccid, ULONG slot, ULONG wt)
{
diff --git a/common/usbx_device_classes/src/ux_device_class_ccid_uninitialize.c b/common/usbx_device_classes/src/ux_device_class_ccid_uninitialize.c
index 3f37113c..570ec41c 100644
--- a/common/usbx_device_classes/src/ux_device_class_ccid_uninitialize.c
+++ b/common/usbx_device_classes/src/ux_device_class_ccid_uninitialize.c
@@ -1,10 +1,11 @@
/***************************************************************************
- * Copyright (c) 2024 Microsoft Corporation
- *
+ * Copyright (c) 2024 Microsoft Corporation
+ * Copyright (c) 2026-present Eclipse ThreadX contributors
+ *
* This program and the accompanying materials are made available under the
* terms of the MIT License which is available at
* https://opensource.org/licenses/MIT.
- *
+ *
* SPDX-License-Identifier: MIT
**************************************************************************/
@@ -60,16 +61,6 @@
/* */
/* USBX Source Code */
/* */
-/* RELEASE HISTORY */
-/* */
-/* DATE NAME DESCRIPTION */
-/* */
-/* 04-25-2022 Chaoqiong Xiao Initial Version 6.1.11 */
-/* 10-31-2023 Chaoqiong Xiao Modified comment(s), */
-/* added a new mode to manage */
-/* endpoint buffer in classes, */
-/* resulting in version 6.3.0 */
-/* */
/**************************************************************************/
UINT _ux_device_class_ccid_uninitialize(UX_SLAVE_CLASS_COMMAND *command)
{
diff --git a/common/usbx_device_classes/src/ux_device_class_cdc_acm_activate.c b/common/usbx_device_classes/src/ux_device_class_cdc_acm_activate.c
index 26e64d43..59b9bdd3 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
@@ -1,16 +1,17 @@
/***************************************************************************
- * Copyright (c) 2024 Microsoft Corporation
- *
+ * Copyright (c) 2024 Microsoft Corporation
+ * Copyright (c) 2026-present Eclipse ThreadX contributors
+ *
* This program and the accompanying materials are made available under the
* terms of the MIT License which is available at
* https://opensource.org/licenses/MIT.
- *
+ *
* SPDX-License-Identifier: MIT
**************************************************************************/
/**************************************************************************/
-/** */
-/** USBX Component */
+/** */
+/** USBX Component */
/** */
/** Device CDC Class */
/** */
@@ -27,53 +28,41 @@
#include "ux_device_stack.h"
-/**************************************************************************/
-/* */
-/* FUNCTION RELEASE */
-/* */
-/* _ux_device_class_cdc_acm_activate PORTABLE C */
+/**************************************************************************/
+/* */
+/* FUNCTION RELEASE */
+/* */
+/* _ux_device_class_cdc_acm_activate PORTABLE C */
/* 6.1.12 */
/* AUTHOR */
/* */
/* Chaoqiong Xiao, Microsoft Corporation */
/* */
/* DESCRIPTION */
-/* */
-/* This function initializes the USB CDC device. */
-/* */
-/* INPUT */
-/* */
-/* command Pointer to cdc_acm command */
-/* */
-/* OUTPUT */
-/* */
-/* Completion Status */
-/* */
-/* CALLS */
-/* */
+/* */
+/* This function initializes the USB CDC device. */
+/* */
+/* INPUT */
+/* */
+/* command Pointer to cdc_acm command */
+/* */
+/* OUTPUT */
+/* */
+/* Completion Status */
+/* */
+/* CALLS */
+/* */
/* None */
-/* */
-/* CALLED BY */
-/* */
-/* USBX Source Code */
-/* */
-/* RELEASE HISTORY */
-/* */
-/* DATE NAME DESCRIPTION */
-/* */
-/* 05-19-2020 Chaoqiong Xiao Initial Version 6.0 */
-/* 09-30-2020 Chaoqiong Xiao Modified comment(s), */
-/* resulting in version 6.1 */
-/* 07-29-2022 Chaoqiong Xiao Modified comment(s), */
-/* fixed parameter/variable */
-/* names conflict C++ keyword, */
-/* resulting in version 6.1.12 */
+/* */
+/* CALLED BY */
+/* */
+/* USBX Source Code */
/* */
/**************************************************************************/
UINT _ux_device_class_cdc_acm_activate(UX_SLAVE_CLASS_COMMAND *command)
{
-
-UX_SLAVE_INTERFACE *interface_ptr;
+
+UX_SLAVE_INTERFACE *interface_ptr;
UX_SLAVE_CLASS *class_ptr;
UX_SLAVE_CLASS_CDC_ACM *cdc_acm;
@@ -85,16 +74,16 @@ UX_SLAVE_CLASS_CDC_ACM *cdc_acm;
/* Get the interface that owns this instance. */
interface_ptr = (UX_SLAVE_INTERFACE *) command -> ux_slave_class_command_interface;
-
+
/* Store the class instance into the interface. */
interface_ptr -> ux_slave_interface_class_instance = (VOID *)cdc_acm;
-
+
/* Now the opposite, store the interface in the class instance. */
cdc_acm -> ux_slave_class_cdc_acm_interface = interface_ptr;
/* If there is a activate function call it. */
if (cdc_acm -> ux_slave_class_cdc_acm_parameter.ux_slave_class_cdc_acm_instance_activate != UX_NULL)
- {
+ {
/* Invoke the application. */
cdc_acm -> ux_slave_class_cdc_acm_parameter.ux_slave_class_cdc_acm_instance_activate(cdc_acm);
}
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 9836247a..b20f1620 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
@@ -1,10 +1,11 @@
/***************************************************************************
- * Copyright (c) 2024 Microsoft Corporation
- *
+ * Copyright (c) 2024 Microsoft Corporation
+ * Copyright (c) 2026-present Eclipse ThreadX contributors
+ *
* This program and the accompanying materials are made available under the
* terms of the MIT License which is available at
* https://opensource.org/licenses/MIT.
- *
+ *
* SPDX-License-Identifier: MIT
**************************************************************************/
@@ -64,39 +65,6 @@
/* */
/* ThreadX */
/* */
-/* RELEASE HISTORY */
-/* */
-/* DATE NAME DESCRIPTION */
-/* */
-/* 05-19-2020 Chaoqiong Xiao Initial Version 6.0 */
-/* 09-30-2020 Chaoqiong Xiao Modified comment(s), */
-/* verified memset and memcpy */
-/* cases, used UX prefix to */
-/* refer to TX symbols instead */
-/* of using them directly, */
-/* resulting in version 6.1 */
-/* 04-02-2021 Chaoqiong Xiao Modified comment(s), */
-/* added macro to disable */
-/* transmission support, */
-/* resulting in version 6.1.6 */
-/* 01-31-2022 Chaoqiong Xiao Modified comment(s), */
-/* refined macros names, */
-/* resulting in version 6.1.10 */
-/* 04-25-2022 Chaoqiong Xiao Modified comment(s), */
-/* used whole buffer for write,*/
-/* refined macros names, */
-/* resulting in version 6.1.11 */
-/* 07-29-2022 Chaoqiong Xiao Modified comment(s), */
-/* fixed parameter/variable */
-/* names conflict C++ keyword, */
-/* added auto ZLP support, */
-/* resulting in version 6.1.12 */
-/* 10-31-2023 Chaoqiong Xiao Modified comment(s), */
-/* added zero copy support, */
-/* added a new mode to manage */
-/* endpoint buffer in classes, */
-/* resulting in version 6.3.0 */
-/* */
/**************************************************************************/
VOID _ux_device_class_cdc_acm_bulkin_thread(ULONG cdc_acm_class)
{
diff --git a/common/usbx_device_classes/src/ux_device_class_cdc_acm_bulkout_thread.c b/common/usbx_device_classes/src/ux_device_class_cdc_acm_bulkout_thread.c
index 28c15a22..9df51575 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
@@ -1,10 +1,11 @@
/***************************************************************************
- * Copyright (c) 2024 Microsoft Corporation
- *
+ * Copyright (c) 2024 Microsoft Corporation
+ * Copyright (c) 2026-present Eclipse ThreadX contributors
+ *
* This program and the accompanying materials are made available under the
* terms of the MIT License which is available at
* https://opensource.org/licenses/MIT.
- *
+ *
* SPDX-License-Identifier: MIT
**************************************************************************/
@@ -64,30 +65,6 @@
/* */
/* ThreadX */
/* */
-/* RELEASE HISTORY */
-/* */
-/* DATE NAME DESCRIPTION */
-/* */
-/* 05-19-2020 Chaoqiong Xiao Initial Version 6.0 */
-/* 09-30-2020 Chaoqiong Xiao Modified comment(s), */
-/* resulting in version 6.1 */
-/* 04-02-2021 Chaoqiong Xiao Modified comment(s), */
-/* added macro to disable */
-/* transmission support, */
-/* resulting in version 6.1.6 */
-/* 01-31-2022 Chaoqiong Xiao Modified comment(s), */
-/* refined macros names, */
-/* resulting in version 6.1.10 */
-/* 07-29-2022 Chaoqiong Xiao Modified comment(s), */
-/* fixed parameter/variable */
-/* names conflict C++ keyword, */
-/* resulting in version 6.1.12 */
-/* 10-31-2023 Chaoqiong Xiao Modified comment(s), */
-/* added zero copy support, */
-/* added a new mode to manage */
-/* endpoint buffer in classes, */
-/* resulting in version 6.3.0 */
-/* */
/**************************************************************************/
VOID _ux_device_class_cdc_acm_bulkout_thread(ULONG cdc_acm_class)
{
diff --git a/common/usbx_device_classes/src/ux_device_class_cdc_acm_control_request.c b/common/usbx_device_classes/src/ux_device_class_cdc_acm_control_request.c
index 0660bf29..12b40308 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
@@ -1,17 +1,18 @@
/***************************************************************************
- * Copyright (c) 2024 Microsoft Corporation
- *
+ * Copyright (c) 2024 Microsoft Corporation
+ * Copyright (c) 2026-present Eclipse ThreadX contributors
+ *
* This program and the accompanying materials are made available under the
* terms of the MIT License which is available at
* https://opensource.org/licenses/MIT.
- *
+ *
* SPDX-License-Identifier: MIT
**************************************************************************/
/**************************************************************************/
/**************************************************************************/
-/** */
-/** USBX Component */
+/** */
+/** USBX Component */
/** */
/** Device CDC Class */
/** */
@@ -28,48 +29,36 @@
#include "ux_device_stack.h"
-/**************************************************************************/
-/* */
-/* FUNCTION RELEASE */
-/* */
-/* _ux_device_class_cdc_acm_control_request PORTABLE C */
+/**************************************************************************/
+/* */
+/* FUNCTION RELEASE */
+/* */
+/* _ux_device_class_cdc_acm_control_request PORTABLE C */
/* 6.1.12 */
/* AUTHOR */
/* */
/* Chaoqiong Xiao, Microsoft Corporation */
/* */
/* DESCRIPTION */
-/* */
-/* This function manages the based sent by the host on the control */
-/* endpoints with a CLASS or VENDOR SPECIFIC type. */
-/* */
-/* INPUT */
-/* */
-/* cdc_acm Pointer to cdc_acm class */
-/* */
-/* OUTPUT */
-/* */
-/* None */
-/* */
-/* CALLS */
-/* */
-/* _ux_device_stack_transfer_request Transfer request */
-/* */
-/* CALLED BY */
-/* */
+/* */
+/* This function manages the based sent by the host on the control */
+/* endpoints with a CLASS or VENDOR SPECIFIC type. */
+/* */
+/* INPUT */
+/* */
+/* cdc_acm Pointer to cdc_acm class */
+/* */
+/* OUTPUT */
+/* */
+/* None */
+/* */
+/* CALLS */
+/* */
+/* _ux_device_stack_transfer_request Transfer request */
+/* */
+/* CALLED BY */
+/* */
/* CDC Class */
-/* */
-/* RELEASE HISTORY */
-/* */
-/* DATE NAME DESCRIPTION */
-/* */
-/* 05-19-2020 Chaoqiong Xiao Initial Version 6.0 */
-/* 09-30-2020 Chaoqiong Xiao Modified comment(s), */
-/* resulting in version 6.1 */
-/* 07-29-2022 Chaoqiong Xiao Modified comment(s), */
-/* fixed parameter/variable */
-/* names conflict C++ keyword, */
-/* resulting in version 6.1.12 */
/* */
/**************************************************************************/
UINT _ux_device_class_cdc_acm_control_request(UX_SLAVE_CLASS_COMMAND *command)
@@ -105,7 +94,7 @@ ULONG transmit_length;
request_length = _ux_utility_short_get(transfer_request -> ux_slave_transfer_request_setup + UX_SETUP_LENGTH);
transmit_length = request_length ;
-
+
/* Here we proceed only the standard request we know of at the device level. */
switch (request)
{
@@ -118,16 +107,16 @@ ULONG transmit_length;
/* Get the line state parameters from the host. DTR signal. */
if (value & UX_SLAVE_CLASS_CDC_ACM_LINE_STATE_DTR)
- cdc_acm -> ux_slave_class_cdc_acm_data_dtr_state = UX_TRUE;
+ cdc_acm -> ux_slave_class_cdc_acm_data_dtr_state = UX_TRUE;
/* Get the line state parameters from the host. RTS signal. */
if (value & UX_SLAVE_CLASS_CDC_ACM_LINE_STATE_RTS)
- cdc_acm -> ux_slave_class_cdc_acm_data_rts_state = UX_TRUE;
-
+ cdc_acm -> ux_slave_class_cdc_acm_data_rts_state = UX_TRUE;
+
/* If there is a parameter change function call it. */
if (cdc_acm -> ux_slave_class_cdc_acm_parameter.ux_slave_class_cdc_acm_parameter_change != UX_NULL)
- {
-
+ {
+
/* Invoke the application. */
cdc_acm -> ux_slave_class_cdc_acm_parameter.ux_slave_class_cdc_acm_parameter_change(cdc_acm);
}
@@ -137,11 +126,11 @@ ULONG transmit_length;
case UX_SLAVE_CLASS_CDC_ACM_GET_LINE_CODING:
/* Setup the length appropriately. */
- if (request_length > UX_SLAVE_CLASS_CDC_ACM_LINE_CODING_RESPONSE_SIZE)
+ if (request_length > UX_SLAVE_CLASS_CDC_ACM_LINE_CODING_RESPONSE_SIZE)
transmit_length = UX_SLAVE_CLASS_CDC_ACM_LINE_CODING_RESPONSE_SIZE;
-
+
/* Send the line coding default parameters back to the host. */
- _ux_utility_long_put(transfer_request -> ux_slave_transfer_request_data_pointer + UX_SLAVE_CLASS_CDC_ACM_LINE_CODING_BAUDRATE_STRUCT,
+ _ux_utility_long_put(transfer_request -> ux_slave_transfer_request_data_pointer + UX_SLAVE_CLASS_CDC_ACM_LINE_CODING_BAUDRATE_STRUCT,
cdc_acm -> ux_slave_class_cdc_acm_baudrate);
*(transfer_request -> ux_slave_transfer_request_data_pointer + UX_SLAVE_CLASS_CDC_ACM_LINE_CODING_STOP_BIT_STRUCT) = cdc_acm -> ux_slave_class_cdc_acm_stop_bit;
*(transfer_request -> ux_slave_transfer_request_data_pointer + UX_SLAVE_CLASS_CDC_ACM_LINE_CODING_PARITY_STRUCT) = cdc_acm -> ux_slave_class_cdc_acm_parity;
@@ -149,11 +138,11 @@ ULONG transmit_length;
/* Set the phase of the transfer to data out. */
transfer_request -> ux_slave_transfer_request_phase = UX_TRANSFER_PHASE_DATA_OUT;
-
+
/* Perform the data transfer. */
_ux_device_stack_transfer_request(transfer_request, transmit_length, request_length);
- break;
-
+ break;
+
case UX_SLAVE_CLASS_CDC_ACM_SET_LINE_CODING:
/* Get the line coding parameters from the host. */
@@ -164,8 +153,8 @@ ULONG transmit_length;
/* If there is a parameter change function call it. */
if (cdc_acm -> ux_slave_class_cdc_acm_parameter.ux_slave_class_cdc_acm_parameter_change != UX_NULL)
- {
-
+ {
+
/* Invoke the application. */
cdc_acm -> ux_slave_class_cdc_acm_parameter.ux_slave_class_cdc_acm_parameter_change(cdc_acm);
}
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 fe3f510c..f05e035e 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
@@ -1,17 +1,18 @@
/***************************************************************************
- * Copyright (c) 2024 Microsoft Corporation
- *
+ * Copyright (c) 2024 Microsoft Corporation
+ * Copyright (c) 2026-present Eclipse ThreadX contributors
+ *
* This program and the accompanying materials are made available under the
* terms of the MIT License which is available at
* https://opensource.org/licenses/MIT.
- *
+ *
* SPDX-License-Identifier: MIT
**************************************************************************/
/**************************************************************************/
/**************************************************************************/
-/** */
-/** USBX Component */
+/** */
+/** USBX Component */
/** */
/** Device CDC Class */
/** */
@@ -28,53 +29,41 @@
#include "ux_device_stack.h"
-/**************************************************************************/
-/* */
-/* FUNCTION RELEASE */
-/* */
-/* _ux_device_class_cdc_acm_deactivate PORTABLE C */
+/**************************************************************************/
+/* */
+/* FUNCTION RELEASE */
+/* */
+/* _ux_device_class_cdc_acm_deactivate PORTABLE C */
/* 6.1.12 */
/* AUTHOR */
/* */
/* Chaoqiong Xiao, Microsoft Corporation */
/* */
/* DESCRIPTION */
-/* */
-/* This function deactivate an instance of the cdc_acm class. */
-/* */
-/* INPUT */
-/* */
-/* command Pointer to a class command */
-/* */
-/* OUTPUT */
-/* */
-/* Completion Status */
-/* */
-/* CALLS */
-/* */
-/* _ux_device_stack_transfer_all_request_abort Abort all transfers */
-/* _ux_device_class_cdc_acm_ioctl IO control */
-/* */
-/* CALLED BY */
-/* */
+/* */
+/* This function deactivate an instance of the cdc_acm class. */
+/* */
+/* INPUT */
+/* */
+/* command Pointer to a class command */
+/* */
+/* OUTPUT */
+/* */
+/* Completion Status */
+/* */
+/* CALLS */
+/* */
+/* _ux_device_stack_transfer_all_request_abort Abort all transfers */
+/* _ux_device_class_cdc_acm_ioctl IO control */
+/* */
+/* CALLED BY */
+/* */
/* CDC Class */
-/* */
-/* RELEASE HISTORY */
-/* */
-/* DATE NAME DESCRIPTION */
-/* */
-/* 05-19-2020 Chaoqiong Xiao Initial Version 6.0 */
-/* 09-30-2020 Chaoqiong Xiao Modified comment(s), */
-/* resulting in version 6.1 */
-/* 07-29-2022 Chaoqiong Xiao Modified comment(s), */
-/* fixed parameter/variable */
-/* names conflict C++ keyword, */
-/* resulting in version 6.1.12 */
/* */
/**************************************************************************/
UINT _ux_device_class_cdc_acm_deactivate(UX_SLAVE_CLASS_COMMAND *command)
{
-
+
UX_SLAVE_INTERFACE *interface_ptr;
UX_SLAVE_CLASS *class_ptr;
UX_SLAVE_CLASS_CDC_ACM *cdc_acm;
@@ -89,17 +78,17 @@ UX_SLAVE_ENDPOINT *endpoint_out;
/* We need the interface to the class. */
interface_ptr = cdc_acm -> ux_slave_class_cdc_acm_interface;
-
+
/* Locate the endpoints. */
endpoint_in = interface_ptr -> ux_slave_interface_first_endpoint;
-
+
/* Check the endpoint direction, if IN we have the correct endpoint. */
if ((endpoint_in -> ux_slave_endpoint_descriptor.bEndpointAddress & UX_ENDPOINT_DIRECTION) != UX_ENDPOINT_IN)
{
/* Wrong direction, we found the OUT endpoint first. */
endpoint_out = endpoint_in;
-
+
/* So the next endpoint has to be the IN endpoint. */
endpoint_in = endpoint_out -> ux_slave_endpoint_next_endpoint;
}
@@ -109,7 +98,7 @@ UX_SLAVE_ENDPOINT *endpoint_out;
/* We found the endpoint IN first, so next endpoint is OUT. */
endpoint_out = endpoint_in -> ux_slave_endpoint_next_endpoint;
}
-
+
/* Terminate the transactions pending on the endpoints. */
_ux_device_stack_transfer_all_request_abort(endpoint_in, UX_TRANSFER_BUS_RESET);
_ux_device_stack_transfer_all_request_abort(endpoint_out, UX_TRANSFER_BUS_RESET);
@@ -125,7 +114,7 @@ UX_SLAVE_ENDPOINT *endpoint_out;
cdc_acm -> ux_slave_class_cdc_acm_parameter.ux_slave_class_cdc_acm_instance_deactivate(cdc_acm);
}
- /* We need to reset the DTR and RTS values so they do not carry over to the
+ /* We need to reset the DTR and RTS values so they do not carry over to the
next connection. */
cdc_acm -> ux_slave_class_cdc_acm_data_dtr_state = 0;
cdc_acm -> ux_slave_class_cdc_acm_data_rts_state = 0;
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 ea519105..f3a8bce3 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
@@ -1,5 +1,6 @@
/***************************************************************************
* Copyright (c) 2024 Microsoft Corporation
+ * Copyright (c) 2026-present Eclipse ThreadX contributors
*
* This program and the accompanying materials are made available under the
* terms of the MIT License which is available at
@@ -65,18 +66,6 @@
/* */
/* CDC Class */
/* */
-/* RELEASE HISTORY */
-/* */
-/* DATE NAME DESCRIPTION */
-/* */
-/* 05-19-2020 Chaoqiong Xiao Initial Version 6.0 */
-/* 09-30-2020 Chaoqiong Xiao Modified comment(s), */
-/* resulting in version 6.1 */
-/* xx-xx-xxxx Mohamed ayed Modified comment(s), */
-/* fix typo, */
-/* remove extra spaces, */
-/* resulting in version 6.x */
-/* */
/**************************************************************************/
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 20066a72..6330aa61 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
@@ -1,16 +1,17 @@
/***************************************************************************
- * Copyright (c) 2024 Microsoft Corporation
- *
+ * Copyright (c) 2024 Microsoft Corporation
+ * Copyright (c) 2026-present Eclipse ThreadX contributors
+ *
* This program and the accompanying materials are made available under the
* terms of the MIT License which is available at
* https://opensource.org/licenses/MIT.
- *
+ *
* SPDX-License-Identifier: MIT
**************************************************************************/
/**************************************************************************/
-/** */
-/** USBX Component */
+/** */
+/** USBX Component */
/** */
/** Device CDC Class */
/** */
@@ -31,71 +32,43 @@
#error UX_THREAD_STACK_SIZE too large
#endif
-/**************************************************************************/
-/* */
-/* FUNCTION RELEASE */
-/* */
-/* _ux_device_class_cdc_acm_initialize PORTABLE C */
+/**************************************************************************/
+/* */
+/* FUNCTION RELEASE */
+/* */
+/* _ux_device_class_cdc_acm_initialize PORTABLE C */
/* 6.3.0 */
/* AUTHOR */
/* */
/* Chaoqiong Xiao, Microsoft Corporation */
/* */
/* DESCRIPTION */
-/* */
-/* This function initializes the USB CDC device. */
-/* */
-/* INPUT */
-/* */
-/* command Pointer to cdc_acm command */
-/* */
-/* OUTPUT */
-/* */
-/* Completion Status */
-/* */
-/* CALLS */
-/* */
-/* _ux_utility_memory_allocate Allocate memory */
-/* _ux_utility_memory_free Free memory */
-/* _ux_utility_mutex_create Create mutex */
-/* _ux_device_mutex_delete Delete mutex */
-/* */
-/* CALLED BY */
-/* */
-/* USBX Source Code */
-/* */
-/* RELEASE HISTORY */
-/* */
-/* DATE NAME DESCRIPTION */
-/* */
-/* 05-19-2020 Chaoqiong Xiao Initial Version 6.0 */
-/* 09-30-2020 Chaoqiong Xiao Modified comment(s), */
-/* resulting in version 6.1 */
-/* 04-02-2021 Chaoqiong Xiao Modified comment(s), */
-/* added macro to disable */
-/* transmission support, */
-/* moved transmission resource */
-/* allocate to here (init), */
-/* resulting in version 6.1.6 */
-/* 01-31-2022 Chaoqiong Xiao Modified comment(s), */
-/* added standalone support, */
-/* resulting in version 6.1.10 */
-/* 04-25-2022 Chaoqiong Xiao Modified comment(s), */
-/* resulting in version 6.1.11 */
-/* 07-29-2022 Chaoqiong Xiao Modified comment(s), */
-/* fixed parameter/variable */
-/* names conflict C++ keyword, */
-/* resulting in version 6.1.12 */
-/* 10-31-2023 Chaoqiong Xiao Modified comment(s), */
-/* added zero copy support, */
-/* added a new mode to manage */
-/* endpoint buffer in classes, */
-/* resulting in version 6.3.0 */
+/* */
+/* This function initializes the USB CDC device. */
+/* */
+/* INPUT */
+/* */
+/* command Pointer to cdc_acm command */
+/* */
+/* OUTPUT */
+/* */
+/* Completion Status */
+/* */
+/* CALLS */
+/* */
+/* _ux_utility_memory_allocate Allocate memory */
+/* _ux_utility_memory_free Free memory */
+/* _ux_utility_mutex_create Create mutex */
+/* _ux_device_mutex_delete Delete mutex */
+/* */
+/* CALLED BY */
+/* */
+/* USBX Source Code */
/* */
/**************************************************************************/
UINT _ux_device_class_cdc_acm_initialize(UX_SLAVE_CLASS_COMMAND *command)
{
-
+
UX_SLAVE_CLASS_CDC_ACM *cdc_acm;
UX_SLAVE_CLASS_CDC_ACM_PARAMETER *cdc_acm_parameter;
UX_SLAVE_CLASS *class_ptr;
@@ -132,10 +105,10 @@ UINT status;
UX_DEVICE_CLASS_CDC_ACM_ENDPOINT_BUFFER_SIZE);
if (cdc_acm -> ux_device_class_cdc_acm_endpoint_buffer == UX_NULL)
{
-
+
/* Free the resources. */
_ux_utility_memory_free(cdc_acm);
-
+
/* Return fatal error. */
return(UX_MEMORY_INSUFFICIENT);
}
@@ -155,10 +128,10 @@ UINT status;
_ux_utility_memory_free(cdc_acm -> ux_device_class_cdc_acm_endpoint_buffer);
#endif
_ux_utility_memory_free(cdc_acm);
-
+
/* Return fatal error. */
return(UX_MUTEX_ERROR);
- }
+ }
/* Out Mutex. */
status = _ux_utility_mutex_create(&cdc_acm -> ux_slave_class_cdc_acm_endpoint_out_mutex, "ux_slave_class_cdc_acm_out_mutex");
@@ -175,10 +148,10 @@ UINT status;
_ux_utility_memory_free(cdc_acm -> ux_device_class_cdc_acm_endpoint_buffer);
#endif
_ux_utility_memory_free(cdc_acm);
-
+
/* Return fatal error. */
return(UX_MUTEX_ERROR);
- }
+ }
#endif
@@ -198,7 +171,7 @@ UINT status;
/* We need to prepare the 2 threads for sending and receiving. */
/* Allocate some memory for the bulk out and in thread stack. */
- cdc_acm -> ux_slave_class_cdc_acm_bulkout_thread_stack =
+ cdc_acm -> ux_slave_class_cdc_acm_bulkout_thread_stack =
_ux_utility_memory_allocate(UX_NO_ALIGN, UX_REGULAR_MEMORY, UX_THREAD_STACK_SIZE * 2);
/* Check for successful allocation. */
@@ -236,7 +209,7 @@ UINT status;
does not start until we have a instance of the class. */
status = _ux_utility_thread_create(
&cdc_acm -> ux_slave_class_cdc_acm_bulkin_thread,
- "ux_slave_class_cdc_acm_bulkin_thread",
+ "ux_slave_class_cdc_acm_bulkin_thread",
_ux_device_class_cdc_acm_bulkin_thread,
(ULONG) (ALIGN_TYPE) cdc_acm,
(VOID *) cdc_acm -> ux_slave_class_cdc_acm_bulkin_thread_stack,
@@ -264,7 +237,7 @@ UINT status;
does not start until we have a instance of the class. */
status = _ux_utility_thread_create(
&cdc_acm -> ux_slave_class_cdc_acm_bulkout_thread,
- "ux_slave_class_cdc_acm_bulkout_thread",
+ "ux_slave_class_cdc_acm_bulkout_thread",
_ux_device_class_cdc_acm_bulkout_thread,
(ULONG) (ALIGN_TYPE) cdc_acm,
(VOID *) cdc_acm -> ux_slave_class_cdc_acm_bulkout_thread_stack,
@@ -288,9 +261,9 @@ UINT status;
{
/* Free resources and return error. */
- if (cdc_acm -> ux_slave_class_cdc_acm_bulkin_thread.tx_thread_id)
+ if (_ux_device_thread_created(&cdc_acm -> ux_slave_class_cdc_acm_bulkin_thread))
_ux_utility_thread_delete(&cdc_acm -> ux_slave_class_cdc_acm_bulkin_thread);
- if (cdc_acm -> ux_slave_class_cdc_acm_event_flags_group.tx_event_flags_group_id)
+ if (_ux_device_event_flags_created(&cdc_acm -> ux_slave_class_cdc_acm_event_flags_group))
_ux_utility_event_flags_delete(&cdc_acm -> ux_slave_class_cdc_acm_event_flags_group);
if (cdc_acm -> ux_slave_class_cdc_acm_bulkout_thread_stack)
_ux_utility_memory_free(cdc_acm -> ux_slave_class_cdc_acm_bulkout_thread_stack);
@@ -309,4 +282,3 @@ UINT status;
/* Return completion status. */
return(UX_SUCCESS);
}
-
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 852b15de..bebcf7c8 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
@@ -1,17 +1,18 @@
/***************************************************************************
- * Copyright (c) 2024 Microsoft Corporation
- *
+ * Copyright (c) 2024 Microsoft Corporation
+ * Copyright (c) 2026-present Eclipse ThreadX contributors
+ *
* This program and the accompanying materials are made available under the
* terms of the MIT License which is available at
* https://opensource.org/licenses/MIT.
- *
+ *
* SPDX-License-Identifier: MIT
**************************************************************************/
/**************************************************************************/
/**************************************************************************/
-/** */
-/** USBX Component */
+/** */
+/** USBX Component */
/** */
/** Device CDC Class */
/** */
@@ -28,31 +29,31 @@
#include "ux_device_stack.h"
-/**************************************************************************/
-/* */
-/* FUNCTION RELEASE */
-/* */
-/* _ux_device_class_cdc_acm_ioctl PORTABLE C */
+/**************************************************************************/
+/* */
+/* FUNCTION RELEASE */
+/* */
+/* _ux_device_class_cdc_acm_ioctl PORTABLE C */
/* 6.3.0 */
/* AUTHOR */
/* */
/* Chaoqiong Xiao, Microsoft Corporation */
/* */
/* DESCRIPTION */
-/* */
-/* This function performs certain functions on the cdc acm instance */
-/* */
-/* INPUT */
-/* */
-/* cdc_acm Address of cdc_acm class */
-/* instance */
-/* */
-/* OUTPUT */
-/* */
-/* Status */
-/* */
-/* CALLS */
-/* */
+/* */
+/* This function performs certain functions on the cdc acm instance */
+/* */
+/* INPUT */
+/* */
+/* cdc_acm Address of cdc_acm class */
+/* instance */
+/* */
+/* OUTPUT */
+/* */
+/* Status */
+/* */
+/* CALLS */
+/* */
/* _ux_device_stack_transfer_abort Abort transfer */
/* _ux_utility_memory_allocate Allocate memory */
/* _ux_utility_memory_free Free memory */
@@ -60,43 +61,10 @@
/* _ux_utility_event_flags_delete Delete event flags */
/* _ux_device_thread_create Create thread */
/* _ux_device_thread_delete Delete thread */
-/* */
-/* CALLED BY */
-/* */
+/* */
+/* 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), */
-/* used UX prefix to refer to */
-/* TX symbols instead of using */
-/* them directly, */
-/* resulting in version 6.1 */
-/* 03-02-2021 Xiuwen Cai Modified comment(s), removed */
-/* unreachable statement, */
-/* resulting in version 6.1.5 */
-/* 04-02-2021 Chaoqiong Xiao Modified comment(s), */
-/* added macro to disable */
-/* transmission support, */
-/* moved transmission resource */
-/* management to init/uninit, */
-/* resulting in version 6.1.6 */
-/* 10-15-2021 Chaoqiong Xiao Modified comment(s), */
-/* fixed compile issue, */
-/* resulting in version 6.1.9 */
-/* 01-31-2022 Chaoqiong Xiao Modified comment(s), */
-/* added standalone support, */
-/* fixed aborting return code, */
-/* resulting in version 6.1.10 */
-/* 07-29-2022 Chaoqiong Xiao Modified comment(s), */
-/* fixed parameter/variable */
-/* names conflict C++ keyword, */
-/* resulting in version 6.1.12 */
-/* 10-31-2023 Yajun Xia Modified comment(s), */
-/* resulting in version 6.3.0 */
/* */
/**************************************************************************/
UINT _ux_device_class_cdc_acm_ioctl(UX_SLAVE_CLASS_CDC_ACM *cdc_acm, ULONG ioctl_function,
@@ -121,68 +89,68 @@ UX_SLAVE_TRANSFER *transfer_request;
{
case UX_SLAVE_CLASS_CDC_ACM_IOCTL_SET_LINE_CODING:
-
+
/* Properly cast the parameter pointer. */
line_coding = (UX_SLAVE_CLASS_CDC_ACM_LINE_CODING_PARAMETER *) parameter;
-
+
/* Save the parameters in the cdc_acm function. */
cdc_acm -> ux_slave_class_cdc_acm_baudrate = line_coding -> ux_slave_class_cdc_acm_parameter_baudrate;
cdc_acm -> ux_slave_class_cdc_acm_stop_bit = line_coding -> ux_slave_class_cdc_acm_parameter_stop_bit;
cdc_acm -> ux_slave_class_cdc_acm_parity = line_coding -> ux_slave_class_cdc_acm_parameter_parity;
cdc_acm -> ux_slave_class_cdc_acm_data_bit = line_coding -> ux_slave_class_cdc_acm_parameter_data_bit;
-
+
break;
-
+
case UX_SLAVE_CLASS_CDC_ACM_IOCTL_GET_LINE_CODING:
-
+
/* Properly cast the parameter pointer. */
line_coding = (UX_SLAVE_CLASS_CDC_ACM_LINE_CODING_PARAMETER *) parameter;
-
+
/* Save the parameters in the cdc_acm function. */
line_coding -> ux_slave_class_cdc_acm_parameter_baudrate = cdc_acm -> ux_slave_class_cdc_acm_baudrate;
line_coding -> ux_slave_class_cdc_acm_parameter_stop_bit = cdc_acm -> ux_slave_class_cdc_acm_stop_bit;
line_coding -> ux_slave_class_cdc_acm_parameter_parity = cdc_acm -> ux_slave_class_cdc_acm_parity;
line_coding -> ux_slave_class_cdc_acm_parameter_data_bit = cdc_acm -> ux_slave_class_cdc_acm_data_bit;
-
+
break;
-
+
case UX_SLAVE_CLASS_CDC_ACM_IOCTL_GET_LINE_STATE:
-
+
/* Properly cast the parameter pointer. */
line_state = (UX_SLAVE_CLASS_CDC_ACM_LINE_STATE_PARAMETER *) parameter;
-
+
/* Return the DTR/RTS signals. */
line_state -> ux_slave_class_cdc_acm_parameter_rts = cdc_acm -> ux_slave_class_cdc_acm_data_rts_state;
line_state -> ux_slave_class_cdc_acm_parameter_dtr = cdc_acm -> ux_slave_class_cdc_acm_data_dtr_state;
-
+
break;
-
+
case UX_SLAVE_CLASS_CDC_ACM_IOCTL_SET_LINE_STATE:
-
+
/* Properly cast the parameter pointer. */
line_state = (UX_SLAVE_CLASS_CDC_ACM_LINE_STATE_PARAMETER *) parameter;
-
+
/* Set the DTR/RTS signals. */
cdc_acm -> ux_slave_class_cdc_acm_data_rts_state = line_state -> ux_slave_class_cdc_acm_parameter_rts;
cdc_acm -> ux_slave_class_cdc_acm_data_dtr_state = line_state -> ux_slave_class_cdc_acm_parameter_dtr;
-
+
break;
-
+
case UX_SLAVE_CLASS_CDC_ACM_IOCTL_ABORT_PIPE:
/* Get the interface from the instance. */
interface_ptr = cdc_acm -> ux_slave_class_cdc_acm_interface;
-
+
/* Locate the endpoints. */
endpoint = interface_ptr -> ux_slave_interface_first_endpoint;
-
+
/* What direction ? */
switch( (ULONG) (ALIGN_TYPE) parameter)
{
- case UX_SLAVE_CLASS_CDC_ACM_ENDPOINT_XMIT :
-
+ case UX_SLAVE_CLASS_CDC_ACM_ENDPOINT_XMIT :
+
/* Check the endpoint direction, if IN we have the correct endpoint. */
if ((endpoint -> ux_slave_endpoint_descriptor.bEndpointAddress & UX_ENDPOINT_DIRECTION) != UX_ENDPOINT_IN)
{
@@ -191,9 +159,9 @@ UX_SLAVE_TRANSFER *transfer_request;
endpoint = endpoint -> ux_slave_endpoint_next_endpoint;
}
break;
-
- case UX_SLAVE_CLASS_CDC_ACM_ENDPOINT_RCV :
-
+
+ case UX_SLAVE_CLASS_CDC_ACM_ENDPOINT_RCV :
+
/* Check the endpoint direction, if OUT we have the correct endpoint. */
if ((endpoint -> ux_slave_endpoint_descriptor.bEndpointAddress & UX_ENDPOINT_DIRECTION) != UX_ENDPOINT_OUT)
{
@@ -202,11 +170,11 @@ UX_SLAVE_TRANSFER *transfer_request;
endpoint = endpoint -> ux_slave_endpoint_next_endpoint;
}
break;
-
+
default :
-
+
/* Parameter not supported. Return an error. */
status = UX_ENDPOINT_HANDLE_UNKNOWN;
}
@@ -224,7 +192,7 @@ UX_SLAVE_TRANSFER *transfer_request;
cdc_acm -> ux_device_class_cdc_acm_read_state = UX_STATE_RESET;
#else
- /* Check the status of the transfer. */
+ /* Check the status of the transfer. */
if (transfer_request -> ux_slave_transfer_request_status == UX_TRANSFER_STATUS_PENDING)
{
@@ -252,7 +220,7 @@ UX_SLAVE_TRANSFER *transfer_request;
/* Get the transfer request associated with the endpoint. */
transfer_request = &endpoint -> ux_slave_endpoint_transfer_request;
- /* Check the status of the transfer. */
+ /* Check the status of the transfer. */
if (transfer_request -> ux_slave_transfer_request_status == UX_TRANSFER_STATUS_PENDING)
status = UX_ERROR;
else
@@ -269,9 +237,9 @@ UX_SLAVE_TRANSFER *transfer_request;
{
/* We should not to that ! */
return(UX_ERROR);
-
+
}
-
+
/* Properly cast the parameter pointer. */
callback = (UX_SLAVE_CLASS_CDC_ACM_CALLBACK_PARAMETER *) parameter;
@@ -290,34 +258,34 @@ UX_SLAVE_TRANSFER *transfer_request;
/* Declare the transmission with callback on. */
cdc_acm -> ux_slave_class_cdc_acm_transmission_status = UX_TRUE;
-
+
/* We are done here. */
return(UX_SUCCESS);
case UX_SLAVE_CLASS_CDC_ACM_IOCTL_TRANSMISSION_STOP:
-
+
/* Check if we are in callback transmission already. */
if (cdc_acm -> ux_slave_class_cdc_acm_transmission_status == UX_TRUE)
{
-
+
/* Get the interface from the instance. */
interface_ptr = cdc_acm -> ux_slave_class_cdc_acm_interface;
-
+
/* Locate the endpoints. */
endpoint = interface_ptr -> ux_slave_interface_first_endpoint;
/* Get the transfer request associated with the endpoint. */
transfer_request = &endpoint -> ux_slave_endpoint_transfer_request;
-
+
/* Abort the transfer. */
_ux_device_stack_transfer_abort(transfer_request, UX_ABORTED);
-
+
/* Next endpoint. */
endpoint = endpoint -> ux_slave_endpoint_next_endpoint;
/* Get the transfer request associated with the endpoint. */
transfer_request = &endpoint -> ux_slave_endpoint_transfer_request;
-
+
/* Abort the transfer. */
_ux_device_stack_transfer_abort(transfer_request, UX_ABORTED);
@@ -335,21 +303,21 @@ UX_SLAVE_TRANSFER *transfer_request;
cdc_acm -> ux_slave_class_cdc_acm_transmission_status = UX_FALSE;
}
else
-
+
/* We should not try to stop an non existing transmission. */
- return(UX_ERROR);
+ return(UX_ERROR);
- break;
+ break;
#endif
- default:
+ default:
/* 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, 0, 0, 0, UX_TRACE_ERRORS, 0, 0)
-
+
/* Function not supported. Return an error. */
status = UX_FUNCTION_NOT_SUPPORTED;
}
@@ -392,12 +360,6 @@ UX_SLAVE_TRANSFER *transfer_request;
/* */
/* Application */
/* */
-/* RELEASE HISTORY */
-/* */
-/* DATE NAME DESCRIPTION */
-/* */
-/* 10-31-2023 Yajun Xia Initial Version 6.3.0 */
-/* */
/**************************************************************************/
UINT _uxe_device_class_cdc_acm_ioctl(UX_SLAVE_CLASS_CDC_ACM *cdc_acm, ULONG ioctl_function,
VOID *parameter)
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 994740ac..1910bbf9 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
@@ -1,17 +1,18 @@
/***************************************************************************
- * Copyright (c) 2024 Microsoft Corporation
- *
+ * Copyright (c) 2024 Microsoft Corporation
+ * Copyright (c) 2026-present Eclipse ThreadX contributors
+ *
* This program and the accompanying materials are made available under the
* terms of the MIT License which is available at
* https://opensource.org/licenses/MIT.
- *
+ *
* SPDX-License-Identifier: MIT
**************************************************************************/
/**************************************************************************/
/**************************************************************************/
-/** */
-/** USBX Component */
+/** */
+/** USBX Component */
/** */
/** Device CDC Class */
/** */
@@ -29,74 +30,48 @@
#if !defined(UX_DEVICE_STANDALONE)
-/**************************************************************************/
-/* */
-/* FUNCTION RELEASE */
-/* */
-/* _ux_device_class_cdc_acm_read PORTABLE C */
+/**************************************************************************/
+/* */
+/* FUNCTION RELEASE */
+/* */
+/* _ux_device_class_cdc_acm_read PORTABLE C */
/* 6.3.0 */
/* AUTHOR */
/* */
/* Chaoqiong Xiao, Microsoft Corporation */
/* */
/* DESCRIPTION */
-/* */
-/* This function reads from the CDC class. */
-/* */
+/* */
+/* This function reads from the CDC class. */
+/* */
/* It's for RTOS mode. */
-/* */
-/* INPUT */
-/* */
-/* cdc_acm Address of cdc_acm class */
-/* instance */
+/* */
+/* INPUT */
+/* */
+/* cdc_acm Address of cdc_acm class */
+/* instance */
/* buffer Pointer to buffer to save */
/* received data */
/* requested_length Length of bytes to read */
/* actual_length Pointer to save number of */
/* bytes read */
-/* */
-/* OUTPUT */
-/* */
-/* None */
-/* */
-/* CALLS */
-/* */
-/* _ux_device_stack_transfer_request Transfer request */
-/* _ux_utility_memory_copy Copy memory */
-/* _ux_device_mutex_off Release mutex */
-/* */
-/* CALLED BY */
-/* */
+/* */
+/* OUTPUT */
+/* */
+/* None */
+/* */
+/* CALLS */
+/* */
+/* _ux_device_stack_transfer_request Transfer request */
+/* _ux_utility_memory_copy Copy memory */
+/* _ux_device_mutex_off Release mutex */
+/* */
+/* CALLED BY */
+/* */
/* Application */
-/* */
-/* RELEASE HISTORY */
-/* */
-/* DATE NAME DESCRIPTION */
-/* */
-/* 05-19-2020 Chaoqiong Xiao Initial Version 6.0 */
-/* 09-30-2020 Chaoqiong Xiao Modified comment(s), */
-/* verified memset and memcpy */
-/* cases, */
-/* resulting in version 6.1 */
-/* 10-15-2021 Chaoqiong Xiao Modified comment(s), */
-/* fixed compile issue, */
-/* resulting in version 6.1.9 */
-/* 01-31-2022x Chaoqiong Xiao Modified comment(s), */
-/* resulting in version 6.1.10 */
-/* 04-25-2022 Chaoqiong Xiao Modified comment(s), */
-/* resulting in version 6.1.11 */
-/* 07-29-2022 Chaoqiong Xiao Modified comment(s), */
-/* fixed parameter/variable */
-/* names conflict C++ keyword, */
-/* resulting in version 6.1.12 */
-/* 10-31-2023 Yajun Xia, CQ Xiao Modified comment(s), */
-/* added zero copy support, */
-/* added a new mode to manage */
-/* endpoint buffer in classes, */
-/* resulting in version 6.3.0 */
/* */
/**************************************************************************/
-UINT _ux_device_class_cdc_acm_read(UX_SLAVE_CLASS_CDC_ACM *cdc_acm, UCHAR *buffer,
+UINT _ux_device_class_cdc_acm_read(UX_SLAVE_CLASS_CDC_ACM *cdc_acm, UCHAR *buffer,
ULONG requested_length, ULONG *actual_length)
{
@@ -114,17 +89,17 @@ ULONG local_requested_length;
/* Check if current cdc-acm is using callback or not. We cannot use direct reads with callback on. */
if (cdc_acm -> ux_slave_class_cdc_acm_transmission_status == UX_TRUE)
-
+
/* Not allowed. */
return(UX_ERROR);
#endif
/* Get the pointer to the device. */
device = &_ux_system_slave -> ux_system_slave_device;
-
+
/* As long as the device is in the CONFIGURED state. */
if (device -> ux_slave_device_state != UX_DEVICE_CONFIGURED)
- {
+ {
/* Error trap. */
_ux_system_error_handler(UX_SYSTEM_LEVEL_THREAD, UX_SYSTEM_CONTEXT_CLASS, UX_CONFIGURATION_HANDLE_UNKNOWN);
@@ -132,17 +107,17 @@ ULONG local_requested_length;
/* If trace is enabled, insert this event into the trace buffer. */
UX_TRACE_IN_LINE_INSERT(UX_TRACE_ERROR, UX_CONFIGURATION_HANDLE_UNKNOWN, device, 0, 0, UX_TRACE_ERRORS, 0, 0)
-
+
/* Cannot proceed with command, the interface is down. */
return(UX_CONFIGURATION_HANDLE_UNKNOWN);
}
-
+
/* This is the first time we are activated. We need the interface to the class. */
interface_ptr = cdc_acm -> ux_slave_class_cdc_acm_interface;
-
+
/* Locate the endpoints. */
endpoint = interface_ptr -> ux_slave_interface_first_endpoint;
-
+
/* Check the endpoint direction, if OUT we have the correct endpoint. */
if ((endpoint -> ux_slave_endpoint_descriptor.bEndpointAddress & UX_ENDPOINT_DIRECTION) != UX_ENDPOINT_OUT)
{
@@ -185,48 +160,48 @@ ULONG local_requested_length;
/* Check if we need more transactions. */
while (device -> ux_slave_device_state == UX_DEVICE_CONFIGURED && requested_length != 0)
- {
-
+ {
+
/* Check if we have enough in the local buffer. */
if (requested_length > endpoint -> ux_slave_endpoint_descriptor.wMaxPacketSize)
-
+
/* We have too much to transfer. */
local_requested_length = endpoint -> ux_slave_endpoint_descriptor.wMaxPacketSize;
-
+
else
-
+
/* We can proceed with the demanded length. */
local_requested_length = requested_length;
-
+
/* Send the request to the device controller. */
status = _ux_device_stack_transfer_request(transfer_request, local_requested_length, local_requested_length);
-
- /* Check the status */
+
+ /* Check the status */
if (status == UX_SUCCESS)
{
/* 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); /* Use case of memcpy is verified. */
-
+
/* Next buffer address. */
buffer += transfer_request -> ux_slave_transfer_request_actual_length;
-
+
/* Set the length actually received. */
- *actual_length += transfer_request -> ux_slave_transfer_request_actual_length;
-
+ *actual_length += transfer_request -> ux_slave_transfer_request_actual_length;
+
/* Decrement what left has to be done. */
requested_length -= transfer_request -> ux_slave_transfer_request_actual_length;
/* Is this a short packet or a ZLP indicating we are done with this transfer ? */
if (transfer_request -> ux_slave_transfer_request_actual_length < endpoint -> ux_slave_endpoint_descriptor.wMaxPacketSize)
- {
+ {
/* We are done. */
/* Free Mutex resource. */
_ux_device_mutex_off(&cdc_acm -> ux_slave_class_cdc_acm_endpoint_out_mutex);
-
+
/* Return with success. */
return(UX_SUCCESS);
@@ -234,13 +209,13 @@ ULONG local_requested_length;
}
else
{
-
+
/* Free Mutex resource. */
_ux_device_mutex_off(&cdc_acm -> ux_slave_class_cdc_acm_endpoint_out_mutex);
-
+
/* We got an error. */
return(status);
- }
+ }
}
#endif
@@ -250,7 +225,7 @@ ULONG local_requested_length;
/* Check why we got here, either completion or device was extracted. */
if (device -> ux_slave_device_state != UX_DEVICE_CONFIGURED)
- {
+ {
/* Error trap. */
_ux_system_error_handler(UX_SYSTEM_LEVEL_THREAD, UX_SYSTEM_CONTEXT_CLASS, UX_TRANSFER_NO_ANSWER);
@@ -262,9 +237,9 @@ ULONG local_requested_length;
return (UX_TRANSFER_NO_ANSWER);
}
else
-
+
/* Simply return the last transaction result. */
- return(status);
+ return(status);
}
/**************************************************************************/
@@ -303,12 +278,6 @@ ULONG local_requested_length;
/* */
/* Application */
/* */
-/* RELEASE HISTORY */
-/* */
-/* DATE NAME DESCRIPTION */
-/* */
-/* 10-31-2023 Yajun Xia Initial Version 6.3.0 */
-/* */
/**************************************************************************/
UINT _uxe_device_class_cdc_acm_read(UX_SLAVE_CLASS_CDC_ACM *cdc_acm, UCHAR *buffer,
ULONG requested_length, ULONG *actual_length)
diff --git a/common/usbx_device_classes/src/ux_device_class_cdc_acm_read_run.c b/common/usbx_device_classes/src/ux_device_class_cdc_acm_read_run.c
index 69b74aaf..90ea3976 100644
--- a/common/usbx_device_classes/src/ux_device_class_cdc_acm_read_run.c
+++ b/common/usbx_device_classes/src/ux_device_class_cdc_acm_read_run.c
@@ -1,10 +1,11 @@
/***************************************************************************
- * Copyright (c) 2024 Microsoft Corporation
- *
+ * Copyright (c) 2024 Microsoft Corporation
+ * Copyright (c) 2026-present Eclipse ThreadX contributors
+ *
* This program and the accompanying materials are made available under the
* terms of the MIT License which is available at
* https://opensource.org/licenses/MIT.
- *
+ *
* SPDX-License-Identifier: MIT
**************************************************************************/
@@ -74,21 +75,6 @@
/* */
/* Application */
/* */
-/* RELEASE HISTORY */
-/* */
-/* DATE NAME DESCRIPTION */
-/* */
-/* 01-31-2022 Chaoqiong Xiao Initial Version 6.1.10 */
-/* 10-31-2022 Yajun Xia Modified comment(s), */
-/* fixed return code, */
-/* resulting in version 6.2.0 */
-/* 10-31-2023 Yajun Xia, CQ Xiao Modified comment(s), */
-/* added zero copy support, */
-/* added a new mode to manage */
-/* endpoint buffer in classes, */
-/* fixed return code, */
-/* resulting in version 6.3.0 */
-/* */
/**************************************************************************/
UINT _ux_device_class_cdc_acm_read_run(UX_SLAVE_CLASS_CDC_ACM *cdc_acm,
UCHAR *buffer, ULONG requested_length, ULONG *actual_length)
@@ -309,7 +295,7 @@ UINT status = UX_SUCCESS;
cdc_acm -> ux_device_class_cdc_acm_read_status = UX_INVALID_STATE;
break;
}
-
+
/* Error cases. */
return(UX_STATE_EXIT);
@@ -358,12 +344,6 @@ UINT status = UX_SUCCESS;
/* */
/* Application */
/* */
-/* RELEASE HISTORY */
-/* */
-/* DATE NAME DESCRIPTION */
-/* */
-/* 10-31-2023 Yajun Xia Initial Version 6.3.0 */
-/* */
/**************************************************************************/
UINT _uxe_device_class_cdc_acm_read_run(UX_SLAVE_CLASS_CDC_ACM *cdc_acm,
UCHAR *buffer, ULONG requested_length, ULONG *actual_length)
diff --git a/common/usbx_device_classes/src/ux_device_class_cdc_acm_tasks_run.c b/common/usbx_device_classes/src/ux_device_class_cdc_acm_tasks_run.c
index dee6d349..bc5023c5 100644
--- a/common/usbx_device_classes/src/ux_device_class_cdc_acm_tasks_run.c
+++ b/common/usbx_device_classes/src/ux_device_class_cdc_acm_tasks_run.c
@@ -1,10 +1,11 @@
/***************************************************************************
- * Copyright (c) 2024 Microsoft Corporation
- *
+ * Copyright (c) 2024 Microsoft Corporation
+ * Copyright (c) 2026-present Eclipse ThreadX contributors
+ *
* This program and the accompanying materials are made available under the
* terms of the MIT License which is available at
* https://opensource.org/licenses/MIT.
- *
+ *
* SPDX-License-Identifier: MIT
**************************************************************************/
@@ -72,25 +73,6 @@ static inline VOID _ux_device_class_cdc_acm_transmission_write_run(UX_SLAVE_CLAS
/* */
/* Device Stack */
/* */
-/* RELEASE HISTORY */
-/* */
-/* DATE NAME DESCRIPTION */
-/* */
-/* 01-31-2022 Chaoqiong Xiao Initial Version 6.1.10 */
-/* 07-29-2022 Chaoqiong Xiao Modified comment(s), */
-/* fixed parameter/variable */
-/* names conflict C++ keyword, */
-/* supported write auto ZLP, */
-/* resulting in version 6.1.12 */
-/* 10-31-2022 Chaoqiong Xiao Modified comment(s), */
-/* fixed compile warnings, */
-/* resulting in version 6.2.0 */
-/* 10-31-2023 Chaoqiong Xiao Modified comment(s), */
-/* added zero copy support, */
-/* added a new mode to manage */
-/* endpoint buffer in classes, */
-/* resulting in version 6.3.0 */
-/* */
/**************************************************************************/
UINT _ux_device_class_cdc_acm_tasks_run(VOID *instance)
{
@@ -396,7 +378,7 @@ UINT zlp = UX_FALSE;
/* 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,
+ _ux_utility_memory_copy(transfer_request -> ux_slave_transfer_request_data_pointer,
cdc_acm -> ux_device_class_cdc_acm_write_buffer,
cdc_acm -> ux_device_class_cdc_acm_write_transfer_length); /* Use case of memcpy is verified. */
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 63841de4..1b40e36b 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
@@ -1,17 +1,18 @@
/***************************************************************************
- * Copyright (c) 2024 Microsoft Corporation
- *
+ * Copyright (c) 2024 Microsoft Corporation
+ * Copyright (c) 2026-present Eclipse ThreadX contributors
+ *
* This program and the accompanying materials are made available under the
* terms of the MIT License which is available at
* https://opensource.org/licenses/MIT.
- *
+ *
* SPDX-License-Identifier: MIT
**************************************************************************/
/**************************************************************************/
/**************************************************************************/
-/** */
-/** USBX Component */
+/** */
+/** USBX Component */
/** */
/** Device CDC Class */
/** */
@@ -28,69 +29,41 @@
#include "ux_device_stack.h"
-/**************************************************************************/
-/* */
-/* FUNCTION RELEASE */
-/* */
-/* _ux_device_class_cdc_acm_uninitialize PORTABLE C */
+/**************************************************************************/
+/* */
+/* FUNCTION RELEASE */
+/* */
+/* _ux_device_class_cdc_acm_uninitialize PORTABLE C */
/* 6.3.0 */
/* AUTHOR */
/* */
/* Chaoqiong Xiao, Microsoft Corporation */
/* */
/* DESCRIPTION */
-/* */
-/* This function uninitialize the cdc-acm class. */
-/* */
-/* INPUT */
-/* */
-/* command Pointer to a class command */
-/* */
-/* OUTPUT */
-/* */
-/* Completion Status */
-/* */
-/* CALLS */
-/* */
-/* _ux_device_mutex_delete Delete Mutex */
-/* _ux_utility_memory_free Free used local memory */
-/* */
-/* CALLED BY */
-/* */
+/* */
+/* This function uninitialize the cdc-acm class. */
+/* */
+/* INPUT */
+/* */
+/* command Pointer to a class command */
+/* */
+/* OUTPUT */
+/* */
+/* Completion Status */
+/* */
+/* CALLS */
+/* */
+/* _ux_device_mutex_delete Delete Mutex */
+/* _ux_utility_memory_free Free used local memory */
+/* */
+/* CALLED BY */
+/* */
/* CDC Class */
-/* */
-/* RELEASE HISTORY */
-/* */
-/* DATE NAME DESCRIPTION */
-/* */
-/* 05-19-2020 Chaoqiong Xiao Initial Version 6.0 */
-/* 09-30-2020 Chaoqiong Xiao Modified comment(s), */
-/* resulting in version 6.1 */
-/* 04-02-2021 Chaoqiong Xiao Modified comment(s), */
-/* added macro to disable */
-/* transmission support, */
-/* moved transmission resource */
-/* free to here (uninit), */
-/* resulting in version 6.1.6 */
-/* 01-31-2022 Chaoqiong Xiao Modified comment(s), */
-/* added standalone support, */
-/* resulting in version 6.1.10 */
-/* 04-25-2022 Chaoqiong Xiao Modified comment(s), */
-/* resulting in version 6.1.11 */
-/* 07-29-2022 Chaoqiong Xiao Modified comment(s), */
-/* fixed parameter/variable */
-/* names conflict C++ keyword, */
-/* resulting in version 6.1.12 */
-/* 10-31-2023 Chaoqiong Xiao Modified comment(s), */
-/* added zero copy support, */
-/* added a new mode to manage */
-/* endpoint buffer in classes, */
-/* resulting in version 6.3.0 */
/* */
/**************************************************************************/
UINT _ux_device_class_cdc_acm_uninitialize(UX_SLAVE_CLASS_COMMAND *command)
{
-
+
UX_SLAVE_CLASS_CDC_ACM *cdc_acm;
UX_SLAVE_CLASS *class_ptr;
@@ -132,7 +105,7 @@ UX_SLAVE_CLASS *class_ptr;
_ux_utility_memory_free(cdc_acm);
}
-
+
/* Return completion status. */
return(UX_SUCCESS);
}
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 33eb616d..b8017789 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
@@ -1,17 +1,18 @@
/***************************************************************************
- * Copyright (c) 2024 Microsoft Corporation
- *
+ * Copyright (c) 2024 Microsoft Corporation
+ * Copyright (c) 2026-present Eclipse ThreadX contributors
+ *
* This program and the accompanying materials are made available under the
* terms of the MIT License which is available at
* https://opensource.org/licenses/MIT.
- *
+ *
* SPDX-License-Identifier: MIT
**************************************************************************/
/**************************************************************************/
/**************************************************************************/
-/** */
-/** USBX Component */
+/** */
+/** USBX Component */
/** */
/** Device CDC Class */
/** */
@@ -29,76 +30,49 @@
#if !defined(UX_DEVICE_STANDALONE)
-/**************************************************************************/
-/* */
-/* FUNCTION RELEASE */
-/* */
-/* _ux_device_class_cdc_acm_write PORTABLE C */
+/**************************************************************************/
+/* */
+/* FUNCTION RELEASE */
+/* */
+/* _ux_device_class_cdc_acm_write PORTABLE C */
/* 6.3.0 */
/* AUTHOR */
/* */
/* Chaoqiong Xiao, Microsoft Corporation */
/* */
/* DESCRIPTION */
-/* */
-/* This function writes to the CDC class. */
-/* */
+/* */
+/* This function writes to the CDC class. */
+/* */
/* It's for RTOS mode. */
-/* */
-/* INPUT */
-/* */
-/* cdc_acm Address of cdc_acm class */
-/* instance */
+/* */
+/* INPUT */
+/* */
+/* cdc_acm Address of cdc_acm class */
+/* instance */
/* buffer Pointer to data to write */
/* requested_length Length of bytes to write, */
/* set to 0 to issue ZLP */
/* actual_length Pointer to save number of */
/* bytes written */
-/* */
-/* OUTPUT */
-/* */
-/* None */
-/* */
-/* CALLS */
-/* */
-/* _ux_utility_memory_copy Copy memory */
-/* _ux_device_stack_transfer_request Transfer request */
-/* _ux_device_mutex_on Take Mutex */
-/* _ux_device_mutex_off Release Mutex */
-/* */
-/* CALLED BY */
-/* */
+/* */
+/* OUTPUT */
+/* */
+/* None */
+/* */
+/* CALLS */
+/* */
+/* _ux_utility_memory_copy Copy memory */
+/* _ux_device_stack_transfer_request Transfer request */
+/* _ux_device_mutex_on Take Mutex */
+/* _ux_device_mutex_off Release Mutex */
+/* */
+/* CALLED BY */
+/* */
/* Application */
-/* */
-/* RELEASE HISTORY */
-/* */
-/* DATE NAME DESCRIPTION */
-/* */
-/* 05-19-2020 Chaoqiong Xiao Initial Version 6.0 */
-/* 09-30-2020 Chaoqiong Xiao Modified comment(s), */
-/* verified memset and memcpy */
-/* cases, */
-/* resulting in version 6.1 */
-/* 10-15-2021 Chaoqiong Xiao Modified comment(s), */
-/* fixed compile issue, */
-/* resulting in version 6.1.9 */
-/* 01-31-2022 Chaoqiong Xiao Modified comment(s), */
-/* resulting in version 6.1.10 */
-/* 04-25-2022 Chaoqiong Xiao Modified comment(s), */
-/* resulting in version 6.1.11 */
-/* 07-29-2022 Chaoqiong Xiao Modified comment(s), */
-/* fixed parameter/variable */
-/* names conflict C++ keyword, */
-/* added auto ZLP support, */
-/* resulting in version 6.1.12 */
-/* 10-31-2023 Yajun Xia, CQ Xiao Modified comment(s), */
-/* added zero copy support, */
-/* added a new mode to manage */
-/* endpoint buffer in classes, */
-/* resulting in version 6.3.0 */
/* */
/**************************************************************************/
-UINT _ux_device_class_cdc_acm_write(UX_SLAVE_CLASS_CDC_ACM *cdc_acm, UCHAR *buffer,
+UINT _ux_device_class_cdc_acm_write(UX_SLAVE_CLASS_CDC_ACM *cdc_acm, UCHAR *buffer,
ULONG requested_length, ULONG *actual_length)
{
@@ -117,34 +91,34 @@ UINT status = 0;
/* Check if current cdc-acm is using callback or not. We cannot use direct reads with callback on. */
if (cdc_acm -> ux_slave_class_cdc_acm_transmission_status == UX_TRUE)
-
+
/* Not allowed. */
return(UX_ERROR);
#endif
/* Get the pointer to the device. */
device = &_ux_system_slave -> ux_system_slave_device;
-
+
/* As long as the device is in the CONFIGURED state. */
if (device -> ux_slave_device_state != UX_DEVICE_CONFIGURED)
{
-
+
/* Error trap. */
_ux_system_error_handler(UX_SYSTEM_LEVEL_THREAD, UX_SYSTEM_CONTEXT_CLASS, UX_CONFIGURATION_HANDLE_UNKNOWN);
/* If trace is enabled, insert this event into the trace buffer. */
UX_TRACE_IN_LINE_INSERT(UX_TRACE_ERROR, UX_CONFIGURATION_HANDLE_UNKNOWN, device, 0, 0, UX_TRACE_ERRORS, 0, 0)
-
+
/* Cannot proceed with command, the interface is down. */
return(UX_CONFIGURATION_HANDLE_UNKNOWN);
}
-
+
/* We need the interface to the class. */
interface_ptr = cdc_acm -> ux_slave_class_cdc_acm_interface;
-
+
/* Locate the endpoints. */
endpoint = interface_ptr -> ux_slave_interface_first_endpoint;
-
+
/* Check the endpoint direction, if IN we have the correct endpoint. */
if ((endpoint -> ux_slave_endpoint_descriptor.bEndpointAddress & UX_ENDPOINT_DIRECTION) != UX_ENDPOINT_IN)
{
@@ -174,7 +148,7 @@ UINT status = 0;
/* Check if the application forces a 0 length packet. */
if (device -> ux_slave_device_state == UX_DEVICE_CONFIGURED && requested_length == 0)
{
-
+
/* Send the request for 0 byte packet to the device controller. */
status = _ux_device_stack_transfer_request(transfer_request, 0, 0);
@@ -183,7 +157,7 @@ UINT status = 0;
/* Return the status. */
return(status);
-
+
}
else
@@ -214,14 +188,14 @@ UINT status = 0;
/* Check if we need more transactions. */
local_host_length = UX_DEVICE_CLASS_CDC_ACM_WRITE_BUFFER_SIZE;
while (device -> ux_slave_device_state == UX_DEVICE_CONFIGURED && requested_length != 0)
- {
-
+ {
+
/* Check if we have enough in the local buffer. */
if (requested_length > UX_DEVICE_CLASS_CDC_ACM_WRITE_BUFFER_SIZE)
-
+
/* We have too much to transfer. */
local_requested_length = UX_DEVICE_CLASS_CDC_ACM_WRITE_BUFFER_SIZE;
-
+
else
{
@@ -238,36 +212,36 @@ UINT status = 0;
local_host_length = UX_DEVICE_CLASS_CDC_ACM_WRITE_BUFFER_SIZE + 1;
#endif
}
-
+
/* 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); /* 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_host_length);
-
- /* Check the status */
+
+ /* Check the status */
if (status == UX_SUCCESS)
{
-
+
/* Next buffer address. */
buffer += transfer_request -> ux_slave_transfer_request_actual_length;
-
+
/* Set the length actually received. */
- *actual_length += transfer_request -> ux_slave_transfer_request_actual_length;
-
+ *actual_length += transfer_request -> ux_slave_transfer_request_actual_length;
+
/* Decrement what left has to be done. */
requested_length -= transfer_request -> ux_slave_transfer_request_actual_length;
-
+
}
-
+
else
{
-
+
/* Free Mutex resource. */
_ux_device_mutex_off(&cdc_acm -> ux_slave_class_cdc_acm_endpoint_in_mutex);
-
+
/* We had an error, abort. */
return(status);
}
@@ -275,14 +249,14 @@ UINT status = 0;
#endif /* _BUFF_OWNER && _ZERO_COPY */
}
-
+
/* Free Mutex resource. */
_ux_device_mutex_off(&cdc_acm -> ux_slave_class_cdc_acm_endpoint_in_mutex);
/* Check why we got here, either completion or device was extracted. */
if (device -> ux_slave_device_state != UX_DEVICE_CONFIGURED)
{
-
+
/* Error trap. */
_ux_system_error_handler(UX_SYSTEM_LEVEL_THREAD, UX_SYSTEM_CONTEXT_CLASS, UX_TRANSFER_NO_ANSWER);
@@ -293,10 +267,10 @@ UINT status = 0;
return (UX_TRANSFER_NO_ANSWER);
}
else
-
+
/* Simply return the last transaction result. */
- return(status);
-
+ return(status);
+
}
/**************************************************************************/
@@ -335,12 +309,6 @@ UINT status = 0;
/* */
/* Application */
/* */
-/* RELEASE HISTORY */
-/* */
-/* DATE NAME DESCRIPTION */
-/* */
-/* 10-31-2023 Yajun Xia Initial Version 6.3.0 */
-/* */
/**************************************************************************/
UINT _uxe_device_class_cdc_acm_write(UX_SLAVE_CLASS_CDC_ACM *cdc_acm, UCHAR *buffer,
ULONG requested_length, ULONG *actual_length)
diff --git a/common/usbx_device_classes/src/ux_device_class_cdc_acm_write_run.c b/common/usbx_device_classes/src/ux_device_class_cdc_acm_write_run.c
index 7a18d29e..0272f941 100644
--- a/common/usbx_device_classes/src/ux_device_class_cdc_acm_write_run.c
+++ b/common/usbx_device_classes/src/ux_device_class_cdc_acm_write_run.c
@@ -1,10 +1,11 @@
/***************************************************************************
- * Copyright (c) 2024 Microsoft Corporation
- *
+ * Copyright (c) 2024 Microsoft Corporation
+ * Copyright (c) 2026-present Eclipse ThreadX contributors
+ *
* This program and the accompanying materials are made available under the
* terms of the MIT License which is available at
* https://opensource.org/licenses/MIT.
- *
+ *
* SPDX-License-Identifier: MIT
**************************************************************************/
@@ -73,26 +74,6 @@
/* */
/* Application */
/* */
-/* RELEASE HISTORY */
-/* */
-/* DATE NAME DESCRIPTION */
-/* */
-/* 01-31-2022 Chaoqiong Xiao Initial Version 6.1.10 */
-/* 07-29-2022 Chaoqiong Xiao Modified comment(s), */
-/* fixed parameter/variable */
-/* names conflict C++ keyword, */
-/* added auto ZLP support, */
-/* resulting in version 6.1.12 */
-/* 10-31-2022 Yajun Xia Modified comment(s), */
-/* fixed return code, */
-/* resulting in version 6.2.0 */
-/* 10-31-2023 Yajun Xia, CQ Xiao Modified comment(s), */
-/* added zero copy support, */
-/* added a new mode to manage */
-/* endpoint buffer in classes, */
-/* fixed return code, */
-/* resulting in version 6.3.0 */
-/* */
/**************************************************************************/
UINT _ux_device_class_cdc_acm_write_run(UX_SLAVE_CLASS_CDC_ACM *cdc_acm,
UCHAR *buffer, ULONG requested_length, ULONG *actual_length)
@@ -266,7 +247,7 @@ UINT zlp = UX_FALSE;
/* 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,
+ _ux_utility_memory_copy(transfer_request -> ux_slave_transfer_request_data_pointer,
cdc_acm -> ux_device_class_cdc_acm_write_buffer,
cdc_acm -> ux_device_class_cdc_acm_write_transfer_length); /* Use case of memcpy is verified. */
@@ -376,12 +357,6 @@ UINT zlp = UX_FALSE;
/* */
/* Application */
/* */
-/* RELEASE HISTORY */
-/* */
-/* DATE NAME DESCRIPTION */
-/* */
-/* 10-31-2023 Yajun Xia Initial Version 6.3.0 */
-/* */
/**************************************************************************/
UINT _uxe_device_class_cdc_acm_write_run(UX_SLAVE_CLASS_CDC_ACM *cdc_acm,
UCHAR *buffer, ULONG requested_length, ULONG *actual_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 225bb74f..0ecc870c 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
@@ -1,10 +1,11 @@
/***************************************************************************
- * Copyright (c) 2024 Microsoft Corporation
- *
+ * Copyright (c) 2024 Microsoft Corporation
+ * Copyright (c) 2026-present Eclipse ThreadX contributors
+ *
* This program and the accompanying materials are made available under the
* terms of the MIT License which is available at
* https://opensource.org/licenses/MIT.
- *
+ *
* SPDX-License-Identifier: MIT
**************************************************************************/
@@ -61,28 +62,6 @@
/* */
/* Application */
/* */
-/* RELEASE HISTORY */
-/* */
-/* 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 */
-/* 04-02-2021 Chaoqiong Xiao Modified comment(s), */
-/* added macro to disable */
-/* transmission support, */
-/* resulting in version 6.1.6 */
-/* 01-31-2022 Chaoqiong Xiao Modified comment(s), */
-/* added standalone support, */
-/* resulting in version 6.1.10 */
-/* 04-25-2022 Chaoqiong Xiao Modified comment(s), */
-/* resulting in version 6.1.11 */
-/* 10-31-2023 Yajun Xia Modified comment(s), */
-/* resulting in version 6.3.0 */
-/* */
/**************************************************************************/
UINT _ux_device_class_cdc_acm_write_with_callback(UX_SLAVE_CLASS_CDC_ACM *cdc_acm, UCHAR *buffer,
ULONG requested_length)
@@ -200,12 +179,6 @@ UINT status;
/* */
/* Application */
/* */
-/* RELEASE HISTORY */
-/* */
-/* DATE NAME DESCRIPTION */
-/* */
-/* 10-31-2023 Yajun Xia Initial Version 6.3.0 */
-/* */
/**************************************************************************/
UINT _uxe_device_class_cdc_acm_write_with_callback(UX_SLAVE_CLASS_CDC_ACM *cdc_acm, UCHAR *buffer,
ULONG requested_length)
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 feb558ba..7f92c728 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
@@ -1,16 +1,17 @@
/***************************************************************************
- * Copyright (c) 2024 Microsoft Corporation
- *
+ * Copyright (c) 2024 Microsoft Corporation
+ * Copyright (c) 2026-present Eclipse ThreadX contributors
+ *
* This program and the accompanying materials are made available under the
* terms of the MIT License which is available at
* https://opensource.org/licenses/MIT.
- *
+ *
* SPDX-License-Identifier: MIT
**************************************************************************/
/**************************************************************************/
-/** */
-/** USBX Component */
+/** */
+/** USBX Component */
/** */
/** Device CDC_ECM Class */
/** */
@@ -27,65 +28,35 @@
#include "ux_device_stack.h"
-/**************************************************************************/
-/* */
-/* FUNCTION RELEASE */
-/* */
-/* _ux_device_class_cdc_ecm_activate PORTABLE C */
+/**************************************************************************/
+/* */
+/* FUNCTION RELEASE */
+/* */
+/* _ux_device_class_cdc_ecm_activate PORTABLE C */
/* 6.3.0 */
/* AUTHOR */
/* */
/* Chaoqiong Xiao, Microsoft Corporation */
/* */
/* DESCRIPTION */
-/* */
-/* This function activates the USB CDC_ECM device. */
-/* */
-/* INPUT */
-/* */
-/* command Pointer to cdc_ecm command */
-/* */
-/* OUTPUT */
-/* */
-/* Completion Status */
-/* */
-/* CALLS */
-/* */
+/* */
+/* This function activates the USB CDC_ECM device. */
+/* */
+/* INPUT */
+/* */
+/* command Pointer to cdc_ecm command */
+/* */
+/* OUTPUT */
+/* */
+/* Completion Status */
+/* */
+/* CALLS */
+/* */
/* None */
-/* */
-/* CALLED BY */
-/* */
-/* USBX Source Code */
-/* */
-/* RELEASE HISTORY */
-/* */
-/* DATE NAME DESCRIPTION */
-/* */
-/* 05-19-2020 Chaoqiong Xiao Initial Version 6.0 */
-/* 09-30-2020 Chaoqiong Xiao Modified comment(s), */
-/* verified memset and memcpy */
-/* cases, used UX prefix to */
-/* refer to TX symbols instead */
-/* of using them directly, */
-/* resulting in version 6.1 */
-/* 08-02-2021 Wen Wang Modified comment(s), */
-/* fixed spelling error, */
-/* resulting in version 6.1.8 */
-/* 01-31-2022 Chaoqiong Xiao Modified comment(s), */
-/* refined macros names, */
-/* resulting in version 6.1.10 */
-/* 04-25-2022 Chaoqiong Xiao Modified comment(s), */
-/* fixed standalone compile, */
-/* resulting in version 6.1.11 */
-/* 07-29-2022 Chaoqiong Xiao Modified comment(s), */
-/* fixed parameter/variable */
-/* names conflict C++ keyword, */
-/* resulting in version 6.1.12 */
-/* 10-31-2023 Chaoqiong Xiao Modified comment(s), */
-/* added zero copy support, */
-/* added a new mode to manage */
-/* endpoint buffer in classes, */
-/* resulting in version 6.3.0 */
+/* */
+/* CALLED BY */
+/* */
+/* USBX Source Code */
/* */
/**************************************************************************/
UINT _ux_device_class_cdc_ecm_activate(UX_SLAVE_CLASS_COMMAND *command)
@@ -95,7 +66,7 @@ UINT _ux_device_class_cdc_ecm_activate(UX_SLAVE_CLASS_COMMAND *command)
return(UX_FUNCTION_NOT_SUPPORTED);
#else
-UX_SLAVE_INTERFACE *interface_ptr;
+UX_SLAVE_INTERFACE *interface_ptr;
UX_SLAVE_CLASS *class_ptr;
UX_SLAVE_CLASS_CDC_ECM *cdc_ecm;
UX_SLAVE_ENDPOINT *endpoint;
@@ -110,32 +81,32 @@ ULONG physical_address_lsw;
/* Get the interface that owns this instance. */
interface_ptr = (UX_SLAVE_INTERFACE *) command -> ux_slave_class_command_interface;
-
+
/* Check if this is the Control or Data interface. */
if (command -> ux_slave_class_command_class == UX_DEVICE_CLASS_CDC_ECM_CLASS_COMMUNICATION_CONTROL)
{
/* Store the class instance into the interface. */
interface_ptr -> ux_slave_interface_class_instance = (VOID *)cdc_ecm;
-
+
/* Now the opposite, store the interface in the class instance. */
cdc_ecm -> ux_slave_class_cdc_ecm_interface = interface_ptr;
-
+
/* Locate the interrupt endpoint. */
endpoint = interface_ptr -> ux_slave_interface_first_endpoint;
-
+
/* Parse all endpoints. */
while (endpoint != UX_NULL)
{
-
+
/* Check the endpoint direction, and type. */
if ((endpoint -> ux_slave_endpoint_descriptor.bEndpointAddress & UX_ENDPOINT_DIRECTION) == UX_ENDPOINT_IN)
{
/* Look at type. */
if ((endpoint -> ux_slave_endpoint_descriptor.bmAttributes & UX_MASK_ENDPOINT_TYPE) == UX_INTERRUPT_ENDPOINT)
- {
-
+ {
+
/* We have found the interrupt endpoint, save it. */
cdc_ecm -> ux_slave_class_cdc_ecm_interrupt_endpoint = endpoint;
#if UX_DEVICE_ENDPOINT_BUFFER_OWNER == 1
@@ -147,20 +118,20 @@ ULONG physical_address_lsw;
#endif
/* Reset the endpoint buffers. */
- _ux_utility_memory_set(cdc_ecm -> ux_slave_class_cdc_ecm_interrupt_endpoint -> ux_slave_endpoint_transfer_request.
+ _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_DEVICE_CLASS_CDC_ECM_INTERRUPTIN_BUFFER_SIZE); /* Use case of memset is verified. */
/* Resume the interrupt endpoint threads. */
- _ux_device_thread_resume(&cdc_ecm -> ux_slave_class_cdc_ecm_interrupt_thread);
+ _ux_device_thread_resume(&cdc_ecm -> ux_slave_class_cdc_ecm_interrupt_thread);
}
-
- }
+
+ }
/* Next endpoint. */
endpoint = endpoint -> ux_slave_endpoint_next_endpoint;
}
-
+
}
else
@@ -181,19 +152,19 @@ ULONG physical_address_lsw;
/* Does the data class have bulk endpoint declared ? If yes we need to start link.
If not, the host will change the alternate setting at a later stage. */
if (interface_ptr -> ux_slave_interface_descriptor.bNumEndpoints != 0)
- {
+ {
/* Locate the endpoints. Control and Bulk in/out for Data Interface. */
endpoint = interface_ptr -> ux_slave_interface_first_endpoint;
-
+
/* Parse all endpoints. */
while (endpoint != UX_NULL)
{
-
+
/* Check the endpoint direction, and type. */
if ((endpoint -> ux_slave_endpoint_descriptor.bEndpointAddress & UX_ENDPOINT_DIRECTION) == UX_ENDPOINT_IN)
{
-
+
/* Look at type. */
if ((endpoint -> ux_slave_endpoint_descriptor.bmAttributes & UX_MASK_ENDPOINT_TYPE) == UX_BULK_ENDPOINT)
{
@@ -205,7 +176,7 @@ ULONG physical_address_lsw;
UX_DEVICE_CLASS_CDC_ECM_BULKIN_BUFFER(cdc_ecm);
#endif
}
-
+
}
else
{
@@ -220,25 +191,25 @@ ULONG physical_address_lsw;
UX_DEVICE_CLASS_CDC_ECM_BULKOUT_BUFFER(cdc_ecm);
#endif
}
- }
-
+ }
+
/* Next endpoint. */
endpoint = endpoint -> ux_slave_endpoint_next_endpoint;
}
-
-
+
+
/* Now check if all endpoints have been found. */
if (cdc_ecm -> ux_slave_class_cdc_ecm_bulkout_endpoint == UX_NULL || cdc_ecm -> ux_slave_class_cdc_ecm_bulkin_endpoint == UX_NULL)
-
+
/* Not all endpoints have been found. Major error, do not proceed. */
return(UX_ERROR);
/* Declare the link to be up. That may need to change later to make it dependent on the
WAN/Wireless modem. */
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_device_event_flags_set(&cdc_ecm -> ux_slave_class_cdc_ecm_event_flags_group, UX_DEVICE_CLASS_CDC_ECM_NETWORK_NOTIFICATION_EVENT, UX_OR);
+ _ux_device_event_flags_set(&cdc_ecm -> ux_slave_class_cdc_ecm_event_flags_group, UX_DEVICE_CLASS_CDC_ECM_NETWORK_NOTIFICATION_EVENT, UX_OR);
#if (UX_DEVICE_ENDPOINT_BUFFER_OWNER == 1) && defined(UX_DEVICE_CLASS_CDC_ECM_ZERO_COPY)
@@ -246,29 +217,29 @@ ULONG physical_address_lsw;
#else
/* Reset the endpoint buffers. */
- _ux_utility_memory_set(cdc_ecm -> ux_slave_class_cdc_ecm_bulkout_endpoint -> ux_slave_endpoint_transfer_request.
+ _ux_utility_memory_set(cdc_ecm -> ux_slave_class_cdc_ecm_bulkout_endpoint -> ux_slave_endpoint_transfer_request.
ux_slave_transfer_request_data_pointer, 0, UX_DEVICE_CLASS_CDC_ECM_BULKOUT_BUFFER_SIZE); /* Use case of memset is verified. */
- _ux_utility_memory_set(cdc_ecm -> ux_slave_class_cdc_ecm_bulkin_endpoint -> ux_slave_endpoint_transfer_request.
+ _ux_utility_memory_set(cdc_ecm -> ux_slave_class_cdc_ecm_bulkin_endpoint -> ux_slave_endpoint_transfer_request.
ux_slave_transfer_request_data_pointer, 0, UX_DEVICE_CLASS_CDC_ECM_BULKIN_BUFFER_SIZE); /* Use case of memset is verified. */
#endif
/* Resume the endpoint threads. */
- _ux_device_thread_resume(&cdc_ecm -> ux_slave_class_cdc_ecm_bulkout_thread);
- _ux_device_thread_resume(&cdc_ecm -> ux_slave_class_cdc_ecm_bulkin_thread);
+ _ux_device_thread_resume(&cdc_ecm -> ux_slave_class_cdc_ecm_bulkout_thread);
+ _ux_device_thread_resume(&cdc_ecm -> ux_slave_class_cdc_ecm_bulkin_thread);
}
-
+
/* Setup the physical address of this IP instance. */
physical_address_msw = (ULONG)((cdc_ecm -> ux_slave_class_cdc_ecm_local_node_id[0] << 8) | (cdc_ecm -> ux_slave_class_cdc_ecm_local_node_id[1]));
- physical_address_lsw = (ULONG)((cdc_ecm -> ux_slave_class_cdc_ecm_local_node_id[2] << 24) | (cdc_ecm -> ux_slave_class_cdc_ecm_local_node_id[3] << 16) |
+ physical_address_lsw = (ULONG)((cdc_ecm -> ux_slave_class_cdc_ecm_local_node_id[2] << 24) | (cdc_ecm -> ux_slave_class_cdc_ecm_local_node_id[3] << 16) |
(cdc_ecm -> ux_slave_class_cdc_ecm_local_node_id[4] << 8) | (cdc_ecm -> ux_slave_class_cdc_ecm_local_node_id[5]));
-
+
/* Register this interface to the NetX USB interface broker. */
_ux_network_driver_activate((VOID *) cdc_ecm, _ux_device_class_cdc_ecm_write,
&cdc_ecm -> ux_slave_class_cdc_ecm_network_handle,
physical_address_msw,
physical_address_lsw);
-
+
/* Check Link. */
if (cdc_ecm -> ux_slave_class_cdc_ecm_link_state == UX_DEVICE_CLASS_CDC_ECM_LINK_STATE_UP)
{
@@ -282,7 +253,7 @@ ULONG physical_address_lsw;
/* Invoke the application. */
cdc_ecm -> ux_slave_class_cdc_ecm_parameter.ux_slave_class_cdc_ecm_instance_activate(cdc_ecm);
}
- }
+ }
/* If trace is enabled, insert this event into the trace buffer. */
UX_TRACE_IN_LINE_INSERT(UX_TRACE_DEVICE_CLASS_CDC_ECM_ACTIVATE, cdc_ecm, 0, 0, 0, UX_TRACE_DEVICE_CLASS_EVENTS, 0, 0)
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 a09b5a0a..9dc3e5c2 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
@@ -1,17 +1,18 @@
/***************************************************************************
- * Copyright (c) 2024 Microsoft Corporation
- *
+ * Copyright (c) 2024 Microsoft Corporation
+ * Copyright (c) 2026-present Eclipse ThreadX contributors
+ *
* This program and the accompanying materials are made available under the
* terms of the MIT License which is available at
* https://opensource.org/licenses/MIT.
- *
+ *
* SPDX-License-Identifier: MIT
**************************************************************************/
/**************************************************************************/
/**************************************************************************/
-/** */
-/** USBX Component */
+/** */
+/** USBX Component */
/** */
/** Device CDC_ECM Class */
/** */
@@ -29,67 +30,41 @@
#if !defined(UX_DEVICE_STANDALONE)
-/**************************************************************************/
-/* */
-/* FUNCTION RELEASE */
-/* */
-/* _ux_device_class_cdc_ecm_bulkin_thread PORTABLE C */
+/**************************************************************************/
+/* */
+/* FUNCTION RELEASE */
+/* */
+/* _ux_device_class_cdc_ecm_bulkin_thread PORTABLE C */
/* 6.3.0 */
/* AUTHOR */
/* */
/* Chaoqiong Xiao, Microsoft Corporation */
/* */
/* DESCRIPTION */
-/* */
-/* This function is the thread of the cdc_ecm bulkin endpoint. The bulk*/
-/* IN endpoint is used when the device wants to write data to be sent */
-/* to the host. */
-/* */
-/* INPUT */
-/* */
-/* cdc_ecm_class Address of cdc_ecm class */
-/* container */
-/* */
-/* OUTPUT */
-/* */
-/* None */
-/* */
-/* CALLS */
-/* */
-/* _ux_device_stack_transfer_request Request transfer */
+/* */
+/* This function is the thread of the cdc_ecm bulkin endpoint. The bulk*/
+/* IN endpoint is used when the device wants to write data to be sent */
+/* to the host. */
+/* */
+/* INPUT */
+/* */
+/* cdc_ecm_class Address of cdc_ecm class */
+/* container */
+/* */
+/* OUTPUT */
+/* */
+/* None */
+/* */
+/* CALLS */
+/* */
+/* _ux_device_stack_transfer_request Request transfer */
/* _ux_utility_event_flags_get Get event flags */
/* _ux_device_mutex_on Take mutex */
/* _ux_device_mutex_off Free mutex */
-/* */
-/* CALLED BY */
-/* */
-/* ThreadX */
-/* */
-/* RELEASE HISTORY */
-/* */
-/* DATE NAME DESCRIPTION */
-/* */
-/* 05-19-2020 Chaoqiong Xiao Initial Version 6.0 */
-/* 09-30-2020 Chaoqiong Xiao Modified comment(s), */
-/* verified memset and memcpy */
-/* cases, used UX prefix to */
-/* refer to TX symbols instead */
-/* of using them directly, */
-/* resulting in version 6.1 */
-/* 01-31-2022 Chaoqiong Xiao Modified comment(s), */
-/* refined macros names, */
-/* resulting in version 6.1.10 */
-/* 04-25-2022 Chaoqiong Xiao Modified comment(s), */
-/* fixed standalone compile, */
-/* resulting in version 6.1.11 */
-/* 10-31-2022 Chaoqiong Xiao Modified comment(s), */
-/* used NX API to copy data, */
-/* resulting in version 6.2.0 */
-/* 10-31-2023 Chaoqiong Xiao Modified comment(s), */
-/* added zero copy support, */
-/* added a new mode to manage */
-/* endpoint buffer in classes, */
-/* resulting in version 6.3.0 */
+/* */
+/* CALLED BY */
+/* */
+/* ThreadX */
/* */
/**************************************************************************/
VOID _ux_device_class_cdc_ecm_bulkin_thread(ULONG cdc_ecm_class)
@@ -110,13 +85,13 @@ NX_PACKET *packet;
/* Cast properly the cdc_ecm instance. */
UX_THREAD_EXTENSION_PTR_GET(class_ptr, UX_SLAVE_CLASS, cdc_ecm_class)
-
+
/* Get the cdc_ecm instance from this class container. */
cdc_ecm = (UX_SLAVE_CLASS_CDC_ECM *) class_ptr -> ux_slave_class_instance;
-
+
/* Get the pointer to the device. */
device = &_ux_system_slave -> ux_system_slave_device;
-
+
/* This thread runs forever but can be suspended or resumed. */
while (1)
{
@@ -124,11 +99,11 @@ NX_PACKET *packet;
/* For as long we are configured. */
while (1)
{
-
+
/* Wait until either a new packet has been added to the xmit queue,
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),
+ UX_DEVICE_CLASS_CDC_ECM_NEW_DEVICE_STATE_CHANGE_EVENT),
UX_OR_CLEAR, &actual_flags, UX_WAIT_FOREVER);
/* Check the completion code and the actual flags returned. */
@@ -137,7 +112,7 @@ NX_PACKET *packet;
/* Get the transfer request for the bulk IN pipe. */
transfer_request = &cdc_ecm -> ux_slave_class_cdc_ecm_bulkin_endpoint -> ux_slave_endpoint_transfer_request;
-
+
/* Parse all packets. */
while (cdc_ecm -> ux_slave_class_cdc_ecm_xmit_queue != UX_NULL)
{
@@ -150,10 +125,10 @@ NX_PACKET *packet;
/* Set the next packet (or a NULL value) as the head of the xmit queue. */
cdc_ecm -> ux_slave_class_cdc_ecm_xmit_queue = current_packet -> nx_packet_queue_next;
-
+
/* Free Mutex resource. */
_ux_device_mutex_off(&cdc_ecm -> ux_slave_class_cdc_ecm_mutex);
-
+
/* If the link is down no need to rearm a packet. */
if (cdc_ecm -> ux_slave_class_cdc_ecm_link_state == UX_DEVICE_CLASS_CDC_ECM_LINK_STATE_UP)
{
@@ -176,7 +151,7 @@ NX_PACKET *packet;
{
/* Allocate a new packet for chain data collection. */
- status = nx_packet_allocate(cdc_ecm -> ux_slave_class_cdc_ecm_packet_pool, &packet,
+ status = nx_packet_allocate(cdc_ecm -> ux_slave_class_cdc_ecm_packet_pool, &packet,
NX_RECEIVE_PACKET, UX_MS_TO_TICK(UX_DEVICE_CLASS_CDC_ECM_PACKET_POOL_WAIT));
if (status == UX_SUCCESS)
{
@@ -213,7 +188,7 @@ NX_PACKET *packet;
/* Calculate the transfer length. */
transfer_length = current_packet -> nx_packet_length;
-
+
/* If trace is enabled, insert this event into the trace buffer. */
UX_TRACE_IN_LINE_INSERT(UX_TRACE_DEVICE_CLASS_CDC_ECM_PACKET_TRANSMIT, cdc_ecm, 0, 0, 0, UX_TRACE_DEVICE_CLASS_EVENTS, 0, 0)
@@ -248,7 +223,7 @@ NX_PACKET *packet;
/* Calculate the transfer length. */
transfer_length = current_packet -> nx_packet_length;
-
+
/* If trace is enabled, insert this event into the trace buffer. */
UX_TRACE_IN_LINE_INSERT(UX_TRACE_DEVICE_CLASS_CDC_ECM_PACKET_TRANSMIT, cdc_ecm, 0, 0, 0, UX_TRACE_DEVICE_CLASS_EVENTS, 0, 0)
@@ -281,11 +256,11 @@ NX_PACKET *packet;
}
/* Free the packet that was just sent. First do some housekeeping. */
- current_packet -> nx_packet_prepend_ptr = current_packet -> nx_packet_prepend_ptr + UX_DEVICE_CLASS_CDC_ECM_ETHERNET_SIZE;
+ current_packet -> nx_packet_prepend_ptr = current_packet -> nx_packet_prepend_ptr + UX_DEVICE_CLASS_CDC_ECM_ETHERNET_SIZE;
current_packet -> nx_packet_length = current_packet -> nx_packet_length - UX_DEVICE_CLASS_CDC_ECM_ETHERNET_SIZE;
-
+
/* And ask Netx to release it. */
- nx_packet_transmit_release(current_packet);
+ nx_packet_transmit_release(current_packet);
}
}
else
@@ -295,7 +270,7 @@ NX_PACKET *packet;
_ux_device_mutex_on(&cdc_ecm -> ux_slave_class_cdc_ecm_mutex);
/* Since we got the mutex, we know no one is trying to modify the queue; we also know
- no one can start modifying the queue since the link state is down, so we can just
+ no one can start modifying the queue since the link state is down, so we can just
release the mutex. */
_ux_device_mutex_off(&cdc_ecm -> ux_slave_class_cdc_ecm_mutex);
@@ -305,16 +280,16 @@ NX_PACKET *packet;
/* Get the current packet in the list. */
current_packet = cdc_ecm -> ux_slave_class_cdc_ecm_xmit_queue;
-
+
/* Set the next packet (or a NULL value) as the head of the xmit queue. */
cdc_ecm -> ux_slave_class_cdc_ecm_xmit_queue = current_packet -> nx_packet_queue_next;
/* Free the packet. */
- current_packet -> nx_packet_prepend_ptr = current_packet -> nx_packet_prepend_ptr + UX_DEVICE_CLASS_CDC_ECM_ETHERNET_SIZE;
+ current_packet -> nx_packet_prepend_ptr = current_packet -> nx_packet_prepend_ptr + UX_DEVICE_CLASS_CDC_ECM_ETHERNET_SIZE;
current_packet -> nx_packet_length = current_packet -> nx_packet_length - UX_DEVICE_CLASS_CDC_ECM_ETHERNET_SIZE;
/* And ask Netx to release it. */
- nx_packet_transmit_release(current_packet);
+ nx_packet_transmit_release(current_packet);
}
/* Was the change in the device state caused by a disconnection? */
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 d8e5014f..1e95c7c0 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
@@ -1,17 +1,18 @@
/***************************************************************************
- * Copyright (c) 2024 Microsoft Corporation
- *
+ * Copyright (c) 2024 Microsoft Corporation
+ * Copyright (c) 2026-present Eclipse ThreadX contributors
+ *
* This program and the accompanying materials are made available under the
* terms of the MIT License which is available at
* https://opensource.org/licenses/MIT.
- *
+ *
* SPDX-License-Identifier: MIT
**************************************************************************/
/**************************************************************************/
/**************************************************************************/
-/** */
-/** USBX Component */
+/** */
+/** USBX Component */
/** */
/** Device CDC_ECM Class */
/** */
@@ -29,69 +30,42 @@
#if !defined(UX_DEVICE_STANDALONE)
-/**************************************************************************/
-/* */
-/* FUNCTION RELEASE */
-/* */
-/* _ux_device_class_cdc_ecm_bulkout_thread PORTABLE C */
+/**************************************************************************/
+/* */
+/* FUNCTION RELEASE */
+/* */
+/* _ux_device_class_cdc_ecm_bulkout_thread PORTABLE C */
/* 6.3.0 */
/* AUTHOR */
/* */
/* Chaoqiong Xiao, Microsoft Corporation */
/* */
/* DESCRIPTION */
-/* */
-/* This function is the thread of the cdc_ecm bulk out endpoint. It */
-/* is waiting for the host to send data on the bulk out endpoint to */
-/* the device. */
-/* */
-/* INPUT */
-/* */
-/* cdc_ecm_class Address of cdc_ecm class */
-/* container */
-/* */
-/* OUTPUT */
-/* */
-/* None */
-/* */
-/* CALLS */
-/* */
-/* _ux_device_stack_transfer_request Request transfer */
+/* */
+/* This function is the thread of the cdc_ecm bulk out endpoint. It */
+/* is waiting for the host to send data on the bulk out endpoint to */
+/* the device. */
+/* */
+/* INPUT */
+/* */
+/* cdc_ecm_class Address of cdc_ecm class */
+/* container */
+/* */
+/* OUTPUT */
+/* */
+/* None */
+/* */
+/* CALLS */
+/* */
+/* _ux_device_stack_transfer_request Request transfer */
/* _ux_utility_memory_copy Copy memory */
/* nx_packet_allocate Allocate NetX packet */
/* nx_packet_release Free NetX packet */
/* _ux_device_thread_suspend Suspend thread */
-/* */
-/* CALLED BY */
-/* */
-/* ThreadX */
-/* */
-/* RELEASE HISTORY */
-/* */
-/* 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 */
-/* 01-31-2022 Chaoqiong Xiao Modified comment(s), */
-/* refined macros names, */
-/* resulting in version 6.1.10 */
-/* 04-25-2022 Chaoqiong Xiao Modified comment(s), */
-/* fixed standalone compile, */
-/* resulting in version 6.1.11 */
-/* 10-31-2022 Chaoqiong Xiao Modified comment(s), */
-/* fixed EP not ready issue, */
-/* used pool from NX IP inst, */
-/* used NX API to copy data, */
-/* resulting in version 6.2.0 */
-/* 10-31-2023 Chaoqiong Xiao Modified comment(s), */
-/* added zero copy support, */
-/* added a new mode to manage */
-/* endpoint buffer in classes, */
-/* resulting in version 6.3.0 */
+/* */
+/* CALLED BY */
+/* */
+/* ThreadX */
/* */
/**************************************************************************/
VOID _ux_device_class_cdc_ecm_bulkout_thread(ULONG cdc_ecm_class)
@@ -107,20 +81,20 @@ USB_NETWORK_DEVICE_TYPE *ux_nx_device;
/* Cast properly the cdc_ecm instance. */
UX_THREAD_EXTENSION_PTR_GET(class_ptr, UX_SLAVE_CLASS, cdc_ecm_class)
-
+
/* Get the cdc_ecm instance from this class container. */
cdc_ecm = (UX_SLAVE_CLASS_CDC_ECM *) class_ptr -> ux_slave_class_instance;
-
+
/* Get the pointer to the device. */
device = &_ux_system_slave -> ux_system_slave_device;
-
+
/* This thread runs forever but can be suspended or resumed. */
while (1)
{
/* As long as the device is in the CONFIGURED state. */
while (device -> ux_slave_device_state == UX_DEVICE_CONFIGURED)
- {
+ {
/* Check if packet pool is ready. */
if (cdc_ecm -> ux_slave_class_cdc_ecm_packet_pool == UX_NULL)
@@ -153,7 +127,7 @@ USB_NETWORK_DEVICE_TYPE *ux_nx_device;
}
/* We can accept new reception. Get a NX Packet */
- status = nx_packet_allocate(cdc_ecm -> ux_slave_class_cdc_ecm_packet_pool, &packet,
+ status = nx_packet_allocate(cdc_ecm -> ux_slave_class_cdc_ecm_packet_pool, &packet,
NX_RECEIVE_PACKET, UX_MS_TO_TICK(UX_DEVICE_CLASS_CDC_ECM_PACKET_POOL_WAIT));
if (status == NX_SUCCESS)
@@ -165,10 +139,10 @@ USB_NETWORK_DEVICE_TYPE *ux_nx_device;
/* And length. */
transfer_request -> ux_slave_transfer_request_requested_length = UX_DEVICE_CLASS_CDC_ECM_BULKOUT_BUFFER_SIZE;
transfer_request -> ux_slave_transfer_request_actual_length = 0;
-
+
/* Memorize this packet at the beginning of the queue. */
cdc_ecm -> ux_slave_class_cdc_ecm_receive_queue = packet;
-
+
/* Reset the queue pointer of this packet. */
packet -> nx_packet_queue_next = UX_NULL;
@@ -243,7 +217,7 @@ USB_NETWORK_DEVICE_TYPE *ux_nx_device;
_ux_system_error_handler(UX_SYSTEM_LEVEL_THREAD, UX_SYSTEM_CONTEXT_CLASS, UX_MEMORY_INSUFFICIENT);
}
}
-
+
/* We need to suspend ourselves. We will be resumed by the device enumeration module. */
_ux_device_thread_suspend(&cdc_ecm -> ux_slave_class_cdc_ecm_bulkout_thread);
}
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 f81065aa..fcb46d57 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
@@ -1,16 +1,17 @@
/***************************************************************************
- * Copyright (c) 2024 Microsoft Corporation
- *
+ * Copyright (c) 2024 Microsoft Corporation
+ * Copyright (c) 2026-present Eclipse ThreadX contributors
+ *
* This program and the accompanying materials are made available under the
* terms of the MIT License which is available at
* https://opensource.org/licenses/MIT.
- *
+ *
* SPDX-License-Identifier: MIT
**************************************************************************/
/**************************************************************************/
-/** */
-/** USBX Component */
+/** */
+/** USBX Component */
/** */
/** Device CDC_ECM Class */
/** */
@@ -27,30 +28,30 @@
#include "ux_device_stack.h"
-/**************************************************************************/
-/* */
-/* FUNCTION RELEASE */
-/* */
-/* _ux_device_class_cdc_ecm_change PORTABLE C */
+/**************************************************************************/
+/* */
+/* FUNCTION RELEASE */
+/* */
+/* _ux_device_class_cdc_ecm_change PORTABLE C */
/* 6.3.0 */
/* AUTHOR */
/* */
/* Chaoqiong Xiao, Microsoft Corporation */
/* */
/* DESCRIPTION */
-/* */
-/* This function changes the interface of the CDC_ECM device */
-/* */
-/* INPUT */
-/* */
-/* command Pointer to cdc_ecm command */
-/* */
-/* OUTPUT */
-/* */
-/* Completion Status */
-/* */
-/* CALLS */
-/* */
+/* */
+/* This function changes the interface of the CDC_ECM device */
+/* */
+/* INPUT */
+/* */
+/* command Pointer to cdc_ecm command */
+/* */
+/* OUTPUT */
+/* */
+/* Completion Status */
+/* */
+/* CALLS */
+/* */
/* _ux_network_driver_link_up Link status up */
/* _ux_network_driver_link_down Link status down */
/* _ux_utility_memory_set Set memory */
@@ -58,43 +59,16 @@
/* _ux_device_event_flags_set Set event flags */
/* _ux_device_stack_transfer_all_request_abort */
/* Abort transfer */
-/* */
-/* CALLED BY */
-/* */
-/* USBX Source Code */
-/* */
-/* RELEASE HISTORY */
-/* */
-/* DATE NAME DESCRIPTION */
-/* */
-/* 05-19-2020 Chaoqiong Xiao Initial Version 6.0 */
-/* 09-30-2020 Chaoqiong Xiao Modified comment(s), */
-/* verified memset and memcpy */
-/* cases, used UX prefix to */
-/* refer to TX symbols instead */
-/* of using them directly, */
-/* resulting in version 6.1 */
-/* 01-31-2022 Chaoqiong Xiao Modified comment(s), */
-/* refined macros names, */
-/* resulting in version 6.1.10 */
-/* 04-25-2022 Chaoqiong Xiao Modified comment(s), */
-/* fixed standalone compile, */
-/* resulting in version 6.1.11 */
-/* 07-29-2022 Chaoqiong Xiao Modified comment(s), */
-/* fixed parameter/variable */
-/* names conflict C++ keyword, */
-/* resulting in version 6.1.12 */
-/* 10-31-2023 Chaoqiong Xiao Modified comment(s), */
-/* added zero copy support, */
-/* added a new mode to manage */
-/* endpoint buffer in classes, */
-/* resulting in version 6.3.0 */
+/* */
+/* CALLED BY */
+/* */
+/* USBX Source Code */
/* */
/**************************************************************************/
UINT _ux_device_class_cdc_ecm_change(UX_SLAVE_CLASS_COMMAND *command)
{
-UX_SLAVE_INTERFACE *interface_ptr;
+UX_SLAVE_INTERFACE *interface_ptr;
UX_SLAVE_CLASS *class_ptr;
UX_SLAVE_CLASS_CDC_ECM *cdc_ecm;
UX_SLAVE_ENDPOINT *endpoint;
@@ -107,27 +81,27 @@ UX_SLAVE_ENDPOINT *endpoint;
/* Get the interface that owns this instance. */
interface_ptr = (UX_SLAVE_INTERFACE *) command -> ux_slave_class_command_interface;
-
+
/* Locate the endpoints. Control and Bulk in/out for Data Interface. */
endpoint = interface_ptr -> ux_slave_interface_first_endpoint;
-
+
/* If the interface to mount has a non zero alternate setting, the class is really active with
the endpoints active. If the interface reverts to alternate setting 0, it needs to have
the pending transactions terminated. */
- if (interface_ptr -> ux_slave_interface_descriptor.bAlternateSetting != 0)
+ if (interface_ptr -> ux_slave_interface_descriptor.bAlternateSetting != 0)
{
-
+
/* Parse all endpoints. */
while (endpoint != UX_NULL)
{
-
+
/* Check the endpoint direction, and type. */
if ((endpoint -> ux_slave_endpoint_descriptor.bEndpointAddress & UX_ENDPOINT_DIRECTION) == UX_ENDPOINT_IN)
{
-
+
/* Look at type. */
if ((endpoint -> ux_slave_endpoint_descriptor.bmAttributes & UX_MASK_ENDPOINT_TYPE) == UX_BULK_ENDPOINT)
-
+
/* We have found the bulk in endpoint, save it. */
cdc_ecm -> ux_slave_class_cdc_ecm_bulkin_endpoint = endpoint;
#if (UX_DEVICE_ENDPOINT_BUFFER_OWNER == 1) && !defined(UX_DEVICE_CLASS_CDC_ECM_ZERO_COPY)
@@ -140,7 +114,7 @@ UX_SLAVE_ENDPOINT *endpoint;
{
/* Look at type for out endpoint. */
if ((endpoint -> ux_slave_endpoint_descriptor.bmAttributes & UX_MASK_ENDPOINT_TYPE) == UX_BULK_ENDPOINT)
-
+
/* We have found the bulk out endpoint, save it. */
cdc_ecm -> ux_slave_class_cdc_ecm_bulkout_endpoint = endpoint;
#if (UX_DEVICE_ENDPOINT_BUFFER_OWNER == 1) && !defined(UX_DEVICE_CLASS_CDC_ECM_ZERO_COPY)
@@ -148,8 +122,8 @@ UX_SLAVE_ENDPOINT *endpoint;
ux_slave_transfer_request_data_pointer =
UX_DEVICE_CLASS_CDC_ECM_BULKOUT_BUFFER(cdc_ecm);
#endif
- }
-
+ }
+
/* Next endpoint. */
endpoint = endpoint -> ux_slave_endpoint_next_endpoint;
}
@@ -162,7 +136,7 @@ UX_SLAVE_ENDPOINT *endpoint;
/* Declare the link to be up. */
cdc_ecm -> ux_slave_class_cdc_ecm_link_state = UX_DEVICE_CLASS_CDC_ECM_LINK_STATE_UP;
-
+
/* Communicate the state with the network driver. */
_ux_network_driver_link_up(cdc_ecm -> ux_slave_class_cdc_ecm_network_handle);
@@ -172,25 +146,25 @@ UX_SLAVE_ENDPOINT *endpoint;
#else
/* Reset the endpoint buffers. */
- _ux_utility_memory_set(cdc_ecm -> ux_slave_class_cdc_ecm_bulkout_endpoint -> ux_slave_endpoint_transfer_request.
+ _ux_utility_memory_set(cdc_ecm -> ux_slave_class_cdc_ecm_bulkout_endpoint -> ux_slave_endpoint_transfer_request.
ux_slave_transfer_request_data_pointer, 0, UX_DEVICE_CLASS_CDC_ECM_BULKOUT_BUFFER_SIZE); /* Use case of memset is verified. */
- _ux_utility_memory_set(cdc_ecm -> ux_slave_class_cdc_ecm_bulkin_endpoint -> ux_slave_endpoint_transfer_request.
+ _ux_utility_memory_set(cdc_ecm -> ux_slave_class_cdc_ecm_bulkin_endpoint -> ux_slave_endpoint_transfer_request.
ux_slave_transfer_request_data_pointer, 0, UX_DEVICE_CLASS_CDC_ECM_BULKIN_BUFFER_SIZE); /* Use case of memset is verified. */
#endif
/* Resume the endpoint threads. */
- _ux_device_thread_resume(&cdc_ecm -> ux_slave_class_cdc_ecm_bulkout_thread);
- _ux_device_thread_resume(&cdc_ecm -> ux_slave_class_cdc_ecm_bulkin_thread);
-
+ _ux_device_thread_resume(&cdc_ecm -> ux_slave_class_cdc_ecm_bulkout_thread);
+ _ux_device_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_device_event_flags_set(&cdc_ecm -> ux_slave_class_cdc_ecm_event_flags_group, UX_DEVICE_CLASS_CDC_ECM_NETWORK_NOTIFICATION_EVENT, UX_OR);
+ _ux_device_event_flags_set(&cdc_ecm -> ux_slave_class_cdc_ecm_event_flags_group, UX_DEVICE_CLASS_CDC_ECM_NETWORK_NOTIFICATION_EVENT, UX_OR);
/* If 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)
/* Invoke the application. */
cdc_ecm -> ux_slave_class_cdc_ecm_parameter.ux_slave_class_cdc_ecm_instance_activate(cdc_ecm);
- }
+ }
else
{
@@ -198,7 +172,7 @@ UX_SLAVE_ENDPOINT *endpoint;
/* Declare the link to be down. */
cdc_ecm -> ux_slave_class_cdc_ecm_link_state = UX_DEVICE_CLASS_CDC_ECM_LINK_STATE_DOWN;
-
+
/* Communicate the state with the network driver. */
_ux_network_driver_link_down(cdc_ecm -> ux_slave_class_cdc_ecm_network_handle);
@@ -208,10 +182,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_device_event_flags_set(&cdc_ecm -> ux_slave_class_cdc_ecm_event_flags_group, UX_DEVICE_CLASS_CDC_ECM_NETWORK_NOTIFICATION_EVENT, UX_OR);
+ _ux_device_event_flags_set(&cdc_ecm -> ux_slave_class_cdc_ecm_event_flags_group, UX_DEVICE_CLASS_CDC_ECM_NETWORK_NOTIFICATION_EVENT, UX_OR);
/* Wake up the bulk in thread so that it can clean up the xmit queue. */
- _ux_device_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);
+ _ux_device_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 4d8f1a43..76179bb7 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
@@ -1,17 +1,18 @@
/***************************************************************************
- * Copyright (c) 2024 Microsoft Corporation
- *
+ * Copyright (c) 2024 Microsoft Corporation
+ * Copyright (c) 2026-present Eclipse ThreadX contributors
+ *
* This program and the accompanying materials are made available under the
* terms of the MIT License which is available at
* https://opensource.org/licenses/MIT.
- *
+ *
* SPDX-License-Identifier: MIT
**************************************************************************/
/**************************************************************************/
/**************************************************************************/
-/** */
-/** USBX Component */
+/** */
+/** USBX Component */
/** */
/** Device CDC_ECM Class */
/** */
@@ -27,48 +28,36 @@
#include "ux_device_class_cdc_ecm.h"
#include "ux_device_stack.h"
-/**************************************************************************/
-/* */
-/* FUNCTION RELEASE */
-/* */
-/* _ux_device_class_cdc_ecm_control_request PORTABLE C */
+/**************************************************************************/
+/* */
+/* FUNCTION RELEASE */
+/* */
+/* _ux_device_class_cdc_ecm_control_request PORTABLE C */
/* 6.1.12 */
/* AUTHOR */
/* */
/* Chaoqiong Xiao, Microsoft Corporation */
/* */
/* DESCRIPTION */
-/* */
-/* This function manages the based sent by the host on the control */
-/* endpoints with a CLASS or VENDOR SPECIFIC type. */
-/* */
-/* INPUT */
-/* */
-/* cdc_ecm Pointer to cdc_ecm class */
-/* */
-/* OUTPUT */
-/* */
-/* None */
-/* */
-/* CALLS */
-/* */
-/* _ux_utility_short_get Get 16-bit value */
-/* */
-/* CALLED BY */
-/* */
+/* */
+/* This function manages the based sent by the host on the control */
+/* endpoints with a CLASS or VENDOR SPECIFIC type. */
+/* */
+/* INPUT */
+/* */
+/* cdc_ecm Pointer to cdc_ecm class */
+/* */
+/* OUTPUT */
+/* */
+/* None */
+/* */
+/* CALLS */
+/* */
+/* _ux_utility_short_get Get 16-bit value */
+/* */
+/* CALLED BY */
+/* */
/* CDC_ECM Class */
-/* */
-/* RELEASE HISTORY */
-/* */
-/* DATE NAME DESCRIPTION */
-/* */
-/* 05-19-2020 Chaoqiong Xiao Initial Version 6.0 */
-/* 09-30-2020 Chaoqiong Xiao Modified comment(s), */
-/* resulting in version 6.1 */
-/* 07-29-2022 Chaoqiong Xiao Modified comment(s), */
-/* fixed parameter/variable */
-/* names conflict C++ keyword, */
-/* resulting in version 6.1.12 */
/* */
/**************************************************************************/
UINT _ux_device_class_cdc_ecm_control_request(UX_SLAVE_CLASS_COMMAND *command)
@@ -93,17 +82,17 @@ UX_SLAVE_CLASS_CDC_ECM *cdc_ecm;
/* Get the class container. */
class_ptr = command -> ux_slave_class_command_class_ptr;
-
+
/* Get the cdc_ecm instance from this class container. */
cdc_ecm = (UX_SLAVE_CLASS_CDC_ECM *) class_ptr -> ux_slave_class_instance;
-
+
/* Here we proceed only the standard request we know of at the device level. */
switch (request)
{
case UX_DEVICE_CLASS_CDC_ECM_SET_ETHERNET_MULTICAST_FILTER :
- /* Save the multicast filter. */
+ /* Save the multicast filter. */
cdc_ecm -> ux_slave_class_cdc_ecm_ethernet_multicast_filter = request_value;
break ;
@@ -118,7 +107,7 @@ UX_SLAVE_CLASS_CDC_ECM *cdc_ecm;
/* Save the packet filter. */
cdc_ecm -> ux_slave_class_cdc_ecm_ethernet_packet_filter = request_value;
break ;
-
+
case UX_DEVICE_CLASS_CDC_ECM_GET_ETHERNET_POWER_MANAGEMENT_FILTER :
default:
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 66359718..a54b41a2 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
@@ -1,17 +1,18 @@
/***************************************************************************
- * Copyright (c) 2024 Microsoft Corporation
- *
+ * Copyright (c) 2024 Microsoft Corporation
+ * Copyright (c) 2026-present Eclipse ThreadX contributors
+ *
* This program and the accompanying materials are made available under the
* terms of the MIT License which is available at
* https://opensource.org/licenses/MIT.
- *
+ *
* SPDX-License-Identifier: MIT
**************************************************************************/
/**************************************************************************/
/**************************************************************************/
-/** */
-/** USBX Component */
+/** */
+/** USBX Component */
/** */
/** Device CDC_ECM Class */
/** */
@@ -28,63 +29,45 @@
#include "ux_device_stack.h"
-/**************************************************************************/
-/* */
-/* FUNCTION RELEASE */
-/* */
-/* _ux_device_class_cdc_ecm_deactivate PORTABLE C */
+/**************************************************************************/
+/* */
+/* FUNCTION RELEASE */
+/* */
+/* _ux_device_class_cdc_ecm_deactivate PORTABLE C */
/* 6.1.12 */
/* AUTHOR */
/* */
/* Chaoqiong Xiao, Microsoft Corporation */
/* */
/* DESCRIPTION */
-/* */
-/* This function deactivate an instance of the cdc_ecm class. */
-/* */
-/* INPUT */
-/* */
-/* command Pointer to a class command */
-/* */
-/* OUTPUT */
-/* */
-/* Completion Status */
-/* */
-/* CALLS */
-/* */
+/* */
+/* This function deactivate an instance of the cdc_ecm class. */
+/* */
+/* INPUT */
+/* */
+/* command Pointer to a class command */
+/* */
+/* OUTPUT */
+/* */
+/* Completion Status */
+/* */
+/* CALLS */
+/* */
/* _ux_device_stack_transfer_all_request_abort */
/* Abort all transfers */
/* _ux_device_event_flags_set Set event flags */
/* _ux_network_driver_deactivate Deactivate NetX USB interface */
-/* */
-/* CALLED BY */
-/* */
+/* */
+/* CALLED BY */
+/* */
/* CDC_ECM Class */
-/* */
-/* RELEASE HISTORY */
-/* */
-/* 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 */
-/* 04-25-2022 Chaoqiong Xiao Modified comment(s), */
-/* fixed standalone compile, */
-/* resulting in version 6.1.11 */
-/* 07-29-2022 Chaoqiong Xiao Modified comment(s), */
-/* fixed parameter/variable */
-/* names conflict C++ keyword, */
-/* resulting in version 6.1.12 */
/* */
/**************************************************************************/
UINT _ux_device_class_cdc_ecm_deactivate(UX_SLAVE_CLASS_COMMAND *command)
{
-
+
UX_SLAVE_CLASS_CDC_ECM *cdc_ecm;
-UX_SLAVE_INTERFACE *interface_ptr;
+UX_SLAVE_INTERFACE *interface_ptr;
UX_SLAVE_CLASS *class_ptr;
/* Get the class container. */
@@ -98,7 +81,7 @@ UX_SLAVE_CLASS *class_ptr;
interface in the class container, we used the class_command pointer to retrieve the
correct interface which issued the deactivation. */
interface_ptr = (UX_SLAVE_INTERFACE *) command -> ux_slave_class_command_interface;
-
+
/* Check if this is the Control or Data interface. We only need to dismount the link and abort the
transfer once for the 2 classes. */
if (interface_ptr -> ux_slave_interface_descriptor.bInterfaceClass == UX_DEVICE_CLASS_CDC_ECM_CLASS_COMMUNICATION_CONTROL)
@@ -110,7 +93,7 @@ UX_SLAVE_CLASS *class_ptr;
/* Then we've found the bulk endpoints and started the threads. */
- /* Abort transfers. Note that since the bulk out thread is most likely waiting for
+ /* Abort transfers. Note that since the bulk out thread is most likely waiting for
a transfer from the host, this will allow it to resume and suspend itself. */
_ux_device_stack_transfer_all_request_abort(cdc_ecm -> ux_slave_class_cdc_ecm_bulkin_endpoint, UX_TRANSFER_BUS_RESET);
_ux_device_stack_transfer_all_request_abort(cdc_ecm -> ux_slave_class_cdc_ecm_bulkout_endpoint, UX_TRANSFER_BUS_RESET);
@@ -126,7 +109,7 @@ UX_SLAVE_CLASS *class_ptr;
_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_device_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);
+ _ux_device_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 08099a50..9c9c4457 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
@@ -1,5 +1,6 @@
/***************************************************************************
* Copyright (c) 2024 Microsoft Corporation
+ * Copyright (c) 2026-present Eclipse ThreadX contributors
*
* This program and the accompanying materials are made available under the
* terms of the MIT License which is available at
@@ -66,18 +67,6 @@
/* */
/* CDC_ECM Class */
/* */
-/* RELEASE HISTORY */
-/* */
-/* DATE NAME DESCRIPTION */
-/* */
-/* 05-19-2020 Chaoqiong Xiao Initial Version 6.0 */
-/* 09-30-2020 Chaoqiong Xiao Modified comment(s), */
-/* resulting in version 6.1 */
-/* xx-xx-xxxx Mohamed ayed Modified comment(s), */
-/* fix typo, */
-/* remove extra spaces, */
-/* resulting in version 6.x */
-/* */
/**************************************************************************/
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 0fe9fed4..a7faf29f 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
@@ -1,10 +1,11 @@
/***************************************************************************
- * Copyright (c) 2024 Microsoft Corporation
- *
+ * Copyright (c) 2024 Microsoft Corporation
+ * Copyright (c) 2026-present Eclipse ThreadX contributors
+ *
* This program and the accompanying materials are made available under the
* terms of the MIT License which is available at
* https://opensource.org/licenses/MIT.
- *
+ *
* SPDX-License-Identifier: MIT
**************************************************************************/
@@ -64,35 +65,6 @@
/* */
/* USBX Source Code */
/* */
-/* RELEASE HISTORY */
-/* */
-/* DATE NAME DESCRIPTION */
-/* */
-/* 05-19-2020 Chaoqiong Xiao Initial Version 6.0 */
-/* 09-30-2020 Chaoqiong Xiao Modified comment(s), */
-/* verified memset and memcpy */
-/* cases, used UX prefix to */
-/* refer to TX symbols instead */
-/* of using them directly, */
-/* resulting in version 6.1 */
-/* 01-31-2022 Chaoqiong Xiao Modified comment(s), */
-/* refined macros names, */
-/* resulting in version 6.1.10 */
-/* 04-25-2022 Chaoqiong Xiao Modified comment(s), */
-/* fixed standalone compile, */
-/* resulting in version 6.1.11 */
-/* 07-29-2022 Chaoqiong Xiao Modified comment(s), */
-/* fixed parameter/variable */
-/* names conflict C++ keyword, */
-/* resulting in version 6.1.12 */
-/* 10-31-2022 Chaoqiong Xiao Modified comment(s), */
-/* removed internal NX pool, */
-/* resulting in version 6.2.0 */
-/* 10-31-2023 Chaoqiong Xiao Modified comment(s), */
-/* added a new mode to manage */
-/* endpoint buffer in classes, */
-/* resulting in version 6.3.0 */
-/* */
/**************************************************************************/
UINT _ux_device_class_cdc_ecm_initialize(UX_SLAVE_CLASS_COMMAND *command)
{
diff --git a/common/usbx_device_classes/src/ux_device_class_cdc_ecm_interrupt_thread.c b/common/usbx_device_classes/src/ux_device_class_cdc_ecm_interrupt_thread.c
index f734c8d8..42dde1a3 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
@@ -1,17 +1,18 @@
/***************************************************************************
- * Copyright (c) 2024 Microsoft Corporation
- *
+ * Copyright (c) 2024 Microsoft Corporation
+ * Copyright (c) 2026-present Eclipse ThreadX contributors
+ *
* This program and the accompanying materials are made available under the
* terms of the MIT License which is available at
* https://opensource.org/licenses/MIT.
- *
+ *
* SPDX-License-Identifier: MIT
**************************************************************************/
/**************************************************************************/
/**************************************************************************/
-/** */
-/** USBX Component */
+/** */
+/** USBX Component */
/** */
/** Device CDC_ECM Class */
/** */
@@ -29,56 +30,39 @@
#if !defined(UX_DEVICE_STANDALONE)
-/**************************************************************************/
-/* */
-/* FUNCTION RELEASE */
-/* */
-/* _ux_device_class_cdc_ecm_interrupt_thread PORTABLE C */
+/**************************************************************************/
+/* */
+/* FUNCTION RELEASE */
+/* */
+/* _ux_device_class_cdc_ecm_interrupt_thread PORTABLE C */
/* 6.1.11 */
/* AUTHOR */
/* */
/* Chaoqiong Xiao, Microsoft Corporation */
/* */
/* DESCRIPTION */
-/* */
-/* This function is the thread of the cdc_ecm interrupt endpoint */
-/* */
-/* INPUT */
-/* */
-/* cdc_ecm_class Address of cdc_ecm class */
-/* container */
-/* */
-/* OUTPUT */
-/* */
-/* None */
-/* */
-/* CALLS */
-/* */
-/* _ux_device_stack_transfer_request Request transfer */
+/* */
+/* This function is the thread of the cdc_ecm interrupt endpoint */
+/* */
+/* INPUT */
+/* */
+/* cdc_ecm_class Address of cdc_ecm class */
+/* container */
+/* */
+/* OUTPUT */
+/* */
+/* None */
+/* */
+/* CALLS */
+/* */
+/* _ux_device_stack_transfer_request Request transfer */
/* _ux_utility_event_flags_get Get event flags */
/* _ux_utility_short_put Put 16-bit value to buffer */
/* _ux_device_thread_suspend Suspend thread */
-/* */
-/* CALLED BY */
-/* */
-/* ThreadX */
-/* */
-/* RELEASE HISTORY */
-/* */
-/* 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 */
-/* 01-31-2022 Chaoqiong Xiao Modified comment(s), */
-/* refined macros names, */
-/* resulting in version 6.1.10 */
-/* 04-25-2022 Chaoqiong Xiao Modified comment(s), */
-/* fixed standalone compile, */
-/* resulting in version 6.1.11 */
+/* */
+/* CALLED BY */
+/* */
+/* ThreadX */
/* */
/**************************************************************************/
VOID _ux_device_class_cdc_ecm_interrupt_thread(ULONG cdc_ecm_class)
@@ -94,13 +78,13 @@ UCHAR *notification_buffer;
/* Cast properly the cdc_ecm instance. */
UX_THREAD_EXTENSION_PTR_GET(class_ptr, UX_SLAVE_CLASS, cdc_ecm_class)
-
+
/* Get the cdc_ecm instance from this class container. */
cdc_ecm = (UX_SLAVE_CLASS_CDC_ECM *) class_ptr -> ux_slave_class_instance;
-
+
/* Get the pointer to the device. */
device = &_ux_system_slave -> ux_system_slave_device;
-
+
/* This thread runs forever but can be suspended or resumed. */
while(1)
{
@@ -110,13 +94,13 @@ UCHAR *notification_buffer;
/* As long as the device is in the CONFIGURED state. */
while (device -> ux_slave_device_state == UX_DEVICE_CONFIGURED)
- {
+ {
/* Wait until we have a event sent by the application. We do not treat yet the case where a timeout based
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,
+ _ux_utility_event_flags_get(&cdc_ecm -> ux_slave_class_cdc_ecm_event_flags_group,
+ UX_DEVICE_CLASS_CDC_ECM_NETWORK_NOTIFICATION_EVENT,
UX_OR_CLEAR, &actual_flags, UX_WAIT_FOREVER);
/* Build the Network Notification response. */
@@ -127,7 +111,7 @@ UCHAR *notification_buffer;
/* Set the request itself. */
*(notification_buffer + UX_SETUP_REQUEST) = 0;
-
+
/* Set the value. It is the network link. */
_ux_utility_short_put(notification_buffer + UX_SETUP_VALUE, (USHORT)(cdc_ecm -> ux_slave_class_cdc_ecm_link_state));
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 21c802dc..44cec34f 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
@@ -1,18 +1,19 @@
/***************************************************************************
- * Copyright (c) 2024 Microsoft Corporation
- *
+ * Copyright (c) 2024 Microsoft Corporation
+ * Copyright (c) 2026-present Eclipse ThreadX contributors
+ *
* This program and the accompanying materials are made available under the
* terms of the MIT License which is available at
* https://opensource.org/licenses/MIT.
- *
+ *
* SPDX-License-Identifier: MIT
**************************************************************************/
/**************************************************************************/
/**************************************************************************/
-/** */
-/** USBX Component */
+/** */
+/** USBX Component */
/** */
/** Device CDC-ECM Class */
/** */
@@ -29,70 +30,45 @@
#include "ux_device_stack.h"
-/**************************************************************************/
-/* */
-/* FUNCTION RELEASE */
-/* */
-/* _ux_device_class_cdc_ecm_uninitialize PORTABLE C */
+/**************************************************************************/
+/* */
+/* FUNCTION RELEASE */
+/* */
+/* _ux_device_class_cdc_ecm_uninitialize PORTABLE C */
/* 6.3.0 */
/* AUTHOR */
/* */
/* Chaoqiong Xiao, Microsoft Corporation */
/* */
/* DESCRIPTION */
-/* */
-/* This function deinitializes the resources for the specified CDC-ECM */
-/* instance. */
-/* */
-/* INPUT */
-/* */
+/* */
+/* This function deinitializes the resources for the specified CDC-ECM */
+/* instance. */
+/* */
+/* INPUT */
+/* */
/* command Pointer to cdc ecm command */
-/* */
-/* OUTPUT */
-/* */
-/* Completion Status */
-/* */
-/* CALLS */
-/* */
-/* _ux_device_mutex_delete Delete mutex */
-/* _ux_device_thread_delete Delete thread */
-/* _ux_utility_memory_free Free memory */
-/* _ux_utility_event_flags_delete Delete event flags */
-/* _ux_device_semaphore_delete Delete semaphore */
-/* */
-/* CALLED BY */
-/* */
-/* Device CDC-ECM Class */
-/* */
-/* RELEASE HISTORY */
-/* */
-/* DATE NAME DESCRIPTION */
-/* */
-/* 05-19-2020 Chaoqiong Xiao Initial Version 6.0 */
-/* 09-30-2020 Chaoqiong Xiao Modified comment(s), */
-/* resulting in version 6.1 */
-/* 01-31-2022 Chaoqiong Xiao Modified comment(s), */
-/* refined macros names, */
-/* resulting in version 6.1.10 */
-/* 04-25-2022 Chaoqiong Xiao Modified comment(s), */
-/* fixed standalone compile, */
-/* resulting in version 6.1.11 */
-/* 07-29-2022 Chaoqiong Xiao Modified comment(s), */
-/* fixed parameter/variable */
-/* names conflict C++ keyword, */
-/* resulting in version 6.1.12 */
-/* 10-31-2022 Chaoqiong Xiao Modified comment(s), */
-/* removed internal NX pool, */
-/* resulting in version 6.2.0 */
-/* 10-31-2023 Chaoqiong Xiao Modified comment(s), */
-/* added a new mode to manage */
-/* endpoint buffer in classes, */
-/* resulting in version 6.3.0 */
+/* */
+/* OUTPUT */
+/* */
+/* Completion Status */
+/* */
+/* CALLS */
+/* */
+/* _ux_device_mutex_delete Delete mutex */
+/* _ux_device_thread_delete Delete thread */
+/* _ux_utility_memory_free Free memory */
+/* _ux_utility_event_flags_delete Delete event flags */
+/* _ux_device_semaphore_delete Delete semaphore */
+/* */
+/* CALLED BY */
+/* */
+/* Device CDC-ECM Class */
/* */
/**************************************************************************/
UINT _ux_device_class_cdc_ecm_uninitialize(UX_SLAVE_CLASS_COMMAND *command)
{
-
+
UX_SLAVE_CLASS_CDC_ECM *cdc_ecm;
UX_SLAVE_CLASS *class_ptr;
@@ -102,7 +78,7 @@ UX_SLAVE_CLASS *class_ptr;
/* Get the class instance in the container. */
cdc_ecm = (UX_SLAVE_CLASS_CDC_ECM *) class_ptr -> ux_slave_class_instance;
-
+
/* Sanity check. */
if (cdc_ecm != UX_NULL)
{
@@ -145,7 +121,7 @@ UX_SLAVE_CLASS *class_ptr;
#endif
_ux_utility_memory_free(cdc_ecm);
}
-
+
/* Return completion status. */
return(UX_SUCCESS);
}
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 0553946d..6cf0ab93 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
@@ -1,17 +1,18 @@
/***************************************************************************
- * Copyright (c) 2024 Microsoft Corporation
- *
+ * Copyright (c) 2024 Microsoft Corporation
+ * Copyright (c) 2026-present Eclipse ThreadX contributors
+ *
* This program and the accompanying materials are made available under the
* terms of the MIT License which is available at
* https://opensource.org/licenses/MIT.
- *
+ *
* SPDX-License-Identifier: MIT
**************************************************************************/
/**************************************************************************/
/**************************************************************************/
-/** */
-/** USBX Component */
+/** */
+/** USBX Component */
/** */
/** Device CDC_ECM Class */
/** */
@@ -28,53 +29,39 @@
#include "ux_device_stack.h"
-/**************************************************************************/
-/* */
-/* FUNCTION RELEASE */
-/* */
-/* _ux_device_class_cdc_ecm_write PORTABLE C */
+/**************************************************************************/
+/* */
+/* FUNCTION RELEASE */
+/* */
+/* _ux_device_class_cdc_ecm_write PORTABLE C */
/* 6.1.11 */
/* AUTHOR */
/* */
/* Chaoqiong Xiao, Microsoft Corporation */
/* */
/* DESCRIPTION */
-/* */
-/* This function writes a packet into a queue for later thread */
-/* processing. */
-/* */
-/* INPUT */
-/* */
-/* cdc_ecm Address of cdc_ecm class */
-/* instance */
-/* */
-/* OUTPUT */
-/* */
-/* None */
-/* */
-/* CALLS */
-/* */
-/* _ux_device_stack_transfer_request Transfer request */
+/* */
+/* This function writes a packet into a queue for later thread */
+/* processing. */
+/* */
+/* INPUT */
+/* */
+/* cdc_ecm Address of cdc_ecm class */
+/* instance */
+/* */
+/* OUTPUT */
+/* */
+/* None */
+/* */
+/* CALLS */
+/* */
+/* _ux_device_stack_transfer_request Transfer request */
/* _ux_device_mutex_off Release mutex */
/* _ux_device_event_flags_set Set event flags */
-/* */
-/* CALLED BY */
-/* */
-/* ThreadX */
-/* */
-/* RELEASE HISTORY */
-/* */
-/* 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 */
-/* 04-25-2022 Chaoqiong Xiao Modified comment(s), */
-/* fixed standalone compile, */
-/* resulting in version 6.1.11 */
+/* */
+/* CALLED BY */
+/* */
+/* ThreadX */
/* */
/**************************************************************************/
UINT _ux_device_class_cdc_ecm_write(VOID *cdc_ecm_class, NX_PACKET *packet)
@@ -105,13 +92,13 @@ UX_SLAVE_CLASS_CDC_ECM *cdc_ecm;
cdc_ecm -> ux_slave_class_cdc_ecm_xmit_queue = packet;
else
-
+
/* Add the packet to the end of the queue. */
cdc_ecm -> ux_slave_class_cdc_ecm_xmit_queue_tail -> nx_packet_queue_next = packet;
/* Set the tail. */
cdc_ecm -> ux_slave_class_cdc_ecm_xmit_queue_tail = packet;
-
+
/* The packet to be sent is the last in the chain. */
packet -> nx_packet_queue_next = NX_NULL;
@@ -119,7 +106,7 @@ UX_SLAVE_CLASS_CDC_ECM *cdc_ecm;
_ux_device_mutex_off(&cdc_ecm -> ux_slave_class_cdc_ecm_mutex);
/* Set an event to wake up the bulkin thread. */
- _ux_device_event_flags_set(&cdc_ecm -> ux_slave_class_cdc_ecm_event_flags_group, UX_DEVICE_CLASS_CDC_ECM_NEW_BULKIN_EVENT, UX_OR);
+ _ux_device_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;
@@ -138,6 +125,6 @@ UX_SLAVE_CLASS_CDC_ECM *cdc_ecm;
}
/* We are done here. */
- return(status);
+ return(status);
#endif
}
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 27fb49e6..371380a6 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
@@ -1,16 +1,17 @@
/***************************************************************************
- * Copyright (c) 2024 Microsoft Corporation
- *
+ * Copyright (c) 2024 Microsoft Corporation
+ * Copyright (c) 2026-present Eclipse ThreadX contributors
+ *
* This program and the accompanying materials are made available under the
* terms of the MIT License which is available at
* https://opensource.org/licenses/MIT.
- *
+ *
* SPDX-License-Identifier: MIT
**************************************************************************/
/**************************************************************************/
-/** */
-/** USBX Component */
+/** */
+/** USBX Component */
/** */
/** Device DFU Class */
/** */
@@ -27,64 +28,46 @@
#include "ux_device_stack.h"
-/**************************************************************************/
-/* */
-/* FUNCTION RELEASE */
-/* */
-/* _ux_device_class_dfu_activate PORTABLE C */
+/**************************************************************************/
+/* */
+/* FUNCTION RELEASE */
+/* */
+/* _ux_device_class_dfu_activate PORTABLE C */
/* 6.1.12 */
/* AUTHOR */
/* */
/* Chaoqiong Xiao, Microsoft Corporation */
/* */
/* DESCRIPTION */
-/* */
-/* This function initializes the USB DFU device. */
-/* This class can be activated either as part of the device primary */
-/* framework or after a PORT_RESET detected. */
-/* This is detected through the protocol field. If 1, we are in the */
-/* device regular mode. If 2, we are activated through the DFU */
-/* mode. */
-/* */
-/* INPUT */
-/* */
-/* command Pointer to dfu command */
-/* */
-/* OUTPUT */
-/* */
-/* Completion Status */
-/* */
-/* CALLS */
-/* */
-/* _ux_utility_memory_allocate Allocate memory */
-/* */
-/* CALLED BY */
-/* */
-/* USBX Source Code */
-/* */
-/* RELEASE HISTORY */
-/* */
-/* DATE NAME DESCRIPTION */
-/* */
-/* 05-19-2020 Chaoqiong Xiao Initial Version 6.0 */
-/* 09-30-2020 Chaoqiong Xiao Modified comment(s), */
-/* resulting in version 6.1 */
-/* 04-02-2021 Chaoqiong Xiao Modified comment(s), */
-/* removed block count (it's */
-/* from host request wValue), */
-/* resulting in version 6.1.6 */
-/* 01-31-2022 Chaoqiong Xiao Modified comment(s), */
-/* resulting in version 6.1.10 */
-/* 07-29-2022 Chaoqiong Xiao Modified comment(s), */
-/* fixed parameter/variable */
-/* names conflict C++ keyword, */
-/* resulting in version 6.1.12 */
+/* */
+/* This function initializes the USB DFU device. */
+/* This class can be activated either as part of the device primary */
+/* framework or after a PORT_RESET detected. */
+/* This is detected through the protocol field. If 1, we are in the */
+/* device regular mode. If 2, we are activated through the DFU */
+/* mode. */
+/* */
+/* INPUT */
+/* */
+/* command Pointer to dfu command */
+/* */
+/* OUTPUT */
+/* */
+/* Completion Status */
+/* */
+/* CALLS */
+/* */
+/* _ux_utility_memory_allocate Allocate memory */
+/* */
+/* CALLED BY */
+/* */
+/* USBX Source Code */
/* */
/**************************************************************************/
UINT _ux_device_class_dfu_activate(UX_SLAVE_CLASS_COMMAND *command)
{
-
-UX_SLAVE_INTERFACE *interface_ptr;
+
+UX_SLAVE_INTERFACE *interface_ptr;
UX_SLAVE_CLASS *class_ptr;
UX_SLAVE_CLASS_DFU *dfu;
@@ -96,10 +79,10 @@ UX_SLAVE_CLASS_DFU *dfu;
/* Get the interface that owns this instance. */
interface_ptr = (UX_SLAVE_INTERFACE *) command -> ux_slave_class_command_interface;
-
+
/* Store the class instance into the interface. */
interface_ptr -> ux_slave_interface_class_instance = (VOID *)dfu;
-
+
/* Now the opposite, store the interface in the class instance. */
dfu -> ux_slave_class_dfu_interface = interface_ptr;
@@ -107,9 +90,9 @@ UX_SLAVE_CLASS_DFU *dfu;
we are. */
switch (command -> ux_slave_class_command_protocol)
{
-
+
case UX_SLAVE_CLASS_DFU_PROTOCOL_RUNTIME :
-
+
/* In the system, state the DFU state machine to application idle. */
_ux_system_slave -> ux_system_slave_device_dfu_state_machine = UX_SYSTEM_DFU_STATE_APP_IDLE;
@@ -120,26 +103,26 @@ UX_SLAVE_CLASS_DFU *dfu;
case UX_SLAVE_CLASS_DFU_PROTOCOL_DFU_MODE :
-
+
/* In the system, state the DFU state machine to DFU idle. */
_ux_system_slave -> ux_system_slave_device_dfu_state_machine = UX_SYSTEM_DFU_STATE_DFU_IDLE;
/* Set the mode to DFU mode. */
_ux_system_slave -> ux_system_slave_device_dfu_mode = UX_DEVICE_CLASS_DFU_MODE_DFU ;
- break;
+ break;
default :
-
+
/* We should never get here. */
return(UX_ERROR);
-
+
}
-
-
+
+
/* If there is a activate function call it. */
if (dfu -> ux_slave_class_dfu_instance_activate != UX_NULL)
- {
+ {
/* Invoke the application. */
dfu -> ux_slave_class_dfu_instance_activate(dfu);
}
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 4bb00f20..d93fa02c 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
@@ -1,10 +1,11 @@
/***************************************************************************
- * Copyright (c) 2024 Microsoft Corporation
- *
+ * Copyright (c) 2024 Microsoft Corporation
+ * Copyright (c) 2026-present Eclipse ThreadX contributors
+ *
* This program and the accompanying materials are made available under the
* terms of the MIT License which is available at
* https://opensource.org/licenses/MIT.
- *
+ *
* SPDX-License-Identifier: MIT
**************************************************************************/
@@ -66,40 +67,6 @@ static inline VOID _ux_device_class_dfu_status_get(UX_SLAVE_CLASS_DFU *,
/* */
/* DFU Class */
/* */
-/* RELEASE HISTORY */
-/* */
-/* 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 */
-/* 04-02-2021 Chaoqiong Xiao Modified comment(s), */
-/* added DFU_UPLOAD support, */
-/* removed block count (it's */
-/* from host request wValue), */
-/* resulting in version 6.1.6 */
-/* 10-15-2021 Chaoqiong Xiao Modified comment(s), */
-/* fixed compile warning, */
-/* resulting in version 6.1.9 */
-/* 01-31-2022 Chaoqiong Xiao Modified comment(s), */
-/* added UPLOAD length check, */
-/* added standalone support, */
-/* resulting in version 6.1.10 */
-/* 04-25-2022 Chaoqiong Xiao Modified comment(s), */
-/* checked r/w callback status,*/
-/* resulting in version 6.1.11 */
-/* 07-29-2022 Chaoqiong Xiao Modified comment(s), */
-/* fixed parameter/variable */
-/* names conflict C++ keyword, */
-/* added UPLOAD length check */
-/* in _UPLOAD_IDLE state, */
-/* added DNLOAD REQ */
-/* validation, */
-/* resulting in version 6.1.12 */
-/* */
/**************************************************************************/
UINT _ux_device_class_dfu_control_request(UX_SLAVE_CLASS_COMMAND *command)
{
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 c04d280d..2b6ea152 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
@@ -1,17 +1,18 @@
/***************************************************************************
- * Copyright (c) 2024 Microsoft Corporation
- *
+ * Copyright (c) 2024 Microsoft Corporation
+ * Copyright (c) 2026-present Eclipse ThreadX contributors
+ *
* This program and the accompanying materials are made available under the
* terms of the MIT License which is available at
* https://opensource.org/licenses/MIT.
- *
+ *
* SPDX-License-Identifier: MIT
**************************************************************************/
/**************************************************************************/
/**************************************************************************/
-/** */
-/** USBX Component */
+/** */
+/** USBX Component */
/** */
/** Device DFU Class */
/** */
@@ -28,55 +29,40 @@
#include "ux_device_stack.h"
-/**************************************************************************/
-/* */
-/* FUNCTION RELEASE */
-/* */
-/* _ux_device_class_dfu_deactivate PORTABLE C */
+/**************************************************************************/
+/* */
+/* FUNCTION RELEASE */
+/* */
+/* _ux_device_class_dfu_deactivate PORTABLE C */
/* 6.1.12 */
/* AUTHOR */
/* */
/* Chaoqiong Xiao, Microsoft Corporation */
/* */
/* DESCRIPTION */
-/* */
-/* This function deactivate an instance of the dfu class. */
-/* */
-/* INPUT */
-/* */
-/* command Pointer to a class command */
-/* */
-/* OUTPUT */
-/* */
-/* Completion Status */
-/* */
-/* CALLS */
-/* */
-/* _ux_device_stack_transfer_all_request_abort Abort all transfers */
-/* */
-/* CALLED BY */
-/* */
+/* */
+/* This function deactivate an instance of the dfu class. */
+/* */
+/* INPUT */
+/* */
+/* command Pointer to a class command */
+/* */
+/* OUTPUT */
+/* */
+/* Completion Status */
+/* */
+/* CALLS */
+/* */
+/* _ux_device_stack_transfer_all_request_abort Abort all transfers */
+/* */
+/* CALLED BY */
+/* */
/* DFU Class */
-/* */
-/* RELEASE HISTORY */
-/* */
-/* DATE NAME DESCRIPTION */
-/* */
-/* 05-19-2020 Chaoqiong Xiao Initial Version 6.0 */
-/* 09-30-2020 Chaoqiong Xiao Modified comment(s), */
-/* resulting in version 6.1 */
-/* 04-02-2021 Chaoqiong Xiao Modified comment(s), */
-/* removed endpoints aborting, */
-/* resulting in version 6.1.6 */
-/* 07-29-2022 Chaoqiong Xiao Modified comment(s), */
-/* fixed parameter/variable */
-/* names conflict C++ keyword, */
-/* resulting in version 6.1.12 */
/* */
/**************************************************************************/
UINT _ux_device_class_dfu_deactivate(UX_SLAVE_CLASS_COMMAND *command)
{
-
+
UX_SLAVE_CLASS_DFU *dfu;
UX_SLAVE_CLASS *class_ptr;
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 772e6831..f6651d3e 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
@@ -1,5 +1,6 @@
/***************************************************************************
* Copyright (c) 2024 Microsoft Corporation
+ * Copyright (c) 2026-present Eclipse ThreadX contributors
*
* This program and the accompanying materials are made available under the
* terms of the MIT License which is available at
@@ -65,22 +66,6 @@
/* */
/* DFU Class */
/* */
-/* RELEASE HISTORY */
-/* */
-/* DATE NAME DESCRIPTION */
-/* */
-/* 05-19-2020 Chaoqiong Xiao Initial Version 6.0 */
-/* 09-30-2020 Chaoqiong Xiao Modified comment(s), */
-/* resulting in version 6.1 */
-/* 10-31-2023 Yajun Xia Modified comment(s), */
-/* added error checks support, */
-/* resulting in version 6.3.0 */
-/* xx-xx-xxxx Mohamed ayed Modified comment(s), */
-/* added call of dfu uninit */
-/* function, */
-/* remove extra spaces, */
-/* resulting in version 6.x */
-/* */
/**************************************************************************/
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 ef72054a..78c49f03 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
@@ -1,10 +1,11 @@
/***************************************************************************
- * Copyright (c) 2024 Microsoft Corporation
- *
+ * Copyright (c) 2024 Microsoft Corporation
+ * Copyright (c) 2026-present Eclipse ThreadX contributors
+ *
* This program and the accompanying materials are made available under the
* terms of the MIT License which is available at
* https://opensource.org/licenses/MIT.
- *
+ *
* SPDX-License-Identifier: MIT
**************************************************************************/
@@ -62,31 +63,6 @@
/* */
/* USBX Source Code */
/* */
-/* RELEASE HISTORY */
-/* */
-/* 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 */
-/* 04-02-2021 Chaoqiong Xiao Modified comment(s), */
-/* fixed max transfer size, */
-/* added max size limit check, */
-/* resulting in version 6.1.6 */
-/* 01-31-2022 Chaoqiong Xiao Modified comment(s), */
-/* added standalone support, */
-/* resulting in version 6.1.10 */
-/* 04-25-2022 Chaoqiong Xiao Modified comment(s), */
-/* internal clean up, */
-/* resulting in version 6.1.11 */
-/* 07-29-2022 Chaoqiong Xiao Modified comment(s), */
-/* fixed parameter/variable */
-/* names conflict C++ keyword, */
-/* resulting in version 6.1.12 */
-/* */
/**************************************************************************/
UINT _ux_device_class_dfu_initialize(UX_SLAVE_CLASS_COMMAND *command)
{
@@ -243,7 +219,7 @@ ULONG descriptor_length;
/* The last resource, thread is not created or created error, no need to free. */
if (dfu -> ux_slave_class_dfu_thread_stack)
_ux_utility_memory_free(dfu -> ux_slave_class_dfu_thread_stack);
- if (dfu -> ux_slave_class_dfu_event_flags_group.tx_event_flags_group_id != 0)
+ if (_ux_device_event_flags_created(&dfu -> ux_slave_class_dfu_event_flags_group))
_ux_utility_event_flags_delete(&dfu -> ux_slave_class_dfu_event_flags_group);
#endif
@@ -286,12 +262,6 @@ ULONG descriptor_length;
/* */
/* USBX Source Code */
/* */
-/* RELEASE HISTORY */
-/* */
-/* DATE NAME DESCRIPTION */
-/* */
-/* 10-31-2023 Yajun Xia Initial Version 6.3.0 */
-/* */
/**************************************************************************/
UINT _uxe_device_class_dfu_initialize(UX_SLAVE_CLASS_COMMAND *command)
{
diff --git a/common/usbx_device_classes/src/ux_device_class_dfu_state_get.c b/common/usbx_device_classes/src/ux_device_class_dfu_state_get.c
index 01bf7f5f..e93f7931 100644
--- a/common/usbx_device_classes/src/ux_device_class_dfu_state_get.c
+++ b/common/usbx_device_classes/src/ux_device_class_dfu_state_get.c
@@ -1,10 +1,11 @@
/***************************************************************************
- * Copyright (c) 2024 Microsoft Corporation
- *
+ * Copyright (c) 2024 Microsoft Corporation
+ * Copyright (c) 2026-present Eclipse ThreadX contributors
+ *
* This program and the accompanying materials are made available under the
* terms of the MIT License which is available at
* https://opensource.org/licenses/MIT.
- *
+ *
* SPDX-License-Identifier: MIT
**************************************************************************/
@@ -58,12 +59,6 @@
/* Application Code */
/* USBX Source Code */
/* */
-/* RELEASE HISTORY */
-/* */
-/* DATE NAME DESCRIPTION */
-/* */
-/* 04-02-2021 Chaoqiong Xiao Initial Version 6.1.6 */
-/* */
/**************************************************************************/
UCHAR _ux_device_class_dfu_state_get(UX_SLAVE_CLASS_DFU *dfu)
{
diff --git a/common/usbx_device_classes/src/ux_device_class_dfu_state_sync.c b/common/usbx_device_classes/src/ux_device_class_dfu_state_sync.c
index b28d96cb..2c316679 100644
--- a/common/usbx_device_classes/src/ux_device_class_dfu_state_sync.c
+++ b/common/usbx_device_classes/src/ux_device_class_dfu_state_sync.c
@@ -1,10 +1,11 @@
/***************************************************************************
- * Copyright (c) 2024 Microsoft Corporation
- *
+ * Copyright (c) 2024 Microsoft Corporation
+ * Copyright (c) 2026-present Eclipse ThreadX contributors
+ *
* This program and the accompanying materials are made available under the
* terms of the MIT License which is available at
* https://opensource.org/licenses/MIT.
- *
+ *
* SPDX-License-Identifier: MIT
**************************************************************************/
@@ -66,12 +67,6 @@
/* Application Code */
/* USBX Source Code */
/* */
-/* RELEASE HISTORY */
-/* */
-/* DATE NAME DESCRIPTION */
-/* */
-/* 04-02-2021 Chaoqiong Xiao Initial Version 6.1.6 */
-/* */
/**************************************************************************/
VOID _ux_device_class_dfu_state_sync(UX_SLAVE_CLASS_DFU *dfu)
{
diff --git a/common/usbx_device_classes/src/ux_device_class_dfu_tasks_run.c b/common/usbx_device_classes/src/ux_device_class_dfu_tasks_run.c
index dfb03781..be100c6f 100644
--- a/common/usbx_device_classes/src/ux_device_class_dfu_tasks_run.c
+++ b/common/usbx_device_classes/src/ux_device_class_dfu_tasks_run.c
@@ -1,10 +1,11 @@
/***************************************************************************
- * Copyright (c) 2024 Microsoft Corporation
- *
+ * Copyright (c) 2024 Microsoft Corporation
+ * Copyright (c) 2026-present Eclipse ThreadX contributors
+ *
* This program and the accompanying materials are made available under the
* terms of the MIT License which is available at
* https://opensource.org/licenses/MIT.
- *
+ *
* SPDX-License-Identifier: MIT
**************************************************************************/
@@ -61,12 +62,6 @@
/* */
/* USBX */
/* */
-/* RELEASE HISTORY */
-/* */
-/* DATE NAME DESCRIPTION */
-/* */
-/* 01-31-2022 Chaoqiong Xiao Initial Version 6.1.10 */
-/* */
/**************************************************************************/
UINT _ux_device_class_dfu_tasks_run(VOID *class_instance)
{
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 1c833c53..1632cdea 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
@@ -1,17 +1,18 @@
/***************************************************************************
- * Copyright (c) 2024 Microsoft Corporation
- *
+ * Copyright (c) 2024 Microsoft Corporation
+ * Copyright (c) 2026-present Eclipse ThreadX contributors
+ *
* This program and the accompanying materials are made available under the
* terms of the MIT License which is available at
* https://opensource.org/licenses/MIT.
- *
+ *
* SPDX-License-Identifier: MIT
**************************************************************************/
/**************************************************************************/
/**************************************************************************/
-/** */
-/** USBX Component */
+/** */
+/** USBX Component */
/** */
/** Device dfu Class */
/** */
@@ -29,54 +30,41 @@
#if !defined(UX_DEVICE_STANDALONE)
-/**************************************************************************/
-/* */
-/* FUNCTION RELEASE */
-/* */
-/* _ux_device_class_dfu_thread PORTABLE C */
+/**************************************************************************/
+/* */
+/* FUNCTION RELEASE */
+/* */
+/* _ux_device_class_dfu_thread PORTABLE C */
/* 6.1.10 */
/* AUTHOR */
/* */
/* Chaoqiong Xiao, Microsoft Corporation */
/* */
/* DESCRIPTION */
-/* */
+/* */
/* This function is the thread of the dfu class. It waits for the */
-/* dfu command to signal a DFU_DETACH stage and either force a */
-/* disconnect from the device or wait for the host to detach. */
+/* dfu command to signal a DFU_DETACH stage and either force a */
+/* disconnect from the device or wait for the host to detach. */
/* */
/* It's for RTOS mode. */
-/* */
-/* INPUT */
-/* */
-/* dfu_class Address of dfu class */
-/* container */
-/* */
-/* OUTPUT */
-/* */
-/* None */
-/* */
-/* CALLS */
-/* */
-/* _ux_utility_event_flags_get Get event flags */
-/* _ux_utility_delay_ms Delay in milliseconds */
-/* */
-/* CALLED BY */
-/* */
-/* ThreadX */
-/* */
-/* RELEASE HISTORY */
-/* */
-/* 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 */
-/* 01-31-2022 Chaoqiong Xiao Modified comment(s), */
-/* resulting in version 6.1.10 */
+/* */
+/* INPUT */
+/* */
+/* dfu_class Address of dfu class */
+/* container */
+/* */
+/* OUTPUT */
+/* */
+/* None */
+/* */
+/* CALLS */
+/* */
+/* _ux_utility_event_flags_get Get event flags */
+/* _ux_utility_delay_ms Delay in milliseconds */
+/* */
+/* CALLED BY */
+/* */
+/* ThreadX */
/* */
/**************************************************************************/
VOID _ux_device_class_dfu_thread(ULONG dfu_class)
@@ -90,28 +78,28 @@ ULONG actual_flags;
/* Cast properly the dfu instance. */
UX_THREAD_EXTENSION_PTR_GET(class_ptr, UX_SLAVE_CLASS, dfu_class)
-
+
/* Get the dfu instance from this class container. */
dfu = (UX_SLAVE_CLASS_DFU *) class_ptr -> ux_slave_class_instance;
-
+
/* This thread runs forever. */
while(1)
{
-
+
/* 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),
+ UX_DEVICE_CLASS_DFU_THREAD_EVENT_WAIT_RESET),
UX_OR_CLEAR, &actual_flags, UX_WAIT_FOREVER);
-
+
/* Check the completion code and the actual flags returned. */
if (status == UX_SUCCESS)
{
-
+
/* Check the source of event. */
if (actual_flags & UX_DEVICE_CLASS_DFU_THREAD_EVENT_DISCONNECT)
{
-
+
/* We need to disconnect. The control command for DETACH is still being processed, wait 2-3 ms. */
_ux_utility_delay_ms(2);
@@ -120,25 +108,25 @@ ULONG actual_flags;
/* Issue a Soft Disconnect. */
dcd -> ux_slave_dcd_function(dcd, UX_DCD_CHANGE_STATE, (VOID *) UX_DEVICE_FORCE_DISCONNECT);
-
- }
-
+
+ }
+
/* Check the source of event. */
if (actual_flags & UX_DEVICE_CLASS_DFU_THREAD_EVENT_WAIT_RESET)
{
-
+
/* We need to wait for reset. Arm a timer. The timeout value is indicated in ms from
the device framework. */
_ux_utility_delay_ms(_ux_system_slave -> ux_system_slave_device_dfu_detach_timeout);
/* Check the mode. */
if (_ux_system_slave -> ux_system_slave_device_dfu_mode == UX_DEVICE_CLASS_DFU_MODE_RUNTIME)
-
+
/* We are still in RunTime mode. The host never reset. Revert to AppIdle state. */
_ux_system_slave -> ux_system_slave_device_dfu_state_machine = UX_SYSTEM_DFU_STATE_APP_IDLE;
-
- }
+
+ }
}
- }
+ }
}
#endif
diff --git a/common/usbx_device_classes/src/ux_device_class_dfu_uninitialize.c b/common/usbx_device_classes/src/ux_device_class_dfu_uninitialize.c
index b0049d6f..23ae85b9 100644
--- a/common/usbx_device_classes/src/ux_device_class_dfu_uninitialize.c
+++ b/common/usbx_device_classes/src/ux_device_class_dfu_uninitialize.c
@@ -1,5 +1,6 @@
/***************************************************************************
* Copyright (c) 2024 Microsoft Corporation
+ * Copyright (c) 2026-present Eclipse ThreadX contributors
*
* This program and the accompanying materials are made available under the
* terms of the MIT License which is available at
@@ -60,12 +61,6 @@
/* */
/* USBX Source Code */
/* */
-/* RELEASE HISTORY */
-/* */
-/* DATE NAME DESCRIPTION */
-/* */
-/* xx-xx-xxxx Mohamed ayed Initial Version 6.x */
-/* */
/**************************************************************************/
UINT _ux_device_class_dfu_uninitialize(UX_SLAVE_CLASS_COMMAND *command)
{
diff --git a/common/usbx_device_classes/src/ux_device_class_hid_activate.c b/common/usbx_device_classes/src/ux_device_class_hid_activate.c
index 08cdc109..6b89ccde 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
@@ -1,5 +1,6 @@
/***************************************************************************
* Copyright (c) 2024 Microsoft Corporation
+ * Copyright (c) 2026-present Eclipse ThreadX contributors
*
* This program and the accompanying materials are made available under the
* terms of the MIT License which is available at
@@ -59,38 +60,6 @@
/* */
/* USBX Source Code */
/* */
-/* RELEASE HISTORY */
-/* */
-/* DATE NAME DESCRIPTION */
-/* */
-/* 05-19-2020 Chaoqiong Xiao Initial Version 6.0 */
-/* 09-30-2020 Chaoqiong Xiao Modified comment(s), */
-/* resulting in version 6.1 */
-/* 12-31-2020 Chaoqiong Xiao Modified comment(s), */
-/* added Get/Set Protocol */
-/* request support, */
-/* resulting in version 6.1.3 */
-/* 10-15-2021 Chaoqiong Xiao Modified comment(s), */
-/* added packet size assert, */
-/* resulting in version 6.1.9 */
-/* 01-31-2022 Chaoqiong Xiao Modified comment(s), */
-/* added standalone support, */
-/* added interrupt OUT support,*/
-/* added packet size assert, */
-/* resulting in version 6.1.10 */
-/* 07-29-2022 Chaoqiong Xiao Modified comment(s), */
-/* added standalone receiver, */
-/* fixed standalone tx length, */
-/* fixed standalone EP IN init,*/
-/* fixed parameter/variable */
-/* names conflict C++ keyword, */
-/* resulting in version 6.1.12 */
-/* 10-31-2023 Chaoqiong Xiao Modified comment(s), */
-/* added zero copy support, */
-/* added a new mode to manage */
-/* endpoint buffer in classes, */
-/* resulting in version 6.3.0 */
-/* */
/**************************************************************************/
UINT _ux_device_class_hid_activate(UX_SLAVE_CLASS_COMMAND *command)
{
diff --git a/common/usbx_device_classes/src/ux_device_class_hid_control_request.c b/common/usbx_device_classes/src/ux_device_class_hid_control_request.c
index edecc7b0..ccc47e87 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
@@ -1,5 +1,6 @@
/***************************************************************************
* Copyright (c) 2024 Microsoft Corporation
+ * Copyright (c) 2026-present Eclipse ThreadX contributors
*
* This program and the accompanying materials are made available under the
* terms of the MIT License which is available at
@@ -63,34 +64,6 @@
/* */
/* HID Class */
/* */
-/* RELEASE HISTORY */
-/* */
-/* 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 */
-/* 11-09-2020 Chaoqiong Xiao Modified comment(s), */
-/* fixed compile warnings 64b, */
-/* resulting in version 6.1.2 */
-/* 12-31-2020 Chaoqiong Xiao Modified comment(s), */
-/* added Get/Set Protocol */
-/* request support, */
-/* resulting in version 6.1.3 */
-/* 01-31-2022 Chaoqiong Xiao Modified comment(s), */
-/* added standalone support, */
-/* resulting in version 6.1.10 */
-/* 04-25-2022 Chaoqiong Xiao Modified comment(s), */
-/* resulting in version 6.1.11 */
-/* 07-29-2022 Chaoqiong Xiao Modified comment(s), */
-/* fixed parameter/variable */
-/* names conflict C++ keyword, */
-/* resulting in version 6.1.12 */
-/* */
/**************************************************************************/
UINT _ux_device_class_hid_control_request(UX_SLAVE_CLASS_COMMAND *command)
{
@@ -205,15 +178,28 @@ UX_SLAVE_CLASS_HID *hid;
case UX_DEVICE_CLASS_HID_COMMAND_GET_PROTOCOL:
- /* Send the protocol. */
+ /* Send the protocol to host. */
*transfer_request -> ux_slave_transfer_request_data_pointer = (UCHAR)hid -> ux_device_class_hid_protocol;
_ux_device_stack_transfer_request(transfer_request, 1, request_length);
break;
case UX_DEVICE_CLASS_HID_COMMAND_SET_PROTOCOL:
+ /* Check protocol must be 0 (Boot) or 1 (Report). */
+ if ((request_value != UX_DEVICE_CLASS_HID_PROTOCOL_BOOT) &&
+ (request_value != UX_DEVICE_CLASS_HID_PROTOCOL_REPORT))
+ {
+ /* Invalid value: not handled. */
+ return(UX_ERROR);
+ }
+
/* Accept the protocol. */
hid -> ux_device_class_hid_protocol = request_value;
+
+ /* If there is a callback defined by the application, send the protocol to it. */
+ if (hid -> ux_device_class_hid_set_protocol_callback != UX_NULL)
+ hid -> ux_device_class_hid_set_protocol_callback(hid, request_value);
+
break;
default:
@@ -225,4 +211,3 @@ UX_SLAVE_CLASS_HID *hid;
/* It's handled. */
return(UX_SUCCESS);
}
-
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 6b11308f..2e38c0eb 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
@@ -1,5 +1,6 @@
/***************************************************************************
* Copyright (c) 2024 Microsoft Corporation
+ * Copyright (c) 2026-present Eclipse ThreadX contributors
*
* This program and the accompanying materials are made available under the
* terms of the MIT License which is available at
@@ -59,18 +60,6 @@
/* */
/* HID Class */
/* */
-/* RELEASE HISTORY */
-/* */
-/* DATE NAME DESCRIPTION */
-/* */
-/* 05-19-2020 Chaoqiong Xiao Initial Version 6.0 */
-/* 09-30-2020 Chaoqiong Xiao Modified comment(s), */
-/* resulting in version 6.1 */
-/* 07-29-2022 Chaoqiong Xiao Modified comment(s), */
-/* fixed parameter/variable */
-/* names conflict C++ keyword, */
-/* resulting in version 6.1.12 */
-/* */
/**************************************************************************/
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 a5c124ec..fb928fb6 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
@@ -1,5 +1,6 @@
/***************************************************************************
* Copyright (c) 2024 Microsoft Corporation
+ * Copyright (c) 2026-present Eclipse ThreadX contributors
*
* This program and the accompanying materials are made available under the
* terms of the MIT License which is available at
@@ -64,19 +65,6 @@
/* Application */
/* Device Stack */
/* */
-/* RELEASE HISTORY */
-/* */
-/* DATE NAME DESCRIPTION */
-/* */
-/* 05-19-2020 Chaoqiong Xiao Initial Version 6.0 */
-/* 09-30-2020 Chaoqiong Xiao Modified comment(s), */
-/* verified memset and memcpy */
-/* cases, */
-/* resulting in version 6.1 */
-/* 08-02-2021 Chaoqiong Xiao Modified comment(s), */
-/* fixed HID descriptor search,*/
-/* resulting in version 6.1.8 */
-/* */
/**************************************************************************/
UINT _ux_device_class_hid_descriptor_send(UX_SLAVE_CLASS_HID *hid, ULONG descriptor_type,
ULONG request_index, ULONG 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 22222e7e..345cb766 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
@@ -1,5 +1,6 @@
/***************************************************************************
* Copyright (c) 2024 Microsoft Corporation
+ * Copyright (c) 2026-present Eclipse ThreadX contributors
*
* This program and the accompanying materials are made available under the
* terms of the MIT License which is available at
@@ -66,21 +67,6 @@
/* */
/* HID Class */
/* */
-/* RELEASE HISTORY */
-/* */
-/* DATE NAME DESCRIPTION */
-/* */
-/* 05-19-2020 Chaoqiong Xiao Initial Version 6.0 */
-/* 09-30-2020 Chaoqiong Xiao Modified comment(s), */
-/* resulting in version 6.1 */
-/* 10-31-2023 Chaoqiong Xiao Modified comment(s), */
-/* added error checks support, */
-/* resulting in version 6.3.0 */
-/* 24-02-2025 Mohamed ayed Modified comment(s), */
-/* fix typo, */
-/* remove extra spaces, */
-/* resulting in version 6.4.2 */
-/* */
/**************************************************************************/
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 eae13247..e65ddde7 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
@@ -1,5 +1,6 @@
/***************************************************************************
* Copyright (c) 2024 Microsoft Corporation
+ * Copyright (c) 2026-present Eclipse ThreadX contributors
*
* This program and the accompanying materials are made available under the
* terms of the MIT License which is available at
@@ -61,12 +62,6 @@
/* */
/* Device HID Class */
/* */
-/* RELEASE HISTORY */
-/* */
-/* DATE NAME DESCRIPTION */
-/* */
-/* 10-31-2023 Chaoqiong Xiao Initial Version 6.3.0 */
-/* */
/**************************************************************************/
UINT _ux_device_class_hid_event_check(UX_SLAVE_CLASS_HID *hid,
UX_DEVICE_CLASS_HID_EVENT **hid_event)
@@ -121,12 +116,6 @@ UX_SLAVE_DEVICE *device;
/* */
/* Device HID Class */
/* */
-/* RELEASE HISTORY */
-/* */
-/* DATE NAME DESCRIPTION */
-/* */
-/* 10-31-2023 Chaoqiong Xiao Initial Version 6.3.0 */
-/* */
/**************************************************************************/
VOID _ux_device_class_hid_event_free(UX_SLAVE_CLASS_HID *hid)
{
@@ -171,19 +160,6 @@ UCHAR *pos;
/* */
/* ThreadX */
/* */
-/* RELEASE HISTORY */
-/* */
-/* DATE NAME DESCRIPTION */
-/* */
-/* 05-19-2020 Chaoqiong Xiao Initial Version 6.0 */
-/* 09-30-2020 Chaoqiong Xiao Modified comment(s), */
-/* verified memset and memcpy */
-/* cases, */
-/* resulting in version 6.1 */
-/* 10-31-2023 Chaoqiong Xiao Modified comment(s), */
-/* added zero copy support, */
-/* resulting in version 6.3.0 */
-/* */
/**************************************************************************/
UINT _ux_device_class_hid_event_get(UX_SLAVE_CLASS_HID *hid,
UX_SLAVE_CLASS_HID_EVENT *hid_event)
@@ -251,12 +227,6 @@ UINT status;
/* */
/* Application */
/* */
-/* RELEASE HISTORY */
-/* */
-/* DATE NAME DESCRIPTION */
-/* */
-/* 10-31-2023 Chaoqiong Xiao Initial Version 6.3.0 */
-/* */
/**************************************************************************/
UINT _uxe_device_class_hid_event_get(UX_SLAVE_CLASS_HID *hid,
UX_SLAVE_CLASS_HID_EVENT *hid_event)
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 84b99e2f..a0c01d29 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
@@ -1,5 +1,6 @@
/***************************************************************************
* Copyright (c) 2024 Microsoft Corporation
+ * Copyright (c) 2026-present Eclipse ThreadX contributors
*
* This program and the accompanying materials are made available under the
* terms of the MIT License which is available at
@@ -62,27 +63,6 @@
/* */
/* ThreadX */
/* */
-/* RELEASE HISTORY */
-/* */
-/* DATE NAME DESCRIPTION */
-/* */
-/* 05-19-2020 Chaoqiong Xiao Initial Version 6.0 */
-/* 09-30-2020 Chaoqiong Xiao Modified comment(s), */
-/* added standalone support, */
-/* verified memset and memcpy */
-/* cases, used UX prefix to */
-/* refer to TX symbols instead */
-/* of using them directly, */
-/* resulting in version 6.1 */
-/* 01-31-2022 Chaoqiong Xiao Modified comment(s), */
-/* added standalone support, */
-/* resulting in version 6.1.10 */
-/* 04-25-2022 Chaoqiong Xiao Modified comment(s), */
-/* resulting in version 6.1.11 */
-/* 10-31-2023 Chaoqiong Xiao Modified comment(s), */
-/* added zero copy support, */
-/* resulting in version 6.3.0 */
-/* */
/**************************************************************************/
UINT _ux_device_class_hid_event_set(UX_SLAVE_CLASS_HID *hid,
UX_SLAVE_CLASS_HID_EVENT *hid_event)
@@ -210,12 +190,6 @@ UCHAR *next_position;
/* */
/* Application */
/* */
-/* RELEASE HISTORY */
-/* */
-/* DATE NAME DESCRIPTION */
-/* */
-/* 10-31-2023 Chaoqiong Xiao Initial Version 6.3.0 */
-/* */
/**************************************************************************/
UINT _uxe_device_class_hid_event_set(UX_SLAVE_CLASS_HID *hid,
UX_SLAVE_CLASS_HID_EVENT *hid_event)
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 2366cdee..5b6e4f02 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
@@ -1,5 +1,6 @@
/***************************************************************************
* Copyright (c) 2024 Microsoft Corporation
+ * Copyright (c) 2026-present Eclipse ThreadX contributors
*
* This program and the accompanying materials are made available under the
* terms of the MIT License which is available at
@@ -8,6 +9,7 @@
* SPDX-License-Identifier: MIT
**************************************************************************/
+
/**************************************************************************/
/**************************************************************************/
/** */
@@ -64,37 +66,6 @@
/* */
/* USBX Source Code */
/* */
-/* RELEASE HISTORY */
-/* */
-/* 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 */
-/* 01-31-2022 Chaoqiong Xiao Modified comment(s), */
-/* added standalone support, */
-/* added interrupt OUT support,*/
-/* resulting in version 6.1.10 */
-/* 04-25-2022 Chaoqiong Xiao Modified comment(s), */
-/* resulting in version 6.1.11 */
-/* 07-29-2022 Chaoqiong Xiao Modified comment(s), */
-/* added standalone receiver, */
-/* fixed parameter/variable */
-/* names conflict C++ keyword, */
-/* resulting in version 6.1.12 */
-/* 10-31-2022 Chaoqiong Xiao Modified comment(s), */
-/* fixed compile warnings, */
-/* resulting in version 6.2.0 */
-/* 10-31-2023 Chaoqiong Xiao Modified comment(s), */
-/* added zero copy support, */
-/* added a new mode to manage */
-/* endpoint buffer in classes, */
-/* checked compile options, */
-/* resulting in version 6.3.0 */
-/* */
/**************************************************************************/
UINT _ux_device_class_hid_initialize(UX_SLAVE_CLASS_COMMAND *command)
{
@@ -196,6 +167,7 @@ UCHAR *buffer;
/* Store the callback function. */
hid -> ux_device_class_hid_callback = hid_parameter -> ux_device_class_hid_parameter_callback;
hid -> ux_device_class_hid_get_callback = hid_parameter -> ux_device_class_hid_parameter_get_callback;
+ hid -> ux_device_class_hid_set_protocol_callback = hid_parameter -> ux_device_class_hid_parameter_set_protocol_callback;
#if defined(UX_DEVICE_CLASS_HID_FLEXIBLE_EVENTS_QUEUE)
@@ -407,12 +379,6 @@ UCHAR *buffer;
/* */
/* Device Stack */
/* */
-/* RELEASE HISTORY */
-/* */
-/* DATE NAME DESCRIPTION */
-/* */
-/* 10-31-2023 Chaoqiong Xiao Initial Version 6.3.0 */
-/* */
/**************************************************************************/
UINT _uxe_device_class_hid_initialize(UX_SLAVE_CLASS_COMMAND *command)
{
diff --git a/common/usbx_device_classes/src/ux_device_class_hid_interrupt_thread.c b/common/usbx_device_classes/src/ux_device_class_hid_interrupt_thread.c
index 2d785723..239e4a7f 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
@@ -1,5 +1,6 @@
/***************************************************************************
* Copyright (c) 2024 Microsoft Corporation
+ * Copyright (c) 2026-present Eclipse ThreadX contributors
*
* This program and the accompanying materials are made available under the
* terms of the MIT License which is available at
@@ -67,27 +68,6 @@
/* */
/* ThreadX */
/* */
-/* RELEASE HISTORY */
-/* */
-/* DATE NAME DESCRIPTION */
-/* */
-/* 05-19-2020 Chaoqiong Xiao Initial Version 6.0 */
-/* 09-30-2020 Chaoqiong Xiao Modified comment(s), */
-/* verified memset and memcpy */
-/* cases, used UX prefix to */
-/* refer to TX symbols instead */
-/* of using them directly, */
-/* resulting in version 6.1 */
-/* 10-15-2021 Chaoqiong Xiao Modified comment(s), */
-/* improved idle generation, */
-/* resulting in version 6.1.9 */
-/* 01-31-2022 Chaoqiong Xiao Modified comment(s), */
-/* off for standalone compile, */
-/* resulting in version 6.1.10 */
-/* 10-31-2023 Chaoqiong Xiao Modified comment(s), */
-/* added zero copy support, */
-/* resulting in version 6.3.0 */
-/* */
/**************************************************************************/
VOID _ux_device_class_hid_interrupt_thread(ULONG hid_class)
{
diff --git a/common/usbx_device_classes/src/ux_device_class_hid_read.c b/common/usbx_device_classes/src/ux_device_class_hid_read.c
index feb4b352..e2cb0820 100644
--- a/common/usbx_device_classes/src/ux_device_class_hid_read.c
+++ b/common/usbx_device_classes/src/ux_device_class_hid_read.c
@@ -1,5 +1,6 @@
/***************************************************************************
* Copyright (c) 2024 Microsoft Corporation
+ * Copyright (c) 2026-present Eclipse ThreadX contributors
*
* This program and the accompanying materials are made available under the
* terms of the MIT License which is available at
@@ -70,20 +71,6 @@
/* */
/* Application */
/* */
-/* RELEASE HISTORY */
-/* */
-/* DATE NAME DESCRIPTION */
-/* */
-/* 01-31-2022 Chaoqiong Xiao Initial Version 6.1.10 */
-/* 04-25-2022 Chaoqiong Xiao Modified comment(s), */
-/* fixed standalone compile, */
-/* resulting in version 6.1.11 */
-/* 07-29-2022 Chaoqiong Xiao Modified comment(s), */
-/* resulting in version 6.1.12 */
-/* 10-31-2023 Chaoqiong Xiao Modified comment(s), */
-/* added zero copy support, */
-/* resulting in version 6.3.0 */
-/* */
/**************************************************************************/
UINT _ux_device_class_hid_read(UX_SLAVE_CLASS_HID *hid, UCHAR *buffer,
ULONG requested_length, ULONG *actual_length)
@@ -266,12 +253,6 @@ ULONG local_requested_length;
/* */
/* Application */
/* */
-/* RELEASE HISTORY */
-/* */
-/* DATE NAME DESCRIPTION */
-/* */
-/* 10-31-2023 Chaoqiong Xiao Initial Version 6.3.0 */
-/* */
/**************************************************************************/
UINT _uxe_device_class_hid_read(UX_SLAVE_CLASS_HID *hid, UCHAR *buffer,
ULONG requested_length, ULONG *actual_length)
diff --git a/common/usbx_device_classes/src/ux_device_class_hid_read_run.c b/common/usbx_device_classes/src/ux_device_class_hid_read_run.c
index 99948ad2..4bfa8c42 100644
--- a/common/usbx_device_classes/src/ux_device_class_hid_read_run.c
+++ b/common/usbx_device_classes/src/ux_device_class_hid_read_run.c
@@ -1,5 +1,6 @@
/***************************************************************************
* Copyright (c) 2024 Microsoft Corporation
+ * Copyright (c) 2026-present Eclipse ThreadX contributors
*
* This program and the accompanying materials are made available under the
* terms of the MIT License which is available at
@@ -69,15 +70,6 @@
/* */
/* Application */
/* */
-/* RELEASE HISTORY */
-/* */
-/* DATE NAME DESCRIPTION */
-/* */
-/* 07-29-2022 Chaoqiong Xiao Initial Version 6.1.12 */
-/* 10-31-2023 Chaoqiong Xiao Modified comment(s), */
-/* added zero copy support, */
-/* resulting in version 6.3.0 */
-/* */
/**************************************************************************/
UINT _ux_device_class_hid_read_run(UX_SLAVE_CLASS_HID *hid, UCHAR *buffer,
ULONG requested_length, ULONG *actual_length)
@@ -330,12 +322,6 @@ UINT status= UX_SUCCESS;
/* */
/* Application */
/* */
-/* RELEASE HISTORY */
-/* */
-/* DATE NAME DESCRIPTION */
-/* */
-/* 10-31-2023 Chaoqiong Xiao Initial Version 6.3.0 */
-/* */
/**************************************************************************/
UINT _uxe_device_class_hid_read_run(UX_SLAVE_CLASS_HID *hid, UCHAR *buffer,
ULONG requested_length, ULONG *actual_length)
diff --git a/common/usbx_device_classes/src/ux_device_class_hid_receiver_event_free.c b/common/usbx_device_classes/src/ux_device_class_hid_receiver_event_free.c
index 98a03634..e0b072ca 100644
--- a/common/usbx_device_classes/src/ux_device_class_hid_receiver_event_free.c
+++ b/common/usbx_device_classes/src/ux_device_class_hid_receiver_event_free.c
@@ -1,5 +1,6 @@
/***************************************************************************
* Copyright (c) 2024 Microsoft Corporation
+ * Copyright (c) 2026-present Eclipse ThreadX contributors
*
* This program and the accompanying materials are made available under the
* terms of the MIT License which is available at
@@ -60,18 +61,6 @@
/* */
/* Application */
/* */
-/* RELEASE HISTORY */
-/* */
-/* DATE NAME DESCRIPTION */
-/* */
-/* 01-31-2022 Chaoqiong Xiao Initial Version 6.1.10 */
-/* 04-25-2022 Chaoqiong Xiao Modified comment(s), */
-/* fixed standalone compile, */
-/* resulting in version 6.1.11 */
-/* 10-31-2023 Chaoqiong Xiao Modified comment(s), */
-/* added zero copy support, */
-/* resulting in version 6.3.0 */
-/* */
/**************************************************************************/
UINT _ux_device_class_hid_receiver_event_free(UX_SLAVE_CLASS_HID *hid)
{
@@ -149,12 +138,6 @@ UCHAR *next_pos;
/* */
/* Application */
/* */
-/* RELEASE HISTORY */
-/* */
-/* DATE NAME DESCRIPTION */
-/* */
-/* 10-31-2023 Chaoqiong Xiao Initial Version 6.3.0 */
-/* */
/**************************************************************************/
UINT _uxe_device_class_hid_receiver_event_free(UX_SLAVE_CLASS_HID *hid)
{
diff --git a/common/usbx_device_classes/src/ux_device_class_hid_receiver_event_get.c b/common/usbx_device_classes/src/ux_device_class_hid_receiver_event_get.c
index 0a2e4225..6798a100 100644
--- a/common/usbx_device_classes/src/ux_device_class_hid_receiver_event_get.c
+++ b/common/usbx_device_classes/src/ux_device_class_hid_receiver_event_get.c
@@ -1,5 +1,6 @@
/***************************************************************************
* Copyright (c) 2024 Microsoft Corporation
+ * Copyright (c) 2026-present Eclipse ThreadX contributors
*
* This program and the accompanying materials are made available under the
* terms of the MIT License which is available at
@@ -63,18 +64,6 @@
/* */
/* ThreadX */
/* */
-/* RELEASE HISTORY */
-/* */
-/* DATE NAME DESCRIPTION */
-/* */
-/* 01-31-2022 Chaoqiong Xiao Initial Version 6.1.10 */
-/* 07-29-2022 Chaoqiong Xiao Modified comment(s), */
-/* cleaned compile with TRACE, */
-/* resulting in version 6.1.12 */
-/* 10-31-2023 Chaoqiong Xiao Modified comment(s), */
-/* added zero copy support, */
-/* resulting in version 6.3.0 */
-/* */
/**************************************************************************/
UINT _ux_device_class_hid_receiver_event_get(UX_SLAVE_CLASS_HID *hid,
UX_DEVICE_CLASS_HID_RECEIVED_EVENT *event)
@@ -149,12 +138,6 @@ UX_DEVICE_CLASS_HID_RECEIVED_EVENT *pos;
/* */
/* Application */
/* */
-/* RELEASE HISTORY */
-/* */
-/* DATE NAME DESCRIPTION */
-/* */
-/* 10-31-2023 Chaoqiong Xiao Initial Version 6.3.0 */
-/* */
/**************************************************************************/
UINT _uxe_device_class_hid_receiver_event_get(UX_SLAVE_CLASS_HID *hid,
UX_DEVICE_CLASS_HID_RECEIVED_EVENT *event)
diff --git a/common/usbx_device_classes/src/ux_device_class_hid_receiver_initialize.c b/common/usbx_device_classes/src/ux_device_class_hid_receiver_initialize.c
index 45d16b34..2a0fd4ee 100644
--- a/common/usbx_device_classes/src/ux_device_class_hid_receiver_initialize.c
+++ b/common/usbx_device_classes/src/ux_device_class_hid_receiver_initialize.c
@@ -1,5 +1,6 @@
/***************************************************************************
* Copyright (c) 2024 Microsoft Corporation
+ * Copyright (c) 2026-present Eclipse ThreadX contributors
*
* This program and the accompanying materials are made available under the
* terms of the MIT License which is available at
@@ -67,21 +68,6 @@
/* */
/* USBX Source Code */
/* */
-/* RELEASE HISTORY */
-/* */
-/* DATE NAME DESCRIPTION */
-/* */
-/* 01-31-2022 Chaoqiong Xiao Initial Version 6.1.10 */
-/* 04-25-2022 Chaoqiong Xiao Modified comment(s), */
-/* added receiver callback, */
-/* resulting in version 6.1.11 */
-/* 07-29-2022 Chaoqiong Xiao Modified comment(s), */
-/* added standalone receiver, */
-/* resulting in version 6.1.12 */
-/* 10-31-2023 Chaoqiong Xiao Modified comment(s), */
-/* added zero copy support, */
-/* resulting in version 6.3.0 */
-/* */
/**************************************************************************/
UINT _ux_device_class_hid_receiver_initialize(UX_SLAVE_CLASS_HID *hid,
UX_SLAVE_CLASS_HID_PARAMETER *parameter,
diff --git a/common/usbx_device_classes/src/ux_device_class_hid_receiver_tasks_run.c b/common/usbx_device_classes/src/ux_device_class_hid_receiver_tasks_run.c
index 4ce8fbfa..f6c9c769 100644
--- a/common/usbx_device_classes/src/ux_device_class_hid_receiver_tasks_run.c
+++ b/common/usbx_device_classes/src/ux_device_class_hid_receiver_tasks_run.c
@@ -1,5 +1,6 @@
/***************************************************************************
* Copyright (c) 2024 Microsoft Corporation
+ * Copyright (c) 2026-present Eclipse ThreadX contributors
*
* This program and the accompanying materials are made available under the
* terms of the MIT License which is available at
@@ -62,18 +63,6 @@
/* */
/* USBX Device HID */
/* */
-/* RELEASE HISTORY */
-/* */
-/* DATE NAME DESCRIPTION */
-/* */
-/* 07-29-2022 Chaoqiong Xiao Initial Version 6.1.12 */
-/* 10-31-2023 Chaoqiong Xiao Modified comment(s), */
-/* added zero copy support, */
-/* resulting in version 6.3.0 */
-/* 12-31-2023 Chaoqiong Xiao Modified comment(s), */
-/* fixed save position issue, */
-/* resulting in version 6.4.0 */
-/* */
/**************************************************************************/
UINT _ux_device_class_hid_receiver_tasks_run(UX_SLAVE_CLASS_HID *hid)
{
diff --git a/common/usbx_device_classes/src/ux_device_class_hid_receiver_thread.c b/common/usbx_device_classes/src/ux_device_class_hid_receiver_thread.c
index 79d0d75b..2c5382ff 100644
--- a/common/usbx_device_classes/src/ux_device_class_hid_receiver_thread.c
+++ b/common/usbx_device_classes/src/ux_device_class_hid_receiver_thread.c
@@ -1,5 +1,6 @@
/***************************************************************************
* Copyright (c) 2024 Microsoft Corporation
+ * Copyright (c) 2026-present Eclipse ThreadX contributors
*
* This program and the accompanying materials are made available under the
* terms of the MIT License which is available at
@@ -64,18 +65,6 @@
/* */
/* ThreadX */
/* */
-/* RELEASE HISTORY */
-/* */
-/* DATE NAME DESCRIPTION */
-/* */
-/* 01-31-2022 Chaoqiong Xiao Initial Version 6.1.10 */
-/* 04-25-2022 Chaoqiong Xiao Modified comment(s), */
-/* added receiver callback, */
-/* resulting in version 6.1.11 */
-/* 10-31-2023 Chaoqiong Xiao Modified comment(s), */
-/* added zero copy support, */
-/* resulting in version 6.3.0 */
-/* */
/**************************************************************************/
VOID _ux_device_class_hid_receiver_thread(ULONG hid_instance)
{
diff --git a/common/usbx_device_classes/src/ux_device_class_hid_receiver_uninitialize.c b/common/usbx_device_classes/src/ux_device_class_hid_receiver_uninitialize.c
index ee46b3a4..a9e4cf61 100644
--- a/common/usbx_device_classes/src/ux_device_class_hid_receiver_uninitialize.c
+++ b/common/usbx_device_classes/src/ux_device_class_hid_receiver_uninitialize.c
@@ -1,5 +1,6 @@
/***************************************************************************
* Copyright (c) 2024 Microsoft Corporation
+ * Copyright (c) 2026-present Eclipse ThreadX contributors
*
* This program and the accompanying materials are made available under the
* terms of the MIT License which is available at
@@ -62,15 +63,6 @@
/* */
/* USBX Source Code */
/* */
-/* RELEASE HISTORY */
-/* */
-/* DATE NAME DESCRIPTION */
-/* */
-/* 01-31-2022 Chaoqiong Xiao Initial Version 6.1.10 */
-/* 10-31-2023 Chaoqiong Xiao Modified comment(s), */
-/* added zero copy support, */
-/* resulting in version 6.3.0 */
-/* */
/**************************************************************************/
VOID _ux_device_class_hid_receiver_uninitialize(UX_DEVICE_CLASS_HID_RECEIVER *receiver)
{
diff --git a/common/usbx_device_classes/src/ux_device_class_hid_report_get.c b/common/usbx_device_classes/src/ux_device_class_hid_report_get.c
index ac863727..a8d2350b 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
@@ -1,18 +1,19 @@
/***************************************************************************
- * Copyright (c) 2024 Microsoft Corporation
- *
+ * Copyright (c) 2024 Microsoft Corporation
+ * Copyright (c) 2026-present Eclipse ThreadX contributors
+ *
* This program and the accompanying materials are made available under the
* terms of the MIT License which is available at
* https://opensource.org/licenses/MIT.
- *
+ *
* SPDX-License-Identifier: MIT
**************************************************************************/
/**************************************************************************/
/**************************************************************************/
-/** */
-/** USBX Component */
+/** */
+/** USBX Component */
/** */
/** Device HID Class */
/** */
@@ -52,33 +53,21 @@
/* */
/* OUTPUT */
/* */
-/* Completion Status */
+/* Completion Status */
+/* */
+/* CALLS */
/* */
-/* CALLS */
-/* */
/* _ux_device_class_hid_event_get Get HID event */
/* _ux_device_stack_transfer_request Process transfer request */
/* _ux_utility_memory_set Set memory */
/* _ux_utility_memory_copy Copy memory */
-/* */
-/* CALLED BY */
-/* */
+/* */
+/* CALLED BY */
+/* */
/* Device HID */
-/* */
-/* RELEASE HISTORY */
-/* */
-/* DATE NAME DESCRIPTION */
-/* */
-/* 05-19-2020 Chaoqiong Xiao Initial Version 6.0 */
-/* 09-30-2020 Chaoqiong Xiao Modified comment(s), */
-/* verified memset and memcpy */
-/* cases, */
-/* resulting in version 6.1 */
-/* 10-31-2023 Chaoqiong Xiao Modified comment(s), */
-/* resulting in version 6.3.0 */
/* */
/**************************************************************************/
-UINT _ux_device_class_hid_report_get(UX_SLAVE_CLASS_HID *hid, ULONG descriptor_type,
+UINT _ux_device_class_hid_report_get(UX_SLAVE_CLASS_HID *hid, ULONG descriptor_type,
ULONG request_index, ULONG host_length)
{
@@ -100,7 +89,7 @@ UINT status = UX_ERROR;
/* 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;
@@ -132,7 +121,7 @@ UINT status = UX_ERROR;
/* Try to get event from application callback. */
else
{
-
+
/* Let application fill event. */
if (hid -> ux_device_class_hid_get_callback != UX_NULL)
status = hid -> ux_device_class_hid_get_callback(hid, &hid_event);
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 f32b7fa6..dd420fb5 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
@@ -1,18 +1,19 @@
/***************************************************************************
- * Copyright (c) 2024 Microsoft Corporation
- *
+ * Copyright (c) 2024 Microsoft Corporation
+ * Copyright (c) 2026-present Eclipse ThreadX contributors
+ *
* This program and the accompanying materials are made available under the
* terms of the MIT License which is available at
* https://opensource.org/licenses/MIT.
- *
+ *
* SPDX-License-Identifier: MIT
**************************************************************************/
/**************************************************************************/
/**************************************************************************/
-/** */
-/** USBX Component */
+/** */
+/** USBX Component */
/** */
/** Device HID Class */
/** */
@@ -53,30 +54,18 @@
/* */
/* OUTPUT */
/* */
-/* Completion Status */
+/* Completion Status */
+/* */
+/* CALLS */
+/* */
+/* _ux_utility_memory_copy Memory copy */
+/* */
+/* CALLED BY */
/* */
-/* CALLS */
-/* */
-/* _ux_utility_memory_copy Memory copy */
-/* */
-/* CALLED BY */
-/* */
/* Device HID */
-/* */
-/* RELEASE HISTORY */
-/* */
-/* DATE NAME DESCRIPTION */
-/* */
-/* 05-19-2020 Chaoqiong Xiao Initial Version 6.0 */
-/* 09-30-2020 Chaoqiong Xiao Modified comment(s), */
-/* verified memset and memcpy */
-/* cases, */
-/* resulting in version 6.1 */
-/* 10-31-2023 Chaoqiong Xiao Modified comment(s), */
-/* resulting in version 6.3.0 */
/* */
/**************************************************************************/
-UINT _ux_device_class_hid_report_set(UX_SLAVE_CLASS_HID *hid, ULONG descriptor_type,
+UINT _ux_device_class_hid_report_set(UX_SLAVE_CLASS_HID *hid, ULONG descriptor_type,
ULONG request_index, ULONG host_length)
{
@@ -94,16 +83,16 @@ UCHAR *hid_buffer;
/* 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;
/* Get the pointer to the transfer request associated with the endpoint. */
transfer_request = &endpoint -> ux_slave_endpoint_transfer_request;
-
+
/* Set the event type to OUTPUT. */
hid_event.ux_device_class_hid_event_report_type = descriptor_type;
-
+
/* Get HID data address. */
hid_buffer = transfer_request -> ux_slave_transfer_request_data_pointer;
@@ -115,36 +104,36 @@ UCHAR *hid_buffer;
/* Set the length = total length - report ID. */
hid_event.ux_device_class_hid_event_length = transfer_request -> ux_slave_transfer_request_actual_length -1;
-
+
/* Set HID data after report ID. */
hid_buffer++;
}
-
+
else
- {
+ {
/* Set the report ID, not used here. */
hid_event.ux_device_class_hid_event_report_id = 0;
/* Set the length. */
hid_event.ux_device_class_hid_event_length = transfer_request -> ux_slave_transfer_request_actual_length;
}
-
+
/* Copy the buffer received from the host. Check for overflow. */
if (hid_event.ux_device_class_hid_event_length > UX_DEVICE_CLASS_HID_EVENT_BUFFER_LENGTH)
-
+
/* Overflow detected. */
- hid_event.ux_device_class_hid_event_length = UX_DEVICE_CLASS_HID_EVENT_BUFFER_LENGTH;
-
+ hid_event.ux_device_class_hid_event_length = UX_DEVICE_CLASS_HID_EVENT_BUFFER_LENGTH;
+
/* Now we can safely copy the payload. */
- _ux_utility_memory_copy(hid_event.ux_device_class_hid_event_buffer, hid_buffer,
+ _ux_utility_memory_copy(hid_event.ux_device_class_hid_event_buffer, hid_buffer,
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)
-
+
/* Callback exists. */
hid -> ux_device_class_hid_callback(hid, &hid_event);
-
+
/* Return the status to the caller. */
return(UX_SUCCESS);
}
diff --git a/common/usbx_device_classes/src/ux_device_class_hid_tasks_run.c b/common/usbx_device_classes/src/ux_device_class_hid_tasks_run.c
index 56b27e55..33a3643d 100644
--- a/common/usbx_device_classes/src/ux_device_class_hid_tasks_run.c
+++ b/common/usbx_device_classes/src/ux_device_class_hid_tasks_run.c
@@ -1,5 +1,6 @@
/***************************************************************************
* Copyright (c) 2024 Microsoft Corporation
+ * Copyright (c) 2026-present Eclipse ThreadX contributors
*
* This program and the accompanying materials are made available under the
* terms of the MIT License which is available at
@@ -68,15 +69,6 @@
/* */
/* USBX Device Stack */
/* */
-/* RELEASE HISTORY */
-/* */
-/* DATE NAME DESCRIPTION */
-/* */
-/* 01-31-2022 Chaoqiong Xiao Initial Version 6.1.10 */
-/* 10-31-2023 Chaoqiong Xiao Modified comment(s), */
-/* added zero copy support, */
-/* resulting in version 6.3.0 */
-/* */
/**************************************************************************/
UINT _ux_device_class_hid_tasks_run(VOID *hid_instance)
{
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 0060ce23..aae2d170 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
@@ -1,5 +1,6 @@
/***************************************************************************
* Copyright (c) 2024 Microsoft Corporation
+ * Copyright (c) 2026-present Eclipse ThreadX contributors
*
* This program and the accompanying materials are made available under the
* terms of the MIT License which is available at
@@ -61,34 +62,6 @@
/* */
/* USBX Source Code */
/* */
-/* RELEASE HISTORY */
-/* */
-/* DATE NAME DESCRIPTION */
-/* */
-/* 05-19-2020 Chaoqiong Xiao Initial Version 6.0 */
-/* 09-30-2020 Chaoqiong Xiao Modified comment(s), */
-/* resulting in version 6.1 */
-/* 01-31-2022 Chaoqiong Xiao Modified comment(s), */
-/* added standalone support, */
-/* added interrupt OUT support,*/
-/* resulting in version 6.1.10 */
-/* 04-25-2022 Chaoqiong Xiao Modified comment(s), */
-/* resulting in version 6.1.11 */
-/* 07-29-2022 Chaoqiong Xiao Modified comment(s), */
-/* fixed parameter/variable */
-/* names conflict C++ keyword, */
-/* resulting in version 6.1.12 */
-/* 10-31-2023 Chaoqiong Xiao Modified comment(s), */
-/* added zero copy support, */
-/* added a new mode to manage */
-/* endpoint buffer in classes, */
-/* resulting in version 6.3.0 */
-/* xx-xx-xxxx Mohamed ayed Modified comment(s), */
-/* added sanity check before */
-/* freed hid memory, */
-/* remove extra spaces, */
-/* resulting in version 6.x */
-/* */
/**************************************************************************/
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 02ec7850..a1d881e0 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
@@ -1,16 +1,17 @@
/***************************************************************************
- * Copyright (c) 2024 Microsoft Corporation
- *
+ * Copyright (c) 2024 Microsoft Corporation
+ * Copyright (c) 2026-present Eclipse ThreadX contributors
+ *
* This program and the accompanying materials are made available under the
* terms of the MIT License which is available at
* https://opensource.org/licenses/MIT.
- *
+ *
* SPDX-License-Identifier: MIT
**************************************************************************/
/**************************************************************************/
-/** */
-/** USBX Component */
+/** */
+/** USBX Component */
/** */
/** Device CDC Class */
/** */
@@ -27,64 +28,40 @@
#include "ux_device_stack.h"
-/**************************************************************************/
-/* */
-/* FUNCTION RELEASE */
-/* */
-/* _ux_device_class_pima_activate PORTABLE C */
+/**************************************************************************/
+/* */
+/* FUNCTION RELEASE */
+/* */
+/* _ux_device_class_pima_activate PORTABLE C */
/* 6.3.0 */
/* AUTHOR */
/* */
/* Chaoqiong Xiao, Microsoft Corporation */
/* */
/* DESCRIPTION */
-/* */
-/* This function activates the USB Pima device. */
-/* */
-/* INPUT */
-/* */
-/* command Pointer to pima command */
-/* */
-/* OUTPUT */
-/* */
-/* Completion Status */
-/* */
-/* CALLS */
-/* */
-/* _ux_device_thread_resume Resume thread */
-/* */
-/* CALLED BY */
-/* */
-/* USBX Source Code */
-/* */
-/* RELEASE HISTORY */
-/* */
-/* DATE NAME DESCRIPTION */
-/* */
-/* 05-19-2020 Chaoqiong Xiao Initial Version 6.0 */
-/* 09-30-2020 Chaoqiong Xiao Modified comment(s), */
-/* resulting in version 6.1 */
-/* 01-31-2022 Chaoqiong Xiao Modified comment(s), */
-/* refined macros names, */
-/* added variables initialize, */
-/* resulting in version 6.1.10 */
-/* 04-25-2022 Chaoqiong Xiao Modified comment(s), */
-/* fixed standalone compile, */
-/* resulting in version 6.1.11 */
-/* 07-29-2022 Chaoqiong Xiao Modified comment(s), */
-/* fixed parameter/variable */
-/* names conflict C++ keyword, */
-/* resulting in version 6.1.12 */
-/* 10-31-2023 Chaoqiong Xiao Modified comment(s), */
-/* supported optional INT EP, */
-/* added a new mode to manage */
-/* endpoint buffer in classes, */
-/* resulting in version 6.3.0 */
+/* */
+/* This function activates the USB Pima device. */
+/* */
+/* INPUT */
+/* */
+/* command Pointer to pima command */
+/* */
+/* OUTPUT */
+/* */
+/* Completion Status */
+/* */
+/* CALLS */
+/* */
+/* _ux_device_thread_resume Resume thread */
+/* */
+/* CALLED BY */
+/* */
+/* USBX Source Code */
/* */
/**************************************************************************/
UINT _ux_device_class_pima_activate(UX_SLAVE_CLASS_COMMAND *command)
{
-
+
UX_SLAVE_INTERFACE *interface_ptr;
UX_SLAVE_CLASS *class_ptr;
UX_SLAVE_CLASS_PIMA *pima;
@@ -101,29 +78,29 @@ UX_SLAVE_ENDPOINT *endpoint_interrupt;
/* Get the interface that owns this instance. */
interface_ptr = (UX_SLAVE_INTERFACE *) command -> ux_slave_class_command_interface;
-
+
/* Store the class instance into the interface. */
interface_ptr -> ux_slave_interface_class_instance = (VOID *)pima;
-
+
/* Now the opposite, store the interface in the class instance. */
pima -> ux_slave_class_pima_interface = interface_ptr;
-
+
/* Locate the endpoints. */
endpoint_in = interface_ptr -> ux_slave_interface_first_endpoint;
-
+
/* Check the endpoint direction, if IN we have the correct endpoint. */
if ((endpoint_in -> ux_slave_endpoint_descriptor.bEndpointAddress & UX_ENDPOINT_DIRECTION) == UX_ENDPOINT_OUT)
{
/* Wrong direction, we found the OUT endpoint first. */
endpoint_out = endpoint_in;
-
+
/* So the next endpoint has to be the IN endpoint. */
endpoint_in = endpoint_out -> ux_slave_endpoint_next_endpoint;
-
+
/* And the endpoint after that interrupt. */
endpoint_interrupt = endpoint_in -> ux_slave_endpoint_next_endpoint;
-
+
}
else
{
@@ -157,15 +134,15 @@ UX_SLAVE_ENDPOINT *endpoint_interrupt;
pima -> ux_device_class_pima_device_status = UX_DEVICE_CLASS_PIMA_RC_OK;
/* Resume thread. */
- _ux_device_thread_resume(&class_ptr -> ux_slave_class_thread);
-
+ _ux_device_thread_resume(&class_ptr -> ux_slave_class_thread);
+
/* If there is a activate function call it. */
if (pima -> ux_device_class_pima_instance_activate != UX_NULL)
- {
+ {
/* Invoke the application. */
pima -> ux_device_class_pima_instance_activate(pima);
}
-
+
/* If trace is enabled, insert this event into the trace buffer. */
UX_TRACE_IN_LINE_INSERT(UX_TRACE_DEVICE_CLASS_PIMA_ACTIVATE, pima, 0, 0, 0, UX_TRACE_DEVICE_CLASS_EVENTS, 0, 0)
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 0c010f6a..3a9436a6 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
@@ -1,10 +1,11 @@
/***************************************************************************
- * Copyright (c) 2024 Microsoft Corporation
- *
+ * Copyright (c) 2024 Microsoft Corporation
+ * Copyright (c) 2026-present Eclipse ThreadX contributors
+ *
* This program and the accompanying materials are made available under the
* terms of the MIT License which is available at
* https://opensource.org/licenses/MIT.
- *
+ *
* SPDX-License-Identifier: MIT
**************************************************************************/
@@ -62,21 +63,6 @@
/* */
/* PIMA Class */
/* */
-/* RELEASE HISTORY */
-/* */
-/* DATE NAME DESCRIPTION */
-/* */
-/* 05-19-2020 Chaoqiong Xiao Initial Version 6.0 */
-/* 09-30-2020 Chaoqiong Xiao Modified comment(s), */
-/* resulting in version 6.1 */
-/* 01-31-2022 Chaoqiong Xiao Modified comment(s), */
-/* improved request handling, */
-/* resulting in version 6.1.10 */
-/* 07-29-2022 Chaoqiong Xiao Modified comment(s), */
-/* fixed parameter/variable */
-/* names conflict C++ keyword, */
-/* resulting in version 6.1.12 */
-/* */
/**************************************************************************/
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 6dba7f88..e0d486bb 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
@@ -1,17 +1,18 @@
/***************************************************************************
- * Copyright (c) 2024 Microsoft Corporation
- *
+ * Copyright (c) 2024 Microsoft Corporation
+ * Copyright (c) 2026-present Eclipse ThreadX contributors
+ *
* This program and the accompanying materials are made available under the
* terms of the MIT License which is available at
* https://opensource.org/licenses/MIT.
- *
+ *
* SPDX-License-Identifier: MIT
**************************************************************************/
/**************************************************************************/
/**************************************************************************/
-/** */
-/** USBX Component */
+/** */
+/** USBX Component */
/** */
/** Device PIMA Class */
/** */
@@ -28,39 +29,31 @@
#include "ux_device_stack.h"
-/**************************************************************************/
-/* */
-/* FUNCTION RELEASE */
-/* */
-/* ux_device_class_pima_data.c PORTABLE C */
+/**************************************************************************/
+/* */
+/* FUNCTION RELEASE */
+/* */
+/* ux_device_class_pima_data.c PORTABLE C */
/* 6.1 */
/* AUTHOR */
/* */
/* Chaoqiong Xiao, Microsoft Corporation */
/* */
/* DESCRIPTION */
-/* */
-/* This module contains all the data definition used by the PIMA */
-/* device class. */
-/* */
-/* INPUT */
-/* */
-/* OUTPUT */
-/* */
-/* CALLS */
-/* */
+/* */
+/* This module contains all the data definition used by the PIMA */
+/* device class. */
+/* */
+/* INPUT */
+/* */
+/* OUTPUT */
+/* */
+/* CALLS */
+/* */
/* None */
-/* */
-/* CALLED BY */
-/* */
-/* */
-/* RELEASE HISTORY */
-/* */
-/* DATE NAME DESCRIPTION */
-/* */
-/* 05-19-2020 Chaoqiong Xiao Initial Version 6.0 */
-/* 09-30-2020 Chaoqiong Xiao Modified comment(s), */
-/* resulting in version 6.1 */
+/* */
+/* CALLED BY */
+/* */
/* */
/**************************************************************************/
@@ -70,40 +63,40 @@ UCHAR _ux_device_class_pima_vendor_extension_descriptor[] = {
"microsoft.com: 1.0; microsoft.com/WMPPD: 11.0; microsoft.com/WMPPD: 10.0; microsoft.com/WMDRMPD: 10.1;"
#else
0
-#endif
+#endif
};
-
+
/* Define PIMA supported operations. The last entry MUST be a zero. The DeviceInfoSet command
will parse this array and compute the number of functions supported and return it to the
host. */
USHORT _ux_device_class_pima_supported_operations[] = {
- UX_DEVICE_CLASS_PIMA_OC_GET_DEVICE_INFO,
- UX_DEVICE_CLASS_PIMA_OC_OPEN_SESSION,
- UX_DEVICE_CLASS_PIMA_OC_CLOSE_SESSION,
- UX_DEVICE_CLASS_PIMA_OC_GET_STORAGE_IDS,
- UX_DEVICE_CLASS_PIMA_OC_GET_STORAGE_INFO,
- UX_DEVICE_CLASS_PIMA_OC_GET_NUM_OBJECTS,
- UX_DEVICE_CLASS_PIMA_OC_GET_OBJECT_HANDLES,
- UX_DEVICE_CLASS_PIMA_OC_GET_OBJECT_INFO,
- UX_DEVICE_CLASS_PIMA_OC_GET_OBJECT,
- UX_DEVICE_CLASS_PIMA_OC_GET_THUMB,
+ UX_DEVICE_CLASS_PIMA_OC_GET_DEVICE_INFO,
+ UX_DEVICE_CLASS_PIMA_OC_OPEN_SESSION,
+ UX_DEVICE_CLASS_PIMA_OC_CLOSE_SESSION,
+ UX_DEVICE_CLASS_PIMA_OC_GET_STORAGE_IDS,
+ UX_DEVICE_CLASS_PIMA_OC_GET_STORAGE_INFO,
+ UX_DEVICE_CLASS_PIMA_OC_GET_NUM_OBJECTS,
+ UX_DEVICE_CLASS_PIMA_OC_GET_OBJECT_HANDLES,
+ UX_DEVICE_CLASS_PIMA_OC_GET_OBJECT_INFO,
+ UX_DEVICE_CLASS_PIMA_OC_GET_OBJECT,
+ UX_DEVICE_CLASS_PIMA_OC_GET_THUMB,
UX_DEVICE_CLASS_PIMA_OC_GET_PARTIAL_OBJECT,
- UX_DEVICE_CLASS_PIMA_OC_DELETE_OBJECT,
- UX_DEVICE_CLASS_PIMA_OC_SEND_OBJECT_INFO,
- UX_DEVICE_CLASS_PIMA_OC_SEND_OBJECT,
- UX_DEVICE_CLASS_PIMA_OC_INITIATE_CAPTURE,
- UX_DEVICE_CLASS_PIMA_OC_FORMAT_STORE,
- UX_DEVICE_CLASS_PIMA_OC_RESET_DEVICE,
-#ifdef UX_PIMA_WITH_MTP_SUPPORT
+ UX_DEVICE_CLASS_PIMA_OC_DELETE_OBJECT,
+ UX_DEVICE_CLASS_PIMA_OC_SEND_OBJECT_INFO,
+ UX_DEVICE_CLASS_PIMA_OC_SEND_OBJECT,
+ UX_DEVICE_CLASS_PIMA_OC_INITIATE_CAPTURE,
+ UX_DEVICE_CLASS_PIMA_OC_FORMAT_STORE,
+ UX_DEVICE_CLASS_PIMA_OC_RESET_DEVICE,
+#ifdef UX_PIMA_WITH_MTP_SUPPORT
UX_DEVICE_CLASS_PIMA_OC_GET_OBJECT_PROPS_SUPPORTED,
UX_DEVICE_CLASS_PIMA_OC_GET_OBJECT_PROP_DESC,
UX_DEVICE_CLASS_PIMA_OC_GET_OBJECT_PROP_VALUE,
UX_DEVICE_CLASS_PIMA_OC_SET_OBJECT_PROP_VALUE,
UX_DEVICE_CLASS_PIMA_OC_GET_OBJECT_REFERENCES,
- UX_DEVICE_CLASS_PIMA_OC_SET_OBJECT_REFERENCES,
-#endif
+ UX_DEVICE_CLASS_PIMA_OC_SET_OBJECT_REFERENCES,
+#endif
0
};
@@ -114,79 +107,79 @@ USHORT _ux_device_class_pima_supported_operations[] = {
USHORT _ux_device_class_pima_supported_events[] = {
- UX_DEVICE_CLASS_PIMA_EC_CANCEL_TRANSACTION,
- UX_DEVICE_CLASS_PIMA_EC_OBJECT_ADDED,
- UX_DEVICE_CLASS_PIMA_EC_OBJECT_REMOVED,
- UX_DEVICE_CLASS_PIMA_EC_STORE_ADDED,
- UX_DEVICE_CLASS_PIMA_EC_STORE_REMOVED,
- UX_DEVICE_CLASS_PIMA_EC_DEVICE_PROP_CHANGED,
- UX_DEVICE_CLASS_PIMA_EC_OBJECT_INFO_CHANGED,
- UX_DEVICE_CLASS_PIMA_EC_DEVICE_INFO_CHANGED,
- UX_DEVICE_CLASS_PIMA_EC_REQUEST_OBJECT_TRANSFER,
- UX_DEVICE_CLASS_PIMA_EC_STORE_FULL,
- UX_DEVICE_CLASS_PIMA_EC_DEVICE_RESET,
- UX_DEVICE_CLASS_PIMA_EC_STORAGE_INFO_CHANGED,
- UX_DEVICE_CLASS_PIMA_EC_CAPTURE_COMPLETE,
- UX_DEVICE_CLASS_PIMA_EC_UNREPORTED_STATUS,
+ UX_DEVICE_CLASS_PIMA_EC_CANCEL_TRANSACTION,
+ UX_DEVICE_CLASS_PIMA_EC_OBJECT_ADDED,
+ UX_DEVICE_CLASS_PIMA_EC_OBJECT_REMOVED,
+ UX_DEVICE_CLASS_PIMA_EC_STORE_ADDED,
+ UX_DEVICE_CLASS_PIMA_EC_STORE_REMOVED,
+ UX_DEVICE_CLASS_PIMA_EC_DEVICE_PROP_CHANGED,
+ UX_DEVICE_CLASS_PIMA_EC_OBJECT_INFO_CHANGED,
+ UX_DEVICE_CLASS_PIMA_EC_DEVICE_INFO_CHANGED,
+ UX_DEVICE_CLASS_PIMA_EC_REQUEST_OBJECT_TRANSFER,
+ UX_DEVICE_CLASS_PIMA_EC_STORE_FULL,
+ UX_DEVICE_CLASS_PIMA_EC_DEVICE_RESET,
+ UX_DEVICE_CLASS_PIMA_EC_STORAGE_INFO_CHANGED,
+ UX_DEVICE_CLASS_PIMA_EC_CAPTURE_COMPLETE,
+ UX_DEVICE_CLASS_PIMA_EC_UNREPORTED_STATUS,
0
};
/* Define PIMA supported device properties. The last entry MUST be a zero. The DeviceInfoSet command
will parse this array and compute the number of functions supported and return it to the
- host. For each declared device property, a dataset must be created in the application.
+ host. For each declared device property, a dataset must be created in the application.
This table is used is the application has not defined any device properties. */
USHORT _ux_device_class_pima_device_prop_supported[] = {
- UX_DEVICE_CLASS_PIMA_DEV_PROP_UNDEFINED,
- UX_DEVICE_CLASS_PIMA_DEV_PROP_BATTERY_LEVEL,
- UX_DEVICE_CLASS_PIMA_DEV_PROP_FUNCTIONAL_MODE,
- UX_DEVICE_CLASS_PIMA_DEV_PROP_IMAGE_SIZE,
- UX_DEVICE_CLASS_PIMA_DEV_PROP_COMPRESSION_SETTING,
- UX_DEVICE_CLASS_PIMA_DEV_PROP_WHITE_BALANCE,
- UX_DEVICE_CLASS_PIMA_DEV_PROP_RGB_GAIN,
- UX_DEVICE_CLASS_PIMA_DEV_PROP_F_NUMBER,
- UX_DEVICE_CLASS_PIMA_DEV_PROP_FOCAL_LENGTH,
- UX_DEVICE_CLASS_PIMA_DEV_PROP_FOCUS_DISTANCE,
- UX_DEVICE_CLASS_PIMA_DEV_PROP_FOCUS_MODE,
- UX_DEVICE_CLASS_PIMA_DEV_PROP_EXPOSURE_METERING_MODE,
- UX_DEVICE_CLASS_PIMA_DEV_PROP_FLASH_MODE,
- UX_DEVICE_CLASS_PIMA_DEV_PROP_EXPOSURE_TIME,
- UX_DEVICE_CLASS_PIMA_DEV_PROP_EXPOSURE_PROGRAM_MODE,
- UX_DEVICE_CLASS_PIMA_DEV_PROP_EXPOSURE_INDEX,
- UX_DEVICE_CLASS_PIMA_DEV_PROP_EXPOSURE_BIAS_COMPENSATION,
- UX_DEVICE_CLASS_PIMA_DEV_PROP_DATE_TIME,
- UX_DEVICE_CLASS_PIMA_DEV_PROP_CAPTURE_DELAY,
- UX_DEVICE_CLASS_PIMA_DEV_PROP_STILL_CAPTURE_MODE,
- UX_DEVICE_CLASS_PIMA_DEV_PROP_CONTRAST,
- UX_DEVICE_CLASS_PIMA_DEV_PROP_SHARPNESS,
- UX_DEVICE_CLASS_PIMA_DEV_PROP_DIGITAL_ZOOM,
- UX_DEVICE_CLASS_PIMA_DEV_PROP_EFFECT_MODE,
- UX_DEVICE_CLASS_PIMA_DEV_PROP_BURST_NUMBER,
- UX_DEVICE_CLASS_PIMA_DEV_PROP_BURST_INTERVAL,
- UX_DEVICE_CLASS_PIMA_DEV_PROP_TIME_LAPSE_NUMBER,
- UX_DEVICE_CLASS_PIMA_DEV_PROP_TIME_LAPSE_INTERVAL,
- UX_DEVICE_CLASS_PIMA_DEV_PROP_FOCUS_METERING_MODE,
- UX_DEVICE_CLASS_PIMA_DEV_PROP_UPLOAD_URL,
- UX_DEVICE_CLASS_PIMA_DEV_PROP_ARTIST,
- UX_DEVICE_CLASS_PIMA_DEV_PROP_COPYRIGHT_INFO,
+ UX_DEVICE_CLASS_PIMA_DEV_PROP_UNDEFINED,
+ UX_DEVICE_CLASS_PIMA_DEV_PROP_BATTERY_LEVEL,
+ UX_DEVICE_CLASS_PIMA_DEV_PROP_FUNCTIONAL_MODE,
+ UX_DEVICE_CLASS_PIMA_DEV_PROP_IMAGE_SIZE,
+ UX_DEVICE_CLASS_PIMA_DEV_PROP_COMPRESSION_SETTING,
+ UX_DEVICE_CLASS_PIMA_DEV_PROP_WHITE_BALANCE,
+ UX_DEVICE_CLASS_PIMA_DEV_PROP_RGB_GAIN,
+ UX_DEVICE_CLASS_PIMA_DEV_PROP_F_NUMBER,
+ UX_DEVICE_CLASS_PIMA_DEV_PROP_FOCAL_LENGTH,
+ UX_DEVICE_CLASS_PIMA_DEV_PROP_FOCUS_DISTANCE,
+ UX_DEVICE_CLASS_PIMA_DEV_PROP_FOCUS_MODE,
+ UX_DEVICE_CLASS_PIMA_DEV_PROP_EXPOSURE_METERING_MODE,
+ UX_DEVICE_CLASS_PIMA_DEV_PROP_FLASH_MODE,
+ UX_DEVICE_CLASS_PIMA_DEV_PROP_EXPOSURE_TIME,
+ UX_DEVICE_CLASS_PIMA_DEV_PROP_EXPOSURE_PROGRAM_MODE,
+ UX_DEVICE_CLASS_PIMA_DEV_PROP_EXPOSURE_INDEX,
+ UX_DEVICE_CLASS_PIMA_DEV_PROP_EXPOSURE_BIAS_COMPENSATION,
+ UX_DEVICE_CLASS_PIMA_DEV_PROP_DATE_TIME,
+ UX_DEVICE_CLASS_PIMA_DEV_PROP_CAPTURE_DELAY,
+ UX_DEVICE_CLASS_PIMA_DEV_PROP_STILL_CAPTURE_MODE,
+ UX_DEVICE_CLASS_PIMA_DEV_PROP_CONTRAST,
+ UX_DEVICE_CLASS_PIMA_DEV_PROP_SHARPNESS,
+ UX_DEVICE_CLASS_PIMA_DEV_PROP_DIGITAL_ZOOM,
+ UX_DEVICE_CLASS_PIMA_DEV_PROP_EFFECT_MODE,
+ UX_DEVICE_CLASS_PIMA_DEV_PROP_BURST_NUMBER,
+ UX_DEVICE_CLASS_PIMA_DEV_PROP_BURST_INTERVAL,
+ UX_DEVICE_CLASS_PIMA_DEV_PROP_TIME_LAPSE_NUMBER,
+ UX_DEVICE_CLASS_PIMA_DEV_PROP_TIME_LAPSE_INTERVAL,
+ UX_DEVICE_CLASS_PIMA_DEV_PROP_FOCUS_METERING_MODE,
+ UX_DEVICE_CLASS_PIMA_DEV_PROP_UPLOAD_URL,
+ UX_DEVICE_CLASS_PIMA_DEV_PROP_ARTIST,
+ UX_DEVICE_CLASS_PIMA_DEV_PROP_COPYRIGHT_INFO,
#ifdef UX_PIMA_WITH_MTP_SUPPORT
- UX_DEVICE_CLASS_PIMA_DEV_PROP_SYNCHRONIZATION_PARTNER,
- UX_DEVICE_CLASS_PIMA_DEV_PROP_DEVICE_FRIENDLY_NAME,
- UX_DEVICE_CLASS_PIMA_DEV_PROP_VOLUME,
- UX_DEVICE_CLASS_PIMA_DEV_PROP_SUPPORTED_FORMATS_ORDERED,
- UX_DEVICE_CLASS_PIMA_DEV_PROP_DEVICE_ICON,
- UX_DEVICE_CLASS_PIMA_DEV_PROP_PLAYBACK_RATE,
- UX_DEVICE_CLASS_PIMA_DEV_PROP_PLAYBACK_OBJECT,
- UX_DEVICE_CLASS_PIMA_DEV_PROP_PLAYBACK_CONTAINER,
- UX_DEVICE_CLASS_PIMA_DEV_PROP_SESSION_INITIATOR_VERSION_INFO,
- UX_DEVICE_CLASS_PIMA_DEV_PROP_PERCEIVED_DEVICE_TYPE,
+ UX_DEVICE_CLASS_PIMA_DEV_PROP_SYNCHRONIZATION_PARTNER,
+ UX_DEVICE_CLASS_PIMA_DEV_PROP_DEVICE_FRIENDLY_NAME,
+ UX_DEVICE_CLASS_PIMA_DEV_PROP_VOLUME,
+ UX_DEVICE_CLASS_PIMA_DEV_PROP_SUPPORTED_FORMATS_ORDERED,
+ UX_DEVICE_CLASS_PIMA_DEV_PROP_DEVICE_ICON,
+ UX_DEVICE_CLASS_PIMA_DEV_PROP_PLAYBACK_RATE,
+ UX_DEVICE_CLASS_PIMA_DEV_PROP_PLAYBACK_OBJECT,
+ UX_DEVICE_CLASS_PIMA_DEV_PROP_PLAYBACK_CONTAINER,
+ UX_DEVICE_CLASS_PIMA_DEV_PROP_SESSION_INITIATOR_VERSION_INFO,
+ UX_DEVICE_CLASS_PIMA_DEV_PROP_PERCEIVED_DEVICE_TYPE,
#endif
0
};
-
+
/* Define PIMA supported capture formats. The last entry MUST be a zero. The DeviceInfoSet command
will parse this array and compute the number of functions supported and return it to the
- host.
+ host.
This table is used is the application has not defined any capture formats. */
USHORT _ux_device_class_pima_supported_capture_formats[] = {
0
@@ -194,82 +187,82 @@ USHORT _ux_device_class_pima_supported_capture_formats[] = {
/* Define PIMA supported image formats. The last entry MUST be a zero. The DeviceInfoSet command
will parse this array and compute the number of formats supported and return it to the
- host.
+ host.
This table is used is the application has not defined any capture formats. */
USHORT _ux_device_class_pima_supported_image_formats[] = {
- UX_DEVICE_CLASS_PIMA_OFC_UNDEFINED,
- UX_DEVICE_CLASS_PIMA_OFC_ASSOCIATION,
- UX_DEVICE_CLASS_PIMA_OFC_SCRIPT,
- UX_DEVICE_CLASS_PIMA_OFC_EXECUTABLE,
- UX_DEVICE_CLASS_PIMA_OFC_TEXT,
- UX_DEVICE_CLASS_PIMA_OFC_HTML,
- UX_DEVICE_CLASS_PIMA_OFC_DPOF,
- UX_DEVICE_CLASS_PIMA_OFC_AIFF,
- UX_DEVICE_CLASS_PIMA_OFC_WAV,
- UX_DEVICE_CLASS_PIMA_OFC_MP3,
- UX_DEVICE_CLASS_PIMA_OFC_AVI,
- UX_DEVICE_CLASS_PIMA_OFC_MPEG,
- UX_DEVICE_CLASS_PIMA_OFC_ASF,
- UX_DEVICE_CLASS_PIMA_OFC_DEFINED,
- UX_DEVICE_CLASS_PIMA_OFC_EXIF_JPEG,
- UX_DEVICE_CLASS_PIMA_OFC_TIFF_EP,
- UX_DEVICE_CLASS_PIMA_OFC_FLASHPIX,
- UX_DEVICE_CLASS_PIMA_OFC_BMP,
- UX_DEVICE_CLASS_PIMA_OFC_CIFF,
- UX_DEVICE_CLASS_PIMA_OFC_UNDEFINED,
- UX_DEVICE_CLASS_PIMA_OFC_GIF,
- UX_DEVICE_CLASS_PIMA_OFC_JFIF,
- UX_DEVICE_CLASS_PIMA_OFC_CD,
- UX_DEVICE_CLASS_PIMA_OFC_PICT,
- UX_DEVICE_CLASS_PIMA_OFC_PNG,
- UX_DEVICE_CLASS_PIMA_OFC_UNDEFINED,
- UX_DEVICE_CLASS_PIMA_OFC_TIFF,
- UX_DEVICE_CLASS_PIMA_OFC_TIFF_IT,
- UX_DEVICE_CLASS_PIMA_OFC_JP2,
- UX_DEVICE_CLASS_PIMA_OFC_JPX,
+ UX_DEVICE_CLASS_PIMA_OFC_UNDEFINED,
+ UX_DEVICE_CLASS_PIMA_OFC_ASSOCIATION,
+ UX_DEVICE_CLASS_PIMA_OFC_SCRIPT,
+ UX_DEVICE_CLASS_PIMA_OFC_EXECUTABLE,
+ UX_DEVICE_CLASS_PIMA_OFC_TEXT,
+ UX_DEVICE_CLASS_PIMA_OFC_HTML,
+ UX_DEVICE_CLASS_PIMA_OFC_DPOF,
+ UX_DEVICE_CLASS_PIMA_OFC_AIFF,
+ UX_DEVICE_CLASS_PIMA_OFC_WAV,
+ UX_DEVICE_CLASS_PIMA_OFC_MP3,
+ UX_DEVICE_CLASS_PIMA_OFC_AVI,
+ UX_DEVICE_CLASS_PIMA_OFC_MPEG,
+ UX_DEVICE_CLASS_PIMA_OFC_ASF,
+ UX_DEVICE_CLASS_PIMA_OFC_DEFINED,
+ UX_DEVICE_CLASS_PIMA_OFC_EXIF_JPEG,
+ UX_DEVICE_CLASS_PIMA_OFC_TIFF_EP,
+ UX_DEVICE_CLASS_PIMA_OFC_FLASHPIX,
+ UX_DEVICE_CLASS_PIMA_OFC_BMP,
+ UX_DEVICE_CLASS_PIMA_OFC_CIFF,
+ UX_DEVICE_CLASS_PIMA_OFC_UNDEFINED,
+ UX_DEVICE_CLASS_PIMA_OFC_GIF,
+ UX_DEVICE_CLASS_PIMA_OFC_JFIF,
+ UX_DEVICE_CLASS_PIMA_OFC_CD,
+ UX_DEVICE_CLASS_PIMA_OFC_PICT,
+ UX_DEVICE_CLASS_PIMA_OFC_PNG,
+ UX_DEVICE_CLASS_PIMA_OFC_UNDEFINED,
+ UX_DEVICE_CLASS_PIMA_OFC_TIFF,
+ UX_DEVICE_CLASS_PIMA_OFC_TIFF_IT,
+ UX_DEVICE_CLASS_PIMA_OFC_JP2,
+ UX_DEVICE_CLASS_PIMA_OFC_JPX,
#ifdef UX_PIMA_WITH_MTP_SUPPORT
- UX_DEVICE_CLASS_PIMA_OFC_UNDEFINED_FIRMWARE,
- UX_DEVICE_CLASS_PIMA_OFC_WINDOWS_IMAGE_FORMAT,
- UX_DEVICE_CLASS_PIMA_OFC_UNDEFINED_AUDIO,
- UX_DEVICE_CLASS_PIMA_OFC_WMA,
- UX_DEVICE_CLASS_PIMA_OFC_OGG,
- UX_DEVICE_CLASS_PIMA_OFC_AAC,
- UX_DEVICE_CLASS_PIMA_OFC_AUDIBLE,
- UX_DEVICE_CLASS_PIMA_OFC_FLAC,
- UX_DEVICE_CLASS_PIMA_OFC_UNDEFINED_VIDEO,
- UX_DEVICE_CLASS_PIMA_OFC_WMV,
- UX_DEVICE_CLASS_PIMA_OFC_MP4_CONTAINER,
- UX_DEVICE_CLASS_PIMA_OFC_MP2,
- UX_DEVICE_CLASS_PIMA_OFC_3GP_CONTAINER,
- UX_DEVICE_CLASS_PIMA_OFC_UNDEFINED_COLLECTION,
- UX_DEVICE_CLASS_PIMA_OFC_ABSTRACT_MULTIMEDIA_ALBUM,
- UX_DEVICE_CLASS_PIMA_OFC_ABSTRACT_IMAGE_ALBUM,
- UX_DEVICE_CLASS_PIMA_OFC_ABSTRACT_AUDIO_ALBUM,
- UX_DEVICE_CLASS_PIMA_OFC_ABSTRACT_VIDEO_ALBUM,
- UX_DEVICE_CLASS_PIMA_OFC_ABSTRACT_AUDIO_AND_VIDEO_PLAYLIST,
- UX_DEVICE_CLASS_PIMA_OFC_ABSTRACT_CONTACT_GROUP,
- UX_DEVICE_CLASS_PIMA_OFC_ABSTRACT_MESSAGE_FOLDER,
- UX_DEVICE_CLASS_PIMA_OFC_ABSTRACT_CHAPTERED_PRODUCTION,
- UX_DEVICE_CLASS_PIMA_OFC_ABSTRACT_AUDIO_PLAYLIST,
- UX_DEVICE_CLASS_PIMA_OFC_ABSTRACT_VIDEO_PLAYLIST,
- UX_DEVICE_CLASS_PIMA_OFC_ABSTRACT_MEDIACAST,
- UX_DEVICE_CLASS_PIMA_OFC_WPL_PLAYLIST,
- UX_DEVICE_CLASS_PIMA_OFC_M3U_PLAYLIST,
- UX_DEVICE_CLASS_PIMA_OFC_MPL_PLAYLIST,
- UX_DEVICE_CLASS_PIMA_OFC_ASX_PLAYLIST,
- UX_DEVICE_CLASS_PIMA_OFC_PLS_PLAYLIST,
- UX_DEVICE_CLASS_PIMA_OFC_UNDEFINED_DOCUMENT,
- UX_DEVICE_CLASS_PIMA_OFC_ABSTRACT_DOCUMENT,
- UX_DEVICE_CLASS_PIMA_OFC_XML_DOCUMENT,
- UX_DEVICE_CLASS_PIMA_OFC_MICROSOFT_WORD_DOCUMENT,
- UX_DEVICE_CLASS_PIMA_OFC_MHT_COMPILED_HTML_DOCUMENT,
- UX_DEVICE_CLASS_PIMA_OFC_MICROSOFT_EXCEL_SPREADSHEET,
- UX_DEVICE_CLASS_PIMA_OFC_MICROSOFT_POWERPOINT_PRESENTATION,
- UX_DEVICE_CLASS_PIMA_OFC_UNDEFINED_MESSAGE,
- UX_DEVICE_CLASS_PIMA_OFC_ABSTRACT_MESSAGE,
- UX_DEVICE_CLASS_PIMA_OFC_UNDEFINED_CONTACT,
- UX_DEVICE_CLASS_PIMA_OFC_ABSTRACT_CONTACT,
- UX_DEVICE_CLASS_PIMA_OFC_VCARD2,
+ UX_DEVICE_CLASS_PIMA_OFC_UNDEFINED_FIRMWARE,
+ UX_DEVICE_CLASS_PIMA_OFC_WINDOWS_IMAGE_FORMAT,
+ UX_DEVICE_CLASS_PIMA_OFC_UNDEFINED_AUDIO,
+ UX_DEVICE_CLASS_PIMA_OFC_WMA,
+ UX_DEVICE_CLASS_PIMA_OFC_OGG,
+ UX_DEVICE_CLASS_PIMA_OFC_AAC,
+ UX_DEVICE_CLASS_PIMA_OFC_AUDIBLE,
+ UX_DEVICE_CLASS_PIMA_OFC_FLAC,
+ UX_DEVICE_CLASS_PIMA_OFC_UNDEFINED_VIDEO,
+ UX_DEVICE_CLASS_PIMA_OFC_WMV,
+ UX_DEVICE_CLASS_PIMA_OFC_MP4_CONTAINER,
+ UX_DEVICE_CLASS_PIMA_OFC_MP2,
+ UX_DEVICE_CLASS_PIMA_OFC_3GP_CONTAINER,
+ UX_DEVICE_CLASS_PIMA_OFC_UNDEFINED_COLLECTION,
+ UX_DEVICE_CLASS_PIMA_OFC_ABSTRACT_MULTIMEDIA_ALBUM,
+ UX_DEVICE_CLASS_PIMA_OFC_ABSTRACT_IMAGE_ALBUM,
+ UX_DEVICE_CLASS_PIMA_OFC_ABSTRACT_AUDIO_ALBUM,
+ UX_DEVICE_CLASS_PIMA_OFC_ABSTRACT_VIDEO_ALBUM,
+ UX_DEVICE_CLASS_PIMA_OFC_ABSTRACT_AUDIO_AND_VIDEO_PLAYLIST,
+ UX_DEVICE_CLASS_PIMA_OFC_ABSTRACT_CONTACT_GROUP,
+ UX_DEVICE_CLASS_PIMA_OFC_ABSTRACT_MESSAGE_FOLDER,
+ UX_DEVICE_CLASS_PIMA_OFC_ABSTRACT_CHAPTERED_PRODUCTION,
+ UX_DEVICE_CLASS_PIMA_OFC_ABSTRACT_AUDIO_PLAYLIST,
+ UX_DEVICE_CLASS_PIMA_OFC_ABSTRACT_VIDEO_PLAYLIST,
+ UX_DEVICE_CLASS_PIMA_OFC_ABSTRACT_MEDIACAST,
+ UX_DEVICE_CLASS_PIMA_OFC_WPL_PLAYLIST,
+ UX_DEVICE_CLASS_PIMA_OFC_M3U_PLAYLIST,
+ UX_DEVICE_CLASS_PIMA_OFC_MPL_PLAYLIST,
+ UX_DEVICE_CLASS_PIMA_OFC_ASX_PLAYLIST,
+ UX_DEVICE_CLASS_PIMA_OFC_PLS_PLAYLIST,
+ UX_DEVICE_CLASS_PIMA_OFC_UNDEFINED_DOCUMENT,
+ UX_DEVICE_CLASS_PIMA_OFC_ABSTRACT_DOCUMENT,
+ UX_DEVICE_CLASS_PIMA_OFC_XML_DOCUMENT,
+ UX_DEVICE_CLASS_PIMA_OFC_MICROSOFT_WORD_DOCUMENT,
+ UX_DEVICE_CLASS_PIMA_OFC_MHT_COMPILED_HTML_DOCUMENT,
+ UX_DEVICE_CLASS_PIMA_OFC_MICROSOFT_EXCEL_SPREADSHEET,
+ UX_DEVICE_CLASS_PIMA_OFC_MICROSOFT_POWERPOINT_PRESENTATION,
+ UX_DEVICE_CLASS_PIMA_OFC_UNDEFINED_MESSAGE,
+ UX_DEVICE_CLASS_PIMA_OFC_ABSTRACT_MESSAGE,
+ UX_DEVICE_CLASS_PIMA_OFC_UNDEFINED_CONTACT,
+ UX_DEVICE_CLASS_PIMA_OFC_ABSTRACT_CONTACT,
+ UX_DEVICE_CLASS_PIMA_OFC_VCARD2,
#endif
0
};
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 a4e1affb..5d656a5c 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
@@ -1,17 +1,18 @@
/***************************************************************************
- * Copyright (c) 2024 Microsoft Corporation
- *
+ * Copyright (c) 2024 Microsoft Corporation
+ * Copyright (c) 2026-present Eclipse ThreadX contributors
+ *
* This program and the accompanying materials are made available under the
* terms of the MIT License which is available at
* https://opensource.org/licenses/MIT.
- *
+ *
* SPDX-License-Identifier: MIT
**************************************************************************/
/**************************************************************************/
/**************************************************************************/
-/** */
-/** USBX Component */
+/** */
+/** USBX Component */
/** */
/** Device PIMA Class */
/** */
@@ -28,55 +29,40 @@
#include "ux_device_stack.h"
-/**************************************************************************/
-/* */
-/* FUNCTION RELEASE */
-/* */
-/* _ux_device_class_pima_deactivate PORTABLE C */
+/**************************************************************************/
+/* */
+/* FUNCTION RELEASE */
+/* */
+/* _ux_device_class_pima_deactivate PORTABLE C */
/* 6.3.0 */
/* AUTHOR */
/* */
/* Chaoqiong Xiao, Microsoft Corporation */
/* */
/* DESCRIPTION */
-/* */
-/* This function deactivate an instance of the pima class. */
-/* */
-/* INPUT */
-/* */
-/* command Pointer to a class command */
-/* */
-/* OUTPUT */
-/* */
-/* Completion Status */
-/* */
-/* CALLS */
-/* */
-/* _ux_device_stack_transfer_all_request_abort Abort all transfers */
-/* */
-/* CALLED BY */
-/* */
+/* */
+/* This function deactivate an instance of the pima class. */
+/* */
+/* INPUT */
+/* */
+/* command Pointer to a class command */
+/* */
+/* OUTPUT */
+/* */
+/* Completion Status */
+/* */
+/* CALLS */
+/* */
+/* _ux_device_stack_transfer_all_request_abort Abort all transfers */
+/* */
+/* CALLED BY */
+/* */
/* PIMA Class */
-/* */
-/* RELEASE HISTORY */
-/* */
-/* DATE NAME DESCRIPTION */
-/* */
-/* 05-19-2020 Chaoqiong Xiao Initial Version 6.0 */
-/* 09-30-2020 Chaoqiong Xiao Modified comment(s), */
-/* resulting in version 6.1 */
-/* 07-29-2022 Chaoqiong Xiao Modified comment(s), */
-/* fixed parameter/variable */
-/* names conflict C++ keyword, */
-/* resulting in version 6.1.12 */
-/* 10-31-2023 Chaoqiong Xiao Modified comment(s), */
-/* supported optional INT EP, */
-/* resulting in version 6.3.0 */
/* */
/**************************************************************************/
UINT _ux_device_class_pima_deactivate(UX_SLAVE_CLASS_COMMAND *command)
{
-
+
UX_SLAVE_CLASS_PIMA *pima;
UX_SLAVE_CLASS *class_ptr;
@@ -97,7 +83,7 @@ UX_SLAVE_CLASS *class_ptr;
/* If there is a deactivate function call it. */
if (pima -> ux_device_class_pima_instance_deactivate != UX_NULL)
- {
+ {
/* Invoke the application. */
pima -> ux_device_class_pima_instance_deactivate(pima);
}
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 1f4000e6..70187d0a 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
@@ -1,10 +1,11 @@
/***************************************************************************
- * Copyright (c) 2024 Microsoft Corporation
- *
+ * Copyright (c) 2024 Microsoft Corporation
+ * Copyright (c) 2026-present Eclipse ThreadX contributors
+ *
* This program and the accompanying materials are made available under the
* terms of the MIT License which is available at
* https://opensource.org/licenses/MIT.
- *
+ *
* SPDX-License-Identifier: MIT
**************************************************************************/
@@ -69,24 +70,6 @@
/* */
/* Device Storage Class */
/* */
-/* RELEASE HISTORY */
-/* */
-/* DATE NAME DESCRIPTION */
-/* */
-/* 05-19-2020 Chaoqiong Xiao Initial Version 6.0 */
-/* 09-30-2020 Chaoqiong Xiao Modified comment(s), */
-/* resulting in version 6.1 */
-/* 01-31-2022 Chaoqiong Xiao Modified comment(s), */
-/* added sanity checks, */
-/* resulting in version 6.1.10 */
-/* 04-25-2022 Chaoqiong Xiao Modified comment(s), */
-/* internal clean up, */
-/* resulting in version 6.1.11 */
-/* 10-31-2023 Chaoqiong Xiao Modified comment(s), */
-/* checked compiling options */
-/* by runtime UX_ASSERT, */
-/* resulting in version 6.3.0 */
-/* */
/**************************************************************************/
UINT _ux_device_class_pima_device_info_send(UX_SLAVE_CLASS_PIMA *pima)
{
diff --git a/common/usbx_device_classes/src/ux_device_class_pima_device_prop_desc_get.c b/common/usbx_device_classes/src/ux_device_class_pima_device_prop_desc_get.c
index 5aec26e4..b0024f92 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
@@ -1,10 +1,11 @@
/***************************************************************************
- * Copyright (c) 2024 Microsoft Corporation
- *
+ * Copyright (c) 2024 Microsoft Corporation
+ * Copyright (c) 2026-present Eclipse ThreadX contributors
+ *
* This program and the accompanying materials are made available under the
* terms of the MIT License which is available at
* https://opensource.org/licenses/MIT.
- *
+ *
* SPDX-License-Identifier: MIT
**************************************************************************/
@@ -66,20 +67,6 @@
/* */
/* Device Pima Class */
/* */
-/* RELEASE HISTORY */
-/* */
-/* DATE NAME DESCRIPTION */
-/* */
-/* 05-19-2020 Chaoqiong Xiao Initial Version 6.0 */
-/* 09-30-2020 Chaoqiong Xiao Modified comment(s), */
-/* verified memset and memcpy */
-/* cases, */
-/* resulting in version 6.1 */
-/* 01-31-2022 Chaoqiong Xiao Modified comment(s), */
-/* updated status handling, */
-/* improved sanity checks, */
-/* resulting in version 6.1.10 */
-/* */
/**************************************************************************/
UINT _ux_device_class_pima_device_prop_desc_get(UX_SLAVE_CLASS_PIMA *pima,
ULONG device_property_code)
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 f4a2f34b..9be49209 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
@@ -1,10 +1,11 @@
/***************************************************************************
- * Copyright (c) 2024 Microsoft Corporation
- *
+ * Copyright (c) 2024 Microsoft Corporation
+ * Copyright (c) 2026-present Eclipse ThreadX contributors
+ *
* This program and the accompanying materials are made available under the
* terms of the MIT License which is available at
* https://opensource.org/licenses/MIT.
- *
+ *
* SPDX-License-Identifier: MIT
**************************************************************************/
@@ -71,24 +72,6 @@
/* */
/* Device Pima Class */
/* */
-/* RELEASE HISTORY */
-/* */
-/* DATE NAME DESCRIPTION */
-/* */
-/* 05-19-2020 Chaoqiong Xiao Initial Version 6.0 */
-/* 09-30-2020 Chaoqiong Xiao Modified comment(s), */
-/* verified memset and memcpy */
-/* cases, */
-/* resulting in version 6.1 */
-/* 01-31-2022 Chaoqiong Xiao Modified comment(s), */
-/* updated status handling, */
-/* improved sanity checks, */
-/* resulting in version 6.1.10 */
-/* 10-31-2023 Chaoqiong Xiao Modified comment(s), */
-/* checked compiling options */
-/* by runtime UX_ASSERT, */
-/* resulting in version 6.3.0 */
-/* */
/**************************************************************************/
UINT _ux_device_class_pima_device_prop_value_get(UX_SLAVE_CLASS_PIMA *pima,
ULONG device_property_code)
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 530fb115..70a645c7 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
@@ -1,10 +1,11 @@
/***************************************************************************
- * Copyright (c) 2024 Microsoft Corporation
- *
+ * Copyright (c) 2024 Microsoft Corporation
+ * Copyright (c) 2026-present Eclipse ThreadX contributors
+ *
* This program and the accompanying materials are made available under the
* terms of the MIT License which is available at
* https://opensource.org/licenses/MIT.
- *
+ *
* SPDX-License-Identifier: MIT
**************************************************************************/
@@ -61,18 +62,6 @@
/* */
/* Device Storage Class */
/* */
-/* RELEASE HISTORY */
-/* */
-/* DATE NAME DESCRIPTION */
-/* */
-/* 05-19-2020 Chaoqiong Xiao Initial Version 6.0 */
-/* 09-30-2020 Chaoqiong Xiao Modified comment(s), */
-/* resulting in version 6.1 */
-/* 01-31-2022 Chaoqiong Xiao Modified comment(s), */
-/* updated status handling, */
-/* improved sanity checks, */
-/* resulting in version 6.1.10 */
-/* */
/**************************************************************************/
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 c5c6882b..70810e41 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
@@ -1,18 +1,19 @@
/***************************************************************************
- * Copyright (c) 2024 Microsoft Corporation
- *
+ * Copyright (c) 2024 Microsoft Corporation
+ * Copyright (c) 2026-present Eclipse ThreadX contributors
+ *
* This program and the accompanying materials are made available under the
* terms of the MIT License which is available at
* https://opensource.org/licenses/MIT.
- *
+ *
* SPDX-License-Identifier: MIT
**************************************************************************/
/**************************************************************************/
/**************************************************************************/
-/** */
-/** USBX Component */
+/** */
+/** USBX Component */
/** */
/** Device Pima Class */
/** */
@@ -29,44 +30,36 @@
#include "ux_device_stack.h"
-/**************************************************************************/
-/* */
-/* FUNCTION RELEASE */
-/* */
-/* _ux_device_class_pima_device_reset PORTABLE C */
+/**************************************************************************/
+/* */
+/* FUNCTION RELEASE */
+/* */
+/* _ux_device_class_pima_device_reset PORTABLE C */
/* 6.1 */
/* AUTHOR */
/* */
/* Chaoqiong Xiao, Microsoft Corporation */
/* */
/* DESCRIPTION */
-/* */
-/* This function informs the application that the device needs to */
-/* be reset. This will close the session. */
-/* */
-/* INPUT */
-/* */
-/* pima Pointer to pima class */
-/* */
-/* OUTPUT */
-/* */
-/* Completion Status */
-/* */
-/* CALLS */
-/* */
+/* */
+/* This function informs the application that the device needs to */
+/* be reset. This will close the session. */
+/* */
+/* INPUT */
+/* */
+/* pima Pointer to pima class */
+/* */
+/* OUTPUT */
+/* */
+/* Completion Status */
+/* */
+/* CALLS */
+/* */
/* _ux_device_class_pima_response_send Send PIMA response */
-/* */
-/* CALLED BY */
-/* */
-/* Device Pima Class */
-/* */
-/* RELEASE HISTORY */
-/* */
-/* DATE NAME DESCRIPTION */
-/* */
-/* 05-19-2020 Chaoqiong Xiao Initial Version 6.0 */
-/* 09-30-2020 Chaoqiong Xiao Modified comment(s), */
-/* resulting in version 6.1 */
+/* */
+/* CALLED BY */
+/* */
+/* Device Pima Class */
/* */
/**************************************************************************/
UINT _ux_device_class_pima_device_reset(UX_SLAVE_CLASS_PIMA *pima)
@@ -79,24 +72,24 @@ UINT status;
/* Invoke the application callback function. */
status = pima -> ux_device_class_pima_device_reset(pima);
-
+
/* Check for error. */
if (status != UX_SUCCESS)
/* We return an error. */
_ux_device_class_pima_response_send(pima, status, 0, 0, 0, 0);
-
+
else
{
-
+
/* We return a response with success. */
_ux_device_class_pima_response_send(pima, UX_DEVICE_CLASS_PIMA_RC_OK, 0, 0, 0, 0);
-
+
/* Session is now closed. */
pima -> ux_device_class_pima_session_id = 0;
-
+
}
-
+
/* Return completion status. */
return(status);
}
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 f2753e54..d137a021 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
@@ -1,5 +1,6 @@
/***************************************************************************
* Copyright (c) 2024 Microsoft Corporation
+ * Copyright (c) 2026-present Eclipse ThreadX contributors
*
* This program and the accompanying materials are made available under the
* terms of the MIT License which is available at
@@ -65,22 +66,6 @@
/* */
/* PIMA Class */
/* */
-/* RELEASE HISTORY */
-/* */
-/* DATE NAME DESCRIPTION */
-/* */
-/* 05-19-2020 Chaoqiong Xiao Initial Version 6.0 */
-/* 09-30-2020 Chaoqiong Xiao Modified comment(s), */
-/* resulting in version 6.1 */
-/* 10-31-2023 Chaoqiong Xiao Modified comment(s), */
-/* added error checks support, */
-/* resulting in version 6.3.0 */
-/* xx-xx-xxxx Mohamed ayed Modified comment(s), */
-/* added call of pima uninit */
-/* function, */
-/* remove extra spaces, */
-/* resulting in version 6.x */
-/* */
/**************************************************************************/
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 a215c5b1..b4897aeb 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
@@ -1,17 +1,18 @@
/***************************************************************************
- * Copyright (c) 2024 Microsoft Corporation
- *
+ * Copyright (c) 2024 Microsoft Corporation
+ * Copyright (c) 2026-present Eclipse ThreadX contributors
+ *
* This program and the accompanying materials are made available under the
* terms of the MIT License which is available at
* https://opensource.org/licenses/MIT.
- *
+ *
* SPDX-License-Identifier: MIT
**************************************************************************/
/**************************************************************************/
/**************************************************************************/
-/** */
-/** USBX Component */
+/** */
+/** USBX Component */
/** */
/** Device PIMA Class */
/** */
@@ -28,47 +29,39 @@
#include "ux_device_stack.h"
-/**************************************************************************/
-/* */
-/* FUNCTION RELEASE */
-/* */
-/* _ux_device_class_pima_event_get PORTABLE C */
+/**************************************************************************/
+/* */
+/* FUNCTION RELEASE */
+/* */
+/* _ux_device_class_pima_event_get PORTABLE C */
/* 6.1 */
/* AUTHOR */
/* */
/* Chaoqiong Xiao, Microsoft Corporation */
/* */
/* DESCRIPTION */
-/* */
-/* This function checks if there is an event from the application */
-/* */
-/* INPUT */
-/* */
-/* pima Address of pima class */
-/* event Pointer of the event */
-/* */
-/* OUTPUT */
-/* */
-/* status UX_SUCCESS if there is an */
-/* event */
-/* CALLS */
-/* */
+/* */
+/* This function checks if there is an event from the application */
+/* */
+/* INPUT */
+/* */
+/* pima Address of pima class */
+/* event Pointer of the event */
+/* */
+/* OUTPUT */
+/* */
+/* status UX_SUCCESS if there is an */
+/* event */
+/* CALLS */
+/* */
/* None */
-/* */
-/* CALLED BY */
-/* */
-/* ThreadX */
-/* */
-/* RELEASE HISTORY */
-/* */
-/* DATE NAME DESCRIPTION */
-/* */
-/* 05-19-2020 Chaoqiong Xiao Initial Version 6.0 */
-/* 09-30-2020 Chaoqiong Xiao Modified comment(s), */
-/* resulting in version 6.1 */
+/* */
+/* CALLED BY */
+/* */
+/* ThreadX */
/* */
/**************************************************************************/
-UINT _ux_device_class_pima_event_get(UX_SLAVE_CLASS_PIMA *pima,
+UINT _ux_device_class_pima_event_get(UX_SLAVE_CLASS_PIMA *pima,
UX_SLAVE_CLASS_PIMA_EVENT *pima_event)
{
@@ -78,15 +71,15 @@ UX_SLAVE_CLASS_PIMA_EVENT *current_pima_event;
UX_TRACE_IN_LINE_INSERT(UX_TRACE_DEVICE_CLASS_PIMA_EVENT_GET, pima, pima_event, 0, 0, UX_TRACE_DEVICE_CLASS_EVENTS, 0, 0)
/* Check if the head and the tail of the event array is the same. */
- if (pima -> ux_device_class_pima_event_array_head ==
+ if (pima -> ux_device_class_pima_event_array_head ==
pima -> ux_device_class_pima_event_array_tail)
/* No event to report. */
- return(UX_ERROR);
+ return(UX_ERROR);
/* There is an event to report, get the current pointer to the event. */
current_pima_event = pima -> ux_device_class_pima_event_array_tail;
-
+
/* fill in the event structure from the user. */
pima_event -> ux_device_class_pima_event_code = current_pima_event -> ux_device_class_pima_event_code;
pima_event -> ux_device_class_pima_event_session_id = pima -> ux_device_class_pima_session_id;
@@ -101,8 +94,8 @@ UX_SLAVE_CLASS_PIMA_EVENT *current_pima_event;
/* We are at the end, go back to the beginning. */
pima -> ux_device_class_pima_event_array_tail = pima -> ux_device_class_pima_event_array;
-
- else
+
+ else
/* We are not at the end, increment the tail position. */
pima -> ux_device_class_pima_event_array_tail++;
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 bb21bf43..cc398097 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
@@ -1,17 +1,18 @@
/***************************************************************************
- * Copyright (c) 2024 Microsoft Corporation
- *
+ * Copyright (c) 2024 Microsoft Corporation
+ * Copyright (c) 2026-present Eclipse ThreadX contributors
+ *
* This program and the accompanying materials are made available under the
* terms of the MIT License which is available at
* https://opensource.org/licenses/MIT.
- *
+ *
* SPDX-License-Identifier: MIT
**************************************************************************/
/**************************************************************************/
/**************************************************************************/
-/** */
-/** USBX Component */
+/** */
+/** USBX Component */
/** */
/** Device PIMA Class */
/** */
@@ -28,55 +29,40 @@
#include "ux_device_stack.h"
-/**************************************************************************/
-/* */
-/* FUNCTION RELEASE */
-/* */
-/* _ux_device_class_pima_event_set PORTABLE C */
+/**************************************************************************/
+/* */
+/* FUNCTION RELEASE */
+/* */
+/* _ux_device_class_pima_event_set PORTABLE C */
/* 6.3.0 */
/* AUTHOR */
/* */
/* Chaoqiong Xiao, Microsoft Corporation */
/* */
/* DESCRIPTION */
-/* */
-/* This function sends an event to the pima class. It is processed */
-/* asynchronously by the interrupt thread. */
-/* */
-/* INPUT */
-/* */
-/* pima Address of pima class */
-/* event Pointer of the event */
-/* */
-/* OUTPUT */
-/* */
-/* status UX_SUCCESS if there is an */
-/* event */
-/* CALLS */
-/* */
+/* */
+/* This function sends an event to the pima class. It is processed */
+/* asynchronously by the interrupt thread. */
+/* */
+/* INPUT */
+/* */
+/* pima Address of pima class */
+/* event Pointer of the event */
+/* */
+/* OUTPUT */
+/* */
+/* status UX_SUCCESS if there is an */
+/* event */
+/* CALLS */
+/* */
/* _ux_device_semaphore_put Put semaphore */
-/* */
-/* CALLED BY */
-/* */
-/* ThreadX */
-/* */
-/* RELEASE HISTORY */
-/* */
-/* DATE NAME DESCRIPTION */
-/* */
-/* 05-19-2020 Chaoqiong Xiao Initial Version 6.0 */
-/* 09-30-2020 Chaoqiong Xiao Modified comment(s), */
-/* resulting in version 6.1 */
-/* 01-31-2022 Chaoqiong Xiao Modified comment(s), */
-/* refined macros names, */
-/* added transaction ID, */
-/* resulting in version 6.1.10 */
-/* 10-31-2023 Chaoqiong Xiao Modified comment(s), */
-/* checked if INT EP exists, */
-/* resulting in version 6.3.0 */
+/* */
+/* CALLED BY */
+/* */
+/* ThreadX */
/* */
/**************************************************************************/
-UINT _ux_device_class_pima_event_set(UX_SLAVE_CLASS_PIMA *pima,
+UINT _ux_device_class_pima_event_set(UX_SLAVE_CLASS_PIMA *pima,
UX_SLAVE_CLASS_PIMA_EVENT *pima_event)
{
@@ -89,7 +75,7 @@ UX_SLAVE_DEVICE *device;
/* Get the pointer to the device. */
device = &_ux_system_slave -> ux_system_slave_device;
-
+
/* Check the device state. */
if (device -> ux_slave_device_state != UX_DEVICE_CONFIGURED)
{
@@ -108,21 +94,21 @@ UX_SLAVE_DEVICE *device;
/* Current position of the head. */
current_pima_event = pima -> ux_device_class_pima_event_array_head;
-
+
/* If the pointer is NULL, the round robin buffer has not been activated. */
if (current_pima_event == UX_NULL)
return (UX_ERROR);
-
+
/* Calculate the next position. */
if ((current_pima_event + 1) == pima -> ux_device_class_pima_event_array_end)
/* We are at the end, go back to the beginning. */
next_pima_event = pima -> ux_device_class_pima_event_array;
-
- else
+
+ else
/* We are not at the end, increment the head position. */
next_pima_event = current_pima_event + 1;
-
+
/* Any place left for this event ? */
if (next_pima_event == pima -> ux_device_class_pima_event_array_tail)
@@ -133,14 +119,14 @@ UX_SLAVE_DEVICE *device;
/* There is an event to report, get the current pointer to the event. */
current_pima_event = pima -> ux_device_class_pima_event_array_tail;
-
+
/* fill in the event structure from the user. */
- current_pima_event -> ux_device_class_pima_event_code = pima_event -> ux_device_class_pima_event_code;
+ current_pima_event -> ux_device_class_pima_event_code = pima_event -> ux_device_class_pima_event_code;
current_pima_event -> ux_device_class_pima_event_transaction_id = pima_event -> ux_device_class_pima_event_transaction_id;
- current_pima_event -> ux_device_class_pima_event_parameter_1 = pima_event -> ux_device_class_pima_event_parameter_1;
- current_pima_event -> ux_device_class_pima_event_parameter_2 = pima_event -> ux_device_class_pima_event_parameter_2;
- current_pima_event -> ux_device_class_pima_event_parameter_3 = pima_event -> ux_device_class_pima_event_parameter_3;
-
+ current_pima_event -> ux_device_class_pima_event_parameter_1 = pima_event -> ux_device_class_pima_event_parameter_1;
+ current_pima_event -> ux_device_class_pima_event_parameter_2 = pima_event -> ux_device_class_pima_event_parameter_2;
+ current_pima_event -> ux_device_class_pima_event_parameter_3 = pima_event -> ux_device_class_pima_event_parameter_3;
+
/* Set a semaphore to wake up the interrupt thread. */
_ux_device_semaphore_put(&pima -> ux_device_class_pima_interrupt_thread_semaphore);
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 19191179..ee58028e 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
@@ -1,16 +1,17 @@
/***************************************************************************
- * Copyright (c) 2024 Microsoft Corporation
- *
+ * Copyright (c) 2024 Microsoft Corporation
+ * Copyright (c) 2026-present Eclipse ThreadX contributors
+ *
* This program and the accompanying materials are made available under the
* terms of the MIT License which is available at
* https://opensource.org/licenses/MIT.
- *
+ *
* SPDX-License-Identifier: MIT
**************************************************************************/
/**************************************************************************/
-/** */
-/** USBX Component */
+/** */
+/** USBX Component */
/** */
/** Device CDC Class */
/** */
@@ -27,63 +28,37 @@
#include "ux_device_stack.h"
-/**************************************************************************/
-/* */
-/* FUNCTION RELEASE */
-/* */
-/* _ux_device_class_pima_initialize PORTABLE C */
+/**************************************************************************/
+/* */
+/* FUNCTION RELEASE */
+/* */
+/* _ux_device_class_pima_initialize PORTABLE C */
/* 6.3.0 */
/* AUTHOR */
/* */
/* Chaoqiong Xiao, Microsoft Corporation */
/* */
/* DESCRIPTION */
-/* */
-/* This function initializes the USB Pima device class */
-/* */
-/* INPUT */
-/* */
-/* command Pointer to pima command */
-/* */
-/* OUTPUT */
-/* */
-/* Completion Status */
-/* */
-/* CALLS */
-/* */
-/* _ux_utility_memory_allocate Allocate memory */
+/* */
+/* This function initializes the USB Pima device class */
+/* */
+/* INPUT */
+/* */
+/* command Pointer to pima command */
+/* */
+/* OUTPUT */
+/* */
+/* Completion Status */
+/* */
+/* CALLS */
+/* */
+/* _ux_utility_memory_allocate Allocate memory */
/* _ux_utility_memory_free Free memory */
/* _ux_device_thread_create Create thread */
-/* */
-/* CALLED BY */
-/* */
-/* USBX Source Code */
-/* */
-/* RELEASE HISTORY */
-/* */
-/* 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 */
-/* 01-31-2022 Chaoqiong Xiao Modified comment(s), */
-/* refined macros names, */
-/* added cancel callback, */
-/* resulting in version 6.1.10 */
-/* 04-25-2022 Chaoqiong Xiao Modified comment(s), */
-/* fixed standalone compile, */
-/* resulting in version 6.1.11 */
-/* 07-29-2022 Chaoqiong Xiao Modified comment(s), */
-/* fixed parameter/variable */
-/* names conflict C++ keyword, */
-/* resulting in version 6.1.12 */
-/* 10-31-2023 Chaoqiong Xiao Modified comment(s), */
-/* added a new mode to manage */
-/* endpoint buffer in classes, */
-/* resulting in version 6.3.0 */
+/* */
+/* CALLED BY */
+/* */
+/* USBX Source Code */
/* */
/**************************************************************************/
UINT _ux_device_class_pima_initialize(UX_SLAVE_CLASS_COMMAND *command)
@@ -114,7 +89,7 @@ UX_SLAVE_CLASS *class_ptr;
/* Allocate some memory for endpoints. */
UX_ASSERT(!UX_DEVICE_CLASS_PIMA_ENDPOINT_BUFFER_SIZE_CALC_OVERFLOW);
- pima -> ux_device_class_pima_endpoint_buffer =
+ pima -> ux_device_class_pima_endpoint_buffer =
_ux_utility_memory_allocate(UX_NO_ALIGN, UX_CACHE_SAFE_MEMORY,
UX_DEVICE_CLASS_PIMA_ENDPOINT_BUFFER_SIZE);
if (pima -> ux_device_class_pima_endpoint_buffer == UX_NULL)
@@ -125,9 +100,9 @@ UX_SLAVE_CLASS *class_ptr;
#endif
/* Allocate some memory for the thread stack. */
- class_ptr -> ux_slave_class_thread_stack =
+ class_ptr -> ux_slave_class_thread_stack =
_ux_utility_memory_allocate(UX_NO_ALIGN, UX_REGULAR_MEMORY, UX_THREAD_STACK_SIZE);
-
+
/* Check for successful allocation. */
if (class_ptr -> ux_slave_class_thread_stack == UX_NULL)
status = UX_MEMORY_INSUFFICIENT;
@@ -139,12 +114,12 @@ UX_SLAVE_CLASS *class_ptr;
does not start until we have a instance of the class. */
if (status == UX_SUCCESS)
{
- status = _ux_device_thread_create(&class_ptr -> ux_slave_class_thread, "ux_slave_class_thread",
+ status = _ux_device_thread_create(&class_ptr -> ux_slave_class_thread, "ux_slave_class_thread",
_ux_device_class_pima_thread,
(ULONG) (ALIGN_TYPE) class_ptr, (VOID *) class_ptr -> ux_slave_class_thread_stack,
UX_THREAD_STACK_SIZE, UX_THREAD_PRIORITY_CLASS,
UX_THREAD_PRIORITY_CLASS, UX_NO_TIME_SLICE, UX_DONT_START);
-
+
/* Check the creation of this thread. */
if (status != UX_SUCCESS)
status = UX_THREAD_ERROR;
@@ -179,33 +154,33 @@ UX_SLAVE_CLASS *class_ptr;
pima_parameter = command -> ux_slave_class_command_parameter;
/* Store all the application parameter information about the media. */
- pima -> ux_device_class_pima_manufacturer = pima_parameter -> ux_device_class_pima_parameter_manufacturer;
- pima -> ux_device_class_pima_model = pima_parameter -> ux_device_class_pima_parameter_model;
+ pima -> ux_device_class_pima_manufacturer = pima_parameter -> ux_device_class_pima_parameter_manufacturer;
+ pima -> ux_device_class_pima_model = pima_parameter -> ux_device_class_pima_parameter_model;
pima -> ux_device_class_pima_device_version = pima_parameter -> ux_device_class_pima_parameter_device_version;
- pima -> ux_device_class_pima_serial_number = pima_parameter -> ux_device_class_pima_parameter_serial_number;
+ pima -> ux_device_class_pima_serial_number = pima_parameter -> ux_device_class_pima_parameter_serial_number;
/* Store all the application parameter information about the storage. */
- pima -> ux_device_class_pima_storage_id = pima_parameter -> ux_device_class_pima_parameter_storage_id;
- pima -> ux_device_class_pima_storage_type = pima_parameter -> ux_device_class_pima_parameter_storage_type;
- pima -> ux_device_class_pima_storage_file_system_type = pima_parameter -> ux_device_class_pima_parameter_storage_file_system_type;
- pima -> ux_device_class_pima_storage_access_capability = pima_parameter -> ux_device_class_pima_parameter_storage_access_capability;
- pima -> ux_device_class_pima_storage_max_capacity_low = pima_parameter -> ux_device_class_pima_parameter_storage_max_capacity_low;
- pima -> ux_device_class_pima_storage_max_capacity_high = pima_parameter -> ux_device_class_pima_parameter_storage_max_capacity_high;
- pima -> ux_device_class_pima_storage_free_space_low = pima_parameter -> ux_device_class_pima_parameter_storage_free_space_low;
- pima -> ux_device_class_pima_storage_free_space_high = pima_parameter -> ux_device_class_pima_parameter_storage_free_space_high;
- pima -> ux_device_class_pima_storage_free_space_image = pima_parameter -> ux_device_class_pima_parameter_storage_free_space_image;
- pima -> ux_device_class_pima_storage_description = pima_parameter -> ux_device_class_pima_parameter_storage_description;
- pima -> ux_device_class_pima_storage_volume_label = pima_parameter -> ux_device_class_pima_parameter_storage_volume_label;
-
+ pima -> ux_device_class_pima_storage_id = pima_parameter -> ux_device_class_pima_parameter_storage_id;
+ pima -> ux_device_class_pima_storage_type = pima_parameter -> ux_device_class_pima_parameter_storage_type;
+ pima -> ux_device_class_pima_storage_file_system_type = pima_parameter -> ux_device_class_pima_parameter_storage_file_system_type;
+ pima -> ux_device_class_pima_storage_access_capability = pima_parameter -> ux_device_class_pima_parameter_storage_access_capability;
+ pima -> ux_device_class_pima_storage_max_capacity_low = pima_parameter -> ux_device_class_pima_parameter_storage_max_capacity_low;
+ pima -> ux_device_class_pima_storage_max_capacity_high = pima_parameter -> ux_device_class_pima_parameter_storage_max_capacity_high;
+ pima -> ux_device_class_pima_storage_free_space_low = pima_parameter -> ux_device_class_pima_parameter_storage_free_space_low;
+ pima -> ux_device_class_pima_storage_free_space_high = pima_parameter -> ux_device_class_pima_parameter_storage_free_space_high;
+ pima -> ux_device_class_pima_storage_free_space_image = pima_parameter -> ux_device_class_pima_parameter_storage_free_space_image;
+ pima -> ux_device_class_pima_storage_description = pima_parameter -> ux_device_class_pima_parameter_storage_description;
+ pima -> ux_device_class_pima_storage_volume_label = pima_parameter -> ux_device_class_pima_parameter_storage_volume_label;
+
/* Update device properties supported. */
pima -> ux_device_class_pima_device_properties_list = pima_parameter -> ux_device_class_pima_parameter_device_properties_list;
/* Update the capture formats supported list. */
pima -> ux_device_class_pima_supported_capture_formats_list = pima_parameter -> ux_device_class_pima_parameter_supported_capture_formats_list;
-
+
/* Update the image formats supported list. */
pima -> ux_device_class_pima_supported_image_formats_list = pima_parameter -> ux_device_class_pima_parameter_supported_image_formats_list;
-
+
#ifdef UX_PIMA_WITH_MTP_SUPPORT
/* Update the internal pima structure with the object properties. */
pima -> ux_device_class_pima_object_properties_list = pima_parameter -> ux_device_class_pima_parameter_object_properties_list;
@@ -226,12 +201,12 @@ UX_SLAVE_CLASS *class_ptr;
pima -> ux_device_class_pima_storage_info_get = pima_parameter -> ux_device_class_pima_parameter_storage_info_get;
/* Store the callback functions for objects. */
- pima -> ux_device_class_pima_object_number_get = pima_parameter -> ux_device_class_pima_parameter_object_number_get;
+ pima -> ux_device_class_pima_object_number_get = pima_parameter -> ux_device_class_pima_parameter_object_number_get;
pima -> ux_device_class_pima_object_handles_get = pima_parameter -> ux_device_class_pima_parameter_object_handles_get;
- pima -> ux_device_class_pima_object_info_get = pima_parameter -> ux_device_class_pima_parameter_object_info_get;
- pima -> ux_device_class_pima_object_data_get = pima_parameter -> ux_device_class_pima_parameter_object_data_get;
- pima -> ux_device_class_pima_object_info_send = pima_parameter -> ux_device_class_pima_parameter_object_info_send;
- pima -> ux_device_class_pima_object_data_send = pima_parameter -> ux_device_class_pima_parameter_object_data_send;
+ pima -> ux_device_class_pima_object_info_get = pima_parameter -> ux_device_class_pima_parameter_object_info_get;
+ pima -> ux_device_class_pima_object_data_get = pima_parameter -> ux_device_class_pima_parameter_object_data_get;
+ pima -> ux_device_class_pima_object_info_send = pima_parameter -> ux_device_class_pima_parameter_object_info_send;
+ pima -> ux_device_class_pima_object_data_send = pima_parameter -> ux_device_class_pima_parameter_object_data_send;
pima -> ux_device_class_pima_object_delete = pima_parameter -> ux_device_class_pima_parameter_object_delete;
@@ -287,12 +262,6 @@ UX_SLAVE_CLASS *class_ptr;
/* */
/* Device PIMA Class */
/* */
-/* RELEASE HISTORY */
-/* */
-/* DATE NAME DESCRIPTION */
-/* */
-/* 10-31-2023 Chaoqiong Xiao Initial Version 6.3.0 */
-/* */
/**************************************************************************/
UINT _uxe_device_class_pima_initialize(UX_SLAVE_CLASS_COMMAND *command)
{
diff --git a/common/usbx_device_classes/src/ux_device_class_pima_interrupt_thread.c b/common/usbx_device_classes/src/ux_device_class_pima_interrupt_thread.c
index 290bea15..be5628a0 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
@@ -1,17 +1,18 @@
/***************************************************************************
- * Copyright (c) 2024 Microsoft Corporation
- *
+ * Copyright (c) 2024 Microsoft Corporation
+ * Copyright (c) 2026-present Eclipse ThreadX contributors
+ *
* This program and the accompanying materials are made available under the
* terms of the MIT License which is available at
* https://opensource.org/licenses/MIT.
- *
+ *
* SPDX-License-Identifier: MIT
**************************************************************************/
/**************************************************************************/
/**************************************************************************/
-/** */
-/** USBX Component */
+/** */
+/** USBX Component */
/** */
/** Device PIMA Class */
/** */
@@ -29,63 +30,42 @@
#if !defined(UX_DEVICE_STANDALONE)
-/**************************************************************************/
-/* */
-/* FUNCTION RELEASE */
-/* */
-/* _ux_device_class_pima_interrupt_thread PORTABLE C */
+/**************************************************************************/
+/* */
+/* FUNCTION RELEASE */
+/* */
+/* _ux_device_class_pima_interrupt_thread PORTABLE C */
/* 6.3.0 */
/* AUTHOR */
/* */
/* Chaoqiong Xiao, Microsoft Corporation */
/* */
/* DESCRIPTION */
-/* */
-/* This function is the thread of the pima interrupt endpoint */
-/* */
-/* INPUT */
-/* */
-/* pima_class Address of pima class */
-/* container */
-/* */
-/* OUTPUT */
-/* */
-/* None */
-/* */
-/* CALLS */
-/* */
-/* _ux_device_stack_transfer_request Request transfer */
-/* _ux_utility_memory_allocate Allocate memory */
+/* */
+/* This function is the thread of the pima interrupt endpoint */
+/* */
+/* INPUT */
+/* */
+/* pima_class Address of pima class */
+/* container */
+/* */
+/* OUTPUT */
+/* */
+/* None */
+/* */
+/* CALLS */
+/* */
+/* _ux_device_stack_transfer_request Request transfer */
+/* _ux_utility_memory_allocate Allocate memory */
/* _ux_device_semaphore_get Get semaphore */
/* _ux_device_class_pima_event_get Get PIMA event */
/* _ux_utility_long_put Put 32-bit value */
/* _ux_utility_short_put Put 16-bit value */
/* _ux_device_thread_suspend Suspend thread */
-/* */
-/* CALLED BY */
-/* */
-/* ThreadX */
-/* */
-/* RELEASE HISTORY */
-/* */
-/* DATE NAME DESCRIPTION */
-/* */
-/* 05-19-2020 Chaoqiong Xiao Initial Version 6.0 */
-/* 09-30-2020 Chaoqiong Xiao Modified comment(s), */
-/* resulting in version 6.1 */
-/* 01-31-2022 Chaoqiong Xiao Modified comment(s), */
-/* refined macros names, */
-/* added transaction ID, */
-/* resulting in version 6.1.10 */
-/* 04-25-2022 Chaoqiong Xiao Modified comment(s), */
-/* fixed standalone compile, */
-/* resulting in version 6.1.11 */
-/* 07-29-2022 Chaoqiong Xiao Modified comment(s), */
-/* fixed event message size, */
-/* resulting in version 6.1.12 */
-/* 10-31-2023 Chaoqiong Xiao Modified comment(s), */
-/* improved INT EP management, */
-/* resulting in version 6.3.0 */
+/* */
+/* CALLED BY */
+/* */
+/* ThreadX */
/* */
/**************************************************************************/
VOID _ux_device_class_pima_interrupt_thread(ULONG pima_class)
@@ -97,12 +77,12 @@ UX_SLAVE_TRANSFER *transfer_request_in;
UX_SLAVE_CLASS_PIMA_EVENT pima_event;
UINT status;
UCHAR *buffer;
-
+
/* Get the pima instance from the calling parameter. */
UX_THREAD_EXTENSION_PTR_GET(pima, UX_SLAVE_CLASS_PIMA, pima_class)
/* Allocate the event round robin buffer. */
- pima -> ux_device_class_pima_event_array =
+ pima -> ux_device_class_pima_event_array =
_ux_utility_memory_allocate_mulc_safe(UX_NO_ALIGN, UX_REGULAR_MEMORY, sizeof(UX_SLAVE_CLASS_PIMA_EVENT), UX_DEVICE_CLASS_PIMA_MAX_EVENTS_QUEUE);
/* Check for successful allocation. */
@@ -110,7 +90,7 @@ UCHAR *buffer;
{
/* Return, no event management. */
return;
- }
+ }
/* Allocate the head\tail and end of the round robin buffer. */
pima -> ux_device_class_pima_event_array_head = pima -> ux_device_class_pima_event_array;
@@ -123,11 +103,11 @@ UCHAR *buffer;
/* Get the pointer to the device. */
device = &_ux_system_slave -> ux_system_slave_device;
-
-
+
+
/* As long as the device is in the CONFIGURED state. */
while (device -> ux_slave_device_state == UX_DEVICE_CONFIGURED)
- {
+ {
/* All PIMA events are on the interrupt endpoint IN, from the host. */
if (pima -> ux_device_class_pima_interrupt_endpoint == UX_NULL)
@@ -136,7 +116,7 @@ UCHAR *buffer;
/* Wait until something has awaken us. */
status = _ux_device_semaphore_get(&pima -> ux_device_class_pima_interrupt_thread_semaphore, UX_WAIT_FOREVER);
-
+
/* Check the completion code. */
if (status != UX_SUCCESS)
@@ -145,35 +125,35 @@ UCHAR *buffer;
/* Check if we have an event to report. */
status = _ux_device_class_pima_event_get(pima, &pima_event);
-
+
/* We may have an event to report on the interrupt pipe. */
if(status == UX_SUCCESS)
{
/* Prepare the event data payload from the pima event structure. Get a pointer to the buffer area. */
buffer = transfer_request_in -> ux_slave_transfer_request_data_pointer;
-
+
/* Put the length of the entire event payload. */
_ux_utility_long_put(buffer + UX_DEVICE_CLASS_PIMA_AEI_DATA_LENGTH, UX_DEVICE_CLASS_PIMA_AEI_MAX_LENGTH);
-
+
/* Put the type of packet (Event) */
_ux_utility_short_put(buffer + UX_DEVICE_CLASS_PIMA_AEI_TYPE, UX_DEVICE_CLASS_PIMA_CT_EVENT_BLOCK);
/* Put the type of event. */
_ux_utility_short_put(buffer + UX_DEVICE_CLASS_PIMA_AEI_EVENT_CODE, (USHORT)pima_event.ux_device_class_pima_event_code);
-
+
/* Put the transaction ID. */
_ux_utility_long_put(buffer + UX_DEVICE_CLASS_PIMA_AEI_TRANSACTION_ID, pima_event.ux_device_class_pima_event_transaction_id);
-
+
/* Put the value of parameter 1. */
_ux_utility_long_put(buffer + UX_DEVICE_CLASS_PIMA_AEI_PARAMETER_1, pima_event.ux_device_class_pima_event_parameter_1);
-
+
/* Put the value of parameter 2. */
_ux_utility_long_put(buffer + UX_DEVICE_CLASS_PIMA_AEI_PARAMETER_2, pima_event.ux_device_class_pima_event_parameter_2);
/* Put the value of parameter 3. */
_ux_utility_long_put(buffer + UX_DEVICE_CLASS_PIMA_AEI_PARAMETER_3, pima_event.ux_device_class_pima_event_parameter_3);
-
+
/* Send the request to the device controller. */
status = _ux_device_stack_transfer_request(transfer_request_in, UX_DEVICE_CLASS_PIMA_AEI_MAX_LENGTH, UX_DEVICE_CLASS_PIMA_AEI_MAX_LENGTH);
@@ -183,7 +163,7 @@ UCHAR *buffer;
/* Error trap. */
_ux_system_error_handler(UX_SYSTEM_LEVEL_THREAD, UX_SYSTEM_CONTEXT_CLASS, status);
- }
+ }
}
/* We need to suspend ourselves. We will be resumed by the device enumeration module. */
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 c6be2156..7579080d 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
@@ -1,18 +1,19 @@
/***************************************************************************
- * Copyright (c) 2024 Microsoft Corporation
- *
+ * Copyright (c) 2024 Microsoft Corporation
+ * Copyright (c) 2026-present Eclipse ThreadX contributors
+ *
* This program and the accompanying materials are made available under the
* terms of the MIT License which is available at
* https://opensource.org/licenses/MIT.
- *
+ *
* SPDX-License-Identifier: MIT
**************************************************************************/
/**************************************************************************/
/**************************************************************************/
-/** */
-/** USBX Component */
+/** */
+/** USBX Component */
/** */
/** Device Pima Class */
/** */
@@ -29,45 +30,37 @@
#include "ux_device_stack.h"
-/**************************************************************************/
-/* */
-/* FUNCTION RELEASE */
-/* */
-/* _ux_device_class_pima_object_add PORTABLE C */
+/**************************************************************************/
+/* */
+/* FUNCTION RELEASE */
+/* */
+/* _ux_device_class_pima_object_add PORTABLE C */
/* 6.1 */
/* AUTHOR */
/* */
/* Chaoqiong Xiao, Microsoft Corporation */
/* */
/* DESCRIPTION */
-/* */
-/* This function sends an event to the host to inform that an object */
-/* has been added. */
-/* */
-/* INPUT */
-/* */
-/* pima Pointer to pima class */
-/* object_handle Handle of object to delete */
-/* */
-/* OUTPUT */
-/* */
-/* Completion Status */
-/* */
-/* CALLS */
-/* */
+/* */
+/* This function sends an event to the host to inform that an object */
+/* has been added. */
+/* */
+/* INPUT */
+/* */
+/* pima Pointer to pima class */
+/* object_handle Handle of object to delete */
+/* */
+/* OUTPUT */
+/* */
+/* Completion Status */
+/* */
+/* CALLS */
+/* */
/* _ux_device_class_pima_event_set Add PIMA event to queue */
-/* */
-/* CALLED BY */
-/* */
-/* Device Pima Class */
-/* */
-/* RELEASE HISTORY */
-/* */
-/* DATE NAME DESCRIPTION */
-/* */
-/* 05-19-2020 Chaoqiong Xiao Initial Version 6.0 */
-/* 09-30-2020 Chaoqiong Xiao Modified comment(s), */
-/* resulting in version 6.1 */
+/* */
+/* CALLED BY */
+/* */
+/* Device Pima Class */
/* */
/**************************************************************************/
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 f3b44b05..59797736 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
@@ -1,10 +1,11 @@
/***************************************************************************
- * Copyright (c) 2024 Microsoft Corporation
- *
+ * Copyright (c) 2024 Microsoft Corporation
+ * Copyright (c) 2026-present Eclipse ThreadX contributors
+ *
* This program and the accompanying materials are made available under the
* terms of the MIT License which is available at
* https://opensource.org/licenses/MIT.
- *
+ *
* SPDX-License-Identifier: MIT
**************************************************************************/
@@ -62,19 +63,6 @@
/* */
/* Device Storage Class */
/* */
-/* RELEASE HISTORY */
-/* */
-/* DATE NAME DESCRIPTION */
-/* */
-/* 05-19-2020 Chaoqiong Xiao Initial Version 6.0 */
-/* 09-30-2020 Chaoqiong Xiao Modified comment(s), */
-/* resulting in version 6.1 */
-/* 01-31-2022 Chaoqiong Xiao Modified comment(s), */
-/* updated status handling, */
-/* improved sanity checks, */
-/* improved cancel flow, */
-/* resulting in version 6.1.10 */
-/* */
/**************************************************************************/
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 1279b472..da8f84cf 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
@@ -1,18 +1,19 @@
/***************************************************************************
- * Copyright (c) 2024 Microsoft Corporation
- *
+ * Copyright (c) 2024 Microsoft Corporation
+ * Copyright (c) 2026-present Eclipse ThreadX contributors
+ *
* This program and the accompanying materials are made available under the
* terms of the MIT License which is available at
* https://opensource.org/licenses/MIT.
- *
+ *
* SPDX-License-Identifier: MIT
**************************************************************************/
/**************************************************************************/
/**************************************************************************/
-/** */
-/** USBX Component */
+/** */
+/** USBX Component */
/** */
/** Device Pima Class */
/** */
@@ -29,48 +30,36 @@
#include "ux_device_stack.h"
-/**************************************************************************/
-/* */
-/* FUNCTION RELEASE */
-/* */
-/* _ux_device_class_pima_object_data_send PORTABLE C */
+/**************************************************************************/
+/* */
+/* FUNCTION RELEASE */
+/* */
+/* _ux_device_class_pima_object_data_send PORTABLE C */
/* 6.1.10 */
/* AUTHOR */
/* */
/* Chaoqiong Xiao, Microsoft Corporation */
/* */
/* DESCRIPTION */
-/* */
-/* This function accepts an object data from the host. */
-/* */
-/* INPUT */
-/* */
-/* pima Pointer to pima class */
-/* */
-/* OUTPUT */
-/* */
-/* Completion Status */
-/* */
-/* CALLS */
-/* */
-/* _ux_device_stack_transfer_request Transfer request */
+/* */
+/* This function accepts an object data from the host. */
+/* */
+/* INPUT */
+/* */
+/* pima Pointer to pima class */
+/* */
+/* OUTPUT */
+/* */
+/* Completion Status */
+/* */
+/* CALLS */
+/* */
+/* _ux_device_stack_transfer_request Transfer request */
/* _ux_device_stack_endpoint_stall Stall endpoint */
-/* */
-/* CALLED BY */
-/* */
-/* Device Storage Class */
-/* */
-/* RELEASE HISTORY */
-/* */
-/* DATE NAME DESCRIPTION */
-/* */
-/* 05-19-2020 Chaoqiong Xiao Initial Version 6.0 */
-/* 09-30-2020 Chaoqiong Xiao Modified comment(s), */
-/* resulting in version 6.1 */
-/* 01-31-2022 Chaoqiong Xiao Modified comment(s), */
-/* updated status handling, */
-/* improved cancel flow, */
-/* resulting in version 6.1.10 */
+/* */
+/* CALLED BY */
+/* */
+/* Device Storage Class */
/* */
/**************************************************************************/
UINT _ux_device_class_pima_object_data_send(UX_SLAVE_CLASS_PIMA *pima)
@@ -94,33 +83,33 @@ ULONG total_length;
/* Obtain the object info from the application. */
status = pima -> ux_device_class_pima_object_info_get(pima, object_handle, &object);
-
+
/* Check for error. */
if (status == UX_SUCCESS)
- {
+ {
/* Data phase (Bulk OUT). */
pima -> ux_device_class_pima_state = UX_DEVICE_CLASS_PIMA_PHASE_DATA_OUT;
/* Set the object length. */
- object_length = object -> ux_device_class_pima_object_compressed_size;
-
+ object_length = object -> ux_device_class_pima_object_compressed_size;
+
/* Set the total length to be received. */
total_length = object_length + UX_DEVICE_CLASS_PIMA_DATA_HEADER_SIZE;
-
+
/* Reset the offset. */
- object_offset = 0;
+ object_offset = 0;
/* Obtain the pointer to the transfer request of the bulk out endpoint. */
transfer_request = &pima -> ux_device_class_pima_bulk_out_endpoint -> ux_slave_endpoint_transfer_request;
-
+
/* Obtain memory for this object info. Use the transfer request pre-allocated memory. */
object_data = transfer_request -> ux_slave_transfer_request_data_pointer;
/* Assume the host will send all the data. */
while (total_length != 0)
{
-
+
/* Get a data payload. */
status = _ux_device_stack_transfer_request(transfer_request, UX_DEVICE_CLASS_PIMA_TRANSFER_BUFFER_LENGTH, UX_DEVICE_CLASS_PIMA_TRANSFER_BUFFER_LENGTH);
@@ -134,15 +123,15 @@ ULONG total_length;
/* Check for the status. We may have had a request to cancel the transaction from the host. */
if (status != UX_SUCCESS)
{
-
+
/* Check the completion code for transfer abort from the host. */
if (transfer_request -> ux_slave_transfer_request_status == UX_TRANSFER_STATUS_ABORT)
{
-
+
/* Do not proceed. */
return(UX_ERROR);
-
- }
+
+ }
else
{
@@ -151,12 +140,12 @@ ULONG total_length;
break;
}
-
+
}
-
+
/* Obtain the length of the transaction. */
transfer_length = transfer_request -> ux_slave_transfer_request_actual_length;
-
+
/* If this is the first packet, we have to take into account the
header. */
if (object_offset == 0)
@@ -172,33 +161,33 @@ ULONG total_length;
}
/* Send the object data to the application. */
- status = pima -> ux_device_class_pima_object_data_send(pima, object_handle, UX_DEVICE_CLASS_PIMA_OBJECT_TRANSFER_PHASE_ACTIVE,
- object_data + UX_DEVICE_CLASS_PIMA_DATA_HEADER_SIZE,
+ status = pima -> ux_device_class_pima_object_data_send(pima, object_handle, UX_DEVICE_CLASS_PIMA_OBJECT_TRANSFER_PHASE_ACTIVE,
+ object_data + UX_DEVICE_CLASS_PIMA_DATA_HEADER_SIZE,
object_offset,
(transfer_length - UX_DEVICE_CLASS_PIMA_DATA_HEADER_SIZE));
-
+
/* Check status, if we have a problem, we abort. */
if (status != UX_SUCCESS)
{
-
+
/* We need to inform the host of an error. */
status = UX_ERROR;
break;
}
else
- {
+ {
/* Adjust the remaining length of the object. */
total_length -= transfer_length;
/* Adjust the length to be sent. */
object_offset += (transfer_length - UX_DEVICE_CLASS_PIMA_DATA_HEADER_SIZE);
-
- }
-
+
+ }
+
}
else
- {
+ {
/* Do some sanity check. */
if (object_length < transfer_length)
@@ -211,29 +200,29 @@ ULONG total_length;
}
/* This is not the first packet, send the object data to the application. */
- status = pima -> ux_device_class_pima_object_data_send(pima, object_handle, UX_DEVICE_CLASS_PIMA_OBJECT_TRANSFER_PHASE_ACTIVE,
- object_data,
+ status = pima -> ux_device_class_pima_object_data_send(pima, object_handle, UX_DEVICE_CLASS_PIMA_OBJECT_TRANSFER_PHASE_ACTIVE,
+ object_data,
object_offset,
transfer_length);
-
+
/* Check status, if we have a problem, we abort. */
if (status != UX_SUCCESS)
{
-
+
/* We need to inform the host of an error. */
status = UX_ERROR;
break;
}
else
- {
+ {
/* Adjust the remaining length of the total object. */
total_length -= transfer_length;
/* Adjust the length to be sent. */
object_offset += transfer_length;
-
- }
+
+ }
}
@@ -245,31 +234,31 @@ ULONG total_length;
}
}
}
-
+
/* Check for status. */
if (status == UX_SUCCESS)
{
-
+
/* Now we return a response with success. */
_ux_device_class_pima_response_send(pima, UX_DEVICE_CLASS_PIMA_RC_OK, 0, 0, 0, 0);
/* Make the object transfer completed. */
- status = pima -> ux_device_class_pima_object_data_send(pima, object_handle, UX_DEVICE_CLASS_PIMA_OBJECT_TRANSFER_PHASE_COMPLETED,
+ status = pima -> ux_device_class_pima_object_data_send(pima, object_handle, UX_DEVICE_CLASS_PIMA_OBJECT_TRANSFER_PHASE_COMPLETED,
UX_NULL, 0, 0);
- }
+ }
else
{
-
- /* We need to stall the bulk out pipe. This is the method used by Pima devices to
+
+ /* We need to stall the bulk out pipe. This is the method used by Pima devices to
cancel a transaction. */
_ux_device_stack_endpoint_stall(pima -> ux_device_class_pima_bulk_in_endpoint);
/* Make the object transfer non completed. */
- status = pima -> ux_device_class_pima_object_data_send(pima, object_handle, UX_DEVICE_CLASS_PIMA_OBJECT_TRANSFER_PHASE_COMPLETED_ERROR,
+ status = pima -> ux_device_class_pima_object_data_send(pima, object_handle, UX_DEVICE_CLASS_PIMA_OBJECT_TRANSFER_PHASE_COMPLETED_ERROR,
UX_NULL, 0, 0);
}
-
+
/* Return completion status. */
return(status);
}
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 152c758d..0d35daed 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
@@ -1,18 +1,19 @@
/***************************************************************************
- * Copyright (c) 2024 Microsoft Corporation
- *
+ * Copyright (c) 2024 Microsoft Corporation
+ * Copyright (c) 2026-present Eclipse ThreadX contributors
+ *
* This program and the accompanying materials are made available under the
* terms of the MIT License which is available at
* https://opensource.org/licenses/MIT.
- *
+ *
* SPDX-License-Identifier: MIT
**************************************************************************/
/**************************************************************************/
/**************************************************************************/
-/** */
-/** USBX Component */
+/** */
+/** USBX Component */
/** */
/** Device Pima Class */
/** */
@@ -29,48 +30,37 @@
#include "ux_device_stack.h"
-/**************************************************************************/
-/* */
-/* FUNCTION RELEASE */
-/* */
-/* _ux_device_class_pima_object_delete PORTABLE C */
+/**************************************************************************/
+/* */
+/* FUNCTION RELEASE */
+/* */
+/* _ux_device_class_pima_object_delete PORTABLE C */
/* 6.1.10 */
/* AUTHOR */
/* */
/* Chaoqiong Xiao, Microsoft Corporation */
/* */
/* DESCRIPTION */
-/* */
-/* This function informs the application that an object is to be */
-/* deleted. The handle points to an object or all objects if -1 */
-/* */
-/* INPUT */
-/* */
-/* pima Pointer to pima class */
-/* object_handle Handle of object to delete */
-/* */
-/* OUTPUT */
-/* */
-/* Completion Status */
-/* */
-/* CALLS */
-/* */
+/* */
+/* This function informs the application that an object is to be */
+/* deleted. The handle points to an object or all objects if -1 */
+/* */
+/* INPUT */
+/* */
+/* pima Pointer to pima class */
+/* object_handle Handle of object to delete */
+/* */
+/* OUTPUT */
+/* */
+/* Completion Status */
+/* */
+/* CALLS */
+/* */
/* _ux_device_class_pima_response_send Send PIMA response */
-/* */
-/* CALLED BY */
-/* */
-/* Device Pima Class */
-/* */
-/* RELEASE HISTORY */
-/* */
-/* DATE NAME DESCRIPTION */
-/* */
-/* 05-19-2020 Chaoqiong Xiao Initial Version 6.0 */
-/* 09-30-2020 Chaoqiong Xiao Modified comment(s), */
-/* resulting in version 6.1 */
-/* 01-31-2022 Chaoqiong Xiao Modified comment(s), */
-/* updated status handling, */
-/* resulting in version 6.1.10 */
+/* */
+/* CALLED BY */
+/* */
+/* Device Pima Class */
/* */
/**************************************************************************/
UINT _ux_device_class_pima_object_delete(UX_SLAVE_CLASS_PIMA *pima, ULONG object_handle, ULONG object_format)
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 2f5f0f8f..6f7df15f 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
@@ -1,18 +1,19 @@
/***************************************************************************
- * Copyright (c) 2024 Microsoft Corporation
- *
+ * Copyright (c) 2024 Microsoft Corporation
+ * Copyright (c) 2026-present Eclipse ThreadX contributors
+ *
* This program and the accompanying materials are made available under the
* terms of the MIT License which is available at
* https://opensource.org/licenses/MIT.
- *
+ *
* SPDX-License-Identifier: MIT
**************************************************************************/
/**************************************************************************/
/**************************************************************************/
-/** */
-/** USBX Component */
+/** */
+/** USBX Component */
/** */
/** Device Pima Class */
/** */
@@ -29,56 +30,45 @@
#include "ux_device_stack.h"
-/**************************************************************************/
-/* */
-/* FUNCTION RELEASE */
-/* */
-/* _ux_device_class_pima_object_handles_send PORTABLE C */
+/**************************************************************************/
+/* */
+/* FUNCTION RELEASE */
+/* */
+/* _ux_device_class_pima_object_handles_send PORTABLE C */
/* 6.1.10 */
/* AUTHOR */
/* */
/* Chaoqiong Xiao, Microsoft Corporation */
/* */
/* DESCRIPTION */
-/* */
-/* This function returns the object handle array to the host. */
-/* */
-/* INPUT */
-/* */
-/* pima Pointer to pima class */
-/* storage_id StorageID */
-/* object_format_code Format code filter */
-/* object_association Object Handle Association */
-/* */
-/* OUTPUT */
-/* */
-/* Completion Status */
-/* */
-/* CALLS */
-/* */
-/* _ux_device_stack_transfer_request Transfer request */
-/* _ux_utility_long_put Put 32-bit value */
-/* _ux_utility_short_put Put 32-bit value */
-/* _ux_utility_memory_set Set memory */
+/* */
+/* This function returns the object handle array to the host. */
+/* */
+/* INPUT */
+/* */
+/* pima Pointer to pima class */
+/* storage_id StorageID */
+/* object_format_code Format code filter */
+/* object_association Object Handle Association */
+/* */
+/* OUTPUT */
+/* */
+/* Completion Status */
+/* */
+/* CALLS */
+/* */
+/* _ux_device_stack_transfer_request Transfer request */
+/* _ux_utility_long_put Put 32-bit value */
+/* _ux_utility_short_put Put 32-bit value */
+/* _ux_utility_memory_set Set memory */
/* _ux_device_class_pima_response_send Send PIMA response */
-/* */
-/* CALLED BY */
-/* */
-/* Device Pima Class */
-/* */
-/* RELEASE HISTORY */
-/* */
-/* DATE NAME DESCRIPTION */
-/* */
-/* 05-19-2020 Chaoqiong Xiao Initial Version 6.0 */
-/* 09-30-2020 Chaoqiong Xiao Modified comment(s), */
-/* resulting in version 6.1 */
-/* 01-31-2022 Chaoqiong Xiao Modified comment(s), */
-/* updated status handling, */
-/* resulting in version 6.1.10 */
+/* */
+/* CALLED BY */
+/* */
+/* Device Pima Class */
/* */
/**************************************************************************/
-UINT _ux_device_class_pima_object_handles_send(UX_SLAVE_CLASS_PIMA *pima,
+UINT _ux_device_class_pima_object_handles_send(UX_SLAVE_CLASS_PIMA *pima,
ULONG storage_id,
ULONG object_format_code,
ULONG object_association)
@@ -96,27 +86,27 @@ UCHAR *object_handles_array;
/* 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_handles_array = transfer_request -> ux_slave_transfer_request_data_pointer;
/* Fill in the data container type. */
_ux_utility_short_put(object_handles_array + UX_DEVICE_CLASS_PIMA_DATA_HEADER_TYPE,
UX_DEVICE_CLASS_PIMA_CT_DATA_BLOCK);
-
+
/* Fill in the data code. */
_ux_utility_short_put(object_handles_array + UX_DEVICE_CLASS_PIMA_DATA_HEADER_CODE,
UX_DEVICE_CLASS_PIMA_OC_GET_OBJECT_HANDLES);
-
+
/* Fill in the Transaction ID. */
- _ux_utility_long_put(object_handles_array + UX_DEVICE_CLASS_PIMA_DATA_HEADER_TRANSACTION_ID,
+ _ux_utility_long_put(object_handles_array + UX_DEVICE_CLASS_PIMA_DATA_HEADER_TRANSACTION_ID,
pima -> ux_device_class_pima_transaction_id);
/* Get the array from the application. */
status = pima -> ux_device_class_pima_object_handles_get(pima, object_format_code,
object_association, (ULONG *) (object_handles_array + UX_DEVICE_CLASS_PIMA_DATA_HEADER_SIZE),
(UX_DEVICE_CLASS_PIMA_ARRAY_BUFFER_SIZE / sizeof(ULONG)) -1);
-
+
/* Result should always be OK, but to be sure .... */
if (status != UX_SUCCESS)
@@ -125,25 +115,25 @@ UCHAR *object_handles_array;
else
{
-
+
/* Compute the overall length of the handle arrays. */
object_handles_array_length = (_ux_utility_long_get(object_handles_array + UX_DEVICE_CLASS_PIMA_DATA_HEADER_SIZE) +1) * (ULONG)sizeof(ULONG);
-
+
/* Add the header size. */
object_handles_array_length += UX_DEVICE_CLASS_PIMA_DATA_HEADER_SIZE;
-
+
/* Fill in the size of the response header. */
- _ux_utility_long_put(object_handles_array + UX_DEVICE_CLASS_PIMA_DATA_HEADER_LENGTH,
+ _ux_utility_long_put(object_handles_array + UX_DEVICE_CLASS_PIMA_DATA_HEADER_LENGTH,
object_handles_array_length);
-
+
/* Send a data payload with the object handles array. */
status = _ux_device_stack_transfer_request(transfer_request, object_handles_array_length, 0);
-
+
/* Now we return a response with success. */
_ux_device_class_pima_response_send(pima, UX_DEVICE_CLASS_PIMA_RC_OK, 0, 0, 0, 0);
}
-
+
/* Return completion status. */
return(status);
}
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 cd62e7b5..0b840116 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
@@ -1,18 +1,19 @@
/***************************************************************************
- * Copyright (c) 2024 Microsoft Corporation
- *
+ * Copyright (c) 2024 Microsoft Corporation
+ * Copyright (c) 2026-present Eclipse ThreadX contributors
+ *
* This program and the accompanying materials are made available under the
* terms of the MIT License which is available at
* https://opensource.org/licenses/MIT.
- *
+ *
* SPDX-License-Identifier: MIT
**************************************************************************/
/**************************************************************************/
/**************************************************************************/
-/** */
-/** USBX Component */
+/** */
+/** USBX Component */
/** */
/** Device Pima Class */
/** */
@@ -29,60 +30,40 @@
#include "ux_device_stack.h"
-/**************************************************************************/
-/* */
-/* FUNCTION RELEASE */
-/* */
-/* _ux_device_class_pima_object_info_get PORTABLE C */
+/**************************************************************************/
+/* */
+/* FUNCTION RELEASE */
+/* */
+/* _ux_device_class_pima_object_info_get PORTABLE C */
/* 6.3.0 */
/* AUTHOR */
/* */
/* Chaoqiong Xiao, Microsoft Corporation */
/* */
/* DESCRIPTION */
-/* */
-/* This function returns the object info structure to the host. */
-/* */
-/* INPUT */
-/* */
-/* pima Pointer to pima class */
-/* */
-/* OUTPUT */
-/* */
-/* Completion Status */
-/* */
-/* CALLS */
-/* */
-/* _ux_device_stack_transfer_request Transfer request */
-/* _ux_utility_long_put Put 32-bit value */
-/* _ux_utility_short_put Put 32-bit value */
-/* _ux_utility_memory_copy Copy memory */
+/* */
+/* This function returns the object info structure to the host. */
+/* */
+/* INPUT */
+/* */
+/* pima Pointer to pima class */
+/* */
+/* OUTPUT */
+/* */
+/* Completion Status */
+/* */
+/* CALLS */
+/* */
+/* _ux_device_stack_transfer_request Transfer request */
+/* _ux_utility_long_put Put 32-bit value */
+/* _ux_utility_short_put Put 32-bit value */
+/* _ux_utility_memory_copy Copy memory */
/* _ux_utility_descriptor_pack Pack descriptor */
/* _ux_device_class_pima_response_send Send PIMA response */
-/* */
-/* CALLED BY */
-/* */
-/* Device Storage Class */
-/* */
-/* RELEASE HISTORY */
-/* */
-/* DATE NAME DESCRIPTION */
-/* */
-/* 05-19-2020 Chaoqiong Xiao Initial Version 6.0 */
-/* 09-30-2020 Chaoqiong Xiao Modified comment(s), */
-/* verified memset and memcpy */
-/* cases, */
-/* resulting in version 6.1 */
-/* 01-31-2022 Chaoqiong Xiao Modified comment(s), */
-/* updated status handling, */
-/* resulting in version 6.1.10 */
-/* 04-25-2022 Chaoqiong Xiao Modified comment(s), */
-/* internal clean up, */
-/* resulting in version 6.1.11 */
-/* 10-31-2023 Chaoqiong Xiao Modified comment(s), */
-/* added a new mode to manage */
-/* endpoint buffer in classes, */
-/* resulting in version 6.3.0 */
+/* */
+/* CALLED BY */
+/* */
+/* Device Storage Class */
/* */
/**************************************************************************/
UINT _ux_device_class_pima_object_info_get(UX_SLAVE_CLASS_PIMA *pima, ULONG object_handle)
@@ -105,16 +86,16 @@ ULONG keywords_length;
/* Obtain the object info from the application. */
status = pima -> ux_device_class_pima_object_info_get(pima, object_handle, &object);
-
+
/* Check for error. */
if (status != UX_SUCCESS)
/* We return an error. */
_ux_device_class_pima_response_send(pima, status, 0, 0, 0, 0);
-
+
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;
@@ -150,55 +131,55 @@ ULONG keywords_length;
/* 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);
-
+
/* Fill in the data code. */
_ux_utility_short_put(object_info + UX_DEVICE_CLASS_PIMA_DATA_HEADER_CODE,
UX_DEVICE_CLASS_PIMA_OC_GET_OBJECT_INFO);
-
+
/* Fill in the Transaction ID. */
- _ux_utility_long_put(object_info + UX_DEVICE_CLASS_PIMA_DATA_HEADER_TRANSACTION_ID,
+ _ux_utility_long_put(object_info + UX_DEVICE_CLASS_PIMA_DATA_HEADER_TRANSACTION_ID,
pima -> ux_device_class_pima_transaction_id);
-
+
/* Allocate the device info pointer to the beginning of the dynamic object info field. */
object_info_pointer = object_info + UX_DEVICE_CLASS_PIMA_DATA_HEADER_SIZE;
/* The object info structure coming from the application needs to be packed. */
- _ux_utility_descriptor_pack((UCHAR *) object,
+ _ux_utility_descriptor_pack((UCHAR *) object,
_ux_system_class_pima_object_structure,
UX_DEVICE_CLASS_PIMA_OBJECT_ENTRIES,
object_info_pointer);
/* Copy the object filename field. Point to the beginning of the object description string. */
object_info_pointer += UX_DEVICE_CLASS_PIMA_OBJECT_VARIABLE_OFFSET;
-
+
/* Copy that string into the object description field. */
_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 += file_name_length;
-
+
/* Copy that string into the capture date field. */
_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 += capture_date_length;
-
+
/* Copy that string into the modification date field. */
_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 += modification_date_length;
-
+
/* Copy that string into the keywords field. */
_ux_utility_memory_copy(object_info_pointer, object -> ux_device_class_pima_object_keywords, keywords_length); /* Use case of memcpy is verified. */
-
+
/* Fill in the size of the response header. */
- _ux_utility_long_put(object_info + UX_DEVICE_CLASS_PIMA_DATA_HEADER_LENGTH,
+ _ux_utility_long_put(object_info + UX_DEVICE_CLASS_PIMA_DATA_HEADER_LENGTH,
object_info_length);
-
+
/* Send a data payload with the object info data set. */
status = _ux_device_stack_transfer_request(transfer_request, object_info_length, 0);
-
+
/* Now we return a response with success. */
_ux_device_class_pima_response_send(pima, UX_DEVICE_CLASS_PIMA_RC_OK, 0, 0, 0, 0);
}
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 557c386e..4e165e7c 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
@@ -1,18 +1,19 @@
/***************************************************************************
- * Copyright (c) 2024 Microsoft Corporation
- *
+ * Copyright (c) 2024 Microsoft Corporation
+ * Copyright (c) 2026-present Eclipse ThreadX contributors
+ *
* This program and the accompanying materials are made available under the
* terms of the MIT License which is available at
* https://opensource.org/licenses/MIT.
- *
+ *
* SPDX-License-Identifier: MIT
**************************************************************************/
/**************************************************************************/
/**************************************************************************/
-/** */
-/** USBX Component */
+/** */
+/** USBX Component */
/** */
/** Device Pima Class */
/** */
@@ -29,57 +30,44 @@
#include "ux_device_stack.h"
-/**************************************************************************/
-/* */
-/* FUNCTION RELEASE */
-/* */
-/* _ux_device_class_pima_object_info_send PORTABLE C */
+/**************************************************************************/
+/* */
+/* FUNCTION RELEASE */
+/* */
+/* _ux_device_class_pima_object_info_send PORTABLE C */
/* 6.1.10 */
/* AUTHOR */
/* */
/* Chaoqiong Xiao, Microsoft Corporation */
/* */
/* DESCRIPTION */
-/* */
-/* This function receives an object info structure from the host */
-/* before receiving the actual data. */
-/* */
-/* INPUT */
-/* */
-/* pima Pointer to pima class */
-/* */
-/* OUTPUT */
-/* */
-/* Completion Status */
-/* */
-/* CALLS */
-/* */
-/* _ux_device_stack_transfer_request Transfer request */
+/* */
+/* This function receives an object info structure from the host */
+/* before receiving the actual data. */
+/* */
+/* INPUT */
+/* */
+/* pima Pointer to pima class */
+/* */
+/* OUTPUT */
+/* */
+/* Completion Status */
+/* */
+/* CALLS */
+/* */
+/* _ux_device_stack_transfer_request Transfer request */
/* _ux_device_stack_endpoint_stall Stall endpoint */
-/* _ux_utility_long_put Put 32-bit value */
-/* _ux_utility_short_put Put 32-bit value */
+/* _ux_utility_long_put Put 32-bit value */
+/* _ux_utility_short_put Put 32-bit value */
/* _ux_utility_memory_allocate Allocate memory */
-/* _ux_utility_memory_copy Copy memory */
-/* _ux_utility_memory_free Free memory */
+/* _ux_utility_memory_copy Copy memory */
+/* _ux_utility_memory_free Free memory */
/* _ux_utility_descriptor_parse Parse descriptor */
/* _ux_device_class_pima_response_send Send PIMA response */
-/* */
-/* CALLED BY */
-/* */
-/* Device Storage Class */
-/* */
-/* RELEASE HISTORY */
-/* */
-/* DATE NAME DESCRIPTION */
-/* */
-/* 05-19-2020 Chaoqiong Xiao Initial Version 6.0 */
-/* 09-30-2020 Chaoqiong Xiao Modified comment(s), */
-/* verified memset and memcpy */
-/* cases, */
-/* resulting in version 6.1 */
-/* 01-31-2022 Chaoqiong Xiao Modified comment(s), */
-/* updated status handling, */
-/* resulting in version 6.1.10 */
+/* */
+/* CALLED BY */
+/* */
+/* Device Storage Class */
/* */
/**************************************************************************/
UINT _ux_device_class_pima_object_info_send(UX_SLAVE_CLASS_PIMA *pima, ULONG storage_id, ULONG parent_object_handle)
@@ -98,24 +86,24 @@ ULONG object_handle;
/* Obtain the pointer to the transfer request. */
transfer_request = &pima -> ux_device_class_pima_bulk_out_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;
/* Get the data payload. */
- status = _ux_device_stack_transfer_request(transfer_request, UX_DEVICE_CLASS_PIMA_TRANSFER_BUFFER_LENGTH,
+ status = _ux_device_stack_transfer_request(transfer_request, UX_DEVICE_CLASS_PIMA_TRANSFER_BUFFER_LENGTH,
UX_DEVICE_CLASS_PIMA_TRANSFER_BUFFER_LENGTH);
/* Check if there was an error. If so, stall the endpoint. */
if (status != UX_SUCCESS)
{
-
+
/* Stall the endpoint. */
_ux_device_stack_endpoint_stall(pima -> ux_device_class_pima_bulk_out_endpoint);
-
+
/* Return the status. */
return(status);
-
+
}
/* Allocate some memory for the object. */
@@ -136,7 +124,7 @@ ULONG object_handle;
/* Copy the object filename field. Point to the beginning of the object description string. */
object_info_pointer = object_info_pointer + UX_DEVICE_CLASS_PIMA_OBJECT_VARIABLE_OFFSET;
-
+
/* Get the unicode string length. */
unicode_string_length = ((ULONG) *object_info_pointer * 2) + 1;
@@ -149,13 +137,13 @@ ULONG object_handle;
/* Is there enough space? */
if (status == UX_SUCCESS)
{
-
+
/* 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); /* Use case of memcpy is verified. */
/* Point to the next field. */
object_info_pointer += unicode_string_length;
-
+
/* Get the unicode string length. */
unicode_string_length = ((ULONG) *object_info_pointer * 2) + 1;
@@ -175,7 +163,7 @@ ULONG object_handle;
/* Point to the next field. */
object_info_pointer += unicode_string_length;
-
+
/* Get the unicode string length. */
unicode_string_length = ((ULONG) *object_info_pointer * 2) + 1;
@@ -195,7 +183,7 @@ ULONG object_handle;
/* Point to the next field. */
object_info_pointer += unicode_string_length;
-
+
/* Get the unicode string length. */
unicode_string_length = ((ULONG) *object_info_pointer * 2) + 1;
@@ -212,27 +200,27 @@ 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); /* Use case of memcpy is verified. */
-
+
/* Reset the rest of the other parameters. */
object -> ux_device_class_pima_object_state = 0;
object -> ux_device_class_pima_object_offset = 0;
object -> ux_device_class_pima_object_transfer_status = 0;
object -> ux_device_class_pima_object_handle_id = 0;
object -> ux_device_class_pima_object_length = 0;
-
+
/* Send the object to the application. */
status = pima -> ux_device_class_pima_object_info_send(pima, object, storage_id, parent_object_handle, &object_handle);
-
+
if (status != UX_SUCCESS)
{
/* Now we return a response with error. */
- _ux_device_class_pima_response_send(pima, status, 3, pima -> ux_device_class_pima_storage_id,
+ _ux_device_class_pima_response_send(pima, status, 3, pima -> ux_device_class_pima_storage_id,
object -> ux_device_class_pima_object_parent_object, object_handle);
}
else
{
/* Now we return a response with success. */
- _ux_device_class_pima_response_send(pima, UX_DEVICE_CLASS_PIMA_RC_OK, 3, pima -> ux_device_class_pima_storage_id,
+ _ux_device_class_pima_response_send(pima, UX_DEVICE_CLASS_PIMA_RC_OK, 3, pima -> ux_device_class_pima_storage_id,
object -> ux_device_class_pima_object_parent_object, object_handle);
}
@@ -251,7 +239,7 @@ ULONG object_handle;
/* Free the resources. */
_ux_utility_memory_free(object);
-
+
/* Return completion status. */
return(status);
}
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 dd85ac53..bc4cbf2c 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
@@ -1,18 +1,19 @@
/***************************************************************************
- * Copyright (c) 2024 Microsoft Corporation
- *
+ * Copyright (c) 2024 Microsoft Corporation
+ * Copyright (c) 2026-present Eclipse ThreadX contributors
+ *
* This program and the accompanying materials are made available under the
* terms of the MIT License which is available at
* https://opensource.org/licenses/MIT.
- *
+ *
* SPDX-License-Identifier: MIT
**************************************************************************/
/**************************************************************************/
/**************************************************************************/
-/** */
-/** USBX Component */
+/** */
+/** USBX Component */
/** */
/** Device Pima Class */
/** */
@@ -29,61 +30,43 @@
#include "ux_device_stack.h"
-/**************************************************************************/
-/* */
-/* FUNCTION RELEASE */
-/* */
-/* _ux_device_class_pima_object_prop_desc_get PORTABLE C */
+/**************************************************************************/
+/* */
+/* FUNCTION RELEASE */
+/* */
+/* _ux_device_class_pima_object_prop_desc_get PORTABLE C */
/* 6.3.0 */
/* AUTHOR */
/* */
/* Chaoqiong Xiao, Microsoft Corporation */
/* */
/* DESCRIPTION */
-/* */
-/* Return an Object Property Description dataset for a format code and */
+/* */
+/* Return an Object Property Description dataset for a format code and */
/* a specific object property. */
-/* */
-/* INPUT */
-/* */
-/* pima Pointer to pima class */
+/* */
+/* INPUT */
+/* */
+/* pima Pointer to pima class */
/* object_property Object Property */
-/* object_format_code Object format for which the */
-/* properties supported are. */
-/* */
-/* OUTPUT */
-/* */
-/* Completion Status */
-/* */
-/* CALLS */
-/* */
+/* object_format_code Object format for which the */
+/* properties supported are. */
+/* */
+/* OUTPUT */
+/* */
+/* Completion Status */
+/* */
+/* CALLS */
+/* */
/* _ux_device_stack_transfer_request Transfer request */
/* _ux_utility_long_put Put 32-bit value */
/* _ux_utility_short_put Put 32-bit value */
/* _ux_utility_memory_copy Copy memory */
/* _ux_device_class_pima_response_send Send PIMA response */
-/* */
-/* CALLED BY */
-/* */
-/* Device Pima Class */
-/* */
-/* RELEASE HISTORY */
-/* */
-/* DATE NAME DESCRIPTION */
-/* */
-/* 05-19-2020 Chaoqiong Xiao Initial Version 6.0 */
-/* 09-30-2020 Chaoqiong Xiao Modified comment(s), */
-/* verified memset and memcpy */
-/* cases, */
-/* resulting in version 6.1 */
-/* 01-31-2022 Chaoqiong Xiao Modified comment(s), */
-/* updated status handling, */
-/* passed max length to app, */
-/* resulting in version 6.1.10 */
-/* 10-31-2023 Chaoqiong Xiao Modified comment(s), */
-/* added a new mode to manage */
-/* endpoint buffer in classes, */
-/* resulting in version 6.3.0 */
+/* */
+/* CALLED BY */
+/* */
+/* Device Pima Class */
/* */
/**************************************************************************/
UINT _ux_device_class_pima_object_prop_desc_get(UX_SLAVE_CLASS_PIMA *pima,
@@ -103,7 +86,7 @@ UCHAR *object_props_desc_end;
/* 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_props_desc = transfer_request -> ux_slave_transfer_request_data_pointer;
@@ -113,13 +96,13 @@ UCHAR *object_props_desc_end;
/* Fill in the data container type. */
_ux_utility_short_put(object_props_desc + UX_DEVICE_CLASS_PIMA_DATA_HEADER_TYPE,
UX_DEVICE_CLASS_PIMA_CT_DATA_BLOCK);
-
+
/* Fill in the data code. */
_ux_utility_short_put(object_props_desc + UX_DEVICE_CLASS_PIMA_DATA_HEADER_CODE,
UX_DEVICE_CLASS_PIMA_OC_GET_OBJECT_PROP_DESC);
-
+
/* Fill in the Transaction ID. */
- _ux_utility_long_put(object_props_desc + UX_DEVICE_CLASS_PIMA_DATA_HEADER_TRANSACTION_ID,
+ _ux_utility_long_put(object_props_desc + UX_DEVICE_CLASS_PIMA_DATA_HEADER_TRANSACTION_ID,
pima -> ux_device_class_pima_transaction_id);
/* Call the application to retrieve the property description dataset. */
@@ -129,7 +112,7 @@ UCHAR *object_props_desc_end;
/* See if we have the right format code and object property. */
if (status == UX_SUCCESS)
{
-
+
/* We have found the object property for the format code requested, retrieve the dataset. */
/* Do we have enough space? */
@@ -139,17 +122,17 @@ 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); /* Use case of memcpy is verified. */
-
+
/* Add the header size. */
object_prop_dataset_length += UX_DEVICE_CLASS_PIMA_DATA_HEADER_SIZE;
-
+
/* Fill in the size of the response header. */
- _ux_utility_long_put(object_props_desc + UX_DEVICE_CLASS_PIMA_DATA_HEADER_LENGTH,
+ _ux_utility_long_put(object_props_desc + UX_DEVICE_CLASS_PIMA_DATA_HEADER_LENGTH,
object_prop_dataset_length);
-
+
/* Send a data payload with the object props array. */
status = _ux_device_stack_transfer_request(transfer_request, object_prop_dataset_length, 0);
-
+
/* Now we return a response with success. */
_ux_device_class_pima_response_send(pima, UX_DEVICE_CLASS_PIMA_RC_OK, 0, 0, 0, 0);
@@ -168,8 +151,8 @@ UCHAR *object_props_desc_end;
status = UX_DEVICE_CLASS_PIMA_RC_GENERAL_ERROR;
}
}
-
- /* We get here when we did not find the object format code or the dataset was too large. */
+
+ /* We get here when we did not find the object format code or the dataset was too large. */
/* Now we return a response with error code. */
_ux_device_class_pima_response_send(pima, status, 0, 0, 0, 0);
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 f05ec9d6..8c1f0e04 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
@@ -1,18 +1,19 @@
/***************************************************************************
- * Copyright (c) 2024 Microsoft Corporation
- *
+ * Copyright (c) 2024 Microsoft Corporation
+ * Copyright (c) 2026-present Eclipse ThreadX contributors
+ *
* This program and the accompanying materials are made available under the
* terms of the MIT License which is available at
* https://opensource.org/licenses/MIT.
- *
+ *
* SPDX-License-Identifier: MIT
**************************************************************************/
/**************************************************************************/
/**************************************************************************/
-/** */
-/** USBX Component */
+/** */
+/** USBX Component */
/** */
/** Device Pima Class */
/** */
@@ -29,64 +30,46 @@
#include "ux_device_stack.h"
-/**************************************************************************/
-/* */
-/* FUNCTION RELEASE */
-/* */
-/* _ux_device_class_pima_object_prop_value_get PORTABLE C */
+/**************************************************************************/
+/* */
+/* FUNCTION RELEASE */
+/* */
+/* _ux_device_class_pima_object_prop_value_get PORTABLE C */
/* 6.3.0 */
/* AUTHOR */
/* */
/* Chaoqiong Xiao, Microsoft Corporation */
/* */
/* DESCRIPTION */
-/* */
-/* Return an Object Property Value. The value is fetched by calling the */
+/* */
+/* Return an Object Property Value. The value is fetched by calling the */
/* application which initialized a call back pointer. The application */
-/* will copy the value at the specified address. The length of the */
-/* value of the object will be returned to compute the length of the */
-/* payload packet. */
-/* */
-/* INPUT */
-/* */
-/* pima Pointer to pima class */
+/* will copy the value at the specified address. The length of the */
+/* value of the object will be returned to compute the length of the */
+/* payload packet. */
+/* */
+/* INPUT */
+/* */
+/* pima Pointer to pima class */
/* object_handle Object Handle */
-/* object_property_code Object Property code for */
-/* which the value is obtained. */
-/* */
-/* OUTPUT */
-/* */
-/* Completion Status */
-/* */
-/* CALLS */
-/* */
+/* object_property_code Object Property code for */
+/* which the value is obtained. */
+/* */
+/* OUTPUT */
+/* */
+/* Completion Status */
+/* */
+/* CALLS */
+/* */
/* _ux_device_stack_transfer_request Transfer request */
/* _ux_utility_long_put Put 32-bit value */
/* _ux_utility_short_put Put 32-bit value */
/* _ux_utility_memory_copy Copy memory */
/* _ux_device_class_pima_response_send Send PIMA response */
-/* */
-/* CALLED BY */
-/* */
-/* Device Pima Class */
-/* */
-/* RELEASE HISTORY */
-/* */
-/* DATE NAME DESCRIPTION */
-/* */
-/* 05-19-2020 Chaoqiong Xiao Initial Version 6.0 */
-/* 09-30-2020 Chaoqiong Xiao Modified comment(s), */
-/* verified memset and memcpy */
-/* cases, */
-/* resulting in version 6.1 */
-/* 01-31-2022 Chaoqiong Xiao Modified comment(s), */
-/* updated status handling, */
-/* passed max length to app, */
-/* resulting in version 6.1.10 */
-/* 10-31-2023 Chaoqiong Xiao Modified comment(s), */
-/* added a new mode to manage */
-/* endpoint buffer in classes, */
-/* resulting in version 6.3.0 */
+/* */
+/* CALLED BY */
+/* */
+/* Device Pima Class */
/* */
/**************************************************************************/
UINT _ux_device_class_pima_object_prop_value_get(UX_SLAVE_CLASS_PIMA *pima,
@@ -106,7 +89,7 @@ ULONG object_property_value_length;
/* 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. */
pima_data_buffer = transfer_request -> ux_slave_transfer_request_data_pointer;
@@ -116,19 +99,19 @@ ULONG object_property_value_length;
/* Fill in the data container type. */
_ux_utility_short_put(pima_data_buffer + UX_DEVICE_CLASS_PIMA_DATA_HEADER_TYPE,
UX_DEVICE_CLASS_PIMA_CT_DATA_BLOCK);
-
+
/* Fill in the data code. */
_ux_utility_short_put(pima_data_buffer + UX_DEVICE_CLASS_PIMA_DATA_HEADER_CODE,
UX_DEVICE_CLASS_PIMA_OC_GET_OBJECT_PROP_VALUE);
-
+
/* Fill in the Transaction ID. */
- _ux_utility_long_put(pima_data_buffer + UX_DEVICE_CLASS_PIMA_DATA_HEADER_TRANSACTION_ID,
+ _ux_utility_long_put(pima_data_buffer + UX_DEVICE_CLASS_PIMA_DATA_HEADER_TRANSACTION_ID,
pima -> ux_device_class_pima_transaction_id);
/* Ask the application to retrieve for us the object prop value. */
object_property_value_length = UX_DEVICE_CLASS_PIMA_MAX_PAYLOAD;
status = pima -> ux_device_class_pima_object_prop_value_get(pima, object_handle, object_property_code, &object_property_value, &object_property_value_length);
-
+
/* Result should always be OK, but to be sure .... */
if (status != UX_SUCCESS)
@@ -141,20 +124,20 @@ ULONG object_property_value_length;
/* Check if the prop value will fit. */
if (pima_data_buffer + UX_DEVICE_CLASS_PIMA_DATA_HEADER_SIZE + object_property_value_length <= pima_data_buffer_end)
{
-
+
/* 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); /* Use case of memcpy is verified. */
/* Add the header size to the payload. */
object_property_value_length += UX_DEVICE_CLASS_PIMA_DATA_HEADER_SIZE;
-
+
/* Fill in the size of the response header. */
- _ux_utility_long_put(pima_data_buffer + UX_DEVICE_CLASS_PIMA_DATA_HEADER_LENGTH,
+ _ux_utility_long_put(pima_data_buffer + UX_DEVICE_CLASS_PIMA_DATA_HEADER_LENGTH,
object_property_value_length);
-
+
/* Send a data payload with the object props array. */
status = _ux_device_stack_transfer_request(transfer_request, object_property_value_length, 0);
-
+
/* Now we return a response with success. */
_ux_device_class_pima_response_send(pima, UX_DEVICE_CLASS_PIMA_RC_OK, 0, 0, 0, 0);
}
@@ -173,7 +156,7 @@ ULONG object_property_value_length;
status = UX_MEMORY_INSUFFICIENT;
}
}
-
+
/* Return completion status. */
return(status);
}
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 df8b9181..a35b50f9 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
@@ -1,18 +1,19 @@
/***************************************************************************
- * Copyright (c) 2024 Microsoft Corporation
- *
+ * Copyright (c) 2024 Microsoft Corporation
+ * Copyright (c) 2026-present Eclipse ThreadX contributors
+ *
* This program and the accompanying materials are made available under the
* terms of the MIT License which is available at
* https://opensource.org/licenses/MIT.
- *
+ *
* SPDX-License-Identifier: MIT
**************************************************************************/
/**************************************************************************/
/**************************************************************************/
-/** */
-/** USBX Component */
+/** */
+/** USBX Component */
/** */
/** Device Pima Class */
/** */
@@ -29,49 +30,41 @@
#include "ux_device_stack.h"
-/**************************************************************************/
-/* */
-/* FUNCTION RELEASE */
-/* */
-/* _ux_device_class_pima_object_prop_value_set PORTABLE C */
+/**************************************************************************/
+/* */
+/* FUNCTION RELEASE */
+/* */
+/* _ux_device_class_pima_object_prop_value_set PORTABLE C */
/* 6.1 */
/* AUTHOR */
/* */
/* Chaoqiong Xiao, Microsoft Corporation */
/* */
/* DESCRIPTION */
-/* */
-/* Return an Object Property Value. */
/* */
-/* */
-/* INPUT */
-/* */
-/* pima Pointer to pima class */
+/* Return an Object Property Value. */
+/* */
+/* */
+/* INPUT */
+/* */
+/* pima Pointer to pima class */
/* object_handle Object Handle */
-/* object_property_code Object Property code for */
-/* which the value is obtained. */
-/* */
-/* OUTPUT */
-/* */
-/* Completion Status */
-/* */
-/* CALLS */
-/* */
+/* object_property_code Object Property code for */
+/* which the value is obtained. */
+/* */
+/* OUTPUT */
+/* */
+/* Completion Status */
+/* */
+/* CALLS */
+/* */
/* _ux_device_stack_transfer_request Transfer request */
/* _ux_device_stack_endpoint_stall Stall endpoint */
/* _ux_device_class_pima_response_send Send PIMA response */
-/* */
-/* CALLED BY */
-/* */
-/* Device Pima Class */
-/* */
-/* RELEASE HISTORY */
-/* */
-/* DATE NAME DESCRIPTION */
-/* */
-/* 05-19-2020 Chaoqiong Xiao Initial Version 6.0 */
-/* 09-30-2020 Chaoqiong Xiao Modified comment(s), */
-/* resulting in version 6.1 */
+/* */
+/* CALLED BY */
+/* */
+/* Device Pima Class */
/* */
/**************************************************************************/
UINT _ux_device_class_pima_object_prop_value_set(UX_SLAVE_CLASS_PIMA *pima,
@@ -90,26 +83,26 @@ ULONG object_property_value_length;
/* Obtain the pointer to the transfer request. */
transfer_request = &pima -> ux_device_class_pima_bulk_out_endpoint -> ux_slave_endpoint_transfer_request;
-
+
/* Obtain memory for this object info. Use the transfer request pre-allocated memory. */
pima_data_buffer = transfer_request -> ux_slave_transfer_request_data_pointer;
/* Get the data payload. */
- status = _ux_device_stack_transfer_request(transfer_request, UX_DEVICE_CLASS_PIMA_OBJECT_PROP_VALUE_BUFFER_SIZE,
+ status = _ux_device_stack_transfer_request(transfer_request, UX_DEVICE_CLASS_PIMA_OBJECT_PROP_VALUE_BUFFER_SIZE,
UX_DEVICE_CLASS_PIMA_OBJECT_PROP_VALUE_BUFFER_SIZE);
/* Check if there was an error. If so, stall the endpoint. */
if (status != UX_SUCCESS)
{
-
+
/* Stall the endpoint. */
_ux_device_stack_endpoint_stall(pima -> ux_device_class_pima_bulk_out_endpoint);
-
+
/* Return the status. */
return(status);
-
+
}
-
+
/* Allocate the device info pointer to the beginning of the dynamic object info field. */
object_property_value = pima_data_buffer + UX_DEVICE_CLASS_PIMA_DATA_HEADER_SIZE;
@@ -122,23 +115,23 @@ ULONG object_property_value_length;
/* Take out the header. */
object_property_value_length -= UX_DEVICE_CLASS_PIMA_DATA_HEADER_SIZE;
-
+
/* Send the object to the application. */
status = pima -> ux_device_class_pima_object_prop_value_set(pima, object_handle, object_property_code, object_property_value, object_property_value_length);
-
+
/* Check error code from application. */
if (status == UX_SUCCESS)
-
+
/* Now we return a response with success. */
_ux_device_class_pima_response_send(pima, UX_DEVICE_CLASS_PIMA_RC_OK, 0, 0, 0, 0);
else
-
+
/* We return an error. The code is passed by the application. */
_ux_device_class_pima_response_send(pima, status, 0, 0, 0, 0);
}
else
- {
+ {
/* We return an error. */
_ux_device_class_pima_response_send(pima, UX_DEVICE_CLASS_PIMA_RC_INVALID_PARAMETER, 0, 0, 0, 0);
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 7eaebeca..bc129776 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
@@ -1,18 +1,19 @@
/***************************************************************************
- * Copyright (c) 2024 Microsoft Corporation
- *
+ * Copyright (c) 2024 Microsoft Corporation
+ * Copyright (c) 2026-present Eclipse ThreadX contributors
+ *
* This program and the accompanying materials are made available under the
* terms of the MIT License which is available at
* https://opensource.org/licenses/MIT.
- *
+ *
* SPDX-License-Identifier: MIT
**************************************************************************/
/**************************************************************************/
/**************************************************************************/
-/** */
-/** USBX Component */
+/** */
+/** USBX Component */
/** */
/** Device Pima Class */
/** */
@@ -29,53 +30,42 @@
#include "ux_device_stack.h"
-/**************************************************************************/
-/* */
-/* FUNCTION RELEASE */
-/* */
-/* _ux_device_class_pima_object_props_supported_get PORTABLE C */
+/**************************************************************************/
+/* */
+/* FUNCTION RELEASE */
+/* */
+/* _ux_device_class_pima_object_props_supported_get PORTABLE C */
/* 6.1.10 */
/* AUTHOR */
/* */
/* Chaoqiong Xiao, Microsoft Corporation */
/* */
/* DESCRIPTION */
-/* */
-/* Return an Object Property Code array of supported object properties */
+/* */
+/* Return an Object Property Code array of supported object properties */
/* in the first parameter. */
-/* */
-/* INPUT */
-/* */
-/* pima Pointer to pima class */
-/* object_format_code Object format for which the */
-/* properties supported are. */
-/* */
-/* OUTPUT */
-/* */
-/* Completion Status */
-/* */
-/* CALLS */
-/* */
+/* */
+/* INPUT */
+/* */
+/* pima Pointer to pima class */
+/* object_format_code Object format for which the */
+/* properties supported are. */
+/* */
+/* OUTPUT */
+/* */
+/* Completion Status */
+/* */
+/* CALLS */
+/* */
/* _ux_device_stack_transfer_request Transfer request */
/* _ux_utility_long_put Put 32-bit value */
/* _ux_utility_short_put Put 32-bit value */
/* _ux_utility_memory_copy Copy memory */
/* _ux_device_class_pima_response_send Send PIMA response */
-/* */
-/* CALLED BY */
-/* */
-/* Device Pima Class */
-/* */
-/* RELEASE HISTORY */
-/* */
-/* DATE NAME DESCRIPTION */
-/* */
-/* 05-19-2020 Chaoqiong Xiao Initial Version 6.0 */
-/* 09-30-2020 Chaoqiong Xiao Modified comment(s), */
-/* resulting in version 6.1 */
-/* 01-31-2022 Chaoqiong Xiao Modified comment(s), */
-/* improved sanity checks, */
-/* resulting in version 6.1.10 */
+/* */
+/* CALLED BY */
+/* */
+/* Device Pima Class */
/* */
/**************************************************************************/
UINT _ux_device_class_pima_object_props_supported_get(UX_SLAVE_CLASS_PIMA *pima,
@@ -94,32 +84,32 @@ USHORT *object_props_list_pointer;
/* 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_props_list = transfer_request -> ux_slave_transfer_request_data_pointer;
/* Fill in the data container type. */
_ux_utility_short_put(object_props_list + UX_DEVICE_CLASS_PIMA_DATA_HEADER_TYPE,
UX_DEVICE_CLASS_PIMA_CT_DATA_BLOCK);
-
+
/* Fill in the data code. */
_ux_utility_short_put(object_props_list + UX_DEVICE_CLASS_PIMA_DATA_HEADER_CODE,
UX_DEVICE_CLASS_PIMA_OC_GET_OBJECT_PROPS_SUPPORTED);
-
+
/* Fill in the Transaction ID. */
- _ux_utility_long_put(object_props_list + UX_DEVICE_CLASS_PIMA_DATA_HEADER_TRANSACTION_ID,
+ _ux_utility_long_put(object_props_list + UX_DEVICE_CLASS_PIMA_DATA_HEADER_TRANSACTION_ID,
pima -> ux_device_class_pima_transaction_id);
/* Get the pointer to the list of arrays. */
object_props_list_pointer = pima -> ux_device_class_pima_object_properties_list;
-
+
/* Find the object format within the object props arrays. */
while (*object_props_list_pointer != 0)
{
/* See what the format code is. */
if (*object_props_list_pointer == (USHORT) object_format_code)
{
-
+
/* We have found the format code requested, retrieve the array of props. */
/* Retrieve the number of properties for this format code. */
object_props_list_items = (ULONG) *(object_props_list_pointer + 1);
@@ -134,40 +124,40 @@ USHORT *object_props_list_pointer;
UX_ASSERT(object_props_list_length <= UX_DEVICE_CLASS_PIMA_TRANSFER_BUFFER_LENGTH);
/* Fill in the size of the response header. */
- _ux_utility_long_put(object_props_list + UX_DEVICE_CLASS_PIMA_DATA_HEADER_LENGTH,
+ _ux_utility_long_put(object_props_list + UX_DEVICE_CLASS_PIMA_DATA_HEADER_LENGTH,
object_props_list_length);
-
+
/* Update the destination pointer. */
object_props_list += UX_DEVICE_CLASS_PIMA_DATA_HEADER_SIZE;
-
+
/* Insert the number of elements in the array. */
_ux_utility_long_put(object_props_list, object_props_list_items);
-
+
/* Add the length of the array. */
object_props_list += sizeof(ULONG);
-
+
/* Point the object_props_list_pointer to the props supported. Skip the object format and the number
of properties. */
object_props_list_pointer += 2;
-
+
/* Create the array in little endian format for transfer to host. */
while(object_props_list_items--)
{
-
+
/* Insert the object property in little endian. */
_ux_utility_short_put(object_props_list, *object_props_list_pointer);
-
+
/* Update target pointer. */
object_props_list += sizeof(SHORT);
-
+
/* Update source pointer. */
object_props_list_pointer++;
-
+
}
-
+
/* Send a data payload with the object props array. */
status = _ux_device_stack_transfer_request(transfer_request, object_props_list_length, 0);
-
+
/* Now we return a response with success. */
_ux_device_class_pima_response_send(pima, UX_DEVICE_CLASS_PIMA_RC_OK, 0, 0, 0, 0);
@@ -180,14 +170,14 @@ USHORT *object_props_list_pointer;
/* We need to skip this object format and point to the next. */
/* Retrieve the number of properties for this format code. */
object_props_list_items = *(object_props_list_pointer + 1);
-
+
/* Add the number of items to skip to the current list pointer. */
object_props_list_pointer += object_props_list_items + 2;
}
}
-
- /* We get here when we did not find the object format code. */
+
+ /* We get here when we did not find the object format code. */
status = _ux_device_class_pima_response_send(pima, UX_DEVICE_CLASS_PIMA_RC_INVALID_OBJECT_FORMAT_CODE, 0, 0, 0, 0);
/* Return completion status. */
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 5f95c876..f695d108 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
@@ -1,18 +1,19 @@
/***************************************************************************
- * Copyright (c) 2024 Microsoft Corporation
- *
+ * Copyright (c) 2024 Microsoft Corporation
+ * Copyright (c) 2026-present Eclipse ThreadX contributors
+ *
* This program and the accompanying materials are made available under the
* terms of the MIT License which is available at
* https://opensource.org/licenses/MIT.
- *
+ *
* SPDX-License-Identifier: MIT
**************************************************************************/
/**************************************************************************/
/**************************************************************************/
-/** */
-/** USBX Component */
+/** */
+/** USBX Component */
/** */
/** Device Pima Class */
/** */
@@ -29,61 +30,43 @@
#include "ux_device_stack.h"
-/**************************************************************************/
-/* */
-/* FUNCTION RELEASE */
-/* */
-/* _ux_device_class_pima_object_references_get PORTABLE C */
+/**************************************************************************/
+/* */
+/* FUNCTION RELEASE */
+/* */
+/* _ux_device_class_pima_object_references_get PORTABLE C */
/* 6.3.0 */
/* AUTHOR */
/* */
/* Chaoqiong Xiao, Microsoft Corporation */
/* */
/* DESCRIPTION */
-/* */
-/* Return object references associated with an object handle. */
-/* The pima class will call the application to get the array of */
-/* references. */
-/* */
-/* INPUT */
-/* */
-/* pima Pointer to pima class */
+/* */
+/* Return object references associated with an object handle. */
+/* The pima class will call the application to get the array of */
+/* references. */
+/* */
+/* INPUT */
+/* */
+/* pima Pointer to pima class */
/* object_handle Object Handle for which */
-/* references are obtained. */
-/* */
-/* OUTPUT */
-/* */
-/* Completion Status */
-/* */
-/* CALLS */
-/* */
+/* references are obtained. */
+/* */
+/* OUTPUT */
+/* */
+/* Completion Status */
+/* */
+/* CALLS */
+/* */
/* _ux_device_stack_transfer_request Transfer request */
/* _ux_utility_long_put Put 32-bit value */
/* _ux_utility_short_put Put 32-bit value */
/* _ux_utility_memory_copy Copy memory */
/* _ux_device_class_pima_response_send Send PIMA response */
-/* */
-/* CALLED BY */
-/* */
-/* Device Pima Class */
-/* */
-/* RELEASE HISTORY */
-/* */
-/* DATE NAME DESCRIPTION */
-/* */
-/* 05-19-2020 Chaoqiong Xiao Initial Version 6.0 */
-/* 09-30-2020 Chaoqiong Xiao Modified comment(s), */
-/* verified memset and memcpy */
-/* cases, */
-/* resulting in version 6.1 */
-/* 01-31-2022 Chaoqiong Xiao Modified comment(s), */
-/* updated status handling, */
-/* passed max length to app, */
-/* resulting in version 6.1.10 */
-/* 10-31-2023 Chaoqiong Xiao Modified comment(s), */
-/* added a new mode to manage */
-/* endpoint buffer in classes, */
-/* resulting in version 6.3.0 */
+/* */
+/* CALLED BY */
+/* */
+/* Device Pima Class */
/* */
/**************************************************************************/
UINT _ux_device_class_pima_object_references_get(UX_SLAVE_CLASS_PIMA *pima,
@@ -102,7 +85,7 @@ ULONG object_references_length;
/* 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. */
pima_data_buffer = transfer_request -> ux_slave_transfer_request_data_pointer;
@@ -112,19 +95,19 @@ ULONG object_references_length;
/* Fill in the data container type. */
_ux_utility_short_put(pima_data_buffer + UX_DEVICE_CLASS_PIMA_DATA_HEADER_TYPE,
UX_DEVICE_CLASS_PIMA_CT_DATA_BLOCK);
-
+
/* Fill in the data code. */
_ux_utility_short_put(pima_data_buffer + UX_DEVICE_CLASS_PIMA_DATA_HEADER_CODE,
UX_DEVICE_CLASS_PIMA_OC_GET_OBJECT_REFERENCES);
-
+
/* Fill in the Transaction ID. */
- _ux_utility_long_put(pima_data_buffer + UX_DEVICE_CLASS_PIMA_DATA_HEADER_TRANSACTION_ID,
+ _ux_utility_long_put(pima_data_buffer + UX_DEVICE_CLASS_PIMA_DATA_HEADER_TRANSACTION_ID,
pima -> ux_device_class_pima_transaction_id);
/* Ask the application to retrieve for us the object references. */
object_references_length = UX_DEVICE_CLASS_PIMA_MAX_PAYLOAD;
status = pima -> ux_device_class_pima_object_references_get(pima, object_handle, &object_references, &object_references_length);
-
+
/* Result should always be OK, but to be sure .... */
if (status != UX_SUCCESS)
@@ -143,14 +126,14 @@ ULONG object_references_length;
/* Add the header size to the payload. */
object_references_length += UX_DEVICE_CLASS_PIMA_DATA_HEADER_SIZE;
-
+
/* Fill in the size of the response header. */
- _ux_utility_long_put(pima_data_buffer + UX_DEVICE_CLASS_PIMA_DATA_HEADER_LENGTH,
+ _ux_utility_long_put(pima_data_buffer + UX_DEVICE_CLASS_PIMA_DATA_HEADER_LENGTH,
object_references_length);
-
+
/* Send a data payload with the object references array. */
status = _ux_device_stack_transfer_request(transfer_request, object_references_length, 0);
-
+
/* Now we return a response with success. */
_ux_device_class_pima_response_send(pima, UX_DEVICE_CLASS_PIMA_RC_OK, 0, 0, 0, 0);
}
@@ -167,7 +150,7 @@ ULONG object_references_length;
status = UX_MEMORY_INSUFFICIENT;
}
}
-
+
/* Return completion status. */
return(status);
}
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 5197f06a..61ee6e9a 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
@@ -1,18 +1,19 @@
/***************************************************************************
- * Copyright (c) 2024 Microsoft Corporation
- *
+ * Copyright (c) 2024 Microsoft Corporation
+ * Copyright (c) 2026-present Eclipse ThreadX contributors
+ *
* This program and the accompanying materials are made available under the
* terms of the MIT License which is available at
* https://opensource.org/licenses/MIT.
- *
+ *
* SPDX-License-Identifier: MIT
**************************************************************************/
/**************************************************************************/
/**************************************************************************/
-/** */
-/** USBX Component */
+/** */
+/** USBX Component */
/** */
/** Device Pima Class */
/** */
@@ -29,53 +30,42 @@
#include "ux_device_stack.h"
-/**************************************************************************/
-/* */
-/* FUNCTION RELEASE */
-/* */
-/* _ux_device_class_pima_object_references_set PORTABLE C */
+/**************************************************************************/
+/* */
+/* FUNCTION RELEASE */
+/* */
+/* _ux_device_class_pima_object_references_set PORTABLE C */
/* 6.1.10 */
/* AUTHOR */
/* */
/* Chaoqiong Xiao, Microsoft Corporation */
/* */
/* DESCRIPTION */
-/* */
-/* Set object references associated with an object handle. */
-/* The pima class will call the application to set the array of */
-/* references. */
-/* */
-/* */
-/* */
-/* INPUT */
-/* */
-/* pima Pointer to pima class */
+/* */
+/* Set object references associated with an object handle. */
+/* The pima class will call the application to set the array of */
+/* references. */
+/* */
+/* */
+/* */
+/* INPUT */
+/* */
+/* pima Pointer to pima class */
/* object_handle Object Handle */
-/* */
-/* OUTPUT */
-/* */
-/* Completion Status */
-/* */
-/* CALLS */
-/* */
+/* */
+/* OUTPUT */
+/* */
+/* Completion Status */
+/* */
+/* CALLS */
+/* */
/* _ux_device_stack_transfer_request Transfer request */
/* _ux_device_stack_endpoint_stall Stall endpoint */
/* _ux_device_class_pima_response_send Send PIMA response */
-/* */
-/* CALLED BY */
-/* */
-/* Device Pima Class */
-/* */
-/* RELEASE HISTORY */
-/* */
-/* DATE NAME DESCRIPTION */
-/* */
-/* 05-19-2020 Chaoqiong Xiao Initial Version 6.0 */
-/* 09-30-2020 Chaoqiong Xiao Modified comment(s), */
-/* resulting in version 6.1 */
-/* 01-31-2022 Chaoqiong Xiao Modified comment(s), */
-/* updated status handling, */
-/* resulting in version 6.1.10 */
+/* */
+/* CALLED BY */
+/* */
+/* Device Pima Class */
/* */
/**************************************************************************/
UINT _ux_device_class_pima_object_references_set(UX_SLAVE_CLASS_PIMA *pima,
@@ -93,26 +83,26 @@ ULONG object_references_length;
/* Obtain the pointer to the transfer request. */
transfer_request = &pima -> ux_device_class_pima_bulk_out_endpoint -> ux_slave_endpoint_transfer_request;
-
+
/* Obtain memory for this object info. Use the transfer request pre-allocated memory. */
pima_data_buffer = transfer_request -> ux_slave_transfer_request_data_pointer;
/* Get the data payload. */
- status = _ux_device_stack_transfer_request(transfer_request, UX_DEVICE_CLASS_PIMA_OBJECT_PROP_VALUE_BUFFER_SIZE,
+ status = _ux_device_stack_transfer_request(transfer_request, UX_DEVICE_CLASS_PIMA_OBJECT_PROP_VALUE_BUFFER_SIZE,
UX_DEVICE_CLASS_PIMA_OBJECT_PROP_VALUE_BUFFER_SIZE);
/* Check if there was an error. If so, stall the endpoint. */
if (status != UX_SUCCESS)
{
-
+
/* Stall the endpoint. */
_ux_device_stack_endpoint_stall(pima -> ux_device_class_pima_bulk_out_endpoint);
-
+
/* Return the status. */
return(status);
-
+
}
-
+
/* Allocate the device info pointer to the beginning of the dynamic object info field. */
object_references = pima_data_buffer + UX_DEVICE_CLASS_PIMA_DATA_HEADER_SIZE;
@@ -125,7 +115,7 @@ ULONG object_references_length;
/* Take out the header. */
object_references_length -= UX_DEVICE_CLASS_PIMA_DATA_HEADER_SIZE;
-
+
/* Send the object references to the application. */
status = pima -> ux_device_class_pima_object_references_set(pima, object_handle, object_references, object_references_length);
@@ -141,7 +131,7 @@ ULONG object_references_length;
}
else
- {
+ {
/* We return an error. */
_ux_device_class_pima_response_send(pima, UX_DEVICE_CLASS_PIMA_RC_INVALID_PARAMETER, 0, 0, 0, 0);
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 2ad4177d..9b28feec 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
@@ -1,18 +1,19 @@
/***************************************************************************
- * Copyright (c) 2024 Microsoft Corporation
- *
+ * Copyright (c) 2024 Microsoft Corporation
+ * Copyright (c) 2026-present Eclipse ThreadX contributors
+ *
* This program and the accompanying materials are made available under the
* terms of the MIT License which is available at
* https://opensource.org/licenses/MIT.
- *
+ *
* SPDX-License-Identifier: MIT
**************************************************************************/
/**************************************************************************/
/**************************************************************************/
-/** */
-/** USBX Component */
+/** */
+/** USBX Component */
/** */
/** Device Pima Class */
/** */
@@ -29,46 +30,35 @@
#include "ux_device_stack.h"
-/**************************************************************************/
-/* */
-/* FUNCTION RELEASE */
-/* */
-/* _ux_device_class_pima_objects_number_send PORTABLE C */
+/**************************************************************************/
+/* */
+/* FUNCTION RELEASE */
+/* */
+/* _ux_device_class_pima_objects_number_send PORTABLE C */
/* 6.1.10 */
/* AUTHOR */
/* */
/* Chaoqiong Xiao, Microsoft Corporation */
/* */
/* DESCRIPTION */
-/* */
-/* This function returns the number of objects in the system. */
-/* */
-/* INPUT */
-/* */
-/* pima Pointer to pima class */
-/* */
-/* OUTPUT */
-/* */
-/* Completion Status */
-/* */
-/* CALLS */
-/* */
+/* */
+/* This function returns the number of objects in the system. */
+/* */
+/* INPUT */
+/* */
+/* pima Pointer to pima class */
+/* */
+/* OUTPUT */
+/* */
+/* Completion Status */
+/* */
+/* CALLS */
+/* */
/* _ux_device_class_pima_response_send Send PIMA response */
-/* */
-/* CALLED BY */
-/* */
-/* Device Pima Class */
-/* */
-/* RELEASE HISTORY */
-/* */
-/* DATE NAME DESCRIPTION */
-/* */
-/* 05-19-2020 Chaoqiong Xiao Initial Version 6.0 */
-/* 09-30-2020 Chaoqiong Xiao Modified comment(s), */
-/* resulting in version 6.1 */
-/* 01-31-2022 Chaoqiong Xiao Modified comment(s), */
-/* updated status handling, */
-/* resulting in version 6.1.10 */
+/* */
+/* CALLED BY */
+/* */
+/* Device Pima Class */
/* */
/**************************************************************************/
UINT _ux_device_class_pima_objects_number_send(UX_SLAVE_CLASS_PIMA *pima,
@@ -87,15 +77,15 @@ ULONG object_number;
/* Get the number of objects from the application. */
status = pima -> ux_device_class_pima_object_number_get(pima, object_format_code, object_association, &object_number);
-
+
/* Result should always be OK, but to be sure .... */
if (status != UX_SUCCESS)
/* We return an error. */
_ux_device_class_pima_response_send(pima, status, 0, 0, 0, 0);
- else
-
+ else
+
/* Now we return a response with success. */
_ux_device_class_pima_response_send(pima, UX_DEVICE_CLASS_PIMA_RC_OK, 1, object_number, 0, 0);
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 d18c1132..bc7d6d09 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
@@ -1,18 +1,19 @@
/***************************************************************************
- * Copyright (c) 2024 Microsoft Corporation
- *
+ * Copyright (c) 2024 Microsoft Corporation
+ * Copyright (c) 2026-present Eclipse ThreadX contributors
+ *
* This program and the accompanying materials are made available under the
* terms of the MIT License which is available at
* https://opensource.org/licenses/MIT.
- *
+ *
* SPDX-License-Identifier: MIT
**************************************************************************/
/**************************************************************************/
/**************************************************************************/
-/** */
-/** USBX Component */
+/** */
+/** USBX Component */
/** */
/** Device Pima Class */
/** */
@@ -29,57 +30,44 @@
#include "ux_device_stack.h"
-/**************************************************************************/
-/* */
-/* FUNCTION RELEASE */
-/* */
-/* _ux_device_class_pima_partial_object_data_get PORTABLE C */
+/**************************************************************************/
+/* */
+/* FUNCTION RELEASE */
+/* */
+/* _ux_device_class_pima_partial_object_data_get PORTABLE C */
/* 6.1.10 */
/* AUTHOR */
/* */
/* Chaoqiong Xiao, Microsoft Corporation */
/* */
/* DESCRIPTION */
-/* */
-/* This function returns the partial object data to the host. */
-/* */
-/* INPUT */
-/* */
-/* pima Pointer to pima class */
-/* */
-/* OUTPUT */
-/* */
-/* Completion Status */
-/* */
-/* CALLS */
-/* */
+/* */
+/* This function returns the partial object data to the host. */
+/* */
+/* INPUT */
+/* */
+/* pima Pointer to pima class */
+/* */
+/* OUTPUT */
+/* */
+/* Completion Status */
+/* */
+/* CALLS */
+/* */
/* _ux_device_stack_transfer_request Transfer request */
/* _ux_device_stack_endpoint_stall Stall endpoint */
/* _ux_utility_long_put Put 32-bit value */
/* _ux_utility_short_put Put 32-bit value */
/* _ux_device_class_pima_response_send Send PIMA response */
-/* */
-/* CALLED BY */
-/* */
-/* Device Storage Class */
-/* */
-/* RELEASE HISTORY */
-/* */
-/* DATE NAME DESCRIPTION */
-/* */
-/* 05-19-2020 Chaoqiong Xiao Initial Version 6.0 */
-/* 09-30-2020 Chaoqiong Xiao Modified comment(s), */
-/* resulting in version 6.1 */
-/* 01-31-2022 Chaoqiong Xiao Modified comment(s), */
-/* improved cancel flow, */
-/* updated status handling, */
-/* improved sanity checks, */
-/* resulting in version 6.1.10 */
+/* */
+/* CALLED BY */
+/* */
+/* Device Storage Class */
/* */
/**************************************************************************/
-UINT _ux_device_class_pima_partial_object_data_get(UX_SLAVE_CLASS_PIMA *pima,
- ULONG object_handle,
- ULONG offset_requested,
+UINT _ux_device_class_pima_partial_object_data_get(UX_SLAVE_CLASS_PIMA *pima,
+ ULONG object_handle,
+ ULONG offset_requested,
ULONG length_requested)
{
@@ -100,123 +88,123 @@ ULONG object_bytes_sent;
/* Obtain the object info from the application. */
status = pima -> ux_device_class_pima_object_info_get(pima, object_handle, &object);
-
+
/* Check for error. */
if (status == UX_SUCCESS)
- {
+ {
/* Get the object length. */
- object_length = object -> ux_device_class_pima_object_length;
-
+ object_length = object -> ux_device_class_pima_object_length;
+
/* Check how much to return. */
if ((object_length - offset_requested) > length_requested)
{
-
+
/* Return the maximum demanded. */
total_length = length_requested + UX_DEVICE_CLASS_PIMA_DATA_HEADER_SIZE;
-
+
/* Set the number of bytes we will send back. */
object_bytes_sent = length_requested;
}
-
+
else
{
-
+
/* Return the maximum we can. */
total_length = (object_length - offset_requested) + UX_DEVICE_CLASS_PIMA_DATA_HEADER_SIZE;
/* Set the number of bytes we will send back. */
object_bytes_sent = object_length - offset_requested;
-
- }
-
+
+ }
+
/* Reset the offset. */
- object_offset = 0;
+ object_offset = 0;
/* Obtain the pointer to the transfer request of the bulk in endpoint. */
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_data = transfer_request -> ux_slave_transfer_request_data_pointer;
-
+
/* Fill in the total length to be sent (header + payload. */
- _ux_utility_long_put(object_data + UX_DEVICE_CLASS_PIMA_DATA_HEADER_LENGTH,
+ _ux_utility_long_put(object_data + UX_DEVICE_CLASS_PIMA_DATA_HEADER_LENGTH,
total_length);
/* Fill in the data container type. */
_ux_utility_short_put(object_data + UX_DEVICE_CLASS_PIMA_DATA_HEADER_TYPE,
UX_DEVICE_CLASS_PIMA_CT_DATA_BLOCK);
-
+
/* Fill in the data code. */
_ux_utility_short_put(object_data + UX_DEVICE_CLASS_PIMA_DATA_HEADER_CODE,
UX_DEVICE_CLASS_PIMA_OC_GET_PARTIAL_OBJECT);
-
+
/* Fill in the Transaction ID. */
- _ux_utility_long_put(object_data + UX_DEVICE_CLASS_PIMA_DATA_HEADER_TRANSACTION_ID,
+ _ux_utility_long_put(object_data + UX_DEVICE_CLASS_PIMA_DATA_HEADER_TRANSACTION_ID,
pima -> ux_device_class_pima_transaction_id);
-
+
/* Assuming the host will ask for the entire object. */
while (total_length != 0)
{
-
+
/* If this is the first packet, we have to take into account the
header. */
if (object_offset == 0)
{
-
+
/* Calculate the maximum length for the first packet. */
object_length_demanded = UX_DEVICE_CLASS_PIMA_OBJECT_INFO_BUFFER_SIZE -
- UX_DEVICE_CLASS_PIMA_DATA_HEADER_SIZE;
-
+ UX_DEVICE_CLASS_PIMA_DATA_HEADER_SIZE;
+
/* Can we get that much from the application ? */
if (object_length_demanded > object_bytes_sent)
-
+
/* We ask too much. */
object_length_demanded = object_bytes_sent;
-
+
/* Obtain some data from the application. */
- status = pima -> ux_device_class_pima_object_data_get(pima, object_handle, object_data + UX_DEVICE_CLASS_PIMA_DATA_HEADER_SIZE,
+ status = pima -> ux_device_class_pima_object_data_get(pima, object_handle, object_data + UX_DEVICE_CLASS_PIMA_DATA_HEADER_SIZE,
object_offset + offset_requested,
object_length_demanded,
&object_length_received);
-
+
/* Check status, if we have a problem, we abort. */
if (status != UX_SUCCESS)
{
-
+
break;
}
else
- {
+ {
/* Adjust the length of the object. */
object_length -= object_length_received;
/* Adjust the length to be sent. */
object_length_transfer = object_length_received + UX_DEVICE_CLASS_PIMA_DATA_HEADER_SIZE;
- }
+ }
}
else
- {
+ {
/* Calculate the maximum length for the first packet. */
object_length_demanded = UX_DEVICE_CLASS_PIMA_TRANSFER_BUFFER_LENGTH;
-
+
/* Can we get that much from the application ? */
if (object_length_demanded > total_length)
-
+
/* We ask too much. */
object_length_demanded = total_length;
-
+
/* Obtain some data from the application. */
status = pima -> ux_device_class_pima_object_data_get(pima, object_handle, object_data, object_offset + offset_requested,
object_length_demanded,
&object_length_received);
-
+
/* Check status, if we have a problem, we abort. */
if (status != UX_SUCCESS)
{
-
+
/* We need to inform the host of an error. */
break;
}
@@ -225,10 +213,10 @@ ULONG object_bytes_sent;
/* Adjust the length of the object. */
object_length -= object_length_received;
-
+
/* Adjust the length to be sent. */
object_length_transfer = object_length_received;
- }
+ }
}
/* It's canceled, do not proceed. */
@@ -251,17 +239,17 @@ ULONG object_bytes_sent;
/* Check for the status. We may have had a request to cancel the transaction from the host. */
if (status != UX_SUCCESS)
{
-
+
/* Check the completion code for transfer abort from the host. */
if (transfer_request -> ux_slave_transfer_request_status == UX_TRANSFER_STATUS_ABORT)
{
-
+
/* Do not proceed. */
return(UX_ERROR);
- }
+ }
else
{
-
+
/* We need to inform the host of an error. */
status = UX_DEVICE_CLASS_PIMA_RC_GENERAL_ERROR;
break;
@@ -278,10 +266,10 @@ ULONG object_bytes_sent;
status = UX_ERROR;
break;
}
-
+
/* Adjust the offset within the object data. */
object_offset += object_length_received;
-
+
/* Update the total length to be sent. */
total_length -= object_length_transfer;
}
@@ -293,11 +281,11 @@ ULONG object_bytes_sent;
/* Check if status is OK. */
if (status != UX_SUCCESS)
-
- /* We need to stall the bulk in pipe. This is the method used by Pima devices to
+
+ /* We need to stall the bulk in pipe. This is the method used by Pima devices to
cancel a transaction. */
_ux_device_stack_endpoint_stall(pima -> ux_device_class_pima_bulk_in_endpoint);
-
+
/* Return completion status. */
return(status);
}
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 1c08c4e4..fb0eadf8 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
@@ -1,17 +1,18 @@
/***************************************************************************
- * Copyright (c) 2024 Microsoft Corporation
- *
+ * Copyright (c) 2024 Microsoft Corporation
+ * Copyright (c) 2026-present Eclipse ThreadX contributors
+ *
* This program and the accompanying materials are made available under the
* terms of the MIT License which is available at
* https://opensource.org/licenses/MIT.
- *
+ *
* SPDX-License-Identifier: MIT
**************************************************************************/
/**************************************************************************/
/**************************************************************************/
-/** */
-/** USBX Component */
+/** */
+/** USBX Component */
/** */
/** Device PIMA Class */
/** */
@@ -27,57 +28,46 @@
#include "ux_device_class_pima.h"
#include "ux_device_stack.h"
-/**************************************************************************/
-/* */
-/* FUNCTION RELEASE */
-/* */
-/* _ux_device_class_pima_response_send PORTABLE C */
+/**************************************************************************/
+/* */
+/* FUNCTION RELEASE */
+/* */
+/* _ux_device_class_pima_response_send PORTABLE C */
/* 6.1.10 */
/* AUTHOR */
/* */
/* Chaoqiong Xiao, Microsoft Corporation */
/* */
/* DESCRIPTION */
-/* */
-/* This function returns a response to a pima command to the host. */
-/* */
-/* INPUT */
-/* */
-/* pima Pointer to pima class */
-/* response_code Response code */
-/* */
-/* OUTPUT */
-/* */
-/* Completion Status */
-/* */
-/* CALLS */
-/* */
+/* */
+/* This function returns a response to a pima command to the host. */
+/* */
+/* INPUT */
+/* */
+/* pima Pointer to pima class */
+/* response_code Response code */
+/* */
+/* OUTPUT */
+/* */
+/* Completion Status */
+/* */
+/* CALLS */
+/* */
/* _ux_device_stack_transfer_request Transfer request */
/* _ux_utility_long_put Put 32-bit value */
/* _ux_utility_short_put Put 32-bit value */
/* _ux_device_class_pima_response_send Send PIMA response */
-/* */
-/* CALLED BY */
-/* */
-/* Device Storage Class */
-/* */
-/* RELEASE HISTORY */
-/* */
-/* DATE NAME DESCRIPTION */
-/* */
-/* 05-19-2020 Chaoqiong Xiao Initial Version 6.0 */
-/* 09-30-2020 Chaoqiong Xiao Modified comment(s), */
-/* resulting in version 6.1 */
-/* 01-31-2022 Chaoqiong Xiao Modified comment(s), */
-/* updated command phase, */
-/* resulting in version 6.1.10 */
+/* */
+/* CALLED BY */
+/* */
+/* Device Storage Class */
/* */
/**************************************************************************/
-UINT _ux_device_class_pima_response_send(UX_SLAVE_CLASS_PIMA *pima, ULONG response_code,
+UINT _ux_device_class_pima_response_send(UX_SLAVE_CLASS_PIMA *pima, ULONG response_code,
ULONG number_parameters,
- ULONG pima_parameter_1,
- ULONG pima_parameter_2,
- ULONG pima_parameter_3)
+ ULONG pima_parameter_1,
+ ULONG pima_parameter_2,
+ ULONG pima_parameter_3)
{
UINT status;
@@ -99,17 +89,17 @@ ULONG header_size;
/* Fill in the size of the response header. */
_ux_utility_long_put(response + UX_DEVICE_CLASS_PIMA_RESPONSE_HEADER_LENGTH, header_size);
-
+
/* Fill in the response container type. */
_ux_utility_short_put(response + UX_DEVICE_CLASS_PIMA_RESPONSE_HEADER_TYPE,
UX_DEVICE_CLASS_PIMA_CT_RESPONSE_BLOCK);
-
+
/* Fill in the response code. */
_ux_utility_short_put(response + UX_DEVICE_CLASS_PIMA_RESPONSE_HEADER_CODE,
(USHORT)response_code);
-
+
/* Fill in the Transaction ID. */
- _ux_utility_long_put(response + UX_DEVICE_CLASS_PIMA_RESPONSE_HEADER_TRANSACTION_ID,
+ _ux_utility_long_put(response + UX_DEVICE_CLASS_PIMA_RESPONSE_HEADER_TRANSACTION_ID,
pima -> ux_device_class_pima_transaction_id);
/* Parse each parameter and insert it if needed. */
@@ -117,31 +107,31 @@ ULONG header_size;
{
case 3 :
- _ux_utility_long_put(response + UX_DEVICE_CLASS_PIMA_RESPONSE_HEADER_PARAMETERS + (sizeof(ULONG) * 2),
+ _ux_utility_long_put(response + UX_DEVICE_CLASS_PIMA_RESPONSE_HEADER_PARAMETERS + (sizeof(ULONG) * 2),
pima_parameter_3);
/* Intentionally fallthrough to "case 2" */
/* fall through */
- case 2 :
- _ux_utility_long_put(response + UX_DEVICE_CLASS_PIMA_RESPONSE_HEADER_PARAMETERS + (sizeof(ULONG) * 1),
+ case 2 :
+ _ux_utility_long_put(response + UX_DEVICE_CLASS_PIMA_RESPONSE_HEADER_PARAMETERS + (sizeof(ULONG) * 1),
pima_parameter_2);
/* Intentionally fallthrough to "case 1" */
/* fall through */
- case 1 :
- _ux_utility_long_put(response + UX_DEVICE_CLASS_PIMA_RESPONSE_HEADER_PARAMETERS ,
+ case 1 :
+ _ux_utility_long_put(response + UX_DEVICE_CLASS_PIMA_RESPONSE_HEADER_PARAMETERS ,
pima_parameter_1);
/* Intentionally fallthrough to "default" */
/* fall through */
default :
break;
-
- }
+
+ }
/* Set phase to response. */
pima -> ux_device_class_pima_state = UX_DEVICE_CLASS_PIMA_PHASE_RESPONSE;
/* Send the response block. */
status = _ux_device_stack_transfer_request(transfer_request, header_size, 0);
-
+
/* Return completion status. */
return(status);
}
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 838636ce..bcdb4928 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
@@ -1,18 +1,19 @@
/***************************************************************************
- * Copyright (c) 2024 Microsoft Corporation
- *
+ * Copyright (c) 2024 Microsoft Corporation
+ * Copyright (c) 2026-present Eclipse ThreadX contributors
+ *
* This program and the accompanying materials are made available under the
* terms of the MIT License which is available at
* https://opensource.org/licenses/MIT.
- *
+ *
* SPDX-License-Identifier: MIT
**************************************************************************/
/**************************************************************************/
/**************************************************************************/
-/** */
-/** USBX Component */
+/** */
+/** USBX Component */
/** */
/** Device Pima Class */
/** */
@@ -29,45 +30,37 @@
#include "ux_device_stack.h"
-/**************************************************************************/
-/* */
-/* FUNCTION RELEASE */
-/* */
-/* _ux_device_class_pima_storage_format PORTABLE C */
+/**************************************************************************/
+/* */
+/* FUNCTION RELEASE */
+/* */
+/* _ux_device_class_pima_storage_format PORTABLE C */
/* 6.1 */
/* AUTHOR */
/* */
/* Chaoqiong Xiao, Microsoft Corporation */
/* */
/* DESCRIPTION */
-/* */
-/* This function informs the application that the storage media */
-/* should be reformatted. */
-/* */
-/* INPUT */
-/* */
-/* pima Pointer to pima class */
-/* storage_id Storage ID */
-/* */
-/* OUTPUT */
-/* */
-/* Completion Status */
-/* */
-/* CALLS */
-/* */
+/* */
+/* This function informs the application that the storage media */
+/* should be reformatted. */
+/* */
+/* INPUT */
+/* */
+/* pima Pointer to pima class */
+/* storage_id Storage ID */
+/* */
+/* OUTPUT */
+/* */
+/* Completion Status */
+/* */
+/* CALLS */
+/* */
/* _ux_device_class_pima_response_send Send PIMA response */
-/* */
-/* CALLED BY */
-/* */
-/* Device Pima Class */
-/* */
-/* RELEASE HISTORY */
-/* */
-/* DATE NAME DESCRIPTION */
-/* */
-/* 05-19-2020 Chaoqiong Xiao Initial Version 6.0 */
-/* 09-30-2020 Chaoqiong Xiao Modified comment(s), */
-/* resulting in version 6.1 */
+/* */
+/* CALLED BY */
+/* */
+/* Device Pima Class */
/* */
/**************************************************************************/
UINT _ux_device_class_pima_storage_format(UX_SLAVE_CLASS_PIMA *pima, ULONG storage_id)
@@ -80,13 +73,13 @@ UINT status;
/* Invoke the application callback function. */
status = pima -> ux_device_class_pima_storage_format(pima, storage_id);
-
+
/* Check for error. */
if (status != UX_SUCCESS)
/* We return an error. */
_ux_device_class_pima_response_send(pima, status, 0, 0, 0, 0);
-
+
else
/* We return a response with success. */
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 69535137..50e1db93 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
@@ -1,18 +1,19 @@
/***************************************************************************
- * Copyright (c) 2024 Microsoft Corporation
- *
+ * Copyright (c) 2024 Microsoft Corporation
+ * Copyright (c) 2026-present Eclipse ThreadX contributors
+ *
* This program and the accompanying materials are made available under the
* terms of the MIT License which is available at
* https://opensource.org/licenses/MIT.
- *
+ *
* SPDX-License-Identifier: MIT
**************************************************************************/
/**************************************************************************/
/**************************************************************************/
-/** */
-/** USBX Component */
+/** */
+/** USBX Component */
/** */
/** Device Pima Class */
/** */
@@ -36,53 +37,38 @@
/* Build option checked runtime by UX_ASSERT */
#endif
-/**************************************************************************/
-/* */
-/* FUNCTION RELEASE */
-/* */
-/* _ux_device_class_pima_storage_id_send PORTABLE C */
+/**************************************************************************/
+/* */
+/* FUNCTION RELEASE */
+/* */
+/* _ux_device_class_pima_storage_id_send PORTABLE C */
/* 6.3.0 */
/* AUTHOR */
/* */
/* Chaoqiong Xiao, Microsoft Corporation */
/* */
/* DESCRIPTION */
-/* */
-/* This function returns the storage id array to the host. */
-/* */
-/* INPUT */
-/* */
-/* pima Pointer to pima class */
-/* */
-/* OUTPUT */
-/* */
-/* Completion Status */
-/* */
-/* CALLS */
-/* */
+/* */
+/* This function returns the storage id array to the host. */
+/* */
+/* INPUT */
+/* */
+/* pima Pointer to pima class */
+/* */
+/* OUTPUT */
+/* */
+/* Completion Status */
+/* */
+/* CALLS */
+/* */
/* _ux_device_stack_transfer_request Transfer request */
/* _ux_utility_long_put Put 32-bit value */
/* _ux_utility_short_put Put 32-bit value */
/* _ux_device_class_pima_response_send Send PIMA response */
-/* */
-/* CALLED BY */
-/* */
-/* Device Pima Class */
-/* */
-/* RELEASE HISTORY */
-/* */
-/* DATE NAME DESCRIPTION */
-/* */
-/* 05-19-2020 Chaoqiong Xiao Initial Version 6.0 */
-/* 09-30-2020 Chaoqiong Xiao Modified comment(s), */
-/* resulting in version 6.1 */
-/* 01-31-2022 Chaoqiong Xiao Modified comment(s), */
-/* improved sanity checks, */
-/* resulting in version 6.1.10 */
-/* 10-31-2023 Chaoqiong Xiao Modified comment(s), */
-/* checked compiling options */
-/* by runtime UX_ASSERT, */
-/* resulting in version 6.3.0 */
+/* */
+/* CALLED BY */
+/* */
+/* Device Pima Class */
/* */
/**************************************************************************/
UINT _ux_device_class_pima_storage_id_send(UX_SLAVE_CLASS_PIMA *pima)
@@ -95,8 +81,8 @@ UCHAR *storage_id;
/* Build option check. */
UX_ASSERT(UX_DEVICE_CLASS_PIMA_TRANSFER_BUFFER_LENGTH >=
- (UX_DEVICE_CLASS_PIMA_DATA_HEADER_SIZE +
- 4 +
+ (UX_DEVICE_CLASS_PIMA_DATA_HEADER_SIZE +
+ 4 +
(4 * UX_DEVICE_CLASS_PIMA_MAX_STORAGE_IDS)));
/* If trace is enabled, insert this event into the trace buffer. */
@@ -107,19 +93,19 @@ UCHAR *storage_id;
/* Obtain memory for this object. Use the transfer request pre-allocated memory. */
storage_id = transfer_request -> ux_slave_transfer_request_data_pointer;
-
+
/* Fill in the data container type. */
_ux_utility_short_put(storage_id + UX_DEVICE_CLASS_PIMA_DATA_HEADER_TYPE,
UX_DEVICE_CLASS_PIMA_CT_DATA_BLOCK);
-
+
/* Fill in the data code. */
_ux_utility_short_put(storage_id + UX_DEVICE_CLASS_PIMA_DATA_HEADER_CODE,
UX_DEVICE_CLASS_PIMA_OC_GET_STORAGE_IDS);
-
+
/* Fill in the Transaction ID. */
- _ux_utility_long_put(storage_id + UX_DEVICE_CLASS_PIMA_DATA_HEADER_TRANSACTION_ID,
+ _ux_utility_long_put(storage_id + UX_DEVICE_CLASS_PIMA_DATA_HEADER_TRANSACTION_ID,
pima -> ux_device_class_pima_transaction_id);
-
+
/* We have one element only to report. */
_ux_utility_long_put(storage_id + UX_DEVICE_CLASS_PIMA_DATA_HEADER_SIZE, UX_DEVICE_CLASS_PIMA_MAX_STORAGE_IDS);
@@ -128,14 +114,14 @@ UCHAR *storage_id;
/* Compute the overall length of the device info structure. */
storage_id_length = UX_DEVICE_CLASS_PIMA_DATA_HEADER_SIZE + sizeof(ULONG) + (sizeof(ULONG) * UX_DEVICE_CLASS_PIMA_MAX_STORAGE_IDS);
-
+
/* Fill in the size of the response header. */
- _ux_utility_long_put(storage_id + UX_DEVICE_CLASS_PIMA_DATA_HEADER_LENGTH,
+ _ux_utility_long_put(storage_id + UX_DEVICE_CLASS_PIMA_DATA_HEADER_LENGTH,
storage_id_length);
-
+
/* Send a data payload with the storage id data set. */
status = _ux_device_stack_transfer_request(transfer_request, storage_id_length, 0);
-
+
/* Now we return a response with success. */
_ux_device_class_pima_response_send(pima, UX_DEVICE_CLASS_PIMA_RC_OK, 0, 0, 0, 0);
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 4a804f7d..b1a0f24c 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
@@ -1,18 +1,19 @@
/***************************************************************************
- * Copyright (c) 2024 Microsoft Corporation
- *
+ * Copyright (c) 2024 Microsoft Corporation
+ * Copyright (c) 2026-present Eclipse ThreadX contributors
+ *
* This program and the accompanying materials are made available under the
* terms of the MIT License which is available at
* https://opensource.org/licenses/MIT.
- *
+ *
* SPDX-License-Identifier: MIT
**************************************************************************/
/**************************************************************************/
/**************************************************************************/
-/** */
-/** USBX Component */
+/** */
+/** USBX Component */
/** */
/** Device Pima Class */
/** */
@@ -29,53 +30,39 @@
#include "ux_device_stack.h"
-/**************************************************************************/
-/* */
-/* FUNCTION RELEASE */
-/* */
-/* _ux_device_class_pima_storage_info_get PORTABLE C */
+/**************************************************************************/
+/* */
+/* FUNCTION RELEASE */
+/* */
+/* _ux_device_class_pima_storage_info_get PORTABLE C */
/* 6.1.12 */
/* AUTHOR */
/* */
/* Chaoqiong Xiao, Microsoft Corporation */
/* */
/* DESCRIPTION */
-/* */
-/* This function returns the storage info structure to the host. */
-/* */
-/* INPUT */
-/* */
-/* pima Pointer to pima class */
-/* */
-/* OUTPUT */
-/* */
-/* Completion Status */
-/* */
-/* CALLS */
-/* */
+/* */
+/* This function returns the storage info structure to the host. */
+/* */
+/* INPUT */
+/* */
+/* pima Pointer to pima class */
+/* */
+/* OUTPUT */
+/* */
+/* Completion Status */
+/* */
+/* CALLS */
+/* */
/* _ux_device_stack_transfer_request Transfer request */
/* _ux_utility_long_put Put 32-bit value */
/* _ux_utility_short_put Put 32-bit value */
/* _ux_utility_string_to_unicode Ascii string to unicode */
/* _ux_device_class_pima_response_send Send PIMA response */
-/* */
-/* CALLED BY */
-/* */
-/* Device Storage Class */
-/* */
-/* RELEASE HISTORY */
-/* */
-/* DATE NAME DESCRIPTION */
-/* */
-/* 05-19-2020 Chaoqiong Xiao Initial Version 6.0 */
-/* 09-30-2020 Chaoqiong Xiao Modified comment(s), */
-/* resulting in version 6.1 */
-/* 01-31-2022 Chaoqiong Xiao Modified comment(s), */
-/* improved sanity checks, */
-/* resulting in version 6.1.10 */
-/* 07-29-2022 Chaoqiong Xiao Modified comment(s), */
-/* added no-callback handling, */
-/* resulting in version 6.1.12 */
+/* */
+/* CALLED BY */
+/* */
+/* Device Storage Class */
/* */
/**************************************************************************/
UINT _ux_device_class_pima_storage_info_get(UX_SLAVE_CLASS_PIMA *pima, ULONG storage_id)
@@ -95,7 +82,7 @@ UCHAR *storage_info_pointer;
/* Obtain memory for this object info. Use the transfer request pre-allocated memory. */
storage_info = transfer_request -> ux_slave_transfer_request_data_pointer;
-
+
/* Update the storage information. We get the volatile parameters from the application. */
if (pima -> ux_device_class_pima_storage_info_get)
status = pima -> ux_device_class_pima_storage_info_get(pima, storage_id);
@@ -112,55 +99,55 @@ UCHAR *storage_info_pointer;
/* We return an error. */
_ux_device_class_pima_response_send(pima, status, 0, 0, 0, 0);
-
+
else
- {
+ {
/* Fill in the data container type. */
_ux_utility_short_put(storage_info + UX_DEVICE_CLASS_PIMA_DATA_HEADER_TYPE,
UX_DEVICE_CLASS_PIMA_CT_DATA_BLOCK);
-
+
/* Fill in the data code. */
_ux_utility_short_put(storage_info + UX_DEVICE_CLASS_PIMA_DATA_HEADER_CODE,
UX_DEVICE_CLASS_PIMA_OC_GET_STORAGE_INFO);
-
+
/* Fill in the Transaction ID. */
- _ux_utility_long_put(storage_info + UX_DEVICE_CLASS_PIMA_DATA_HEADER_TRANSACTION_ID,
+ _ux_utility_long_put(storage_info + UX_DEVICE_CLASS_PIMA_DATA_HEADER_TRANSACTION_ID,
pima -> ux_device_class_pima_transaction_id);
-
+
/* Allocate the device info pointer to the beginning of the dynamic storage info field. */
storage_info_pointer = storage_info + UX_DEVICE_CLASS_PIMA_STORAGE_FREE_STORAGE_DESCRIPTION;
-
+
/* Fill in the storage type. */
- _ux_utility_short_put(storage_info + UX_DEVICE_CLASS_PIMA_STORAGE_TYPE,
+ _ux_utility_short_put(storage_info + UX_DEVICE_CLASS_PIMA_STORAGE_TYPE,
(USHORT)pima -> ux_device_class_pima_storage_type);
-
+
/* Fill in the file system type. */
- _ux_utility_short_put(storage_info + UX_DEVICE_CLASS_PIMA_STORAGE_FILE_SYSTEM_TYPE,
+ _ux_utility_short_put(storage_info + UX_DEVICE_CLASS_PIMA_STORAGE_FILE_SYSTEM_TYPE,
(USHORT)pima -> ux_device_class_pima_storage_file_system_type);
-
+
/* Fill in the access capability. */
- _ux_utility_short_put(storage_info + UX_DEVICE_CLASS_PIMA_STORAGE_ACCESS_CAPABILITY,
+ _ux_utility_short_put(storage_info + UX_DEVICE_CLASS_PIMA_STORAGE_ACCESS_CAPABILITY,
(USHORT)pima -> ux_device_class_pima_storage_access_capability);
-
+
/* Fill in the low dword of max capacity. */
- _ux_utility_long_put(storage_info + UX_DEVICE_CLASS_PIMA_STORAGE_MAX_CAPACITY_LOW,
+ _ux_utility_long_put(storage_info + UX_DEVICE_CLASS_PIMA_STORAGE_MAX_CAPACITY_LOW,
pima -> ux_device_class_pima_storage_max_capacity_low);
-
+
/* Fill in the high dword of max capacity. */
- _ux_utility_long_put(storage_info + UX_DEVICE_CLASS_PIMA_STORAGE_MAX_CAPACITY_HIGH,
+ _ux_utility_long_put(storage_info + UX_DEVICE_CLASS_PIMA_STORAGE_MAX_CAPACITY_HIGH,
pima -> ux_device_class_pima_storage_max_capacity_high);
-
+
/* Fill in the low dword of free space. */
- _ux_utility_long_put(storage_info + UX_DEVICE_CLASS_PIMA_STORAGE_FREE_SPACE_LOW,
+ _ux_utility_long_put(storage_info + UX_DEVICE_CLASS_PIMA_STORAGE_FREE_SPACE_LOW,
pima -> ux_device_class_pima_storage_free_space_low);
-
+
/* Fill in the high dword of free space. */
- _ux_utility_long_put(storage_info + UX_DEVICE_CLASS_PIMA_STORAGE_FREE_SPACE_HIGH,
+ _ux_utility_long_put(storage_info + UX_DEVICE_CLASS_PIMA_STORAGE_FREE_SPACE_HIGH,
pima -> ux_device_class_pima_storage_free_space_high);
-
+
/* Fill in the free space in image. */
- _ux_utility_long_put(storage_info + UX_DEVICE_CLASS_PIMA_STORAGE_FREE_SPACE_IMAGE,
+ _ux_utility_long_put(storage_info + UX_DEVICE_CLASS_PIMA_STORAGE_FREE_SPACE_IMAGE,
pima -> ux_device_class_pima_storage_free_space_image);
/* Sanity check for buffer length. */
@@ -169,31 +156,31 @@ UCHAR *storage_info_pointer;
_ux_utility_string_length_get(pima -> ux_device_class_pima_storage_volume_label) * 2);
/* Fill in the storage description string. */
- _ux_utility_string_to_unicode(pima -> ux_device_class_pima_storage_description, storage_info_pointer);
-
+ _ux_utility_string_to_unicode(pima -> ux_device_class_pima_storage_description, storage_info_pointer);
+
/* Update the storage info pointer. */
storage_info_pointer += (ULONG) (*storage_info_pointer * 2) + 1;
-
+
/* Fill in the volume label string. */
- _ux_utility_string_to_unicode(pima -> ux_device_class_pima_storage_volume_label, storage_info_pointer);
-
+ _ux_utility_string_to_unicode(pima -> ux_device_class_pima_storage_volume_label, storage_info_pointer);
+
/* Update the storage info pointer. */
storage_info_pointer += (ULONG) (*storage_info_pointer* 2) + 1;
-
+
/* Compute the overall length of the storage info structure. */
storage_info_length = (ULONG) ((ALIGN_TYPE) storage_info_pointer - (ALIGN_TYPE) storage_info);
-
+
/* Fill in the size of the response header. */
- _ux_utility_long_put(storage_info + UX_DEVICE_CLASS_PIMA_DATA_HEADER_LENGTH,
+ _ux_utility_long_put(storage_info + UX_DEVICE_CLASS_PIMA_DATA_HEADER_LENGTH,
storage_info_length);
-
+
/* Send a data payload with the storage info data set. */
status = _ux_device_stack_transfer_request(transfer_request, storage_info_length, 0);
-
+
/* Now we return a response with success. */
_ux_device_class_pima_response_send(pima, UX_DEVICE_CLASS_PIMA_RC_OK, 0, 0, 0, 0);
}
-
+
/* Return completion status. */
return(status);
}
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 6fd82a4a..2f896dbb 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
@@ -1,17 +1,18 @@
/***************************************************************************
- * Copyright (c) 2024 Microsoft Corporation
- *
+ * Copyright (c) 2024 Microsoft Corporation
+ * Copyright (c) 2026-present Eclipse ThreadX contributors
+ *
* This program and the accompanying materials are made available under the
* terms of the MIT License which is available at
* https://opensource.org/licenses/MIT.
- *
+ *
* SPDX-License-Identifier: MIT
**************************************************************************/
/**************************************************************************/
/**************************************************************************/
-/** */
-/** USBX Component */
+/** */
+/** USBX Component */
/** */
/** Device PIMA Class */
/** */
@@ -29,37 +30,37 @@
#if !defined(UX_DEVICE_STANDALONE)
-/**************************************************************************/
-/* */
-/* FUNCTION RELEASE */
-/* */
-/* _ux_device_class_pima_thread PORTABLE C */
+/**************************************************************************/
+/* */
+/* FUNCTION RELEASE */
+/* */
+/* _ux_device_class_pima_thread PORTABLE C */
/* 6.1.11 */
/* AUTHOR */
/* */
/* Chaoqiong Xiao, Microsoft Corporation */
/* */
/* DESCRIPTION */
-/* */
-/* This function is the thread of the pima class. */
-/* */
-/* INPUT */
-/* */
-/* pima_class Address of pima class */
-/* container */
-/* */
-/* OUTPUT */
-/* */
-/* None */
-/* */
-/* CALLS */
-/* */
-/* _ux_device_stack_transfer_request Request transfer */
+/* */
+/* This function is the thread of the pima class. */
+/* */
+/* INPUT */
+/* */
+/* pima_class Address of pima class */
+/* container */
+/* */
+/* OUTPUT */
+/* */
+/* None */
+/* */
+/* CALLS */
+/* */
+/* _ux_device_stack_transfer_request Request transfer */
/* _ux_device_stack_endpoint_stall Stall endpoint */
-/* _ux_utility_memory_allocate Allocate memory */
+/* _ux_utility_memory_allocate Allocate memory */
/* _ux_device_semaphore_create Create semaphore */
/* _ux_device_thread_create Create thread */
-/* _ux_device_thread_suspend Suspend thread */
+/* _ux_device_thread_suspend Suspend thread */
/* _ux_utility_short_get Get 16-bit value */
/* _ux_utility_long_get Get 32-bit value */
/* _ux_device_class_pima_device_info_send */
@@ -100,29 +101,10 @@
/* _ux_device_class_pima_device_prop_value_set */
/* Set PIMA device property value*/
/* _ux_device_class_pima_response_send Send PIMA response */
-/* */
-/* CALLED BY */
-/* */
-/* ThreadX */
-/* */
-/* RELEASE HISTORY */
-/* */
-/* 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 */
-/* 01-31-2022 Chaoqiong Xiao Modified comment(s), */
-/* refined macros names, */
-/* updated phase states, */
-/* refined internal function, */
-/* resulting in version 6.1.10 */
-/* 04-25-2022 Chaoqiong Xiao Modified comment(s), */
-/* fixed standalone compile, */
-/* resulting in version 6.1.11 */
+/* */
+/* CALLED BY */
+/* */
+/* ThreadX */
/* */
/**************************************************************************/
VOID _ux_device_class_pima_thread(ULONG pima_class)
@@ -139,15 +121,15 @@ ULONG pima_parameter_2;
ULONG pima_parameter_3;
UINT status;
-
+
/* Cast properly the pima instance. */
UX_THREAD_EXTENSION_PTR_GET(class_ptr, UX_SLAVE_CLASS, pima_class)
-
+
/* Get the pima instance from this class container. */
pima = (UX_SLAVE_CLASS_PIMA *) class_ptr -> ux_slave_class_instance;
-
+
/* Allocate some memory for the thread stack. */
- pima -> ux_device_class_pima_interrupt_thread_stack =
+ pima -> ux_device_class_pima_interrupt_thread_stack =
_ux_utility_memory_allocate(UX_NO_ALIGN, UX_REGULAR_MEMORY, UX_THREAD_STACK_SIZE);
/* Check for successful allocation. */
@@ -156,7 +138,7 @@ UINT status;
/* Do not proceed. */
return;
- }
+ }
/* Allocate a semaphore to this thread. */
status = _ux_device_semaphore_create(&pima -> ux_device_class_pima_interrupt_thread_semaphore,
@@ -168,23 +150,23 @@ UINT status;
/* Do not proceed. */
return;
- }
-
+ }
+
/* The Pima device class needs 2 threads, one is activated by default for the command\response and one needs to be
created here for the interrupt pipe event. */
- status = _ux_device_thread_create(&pima -> ux_device_class_pima_interrupt_thread, "ux_slave_class_thread_pima_interrupt",
+ status = _ux_device_thread_create(&pima -> ux_device_class_pima_interrupt_thread, "ux_slave_class_thread_pima_interrupt",
_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, UX_AUTO_START);
-
+
/* Check the creation of this thread. */
if (status != UX_SUCCESS)
{
/* Do not proceed. */
return;
- }
+ }
UX_THREAD_EXTENSION_PTR_SET(&(pima -> ux_device_class_pima_interrupt_thread), pima)
@@ -195,64 +177,64 @@ UINT status;
/* Get the pointer to the device. */
device = &_ux_system_slave -> ux_system_slave_device;
-
+
/* All PIMA commands are on the endpoint OUT, from the host. */
transfer_request = &pima -> ux_device_class_pima_bulk_out_endpoint -> ux_slave_endpoint_transfer_request;
-
+
/* As long as the device is in the CONFIGURED state. */
while (device -> ux_slave_device_state == UX_DEVICE_CONFIGURED)
- {
-
+ {
+
/* Phase idle. */
pima -> ux_device_class_pima_state = UX_DEVICE_CLASS_PIMA_PHASE_IDLE;
/* Send the request to the device controller. */
status = _ux_device_stack_transfer_request(transfer_request, 64, 64);
-
- /* Check the status */
+
+ /* Check the status */
if (status == UX_SUCCESS)
{
/* Obtain the buffer address containing the PIMA command. */
pima_command = transfer_request -> ux_slave_transfer_request_data_pointer;
-
+
/* Check to make sure we have a command block. */
if (_ux_utility_short_get(pima_command + UX_DEVICE_CLASS_PIMA_COMMAND_HEADER_TYPE) == UX_DEVICE_CLASS_PIMA_CT_COMMAND_BLOCK)
{
/* Save the transaction ID. */
- pima -> ux_device_class_pima_transaction_id = _ux_utility_long_get(pima_command +
+ pima -> ux_device_class_pima_transaction_id = _ux_utility_long_get(pima_command +
UX_DEVICE_CLASS_PIMA_COMMAND_HEADER_TRANSACTION_ID);
/* Retrieve the command stored in the command block. */
pima_command_code = _ux_utility_short_get(pima_command + UX_DEVICE_CLASS_PIMA_COMMAND_HEADER_CODE);
-
+
/* Retrieve the parameter 1. */
pima_parameter_1 = _ux_utility_long_get(pima_command + UX_DEVICE_CLASS_PIMA_COMMAND_HEADER_PARAMETER_1);
-
+
/* Retrieve the parameter 2. */
pima_parameter_2 = _ux_utility_long_get(pima_command + UX_DEVICE_CLASS_PIMA_COMMAND_HEADER_PARAMETER_2);
-
+
/* Retrieve the parameter 3. */
pima_parameter_3 = _ux_utility_long_get(pima_command + UX_DEVICE_CLASS_PIMA_COMMAND_HEADER_PARAMETER_3);
-
+
/* Phase command. */
pima -> ux_device_class_pima_state = UX_DEVICE_CLASS_PIMA_PHASE_COMMAND;
- /* We check first if this is a GET_DEVICE_INFO as this is the only command which does not require
+ /* We check first if this is a GET_DEVICE_INFO as this is the only command which does not require
a session to be opened. */
-
+
switch (pima_command_code)
{
-
+
case UX_DEVICE_CLASS_PIMA_OC_GET_DEVICE_INFO :
/* Return the device info to the host. */
status = _ux_device_class_pima_device_info_send(pima);
- break;
+ break;
+
+ case UX_DEVICE_CLASS_PIMA_OC_OPEN_SESSION :
- case UX_DEVICE_CLASS_PIMA_OC_OPEN_SESSION :
-
/* If the first parameter is 0x00000000,
the operation should fail with a response of Invalid_Parameter.
If a session is already open, and the device does not support multiple sessions,
@@ -276,7 +258,7 @@ UINT status;
pima -> ux_device_class_pima_session_id, 0, 0, 0);
break;
}
-
+
/* Session can be opened. */
pima -> ux_device_class_pima_session_id = pima_parameter_1;
pima -> ux_device_class_pima_transaction_id = 0;
@@ -285,185 +267,185 @@ UINT status;
break;
default :
-
+
/* Check if a session is opened. */
if (pima -> ux_device_class_pima_session_id == 0)
{
-
+
/* We cannot proceed since the session is not opened. */
_ux_device_class_pima_response_send(pima, UX_DEVICE_CLASS_PIMA_RC_SESSION_NOT_OPEN, 0, 0, 0, 0);
}
else
{
-
+
/* Analyze the command stored in the command block. */
switch (pima_command_code)
{
-
- case UX_DEVICE_CLASS_PIMA_OC_CLOSE_SESSION :
-
+
+ case UX_DEVICE_CLASS_PIMA_OC_CLOSE_SESSION :
+
/* We close the session. Return OK. */
_ux_device_class_pima_response_send(pima, UX_DEVICE_CLASS_PIMA_RC_OK, 0, 0, 0, 0);
-
+
/* Session is now closed. */
pima -> ux_device_class_pima_session_id = 0;
break;
- case UX_DEVICE_CLASS_PIMA_OC_GET_STORAGE_IDS :
+ case UX_DEVICE_CLASS_PIMA_OC_GET_STORAGE_IDS :
/* Return the array of storage IDs to the host. In this version, we support
only one storage media. */
status = _ux_device_class_pima_storage_id_send(pima);
- break;
-
- case UX_DEVICE_CLASS_PIMA_OC_GET_STORAGE_INFO :
+ break;
+
+ case UX_DEVICE_CLASS_PIMA_OC_GET_STORAGE_INFO :
/* Return the storage info to the host. */
status = _ux_device_class_pima_storage_info_get(pima, pima_parameter_1);
- break;
+ break;
- case UX_DEVICE_CLASS_PIMA_OC_GET_NUM_OBJECTS :
+ case UX_DEVICE_CLASS_PIMA_OC_GET_NUM_OBJECTS :
/* Return the number of objects found in the system. */
- status = _ux_device_class_pima_objects_number_send(pima,
+ status = _ux_device_class_pima_objects_number_send(pima,
pima_parameter_1, pima_parameter_2, pima_parameter_3);
- break;
-
- case UX_DEVICE_CLASS_PIMA_OC_GET_OBJECT_HANDLES :
+ break;
+
+ case UX_DEVICE_CLASS_PIMA_OC_GET_OBJECT_HANDLES :
/* Return the object handles found in the system. */
- status = _ux_device_class_pima_object_handles_send(pima,
+ status = _ux_device_class_pima_object_handles_send(pima,
pima_parameter_1, pima_parameter_2, pima_parameter_3);
-
- break;
-
- case UX_DEVICE_CLASS_PIMA_OC_GET_OBJECT_INFO :
-
+
+ break;
+
+ case UX_DEVICE_CLASS_PIMA_OC_GET_OBJECT_INFO :
+
/* Return the object info data set. */
status = _ux_device_class_pima_object_info_get(pima, pima_parameter_1);
- break;
-
- case UX_DEVICE_CLASS_PIMA_OC_GET_OBJECT :
+ break;
+
+ case UX_DEVICE_CLASS_PIMA_OC_GET_OBJECT :
/* Return the object data. */
status = _ux_device_class_pima_object_data_get(pima, pima_parameter_1);
- break;
-
- case UX_DEVICE_CLASS_PIMA_OC_DELETE_OBJECT :
+ break;
+
+ case UX_DEVICE_CLASS_PIMA_OC_DELETE_OBJECT :
/* Delete one or more objects. */
status = _ux_device_class_pima_object_delete(pima, pima_parameter_1, pima_parameter_2);
- break;
-
- case UX_DEVICE_CLASS_PIMA_OC_SEND_OBJECT_INFO :
+ break;
+
+ case UX_DEVICE_CLASS_PIMA_OC_SEND_OBJECT_INFO :
/* Accept an object info data set. */
status = _ux_device_class_pima_object_info_send(pima, pima_parameter_1, pima_parameter_2);
- break;
-
- case UX_DEVICE_CLASS_PIMA_OC_SEND_OBJECT :
+ break;
+
+ case UX_DEVICE_CLASS_PIMA_OC_SEND_OBJECT :
/* Accept the object data. */
status = _ux_device_class_pima_object_data_send(pima);
- break;
-
- case UX_DEVICE_CLASS_PIMA_OC_GET_PARTIAL_OBJECT :
+ break;
+
+ case UX_DEVICE_CLASS_PIMA_OC_GET_PARTIAL_OBJECT :
/* Return the partial object data. */
status = _ux_device_class_pima_partial_object_data_get(pima, pima_parameter_1, pima_parameter_2, pima_parameter_3);
- break;
+ break;
- case UX_DEVICE_CLASS_PIMA_OC_FORMAT_STORE :
+ case UX_DEVICE_CLASS_PIMA_OC_FORMAT_STORE :
/* Format the storage device. This calls the application to reset all object handles stored
on the media. */
status = _ux_device_class_pima_storage_format(pima, pima_parameter_1);
break;
- case UX_DEVICE_CLASS_PIMA_OC_RESET_DEVICE :
+ case UX_DEVICE_CLASS_PIMA_OC_RESET_DEVICE :
/* Reset the device. This calls the application to reset the device. The session is closed
but all objects retain their properties. */
status = _ux_device_class_pima_device_reset(pima);
break;
-
- case UX_DEVICE_CLASS_PIMA_OC_GET_OBJECT_PROPS_SUPPORTED :
- /* Return an Object Property Code array of supported object properties for the object format that is indicated
+ case UX_DEVICE_CLASS_PIMA_OC_GET_OBJECT_PROPS_SUPPORTED :
+
+ /* Return an Object Property Code array of supported object properties for the object format that is indicated
in the first parameter. */
status = _ux_device_class_pima_object_props_supported_get(pima, pima_parameter_1);
break;
- case UX_DEVICE_CLASS_PIMA_OC_GET_OBJECT_PROP_DESC :
+ case UX_DEVICE_CLASS_PIMA_OC_GET_OBJECT_PROP_DESC :
/* Returns the appropriate property that describes the dataset that is indicated in the first parameter. */
status = _ux_device_class_pima_object_prop_desc_get(pima, pima_parameter_1, pima_parameter_2);
break;
- case UX_DEVICE_CLASS_PIMA_OC_GET_OBJECT_PROP_VALUE :
+ case UX_DEVICE_CLASS_PIMA_OC_GET_OBJECT_PROP_VALUE :
/* Returns the Object property value. */
status = _ux_device_class_pima_object_prop_value_get(pima, pima_parameter_1, pima_parameter_2);
break;
- case UX_DEVICE_CLASS_PIMA_OC_SET_OBJECT_PROP_VALUE :
+ case UX_DEVICE_CLASS_PIMA_OC_SET_OBJECT_PROP_VALUE :
/* Sets the current value of the object property. */
status = _ux_device_class_pima_object_prop_value_set(pima, pima_parameter_1, pima_parameter_2);
break;
- case UX_DEVICE_CLASS_PIMA_OC_GET_OBJECT_REFERENCES :
+ case UX_DEVICE_CLASS_PIMA_OC_GET_OBJECT_REFERENCES :
/* Returns the object handle references. */
status = _ux_device_class_pima_object_references_get(pima, pima_parameter_1);
break;
- case UX_DEVICE_CLASS_PIMA_OC_SET_OBJECT_REFERENCES :
+ case UX_DEVICE_CLASS_PIMA_OC_SET_OBJECT_REFERENCES :
/* Set the object handle references. */
status = _ux_device_class_pima_object_references_set(pima, pima_parameter_1);
break;
- case UX_DEVICE_CLASS_PIMA_OC_GET_DEVICE_PROP_DESC :
+ case UX_DEVICE_CLASS_PIMA_OC_GET_DEVICE_PROP_DESC :
/* Returns the appropriate device property. */
status = _ux_device_class_pima_device_prop_desc_get(pima, pima_parameter_1);
break;
- case UX_DEVICE_CLASS_PIMA_OC_GET_DEVICE_PROP_VALUE :
+ case UX_DEVICE_CLASS_PIMA_OC_GET_DEVICE_PROP_VALUE :
/* Returns the device property value. */
status = _ux_device_class_pima_device_prop_value_get(pima, pima_parameter_1);
break;
- case UX_DEVICE_CLASS_PIMA_OC_SET_DEVICE_PROP_VALUE :
+ case UX_DEVICE_CLASS_PIMA_OC_SET_DEVICE_PROP_VALUE :
/* Sets the current value of the device property. */
status = _ux_device_class_pima_device_prop_value_set(pima, pima_parameter_1);
break;
- case UX_DEVICE_CLASS_PIMA_OC_INITIATE_OPEN_CAPTURE :
- case UX_DEVICE_CLASS_PIMA_OC_GET_THUMB :
- case UX_DEVICE_CLASS_PIMA_OC_INITIATE_CAPTURE :
- case UX_DEVICE_CLASS_PIMA_OC_SELF_TEST :
- case UX_DEVICE_CLASS_PIMA_OC_SET_OBJECT_PROTECTION :
- case UX_DEVICE_CLASS_PIMA_OC_POWER_DOWN :
- case UX_DEVICE_CLASS_PIMA_OC_RESET_DEVICE_PROP_VALUE :
- case UX_DEVICE_CLASS_PIMA_OC_TERMINATE_OPEN_CAPTURE :
- case UX_DEVICE_CLASS_PIMA_OC_MOVE_OBJECT :
- case UX_DEVICE_CLASS_PIMA_OC_COPY_OBJECT :
+ case UX_DEVICE_CLASS_PIMA_OC_INITIATE_OPEN_CAPTURE :
+ case UX_DEVICE_CLASS_PIMA_OC_GET_THUMB :
+ case UX_DEVICE_CLASS_PIMA_OC_INITIATE_CAPTURE :
+ case UX_DEVICE_CLASS_PIMA_OC_SELF_TEST :
+ case UX_DEVICE_CLASS_PIMA_OC_SET_OBJECT_PROTECTION :
+ case UX_DEVICE_CLASS_PIMA_OC_POWER_DOWN :
+ case UX_DEVICE_CLASS_PIMA_OC_RESET_DEVICE_PROP_VALUE :
+ case UX_DEVICE_CLASS_PIMA_OC_TERMINATE_OPEN_CAPTURE :
+ case UX_DEVICE_CLASS_PIMA_OC_MOVE_OBJECT :
+ case UX_DEVICE_CLASS_PIMA_OC_COPY_OBJECT :
/* Functions not yet supported. */
_ux_device_class_pima_response_send(pima, UX_DEVICE_CLASS_PIMA_RC_OPERATION_NOT_SUPPORTED, 0, 0, 0, 0);
/* Set error code. */
status = UX_FUNCTION_NOT_SUPPORTED;
-
+
break;
default:
-
- /* The command is unknown, so we stall the endpoint. */
+
+ /* The command is unknown, so we stall the endpoint. */
_ux_device_stack_endpoint_stall(pima -> ux_device_class_pima_bulk_out_endpoint);
}
@@ -475,7 +457,7 @@ UINT status;
}
}
-
+
/* Check error code. */
if (status != UX_SUCCESS)
@@ -483,8 +465,8 @@ UINT status;
_ux_system_error_handler(UX_SYSTEM_LEVEL_THREAD, UX_SYSTEM_CONTEXT_CLASS, status);
}
else
-
- /* We have a wrong buffer format. Stall the endpoint. */
+
+ /* We have a wrong buffer format. Stall the endpoint. */
_ux_device_stack_endpoint_stall(pima -> ux_device_class_pima_bulk_out_endpoint);
}
}
diff --git a/common/usbx_device_classes/src/ux_device_class_pima_uninitialize.c b/common/usbx_device_classes/src/ux_device_class_pima_uninitialize.c
index 07185d94..f13f02a8 100644
--- a/common/usbx_device_classes/src/ux_device_class_pima_uninitialize.c
+++ b/common/usbx_device_classes/src/ux_device_class_pima_uninitialize.c
@@ -1,5 +1,6 @@
/***************************************************************************
* Copyright (c) 2024 Microsoft Corporation
+ * Copyright (c) 2026-present Eclipse ThreadX contributors
*
* This program and the accompanying materials are made available under the
* terms of the MIT License which is available at
@@ -60,12 +61,6 @@
/* */
/* USBX Source Code */
/* */
-/* RELEASE HISTORY */
-/* */
-/* DATE NAME DESCRIPTION */
-/* */
-/* xx-xx-xxxx Chaoqiong Xiao Initial Version 6.x */
-/* */
/**************************************************************************/
UINT _ux_device_class_pima_uninitialize(UX_SLAVE_CLASS_COMMAND *command)
{
diff --git a/common/usbx_device_classes/src/ux_device_class_printer_activate.c b/common/usbx_device_classes/src/ux_device_class_printer_activate.c
index 6e235494..18995cef 100644
--- a/common/usbx_device_classes/src/ux_device_class_printer_activate.c
+++ b/common/usbx_device_classes/src/ux_device_class_printer_activate.c
@@ -1,10 +1,11 @@
/***************************************************************************
- * Copyright (c) 2024 Microsoft Corporation
- *
+ * Copyright (c) 2024 Microsoft Corporation
+ * Copyright (c) 2026-present Eclipse ThreadX contributors
+ *
* This program and the accompanying materials are made available under the
* terms of the MIT License which is available at
* https://opensource.org/licenses/MIT.
- *
+ *
* SPDX-License-Identifier: MIT
**************************************************************************/
@@ -58,20 +59,6 @@
/* */
/* Device Printer Class */
/* */
-/* RELEASE HISTORY */
-/* */
-/* DATE NAME DESCRIPTION */
-/* */
-/* 01-31-2022 Chaoqiong Xiao Initial Version 6.1.10 */
-/* 07-29-2022 Chaoqiong Xiao Modified comment(s), */
-/* fixed parameter/variable */
-/* names conflict C++ keyword, */
-/* resulting in version 6.1.12 */
-/* 10-31-2023 Chaoqiong Xiao Modified comment(s), */
-/* added a new mode to manage */
-/* endpoint buffer in classes, */
-/* resulting in version 6.3.0 */
-/* */
/**************************************************************************/
UINT _ux_device_class_printer_activate(UX_SLAVE_CLASS_COMMAND *command)
{
diff --git a/common/usbx_device_classes/src/ux_device_class_printer_control_request.c b/common/usbx_device_classes/src/ux_device_class_printer_control_request.c
index 7314fe27..255522a8 100644
--- a/common/usbx_device_classes/src/ux_device_class_printer_control_request.c
+++ b/common/usbx_device_classes/src/ux_device_class_printer_control_request.c
@@ -1,10 +1,11 @@
/***************************************************************************
- * Copyright (c) 2024 Microsoft Corporation
- *
+ * Copyright (c) 2024 Microsoft Corporation
+ * Copyright (c) 2026-present Eclipse ThreadX contributors
+ *
* This program and the accompanying materials are made available under the
* terms of the MIT License which is available at
* https://opensource.org/licenses/MIT.
- *
+ *
* SPDX-License-Identifier: MIT
**************************************************************************/
@@ -63,16 +64,6 @@
/* */
/* Device Printer Class */
/* */
-/* RELEASE HISTORY */
-/* */
-/* DATE NAME DESCRIPTION */
-/* */
-/* 01-31-2022 Chaoqiong Xiao Initial Version 6.1.10 */
-/* 07-29-2022 Chaoqiong Xiao Modified comment(s), */
-/* fixed parameter/variable */
-/* names conflict C++ keyword, */
-/* resulting in version 6.1.12 */
-/* */
/**************************************************************************/
UINT _ux_device_class_printer_control_request(UX_SLAVE_CLASS_COMMAND *command)
{
diff --git a/common/usbx_device_classes/src/ux_device_class_printer_deactivate.c b/common/usbx_device_classes/src/ux_device_class_printer_deactivate.c
index 36a5f25b..ce537663 100644
--- a/common/usbx_device_classes/src/ux_device_class_printer_deactivate.c
+++ b/common/usbx_device_classes/src/ux_device_class_printer_deactivate.c
@@ -1,10 +1,11 @@
/***************************************************************************
- * Copyright (c) 2024 Microsoft Corporation
- *
+ * Copyright (c) 2024 Microsoft Corporation
+ * Copyright (c) 2026-present Eclipse ThreadX contributors
+ *
* This program and the accompanying materials are made available under the
* terms of the MIT License which is available at
* https://opensource.org/licenses/MIT.
- *
+ *
* SPDX-License-Identifier: MIT
**************************************************************************/
@@ -60,12 +61,6 @@
/* */
/* Device Printer Class */
/* */
-/* RELEASE HISTORY */
-/* */
-/* DATE NAME DESCRIPTION */
-/* */
-/* 01-31-2022 Chaoqiong Xiao Initial Version 6.1.10 */
-/* */
/**************************************************************************/
UINT _ux_device_class_printer_deactivate(UX_SLAVE_CLASS_COMMAND *command)
{
diff --git a/common/usbx_device_classes/src/ux_device_class_printer_entry.c b/common/usbx_device_classes/src/ux_device_class_printer_entry.c
index f4fafbd3..b7e0b2c3 100644
--- a/common/usbx_device_classes/src/ux_device_class_printer_entry.c
+++ b/common/usbx_device_classes/src/ux_device_class_printer_entry.c
@@ -1,5 +1,6 @@
/***************************************************************************
* Copyright (c) 2024 Microsoft Corporation
+ * Copyright (c) 2026-present Eclipse ThreadX contributors
*
* This program and the accompanying materials are made available under the
* terms of the MIT License which is available at
@@ -66,18 +67,6 @@
/* */
/* Device Stack */
/* */
-/* RELEASE HISTORY */
-/* */
-/* DATE NAME DESCRIPTION */
-/* */
-/* 01-31-2022 Chaoqiong Xiao Initial Version 6.1.10 */
-/* 03-08-2023 Yajun Xia Modified comment(s), */
-/* added error checks support, */
-/* resulting in version 6.2.1 */
-/* xx-xx-xxxx Mohamed ayed Modified comment(s), */
-/* fix typo, */
-/* resulting in version 6.x */
-/* */
/**************************************************************************/
UINT _ux_device_class_printer_entry(UX_SLAVE_CLASS_COMMAND *command)
{
diff --git a/common/usbx_device_classes/src/ux_device_class_printer_initialize.c b/common/usbx_device_classes/src/ux_device_class_printer_initialize.c
index 0934d6ae..5b41a1e1 100644
--- a/common/usbx_device_classes/src/ux_device_class_printer_initialize.c
+++ b/common/usbx_device_classes/src/ux_device_class_printer_initialize.c
@@ -1,10 +1,11 @@
/***************************************************************************
- * Copyright (c) 2024 Microsoft Corporation
- *
+ * Copyright (c) 2024 Microsoft Corporation
+ * Copyright (c) 2026-present Eclipse ThreadX contributors
+ *
* This program and the accompanying materials are made available under the
* terms of the MIT License which is available at
* https://opensource.org/licenses/MIT.
- *
+ *
* SPDX-License-Identifier: MIT
**************************************************************************/
@@ -60,22 +61,6 @@
/* */
/* Device Stack */
/* */
-/* RELEASE HISTORY */
-/* */
-/* DATE NAME DESCRIPTION */
-/* */
-/* 01-31-2022 Chaoqiong Xiao Initial Version 6.1.10 */
-/* 04-25-2022 Chaoqiong Xiao Modified comment(s), */
-/* fixed standalone compile, */
-/* resulting in version 6.1.11 */
-/* 10-31-2022 Yajun Xia Modified comment(s), */
-/* added standalone support, */
-/* resulting in version 6.2.0 */
-/* 10-31-2023 Chaoqiong Xiao Modified comment(s), */
-/* added a new mode to manage */
-/* endpoint buffer in classes, */
-/* resulting in version 6.3.0 */
-/* */
/**************************************************************************/
UINT _ux_device_class_printer_initialize(UX_SLAVE_CLASS_COMMAND *command)
{
@@ -201,12 +186,6 @@ UINT status;
/* */
/* Device Stack */
/* */
-/* RELEASE HISTORY */
-/* */
-/* DATE NAME DESCRIPTION */
-/* */
-/* 03-08-2023 Yajun Xia Initial Version 6.2.1 */
-/* */
/**************************************************************************/
UINT _uxe_device_class_printer_initialize(UX_SLAVE_CLASS_COMMAND *command)
{
diff --git a/common/usbx_device_classes/src/ux_device_class_printer_ioctl.c b/common/usbx_device_classes/src/ux_device_class_printer_ioctl.c
index 6f0ed629..87cb9c3c 100644
--- a/common/usbx_device_classes/src/ux_device_class_printer_ioctl.c
+++ b/common/usbx_device_classes/src/ux_device_class_printer_ioctl.c
@@ -1,10 +1,11 @@
/***************************************************************************
- * Copyright (c) 2024 Microsoft Corporation
- *
+ * Copyright (c) 2024 Microsoft Corporation
+ * Copyright (c) 2026-present Eclipse ThreadX contributors
+ *
* This program and the accompanying materials are made available under the
* terms of the MIT License which is available at
* https://opensource.org/licenses/MIT.
- *
+ *
* SPDX-License-Identifier: MIT
**************************************************************************/
@@ -61,14 +62,6 @@
/* */
/* Application */
/* */
-/* RELEASE HISTORY */
-/* */
-/* DATE NAME DESCRIPTION */
-/* */
-/* 01-31-2022 Chaoqiong Xiao Initial Version 6.1.10 */
-/* 03-08-2023 Yajun Xia Modified comment(s), */
-/* resulting in version 6.2.1 */
-/* */
/**************************************************************************/
UINT _ux_device_class_printer_ioctl(UX_DEVICE_CLASS_PRINTER *printer, ULONG ioctl_function,
VOID *parameter)
@@ -161,12 +154,6 @@ UX_SLAVE_TRANSFER *transfer;
/* */
/* Application */
/* */
-/* RELEASE HISTORY */
-/* */
-/* DATE NAME DESCRIPTION */
-/* */
-/* 03-08-2023 Yajun Xia Initial Version 6.2.1 */
-/* */
/**************************************************************************/
UINT _uxe_device_class_printer_ioctl(UX_DEVICE_CLASS_PRINTER *printer, ULONG ioctl_function,
VOID *parameter)
diff --git a/common/usbx_device_classes/src/ux_device_class_printer_read.c b/common/usbx_device_classes/src/ux_device_class_printer_read.c
index 05a06b23..68ae5947 100644
--- a/common/usbx_device_classes/src/ux_device_class_printer_read.c
+++ b/common/usbx_device_classes/src/ux_device_class_printer_read.c
@@ -1,10 +1,11 @@
/***************************************************************************
- * Copyright (c) 2024 Microsoft Corporation
- *
+ * Copyright (c) 2024 Microsoft Corporation
+ * Copyright (c) 2026-present Eclipse ThreadX contributors
+ *
* This program and the accompanying materials are made available under the
* terms of the MIT License which is available at
* https://opensource.org/licenses/MIT.
- *
+ *
* SPDX-License-Identifier: MIT
**************************************************************************/
@@ -66,15 +67,6 @@
/* */
/* Application */
/* */
-/* RELEASE HISTORY */
-/* */
-/* DATE NAME DESCRIPTION */
-/* */
-/* 01-31-2022 Chaoqiong Xiao Initial Version 6.1.10 */
-/* 04-25-2022 Chaoqiong Xiao Modified comment(s), */
-/* fixed standalone compile, */
-/* resulting in version 6.1.11 */
-/* */
/**************************************************************************/
UINT _ux_device_class_printer_read(UX_DEVICE_CLASS_PRINTER *printer, UCHAR *buffer,
ULONG requested_length, ULONG *actual_length)
@@ -253,15 +245,6 @@ ULONG local_requested_length;
/* */
/* Application */
/* */
-/* RELEASE HISTORY */
-/* */
-/* DATE NAME DESCRIPTION */
-/* */
-/* 03-08-2023 Yajun Xia Initial Version 6.2.1 */
-/* 10-31-2023 Yajun Xia Modified comment(s), */
-/* fixed error checking issue, */
-/* resulting in version 6.3.0 */
-/* */
/**************************************************************************/
UINT _uxe_device_class_printer_read(UX_DEVICE_CLASS_PRINTER *printer, UCHAR *buffer,
ULONG requested_length, ULONG *actual_length)
diff --git a/common/usbx_device_classes/src/ux_device_class_printer_read_run.c b/common/usbx_device_classes/src/ux_device_class_printer_read_run.c
index e07bf23b..27df75cb 100644
--- a/common/usbx_device_classes/src/ux_device_class_printer_read_run.c
+++ b/common/usbx_device_classes/src/ux_device_class_printer_read_run.c
@@ -1,10 +1,11 @@
/***************************************************************************
- * Copyright (c) 2024 Microsoft Corporation
- *
+ * Copyright (c) 2024 Microsoft Corporation
+ * Copyright (c) 2026-present Eclipse ThreadX contributors
+ *
* This program and the accompanying materials are made available under the
* terms of the MIT License which is available at
* https://opensource.org/licenses/MIT.
- *
+ *
* SPDX-License-Identifier: MIT
**************************************************************************/
@@ -73,12 +74,6 @@
/* */
/* Application */
/* */
-/* RELEASE HISTORY */
-/* */
-/* DATE NAME DESCRIPTION */
-/* */
-/* 10-31-2022 Yajun xia Initial Version 6.2.0 */
-/* */
/**************************************************************************/
UINT _ux_device_class_printer_read_run(UX_DEVICE_CLASS_PRINTER *printer, UCHAR *buffer,
ULONG requested_length, ULONG *actual_length)
@@ -124,10 +119,10 @@ UINT status = UX_SUCCESS;
/* Run the transfer state machine. */
if (printer -> ux_device_class_printer_read_state == UX_STATE_RESET)
{
-
+
/* If trace is enabled, insert this event into the trace buffer. */
UX_TRACE_IN_LINE_INSERT(UX_TRACE_DEVICE_CLASS_PRINTER_READ, printer, buffer, requested_length, 0, UX_TRACE_DEVICE_CLASS_EVENTS, 0, 0)
-
+
printer -> ux_device_class_printer_read_state = UX_DEVICE_CLASS_PRINTER_READ_START;
printer -> ux_device_class_printer_read_status = UX_TRANSFER_NO_ANSWER;
transfer_request -> ux_slave_transfer_request_data_pointer = buffer;
@@ -324,12 +319,6 @@ UINT status = UX_SUCCESS;
/* */
/* Application */
/* */
-/* RELEASE HISTORY */
-/* */
-/* DATE NAME DESCRIPTION */
-/* */
-/* 10-31-2023 Yajun xia Initial Version 6.3.0 */
-/* */
/**************************************************************************/
UINT _uxe_device_class_printer_read_run(UX_DEVICE_CLASS_PRINTER *printer, UCHAR *buffer,
ULONG requested_length, ULONG *actual_length)
diff --git a/common/usbx_device_classes/src/ux_device_class_printer_soft_reset.c b/common/usbx_device_classes/src/ux_device_class_printer_soft_reset.c
index 86265582..5590b61c 100644
--- a/common/usbx_device_classes/src/ux_device_class_printer_soft_reset.c
+++ b/common/usbx_device_classes/src/ux_device_class_printer_soft_reset.c
@@ -1,10 +1,11 @@
/***************************************************************************
- * Copyright (c) 2024 Microsoft Corporation
- *
+ * Copyright (c) 2024 Microsoft Corporation
+ * Copyright (c) 2026-present Eclipse ThreadX contributors
+ *
* This program and the accompanying materials are made available under the
* terms of the MIT License which is available at
* https://opensource.org/licenses/MIT.
- *
+ *
* SPDX-License-Identifier: MIT
**************************************************************************/
@@ -60,15 +61,6 @@
/* */
/* Device Printer Class */
/* */
-/* RELEASE HISTORY */
-/* */
-/* DATE NAME DESCRIPTION */
-/* */
-/* 01-31-2022 Chaoqiong Xiao Initial Version 6.1.10 */
-/* 10-31-2022 Yajun Xia Modified comment(s), */
-/* added standalone support, */
-/* resulting in version 6.2.0 */
-/* */
/**************************************************************************/
VOID _ux_device_class_printer_soft_reset(UX_DEVICE_CLASS_PRINTER *printer)
{
diff --git a/common/usbx_device_classes/src/ux_device_class_printer_uninitialize.c b/common/usbx_device_classes/src/ux_device_class_printer_uninitialize.c
index 6d4fcf5d..17376c6e 100644
--- a/common/usbx_device_classes/src/ux_device_class_printer_uninitialize.c
+++ b/common/usbx_device_classes/src/ux_device_class_printer_uninitialize.c
@@ -1,10 +1,11 @@
/***************************************************************************
- * Copyright (c) 2024 Microsoft Corporation
- *
+ * Copyright (c) 2024 Microsoft Corporation
+ * Copyright (c) 2026-present Eclipse ThreadX contributors
+ *
* This program and the accompanying materials are made available under the
* terms of the MIT License which is available at
* https://opensource.org/licenses/MIT.
- *
+ *
* SPDX-License-Identifier: MIT
**************************************************************************/
@@ -59,26 +60,6 @@
/* */
/* Device Printer Class */
/* */
-/* RELEASE HISTORY */
-/* */
-/* DATE NAME DESCRIPTION */
-/* */
-/* 01-31-2022 Chaoqiong Xiao Initial Version 6.1.10 */
-/* 04-25-2022 Chaoqiong Xiao Modified comment(s), */
-/* fixed standalone compile, */
-/* resulting in version 6.1.11 */
-/* 07-29-2022 Chaoqiong Xiao Modified comment(s), */
-/* fixed parameter/variable */
-/* names conflict C++ keyword, */
-/* resulting in version 6.1.12 */
-/* 10-31-2022 Yajun Xia Modified comment(s), */
-/* added standalone support, */
-/* resulting in version 6.2.0 */
-/* 10-31-2023 Chaoqiong Xiao Modified comment(s), */
-/* added a new mode to manage */
-/* endpoint buffer in classes, */
-/* resulting in version 6.3.0 */
-/* */
/**************************************************************************/
UINT _ux_device_class_printer_uninitialize(UX_SLAVE_CLASS_COMMAND *command)
{
diff --git a/common/usbx_device_classes/src/ux_device_class_printer_write.c b/common/usbx_device_classes/src/ux_device_class_printer_write.c
index 2534aab4..39cd0395 100644
--- a/common/usbx_device_classes/src/ux_device_class_printer_write.c
+++ b/common/usbx_device_classes/src/ux_device_class_printer_write.c
@@ -1,10 +1,11 @@
/***************************************************************************
- * Copyright (c) 2024 Microsoft Corporation
- *
+ * Copyright (c) 2024 Microsoft Corporation
+ * Copyright (c) 2026-present Eclipse ThreadX contributors
+ *
* This program and the accompanying materials are made available under the
* terms of the MIT License which is available at
* https://opensource.org/licenses/MIT.
- *
+ *
* SPDX-License-Identifier: MIT
**************************************************************************/
@@ -67,22 +68,6 @@
/* */
/* Application */
/* */
-/* RELEASE HISTORY */
-/* */
-/* DATE NAME DESCRIPTION */
-/* */
-/* 01-31-2022 Chaoqiong Xiao Initial Version 6.1.10 */
-/* 04-25-2022 Chaoqiong Xiao Modified comment(s), */
-/* fixed standalone compile, */
-/* resulting in version 6.1.11 */
-/* 07-29-2022 Chaoqiong Xiao Modified comment(s), */
-/* added auto ZLP support, */
-/* resulting in version 6.1.12 */
-/* 10-31-2023 Chaoqiong Xiao Modified comment(s), */
-/* added a new mode to manage */
-/* endpoint buffer in classes, */
-/* resulting in version 6.3.0 */
-/* */
/**************************************************************************/
UINT _ux_device_class_printer_write(UX_DEVICE_CLASS_PRINTER *printer, UCHAR *buffer,
ULONG requested_length, ULONG *actual_length)
@@ -288,15 +273,6 @@ UINT status = 0;
/* */
/* Application */
/* */
-/* RELEASE HISTORY */
-/* */
-/* DATE NAME DESCRIPTION */
-/* */
-/* 03-08-2023 Yajun Xia Initial Version 6.2.1 */
-/* 10-31-2023 Yajun Xia Modified comment(s), */
-/* fixed error checking issue, */
-/* resulting in version 6.3.0 */
-/* */
/**************************************************************************/
UINT _uxe_device_class_printer_write(UX_DEVICE_CLASS_PRINTER *printer, UCHAR *buffer,
ULONG requested_length, ULONG *actual_length)
diff --git a/common/usbx_device_classes/src/ux_device_class_printer_write_run.c b/common/usbx_device_classes/src/ux_device_class_printer_write_run.c
index 70c4feb5..e2195330 100644
--- a/common/usbx_device_classes/src/ux_device_class_printer_write_run.c
+++ b/common/usbx_device_classes/src/ux_device_class_printer_write_run.c
@@ -1,10 +1,11 @@
/***************************************************************************
- * Copyright (c) 2024 Microsoft Corporation
- *
+ * Copyright (c) 2024 Microsoft Corporation
+ * Copyright (c) 2026-present Eclipse ThreadX contributors
+ *
* This program and the accompanying materials are made available under the
* terms of the MIT License which is available at
* https://opensource.org/licenses/MIT.
- *
+ *
* SPDX-License-Identifier: MIT
**************************************************************************/
@@ -72,16 +73,6 @@
/* */
/* Application */
/* */
-/* RELEASE HISTORY */
-/* */
-/* DATE NAME DESCRIPTION */
-/* */
-/* 10-31-2022 Yajun Xia Initial Version 6.2.0 */
-/* 10-31-2023 Chaoqiong Xiao Modified comment(s), */
-/* added a new mode to manage */
-/* endpoint buffer in classes, */
-/* resulting in version 6.3.0 */
-/* */
/**************************************************************************/
UINT _ux_device_class_printer_write_run(UX_DEVICE_CLASS_PRINTER *printer, UCHAR *buffer,
ULONG requested_length, ULONG *actual_length)
@@ -240,7 +231,7 @@ UINT zlp = UX_FALSE;
/* 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,
+ _ux_utility_memory_copy(transfer_request -> ux_slave_transfer_request_data_pointer,
printer -> ux_device_class_printer_write_buffer,
printer -> ux_device_class_printer_write_transfer_length); /* Use case of memcpy is verified. */
@@ -351,12 +342,6 @@ UINT zlp = UX_FALSE;
/* */
/* Application */
/* */
-/* RELEASE HISTORY */
-/* */
-/* DATE NAME DESCRIPTION */
-/* */
-/* 10-31-2023 Yajun xia Initial Version 6.3.0 */
-/* */
/**************************************************************************/
UINT _uxe_device_class_printer_write_run(UX_DEVICE_CLASS_PRINTER *printer, UCHAR *buffer,
ULONG requested_length, ULONG *actual_length)
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 4bb0adf5..4c1495dd 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
@@ -1,16 +1,17 @@
/***************************************************************************
- * Copyright (c) 2024 Microsoft Corporation
- *
+ * Copyright (c) 2024 Microsoft Corporation
+ * Copyright (c) 2026-present Eclipse ThreadX contributors
+ *
* This program and the accompanying materials are made available under the
* terms of the MIT License which is available at
* https://opensource.org/licenses/MIT.
- *
+ *
* SPDX-License-Identifier: MIT
**************************************************************************/
/**************************************************************************/
-/** */
-/** USBX Component */
+/** */
+/** USBX Component */
/** */
/** Device RNDIS Class */
/** */
@@ -27,62 +28,37 @@
#include "ux_device_stack.h"
-/**************************************************************************/
-/* */
-/* FUNCTION RELEASE */
-/* */
-/* _ux_device_class_rndis_activate PORTABLE C */
+/**************************************************************************/
+/* */
+/* FUNCTION RELEASE */
+/* */
+/* _ux_device_class_rndis_activate PORTABLE C */
/* 6.3.0 */
/* AUTHOR */
/* */
/* Chaoqiong Xiao, Microsoft Corporation */
/* */
/* DESCRIPTION */
-/* */
-/* This function activates the USB RNDIS device. */
-/* */
-/* INPUT */
-/* */
-/* command Pointer to rndis command */
-/* */
-/* OUTPUT */
-/* */
-/* Completion Status */
-/* */
-/* CALLS */
-/* */
+/* */
+/* This function activates the USB RNDIS device. */
+/* */
+/* INPUT */
+/* */
+/* command Pointer to rndis command */
+/* */
+/* OUTPUT */
+/* */
+/* Completion Status */
+/* */
+/* CALLS */
+/* */
/* _ux_network_driver_activate Activate NetX USB interface */
/* _ux_utility_memory_set Set memory */
/* _ux_device_thread_resume Resume thread */
-/* */
-/* CALLED BY */
-/* */
-/* USBX Source Code */
-/* */
-/* RELEASE HISTORY */
-/* */
-/* DATE NAME DESCRIPTION */
-/* */
-/* 05-19-2020 Chaoqiong Xiao Initial Version 6.0 */
-/* 09-30-2020 Chaoqiong Xiao Modified comment(s), */
-/* verified memset and memcpy */
-/* cases, */
-/* resulting in version 6.1 */
-/* 01-31-2022 Chaoqiong Xiao Modified comment(s), */
-/* refined macros names, */
-/* resulting in version 6.1.10 */
-/* 04-25-2022 Chaoqiong Xiao Modified comment(s), */
-/* fixed standalone compile, */
-/* resulting in version 6.1.11 */
-/* 07-29-2022 Chaoqiong Xiao Modified comment(s), */
-/* fixed parameter/variable */
-/* names conflict C++ keyword, */
-/* resulting in version 6.1.12 */
-/* 10-31-2023 Chaoqiong Xiao Modified comment(s), */
-/* added zero copy support, */
-/* added a new mode to manage */
-/* endpoint buffer in classes, */
-/* resulting in version 6.3.0 */
+/* */
+/* CALLED BY */
+/* */
+/* USBX Source Code */
/* */
/**************************************************************************/
UINT _ux_device_class_rndis_activate(UX_SLAVE_CLASS_COMMAND *command)
@@ -92,7 +68,7 @@ UINT _ux_device_class_rndis_activate(UX_SLAVE_CLASS_COMMAND *command)
return(UX_FUNCTION_NOT_SUPPORTED);
#else
-UX_SLAVE_INTERFACE *interface_ptr;
+UX_SLAVE_INTERFACE *interface_ptr;
UX_SLAVE_CLASS *class_ptr;
UX_SLAVE_CLASS_RNDIS *rndis;
UX_SLAVE_ENDPOINT *endpoint;
@@ -107,35 +83,35 @@ ULONG physical_address_lsw;
/* Get the interface that owns this instance. */
interface_ptr = (UX_SLAVE_INTERFACE *) command -> ux_slave_class_command_interface;
-
+
/* Check if this is the Control or Data interface. */
if (command -> ux_slave_class_command_class == UX_DEVICE_CLASS_RNDIS_CLASS_COMMUNICATION_CONTROL)
{
/* Store the class instance into the interface. */
interface_ptr -> ux_slave_interface_class_instance = (VOID *)rndis;
-
+
/* Now the opposite, store the interface in the class instance. */
rndis -> ux_slave_class_rndis_interface = interface_ptr;
/* If there is a activate function call it. */
if (rndis -> ux_slave_class_rndis_parameter.ux_slave_class_rndis_instance_activate != UX_NULL)
-
+
/* Invoke the application. */
rndis -> ux_slave_class_rndis_parameter.ux_slave_class_rndis_instance_activate(rndis);
}
else
-
+
/* This is the DATA Class, only store the rndis instance in the interface. */
interface_ptr -> ux_slave_interface_class_instance = (VOID *)rndis;
/* Locate the endpoints. Interrupt for Control and Bulk in/out for Data. */
endpoint = interface_ptr -> ux_slave_interface_first_endpoint;
-
+
/* Parse all endpoints. */
while (endpoint != UX_NULL)
{
-
+
/* Check the endpoint direction, and type. */
if ((endpoint -> ux_slave_endpoint_descriptor.bEndpointAddress & UX_ENDPOINT_DIRECTION) == UX_ENDPOINT_IN)
{
@@ -176,7 +152,7 @@ ULONG physical_address_lsw;
UX_DEVICE_CLASS_RNDIS_BULKOUT_BUFFER(rndis);
#endif
}
- }
+ }
/* Next endpoint. */
endpoint = endpoint -> ux_slave_endpoint_next_endpoint;
@@ -199,49 +175,49 @@ ULONG physical_address_lsw;
/* Setup the physical address of this IP instance. */
physical_address_msw = (ULONG)((rndis -> ux_slave_class_rndis_local_node_id[0] << 8) | (rndis -> ux_slave_class_rndis_local_node_id[1]));
- physical_address_lsw = (ULONG)((rndis -> ux_slave_class_rndis_local_node_id[2] << 24) | (rndis -> ux_slave_class_rndis_local_node_id[3] << 16) |
+ physical_address_lsw = (ULONG)((rndis -> ux_slave_class_rndis_local_node_id[2] << 24) | (rndis -> ux_slave_class_rndis_local_node_id[3] << 16) |
(rndis -> ux_slave_class_rndis_local_node_id[4] << 8) | (rndis -> ux_slave_class_rndis_local_node_id[5]));
-
+
/* Register this interface to the NetX USB interface broker. */
_ux_network_driver_activate((VOID *) rndis, _ux_device_class_rndis_write,
&rndis -> ux_slave_class_rndis_network_handle,
physical_address_msw,
physical_address_lsw);
-
+
/* Reset the endpoint buffers. */
#if (UX_DEVICE_ENDPOINT_BUFFER_OWNER == 1) && !defined(UX_DEVICE_CLASS_RNDIS_ZERO_COPY)
- _ux_utility_memory_set(rndis -> ux_slave_class_rndis_bulkout_endpoint -> ux_slave_endpoint_transfer_request.
+ _ux_utility_memory_set(rndis -> ux_slave_class_rndis_bulkout_endpoint -> ux_slave_endpoint_transfer_request.
ux_slave_transfer_request_data_pointer, 0, UX_DEVICE_CLASS_RNDIS_BULKOUT_BUFFER_SIZE); /* Use case of memset is verified. */
- _ux_utility_memory_set(rndis -> ux_slave_class_rndis_bulkin_endpoint -> ux_slave_endpoint_transfer_request.
+ _ux_utility_memory_set(rndis -> ux_slave_class_rndis_bulkin_endpoint -> ux_slave_endpoint_transfer_request.
ux_slave_transfer_request_data_pointer, 0, UX_DEVICE_CLASS_RNDIS_BULKIN_BUFFER_SIZE); /* Use case of memset is verified. */
#endif
- _ux_utility_memory_set(rndis -> ux_slave_class_rndis_interrupt_endpoint -> ux_slave_endpoint_transfer_request.
+ _ux_utility_memory_set(rndis -> ux_slave_class_rndis_interrupt_endpoint -> ux_slave_endpoint_transfer_request.
ux_slave_transfer_request_data_pointer, 0, UX_DEVICE_CLASS_RNDIS_INTERRUPTIN_BUFFER_SIZE); /* Use case of memset is verified. */
-
+
/* Resume the endpoint threads. */
- _ux_device_thread_resume(&rndis -> ux_slave_class_rndis_interrupt_thread);
- _ux_device_thread_resume(&rndis -> ux_slave_class_rndis_bulkout_thread);
- _ux_device_thread_resume(&rndis -> ux_slave_class_rndis_bulkin_thread);
+ _ux_device_thread_resume(&rndis -> ux_slave_class_rndis_interrupt_thread);
+ _ux_device_thread_resume(&rndis -> ux_slave_class_rndis_bulkout_thread);
+ _ux_device_thread_resume(&rndis -> ux_slave_class_rndis_bulkin_thread);
/* If trace is enabled, insert this event into the trace buffer. */
UX_TRACE_IN_LINE_INSERT(UX_TRACE_DEVICE_CLASS_RNDIS_ACTIVATE, rndis, 0, 0, 0, UX_TRACE_DEVICE_CLASS_EVENTS, 0, 0)
-
+
/* If trace is enabled, register this object. */
UX_TRACE_OBJECT_REGISTER(UX_TRACE_DEVICE_OBJECT_TYPE_INTERFACE, rndis, 0, 0, 0)
-
+
/* Return completion status. */
return(UX_SUCCESS);
-
- }
+
+ }
else
{
-
+
/* If trace is enabled, insert this event into the trace buffer. */
UX_TRACE_IN_LINE_INSERT(UX_TRACE_DEVICE_CLASS_RNDIS_ACTIVATE, rndis, 0, 0, 0, UX_TRACE_DEVICE_CLASS_EVENTS, 0, 0)
-
+
/* If trace is enabled, register this object. */
UX_TRACE_OBJECT_REGISTER(UX_TRACE_DEVICE_OBJECT_TYPE_INTERFACE, rndis, 0, 0, 0)
-
+
/* Return completion status. */
return(UX_SUCCESS);
}
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 105c9f49..ee508bc5 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
@@ -1,17 +1,18 @@
/***************************************************************************
- * Copyright (c) 2024 Microsoft Corporation
- *
+ * Copyright (c) 2024 Microsoft Corporation
+ * Copyright (c) 2026-present Eclipse ThreadX contributors
+ *
* This program and the accompanying materials are made available under the
* terms of the MIT License which is available at
* https://opensource.org/licenses/MIT.
- *
+ *
* SPDX-License-Identifier: MIT
**************************************************************************/
/**************************************************************************/
/**************************************************************************/
-/** */
-/** USBX Component */
+/** */
+/** USBX Component */
/** */
/** Device RNDIS Class */
/** */
@@ -29,69 +30,43 @@
#if !defined(UX_DEVICE_STANDALONE)
-/**************************************************************************/
-/* */
-/* FUNCTION RELEASE */
-/* */
-/* _ux_device_class_rndis_bulkin_thread PORTABLE C */
+/**************************************************************************/
+/* */
+/* FUNCTION RELEASE */
+/* */
+/* _ux_device_class_rndis_bulkin_thread PORTABLE C */
/* 6.3.0 */
/* AUTHOR */
/* */
/* Chaoqiong Xiao, Microsoft Corporation */
/* */
/* DESCRIPTION */
-/* */
-/* This function is the thread of the rndis bulkin endpoint. The bulk */
-/* IN endpoint is used when the device wants to write data to be sent */
-/* to the host. */
-/* */
-/* INPUT */
-/* */
-/* rndis_class Address of rndis class */
-/* container */
-/* */
-/* OUTPUT */
-/* */
-/* None */
-/* */
-/* CALLS */
-/* */
-/* _ux_device_stack_transfer_request Request transfer */
+/* */
+/* This function is the thread of the rndis bulkin endpoint. The bulk */
+/* IN endpoint is used when the device wants to write data to be sent */
+/* to the host. */
+/* */
+/* INPUT */
+/* */
+/* rndis_class Address of rndis class */
+/* container */
+/* */
+/* OUTPUT */
+/* */
+/* None */
+/* */
+/* CALLS */
+/* */
+/* _ux_device_stack_transfer_request Request transfer */
/* _ux_utility_event_flags_get Get event flags */
/* _ux_device_mutex_on Take mutex */
/* _ux_device_mutex_off Release mutex */
/* _ux_utility_long_put Put 32-bit value */
/* nx_packet_transmit_release Release NetX packet */
-/* */
-/* CALLED BY */
-/* */
-/* ThreadX */
-/* */
-/* RELEASE HISTORY */
-/* */
-/* DATE NAME DESCRIPTION */
-/* */
-/* 05-19-2020 Chaoqiong Xiao Initial Version 6.0 */
-/* 09-30-2020 Chaoqiong Xiao Modified comment(s), */
-/* verified memset and memcpy */
-/* cases, used UX prefix to */
-/* refer to TX symbols instead */
-/* of using them directly, */
-/* resulting in version 6.1 */
-/* 01-31-2022 Chaoqiong Xiao Modified comment(s), */
-/* refined macros names, */
-/* resulting in version 6.1.10 */
-/* 04-25-2022 Chaoqiong Xiao Modified comment(s), */
-/* fixed standalone compile, */
-/* resulting in version 6.1.11 */
-/* 10-31-2022 Chaoqiong Xiao Modified comment(s), */
-/* used NX API to copy data, */
-/* resulting in version 6.2.0 */
-/* 10-31-2023 Chaoqiong Xiao Modified comment(s), */
-/* added zero copy support, */
-/* added a new mode to manage */
-/* endpoint buffer in classes, */
-/* resulting in version 6.3.0 */
+/* */
+/* CALLED BY */
+/* */
+/* ThreadX */
/* */
/**************************************************************************/
VOID _ux_device_class_rndis_bulkin_thread(ULONG rndis_class)
@@ -113,13 +88,13 @@ UINT do_copy;
/* Cast properly the rndis instance. */
UX_THREAD_EXTENSION_PTR_GET(class_ptr, UX_SLAVE_CLASS, rndis_class)
-
+
/* Get the rndis instance from this class container. */
rndis = (UX_SLAVE_CLASS_RNDIS *) class_ptr -> ux_slave_class_instance;
-
+
/* Get the pointer to the device. */
device = &_ux_system_slave -> ux_system_slave_device;
-
+
/* This thread runs forever but can be suspended or resumed. */
while(1)
{
@@ -129,34 +104,34 @@ UINT do_copy;
/* As long as the device is in the CONFIGURED state. */
while (device -> ux_slave_device_state == UX_DEVICE_CONFIGURED)
- {
+ {
/* Wait until we have a event sent by the application. We do not treat yet the case where a timeout based
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),
+ UX_DEVICE_CLASS_RNDIS_NEW_DEVICE_STATE_CHANGE_EVENT),
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)
{
-
+
/* Parse all packets. */
while(rndis -> ux_slave_class_rndis_xmit_queue != UX_NULL)
{
/* Protect this thread. */
_ux_device_mutex_on(&rndis -> ux_slave_class_rndis_mutex);
-
+
/* Get the current packet in the list. */
current_packet = rndis -> ux_slave_class_rndis_xmit_queue;
-
+
/* Set the next packet (or a NULL value) as the head of the xmit queue. */
rndis -> ux_slave_class_rndis_xmit_queue = current_packet -> nx_packet_queue_next;
-
+
/* Free Mutex resource. */
_ux_device_mutex_off(&rndis -> ux_slave_class_rndis_mutex);
-
+
/* If the link is down no need to rearm a packet. */
if (rndis -> ux_slave_class_rndis_link_state == UX_DEVICE_CLASS_RNDIS_LINK_STATE_UP)
{
@@ -250,7 +225,7 @@ UINT do_copy;
/* Initialize fields in header. */
_ux_utility_long_put(current_packet -> nx_packet_prepend_ptr + UX_DEVICE_CLASS_RNDIS_PACKET_MESSAGE_TYPE, UX_DEVICE_CLASS_RNDIS_PACKET_HEADER_MSG);
_ux_utility_long_put(current_packet -> nx_packet_prepend_ptr + UX_DEVICE_CLASS_RNDIS_PACKET_MESSAGE_LENGTH, transfer_length);
- _ux_utility_long_put(current_packet -> nx_packet_prepend_ptr + UX_DEVICE_CLASS_RNDIS_PACKET_DATA_OFFSET,
+ _ux_utility_long_put(current_packet -> nx_packet_prepend_ptr + UX_DEVICE_CLASS_RNDIS_PACKET_DATA_OFFSET,
UX_DEVICE_CLASS_RNDIS_PACKET_HEADER_LENGTH - UX_DEVICE_CLASS_RNDIS_PACKET_DATA_OFFSET);
_ux_utility_long_put(current_packet -> nx_packet_prepend_ptr + UX_DEVICE_CLASS_RNDIS_PACKET_DATA_LENGTH, current_packet -> nx_packet_length);
@@ -294,10 +269,10 @@ UINT do_copy;
/* 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);
_ux_utility_long_put(transfer_request -> ux_slave_transfer_request_data_pointer + UX_DEVICE_CLASS_RNDIS_PACKET_MESSAGE_LENGTH, transfer_length);
- _ux_utility_long_put(transfer_request -> ux_slave_transfer_request_data_pointer + UX_DEVICE_CLASS_RNDIS_PACKET_DATA_OFFSET,
+ _ux_utility_long_put(transfer_request -> ux_slave_transfer_request_data_pointer + UX_DEVICE_CLASS_RNDIS_PACKET_DATA_OFFSET,
UX_DEVICE_CLASS_RNDIS_PACKET_HEADER_LENGTH - UX_DEVICE_CLASS_RNDIS_PACKET_DATA_OFFSET);
_ux_utility_long_put(transfer_request -> ux_slave_transfer_request_data_pointer + UX_DEVICE_CLASS_RNDIS_PACKET_DATA_LENGTH, current_packet -> nx_packet_length);
-
+
/* If trace is enabled, insert this event into the trace buffer. */
UX_TRACE_IN_LINE_INSERT(UX_TRACE_DEVICE_CLASS_RNDIS_PACKET_TRANSMIT, rndis, 0, 0, 0, UX_TRACE_DEVICE_CLASS_EVENTS, 0, 0)
@@ -307,7 +282,7 @@ UINT do_copy;
/* Check for error. */
if (status != UX_SUCCESS)
-
+
/* Error trap. */
_ux_system_error_handler(UX_SYSTEM_LEVEL_THREAD, UX_SYSTEM_CONTEXT_CLASS, status);
}
@@ -320,14 +295,14 @@ UINT do_copy;
_ux_system_error_handler(UX_SYSTEM_LEVEL_THREAD, UX_SYSTEM_CONTEXT_CLASS, UX_MEMORY_INSUFFICIENT);
}
#endif
- }
-
+ }
+
/* Free the packet that was just sent. First do some housekeeping. */
- current_packet -> nx_packet_prepend_ptr = current_packet -> nx_packet_prepend_ptr + UX_DEVICE_CLASS_RNDIS_ETHERNET_SIZE;
+ current_packet -> nx_packet_prepend_ptr = current_packet -> nx_packet_prepend_ptr + UX_DEVICE_CLASS_RNDIS_ETHERNET_SIZE;
current_packet -> nx_packet_length = current_packet -> nx_packet_length - UX_DEVICE_CLASS_RNDIS_ETHERNET_SIZE;
-
+
/* And ask Netx to release it. */
- nx_packet_transmit_release(current_packet);
+ nx_packet_transmit_release(current_packet);
}
}
else
@@ -339,26 +314,26 @@ UINT do_copy;
/* Protect the chain of packets. */
_ux_device_mutex_on(&rndis -> ux_slave_class_rndis_mutex);
-
+
/* Get the current packet in the list. */
current_packet = rndis -> ux_slave_class_rndis_xmit_queue;
-
+
/* Set the next packet (or a NULL value) as the head of the xmit queue. */
rndis -> ux_slave_class_rndis_xmit_queue = current_packet -> nx_packet_queue_next;
-
+
/* Free Mutex resource. */
_ux_device_mutex_off(&rndis -> ux_slave_class_rndis_mutex);
-
+
/* Free the packet */
- current_packet -> nx_packet_prepend_ptr = current_packet -> nx_packet_prepend_ptr + UX_DEVICE_CLASS_RNDIS_ETHERNET_SIZE;
+ current_packet -> nx_packet_prepend_ptr = current_packet -> nx_packet_prepend_ptr + UX_DEVICE_CLASS_RNDIS_ETHERNET_SIZE;
current_packet -> nx_packet_length = current_packet -> nx_packet_length - UX_DEVICE_CLASS_RNDIS_ETHERNET_SIZE;
-
+
/* And ask Netx to release it. */
- nx_packet_transmit_release(current_packet);
+ nx_packet_transmit_release(current_packet);
}
}
}
-
+
/* We need to suspend ourselves. We will be resumed by the device enumeration module. */
_ux_device_thread_suspend(&rndis -> ux_slave_class_rndis_bulkin_thread);
}
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 0b673311..443366d9 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
@@ -1,17 +1,18 @@
/***************************************************************************
- * Copyright (c) 2024 Microsoft Corporation
- *
+ * Copyright (c) 2024 Microsoft Corporation
+ * Copyright (c) 2026-present Eclipse ThreadX contributors
+ *
* This program and the accompanying materials are made available under the
* terms of the MIT License which is available at
* https://opensource.org/licenses/MIT.
- *
+ *
* SPDX-License-Identifier: MIT
**************************************************************************/
/**************************************************************************/
/**************************************************************************/
-/** */
-/** USBX Component */
+/** */
+/** USBX Component */
/** */
/** Device RNDIS Class */
/** */
@@ -29,69 +30,43 @@
#if !defined(UX_DEVICE_STANDALONE)
-/**************************************************************************/
-/* */
-/* FUNCTION RELEASE */
-/* */
-/* _ux_device_class_rndis_bulkout_thread PORTABLE C */
+/**************************************************************************/
+/* */
+/* FUNCTION RELEASE */
+/* */
+/* _ux_device_class_rndis_bulkout_thread PORTABLE C */
/* 6.3.0 */
/* AUTHOR */
/* */
/* Chaoqiong Xiao, Microsoft Corporation */
/* */
/* DESCRIPTION */
-/* */
-/* This function is the thread of the rndis bulk out endpoint. It */
-/* is waiting for the host to send data on the bulk out endpoint to */
-/* the device. */
-/* */
-/* INPUT */
-/* */
-/* rndis_class Address of rndis class */
-/* container */
-/* */
-/* OUTPUT */
-/* */
-/* None */
-/* */
-/* CALLS */
-/* */
-/* _ux_device_stack_transfer_request Request transfer */
+/* */
+/* This function is the thread of the rndis bulk out endpoint. It */
+/* is waiting for the host to send data on the bulk out endpoint to */
+/* the device. */
+/* */
+/* INPUT */
+/* */
+/* rndis_class Address of rndis class */
+/* container */
+/* */
+/* OUTPUT */
+/* */
+/* None */
+/* */
+/* CALLS */
+/* */
+/* _ux_device_stack_transfer_request Request transfer */
/* _ux_network_driver_packet_received Process received packet */
/* _ux_utility_long_get Get 32-bit value */
/* _ux_device_thread_suspend Suspend thread */
/* nx_packet_allocate Allocate NetX packet */
/* nx_packet_release Release NetX packet */
-/* */
-/* CALLED BY */
-/* */
-/* ThreadX */
-/* */
-/* RELEASE HISTORY */
-/* */
-/* 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 */
-/* 01-31-2022 Chaoqiong Xiao Modified comment(s), */
-/* refined macros names, */
-/* resulting in version 6.1.10 */
-/* 04-25-2022 Chaoqiong Xiao Modified comment(s), */
-/* fixed standalone compile, */
-/* resulting in version 6.1.11 */
-/* 10-31-2022 Chaoqiong Xiao Modified comment(s), */
-/* used NX API to copy data, */
-/* used linked NX IP pool, */
-/* resulting in version 6.2.0 */
-/* 10-31-2023 Chaoqiong Xiao Modified comment(s), */
-/* added zero copy support, */
-/* added a new mode to manage */
-/* endpoint buffer in classes, */
-/* resulting in version 6.3.0 */
+/* */
+/* CALLED BY */
+/* */
+/* ThreadX */
/* */
/**************************************************************************/
VOID _ux_device_class_rndis_bulkout_thread(ULONG rndis_class)
@@ -108,13 +83,13 @@ USB_NETWORK_DEVICE_TYPE *ux_nx_device;
/* Cast properly the rndis instance. */
UX_THREAD_EXTENSION_PTR_GET(class_ptr, UX_SLAVE_CLASS, rndis_class)
-
+
/* Get the rndis instance from this class container. */
rndis = (UX_SLAVE_CLASS_RNDIS *) class_ptr -> ux_slave_class_instance;
-
+
/* Get the pointer to the device. */
device = &_ux_system_slave -> ux_system_slave_device;
-
+
/* This thread runs forever but can be suspended or resumed. */
while(1)
{
@@ -124,7 +99,7 @@ USB_NETWORK_DEVICE_TYPE *ux_nx_device;
/* As long as the device is in the CONFIGURED state. */
while (device -> ux_slave_device_state == UX_DEVICE_CONFIGURED)
- {
+ {
/* Check if packet pool is ready. */
if (rndis -> ux_slave_class_rndis_packet_pool == UX_NULL)
@@ -150,7 +125,7 @@ USB_NETWORK_DEVICE_TYPE *ux_nx_device;
}
/* We can accept new reception. Get a NX Packet. */
- status = nx_packet_allocate(rndis -> ux_slave_class_rndis_packet_pool, &packet,
+ status = nx_packet_allocate(rndis -> ux_slave_class_rndis_packet_pool, &packet,
NX_RECEIVE_PACKET, UX_MS_TO_TICK(UX_DEVICE_CLASS_RNDIS_PACKET_POOL_WAIT));
if (status == NX_SUCCESS)
@@ -159,10 +134,10 @@ USB_NETWORK_DEVICE_TYPE *ux_nx_device;
/* And length. */
transfer_request -> ux_slave_transfer_request_requested_length = UX_DEVICE_CLASS_RNDIS_BULKOUT_BUFFER_SIZE;
transfer_request -> ux_slave_transfer_request_actual_length = 0;
-
+
/* Memorize this packet at the beginning of the queue. */
rndis -> ux_slave_class_rndis_receive_queue = packet;
-
+
/* Reset the queue pointer of this packet. */
packet -> nx_packet_queue_next = UX_NULL;
@@ -221,7 +196,7 @@ USB_NETWORK_DEVICE_TYPE *ux_nx_device;
/* Ensure the length reported in the RNDIS header is not larger than it actually is.
The reason we can't check to see if the length reported in the header and the
- actual length are exactly equal is because there might other data after the payload
+ actual length are exactly equal is because there might other data after the payload
(padding, or even a message). */
if (packet_payload <= transfer_request -> ux_slave_transfer_request_actual_length - UX_DEVICE_CLASS_RNDIS_PACKET_HEADER_LENGTH)
{
@@ -297,7 +272,7 @@ USB_NETWORK_DEVICE_TYPE *ux_nx_device;
_ux_system_error_handler(UX_SYSTEM_LEVEL_THREAD, UX_SYSTEM_CONTEXT_CLASS, UX_MEMORY_INSUFFICIENT);
}
}
-
+
/* We need to suspend ourselves. We will be resumed by the device enumeration module. */
_ux_device_thread_suspend(&rndis -> ux_slave_class_rndis_bulkout_thread);
}
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 f9e8851d..e4804659 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
@@ -1,17 +1,18 @@
/***************************************************************************
- * Copyright (c) 2024 Microsoft Corporation
- *
+ * Copyright (c) 2024 Microsoft Corporation
+ * Copyright (c) 2026-present Eclipse ThreadX contributors
+ *
* This program and the accompanying materials are made available under the
* terms of the MIT License which is available at
* https://opensource.org/licenses/MIT.
- *
+ *
* SPDX-License-Identifier: MIT
**************************************************************************/
/**************************************************************************/
/**************************************************************************/
-/** */
-/** USBX Component */
+/** */
+/** USBX Component */
/** */
/** Device RNDIS Class */
/** */
@@ -34,32 +35,32 @@
/* Build option checked runtime by UX_ASSERT */
#endif
-/**************************************************************************/
-/* */
-/* FUNCTION RELEASE */
-/* */
-/* _ux_device_class_rndis_control_request PORTABLE C */
+/**************************************************************************/
+/* */
+/* FUNCTION RELEASE */
+/* */
+/* _ux_device_class_rndis_control_request PORTABLE C */
/* 6.3.0 */
/* AUTHOR */
/* */
/* Chaoqiong Xiao, Microsoft Corporation */
/* */
/* DESCRIPTION */
-/* */
-/* This function manages the based sent by the host on the control */
-/* endpoints with a CLASS or VENDOR SPECIFIC type. */
-/* */
-/* INPUT */
-/* */
-/* rndis Pointer to rndis class */
-/* */
-/* OUTPUT */
-/* */
-/* None */
-/* */
-/* CALLS */
-/* */
-/* _ux_device_stack_endpoint_stall Endpoint stall */
+/* */
+/* This function manages the based sent by the host on the control */
+/* endpoints with a CLASS or VENDOR SPECIFIC type. */
+/* */
+/* INPUT */
+/* */
+/* rndis Pointer to rndis class */
+/* */
+/* OUTPUT */
+/* */
+/* None */
+/* */
+/* CALLS */
+/* */
+/* _ux_device_stack_endpoint_stall Endpoint stall */
/* _ux_device_stack_transfer_request Transfer request */
/* _ux_utility_memory_set Set memory */
/* _ux_utility_memory_copy Copy memory */
@@ -70,33 +71,10 @@
/* _ux_device_class_rndis_msg_set Command set */
/* _ux_device_class_rndis_msg_reset Command reset */
/* _ux_device_class_rndis_msg_keep_alive Command keep alive */
-/* */
-/* CALLED BY */
-/* */
+/* */
+/* CALLED BY */
+/* */
/* RNDIS Class */
-/* */
-/* RELEASE HISTORY */
-/* */
-/* DATE NAME DESCRIPTION */
-/* */
-/* 05-19-2020 Chaoqiong Xiao Initial Version 6.0 */
-/* 09-30-2020 Chaoqiong Xiao Modified comment(s), */
-/* verified memset and memcpy */
-/* cases, used UX prefix to */
-/* refer to TX symbols instead */
-/* of using them directly, */
-/* resulting in version 6.1 */
-/* 04-25-2022 Chaoqiong Xiao Modified comment(s), */
-/* fixed standalone compile, */
-/* resulting in version 6.1.11 */
-/* 07-29-2022 Chaoqiong Xiao Modified comment(s), */
-/* fixed parameter/variable */
-/* names conflict C++ keyword, */
-/* resulting in version 6.1.12 */
-/* 10-31-2023 Chaoqiong Xiao Modified comment(s), */
-/* checked compiling options */
-/* by runtime UX_ASSERT, */
-/* resulting in version 6.3.0 */
/* */
/**************************************************************************/
UINT _ux_device_class_rndis_control_request(UX_SLAVE_CLASS_COMMAND *command)
@@ -129,18 +107,18 @@ UX_SLAVE_CLASS_RNDIS *rndis;
/* Get the class container. */
class_ptr = command -> ux_slave_class_command_class_ptr;
-
+
/* Get the rndis instance from this class container. */
rndis = (UX_SLAVE_CLASS_RNDIS *) class_ptr -> ux_slave_class_instance;
-
+
/* Here we proceed only the standard request we know of at the device level. */
switch (request)
{
-
+
case UX_DEVICE_CLASS_RNDIS_SEND_ENCAPSULATED_COMMAND :
-
-
+
+
/* We have received a command. Check if the command is valid and dispatch it. */
rndis_command = _ux_utility_long_get(transfer_request -> ux_slave_transfer_request_data_pointer);
@@ -148,37 +126,37 @@ UX_SLAVE_CLASS_RNDIS *rndis;
{
case UX_DEVICE_CLASS_RNDIS_MSG_INITIALIZE :
-
+
_ux_device_class_rndis_msg_initialize(rndis, transfer_request);
break;
-
+
case UX_DEVICE_CLASS_RNDIS_MSG_HALT :
break;
-
-
+
+
case UX_DEVICE_CLASS_RNDIS_MSG_QUERY :
_ux_device_class_rndis_msg_query(rndis, transfer_request);
break;
-
-
+
+
case UX_DEVICE_CLASS_RNDIS_MSG_SET :
_ux_device_class_rndis_msg_set(rndis, transfer_request);
break;
-
-
+
+
case UX_DEVICE_CLASS_RNDIS_MSG_RESET :
_ux_device_class_rndis_msg_reset(rndis, transfer_request);
break;
-
-
+
+
case UX_DEVICE_CLASS_RNDIS_MSG_INDICATE_STATUS :
break;
-
-
+
+
case UX_DEVICE_CLASS_RNDIS_MSG_KEEP_ALIVE :
_ux_device_class_rndis_msg_keep_alive(rndis, transfer_request);
break;
-
+
default :
/* Unknown function. Stall the endpoint. */
@@ -186,8 +164,8 @@ UX_SLAVE_CLASS_RNDIS *rndis;
break;
}
-
- /* Check the return status. If no error, we set the interrupt pipe to reply response available.
+
+ /* Check the return status. If no error, we set the interrupt pipe to reply response available.
All RNDIS events are on the interrupt endpoint IN, from the host. */
transfer_request_in = &rndis -> ux_slave_class_rndis_interrupt_endpoint -> ux_slave_endpoint_transfer_request;
@@ -198,13 +176,13 @@ UX_SLAVE_CLASS_RNDIS *rndis;
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_device_event_flags_set(&rndis -> ux_slave_class_rndis_event_flags_group, UX_DEVICE_CLASS_RNDIS_NEW_INTERRUPT_EVENT, UX_OR);
-
+ _ux_device_event_flags_set(&rndis -> ux_slave_class_rndis_event_flags_group, UX_DEVICE_CLASS_RNDIS_NEW_INTERRUPT_EVENT, UX_OR);
+
break;
-
+
case UX_DEVICE_CLASS_RNDIS_GET_ENCAPSULATED_RESPONSE :
-
-
+
+
/* 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); /* Use case of memcpy is verified. */
@@ -214,9 +192,9 @@ UX_SLAVE_CLASS_RNDIS *rndis;
/* We can return the RNDIS response. */
_ux_device_stack_transfer_request(transfer_request, rndis -> ux_slave_class_rndis_response_length, request_length);
-
+
break ;
-
+
default:
/* Unknown function. It's not handled. */
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 42744d49..75146367 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
@@ -1,17 +1,18 @@
/***************************************************************************
- * Copyright (c) 2024 Microsoft Corporation
- *
+ * Copyright (c) 2024 Microsoft Corporation
+ * Copyright (c) 2026-present Eclipse ThreadX contributors
+ *
* This program and the accompanying materials are made available under the
* terms of the MIT License which is available at
* https://opensource.org/licenses/MIT.
- *
+ *
* SPDX-License-Identifier: MIT
**************************************************************************/
/**************************************************************************/
/**************************************************************************/
-/** */
-/** USBX Component */
+/** */
+/** USBX Component */
/** */
/** Device RNDIS Class */
/** */
@@ -28,66 +29,45 @@
#include "ux_device_stack.h"
-/**************************************************************************/
-/* */
-/* FUNCTION RELEASE */
-/* */
-/* _ux_device_class_rndis_deactivate PORTABLE C */
+/**************************************************************************/
+/* */
+/* FUNCTION RELEASE */
+/* */
+/* _ux_device_class_rndis_deactivate PORTABLE C */
/* 6.1.12 */
/* AUTHOR */
/* */
/* Chaoqiong Xiao, Microsoft Corporation */
/* */
/* DESCRIPTION */
-/* */
-/* This function deactivate an instance of the rndis class. */
-/* */
-/* INPUT */
-/* */
-/* command Pointer to a class command */
-/* */
-/* OUTPUT */
-/* */
-/* Completion Status */
-/* */
-/* CALLS */
-/* */
+/* */
+/* This function deactivate an instance of the rndis class. */
+/* */
+/* INPUT */
+/* */
+/* command Pointer to a class command */
+/* */
+/* OUTPUT */
+/* */
+/* Completion Status */
+/* */
+/* CALLS */
+/* */
/* _ux_device_stack_transfer_all_request_abort */
/* Abort all transfers */
/* _ux_device_event_flags_set Set event flags */
/* _ux_network_driver_deactivate Deactivate NetX USB interface */
-/* */
-/* CALLED BY */
-/* */
+/* */
+/* CALLED BY */
+/* */
/* RNDIS Class */
-/* */
-/* RELEASE HISTORY */
-/* */
-/* 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 */
-/* 08-02-2021 Wen Wang Modified comment(s), */
-/* fixed spelling error, */
-/* resulting in version 6.1.8 */
-/* 04-25-2022 Chaoqiong Xiao Modified comment(s), */
-/* fixed standalone compile, */
-/* resulting in version 6.1.11 */
-/* 07-29-2022 Chaoqiong Xiao Modified comment(s), */
-/* fixed parameter/variable */
-/* names conflict C++ keyword, */
-/* resulting in version 6.1.12 */
/* */
/**************************************************************************/
UINT _ux_device_class_rndis_deactivate(UX_SLAVE_CLASS_COMMAND *command)
{
-
+
UX_SLAVE_CLASS_RNDIS *rndis;
-UX_SLAVE_INTERFACE *interface_ptr;
+UX_SLAVE_INTERFACE *interface_ptr;
UX_SLAVE_CLASS *class_ptr;
/* Get the class container. */
@@ -101,12 +81,12 @@ UX_SLAVE_CLASS *class_ptr;
interface in the class container, we used the class_command pointer to retrieve the
correct interface which issued the deactivation. */
interface_ptr = (UX_SLAVE_INTERFACE *) command -> ux_slave_class_command_interface;
-
+
/* Check if this is the Control or Data interface. We only need to dismount the link and abort the
transfer once for the 2 classes. */
if (interface_ptr -> ux_slave_interface_descriptor.bInterfaceClass == UX_DEVICE_CLASS_RNDIS_CLASS_COMMUNICATION_CONTROL)
{
-
+
/* Declare the link to be down. That may need to change later to make it dependant on the
WAN/Wireless modem. */
rndis -> ux_slave_class_rndis_link_state = UX_DEVICE_CLASS_RNDIS_LINK_STATE_DOWN;
@@ -116,19 +96,19 @@ UX_SLAVE_CLASS *class_ptr;
_ux_device_stack_transfer_all_request_abort(rndis -> ux_slave_class_rndis_bulkin_endpoint, UX_TRANSFER_BUS_RESET);
_ux_device_stack_transfer_all_request_abort(rndis -> ux_slave_class_rndis_bulkout_endpoint, UX_TRANSFER_BUS_RESET);
- /* We have 2 threads waiting for an event, interrupt and bulk in. We wake them up with
+ /* 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_device_event_flags_set(&rndis -> ux_slave_class_rndis_event_flags_group, UX_DEVICE_CLASS_RNDIS_NEW_DEVICE_STATE_CHANGE_EVENT, UX_OR);
+ _ux_device_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)
-
+
/* Invoke the application. */
rndis -> ux_slave_class_rndis_parameter.ux_slave_class_rndis_instance_deactivate(rndis);
/* Deregister this interface to the NetX USB interface broker. */
_ux_network_driver_deactivate((VOID *) rndis, rndis -> ux_slave_class_rndis_network_handle);
-
+
}
/* If trace is enabled, insert this event into the trace buffer. */
@@ -136,7 +116,7 @@ UX_SLAVE_CLASS *class_ptr;
/* If trace is enabled, register this object. */
UX_TRACE_OBJECT_UNREGISTER(rndis);
-
+
/* Return completion status. */
return(UX_SUCCESS);
}
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 8cf98aa6..72c68c7f 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
@@ -1,5 +1,6 @@
/***************************************************************************
* Copyright (c) 2024 Microsoft Corporation
+ * Copyright (c) 2026-present Eclipse ThreadX contributors
*
* This program and the accompanying materials are made available under the
* terms of the MIT License which is available at
@@ -65,19 +66,6 @@
/* */
/* RNDIS Class */
/* */
-/* RELEASE HISTORY */
-/* */
-/* DATE NAME DESCRIPTION */
-/* */
-/* 05-19-2020 Chaoqiong Xiao Initial Version 6.0 */
-/* 09-30-2020 Chaoqiong Xiao Modified comment(s), */
-/* resulting in version 6.1 */
-/* xx-xx-xxxx Mohamed ayed Modified comment(s), */
-/* added call of rndis uninit */
-/* function, */
-/* remove extra spaces, */
-/* resulting in version 6.x */
-/* */
/**************************************************************************/
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 5994ca7c..ded5dbfc 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
@@ -1,16 +1,17 @@
/***************************************************************************
- * Copyright (c) 2024 Microsoft Corporation
- *
+ * Copyright (c) 2024 Microsoft Corporation
+ * Copyright (c) 2026-present Eclipse ThreadX contributors
+ *
* This program and the accompanying materials are made available under the
* terms of the MIT License which is available at
* https://opensource.org/licenses/MIT.
- *
+ *
* SPDX-License-Identifier: MIT
**************************************************************************/
/**************************************************************************/
-/** */
-/** USBX Component */
+/** */
+/** USBX Component */
/** */
/** Device RNDIS Class */
/** */
@@ -72,35 +73,35 @@ ULONG ux_device_class_rndis_oid_supported_list[UX_DEVICE_CLASS_RNDIS_OID_SUPPORT
0,
};
-/**************************************************************************/
-/* */
-/* FUNCTION RELEASE */
-/* */
-/* _ux_device_class_rndis_initialize PORTABLE C */
+/**************************************************************************/
+/* */
+/* FUNCTION RELEASE */
+/* */
+/* _ux_device_class_rndis_initialize PORTABLE C */
/* 6.3.0 */
/* AUTHOR */
/* */
/* Chaoqiong Xiao, Microsoft Corporation */
/* */
/* DESCRIPTION */
-/* */
-/* This function initializes the USB RNDIS device. */
-/* */
-/* INPUT */
-/* */
-/* command Pointer to rndis command */
-/* */
-/* OUTPUT */
-/* */
-/* Completion Status */
-/* */
-/* CALLS */
-/* */
-/* _ux_utility_memory_allocate Allocate memory */
+/* */
+/* This function initializes the USB RNDIS device. */
+/* */
+/* INPUT */
+/* */
+/* command Pointer to rndis command */
+/* */
+/* OUTPUT */
+/* */
+/* Completion Status */
+/* */
+/* CALLS */
+/* */
+/* _ux_utility_memory_allocate Allocate memory */
/* _ux_utility_memory_copy Copy memory */
/* _ux_utility_memory_free Free memory */
-/* _ux_utility_event_flags_create Create Flag group */
-/* _ux_utility_event_flags_delete Delete Flag group */
+/* _ux_utility_event_flags_create Create Flag group */
+/* _ux_utility_event_flags_delete Delete Flag group */
/* _ux_utility_mutex_create Create mutex */
/* _ux_device_mutex_delete Delete mutex */
/* _ux_device_semaphore_create Create semaphore */
@@ -109,40 +110,10 @@ ULONG ux_device_class_rndis_oid_supported_list[UX_DEVICE_CLASS_RNDIS_OID_SUPPORT
/* _ux_device_thread_delete Delete thread */
/* nx_packet_pool_create Create NetX packet pool */
/* nx_packet_pool_delete Delete NetX packet pool */
-/* */
-/* CALLED BY */
-/* */
-/* USBX Source Code */
-/* */
-/* RELEASE HISTORY */
-/* */
-/* DATE NAME DESCRIPTION */
-/* */
-/* 05-19-2020 Chaoqiong Xiao Initial Version 6.0 */
-/* 09-30-2020 Chaoqiong Xiao Modified comment(s), */
-/* verified memset and memcpy */
-/* cases, used UX prefix to */
-/* refer to TX symbols instead */
-/* of using them directly, */
-/* resulting in version 6.1 */
-/* 01-31-2022 Chaoqiong Xiao Modified comment(s), */
-/* refined macros names, */
-/* resulting in version 6.1.10 */
-/* 04-25-2022 Chaoqiong Xiao Modified comment(s), */
-/* fixed standalone compile, */
-/* resulting in version 6.1.11 */
-/* 07-29-2022 Chaoqiong Xiao Modified comment(s), */
-/* fixed parameter/variable */
-/* names conflict C++ keyword, */
-/* resulting in version 6.1.12 */
-/* 10-31-2022 Chaoqiong Xiao Modified comment(s), */
-/* removed internal NX pool, */
-/* resulting in version 6.2.0 */
-/* 10-31-2023 Chaoqiong Xiao Modified comment(s), */
-/* added a new mode to manage */
-/* endpoint buffer in classes, */
-/* checked compile options, */
-/* resulting in version 6.3.0 */
+/* */
+/* CALLED BY */
+/* */
+/* USBX Source Code */
/* */
/**************************************************************************/
UINT _ux_device_class_rndis_initialize(UX_SLAVE_CLASS_COMMAND *command)
@@ -185,16 +156,16 @@ UINT status = UX_SUCCESS;
/* Store the start and stop signals if needed by the application. */
rndis -> ux_slave_class_rndis_parameter.ux_slave_class_rndis_instance_activate = rndis_parameter -> ux_slave_class_rndis_instance_activate;
rndis -> ux_slave_class_rndis_parameter.ux_slave_class_rndis_instance_deactivate = rndis_parameter -> ux_slave_class_rndis_instance_deactivate;
-
+
/* Save the Netx IP passed by the application. */
- rndis -> ux_slave_class_rndis_nx_ip = rndis_parameter -> ux_slave_class_rndis_parameter_nx_ip;
-
+ rndis -> ux_slave_class_rndis_nx_ip = rndis_parameter -> ux_slave_class_rndis_parameter_nx_ip;
+
/* Save the Netx IP address passed by the application. */
- rndis -> ux_slave_class_rndis_nx_ip_address = rndis_parameter -> ux_slave_class_rndis_parameter_nx_ip_address;
-
+ rndis -> ux_slave_class_rndis_nx_ip_address = rndis_parameter -> ux_slave_class_rndis_parameter_nx_ip_address;
+
/* Save the Netx IP address network mask passed by the application. */
- rndis -> ux_slave_class_rndis_nx_ip_network_mask = rndis_parameter -> ux_slave_class_rndis_parameter_nx_ip_network_mask;
-
+ rndis -> ux_slave_class_rndis_nx_ip_network_mask = rndis_parameter -> ux_slave_class_rndis_parameter_nx_ip_network_mask;
+
/* 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); /* Use case of memcpy is verified. */
@@ -230,9 +201,9 @@ UINT status = UX_SUCCESS;
/* Allocate some memory for the interrupt thread stack. */
if (status == UX_SUCCESS)
{
- rndis -> ux_slave_class_rndis_interrupt_thread_stack =
+ rndis -> ux_slave_class_rndis_interrupt_thread_stack =
_ux_utility_memory_allocate(UX_NO_ALIGN, UX_REGULAR_MEMORY, UX_THREAD_STACK_SIZE);
-
+
/* Check for successful allocation. */
if (rndis -> ux_slave_class_rndis_interrupt_thread_stack == UX_NULL)
@@ -245,12 +216,12 @@ UINT status = UX_SUCCESS;
does not start until we have a instance of the class. */
if (status == UX_SUCCESS)
{
- status = _ux_device_thread_create(&rndis -> ux_slave_class_rndis_interrupt_thread , "ux_slave_class_rndis_interrupt_thread",
+ status = _ux_device_thread_create(&rndis -> ux_slave_class_rndis_interrupt_thread , "ux_slave_class_rndis_interrupt_thread",
_ux_device_class_rndis_interrupt_thread,
(ULONG) (ALIGN_TYPE) class_ptr, (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, UX_DONT_START);
-
+
/* Check the creation of this thread. */
if (status != UX_SUCCESS)
status = UX_THREAD_ERROR;
@@ -261,9 +232,9 @@ UINT status = UX_SUCCESS;
/* Allocate some memory for the bulk out thread stack. */
if (status == UX_SUCCESS)
{
- rndis -> ux_slave_class_rndis_bulkout_thread_stack =
+ rndis -> ux_slave_class_rndis_bulkout_thread_stack =
_ux_utility_memory_allocate(UX_NO_ALIGN, UX_REGULAR_MEMORY, UX_THREAD_STACK_SIZE);
-
+
/* Check for successful allocation. */
if (rndis -> ux_slave_class_rndis_bulkout_thread_stack == UX_NULL)
status = UX_MEMORY_INSUFFICIENT;
@@ -274,12 +245,12 @@ UINT status = UX_SUCCESS;
does not start until we have a instance of the class. */
if (status == UX_SUCCESS)
{
- status = _ux_device_thread_create(&rndis -> ux_slave_class_rndis_bulkout_thread , "ux_slave_class_rndis_bulkout_thread",
+ status = _ux_device_thread_create(&rndis -> ux_slave_class_rndis_bulkout_thread , "ux_slave_class_rndis_bulkout_thread",
_ux_device_class_rndis_bulkout_thread,
(ULONG) (ALIGN_TYPE) class_ptr, (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, UX_DONT_START);
-
+
/* Check the creation of this thread. */
if (status != UX_SUCCESS)
status = UX_THREAD_ERROR;
@@ -290,9 +261,9 @@ UINT status = UX_SUCCESS;
/* Allocate some memory for the bulk in thread stack. */
if (status == UX_SUCCESS)
{
- rndis -> ux_slave_class_rndis_bulkin_thread_stack =
+ rndis -> ux_slave_class_rndis_bulkin_thread_stack =
_ux_utility_memory_allocate(UX_NO_ALIGN, UX_REGULAR_MEMORY, UX_THREAD_STACK_SIZE);
-
+
/* Check for successful allocation. */
if (rndis -> ux_slave_class_rndis_bulkin_thread_stack == UX_NULL)
status = UX_MEMORY_INSUFFICIENT;
@@ -303,7 +274,7 @@ UINT status = UX_SUCCESS;
does not start until we have a instance of the class. */
if (status == UX_SUCCESS)
{
- status = _ux_device_thread_create(&rndis -> ux_slave_class_rndis_bulkin_thread , "ux_slave_class_rndis_bulkin_thread",
+ status = _ux_device_thread_create(&rndis -> ux_slave_class_rndis_bulkin_thread , "ux_slave_class_rndis_bulkin_thread",
_ux_device_class_rndis_bulkin_thread,
(ULONG) (ALIGN_TYPE) class_ptr, (VOID *) rndis -> ux_slave_class_rndis_bulkin_thread_stack ,
UX_THREAD_STACK_SIZE, UX_THREAD_PRIORITY_CLASS,
@@ -342,15 +313,15 @@ UINT status = UX_SUCCESS;
/* Failed! Free up resources. */
/* Delete semaphore for protecting the driver entry. */
- if (rndis -> ux_slave_class_rndis_semaphore.tx_semaphore_id != 0)
+ if (_ux_device_semaphore_created(&rndis -> ux_slave_class_rndis_semaphore))
_ux_device_semaphore_delete(&rndis -> ux_slave_class_rndis_semaphore);
/* Delete rndis -> ux_slave_class_rndis_event_flags_group. */
- if (rndis -> ux_slave_class_rndis_event_flags_group.tx_event_flags_group_id != 0)
+ if (_ux_device_event_flags_created(&rndis -> ux_slave_class_rndis_event_flags_group))
_ux_utility_event_flags_delete(&rndis -> ux_slave_class_rndis_event_flags_group);
/* Delete rndis -> ux_slave_class_rndis_bulkin_thread. */
- if (rndis -> ux_slave_class_rndis_bulkin_thread.tx_thread_id != 0)
+ if (_ux_device_thread_created(&rndis -> ux_slave_class_rndis_bulkin_thread))
_ux_device_thread_delete(&rndis -> ux_slave_class_rndis_bulkin_thread);
/* Free rndis -> ux_slave_class_rndis_bulkin_thread_stack. */
@@ -358,23 +329,23 @@ UINT status = UX_SUCCESS;
_ux_utility_memory_free(rndis -> ux_slave_class_rndis_bulkin_thread_stack);
/* Delete rndis -> ux_slave_class_rndis_bulkout_thread. */
- if (rndis -> ux_slave_class_rndis_bulkout_thread.tx_thread_id != 0)
+ if (_ux_device_thread_created(&rndis -> ux_slave_class_rndis_bulkout_thread))
_ux_device_thread_delete(&rndis -> ux_slave_class_rndis_bulkout_thread);
/* Free rndis -> ux_slave_class_rndis_bulkout_thread_stack. */
if (rndis -> ux_slave_class_rndis_bulkout_thread_stack)
_ux_utility_memory_free(rndis -> ux_slave_class_rndis_bulkout_thread_stack);
-
+
/* Delete rndis -> ux_slave_class_rndis_interrupt_thread. */
- if (rndis -> ux_slave_class_rndis_interrupt_thread.tx_thread_id != 0)
+ if (_ux_device_thread_created(&rndis -> ux_slave_class_rndis_interrupt_thread))
_ux_device_thread_delete(&rndis -> ux_slave_class_rndis_interrupt_thread);
-
+
/* Free rndis -> ux_slave_class_rndis_interrupt_thread_stack. */
if (rndis -> ux_slave_class_rndis_interrupt_thread_stack)
_ux_utility_memory_free(rndis -> ux_slave_class_rndis_interrupt_thread_stack);
/* Delete rndis -> ux_slave_class_rndis_mutex. */
- if (rndis -> ux_slave_class_rndis_mutex.tx_mutex_id != 0)
+ if (_ux_device_mutex_created(&rndis -> ux_slave_class_rndis_mutex))
_ux_device_mutex_delete(&rndis -> ux_slave_class_rndis_mutex);
#if UX_DEVICE_ENDPOINT_BUFFER_OWNER == 1
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 d0ea2c86..253cd81a 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
@@ -1,17 +1,18 @@
/***************************************************************************
- * Copyright (c) 2024 Microsoft Corporation
- *
+ * Copyright (c) 2024 Microsoft Corporation
+ * Copyright (c) 2026-present Eclipse ThreadX contributors
+ *
* This program and the accompanying materials are made available under the
* terms of the MIT License which is available at
* https://opensource.org/licenses/MIT.
- *
+ *
* SPDX-License-Identifier: MIT
**************************************************************************/
/**************************************************************************/
/**************************************************************************/
-/** */
-/** USBX Component */
+/** */
+/** USBX Component */
/** */
/** Device RNDIS Class */
/** */
@@ -29,59 +30,38 @@
#if !defined(UX_DEVICE_STANDALONE)
-/**************************************************************************/
-/* */
-/* FUNCTION RELEASE */
-/* */
-/* _ux_device_class_rndis_interrupt_thread PORTABLE C */
+/**************************************************************************/
+/* */
+/* FUNCTION RELEASE */
+/* */
+/* _ux_device_class_rndis_interrupt_thread PORTABLE C */
/* 6.1.12 */
/* AUTHOR */
/* */
/* Chaoqiong Xiao, Microsoft Corporation */
/* */
/* DESCRIPTION */
-/* */
-/* This function is the thread of the rndis interrupt endpoint */
-/* */
-/* INPUT */
-/* */
-/* rndis_class Address of rndis class */
-/* container */
-/* */
-/* OUTPUT */
-/* */
-/* None */
-/* */
-/* CALLS */
-/* */
-/* _ux_device_stack_transfer_request Request transfer */
+/* */
+/* This function is the thread of the rndis interrupt endpoint */
+/* */
+/* INPUT */
+/* */
+/* rndis_class Address of rndis class */
+/* container */
+/* */
+/* OUTPUT */
+/* */
+/* None */
+/* */
+/* CALLS */
+/* */
+/* _ux_device_stack_transfer_request Request transfer */
/* _ux_utility_event_flags_get Get event flags */
/* _ux_device_thread_suspend Suspend thread */
-/* */
-/* CALLED BY */
-/* */
-/* ThreadX */
-/* */
-/* RELEASE HISTORY */
-/* */
-/* 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 */
-/* 01-31-2022 Chaoqiong Xiao Modified comment(s), */
-/* refined macros names, */
-/* resulting in version 6.1.10 */
-/* 04-25-2022 Chaoqiong Xiao Modified comment(s), */
-/* fixed standalone compile, */
-/* resulting in version 6.1.11 */
-/* 07-29-2022 Chaoqiong Xiao Modified comment(s), */
-/* fixed parameter/variable */
-/* names conflict C++ keyword, */
-/* resulting in version 6.1.12 */
+/* */
+/* CALLED BY */
+/* */
+/* ThreadX */
/* */
/**************************************************************************/
VOID _ux_device_class_rndis_interrupt_thread(ULONG rndis_class)
@@ -96,13 +76,13 @@ ULONG actual_flags;
/* Cast properly the rndis instance. */
UX_THREAD_EXTENSION_PTR_GET(class_ptr, UX_SLAVE_CLASS, rndis_class)
-
+
/* Get the rndis instance from this class container. */
rndis = (UX_SLAVE_CLASS_RNDIS *) class_ptr -> ux_slave_class_instance;
-
+
/* Get the pointer to the device. */
device = &_ux_system_slave -> ux_system_slave_device;
-
+
/* This thread runs forever but can be suspended or resumed. */
while(1)
{
@@ -112,25 +92,25 @@ ULONG actual_flags;
/* As long as the device is in the CONFIGURED state. */
while (device -> ux_slave_device_state == UX_DEVICE_CONFIGURED)
- {
+ {
/* Wait until we have a event sent by the application. We do not treat yet the case where a timeout based
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),
+ UX_DEVICE_CLASS_RNDIS_NEW_DEVICE_STATE_CHANGE_EVENT),
UX_OR_CLEAR, &actual_flags, UX_WAIT_FOREVER);
-
+
/* If error log is enabled, insert this error message into the log buffer. */
-
+
/* Check the completion code. */
if (status == UX_SUCCESS && (actual_flags & UX_DEVICE_CLASS_RNDIS_NEW_DEVICE_STATE_CHANGE_EVENT) == 0)
{
-
+
/* Send the request to the device controller. */
status = _ux_device_stack_transfer_request(transfer_request, UX_DEVICE_CLASS_RNDIS_INTERRUPT_RESPONSE_LENGTH,
UX_DEVICE_CLASS_RNDIS_INTERRUPT_RESPONSE_LENGTH);
-
+
/* Check error code. */
if (status != UX_SUCCESS)
@@ -138,7 +118,7 @@ ULONG actual_flags;
_ux_system_error_handler(UX_SYSTEM_LEVEL_THREAD, UX_SYSTEM_CONTEXT_CLASS, status);
}
}
-
+
/* We need to suspend ourselves. We will be resumed by the device enumeration module. */
_ux_device_thread_suspend(&rndis -> ux_slave_class_rndis_interrupt_thread);
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 995376fe..bcf1b918 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
@@ -1,5 +1,6 @@
/***************************************************************************
* Copyright (c) 2024 Microsoft Corporation
+ * Copyright (c) 2026-present Eclipse ThreadX contributors
*
* This program and the accompanying materials are made available under the
* terms of the MIT License which is available at
@@ -61,14 +62,6 @@
/* */
/* RNDIS Class */
/* */
-/* RELEASE HISTORY */
-/* */
-/* DATE NAME DESCRIPTION */
-/* */
-/* 05-19-2020 Chaoqiong Xiao Initial Version 6.0 */
-/* 09-30-2020 Chaoqiong Xiao Modified comment(s), */
-/* resulting in version 6.1 */
-/* */
/**************************************************************************/
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 a5a5ba04..d32b42c1 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
@@ -1,17 +1,18 @@
/***************************************************************************
- * Copyright (c) 2024 Microsoft Corporation
- *
+ * Copyright (c) 2024 Microsoft Corporation
+ * Copyright (c) 2026-present Eclipse ThreadX contributors
+ *
* This program and the accompanying materials are made available under the
* terms of the MIT License which is available at
* https://opensource.org/licenses/MIT.
- *
+ *
* SPDX-License-Identifier: MIT
**************************************************************************/
/**************************************************************************/
/**************************************************************************/
-/** */
-/** USBX Component */
+/** */
+/** USBX Component */
/** */
/** Device RNDIS Class */
/** */
@@ -28,45 +29,37 @@
#include "ux_device_stack.h"
-/**************************************************************************/
-/* */
-/* FUNCTION RELEASE */
-/* */
-/* _ux_device_class_rndis_msg_keep_alive PORTABLE C */
+/**************************************************************************/
+/* */
+/* FUNCTION RELEASE */
+/* */
+/* _ux_device_class_rndis_msg_keep_alive PORTABLE C */
/* 6.1 */
/* AUTHOR */
/* */
/* Chaoqiong Xiao, Microsoft Corporation */
/* */
/* DESCRIPTION */
-/* */
-/* This function analyzes and replies to the MSG KEEP_ALIVE */
-/* */
-/* INPUT */
-/* */
-/* rndis Pointer to rndis class */
-/* transfer_request Pointer to the transfer request */
-/* */
-/* OUTPUT */
-/* */
-/* None */
-/* */
-/* CALLS */
-/* */
+/* */
+/* This function analyzes and replies to the MSG KEEP_ALIVE */
+/* */
+/* INPUT */
+/* */
+/* rndis Pointer to rndis class */
+/* transfer_request Pointer to the transfer request */
+/* */
+/* OUTPUT */
+/* */
+/* None */
+/* */
+/* CALLS */
+/* */
/* _ux_utility_long_get Get 32-bit value */
/* _ux_utility_long_put Put 32-bit value */
-/* */
-/* CALLED BY */
-/* */
+/* */
+/* CALLED BY */
+/* */
/* RNDIS Class */
-/* */
-/* RELEASE HISTORY */
-/* */
-/* DATE NAME DESCRIPTION */
-/* */
-/* 05-19-2020 Chaoqiong Xiao Initial Version 6.0 */
-/* 09-30-2020 Chaoqiong Xiao Modified comment(s), */
-/* resulting in version 6.1 */
/* */
/**************************************************************************/
UINT _ux_device_class_rndis_msg_keep_alive(UX_SLAVE_CLASS_RNDIS *rndis, UX_SLAVE_TRANSFER *transfer_request)
@@ -80,29 +73,29 @@ UCHAR *rndis_response;
/* Get the pointer to the RNDIS message. */
rndis_msg = transfer_request -> ux_slave_transfer_request_data_pointer;
-
+
/* Get the request ID and keep it for the response. */
rndis -> ux_slave_class_rndis_request_id = _ux_utility_long_get(rndis_msg + UX_DEVICE_CLASS_RNDIS_MSG_KEEP_ALIVE_REQUEST_ID);
-
+
/* Now prepare the response. */
rndis_response = rndis -> ux_slave_class_rndis_response;
-
+
/* First store the command. */
_ux_utility_long_put(rndis_response + UX_DEVICE_CLASS_RNDIS_CMPLT_KEEP_ALIVE_MESSAGE_TYPE, UX_DEVICE_CLASS_RNDIS_CMPLT_KEEP_ALIVE);
-
+
/* Then the length of the response. */
_ux_utility_long_put(rndis_response + UX_DEVICE_CLASS_RNDIS_CMPLT_KEEP_ALIVE_MESSAGE_LENGTH, UX_DEVICE_CLASS_RNDIS_CMPLT_KEEP_ALIVE_RESPONSE_LENGTH);
/* Store the request ID. */
_ux_utility_long_put(rndis_response + UX_DEVICE_CLASS_RNDIS_CMPLT_KEEP_ALIVE_REQUEST_ID, rndis -> ux_slave_class_rndis_request_id);
-
+
/* Force the status to SUCCESS. */
_ux_utility_long_put(rndis_response + UX_DEVICE_CLASS_RNDIS_CMPLT_KEEP_ALIVE_STATUS, UX_DEVICE_CLASS_RNDIS_STATUS_SUCCESS);
-
+
/* Set the response length. */
rndis -> ux_slave_class_rndis_response_length = UX_DEVICE_CLASS_RNDIS_CMPLT_KEEP_ALIVE_RESPONSE_LENGTH;
/* We are done. Return UX_SUCCESS. */
- return(UX_SUCCESS);
+ return(UX_SUCCESS);
}
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 87edf93c..40952ffe 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
@@ -1,17 +1,19 @@
/***************************************************************************
- * Copyright (c) 2024 Microsoft Corporation
- *
+ * Copyright (c) 2024 Microsoft Corporation
+ * Copyright (c) 2026-present Eclipse ThreadX contributors
+ *
* This program and the accompanying materials are made available under the
* terms of the MIT License which is available at
* https://opensource.org/licenses/MIT.
- *
+ *
* SPDX-License-Identifier: MIT
**************************************************************************/
+
/**************************************************************************/
/**************************************************************************/
-/** */
-/** USBX Component */
+/** */
+/** USBX Component */
/** */
/** Device RNDIS Class */
/** */
@@ -29,49 +31,39 @@
-/**************************************************************************/
-/* */
-/* FUNCTION RELEASE */
-/* */
-/* _ux_device_class_rndis_msg_query PORTABLE C */
+/**************************************************************************/
+/* */
+/* FUNCTION RELEASE */
+/* */
+/* _ux_device_class_rndis_msg_query PORTABLE C */
/* 6.1 */
/* AUTHOR */
/* */
/* Chaoqiong Xiao, Microsoft Corporation */
/* */
/* DESCRIPTION */
-/* */
-/* This function analyzes and replies to the MSG QUERY */
-/* */
-/* INPUT */
-/* */
-/* rndis Pointer to rndis class */
-/* transfer_request Pointer to the transfer request */
-/* */
-/* OUTPUT */
-/* */
-/* None */
-/* */
-/* CALLS */
-/* */
+/* */
+/* This function analyzes and replies to the MSG QUERY */
+/* */
+/* INPUT */
+/* */
+/* rndis Pointer to rndis class */
+/* transfer_request Pointer to the transfer request */
+/* */
+/* OUTPUT */
+/* */
+/* None */
+/* */
+/* CALLS */
+/* */
/* _ux_utility_long_get Get 32-bit value */
/* _ux_utility_long_put Put 32-bit value */
/* _ux_utility_string_length_check Check and return C string length */
/* _ux_utility_memory_copy Copy memory */
-/* */
-/* CALLED BY */
-/* */
+/* */
+/* CALLED BY */
+/* */
/* RNDIS Class */
-/* */
-/* RELEASE HISTORY */
-/* */
-/* DATE NAME DESCRIPTION */
-/* */
-/* 05-19-2020 Chaoqiong Xiao Initial Version 6.0 */
-/* 09-30-2020 Chaoqiong Xiao Modified comment(s), */
-/* verified memset and memcpy */
-/* cases, */
-/* resulting in version 6.1 */
/* */
/**************************************************************************/
UINT _ux_device_class_rndis_msg_query(UX_SLAVE_CLASS_RNDIS *rndis, UX_SLAVE_TRANSFER *transfer_request)
@@ -87,10 +79,10 @@ ULONG status;
/* Get the pointer to the RNDIS message. */
rndis_msg = transfer_request -> ux_slave_transfer_request_data_pointer;
-
+
/* Get the request ID and keep it for the response. */
rndis -> ux_slave_class_rndis_request_id = _ux_utility_long_get(rndis_msg + UX_DEVICE_CLASS_RNDIS_MSG_QUERY_REQUEST_ID);
-
+
/* Get the OID. */
rndis_oid = _ux_utility_long_get(rndis_msg + UX_DEVICE_CLASS_RNDIS_MSG_QUERY_OID);
@@ -99,10 +91,10 @@ ULONG status;
/* Now prepare the response. */
rndis_response = rndis -> ux_slave_class_rndis_response;
-
+
/* First store the command. */
_ux_utility_long_put(rndis_response + UX_DEVICE_CLASS_RNDIS_CMPLT_QUERY_MESSAGE_TYPE, UX_DEVICE_CLASS_RNDIS_CMPLT_QUERY);
-
+
/* Store the request ID. */
_ux_utility_long_put(rndis_response + UX_DEVICE_CLASS_RNDIS_CMPLT_QUERY_REQUEST_ID, rndis -> ux_slave_class_rndis_request_id);
@@ -112,86 +104,86 @@ ULONG status;
/* What OID are we dealing here ? */
switch (rndis_oid)
{
-
+
case UX_DEVICE_CLASS_RNDIS_OID_GEN_SUPPORTED_LIST :
-
+
/* Supported List of OIDs. Parse each OID until the end and store it in the response buffer. */
oid_index = 0;
while (ux_device_class_rndis_oid_supported_list[oid_index] != 0)
{
/* We have found a valid OID to return. */
- _ux_utility_long_put(rndis_response + UX_DEVICE_CLASS_RNDIS_CMPLT_QUERY_INFO_BUFFER + (oid_index * sizeof(ULONG)),
+ _ux_utility_long_put(rndis_response + UX_DEVICE_CLASS_RNDIS_CMPLT_QUERY_INFO_BUFFER + (oid_index * sizeof(ULONG)),
ux_device_class_rndis_oid_supported_list[oid_index]);
/* Next OID index. */
oid_index++;
- }
-
+ }
+
/* Set the total response length. */
rndis_response_length = oid_index * (ULONG)sizeof(ULONG);
-
- break;
+
+ break;
case UX_DEVICE_CLASS_RNDIS_OID_GEN_MAXIMUM_FRAME_SIZE :
/* Set the maximum frame size. */
_ux_utility_long_put(rndis_response + UX_DEVICE_CLASS_RNDIS_CMPLT_QUERY_INFO_BUFFER, UX_DEVICE_CLASS_RNDIS_MAX_FRAME_SIZE);
-
+
/* Set the total response length. */
rndis_response_length = sizeof(ULONG);
-
+
break;
-
+
case UX_DEVICE_CLASS_RNDIS_OID_GEN_MEDIA_SUPPORTED :
/* Set the media supported. */
_ux_utility_long_put(rndis_response + UX_DEVICE_CLASS_RNDIS_CMPLT_QUERY_INFO_BUFFER, UX_DEVICE_CLASS_RNDIS_MEDIA_802_3);
-
+
/* Set the total response length. */
rndis_response_length = sizeof(ULONG);
-
+
break;
-
+
case UX_DEVICE_CLASS_RNDIS_OID_GEN_MEDIA_IN_USE :
/* Set the media in use. */
_ux_utility_long_put(rndis_response + UX_DEVICE_CLASS_RNDIS_CMPLT_QUERY_INFO_BUFFER, UX_DEVICE_CLASS_RNDIS_MEDIA_802_3);
-
+
/* Set the total response length. */
rndis_response_length = sizeof(ULONG);
-
+
break;
case UX_DEVICE_CLASS_RNDIS_OID_GEN_HARDWARE_STATUS :
/* Set the hardware status. */
_ux_utility_long_put(rndis_response + UX_DEVICE_CLASS_RNDIS_CMPLT_QUERY_INFO_BUFFER, UX_DEVICE_CLASS_RNDIS_OID_HW_STATUS_READY);
-
+
/* Set the total response length. */
rndis_response_length = sizeof(ULONG);
-
+
break;
case UX_DEVICE_CLASS_RNDIS_OID_GEN_PHYSICAL_MEDIUM :
/* Set the physical medium. */
_ux_utility_long_put(rndis_response + UX_DEVICE_CLASS_RNDIS_CMPLT_QUERY_INFO_BUFFER, 0);
-
+
/* Set the total response length. */
rndis_response_length = sizeof(ULONG);
-
+
break;
case UX_DEVICE_CLASS_RNDIS_OID_GEN_MAXIMUM_TOTAL_SIZE :
/* Set the physical medium. */
_ux_utility_long_put(rndis_response + UX_DEVICE_CLASS_RNDIS_CMPLT_QUERY_INFO_BUFFER, UX_DEVICE_CLASS_RNDIS_MAX_PACKET_LENGTH);
-
+
/* Set the total response length. */
rndis_response_length = sizeof(ULONG);
-
+
break;
@@ -199,20 +191,20 @@ ULONG status;
/* Set the link speed. For now we assume a full speed device. */
_ux_utility_long_put(rndis_response + UX_DEVICE_CLASS_RNDIS_CMPLT_QUERY_INFO_BUFFER, UX_DEVICE_CLASS_RNDIS_LINK_SPEED_FS);
-
+
/* Set the total response length. */
rndis_response_length = sizeof(ULONG);
-
+
break;
case UX_DEVICE_CLASS_RNDIS_OID_GEN_MEDIA_CONNECT_STATUS :
/* Set the media connection status. */
_ux_utility_long_put(rndis_response + UX_DEVICE_CLASS_RNDIS_CMPLT_QUERY_INFO_BUFFER, UX_DEVICE_CLASS_RNDIS_MEDIA_CONNECTED);
-
+
/* Set the total response length. */
rndis_response_length = sizeof(ULONG);
-
+
break;
@@ -220,33 +212,33 @@ ULONG status;
/* Set the MAC options. */
_ux_utility_long_put(rndis_response + UX_DEVICE_CLASS_RNDIS_CMPLT_QUERY_INFO_BUFFER, UX_DEVICE_CLASS_RNDIS_MAC_OPTIONS);
-
+
/* Set the total response length. */
rndis_response_length = sizeof(ULONG);
-
+
break;
case UX_DEVICE_CLASS_RNDIS_OID_GEN_VENDOR_ID :
/* Set the vendor ID. */
_ux_utility_long_put(rndis_response + UX_DEVICE_CLASS_RNDIS_CMPLT_QUERY_INFO_BUFFER, rndis -> ux_slave_class_rndis_parameter.ux_slave_class_rndis_parameter_vendor_id);
-
+
/* Set the total response length. */
rndis_response_length = sizeof(ULONG);
break;
-
+
case UX_DEVICE_CLASS_RNDIS_OID_GEN_DRIVER_VERSION :
/* Set the driver version. */
_ux_utility_long_put(rndis_response + UX_DEVICE_CLASS_RNDIS_CMPLT_QUERY_INFO_BUFFER, rndis -> ux_slave_class_rndis_parameter.ux_slave_class_rndis_parameter_driver_version);
-
+
/* Set the total response length. */
rndis_response_length = sizeof(ULONG);
break;
-
-
+
+
case UX_DEVICE_CLASS_RNDIS_OID_GEN_VENDOR_DESCRIPTION :
/* Get the string length for the vendor description. */
@@ -261,100 +253,110 @@ ULONG status;
_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;
-
+
case UX_DEVICE_CLASS_RNDIS_OID_GEN_XMIT_OK :
/* Set the appropriate statistic value. */
_ux_utility_long_put(rndis_response + UX_DEVICE_CLASS_RNDIS_CMPLT_QUERY_INFO_BUFFER, rndis -> ux_slave_class_rndis_statistics_xmit_ok);
-
+
/* Set the total response length. */
rndis_response_length = sizeof(ULONG);
-
+
break;
case UX_DEVICE_CLASS_RNDIS_OID_GEN_RCV_OK :
/* Set the appropriate statistic value. */
_ux_utility_long_put(rndis_response + UX_DEVICE_CLASS_RNDIS_CMPLT_QUERY_INFO_BUFFER, rndis -> ux_slave_class_rndis_statistics_rcv_ok);
-
+
/* Set the total response length. */
rndis_response_length = sizeof(ULONG);
-
+
break;
case UX_DEVICE_CLASS_RNDIS_OID_GEN_XMIT_ERROR :
/* Set the appropriate statistic value. */
_ux_utility_long_put(rndis_response + UX_DEVICE_CLASS_RNDIS_CMPLT_QUERY_INFO_BUFFER, rndis -> ux_slave_class_rndis_statistics_xmit_error);
-
+
/* Set the total response length. */
rndis_response_length = sizeof(ULONG);
-
+
break;
case UX_DEVICE_CLASS_RNDIS_OID_GEN_RCV_ERROR :
/* Set the appropriate statistic value. */
_ux_utility_long_put(rndis_response + UX_DEVICE_CLASS_RNDIS_CMPLT_QUERY_INFO_BUFFER, rndis -> ux_slave_class_rndis_statistics_rcv_error);
-
+
/* Set the total response length. */
rndis_response_length = sizeof(ULONG);
-
+
break;
case UX_DEVICE_CLASS_RNDIS_OID_GEN_RCV_NO_BUFFER :
/* Set the appropriate statistic value. */
_ux_utility_long_put(rndis_response + UX_DEVICE_CLASS_RNDIS_CMPLT_QUERY_INFO_BUFFER, rndis -> ux_slave_class_rndis_statistics_rcv_no_buffer);
-
+
/* Set the total response length. */
rndis_response_length = sizeof(ULONG);
-
+
break;
case UX_DEVICE_CLASS_RNDIS_OID_802_3_CURRENT_ADDRESS :
-
-
+
+
/* Save the Hardware address in the return message. */
- _ux_utility_memory_copy(rndis_response + UX_DEVICE_CLASS_RNDIS_CMPLT_QUERY_INFO_BUFFER,
+ _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); /* Use case of memcpy is verified. */
/* Set the total response length. */
rndis_response_length = UX_DEVICE_CLASS_RNDIS_NODE_ID_LENGTH;
-
- break;
+ break;
+
+ case UX_DEVICE_CLASS_RNDIS_OID_802_3_PERMANENT_ADDRESS :
+
+ /* 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); /* Use case of memcpy is verified. */
+
+ /* Set the total response length. */
+ rndis_response_length = UX_DEVICE_CLASS_RNDIS_NODE_ID_LENGTH;
+
+ break;
default :
/* Just return zero ULONG field. */
_ux_utility_long_put(rndis_response + UX_DEVICE_CLASS_RNDIS_CMPLT_QUERY_INFO_BUFFER, 0);
-
+
/* Set the total response length. */
rndis_response_length = sizeof(ULONG);
-
+
break;
}
-
+
/* Set the status field. */
_ux_utility_long_put(rndis_response + UX_DEVICE_CLASS_RNDIS_CMPLT_QUERY_STATUS, status);
/* Set the buffer offset value. */
- _ux_utility_long_put(rndis_response + UX_DEVICE_CLASS_RNDIS_CMPLT_QUERY_INFO_BUFFER_OFFSET,
+ _ux_utility_long_put(rndis_response + UX_DEVICE_CLASS_RNDIS_CMPLT_QUERY_INFO_BUFFER_OFFSET,
(UX_DEVICE_CLASS_RNDIS_CMPLT_QUERY_INFO_BUFFER - UX_DEVICE_CLASS_RNDIS_CMPLT_QUERY_REQUEST_ID));
-
+
/* Store the length of the buffer. */
- _ux_utility_long_put(rndis_response + UX_DEVICE_CLASS_RNDIS_CMPLT_QUERY_INFO_BUFFER_LENGTH, rndis_response_length);
+ _ux_utility_long_put(rndis_response + UX_DEVICE_CLASS_RNDIS_CMPLT_QUERY_INFO_BUFFER_LENGTH, rndis_response_length);
/* Update the response length to add the header. */
rndis_response_length += UX_DEVICE_CLASS_RNDIS_CMPLT_QUERY_INFO_BUFFER;
-
+
/* Set the response length. */
rndis -> ux_slave_class_rndis_response_length = rndis_response_length;
_ux_utility_long_put(rndis_response + UX_DEVICE_CLASS_RNDIS_CMPLT_QUERY_MESSAGE_LENGTH, rndis_response_length);
/* We are done. Return UX_SUCCESS. */
- return(status);
+ return(status);
}
-
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 7fadcd19..6ac89dc4 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
@@ -1,17 +1,18 @@
/***************************************************************************
- * Copyright (c) 2024 Microsoft Corporation
- *
+ * Copyright (c) 2024 Microsoft Corporation
+ * Copyright (c) 2026-present Eclipse ThreadX contributors
+ *
* This program and the accompanying materials are made available under the
* terms of the MIT License which is available at
* https://opensource.org/licenses/MIT.
- *
+ *
* SPDX-License-Identifier: MIT
**************************************************************************/
/**************************************************************************/
/**************************************************************************/
-/** */
-/** USBX Component */
+/** */
+/** USBX Component */
/** */
/** Device RNDIS Class */
/** */
@@ -28,44 +29,36 @@
#include "ux_device_stack.h"
-/**************************************************************************/
-/* */
-/* FUNCTION RELEASE */
-/* */
-/* _ux_device_class_rndis_msg_reset PORTABLE C */
+/**************************************************************************/
+/* */
+/* FUNCTION RELEASE */
+/* */
+/* _ux_device_class_rndis_msg_reset PORTABLE C */
/* 6.1 */
/* AUTHOR */
/* */
/* Chaoqiong Xiao, Microsoft Corporation */
/* */
/* DESCRIPTION */
-/* */
-/* This function analyzes and replies to the MSG RESET */
-/* */
-/* INPUT */
-/* */
-/* rndis Pointer to rndis class */
-/* transfer_request Pointer to the transfer request */
-/* */
-/* OUTPUT */
-/* */
-/* None */
-/* */
-/* CALLS */
-/* */
+/* */
+/* This function analyzes and replies to the MSG RESET */
+/* */
+/* INPUT */
+/* */
+/* rndis Pointer to rndis class */
+/* transfer_request Pointer to the transfer request */
+/* */
+/* OUTPUT */
+/* */
+/* None */
+/* */
+/* CALLS */
+/* */
/* _ux_utility_long_put Put 32-bit value */
-/* */
-/* CALLED BY */
-/* */
+/* */
+/* CALLED BY */
+/* */
/* RNDIS Class */
-/* */
-/* RELEASE HISTORY */
-/* */
-/* DATE NAME DESCRIPTION */
-/* */
-/* 05-19-2020 Chaoqiong Xiao Initial Version 6.0 */
-/* 09-30-2020 Chaoqiong Xiao Modified comment(s), */
-/* resulting in version 6.1 */
/* */
/**************************************************************************/
UINT _ux_device_class_rndis_msg_reset(UX_SLAVE_CLASS_RNDIS *rndis, UX_SLAVE_TRANSFER *transfer_request)
@@ -80,23 +73,23 @@ UCHAR *rndis_response;
/* Now prepare the response. */
rndis_response = rndis -> ux_slave_class_rndis_response;
-
+
/* First store the command. */
_ux_utility_long_put(rndis_response + UX_DEVICE_CLASS_RNDIS_CMPLT_RESET_MESSAGE_TYPE, UX_DEVICE_CLASS_RNDIS_CMPLT_RESET);
-
+
/* Then the length of the response. */
_ux_utility_long_put(rndis_response + UX_DEVICE_CLASS_RNDIS_CMPLT_RESET_MESSAGE_LENGTH, UX_DEVICE_CLASS_RNDIS_CMPLT_RESET_RESPONSE_LENGTH);
/* Force the status to SUCCESS. */
_ux_utility_long_put(rndis_response + UX_DEVICE_CLASS_RNDIS_CMPLT_RESET_STATUS, UX_DEVICE_CLASS_RNDIS_STATUS_SUCCESS);
-
+
/* Set Addressing Reset field: no need to resend multicast address list. */
_ux_utility_long_put(rndis_response + UX_DEVICE_CLASS_RNDIS_CMPLT_RESET_ADDRESSING_RESET, 0);
-
+
/* Set the response length. */
rndis -> ux_slave_class_rndis_response_length = UX_DEVICE_CLASS_RNDIS_CMPLT_RESET_RESPONSE_LENGTH;
/* We are done. Return UX_SUCCESS. */
- return(UX_SUCCESS);
+ return(UX_SUCCESS);
}
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 58ef0e84..72aee8d6 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
@@ -1,17 +1,18 @@
/***************************************************************************
- * Copyright (c) 2024 Microsoft Corporation
- *
+ * Copyright (c) 2024 Microsoft Corporation
+ * Copyright (c) 2026-present Eclipse ThreadX contributors
+ *
* This program and the accompanying materials are made available under the
* terms of the MIT License which is available at
* https://opensource.org/licenses/MIT.
- *
+ *
* SPDX-License-Identifier: MIT
**************************************************************************/
/**************************************************************************/
/**************************************************************************/
-/** */
-/** USBX Component */
+/** */
+/** USBX Component */
/** */
/** Device RNDIS Class */
/** */
@@ -27,45 +28,37 @@
#include "ux_device_class_rndis.h"
#include "ux_device_stack.h"
-/**************************************************************************/
-/* */
-/* FUNCTION RELEASE */
-/* */
-/* _ux_device_class_rndis_msg_set PORTABLE C */
+/**************************************************************************/
+/* */
+/* FUNCTION RELEASE */
+/* */
+/* _ux_device_class_rndis_msg_set PORTABLE C */
/* 6.1 */
/* AUTHOR */
/* */
/* Chaoqiong Xiao, Microsoft Corporation */
/* */
/* DESCRIPTION */
-/* */
-/* This function analyzes and replies to the MSG SET */
-/* */
-/* INPUT */
-/* */
-/* rndis Pointer to rndis class */
-/* transfer_request Pointer to the transfer request */
-/* */
-/* OUTPUT */
-/* */
-/* None */
-/* */
-/* CALLS */
-/* */
+/* */
+/* This function analyzes and replies to the MSG SET */
+/* */
+/* INPUT */
+/* */
+/* rndis Pointer to rndis class */
+/* transfer_request Pointer to the transfer request */
+/* */
+/* OUTPUT */
+/* */
+/* None */
+/* */
+/* CALLS */
+/* */
/* _ux_utility_long_get Get 32-bit value */
/* _ux_utility_long_put Put 32-bit value */
-/* */
-/* CALLED BY */
-/* */
+/* */
+/* CALLED BY */
+/* */
/* RNDIS Class */
-/* */
-/* RELEASE HISTORY */
-/* */
-/* DATE NAME DESCRIPTION */
-/* */
-/* 05-19-2020 Chaoqiong Xiao Initial Version 6.0 */
-/* 09-30-2020 Chaoqiong Xiao Modified comment(s), */
-/* resulting in version 6.1 */
/* */
/**************************************************************************/
UINT _ux_device_class_rndis_msg_set(UX_SLAVE_CLASS_RNDIS *rndis, UX_SLAVE_TRANSFER *transfer_request)
@@ -78,10 +71,10 @@ ULONG status;
/* Get the pointer to the RNDIS message. */
rndis_msg = transfer_request -> ux_slave_transfer_request_data_pointer;
-
+
/* Get the request ID and keep it for the response. */
rndis -> ux_slave_class_rndis_request_id = _ux_utility_long_get(rndis_msg + UX_DEVICE_CLASS_RNDIS_MSG_SET_REQUEST_ID);
-
+
/* Get the OID. */
rndis_oid = _ux_utility_long_get(rndis_msg + UX_DEVICE_CLASS_RNDIS_MSG_SET_OID);
@@ -90,10 +83,10 @@ ULONG status;
/* Now prepare the response. */
rndis_response = rndis -> ux_slave_class_rndis_response;
-
+
/* First store the command. */
_ux_utility_long_put(rndis_response + UX_DEVICE_CLASS_RNDIS_CMPLT_SET_MESSAGE_TYPE, UX_DEVICE_CLASS_RNDIS_CMPLT_SET);
-
+
/* Store the request ID. */
_ux_utility_long_put(rndis_response + UX_DEVICE_CLASS_RNDIS_CMPLT_SET_REQUEST_ID, rndis -> ux_slave_class_rndis_request_id);
@@ -103,7 +96,7 @@ ULONG status;
/* What OID are we dealing here ? No need to treat OIDs but not sure so leave the code as is for now. */
switch (rndis_oid)
{
-
+
case UX_DEVICE_CLASS_RNDIS_OID_GEN_SUPPORTED_LIST :
case UX_DEVICE_CLASS_RNDIS_OID_GEN_MAXIMUM_FRAME_SIZE :
case UX_DEVICE_CLASS_RNDIS_OID_GEN_MEDIA_SUPPORTED :
@@ -122,15 +115,15 @@ ULONG status;
break;
}
-
+
/* Set the status field. */
_ux_utility_long_put(rndis_response + UX_DEVICE_CLASS_RNDIS_CMPLT_SET_STATUS, status);
-
+
/* Set the response length. */
rndis -> ux_slave_class_rndis_response_length = UX_DEVICE_CLASS_RNDIS_CMPLT_SET_RESPONSE_LENGTH;
_ux_utility_long_put(rndis_response + UX_DEVICE_CLASS_RNDIS_CMPLT_SET_MESSAGE_LENGTH, UX_DEVICE_CLASS_RNDIS_CMPLT_SET_RESPONSE_LENGTH);
/* We are done. Return UX_SUCCESS. */
- return(status);
+ return(status);
}
diff --git a/common/usbx_device_classes/src/ux_device_class_rndis_uninitialize.c b/common/usbx_device_classes/src/ux_device_class_rndis_uninitialize.c
index b36f5a63..0356fcd2 100644
--- a/common/usbx_device_classes/src/ux_device_class_rndis_uninitialize.c
+++ b/common/usbx_device_classes/src/ux_device_class_rndis_uninitialize.c
@@ -1,5 +1,6 @@
/***************************************************************************
* Copyright (c) 2024 Microsoft Corporation
+ * Copyright (c) 2026-present Eclipse ThreadX contributors
*
* This program and the accompanying materials are made available under the
* terms of the MIT License which is available at
@@ -63,12 +64,6 @@
/* */
/* Device RNDIS Class */
/* */
-/* RELEASE HISTORY */
-/* */
-/* DATE NAME DESCRIPTION */
-/* */
-/* xx-xx-xxxx Mohamed ayed Initial Version 6.x */
-/* */
/**************************************************************************/
UINT _ux_device_class_rndis_uninitialize(UX_SLAVE_CLASS_COMMAND *command)
{
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 7aa17650..bb588651 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
@@ -1,17 +1,18 @@
/***************************************************************************
- * Copyright (c) 2024 Microsoft Corporation
- *
+ * Copyright (c) 2024 Microsoft Corporation
+ * Copyright (c) 2026-present Eclipse ThreadX contributors
+ *
* This program and the accompanying materials are made available under the
* terms of the MIT License which is available at
* https://opensource.org/licenses/MIT.
- *
+ *
* SPDX-License-Identifier: MIT
**************************************************************************/
/**************************************************************************/
/**************************************************************************/
-/** */
-/** USBX Component */
+/** */
+/** USBX Component */
/** */
/** Device RNDIS Class */
/** */
@@ -28,53 +29,39 @@
#include "ux_device_stack.h"
-/**************************************************************************/
-/* */
-/* FUNCTION RELEASE */
-/* */
-/* _ux_device_class_rndis_write PORTABLE C */
+/**************************************************************************/
+/* */
+/* FUNCTION RELEASE */
+/* */
+/* _ux_device_class_rndis_write PORTABLE C */
/* 6.1.11 */
/* AUTHOR */
/* */
/* Chaoqiong Xiao, Microsoft Corporation */
/* */
/* DESCRIPTION */
-/* */
-/* This function writes a packet into a queue for later thread */
-/* processing. */
-/* */
-/* INPUT */
-/* */
-/* rndis Address of rndis class */
-/* instance */
-/* */
-/* OUTPUT */
-/* */
-/* None */
-/* */
-/* CALLS */
-/* */
+/* */
+/* This function writes a packet into a queue for later thread */
+/* processing. */
+/* */
+/* INPUT */
+/* */
+/* rndis Address of rndis class */
+/* instance */
+/* */
+/* OUTPUT */
+/* */
+/* None */
+/* */
+/* CALLS */
+/* */
/* _ux_device_mutex_on Take mutex */
/* _ux_device_mutex_off Free mutex */
/* _ux_device_event_flags_set Set event flags */
-/* */
-/* CALLED BY */
-/* */
-/* ThreadX */
-/* */
-/* RELEASE HISTORY */
-/* */
-/* 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 */
-/* 04-25-2022 Chaoqiong Xiao Modified comment(s), */
-/* fixed standalone compile, */
-/* resulting in version 6.1.11 */
+/* */
+/* CALLED BY */
+/* */
+/* ThreadX */
/* */
/**************************************************************************/
UINT _ux_device_class_rndis_write(VOID *rndis_class, NX_PACKET *packet)
@@ -94,17 +81,17 @@ UX_SLAVE_CLASS_RNDIS *rndis;
/* Protect this thread. */
_ux_device_mutex_on(&rndis -> ux_slave_class_rndis_mutex);
-
+
/* Check the queue. See if there is something that is being sent. */
if (rndis -> ux_slave_class_rndis_xmit_queue == UX_NULL)
-
+
/* Memorize this packet at the beginning of the queue. */
rndis -> ux_slave_class_rndis_xmit_queue = packet;
-
+
else
-
+
{
-
+
/* We get here when there is something in the queue. */
current_packet = rndis -> ux_slave_class_rndis_xmit_queue;
@@ -116,7 +103,7 @@ UX_SLAVE_CLASS_RNDIS *rndis;
{
/* Remember the current packet. */
current_packet = next_packet;
-
+
/* See what the next packet in the chain is. */
next_packet = current_packet -> nx_packet_queue_next;
}
@@ -128,14 +115,14 @@ UX_SLAVE_CLASS_RNDIS *rndis;
/* Free Mutex resource. */
_ux_device_mutex_off(&rndis -> ux_slave_class_rndis_mutex);
-
+
/* The packet to be sent is the last in the chain. */
packet -> nx_packet_queue_next = NX_NULL;
/* Set an event to wake up the bulkin thread. */
- _ux_device_event_flags_set(&rndis -> ux_slave_class_rndis_event_flags_group, UX_DEVICE_CLASS_RNDIS_NEW_BULKIN_EVENT, UX_OR);
+ _ux_device_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);
+ return(UX_SUCCESS);
#endif
}
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 b868c497..d3cfd298 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
@@ -1,18 +1,19 @@
/***************************************************************************
- * Copyright (c) 2024 Microsoft Corporation
- *
+ * Copyright (c) 2024 Microsoft Corporation
+ * Copyright (c) 2026-present Eclipse ThreadX contributors
+ *
* This program and the accompanying materials are made available under the
* terms of the MIT License which is available at
* https://opensource.org/licenses/MIT.
- *
+ *
* SPDX-License-Identifier: MIT
**************************************************************************/
/**************************************************************************/
/**************************************************************************/
-/** */
-/** USBX Component */
+/** */
+/** USBX Component */
/** */
/** Device Storage Class */
/** */
@@ -29,63 +30,45 @@
#include "ux_device_stack.h"
-/**************************************************************************/
-/* */
-/* FUNCTION RELEASE */
-/* */
-/* _ux_device_class_storage_activate PORTABLE C */
+/**************************************************************************/
+/* */
+/* FUNCTION RELEASE */
+/* */
+/* _ux_device_class_storage_activate PORTABLE C */
/* 6.3.0 */
/* AUTHOR */
/* */
/* Chaoqiong Xiao, Microsoft Corporation */
/* */
/* DESCRIPTION */
-/* */
-/* This function activates the USB storage device. */
-/* */
-/* INPUT */
-/* */
-/* command Pointer to storage command */
-/* */
-/* OUTPUT */
-/* */
-/* Completion Status */
-/* */
-/* CALLS */
-/* */
-/* _ux_device_thread_resume Resume thread */
-/* */
-/* CALLED BY */
-/* */
-/* Device Storage Class */
-/* */
-/* RELEASE HISTORY */
-/* */
-/* DATE NAME DESCRIPTION */
-/* */
-/* 05-19-2020 Chaoqiong Xiao Initial Version 6.0 */
-/* 09-30-2020 Chaoqiong Xiao Modified comment(s), */
-/* resulting in version 6.1 */
-/* 01-31-2022 Chaoqiong Xiao Modified comment(s), */
-/* added standalone support, */
-/* resulting in version 6.1.10 */
-/* 07-29-2022 Chaoqiong Xiao Modified comment(s), */
-/* fixed parameter/variable */
-/* names conflict C++ keyword, */
-/* resulting in version 6.1.12 */
-/* 10-31-2023 Chaoqiong Xiao Modified comment(s), */
-/* added a new mode to manage */
-/* endpoint buffer in classes, */
-/* resulting in version 6.3.0 */
+/* */
+/* This function activates the USB storage device. */
+/* */
+/* INPUT */
+/* */
+/* command Pointer to storage command */
+/* */
+/* OUTPUT */
+/* */
+/* Completion Status */
+/* */
+/* CALLS */
+/* */
+/* _ux_device_thread_resume Resume thread */
+/* */
+/* CALLED BY */
+/* */
+/* Device Storage Class */
/* */
/**************************************************************************/
UINT _ux_device_class_storage_activate(UX_SLAVE_CLASS_COMMAND *command)
{
-
+
UINT status = UX_SUCCESS;
UX_SLAVE_INTERFACE *interface_ptr;
UX_SLAVE_CLASS *class_ptr;
UX_SLAVE_CLASS_STORAGE *storage;
+ULONG lun_index;
#if defined(UX_DEVICE_STANDALONE)
UX_SLAVE_ENDPOINT *endpoint;
#endif
@@ -99,17 +82,17 @@ UX_SLAVE_ENDPOINT *endpoint;
/* Get the interface that owns this instance. */
interface_ptr = (UX_SLAVE_INTERFACE *) command -> ux_slave_class_command_interface;
-
+
/* Store the class instance into the interface. */
interface_ptr -> ux_slave_interface_class_instance = (VOID *)storage;
-
+
/* Now the opposite, store the interface in the class instance. */
storage -> ux_slave_class_storage_interface = interface_ptr;
#if !defined(UX_DEVICE_STANDALONE)
/* Resume thread. */
- _ux_device_thread_resume(&class_ptr -> ux_slave_class_thread);
+ _ux_device_thread_resume(&class_ptr -> ux_slave_class_thread);
#else
@@ -130,7 +113,7 @@ UX_SLAVE_ENDPOINT *endpoint;
/* We found the IN endpoint first. */
storage -> ux_device_class_storage_ep_in = endpoint;
-
+
/* So the next endpoint has to be the OUT endpoint. */
storage -> ux_device_class_storage_ep_out = endpoint -> ux_slave_endpoint_next_endpoint;
}
@@ -162,13 +145,20 @@ UX_SLAVE_ENDPOINT *endpoint;
status = UX_SUCCESS;
#endif
+ /* Default when activating storage device: media removal is allowed (not prevented) and loaded. */
+ for (lun_index = 0; lun_index < storage -> ux_slave_class_storage_number_lun; lun_index++)
+ {
+ storage -> ux_slave_class_storage_lun[lun_index].ux_slave_class_storage_prevent_medium_removal = 0;
+ storage -> ux_slave_class_storage_lun[lun_index].ux_slave_class_storage_medium_loaded_status = 1;
+ }
+
/* If there is a activate function call it. */
if (storage -> ux_slave_class_storage_instance_activate != UX_NULL)
- {
+ {
/* Invoke the application. */
storage -> ux_slave_class_storage_instance_activate(storage);
}
-
+
/* If trace is enabled, insert this event into the trace buffer. */
UX_TRACE_IN_LINE_INSERT(UX_TRACE_DEVICE_CLASS_STORAGE_ACTIVATE, storage, 0, 0, 0, UX_TRACE_DEVICE_CLASS_EVENTS, 0, 0)
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 691fbc00..2010a8ec 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
@@ -1,18 +1,19 @@
/***************************************************************************
- * Copyright (c) 2024 Microsoft Corporation
- *
+ * Copyright (c) 2024 Microsoft Corporation
+ * Copyright (c) 2026-present Eclipse ThreadX contributors
+ *
* This program and the accompanying materials are made available under the
* terms of the MIT License which is available at
* https://opensource.org/licenses/MIT.
- *
+ *
* SPDX-License-Identifier: MIT
**************************************************************************/
/**************************************************************************/
/**************************************************************************/
-/** */
-/** USBX Component */
+/** */
+/** USBX Component */
/** */
/** Device Storage Class */
/** */
@@ -29,56 +30,37 @@
#include "ux_device_stack.h"
-/**************************************************************************/
-/* */
-/* FUNCTION RELEASE */
-/* */
-/* _ux_device_class_storage_control_request PORTABLE C */
+/**************************************************************************/
+/* */
+/* FUNCTION RELEASE */
+/* */
+/* _ux_device_class_storage_control_request PORTABLE C */
/* 6.1.12 */
/* AUTHOR */
/* */
/* Chaoqiong Xiao, Microsoft Corporation */
/* */
/* DESCRIPTION */
-/* */
-/* This function manages the based sent by the host on the control */
-/* endpoints with a CLASS or VENDOR SPECIFIC type. */
-/* */
-/* INPUT */
-/* */
-/* storage Pointer to storage class */
-/* */
-/* OUTPUT */
-/* */
-/* None */
-/* */
-/* CALLS */
-/* */
-/* _ux_device_stack_transfer_request Transfer request */
+/* */
+/* This function manages the based sent by the host on the control */
+/* endpoints with a CLASS or VENDOR SPECIFIC type. */
+/* */
+/* INPUT */
+/* */
+/* storage Pointer to storage class */
+/* */
+/* OUTPUT */
+/* */
+/* None */
+/* */
+/* CALLS */
+/* */
+/* _ux_device_stack_transfer_request Transfer request */
/* _ux_device_stack_transfer_abort Abort Transfer */
-/* */
-/* CALLED BY */
-/* */
+/* */
+/* CALLED BY */
+/* */
/* Device Storage Class */
-/* */
-/* RELEASE HISTORY */
-/* */
-/* 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 */
-/* 12-31-2020 Chaoqiong Xiao Modified comment(s), */
-/* fixed USB CV test issues, */
-/* resulting in version 6.1.3 */
-/* 01-31-2022 Chaoqiong Xiao Modified comment(s), */
-/* added standalone support, */
-/* resulting in version 6.1.10 */
-/* 07-29-2022 Chaoqiong Xiao Modified comment(s), */
-/* fixed parameter/variable */
-/* names conflict C++ keyword, */
-/* resulting in version 6.1.12 */
/* */
/**************************************************************************/
UINT _ux_device_class_storage_control_request(UX_SLAVE_CLASS_COMMAND *command)
@@ -103,7 +85,7 @@ UX_SLAVE_ENDPOINT *endpoint_out;
/* Get the pointer to the transfer request associated with the control endpoint. */
transfer_request = &device -> ux_slave_device_control_endpoint.ux_slave_endpoint_transfer_request;
-
+
/* Extract the request type from the SETUP packet.. */
request = *(transfer_request -> ux_slave_transfer_request_setup + UX_SETUP_REQUEST);
request_value = _ux_utility_short_get(transfer_request -> ux_slave_transfer_request_setup + UX_SETUP_VALUE);
@@ -115,7 +97,7 @@ UX_SLAVE_ENDPOINT *endpoint_out;
/* Get the class container. */
class_ptr = command -> ux_slave_class_command_class_ptr;
-
+
/* Get the storage instance from this class container. */
storage = (UX_SLAVE_CLASS_STORAGE *) class_ptr -> ux_slave_class_instance;
@@ -139,14 +121,14 @@ UX_SLAVE_ENDPOINT *endpoint_out;
/* Locate the endpoints. */
endpoint_in = interface_ptr -> ux_slave_interface_first_endpoint;
-
+
/* Check the endpoint direction, if IN we have the correct endpoint. */
if ((endpoint_in -> ux_slave_endpoint_descriptor.bEndpointAddress & UX_ENDPOINT_DIRECTION) != UX_ENDPOINT_IN)
{
/* Wrong direction, we found the OUT endpoint first. */
endpoint_out = endpoint_in;
-
+
/* So the next endpoint has to be the IN endpoint. */
endpoint_in = endpoint_out -> ux_slave_endpoint_next_endpoint;
}
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 10972d3e..c1b11cd0 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
@@ -1,18 +1,19 @@
/***************************************************************************
- * Copyright (c) 2024 Microsoft Corporation
- *
+ * Copyright (c) 2024 Microsoft Corporation
+ * Copyright (c) 2026-present Eclipse ThreadX contributors
+ *
* This program and the accompanying materials are made available under the
* terms of the MIT License which is available at
* https://opensource.org/licenses/MIT.
- *
+ *
* SPDX-License-Identifier: MIT
**************************************************************************/
/**************************************************************************/
/**************************************************************************/
-/** */
-/** USBX Component */
+/** */
+/** USBX Component */
/** */
/** Device Storage Class */
/** */
@@ -33,69 +34,45 @@
/* Build option checked runtime by UX_ASSERT */
#endif
-/**************************************************************************/
-/* */
-/* FUNCTION RELEASE */
-/* */
-/* _ux_device_class_storage_csw_send PORTABLE C */
+/**************************************************************************/
+/* */
+/* FUNCTION RELEASE */
+/* */
+/* _ux_device_class_storage_csw_send PORTABLE C */
/* 6.3.0 */
/* AUTHOR */
/* */
/* Chaoqiong Xiao, Microsoft Corporation */
/* */
/* DESCRIPTION */
-/* */
-/* This function sends the status phase of SCSI transaction. Note that */
-/* dCSWDataResidue is always set to 0 because we either transfer all */
-/* the data, or report command failure. */
-/* */
-/* INPUT */
-/* */
-/* storage Pointer to storage class */
-/* endpoint_in Pointer to IN endpoint */
-/* status Status of CSW */
-/* */
-/* OUTPUT */
-/* */
-/* Completion Status */
-/* */
-/* CALLS */
-/* */
-/* _ux_device_stack_transfer_request Transfer request */
-/* _ux_utility_long_put Put long word */
-/* _ux_utility_memory_copy Copy memory */
-/* _ux_utility_memory_set Set memory */
-/* */
-/* CALLED BY */
-/* */
+/* */
+/* This function sends the status phase of SCSI transaction. Note that */
+/* dCSWDataResidue is always set to 0 because we either transfer all */
+/* the data, or report command failure. */
+/* */
+/* INPUT */
+/* */
+/* storage Pointer to storage class */
+/* endpoint_in Pointer to IN endpoint */
+/* status Status of CSW */
+/* */
+/* OUTPUT */
+/* */
+/* Completion Status */
+/* */
+/* CALLS */
+/* */
+/* _ux_device_stack_transfer_request Transfer request */
+/* _ux_utility_long_put Put long word */
+/* _ux_utility_memory_copy Copy memory */
+/* _ux_utility_memory_set Set memory */
+/* */
+/* CALLED BY */
+/* */
/* Device Storage Class */
-/* */
-/* RELEASE HISTORY */
-/* */
-/* 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 */
-/* 12-31-2020 Chaoqiong Xiao Modified comment(s), */
-/* fixed USB CV test issues, */
-/* resulting in version 6.1.3 */
-/* 10-15-2021 Chaoqiong Xiao Modified comment(s), */
-/* improved TAG management, */
-/* resulting in version 6.1.9 */
-/* 01-31-2022 Chaoqiong Xiao Modified comment(s), */
-/* added standalone support, */
-/* resulting in version 6.1.10 */
-/* 10-31-2023 Chaoqiong Xiao Modified comment(s), */
-/* checked compiling options */
-/* by runtime UX_ASSERT, */
-/* resulting in version 6.3.0 */
/* */
/**************************************************************************/
-UINT _ux_device_class_storage_csw_send(UX_SLAVE_CLASS_STORAGE *storage, ULONG lun,
+UINT _ux_device_class_storage_csw_send(UX_SLAVE_CLASS_STORAGE *storage, ULONG lun,
UX_SLAVE_ENDPOINT *endpoint_in, UCHAR csw_status)
{
@@ -158,10 +135,10 @@ UCHAR *csw_buffer;
#else
/* 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.
+ a CLEAR_FEATURE. We will wait until the host clears the endpoint.
The transfer_request function does that. */
/* Send the CSW back to the host. */
- status = _ux_device_stack_transfer_request(transfer_request, UX_SLAVE_CLASS_STORAGE_CSW_LENGTH,
+ status = _ux_device_stack_transfer_request(transfer_request, UX_SLAVE_CLASS_STORAGE_CSW_LENGTH,
UX_SLAVE_CLASS_STORAGE_CSW_LENGTH);
#endif
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 9e7c17bd..1e9fc425 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
@@ -1,18 +1,19 @@
/***************************************************************************
- * Copyright (c) 2024 Microsoft Corporation
- *
+ * Copyright (c) 2024 Microsoft Corporation
+ * Copyright (c) 2026-present Eclipse ThreadX contributors
+ *
* This program and the accompanying materials are made available under the
* terms of the MIT License which is available at
* https://opensource.org/licenses/MIT.
- *
+ *
* SPDX-License-Identifier: MIT
**************************************************************************/
/**************************************************************************/
/**************************************************************************/
-/** */
-/** USBX Component */
+/** */
+/** USBX Component */
/** */
/** Device Storage Class */
/** */
@@ -29,55 +30,40 @@
#include "ux_device_stack.h"
-/**************************************************************************/
-/* */
-/* FUNCTION RELEASE */
-/* */
-/* _ux_device_class_storage_deactivate PORTABLE C */
+/**************************************************************************/
+/* */
+/* FUNCTION RELEASE */
+/* */
+/* _ux_device_class_storage_deactivate PORTABLE C */
/* 6.1.12 */
/* AUTHOR */
/* */
/* Chaoqiong Xiao, Microsoft Corporation */
/* */
/* DESCRIPTION */
-/* */
-/* This function deactivate an instance of the storage class. */
-/* */
-/* INPUT */
-/* */
-/* command Pointer to a class command */
-/* */
-/* OUTPUT */
-/* */
-/* Completion Status */
-/* */
-/* CALLS */
-/* */
-/* _ux_device_stack_transfer_all_request_abort Abort all transfers */
-/* */
-/* CALLED BY */
-/* */
+/* */
+/* This function deactivate an instance of the storage class. */
+/* */
+/* INPUT */
+/* */
+/* command Pointer to a class command */
+/* */
+/* OUTPUT */
+/* */
+/* Completion Status */
+/* */
+/* CALLS */
+/* */
+/* _ux_device_stack_transfer_all_request_abort Abort all transfers */
+/* */
+/* CALLED BY */
+/* */
/* Device Storage Class */
-/* */
-/* RELEASE HISTORY */
-/* */
-/* DATE NAME DESCRIPTION */
-/* */
-/* 05-19-2020 Chaoqiong Xiao Initial Version 6.0 */
-/* 09-30-2020 Chaoqiong Xiao Modified comment(s), */
-/* resulting in version 6.1 */
-/* 01-31-2022 Chaoqiong Xiao Modified comment(s), */
-/* added standalone support, */
-/* resulting in version 6.1.10 */
-/* 07-29-2022 Chaoqiong Xiao Modified comment(s), */
-/* fixed parameter/variable */
-/* names conflict C++ keyword, */
-/* resulting in version 6.1.12 */
/* */
/**************************************************************************/
UINT _ux_device_class_storage_deactivate(UX_SLAVE_CLASS_COMMAND *command)
{
-
+
UX_SLAVE_CLASS_STORAGE *storage;
UX_SLAVE_ENDPOINT *endpoint_in;
UX_SLAVE_ENDPOINT *endpoint_out;
@@ -103,14 +89,14 @@ UX_SLAVE_CLASS *class_ptr;
/* Locate the endpoints. */
endpoint_in = storage -> ux_slave_class_storage_interface -> ux_slave_interface_first_endpoint;
-
+
/* Check the endpoint direction, if IN we have the correct endpoint. */
if ((endpoint_in -> ux_slave_endpoint_descriptor.bEndpointAddress & UX_ENDPOINT_DIRECTION) != UX_ENDPOINT_IN)
{
/* Wrong direction, we found the OUT endpoint first. */
endpoint_out = endpoint_in;
-
+
/* So the next endpoint has to be the IN endpoint. */
endpoint_in = endpoint_out -> ux_slave_endpoint_next_endpoint;
}
@@ -120,7 +106,7 @@ UX_SLAVE_CLASS *class_ptr;
/* We found the endpoint IN first, so next endpoint is OUT. */
endpoint_out = endpoint_in -> ux_slave_endpoint_next_endpoint;
}
-
+
/* Terminate the transactions pending on the endpoints. */
_ux_device_stack_transfer_all_request_abort(endpoint_in, UX_TRANSFER_BUS_RESET);
_ux_device_stack_transfer_all_request_abort(endpoint_out, UX_TRANSFER_BUS_RESET);
@@ -133,7 +119,7 @@ UX_SLAVE_CLASS *class_ptr;
/* Invoke the application. */
storage -> ux_slave_class_storage_instance_deactivate(storage);
}
-
+
/* If trace is enabled, insert this event into the trace buffer. */
UX_TRACE_IN_LINE_INSERT(UX_TRACE_DEVICE_CLASS_STORAGE_DEACTIVATE, storage, 0, 0, 0, UX_TRACE_DEVICE_CLASS_EVENTS, 0, 0)
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 71a75502..a397c345 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
@@ -1,5 +1,6 @@
/***************************************************************************
* Copyright (c) 2024 Microsoft Corporation
+ * Copyright (c) 2026-present Eclipse ThreadX contributors
*
* This program and the accompanying materials are made available under the
* terms of the MIT License which is available at
@@ -67,21 +68,6 @@
/* */
/* Device Storage Class */
/* */
-/* RELEASE HISTORY */
-/* */
-/* DATE NAME DESCRIPTION */
-/* */
-/* 05-19-2020 Chaoqiong Xiao Initial Version 6.0 */
-/* 09-30-2020 Chaoqiong Xiao Modified comment(s), */
-/* resulting in version 6.1 */
-/* 10-31-2023 Chaoqiong Xiao Modified comment(s), */
-/* added error checks support, */
-/* resulting in version 6.3.0 */
-/* xx-xx-xxxx Mohamed ayed Modified comment(s), */
-/* fix typo, */
-/* remove extra spaces, */
-/* resulting in version 6.x */
-/* */
/**************************************************************************/
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 b934648d..ad1470c3 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
@@ -1,18 +1,19 @@
/***************************************************************************
- * Copyright (c) 2024 Microsoft Corporation
- *
+ * Copyright (c) 2024 Microsoft Corporation
+ * Copyright (c) 2026-present Eclipse ThreadX contributors
+ *
* This program and the accompanying materials are made available under the
* terms of the MIT License which is available at
* https://opensource.org/licenses/MIT.
- *
+ *
* SPDX-License-Identifier: MIT
**************************************************************************/
/**************************************************************************/
/**************************************************************************/
-/** */
-/** USBX Component */
+/** */
+/** USBX Component */
/** */
/** Device Storage Class */
/** */
@@ -29,52 +30,40 @@
#include "ux_device_stack.h"
-/**************************************************************************/
-/* */
-/* FUNCTION RELEASE */
-/* */
-/* _ux_device_class_storage_format PORTABLE C */
+/**************************************************************************/
+/* */
+/* FUNCTION RELEASE */
+/* */
+/* _ux_device_class_storage_format PORTABLE C */
/* 6.1.10 */
/* AUTHOR */
/* */
/* Chaoqiong Xiao, Microsoft Corporation */
/* */
/* DESCRIPTION */
-/* */
-/* This function formats the local media. It is not supported in this */
-/* release. */
-/* */
-/* INPUT */
-/* */
-/* storage Pointer to storage class */
+/* */
+/* This function formats the local media. It is not supported in this */
+/* release. */
+/* */
+/* INPUT */
+/* */
+/* storage Pointer to storage class */
/* endpoint_in Pointer to IN endpoint */
/* endpoint_out Pointer to OUT endpoint */
-/* cbwcb Pointer to CBWCB */
-/* */
-/* OUTPUT */
-/* */
-/* Completion Status */
-/* */
-/* CALLS */
-/* */
-/* _ux_device_stack_endpoint_stall Endpoint stall */
+/* cbwcb Pointer to CBWCB */
+/* */
+/* OUTPUT */
+/* */
+/* Completion Status */
+/* */
+/* CALLS */
+/* */
+/* _ux_device_stack_endpoint_stall Endpoint stall */
/* _ux_device_class_storage_csw_send Send CSW */
-/* */
-/* CALLED BY */
-/* */
+/* */
+/* CALLED BY */
+/* */
/* Device Storage Class */
-/* */
-/* RELEASE HISTORY */
-/* */
-/* 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 */
-/* 01-31-2022 Chaoqiong Xiao Modified comment(s), */
-/* added standalone support, */
-/* resulting in version 6.1.10 */
/* */
/**************************************************************************/
UINT _ux_device_class_storage_format(UX_SLAVE_CLASS_STORAGE *storage, ULONG lun, UX_SLAVE_ENDPOINT *endpoint_in,
@@ -110,4 +99,4 @@ UINT _ux_device_class_storage_format(UX_SLAVE_CLASS_STORAGE *storage, ULONG lun
/* Return not supported error. */
return(UX_FUNCTION_NOT_SUPPORTED);
}
-
+
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 d4dc847b..06b6299b 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
@@ -1,18 +1,19 @@
/***************************************************************************
- * Copyright (c) 2024 Microsoft Corporation
- *
+ * Copyright (c) 2024 Microsoft Corporation
+ * Copyright (c) 2026-present Eclipse ThreadX contributors
+ *
* This program and the accompanying materials are made available under the
* terms of the MIT License which is available at
* https://opensource.org/licenses/MIT.
- *
+ *
* SPDX-License-Identifier: MIT
**************************************************************************/
/**************************************************************************/
/**************************************************************************/
-/** */
-/** USBX Component */
+/** */
+/** USBX Component */
/** */
/** Device Storage Class */
/** */
@@ -33,19 +34,19 @@
#define USBX_DEVICE_CLASS_STORAGE_CONFIGURATION_FEATURE_DESCRIPTOR_LENGTH 32
#define USBX_DEVICE_CLASS_STORAGE_CONFIGURATION_FEATURE_HEADER_LENGTH 4
#define USBX_DEVICE_CLASS_STORAGE_CONFIGURATION_FEATURE_LENGTH (USBX_DEVICE_CLASS_STORAGE_CONFIGURATION_PROFILE_LENGTH - USBX_DEVICE_CLASS_STORAGE_CONFIGURATION_FEATURE_DESCRIPTOR_LENGTH - USBX_DEVICE_CLASS_STORAGE_CONFIGURATION_HEADER_LENGTH)
-UCHAR usbx_device_class_storage_configuration_profile[] = {
+UCHAR usbx_device_class_storage_configuration_profile[] = {
/* Feature Header */
0x00, 0x00, /* Entire length of profile filled by firmware */
- 0x00, 0x00,
- 0x00, 0x00,
- 0x00, 0x00, /* Current profile */
+ 0x00, 0x00,
+ 0x00, 0x00,
+ 0x00, 0x00, /* Current profile */
/* Feature Descriptor */
0x00, 0x00, /* Feature Code : profile list */
- 0x00, /* Persistent/current */
- 0x1c, /* Additional Length */
-
+ 0x00, /* Persistent/current */
+ 0x1c, /* Additional Length */
+
0x00, 0x12, 0x00, 0x00, /* DVD-RAM */
0x00, 0x11, 0x00, 0x00, /* DVD-R */
0x00, 0x10, 0x00, 0x00, /* DVD-ROM */
@@ -53,67 +54,67 @@ UCHAR usbx_device_class_storage_configuration_profile[] = {
0x00, 0x09, 0x00, 0x00, /* CD-R */
0x00, 0x08, 0x00, 0x00, /* CD-ROM */
0x00, 0x02, 0x00, 0x00, /* Writable capable with removable media. */
-
+
/* Feature Descriptor */
0x00, 0x01, /* Feature Code : core feature */
- 0x0b, /* Persistent/current */
- 0x08, /* Additional Length */
-
+ 0x0b, /* Persistent/current */
+ 0x08, /* Additional Length */
+
0x00, 0x00, 0x00, 0x07, /* Physical Interface Standard */
0x01, 0x00, 0x00, 0x00, /* */
/* Feature Descriptor */
- 0x00, 0x02, /* Feature Code : morphing (Ability to notify initiator about
- operational changes and accept initiator requests to prevent
+ 0x00, 0x02, /* Feature Code : morphing (Ability to notify initiator about
+ operational changes and accept initiator requests to prevent
operational changes) */
- 0x07, /* Persistent/current */
- 0x04, /* Additional Length */
-
+ 0x07, /* Persistent/current */
+ 0x04, /* Additional Length */
+
0x02, 0x00, 0x00, 0x00, /* Physical Interface Standard */
/* Feature Descriptor */
- 0x00, 0x03, /* Feature Code : Removable Medium (The medium may be removed
+ 0x00, 0x03, /* Feature Code : Removable Medium (The medium may be removed
from the device ) */
- 0x0b, /* Persistent/current */
- 0x04, /* Additional Length */
-
+ 0x0b, /* Persistent/current */
+ 0x04, /* Additional Length */
+
0x2b, 0x00, 0x00, 0x00, /* Physical Interface Standard */
/* Feature Descriptor */
- 0x00, 0x10, /* Feature Code : Random Readable (Read ability for storage devices
+ 0x00, 0x10, /* Feature Code : Random Readable (Read ability for storage devices
with random addressing) */
- 0x00, /* Persistent/current */
- 0x08, /* Additional Length */
-
+ 0x00, /* Persistent/current */
+ 0x08, /* Additional Length */
+
0x00, 0x00, 0x08, 0x00, /* */
0x00, 0x01, 0x01, 0x00, /* */
/* Feature Descriptor */
0x00, 0x1d, /* Feature Code : MultiRead (The logical unit can read all CD media types) */
- 0x00, /* Persistent/current */
- 0x00, /* Additional Length */
+ 0x00, /* Persistent/current */
+ 0x00, /* Additional Length */
/* Feature Descriptor */
0x00, 0x1e, /* Feature Code : CD Read (The ability to read CD specific structures) */
- 0x08, /* Persistent/current */
- 0x04, /* Additional Length */
-
+ 0x08, /* Persistent/current */
+ 0x04, /* Additional Length */
+
0x03, 0x00, 0x00, 0x00, /* */
/* Feature Descriptor */
0x00, 0x1f, /* Feature Code : DVD Read (The ability to read DVD specific structures) */
- 0x08, /* Persistent/current */
- 0x04, /* Additional Length */
-
+ 0x08, /* Persistent/current */
+ 0x04, /* Additional Length */
+
0x01, 0x00, 0x01, 0x00, /* */
/* Feature Descriptor */
0x00, 0x20, /* Feature Code : Random Writable (Write support for randomly addressed writes) */
- 0x04, /* Persistent/current */
- 0x0c, /* Additional Length */
-
+ 0x04, /* Persistent/current */
+ 0x0c, /* Additional Length */
+
0x00, 0x00, 0x00, 0x00, /* */
0x00, 0x00, 0x08, 0x00, /* */
0x00, 0x00, 0x01, 0x00, /* */
@@ -121,85 +122,85 @@ UCHAR usbx_device_class_storage_configuration_profile[] = {
/* Feature Descriptor */
0x00, 0x21, /* Feature Code : Incremental Streaming Writable (Write support for sequential recording) */
- 0x0C, /* Persistent/current */
- 0x08, /* Additional Length */
-
+ 0x0C, /* Persistent/current */
+ 0x08, /* Additional Length */
+
0x00, 0x00, 0x00, 0x00, /* */
0x00, 0x00, 0x00, 0x00, /* */
/* Feature Descriptor */
0x00, 0x23, /* Feature Code : Formattable (Support for formatting of media.) */
- 0x08, /* Persistent/current */
- 0x08, /* Additional Length */
-
+ 0x08, /* Persistent/current */
+ 0x08, /* Additional Length */
+
0x00, 0x00, 0x00, 0x00, /* */
0x00, 0x00, 0x00, 0x00, /* */
/* Feature Descriptor */
- 0x00, 0x24, /* Feature Code : Defect Management (Ability of the drive/media system to provide an
+ 0x00, 0x24, /* Feature Code : Defect Management (Ability of the drive/media system to provide an
apparently defect-free space.) */
- 0x04, /* Persistent/current */
- 0x04, /* Additional Length */
-
+ 0x04, /* Persistent/current */
+ 0x04, /* Additional Length */
+
0x80, 0x00, 0x00, 0x00, /* */
/* Feature Descriptor */
- 0x00, 0x26, /* Feature Code : Restricted Overwrite (Write support for media that must be written
+ 0x00, 0x26, /* Feature Code : Restricted Overwrite (Write support for media that must be written
in multiples of logical blocks.) */
- 0x00, /* Persistent/current */
- 0x00, /* Additional Length */
-
+ 0x00, /* Persistent/current */
+ 0x00, /* Additional Length */
+
/* Feature Descriptor */
0x00, 0x2d, /* Feature Code : CD Track at Once (Ability to write CD with Track at Once recording) */
- 0x08, /* Persistent/current */
- 0x04, /* Additional Length */
-
+ 0x08, /* Persistent/current */
+ 0x04, /* Additional Length */
+
0x46, 0x00, 0x3f, 0x0f, /* */
/* Feature Descriptor */
0x00, 0x2e, /* Feature Code : CD Mastering (The ability to write CD with Session at Once or Raw write methods.) */
- 0x04, /* Persistent/current */
- 0x04, /* Additional Length */
-
+ 0x04, /* Persistent/current */
+ 0x04, /* Additional Length */
+
0x7f, 0x00, 0x0d, 0x00, /* */
/* Feature Descriptor */
0x00, 0x2f, /* Feature Code : DVD-R Write (The ability to write DVD specific structures) */
- 0x08, /* Persistent/current */
- 0x04, /* Additional Length */
-
+ 0x08, /* Persistent/current */
+ 0x04, /* Additional Length */
+
0x4e, 0x00, 0x00, 0x00, /* */
0x01, 0x00, /* Feature Code : Power Management (Initiator and device directed power management) */
- 0x07, /* Persistent/current */
- 0x04, /* Additional Length */
-
+ 0x07, /* Persistent/current */
+ 0x04, /* Additional Length */
+
0x00, 0x00, 0x00, 0x00, /* */
0x01, 0x01, /* Feature Code : S.M.A.R.T. (Self Monitoring Analysis and Reporting Technology (Failure prediction)) */
- 0x00, /* Persistent/current */
- 0x04, /* Additional Length */
-
+ 0x00, /* Persistent/current */
+ 0x04, /* Additional Length */
+
0x00, 0x00, 0x00, 0x00, /* */
0x01, 0x08, /* Feature Code : Logical Unit serial number (Logical unit has a unique identifier) */
- 0x03, /* Persistent/current */
- 0x10, /* Additional Length */
+ 0x03, /* Persistent/current */
+ 0x10, /* Additional Length */
0x53, 0x31, 0x33, 0x36, /* Serial Number */
- 0x36, 0x59, 0x42, 0x46,
- 0x37, 0x30, 0x30, 0x39,
- 0x45, 0x48, 0x20, 0x20,
+ 0x36, 0x59, 0x42, 0x46,
+ 0x37, 0x30, 0x30, 0x39,
+ 0x45, 0x48, 0x20, 0x20,
0x01, 0x0a, /* Feature Code : Not sure : says FDC STC TOC */
- 0x00, /* Persistent/current */
- 0x0c, /* Additional Length */
+ 0x00, /* Persistent/current */
+ 0x0c, /* Additional Length */
- 0x46, 0x44, 0x43, 0x00,
- 0x53, 0x54, 0x43, 0x00,
+ 0x46, 0x44, 0x43, 0x00,
+ 0x53, 0x54, 0x43, 0x00,
0x54, 0x4F, 0x43, 0x00,
};
@@ -209,19 +210,19 @@ UCHAR usbx_device_class_storage_configuration_profile[] = {
#define USBX_DEVICE_CLASS_STORAGE_CONFIGURATION_ACTIVE_FEATURE_DESCRIPTOR_LENGTH 32
#define USBX_DEVICE_CLASS_STORAGE_CONFIGURATION_ACTIVE_FEATURE_HEADER_LENGTH 4
#define USBX_DEVICE_CLASS_STORAGE_CONFIGURATION_ACTIVE_FEATURE_LENGTH (USBX_DEVICE_CLASS_STORAGE_CONFIGURATION_ACTIVE_PROFILE_LENGTH - USBX_DEVICE_CLASS_STORAGE_CONFIGURATION_ACTIVE_FEATURE_DESCRIPTOR_LENGTH - USBX_DEVICE_CLASS_STORAGE_CONFIGURATION_ACTIVE_HEADER_LENGTH)
-UCHAR usbx_device_class_storage_configuration_active_profile[] = {
+UCHAR usbx_device_class_storage_configuration_active_profile[] = {
/* Feature Header */
0x00, 0x00, /* Entire length of profile filled by firmware */
- 0x00, 0x00,
- 0x00, 0x00,
- 0x00, 0x08, /* Current profile is CD-ROM*/
+ 0x00, 0x00,
+ 0x00, 0x00,
+ 0x00, 0x08, /* Current profile is CD-ROM*/
/* Feature Descriptor */
0x00, 0x00, /* Feature Code : profile list */
- 0x00, /* Persistent/current */
- 0x1c, /* Additional Length */
-
+ 0x00, /* Persistent/current */
+ 0x1c, /* Additional Length */
+
0x00, 0x12, 0x00, 0x00, /* DVD-RAM */
0x00, 0x11, 0x00, 0x00, /* DVD-R */
0x00, 0x10, 0x00, 0x00, /* DVD-ROM */
@@ -229,64 +230,64 @@ UCHAR usbx_device_class_storage_configuration_active_profile[] = {
0x00, 0x09, 0x00, 0x00, /* CD-R */
0x00, 0x08, 0x01, 0x00, /* CD-ROM : active profile */
0x00, 0x02, 0x00, 0x00, /* Writable capable with removable media. */
-
+
/* Feature Descriptor */
0x00, 0x01, /* Feature Code : core feature */
- 0x0b, /* Persistent/current */
- 0x08, /* Additional Length */
-
+ 0x0b, /* Persistent/current */
+ 0x08, /* Additional Length */
+
0x00, 0x00, 0x00, 0x07, /* Physical Interface Standard */
0x01, 0x00, 0x00, 0x00, /* */
/* Feature Descriptor */
- 0x00, 0x02, /* Feature Code : morphing (Ability to notify initiator about
- operational changes and accept initiator requests to prevent
+ 0x00, 0x02, /* Feature Code : morphing (Ability to notify initiator about
+ operational changes and accept initiator requests to prevent
operational changes) */
- 0x07, /* Persistent/current */
- 0x04, /* Additional Length */
-
+ 0x07, /* Persistent/current */
+ 0x04, /* Additional Length */
+
0x02, 0x00, 0x00, 0x00, /* Physical Interface Standard */
/* Feature Descriptor */
- 0x00, 0x03, /* Feature Code : Removable Medium (The medium may be removed
+ 0x00, 0x03, /* Feature Code : Removable Medium (The medium may be removed
from the device ) */
- 0x0b, /* Persistent/current */
- 0x04, /* Additional Length */
-
+ 0x0b, /* Persistent/current */
+ 0x04, /* Additional Length */
+
0x2b, 0x00, 0x00, 0x00, /* Physical Interface Standard */
/* Feature Descriptor */
- 0x00, 0x10, /* Feature Code : Random Readable (Read ability for storage devices
+ 0x00, 0x10, /* Feature Code : Random Readable (Read ability for storage devices
with random addressing) */
- 0x01, /* Persistent/current */
- 0x08, /* Additional Length */
-
+ 0x01, /* Persistent/current */
+ 0x08, /* Additional Length */
+
0x00, 0x00, 0x08, 0x00, /* */
0x00, 0x01, 0x01, 0x00, /* */
/* Feature Descriptor */
0x00, 0x1d, /* Feature Code : MultiRead (The logical unit can read all CD media types) */
- 0x01, /* Persistent/current */
- 0x00, /* Additional Length */
+ 0x01, /* Persistent/current */
+ 0x00, /* Additional Length */
/* Feature Descriptor */
0x00, 0x1e, /* Feature Code : CD Read (The ability to read CD specific structures) */
- 0x09, /* Persistent/current */
- 0x04, /* Additional Length */
-
+ 0x09, /* Persistent/current */
+ 0x04, /* Additional Length */
+
0x03, 0x00, 0x00, 0x00, /* */
0x01, 0x08, /* Feature Code : Logical Unit serial number (Logical unit has a unique identifier) */
- 0x03, /* Persistent/current */
- 0x10, /* Additional Length */
+ 0x03, /* Persistent/current */
+ 0x10, /* Additional Length */
0x53, 0x31, 0x33, 0x36, /* Serial Number */
- 0x36, 0x59, 0x42, 0x46,
- 0x37, 0x30, 0x30, 0x39,
- 0x45, 0x48, 0x20, 0x20,
+ 0x36, 0x59, 0x42, 0x46,
+ 0x37, 0x30, 0x30, 0x39,
+ 0x45, 0x48, 0x20, 0x20,
};
@@ -297,61 +298,43 @@ UCHAR usbx_device_class_storage_configuration_active_profile[] = {
#endif
-/**************************************************************************/
-/* */
-/* FUNCTION RELEASE */
-/* */
-/* _ux_device_class_storage_get_configuration PORTABLE C */
+/**************************************************************************/
+/* */
+/* FUNCTION RELEASE */
+/* */
+/* _ux_device_class_storage_get_configuration PORTABLE C */
/* 6.3.0 */
/* AUTHOR */
/* */
/* Chaoqiong Xiao, Microsoft Corporation */
/* */
/* DESCRIPTION */
-/* */
-/* This function performs a GET_CONFIGURATION command. */
-/* */
-/* INPUT */
-/* */
-/* storage Pointer to storage class */
+/* */
+/* This function performs a GET_CONFIGURATION command. */
+/* */
+/* INPUT */
+/* */
+/* storage Pointer to storage class */
/* endpoint_in Pointer to IN endpoint */
/* endpoint_out Pointer to OUT endpoint */
-/* cbwcb Pointer to CBWCB */
-/* */
-/* OUTPUT */
-/* */
-/* Completion Status */
-/* */
-/* CALLS */
-/* */
-/* _ux_device_class_storage_csw_send Send CSW */
-/* _ux_device_stack_transfer_request Transfer request */
+/* cbwcb Pointer to CBWCB */
+/* */
+/* OUTPUT */
+/* */
+/* Completion Status */
+/* */
+/* CALLS */
+/* */
+/* _ux_device_class_storage_csw_send Send CSW */
+/* _ux_device_stack_transfer_request Transfer request */
/* _ux_device_stack_endpoint_stall Stall endpoint */
/* _ux_utility_short_get_big_endian Get 16-bit big endian */
-/* _ux_utility_long_put_big_endian Put 32-bit big endian */
-/* _ux_utility_memory_copy Copy memory */
-/* */
-/* CALLED BY */
-/* */
-/* Device Storage Class */
-/* */
-/* RELEASE HISTORY */
-/* */
-/* 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 */
-/* 01-31-2022 Chaoqiong Xiao Modified comment(s), */
-/* added standalone support, */
-/* resulting in version 6.1.10 */
-/* 10-31-2023 Chaoqiong Xiao Modified comment(s), */
-/* checked compiling options */
-/* by runtime UX_ASSERT, */
-/* resulting in version 6.3.0 */
+/* _ux_utility_long_put_big_endian Put 32-bit big endian */
+/* _ux_utility_memory_copy Copy memory */
+/* */
+/* CALLED BY */
+/* */
+/* Device Storage Class */
/* */
/**************************************************************************/
UINT _ux_device_class_storage_get_configuration(UX_SLAVE_CLASS_STORAGE *storage, ULONG lun,
@@ -378,16 +361,16 @@ ULONG feature;
/* If trace is enabled, insert this event into the trace buffer. */
UX_TRACE_IN_LINE_INSERT(UX_TRACE_DEVICE_CLASS_STORAGE_GET_CONFIGURATION, storage, lun, 0, 0, UX_TRACE_DEVICE_CLASS_EVENTS, 0, 0)
-
+
/* Initialize the length of the configuration profile. */
_ux_utility_long_put_big_endian(usbx_device_class_storage_configuration_profile, (USBX_DEVICE_CLASS_STORAGE_CONFIGURATION_PROFILE_LENGTH - 4));
-
+
/* Initialize the length of the active configuration profile. */
_ux_utility_long_put_big_endian(usbx_device_class_storage_configuration_active_profile, (USBX_DEVICE_CLASS_STORAGE_CONFIGURATION_ACTIVE_PROFILE_LENGTH - 4));
-
+
/* Obtain the pointer to the transfer request. */
transfer_request = &endpoint_in -> ux_slave_endpoint_transfer_request;
-
+
/* Get the Starting Feature. */
starting_feature = _ux_utility_short_get_big_endian(cbwcb + UX_SLAVE_CLASS_STORAGE_GET_CONFIGURATION_STARTING_FEATURE);
@@ -406,34 +389,34 @@ ULONG feature;
{
/* We get the active profile. */
- /* Can we send all the activeconfiguration profile ? If not, the host may demand the first part of the configuration to get the entire length.
+ /* Can we send all the activeconfiguration profile ? If not, the host may demand the first part of the configuration to get the entire length.
In this case, return the length demanded by the host. */
if (allocation_length >= USBX_DEVICE_CLASS_STORAGE_CONFIGURATION_ACTIVE_PROFILE_LENGTH)
/* Adjust allocation length to maximum allowed. */
allocation_length = USBX_DEVICE_CLASS_STORAGE_CONFIGURATION_ACTIVE_PROFILE_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_configuration_active_profile,
+ _ux_utility_memory_copy(transfer_request -> ux_slave_transfer_request_data_pointer,
+ usbx_device_class_storage_configuration_active_profile,
allocation_length); /* Use case of memcpy is verified. */
}
else
{
/* We get the whole profile. */
- /* Can we send all the configuration profile ? If not, the host may demand the first part of the configuration to get the entire length.
+ /* Can we send all the configuration profile ? If not, the host may demand the first part of the configuration to get the entire length.
In this case, return the length demanded by the host. */
if (allocation_length >= USBX_DEVICE_CLASS_STORAGE_CONFIGURATION_PROFILE_LENGTH)
/* Adjust allocation length to maximum allowed. */
allocation_length = USBX_DEVICE_CLASS_STORAGE_CONFIGURATION_PROFILE_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_configuration_profile,
+ _ux_utility_memory_copy(transfer_request -> ux_slave_transfer_request_data_pointer,
+ usbx_device_class_storage_configuration_profile,
allocation_length); /* Use case of memcpy is verified. */
-
+
}
/* Now success. */
@@ -446,23 +429,23 @@ ULONG feature;
profile_pointer = usbx_device_class_storage_configuration_profile + USBX_DEVICE_CLASS_STORAGE_CONFIGURATION_HEADER_LENGTH +
USBX_DEVICE_CLASS_STORAGE_CONFIGURATION_FEATURE_DESCRIPTOR_LENGTH;
profile_counter = USBX_DEVICE_CLASS_STORAGE_CONFIGURATION_FEATURE_LENGTH;
-
+
/* Scan our configuration profile. */
while (profile_counter != 0)
{
/* Extract the feature from the configuration profile. */
feature = _ux_utility_short_get_big_endian(profile_pointer + USBX_DEVICE_CLASS_STORAGE_FEATURE_DESCRIPTOR_FEATURE_CODE);
-
+
/* Extract the feature length from the configuration profile. */
additional_length = (ULONG ) *(profile_pointer + USBX_DEVICE_CLASS_STORAGE_FEATURE_DESCRIPTOR_FEATURE_ADD_LENGTH);
/* Compare the Feature extracted with the one demanded. */
if (feature == starting_feature)
{
-
+
/* We found the feature, we check if the requester has enough space for us to return it. */
- if (allocation_length >= (additional_length + USBX_DEVICE_CLASS_STORAGE_CONFIGURATION_HEADER_LENGTH +
+ if (allocation_length >= (additional_length + USBX_DEVICE_CLASS_STORAGE_CONFIGURATION_HEADER_LENGTH +
USBX_DEVICE_CLASS_STORAGE_CONFIGURATION_FEATURE_HEADER_LENGTH))
/* Need to adjust the allocation length. */
@@ -470,19 +453,19 @@ ULONG feature;
USBX_DEVICE_CLASS_STORAGE_CONFIGURATION_FEATURE_HEADER_LENGTH;
/* Copy the CSW into the transfer request memory. */
- _ux_utility_memory_copy(transfer_request -> ux_slave_transfer_request_data_pointer,
- profile_pointer,
+ _ux_utility_memory_copy(transfer_request -> ux_slave_transfer_request_data_pointer,
+ profile_pointer,
allocation_length); /* Use case of memcpy is verified. */
/* Now success. */
status = UX_SUCCESS;
/* Get out of the loop. */
- break;
+ break;
}
- else
+ else
{
-
+
/* We have not yet found the feature, keep parsing. */
if (profile_counter - additional_length - USBX_DEVICE_CLASS_STORAGE_CONFIGURATION_FEATURE_HEADER_LENGTH <= 0)
{
@@ -500,7 +483,7 @@ ULONG feature;
status = UX_ERROR;
/* Get out of the loop. */
- break;
+ break;
}
else
@@ -513,7 +496,7 @@ ULONG feature;
profile_counter -= additional_length + USBX_DEVICE_CLASS_STORAGE_CONFIGURATION_FEATURE_HEADER_LENGTH;
}
}
- }
+ }
}
/* Success, send data. */
@@ -534,7 +517,7 @@ ULONG feature;
#else
/* Send a data payload with the read_capacity response buffer. */
- _ux_device_stack_transfer_request(transfer_request,
+ _ux_device_stack_transfer_request(transfer_request,
allocation_length,
allocation_length);
#endif
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 5b2a1198..1bf8a77d 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
@@ -1,18 +1,19 @@
/***************************************************************************
- * Copyright (c) 2024 Microsoft Corporation
- *
+ * Copyright (c) 2024 Microsoft Corporation
+ * Copyright (c) 2026-present Eclipse ThreadX contributors
+ *
* This program and the accompanying materials are made available under the
* terms of the MIT License which is available at
* https://opensource.org/licenses/MIT.
- *
+ *
* SPDX-License-Identifier: MIT
**************************************************************************/
/**************************************************************************/
/**************************************************************************/
-/** */
-/** USBX Component */
+/** */
+/** USBX Component */
/** */
/** Device Storage Class */
/** */
@@ -33,72 +34,54 @@
/* #error UX_SLAVE_REQUEST_DATA_MAX_LENGTH too small, please check */
/* Build option checked runtime by UX_ASSERT */
#endif
-UCHAR usbx_device_class_storage_performance[] = {
+UCHAR usbx_device_class_storage_performance[] = {
- 0x08, 0x00, 0x00, 0x00, 0x00, 0x23, 0x12, 0x80,
+ 0x08, 0x00, 0x00, 0x00, 0x00, 0x23, 0x12, 0x80,
0x00, 0x00, 0x10, 0x89, 0x00, 0x00, 0x10, 0x89
};
-/**************************************************************************/
-/* */
-/* FUNCTION RELEASE */
-/* */
-/* _ux_device_class_storage_get_performance PORTABLE C */
+/**************************************************************************/
+/* */
+/* FUNCTION RELEASE */
+/* */
+/* _ux_device_class_storage_get_performance PORTABLE C */
/* 6.3.0 */
/* AUTHOR */
/* */
/* Chaoqiong Xiao, Microsoft Corporation */
/* */
/* DESCRIPTION */
-/* */
-/* This function performs a GET_PERFORMANCE SCSI command. */
-/* */
-/* INPUT */
-/* */
-/* storage Pointer to storage class */
+/* */
+/* This function performs a GET_PERFORMANCE SCSI command. */
+/* */
+/* INPUT */
+/* */
+/* storage Pointer to storage class */
/* endpoint_in Pointer to IN endpoint */
/* endpoint_out Pointer to OUT endpoint */
-/* cbwcb Pointer to CBWCB */
-/* */
-/* OUTPUT */
-/* */
-/* Completion Status */
-/* */
-/* CALLS */
-/* */
-/* _ux_device_stack_transfer_request Transfer request */
-/* _ux_device_class_storage_csw_send Send CSW */
+/* cbwcb Pointer to CBWCB */
+/* */
+/* OUTPUT */
+/* */
+/* Completion Status */
+/* */
+/* CALLS */
+/* */
+/* _ux_device_stack_transfer_request Transfer request */
+/* _ux_device_class_storage_csw_send Send CSW */
/* _ux_utility_memory_set Set memory */
/* _ux_utility_memory_copy Copy memory */
/* _ux_utility_long_put_big_endian Put 32-bit big endian */
-/* */
-/* CALLED BY */
-/* */
+/* */
+/* CALLED BY */
+/* */
/* Device Storage Class */
-/* */
-/* RELEASE HISTORY */
-/* */
-/* 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 */
-/* 01-31-2022 Chaoqiong Xiao Modified comment(s), */
-/* added standalone support, */
-/* resulting in version 6.1.10 */
-/* 10-31-2023 Chaoqiong Xiao Modified comment(s), */
-/* checked compiling options */
-/* by runtime UX_ASSERT, */
-/* resulting in version 6.3.0 */
/* */
/**************************************************************************/
-UINT _ux_device_class_storage_get_performance(UX_SLAVE_CLASS_STORAGE *storage,
- ULONG lun,
+UINT _ux_device_class_storage_get_performance(UX_SLAVE_CLASS_STORAGE *storage,
+ ULONG lun,
UX_SLAVE_ENDPOINT *endpoint_in,
- UX_SLAVE_ENDPOINT *endpoint_out,
+ UX_SLAVE_ENDPOINT *endpoint_out,
UCHAR *cbwcb)
{
@@ -122,35 +105,35 @@ ULONG data_length = 0;
/* Ensure memory buffer cleaned. */
_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);
/* Filter it as the response depends on it. */
switch (performance_page)
- {
-
- case UX_SLAVE_CLASS_STORAGE_GET_PERFORMANCE_PAGE_14 :
+ {
+
+ case UX_SLAVE_CLASS_STORAGE_GET_PERFORMANCE_PAGE_14 :
/* Put the length to be returned. */
- _ux_utility_long_put_big_endian(transfer_request -> ux_slave_transfer_request_data_pointer,
+ _ux_utility_long_put_big_endian(transfer_request -> ux_slave_transfer_request_data_pointer,
UX_SLAVE_CLASS_STORAGE_GET_PERFORMANCE_PAYLOAD_LENGTH);
/* Put the payload to be returned. */
- _ux_utility_long_put_big_endian(transfer_request -> ux_slave_transfer_request_data_pointer + 4,
+ _ux_utility_long_put_big_endian(transfer_request -> ux_slave_transfer_request_data_pointer + 4,
UX_SLAVE_CLASS_STORAGE_GET_PERFORMANCE_PAYLOAD);
data_length = UX_SLAVE_CLASS_STORAGE_GET_PERFORMANCE_RESPONSE_LENGTH;
break;
-
+
case UX_SLAVE_CLASS_STORAGE_GET_PERFORMANCE_PAGE_0 :
/* Put the length to be returned. */
- _ux_utility_long_put_big_endian(transfer_request -> ux_slave_transfer_request_data_pointer,
+ _ux_utility_long_put_big_endian(transfer_request -> ux_slave_transfer_request_data_pointer,
USBX_DEVICE_CLASS_STORAGE_GET_PERFORMANCE_0_LENGTH + 8);
/* Copy the CSW into the transfer request memory. */
- _ux_utility_memory_copy(transfer_request -> ux_slave_transfer_request_data_pointer + 8,
+ _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); /* Use case of memcpy is verified. */
data_length = USBX_DEVICE_CLASS_STORAGE_GET_PERFORMANCE_0_LENGTH + 8;
@@ -175,7 +158,7 @@ ULONG data_length = 0;
#else
/* Send a data payload with the read_capacity response buffer. */
- _ux_device_stack_transfer_request(transfer_request, data_length, data_length);
+ _ux_device_stack_transfer_request(transfer_request, data_length, data_length);
#endif
/* Now we set the CSW with success. */
@@ -185,4 +168,4 @@ ULONG data_length = 0;
/* 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 eceb4906..b2bdcc13 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
@@ -1,18 +1,19 @@
/***************************************************************************
- * Copyright (c) 2024 Microsoft Corporation
- *
+ * Copyright (c) 2024 Microsoft Corporation
+ * Copyright (c) 2026-present Eclipse ThreadX contributors
+ *
* This program and the accompanying materials are made available under the
* terms of the MIT License which is available at
* https://opensource.org/licenses/MIT.
- *
+ *
* SPDX-License-Identifier: MIT
**************************************************************************/
/**************************************************************************/
/**************************************************************************/
-/** */
-/** USBX Component */
+/** */
+/** USBX Component */
/** */
/** Device Storage Class */
/** */
@@ -29,56 +30,42 @@
#include "ux_device_stack.h"
-/**************************************************************************/
-/* */
-/* FUNCTION RELEASE */
-/* */
-/* _ux_device_class_storage_get_status_notification PORTABLE C */
+/**************************************************************************/
+/* */
+/* FUNCTION RELEASE */
+/* */
+/* _ux_device_class_storage_get_status_notification PORTABLE C */
/* 6.1.10 */
/* AUTHOR */
/* */
/* Chaoqiong Xiao, Microsoft Corporation */
/* */
/* DESCRIPTION */
-/* */
-/* This function performs a GET_STATUS_NOTIFICATION command. */
-/* */
-/* INPUT */
-/* */
-/* storage Pointer to storage class */
+/* */
+/* This function performs a GET_STATUS_NOTIFICATION command. */
+/* */
+/* INPUT */
+/* */
+/* storage Pointer to storage class */
/* endpoint_in Pointer to IN endpoint */
/* endpoint_out Pointer to OUT endpoint */
-/* cbwcb Pointer to CBWCB */
-/* */
-/* OUTPUT */
-/* */
-/* Completion Status */
-/* */
-/* CALLS */
-/* */
-/* _ux_device_class_storage_csw_send Send CSW */
-/* _ux_device_stack_transfer_request Transfer request */
+/* cbwcb Pointer to CBWCB */
+/* */
+/* OUTPUT */
+/* */
+/* Completion Status */
+/* */
+/* CALLS */
+/* */
+/* _ux_device_class_storage_csw_send Send CSW */
+/* _ux_device_stack_transfer_request Transfer request */
/* _ux_device_stack_endpoint_stall Stall endpoint */
/* _ux_utility_short_put_big_endian Put 16-bit big endian */
-/* _ux_utility_memory_copy Copy memory */
-/* */
-/* CALLED BY */
-/* */
-/* Device Storage Class */
-/* */
-/* RELEASE HISTORY */
-/* */
-/* 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 */
-/* 01-31-2022 Chaoqiong Xiao Modified comment(s), */
-/* added standalone support, */
-/* resulting in version 6.1.10 */
+/* _ux_utility_memory_copy Copy memory */
+/* */
+/* CALLED BY */
+/* */
+/* Device Storage Class */
/* */
/**************************************************************************/
UINT _ux_device_class_storage_get_status_notification(UX_SLAVE_CLASS_STORAGE *storage, ULONG lun,
@@ -120,12 +107,12 @@ ULONG notification_class;
/* Extract the notification from the cbwcb. */
notification_class = (ULONG) *(cbwcb + UX_SLAVE_CLASS_STORAGE_EVENT_NOTIFICATION_CLASS_REQUEST);
-
+
/* Obtain the notification of the device. */
- status = storage -> ux_slave_class_storage_lun[lun].ux_slave_class_storage_media_notification(storage, lun,
+ status = storage -> ux_slave_class_storage_lun[lun].ux_slave_class_storage_media_notification(storage, lun,
storage -> ux_slave_class_storage_lun[lun].ux_slave_class_storage_media_id,
- notification_class,
- &media_notification,
+ notification_class,
+ &media_notification,
&media_notification_length);
/* Check the notification length. */
@@ -145,33 +132,33 @@ ULONG notification_class;
/* Check the status for error. */
if (status != UX_SUCCESS)
{
-
+
#if !defined(UX_DEVICE_STANDALONE)
/* We need to STALL the IN endpoint. The endpoint will be reset by the host. */
_ux_device_stack_endpoint_stall(endpoint_in);
#endif
- }
+ }
else
{
/* Obtain the pointer to the transfer request. */
transfer_request = &endpoint_in -> ux_slave_endpoint_transfer_request;
-
+
/* Put the length of the notification length in the buffer. */
_ux_utility_short_put_big_endian(transfer_request -> ux_slave_transfer_request_data_pointer, (USHORT)media_notification_length);
/* Copy the CSW into the transfer request memory. */
- _ux_utility_memory_copy(transfer_request -> ux_slave_transfer_request_data_pointer + sizeof (USHORT),
- media_notification,
+ _ux_utility_memory_copy(transfer_request -> ux_slave_transfer_request_data_pointer + sizeof (USHORT),
+ media_notification,
media_notification_length); /* Use case of memcpy is verified. */
-
+
/* Update the notification length. */
media_notification_length += (ULONG)sizeof (USHORT);
#if !defined(UX_DEVICE_STANDALONE)
/* Send a data payload with the notification buffer. */
- _ux_device_stack_transfer_request(transfer_request,
+ _ux_device_stack_transfer_request(transfer_request,
media_notification_length,
media_notification_length);
#else
@@ -190,7 +177,7 @@ ULONG notification_class;
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_initialize.c b/common/usbx_device_classes/src/ux_device_class_storage_initialize.c
index c6f393e0..6dd02113 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
@@ -1,5 +1,6 @@
/***************************************************************************
* Copyright (c) 2024 Microsoft Corporation
+ * Copyright (c) 2026-present Eclipse ThreadX contributors
*
* This program and the accompanying materials are made available under the
* terms of the MIT License which is available at
@@ -68,24 +69,6 @@ UCHAR _ux_system_slave_class_storage_product_serial[] = "123
/* */
/* Device Storage Class */
/* */
-/* RELEASE HISTORY */
-/* */
-/* 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 */
-/* 01-31-2022 Chaoqiong Xiao Modified comment(s), */
-/* added standalone support, */
-/* resulting in version 6.1.10 */
-/* 10-31-2023 Chaoqiong Xiao Modified comment(s), */
-/* added a new mode to manage */
-/* endpoint buffer in classes, */
-/* resulting in version 6.3.0 */
-/* */
/**************************************************************************/
UINT _ux_device_class_storage_initialize(UX_SLAVE_CLASS_COMMAND *command)
{
@@ -184,6 +167,7 @@ ULONG lun_index;
storage -> ux_slave_class_storage_lun[lun_index].ux_slave_class_storage_media_write = storage_parameter -> ux_slave_class_storage_parameter_lun[lun_index].ux_slave_class_storage_media_write;
storage -> ux_slave_class_storage_lun[lun_index].ux_slave_class_storage_media_status = storage_parameter -> ux_slave_class_storage_parameter_lun[lun_index].ux_slave_class_storage_media_status;
storage -> ux_slave_class_storage_lun[lun_index].ux_slave_class_storage_media_notification = storage_parameter -> ux_slave_class_storage_parameter_lun[lun_index].ux_slave_class_storage_media_notification;
+ storage -> ux_slave_class_storage_lun[lun_index].ux_slave_class_storage_media_start_stop = storage_parameter -> ux_slave_class_storage_parameter_lun[lun_index].ux_slave_class_storage_media_start_stop;
}
/* If it's OK, complete it. */
@@ -273,12 +257,6 @@ ULONG lun_index;
/* */
/* Application */
/* */
-/* RELEASE HISTORY */
-/* */
-/* DATE NAME DESCRIPTION */
-/* */
-/* 10-31-2023 Chaoqiong Xiao Initial Version 6.3.0 */
-/* */
/**************************************************************************/
UINT _uxe_device_class_storage_initialize(UX_SLAVE_CLASS_COMMAND *command)
{
diff --git a/common/usbx_device_classes/src/ux_device_class_storage_inquiry.c b/common/usbx_device_classes/src/ux_device_class_storage_inquiry.c
index 1ead06ae..231f3d67 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
@@ -1,18 +1,19 @@
/***************************************************************************
- * Copyright (c) 2024 Microsoft Corporation
- *
+ * Copyright (c) 2024 Microsoft Corporation
+ * Copyright (c) 2026-present Eclipse ThreadX contributors
+ *
* This program and the accompanying materials are made available under the
* terms of the MIT License which is available at
* https://opensource.org/licenses/MIT.
- *
+ *
* SPDX-License-Identifier: MIT
**************************************************************************/
/**************************************************************************/
/**************************************************************************/
-/** */
-/** USBX Component */
+/** */
+/** USBX Component */
/** */
/** Device Storage Class */
/** */
@@ -34,67 +35,43 @@
/* Build option checked runtime by UX_ASSERT */
#endif
-/**************************************************************************/
-/* */
-/* FUNCTION RELEASE */
-/* */
-/* _ux_device_class_storage_inquiry PORTABLE C */
+/**************************************************************************/
+/* */
+/* FUNCTION RELEASE */
+/* */
+/* _ux_device_class_storage_inquiry PORTABLE C */
/* 6.3.0 */
/* AUTHOR */
/* */
/* Chaoqiong Xiao, Microsoft Corporation */
/* */
/* DESCRIPTION */
-/* */
-/* This function performs a INQUIRY command. */
-/* */
-/* INPUT */
-/* */
-/* storage Pointer to storage class */
+/* */
+/* This function performs a INQUIRY command. */
+/* */
+/* INPUT */
+/* */
+/* storage Pointer to storage class */
/* endpoint_in Pointer to IN endpoint */
/* endpoint_out Pointer to OUT endpoint */
-/* cbwcb Pointer to CBWCB */
-/* */
-/* OUTPUT */
-/* */
-/* Completion Status */
-/* */
-/* CALLS */
-/* */
-/* _ux_device_class_storage_csw_send Send CSW */
-/* _ux_device_stack_transfer_request Transfer request */
+/* cbwcb Pointer to CBWCB */
+/* */
+/* OUTPUT */
+/* */
+/* Completion Status */
+/* */
+/* CALLS */
+/* */
+/* _ux_device_class_storage_csw_send Send CSW */
+/* _ux_device_stack_transfer_request Transfer request */
/* _ux_device_stack_endpoint_stall Stall endpoint */
-/* _ux_utility_memory_copy Copy memory */
-/* _ux_utility_memory_set Set memory */
+/* _ux_utility_memory_copy Copy memory */
+/* _ux_utility_memory_set Set memory */
/* _ux_utility_short_put_big_endian Put 16-bit big endian */
-/* */
-/* CALLED BY */
-/* */
+/* */
+/* CALLED BY */
+/* */
/* Device Storage Class */
-/* */
-/* RELEASE HISTORY */
-/* */
-/* 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 */
-/* 12-31-2020 Chaoqiong Xiao Modified comment(s), */
-/* fixed USB CV test issues, */
-/* resulting in version 6.1.3 */
-/* 01-31-2022 Chaoqiong Xiao Modified comment(s), */
-/* added standalone support, */
-/* resulting in version 6.1.10 */
-/* 07-29-2022 Chaoqiong Xiao Modified comment(s), */
-/* updated dCSWDataResidue, */
-/* resulting in version 6.1.12 */
-/* 10-31-2023 Chaoqiong Xiao Modified comment(s), */
-/* checked compiling options */
-/* by runtime UX_ASSERT, */
-/* resulting in version 6.3.0 */
/* */
/**************************************************************************/
UINT _ux_device_class_storage_inquiry(UX_SLAVE_CLASS_STORAGE *storage, ULONG lun, UX_SLAVE_ENDPOINT *endpoint_in,
@@ -129,7 +106,7 @@ UCHAR *inquiry_buffer;
/* From the SCSI Inquiry payload, get the page code. */
inquiry_page_code = *(cbwcb + UX_SLAVE_CLASS_STORAGE_INQUIRY_PAGE_CODE);
-
+
/* And the length to be returned. */
inquiry_length = storage -> ux_slave_class_storage_host_length;
@@ -154,7 +131,7 @@ UCHAR *inquiry_buffer;
{
case UX_SLAVE_CLASS_STORAGE_INQUIRY_PAGE_CODE_STANDARD:
-
+
/* Store the product type. */
inquiry_buffer[UX_SLAVE_CLASS_STORAGE_INQUIRY_RESPONSE_PERIPHERAL_TYPE] = (UCHAR)storage -> ux_slave_class_storage_lun[lun].ux_slave_class_storage_media_type;
@@ -170,7 +147,7 @@ UCHAR *inquiry_buffer;
/* Store the length of the response. There is a hack here. For CD-ROM, the data lg is fixed to 0x5B ! */
if (storage -> ux_slave_class_storage_lun[lun].ux_slave_class_storage_media_type != UX_SLAVE_CLASS_STORAGE_MEDIA_CDROM)
inquiry_buffer[UX_SLAVE_CLASS_STORAGE_INQUIRY_RESPONSE_ADDITIONAL_LENGTH] = UX_SLAVE_CLASS_STORAGE_INQUIRY_RESPONSE_LENGTH;
- else
+ else
inquiry_buffer[UX_SLAVE_CLASS_STORAGE_INQUIRY_RESPONSE_ADDITIONAL_LENGTH] = UX_SLAVE_CLASS_STORAGE_INQUIRY_RESPONSE_LENGTH_CD_ROM;
/* Fill in the storage vendor ID. */
@@ -201,7 +178,7 @@ UCHAR *inquiry_buffer;
/* Send a data payload with the inquiry response buffer. */
if (inquiry_length > 24)
inquiry_length = 24;
-
+
break;
default:
@@ -221,8 +198,8 @@ UCHAR *inquiry_buffer;
/* Return error. */
status = UX_ERROR;
- break;
- }
+ break;
+ }
/* Error cases. */
if (status != UX_SUCCESS)
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 4dd2f44c..4ebb0108 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
@@ -1,18 +1,19 @@
/***************************************************************************
- * Copyright (c) 2024 Microsoft Corporation
- *
+ * Copyright (c) 2024 Microsoft Corporation
+ * Copyright (c) 2026-present Eclipse ThreadX contributors
+ *
* This program and the accompanying materials are made available under the
* terms of the MIT License which is available at
* https://opensource.org/licenses/MIT.
- *
+ *
* SPDX-License-Identifier: MIT
**************************************************************************/
/**************************************************************************/
/**************************************************************************/
-/** */
-/** USBX Component */
+/** */
+/** USBX Component */
/** */
/** Device Storage Class */
/** */
@@ -29,58 +30,43 @@
#include "ux_device_stack.h"
-/**************************************************************************/
-/* */
-/* FUNCTION RELEASE */
-/* */
-/* _ux_device_class_storage_mode_select PORTABLE C */
+/**************************************************************************/
+/* */
+/* FUNCTION RELEASE */
+/* */
+/* _ux_device_class_storage_mode_select PORTABLE C */
/* 6.1.10 */
/* AUTHOR */
/* */
/* Chaoqiong Xiao, Microsoft Corporation */
/* */
/* DESCRIPTION */
-/* */
-/* This function performs a MODE_SELECT SCSI command. It is not */
-/* supported in this release. */
-/* */
-/* INPUT */
-/* */
-/* storage Pointer to storage class */
+/* */
+/* This function performs a MODE_SELECT SCSI command. It is not */
+/* supported in this release. */
+/* */
+/* INPUT */
+/* */
+/* storage Pointer to storage class */
/* endpoint_in Pointer to IN endpoint */
/* endpoint_out Pointer to OUT endpoint */
-/* cbwcb Pointer to CBWCB */
-/* */
-/* OUTPUT */
-/* */
-/* Completion Status */
-/* */
-/* CALLS */
-/* */
-/* _ux_device_stack_endpoint_stall Stall endpoint */
+/* cbwcb Pointer to CBWCB */
+/* */
+/* OUTPUT */
+/* */
+/* Completion Status */
+/* */
+/* CALLS */
+/* */
+/* _ux_device_stack_endpoint_stall Stall endpoint */
/* _ux_device_class_storage_csw_send Send CSW */
-/* */
-/* CALLED BY */
-/* */
+/* */
+/* CALLED BY */
+/* */
/* Device Storage Class */
-/* */
-/* RELEASE HISTORY */
-/* */
-/* 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 */
-/* 12-31-2020 Chaoqiong Xiao Modified comment(s), */
-/* fixed USB CV test issues, */
-/* resulting in version 6.1.3 */
-/* 01-31-2022 Chaoqiong Xiao Modified comment(s), */
-/* added standalone support, */
-/* resulting in version 6.1.10 */
/* */
/**************************************************************************/
-UINT _ux_device_class_storage_mode_select(UX_SLAVE_CLASS_STORAGE *storage, ULONG lun,
+UINT _ux_device_class_storage_mode_select(UX_SLAVE_CLASS_STORAGE *storage, ULONG lun,
UX_SLAVE_ENDPOINT *endpoint_in,
UX_SLAVE_ENDPOINT *endpoint_out, UCHAR * cbwcb)
{
@@ -119,5 +105,5 @@ UINT _ux_device_class_storage_mode_select(UX_SLAVE_CLASS_STORAGE *storage, ULON
/* Return not supported error! */
return(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 05905923..badc9771 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
@@ -1,18 +1,19 @@
/***************************************************************************
- * Copyright (c) 2024 Microsoft Corporation
- *
+ * Copyright (c) 2024 Microsoft Corporation
+ * Copyright (c) 2026-present Eclipse ThreadX contributors
+ *
* This program and the accompanying materials are made available under the
* terms of the MIT License which is available at
* https://opensource.org/licenses/MIT.
- *
+ *
* SPDX-License-Identifier: MIT
**************************************************************************/
/**************************************************************************/
/**************************************************************************/
-/** */
-/** USBX Component */
+/** */
+/** USBX Component */
/** */
/** Device Storage Class */
/** */
@@ -30,16 +31,16 @@
#ifdef UX_SLAVE_CLASS_STORAGE_INCLUDE_MMC
#define USBX_DEVICE_CLASS_STORAGE_MODE_SENSE_PAGE_CDROM_LENGTH (0x42 + 2)
-UCHAR usbx_device_class_storage_mode_sense_page_cdrom[USBX_DEVICE_CLASS_STORAGE_MODE_SENSE_PAGE_CDROM_LENGTH] = {
+UCHAR usbx_device_class_storage_mode_sense_page_cdrom[USBX_DEVICE_CLASS_STORAGE_MODE_SENSE_PAGE_CDROM_LENGTH] = {
0x2A, 0x42, 0x3F, 0x37, 0xF1, 0x77, 0x29, 0x23,
- 0x10, 0x89, 0x01, 0x00, 0x02, 0x00, 0x05, 0x84,
+ 0x10, 0x89, 0x01, 0x00, 0x02, 0x00, 0x05, 0x84,
0x00, 0x10, 0x10, 0x89, 0x00, 0x00, 0x00, 0x01,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00
};
@@ -60,71 +61,50 @@ UCHAR usbx_device_class_storage_mode_sense_page_cdrom[USBX_DEVICE_CLASS_STORAGE_
/* Build option checked runtime by UX_ASSERT */
#endif
-/**************************************************************************/
-/* */
-/* FUNCTION RELEASE */
-/* */
-/* _ux_device_class_storage_mode_sense PORTABLE C */
+/**************************************************************************/
+/* */
+/* FUNCTION RELEASE */
+/* */
+/* _ux_device_class_storage_mode_sense PORTABLE C */
/* 6.3.0 */
/* AUTHOR */
/* */
/* Chaoqiong Xiao, Microsoft Corporation */
/* */
/* DESCRIPTION */
-/* */
-/* This function performs a MODE_SENSE SCSI command. It supports */
-/* the standard page for the CD-ROM. */
-/* */
-/* INPUT */
-/* */
-/* storage Pointer to storage class */
+/* */
+/* This function performs a MODE_SENSE SCSI command. It supports */
+/* the standard page for the CD-ROM. */
+/* */
+/* INPUT */
+/* */
+/* storage Pointer to storage class */
/* endpoint_in Pointer to IN endpoint */
/* endpoint_out Pointer to OUT endpoint */
-/* cbwcb Pointer to CBWCB */
-/* */
-/* OUTPUT */
-/* */
-/* Completion Status */
-/* */
-/* CALLS */
-/* */
-/* _ux_device_stack_transfer_request Transfer request */
-/* _ux_device_class_storage_csw_send Send CSW */
+/* cbwcb Pointer to CBWCB */
+/* */
+/* OUTPUT */
+/* */
+/* Completion Status */
+/* */
+/* CALLS */
+/* */
+/* _ux_device_stack_transfer_request Transfer request */
+/* _ux_device_class_storage_csw_send Send CSW */
/* _ux_utility_short_get_big_endian Get 16-bit big endian */
/* _ux_utility_short_put_big_endian Put 16-bit big endian */
/* _ux_utility_memory_set Set memory */
/* _ux_utility_memory_copy Copy memory */
-/* */
-/* CALLED BY */
-/* */
+/* */
+/* CALLED BY */
+/* */
/* Device Storage Class */
-/* */
-/* RELEASE HISTORY */
-/* */
-/* 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 */
-/* 01-31-2022 Chaoqiong Xiao Modified comment(s), */
-/* added standalone support, */
-/* resulting in version 6.1.10 */
-/* 04-25-2022 Chaoqiong Xiao Modified comment(s), */
-/* internal clean up, */
-/* resulting in version 6.1.11 */
-/* 10-31-2023 Chaoqiong Xiao Modified comment(s), */
-/* checked compiling options */
-/* by runtime UX_ASSERT, */
-/* resulting in version 6.3.0 */
/* */
/**************************************************************************/
-UINT _ux_device_class_storage_mode_sense(UX_SLAVE_CLASS_STORAGE *storage,
- ULONG lun,
+UINT _ux_device_class_storage_mode_sense(UX_SLAVE_CLASS_STORAGE *storage,
+ ULONG lun,
UX_SLAVE_ENDPOINT *endpoint_in,
- UX_SLAVE_ENDPOINT *endpoint_out,
+ UX_SLAVE_ENDPOINT *endpoint_out,
UCHAR *cbwcb)
{
@@ -154,7 +134,7 @@ ULONG page_length;
/* Get the command format : we have 1a and 5a. */
mode_sense_command = (ULONG) *(cbwcb + UX_SLAVE_CLASS_STORAGE_MODE_SENSE_OPERATION);
-
+
/* Extract the notification from the cbwcb. */
page_code = (ULONG) *(cbwcb + UX_SLAVE_CLASS_STORAGE_MODE_SENSE_PC_PAGE_CODE);
@@ -186,14 +166,14 @@ ULONG page_length;
/* Establish READ ONLY flag. */
if (storage -> ux_slave_class_storage_lun[lun].ux_slave_class_storage_media_read_only_flag == UX_TRUE)
-
+
/* This device is Read Only. */
read_only_flag = UX_SLAVE_CLASS_STORAGE_MODE_SENSE_PARAMETER_FLAG_WP;
-
+
else
-
+
/* This device can be written to. */
- read_only_flag = 0;
+ read_only_flag = 0;
/* Build response based on expected page codes. */
@@ -277,7 +257,7 @@ ULONG page_length;
#else
/* Send a payload with the response buffer. */
- _ux_device_stack_transfer_request(transfer_request, mode_sense_reply_length, mode_sense_reply_length);
+ _ux_device_stack_transfer_request(transfer_request, mode_sense_reply_length, mode_sense_reply_length);
#endif
/* Now we set the CSW with success. */
@@ -287,4 +267,4 @@ ULONG page_length;
/* 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 3a831ee4..4b9d63d6 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
@@ -1,18 +1,19 @@
/***************************************************************************
- * Copyright (c) 2024 Microsoft Corporation
- *
+ * Copyright (c) 2024 Microsoft Corporation
+ * Copyright (c) 2026-present Eclipse ThreadX contributors
+ *
* This program and the accompanying materials are made available under the
* terms of the MIT License which is available at
* https://opensource.org/licenses/MIT.
- *
+ *
* SPDX-License-Identifier: MIT
**************************************************************************/
/**************************************************************************/
/**************************************************************************/
-/** */
-/** USBX Component */
+/** */
+/** USBX Component */
/** */
/** Device Storage Class */
/** */
@@ -29,68 +30,70 @@
#include "ux_device_stack.h"
-/**************************************************************************/
-/* */
-/* FUNCTION RELEASE */
-/* */
+/**************************************************************************/
+/* */
+/* FUNCTION RELEASE */
+/* */
/* _ux_device_class_storage_prevent_allow_media_removal */
-/* PORTABLE C */
+/* PORTABLE C */
/* 6.1 */
/* AUTHOR */
/* */
/* Chaoqiong Xiao, Microsoft Corporation */
/* */
/* DESCRIPTION */
-/* */
-/* This function allows or prevents the removal of the media. We don't */
-/* do anything here, just the CSW is returned with a SUCCESS code. */
-/* */
-/* INPUT */
-/* */
-/* storage Pointer to storage class */
+/* */
+/* This function allows or prevents the removal of the media. */
+/* The PREVENT ALLOW MEDIUM REMOVAL command allows an application */
+/* client to restrict the demounting of the removable */
+/* medium. */
+/* */
+/* INPUT */
+/* */
+/* storage Pointer to storage class */
+/* lun Logical unit number */
/* endpoint_in Pointer to IN endpoint */
/* endpoint_out Pointer to OUT endpoint */
-/* cbwcb Pointer to CBWCB */
-/* */
-/* OUTPUT */
-/* */
-/* Completion Status */
-/* */
-/* CALLS */
-/* */
-/* _ux_device_class_storage_csw_send Send CSW */
-/* */
-/* CALLED BY */
-/* */
+/* cbwcb Pointer to CBWCB */
+/* */
+/* OUTPUT */
+/* */
+/* Completion Status */
+/* */
+/* CALLS */
+/* */
+/* None */
+/* */
+/* CALLED BY */
+/* */
/* Device Storage Class */
-/* */
-/* RELEASE HISTORY */
-/* */
-/* 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,
+UINT _ux_device_class_storage_prevent_allow_media_removal(UX_SLAVE_CLASS_STORAGE *storage, ULONG lun,
UX_SLAVE_ENDPOINT *endpoint_in,
UX_SLAVE_ENDPOINT *endpoint_out, UCHAR * cbwcb)
{
- UX_PARAMETER_NOT_USED(lun);
+ULONG prevent_flag;
+
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)
+ /* Parse the PREVENT/ALLOW MEDIA REMOVAL command: byte 4 bit 0 is the prevent flag. */
+ prevent_flag = (ULONG)(cbwcb[4] & 0x01);
+
+ /* Update internal flag to track prevent/allow state for this LUN. */
+ if (prevent_flag == UX_SLAVE_CLASS_STORAGE_MEDIUM_REMOVAL_IS_ALLOWED)
+ storage -> ux_slave_class_storage_lun[lun].ux_slave_class_storage_prevent_medium_removal = 0;
+ else
+ storage -> ux_slave_class_storage_lun[lun].ux_slave_class_storage_prevent_medium_removal = 1;
+
/* 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 91e48d4a..01f07aa0 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
@@ -1,18 +1,19 @@
/***************************************************************************
- * Copyright (c) 2024 Microsoft Corporation
- *
+ * Copyright (c) 2024 Microsoft Corporation
+ * Copyright (c) 2026-present Eclipse ThreadX contributors
+ *
* This program and the accompanying materials are made available under the
* terms of the MIT License which is available at
* https://opensource.org/licenses/MIT.
- *
+ *
* SPDX-License-Identifier: MIT
**************************************************************************/
/**************************************************************************/
/**************************************************************************/
-/** */
-/** USBX Component */
+/** */
+/** USBX Component */
/** */
/** Device Storage Class */
/** */
@@ -29,63 +30,48 @@
#include "ux_device_stack.h"
-/**************************************************************************/
-/* */
-/* FUNCTION RELEASE */
-/* */
-/* _ux_device_class_storage_read PORTABLE C */
+/**************************************************************************/
+/* */
+/* FUNCTION RELEASE */
+/* */
+/* _ux_device_class_storage_read PORTABLE C */
/* 6.1.10 */
/* AUTHOR */
/* */
/* Chaoqiong Xiao, Microsoft Corporation */
/* */
/* DESCRIPTION */
-/* */
-/* This function performs a READ command in 32 or 16 bits. */
-/* */
-/* INPUT */
-/* */
-/* storage Pointer to storage class */
+/* */
+/* This function performs a READ command in 32 or 16 bits. */
+/* */
+/* INPUT */
+/* */
+/* storage Pointer to storage class */
+/* lun Logical unit number */
/* endpoint_in Pointer to IN endpoint */
/* endpoint_out Pointer to OUT endpoint */
-/* cbwcb Pointer to CBWCB */
-/* scsi_command SCSI command */
-/* */
-/* OUTPUT */
-/* */
-/* Completion Status */
-/* */
-/* CALLS */
-/* */
-/* (ux_slave_class_storage_media_read) Read from media */
-/* (ux_slave_class_storage_media_status) Get media status */
-/* _ux_device_stack_endpoint_stall Stall endpoint */
-/* _ux_device_stack_transfer_request Transfer request */
-/* _ux_utility_long_get_big_endian Get 32-bit big endian */
-/* _ux_utility_short_get_big_endian Get 16-bit big endian */
-/* _ux_device_class_storage_csw_send Send CSW */
-/* */
-/* CALLED BY */
-/* */
-/* Device Storage Class */
-/* */
-/* RELEASE HISTORY */
-/* */
-/* 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 */
-/* 12-31-2020 Chaoqiong Xiao Modified comment(s), */
-/* fixed USB CV test issues, */
-/* resulting in version 6.1.3 */
-/* 01-31-2022 Chaoqiong Xiao Modified comment(s), */
-/* added standalone support, */
-/* resulting in version 6.1.10 */
+/* cbwcb Pointer to CBWCB */
+/* scsi_command SCSI command */
+/* */
+/* OUTPUT */
+/* */
+/* Completion Status */
+/* */
+/* CALLS */
+/* */
+/* (ux_slave_class_storage_media_read) Read from media */
+/* (ux_slave_class_storage_media_status) Get media status */
+/* _ux_device_stack_endpoint_stall Stall endpoint */
+/* _ux_device_stack_transfer_request Transfer request */
+/* _ux_utility_long_get_big_endian Get 32-bit big endian */
+/* _ux_utility_short_get_big_endian Get 16-bit big endian */
+/* */
+/* CALLED BY */
+/* */
+/* Device Storage Class */
/* */
/**************************************************************************/
-UINT _ux_device_class_storage_read(UX_SLAVE_CLASS_STORAGE *storage, ULONG lun,
+UINT _ux_device_class_storage_read(UX_SLAVE_CLASS_STORAGE *storage, ULONG lun,
UX_SLAVE_ENDPOINT *endpoint_in,
UX_SLAVE_ENDPOINT *endpoint_out, UCHAR * cbwcb, UCHAR scsi_command)
{
@@ -93,12 +79,12 @@ UINT _ux_device_class_storage_read(UX_SLAVE_CLASS_STORAGE *storage, ULONG lun,
UINT status;
ULONG lba;
UX_SLAVE_TRANSFER *transfer_request;
-ULONG total_number_blocks;
+ULONG total_number_blocks;
ULONG media_status;
ULONG total_length;
#if !defined(UX_DEVICE_STANDALONE)
-ULONG number_blocks;
+ULONG number_blocks;
ULONG transfer_length;
ULONG done_length;
#endif
@@ -106,6 +92,20 @@ ULONG done_length;
UX_PARAMETER_NOT_USED(endpoint_out);
+ if (storage -> ux_slave_class_storage_lun[lun].ux_slave_class_storage_medium_loaded_status == 0)
+ {
+ /* Media not loaded. Set NOT READY sense code. */
+ 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_NOT_READY,
+ UX_SLAVE_CLASS_STORAGE_SENSE_CODE_NOT_PRESENT, 0x00);
+
+ /* Return CSW with failure. */
+ storage -> ux_slave_class_storage_csw_status = UX_SLAVE_CLASS_STORAGE_CSW_FAILED;
+
+ /* Return completion status. */
+ return(UX_SUCCESS);
+ }
+
/* Get the LBA from the CBWCB. */
lba = _ux_utility_long_get_big_endian(cbwcb + UX_SLAVE_CLASS_STORAGE_READ_LBA);
@@ -116,7 +116,7 @@ ULONG done_length;
/* Get the number of blocks from the CBWCB in 16 bits. */
total_number_blocks = _ux_utility_short_get_big_endian(cbwcb + UX_SLAVE_CLASS_STORAGE_READ_TRANSFER_LENGTH_16);
- else
+ else
/* Get the number of blocks from the CBWCB in 32 bits. */
total_number_blocks = _ux_utility_long_get_big_endian(cbwcb + UX_SLAVE_CLASS_STORAGE_READ_TRANSFER_LENGTH_32);
@@ -133,7 +133,7 @@ ULONG done_length;
#if defined(UX_DEVICE_STANDALONE)
/* Obtain the status of the device. */
- status = storage -> ux_slave_class_storage_lun[lun].ux_slave_class_storage_media_status(storage, lun,
+ status = storage -> ux_slave_class_storage_lun[lun].ux_slave_class_storage_media_status(storage, lun,
storage -> ux_slave_class_storage_lun[lun].ux_slave_class_storage_media_id, &media_status);
/* Update the request sense. */
@@ -196,23 +196,23 @@ ULONG done_length;
{
/* Obtain the status of the device. */
- status = storage -> ux_slave_class_storage_lun[lun].ux_slave_class_storage_media_status(storage, lun,
+ status = storage -> ux_slave_class_storage_lun[lun].ux_slave_class_storage_media_status(storage, 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_status = media_status;
-
+
/* If there is a problem, return a failed command. */
if (status != UX_SUCCESS)
{
-
+
/* We have a problem, media status error. Return a bad completion and wait for the
REQUEST_SENSE command. */
_ux_device_stack_endpoint_stall(endpoint_in);
/* Update residue. */
storage -> ux_slave_class_storage_csw_residue = storage -> ux_slave_class_storage_host_length - done_length;
-
+
/* Return an error. */
return(UX_ERROR);
}
@@ -222,7 +222,7 @@ ULONG done_length;
/* Compute the transfer length based on the maximum allowed. */
transfer_length = UX_SLAVE_CLASS_STORAGE_BUFFER_SIZE;
-
+
else
/* Compute the transfer length based on what is left to transfer. */
@@ -232,27 +232,27 @@ ULONG done_length;
number_blocks = transfer_length / storage -> ux_slave_class_storage_lun[lun].ux_slave_class_storage_media_block_length;
/* If trace is enabled, insert this event into the trace buffer. */
- UX_TRACE_IN_LINE_INSERT(UX_TRACE_DEVICE_CLASS_STORAGE_READ, storage, lun, transfer_request -> ux_slave_transfer_request_data_pointer,
+ UX_TRACE_IN_LINE_INSERT(UX_TRACE_DEVICE_CLASS_STORAGE_READ, storage, lun, transfer_request -> ux_slave_transfer_request_data_pointer,
number_blocks, UX_TRACE_DEVICE_CLASS_EVENTS, 0, 0)
/* Execute the read command from the local media. */
- status = storage -> ux_slave_class_storage_lun[lun].ux_slave_class_storage_media_read(storage, lun,
- transfer_request -> ux_slave_transfer_request_data_pointer, number_blocks, lba, &media_status);
+ status = storage -> ux_slave_class_storage_lun[lun].ux_slave_class_storage_media_read(storage, lun,
+ transfer_request -> ux_slave_transfer_request_data_pointer, number_blocks, lba, &media_status);
/* If there is a problem, return a failed command. */
if (status != UX_SUCCESS)
{
-
+
/* We have a problem, request error. Return a bad completion and wait for the
REQUEST_SENSE command. */
_ux_device_stack_endpoint_stall(endpoint_in);
-
+
/* Update residue. */
storage -> ux_slave_class_storage_csw_residue = storage -> ux_slave_class_storage_host_length - done_length;
/* And update the REQUEST_SENSE codes. */
storage -> ux_slave_class_storage_lun[lun].ux_slave_class_storage_request_sense_status = media_status;
-
+
/* Return an error. */
return(UX_ERROR);
}
@@ -267,7 +267,7 @@ ULONG done_length;
/* We have a problem, request error. Return a bad completion and wait for the
REQUEST_SENSE command. */
_ux_device_stack_endpoint_stall(endpoint_in);
-
+
/* Update residue. */
storage -> ux_slave_class_storage_csw_residue = storage -> ux_slave_class_storage_host_length - done_length;
@@ -282,11 +282,11 @@ ULONG done_length;
/* Update the LBA address. */
lba += number_blocks;
-
+
/* Update the length to remain. */
- total_length -= transfer_length;
+ total_length -= transfer_length;
done_length += transfer_length;
-
+
/* Update the number of blocks to read. */
total_number_blocks -= number_blocks;
}
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 c3825e7a..3670d0fe 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
@@ -1,18 +1,19 @@
/***************************************************************************
- * Copyright (c) 2024 Microsoft Corporation
- *
+ * Copyright (c) 2024 Microsoft Corporation
+ * Copyright (c) 2026-present Eclipse ThreadX contributors
+ *
* This program and the accompanying materials are made available under the
* terms of the MIT License which is available at
* https://opensource.org/licenses/MIT.
- *
+ *
* SPDX-License-Identifier: MIT
**************************************************************************/
/**************************************************************************/
/**************************************************************************/
-/** */
-/** USBX Component */
+/** */
+/** USBX Component */
/** */
/** Device Storage Class */
/** */
@@ -34,61 +35,42 @@
/* Build option checked runtime by UX_ASSERT */
#endif
-/**************************************************************************/
-/* */
-/* FUNCTION RELEASE */
-/* */
-/* _ux_device_class_storage_read_capacity PORTABLE C */
+/**************************************************************************/
+/* */
+/* FUNCTION RELEASE */
+/* */
+/* _ux_device_class_storage_read_capacity PORTABLE C */
/* 6.3.0 */
/* AUTHOR */
/* */
/* Chaoqiong Xiao, Microsoft Corporation */
/* */
/* DESCRIPTION */
-/* */
-/* This function performs a READ_CAPACITY command. */
-/* */
-/* INPUT */
-/* */
-/* storage Pointer to storage class */
+/* */
+/* This function performs a READ_CAPACITY command. */
+/* */
+/* INPUT */
+/* */
+/* storage Pointer to storage class */
+/* lun Logical unit number */
/* endpoint_in Pointer to IN endpoint */
/* endpoint_out Pointer to OUT endpoint */
-/* cbwcb Pointer to CBWCB */
-/* */
-/* OUTPUT */
-/* */
-/* Completion Status */
-/* */
-/* CALLS */
-/* */
-/* _ux_device_class_storage_csw_send Send CSW */
-/* _ux_device_stack_transfer_request Transfer request */
+/* cbwcb Pointer to CBWCB */
+/* */
+/* OUTPUT */
+/* */
+/* Completion Status */
+/* */
+/* CALLS */
+/* */
+/* _ux_device_stack_transfer_request Transfer request */
/* _ux_device_stack_endpoint_stall Stall endpoint */
-/* _ux_utility_long_put_big_endian Put 32-bit big endian */
-/* _ux_utility_memory_copy Copy memory */
-/* _ux_utility_memory_set Set memory */
-/* */
-/* CALLED BY */
-/* */
-/* Device Storage Class */
-/* */
-/* RELEASE HISTORY */
-/* */
-/* 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 */
-/* 01-31-2022 Chaoqiong Xiao Modified comment(s), */
-/* added standalone support, */
-/* resulting in version 6.1.10 */
-/* 10-31-2023 Chaoqiong Xiao Modified comment(s), */
-/* checked compiling options */
-/* by runtime UX_ASSERT, */
-/* resulting in version 6.3.0 */
+/* _ux_utility_long_put_big_endian Put 32-bit big endian */
+/* _ux_utility_memory_set Set memory */
+/* */
+/* CALLED BY */
+/* */
+/* Device Storage Class */
/* */
/**************************************************************************/
UINT _ux_device_class_storage_read_capacity(UX_SLAVE_CLASS_STORAGE *storage, ULONG lun,
@@ -110,8 +92,25 @@ UCHAR *read_capacity_buffer;
/* 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)
+ if (storage -> ux_slave_class_storage_lun[lun].ux_slave_class_storage_medium_loaded_status == 0)
+ {
+ /* Media not loaded. Set NOT READY sense code. */
+ 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_NOT_READY,
+ UX_SLAVE_CLASS_STORAGE_SENSE_CODE_NOT_PRESENT, 0x00);
+
+ /* Return CSW with failure. */
+ storage -> ux_slave_class_storage_csw_status = UX_SLAVE_CLASS_STORAGE_CSW_FAILED;
+
+ /* We need to STALL the IN endpoint. The endpoint will be reset by the host. */
+ _ux_device_stack_endpoint_stall(endpoint_in);
+
+ /* Return error. */
+ return(UX_SUCCESS);
+ }
+
/* Obtain the status of the device. */
- status = storage -> ux_slave_class_storage_lun[lun].ux_slave_class_storage_media_status(storage, lun,
+ status = storage -> ux_slave_class_storage_lun[lun].ux_slave_class_storage_media_status(storage, lun,
storage -> ux_slave_class_storage_lun[lun].ux_slave_class_storage_media_id, &media_status);
/* Update the request sense. */
@@ -133,24 +132,24 @@ UCHAR *read_capacity_buffer;
}
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); /* 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],
storage -> ux_slave_class_storage_lun[lun].ux_slave_class_storage_media_last_lba);
-
+
/* Insert the block length in the response. */
_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);
-
+
#if defined(UX_DEVICE_STANDALONE)
/* Next: Transfer (DATA). */
@@ -168,7 +167,7 @@ UCHAR *read_capacity_buffer;
#else
/* Send a data payload with the read_capacity response buffer. */
- _ux_device_stack_transfer_request(transfer_request,
+ _ux_device_stack_transfer_request(transfer_request,
UX_SLAVE_CLASS_STORAGE_READ_CAPACITY_RESPONSE_LENGTH,
UX_SLAVE_CLASS_STORAGE_READ_CAPACITY_RESPONSE_LENGTH);
#endif
@@ -177,8 +176,7 @@ UCHAR *read_capacity_buffer;
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_disk_information.c b/common/usbx_device_classes/src/ux_device_class_storage_read_disk_information.c
index 42abc2e0..ca0623b7 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
@@ -1,18 +1,19 @@
/***************************************************************************
- * Copyright (c) 2024 Microsoft Corporation
- *
+ * Copyright (c) 2024 Microsoft Corporation
+ * Copyright (c) 2026-present Eclipse ThreadX contributors
+ *
* This program and the accompanying materials are made available under the
* terms of the MIT License which is available at
* https://opensource.org/licenses/MIT.
- *
+ *
* SPDX-License-Identifier: MIT
**************************************************************************/
/**************************************************************************/
/**************************************************************************/
-/** */
-/** USBX Component */
+/** */
+/** USBX Component */
/** */
/** Device Storage Class */
/** */
@@ -33,21 +34,21 @@
/* #error UX_SLAVE_REQUEST_DATA_MAX_LENGTH is too small, please check */
/* Build option checked runtime by UX_ASSERT */
#endif
-UCHAR usbx_device_class_storage_disk_information[] = {
+UCHAR usbx_device_class_storage_disk_information[] = {
0x00, 0x00, /* Entire length of disk_information */
0x0e, /* Erasable/state of last session/disk status ...*/
- 0x01, /* Number of first track on disk. */
+ 0x01, /* Number of first track on disk. */
0x01, /* Number of sessions. */
- 0x01, /* First track number in last session. */
- 0x01, /* Last track number in last session. */
+ 0x01, /* First track number in last session. */
+ 0x01, /* Last track number in last session. */
0x00, /* DID_V, DBC_V, URU .... */
0x00, /* Disk type */
- 0x00, /* Number of sessions */
- 0x00, /* First Track Number in last session */
- 0x00, /* Last Track Number in last session */
-
+ 0x00, /* Number of sessions */
+ 0x00, /* First Track Number in last session */
+ 0x00, /* Last Track Number in last session */
+
0x00, 0x00, 0x00, 0x00, /* Disk Identification */
0xff, 0xff, 0xff, 0xff, /* Last session lead in start time */
0xff, 0xff, 0xff, 0xff, /* Last possible start time for SOLO */
@@ -56,62 +57,44 @@ UCHAR usbx_device_class_storage_disk_information[] = {
0x00, /* Number of OPC table entries. */
0x00, 0x00, 0x00, 0x00, /* Some padding ? */
0x00, 0x00 /* */
-
+
};
-/**************************************************************************/
-/* */
-/* FUNCTION RELEASE */
-/* */
-/* _ux_device_class_storage_read_disk_information PORTABLE C */
+/**************************************************************************/
+/* */
+/* FUNCTION RELEASE */
+/* */
+/* _ux_device_class_storage_read_disk_information PORTABLE C */
/* 6.3.0 */
/* AUTHOR */
/* */
/* Chaoqiong Xiao, Microsoft Corporation */
/* */
/* DESCRIPTION */
-/* */
-/* This function performs a READ_DISK_INFORMATION command. */
-/* */
-/* INPUT */
-/* */
-/* storage Pointer to storage class */
+/* */
+/* This function performs a READ_DISK_INFORMATION command. */
+/* */
+/* INPUT */
+/* */
+/* storage Pointer to storage class */
/* endpoint_in Pointer to IN endpoint */
/* endpoint_out Pointer to OUT endpoint */
-/* cbwcb Pointer to CBWCB */
-/* */
-/* OUTPUT */
-/* */
-/* Completion Status */
-/* */
-/* CALLS */
-/* */
-/* _ux_device_class_storage_csw_send Send CSW */
-/* _ux_device_stack_transfer_request Transfer request */
-/* _ux_utility_short_put_big_endian Put 16-bit big endian */
-/* _ux_utility_memory_copy Copy memory */
-/* */
-/* CALLED BY */
-/* */
-/* Device Storage Class */
-/* */
-/* RELEASE HISTORY */
-/* */
-/* 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 */
-/* 01-31-2022 Chaoqiong Xiao Modified comment(s), */
-/* added standalone support, */
-/* resulting in version 6.1.10 */
-/* 10-31-2023 Chaoqiong Xiao Modified comment(s), */
-/* checked compiling options */
-/* by runtime UX_ASSERT, */
-/* resulting in version 6.3.0 */
+/* cbwcb Pointer to CBWCB */
+/* */
+/* OUTPUT */
+/* */
+/* Completion Status */
+/* */
+/* CALLS */
+/* */
+/* _ux_device_class_storage_csw_send Send CSW */
+/* _ux_device_stack_transfer_request Transfer request */
+/* _ux_utility_short_put_big_endian Put 16-bit big endian */
+/* _ux_utility_memory_copy Copy memory */
+/* */
+/* CALLED BY */
+/* */
+/* Device Storage Class */
/* */
/**************************************************************************/
UINT _ux_device_class_storage_read_disk_information(UX_SLAVE_CLASS_STORAGE *storage, ULONG lun,
@@ -130,10 +113,10 @@ ULONG allocation_length;
/* If trace is enabled, insert this event into the trace buffer. */
UX_TRACE_IN_LINE_INSERT(UX_TRACE_DEVICE_CLASS_STORAGE_GET_CONFIGURATION, storage, lun, 0, 0, UX_TRACE_DEVICE_CLASS_EVENTS, 0, 0)
-
+
/* Initialize the length of the disk information field. */
_ux_utility_short_put_big_endian(usbx_device_class_storage_disk_information, (USBX_DEVICE_CLASS_STORAGE_DISK_INFORMATION_LENGTH - 2));
-
+
/* Clean the disk status. */
usbx_device_class_storage_disk_information[2] &= (UCHAR)~3;
@@ -148,21 +131,21 @@ ULONG allocation_length;
/* Obtain the pointer to the transfer request. */
transfer_request = &endpoint_in -> ux_slave_endpoint_transfer_request;
-
+
/* Get the allocation length. */
allocation_length = _ux_utility_short_get_big_endian(cbwcb + UX_SLAVE_CLASS_STORAGE_READ_DISK_INFORMATION_ALLOCATION_LENGTH);
/* Can we send all the disk information ? */
if (allocation_length > USBX_DEVICE_CLASS_STORAGE_DISK_INFORMATION_LENGTH)
-
+
/* Yes, so send only the disk information profile. */
allocation_length = USBX_DEVICE_CLASS_STORAGE_DISK_INFORMATION_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,
+ _ux_utility_memory_copy(transfer_request -> ux_slave_transfer_request_data_pointer,
+ usbx_device_class_storage_disk_information,
allocation_length); /* Use case of memcpy is verified. */
-
+
#if defined(UX_DEVICE_STANDALONE)
/* Next: Transfer (DATA). */
@@ -178,7 +161,7 @@ ULONG allocation_length;
#else
/* Send a data payload with the read_capacity response buffer. */
- _ux_device_stack_transfer_request(transfer_request,
+ _ux_device_stack_transfer_request(transfer_request,
allocation_length,
allocation_length);
#endif
@@ -186,7 +169,7 @@ ULONG allocation_length;
/* 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 13e83b3c..7d351ab8 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
@@ -1,18 +1,19 @@
/***************************************************************************
- * Copyright (c) 2024 Microsoft Corporation
- *
+ * Copyright (c) 2024 Microsoft Corporation
+ * Copyright (c) 2026-present Eclipse ThreadX contributors
+ *
* This program and the accompanying materials are made available under the
* terms of the MIT License which is available at
* https://opensource.org/licenses/MIT.
- *
+ *
* SPDX-License-Identifier: MIT
**************************************************************************/
/**************************************************************************/
/**************************************************************************/
-/** */
-/** USBX Component */
+/** */
+/** USBX Component */
/** */
/** Device Storage Class */
/** */
@@ -29,7 +30,7 @@
#include "ux_device_stack.h"
#define USBX_DEVICE_CLASS_STORAGE_DVD_STRUCTURE_LENGTH (2048 + 4)
-UCHAR usbx_device_class_storage_dvd_structure[] = {
+UCHAR usbx_device_class_storage_dvd_structure[] = {
0x08, 0x02, 0x00, 0x00, 0x25, 0x0F, 0x02, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x03, 0x00, 0xAF,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0xFF, 0x00, 0x00, 0x04, 0x6E, 0xA0, 0x00, 0x00, 0x00, 0x00,
@@ -153,58 +154,44 @@ UCHAR usbx_device_class_storage_dvd_structure[] = {
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00
-
+
};
-/**************************************************************************/
-/* */
-/* FUNCTION RELEASE */
-/* */
-/* _ux_device_class_storage_read_dvd_structure PORTABLE C */
+/**************************************************************************/
+/* */
+/* FUNCTION RELEASE */
+/* */
+/* _ux_device_class_storage_read_dvd_structure PORTABLE C */
/* 6.1.10 */
/* AUTHOR */
/* */
/* Chaoqiong Xiao, Microsoft Corporation */
/* */
/* DESCRIPTION */
-/* */
-/* This function performs a READ_DVD_STRUCTURE command. */
-/* */
-/* INPUT */
-/* */
-/* storage Pointer to storage class */
+/* */
+/* This function performs a READ_DVD_STRUCTURE command. */
+/* */
+/* INPUT */
+/* */
+/* storage Pointer to storage class */
/* endpoint_in Pointer to IN endpoint */
/* endpoint_out Pointer to OUT endpoint */
-/* cbwcb Pointer to CBWCB */
-/* */
-/* OUTPUT */
-/* */
-/* Completion Status */
-/* */
-/* CALLS */
-/* */
-/* _ux_device_class_storage_csw_send Send CSW */
-/* _ux_device_stack_transfer_request Transfer request */
-/* _ux_utility_short_get_big_endian Get 16-bit big endian */
-/* _ux_utility_memory_copy Copy memory */
-/* */
-/* CALLED BY */
-/* */
-/* Device Storage Class */
-/* */
-/* RELEASE HISTORY */
-/* */
-/* 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 */
-/* 01-31-2022 Chaoqiong Xiao Modified comment(s), */
-/* added standalone support, */
-/* resulting in version 6.1.10 */
+/* cbwcb Pointer to CBWCB */
+/* */
+/* OUTPUT */
+/* */
+/* Completion Status */
+/* */
+/* CALLS */
+/* */
+/* _ux_device_class_storage_csw_send Send CSW */
+/* _ux_device_stack_transfer_request Transfer request */
+/* _ux_utility_short_get_big_endian Get 16-bit big endian */
+/* _ux_utility_memory_copy Copy memory */
+/* */
+/* CALLED BY */
+/* */
+/* Device Storage Class */
/* */
/**************************************************************************/
UINT _ux_device_class_storage_read_dvd_structure(UX_SLAVE_CLASS_STORAGE *storage, ULONG lun,
@@ -226,16 +213,16 @@ ULONG transfer_length = 0;
/* If trace is enabled, insert this event into the trace buffer. */
UX_TRACE_IN_LINE_INSERT(UX_TRACE_DEVICE_CLASS_STORAGE_OTHER, storage, lun, 0, 0, UX_TRACE_DEVICE_CLASS_EVENTS, 0, 0)
-
+
/* Obtain the pointer to the transfer request. */
transfer_request = &endpoint_in -> ux_slave_endpoint_transfer_request;
-
+
/* Get the allocation length. */
allocation_length = _ux_utility_short_get_big_endian(cbwcb + UX_SLAVE_CLASS_STORAGE_READ_DISK_INFORMATION_ALLOCATION_LENGTH);
/* Can we send all the disk information ? */
if (allocation_length > USBX_DEVICE_CLASS_STORAGE_DVD_STRUCTURE_LENGTH)
-
+
/* Yes, so send only the disk information profile. */
allocation_length = USBX_DEVICE_CLASS_STORAGE_DVD_STRUCTURE_LENGTH;
@@ -266,19 +253,19 @@ ULONG transfer_length = 0;
/* Compute the transfer length based on the maximum allowed. */
transfer_length = UX_SLAVE_CLASS_STORAGE_BUFFER_SIZE;
-
+
else
/* Compute the transfer length based on what is left to transfer. */
transfer_length = allocation_length;
/* Copy the CSW into the transfer request memory. */
- _ux_utility_memory_copy(transfer_request -> ux_slave_transfer_request_data_pointer,
- dvd_structure_pointer,
+ _ux_utility_memory_copy(transfer_request -> ux_slave_transfer_request_data_pointer,
+ dvd_structure_pointer,
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,
+ status = _ux_device_stack_transfer_request(transfer_request,
transfer_length,
transfer_length);
@@ -288,7 +275,7 @@ ULONG transfer_length = 0;
/* Advance pointer to dvd structure. */
dvd_structure_pointer += transfer_length;
-
+
/* Subtract what is left to send out. */
allocation_length -= transfer_length;
}
@@ -298,7 +285,7 @@ ULONG transfer_length = 0;
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 e84e424c..7c78acca 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
@@ -1,18 +1,19 @@
/***************************************************************************
- * Copyright (c) 2024 Microsoft Corporation
- *
+ * Copyright (c) 2024 Microsoft Corporation
+ * Copyright (c) 2026-present Eclipse ThreadX contributors
+ *
* This program and the accompanying materials are made available under the
* terms of the MIT License which is available at
* https://opensource.org/licenses/MIT.
- *
+ *
* SPDX-License-Identifier: MIT
**************************************************************************/
/**************************************************************************/
/**************************************************************************/
-/** */
-/** USBX Component */
+/** */
+/** USBX Component */
/** */
/** Device Storage Class */
/** */
@@ -34,60 +35,41 @@
/* Build option checked runtime by UX_ASSERT */
#endif
-/**************************************************************************/
-/* */
-/* FUNCTION RELEASE */
-/* */
-/* _ux_device_class_storage_read_format_capacity PORTABLE C */
+/**************************************************************************/
+/* */
+/* FUNCTION RELEASE */
+/* */
+/* _ux_device_class_storage_read_format_capacity PORTABLE C */
/* 6.3.0 */
/* AUTHOR */
/* */
/* Chaoqiong Xiao, Microsoft Corporation */
/* */
/* DESCRIPTION */
-/* */
-/* This function performs a READ_FORMAT_CAPACITY command. */
-/* */
-/* INPUT */
-/* */
-/* storage Pointer to storage class */
+/* */
+/* This function performs a READ_FORMAT_CAPACITY command. */
+/* */
+/* INPUT */
+/* */
+/* storage Pointer to storage class */
+/* lun Logical unit number */
/* endpoint_in Pointer to IN endpoint */
/* endpoint_out Pointer to OUT endpoint */
-/* cbwcb Pointer to CBWCB */
-/* */
-/* OUTPUT */
-/* */
-/* Completion Status */
-/* */
-/* CALLS */
-/* */
-/* _ux_device_class_storage_csw_send Send CSW */
-/* _ux_device_stack_transfer_request Transfer request */
+/* cbwcb Pointer to CBWCB */
+/* */
+/* OUTPUT */
+/* */
+/* Completion Status */
+/* */
+/* CALLS */
+/* */
+/* _ux_device_stack_transfer_request Transfer request */
/* _ux_utility_memory_set Set memory */
/* _ux_utility_long_put_big_endian Put 32-bit big endian */
-/* _ux_utility_memory_copy Copy memory */
-/* */
-/* CALLED BY */
-/* */
-/* Device Storage Class */
-/* */
-/* RELEASE HISTORY */
-/* */
-/* 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 */
-/* 01-31-2022 Chaoqiong Xiao Modified comment(s), */
-/* added standalone support, */
-/* resulting in version 6.1.10 */
-/* 10-31-2023 Chaoqiong Xiao Modified comment(s), */
-/* checked compiling options */
-/* by runtime UX_ASSERT, */
-/* resulting in version 6.3.0 */
+/* */
+/* CALLED BY */
+/* */
+/* Device Storage Class */
/* */
/**************************************************************************/
UINT _ux_device_class_storage_read_format_capacity(UX_SLAVE_CLASS_STORAGE *storage, ULONG lun,
@@ -108,6 +90,20 @@ UCHAR *read_format_capacity_buffer;
/* If trace is enabled, insert this event into the trace buffer. */
UX_TRACE_IN_LINE_INSERT(UX_TRACE_DEVICE_CLASS_STORAGE_READ_FORMAT_CAPACITY, storage, lun, 0, 0, UX_TRACE_DEVICE_CLASS_EVENTS, 0, 0)
+ if (storage -> ux_slave_class_storage_lun[lun].ux_slave_class_storage_medium_loaded_status == 0)
+ {
+ /* Media not loaded. Set NOT READY sense code. */
+ 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_NOT_READY,
+ UX_SLAVE_CLASS_STORAGE_SENSE_CODE_NOT_PRESENT, 0x00);
+
+ /* Return CSW with failure. */
+ storage -> ux_slave_class_storage_csw_status = UX_SLAVE_CLASS_STORAGE_CSW_FAILED;
+
+ /* Return completion status. */
+ return(UX_SUCCESS);
+ }
+
/* Obtain the pointer to the transfer request. */
transfer_request = &endpoint_in -> ux_slave_endpoint_transfer_request;
@@ -129,7 +125,7 @@ UCHAR *read_format_capacity_buffer;
storage -> ux_slave_class_storage_lun[lun].ux_slave_class_storage_media_block_length);
/* Insert the response code : always 2. */
- read_format_capacity_buffer[UX_SLAVE_CLASS_STORAGE_READ_FORMAT_CAPACITY_RESPONSE_DESC_CODE] = 2;
+ read_format_capacity_buffer[UX_SLAVE_CLASS_STORAGE_READ_FORMAT_CAPACITY_RESPONSE_DESC_CODE] = 2;
#if defined(UX_DEVICE_STANDALONE)
@@ -148,7 +144,7 @@ UCHAR *read_format_capacity_buffer;
#else
/* Send a data payload with the read_capacity response buffer. */
- _ux_device_stack_transfer_request(transfer_request,
+ _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);
#endif
@@ -160,4 +156,3 @@ UCHAR *read_format_capacity_buffer;
/* 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 bc6f2495..0623a5de 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
@@ -1,18 +1,19 @@
/***************************************************************************
- * Copyright (c) 2024 Microsoft Corporation
- *
+ * Copyright (c) 2024 Microsoft Corporation
+ * Copyright (c) 2026-present Eclipse ThreadX contributors
+ *
* This program and the accompanying materials are made available under the
* terms of the MIT License which is available at
* https://opensource.org/licenses/MIT.
- *
+ *
* SPDX-License-Identifier: MIT
**************************************************************************/
/**************************************************************************/
/**************************************************************************/
-/** */
-/** USBX Component */
+/** */
+/** USBX Component */
/** */
/** Device Storage Class */
/** */
@@ -34,64 +35,46 @@
/* Build option checked runtime by UX_ASSERT */
#endif
-/**************************************************************************/
-/* */
-/* FUNCTION RELEASE */
-/* */
-/* _ux_device_class_storage_read_toc PORTABLE C */
+/**************************************************************************/
+/* */
+/* FUNCTION RELEASE */
+/* */
+/* _ux_device_class_storage_read_toc PORTABLE C */
/* 6.3.0 */
/* AUTHOR */
/* */
/* Chaoqiong Xiao, Microsoft Corporation */
/* */
/* DESCRIPTION */
-/* */
-/* This function performs a READ_TOC SCSI command. This is only for */
-/* supporting CD-ROM emulation and is hardwired to what Windows wants. */
-/* */
-/* INPUT */
-/* */
-/* storage Pointer to storage class */
+/* */
+/* This function performs a READ_TOC SCSI command. This is only for */
+/* supporting CD-ROM emulation and is hardwired to what Windows wants. */
+/* */
+/* INPUT */
+/* */
+/* storage Pointer to storage class */
/* endpoint_in Pointer to IN endpoint */
/* endpoint_out Pointer to OUT endpoint */
-/* cbwcb Pointer to CBWCB */
-/* */
-/* OUTPUT */
-/* */
-/* Completion Status */
-/* */
-/* CALLS */
-/* */
-/* _ux_device_stack_transfer_request Transfer request */
-/* _ux_device_class_storage_csw_send Send CSW */
+/* cbwcb Pointer to CBWCB */
+/* */
+/* OUTPUT */
+/* */
+/* Completion Status */
+/* */
+/* CALLS */
+/* */
+/* _ux_device_stack_transfer_request Transfer request */
+/* _ux_device_class_storage_csw_send Send CSW */
/* _ux_utility_memory_set Set memory */
/* _ux_utility_memory_copy Copy memory */
/* _ux_utility_short_get_big_endian Get 16-bit big endian */
-/* */
-/* CALLED BY */
-/* */
+/* */
+/* CALLED BY */
+/* */
/* Device Storage Class */
-/* */
-/* RELEASE HISTORY */
-/* */
-/* 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 */
-/* 01-31-2022 Chaoqiong Xiao Modified comment(s), */
-/* added standalone support, */
-/* resulting in version 6.1.10 */
-/* 10-31-2023 Chaoqiong Xiao Modified comment(s), */
-/* checked compiling options */
-/* by runtime UX_ASSERT, */
-/* resulting in version 6.3.0 */
/* */
/**************************************************************************/
-UINT _ux_device_class_storage_read_toc(UX_SLAVE_CLASS_STORAGE *storage, ULONG lun,
+UINT _ux_device_class_storage_read_toc(UX_SLAVE_CLASS_STORAGE *storage, ULONG lun,
UX_SLAVE_ENDPOINT *endpoint_in,
UX_SLAVE_ENDPOINT *endpoint_out, UCHAR * cbwcb)
{
@@ -127,16 +110,16 @@ UCHAR *toc_buffer;
/* Insert the fist and last tack number. */
toc_buffer[2] = 0x01;
toc_buffer[3] = 0x01;
-
+
/* Set TOC length by default. */
toc_length = 20;
-
+
/* Insert the ADR and control values. */
toc_buffer[5] = 0x14;
-
+
/* Insert the TOC tack number. */
toc_buffer[6] = 0x01;
-
+
/* Check if the request is for the TOC or time stamp. */
switch (*(cbwcb + UX_SLAVE_CLASS_STORAGE_READ_TOC_FORMAT))
{
@@ -145,41 +128,41 @@ UCHAR *toc_buffer;
/* Set the toc buffer length. */
toc_length = 20;
-
+
/* Insert the TOC buffer length. */
toc_buffer[1] = 0x12;
-
+
/* Insert some time values. */
toc_buffer[10] = 0x02;
toc_buffer[13] = 0x17;
toc_buffer[14] = 0xAA;
toc_buffer[18] = 0x04;
toc_buffer[19] = 0x1a;
-
+
break;
case 0x01 :
/* Set the toc buffer length. */
toc_length = 19;
-
+
/* Insert the TOC buffer length. */
toc_buffer[1] = 0x12;
-
+
toc_buffer[13] = 0x17;
toc_buffer[14] = 0xAA;
toc_buffer[19] = 0xb0;
-
+
break;
case 0x00 :
-
+
/* Set the toc buffer length. */
toc_length = 20;
-
+
/* Insert the TOC buffer length. */
toc_buffer[1] = 0x12;
-
+
/* Insert some time values. */
toc_buffer[10] = 0x02;
toc_buffer[13] = 0x17;
@@ -189,13 +172,13 @@ UCHAR *toc_buffer;
break;
}
-
+
/* Check how much we can send back. */
if (allocation_length > toc_length)
-
+
/* We return less than demanded. */
allocation_length = toc_length;
-
+
#if defined(UX_DEVICE_STANDALONE)
/* Next: Transfer (DATA). */
@@ -216,9 +199,9 @@ UCHAR *toc_buffer;
/* 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 79928f2b..157a7317 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
@@ -1,18 +1,19 @@
/***************************************************************************
- * Copyright (c) 2024 Microsoft Corporation
- *
+ * Copyright (c) 2024 Microsoft Corporation
+ * Copyright (c) 2026-present Eclipse ThreadX contributors
+ *
* This program and the accompanying materials are made available under the
* terms of the MIT License which is available at
* https://opensource.org/licenses/MIT.
- *
+ *
* SPDX-License-Identifier: MIT
**************************************************************************/
/**************************************************************************/
/**************************************************************************/
-/** */
-/** USBX Component */
+/** */
+/** USBX Component */
/** */
/** Device Storage Class */
/** */
@@ -34,67 +35,46 @@
/* Build option checked runtime by UX_ASSERT */
#endif
-/**************************************************************************/
-/* */
-/* FUNCTION RELEASE */
-/* */
-/* _ux_device_class_storage_report_key PORTABLE C */
+/**************************************************************************/
+/* */
+/* FUNCTION RELEASE */
+/* */
+/* _ux_device_class_storage_report_key PORTABLE C */
/* 6.3.0 */
/* AUTHOR */
/* */
/* Chaoqiong Xiao, Microsoft Corporation */
/* */
/* DESCRIPTION */
-/* */
-/* This function performs a REPORT_KEY SCSI command. */
-/* */
-/* INPUT */
-/* */
-/* storage Pointer to storage class */
+/* */
+/* This function performs a REPORT_KEY SCSI command. */
+/* */
+/* INPUT */
+/* */
+/* storage Pointer to storage class */
/* endpoint_in Pointer to IN endpoint */
/* endpoint_out Pointer to OUT endpoint */
-/* cbwcb Pointer to CBWCB */
-/* */
-/* OUTPUT */
-/* */
-/* Completion Status */
-/* */
-/* CALLS */
-/* */
-/* _ux_device_stack_transfer_request Transfer request */
-/* _ux_device_class_storage_csw_send Send CSW */
+/* cbwcb Pointer to CBWCB */
+/* */
+/* OUTPUT */
+/* */
+/* Completion Status */
+/* */
+/* CALLS */
+/* */
+/* _ux_device_stack_transfer_request Transfer request */
+/* _ux_device_class_storage_csw_send Send CSW */
/* _ux_utility_memory_set Set memory */
-/* */
-/* CALLED BY */
-/* */
+/* */
+/* CALLED BY */
+/* */
/* Device Storage Class */
-/* */
-/* RELEASE HISTORY */
-/* */
-/* 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 */
-/* 12-31-2020 Chaoqiong Xiao Modified comment(s), */
-/* fixed compile warning, */
-/* resulting in version 6.1.3 */
-/* 01-31-2022 Chaoqiong Xiao Modified comment(s), */
-/* added standalone support, */
-/* resulting in version 6.1.10 */
-/* 10-31-2023 Chaoqiong Xiao Modified comment(s), */
-/* checked compiling options */
-/* by runtime UX_ASSERT, */
-/* resulting in version 6.3.0 */
/* */
/**************************************************************************/
-UINT _ux_device_class_storage_report_key(UX_SLAVE_CLASS_STORAGE *storage,
- ULONG lun,
+UINT _ux_device_class_storage_report_key(UX_SLAVE_CLASS_STORAGE *storage,
+ ULONG lun,
UX_SLAVE_ENDPOINT *endpoint_in,
- UX_SLAVE_ENDPOINT *endpoint_out,
+ UX_SLAVE_ENDPOINT *endpoint_out,
UCHAR *cbwcb)
{
@@ -118,13 +98,13 @@ ULONG key_format;
/* Get the report key. */
key_format = (ULONG) *(cbwcb + UX_SLAVE_CLASS_STORAGE_REPORT_KEY_FORMAT);
-
+
/* Extract the length to be returned by the cbwcb. */
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, 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)
{
@@ -133,7 +113,7 @@ ULONG key_format;
/* Put the length to be returned. */
- _ux_utility_short_put_big_endian(transfer_request -> ux_slave_transfer_request_data_pointer,
+ _ux_utility_short_put_big_endian(transfer_request -> ux_slave_transfer_request_data_pointer,
UX_SLAVE_CLASS_STORAGE_REPORT_KEY_ANSWER_PAYLOAD);
/* Put the reset field. */
@@ -147,16 +127,16 @@ ULONG key_format;
/* Compute the payload to return. Depends on the request. */
if (allocation_length > UX_SLAVE_CLASS_STORAGE_REPORT_KEY_ANSWER_LENGTH)
-
+
/* Adjust the reply. */
- allocation_length = UX_SLAVE_CLASS_STORAGE_REPORT_KEY_ANSWER_LENGTH;
+ allocation_length = UX_SLAVE_CLASS_STORAGE_REPORT_KEY_ANSWER_LENGTH;
break;
-
+
default :
allocation_length = 0;
break;
-
+
}
#if defined(UX_DEVICE_STANDALONE)
@@ -183,4 +163,4 @@ ULONG key_format;
/* 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 65e9a9f0..e6e114c5 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
@@ -1,18 +1,19 @@
/***************************************************************************
- * Copyright (c) 2024 Microsoft Corporation
- *
+ * Copyright (c) 2024 Microsoft Corporation
+ * Copyright (c) 2026-present Eclipse ThreadX contributors
+ *
* This program and the accompanying materials are made available under the
* terms of the MIT License which is available at
* https://opensource.org/licenses/MIT.
- *
+ *
* SPDX-License-Identifier: MIT
**************************************************************************/
/**************************************************************************/
/**************************************************************************/
-/** */
-/** USBX Component */
+/** */
+/** USBX Component */
/** */
/** Device Storage Class */
/** */
@@ -34,62 +35,41 @@
/* Build option checked runtime by UX_ASSERT */
#endif
-/**************************************************************************/
-/* */
-/* FUNCTION RELEASE */
-/* */
-/* _ux_device_class_storage_request_sense PORTABLE C */
+/**************************************************************************/
+/* */
+/* FUNCTION RELEASE */
+/* */
+/* _ux_device_class_storage_request_sense PORTABLE C */
/* 6.3.0 */
/* AUTHOR */
/* */
/* Chaoqiong Xiao, Microsoft Corporation */
/* */
/* DESCRIPTION */
-/* */
-/* This function performs a request sense command. */
-/* */
-/* INPUT */
-/* */
-/* storage Pointer to storage class */
+/* */
+/* This function performs a request sense command. */
+/* */
+/* INPUT */
+/* */
+/* storage Pointer to storage class */
/* endpoint_in Pointer to IN endpoint */
/* endpoint_out Pointer to OUT endpoint */
-/* cbwcb Pointer to CBWCB */
-/* */
-/* OUTPUT */
-/* */
-/* Completion Status */
-/* */
-/* CALLS */
-/* */
-/* _ux_device_class_storage_csw_send Send CSW */
-/* _ux_device_stack_transfer_request Transfer request */
-/* _ux_utility_memory_copy Copy memory */
-/* _ux_utility_memory_set Set memory */
-/* */
-/* CALLED BY */
-/* */
-/* Device Storage Class */
-/* */
-/* RELEASE HISTORY */
-/* */
-/* 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 */
-/* 12-31-2020 Chaoqiong Xiao Modified comment(s), */
-/* fixed USB CV test issues, */
-/* resulting in version 6.1.3 */
-/* 01-31-2022 Chaoqiong Xiao Modified comment(s), */
-/* added standalone support, */
-/* resulting in version 6.1.10 */
-/* 10-31-2023 Chaoqiong Xiao Modified comment(s), */
-/* checked compiling options */
-/* by runtime UX_ASSERT, */
-/* resulting in version 6.3.0 */
+/* cbwcb Pointer to CBWCB */
+/* */
+/* OUTPUT */
+/* */
+/* Completion Status */
+/* */
+/* CALLS */
+/* */
+/* _ux_device_class_storage_csw_send Send CSW */
+/* _ux_device_stack_transfer_request Transfer request */
+/* _ux_utility_memory_copy Copy memory */
+/* _ux_utility_memory_set Set memory */
+/* */
+/* CALLED BY */
+/* */
+/* Device Storage Class */
/* */
/**************************************************************************/
UINT _ux_device_class_storage_request_sense(UX_SLAVE_CLASS_STORAGE *storage, ULONG lun, UX_SLAVE_ENDPOINT *endpoint_in,
@@ -122,9 +102,9 @@ ULONG sense_length;
/* Ensure it is cleaned. */
_ux_utility_memory_set(sense_buffer, 0, sense_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] =
+ 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. */
@@ -145,7 +125,7 @@ ULONG sense_length;
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,
+ UX_TRACE_IN_LINE_INSERT(UX_TRACE_DEVICE_CLASS_STORAGE_REQUEST_SENSE, storage, lun,
key, code, UX_TRACE_DEVICE_CLASS_EVENTS, 0, 0)
/* Initialize the response buffer with the additional length. */
@@ -176,7 +156,7 @@ ULONG sense_length;
}
#endif
- /* Return completion status. */
+ /* 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 f3b7a989..75e7dd31 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
@@ -1,18 +1,19 @@
/***************************************************************************
- * Copyright (c) 2024 Microsoft Corporation
- *
+ * Copyright (c) 2024 Microsoft Corporation
+ * Copyright (c) 2026-present Eclipse ThreadX contributors
+ *
* This program and the accompanying materials are made available under the
* terms of the MIT License which is available at
* https://opensource.org/licenses/MIT.
- *
+ *
* SPDX-License-Identifier: MIT
**************************************************************************/
/**************************************************************************/
/**************************************************************************/
-/** */
-/** USBX Component */
+/** */
+/** USBX Component */
/** */
/** Device Storage Class */
/** */
@@ -29,67 +30,107 @@
#include "ux_device_stack.h"
-/**************************************************************************/
-/* */
-/* FUNCTION RELEASE */
-/* */
-/* _ux_device_class_storage_start_stop PORTABLE C */
+/**************************************************************************/
+/* */
+/* FUNCTION RELEASE */
+/* */
+/* _ux_device_class_storage_start_stop PORTABLE C */
/* 6.1 */
/* AUTHOR */
/* */
/* Chaoqiong Xiao, Microsoft Corporation */
/* */
/* DESCRIPTION */
-/* */
-/* This function starts or stops the media. This command will not do */
-/* anything here, just the CSW is returned with a SUCCESS code. */
-/* */
-/* INPUT */
-/* */
-/* storage Pointer to storage class */
+/* */
+/* This function starts or stops the media. The device load or eject */
+/* the medium. */
+/* */
+/* INPUT */
+/* */
+/* storage Pointer to storage class */
+/* lun Logical unit number */
/* endpoint_in Pointer to IN endpoint */
/* endpoint_out Pointer to OUT endpoint */
-/* cbwcb Pointer to CBWCB */
-/* */
-/* OUTPUT */
-/* */
-/* Completion Status */
-/* */
-/* CALLS */
-/* */
-/* _ux_device_class_storage_csw_send Send CSW */
-/* */
-/* CALLED BY */
-/* */
+/* cbwcb Pointer to CBWCB */
+/* */
+/* OUTPUT */
+/* */
+/* Completion Status */
+/* */
+/* CALLS */
+/* */
+/* None */
+/* */
+/* CALLED BY */
+/* */
/* Device Storage Class */
-/* */
-/* RELEASE HISTORY */
-/* */
-/* 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,
+UINT _ux_device_class_storage_start_stop(UX_SLAVE_CLASS_STORAGE *storage, ULONG lun,
UX_SLAVE_ENDPOINT *endpoint_in,
UX_SLAVE_ENDPOINT *endpoint_out, UCHAR * cbwcb)
{
- UX_PARAMETER_NOT_USED(lun);
+ULONG power_condition;
+ULONG start;
+ULONG load_eject;
+
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)
+ /* Parse START/STOP (SBC-2 0x1B): byte 4 has LOEJ (bit1) and START (bit0). */
+ power_condition = (ULONG)((cbwcb[4] & 0xF0) >> 0x04);
+ start = (ULONG)(cbwcb[4] & 0x01);
+ load_eject = (ULONG)((cbwcb[4] & 0x02) >> 0x01);
+
+ if ((load_eject == 1) &&
+ (storage -> ux_slave_class_storage_lun[lun].ux_slave_class_storage_prevent_medium_removal == 1) &&
+ (storage -> ux_slave_class_storage_lun[lun].ux_slave_class_storage_media_removable_flag == UX_SLAVE_CLASS_STORAGE_MEDIA_IS_NOT_REMOVABLE))
+ {
+ /* 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(UX_SLAVE_CLASS_STORAGE_SENSE_KEY_ILLEGAL_REQUEST,
+ UX_SLAVE_CLASS_STORAGE_ASC_KEY_INVALID_COMMAND, 0x00);
+
+ /* Set the CSW with failure. */
+ storage -> ux_slave_class_storage_csw_status = UX_SLAVE_CLASS_STORAGE_CSW_FAILED;
+
+ /* Return error. */
+ return(UX_ERROR);
+ }
+
+ /* power_condition = 0, load_eject = 0 : no action regarding loading or ejecting the medium.
+ power_condition = 0, load_eject = 1, start = 0 : unload the medium.
+ power_condition = 0, load_eject = 1, start = 1 : load the medium.
+ */
+ if (power_condition == UX_SLAVE_CLASS_STORAGE_POWER_CONDITION_START_VALID)
+ {
+ if (load_eject != 0)
+ {
+ if (start == 0)
+ {
+ /* Eject media: mark as empty. */
+ storage -> ux_slave_class_storage_lun[lun].ux_slave_class_storage_medium_loaded_status = 0;
+ }
+ else
+ {
+ /* Load media: mark as present/complete. */
+ storage -> ux_slave_class_storage_lun[lun].ux_slave_class_storage_medium_loaded_status = 1;
+ }
+ }
+ }
+
+ /* Call the media start/stop function if available. */
+ if (storage -> ux_slave_class_storage_lun[lun].ux_slave_class_storage_media_start_stop != UX_NULL)
+ storage -> ux_slave_class_storage_lun[lun].ux_slave_class_storage_media_start_stop(
+ storage, lun, power_condition, start, load_eject);
+
/* 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 497cdff2..59b3f4cc 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
@@ -1,18 +1,19 @@
/***************************************************************************
- * Copyright (c) 2024 Microsoft Corporation
- *
+ * Copyright (c) 2024 Microsoft Corporation
+ * Copyright (c) 2026-present Eclipse ThreadX contributors
+ *
* This program and the accompanying materials are made available under the
* terms of the MIT License which is available at
* https://opensource.org/licenses/MIT.
- *
+ *
* SPDX-License-Identifier: MIT
**************************************************************************/
/**************************************************************************/
/**************************************************************************/
-/** */
-/** USBX Component */
+/** */
+/** USBX Component */
/** */
/** Device Storage Class */
/** */
@@ -29,60 +30,48 @@
#include "ux_device_stack.h"
-/**************************************************************************/
-/* */
-/* FUNCTION RELEASE */
-/* */
-/* _ux_device_class_storage_synchronize_cache PORTABLE C */
+/**************************************************************************/
+/* */
+/* FUNCTION RELEASE */
+/* */
+/* _ux_device_class_storage_synchronize_cache PORTABLE C */
/* 6.1.10 */
/* AUTHOR */
/* */
/* Chaoqiong Xiao, Microsoft Corporation */
/* */
/* DESCRIPTION */
-/* */
-/* This function performs a SYNCHRONIZE_CACHE command in 32 or 16 */
-/* bits. */
-/* */
-/* INPUT */
-/* */
-/* storage Pointer to storage class */
+/* */
+/* This function performs a SYNCHRONIZE_CACHE command in 32 or 16 */
+/* bits. */
+/* */
+/* INPUT */
+/* */
+/* storage Pointer to storage class */
/* endpoint_in Pointer to IN endpoint */
/* endpoint_out Pointer to OUT endpoint */
-/* cbwcb Pointer to the CBWCB */
-/* scsi_command SCSI command */
-/* */
-/* OUTPUT */
-/* */
-/* Completion Status */
-/* */
-/* CALLS */
-/* */
-/* (ux_slave_class_storage_media_status) Get media status */
-/* (ux_slave_class_storage_media_flush) Flush media */
-/* _ux_device_class_storage_csw_send Send CSW */
-/* _ux_device_stack_endpoint_stall Stall endpoint */
-/* _ux_utility_long_get_big_endian Get 32-bit big endian */
-/* _ux_utility_short_get_big_endian Get 16-bit big endian */
-/* */
-/* CALLED BY */
-/* */
-/* Device Storage Class */
-/* */
-/* RELEASE HISTORY */
-/* */
-/* 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 */
-/* 01-31-2022 Chaoqiong Xiao Modified comment(s), */
-/* added standalone support, */
-/* resulting in version 6.1.10 */
+/* cbwcb Pointer to the CBWCB */
+/* scsi_command SCSI command */
+/* */
+/* OUTPUT */
+/* */
+/* Completion Status */
+/* */
+/* CALLS */
+/* */
+/* (ux_slave_class_storage_media_status) Get media status */
+/* (ux_slave_class_storage_media_flush) Flush media */
+/* _ux_device_class_storage_csw_send Send CSW */
+/* _ux_device_stack_endpoint_stall Stall endpoint */
+/* _ux_utility_long_get_big_endian Get 32-bit big endian */
+/* _ux_utility_short_get_big_endian Get 16-bit big endian */
+/* */
+/* CALLED BY */
+/* */
+/* Device Storage Class */
/* */
/**************************************************************************/
-UINT _ux_device_class_storage_synchronize_cache(UX_SLAVE_CLASS_STORAGE *storage, ULONG lun,
+UINT _ux_device_class_storage_synchronize_cache(UX_SLAVE_CLASS_STORAGE *storage, ULONG lun,
UX_SLAVE_ENDPOINT *endpoint_in,
UX_SLAVE_ENDPOINT *endpoint_out, UCHAR *cbwcb, UCHAR scsi_command)
{
@@ -121,7 +110,7 @@ UCHAR flags;
UX_TRACE_IN_LINE_INSERT(UX_TRACE_DEVICE_CLASS_STORAGE_SYNCHRONIZE_CACHE, storage, lun, lba, number_blocks, UX_TRACE_DEVICE_CLASS_EVENTS, 0, 0)
/* Obtain the status of the device. */
- status = storage -> ux_slave_class_storage_lun[lun].ux_slave_class_storage_media_status(storage,
+ status = storage -> ux_slave_class_storage_lun[lun].ux_slave_class_storage_media_status(storage,
lun, storage -> ux_slave_class_storage_lun[lun].ux_slave_class_storage_media_id, &media_status);
/* Update the request sense. */
diff --git a/common/usbx_device_classes/src/ux_device_class_storage_tasks_run.c b/common/usbx_device_classes/src/ux_device_class_storage_tasks_run.c
index 5987f798..02762982 100644
--- a/common/usbx_device_classes/src/ux_device_class_storage_tasks_run.c
+++ b/common/usbx_device_classes/src/ux_device_class_storage_tasks_run.c
@@ -1,10 +1,11 @@
/***************************************************************************
- * Copyright (c) 2024 Microsoft Corporation
- *
+ * Copyright (c) 2024 Microsoft Corporation
+ * Copyright (c) 2026-present Eclipse ThreadX contributors
+ *
* This program and the accompanying materials are made available under the
* terms of the MIT License which is available at
* https://opensource.org/licenses/MIT.
- *
+ *
* SPDX-License-Identifier: MIT
**************************************************************************/
@@ -119,15 +120,6 @@ static inline VOID _ux_device_class_storage_disk_error(UX_SLAVE_CLASS_STORAGE *s
/* */
/* Device Stack */
/* */
-/* RELEASE HISTORY */
-/* */
-/* DATE NAME DESCRIPTION */
-/* */
-/* 01-31-2022 Chaoqiong Xiao Initial Version 6.1.10 */
-/* 10-31-2022 Chaoqiong Xiao Modified comment(s), */
-/* improved internal logic, */
-/* resulting in version 6.2.0 */
-/* */
/**************************************************************************/
UINT _ux_device_class_storage_tasks_run(VOID *instance)
{
@@ -491,7 +483,7 @@ UCHAR lun;
_ux_device_class_storage_test_ready(storage, lun, endpoint_in, endpoint_out, cbwcb);
break;
-
+
case UX_SLAVE_CLASS_STORAGE_SCSI_REQUEST_SENSE:
_ux_device_class_storage_request_sense(storage, lun, endpoint_in, endpoint_out, cbwcb);
@@ -511,7 +503,7 @@ UCHAR lun;
_ux_device_class_storage_start_stop(storage, lun, endpoint_in, endpoint_out, cbwcb);
break;
-
+
case UX_SLAVE_CLASS_STORAGE_SCSI_PREVENT_ALLOW_MEDIA_REMOVAL:
_ux_device_class_storage_prevent_allow_media_removal(storage, lun, endpoint_in, endpoint_out, cbwcb);
@@ -545,13 +537,13 @@ UCHAR lun;
case UX_SLAVE_CLASS_STORAGE_SCSI_READ32:
- _ux_device_class_storage_read(storage, lun, endpoint_in, endpoint_out, cbwcb,
+ _ux_device_class_storage_read(storage, lun, endpoint_in, endpoint_out, cbwcb,
UX_SLAVE_CLASS_STORAGE_SCSI_READ32);
break;
case UX_SLAVE_CLASS_STORAGE_SCSI_READ16:
- _ux_device_class_storage_read(storage, lun, endpoint_in, endpoint_out, cbwcb,
+ _ux_device_class_storage_read(storage, lun, endpoint_in, endpoint_out, cbwcb,
UX_SLAVE_CLASS_STORAGE_SCSI_READ16);
break;
@@ -563,7 +555,7 @@ UCHAR lun;
case UX_SLAVE_CLASS_STORAGE_SCSI_WRITE16:
- _ux_device_class_storage_write(storage, lun, endpoint_in, endpoint_out, cbwcb,
+ _ux_device_class_storage_write(storage, lun, endpoint_in, endpoint_out, cbwcb,
UX_SLAVE_CLASS_STORAGE_SCSI_WRITE16);
break;
@@ -575,37 +567,37 @@ UCHAR lun;
#ifdef UX_SLAVE_CLASS_STORAGE_INCLUDE_MMC
case UX_SLAVE_CLASS_STORAGE_SCSI_GET_STATUS_NOTIFICATION:
- _ux_device_class_storage_get_status_notification(storage, lun, endpoint_in, endpoint_out, cbwcb);
+ _ux_device_class_storage_get_status_notification(storage, lun, endpoint_in, endpoint_out, cbwcb);
break;
case UX_SLAVE_CLASS_STORAGE_SCSI_GET_CONFIGURATION:
- _ux_device_class_storage_get_configuration(storage, lun, endpoint_in, endpoint_out, cbwcb);
+ _ux_device_class_storage_get_configuration(storage, lun, endpoint_in, endpoint_out, cbwcb);
break;
case UX_SLAVE_CLASS_STORAGE_SCSI_READ_DISK_INFORMATION:
- _ux_device_class_storage_read_disk_information(storage, lun, endpoint_in, endpoint_out, cbwcb);
+ _ux_device_class_storage_read_disk_information(storage, lun, endpoint_in, endpoint_out, cbwcb);
break;
case UX_SLAVE_CLASS_STORAGE_SCSI_REPORT_KEY:
- _ux_device_class_storage_report_key(storage, lun, endpoint_in, endpoint_out, cbwcb);
+ _ux_device_class_storage_report_key(storage, lun, endpoint_in, endpoint_out, cbwcb);
break;
case UX_SLAVE_CLASS_STORAGE_SCSI_GET_PERFORMANCE:
- _ux_device_class_storage_get_performance(storage, lun, endpoint_in, endpoint_out, cbwcb);
+ _ux_device_class_storage_get_performance(storage, lun, endpoint_in, endpoint_out, cbwcb);
break;
case UX_SLAVE_CLASS_STORAGE_SCSI_READ_DVD_STRUCTURE:
- _ux_device_class_storage_read_dvd_structure(storage, lun, endpoint_in, endpoint_out, cbwcb);
+ _ux_device_class_storage_read_dvd_structure(storage, lun, endpoint_in, endpoint_out, cbwcb);
break;
case UX_SLAVE_CLASS_STORAGE_SCSI_READ_TOC:
- _ux_device_class_storage_read_toc(storage, lun, endpoint_in, endpoint_out, cbwcb);
+ _ux_device_class_storage_read_toc(storage, lun, endpoint_in, endpoint_out, cbwcb);
break;
#endif
@@ -751,7 +743,7 @@ static inline UINT _ux_device_class_storage_data_next(UX_SLAVE_CLASS_STORAGE *st
if (storage -> ux_device_class_storage_device_length >
storage -> ux_device_class_storage_data_count)
{
-
+
/* Update bCSWStatus. */
storage -> ux_slave_class_storage_csw_status = UX_SLAVE_CLASS_STORAGE_CSW_FAILED;
}
@@ -866,7 +858,7 @@ static inline UINT _ux_device_class_storage_data_next(UX_SLAVE_CLASS_STORAGE *st
if (storage -> ux_device_class_storage_device_length >
storage -> ux_device_class_storage_data_count)
{
-
+
/* Update bCSWStatus. */
storage -> ux_slave_class_storage_csw_status = UX_SLAVE_CLASS_STORAGE_CSW_FAILED;
}
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 3a74fc0b..61d6bb35 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
@@ -1,18 +1,19 @@
/***************************************************************************
- * Copyright (c) 2024 Microsoft Corporation
- *
+ * Copyright (c) 2024 Microsoft Corporation
+ * Copyright (c) 2026-present Eclipse ThreadX contributors
+ *
* This program and the accompanying materials are made available under the
* terms of the MIT License which is available at
* https://opensource.org/licenses/MIT.
- *
+ *
* SPDX-License-Identifier: MIT
**************************************************************************/
/**************************************************************************/
/**************************************************************************/
-/** */
-/** USBX Component */
+/** */
+/** USBX Component */
/** */
/** Device Storage Class */
/** */
@@ -29,57 +30,42 @@
#include "ux_device_stack.h"
-/**************************************************************************/
-/* */
-/* FUNCTION RELEASE */
-/* */
-/* _ux_device_class_storage_test_ready PORTABLE C */
+/**************************************************************************/
+/* */
+/* FUNCTION RELEASE */
+/* */
+/* _ux_device_class_storage_test_ready PORTABLE C */
/* 6.1.10 */
/* AUTHOR */
/* */
/* Chaoqiong Xiao, Microsoft Corporation */
/* */
/* DESCRIPTION */
-/* */
-/* This function tests if the SCSI slave device is ready. */
-/* The status function of the storage devices is called. If there is */
-/* an error, the request sense parameters are set for the host to */
-/* investigate. */
-/* */
-/* INPUT */
-/* */
-/* storage Pointer to storage class */
+/* */
+/* This function tests if the SCSI slave device is ready. */
+/* The status function of the storage devices is called. If there is */
+/* an error, the request sense parameters are set for the host to */
+/* investigate. */
+/* */
+/* INPUT */
+/* */
+/* storage Pointer to storage class */
+/* lun Logical unit number */
/* endpoint_in Pointer to IN endpoint */
/* endpoint_out Pointer to OUT endpoint */
-/* cbwcb Pointer to CBWCB */
-/* */
-/* OUTPUT */
-/* */
-/* Completion Status */
-/* */
-/* CALLS */
-/* */
-/* (ux_slave_class_storage_media_status) Get media status */
-/* _ux_device_class_storage_csw_send Send CSW */
-/* */
-/* CALLED BY */
-/* */
-/* Device Storage Class */
-/* */
-/* RELEASE HISTORY */
-/* */
-/* 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 */
-/* 12-31-2020 Chaoqiong Xiao Modified comment(s), */
-/* fixed USB CV test issues, */
-/* resulting in version 6.1.3 */
-/* 01-31-2022 Chaoqiong Xiao Modified comment(s), */
-/* added standalone support, */
-/* resulting in version 6.1.10 */
+/* cbwcb Pointer to CBWCB */
+/* */
+/* OUTPUT */
+/* */
+/* Completion Status */
+/* */
+/* CALLS */
+/* */
+/* (ux_slave_class_storage_media_status) Get media status */
+/* */
+/* CALLED BY */
+/* */
+/* Device Storage Class */
/* */
/**************************************************************************/
UINT _ux_device_class_storage_test_ready(UX_SLAVE_CLASS_STORAGE *storage, ULONG lun, UX_SLAVE_ENDPOINT *endpoint_in,
@@ -89,7 +75,6 @@ UINT _ux_device_class_storage_test_ready(UX_SLAVE_CLASS_STORAGE *storage, ULONG
UINT status;
ULONG media_status;
- UX_PARAMETER_NOT_USED(lun);
UX_PARAMETER_NOT_USED(endpoint_in);
UX_PARAMETER_NOT_USED(endpoint_out);
UX_PARAMETER_NOT_USED(cbwcb);
@@ -97,8 +82,22 @@ ULONG media_status;
/* 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)
+ if (storage -> ux_slave_class_storage_lun[lun].ux_slave_class_storage_medium_loaded_status == 0)
+ {
+ /* Media not loaded. Set NOT READY sense code. */
+ 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_NOT_READY,
+ UX_SLAVE_CLASS_STORAGE_SENSE_CODE_NOT_PRESENT, 0x00);
+
+ /* Return CSW with failure. */
+ storage -> ux_slave_class_storage_csw_status = UX_SLAVE_CLASS_STORAGE_CSW_FAILED;
+
+ /* Return completion status. */
+ return(UX_SUCCESS);
+ }
+
/* Obtain the status of the device. */
- status = storage -> ux_slave_class_storage_lun[lun].ux_slave_class_storage_media_status(storage, lun,
+ status = storage -> ux_slave_class_storage_lun[lun].ux_slave_class_storage_media_status(storage, lun,
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. */
@@ -122,4 +121,3 @@ ULONG media_status;
/* 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 4e946810..e3f37c7b 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
@@ -1,18 +1,19 @@
/***************************************************************************
- * Copyright (c) 2024 Microsoft Corporation
- *
+ * Copyright (c) 2024 Microsoft Corporation
+ * Copyright (c) 2026-present Eclipse ThreadX contributors
+ *
* This program and the accompanying materials are made available under the
* terms of the MIT License which is available at
* https://opensource.org/licenses/MIT.
- *
+ *
* SPDX-License-Identifier: MIT
**************************************************************************/
/**************************************************************************/
/**************************************************************************/
-/** */
-/** USBX Component */
+/** */
+/** USBX Component */
/** */
/** Device Storage Class */
/** */
@@ -30,106 +31,64 @@
#if !defined(UX_DEVICE_STANDALONE)
-/**************************************************************************/
-/* */
-/* FUNCTION RELEASE */
-/* */
-/* _ux_device_class_storage_thread PORTABLE C */
+/**************************************************************************/
+/* */
+/* FUNCTION RELEASE */
+/* */
+/* _ux_device_class_storage_thread PORTABLE C */
/* 6.3.0 */
/* AUTHOR */
/* */
/* Chaoqiong Xiao, Microsoft Corporation */
/* */
/* DESCRIPTION */
-/* */
-/* This function is the thread of the storage class. */
+/* */
+/* This function is the thread of the storage class. */
/* */
/* It's for RTOS mode. */
-/* */
-/* INPUT */
-/* */
-/* class Address of storage class */
-/* container */
-/* */
-/* OUTPUT */
-/* */
-/* None */
-/* */
-/* CALLS */
-/* */
-/* _ux_device_class_storage_format Storage class format */
-/* _ux_device_class_storage_inquiry Storage class inquiry */
-/* _ux_device_class_storage_mode_select Mode select */
-/* _ux_device_class_storage_mode_sense Mode sense */
-/* _ux_device_class_storage_prevent_allow_media_removal */
-/* Prevent media removal */
-/* _ux_device_class_storage_read Read */
+/* */
+/* INPUT */
+/* */
+/* class Address of storage class */
+/* container */
+/* */
+/* OUTPUT */
+/* */
+/* None */
+/* */
+/* CALLS */
+/* */
+/* _ux_device_class_storage_format Storage class format */
+/* _ux_device_class_storage_inquiry Storage class inquiry */
+/* _ux_device_class_storage_mode_select Mode select */
+/* _ux_device_class_storage_mode_sense Mode sense */
+/* _ux_device_class_storage_prevent_allow_media_removal */
+/* Prevent media removal */
+/* _ux_device_class_storage_read Read */
/* _ux_device_class_storage_read_capacity */
-/* Read capacity */
-/* _ux_device_class_storage_read_format_capacity */
-/* Read format capacity */
+/* Read capacity */
+/* _ux_device_class_storage_read_format_capacity */
+/* Read format capacity */
/* _ux_device_class_storage_request_sense */
-/* Sense request */
+/* Sense request */
/* _ux_device_class_storage_start_stop Start/Stop */
-/* _ux_device_class_storage_synchronize_cache */
+/* _ux_device_class_storage_synchronize_cache */
/* Synchronize cache */
-/* _ux_device_class_storage_test_ready Ready test */
-/* _ux_device_class_storage_verify Verify */
+/* _ux_device_class_storage_test_ready Ready test */
+/* _ux_device_class_storage_verify Verify */
/* _ux_device_class_storage_write Write */
-/* _ux_device_stack_endpoint_stall Endpoint stall */
-/* _ux_device_stack_interface_delete Interface delete */
-/* _ux_device_stack_transfer_request Transfer request */
-/* _ux_utility_long_get Get 32-bit value */
-/* _ux_utility_memory_allocate Allocate memory */
-/* _ux_device_semaphore_create Create semaphore */
+/* _ux_device_stack_endpoint_stall Endpoint stall */
+/* _ux_device_stack_interface_delete Interface delete */
+/* _ux_device_stack_transfer_request Transfer request */
+/* _ux_utility_long_get Get 32-bit value */
+/* _ux_utility_memory_allocate Allocate memory */
+/* _ux_device_semaphore_create Create semaphore */
/* _ux_utility_delay_ms Sleep thread for several ms */
-/* _ux_device_thread_suspend Suspend thread */
-/* */
-/* CALLED BY */
-/* */
-/* ThreadX */
-/* */
-/* RELEASE HISTORY */
-/* */
-/* 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 */
-/* 12-31-2020 Chaoqiong Xiao Modified comment(s), */
-/* fixed USB CV test issues, */
-/* resulting in version 6.1.3 */
-/* 04-02-2021 Chaoqiong Xiao Modified comment(s), */
-/* fixed compile issues with */
-/* some macro options, */
-/* resulting in version 6.1.6 */
-/* 06-02-2021 Chaoqiong Xiao Modified comment(s), */
-/* get interface and endpoints */
-/* from configured device, */
-/* resulting in version 6.1.7 */
-/* 10-15-2021 Chaoqiong Xiao Modified comment(s), */
-/* improved TAG management, */
-/* resulting in version 6.1.9 */
-/* 01-31-2022 Chaoqiong Xiao Modified comment(s), */
-/* refined macros names, */
-/* resulting in version 6.1.10 */
-/* 04-25-2022 Chaoqiong Xiao Modified comment(s), */
-/* internal clean up, */
-/* resulting in version 6.1.11 */
-/* 07-29-2022 Chaoqiong Xiao Modified comment(s), */
-/* fixed parameter/variable */
-/* names conflict C++ keyword, */
-/* resulting in version 6.1.12 */
-/* 10-31-2023 Chaoqiong Xiao Modified comment(s), */
-/* added a new mode to manage */
-/* endpoint buffer in classes, */
-/* resulting in version 6.3.0 */
+/* _ux_device_thread_suspend Suspend thread */
+/* */
+/* CALLED BY */
+/* */
+/* ThreadX */
/* */
/**************************************************************************/
VOID _ux_device_class_storage_thread(ULONG storage_class)
@@ -156,16 +115,16 @@ UCHAR *cbw_cb;
/* Cast properly the storage instance. */
UX_THREAD_EXTENSION_PTR_GET(class_ptr, UX_SLAVE_CLASS, storage_class)
-
+
/* Get the storage instance from this class container. */
storage = (UX_SLAVE_CLASS_STORAGE *) class_ptr -> ux_slave_class_instance;
-
+
/* Get the pointer to the device. */
device = &_ux_system_slave -> ux_system_slave_device;
-
+
/* As long as the device is in the CONFIGURED state. */
while (device -> ux_slave_device_state == UX_DEVICE_CONFIGURED)
- {
+ {
/* We are activated. We need the interface to the class. */
interface_ptr = storage -> ux_slave_class_storage_interface;
@@ -215,23 +174,23 @@ UCHAR *cbw_cb;
/* Send the request to the device controller. */
status = _ux_device_stack_transfer_request(transfer_request, 64, 64);
- }
-
+ }
+
/* Check the status. Our status is UX_ERROR if one of the endpoint was STALLED. We must wait for the host
- to clear the mess. */
+ to clear the mess. */
if (status == UX_SUCCESS)
{
/* Obtain the length of the transaction. */
length = transfer_request -> ux_slave_transfer_request_actual_length;
-
+
/* Obtain the buffer address containing the SCSI command. */
scsi_command = transfer_request -> ux_slave_transfer_request_data_pointer;
-
+
/* Obtain the lun from the CBW. */
lun = (ULONG) *(scsi_command + UX_SLAVE_CLASS_STORAGE_CBW_LUN);
storage -> ux_slave_class_storage_cbw_lun = (UCHAR)lun;
-
+
/* We have to memorize the SCSI command tag for the CSW phase. */
storage -> ux_slave_class_storage_scsi_tag = _ux_utility_long_get(scsi_command + UX_SLAVE_CLASS_STORAGE_CBW_TAG);
@@ -245,7 +204,7 @@ UCHAR *cbw_cb;
storage -> ux_slave_class_storage_csw_residue = 0;
storage -> ux_slave_class_storage_csw_status = 0;
- /* Ensure the LUN number is within our declared values and check the command
+ /* Ensure the LUN number is within our declared values and check the command
content and format. First we make sure we have a complete CBW. */
if ((lun < storage -> ux_slave_class_storage_number_lun) && (length == UX_SLAVE_CLASS_STORAGE_CBW_LENGTH))
{
@@ -256,7 +215,7 @@ UCHAR *cbw_cb;
/* Get the length of the CBWCB. */
cbwcb_length = (ULONG) *(scsi_command + UX_SLAVE_CLASS_STORAGE_CBW_CB_LENGTH);
-
+
/* Check the length of the CBWCB to ensure there is at least a command. */
if (cbwcb_length != 0)
{
@@ -270,79 +229,79 @@ UCHAR *cbw_cb;
_ux_device_class_storage_test_ready(storage, lun, endpoint_in, endpoint_out, cbw_cb);
break;
-
+
case UX_SLAVE_CLASS_STORAGE_SCSI_REQUEST_SENSE:
_ux_device_class_storage_request_sense(storage, lun, endpoint_in, endpoint_out, cbw_cb);
break;
-
+
case UX_SLAVE_CLASS_STORAGE_SCSI_FORMAT:
_ux_device_class_storage_format(storage, lun, endpoint_in, endpoint_out, cbw_cb);
break;
-
+
case UX_SLAVE_CLASS_STORAGE_SCSI_INQUIRY:
_ux_device_class_storage_inquiry(storage, lun, endpoint_in, endpoint_out, cbw_cb);
break;
-
+
case UX_SLAVE_CLASS_STORAGE_SCSI_START_STOP:
_ux_device_class_storage_start_stop(storage, lun, endpoint_in, endpoint_out, cbw_cb);
break;
-
+
case UX_SLAVE_CLASS_STORAGE_SCSI_PREVENT_ALLOW_MEDIA_REMOVAL:
_ux_device_class_storage_prevent_allow_media_removal(storage, lun, endpoint_in, endpoint_out, cbw_cb);
break;
-
+
case UX_SLAVE_CLASS_STORAGE_SCSI_READ_FORMAT_CAPACITY:
_ux_device_class_storage_read_format_capacity(storage, lun, endpoint_in, endpoint_out, cbw_cb);
break;
-
+
case UX_SLAVE_CLASS_STORAGE_SCSI_READ_CAPACITY:
_ux_device_class_storage_read_capacity(storage, lun, endpoint_in, endpoint_out, cbw_cb);
break;
-
+
case UX_SLAVE_CLASS_STORAGE_SCSI_VERIFY:
_ux_device_class_storage_verify(storage, lun, endpoint_in, endpoint_out, cbw_cb);
break;
-
+
case UX_SLAVE_CLASS_STORAGE_SCSI_MODE_SELECT:
_ux_device_class_storage_mode_select(storage, lun, endpoint_in, endpoint_out, cbw_cb);
break;
-
+
case UX_SLAVE_CLASS_STORAGE_SCSI_MODE_SENSE_SHORT:
case UX_SLAVE_CLASS_STORAGE_SCSI_MODE_SENSE:
_ux_device_class_storage_mode_sense(storage, lun, endpoint_in, endpoint_out, cbw_cb);
break;
-
+
case UX_SLAVE_CLASS_STORAGE_SCSI_READ32:
- _ux_device_class_storage_read(storage, lun, endpoint_in, endpoint_out, cbw_cb,
+ _ux_device_class_storage_read(storage, lun, endpoint_in, endpoint_out, cbw_cb,
UX_SLAVE_CLASS_STORAGE_SCSI_READ32);
break;
-
+
case UX_SLAVE_CLASS_STORAGE_SCSI_READ16:
- _ux_device_class_storage_read(storage, lun, endpoint_in, endpoint_out, cbw_cb,
+ _ux_device_class_storage_read(storage, lun, endpoint_in, endpoint_out, cbw_cb,
UX_SLAVE_CLASS_STORAGE_SCSI_READ16);
break;
-
+
case UX_SLAVE_CLASS_STORAGE_SCSI_WRITE32:
_ux_device_class_storage_write(storage, lun, endpoint_in, endpoint_out, cbw_cb,
UX_SLAVE_CLASS_STORAGE_SCSI_WRITE32);
break;
-
+
case UX_SLAVE_CLASS_STORAGE_SCSI_WRITE16:
- _ux_device_class_storage_write(storage, lun, endpoint_in, endpoint_out, cbw_cb,
+ _ux_device_class_storage_write(storage, lun, endpoint_in, endpoint_out, cbw_cb,
UX_SLAVE_CLASS_STORAGE_SCSI_WRITE16);
break;
@@ -354,37 +313,37 @@ UCHAR *cbw_cb;
#ifdef UX_SLAVE_CLASS_STORAGE_INCLUDE_MMC
case UX_SLAVE_CLASS_STORAGE_SCSI_GET_STATUS_NOTIFICATION:
- _ux_device_class_storage_get_status_notification(storage, lun, endpoint_in, endpoint_out, cbw_cb);
+ _ux_device_class_storage_get_status_notification(storage, lun, endpoint_in, endpoint_out, cbw_cb);
break;
case UX_SLAVE_CLASS_STORAGE_SCSI_GET_CONFIGURATION:
- _ux_device_class_storage_get_configuration(storage, lun, endpoint_in, endpoint_out, cbw_cb);
+ _ux_device_class_storage_get_configuration(storage, lun, endpoint_in, endpoint_out, cbw_cb);
break;
-
+
case UX_SLAVE_CLASS_STORAGE_SCSI_READ_DISK_INFORMATION:
- _ux_device_class_storage_read_disk_information(storage, lun, endpoint_in, endpoint_out, cbw_cb);
+ _ux_device_class_storage_read_disk_information(storage, lun, endpoint_in, endpoint_out, cbw_cb);
break;
-
+
case UX_SLAVE_CLASS_STORAGE_SCSI_REPORT_KEY:
- _ux_device_class_storage_report_key(storage, lun, endpoint_in, endpoint_out, cbw_cb);
+ _ux_device_class_storage_report_key(storage, lun, endpoint_in, endpoint_out, cbw_cb);
break;
-
+
case UX_SLAVE_CLASS_STORAGE_SCSI_GET_PERFORMANCE:
- _ux_device_class_storage_get_performance(storage, lun, endpoint_in, endpoint_out, cbw_cb);
+ _ux_device_class_storage_get_performance(storage, lun, endpoint_in, endpoint_out, cbw_cb);
break;
-
+
case UX_SLAVE_CLASS_STORAGE_SCSI_READ_DVD_STRUCTURE:
- _ux_device_class_storage_read_dvd_structure(storage, lun, endpoint_in, endpoint_out, cbw_cb);
+ _ux_device_class_storage_read_dvd_structure(storage, lun, endpoint_in, endpoint_out, cbw_cb);
break;
case UX_SLAVE_CLASS_STORAGE_SCSI_READ_TOC:
- status = _ux_device_class_storage_read_toc(storage, lun, endpoint_in, endpoint_out, cbw_cb);
+ status = _ux_device_class_storage_read_toc(storage, lun, endpoint_in, endpoint_out, cbw_cb);
/* Special treatment of TOC command. If error, default to Stall endpoint. */
if (status == UX_SUCCESS)
@@ -393,7 +352,7 @@ UCHAR *cbw_cb;
/* fall through */
default:
-
+
/* The command is unknown or unsupported, so we stall the endpoint. */
if (storage -> ux_slave_class_storage_host_length > 0 &&
@@ -405,7 +364,7 @@ UCHAR *cbw_cb;
/* Data-In from device to host, stall IN. */
_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_status =
UX_DEVICE_CLASS_STORAGE_SENSE_STATUS(UX_SLAVE_CLASS_STORAGE_SENSE_KEY_ILLEGAL_REQUEST,
@@ -414,7 +373,7 @@ UCHAR *cbw_cb;
/* 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. */
while (device -> ux_slave_device_state == UX_DEVICE_CONFIGURED)
- {
+ {
/* Check the endpoint state. */
if (endpoint_in -> ux_slave_endpoint_state == UX_ENDPOINT_RESET)
@@ -423,7 +382,7 @@ UCHAR *cbw_cb;
/* Now we set the CSW with failure. */
storage -> ux_slave_class_storage_csw_status = UX_SLAVE_CLASS_STORAGE_CSW_FAILED;
break;
- }
+ }
else
@@ -447,7 +406,7 @@ UCHAR *cbw_cb;
/* Phase error! */
storage -> ux_slave_class_storage_csw_status = UX_SLAVE_CLASS_STORAGE_CSW_PHASE_ERROR;
}
-
+
else
/* Phase error! */
@@ -474,7 +433,7 @@ UCHAR *cbw_cb;
}
}
- /* We need to suspend ourselves. We will be resumed by the
+ /* We need to suspend ourselves. We will be resumed by the
device enumeration module. */
_ux_device_thread_suspend(&class_ptr -> ux_slave_class_thread);
}
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 3234b41b..ca43b8ac 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
@@ -1,18 +1,19 @@
/***************************************************************************
- * Copyright (c) 2024 Microsoft Corporation
- *
+ * Copyright (c) 2024 Microsoft Corporation
+ * Copyright (c) 2026-present Eclipse ThreadX contributors
+ *
* This program and the accompanying materials are made available under the
* terms of the MIT License which is available at
* https://opensource.org/licenses/MIT.
- *
+ *
* SPDX-License-Identifier: MIT
**************************************************************************/
/**************************************************************************/
/**************************************************************************/
-/** */
-/** USBX Component */
+/** */
+/** USBX Component */
/** */
/** Device Storage Class */
/** */
@@ -29,60 +30,41 @@
#include "ux_device_stack.h"
-/**************************************************************************/
-/* */
-/* FUNCTION RELEASE */
-/* */
-/* _ux_device_class_storage_uninitialize PORTABLE C */
+/**************************************************************************/
+/* */
+/* FUNCTION RELEASE */
+/* */
+/* _ux_device_class_storage_uninitialize PORTABLE C */
/* 6.3.0 */
/* AUTHOR */
/* */
/* Chaoqiong Xiao, Microsoft Corporation */
/* */
/* DESCRIPTION */
-/* */
-/* This function deinitializes the USB storage device. */
-/* */
-/* INPUT */
-/* */
-/* command Pointer to storage command */
-/* */
-/* OUTPUT */
-/* */
-/* Completion Status */
-/* */
-/* CALLS */
-/* */
+/* */
+/* This function deinitializes the USB storage device. */
+/* */
+/* INPUT */
+/* */
+/* command Pointer to storage command */
+/* */
+/* OUTPUT */
+/* */
+/* Completion Status */
+/* */
+/* CALLS */
+/* */
/* _ux_utility_memory_free Free memory */
/* _ux_device_thread_delete Delete thread */
-/* */
-/* CALLED BY */
-/* */
-/* Device Storage Class */
-/* */
-/* RELEASE HISTORY */
-/* */
-/* DATE NAME DESCRIPTION */
-/* */
-/* 05-19-2020 Chaoqiong Xiao Initial Version 6.0 */
-/* 09-30-2020 Chaoqiong Xiao Modified comment(s), */
-/* resulting in version 6.1 */
-/* 01-31-2022 Chaoqiong Xiao Modified comment(s), */
-/* added standalone support, */
-/* resulting in version 6.1.10 */
-/* 07-29-2022 Chaoqiong Xiao Modified comment(s), */
-/* fixed parameter/variable */
-/* names conflict C++ keyword, */
-/* resulting in version 6.1.12 */
-/* 10-31-2023 Chaoqiong Xiao Modified comment(s), */
-/* added a new mode to manage */
-/* endpoint buffer in classes, */
-/* resulting in version 6.3.0 */
+/* */
+/* CALLED BY */
+/* */
+/* Device Storage Class */
/* */
/**************************************************************************/
UINT _ux_device_class_storage_uninitialize(UX_SLAVE_CLASS_COMMAND *command)
{
-
+
UX_SLAVE_CLASS_STORAGE *storage;
UX_SLAVE_CLASS *class_ptr;
@@ -91,7 +73,7 @@ UX_SLAVE_CLASS *class_ptr;
/* Get the class instance in the container. */
storage = (UX_SLAVE_CLASS_STORAGE *) class_ptr -> ux_slave_class_instance;
-
+
/* Sanity check. */
if (storage != UX_NULL)
{
@@ -99,7 +81,7 @@ UX_SLAVE_CLASS *class_ptr;
/* Remove STORAGE thread. */
_ux_device_thread_delete(&class_ptr -> ux_slave_class_thread);
-#if !(defined(UX_DEVICE_STANDALONE) || defined(UX_STANDALONE))
+#if !(defined(UX_DEVICE_STANDALONE) || defined(UX_STANDALONE))
/* Remove the thread used by STORAGE. */
_ux_utility_memory_free(class_ptr -> ux_slave_class_thread_stack);
#endif
@@ -111,7 +93,7 @@ UX_SLAVE_CLASS *class_ptr;
/* Free the resources. */
_ux_utility_memory_free(storage);
}
-
+
/* Return completion status. */
return(UX_SUCCESS);
}
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 cf8e9d2a..f5ae0d14 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
@@ -1,18 +1,19 @@
/***************************************************************************
- * Copyright (c) 2024 Microsoft Corporation
- *
+ * Copyright (c) 2024 Microsoft Corporation
+ * Copyright (c) 2026-present Eclipse ThreadX contributors
+ *
* This program and the accompanying materials are made available under the
* terms of the MIT License which is available at
* https://opensource.org/licenses/MIT.
- *
+ *
* SPDX-License-Identifier: MIT
**************************************************************************/
/**************************************************************************/
/**************************************************************************/
-/** */
-/** USBX Component */
+/** */
+/** USBX Component */
/** */
/** Device Storage Class */
/** */
@@ -29,51 +30,42 @@
#include "ux_device_stack.h"
-/**************************************************************************/
-/* */
-/* FUNCTION RELEASE */
-/* */
-/* _ux_device_class_storage_verify PORTABLE C */
+/**************************************************************************/
+/* */
+/* FUNCTION RELEASE */
+/* */
+/* _ux_device_class_storage_verify PORTABLE C */
/* 6.1 */
/* AUTHOR */
/* */
/* Chaoqiong Xiao, Microsoft Corporation */
/* */
/* DESCRIPTION */
-/* */
-/* This function verifies a previous write command. */
-/* Here, the CSW is returned with a SUCCESS code. */
-/* */
-/* INPUT */
-/* */
-/* storage Pointer to storage class */
+/* */
+/* This function verifies a previous write command. */
+/* Here, the CSW is returned with a SUCCESS code. */
+/* */
+/* INPUT */
+/* */
+/* storage Pointer to storage class */
/* endpoint_in Pointer to IN endpoint */
/* endpoint_out Pointer to OUT endpoint */
-/* cbwcb Pointer to CBWCB */
-/* */
-/* OUTPUT */
-/* */
-/* Completion Status */
-/* */
-/* CALLS */
-/* */
-/* _ux_device_class_storage_csw_send Send CSW */
-/* */
-/* CALLED BY */
-/* */
+/* cbwcb Pointer to CBWCB */
+/* */
+/* OUTPUT */
+/* */
+/* Completion Status */
+/* */
+/* CALLS */
+/* */
+/* _ux_device_class_storage_csw_send Send CSW */
+/* */
+/* CALLED BY */
+/* */
/* Device Storage Class */
-/* */
-/* RELEASE HISTORY */
-/* */
-/* 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,
+UINT _ux_device_class_storage_verify(UX_SLAVE_CLASS_STORAGE *storage, ULONG lun,
UX_SLAVE_ENDPOINT *endpoint_in,
UX_SLAVE_ENDPOINT *endpoint_out, UCHAR * cbwcb)
{
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 5f865121..e193eeda 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
@@ -1,18 +1,19 @@
/***************************************************************************
- * Copyright (c) 2024 Microsoft Corporation
- *
+ * Copyright (c) 2024 Microsoft Corporation
+ * Copyright (c) 2026-present Eclipse ThreadX contributors
+ *
* This program and the accompanying materials are made available under the
* terms of the MIT License which is available at
* https://opensource.org/licenses/MIT.
- *
+ *
* SPDX-License-Identifier: MIT
**************************************************************************/
/**************************************************************************/
/**************************************************************************/
-/** */
-/** USBX Component */
+/** */
+/** USBX Component */
/** */
/** Device Storage Class */
/** */
@@ -28,66 +29,48 @@
#include "ux_device_class_storage.h"
#include "ux_device_stack.h"
-/**************************************************************************/
-/* */
-/* FUNCTION RELEASE */
-/* */
-/* _ux_device_class_storage_write PORTABLE C */
+/**************************************************************************/
+/* */
+/* FUNCTION RELEASE */
+/* */
+/* _ux_device_class_storage_write PORTABLE C */
/* 6.1.10 */
/* AUTHOR */
/* */
/* Chaoqiong Xiao, Microsoft Corporation */
/* */
/* DESCRIPTION */
-/* */
-/* This function performs a WRITE command in 32 or 16 bits. */
-/* */
-/* INPUT */
-/* */
-/* storage Pointer to storage class */
+/* */
+/* This function performs a WRITE command in 32 or 16 bits. */
+/* */
+/* INPUT */
+/* */
+/* storage Pointer to storage class */
+/* lun Logical unit number */
/* endpoint_in Pointer to IN endpoint */
/* endpoint_out Pointer to OUT endpoint */
-/* cbwcb Pointer to the CBWCB */
-/* scsi_command SCSI command */
-/* */
-/* OUTPUT */
-/* */
-/* Completion Status */
-/* */
-/* CALLS */
-/* */
-/* (ux_slave_class_storage_media_status) Get media status */
-/* (ux_slave_class_storage_media_write) Write to media */
-/* _ux_device_class_storage_csw_send Send CSW */
-/* _ux_device_stack_endpoint_stall Stall endpoint */
-/* _ux_device_stack_transfer_request Transfer request */
-/* _ux_utility_long_get_big_endian Get 32-bit big endian */
-/* _ux_utility_memory_allocate Allocate memory */
-/* _ux_utility_memory_free Release memory */
+/* cbwcb Pointer to the CBWCB */
+/* scsi_command SCSI command */
+/* */
+/* OUTPUT */
+/* */
+/* Completion Status */
+/* */
+/* CALLS */
+/* */
+/* (ux_slave_class_storage_media_status) Get media status */
+/* (ux_slave_class_storage_media_write) Write to media */
+/* _ux_device_stack_endpoint_stall Stall endpoint */
+/* _ux_device_stack_transfer_request Transfer request */
/* _ux_utility_long_get_big_endian Get 32-bit big endian */
-/* _ux_utility_short_get_big_endian Get 16-bit big endian */
-/* */
-/* CALLED BY */
-/* */
-/* Device Storage Class */
-/* */
-/* RELEASE HISTORY */
-/* */
-/* 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 */
-/* 12-31-2020 Chaoqiong Xiao Modified comment(s), */
-/* fixed USB CV test issues, */
-/* resulting in version 6.1.3 */
-/* 01-31-2022 Chaoqiong Xiao Modified comment(s), */
-/* added standalone support, */
-/* resulting in version 6.1.10 */
+/* _ux_utility_short_get_big_endian Get 16-bit big endian */
+/* */
+/* CALLED BY */
+/* */
+/* Device Storage Class */
/* */
/**************************************************************************/
-UINT _ux_device_class_storage_write(UX_SLAVE_CLASS_STORAGE *storage, ULONG lun,
+UINT _ux_device_class_storage_write(UX_SLAVE_CLASS_STORAGE *storage, ULONG lun,
UX_SLAVE_ENDPOINT *endpoint_in,
UX_SLAVE_ENDPOINT *endpoint_out, UCHAR * cbwcb, UCHAR scsi_command)
{
@@ -95,12 +78,12 @@ UINT _ux_device_class_storage_write(UX_SLAVE_CLASS_STORAGE *storage, ULONG lun,
UINT status;
UX_SLAVE_TRANSFER *transfer_request;
ULONG lba;
-ULONG total_number_blocks;
+ULONG total_number_blocks;
ULONG media_status;
ULONG total_length;
#if !defined(UX_DEVICE_STANDALONE)
-ULONG number_blocks;
+ULONG number_blocks;
ULONG transfer_length;
ULONG done_length;
#endif
@@ -108,9 +91,23 @@ ULONG done_length;
UX_PARAMETER_NOT_USED(endpoint_in);
+ if (storage -> ux_slave_class_storage_lun[lun].ux_slave_class_storage_medium_loaded_status == 0)
+ {
+ /* Media not loaded. Set NOT READY sense code. */
+ 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_NOT_READY,
+ UX_SLAVE_CLASS_STORAGE_SENSE_CODE_NOT_PRESENT, 0x00);
+
+ /* Return CSW with failure. */
+ storage -> ux_slave_class_storage_csw_status = UX_SLAVE_CLASS_STORAGE_CSW_FAILED;
+
+ /* Return completion status. */
+ return(UX_SUCCESS);
+ }
+
/* Get the LBA from the CBWCB. */
lba = _ux_utility_long_get_big_endian(cbwcb + UX_SLAVE_CLASS_STORAGE_WRITE_LBA);
-
+
/* The type of commands will tell us the width of the field containing the number
of sectors to read. */
if (scsi_command == UX_SLAVE_CLASS_STORAGE_SCSI_WRITE16)
@@ -118,7 +115,7 @@ ULONG done_length;
/* Get the number of blocks from the CBWCB in 16 bits. */
total_number_blocks = _ux_utility_short_get_big_endian(cbwcb + UX_SLAVE_CLASS_STORAGE_WRITE_TRANSFER_LENGTH_16);
- else
+ else
/* Get the number of blocks from the CBWCB in 32 bits. */
total_number_blocks = _ux_utility_long_get_big_endian(cbwcb + UX_SLAVE_CLASS_STORAGE_WRITE_TRANSFER_LENGTH_32);
@@ -130,9 +127,9 @@ ULONG done_length;
transfer_request = &endpoint_out -> ux_slave_endpoint_transfer_request;
/* Obtain the status of the device. */
- status = storage -> ux_slave_class_storage_lun[lun].ux_slave_class_storage_media_status(storage,
+ status = storage -> ux_slave_class_storage_lun[lun].ux_slave_class_storage_media_status(storage,
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_status = media_status;
@@ -227,10 +224,10 @@ ULONG done_length;
transfer_length = UX_SLAVE_CLASS_STORAGE_BUFFER_SIZE;
else
transfer_length = total_length;
-
+
/* Get the data payload from the host. */
status = _ux_device_stack_transfer_request(transfer_request, transfer_length, transfer_length);
-
+
/* Check the status. */
if (status != UX_SUCCESS)
{
@@ -245,38 +242,38 @@ ULONG done_length;
/* 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(0x02,0x54,0x00);
-
+
/* Return an error. */
return(UX_ERROR);
}
/* Compute the number of blocks to transfer. */
number_blocks = transfer_length / storage -> ux_slave_class_storage_lun[lun].ux_slave_class_storage_media_block_length;
-
+
/* Execute the write command to the local media. */
status = storage -> ux_slave_class_storage_lun[lun].ux_slave_class_storage_media_write(storage, lun, transfer_request -> ux_slave_transfer_request_data_pointer, number_blocks, lba, &media_status);
-
+
/* If there is a problem, return a failed command. */
if (status != UX_SUCCESS)
{
-
+
/* We have a problem, request error. Return a bad completion and wait for the
REQUEST_SENSE command. */
_ux_device_stack_endpoint_stall(endpoint_out);
-
+
/* Update residue. */
storage -> ux_slave_class_storage_csw_residue = storage -> ux_slave_class_storage_host_length - done_length;
/* And update the REQUEST_SENSE codes. */
storage -> ux_slave_class_storage_lun[lun].ux_slave_class_storage_request_sense_status = media_status;
-
+
/* Return an error. */
return(UX_ERROR);
}
/* Update the lba. */
lba += number_blocks;
-
+
/* Update the length to remain. */
total_length -= transfer_length;
done_length += transfer_length;
diff --git a/common/usbx_device_classes/src/ux_device_class_video_activate.c b/common/usbx_device_classes/src/ux_device_class_video_activate.c
index 9b2632b0..0a7578c5 100644
--- a/common/usbx_device_classes/src/ux_device_class_video_activate.c
+++ b/common/usbx_device_classes/src/ux_device_class_video_activate.c
@@ -1,10 +1,11 @@
/***************************************************************************
- * Copyright (c) 2024 Microsoft Corporation
- *
+ * Copyright (c) 2024 Microsoft Corporation
+ * Copyright (c) 2026-present Eclipse ThreadX contributors
+ *
* This program and the accompanying materials are made available under the
* terms of the MIT License which is available at
* https://opensource.org/licenses/MIT.
- *
+ *
* SPDX-License-Identifier: MIT
**************************************************************************/
@@ -57,19 +58,6 @@
/* */
/* Device Video Class */
/* */
-/* RELEASE HISTORY */
-/* */
-/* DATE NAME DESCRIPTION */
-/* */
-/* 04-25-2022 Chaoqiong Xiao Initial Version 6.1.11 */
-/* 07-29-2022 Chaoqiong Xiao Modified comment(s), */
-/* fixed parameter/variable */
-/* names conflict C++ keyword, */
-/* resulting in version 6.1.12 */
-/* 10-31-2022 Chaoqiong Xiao Modified comment(s), */
-/* added standalone support, */
-/* resulting in version 6.2.0 */
-/* */
/**************************************************************************/
UINT _ux_device_class_video_activate(UX_SLAVE_CLASS_COMMAND *command)
{
diff --git a/common/usbx_device_classes/src/ux_device_class_video_change.c b/common/usbx_device_classes/src/ux_device_class_video_change.c
index 6d4a3426..e24fc9de 100644
--- a/common/usbx_device_classes/src/ux_device_class_video_change.c
+++ b/common/usbx_device_classes/src/ux_device_class_video_change.c
@@ -1,10 +1,11 @@
/***************************************************************************
- * Copyright (c) 2024 Microsoft Corporation
- *
+ * Copyright (c) 2024 Microsoft Corporation
+ * Copyright (c) 2026-present Eclipse ThreadX contributors
+ *
* This program and the accompanying materials are made available under the
* terms of the MIT License which is available at
* https://opensource.org/licenses/MIT.
- *
+ *
* SPDX-License-Identifier: MIT
**************************************************************************/
@@ -57,24 +58,6 @@
/* */
/* Device Video Class */
/* */
-/* RELEASE HISTORY */
-/* */
-/* DATE NAME DESCRIPTION */
-/* */
-/* 04-25-2022 Chaoqiong Xiao Initial Version 6.1.11 */
-/* 07-29-2022 Chaoqiong Xiao Modified comment(s), */
-/* fixed parameter/variable */
-/* names conflict C++ keyword, */
-/* resulting in version 6.1.12 */
-/* 10-31-2022 Chaoqiong Xiao Modified comment(s), */
-/* added standalone support, */
-/* resulting in version 6.2.0 */
-/* 10-31-2023 Chaoqiong Xiao Modified comment(s), */
-/* added a new mode to manage */
-/* endpoint buffer in classes */
-/* with zero copy enabled, */
-/* resulting in version 6.3.0 */
-/* */
/**************************************************************************/
UINT _ux_device_class_video_change(UX_SLAVE_CLASS_COMMAND *command)
{
diff --git a/common/usbx_device_classes/src/ux_device_class_video_control_request.c b/common/usbx_device_classes/src/ux_device_class_video_control_request.c
index ac69ed55..2451b239 100644
--- a/common/usbx_device_classes/src/ux_device_class_video_control_request.c
+++ b/common/usbx_device_classes/src/ux_device_class_video_control_request.c
@@ -1,10 +1,11 @@
/***************************************************************************
- * Copyright (c) 2024 Microsoft Corporation
- *
+ * Copyright (c) 2024 Microsoft Corporation
+ * Copyright (c) 2026-present Eclipse ThreadX contributors
+ *
* This program and the accompanying materials are made available under the
* terms of the MIT License which is available at
* https://opensource.org/licenses/MIT.
- *
+ *
* SPDX-License-Identifier: MIT
**************************************************************************/
@@ -59,12 +60,6 @@
/* */
/* Device Video Class */
/* */
-/* RELEASE HISTORY */
-/* */
-/* DATE NAME DESCRIPTION */
-/* */
-/* 04-25-2022 Chaoqiong Xiao Initial Version 6.1.11 */
-/* */
/**************************************************************************/
UINT _ux_device_class_video_control_request(UX_SLAVE_CLASS_COMMAND *command)
{
diff --git a/common/usbx_device_classes/src/ux_device_class_video_deactivate.c b/common/usbx_device_classes/src/ux_device_class_video_deactivate.c
index 20b55a77..3b026683 100644
--- a/common/usbx_device_classes/src/ux_device_class_video_deactivate.c
+++ b/common/usbx_device_classes/src/ux_device_class_video_deactivate.c
@@ -1,10 +1,11 @@
/***************************************************************************
- * Copyright (c) 2024 Microsoft Corporation
- *
+ * Copyright (c) 2024 Microsoft Corporation
+ * Copyright (c) 2026-present Eclipse ThreadX contributors
+ *
* This program and the accompanying materials are made available under the
* terms of the MIT License which is available at
* https://opensource.org/licenses/MIT.
- *
+ *
* SPDX-License-Identifier: MIT
**************************************************************************/
@@ -59,12 +60,6 @@
/* */
/* Device Video Class */
/* */
-/* RELEASE HISTORY */
-/* */
-/* DATE NAME DESCRIPTION */
-/* */
-/* 04-25-2022 Chaoqiong Xiao Initial Version 6.1.11 */
-/* */
/**************************************************************************/
UINT _ux_device_class_video_deactivate(UX_SLAVE_CLASS_COMMAND *command)
{
diff --git a/common/usbx_device_classes/src/ux_device_class_video_entry.c b/common/usbx_device_classes/src/ux_device_class_video_entry.c
index e8281f30..e55b025f 100644
--- a/common/usbx_device_classes/src/ux_device_class_video_entry.c
+++ b/common/usbx_device_classes/src/ux_device_class_video_entry.c
@@ -1,5 +1,6 @@
/***************************************************************************
* Copyright (c) 2024 Microsoft Corporation
+ * Copyright (c) 2026-present Eclipse ThreadX contributors
*
* This program and the accompanying materials are made available under the
* terms of the MIT License which is available at
@@ -66,18 +67,6 @@
/* */
/* Device Stack */
/* */
-/* RELEASE HISTORY */
-/* */
-/* DATE NAME DESCRIPTION */
-/* */
-/* 04-25-2022 Chaoqiong Xiao Initial Version 6.1.11 */
-/* 10-31-2023 Yajun xia Modified comment(s), */
-/* added error checks support, */
-/* resulting in version 6.3.0 */
-/* xx-xx-xxxx Mohamed ayed Modified comment(s), */
-/* fix typo, */
-/* resulting in version 6.x */
-/* */
/**************************************************************************/
UINT _ux_device_class_video_entry(UX_SLAVE_CLASS_COMMAND *command)
{
diff --git a/common/usbx_device_classes/src/ux_device_class_video_initialize.c b/common/usbx_device_classes/src/ux_device_class_video_initialize.c
index cee4b2ca..0f695352 100644
--- a/common/usbx_device_classes/src/ux_device_class_video_initialize.c
+++ b/common/usbx_device_classes/src/ux_device_class_video_initialize.c
@@ -1,10 +1,11 @@
/***************************************************************************
- * Copyright (c) 2024 Microsoft Corporation
- *
+ * Copyright (c) 2024 Microsoft Corporation
+ * Copyright (c) 2026-present Eclipse ThreadX contributors
+ *
* This program and the accompanying materials are made available under the
* terms of the MIT License which is available at
* https://opensource.org/licenses/MIT.
- *
+ *
* SPDX-License-Identifier: MIT
**************************************************************************/
@@ -61,20 +62,6 @@
/* */
/* Device Video Class */
/* */
-/* RELEASE HISTORY */
-/* */
-/* DATE NAME DESCRIPTION */
-/* */
-/* 04-25-2022 Chaoqiong Xiao Initial Version 6.1.11 */
-/* 10-31-2022 Chaoqiong Xiao Modified comment(s), */
-/* added standalone support, */
-/* resulting in version 6.2.0 */
-/* 10-31-2023 Chaoqiong Xiao Modified comment(s), */
-/* added a new mode to manage */
-/* endpoint buffer in classes */
-/* with zero copy enabled, */
-/* resulting in version 6.3.0 */
-/* */
/**************************************************************************/
UINT _ux_device_class_video_initialize(UX_SLAVE_CLASS_COMMAND *command)
{
@@ -250,7 +237,7 @@ ULONG i;
{
#if !defined(UX_DEVICE_STANDALONE)
- if (stream -> ux_device_class_video_stream_thread.tx_thread_id)
+ if (_ux_device_thread_created(&stream -> ux_device_class_video_stream_thread))
_ux_utility_thread_delete(&stream -> ux_device_class_video_stream_thread);
if (stream -> ux_device_class_video_stream_thread_stack)
_ux_utility_memory_free(stream -> ux_device_class_video_stream_thread_stack);
@@ -294,12 +281,6 @@ ULONG i;
/* */
/* Device Video Class */
/* */
-/* RELEASE HISTORY */
-/* */
-/* DATE NAME DESCRIPTION */
-/* */
-/* 10-31-2023 Yajun Xia Initial Version 6.3.0 */
-/* */
/**************************************************************************/
UINT _uxe_device_class_video_initialize(UX_SLAVE_CLASS_COMMAND *command)
{
@@ -327,4 +308,4 @@ ULONG i;
/* Do initialize. */
return(_ux_device_class_video_initialize(command));
-}
\ No newline at end of file
+}
diff --git a/common/usbx_device_classes/src/ux_device_class_video_ioctl.c b/common/usbx_device_classes/src/ux_device_class_video_ioctl.c
index 645cc5b6..106b3c65 100644
--- a/common/usbx_device_classes/src/ux_device_class_video_ioctl.c
+++ b/common/usbx_device_classes/src/ux_device_class_video_ioctl.c
@@ -1,10 +1,11 @@
/***************************************************************************
- * Copyright (c) 2024 Microsoft Corporation
- *
+ * Copyright (c) 2024 Microsoft Corporation
+ * Copyright (c) 2026-present Eclipse ThreadX contributors
+ *
* This program and the accompanying materials are made available under the
* terms of the MIT License which is available at
* https://opensource.org/licenses/MIT.
- *
+ *
* SPDX-License-Identifier: MIT
**************************************************************************/
@@ -60,14 +61,6 @@
/* */
/* Application */
/* */
-/* RELEASE HISTORY */
-/* */
-/* DATE NAME DESCRIPTION */
-/* */
-/* 04-25-2022 Chaoqiong Xiao Initial Version 6.1.11 */
-/* 10-31-2023 Yajun Xia Modified comment(s), */
-/* resulting in version 6.3.0 */
-/* */
/**************************************************************************/
UINT _ux_device_class_video_ioctl(UX_DEVICE_CLASS_VIDEO *video, ULONG ioctl_function,
VOID *parameter)
@@ -138,12 +131,6 @@ VOID **pptr_parameter;
/* */
/* Application */
/* */
-/* RELEASE HISTORY */
-/* */
-/* DATE NAME DESCRIPTION */
-/* */
-/* 10-31-2023 Yajun Xia Initial Version 6.3.0 */
-/* */
/**************************************************************************/
UINT _uxe_device_class_video_ioctl(UX_DEVICE_CLASS_VIDEO *video, ULONG ioctl_function,
VOID *parameter)
diff --git a/common/usbx_device_classes/src/ux_device_class_video_max_payload_get.c b/common/usbx_device_classes/src/ux_device_class_video_max_payload_get.c
index e45b68b0..7e342db7 100644
--- a/common/usbx_device_classes/src/ux_device_class_video_max_payload_get.c
+++ b/common/usbx_device_classes/src/ux_device_class_video_max_payload_get.c
@@ -1,10 +1,11 @@
/***************************************************************************
- * Copyright (c) 2024 Microsoft Corporation
- *
+ * Copyright (c) 2024 Microsoft Corporation
+ * Copyright (c) 2026-present Eclipse ThreadX contributors
+ *
* This program and the accompanying materials are made available under the
* terms of the MIT License which is available at
* https://opensource.org/licenses/MIT.
- *
+ *
* SPDX-License-Identifier: MIT
**************************************************************************/
@@ -59,12 +60,6 @@
/* */
/* Application */
/* */
-/* RELEASE HISTORY */
-/* */
-/* DATE NAME DESCRIPTION */
-/* */
-/* 04-25-2022 Chaoqiong Xiao Initial Version 6.1.11 */
-/* */
/**************************************************************************/
ULONG _ux_device_class_video_max_payload_length(UX_DEVICE_CLASS_VIDEO_STREAM *stream)
{
@@ -124,12 +119,6 @@ UX_SLAVE_DEVICE *device;
/* */
/* Application */
/* */
-/* RELEASE HISTORY */
-/* */
-/* DATE NAME DESCRIPTION */
-/* */
-/* 10-31-2023 Yajun Xia Initial Version 6.3.0 */
-/* */
/**************************************************************************/
ULONG _uxe_device_class_video_max_payload_length(UX_DEVICE_CLASS_VIDEO_STREAM *stream)
{
diff --git a/common/usbx_device_classes/src/ux_device_class_video_read_payload_free.c b/common/usbx_device_classes/src/ux_device_class_video_read_payload_free.c
index 64971100..d9c8ebc4 100644
--- a/common/usbx_device_classes/src/ux_device_class_video_read_payload_free.c
+++ b/common/usbx_device_classes/src/ux_device_class_video_read_payload_free.c
@@ -1,10 +1,11 @@
/***************************************************************************
- * Copyright (c) 2024 Microsoft Corporation
- *
+ * Copyright (c) 2024 Microsoft Corporation
+ * Copyright (c) 2026-present Eclipse ThreadX contributors
+ *
* This program and the accompanying materials are made available under the
* terms of the MIT License which is available at
* https://opensource.org/licenses/MIT.
- *
+ *
* SPDX-License-Identifier: MIT
**************************************************************************/
@@ -58,14 +59,6 @@
/* */
/* Application */
/* */
-/* RELEASE HISTORY */
-/* */
-/* DATE NAME DESCRIPTION */
-/* */
-/* 04-25-2022 Chaoqiong Xiao Initial Version 6.1.11 */
-/* 10-31-2023 Yajun Xia Modified comment(s), */
-/* resulting in version 6.3.0 */
-/* */
/**************************************************************************/
UINT _ux_device_class_video_read_payload_free(UX_DEVICE_CLASS_VIDEO_STREAM *stream)
{
@@ -156,12 +149,6 @@ UCHAR *next_payload;
/* */
/* Application */
/* */
-/* RELEASE HISTORY */
-/* */
-/* DATE NAME DESCRIPTION */
-/* */
-/* 10-31-2023 Yajun Xia Initial Version 6.3.0 */
-/* */
/**************************************************************************/
UINT _uxe_device_class_video_read_payload_free(UX_DEVICE_CLASS_VIDEO_STREAM *stream)
{
diff --git a/common/usbx_device_classes/src/ux_device_class_video_read_payload_get.c b/common/usbx_device_classes/src/ux_device_class_video_read_payload_get.c
index e8bb0543..af4cffdf 100644
--- a/common/usbx_device_classes/src/ux_device_class_video_read_payload_get.c
+++ b/common/usbx_device_classes/src/ux_device_class_video_read_payload_get.c
@@ -1,10 +1,11 @@
/***************************************************************************
- * Copyright (c) 2024 Microsoft Corporation
- *
+ * Copyright (c) 2024 Microsoft Corporation
+ * Copyright (c) 2026-present Eclipse ThreadX contributors
+ *
* This program and the accompanying materials are made available under the
* terms of the MIT License which is available at
* https://opensource.org/licenses/MIT.
- *
+ *
* SPDX-License-Identifier: MIT
**************************************************************************/
@@ -62,14 +63,6 @@
/* */
/* Application */
/* */
-/* RELEASE HISTORY */
-/* */
-/* DATE NAME DESCRIPTION */
-/* */
-/* 04-25-2022 Chaoqiong Xiao Initial Version 6.1.11 */
-/* 10-31-2023 Yajun Xia Modified comment(s), */
-/* resulting in version 6.3.0 */
-/* */
/**************************************************************************/
UINT _ux_device_class_video_read_payload_get(UX_DEVICE_CLASS_VIDEO_STREAM *stream,
UCHAR **payload_data, ULONG *payload_length)
@@ -149,12 +142,6 @@ UX_SLAVE_DEVICE *device;
/* */
/* Application */
/* */
-/* RELEASE HISTORY */
-/* */
-/* DATE NAME DESCRIPTION */
-/* */
-/* 10-31-2023 Yajun Xia Initial Version 6.3.0 */
-/* */
/**************************************************************************/
UINT _uxe_device_class_video_read_payload_get(UX_DEVICE_CLASS_VIDEO_STREAM *stream,
UCHAR **payload_data, ULONG *payload_length)
diff --git a/common/usbx_device_classes/src/ux_device_class_video_read_task_function.c b/common/usbx_device_classes/src/ux_device_class_video_read_task_function.c
index 0ce68cee..2ef361b0 100644
--- a/common/usbx_device_classes/src/ux_device_class_video_read_task_function.c
+++ b/common/usbx_device_classes/src/ux_device_class_video_read_task_function.c
@@ -1,10 +1,11 @@
/***************************************************************************
- * Copyright (c) 2024 Microsoft Corporation
- *
+ * Copyright (c) 2024 Microsoft Corporation
+ * Copyright (c) 2026-present Eclipse ThreadX contributors
+ *
* This program and the accompanying materials are made available under the
* terms of the MIT License which is available at
* https://opensource.org/licenses/MIT.
- *
+ *
* SPDX-License-Identifier: MIT
**************************************************************************/
@@ -65,16 +66,6 @@
/* */
/* USBX Device Stack */
/* */
-/* RELEASE HISTORY */
-/* */
-/* DATE NAME DESCRIPTION */
-/* */
-/* 10-31-2022 Chaoqiong Xiao Initial Version 6.2.0 */
-/* 10-31-2023 Chaoqiong Xiao Modified comment(s), */
-/* useed zero copy when class */
-/* owns endpoint buffer, */
-/* resulting in version 6.3.0 */
-/* */
/**************************************************************************/
UINT _ux_device_class_video_read_task_function(UX_DEVICE_CLASS_VIDEO_STREAM *stream)
{
diff --git a/common/usbx_device_classes/src/ux_device_class_video_read_thread_entry.c b/common/usbx_device_classes/src/ux_device_class_video_read_thread_entry.c
index 29b44ef3..71071ec0 100644
--- a/common/usbx_device_classes/src/ux_device_class_video_read_thread_entry.c
+++ b/common/usbx_device_classes/src/ux_device_class_video_read_thread_entry.c
@@ -1,10 +1,11 @@
/***************************************************************************
- * Copyright (c) 2024 Microsoft Corporation
- *
+ * Copyright (c) 2024 Microsoft Corporation
+ * Copyright (c) 2026-present Eclipse ThreadX contributors
+ *
* This program and the accompanying materials are made available under the
* terms of the MIT License which is available at
* https://opensource.org/licenses/MIT.
- *
+ *
* SPDX-License-Identifier: MIT
**************************************************************************/
@@ -63,19 +64,6 @@
/* */
/* ThreadX */
/* */
-/* RELEASE HISTORY */
-/* */
-/* DATE NAME DESCRIPTION */
-/* */
-/* 04-25-2022 Chaoqiong Xiao Initial Version 6.1.11 */
-/* 10-31-2022 Chaoqiong Xiao Modified comment(s), */
-/* added error statistics, */
-/* resulting in version 6.2.0 */
-/* 10-31-2023 Chaoqiong Xiao Modified comment(s), */
-/* useed zero copy when class */
-/* owns endpoint buffer, */
-/* resulting in version 6.3.0 */
-/* */
/**************************************************************************/
VOID _ux_device_class_video_read_thread_entry(ULONG video_stream)
{
diff --git a/common/usbx_device_classes/src/ux_device_class_video_reception_start.c b/common/usbx_device_classes/src/ux_device_class_video_reception_start.c
index 8f05a015..5b42256d 100644
--- a/common/usbx_device_classes/src/ux_device_class_video_reception_start.c
+++ b/common/usbx_device_classes/src/ux_device_class_video_reception_start.c
@@ -1,10 +1,11 @@
/***************************************************************************
- * Copyright (c) 2024 Microsoft Corporation
- *
+ * Copyright (c) 2024 Microsoft Corporation
+ * Copyright (c) 2026-present Eclipse ThreadX contributors
+ *
* This program and the accompanying materials are made available under the
* terms of the MIT License which is available at
* https://opensource.org/licenses/MIT.
- *
+ *
* SPDX-License-Identifier: MIT
**************************************************************************/
@@ -59,17 +60,6 @@
/* */
/* Application */
/* */
-/* RELEASE HISTORY */
-/* */
-/* DATE NAME DESCRIPTION */
-/* */
-/* 04-25-2022 Chaoqiong Xiao Initial Version 6.1.11 */
-/* 10-31-2022 Chaoqiong Xiao Modified comment(s), */
-/* added standalone support, */
-/* resulting in version 6.2.0 */
-/* 10-31-2023 Yajun Xia Modified comment(s), */
-/* resulting in version 6.3.0 */
-/* */
/**************************************************************************/
UINT _ux_device_class_video_reception_start(UX_DEVICE_CLASS_VIDEO_STREAM *stream)
{
@@ -148,12 +138,6 @@ UX_SLAVE_DEVICE *device;
/* */
/* Application */
/* */
-/* RELEASE HISTORY */
-/* */
-/* DATE NAME DESCRIPTION */
-/* */
-/* 10-31-2023 Yajun Xia Initial Version 6.3.0 */
-/* */
/**************************************************************************/
UINT _uxe_device_class_video_reception_start(UX_DEVICE_CLASS_VIDEO_STREAM *stream)
{
diff --git a/common/usbx_device_classes/src/ux_device_class_video_stream_get.c b/common/usbx_device_classes/src/ux_device_class_video_stream_get.c
index 3be20d97..c6485695 100644
--- a/common/usbx_device_classes/src/ux_device_class_video_stream_get.c
+++ b/common/usbx_device_classes/src/ux_device_class_video_stream_get.c
@@ -1,10 +1,11 @@
/***************************************************************************
- * Copyright (c) 2024 Microsoft Corporation
- *
+ * Copyright (c) 2024 Microsoft Corporation
+ * Copyright (c) 2026-present Eclipse ThreadX contributors
+ *
* This program and the accompanying materials are made available under the
* terms of the MIT License which is available at
* https://opensource.org/licenses/MIT.
- *
+ *
* SPDX-License-Identifier: MIT
**************************************************************************/
@@ -63,12 +64,6 @@
/* */
/* Video Class */
/* */
-/* RELEASE HISTORY */
-/* */
-/* DATE NAME DESCRIPTION */
-/* */
-/* 04-25-2022 Chaoqiong Xiao Initial Version 6.1.11 */
-/* */
/**************************************************************************/
UINT _ux_device_class_video_stream_get(UX_DEVICE_CLASS_VIDEO *video,
ULONG stream_index, UX_DEVICE_CLASS_VIDEO_STREAM **stream)
diff --git a/common/usbx_device_classes/src/ux_device_class_video_tasks_run.c b/common/usbx_device_classes/src/ux_device_class_video_tasks_run.c
index d30c3c5c..1ae0b496 100644
--- a/common/usbx_device_classes/src/ux_device_class_video_tasks_run.c
+++ b/common/usbx_device_classes/src/ux_device_class_video_tasks_run.c
@@ -1,10 +1,11 @@
/***************************************************************************
- * Copyright (c) 2024 Microsoft Corporation
- *
+ * Copyright (c) 2024 Microsoft Corporation
+ * Copyright (c) 2026-present Eclipse ThreadX contributors
+ *
* This program and the accompanying materials are made available under the
* terms of the MIT License which is available at
* https://opensource.org/licenses/MIT.
- *
+ *
* SPDX-License-Identifier: MIT
**************************************************************************/
@@ -65,12 +66,6 @@
/* */
/* USBX Device Stack */
/* */
-/* RELEASE HISTORY */
-/* */
-/* DATE NAME DESCRIPTION */
-/* */
-/* 10-31-2022 Chaoqiong Xiao Initial Version 6.2.0 */
-/* */
/**************************************************************************/
UINT _ux_device_class_video_tasks_run(VOID *instance)
{
diff --git a/common/usbx_device_classes/src/ux_device_class_video_transmission_start.c b/common/usbx_device_classes/src/ux_device_class_video_transmission_start.c
index 3a854f61..267bc1b3 100644
--- a/common/usbx_device_classes/src/ux_device_class_video_transmission_start.c
+++ b/common/usbx_device_classes/src/ux_device_class_video_transmission_start.c
@@ -1,10 +1,11 @@
/***************************************************************************
- * Copyright (c) 2024 Microsoft Corporation
- *
+ * Copyright (c) 2024 Microsoft Corporation
+ * Copyright (c) 2026-present Eclipse ThreadX contributors
+ *
* This program and the accompanying materials are made available under the
* terms of the MIT License which is available at
* https://opensource.org/licenses/MIT.
- *
+ *
* SPDX-License-Identifier: MIT
**************************************************************************/
@@ -59,17 +60,6 @@
/* */
/* Application */
/* */
-/* RELEASE HISTORY */
-/* */
-/* DATE NAME DESCRIPTION */
-/* */
-/* 04-25-2022 Chaoqiong Xiao Initial Version 6.1.11 */
-/* 10-31-2022 Chaoqiong Xiao Modified comment(s), */
-/* added standalone support, */
-/* resulting in version 6.2.0 */
-/* 10-31-2023 Yajun Xia Modified comment(s), */
-/* resulting in version 6.3.0 */
-/* */
/**************************************************************************/
UINT _ux_device_class_video_transmission_start(UX_DEVICE_CLASS_VIDEO_STREAM *stream)
{
@@ -150,12 +140,6 @@ UX_SLAVE_DEVICE *device;
/* */
/* Application */
/* */
-/* RELEASE HISTORY */
-/* */
-/* DATE NAME DESCRIPTION */
-/* */
-/* 10-31-2023 Yajun Xia Initial Version 6.3.0 */
-/* */
/**************************************************************************/
UINT _uxe_device_class_video_transmission_start(UX_DEVICE_CLASS_VIDEO_STREAM *stream)
{
diff --git a/common/usbx_device_classes/src/ux_device_class_video_uninitialize.c b/common/usbx_device_classes/src/ux_device_class_video_uninitialize.c
index 9708f920..a4368088 100644
--- a/common/usbx_device_classes/src/ux_device_class_video_uninitialize.c
+++ b/common/usbx_device_classes/src/ux_device_class_video_uninitialize.c
@@ -1,10 +1,11 @@
/***************************************************************************
- * Copyright (c) 2024 Microsoft Corporation
- *
+ * Copyright (c) 2024 Microsoft Corporation
+ * Copyright (c) 2026-present Eclipse ThreadX contributors
+ *
* This program and the accompanying materials are made available under the
* terms of the MIT License which is available at
* https://opensource.org/licenses/MIT.
- *
+ *
* SPDX-License-Identifier: MIT
**************************************************************************/
@@ -59,17 +60,6 @@
/* */
/* Device Video Class */
/* */
-/* RELEASE HISTORY */
-/* */
-/* DATE NAME DESCRIPTION */
-/* */
-/* 04-25-2022 Chaoqiong Xiao Initial Version 6.1.11 */
-/* 10-31-2023 Chaoqiong Xiao Modified comment(s), */
-/* added a new mode to manage */
-/* endpoint buffer in classes */
-/* with zero copy enabled, */
-/* resulting in version 6.3.0 */
-/* */
/**************************************************************************/
UINT _ux_device_class_video_uninitialize(UX_SLAVE_CLASS_COMMAND *command)
{
diff --git a/common/usbx_device_classes/src/ux_device_class_video_write_payload_commit.c b/common/usbx_device_classes/src/ux_device_class_video_write_payload_commit.c
index 3d3f5f7f..d61f1621 100644
--- a/common/usbx_device_classes/src/ux_device_class_video_write_payload_commit.c
+++ b/common/usbx_device_classes/src/ux_device_class_video_write_payload_commit.c
@@ -1,10 +1,11 @@
/***************************************************************************
- * Copyright (c) 2024 Microsoft Corporation
- *
+ * Copyright (c) 2024 Microsoft Corporation
+ * Copyright (c) 2026-present Eclipse ThreadX contributors
+ *
* This program and the accompanying materials are made available under the
* terms of the MIT License which is available at
* https://opensource.org/licenses/MIT.
- *
+ *
* SPDX-License-Identifier: MIT
**************************************************************************/
@@ -59,14 +60,6 @@
/* */
/* Application */
/* */
-/* RELEASE HISTORY */
-/* */
-/* DATE NAME DESCRIPTION */
-/* */
-/* 04-25-2022 Chaoqiong Xiao Initial Version 6.1.11 */
-/* 10-31-2023 Yajun Xia Modified comment(s), */
-/* resulting in version 6.3.0 */
-/* */
/**************************************************************************/
UINT _ux_device_class_video_write_payload_commit(UX_DEVICE_CLASS_VIDEO_STREAM *stream, ULONG length)
{
@@ -157,12 +150,6 @@ UCHAR *next_pos;
/* */
/* Application */
/* */
-/* RELEASE HISTORY */
-/* */
-/* DATE NAME DESCRIPTION */
-/* */
-/* 10-31-2023 Yajun Xia Initial Version 6.3.0 */
-/* */
/**************************************************************************/
UINT _uxe_device_class_video_write_payload_commit(UX_DEVICE_CLASS_VIDEO_STREAM *stream, ULONG length)
{
diff --git a/common/usbx_device_classes/src/ux_device_class_video_write_payload_get.c b/common/usbx_device_classes/src/ux_device_class_video_write_payload_get.c
index 9a10d634..7365d02e 100644
--- a/common/usbx_device_classes/src/ux_device_class_video_write_payload_get.c
+++ b/common/usbx_device_classes/src/ux_device_class_video_write_payload_get.c
@@ -1,10 +1,11 @@
/***************************************************************************
- * Copyright (c) 2024 Microsoft Corporation
- *
+ * Copyright (c) 2024 Microsoft Corporation
+ * Copyright (c) 2026-present Eclipse ThreadX contributors
+ *
* This program and the accompanying materials are made available under the
* terms of the MIT License which is available at
* https://opensource.org/licenses/MIT.
- *
+ *
* SPDX-License-Identifier: MIT
**************************************************************************/
@@ -62,14 +63,6 @@
/* */
/* Application */
/* */
-/* RELEASE HISTORY */
-/* */
-/* DATE NAME DESCRIPTION */
-/* */
-/* 04-25-2022 Chaoqiong Xiao Initial Version 6.1.11 */
-/* 10-31-2023 Yajun Xia Modified comment(s), */
-/* resulting in version 6.3.0 */
-/* */
/**************************************************************************/
UINT _ux_device_class_video_write_payload_get(UX_DEVICE_CLASS_VIDEO_STREAM *stream, UCHAR **payload, ULONG *length)
{
@@ -149,12 +142,6 @@ UX_SLAVE_DEVICE *device;
/* */
/* Application */
/* */
-/* RELEASE HISTORY */
-/* */
-/* DATE NAME DESCRIPTION */
-/* */
-/* 10-31-2023 Yajun Xia Initial Version 6.3.0 */
-/* */
/**************************************************************************/
UINT _uxe_device_class_video_write_payload_get(UX_DEVICE_CLASS_VIDEO_STREAM *stream, UCHAR **payload, ULONG *length)
{
diff --git a/common/usbx_device_classes/src/ux_device_class_video_write_task_function.c b/common/usbx_device_classes/src/ux_device_class_video_write_task_function.c
index ceb0d67a..d8f78b41 100644
--- a/common/usbx_device_classes/src/ux_device_class_video_write_task_function.c
+++ b/common/usbx_device_classes/src/ux_device_class_video_write_task_function.c
@@ -1,10 +1,11 @@
/***************************************************************************
- * Copyright (c) 2024 Microsoft Corporation
- *
+ * Copyright (c) 2024 Microsoft Corporation
+ * Copyright (c) 2026-present Eclipse ThreadX contributors
+ *
* This program and the accompanying materials are made available under the
* terms of the MIT License which is available at
* https://opensource.org/licenses/MIT.
- *
+ *
* SPDX-License-Identifier: MIT
**************************************************************************/
@@ -66,16 +67,6 @@
/* */
/* USBX Device Stack */
/* */
-/* RELEASE HISTORY */
-/* */
-/* DATE NAME DESCRIPTION */
-/* */
-/* 10-31-2022 Chaoqiong Xiao Initial Version 6.2.0 */
-/* 10-31-2023 Chaoqiong Xiao Modified comment(s), */
-/* useed zero copy when class */
-/* owns endpoint buffer, */
-/* resulting in version 6.3.0 */
-/* */
/**************************************************************************/
UINT _ux_device_class_video_write_task_function(UX_DEVICE_CLASS_VIDEO_STREAM *stream)
{
diff --git a/common/usbx_device_classes/src/ux_device_class_video_write_thread_entry.c b/common/usbx_device_classes/src/ux_device_class_video_write_thread_entry.c
index 6cc5f669..9523213f 100644
--- a/common/usbx_device_classes/src/ux_device_class_video_write_thread_entry.c
+++ b/common/usbx_device_classes/src/ux_device_class_video_write_thread_entry.c
@@ -1,10 +1,11 @@
/***************************************************************************
- * Copyright (c) 2024 Microsoft Corporation
- *
+ * Copyright (c) 2024 Microsoft Corporation
+ * Copyright (c) 2026-present Eclipse ThreadX contributors
+ *
* This program and the accompanying materials are made available under the
* terms of the MIT License which is available at
* https://opensource.org/licenses/MIT.
- *
+ *
* SPDX-License-Identifier: MIT
**************************************************************************/
@@ -63,19 +64,6 @@
/* */
/* ThreadX */
/* */
-/* RELEASE HISTORY */
-/* */
-/* DATE NAME DESCRIPTION */
-/* */
-/* 04-25-2022 Chaoqiong Xiao Initial Version 6.1.11 */
-/* 10-31-2022 Chaoqiong Xiao Modified comment(s), */
-/* added error statistics, */
-/* resulting in version 6.2.0 */
-/* 10-31-2023 Chaoqiong Xiao Modified comment(s), */
-/* useed zero copy when class */
-/* owns endpoint buffer, */
-/* resulting in version 6.3.0 */
-/* */
/**************************************************************************/
VOID _ux_device_class_video_write_thread_entry(ULONG video_stream)
{
diff --git a/common/usbx_host_classes/CMakeLists.txt b/common/usbx_host_classes/CMakeLists.txt
index 47420899..11083a22 100644
--- a/common/usbx_host_classes/CMakeLists.txt
+++ b/common/usbx_host_classes/CMakeLists.txt
@@ -93,6 +93,8 @@ target_sources(${PROJECT_NAME} PRIVATE
${CMAKE_CURRENT_LIST_DIR}/src/ux_host_class_hid_idle_get.c
${CMAKE_CURRENT_LIST_DIR}/src/ux_host_class_hid_idle_set.c
${CMAKE_CURRENT_LIST_DIR}/src/ux_host_class_hid_idle_set_run.c
+ ${CMAKE_CURRENT_LIST_DIR}/src/ux_host_class_hid_protocol_set.c
+ ${CMAKE_CURRENT_LIST_DIR}/src/ux_host_class_hid_protocol_get.c
${CMAKE_CURRENT_LIST_DIR}/src/ux_host_class_hid_instance_clean.c
${CMAKE_CURRENT_LIST_DIR}/src/ux_host_class_hid_interrupt_endpoint_search.c
${CMAKE_CURRENT_LIST_DIR}/src/ux_host_class_hid_item_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 6e75b179..14dc4f20 100644
--- a/common/usbx_host_classes/inc/ux_host_class_asix.h
+++ b/common/usbx_host_classes/inc/ux_host_class_asix.h
@@ -1,18 +1,19 @@
/***************************************************************************
- * Copyright (c) 2024 Microsoft Corporation
- *
+ * Copyright (c) 2024 Microsoft Corporation
+ * Copyright (c) 2026-present Eclipse ThreadX contributors
+ *
* This program and the accompanying materials are made available under the
* terms of the MIT License which is available at
* https://opensource.org/licenses/MIT.
- *
+ *
* SPDX-License-Identifier: MIT
**************************************************************************/
/**************************************************************************/
/**************************************************************************/
-/** */
-/** USBX Component */
+/** */
+/** USBX Component */
/** */
/** ASIX Class */
/** */
@@ -20,60 +21,35 @@
/**************************************************************************/
-/**************************************************************************/
-/* */
-/* COMPONENT DEFINITION RELEASE */
-/* */
-/* ux_host_class_asix.h PORTABLE C */
+/**************************************************************************/
+/* */
+/* COMPONENT DEFINITION RELEASE */
+/* */
+/* ux_host_class_asix.h PORTABLE C */
/* 6.2.0 */
/* AUTHOR */
/* */
/* Chaoqiong Xiao, Microsoft Corporation */
/* */
/* DESCRIPTION */
-/* */
+/* */
/* This file contains all the header and extern functions used by the */
-/* USBX ASIX class. */
-/* */
-/* RELEASE HISTORY */
-/* */
-/* 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 */
-/* 08-02-2021 Wen Wang Modified comment(s), */
-/* added extern "C" keyword */
-/* for compatibility with C++, */
-/* resulting in version 6.1.8 */
-/* 04-25-2022 Chaoqiong Xiao Modified comment(s), */
-/* fixed standalone compile, */
-/* resulting in version 6.1.11 */
-/* 10-31-2022 Chaoqiong Xiao Modified comment(s), */
-/* supported NX packet chain, */
-/* refined VID/PID check flow, */
-/* removed internal NX pool, */
-/* added some new definitions, */
-/* refined reception handling, */
-/* resulting in version 6.2.0 */
+/* USBX ASIX class. */
/* */
/**************************************************************************/
#ifndef UX_HOST_CLASS_ASIX_H
#define UX_HOST_CLASS_ASIX_H
-/* Determine if a C++ compiler is being used. If so, ensure that standard
- C is used to process the API information. */
+/* Determine if a C++ compiler is being used. If so, ensure that standard
+ C is used to process the API information. */
-#ifdef __cplusplus
+#ifdef __cplusplus
-/* Yes, C++ compiler is present. Use standard C. */
-extern "C" {
+/* Yes, C++ compiler is present. Use standard C. */
+extern "C" {
-#endif
+#endif
#if !defined(UX_HOST_STANDALONE)
@@ -110,8 +86,8 @@ extern "C" {
UX_HOST_CLASS_ASIX_VENDOR_LINKSYS_ID, UX_HOST_CLASS_ASIX_PRODUCT_LINKSYS_ID
#endif
-#define UX_HOST_CLASS_ASIX_SPEED_SELECTED_100MPBS 0x100
-#define UX_HOST_CLASS_ASIX_SPEED_SELECTED_10MPBS 0x10
+#define UX_HOST_CLASS_ASIX_SPEED_SELECTED_100MPBS 0x100
+#define UX_HOST_CLASS_ASIX_SPEED_SELECTED_10MPBS 0x10
#define UX_HOST_CLASS_ASIX_LINK_STATE_DOWN 0
#define UX_HOST_CLASS_ASIX_LINK_STATE_UP 1
#define UX_HOST_CLASS_ASIX_LINK_STATE_PENDING_UP 2
@@ -122,7 +98,7 @@ extern "C" {
#define UX_HOST_CLASS_ASIX_ETHERNET_IP 0x0800
#define UX_HOST_CLASS_ASIX_ETHERNET_ARP 0x0806
#define UX_HOST_CLASS_ASIX_ETHERNET_RARP 0x8035
-#define UX_HOST_CLASS_ASIX_ETHERNET_PACKET_SIZE 1536
+#define UX_HOST_CLASS_ASIX_ETHERNET_PACKET_SIZE 1536
#define UX_HOST_CLASS_ASIX_NX_ALIGN_PADDING 2
#define UX_HOST_CLASS_ASIX_RX_HEADER_SIZE 4
#define UX_HOST_CLASS_ASIX_OVERHEAD_SIZE (UX_HOST_CLASS_ASIX_NX_ALIGN_PADDING + UX_HOST_CLASS_ASIX_RX_HEADER_SIZE)
@@ -157,7 +133,7 @@ extern "C" {
#define UX_HOST_CLASS_ASIX_NX_BUFF_SIZE (UX_HOST_CLASS_ASIX_NX_PAYLOAD_SIZE + UX_HOST_CLASS_ASIX_NX_PACKET_SIZE)
#define UX_HOST_CLASS_ASIX_ETHERNET_SIZE 14
-
+
#define UX_HOST_CLASS_ASIX_DEVICE_INIT_DELAY (1 * UX_PERIODIC_RATE)
#define UX_HOST_CLASS_ASIX_CLASS_TRANSFER_TIMEOUT 300000
#define UX_HOST_CLASS_ASIX_SETUP_BUFFER_SIZE 16
@@ -319,7 +295,7 @@ extern "C" {
/* Define ASIX Class packet equivalences. */
#define UX_HOST_CLASS_ASIX_PACKET_SIZE 128
-#define UX_HOST_CLASS_ASIX_NODE_ID_LENGTH 6
+#define UX_HOST_CLASS_ASIX_NODE_ID_LENGTH 6
#define UX_HOST_CLASS_ASIX_RX_PACKET_LENGTH_MASK 0xFFF
@@ -396,7 +372,7 @@ extern "C" {
typedef struct UX_HOST_CLASS_ASIX_STRUCT
{
- struct UX_HOST_CLASS_ASIX_STRUCT
+ struct UX_HOST_CLASS_ASIX_STRUCT
*ux_host_class_asix_next_instance;
UX_HOST_CLASS *ux_host_class_asix_class;
UX_DEVICE *ux_host_class_asix_device;
@@ -433,10 +409,10 @@ typedef struct UX_HOST_CLASS_ASIX_STRUCT
ULONG ux_host_class_asix_packet_available_min;
UCHAR ux_host_class_asix_node_id[UX_HOST_CLASS_ASIX_NODE_ID_LENGTH];
- VOID (*ux_host_class_asix_device_status_change_callback)(struct UX_HOST_CLASS_ASIX_STRUCT *asix,
+ VOID (*ux_host_class_asix_device_status_change_callback)(struct UX_HOST_CLASS_ASIX_STRUCT *asix,
ULONG device_state);
VOID *ux_host_class_asix_network_handle;
-
+
} UX_HOST_CLASS_ASIX;
@@ -451,9 +427,9 @@ typedef struct UX_HOST_CLASS_ASIX_RECEPTION_STRUCT
ULONG ux_host_class_asix_reception_data_buffer_size;
UCHAR *ux_host_class_asix_reception_data_head;
UCHAR *ux_host_class_asix_reception_data_tail;
- VOID (*ux_host_class_asix_reception_callback)(struct UX_HOST_CLASS_ASIX_STRUCT *asix,
+ VOID (*ux_host_class_asix_reception_callback)(struct UX_HOST_CLASS_ASIX_STRUCT *asix,
UINT status,
- UCHAR *reception_buffer,
+ UCHAR *reception_buffer,
ULONG reception_size);
} UX_HOST_CLASS_ASIX_RECEPTION;
@@ -465,7 +441,7 @@ UINT _ux_host_class_asix_configure(UX_HOST_CLASS_ASIX *asix);
UINT _ux_host_class_asix_deactivate(UX_HOST_CLASS_COMMAND *command);
UINT _ux_host_class_asix_endpoints_get(UX_HOST_CLASS_ASIX *asix);
UINT _ux_host_class_asix_entry(UX_HOST_CLASS_COMMAND *command);
-UINT _ux_host_class_asix_read (UX_HOST_CLASS_ASIX *asix, UCHAR *data_pointer,
+UINT _ux_host_class_asix_read (UX_HOST_CLASS_ASIX *asix, UCHAR *data_pointer,
ULONG requested_length, ULONG *actual_length);
UINT _ux_host_class_asix_write(VOID *asix_class, NX_PACKET *packet);
VOID _ux_host_class_asix_interrupt_notification(UX_TRANSFER *transfer_request);
@@ -473,17 +449,17 @@ VOID _ux_host_class_asix_reception_callback (UX_TRANSFER *transfer_request);
VOID _ux_host_class_asix_thread(ULONG parameter);
VOID _ux_host_class_asix_transmission_callback (UX_TRANSFER *transfer_request);
UINT _ux_host_class_asix_setup(UX_HOST_CLASS_ASIX *asix);
-
+
/* Define Asix Class API prototypes. */
#define ux_host_class_asix_entry _ux_host_class_asix_entry
#define ux_host_class_asix_read _ux_host_class_asix_read
#define ux_host_class_asix_write _ux_host_class_asix_write
-/* Determine if a C++ compiler is being used. If so, complete the standard
- C conditional started above. */
+/* Determine if a C++ compiler is being used. If so, complete the standard
+ C conditional started above. */
#ifdef __cplusplus
-}
-#endif
+}
+#endif
#endif
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 59d957dc..94c582fa 100644
--- a/common/usbx_host_classes/inc/ux_host_class_audio.h
+++ b/common/usbx_host_classes/inc/ux_host_class_audio.h
@@ -1,10 +1,11 @@
/***************************************************************************
- * Copyright (c) 2024 Microsoft Corporation
- *
+ * Copyright (c) 2024 Microsoft Corporation
+ * Copyright (c) 2026-present Eclipse ThreadX contributors
+ *
* This program and the accompanying materials are made available under the
* terms of the MIT License which is available at
* https://opensource.org/licenses/MIT.
- *
+ *
* SPDX-License-Identifier: MIT
**************************************************************************/
@@ -35,32 +36,6 @@
/* This file contains all the header and extern functions used by the */
/* USBX audio class. */
/* */
-/* RELEASE HISTORY */
-/* */
-/* 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 */
-/* 08-02-2021 Wen Wang Modified comment(s), */
-/* added extern "C" keyword */
-/* for compatibility with C++, */
-/* resulting in version 6.1.8 */
-/* 07-29-2022 Chaoqiong Xiao Modified comment(s), */
-/* added interrupt support, */
-/* used interface protocol, */
-/* protect reentry with mutex, */
-/* added feedback support, */
-/* added Audio 2.0 support, */
-/* resulting in version 6.1.12 */
-/* 10-31-2023 Chaoqiong Xiao Modified comment(s), */
-/* improved AC AS management, */
-/* optimized USB descriptors, */
-/* resulting in version 6.3.0 */
-/* */
/**************************************************************************/
#ifndef UX_HOST_CLASS_AUDIO_H
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 3e56211b..24b8fb4e 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
@@ -1,18 +1,19 @@
/***************************************************************************
- * Copyright (c) 2024 Microsoft Corporation
- *
+ * Copyright (c) 2024 Microsoft Corporation
+ * Copyright (c) 2026-present Eclipse ThreadX contributors
+ *
* This program and the accompanying materials are made available under the
* terms of the MIT License which is available at
* https://opensource.org/licenses/MIT.
- *
+ *
* SPDX-License-Identifier: MIT
**************************************************************************/
/**************************************************************************/
/**************************************************************************/
-/** */
-/** USBX Component */
+/** */
+/** USBX Component */
/** */
/** CDC ACM Class */
/** */
@@ -20,55 +21,35 @@
/**************************************************************************/
-/**************************************************************************/
-/* */
-/* COMPONENT DEFINITION RELEASE */
-/* */
-/* ux_host_class_cdc_acm.h PORTABLE C */
+/**************************************************************************/
+/* */
+/* COMPONENT DEFINITION RELEASE */
+/* */
+/* ux_host_class_cdc_acm.h PORTABLE C */
/* 6.1.10 */
/* AUTHOR */
/* */
/* Chaoqiong Xiao, Microsoft Corporation */
/* */
/* DESCRIPTION */
-/* */
+/* */
/* This file contains all the header and extern functions used by the */
-/* USBX CDC ACM class. */
-/* */
-/* RELEASE HISTORY */
-/* */
-/* 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 */
-/* 08-02-2021 Wen Wang Modified comment(s), */
-/* added extern "C" keyword */
-/* for compatibility with C++, */
-/* resulting in version 6.1.8 */
-/* 01-31-2022 Chaoqiong Xiao Modified comment(s), */
-/* added standalone support, */
-/* used defined line coding */
-/* instead of magic number, */
-/* resulting in version 6.1.10 */
+/* USBX CDC ACM class. */
/* */
/**************************************************************************/
#ifndef UX_HOST_CLASS_CDC_ACM_H
#define UX_HOST_CLASS_CDC_ACM_H
-/* Determine if a C++ compiler is being used. If so, ensure that standard
- C is used to process the API information. */
+/* Determine if a C++ compiler is being used. If so, ensure that standard
+ C is used to process the API information. */
-#ifdef __cplusplus
+#ifdef __cplusplus
-/* Yes, C++ compiler is present. Use standard C. */
-extern "C" {
+/* Yes, C++ compiler is present. Use standard C. */
+extern "C" {
-#endif
+#endif
/* Internal option: enable the basic USBX error checking. This define is typically used
@@ -126,7 +107,7 @@ extern "C" {
#define UX_HOST_CLASS_CDC_ACM_REQ_SET_LINE_STATE 0x22
#define UX_HOST_CLASS_CDC_ACM_REQ_SEND_BREAK 0x23
#define UX_HOST_CLASS_CDC_ACM_REQ_SET_RINGER_PARMS 0x30
-#define UX_HOST_CLASS_CDC_ACM_REQ_GET_RINGER_PARMS 0x31
+#define UX_HOST_CLASS_CDC_ACM_REQ_GET_RINGER_PARMS 0x31
#define UX_HOST_CLASS_CDC_ACM_REQ_SET_OPERATION_PARMS 0x32
#define UX_HOST_CLASS_CDC_ACM_REQ_GET_OPERATION_PARMS 0x33
#define UX_HOST_CLASS_CDC_ACM_REQ_SET_LINE_PARMS 0x34
@@ -222,7 +203,7 @@ extern "C" {
typedef struct UX_HOST_CLASS_CDC_ACM_STRUCT
{
- struct UX_HOST_CLASS_CDC_ACM_STRUCT
+ struct UX_HOST_CLASS_CDC_ACM_STRUCT
*ux_host_class_cdc_acm_next_instance;
UX_HOST_CLASS *ux_host_class_cdc_acm_class;
UX_DEVICE *ux_host_class_cdc_acm_device;
@@ -235,10 +216,10 @@ typedef struct UX_HOST_CLASS_CDC_ACM_STRUCT
ULONG ux_host_class_cdc_acm_notification_count;
ULONG ux_host_class_cdc_acm_capabilities;
ULONG ux_host_class_cdc_acm_device_state;
- struct UX_HOST_CLASS_CDC_ACM_RECEPTION_STRUCT
+ struct UX_HOST_CLASS_CDC_ACM_RECEPTION_STRUCT
*ux_host_class_cdc_acm_reception;
-
- VOID (*ux_host_class_cdc_acm_device_status_change_callback)(struct UX_HOST_CLASS_CDC_ACM_STRUCT *cdc_acm,
+
+ VOID (*ux_host_class_cdc_acm_device_status_change_callback)(struct UX_HOST_CLASS_CDC_ACM_STRUCT *cdc_acm,
ULONG notification_type, ULONG notification_value);
#if !defined(UX_HOST_STANDALONE)
UX_SEMAPHORE ux_host_class_cdc_acm_semaphore;
@@ -266,7 +247,7 @@ typedef struct UX_HOST_CLASS_CDC_ACM_STRUCT
typedef struct UX_HOST_CLASS_CDC_DLC_STRUCT
{
- struct UX_HOST_CLASS_CDC_DLC_STRUCT
+ struct UX_HOST_CLASS_CDC_DLC_STRUCT
*ux_host_class_cdc_dlc_next_instance;
UX_HOST_CLASS *ux_host_class_cdc_dlc_class;
UX_DEVICE *ux_host_class_cdc_dlc_device;
@@ -278,7 +259,7 @@ typedef struct UX_HOST_CLASS_CDC_DLC_STRUCT
UINT ux_host_class_cdc_dlc_state;
ULONG ux_host_class_cdc_dlc_notification_count;
ULONG ux_host_class_cdc_dlc_capabilities;
- struct UX_HOST_CLASS_CDC_DLC_RECEPTION_STRUCT
+ struct UX_HOST_CLASS_CDC_DLC_RECEPTION_STRUCT
*ux_host_class_cdc_dlc_reception;
#if !defined(UX_HOST_STANDALONE)
UX_SEMAPHORE ux_host_class_cdc_dlc_semaphore;
@@ -309,9 +290,9 @@ typedef struct UX_HOST_CLASS_CDC_ACM_RECEPTION_STRUCT
ULONG ux_host_class_cdc_acm_reception_data_buffer_size;
UCHAR *ux_host_class_cdc_acm_reception_data_head;
UCHAR *ux_host_class_cdc_acm_reception_data_tail;
- VOID (*ux_host_class_cdc_acm_reception_callback)(struct UX_HOST_CLASS_CDC_ACM_STRUCT *cdc_acm,
+ VOID (*ux_host_class_cdc_acm_reception_callback)(struct UX_HOST_CLASS_CDC_ACM_STRUCT *cdc_acm,
UINT status,
- UCHAR *reception_buffer,
+ UCHAR *reception_buffer,
ULONG reception_size);
} UX_HOST_CLASS_CDC_ACM_RECEPTION;
@@ -354,9 +335,9 @@ UINT _ux_host_class_cdc_acm_configure(UX_HOST_CLASS_CDC_ACM *cdc_acm);
UINT _ux_host_class_cdc_acm_deactivate(UX_HOST_CLASS_COMMAND *command);
UINT _ux_host_class_cdc_acm_endpoints_get(UX_HOST_CLASS_CDC_ACM *cdc_acm);
UINT _ux_host_class_cdc_acm_entry(UX_HOST_CLASS_COMMAND *command);
-UINT _ux_host_class_cdc_acm_read (UX_HOST_CLASS_CDC_ACM *cdc_acm, UCHAR *data_pointer,
+UINT _ux_host_class_cdc_acm_read (UX_HOST_CLASS_CDC_ACM *cdc_acm, UCHAR *data_pointer,
ULONG requested_length, ULONG *actual_length);
-UINT _ux_host_class_cdc_acm_write(UX_HOST_CLASS_CDC_ACM *cdc_acm, UCHAR *data_pointer,
+UINT _ux_host_class_cdc_acm_write(UX_HOST_CLASS_CDC_ACM *cdc_acm, UCHAR *data_pointer,
ULONG requested_length, ULONG *actual_length);
UINT _ux_host_class_cdc_acm_ioctl(UX_HOST_CLASS_CDC_ACM *cdc_acm, ULONG request,
VOID *parameter);
@@ -364,31 +345,31 @@ UINT _ux_host_class_cdc_acm_command(UX_HOST_CLASS_CDC_ACM *cdc_acm, ULONG comma
ULONG value, UCHAR *data_buffer, ULONG data_length);
VOID _ux_host_class_cdc_acm_transfer_request_completed(UX_TRANSFER *transfer_request);
UINT _ux_host_class_cdc_acm_capabilities_get(UX_HOST_CLASS_CDC_ACM *cdc_acm);
-UINT _ux_host_class_cdc_acm_reception_stop (UX_HOST_CLASS_CDC_ACM *cdc_acm,
+UINT _ux_host_class_cdc_acm_reception_stop (UX_HOST_CLASS_CDC_ACM *cdc_acm,
UX_HOST_CLASS_CDC_ACM_RECEPTION *cdc_acm_reception);
-UINT _ux_host_class_cdc_acm_reception_start (UX_HOST_CLASS_CDC_ACM *cdc_acm,
+UINT _ux_host_class_cdc_acm_reception_start (UX_HOST_CLASS_CDC_ACM *cdc_acm,
UX_HOST_CLASS_CDC_ACM_RECEPTION *cdc_acm_reception);
-
+
VOID _ux_host_class_cdc_acm_reception_callback (UX_TRANSFER *transfer_request);
-UINT _ux_host_class_cdc_acm_write_with_callback(UX_HOST_CLASS_CDC_ACM *cdc_acm, UCHAR *data_pointer,
+UINT _ux_host_class_cdc_acm_write_with_callback(UX_HOST_CLASS_CDC_ACM *cdc_acm, UCHAR *data_pointer,
ULONG requested_length);
VOID _ux_host_class_cdc_acm_transmission_callback(UX_TRANSFER *transfer_request);
UINT _uxe_host_class_cdc_acm_command(UX_HOST_CLASS_CDC_ACM *cdc_acm, ULONG command,
ULONG value, UCHAR *data_buffer, ULONG data_length);
-UINT _uxe_host_class_cdc_acm_read (UX_HOST_CLASS_CDC_ACM *cdc_acm, UCHAR *data_pointer,
+UINT _uxe_host_class_cdc_acm_read (UX_HOST_CLASS_CDC_ACM *cdc_acm, UCHAR *data_pointer,
ULONG requested_length, ULONG *actual_length);
-UINT _uxe_host_class_cdc_acm_write(UX_HOST_CLASS_CDC_ACM *cdc_acm, UCHAR *data_pointer,
+UINT _uxe_host_class_cdc_acm_write(UX_HOST_CLASS_CDC_ACM *cdc_acm, UCHAR *data_pointer,
ULONG requested_length, ULONG *actual_length);
UINT _uxe_host_class_cdc_acm_ioctl(UX_HOST_CLASS_CDC_ACM *cdc_acm, ULONG request,
VOID *parameter);
-UINT _uxe_host_class_cdc_acm_reception_stop (UX_HOST_CLASS_CDC_ACM *cdc_acm,
+UINT _uxe_host_class_cdc_acm_reception_stop (UX_HOST_CLASS_CDC_ACM *cdc_acm,
UX_HOST_CLASS_CDC_ACM_RECEPTION *cdc_acm_reception);
-UINT _uxe_host_class_cdc_acm_reception_start (UX_HOST_CLASS_CDC_ACM *cdc_acm,
+UINT _uxe_host_class_cdc_acm_reception_start (UX_HOST_CLASS_CDC_ACM *cdc_acm,
UX_HOST_CLASS_CDC_ACM_RECEPTION *cdc_acm_reception);
-UINT _uxe_host_class_cdc_acm_write_with_callback(UX_HOST_CLASS_CDC_ACM *cdc_acm, UCHAR *data_pointer,
+UINT _uxe_host_class_cdc_acm_write_with_callback(UX_HOST_CLASS_CDC_ACM *cdc_acm, UCHAR *data_pointer,
ULONG requested_length);
@@ -418,10 +399,10 @@ UINT _uxe_host_class_cdc_acm_write_with_callback(UX_HOST_CLASS_CDC_ACM *cdc_acm
#endif
-/* Determine if a C++ compiler is being used. If so, complete the standard
- C conditional started above. */
+/* Determine if a C++ compiler is being used. If so, complete the standard
+ C conditional started above. */
#ifdef __cplusplus
-}
+}
#endif
#endif
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 9b75e1a6..4d92bed8 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
@@ -1,18 +1,19 @@
/***************************************************************************
- * Copyright (c) 2024 Microsoft Corporation
- *
+ * Copyright (c) 2024 Microsoft Corporation
+ * Copyright (c) 2026-present Eclipse ThreadX contributors
+ *
* This program and the accompanying materials are made available under the
* terms of the MIT License which is available at
* https://opensource.org/licenses/MIT.
- *
+ *
* SPDX-License-Identifier: MIT
**************************************************************************/
/**************************************************************************/
/**************************************************************************/
-/** */
-/** USBX Component */
+/** */
+/** USBX Component */
/** */
/** CDC ECM Class */
/** */
@@ -20,63 +21,35 @@
/**************************************************************************/
-/**************************************************************************/
-/* */
-/* COMPONENT DEFINITION RELEASE */
-/* */
-/* ux_host_class_cdc_ecm.h PORTABLE C */
+/**************************************************************************/
+/* */
+/* COMPONENT DEFINITION RELEASE */
+/* */
+/* ux_host_class_cdc_ecm.h PORTABLE C */
/* 6.3.0 */
/* AUTHOR */
/* */
/* Chaoqiong Xiao, Microsoft Corporation */
/* */
/* DESCRIPTION */
-/* */
+/* */
/* This file contains all the header and extern functions used by the */
-/* USBX CDC_ECM class. */
-/* */
-/* RELEASE HISTORY */
-/* */
-/* 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 */
-/* 02-02-2021 Xiuwen Cai Modified comment(s), added */
-/* compile option for using */
-/* packet pool from NetX, */
-/* resulting in version 6.1.4 */
-/* 08-02-2021 Chaoqiong Xiao Modified comment(s), */
-/* added extern "C" keyword */
-/* for compatibility with C++, */
-/* resulting in version 6.1.8 */
-/* 04-25-2022 Chaoqiong Xiao Modified comment(s), */
-/* fixed standalone compile, */
-/* resulting in version 6.1.11 */
-/* 10-31-2022 Chaoqiong Xiao Modified comment(s), */
-/* supported NX packet chain, */
-/* resulting in version 6.2.0 */
-/* 10-31-2023 Chaoqiong Xiao Modified comment(s), */
-/* optimized USB descriptors, */
-/* resulting in version 6.3.0 */
+/* USBX CDC_ECM class. */
/* */
/**************************************************************************/
#ifndef UX_HOST_CLASS_CDC_ECM_H
#define UX_HOST_CLASS_CDC_ECM_H
-/* Determine if a C++ compiler is being used. If so, ensure that standard
- C is used to process the API information. */
+/* Determine if a C++ compiler is being used. If so, ensure that standard
+ C is used to process the API information. */
-#ifdef __cplusplus
+#ifdef __cplusplus
-/* Yes, C++ compiler is present. Use standard C. */
-extern "C" {
+/* Yes, C++ compiler is present. Use standard C. */
+extern "C" {
-#endif
+#endif
#if !defined(UX_HOST_STANDALONE)
#include "nx_api.h"
@@ -89,7 +62,7 @@ extern "C" {
#endif
-/* Define CDC_ECM Class constants. Insert here the PID/VID of vendors and products using the CDC ECM chipset.
+/* Define CDC_ECM Class constants. Insert here the PID/VID of vendors and products using the CDC ECM chipset.
It is a better mechanism to put this value in the ux_user.h file. */
#ifndef UX_HOST_CLASS_CDC_ECM_VENDOR_ID
#define UX_HOST_CLASS_CDC_ECM_VENDOR_ID 0x0770
@@ -106,8 +79,8 @@ extern "C" {
#define UX_HOST_CLASS_CDC_ECM_MAC_ADDRESS_STRING_LENGTH 32
#define UX_HOST_CLASS_CDC_ECM_MAC_ADDRESS_ASCII_LENGTH 8
-#define UX_HOST_CLASS_CDC_ECM_SPEED_SELECTED_100MPBS 0x100
-#define UX_HOST_CLASS_CDC_ECM_SPEED_SELECTED_10MPBS 0x10
+#define UX_HOST_CLASS_CDC_ECM_SPEED_SELECTED_100MPBS 0x100
+#define UX_HOST_CLASS_CDC_ECM_SPEED_SELECTED_10MPBS 0x10
#define UX_HOST_CLASS_CDC_ECM_LINK_STATE_DOWN 0
#define UX_HOST_CLASS_CDC_ECM_LINK_STATE_UP 1
#define UX_HOST_CLASS_CDC_ECM_LINK_STATE_PENDING_UP 2
@@ -118,10 +91,10 @@ extern "C" {
#define UX_HOST_CLASS_CDC_ECM_ETHERNET_IP 0x0800
#define UX_HOST_CLASS_CDC_ECM_ETHERNET_ARP 0x0806
#define UX_HOST_CLASS_CDC_ECM_ETHERNET_RARP 0x8035
-#define UX_HOST_CLASS_CDC_ECM_ETHERNET_PACKET_SIZE 1536
+#define UX_HOST_CLASS_CDC_ECM_ETHERNET_PACKET_SIZE 1536
#define UX_HOST_CLASS_CDC_ECM_NX_ALIGN_PADDING 2
#ifndef UX_HOST_CLASS_CDC_ECM_NX_PKPOOL_ENTRIES
-#define UX_HOST_CLASS_CDC_ECM_NX_PKPOOL_ENTRIES 16
+#define UX_HOST_CLASS_CDC_ECM_NX_PKPOOL_ENTRIES 16
#endif
#define UX_HOST_CLASS_CDC_ECM_NX_PACKET_SIZE sizeof(NX_PACKET)
@@ -156,7 +129,7 @@ extern "C" {
#endif
#define UX_HOST_CLASS_CDC_ECM_ETHERNET_SIZE 14
-
+
#define UX_HOST_CLASS_CDC_ECM_DEVICE_INIT_DELAY (1 * UX_PERIODIC_RATE)
#define UX_HOST_CLASS_CDC_ECM_CLASS_TRANSFER_TIMEOUT 300000
#define UX_HOST_CLASS_CDC_ECM_SETUP_BUFFER_SIZE 16
@@ -220,7 +193,7 @@ extern "C" {
/* Define CDC_ECM Class packet equivalences. */
#define UX_HOST_CLASS_CDC_ECM_PACKET_SIZE 128
-#define UX_HOST_CLASS_CDC_ECM_NODE_ID_LENGTH 6
+#define UX_HOST_CLASS_CDC_ECM_NODE_ID_LENGTH 6
/* Define supported notification types. */
@@ -260,7 +233,7 @@ extern "C" {
typedef struct UX_HOST_CLASS_CDC_ECM_STRUCT
{
- struct UX_HOST_CLASS_CDC_ECM_STRUCT
+ struct UX_HOST_CLASS_CDC_ECM_STRUCT
*ux_host_class_cdc_ecm_next_instance;
UX_HOST_CLASS *ux_host_class_cdc_ecm_class;
UX_DEVICE *ux_host_class_cdc_ecm_device;
@@ -299,10 +272,10 @@ typedef struct UX_HOST_CLASS_CDC_ECM_STRUCT
#endif
UCHAR ux_host_class_cdc_ecm_node_id[UX_HOST_CLASS_CDC_ECM_NODE_ID_LENGTH];
- VOID (*ux_host_class_cdc_ecm_device_status_change_callback)(struct UX_HOST_CLASS_CDC_ECM_STRUCT *cdc_ecm,
+ VOID (*ux_host_class_cdc_ecm_device_status_change_callback)(struct UX_HOST_CLASS_CDC_ECM_STRUCT *cdc_ecm,
ULONG device_state);
VOID *ux_host_class_cdc_ecm_network_handle;
-
+
} UX_HOST_CLASS_CDC_ECM;
@@ -336,16 +309,16 @@ VOID _ux_host_class_cdc_ecm_thread(ULONG parameter);
VOID _ux_host_class_cdc_ecm_transmission_callback(UX_TRANSFER *transfer_request);
VOID _ux_host_class_cdc_ecm_transmit_queue_clean(UX_HOST_CLASS_CDC_ECM *cdc_ecm_control);
UINT _ux_host_class_cdc_ecm_mac_address_get(UX_HOST_CLASS_CDC_ECM *cdc_ecm);
-
+
/* Define CDC ECM Class API prototypes. */
#define ux_host_class_cdc_ecm_entry _ux_host_class_cdc_ecm_entry
#define ux_host_class_cdc_ecm_write _ux_host_class_cdc_ecm_write
-/* Determine if a C++ compiler is being used. If so, complete the standard
- C conditional started above. */
+/* Determine if a C++ compiler is being used. If so, complete the standard
+ C conditional started above. */
#ifdef __cplusplus
-}
-#endif
+}
+#endif
#endif
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 b83d61d0..9332dbfe 100644
--- a/common/usbx_host_classes/inc/ux_host_class_gser.h
+++ b/common/usbx_host_classes/inc/ux_host_class_gser.h
@@ -1,18 +1,19 @@
/***************************************************************************
- * Copyright (c) 2024 Microsoft Corporation
- *
+ * Copyright (c) 2024 Microsoft Corporation
+ * Copyright (c) 2026-present Eclipse ThreadX contributors
+ *
* This program and the accompanying materials are made available under the
* terms of the MIT License which is available at
* https://opensource.org/licenses/MIT.
- *
+ *
* SPDX-License-Identifier: MIT
**************************************************************************/
/**************************************************************************/
/**************************************************************************/
-/** */
-/** USBX Component */
+/** */
+/** USBX Component */
/** */
/** Generic Serial Host module class */
/** */
@@ -20,50 +21,35 @@
/**************************************************************************/
-/**************************************************************************/
-/* */
-/* COMPONENT DEFINITION RELEASE */
-/* */
-/* ux_host_class_gser.h PORTABLE C */
+/**************************************************************************/
+/* */
+/* COMPONENT DEFINITION RELEASE */
+/* */
+/* ux_host_class_gser.h PORTABLE C */
/* 6.1.8 */
/* AUTHOR */
/* */
/* Chaoqiong Xiao, Microsoft Corporation */
/* */
/* DESCRIPTION */
-/* */
+/* */
/* This file contains all the header and extern functions used by the */
-/* USBX Generic Serial Class. */
-/* */
-/* RELEASE HISTORY */
-/* */
-/* 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 */
-/* 08-02-2021 Wen Wang Modified comment(s), */
-/* added extern "C" keyword */
-/* for compatibility with C++, */
-/* resulting in version 6.1.8 */
+/* USBX Generic Serial Class. */
/* */
/**************************************************************************/
#ifndef UX_HOST_CLASS_GSER_H
#define UX_HOST_CLASS_GSER_H
-/* Determine if a C++ compiler is being used. If so, ensure that standard
- C is used to process the API information. */
+/* Determine if a C++ compiler is being used. If so, ensure that standard
+ C is used to process the API information. */
-#ifdef __cplusplus
+#ifdef __cplusplus
-/* Yes, C++ compiler is present. Use standard C. */
-extern "C" {
+/* Yes, C++ compiler is present. Use standard C. */
+extern "C" {
-#endif
+#endif
/* Internal option: enable the basic USBX error checking. This define is typically used
@@ -78,7 +64,7 @@ extern "C" {
#define UX_HOST_CLASS_GSER_CLASS_TRANSFER_TIMEOUT 300000
#ifndef UX_HOST_CLASS_GSER_VENDOR_ID
#define UX_HOST_CLASS_GSER_VENDOR_ID 0X05C6
-#define UX_HOST_CLASS_GSER_PRODUCT_ID 0X9002
+#define UX_HOST_CLASS_GSER_PRODUCT_ID 0X9002
#endif
/* Define serial interfaces equivalences. */
@@ -105,7 +91,7 @@ extern "C" {
#define UX_HOST_CLASS_GSER_REQ_SET_LINE_STATE 0x22
#define UX_HOST_CLASS_GSER_REQ_SEND_BREAK 0x23
#define UX_HOST_CLASS_GSER_REQ_SET_RINGER_PARMS 0x30
-#define UX_HOST_CLASS_GSER_REQ_GET_RINGER_PARMS 0x31
+#define UX_HOST_CLASS_GSER_REQ_GET_RINGER_PARMS 0x31
#define UX_HOST_CLASS_GSER_REQ_SET_OPERATION_PARMS 0x32
#define UX_HOST_CLASS_GSER_REQ_GET_OPERATION_PARMS 0x33
#define UX_HOST_CLASS_GSER_REQ_SET_LINE_PARMS 0x34
@@ -196,7 +182,7 @@ typedef struct UX_HOST_CLASS_GSER_STRUCT
UINT ux_host_class_gser_state;
struct UX_HOST_CLASS_GSER_INTERFACE_STRUCT ux_host_class_gser_interface_array[UX_HOST_CLASS_GSER_INTERFACE_NUMBER];
ULONG ux_host_class_gser_device_state;
- VOID (*ux_host_class_gser_device_status_change_callback)(struct UX_HOST_CLASS_GSER_STRUCT *gser,
+ VOID (*ux_host_class_gser_device_status_change_callback)(struct UX_HOST_CLASS_GSER_STRUCT *gser,
ULONG notification_type, ULONG notification_value);
} UX_HOST_CLASS_GSER;
@@ -213,9 +199,9 @@ typedef struct UX_HOST_CLASS_GSER_RECEPTION_STRUCT
ULONG ux_host_class_gser_reception_data_buffer_size;
UCHAR *ux_host_class_gser_reception_data_head;
UCHAR *ux_host_class_gser_reception_data_tail;
- VOID (*ux_host_class_gser_reception_callback)(struct UX_HOST_CLASS_GSER_STRUCT *gser,
+ VOID (*ux_host_class_gser_reception_callback)(struct UX_HOST_CLASS_GSER_STRUCT *gser,
UINT status,
- UCHAR *reception_buffer,
+ UCHAR *reception_buffer,
ULONG reception_size);
} UX_HOST_CLASS_GSER_RECEPTION;
@@ -260,32 +246,32 @@ UINT _ux_host_class_gser_configure(UX_HOST_CLASS_GSER *gser);
UINT _ux_host_class_gser_deactivate(UX_HOST_CLASS_COMMAND *command);
UINT _ux_host_class_gser_endpoints_get(UX_HOST_CLASS_GSER *gser);
UINT _ux_host_class_gser_entry(UX_HOST_CLASS_COMMAND *command);
-UINT _ux_host_class_gser_read (UX_HOST_CLASS_GSER *gser, ULONG interface_index,UCHAR *data_pointer,
+UINT _ux_host_class_gser_read (UX_HOST_CLASS_GSER *gser, ULONG interface_index,UCHAR *data_pointer,
ULONG requested_length, ULONG *actual_length);
-UINT _ux_host_class_gser_write(UX_HOST_CLASS_GSER *gser, ULONG interface_index,UCHAR *data_pointer,
+UINT _ux_host_class_gser_write(UX_HOST_CLASS_GSER *gser, ULONG interface_index,UCHAR *data_pointer,
ULONG requested_length, ULONG *actual_length);
UINT _ux_host_class_gser_command(UX_HOST_CLASS_GSER *gser, ULONG interface_index, ULONG command,
ULONG value, UCHAR *data_buffer, ULONG data_length);
UINT _ux_host_class_gser_ioctl(UX_HOST_CLASS_GSER *gser, ULONG interface_index, ULONG ioctl_function,
VOID *parameter);
VOID _ux_host_class_gser_reception_callback (UX_TRANSFER *transfer_request);
-UINT _ux_host_class_gser_reception_stop (UX_HOST_CLASS_GSER *gser,
+UINT _ux_host_class_gser_reception_stop (UX_HOST_CLASS_GSER *gser,
UX_HOST_CLASS_GSER_RECEPTION *gser_reception);
-UINT _ux_host_class_gser_reception_start (UX_HOST_CLASS_GSER *gser,
+UINT _ux_host_class_gser_reception_start (UX_HOST_CLASS_GSER *gser,
UX_HOST_CLASS_GSER_RECEPTION *gser_reception);
-UINT _uxe_host_class_gser_read (UX_HOST_CLASS_GSER *gser, ULONG interface_index,UCHAR *data_pointer,
+UINT _uxe_host_class_gser_read (UX_HOST_CLASS_GSER *gser, ULONG interface_index,UCHAR *data_pointer,
ULONG requested_length, ULONG *actual_length);
-UINT _uxe_host_class_gser_write(UX_HOST_CLASS_GSER *gser, ULONG interface_index,UCHAR *data_pointer,
+UINT _uxe_host_class_gser_write(UX_HOST_CLASS_GSER *gser, ULONG interface_index,UCHAR *data_pointer,
ULONG requested_length, ULONG *actual_length);
UINT _uxe_host_class_gser_command(UX_HOST_CLASS_GSER *gser, ULONG interface_index, ULONG command,
ULONG value, UCHAR *data_buffer, ULONG data_length);
UINT _uxe_host_class_gser_ioctl(UX_HOST_CLASS_GSER *gser, ULONG interface_index, ULONG ioctl_function,
VOID *parameter);
-UINT _uxe_host_class_gser_reception_stop (UX_HOST_CLASS_GSER *gser,
+UINT _uxe_host_class_gser_reception_stop (UX_HOST_CLASS_GSER *gser,
UX_HOST_CLASS_GSER_RECEPTION *gser_reception);
-UINT _uxe_host_class_gser_reception_start (UX_HOST_CLASS_GSER *gser,
+UINT _uxe_host_class_gser_reception_start (UX_HOST_CLASS_GSER *gser,
UX_HOST_CLASS_GSER_RECEPTION *gser_reception);
@@ -311,10 +297,10 @@ UINT _uxe_host_class_gser_reception_start (UX_HOST_CLASS_GSER *gser,
#endif
-/* Determine if a C++ compiler is being used. If so, complete the standard
- C conditional started above. */
+/* Determine if a C++ compiler is being used. If so, complete the standard
+ C conditional started above. */
#ifdef __cplusplus
-}
-#endif
+}
+#endif
#endif
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 53a8efbe..94cf2611 100644
--- a/common/usbx_host_classes/inc/ux_host_class_hid.h
+++ b/common/usbx_host_classes/inc/ux_host_class_hid.h
@@ -1,77 +1,55 @@
/***************************************************************************
- * Copyright (c) 2024 Microsoft Corporation
- *
+ * Copyright (c) 2024 Microsoft Corporation
+ * Copyright (c) 2026-present Eclipse ThreadX contributors
+ *
* This program and the accompanying materials are made available under the
* terms of the MIT License which is available at
* https://opensource.org/licenses/MIT.
- *
+ *
* SPDX-License-Identifier: MIT
**************************************************************************/
/**************************************************************************/
/**************************************************************************/
-/** */
-/** USBX Component */
/** */
-/** HID Class */
+/** USBX Component */
+/** */
+/** Host HID Class */
/** */
/**************************************************************************/
/**************************************************************************/
-/**************************************************************************/
-/* */
-/* COMPONENT DEFINITION RELEASE */
-/* */
-/* ux_host_class_hid.h PORTABLE C */
+/**************************************************************************/
+/* */
+/* COMPONENT DEFINITION RELEASE */
+/* */
+/* ux_host_class_hid.h PORTABLE C */
/* 6.3.0 */
/* AUTHOR */
/* */
/* Chaoqiong Xiao, Microsoft Corporation */
/* */
/* DESCRIPTION */
-/* */
+/* */
/* This file contains all the header and extern functions used by the */
-/* USBX HID class. */
-/* */
-/* RELEASE HISTORY */
-/* */
-/* 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, fixed struct */
-/* field definition issues, */
-/* resulting in version 6.1 */
-/* 08-02-2021 Wen Wang Modified comment(s), */
-/* added extern "C" keyword */
-/* for compatibility with C++, */
-/* resulting in version 6.1.8 */
-/* 01-31-2022 Xiuwen Cai, CQ Xiao Modified comment(s), */
-/* added interrupt OUT support,*/
-/* added standalone mode, */
-/* resulting in version 6.1.10 */
-/* 10-31-2023 Chaoqiong Xiao Modified comment(s), */
-/* optimized USB descriptors, */
-/* resulting in version 6.3.0 */
+/* USBX HID class. */
/* */
/**************************************************************************/
#ifndef UX_HOST_CLASS_HID_H
#define UX_HOST_CLASS_HID_H
-/* Determine if a C++ compiler is being used. If so, ensure that standard
- C is used to process the API information. */
+/* Determine if a C++ compiler is being used. If so, ensure that standard
+ C is used to process the API information. */
-#ifdef __cplusplus
+#ifdef __cplusplus
-/* Yes, C++ compiler is present. Use standard C. */
-extern "C" {
+/* Yes, C++ compiler is present. Use standard C. */
+extern "C" {
-#endif
+#endif
/* Internal option: enable the basic USBX error checking. This define is typically used
@@ -112,7 +90,7 @@ extern "C" {
#define UX_HOST_CLASS_HID_TYPE_GLOBAL 0x1
#define UX_HOST_CLASS_HID_TYPE_LOCAL 0x2
#define UX_HOST_CLASS_HID_TYPE_RESERVED 0x3
-
+
/* Define HID Class main tags. */
@@ -121,7 +99,7 @@ extern "C" {
#define UX_HOST_CLASS_HID_MAIN_TAG_FEATURE 0xb
#define UX_HOST_CLASS_HID_MAIN_TAG_COLLECTION 0xa
#define UX_HOST_CLASS_HID_MAIN_TAG_END_COLLECTION 0xc
-
+
/* Define HID Class global tags. */
@@ -181,10 +159,10 @@ extern "C" {
/* Define HID Class commands. */
-#define UX_HOST_CLASS_HID_GET_REPORT 0x01
+#define UX_HOST_CLASS_HID_GET_REPORT 0x01
#define UX_HOST_CLASS_HID_GET_IDLE 0x02
#define UX_HOST_CLASS_HID_GET_PROTOCOL 0x03
-#define UX_HOST_CLASS_HID_SET_REPORT 0x09
+#define UX_HOST_CLASS_HID_SET_REPORT 0x09
#define UX_HOST_CLASS_HID_SET_IDLE 0x0A
#define UX_HOST_CLASS_HID_SET_PROTOCOL 0x0B
@@ -202,133 +180,133 @@ extern "C" {
/* Define HID Class page constants. */
-#define UX_HOST_CLASS_HID_PAGE_GENERIC_DESKTOP_CONTROLS 0x01
-#define UX_HOST_CLASS_HID_PAGE_SIMULATION_CONTROLS 0x02
-#define UX_HOST_CLASS_HID_PAGE_VR_CONTROLS 0x03
-#define UX_HOST_CLASS_HID_PAGE_SPORT_CONTROLS 0x04
-#define UX_HOST_CLASS_HID_PAGE_GAME_CONTROLS 0x05
-#define UX_HOST_CLASS_HID_PAGE_GENERIC_DEVICE_CONTROLS 0x06
-#define UX_HOST_CLASS_HID_PAGE_KEYBOARD_KEYPAD 0x07
-#define UX_HOST_CLASS_HID_PAGE_LEDS 0x08
-#define UX_HOST_CLASS_HID_PAGE_BUTTON 0x09
-#define UX_HOST_CLASS_HID_PAGE_ORDINAL 0x0A
-#define UX_HOST_CLASS_HID_PAGE_TELEPHONY 0x0B
-#define UX_HOST_CLASS_HID_PAGE_CONSUMER 0x0C
-#define UX_HOST_CLASS_HID_PAGE_DIGITIZER 0x0D
-#define UX_HOST_CLASS_HID_PAGE_PHYSICAL_INTERFACE_DEVICE 0x0F
-#define UX_HOST_CLASS_HID_PAGE_UNICODE 0x10
-#define UX_HOST_CLASS_HID_PAGE_ALPHANUMERIC_DISPLAY 0x14
-#define UX_HOST_CLASS_HID_PAGE_MEDICAL_INSTRUMENTS 0x40
-#define UX_HOST_CLASS_HID_PAGE_BAR_CODE_SCANNER 0x8C
-#define UX_HOST_CLASS_HID_PAGE_SCALE_PAGE 0x8D
-#define UX_HOST_CLASS_HID_PAGE_MAGNETIC_STRIPE_READING 0x8E
-#define UX_HOST_CLASS_HID_PAGE_CAMERA_CONTROL_PAGE 0x90
+#define UX_HOST_CLASS_HID_PAGE_GENERIC_DESKTOP_CONTROLS 0x01
+#define UX_HOST_CLASS_HID_PAGE_SIMULATION_CONTROLS 0x02
+#define UX_HOST_CLASS_HID_PAGE_VR_CONTROLS 0x03
+#define UX_HOST_CLASS_HID_PAGE_SPORT_CONTROLS 0x04
+#define UX_HOST_CLASS_HID_PAGE_GAME_CONTROLS 0x05
+#define UX_HOST_CLASS_HID_PAGE_GENERIC_DEVICE_CONTROLS 0x06
+#define UX_HOST_CLASS_HID_PAGE_KEYBOARD_KEYPAD 0x07
+#define UX_HOST_CLASS_HID_PAGE_LEDS 0x08
+#define UX_HOST_CLASS_HID_PAGE_BUTTON 0x09
+#define UX_HOST_CLASS_HID_PAGE_ORDINAL 0x0A
+#define UX_HOST_CLASS_HID_PAGE_TELEPHONY 0x0B
+#define UX_HOST_CLASS_HID_PAGE_CONSUMER 0x0C
+#define UX_HOST_CLASS_HID_PAGE_DIGITIZER 0x0D
+#define UX_HOST_CLASS_HID_PAGE_PHYSICAL_INTERFACE_DEVICE 0x0F
+#define UX_HOST_CLASS_HID_PAGE_UNICODE 0x10
+#define UX_HOST_CLASS_HID_PAGE_ALPHANUMERIC_DISPLAY 0x14
+#define UX_HOST_CLASS_HID_PAGE_MEDICAL_INSTRUMENTS 0x40
+#define UX_HOST_CLASS_HID_PAGE_BAR_CODE_SCANNER 0x8C
+#define UX_HOST_CLASS_HID_PAGE_SCALE_PAGE 0x8D
+#define UX_HOST_CLASS_HID_PAGE_MAGNETIC_STRIPE_READING 0x8E
+#define UX_HOST_CLASS_HID_PAGE_CAMERA_CONTROL_PAGE 0x90
/* Define HID Class generic desktop page constants. */
-#define UX_HOST_CLASS_HID_GENERIC_DESKTOP_UNDEFINED 0x00
-#define UX_HOST_CLASS_HID_GENERIC_DESKTOP_POINTER 0x01
-#define UX_HOST_CLASS_HID_GENERIC_DESKTOP_MOUSE 0x02
-#define UX_HOST_CLASS_HID_GENERIC_DESKTOP_RESERVED 0x03
-#define UX_HOST_CLASS_HID_GENERIC_DESKTOP_JOYSTICK 0x04
-#define UX_HOST_CLASS_HID_GENERIC_DESKTOP_GAME PAD 0x05
-#define UX_HOST_CLASS_HID_GENERIC_DESKTOP_KEYBOARD 0x06
-#define UX_HOST_CLASS_HID_GENERIC_DESKTOP_KEYPAD 0x07
-#define UX_HOST_CLASS_HID_GENERIC_DESKTOP_MULTI_AXIS_CONTROLLER 0x08
-#define UX_HOST_CLASS_HID_GENERIC_DESKTOP_X 0x30
-#define UX_HOST_CLASS_HID_GENERIC_DESKTOP_Y 0x31
-#define UX_HOST_CLASS_HID_GENERIC_DESKTOP_Z 0x32
-#define UX_HOST_CLASS_HID_GENERIC_DESKTOP_RX 0x33
-#define UX_HOST_CLASS_HID_GENERIC_DESKTOP_RY 0x34
-#define UX_HOST_CLASS_HID_GENERIC_DESKTOP_RZ 0x35
-#define UX_HOST_CLASS_HID_GENERIC_DESKTOP_SLIDER 0x36
-#define UX_HOST_CLASS_HID_GENERIC_DESKTOP_DIAL 0x37
-#define UX_HOST_CLASS_HID_GENERIC_DESKTOP_WHEEL 0x38
-#define UX_HOST_CLASS_HID_GENERIC_DESKTOP_HAT_SWITCH 0x39
-#define UX_HOST_CLASS_HID_GENERIC_DESKTOP_COUNTED_BUFFER 0x3A
-#define UX_HOST_CLASS_HID_GENERIC_DESKTOP_BYTE_COUNT 0x3B
-#define UX_HOST_CLASS_HID_GENERIC_DESKTOP_MOTION_WAKEUP 0x3C
-#define UX_HOST_CLASS_HID_GENERIC_DESKTOP_START 0x3D
-#define UX_HOST_CLASS_HID_GENERIC_DESKTOP_SELECT 0x3E
-#define UX_HOST_CLASS_HID_GENERIC_DESKTOP_VX 0x40
-#define UX_HOST_CLASS_HID_GENERIC_DESKTOP_VY 0x41
-#define UX_HOST_CLASS_HID_GENERIC_DESKTOP_VZ 0x42
-#define UX_HOST_CLASS_HID_GENERIC_DESKTOP_VBRX 0x43
-#define UX_HOST_CLASS_HID_GENERIC_DESKTOP_VBRY 0x44
-#define UX_HOST_CLASS_HID_GENERIC_DESKTOP_VBRZ 0x45
-#define UX_HOST_CLASS_HID_GENERIC_DESKTOP_VNO 0x46
-#define UX_HOST_CLASS_HID_GENERIC_DESKTOP_FEATURE_NOTIFICATION 0x47
-#define UX_HOST_CLASS_HID_GENERIC_DESKTOP_SYSTEM_CONTROL 0x80
-#define UX_HOST_CLASS_HID_GENERIC_DESKTOP_SYSTEM_POWER_DOWN 0x81
-#define UX_HOST_CLASS_HID_GENERIC_DESKTOP_SYSTEM_SLEEP 0x82
-#define UX_HOST_CLASS_HID_GENERIC_DESKTOP_SYSTEM_WAKE_UP 0x83
-#define UX_HOST_CLASS_HID_GENERIC_DESKTOP_SYSTEM_CONTEXT_MENU 0x84
-#define UX_HOST_CLASS_HID_GENERIC_DESKTOP_SYSTEM_MAIN_MENU 0x85
-#define UX_HOST_CLASS_HID_GENERIC_DESKTOP_SYSTEM_APP_MENU 0x86
-#define UX_HOST_CLASS_HID_GENERIC_DESKTOP_SYSTEM_MENU_HELP 0x87
-#define UX_HOST_CLASS_HID_GENERIC_DESKTOP_SYSTEM_MENU_EXIT 0x88
-#define UX_HOST_CLASS_HID_GENERIC_DESKTOP_SYSTEM_MENU_SELECT 0x89
-#define UX_HOST_CLASS_HID_GENERIC_DESKTOP_SYSTEM_MENU_RIGHT 0x8A
-#define UX_HOST_CLASS_HID_GENERIC_DESKTOP_SYSTEM_MENU_LEFT 0x8B
-#define UX_HOST_CLASS_HID_GENERIC_DESKTOP_SYSTEM_MENU_UP 0x8C
-#define UX_HOST_CLASS_HID_GENERIC_DESKTOP_SYSTEM_MENU_DOWN 0x8D
-#define UX_HOST_CLASS_HID_GENERIC_DESKTOP_SYSTEM_COLD_RESTART 0x8E
-#define UX_HOST_CLASS_HID_GENERIC_DESKTOP_SYSTEM_WARM_RESTART 0x8F
-#define UX_HOST_CLASS_HID_GENERIC_DESKTOP_D_PAD_UP 0x90
-#define UX_HOST_CLASS_HID_GENERIC_DESKTOP_D_PAD_DOWN 0x91
-#define UX_HOST_CLASS_HID_GENERIC_DESKTOP_D_PAD_RIGHT 0x92
-#define UX_HOST_CLASS_HID_GENERIC_DESKTOP_D_PAD_LEFT 0x93
-#define UX_HOST_CLASS_HID_GENERIC_DESKTOP_SYSTEM_DOCK 0xA0
-#define UX_HOST_CLASS_HID_GENERIC_DESKTOP_SYSTEM_UNDOCK 0xA1
-#define UX_HOST_CLASS_HID_GENERIC_DESKTOP_SYSTEM_SETUP 0xA2
-#define UX_HOST_CLASS_HID_GENERIC_DESKTOP_SYSTEM_BREAK 0xA3
-#define UX_HOST_CLASS_HID_GENERIC_DESKTOP_SYSTEM_DEBUGGER_BREAK 0xA4
-#define UX_HOST_CLASS_HID_GENERIC_DESKTOP_APPLICAION_BREAK 0xA5
-#define UX_HOST_CLASS_HID_GENERIC_DESKTOP_APPLICATION_DEBUGGER_BREAK 0xA6
-#define UX_HOST_CLASS_HID_GENERIC_DESKTOP_SYSTEM_SPEAKER_MUTE 0xA7
-#define UX_HOST_CLASS_HID_GENERIC_DESKTOP_SYSTEM_HIBERNATE 0xA8
-#define UX_HOST_CLASS_HID_GENERIC_DESKTOP_SYSTEM_DISPLAY_INVERT 0xB0
-#define UX_HOST_CLASS_HID_GENERIC_DESKTOP_SYSTEM_DISPLAY_INTERNAL 0xB1
-#define UX_HOST_CLASS_HID_GENERIC_DESKTOP_SYSTEM_DISPLAY_EXTERNAL 0xB2
-#define UX_HOST_CLASS_HID_GENERIC_DESKTOP_SYSTEM_DISPLAY_BOTH 0xB3
-#define UX_HOST_CLASS_HID_GENERIC_DESKTOP_SYSTEM_DISPLAY_DUAL 0xB4
-#define UX_HOST_CLASS_HID_GENERIC_DESKTOP_SYSTEM_DISPLAY_TOGGLE 0xB5
-#define UX_HOST_CLASS_HID_GENERIC_DESKTOP_SYSTEM_DISPLAY_SWAP 0xB6
-#define UX_HOST_CLASS_HID_GENERIC_DESKTOP_SYSTEM_DISPLAY_LCD_AUTOSCALE 0xB7
+#define UX_HOST_CLASS_HID_GENERIC_DESKTOP_UNDEFINED 0x00
+#define UX_HOST_CLASS_HID_GENERIC_DESKTOP_POINTER 0x01
+#define UX_HOST_CLASS_HID_GENERIC_DESKTOP_MOUSE 0x02
+#define UX_HOST_CLASS_HID_GENERIC_DESKTOP_RESERVED 0x03
+#define UX_HOST_CLASS_HID_GENERIC_DESKTOP_JOYSTICK 0x04
+#define UX_HOST_CLASS_HID_GENERIC_DESKTOP_GAME PAD 0x05
+#define UX_HOST_CLASS_HID_GENERIC_DESKTOP_KEYBOARD 0x06
+#define UX_HOST_CLASS_HID_GENERIC_DESKTOP_KEYPAD 0x07
+#define UX_HOST_CLASS_HID_GENERIC_DESKTOP_MULTI_AXIS_CONTROLLER 0x08
+#define UX_HOST_CLASS_HID_GENERIC_DESKTOP_X 0x30
+#define UX_HOST_CLASS_HID_GENERIC_DESKTOP_Y 0x31
+#define UX_HOST_CLASS_HID_GENERIC_DESKTOP_Z 0x32
+#define UX_HOST_CLASS_HID_GENERIC_DESKTOP_RX 0x33
+#define UX_HOST_CLASS_HID_GENERIC_DESKTOP_RY 0x34
+#define UX_HOST_CLASS_HID_GENERIC_DESKTOP_RZ 0x35
+#define UX_HOST_CLASS_HID_GENERIC_DESKTOP_SLIDER 0x36
+#define UX_HOST_CLASS_HID_GENERIC_DESKTOP_DIAL 0x37
+#define UX_HOST_CLASS_HID_GENERIC_DESKTOP_WHEEL 0x38
+#define UX_HOST_CLASS_HID_GENERIC_DESKTOP_HAT_SWITCH 0x39
+#define UX_HOST_CLASS_HID_GENERIC_DESKTOP_COUNTED_BUFFER 0x3A
+#define UX_HOST_CLASS_HID_GENERIC_DESKTOP_BYTE_COUNT 0x3B
+#define UX_HOST_CLASS_HID_GENERIC_DESKTOP_MOTION_WAKEUP 0x3C
+#define UX_HOST_CLASS_HID_GENERIC_DESKTOP_START 0x3D
+#define UX_HOST_CLASS_HID_GENERIC_DESKTOP_SELECT 0x3E
+#define UX_HOST_CLASS_HID_GENERIC_DESKTOP_VX 0x40
+#define UX_HOST_CLASS_HID_GENERIC_DESKTOP_VY 0x41
+#define UX_HOST_CLASS_HID_GENERIC_DESKTOP_VZ 0x42
+#define UX_HOST_CLASS_HID_GENERIC_DESKTOP_VBRX 0x43
+#define UX_HOST_CLASS_HID_GENERIC_DESKTOP_VBRY 0x44
+#define UX_HOST_CLASS_HID_GENERIC_DESKTOP_VBRZ 0x45
+#define UX_HOST_CLASS_HID_GENERIC_DESKTOP_VNO 0x46
+#define UX_HOST_CLASS_HID_GENERIC_DESKTOP_FEATURE_NOTIFICATION 0x47
+#define UX_HOST_CLASS_HID_GENERIC_DESKTOP_SYSTEM_CONTROL 0x80
+#define UX_HOST_CLASS_HID_GENERIC_DESKTOP_SYSTEM_POWER_DOWN 0x81
+#define UX_HOST_CLASS_HID_GENERIC_DESKTOP_SYSTEM_SLEEP 0x82
+#define UX_HOST_CLASS_HID_GENERIC_DESKTOP_SYSTEM_WAKE_UP 0x83
+#define UX_HOST_CLASS_HID_GENERIC_DESKTOP_SYSTEM_CONTEXT_MENU 0x84
+#define UX_HOST_CLASS_HID_GENERIC_DESKTOP_SYSTEM_MAIN_MENU 0x85
+#define UX_HOST_CLASS_HID_GENERIC_DESKTOP_SYSTEM_APP_MENU 0x86
+#define UX_HOST_CLASS_HID_GENERIC_DESKTOP_SYSTEM_MENU_HELP 0x87
+#define UX_HOST_CLASS_HID_GENERIC_DESKTOP_SYSTEM_MENU_EXIT 0x88
+#define UX_HOST_CLASS_HID_GENERIC_DESKTOP_SYSTEM_MENU_SELECT 0x89
+#define UX_HOST_CLASS_HID_GENERIC_DESKTOP_SYSTEM_MENU_RIGHT 0x8A
+#define UX_HOST_CLASS_HID_GENERIC_DESKTOP_SYSTEM_MENU_LEFT 0x8B
+#define UX_HOST_CLASS_HID_GENERIC_DESKTOP_SYSTEM_MENU_UP 0x8C
+#define UX_HOST_CLASS_HID_GENERIC_DESKTOP_SYSTEM_MENU_DOWN 0x8D
+#define UX_HOST_CLASS_HID_GENERIC_DESKTOP_SYSTEM_COLD_RESTART 0x8E
+#define UX_HOST_CLASS_HID_GENERIC_DESKTOP_SYSTEM_WARM_RESTART 0x8F
+#define UX_HOST_CLASS_HID_GENERIC_DESKTOP_D_PAD_UP 0x90
+#define UX_HOST_CLASS_HID_GENERIC_DESKTOP_D_PAD_DOWN 0x91
+#define UX_HOST_CLASS_HID_GENERIC_DESKTOP_D_PAD_RIGHT 0x92
+#define UX_HOST_CLASS_HID_GENERIC_DESKTOP_D_PAD_LEFT 0x93
+#define UX_HOST_CLASS_HID_GENERIC_DESKTOP_SYSTEM_DOCK 0xA0
+#define UX_HOST_CLASS_HID_GENERIC_DESKTOP_SYSTEM_UNDOCK 0xA1
+#define UX_HOST_CLASS_HID_GENERIC_DESKTOP_SYSTEM_SETUP 0xA2
+#define UX_HOST_CLASS_HID_GENERIC_DESKTOP_SYSTEM_BREAK 0xA3
+#define UX_HOST_CLASS_HID_GENERIC_DESKTOP_SYSTEM_DEBUGGER_BREAK 0xA4
+#define UX_HOST_CLASS_HID_GENERIC_DESKTOP_APPLICAION_BREAK 0xA5
+#define UX_HOST_CLASS_HID_GENERIC_DESKTOP_APPLICATION_DEBUGGER_BREAK 0xA6
+#define UX_HOST_CLASS_HID_GENERIC_DESKTOP_SYSTEM_SPEAKER_MUTE 0xA7
+#define UX_HOST_CLASS_HID_GENERIC_DESKTOP_SYSTEM_HIBERNATE 0xA8
+#define UX_HOST_CLASS_HID_GENERIC_DESKTOP_SYSTEM_DISPLAY_INVERT 0xB0
+#define UX_HOST_CLASS_HID_GENERIC_DESKTOP_SYSTEM_DISPLAY_INTERNAL 0xB1
+#define UX_HOST_CLASS_HID_GENERIC_DESKTOP_SYSTEM_DISPLAY_EXTERNAL 0xB2
+#define UX_HOST_CLASS_HID_GENERIC_DESKTOP_SYSTEM_DISPLAY_BOTH 0xB3
+#define UX_HOST_CLASS_HID_GENERIC_DESKTOP_SYSTEM_DISPLAY_DUAL 0xB4
+#define UX_HOST_CLASS_HID_GENERIC_DESKTOP_SYSTEM_DISPLAY_TOGGLE 0xB5
+#define UX_HOST_CLASS_HID_GENERIC_DESKTOP_SYSTEM_DISPLAY_SWAP 0xB6
+#define UX_HOST_CLASS_HID_GENERIC_DESKTOP_SYSTEM_DISPLAY_LCD_AUTOSCALE 0xB7
/* Define HID Class game control page constants. */
-#define UX_HOST_CLASS_HID_GAME_CONTROL_UNDEFINED 0x00
-#define UX_HOST_CLASS_HID_GAME_CONTROL_3D_GAME_CONTROLLER 0x01
-#define UX_HOST_CLASS_HID_GAME_CONTROL_PINBALL_DEVICE 0x02
-#define UX_HOST_CLASS_HID_GAME_CONTROL_GUN_DEVICE 0x03
-#define UX_HOST_CLASS_HID_GAME_CONTROL_POINT_OF_VIEW 0x20
-#define UX_HOST_CLASS_HID_GAME_CONTROL_TURN_RIGHT_LEFT 0x21
-#define UX_HOST_CLASS_HID_GAME_CONTROL_PITCH_FORWARD_BACKWARD 0x22
-#define UX_HOST_CLASS_HID_GAME_CONTROL_ROLL_RIGHT_LEFT 0x23
-#define UX_HOST_CLASS_HID_GAME_CONTROL_MOVE_RIGHT_LEFT 0x24
-#define UX_HOST_CLASS_HID_GAME_CONTROL_MOVE_FORWARD_BACKWARD 0x25
-#define UX_HOST_CLASS_HID_GAME_CONTROL_MOVE_UP_DOWN 0x26
-#define UX_HOST_CLASS_HID_GAME_CONTROL_LEAN_RIGHT_LEFT 0x27
-#define UX_HOST_CLASS_HID_GAME_CONTROL_LEAN_FORWARD_BACKWARD 0x28
-#define UX_HOST_CLASS_HID_GAME_CONTROL_HEIGHT_OF_POV 0x29
-#define UX_HOST_CLASS_HID_GAME_CONTROL_FLIPPER 0x2A
-#define UX_HOST_CLASS_HID_GAME_CONTROL_SECONDARY_FLIPPER 0x2B
-#define UX_HOST_CLASS_HID_GAME_CONTROL_BUMP 0x2C
-#define UX_HOST_CLASS_HID_GAME_CONTROL_NEW_GAME 0x2D
-#define UX_HOST_CLASS_HID_GAME_CONTROL_SHOOT_BALL 0x2E
-#define UX_HOST_CLASS_HID_GAME_CONTROL_PLAYER 0x2F
-#define UX_HOST_CLASS_HID_GAME_CONTROL_GUN_BOLT 0x30
-#define UX_HOST_CLASS_HID_GAME_CONTROL_GUN_CLIP 0x31
-#define UX_HOST_CLASS_HID_GAME_CONTROL_GUN_SELECTOR 0x32
-#define UX_HOST_CLASS_HID_GAME_CONTROL_GUN_SINGLE_SHOT 0x33
-#define UX_HOST_CLASS_HID_GAME_CONTROL_GUN_BURST 0x34
-#define UX_HOST_CLASS_HID_GAME_CONTROL_GUN_AUTOMATIC 0x35
-#define UX_HOST_CLASS_HID_GAME_CONTROL_GUN_SAFETY 0x36
-#define UX_HOST_CLASS_HID_GAME_CONTROL_GAMEAD_FIRE_JUMP 0x37
-#define UX_HOST_CLASS_HID_GAME_CONTROL_GAMEPAD_TRIGGER 0x39
+#define UX_HOST_CLASS_HID_GAME_CONTROL_UNDEFINED 0x00
+#define UX_HOST_CLASS_HID_GAME_CONTROL_3D_GAME_CONTROLLER 0x01
+#define UX_HOST_CLASS_HID_GAME_CONTROL_PINBALL_DEVICE 0x02
+#define UX_HOST_CLASS_HID_GAME_CONTROL_GUN_DEVICE 0x03
+#define UX_HOST_CLASS_HID_GAME_CONTROL_POINT_OF_VIEW 0x20
+#define UX_HOST_CLASS_HID_GAME_CONTROL_TURN_RIGHT_LEFT 0x21
+#define UX_HOST_CLASS_HID_GAME_CONTROL_PITCH_FORWARD_BACKWARD 0x22
+#define UX_HOST_CLASS_HID_GAME_CONTROL_ROLL_RIGHT_LEFT 0x23
+#define UX_HOST_CLASS_HID_GAME_CONTROL_MOVE_RIGHT_LEFT 0x24
+#define UX_HOST_CLASS_HID_GAME_CONTROL_MOVE_FORWARD_BACKWARD 0x25
+#define UX_HOST_CLASS_HID_GAME_CONTROL_MOVE_UP_DOWN 0x26
+#define UX_HOST_CLASS_HID_GAME_CONTROL_LEAN_RIGHT_LEFT 0x27
+#define UX_HOST_CLASS_HID_GAME_CONTROL_LEAN_FORWARD_BACKWARD 0x28
+#define UX_HOST_CLASS_HID_GAME_CONTROL_HEIGHT_OF_POV 0x29
+#define UX_HOST_CLASS_HID_GAME_CONTROL_FLIPPER 0x2A
+#define UX_HOST_CLASS_HID_GAME_CONTROL_SECONDARY_FLIPPER 0x2B
+#define UX_HOST_CLASS_HID_GAME_CONTROL_BUMP 0x2C
+#define UX_HOST_CLASS_HID_GAME_CONTROL_NEW_GAME 0x2D
+#define UX_HOST_CLASS_HID_GAME_CONTROL_SHOOT_BALL 0x2E
+#define UX_HOST_CLASS_HID_GAME_CONTROL_PLAYER 0x2F
+#define UX_HOST_CLASS_HID_GAME_CONTROL_GUN_BOLT 0x30
+#define UX_HOST_CLASS_HID_GAME_CONTROL_GUN_CLIP 0x31
+#define UX_HOST_CLASS_HID_GAME_CONTROL_GUN_SELECTOR 0x32
+#define UX_HOST_CLASS_HID_GAME_CONTROL_GUN_SINGLE_SHOT 0x33
+#define UX_HOST_CLASS_HID_GAME_CONTROL_GUN_BURST 0x34
+#define UX_HOST_CLASS_HID_GAME_CONTROL_GUN_AUTOMATIC 0x35
+#define UX_HOST_CLASS_HID_GAME_CONTROL_GUN_SAFETY 0x36
+#define UX_HOST_CLASS_HID_GAME_CONTROL_GAMEAD_FIRE_JUMP 0x37
+#define UX_HOST_CLASS_HID_GAME_CONTROL_GAMEPAD_TRIGGER 0x39
/* Define HID Class LED page constants. */
@@ -570,7 +548,7 @@ extern "C" {
#define UX_HOST_CLASS_HID_CONSUMER_ALTERNATE_AUDIO_DECREMENT 0x173
#define UX_HOST_CLASS_HID_CONSUMER_APPLICATION_LAUNCH_BUTTONS 0x174
#define UX_HOST_CLASS_HID_CONSUMER_AL_LAUNCH_BUTTON_CONFIGURATION 0x180
-#define UX_HOST_CLASS_HID_CONSUMER_AL_PROGRAMMABLE_BUTTON 0x181
+#define UX_HOST_CLASS_HID_CONSUMER_AL_PROGRAMMABLE_BUTTON 0x181
#define UX_HOST_CLASS_HID_CONSUMER_AL_CONSUMER_CONTROL_CONFIGURATION 0x182
#define UX_HOST_CLASS_HID_CONSUMER_AL_WORD_PROCESSOR 0x183
#define UX_HOST_CLASS_HID_CONSUMER_AL_TEXT_EDITOR 0x184
@@ -786,6 +764,10 @@ extern "C" {
#define UX_HOST_CLASS_HID_REPORT_TRANSFER_TIMEOUT 10000
#endif
+/* HID protocol values. */
+#define UX_HOST_CLASS_HID_PROTOCOL_BOOT 0x00
+#define UX_HOST_CLASS_HID_PROTOCOL_REPORT 0x01
+
/* Define HID Class descriptor. */
typedef struct UX_HID_DESCRIPTOR_STRUCT
@@ -806,7 +788,7 @@ typedef struct UX_HID_DESCRIPTOR_STRUCT
typedef struct UX_HOST_CLASS_HID_REPORT_CALLBACK_STRUCT
{
- struct UX_HOST_CLASS_HID_CLIENT_STRUCT
+ struct UX_HOST_CLASS_HID_CLIENT_STRUCT
*ux_host_class_hid_report_callback_client;
ULONG ux_host_class_hid_report_callback_id;
ULONG ux_host_class_hid_report_callback_status;
@@ -826,7 +808,7 @@ typedef struct UX_HOST_CLASS_HID_REPORT_GET_ID_STRUCT
ULONG ux_host_class_hid_report_get_id;
ULONG ux_host_class_hid_report_get_type;
- struct UX_HOST_CLASS_HID_REPORT_STRUCT
+ struct UX_HOST_CLASS_HID_REPORT_STRUCT
*ux_host_class_hid_report_get_report;
} UX_HOST_CLASS_HID_REPORT_GET_ID;
@@ -890,9 +872,9 @@ typedef struct UX_HOST_CLASS_HID_FIELD_STRUCT
ULONG ux_host_class_hid_field_number_usage;
ULONG *ux_host_class_hid_field_values;
ULONG ux_host_class_hid_field_number_values;
- struct UX_HOST_CLASS_HID_REPORT_STRUCT
+ struct UX_HOST_CLASS_HID_REPORT_STRUCT
*ux_host_class_hid_field_report;
- struct UX_HOST_CLASS_HID_FIELD_STRUCT
+ struct UX_HOST_CLASS_HID_FIELD_STRUCT
*ux_host_class_hid_field_next_field;
} UX_HOST_CLASS_HID_FIELD;
@@ -904,7 +886,7 @@ typedef struct UX_HOST_CLASS_HID_REPORT_STRUCT
ULONG ux_host_class_hid_report_id;
ULONG ux_host_class_hid_report_type;
- struct UX_HOST_CLASS_HID_FIELD_STRUCT
+ struct UX_HOST_CLASS_HID_FIELD_STRUCT
*ux_host_class_hid_report_field;
ULONG ux_host_class_hid_report_number_item;
ULONG ux_host_class_hid_report_byte_length;
@@ -913,7 +895,7 @@ typedef struct UX_HOST_CLASS_HID_REPORT_STRUCT
VOID *ux_host_class_hid_report_callback_buffer;
ULONG ux_host_class_hid_report_callback_length;
VOID (*ux_host_class_hid_report_callback_function) (struct UX_HOST_CLASS_HID_REPORT_CALLBACK_STRUCT *);
- struct UX_HOST_CLASS_HID_REPORT_STRUCT
+ struct UX_HOST_CLASS_HID_REPORT_STRUCT
*ux_host_class_hid_report_next_report;
} UX_HOST_CLASS_HID_REPORT;
@@ -925,21 +907,21 @@ typedef struct UX_HOST_CLASS_HID_PARSER_STRUCT
UX_HOST_CLASS_HID_GLOBAL_ITEM
ux_host_class_hid_parser_global;
- UX_HOST_CLASS_HID_GLOBAL_ITEM
+ UX_HOST_CLASS_HID_GLOBAL_ITEM
ux_host_class_hid_parser_global_pool[UX_HOST_CLASS_HID_MAX_GLOBAL];
ULONG ux_host_class_hid_parser_number_global;
- UX_HOST_CLASS_HID_LOCAL_ITEM
+ UX_HOST_CLASS_HID_LOCAL_ITEM
ux_host_class_hid_parser_local;
ULONG ux_host_class_hid_parser_application;
ULONG ux_host_class_hid_parser_collection[UX_HOST_CLASS_HID_MAX_COLLECTION];
ULONG ux_host_class_hid_parser_number_collection;
ULONG ux_host_class_hid_parser_main_page;
ULONG ux_host_class_hid_parser_main_usage;
- UX_HOST_CLASS_HID_REPORT
+ UX_HOST_CLASS_HID_REPORT
*ux_host_class_hid_parser_input_report;
- UX_HOST_CLASS_HID_REPORT
+ UX_HOST_CLASS_HID_REPORT
*ux_host_class_hid_parser_output_report;
- UX_HOST_CLASS_HID_REPORT
+ UX_HOST_CLASS_HID_REPORT
*ux_host_class_hid_parser_feature_report;
} UX_HOST_CLASS_HID_PARSER;
@@ -961,7 +943,7 @@ typedef struct UX_HOST_CLASS_HID_ITEM_STRUCT
typedef struct UX_HOST_CLASS_HID_STRUCT
{
- struct UX_HOST_CLASS_HID_STRUCT
+ struct UX_HOST_CLASS_HID_STRUCT
*ux_host_class_hid_next_instance;
UX_HOST_CLASS *ux_host_class_hid_class;
UX_DEVICE *ux_host_class_hid_device;
@@ -972,11 +954,11 @@ typedef struct UX_HOST_CLASS_HID_STRUCT
UINT ux_host_class_hid_interrupt_endpoint_status;
UX_INTERFACE *ux_host_class_hid_interface;
ULONG ux_host_class_hid_state;
- struct UX_HID_DESCRIPTOR_STRUCT
+ struct UX_HID_DESCRIPTOR_STRUCT
ux_host_class_hid_descriptor;
- UX_HOST_CLASS_HID_PARSER
+ UX_HOST_CLASS_HID_PARSER
ux_host_class_hid_parser;
- struct UX_HOST_CLASS_HID_CLIENT_STRUCT
+ struct UX_HOST_CLASS_HID_CLIENT_STRUCT
*ux_host_class_hid_client;
#if !defined(UX_HOST_STANDALONE)
UX_SEMAPHORE ux_host_class_hid_semaphore;
@@ -1037,8 +1019,8 @@ typedef struct UX_HOST_CLASS_HID_CLIENT_REPORT_STRUCT
UX_HOST_CLASS_HID_REPORT
*ux_host_class_hid_client_report;
ULONG *ux_host_class_hid_client_report_buffer;
- ULONG ux_host_class_hid_client_report_length;
- ULONG ux_host_class_hid_client_report_actual_length;
+ ULONG ux_host_class_hid_client_report_length;
+ ULONG ux_host_class_hid_client_report_actual_length;
UINT ux_host_class_hid_client_report_flags;
} UX_HOST_CLASS_HID_CLIENT_REPORT;
@@ -1055,7 +1037,7 @@ typedef struct UX_HOST_CLASS_HID_CLIENT_STRUCT
UCHAR ux_host_class_hid_client_name[UX_HOST_CLASS_HID_MAX_CLIENT_NAME_LENGTH + 1]; /* "+1" for string null-terminator */
#endif
UINT (*ux_host_class_hid_client_handler) (struct UX_HOST_CLASS_HID_CLIENT_COMMAND_STRUCT *);
- VOID *ux_host_class_hid_client_local_instance;
+ VOID *ux_host_class_hid_client_local_instance;
#if defined(UX_HOST_STANDALONE)
VOID (*ux_host_class_hid_client_function)(struct UX_HOST_CLASS_HID_CLIENT_STRUCT *);
#endif
@@ -1091,7 +1073,7 @@ UINT _ux_host_class_hid_report_decompress(UX_HOST_CLASS_HID *hid, UX_HOST_CLA
UINT _ux_host_class_hid_report_descriptor_get(UX_HOST_CLASS_HID *hid, ULONG length);
UINT _ux_host_class_hid_report_get(UX_HOST_CLASS_HID *hid, UX_HOST_CLASS_HID_CLIENT_REPORT *client_report);
UINT _ux_host_class_hid_report_id_get(UX_HOST_CLASS_HID *hid, UX_HOST_CLASS_HID_REPORT_GET_ID *report_id);
-UINT _ux_host_class_hid_report_item_analyse(UCHAR *descriptor, UX_HOST_CLASS_HID_ITEM *item);
+UINT _ux_host_class_hid_report_item_analyse(UCHAR *descriptor, ULONG length, UX_HOST_CLASS_HID_ITEM *item);
UINT _ux_host_class_hid_report_set(UX_HOST_CLASS_HID *hid, UX_HOST_CLASS_HID_CLIENT_REPORT *client_report);
UINT _ux_host_class_hid_resources_free(UX_HOST_CLASS_HID *hid);
VOID _ux_host_class_hid_transfer_request_completed(UX_TRANSFER *transfer_request);
@@ -1099,7 +1081,8 @@ VOID _ux_host_class_hid_transfer_request_completed(UX_TRANSFER *transfer_requ
UINT _ux_host_class_hid_tasks_run(UX_HOST_CLASS *hid_class);
UINT _ux_host_class_hid_idle_set_run(UX_HOST_CLASS_HID *hid, USHORT idle_time, USHORT report_id);
UINT _ux_host_class_hid_report_set_run(UX_HOST_CLASS_HID *hid, UX_HOST_CLASS_HID_CLIENT_REPORT *client_report);
-
+UINT _ux_host_class_hid_protocol_set(UX_HOST_CLASS_HID *hid, USHORT protocol);
+UINT _ux_host_class_hid_protocol_get(UX_HOST_CLASS_HID *hid, USHORT *protocol);
UINT _uxe_host_class_hid_client_register(UCHAR *hid_client_name,
UINT (*hid_client_handler)(struct UX_HOST_CLASS_HID_CLIENT_COMMAND_STRUCT *));
@@ -1117,7 +1100,8 @@ UINT _uxe_host_class_hid_report_set(UX_HOST_CLASS_HID *hid, UX_HOST_CLASS_HID
UINT _uxe_host_class_hid_idle_set_run(UX_HOST_CLASS_HID *hid, USHORT idle_time, USHORT report_id);
UINT _uxe_host_class_hid_report_set_run(UX_HOST_CLASS_HID *hid, UX_HOST_CLASS_HID_CLIENT_REPORT *client_report);
-
+UINT _uxe_host_class_hid_protocol_set(UX_HOST_CLASS_HID *hid, USHORT protocol);
+UINT _uxe_host_class_hid_protocol_get(UX_HOST_CLASS_HID *hid, USHORT *protocol);
/* Define HID Class API prototypes. */
@@ -1144,6 +1128,8 @@ UINT _uxe_host_class_hid_report_set_run(UX_HOST_CLASS_HID *hid, UX_HOST_CLASS
#define ux_host_class_hid_report_id_get _uxe_host_class_hid_report_id_get
#define ux_host_class_hid_report_get _uxe_host_class_hid_report_get
#define ux_host_class_hid_report_set _uxe_host_class_hid_report_set
+#define ux_host_class_hid_protocol_set _uxe_host_class_hid_protocol_set
+#define ux_host_class_hid_protocol_get _uxe_host_class_hid_protocol_get
#else
@@ -1159,15 +1145,16 @@ UINT _uxe_host_class_hid_report_set_run(UX_HOST_CLASS_HID *hid, UX_HOST_CLASS
#define ux_host_class_hid_report_id_get _ux_host_class_hid_report_id_get
#define ux_host_class_hid_report_get _ux_host_class_hid_report_get
#define ux_host_class_hid_report_set _ux_host_class_hid_report_set
+#define ux_host_class_hid_protocol_set _ux_host_class_hid_protocol_set
+#define ux_host_class_hid_protocol_get _ux_host_class_hid_protocol_get
#endif
-/* Determine if a C++ compiler is being used. If so, complete the standard
- C conditional started above. */
+/* Determine if a C++ compiler is being used. If so, complete the standard
+ C conditional started above. */
#ifdef __cplusplus
-}
-#endif
-
+}
#endif
+#endif
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 714c04e8..4feee262 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
@@ -1,18 +1,19 @@
/***************************************************************************
- * Copyright (c) 2024 Microsoft Corporation
- *
+ * Copyright (c) 2024 Microsoft Corporation
+ * Copyright (c) 2026-present Eclipse ThreadX contributors
+ *
* This program and the accompanying materials are made available under the
* terms of the MIT License which is available at
* https://opensource.org/licenses/MIT.
- *
+ *
* SPDX-License-Identifier: MIT
**************************************************************************/
/**************************************************************************/
/**************************************************************************/
-/** */
-/** USBX Component */
+/** */
+/** USBX Component */
/** */
/** HID Keyboard Client */
/** */
@@ -20,60 +21,35 @@
/**************************************************************************/
-/**************************************************************************/
-/* */
-/* COMPONENT DEFINITION RELEASE */
-/* */
-/* ux_host_class_hid_keyboard.h PORTABLE C */
+/**************************************************************************/
+/* */
+/* COMPONENT DEFINITION RELEASE */
+/* */
+/* ux_host_class_hid_keyboard.h PORTABLE C */
/* 6.2.0 */
/* AUTHOR */
/* */
/* Chaoqiong Xiao, Microsoft Corporation */
/* */
/* DESCRIPTION */
-/* */
+/* */
/* This file contains all the header and extern functions used by the */
-/* USBX HID keyboard client. */
-/* */
-/* RELEASE HISTORY */
-/* */
-/* 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 */
-/* 08-02-2021 Wen Wang Modified comment(s), */
-/* added extern "C" keyword */
-/* for compatibility with C++, */
-/* resulting in version 6.1.8 */
-/* 01-31-2022 Chaoqiong Xiao Modified comment(s), */
-/* added standalone support, */
-/* resulting in version 6.1.10 */
-/* 04-25-2022 Chaoqiong Xiao Modified comment(s), */
-/* fixed clients management, */
-/* resulting in version 6.1.11 */
-/* 10-31-2022 Chaoqiong Xiao Modified comment(s), */
-/* improved HID OUTPUT report */
-/* handling in standalone mode,*/
-/* resulting in version 6.2.0 */
+/* USBX HID keyboard client. */
/* */
/**************************************************************************/
#ifndef UX_HOST_CLASS_HID_KEYBOARD_H
#define UX_HOST_CLASS_HID_KEYBOARD_H
-/* Determine if a C++ compiler is being used. If so, ensure that standard
- C is used to process the API information. */
+/* Determine if a C++ compiler is being used. If so, ensure that standard
+ C is used to process the API information. */
-#ifdef __cplusplus
+#ifdef __cplusplus
-/* Yes, C++ compiler is present. Use standard C. */
-extern "C" {
+/* Yes, C++ compiler is present. Use standard C. */
+extern "C" {
-#endif
+#endif
/* Internal option: enable the basic USBX error checking. This define is typically used
@@ -140,7 +116,7 @@ extern "C" {
/* Define HID keyboard generic equivalences. */
-#define UX_HID_KEYBOARD_NO_KEY 0
+#define UX_HID_KEYBOARD_NO_KEY 0
#define UX_HID_KEYBOARD_PHANTOM_STATE 0x01
#define UX_HID_KEYBOARD_KEY_LETTER_A 0x04
#define UX_HID_KEYBOARD_KEY_LETTER_Z 0x1D
@@ -215,11 +191,11 @@ typedef struct UX_HOST_CLASS_HID_KEYBOARD_LAYOUT_STRUCT
typedef struct UX_HOST_CLASS_HID_KEYBOARD_STRUCT
{
- ULONG ux_host_class_hid_keyboard_state;
+ ULONG ux_host_class_hid_keyboard_state;
UCHAR *ux_host_class_hid_keyboard_key_state;
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;
+ USHORT ux_host_class_hid_keyboard_id;
#if !defined(UX_HOST_STANDALONE)
VOID *ux_host_class_hid_keyboard_thread_stack;
UX_THREAD ux_host_class_hid_keyboard_thread;
@@ -255,7 +231,7 @@ UINT _ux_host_class_hid_keyboard_activate(UX_HOST_CLASS_HID_CLIENT_COMMAND *c
UINT _ux_host_class_hid_keyboard_deactivate(UX_HOST_CLASS_HID_CLIENT_COMMAND *command);
UINT _ux_host_class_hid_keyboard_entry(UX_HOST_CLASS_HID_CLIENT_COMMAND *command);
VOID _ux_host_class_hid_keyboard_thread(ULONG thread_entry);
-UINT _ux_host_class_hid_keyboard_key_get(UX_HOST_CLASS_HID_KEYBOARD *keyboard_instance,
+UINT _ux_host_class_hid_keyboard_key_get(UX_HOST_CLASS_HID_KEYBOARD *keyboard_instance,
ULONG *keyboard_key, ULONG *keyboard_state);
UINT _ux_host_class_hid_keyboard_ioctl(UX_HOST_CLASS_HID_KEYBOARD *keyboard_instance,
ULONG ioctl_function, VOID *parameter);
@@ -263,7 +239,7 @@ UINT _ux_host_class_hid_keyboard_ioctl(UX_HOST_CLASS_HID_KEYBOARD *keyboard_i
VOID _ux_host_class_hid_keyboard_tasks_run(UX_HOST_CLASS_HID_CLIENT *client);
-UINT _uxe_host_class_hid_keyboard_key_get(UX_HOST_CLASS_HID_KEYBOARD *keyboard_instance,
+UINT _uxe_host_class_hid_keyboard_key_get(UX_HOST_CLASS_HID_KEYBOARD *keyboard_instance,
ULONG *keyboard_key, ULONG *keyboard_state);
UINT _uxe_host_class_hid_keyboard_ioctl(UX_HOST_CLASS_HID_KEYBOARD *keyboard_instance,
ULONG ioctl_function, VOID *parameter);
@@ -285,10 +261,10 @@ UINT _uxe_host_class_hid_keyboard_ioctl(UX_HOST_CLASS_HID_KEYBOARD *keyboard_
#endif
-/* Determine if a C++ compiler is being used. If so, complete the standard
- C conditional started above. */
+/* Determine if a C++ compiler is being used. If so, complete the standard
+ C conditional started above. */
#ifdef __cplusplus
-}
+}
#endif
#endif
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 32588c93..02ae9ab6 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
@@ -1,18 +1,19 @@
/***************************************************************************
- * Copyright (c) 2024 Microsoft Corporation
- *
+ * Copyright (c) 2024 Microsoft Corporation
+ * Copyright (c) 2026-present Eclipse ThreadX contributors
+ *
* This program and the accompanying materials are made available under the
* terms of the MIT License which is available at
* https://opensource.org/licenses/MIT.
- *
+ *
* SPDX-License-Identifier: MIT
**************************************************************************/
/**************************************************************************/
/**************************************************************************/
-/** */
-/** USBX Component */
+/** */
+/** USBX Component */
/** */
/** HID Mouse Client Class */
/** */
@@ -20,53 +21,35 @@
/**************************************************************************/
-/**************************************************************************/
-/* */
-/* COMPONENT DEFINITION RELEASE */
-/* */
-/* ux_host_class_hid_mouse.h PORTABLE C */
+/**************************************************************************/
+/* */
+/* COMPONENT DEFINITION RELEASE */
+/* */
+/* ux_host_class_hid_mouse.h PORTABLE C */
/* 6.1.11 */
/* AUTHOR */
/* */
/* Chaoqiong Xiao, Microsoft Corporation */
/* */
/* DESCRIPTION */
-/* */
+/* */
/* This file contains all the header and extern functions used by the */
-/* USBX HID mouse class. */
-/* */
-/* RELEASE HISTORY */
-/* */
-/* DATE NAME DESCRIPTION */
-/* */
-/* 05-19-2020 Chaoqiong Xiao Initial Version 6.0 */
-/* 09-30-2020 Chaoqiong Xiao Modified comment(s), */
-/* resulting in version 6.1 */
-/* 08-02-2021 Wen Wang Modified comment(s), */
-/* added extern "C" keyword */
-/* for compatibility with C++, */
-/* resulting in version 6.1.8 */
-/* 01-31-2022 Chaoqiong Xiao Modified comment(s), */
-/* added standalone support, */
-/* resulting in version 6.1.10 */
-/* 04-25-2022 Chaoqiong Xiao Modified comment(s), */
-/* fixed clients management, */
-/* resulting in version 6.1.11 */
+/* USBX HID mouse class. */
/* */
/**************************************************************************/
#ifndef UX_HOST_CLASS_HID_MOUSE_H
#define UX_HOST_CLASS_HID_MOUSE_H
-/* Determine if a C++ compiler is being used. If so, ensure that standard
- C is used to process the API information. */
+/* Determine if a C++ compiler is being used. If so, ensure that standard
+ C is used to process the API information. */
-#ifdef __cplusplus
+#ifdef __cplusplus
-/* Yes, C++ compiler is present. Use standard C. */
-extern "C" {
+/* Yes, C++ compiler is present. Use standard C. */
+extern "C" {
-#endif
+#endif
/* Internal option: enable the basic USBX error checking. This define is typically used
@@ -100,7 +83,7 @@ extern "C" {
typedef struct UX_HOST_CLASS_HID_MOUSE_STRUCT
{
- ULONG ux_host_class_hid_mouse_state;
+ ULONG ux_host_class_hid_mouse_state;
UX_HOST_CLASS_HID *ux_host_class_hid_mouse_hid;
USHORT ux_host_class_hid_mouse_id;
SLONG ux_host_class_hid_mouse_x_position;
@@ -126,21 +109,21 @@ UINT _ux_host_class_hid_mouse_activate(UX_HOST_CLASS_HID_CLIENT_COMMAND *comm
VOID _ux_host_class_hid_mouse_callback(UX_HOST_CLASS_HID_REPORT_CALLBACK *callback);
UINT _ux_host_class_hid_mouse_deactivate(UX_HOST_CLASS_HID_CLIENT_COMMAND *command);
UINT _ux_host_class_hid_mouse_entry(UX_HOST_CLASS_HID_CLIENT_COMMAND *command);
-UINT _ux_host_class_hid_mouse_buttons_get(UX_HOST_CLASS_HID_MOUSE *mouse_instance,
+UINT _ux_host_class_hid_mouse_buttons_get(UX_HOST_CLASS_HID_MOUSE *mouse_instance,
ULONG *mouse_buttons);
-UINT _ux_host_class_hid_mouse_position_get(UX_HOST_CLASS_HID_MOUSE *mouse_instance,
- SLONG *mouse_x_position,
+UINT _ux_host_class_hid_mouse_position_get(UX_HOST_CLASS_HID_MOUSE *mouse_instance,
+ SLONG *mouse_x_position,
SLONG *mouse_y_position);
-UINT _ux_host_class_hid_mouse_wheel_get(UX_HOST_CLASS_HID_MOUSE *mouse_instance,
- SLONG *mouse_wheel_movement);
+UINT _ux_host_class_hid_mouse_wheel_get(UX_HOST_CLASS_HID_MOUSE *mouse_instance,
+ SLONG *mouse_wheel_movement);
-UINT _uxe_host_class_hid_mouse_buttons_get(UX_HOST_CLASS_HID_MOUSE *mouse_instance,
+UINT _uxe_host_class_hid_mouse_buttons_get(UX_HOST_CLASS_HID_MOUSE *mouse_instance,
ULONG *mouse_buttons);
-UINT _uxe_host_class_hid_mouse_position_get(UX_HOST_CLASS_HID_MOUSE *mouse_instance,
- SLONG *mouse_x_position,
+UINT _uxe_host_class_hid_mouse_position_get(UX_HOST_CLASS_HID_MOUSE *mouse_instance,
+ SLONG *mouse_x_position,
SLONG *mouse_y_position);
-UINT _uxe_host_class_hid_mouse_wheel_get(UX_HOST_CLASS_HID_MOUSE *mouse_instance,
- SLONG *mouse_wheel_movement);
+UINT _uxe_host_class_hid_mouse_wheel_get(UX_HOST_CLASS_HID_MOUSE *mouse_instance,
+ SLONG *mouse_wheel_movement);
/* Define HID Mouse Class API prototypes. */
@@ -162,10 +145,10 @@ UINT _uxe_host_class_hid_mouse_wheel_get(UX_HOST_CLASS_HID_MOUSE *mouse_insta
#endif
-/* Determine if a C++ compiler is being used. If so, complete the standard
- C conditional started above. */
+/* Determine if a C++ compiler is being used. If so, complete the standard
+ C conditional started above. */
#ifdef __cplusplus
-}
+}
#endif
#endif
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 036caa82..9c64c27e 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
@@ -1,18 +1,19 @@
/***************************************************************************
- * Copyright (c) 2024 Microsoft Corporation
- *
+ * Copyright (c) 2024 Microsoft Corporation
+ * Copyright (c) 2026-present Eclipse ThreadX contributors
+ *
* This program and the accompanying materials are made available under the
* terms of the MIT License which is available at
* https://opensource.org/licenses/MIT.
- *
+ *
* SPDX-License-Identifier: MIT
**************************************************************************/
/**************************************************************************/
/**************************************************************************/
-/** */
-/** USBX Component */
+/** */
+/** USBX Component */
/** */
/** HID Remote Control Class */
/** */
@@ -20,50 +21,35 @@
/**************************************************************************/
-/**************************************************************************/
-/* */
-/* COMPONENT DEFINITION RELEASE */
-/* */
-/* ux_host_class_hid_remote_control.h PORTABLE C */
+/**************************************************************************/
+/* */
+/* COMPONENT DEFINITION RELEASE */
+/* */
+/* ux_host_class_hid_remote_control.h PORTABLE C */
/* 6.1.11 */
/* AUTHOR */
/* */
/* Chaoqiong Xiao, Microsoft Corporation */
/* */
/* DESCRIPTION */
-/* */
+/* */
/* This file contains all the header and extern functions used by the */
-/* USBX HID remote control class. */
-/* */
-/* RELEASE HISTORY */
-/* */
-/* DATE NAME DESCRIPTION */
-/* */
-/* 05-19-2020 Chaoqiong Xiao Initial Version 6.0 */
-/* 09-30-2020 Chaoqiong Xiao Modified comment(s), */
-/* resulting in version 6.1 */
-/* 08-02-2021 Wen Wang Modified comment(s), */
-/* added extern "C" keyword */
-/* for compatibility with C++, */
-/* resulting in version 6.1.8 */
-/* 04-25-2022 Chaoqiong Xiao Modified comment(s), */
-/* fixed clients management, */
-/* resulting in version 6.1.11 */
+/* USBX HID remote control class. */
/* */
/**************************************************************************/
#ifndef UX_HOST_CLASS_HID_REMOTE_CONTROL_H
#define UX_HOST_CLASS_HID_REMOTE_CONTROL_H
-/* Determine if a C++ compiler is being used. If so, ensure that standard
- C is used to process the API information. */
+/* Determine if a C++ compiler is being used. If so, ensure that standard
+ C is used to process the API information. */
-#ifdef __cplusplus
+#ifdef __cplusplus
-/* Yes, C++ compiler is present. Use standard C. */
-extern "C" {
+/* Yes, C++ compiler is present. Use standard C. */
+extern "C" {
-#endif
+#endif
/* Internal option: enable the basic USBX error checking. This define is typically used
@@ -88,7 +74,7 @@ extern "C" {
typedef struct UX_HOST_CLASS_HID_REMOTE_CONTROL_STRUCT
{
- ULONG ux_host_class_hid_remote_control_state;
+ ULONG ux_host_class_hid_remote_control_state;
UX_HOST_CLASS_HID *ux_host_class_hid_remote_control_hid;
ULONG *ux_host_class_hid_remote_control_usage_array;
ULONG *ux_host_class_hid_remote_control_usage_array_head;
@@ -128,11 +114,11 @@ UINT _uxe_host_class_hid_remote_control_usage_get(UX_HOST_CLASS_HID_REMOTE_CO
#endif
-/* Determine if a C++ compiler is being used. If so, complete the standard
- C conditional started above. */
+/* Determine if a C++ compiler is being used. If so, complete the standard
+ C conditional started above. */
#ifdef __cplusplus
-}
-#endif
+}
+#endif
#endif
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 261c5698..6e561966 100644
--- a/common/usbx_host_classes/inc/ux_host_class_hub.h
+++ b/common/usbx_host_classes/inc/ux_host_class_hub.h
@@ -1,18 +1,19 @@
/***************************************************************************
- * Copyright (c) 2024 Microsoft Corporation
- *
+ * Copyright (c) 2024 Microsoft Corporation
+ * Copyright (c) 2026-present Eclipse ThreadX contributors
+ *
* This program and the accompanying materials are made available under the
* terms of the MIT License which is available at
* https://opensource.org/licenses/MIT.
- *
+ *
* SPDX-License-Identifier: MIT
**************************************************************************/
/**************************************************************************/
/**************************************************************************/
-/** */
-/** USBX Component */
+/** */
+/** USBX Component */
/** */
/** HUB Class */
/** */
@@ -20,53 +21,35 @@
/**************************************************************************/
-/**************************************************************************/
-/* */
-/* COMPONENT DEFINITION RELEASE */
-/* */
-/* ux_host_class_hub.h PORTABLE C */
+/**************************************************************************/
+/* */
+/* COMPONENT DEFINITION RELEASE */
+/* */
+/* ux_host_class_hub.h PORTABLE C */
/* 6.3.0 */
/* AUTHOR */
/* */
/* Chaoqiong Xiao, Microsoft Corporation */
/* */
/* DESCRIPTION */
-/* */
+/* */
/* This file contains all the header and extern functions used by the */
-/* USBX HUB class. */
-/* */
-/* RELEASE HISTORY */
-/* */
-/* DATE NAME DESCRIPTION */
-/* */
-/* 05-19-2020 Chaoqiong Xiao Initial Version 6.0 */
-/* 09-30-2020 Chaoqiong Xiao Modified comment(s), */
-/* resulting in version 6.1 */
-/* 08-02-2021 Wen Wang Modified comment(s), */
-/* added extern "C" keyword */
-/* for compatibility with C++, */
-/* resulting in version 6.1.8 */
-/* 07-29-2022 Chaoqiong Xiao Modified comment(s), */
-/* added standalone support, */
-/* resulting in version 6.1.12 */
-/* 10-31-2023 Chaoqiong Xiao Modified comment(s), */
-/* optimized USB descriptors, */
-/* resulting in version 6.3.0 */
+/* USBX HUB class. */
/* */
/**************************************************************************/
#ifndef UX_HOST_CLASS_HUB_H
#define UX_HOST_CLASS_HUB_H
-/* Determine if a C++ compiler is being used. If so, ensure that standard
- C is used to process the API information. */
+/* Determine if a C++ compiler is being used. If so, ensure that standard
+ C is used to process the API information. */
-#ifdef __cplusplus
+#ifdef __cplusplus
-/* Yes, C++ compiler is present. Use standard C. */
-extern "C" {
+/* Yes, C++ compiler is present. Use standard C. */
+extern "C" {
-#endif
+#endif
/* Define HUB Class constants. */
@@ -82,7 +65,7 @@ extern "C" {
#define UX_HOST_CLASS_HUB_GANG_POWER_SWITCHING 0x00
#define UX_HOST_CLASS_HUB_INDIVIDUAL_POWER_SWITCHING 0x01
#define UX_HOST_CLASS_HUB_NO_POWER_SWITCHING 0x02
-
+
#define UX_HOST_CLASS_HUB_COMPOUND_DEVICE 0x04
#define UX_HOST_CLASS_HUB_GLOBAL_OVERCURRENT 0x00
@@ -217,7 +200,7 @@ typedef struct UX_HOST_CLASS_HUB_STRUCT
UINT ux_host_class_hub_instance_status;
UINT ux_host_class_hub_state;
UINT ux_host_class_hub_change_semaphore;
- struct UX_HUB_DESCRIPTOR_STRUCT
+ struct UX_HUB_DESCRIPTOR_STRUCT
ux_host_class_hub_descriptor;
UINT ux_host_class_hub_port_state;
UINT ux_host_class_hub_port_power;
@@ -266,11 +249,11 @@ VOID _ux_host_class_hub_transfer_request_completed(UX_TRANSFER *transfer_requ
UINT _ux_host_class_hub_tasks_run(UX_HOST_CLASS *hub_class);
-/* Determine if a C++ compiler is being used. If so, complete the standard
- C conditional started above. */
+/* Determine if a C++ compiler is being used. If so, complete the standard
+ C conditional started above. */
#ifdef __cplusplus
-}
-#endif
+}
+#endif
#endif
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 9556dae7..2ed48d0e 100644
--- a/common/usbx_host_classes/inc/ux_host_class_pima.h
+++ b/common/usbx_host_classes/inc/ux_host_class_pima.h
@@ -1,10 +1,11 @@
/***************************************************************************
- * Copyright (c) 2024 Microsoft Corporation
- *
+ * Copyright (c) 2024 Microsoft Corporation
+ * Copyright (c) 2026-present Eclipse ThreadX contributors
+ *
* This program and the accompanying materials are made available under the
* terms of the MIT License which is available at
* https://opensource.org/licenses/MIT.
- *
+ *
* SPDX-License-Identifier: MIT
**************************************************************************/
@@ -35,31 +36,6 @@
/* This file contains all the header and extern functions used by the */
/* USBX PIMA class. */
/* */
-/* RELEASE HISTORY */
-/* */
-/* 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 */
-/* 08-02-2021 Wen Wang Modified comment(s), */
-/* added extern "C" keyword */
-/* for compatibility with C++, */
-/* resulting in version 6.1.8 */
-/* 07-29-2022 Chaoqiong Xiao Modified comment(s), */
-/* improved internal checks, */
-/* resulting in version 6.1.12 */
-/* 10-31-2023 Chaoqiong Xiao Modified comment(s), */
-/* removed unused semaphore, */
-/* optimized PIMA data sets, */
-/* increased default buffer */
-/* length to get device info, */
-/* added error checks support, */
-/* resulting in version 6.3.0 */
-/* */
/**************************************************************************/
#ifndef UX_HOST_CLASS_PIMA_H
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 6233d529..bc462081 100644
--- a/common/usbx_host_classes/inc/ux_host_class_printer.h
+++ b/common/usbx_host_classes/inc/ux_host_class_printer.h
@@ -1,10 +1,11 @@
/***************************************************************************
- * Copyright (c) 2024 Microsoft Corporation
- *
+ * Copyright (c) 2024 Microsoft Corporation
+ * Copyright (c) 2026-present Eclipse ThreadX contributors
+ *
* This program and the accompanying materials are made available under the
* terms of the MIT License which is available at
* https://opensource.org/licenses/MIT.
- *
+ *
* SPDX-License-Identifier: MIT
**************************************************************************/
@@ -35,31 +36,6 @@
/* This file contains all the header and extern functions used by the */
/* USBX printer class. */
/* */
-/* RELEASE HISTORY */
-/* */
-/* 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 */
-/* 08-02-2021 Wen Wang Modified comment(s), */
-/* added extern "C" keyword */
-/* for compatibility with C++, */
-/* resulting in version 6.1.8 */
-/* 10-15-2021 Chaoqiong Xiao Modified comment(s), */
-/* added entry public define, */
-/* resulting in version 6.1.9 */
-/* 01-31-2022 Chaoqiong Xiao Modified comment(s), */
-/* added standalone support, */
-/* added a new protocol const, */
-/* resulting in version 6.1.10 */
-/* 10-31-2023 Yajun xia Modified comment(s), */
-/* added error checks support, */
-/* resulting in version 6.3.0 */
-/* */
/**************************************************************************/
#ifndef UX_HOST_CLASS_PRINTER_H
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 127592e8..94b516ff 100644
--- a/common/usbx_host_classes/inc/ux_host_class_prolific.h
+++ b/common/usbx_host_classes/inc/ux_host_class_prolific.h
@@ -1,18 +1,19 @@
/***************************************************************************
- * Copyright (c) 2024 Microsoft Corporation
- *
+ * Copyright (c) 2024 Microsoft Corporation
+ * Copyright (c) 2026-present Eclipse ThreadX contributors
+ *
* This program and the accompanying materials are made available under the
* terms of the MIT License which is available at
* https://opensource.org/licenses/MIT.
- *
+ *
* SPDX-License-Identifier: MIT
**************************************************************************/
/**************************************************************************/
/**************************************************************************/
-/** */
-/** USBX Component */
+/** */
+/** USBX Component */
/** */
/** PROLIFIC Class */
/** */
@@ -20,50 +21,35 @@
/**************************************************************************/
-/**************************************************************************/
-/* */
-/* COMPONENT DEFINITION RELEASE */
-/* */
-/* ux_host_class_prolific.h PORTABLE C */
+/**************************************************************************/
+/* */
+/* COMPONENT DEFINITION RELEASE */
+/* */
+/* ux_host_class_prolific.h PORTABLE C */
/* 6.1.8 */
/* AUTHOR */
/* */
/* Chaoqiong Xiao, Microsoft Corporation */
/* */
/* DESCRIPTION */
-/* */
+/* */
/* This file contains all the header and extern functions used by the */
-/* USBX PROLIFIC class. */
-/* */
-/* RELEASE HISTORY */
-/* */
-/* 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 */
-/* 08-02-2021 Wen Wang Modified comment(s), */
-/* added extern "C" keyword */
-/* for compatibility with C++, */
-/* resulting in version 6.1.8 */
+/* USBX PROLIFIC class. */
/* */
/**************************************************************************/
#ifndef UX_HOST_CLASS_PROLIFIC_H
#define UX_HOST_CLASS_PROLIFIC_H
-/* Determine if a C++ compiler is being used. If so, ensure that standard
- C is used to process the API information. */
+/* Determine if a C++ compiler is being used. If so, ensure that standard
+ C is used to process the API information. */
-#ifdef __cplusplus
+#ifdef __cplusplus
-/* Yes, C++ compiler is present. Use standard C. */
-extern "C" {
+/* Yes, C++ compiler is present. Use standard C. */
+extern "C" {
-#endif
+#endif
/* Internal option: enable the basic USBX error checking. This define is typically used
@@ -74,11 +60,11 @@ extern "C" {
/* Define PROLIFIC Class constants. */
-
+
#define UX_HOST_CLASS_PROLIFIC_DEVICE_INIT_DELAY (1 * UX_PERIODIC_RATE)
#define UX_HOST_CLASS_PROLIFIC_CLASS_TRANSFER_TIMEOUT 300000
#define UX_HOST_CLASS_PROLIFIC_SETUP_BUFFER_SIZE 16
-#define UX_HOST_CLASS_PROLIFIC_DEVICE_PRESENT 1
+#define UX_HOST_CLASS_PROLIFIC_DEVICE_PRESENT 1
#define UX_HOST_CLASS_PROLIFIC_DEVICE_NOT_PRESENT 0
#define UX_HOST_CLASS_PROLIFIC_DEVICE_STATE_OFFSET 8
#define UX_HOST_CLASS_PROLIFIC_DEVICE_STATE_MASK 0x7F
@@ -123,7 +109,7 @@ extern "C" {
#define UX_HOST_CLASS_PROLIFIC_REQ_SET_LINE_STATE 0x22
#define UX_HOST_CLASS_PROLIFIC_REQ_SEND_BREAK 0x23
#define UX_HOST_CLASS_PROLIFIC_REQ_SET_RINGER_PARMS 0x30
-#define UX_HOST_CLASS_PROLIFIC_REQ_GET_RINGER_PARMS 0x31
+#define UX_HOST_CLASS_PROLIFIC_REQ_GET_RINGER_PARMS 0x31
#define UX_HOST_CLASS_PROLIFIC_REQ_SET_OPERATION_PARMS 0x32
#define UX_HOST_CLASS_PROLIFIC_REQ_GET_OPERATION_PARMS 0x33
#define UX_HOST_CLASS_PROLIFIC_REQ_SET_LINE_PARMS 0x34
@@ -207,7 +193,7 @@ extern "C" {
typedef struct UX_HOST_CLASS_PROLIFIC_STRUCT
{
- struct UX_HOST_CLASS_PROLIFIC_STRUCT
+ struct UX_HOST_CLASS_PROLIFIC_STRUCT
*ux_host_class_prolific_next_instance;
UX_HOST_CLASS *ux_host_class_prolific_class;
UX_DEVICE *ux_host_class_prolific_device;
@@ -220,14 +206,14 @@ typedef struct UX_HOST_CLASS_PROLIFIC_STRUCT
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,
+ VOID (*ux_host_class_prolific_device_status_change_callback)(struct UX_HOST_CLASS_PROLIFIC_STRUCT *prolific,
ULONG device_state);
-
+
ULONG ux_host_class_prolific_version;
UCHAR ux_host_class_prolific_device_type;
- struct UX_HOST_CLASS_PROLIFIC_RECEPTION_STRUCT
+ struct UX_HOST_CLASS_PROLIFIC_RECEPTION_STRUCT
*ux_host_class_prolific_reception;
-
+
} UX_HOST_CLASS_PROLIFIC;
@@ -242,9 +228,9 @@ typedef struct UX_HOST_CLASS_PROLIFIC_RECEPTION_STRUCT
ULONG ux_host_class_prolific_reception_data_buffer_size;
UCHAR *ux_host_class_prolific_reception_data_head;
UCHAR *ux_host_class_prolific_reception_data_tail;
- VOID (*ux_host_class_prolific_reception_callback)(struct UX_HOST_CLASS_PROLIFIC_STRUCT *prolific,
+ VOID (*ux_host_class_prolific_reception_callback)(struct UX_HOST_CLASS_PROLIFIC_STRUCT *prolific,
UINT status,
- UCHAR *reception_buffer,
+ UCHAR *reception_buffer,
ULONG reception_size);
} UX_HOST_CLASS_PROLIFIC_RECEPTION;
@@ -288,35 +274,35 @@ UINT _ux_host_class_prolific_configure(UX_HOST_CLASS_PROLIFIC *prolific);
UINT _ux_host_class_prolific_deactivate(UX_HOST_CLASS_COMMAND *command);
UINT _ux_host_class_prolific_endpoints_get(UX_HOST_CLASS_PROLIFIC *prolific);
UINT _ux_host_class_prolific_entry(UX_HOST_CLASS_COMMAND *command);
-UINT _ux_host_class_prolific_read (UX_HOST_CLASS_PROLIFIC *prolific, UCHAR *data_pointer,
+UINT _ux_host_class_prolific_read (UX_HOST_CLASS_PROLIFIC *prolific, UCHAR *data_pointer,
ULONG requested_length, ULONG *actual_length);
-UINT _ux_host_class_prolific_write(UX_HOST_CLASS_PROLIFIC *prolific, UCHAR *data_pointer,
+UINT _ux_host_class_prolific_write(UX_HOST_CLASS_PROLIFIC *prolific, UCHAR *data_pointer,
ULONG requested_length, ULONG *actual_length);
UINT _ux_host_class_prolific_ioctl(UX_HOST_CLASS_PROLIFIC *prolific, ULONG request,
VOID *parameter);
UINT _ux_host_class_prolific_command(UX_HOST_CLASS_PROLIFIC *prolific, ULONG command,
ULONG value, UCHAR *data_buffer, ULONG data_length);
VOID _ux_host_class_prolific_transfer_request_completed(UX_TRANSFER *transfer_request);
-UINT _ux_host_class_prolific_reception_stop (UX_HOST_CLASS_PROLIFIC *prolific,
+UINT _ux_host_class_prolific_reception_stop (UX_HOST_CLASS_PROLIFIC *prolific,
UX_HOST_CLASS_PROLIFIC_RECEPTION *prolific_reception);
-UINT _ux_host_class_prolific_reception_start (UX_HOST_CLASS_PROLIFIC *prolific,
+UINT _ux_host_class_prolific_reception_start (UX_HOST_CLASS_PROLIFIC *prolific,
UX_HOST_CLASS_PROLIFIC_RECEPTION *prolific_reception);
-
+
VOID _ux_host_class_prolific_reception_callback (UX_TRANSFER *transfer_request);
UINT _ux_host_class_prolific_setup(UX_HOST_CLASS_PROLIFIC *prolific);
-UINT _uxe_host_class_prolific_read (UX_HOST_CLASS_PROLIFIC *prolific, UCHAR *data_pointer,
+UINT _uxe_host_class_prolific_read (UX_HOST_CLASS_PROLIFIC *prolific, UCHAR *data_pointer,
ULONG requested_length, ULONG *actual_length);
-UINT _uxe_host_class_prolific_write(UX_HOST_CLASS_PROLIFIC *prolific, UCHAR *data_pointer,
+UINT _uxe_host_class_prolific_write(UX_HOST_CLASS_PROLIFIC *prolific, UCHAR *data_pointer,
ULONG requested_length, ULONG *actual_length);
UINT _uxe_host_class_prolific_ioctl(UX_HOST_CLASS_PROLIFIC *prolific, ULONG request,
VOID *parameter);
UINT _uxe_host_class_prolific_command(UX_HOST_CLASS_PROLIFIC *prolific, ULONG command,
ULONG value, UCHAR *data_buffer, ULONG data_length);
-UINT _uxe_host_class_prolific_reception_stop (UX_HOST_CLASS_PROLIFIC *prolific,
+UINT _uxe_host_class_prolific_reception_stop (UX_HOST_CLASS_PROLIFIC *prolific,
UX_HOST_CLASS_PROLIFIC_RECEPTION *prolific_reception);
-UINT _uxe_host_class_prolific_reception_start (UX_HOST_CLASS_PROLIFIC *prolific,
+UINT _uxe_host_class_prolific_reception_start (UX_HOST_CLASS_PROLIFIC *prolific,
UX_HOST_CLASS_PROLIFIC_RECEPTION *prolific_reception);
@@ -345,10 +331,10 @@ UINT _uxe_host_class_prolific_reception_start (UX_HOST_CLASS_PROLIFIC *prolific
#endif
-/* Determine if a C++ compiler is being used. If so, complete the standard
- C conditional started above. */
+/* Determine if a C++ compiler is being used. If so, complete the standard
+ C conditional started above. */
#ifdef __cplusplus
-}
-#endif
+}
+#endif
#endif
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 c54c8ed0..f9a5a59b 100644
--- a/common/usbx_host_classes/inc/ux_host_class_storage.h
+++ b/common/usbx_host_classes/inc/ux_host_class_storage.h
@@ -1,18 +1,19 @@
/***************************************************************************
- * Copyright (c) 2024 Microsoft Corporation
- *
+ * Copyright (c) 2024 Microsoft Corporation
+ * Copyright (c) 2026-present Eclipse ThreadX contributors
+ *
* This program and the accompanying materials are made available under the
* terms of the MIT License which is available at
* https://opensource.org/licenses/MIT.
- *
+ *
* SPDX-License-Identifier: MIT
**************************************************************************/
/**************************************************************************/
/**************************************************************************/
-/** */
-/** USBX Component */
+/** */
+/** USBX Component */
/** */
/** Storage Class */
/** */
@@ -20,67 +21,35 @@
/**************************************************************************/
-/**************************************************************************/
-/* */
-/* COMPONENT DEFINITION RELEASE */
-/* */
-/* ux_host_class_storage.h PORTABLE C */
+/**************************************************************************/
+/* */
+/* COMPONENT DEFINITION RELEASE */
+/* */
+/* ux_host_class_storage.h PORTABLE C */
/* 6.3.0 */
/* AUTHOR */
/* */
/* Chaoqiong Xiao, Microsoft Corporation */
/* */
/* DESCRIPTION */
-/* */
+/* */
/* This file contains all the header and extern functions used by the */
-/* USBX storage class. */
-/* */
-/* RELEASE HISTORY */
-/* */
-/* 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 */
-/* 11-09-2020 Chaoqiong Xiao Modified comment(s), */
-/* added exFAT type define, */
-/* resulting in version 6.1.2 */
-/* 12-31-2020 Chaoqiong Xiao Modified comment(s), */
-/* resulting in version 6.1.3 */
-/* 08-02-2021 Chaoqiong Xiao Modified comment(s), */
-/* added extern "C" keyword */
-/* for compatibility with C++, */
-/* resulting in version 6.1.8 */
-/* 01-31-2022 Chaoqiong Xiao Modified comment(s), */
-/* added standalone support, */
-/* resulting in version 6.1.10 */
-/* 10-31-2023 Chaoqiong Xiao Modified comment(s), */
-/* added error checks support, */
-/* resulting in version 6.3.0 */
+/* USBX storage class. */
/* */
/**************************************************************************/
#ifndef UX_HOST_CLASS_STORAGE_H
#define UX_HOST_CLASS_STORAGE_H
-/* Determine if a C++ compiler is being used. If so, ensure that standard
- C is used to process the API information. */
+/* Determine if a C++ compiler is being used. If so, ensure that standard
+ C is used to process the API information. */
-#ifdef __cplusplus
+#ifdef __cplusplus
-/* Yes, C++ compiler is present. Use standard C. */
-extern "C" {
+/* Yes, C++ compiler is present. Use standard C. */
+extern "C" {
-#endif
+#endif
/* Internal option: enable the basic USBX error checking. This define is typically used
@@ -236,7 +205,7 @@ extern "C" {
#define UX_HOST_CLASS_STORAGE_SCSI_VERIFY 0x2f
#define UX_HOST_CLASS_STORAGE_SCSI_MODE_SELECT 0x55
#define UX_HOST_CLASS_STORAGE_SCSI_MODE_SENSE 0x5a
-#define UX_HOST_CLASS_STORAGE_SCSI_READ32 0xa8
+#define UX_HOST_CLASS_STORAGE_SCSI_READ32 0xa8
#define UX_HOST_CLASS_STORAGE_SCSI_WRITE32 0xaa
@@ -260,7 +229,7 @@ extern "C" {
#define UX_HOST_CLASS_STORAGE_CSW_LENGTH 13
-/* Define Storage Class SCSI inquiry command constants. */
+/* Define Storage Class SCSI inquiry command constants. */
#define UX_HOST_CLASS_STORAGE_INQUIRY_OPERATION 0
#define UX_HOST_CLASS_STORAGE_INQUIRY_LUN 1
@@ -466,7 +435,7 @@ extern "C" {
typedef struct UX_HOST_CLASS_STORAGE_STRUCT
{
- struct UX_HOST_CLASS_STORAGE_STRUCT
+ struct UX_HOST_CLASS_STORAGE_STRUCT
*ux_host_class_storage_next_instance;
UX_HOST_CLASS *ux_host_class_storage_class;
UX_DEVICE *ux_host_class_storage_device;
@@ -650,7 +619,7 @@ UINT _ux_host_class_storage_media_write(UX_HOST_CLASS_STORAGE *storage, ULONG
UINT _ux_host_class_storage_partition_read(UX_HOST_CLASS_STORAGE *storage, UCHAR *sector_memory, ULONG sector);
UINT _ux_host_class_storage_request_sense(UX_HOST_CLASS_STORAGE *storage);
UINT _ux_host_class_storage_sense_code_translate(UX_HOST_CLASS_STORAGE *storage, UINT status);
-UINT _ux_host_class_storage_start_stop(UX_HOST_CLASS_STORAGE *storage,
+UINT _ux_host_class_storage_start_stop(UX_HOST_CLASS_STORAGE *storage,
ULONG start_stop_signal);
VOID _ux_host_class_storage_thread_entry(ULONG class_address);
UINT _ux_host_class_storage_transport(UX_HOST_CLASS_STORAGE *storage, UCHAR *data_pointer);
@@ -743,10 +712,10 @@ UINT _uxe_host_class_storage_media_lock(UX_HOST_CLASS_STORAGE_MEDIA *storage_
#endif
-/* Determine if a C++ compiler is being used. If so, complete the standard
- C conditional started above. */
+/* Determine if a C++ compiler is being used. If so, complete the standard
+ C conditional started above. */
#ifdef __cplusplus
-}
+}
#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 da2d9f8a..91c41fc8 100644
--- a/common/usbx_host_classes/inc/ux_host_class_swar.h
+++ b/common/usbx_host_classes/inc/ux_host_class_swar.h
@@ -1,18 +1,19 @@
/***************************************************************************
- * Copyright (c) 2024 Microsoft Corporation
- *
+ * Copyright (c) 2024 Microsoft Corporation
+ * Copyright (c) 2026-present Eclipse ThreadX contributors
+ *
* This program and the accompanying materials are made available under the
* terms of the MIT License which is available at
* https://opensource.org/licenses/MIT.
- *
+ *
* SPDX-License-Identifier: MIT
**************************************************************************/
/**************************************************************************/
/**************************************************************************/
-/** */
-/** USBX Component */
+/** */
+/** USBX Component */
/** */
/** Host Sierra Wireless AR module class */
/** */
@@ -20,50 +21,35 @@
/**************************************************************************/
-/**************************************************************************/
-/* */
-/* COMPONENT DEFINITION RELEASE */
-/* */
-/* ux_host_class_swar.h PORTABLE C */
+/**************************************************************************/
+/* */
+/* COMPONENT DEFINITION RELEASE */
+/* */
+/* ux_host_class_swar.h PORTABLE C */
/* 6.1.8 */
/* AUTHOR */
/* */
/* Chaoqiong Xiao, Microsoft Corporation */
/* */
/* DESCRIPTION */
-/* */
+/* */
/* This file contains all the header and extern functions used by the */
-/* USBX Sierra Wireless AR Class. */
-/* */
-/* RELEASE HISTORY */
-/* */
-/* 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 */
-/* 08-02-2021 Wen Wang Modified comment(s), */
-/* added extern "C" keyword */
-/* for compatibility with C++, */
-/* resulting in version 6.1.8 */
+/* USBX Sierra Wireless AR Class. */
/* */
/**************************************************************************/
#ifndef UX_HOST_CLASS_SWAR_H
#define UX_HOST_CLASS_SWAR_H
-/* Determine if a C++ compiler is being used. If so, ensure that standard
- C is used to process the API information. */
+/* Determine if a C++ compiler is being used. If so, ensure that standard
+ C is used to process the API information. */
-#ifdef __cplusplus
+#ifdef __cplusplus
-/* Yes, C++ compiler is present. Use standard C. */
-extern "C" {
+/* Yes, C++ compiler is present. Use standard C. */
+extern "C" {
-#endif
+#endif
/* Internal option: enable the basic USBX error checking. This define is typically used
@@ -78,7 +64,7 @@ extern "C" {
#define UX_HOST_CLASS_SWAR_CLASS_TRANSFER_TIMEOUT 300000
#ifndef UX_HOST_CLASS_SWAR_VENDOR_ID
#define UX_HOST_CLASS_SWAR_VENDOR_ID 0X1199
-#define UX_HOST_CLASS_SWAR_PRODUCT_ID 0X68A3
+#define UX_HOST_CLASS_SWAR_PRODUCT_ID 0X68A3
#endif
/* Define Sierra Wireless AR Class packet equivalences. */
@@ -103,7 +89,7 @@ extern "C" {
typedef struct UX_HOST_CLASS_SWAR_STRUCT
{
- struct UX_HOST_CLASS_SWAR_STRUCT
+ struct UX_HOST_CLASS_SWAR_STRUCT
*ux_host_class_swar_next_instance;
UX_HOST_CLASS *ux_host_class_swar_class;
UX_DEVICE *ux_host_class_swar_device;
@@ -113,7 +99,7 @@ typedef struct UX_HOST_CLASS_SWAR_STRUCT
UINT ux_host_class_swar_state;
UX_SEMAPHORE ux_host_class_swar_semaphore;
- struct UX_HOST_CLASS_SWAR_RECEPTION_STRUCT
+ struct UX_HOST_CLASS_SWAR_RECEPTION_STRUCT
*ux_host_class_swar_reception;
ULONG ux_host_class_swar_notification_count;
} UX_HOST_CLASS_SWAR;
@@ -129,9 +115,9 @@ typedef struct UX_HOST_CLASS_SWAR_RECEPTION_STRUCT
ULONG ux_host_class_swar_reception_data_buffer_size;
UCHAR *ux_host_class_swar_reception_data_head;
UCHAR *ux_host_class_swar_reception_data_tail;
- VOID (*ux_host_class_swar_reception_callback)(struct UX_HOST_CLASS_SWAR_STRUCT *swar,
+ VOID (*ux_host_class_swar_reception_callback)(struct UX_HOST_CLASS_SWAR_STRUCT *swar,
UINT status,
- UCHAR *reception_buffer,
+ UCHAR *reception_buffer,
ULONG reception_size);
} UX_HOST_CLASS_SWAR_RECEPTION;
@@ -143,28 +129,28 @@ UINT _ux_host_class_swar_configure(UX_HOST_CLASS_SWAR *swar);
UINT _ux_host_class_swar_deactivate(UX_HOST_CLASS_COMMAND *command);
UINT _ux_host_class_swar_endpoints_get(UX_HOST_CLASS_SWAR *swar);
UINT _ux_host_class_swar_entry(UX_HOST_CLASS_COMMAND *command);
-UINT _ux_host_class_swar_read (UX_HOST_CLASS_SWAR *swar, UCHAR *data_pointer,
+UINT _ux_host_class_swar_read (UX_HOST_CLASS_SWAR *swar, UCHAR *data_pointer,
ULONG requested_length, ULONG *actual_length);
-UINT _ux_host_class_swar_write(UX_HOST_CLASS_SWAR *swar, UCHAR *data_pointer,
+UINT _ux_host_class_swar_write(UX_HOST_CLASS_SWAR *swar, UCHAR *data_pointer,
ULONG requested_length, ULONG *actual_length);
UINT _ux_host_class_swar_ioctl(UX_HOST_CLASS_SWAR *swar, ULONG ioctl_function,
VOID *parameter);
VOID _ux_host_class_swar_reception_callback (UX_TRANSFER *transfer_request);
-UINT _ux_host_class_swar_reception_stop (UX_HOST_CLASS_SWAR *swar,
+UINT _ux_host_class_swar_reception_stop (UX_HOST_CLASS_SWAR *swar,
UX_HOST_CLASS_SWAR_RECEPTION *swar_reception);
-UINT _ux_host_class_swar_reception_start (UX_HOST_CLASS_SWAR *swar,
+UINT _ux_host_class_swar_reception_start (UX_HOST_CLASS_SWAR *swar,
UX_HOST_CLASS_SWAR_RECEPTION *swar_reception);
-UINT _uxe_host_class_swar_read (UX_HOST_CLASS_SWAR *swar, UCHAR *data_pointer,
+UINT _uxe_host_class_swar_read (UX_HOST_CLASS_SWAR *swar, UCHAR *data_pointer,
ULONG requested_length, ULONG *actual_length);
-UINT _uxe_host_class_swar_write(UX_HOST_CLASS_SWAR *swar, UCHAR *data_pointer,
+UINT _uxe_host_class_swar_write(UX_HOST_CLASS_SWAR *swar, UCHAR *data_pointer,
ULONG requested_length, ULONG *actual_length);
UINT _uxe_host_class_swar_ioctl(UX_HOST_CLASS_SWAR *swar, ULONG ioctl_function,
VOID *parameter);
-UINT _uxe_host_class_swar_reception_stop (UX_HOST_CLASS_SWAR *swar,
+UINT _uxe_host_class_swar_reception_stop (UX_HOST_CLASS_SWAR *swar,
UX_HOST_CLASS_SWAR_RECEPTION *swar_reception);
-UINT _uxe_host_class_swar_reception_start (UX_HOST_CLASS_SWAR *swar,
+UINT _uxe_host_class_swar_reception_start (UX_HOST_CLASS_SWAR *swar,
UX_HOST_CLASS_SWAR_RECEPTION *swar_reception);
/* Define SWAR Class API prototypes. */
@@ -190,10 +176,10 @@ UINT _uxe_host_class_swar_reception_start (UX_HOST_CLASS_SWAR *swar,
#endif
-/* Determine if a C++ compiler is being used. If so, complete the standard
- C conditional started above. */
+/* Determine if a C++ compiler is being used. If so, complete the standard
+ C conditional started above. */
#ifdef __cplusplus
-}
-#endif
+}
+#endif
#endif
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 038ec345..955a9b51 100644
--- a/common/usbx_host_classes/inc/ux_host_class_video.h
+++ b/common/usbx_host_classes/inc/ux_host_class_video.h
@@ -1,10 +1,11 @@
/***************************************************************************
- * Copyright (c) 2024 Microsoft Corporation
- *
+ * Copyright (c) 2024 Microsoft Corporation
+ * Copyright (c) 2026-present Eclipse ThreadX contributors
+ *
* This program and the accompanying materials are made available under the
* terms of the MIT License which is available at
* https://opensource.org/licenses/MIT.
- *
+ *
* SPDX-License-Identifier: MIT
**************************************************************************/
@@ -35,33 +36,6 @@
/* This file contains all the header and extern functions used by the */
/* USBX video class. */
/* */
-/* RELEASE HISTORY */
-/* */
-/* 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 */
-/* 08-02-2021 Wen Wang Modified comment(s), */
-/* added extern "C" keyword */
-/* for compatibility with C++, */
-/* added new definitions */
-/* according to UVC 1.5 Class */
-/* specification, */
-/* resulting in version 6.1.8 */
-/* 10-31-2023 Chaoqiong Xiao Modified comment(s), */
-/* added format and frame data */
-/* fields for H264 support, */
-/* optimized USB descriptors, */
-/* added error checks support, */
-/* resulting in version 6.3.0 */
-/* */
/**************************************************************************/
#ifndef UX_HOST_CLASS_VIDEO_H
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 9e6f0371..e9ba9984 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
@@ -1,18 +1,19 @@
/***************************************************************************
- * Copyright (c) 2024 Microsoft Corporation
- *
+ * Copyright (c) 2024 Microsoft Corporation
+ * Copyright (c) 2026-present Eclipse ThreadX contributors
+ *
* This program and the accompanying materials are made available under the
* terms of the MIT License which is available at
* https://opensource.org/licenses/MIT.
- *
+ *
* SPDX-License-Identifier: MIT
**************************************************************************/
/**************************************************************************/
/**************************************************************************/
-/** */
-/** USBX Component */
+/** */
+/** USBX Component */
/** */
/** Asix Class */
/** */
@@ -29,70 +30,48 @@
#include "ux_host_stack.h"
-/**************************************************************************/
-/* */
-/* FUNCTION RELEASE */
-/* */
-/* _ux_host_class_asix_activate PORTABLE C */
+/**************************************************************************/
+/* */
+/* FUNCTION RELEASE */
+/* */
+/* _ux_host_class_asix_activate PORTABLE C */
/* 6.3.0 */
/* AUTHOR */
/* */
/* Chaoqiong Xiao, Microsoft Corporation */
/* */
/* DESCRIPTION */
-/* */
-/* This function creates the asix instance, configure the device. */
-/* WARNING !!!! The NX_PHYSICAL_HEADER should be set to 20 in nx_api.h */
-/* */
-/* INPUT */
-/* */
-/* command Asix class command pointer */
-/* */
-/* OUTPUT */
-/* */
-/* Completion Status */
-/* */
-/* CALLS */
-/* */
-/* _ux_host_class_asix_configure Configure asix class */
-/* _ux_host_class_asix_endpoints_get Get endpoints of asix */
+/* */
+/* This function creates the asix instance, configure the device. */
+/* WARNING !!!! The NX_PHYSICAL_HEADER should be set to 20 in nx_api.h */
+/* */
+/* INPUT */
+/* */
+/* command Asix class command pointer */
+/* */
+/* OUTPUT */
+/* */
+/* Completion Status */
+/* */
+/* CALLS */
+/* */
+/* _ux_host_class_asix_configure Configure asix class */
+/* _ux_host_class_asix_endpoints_get Get endpoints of asix */
/* _ux_host_class_asix_setup Set up asix */
-/* _ux_host_stack_class_instance_create Create class instance */
-/* _ux_host_stack_class_instance_destroy Destroy the class instance */
+/* _ux_host_stack_class_instance_create Create class instance */
+/* _ux_host_stack_class_instance_destroy Destroy the class instance */
/* _ux_host_stack_transfer_request Transfer request */
-/* _ux_utility_memory_allocate Allocate memory block */
-/* _ux_utility_memory_free Free memory block */
+/* _ux_utility_memory_allocate Allocate memory block */
+/* _ux_utility_memory_free Free memory block */
/* _ux_host_semaphore_create Create semaphore */
/* _ux_host_semaphore_delete Delete semaphore */
/* _ux_utility_thread_create Create thread */
/* _ux_utility_thread_delete Delete thread */
/* nx_packet_pool_create Create NetX packet pool */
-/* */
-/* CALLED BY */
-/* */
-/* _ux_host_class_asix_entry Entry of asix class */
-/* */
-/* RELEASE HISTORY */
-/* */
-/* 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 */
-/* 01-31-2022 Chaoqiong Xiao Modified comment(s), */
-/* refined macros names, */
-/* resulting in version 6.1.10 */
-/* 10-31-2022 Chaoqiong Xiao Modified comment(s), */
-/* moved NX driver activate, */
-/* added reception buffer, */
-/* removed internal NX pool, */
-/* resulting in version 6.2.0 */
-/* 10-31-2023 Chaoqiong Xiao Modified comment(s), */
-/* masked in standalone build, */
-/* resulting in version 6.3.0 */
+/* */
+/* CALLED BY */
+/* */
+/* _ux_host_class_asix_entry Entry of asix class */
/* */
/**************************************************************************/
UINT _ux_host_class_asix_activate(UX_HOST_CLASS_COMMAND *command)
@@ -113,7 +92,7 @@ ULONG physical_address_msw;
ULONG physical_address_lsw;
- /* We need to make sure that the value of the NX_PHYSICAL_HEADER is at least 20.
+ /* We need to make sure that the value of the NX_PHYSICAL_HEADER is at least 20.
This should be changed in the nx_user.h file */
@@ -132,16 +111,16 @@ ULONG physical_address_lsw;
asix -> ux_host_class_asix_device = device;
/* Store the instance in the device container, this is for the USBX stack
- when it needs to invoke the class for deactivation. */
+ when it needs to invoke the class for deactivation. */
device -> ux_device_class_instance = (VOID *) asix;
/* Create this class instance. */
_ux_host_stack_class_instance_create(asix -> ux_host_class_asix_class, (VOID *) asix);
/* Configure the asix class. */
- status = _ux_host_class_asix_configure(asix);
+ status = _ux_host_class_asix_configure(asix);
- /* Get the asix endpoint(s). We need to search for Bulk Out and Bulk In endpoints
+ /* Get the asix endpoint(s). We need to search for Bulk Out and Bulk In endpoints
and the interrupt endpoint. */
if (status == UX_SUCCESS)
status = _ux_host_class_asix_endpoints_get(asix);
@@ -165,7 +144,7 @@ ULONG physical_address_lsw;
/* Allocate a Thread stack. */
if (status == UX_SUCCESS)
{
- asix -> ux_host_class_asix_thread_stack =
+ asix -> ux_host_class_asix_thread_stack =
_ux_utility_memory_allocate(UX_NO_ALIGN, UX_REGULAR_MEMORY, UX_THREAD_STACK_SIZE);
/* Check the completion status. */
@@ -178,13 +157,13 @@ ULONG physical_address_lsw;
{
status = _ux_utility_thread_create(&asix -> ux_host_class_asix_thread,
"ux_asix_thread", _ux_host_class_asix_thread,
- (ULONG) asix,
+ (ULONG) asix,
asix -> ux_host_class_asix_thread_stack,
- UX_THREAD_STACK_SIZE,
+ UX_THREAD_STACK_SIZE,
UX_THREAD_PRIORITY_CLASS,
UX_THREAD_PRIORITY_CLASS,
- TX_NO_TIME_SLICE, UX_AUTO_START);
-
+ UX_NO_TIME_SLICE, UX_AUTO_START);
+
/* Check the completion status. */
if (status != UX_SUCCESS)
status = UX_THREAD_ERROR;
@@ -202,7 +181,7 @@ ULONG physical_address_lsw;
/* The ethernet link is down by default. */
asix -> ux_host_class_asix_link_state = UX_HOST_CLASS_ASIX_LINK_STATE_DOWN;
-
+
/* Start the interrupt pipe now. */
transfer_request = &asix -> ux_host_class_asix_interrupt_endpoint -> ux_endpoint_transfer_request;
status = _ux_host_stack_transfer_request(transfer_request);
@@ -222,12 +201,12 @@ ULONG physical_address_lsw;
/* Setup the physical address of this IP instance. */
physical_address_msw = (ULONG)((asix -> ux_host_class_asix_node_id[0] << 8) | (asix -> ux_host_class_asix_node_id[1]));
- physical_address_lsw = (ULONG)((asix -> ux_host_class_asix_node_id[2] << 24) | (asix -> ux_host_class_asix_node_id[3] << 16) |
+ physical_address_lsw = (ULONG)((asix -> ux_host_class_asix_node_id[2] << 24) | (asix -> ux_host_class_asix_node_id[3] << 16) |
(asix -> ux_host_class_asix_node_id[4] << 8) | (asix -> ux_host_class_asix_node_id[5]));
-
+
/* Register this interface to the NetX USB interface broker. */
- status = _ux_network_driver_activate((VOID *) asix, _ux_host_class_asix_write,
- &asix -> ux_host_class_asix_network_handle,
+ status = _ux_network_driver_activate((VOID *) asix, _ux_host_class_asix_write,
+ &asix -> ux_host_class_asix_network_handle,
physical_address_msw,
physical_address_lsw);
}
@@ -238,12 +217,12 @@ ULONG physical_address_lsw;
/* Mark the asix instance as live now. */
asix -> ux_host_class_asix_state = UX_HOST_CLASS_INSTANCE_LIVE;
-
+
/* If all is fine and the device is mounted, we need to inform the application
if a function has been programmed in the system structure. */
if (_ux_system_host -> ux_system_host_change_function != UX_NULL)
{
-
+
/* Call system change function. */
_ux_system_host -> ux_system_host_change_function(UX_DEVICE_INSERTION, asix -> ux_host_class_asix_class, (VOID *) asix);
}
@@ -255,7 +234,7 @@ ULONG physical_address_lsw;
UX_TRACE_OBJECT_REGISTER(UX_TRACE_HOST_OBJECT_TYPE_INTERFACE, asix, 0, 0, 0)
/* Return completion status. */
- return(UX_SUCCESS);
+ return(UX_SUCCESS);
}
/* There was a problem, so free the resources. */
@@ -265,7 +244,7 @@ ULONG physical_address_lsw;
_ux_utility_memory_free(asix -> ux_host_class_asix_receive_buffer);
/* Free asix -> ux_host_class_asix_thread. */
- if (asix -> ux_host_class_asix_thread.tx_thread_id)
+ if (_ux_host_thread_created(&asix -> ux_host_class_asix_thread))
_ux_utility_thread_delete(&asix -> ux_host_class_asix_thread);
/* Free asix -> ux_host_class_asix_thread_stack. */
@@ -273,11 +252,11 @@ ULONG physical_address_lsw;
_ux_utility_memory_free(asix -> ux_host_class_asix_thread_stack);
/* Free asix -> ux_host_class_asix_interrupt_notification_semaphore. */
- if (asix -> ux_host_class_asix_interrupt_notification_semaphore.tx_semaphore_id != 0)
+ if (_ux_host_semaphore_created(&asix -> ux_host_class_asix_interrupt_notification_semaphore))
_ux_host_semaphore_delete(&asix -> ux_host_class_asix_interrupt_notification_semaphore);
/* Free asix -> ux_host_class_asix_semaphore. */
- if (asix -> ux_host_class_asix_semaphore.tx_semaphore_id != 0)
+ if (_ux_host_semaphore_created(&asix -> ux_host_class_asix_semaphore))
_ux_host_semaphore_delete(&asix -> ux_host_class_asix_semaphore);
/* Destroy class instance. */
@@ -293,4 +272,3 @@ ULONG physical_address_lsw;
return(status);
#endif
}
-
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 515d8c8d..2bb6480b 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
@@ -1,18 +1,19 @@
/***************************************************************************
- * Copyright (c) 2024 Microsoft Corporation
- *
+ * Copyright (c) 2024 Microsoft Corporation
+ * Copyright (c) 2026-present Eclipse ThreadX contributors
+ *
* This program and the accompanying materials are made available under the
* terms of the MIT License which is available at
* https://opensource.org/licenses/MIT.
- *
+ *
* SPDX-License-Identifier: MIT
**************************************************************************/
/**************************************************************************/
/**************************************************************************/
-/** */
-/** USBX Component */
+/** */
+/** USBX Component */
/** */
/** Asix Class */
/** */
@@ -29,53 +30,40 @@
#include "ux_host_stack.h"
-/**************************************************************************/
-/* */
-/* FUNCTION RELEASE */
-/* */
-/* _ux_host_class_asix_configure PORTABLE C */
+/**************************************************************************/
+/* */
+/* FUNCTION RELEASE */
+/* */
+/* _ux_host_class_asix_configure PORTABLE C */
/* 6.3.0 */
/* AUTHOR */
/* */
/* Chaoqiong Xiao, Microsoft Corporation */
/* */
/* DESCRIPTION */
-/* */
+/* */
/* This function calls the USBX stack to do a SET_CONFIGURATION to the */
-/* asix. Once the asix is configured, its interface will be */
-/* activated. The bulk endpoints (1 IN, 1 OUT ) and the optional */
-/* interrupt endpoint are enumerated. */
-/* */
-/* INPUT */
-/* */
-/* asix Pointer to asix class */
-/* */
-/* OUTPUT */
-/* */
-/* Completion Status */
-/* */
-/* CALLS */
-/* */
-/* _ux_host_stack_configuration_interface_get Get interface */
-/* _ux_host_stack_device_configuration_get Get configuration */
-/* _ux_host_stack_device_configuration_select Select configuration */
-/* */
-/* CALLED BY */
-/* */
-/* _ux_host_class_asix_activate Asix class activate */
-/* */
-/* 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 */
-/* 10-31-2023 Chaoqiong Xiao Modified comment(s), */
-/* removed interface link, */
-/* resulting in version 6.3.0 */
+/* asix. Once the asix is configured, its interface will be */
+/* activated. The bulk endpoints (1 IN, 1 OUT ) and the optional */
+/* interrupt endpoint are enumerated. */
+/* */
+/* INPUT */
+/* */
+/* asix Pointer to asix class */
+/* */
+/* OUTPUT */
+/* */
+/* Completion Status */
+/* */
+/* CALLS */
+/* */
+/* _ux_host_stack_configuration_interface_get Get interface */
+/* _ux_host_stack_device_configuration_get Get configuration */
+/* _ux_host_stack_device_configuration_select Select configuration */
+/* */
+/* CALLED BY */
+/* */
+/* _ux_host_class_asix_activate Asix class activate */
/* */
/**************************************************************************/
UINT _ux_host_class_asix_configure(UX_HOST_CLASS_ASIX *asix)
@@ -98,29 +86,29 @@ UX_DEVICE *parent_device;
status = _ux_host_stack_device_configuration_get(asix -> ux_host_class_asix_device, 0, &configuration);
if (status != UX_SUCCESS)
{
-
+
/* Error trap. */
_ux_system_error_handler(UX_SYSTEM_LEVEL_THREAD, UX_SYSTEM_CONTEXT_CLASS, UX_CONFIGURATION_HANDLE_UNKNOWN);
/* If trace is enabled, insert this event into the trace buffer. */
UX_TRACE_IN_LINE_INSERT(UX_TRACE_ERROR, UX_CONFIGURATION_HANDLE_UNKNOWN, asix -> ux_host_class_asix_device, 0, 0, UX_TRACE_ERRORS, 0, 0)
-
+
return(UX_CONFIGURATION_HANDLE_UNKNOWN);
}
#if UX_MAX_DEVICES > 1
- /* Check the asix power source and check the parent power source for
+ /* 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)
{
/* Get parent device pointer. */
parent_device = asix -> ux_host_class_asix_device -> ux_device_parent;
-
- /* If the device is NULL, the parent is the root asix and we don't have to worry
+
+ /* If the device is NULL, the parent is the root asix and we don't have to worry
if the parent is not the root asix, check for its power source. */
if ((parent_device != UX_NULL) && (parent_device -> ux_device_power_source == UX_DEVICE_BUS_POWERED))
- {
+ {
/* Error trap. */
_ux_system_error_handler(UX_SYSTEM_LEVEL_THREAD, UX_SYSTEM_CONTEXT_CLASS, UX_CONNECTION_INCOMPATIBLE);
@@ -129,17 +117,17 @@ UX_DEVICE *parent_device;
UX_TRACE_IN_LINE_INSERT(UX_TRACE_ERROR, UX_CONNECTION_INCOMPATIBLE, asix, 0, 0, UX_TRACE_ERRORS, 0, 0)
return(UX_CONNECTION_INCOMPATIBLE);
- }
+ }
}
#endif
- /* We have the valid configuration. Ask the USBX stack to set this configuration. */
+ /* 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)
return(status);
- /* If the operation went well, the asix default alternate setting for the asix interface is
- active and the interrupt endpoint is now enabled. We have to memorize the first interface since
+ /* If the operation went well, the asix default alternate setting for the asix interface is
+ active and the interrupt endpoint is now enabled. We have to memorize the first interface since
the interrupt endpoint is hooked to it. */
status = _ux_host_stack_configuration_interface_get(configuration, 0, 0, &asix -> ux_host_class_asix_interface);
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 1fd65d24..f79fbf83 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
@@ -1,18 +1,19 @@
/***************************************************************************
- * Copyright (c) 2024 Microsoft Corporation
- *
+ * Copyright (c) 2024 Microsoft Corporation
+ * Copyright (c) 2026-present Eclipse ThreadX contributors
+ *
* This program and the accompanying materials are made available under the
* terms of the MIT License which is available at
* https://opensource.org/licenses/MIT.
- *
+ *
* SPDX-License-Identifier: MIT
**************************************************************************/
/**************************************************************************/
/**************************************************************************/
-/** */
-/** USBX Component */
+/** */
+/** USBX Component */
/** */
/** Asix Class */
/** */
@@ -30,65 +31,45 @@
#if !defined(UX_HOST_STANDALONE)
-/**************************************************************************/
-/* */
-/* FUNCTION RELEASE */
-/* */
-/* _ux_host_class_asix_deactivate PORTABLE C */
+/**************************************************************************/
+/* */
+/* FUNCTION RELEASE */
+/* */
+/* _ux_host_class_asix_deactivate PORTABLE C */
/* 6.2.0 */
/* AUTHOR */
/* */
/* Chaoqiong Xiao, Microsoft Corporation */
/* */
/* DESCRIPTION */
-/* */
+/* */
/* This function is called when this instance of the asix has been */
-/* removed from the bus either directly or indirectly. The bulk in\out */
-/* and interrupt pipes will be destroyed and the instance */
-/* removed. */
-/* */
-/* INPUT */
-/* */
-/* command Asix class command pointer */
-/* */
-/* OUTPUT */
-/* */
-/* Completion Status */
-/* */
-/* CALLS */
-/* */
-/* _ux_host_stack_class_instance_destroy Destroy the class instance */
-/* _ux_host_stack_endpoint_transfer_abort Abort endpoint transfer */
-/* _ux_utility_memory_free Free memory block */
-/* _ux_host_semaphore_get Get protection semaphore */
-/* _ux_host_semaphore_delete Delete protection semaphore */
+/* removed from the bus either directly or indirectly. The bulk in\out */
+/* and interrupt pipes will be destroyed and the instance */
+/* removed. */
+/* */
+/* INPUT */
+/* */
+/* command Asix class command pointer */
+/* */
+/* OUTPUT */
+/* */
+/* Completion Status */
+/* */
+/* CALLS */
+/* */
+/* _ux_host_stack_class_instance_destroy Destroy the class instance */
+/* _ux_host_stack_endpoint_transfer_abort Abort endpoint transfer */
+/* _ux_utility_memory_free Free memory block */
+/* _ux_host_semaphore_get Get protection semaphore */
+/* _ux_host_semaphore_delete Delete protection semaphore */
/* _ux_utility_thread_delete Delete thread */
/* _ux_network_driver_deactivate Deactivate NetX USB interface */
/* nx_packet_transmit_release Release NetX packet */
-/* */
-/* CALLED BY */
-/* */
-/* _ux_host_class_asix_entry Entry of asix class */
-/* */
-/* RELEASE HISTORY */
-/* */
-/* DATE NAME DESCRIPTION */
-/* */
-/* 05-19-2020 Chaoqiong Xiao Initial Version 6.0 */
-/* 09-30-2020 Chaoqiong Xiao Modified comment(s), */
-/* resulting in version 6.1 */
-/* 01-31-2022 Chaoqiong Xiao Modified comment(s), */
-/* refined macros names, */
-/* resulting in version 6.1.10 */
-/* 04-25-2022 Chaoqiong Xiao Modified comment(s), */
-/* internal clean up, */
-/* fixed standalone compile, */
-/* resulting in version 6.1.11 */
-/* 10-31-2022 Chaoqiong Xiao Modified comment(s), */
-/* supported NX packet chain, */
-/* added reception buffer, */
-/* removed internal NX pool, */
-/* resulting in version 6.2.0 */
+/* */
+/* CALLED BY */
+/* */
+/* _ux_host_class_asix_entry Entry of asix class */
/* */
/**************************************************************************/
UINT _ux_host_class_asix_deactivate(UX_HOST_CLASS_COMMAND *command)
@@ -112,39 +93,39 @@ UINT status;
/* The asix is being shut down. */
asix -> ux_host_class_asix_state = UX_HOST_CLASS_INSTANCE_SHUTDOWN;
-
-
+
+
/* Check if link was up. */
if (asix -> ux_host_class_asix_link_state == UX_HOST_CLASS_ASIX_LINK_STATE_UP)
{
/* We need to free the packets that will not be sent. */
current_packet = asix -> ux_host_class_asix_xmit_queue;
-
+
/* Get the next packet associated with the first packet. */
next_packet = current_packet -> nx_packet_queue_next;
-
+
/* Parse all these packets that were scheduled. */
while (current_packet != UX_NULL)
{
-
+
/* Free the packet that was just sent. First do some housekeeping. */
- current_packet -> nx_packet_prepend_ptr = current_packet -> nx_packet_prepend_ptr + UX_HOST_CLASS_ASIX_ETHERNET_SIZE;
+ current_packet -> nx_packet_prepend_ptr = current_packet -> nx_packet_prepend_ptr + UX_HOST_CLASS_ASIX_ETHERNET_SIZE;
current_packet -> nx_packet_length = current_packet -> nx_packet_length - UX_HOST_CLASS_ASIX_ETHERNET_SIZE;
/* And ask Netx to release it. */
- nx_packet_transmit_release(current_packet);
-
+ nx_packet_transmit_release(current_packet);
+
/* Next packet becomes the current one. */
current_packet = next_packet;
-
+
/* Next packet now. */
if (current_packet != UX_NULL)
/* Get the next packet associated with the first packet. */
next_packet = current_packet -> nx_packet_queue_next;
-
+
}
-
+
}
/* Now the link is down. */
@@ -152,40 +133,40 @@ UINT status;
/* Deregister this interface to the NetX USB interface broker. */
_ux_network_driver_deactivate((VOID *) asix, asix -> ux_host_class_asix_network_handle);
-
+
/* If the interrupt endpoint is defined, clean any pending transfer. */
if (asix -> ux_host_class_asix_interrupt_endpoint != UX_NULL)
- {
-
+ {
+
/* Wait for any current transfer to be out of pending. */
transfer_request = &asix -> ux_host_class_asix_interrupt_endpoint -> ux_endpoint_transfer_request;
if (transfer_request -> ux_transfer_request_completion_code == UX_TRANSFER_STATUS_PENDING)
/* And abort any transfer. */
_ux_host_stack_endpoint_transfer_abort(asix -> ux_host_class_asix_interrupt_endpoint);
-
+
/* And free the memory used by the interrupt endpoint. */
_ux_utility_memory_free(transfer_request -> ux_transfer_request_data_pointer);
-
+
}
-
+
/* First we take care of cleaning endpoint IN. */
transfer_request = &asix -> ux_host_class_asix_bulk_in_endpoint -> ux_endpoint_transfer_request;
if (transfer_request -> ux_transfer_request_completion_code == UX_TRANSFER_STATUS_PENDING)
/* We need to abort transactions on the bulk In pipe. */
_ux_host_stack_endpoint_transfer_abort(asix -> ux_host_class_asix_bulk_in_endpoint);
-
- /* Then endpoint OUT. */
+
+ /* Then endpoint OUT. */
transfer_request = &asix -> ux_host_class_asix_bulk_out_endpoint -> ux_endpoint_transfer_request;
if (transfer_request -> ux_transfer_request_completion_code == UX_TRANSFER_STATUS_PENDING)
-
+
/* We need to abort transactions on the bulk Out pipe. We normally don't need that anymore. */
_ux_host_stack_endpoint_transfer_abort(asix -> ux_host_class_asix_bulk_out_endpoint);
-
+
/* The enumeration thread needs to sleep a while to allow the application or the class that may be using
endpoints to exit properly. */
- _ux_host_thread_schedule_other(UX_THREAD_PRIORITY_ENUM);
+ _ux_host_thread_schedule_other(UX_THREAD_PRIORITY_ENUM);
/* Destroy the instance. */
_ux_host_stack_class_instance_destroy(asix -> ux_host_class_asix_class, (VOID *) asix);
@@ -193,10 +174,10 @@ UINT status;
/* Destroy the semaphores. */
_ux_host_semaphore_delete(&asix -> ux_host_class_asix_semaphore);
_ux_host_semaphore_delete(&asix -> ux_host_class_asix_interrupt_notification_semaphore);
-
+
/* Destroy the link monitoring thread. */
_ux_utility_thread_delete(&asix -> ux_host_class_asix_thread);
-
+
/* free its stack memory. */
_ux_utility_memory_free(asix -> ux_host_class_asix_thread_stack);
@@ -214,7 +195,7 @@ UINT status;
that the device is removed. */
if (_ux_system_host -> ux_system_host_change_function != UX_NULL)
{
-
+
/* Inform the application the device is removed. */
_ux_system_host -> ux_system_host_change_function(UX_DEVICE_REMOVAL, asix -> ux_host_class_asix_class, (VOID *) asix);
}
@@ -229,6 +210,6 @@ UINT status;
_ux_utility_memory_free(asix);
/* Return successful status. */
- return(UX_SUCCESS);
+ return(UX_SUCCESS);
}
#endif
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 4fb64211..9077987b 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
@@ -1,18 +1,19 @@
/***************************************************************************
- * Copyright (c) 2024 Microsoft Corporation
- *
+ * Copyright (c) 2024 Microsoft Corporation
+ * Copyright (c) 2026-present Eclipse ThreadX contributors
+ *
* This program and the accompanying materials are made available under the
* terms of the MIT License which is available at
* https://opensource.org/licenses/MIT.
- *
+ *
* SPDX-License-Identifier: MIT
**************************************************************************/
/**************************************************************************/
/**************************************************************************/
-/** */
-/** USBX Component */
+/** */
+/** USBX Component */
/** */
/** Asix Class */
/** */
@@ -29,55 +30,39 @@
#include "ux_host_stack.h"
-/**************************************************************************/
-/* */
-/* FUNCTION RELEASE */
-/* */
-/* _ux_host_class_asix_endpoints_get PORTABLE C */
+/**************************************************************************/
+/* */
+/* FUNCTION RELEASE */
+/* */
+/* _ux_host_class_asix_endpoints_get PORTABLE C */
/* 6.2.0 */
/* AUTHOR */
/* */
/* Chaoqiong Xiao, Microsoft Corporation */
/* */
/* DESCRIPTION */
-/* */
+/* */
/* This function distinguishes for either the Data or Control Class. */
-/* For the data class, we mount the bulk in and bulk out endpoints. */
-/* For the control class, we mount the optional interrupt endpoint. */
-/* */
-/* INPUT */
-/* */
-/* asix Pointer to asix class */
-/* */
-/* OUTPUT */
-/* */
-/* Completion Status */
-/* */
-/* CALLS */
-/* */
-/* _ux_host_stack_interface_endpoint_get Get interface endpoint */
+/* For the data class, we mount the bulk in and bulk out endpoints. */
+/* For the control class, we mount the optional interrupt endpoint. */
+/* */
+/* INPUT */
+/* */
+/* asix Pointer to asix class */
+/* */
+/* OUTPUT */
+/* */
+/* Completion Status */
+/* */
+/* CALLS */
+/* */
+/* _ux_host_stack_interface_endpoint_get Get interface endpoint */
/* _ux_host_stack_transfer_request Transfer request */
/* _ux_utility_memory_allocate Allocate memory */
-/* */
-/* CALLED BY */
-/* */
-/* _ux_host_class_asix_activate Activate asix class */
-/* */
-/* RELEASE HISTORY */
-/* */
-/* DATE NAME DESCRIPTION */
-/* */
-/* 05-19-2020 Chaoqiong Xiao Initial Version 6.0 */
-/* 09-30-2020 Chaoqiong Xiao Modified comment(s), */
-/* resulting in version 6.1 */
-/* 10-15-2021 Chaoqiong Xiao Modified comment(s), */
-/* use pre-calculated value */
-/* instead of wMaxPacketSize, */
-/* resulting in version 6.1.9 */
-/* 10-31-2022 Chaoqiong Xiao Modified comment(s), */
-/* removed packet RX callback, */
-/* refined INT EP start time, */
-/* resulting in version 6.2.0 */
+/* */
+/* CALLED BY */
+/* */
+/* _ux_host_class_asix_activate Activate asix class */
/* */
/**************************************************************************/
UINT _ux_host_class_asix_endpoints_get(UX_HOST_CLASS_ASIX *asix)
@@ -88,31 +73,31 @@ UINT endpoint_index;
UX_ENDPOINT *endpoint;
UX_TRANSFER *transfer_request;
-
+
/* Search the bulk OUT endpoint. It is attached to the interface container. */
for (endpoint_index = 0; endpoint_index < asix -> ux_host_class_asix_interface -> ux_interface_descriptor.bNumEndpoints;
endpoint_index++)
- {
-
+ {
+
/* Get interface endpoint. */
status = _ux_host_stack_interface_endpoint_get(asix -> ux_host_class_asix_interface, endpoint_index, &endpoint);
-
+
/* Check the completion status. */
if (status == UX_SUCCESS)
{
-
+
/* Check if endpoint is bulk and OUT. */
if (((endpoint -> ux_endpoint_descriptor.bEndpointAddress & UX_ENDPOINT_DIRECTION) == UX_ENDPOINT_OUT) &&
((endpoint -> ux_endpoint_descriptor.bmAttributes & UX_MASK_ENDPOINT_TYPE) == UX_BULK_ENDPOINT))
{
-
+
/* This transfer_request always have the OUT direction. */
endpoint -> ux_endpoint_transfer_request.ux_transfer_request_type = UX_REQUEST_OUT;
/* There is a callback function associated with the transfer request, so we need the class instance. */
endpoint -> ux_endpoint_transfer_request.ux_transfer_request_class_instance = (VOID *) asix;
-
+
/* The transfer request has a callback function. */
endpoint -> ux_endpoint_transfer_request.ux_transfer_request_completion_function = _ux_host_class_asix_transmission_callback;
@@ -120,9 +105,9 @@ UX_TRANSFER *transfer_request;
asix -> ux_host_class_asix_bulk_out_endpoint = endpoint;
break;
}
- }
- }
-
+ }
+ }
+
/* The bulk out endpoint is mandatory. */
if (asix -> ux_host_class_asix_bulk_out_endpoint == UX_NULL)
{
@@ -135,24 +120,24 @@ UX_TRANSFER *transfer_request;
return(UX_ENDPOINT_HANDLE_UNKNOWN);
}
-
+
/* Search the bulk IN endpoint. It is attached to the interface container. */
for (endpoint_index = 0; endpoint_index < asix -> ux_host_class_asix_interface -> ux_interface_descriptor.bNumEndpoints;
endpoint_index++)
- {
-
+ {
+
/* Get the endpoint handle. */
status = _ux_host_stack_interface_endpoint_get(asix -> ux_host_class_asix_interface, endpoint_index, &endpoint);
-
+
/* Check the completion status. */
if (status == UX_SUCCESS)
{
-
+
/* Check if endpoint is bulk and IN. */
if (((endpoint -> ux_endpoint_descriptor.bEndpointAddress & UX_ENDPOINT_DIRECTION) == UX_ENDPOINT_IN) &&
((endpoint -> ux_endpoint_descriptor.bmAttributes & UX_MASK_ENDPOINT_TYPE) == UX_BULK_ENDPOINT))
{
-
+
/* This transfer_request always have the IN direction. */
endpoint -> ux_endpoint_transfer_request.ux_transfer_request_type = UX_REQUEST_IN;
@@ -163,13 +148,13 @@ UX_TRANSFER *transfer_request;
asix -> ux_host_class_asix_bulk_in_endpoint = endpoint;
break;
}
- }
- }
+ }
+ }
/* The bulk in endpoint is mandatory. */
if (asix -> ux_host_class_asix_bulk_in_endpoint == UX_NULL)
{
-
+
/* Error trap. */
_ux_system_error_handler(UX_SYSTEM_LEVEL_THREAD, UX_SYSTEM_CONTEXT_CLASS, UX_ENDPOINT_HANDLE_UNKNOWN);
@@ -178,27 +163,27 @@ UX_TRANSFER *transfer_request;
return(UX_ENDPOINT_HANDLE_UNKNOWN);
}
-
+
/* Search the Interrupt endpoint. It is mandatory. */
for (endpoint_index = 0; endpoint_index < asix -> ux_host_class_asix_interface -> ux_interface_descriptor.bNumEndpoints;
endpoint_index++)
- {
-
+ {
+
/* Get the endpoint handle. */
status = _ux_host_stack_interface_endpoint_get(asix -> ux_host_class_asix_interface, endpoint_index, &endpoint);
-
+
/* Check the completion status. */
if (status == UX_SUCCESS)
{
-
+
/* Check if endpoint is Interrupt and IN. */
if (((endpoint -> ux_endpoint_descriptor.bEndpointAddress & UX_ENDPOINT_DIRECTION) == UX_ENDPOINT_IN) &&
((endpoint -> ux_endpoint_descriptor.bmAttributes & UX_MASK_ENDPOINT_TYPE) == UX_INTERRUPT_ENDPOINT))
{
-
+
/* This transfer_request always have the IN direction. */
endpoint -> ux_endpoint_transfer_request.ux_transfer_request_type = UX_REQUEST_IN;
-
+
/* We have found the interrupt endpoint, save it. */
asix -> ux_host_class_asix_interrupt_endpoint = endpoint;
@@ -217,7 +202,7 @@ UX_TRANSFER *transfer_request;
transfer_request -> ux_transfer_request_completion_function = _ux_host_class_asix_interrupt_notification;
/* Obtain a buffer for this transaction. The buffer will always be reused. */
- transfer_request -> ux_transfer_request_data_pointer = _ux_utility_memory_allocate(UX_SAFE_ALIGN, UX_CACHE_SAFE_MEMORY,
+ transfer_request -> ux_transfer_request_data_pointer = _ux_utility_memory_allocate(UX_SAFE_ALIGN, UX_CACHE_SAFE_MEMORY,
transfer_request -> ux_transfer_request_requested_length);
/* If the endpoint is available and we have memory, it's started later after setup. */
@@ -233,11 +218,11 @@ UX_TRANSFER *transfer_request;
/* We must return an error. */
return(UX_ENDPOINT_HANDLE_UNKNOWN);
}
-
+
break;
}
- }
- }
+ }
+ }
/* The interrupt endpoint is mandatory. */
if (asix -> ux_host_class_asix_interrupt_endpoint == UX_NULL)
@@ -251,8 +236,8 @@ UX_TRANSFER *transfer_request;
return(UX_ENDPOINT_HANDLE_UNKNOWN);
}
- else
-
+ else
+
/* All endpoints have been mounted. */
return(UX_SUCCESS);
}
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 bd0f7513..06db90d8 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
@@ -1,18 +1,19 @@
/***************************************************************************
- * Copyright (c) 2024 Microsoft Corporation
- *
+ * Copyright (c) 2024 Microsoft Corporation
+ * Copyright (c) 2026-present Eclipse ThreadX contributors
+ *
* This program and the accompanying materials are made available under the
* terms of the MIT License which is available at
* https://opensource.org/licenses/MIT.
- *
+ *
* SPDX-License-Identifier: MIT
**************************************************************************/
/**************************************************************************/
/**************************************************************************/
-/** */
-/** USBX Component */
+/** */
+/** USBX Component */
/** */
/** Asix Class */
/** */
@@ -34,54 +35,39 @@ static inline UINT _ux_host_class_asix_try_all_vid_pids(UX_HOST_CLASS_COMMAND *c
#endif
-/**************************************************************************/
-/* */
-/* FUNCTION RELEASE */
-/* */
-/* _ux_host_class_asix_entry PORTABLE C */
+/**************************************************************************/
+/* */
+/* FUNCTION RELEASE */
+/* */
+/* _ux_host_class_asix_entry PORTABLE C */
/* 6.2.0 */
/* AUTHOR */
/* */
/* Chaoqiong Xiao, Microsoft Corporation */
/* */
/* DESCRIPTION */
-/* */
-/* This function is the entry point of the asix class. It will be */
-/* called by the USBX stack enumeration module when there is a new */
-/* asix ethernet device on the bus or when the it is removed. */
-/* */
-/* */
-/* INPUT */
-/* */
+/* */
+/* This function is the entry point of the asix class. It will be */
+/* called by the USBX stack enumeration module when there is a new */
+/* asix ethernet device on the bus or when the it is removed. */
+/* */
+/* */
+/* INPUT */
+/* */
/* command Asix class command */
-/* */
-/* OUTPUT */
-/* */
-/* Completion Status */
-/* */
-/* CALLS */
-/* */
-/* _ux_host_class_asix_activate Activate asix class */
-/* _ux_host_class_asix_deactivate Deactivate asix class */
-/* */
-/* CALLED BY */
-/* */
-/* Asix Class */
-/* */
-/* RELEASE HISTORY */
-/* */
-/* DATE NAME DESCRIPTION */
-/* */
-/* 05-19-2020 Chaoqiong Xiao Initial Version 6.0 */
-/* 09-30-2020 Chaoqiong Xiao Modified comment(s), */
-/* resulting in version 6.1 */
-/* 04-25-2022 Chaoqiong Xiao Modified comment(s), */
-/* fixed standalone compile, */
-/* resulting in version 6.1.11 */
-/* 10-31-2022 Chaoqiong Xiao Modified comment(s), */
-/* fixed compile warning, */
-/* refined VID/PID check flow, */
-/* resulting in version 6.2.0 */
+/* */
+/* OUTPUT */
+/* */
+/* Completion Status */
+/* */
+/* CALLS */
+/* */
+/* _ux_host_class_asix_activate Activate asix class */
+/* _ux_host_class_asix_deactivate Deactivate asix class */
+/* */
+/* CALLED BY */
+/* */
+/* Asix Class */
/* */
/**************************************************************************/
UINT _ux_host_class_asix_entry(UX_HOST_CLASS_COMMAND *command)
@@ -103,15 +89,15 @@ 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_PIDVID)
+ if(command -> ux_host_class_command_usage == UX_HOST_CLASS_COMMAND_USAGE_PIDVID)
{
if (_ux_host_class_asix_try_all_vid_pids(command) == UX_SUCCESS)
return(UX_SUCCESS);
}
-
+
/* No match. */
- return(UX_NO_CLASS_MATCH);
-
+ return(UX_NO_CLASS_MATCH);
+
case UX_HOST_CLASS_COMMAND_ACTIVATE:
/* The activate command is used when the device inserted has found a parent and
@@ -121,13 +107,13 @@ UINT status;
case UX_HOST_CLASS_COMMAND_DEACTIVATE:
- /* The deactivate command is used when the device has been extracted either
+ /* The deactivate command is used when the device has been extracted either
directly or when its parents has been extracted. */
status = _ux_host_class_asix_deactivate(command);
return(status);
- default:
-
+ default:
+
/* Error trap. */
_ux_system_error_handler(UX_SYSTEM_LEVEL_THREAD, UX_SYSTEM_CONTEXT_CLASS, UX_FUNCTION_NOT_SUPPORTED);
@@ -135,7 +121,7 @@ UINT status;
UX_TRACE_IN_LINE_INSERT(UX_TRACE_ERROR, UX_FUNCTION_NOT_SUPPORTED, 0, 0, 0, UX_TRACE_ERRORS, 0, 0)
return(UX_FUNCTION_NOT_SUPPORTED);
- }
+ }
#endif
}
#if !defined(UX_HOST_STANDALONE)
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 7fd9956f..36378cd5 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
@@ -1,18 +1,19 @@
/***************************************************************************
- * Copyright (c) 2024 Microsoft Corporation
- *
+ * Copyright (c) 2024 Microsoft Corporation
+ * Copyright (c) 2026-present Eclipse ThreadX contributors
+ *
* This program and the accompanying materials are made available under the
* terms of the MIT License which is available at
* https://opensource.org/licenses/MIT.
- *
+ *
* SPDX-License-Identifier: MIT
**************************************************************************/
/**************************************************************************/
/**************************************************************************/
-/** */
-/** USBX Component */
+/** */
+/** USBX Component */
/** */
/** ASIX Class */
/** */
@@ -29,56 +30,37 @@
#include "ux_host_stack.h"
-/**************************************************************************/
-/* */
-/* FUNCTION RELEASE */
-/* */
-/* _ux_host_class_asix_interrupt_notification PORTABLE C */
+/**************************************************************************/
+/* */
+/* FUNCTION RELEASE */
+/* */
+/* _ux_host_class_asix_interrupt_notification PORTABLE C */
/* 6.2.0 */
/* AUTHOR */
/* */
/* Chaoqiong Xiao, Microsoft Corporation */
/* */
/* DESCRIPTION */
-/* */
-/* This function is called by the stack when an interrupt packet as */
-/* been received. */
-/* */
-/* INPUT */
-/* */
-/* transfer_request Pointer to transfer request */
-/* */
-/* OUTPUT */
-/* */
-/* None */
-/* */
-/* CALLS */
-/* */
+/* */
+/* This function is called by the stack when an interrupt packet as */
+/* been received. */
+/* */
+/* INPUT */
+/* */
+/* transfer_request Pointer to transfer request */
+/* */
+/* OUTPUT */
+/* */
+/* None */
+/* */
+/* CALLS */
+/* */
/* _ux_host_semaphore_put Put semaphore */
/* _ux_host_stack_transfer_request Transfer request */
-/* */
-/* CALLED BY */
-/* */
-/* USBX stack */
-/* */
-/* RELEASE HISTORY */
-/* */
-/* DATE NAME DESCRIPTION */
-/* */
-/* 05-19-2020 Chaoqiong Xiao Initial Version 6.0 */
-/* 09-30-2020 Chaoqiong Xiao Modified comment(s), */
-/* resulting in version 6.1 */
-/* 10-15-2021 Chaoqiong Xiao Modified comment(s), */
-/* use pre-calculated value */
-/* instead of wMaxPacketSize, */
-/* resulting in version 6.1.9 */
-/* 01-31-2022 Chaoqiong Xiao Modified comment(s), */
-/* refined macros names, */
-/* resulting in version 6.1.10 */
-/* 10-31-2022 Chaoqiong Xiao Modified comment(s), */
-/* refined link up/down flow, */
-/* refined interrupt flow, */
-/* resulting in version 6.2.0 */
+/* */
+/* CALLED BY */
+/* */
+/* USBX stack */
/* */
/**************************************************************************/
VOID _ux_host_class_asix_interrupt_notification(UX_TRANSFER *transfer_request)
@@ -88,7 +70,7 @@ UX_HOST_CLASS_ASIX *asix;
/* Get the class instance for this transfer request. */
asix = (UX_HOST_CLASS_ASIX *) transfer_request -> ux_transfer_request_class_instance;
-
+
/* Check the state of the transfer. If there is an error, we do not proceed with this notification. */
if (transfer_request -> ux_transfer_request_completion_code != UX_SUCCESS)
@@ -105,12 +87,12 @@ UX_HOST_CLASS_ASIX *asix;
asix -> ux_host_class_asix_notification_count++;
/* Ensure the length of our interrupt pipe data is correct. */
- if (transfer_request -> ux_transfer_request_actual_length ==
+ if (transfer_request -> ux_transfer_request_actual_length ==
transfer_request -> ux_transfer_request_requested_length)
{
/* Check if the first byte is a interrupt packet signature. */
- if (*(transfer_request -> ux_transfer_request_data_pointer + UX_HOST_CLASS_ASIX_INTERRUPT_SIGNATURE_OFFSET) ==
+ if (*(transfer_request -> ux_transfer_request_data_pointer + UX_HOST_CLASS_ASIX_INTERRUPT_SIGNATURE_OFFSET) ==
UX_HOST_CLASS_ASIX_INTERRUPT_SIGNATURE_VALUE)
{
@@ -120,28 +102,28 @@ UX_HOST_CLASS_ASIX *asix;
{
/* Link is up. See if we know about that. */
- if (asix -> ux_host_class_asix_link_state != UX_HOST_CLASS_ASIX_LINK_STATE_UP &&
+ if (asix -> ux_host_class_asix_link_state != UX_HOST_CLASS_ASIX_LINK_STATE_UP &&
asix -> ux_host_class_asix_link_state != UX_HOST_CLASS_ASIX_LINK_STATE_PENDING_UP)
{
-
+
/* Memorize the new link state. */
- asix -> ux_host_class_asix_link_state = UX_HOST_CLASS_ASIX_LINK_STATE_PENDING_UP;
-
+ asix -> ux_host_class_asix_link_state = UX_HOST_CLASS_ASIX_LINK_STATE_PENDING_UP;
+
/* We need to inform the asix thread of this change. */
_ux_host_semaphore_put(&asix -> ux_host_class_asix_interrupt_notification_semaphore);
/* Reactivate interrupt pipe after link up handled. */
return;
}
- }
+ }
else
{
/* Link is down. See if we know about that. */
- if (asix -> ux_host_class_asix_link_state != UX_HOST_CLASS_ASIX_LINK_STATE_DOWN &&
+ if (asix -> ux_host_class_asix_link_state != UX_HOST_CLASS_ASIX_LINK_STATE_DOWN &&
asix -> ux_host_class_asix_link_state != UX_HOST_CLASS_ASIX_LINK_STATE_PENDING_DOWN)
{
-
+
/* Memorize the new link state. */
asix -> ux_host_class_asix_link_state = UX_HOST_CLASS_ASIX_LINK_STATE_PENDING_DOWN;
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 b8553bc1..730d0666 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
@@ -1,18 +1,19 @@
/***************************************************************************
- * Copyright (c) 2024 Microsoft Corporation
- *
+ * Copyright (c) 2024 Microsoft Corporation
+ * Copyright (c) 2026-present Eclipse ThreadX contributors
+ *
* This program and the accompanying materials are made available under the
* terms of the MIT License which is available at
* https://opensource.org/licenses/MIT.
- *
+ *
* SPDX-License-Identifier: MIT
**************************************************************************/
/**************************************************************************/
/**************************************************************************/
-/** */
-/** USBX Component */
+/** */
+/** USBX Component */
/** */
/** Asix Class */
/** */
@@ -29,70 +30,58 @@
#include "ux_host_stack.h"
-/**************************************************************************/
-/* */
-/* FUNCTION RELEASE */
-/* */
-/* _ux_host_class_asix_read PORTABLE C */
+/**************************************************************************/
+/* */
+/* FUNCTION RELEASE */
+/* */
+/* _ux_host_class_asix_read PORTABLE C */
/* 6.1.10 */
/* AUTHOR */
/* */
/* Chaoqiong Xiao, Microsoft Corporation */
/* */
/* DESCRIPTION */
-/* */
-/* This function reads from the asix interface. The call is */
-/* blocking and only returns when there is either an error or when */
+/* */
+/* This function reads from the asix interface. The call is */
+/* blocking and only returns when there is either an error or when */
/* the transfer is complete. */
/* */
-/* INPUT */
-/* */
-/* asix Pointer to asix class */
+/* INPUT */
+/* */
+/* asix Pointer to asix class */
/* data_pointer Pointer to buffer */
/* requested_length Requested data read */
/* actual_length Actual data read */
-/* */
-/* OUTPUT */
-/* */
-/* Completion Status */
-/* */
-/* CALLS */
-/* */
-/* _ux_host_stack_transfer_request Process transfer request */
-/* _ux_host_stack_transfer_request_abort Abort transfer request */
-/* _ux_host_semaphore_get Get protection semaphore */
-/* */
-/* 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), */
-/* prefixed UX to MS_TO_TICK, */
-/* resulting in version 6.1 */
-/* 01-31-2022 Chaoqiong Xiao Modified comment(s), */
-/* refined macros names, */
-/* resulting in version 6.1.10 */
+/* */
+/* OUTPUT */
+/* */
+/* Completion Status */
+/* */
+/* CALLS */
+/* */
+/* _ux_host_stack_transfer_request Process transfer request */
+/* _ux_host_stack_transfer_request_abort Abort transfer request */
+/* _ux_host_semaphore_get Get protection semaphore */
+/* */
+/* CALLED BY */
+/* */
+/* Application */
/* */
/**************************************************************************/
-UINT _ux_host_class_asix_read (UX_HOST_CLASS_ASIX *asix, UCHAR *data_pointer,
+UINT _ux_host_class_asix_read (UX_HOST_CLASS_ASIX *asix, UCHAR *data_pointer,
ULONG requested_length, ULONG *actual_length)
{
UX_TRANSFER *transfer_request;
UINT status;
ULONG transfer_request_length;
-
+
/* If trace is enabled, insert this event into the trace buffer. */
UX_TRACE_IN_LINE_INSERT(UX_TRACE_HOST_CLASS_ASIX_READ, asix, data_pointer, requested_length, 0, UX_TRACE_HOST_CLASS_EVENTS, 0, 0)
/* Ensure the instance is valid. */
if (asix -> ux_host_class_asix_state != UX_HOST_CLASS_INSTANCE_LIVE)
- {
+ {
/* Error trap. */
_ux_system_error_handler(UX_SYSTEM_LEVEL_THREAD, UX_SYSTEM_CONTEXT_CLASS, UX_HOST_CLASS_INSTANCE_UNKNOWN);
@@ -108,7 +97,7 @@ ULONG transfer_request_length;
/* Get the pointer to the bulk in endpoint in the transfer_request. */
transfer_request = &asix -> ux_host_class_asix_bulk_in_endpoint -> ux_endpoint_transfer_request;
-
+
/* Perform a transfer on the bulk in endpoint until either the transfer is
completed or until there is an error. */
while (requested_length)
@@ -119,18 +108,18 @@ ULONG transfer_request_length;
transfer_request_length = transfer_request -> ux_transfer_request_maximum_length;
else
transfer_request_length = requested_length;
-
+
/* Initialize the transfer request. */
transfer_request -> ux_transfer_request_data_pointer = data_pointer;
transfer_request -> ux_transfer_request_requested_length = transfer_request_length;
-
+
/* Perform the transfer. */
status = _ux_host_stack_transfer_request(transfer_request);
/* If the transfer is successful, we need to wait for the transfer request to be completed. */
if (status == UX_SUCCESS)
{
-
+
/* Wait for the completion of the transfer_request. */
status = _ux_host_semaphore_get(&transfer_request -> ux_transfer_request_semaphore, UX_MS_TO_TICK(UX_HOST_CLASS_ASIX_CLASS_TRANSFER_TIMEOUT));
@@ -140,14 +129,14 @@ ULONG transfer_request_length;
/* All transfers pending need to abort. There may have been a partial transfer. */
_ux_host_stack_transfer_request_abort(transfer_request);
-
- /* Update the length of the actual data transferred. We do this after the
+
+ /* Update the length of the actual data transferred. We do this after the
abort of the transfer request in case some data was actually received. */
*actual_length += transfer_request -> ux_transfer_request_actual_length;
-
+
/* There was an error, return to the caller */
return(UX_TRANSFER_ERROR);
- }
+ }
}
else
{
@@ -162,25 +151,25 @@ ULONG transfer_request_length;
/* Check for completion status. */
if (transfer_request -> ux_transfer_request_completion_code != UX_SUCCESS)
return(transfer_request -> ux_transfer_request_completion_code);
-
+
/* Check for completion of transfer. If the transfer is partial, return to caller.
The transfer is marked as successful but the caller will need to check the length
actually received and determine if a partial transfer is OK. */
if (transfer_request_length != transfer_request -> ux_transfer_request_actual_length)
{
-
+
/* Return success to caller. */
return(UX_SUCCESS);
}
- /* Update the data pointer for next transfer. */
+ /* Update the data pointer for next transfer. */
data_pointer += transfer_request_length;
-
+
/* Update what is left to receive. */
- requested_length -= transfer_request_length;
- }
+ requested_length -= transfer_request_length;
+ }
/* We get here when all the transfers went through without errors. */
- return(UX_SUCCESS);
+ return(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 4f346b51..bc808fdf 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
@@ -1,18 +1,19 @@
/***************************************************************************
- * Copyright (c) 2024 Microsoft Corporation
- *
+ * Copyright (c) 2024 Microsoft Corporation
+ * Copyright (c) 2026-present Eclipse ThreadX contributors
+ *
* This program and the accompanying materials are made available under the
* terms of the MIT License which is available at
* https://opensource.org/licenses/MIT.
- *
+ *
* SPDX-License-Identifier: MIT
**************************************************************************/
/**************************************************************************/
/**************************************************************************/
-/** */
-/** USBX Component */
+/** */
+/** USBX Component */
/** */
/** Asix Class */
/** */
@@ -29,58 +30,43 @@
#include "ux_host_stack.h"
-/**************************************************************************/
-/* */
-/* FUNCTION RELEASE */
-/* */
-/* _ux_host_class_asix_reception_callback PORTABLE C */
+/**************************************************************************/
+/* */
+/* FUNCTION RELEASE */
+/* */
+/* _ux_host_class_asix_reception_callback PORTABLE C */
/* 6.2.0 */
/* AUTHOR */
/* */
/* Chaoqiong Xiao, Microsoft Corporation */
/* */
/* DESCRIPTION */
-/* */
-/* This function is the callback from the USBX transfer functions, */
-/* it is called when a full or partial transfer has been done for a */
+/* */
+/* This function is the callback from the USBX transfer functions, */
+/* it is called when a full or partial transfer has been done for a */
/* bulk in transfer. It calls back the application. */
/* */
/* It's deprecated. */
/* */
-/* INPUT */
-/* */
-/* transfer_request Pointer to transfer request */
-/* */
-/* OUTPUT */
-/* */
-/* None */
-/* */
-/* CALLS */
-/* */
-/* _ux_host_stack_transfer_request Process transfer request */
+/* INPUT */
+/* */
+/* transfer_request Pointer to transfer request */
+/* */
+/* OUTPUT */
+/* */
+/* None */
+/* */
+/* CALLS */
+/* */
+/* _ux_host_stack_transfer_request Process transfer request */
/* _ux_utility_short_get_big_endian Get 16-bit big endian */
/* _ux_network_driver_packet_received Process received packet */
/* nx_packet_transmit_release Release NetX packet */
/* nx_packet_allocate Allocate NetX packet */
-/* */
-/* 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), */
-/* resulting in version 6.1 */
-/* 04-25-2022 Chaoqiong Xiao Modified comment(s), */
-/* fixed standalone compile, */
-/* resulting in version 6.1.11 */
-/* 10-31-2022 Chaoqiong Xiao Modified comment(s), */
-/* deprecated, no RX callback, */
-/* modified pool reference, */
-/* resulting in version 6.2.0 */
+/* */
+/* CALLED BY */
+/* */
+/* Application */
/* */
/**************************************************************************/
VOID _ux_host_class_asix_reception_callback (UX_TRANSFER *transfer_request)
@@ -93,45 +79,45 @@ UX_HOST_CLASS_ASIX *asix;
NX_PACKET *packet;
ULONG ip_given_length;
UINT status;
-
+
/* Get the class instance for this transfer request. */
asix = (UX_HOST_CLASS_ASIX *) transfer_request -> ux_transfer_request_class_instance;
-
+
/* Load the packet that is associated with this reception. */
packet = transfer_request -> ux_transfer_request_user_specific;
-
+
/* Check the state of the transfer. If there is an error, we do not proceed with this report. */
if (transfer_request -> ux_transfer_request_completion_code == UX_SUCCESS)
{
- /* Adjust the prepend, length, append fields to take the Ether header out */
- packet -> nx_packet_prepend_ptr += 4;
+ /* Adjust the prepend, length, append fields to take the Ether header out */
+ packet -> nx_packet_prepend_ptr += 4;
packet -> nx_packet_length = transfer_request -> ux_transfer_request_actual_length - 4;
packet -> nx_packet_append_ptr =
packet->nx_packet_prepend_ptr + transfer_request -> ux_transfer_request_actual_length ;
-
- /* Calculate the accurate packet length from ip header */
- if((*(packet -> nx_packet_prepend_ptr + 12) == 0x08) &&
+
+ /* Calculate the accurate packet length from ip header */
+ if((*(packet -> nx_packet_prepend_ptr + 12) == 0x08) &&
(*(packet -> nx_packet_prepend_ptr + 13) == 0))
{
ip_given_length = _ux_utility_short_get_big_endian(packet -> nx_packet_prepend_ptr + 16) + UX_HOST_CLASS_ASIX_ETHERNET_SIZE;
packet->nx_packet_length = ip_given_length ;
packet->nx_packet_append_ptr = packet->nx_packet_prepend_ptr + ip_given_length;
}
-
+
/* Send that packet to the NetX USB broker. */
_ux_network_driver_packet_received(asix -> ux_host_class_asix_network_handle, packet);
- }
+ }
else
-
+
/* Free the packet that was not successfully received. */
nx_packet_transmit_release(packet);
-
+
/* We can accept new reception. Get a NX Packet */
- if (nx_packet_allocate(asix -> ux_host_class_asix_packet_pool, &packet,
- NX_RECEIVE_PACKET, NX_NO_WAIT) == NX_SUCCESS)
+ if (nx_packet_allocate(asix -> ux_host_class_asix_packet_pool, &packet,
+ NX_RECEIVE_PACKET, NX_NO_WAIT) == NX_SUCCESS)
{
/* Adjust the prepend pointer to take into account the non 3 bit alignment of the ethernet header. */
@@ -149,7 +135,7 @@ UINT status;
/* Memorize this packet at the beginning of the queue. */
asix -> ux_host_class_asix_receive_queue = packet;
-
+
/* Reset the queue pointer of this packet. */
packet -> nx_packet_queue_next = UX_NULL;
@@ -162,10 +148,10 @@ UINT status;
/* Cancel the packet. */
asix -> ux_host_class_asix_receive_queue = UX_NULL;
-
+
}
}
/* There is no status to be reported back to the stack. */
- return;
+ return;
#endif
}
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 0e5477a6..4c64cc37 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
@@ -1,18 +1,19 @@
/***************************************************************************
- * Copyright (c) 2024 Microsoft Corporation
- *
+ * Copyright (c) 2024 Microsoft Corporation
+ * Copyright (c) 2026-present Eclipse ThreadX contributors
+ *
* This program and the accompanying materials are made available under the
* terms of the MIT License which is available at
* https://opensource.org/licenses/MIT.
- *
+ *
* SPDX-License-Identifier: MIT
**************************************************************************/
/**************************************************************************/
/**************************************************************************/
-/** */
-/** USBX Component */
+/** */
+/** USBX Component */
/** */
/** Asix Class */
/** */
@@ -29,47 +30,37 @@
#include "ux_host_stack.h"
-/**************************************************************************/
-/* */
-/* FUNCTION RELEASE */
-/* */
-/* _ux_host_class_asix_setup PORTABLE C */
+/**************************************************************************/
+/* */
+/* FUNCTION RELEASE */
+/* */
+/* _ux_host_class_asix_setup PORTABLE C */
/* 6.1 */
/* AUTHOR */
/* */
/* Chaoqiong Xiao, Microsoft Corporation */
/* */
/* DESCRIPTION */
-/* */
+/* */
/* This function prepares the Asix chip Phy and rx and xmit registers. */
-/* */
-/* INPUT */
-/* */
-/* asix Pointer to asix class */
-/* */
-/* OUTPUT */
-/* */
-/* Completion Status */
-/* */
-/* CALLS */
-/* */
+/* */
+/* INPUT */
+/* */
+/* asix Pointer to asix class */
+/* */
+/* OUTPUT */
+/* */
+/* Completion Status */
+/* */
+/* CALLS */
+/* */
/* _ux_host_stack_transfer_request Transfer request */
/* _ux_utility_memory_allocate Allocate memory */
/* _ux_utility_memory_free Free memory */
-/* */
-/* CALLED BY */
-/* */
-/* _ux_host_class_asix_activate */
-/* */
-/* RELEASE HISTORY */
-/* */
-/* DATE NAME DESCRIPTION */
-/* */
-/* 05-19-2020 Chaoqiong Xiao Initial Version 6.0 */
-/* 09-30-2020 Chaoqiong Xiao Modified comment(s), */
-/* verified memset and memcpy */
-/* cases, */
-/* resulting in version 6.1 */
+/* */
+/* CALLED BY */
+/* */
+/* _ux_host_class_asix_activate */
/* */
/**************************************************************************/
UINT _ux_host_class_asix_setup(UX_HOST_CLASS_ASIX *asix)
@@ -102,7 +93,7 @@ UINT status;
status = _ux_host_stack_transfer_request(transfer_request);
/* Check status, if error, do not proceed. */
- if ((status != UX_SUCCESS) || (transfer_request -> ux_transfer_request_completion_code != UX_SUCCESS) ||
+ if ((status != UX_SUCCESS) || (transfer_request -> ux_transfer_request_completion_code != UX_SUCCESS) ||
(transfer_request -> ux_transfer_request_actual_length != 2))
{
@@ -113,14 +104,14 @@ UINT status;
return(UX_TRANSFER_ERROR);
}
-
+
/* Extract the PHY IDs and the type. */
asix -> ux_host_class_asix_primary_phy_id = *(setup_buffer + UX_HOST_CLASS_ASIX_PHY_ID_PRIMARY) & UX_HOST_CLASS_ASIX_PHY_ID_MASK;
asix -> ux_host_class_asix_primary_phy_type = (*(setup_buffer + UX_HOST_CLASS_ASIX_PHY_ID_PRIMARY) >> UX_HOST_CLASS_ASIX_PHY_TYPE_SHIFT) & UX_HOST_CLASS_ASIX_PHY_TYPE_MASK;
-
+
asix -> ux_host_class_asix_secondary_phy_id = *(setup_buffer + UX_HOST_CLASS_ASIX_PHY_ID_SECONDARY) & UX_HOST_CLASS_ASIX_PHY_ID_MASK;
asix -> ux_host_class_asix_secondary_phy_type = (*(setup_buffer + UX_HOST_CLASS_ASIX_PHY_ID_SECONDARY) >> UX_HOST_CLASS_ASIX_PHY_TYPE_SHIFT) & UX_HOST_CLASS_ASIX_PHY_TYPE_MASK;
-
+
/* Set the GPIO 2 register. */
transfer_request -> ux_transfer_request_data_pointer = UX_NULL;
transfer_request -> ux_transfer_request_requested_length = 0;
@@ -272,7 +263,7 @@ UINT status;
status = _ux_host_stack_transfer_request(transfer_request);
/* Check status, if error, do not proceed. */
- if (status != UX_SUCCESS || transfer_request -> ux_transfer_request_completion_code != UX_SUCCESS ||
+ if (status != UX_SUCCESS || transfer_request -> ux_transfer_request_completion_code != UX_SUCCESS ||
transfer_request -> ux_transfer_request_actual_length != UX_HOST_CLASS_ASIX_NODE_ID_LENGTH)
{
@@ -324,7 +315,7 @@ UINT status;
status = _ux_host_stack_transfer_request(transfer_request);
/* Check status, if error, do not proceed. */
- if (status != UX_SUCCESS || transfer_request -> ux_transfer_request_completion_code != UX_SUCCESS ||
+ if (status != UX_SUCCESS || transfer_request -> ux_transfer_request_completion_code != UX_SUCCESS ||
transfer_request -> ux_transfer_request_actual_length != 2)
{
@@ -403,11 +394,11 @@ UINT status;
transfer_request -> ux_transfer_request_index = UX_HOST_CLASS_ASIX_PHY_REG_BMCR;
/* Set the value for the PHY reg. */
- phy_register_value = UX_HOST_CLASS_ASIX_PHY_REG_BMCR_RESET;
+ phy_register_value = UX_HOST_CLASS_ASIX_PHY_REG_BMCR_RESET;
/* Insert the value into the target buffer. */
_ux_utility_short_put(setup_buffer, (USHORT)phy_register_value);
-
+
/* Send request to HCD layer. */
status = _ux_host_stack_transfer_request(transfer_request);
@@ -453,15 +444,15 @@ UINT status;
/* Isolate the speed and memorize it. */
if (phy_register_value & UX_HOST_CLASS_ASIX_PHY_REG_BMCR_SPEED_100MBS)
-
+
/* Select 100 MBPS as our speed. */
asix -> ux_host_class_asix_speed_selected = UX_HOST_CLASS_ASIX_SPEED_SELECTED_100MPBS;
-
+
else
-
+
/* Select 10 MBPS as our speed. */
asix -> ux_host_class_asix_speed_selected = UX_HOST_CLASS_ASIX_SPEED_SELECTED_10MPBS;
-
+
/* Set the value of the ANAR in the PHY register. */
transfer_request -> ux_transfer_request_data_pointer = setup_buffer;
transfer_request -> ux_transfer_request_requested_length = 2;
@@ -476,17 +467,17 @@ UINT status;
UX_HOST_CLASS_ASIX_PHY_REG_ANAR_10_FD |
UX_HOST_CLASS_ASIX_PHY_REG_ANAR_TX_HD |
UX_HOST_CLASS_ASIX_PHY_REG_ANAR_TX_FD |
- UX_HOST_CLASS_ASIX_PHY_REG_ANAR_PAUSE);
+ UX_HOST_CLASS_ASIX_PHY_REG_ANAR_PAUSE);
/* Insert the value into the target buffer. */
_ux_utility_short_put(setup_buffer, (USHORT)phy_register_value);
-
+
/* Send request to HCD layer. */
status = _ux_host_stack_transfer_request(transfer_request);
/* Check status, if error, do not proceed. */
- if (status != UX_SUCCESS || transfer_request -> ux_transfer_request_completion_code != UX_SUCCESS ||
+ if (status != UX_SUCCESS || transfer_request -> ux_transfer_request_completion_code != UX_SUCCESS ||
transfer_request -> ux_transfer_request_actual_length != 2)
{
@@ -508,7 +499,7 @@ UINT status;
/* Check speed. */
if (asix -> ux_host_class_asix_speed_selected == UX_HOST_CLASS_ASIX_SPEED_SELECTED_100MPBS)
-
+
/* Set speed at 100MBPS. */
phy_register_value = UX_HOST_CLASS_ASIX_PHY_REG_BMCR_SPEED_100MBS;
@@ -523,7 +514,7 @@ UINT status;
status = _ux_host_stack_transfer_request(transfer_request);
/* Check status, if error, do not proceed. */
- if (status != UX_SUCCESS || transfer_request -> ux_transfer_request_completion_code != UX_SUCCESS ||
+ if (status != UX_SUCCESS || transfer_request -> ux_transfer_request_completion_code != UX_SUCCESS ||
transfer_request -> ux_transfer_request_actual_length != 2)
{
@@ -538,10 +529,10 @@ UINT status;
/* Check speed. */
if (asix -> ux_host_class_asix_speed_selected == UX_HOST_CLASS_ASIX_SPEED_SELECTED_100MPBS)
-
+
/* Set speed at 100MBPS. */
transfer_request -> ux_transfer_request_value = UX_HOST_CLASS_ASIX_MEDIUM_PS;
-
+
/* Write the value of the Medium Mode. */
transfer_request -> ux_transfer_request_data_pointer = UX_NULL;
transfer_request -> ux_transfer_request_requested_length = 0;
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 a100ecb3..45e840a1 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
@@ -1,18 +1,19 @@
/***************************************************************************
- * Copyright (c) 2024 Microsoft Corporation
- *
+ * Copyright (c) 2024 Microsoft Corporation
+ * Copyright (c) 2026-present Eclipse ThreadX contributors
+ *
* This program and the accompanying materials are made available under the
* terms of the MIT License which is available at
* https://opensource.org/licenses/MIT.
- *
+ *
* SPDX-License-Identifier: MIT
**************************************************************************/
/**************************************************************************/
/**************************************************************************/
-/** */
-/** USBX Component */
+/** */
+/** USBX Component */
/** */
/** ASIX Class */
/** */
@@ -33,30 +34,30 @@
static inline UINT _ux_host_class_asix_link_up_controls(UX_HOST_CLASS_ASIX *asix);
-/**************************************************************************/
-/* */
-/* FUNCTION RELEASE */
-/* */
-/* _ux_host_class_asix_thread PORTABLE C */
+/**************************************************************************/
+/* */
+/* FUNCTION RELEASE */
+/* */
+/* _ux_host_class_asix_thread PORTABLE C */
/* 6.2.0 */
/* AUTHOR */
/* */
/* Chaoqiong Xiao, Microsoft Corporation */
/* */
/* DESCRIPTION */
-/* */
-/* This is the Asix thread that monitors the link change flag. */
-/* */
-/* INPUT */
-/* */
-/* asix Asix instance */
-/* */
-/* OUTPUT */
-/* */
-/* Completion Status */
-/* */
-/* CALLS */
-/* */
+/* */
+/* This is the Asix thread that monitors the link change flag. */
+/* */
+/* INPUT */
+/* */
+/* asix Asix instance */
+/* */
+/* OUTPUT */
+/* */
+/* Completion Status */
+/* */
+/* CALLS */
+/* */
/* _ux_host_stack_transfer_request Transfer request */
/* _ux_host_semaphore_get Get semaphore */
/* _ux_host_semaphore_put Put semaphore */
@@ -68,34 +69,10 @@ static inline UINT _ux_host_class_asix_link_up_controls(UX_HOST_CLASS_ASIX *asi
/* _ux_network_driver_link_up Set state to link up */
/* nx_packet_allocate Allocate NetX packet */
/* nx_packet_transmit_release Release NetX packet */
-/* */
-/* CALLED BY */
-/* */
-/* Asix class initialization */
-/* */
-/* RELEASE HISTORY */
-/* */
-/* DATE NAME DESCRIPTION */
-/* */
-/* 05-19-2020 Chaoqiong Xiao Initial Version 6.0 */
-/* 09-30-2020 Chaoqiong Xiao Modified comment(s), */
-/* verified memset and memcpy */
-/* cases, */
-/* resulting in version 6.1 */
-/* 01-31-2022 Chaoqiong Xiao Modified comment(s), */
-/* refined macros names, */
-/* resulting in version 6.1.10 */
-/* 04-25-2022 Chaoqiong Xiao Modified comment(s), */
-/* internal clean up, */
-/* fixed standalone compile, */
-/* resulting in version 6.1.11 */
-/* 10-31-2022 Chaoqiong Xiao Modified comment(s), */
-/* removed internal NX pool, */
-/* moved NX driver activate, */
-/* refined control REQ flow, */
-/* refined reception flow, */
-/* refined interrupt flow, */
-/* resulting in version 6.2.0 */
+/* */
+/* CALLED BY */
+/* */
+/* Asix class initialization */
/* */
/**************************************************************************/
VOID _ux_host_class_asix_thread(ULONG parameter)
@@ -140,7 +117,7 @@ USB_NETWORK_DEVICE_TYPE *ux_nx_device;
/* Check for successful completion. */
if (status != UX_SUCCESS)
return;
-
+
/* Check the link state. It is either pending up or down. */
if (asix -> ux_host_class_asix_link_state == UX_HOST_CLASS_ASIX_LINK_STATE_PENDING_UP)
{
@@ -440,7 +417,10 @@ USB_NETWORK_DEVICE_TYPE *ux_nx_device;
current_packet = asix -> ux_host_class_asix_xmit_queue;
/* Get the next packet associated with the first packet. */
- next_packet = current_packet -> nx_packet_queue_next;
+ if(current_packet != UX_NULL)
+ next_packet = current_packet -> nx_packet_queue_next;
+ else
+ next_packet = UX_NULL;
/* Parse all these packets that were scheduled. */
while (current_packet != UX_NULL)
@@ -461,7 +441,7 @@ USB_NETWORK_DEVICE_TYPE *ux_nx_device;
/* Get the next packet associated with the first packet. */
next_packet = current_packet -> nx_packet_queue_next;
-
+
}
/* Communicate the state with the network driver. */
@@ -476,7 +456,7 @@ USB_NETWORK_DEVICE_TYPE *ux_nx_device;
/* Unprotect thread reentry to this instance. */
_ux_host_semaphore_put(&asix -> ux_host_class_asix_semaphore);
}
- }
+ }
}
static inline UINT _ux_host_class_asix_link_up_controls(UX_HOST_CLASS_ASIX *asix)
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 6a8aee48..c5d7dd98 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
@@ -1,18 +1,19 @@
/***************************************************************************
- * Copyright (c) 2024 Microsoft Corporation
- *
+ * Copyright (c) 2024 Microsoft Corporation
+ * Copyright (c) 2026-present Eclipse ThreadX contributors
+ *
* This program and the accompanying materials are made available under the
* terms of the MIT License which is available at
* https://opensource.org/licenses/MIT.
- *
+ *
* SPDX-License-Identifier: MIT
**************************************************************************/
/**************************************************************************/
/**************************************************************************/
-/** */
-/** USBX Component */
+/** */
+/** USBX Component */
/** */
/** Asix Class */
/** */
@@ -29,61 +30,39 @@
#include "ux_host_stack.h"
-/**************************************************************************/
-/* */
-/* FUNCTION RELEASE */
-/* */
-/* _ux_host_class_asix_transmission_callback PORTABLE C */
+/**************************************************************************/
+/* */
+/* FUNCTION RELEASE */
+/* */
+/* _ux_host_class_asix_transmission_callback PORTABLE C */
/* 6.3.0 */
/* AUTHOR */
/* */
/* Chaoqiong Xiao, Microsoft Corporation */
/* */
/* DESCRIPTION */
-/* */
-/* This function is the callback from the USBX transfer functions, */
-/* it is called when a full or partial transfer has been done for a */
+/* */
+/* This function is the callback from the USBX transfer functions, */
+/* it is called when a full or partial transfer has been done for a */
/* bulk out transfer. */
/* */
-/* INPUT */
-/* */
-/* transfer_request Pointer to transfer request */
-/* */
-/* OUTPUT */
-/* */
-/* None */
-/* */
-/* CALLS */
-/* */
-/* _ux_host_stack_transfer_request Process transfer request */
+/* INPUT */
+/* */
+/* transfer_request Pointer to transfer request */
+/* */
+/* OUTPUT */
+/* */
+/* None */
+/* */
+/* CALLS */
+/* */
+/* _ux_host_stack_transfer_request Process transfer request */
/* _ux_utility_short_put Put 16-bit value */
/* nx_packet_transmit_release Release NetX packet */
-/* */
-/* 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), */
-/* resulting in version 6.1 */
-/* 08-02-2021 Wen Wang Modified comment(s), */
-/* fixed spelling error, */
-/* resulting in version 6.1.8 */
-/* 04-25-2022 Chaoqiong Xiao Modified comment(s), */
-/* fixed standalone compile, */
-/* resulting in version 6.1.11 */
-/* 10-31-2022 Chaoqiong Xiao Modified comment(s), */
-/* supported NX packet chain, */
-/* fixed empty queue handling, */
-/* resulting in version 6.2.0 */
-/* 10-31-2023 Chaoqiong Xiao Modified comment(s), */
-/* fixed compile warnings, */
-/* improved 64-bit support, */
-/* resulting in version 6.3.0 */
+/* */
+/* CALLED BY */
+/* */
+/* Application */
/* */
/**************************************************************************/
VOID _ux_host_class_asix_transmission_callback (UX_TRANSFER *transfer_request)
@@ -99,17 +78,17 @@ UCHAR *packet_header;
#ifdef UX_HOST_CLASS_ASIX_PACKET_CHAIN_SUPPORT
ULONG copied;
#endif
-
+
/* Get the class instance for this transfer request. */
asix = (UX_HOST_CLASS_ASIX *) transfer_request -> ux_transfer_request_class_instance;
-
+
/* Check the state of the transfer. If there is an error, we do not proceed with this report. */
if (transfer_request -> ux_transfer_request_completion_code != UX_SUCCESS)
{
-
+
/* We do not proceed. */
- return;
-
+ return;
+
}
/* Check if the class is in shutdown. */
@@ -135,23 +114,23 @@ ULONG copied;
/* Get the next packet associated with the first packet. */
next_packet = current_packet -> nx_packet_queue_next;
-
+
/* Set the next packet (or a NULL value) as the head of the xmit queue. */
asix -> ux_host_class_asix_xmit_queue = next_packet;
-
+
/* If there is nothing else or if the link is down no need to rearm a packet. */
if (next_packet != UX_NULL && asix -> ux_host_class_asix_link_state == UX_HOST_CLASS_ASIX_LINK_STATE_UP)
{
/* Load the address of the current packet header of the physical header. */
packet_header = next_packet -> nx_packet_prepend_ptr;
-
+
/* Subtract 2 USHORT to store length of the packet. */
packet_header -= sizeof(USHORT) * 2;
-
+
/* Store the length of the payload in the first USHORT. */
_ux_utility_short_put(packet_header, (USHORT)(next_packet -> nx_packet_length));
-
+
/* Store the negative length of the payload in the first USHORT. */
_ux_utility_short_put(packet_header+ sizeof(USHORT), (USHORT)(~next_packet -> nx_packet_length));
@@ -181,22 +160,22 @@ ULONG copied;
transfer_request -> ux_transfer_request_data_pointer = packet_header;
transfer_request -> ux_transfer_request_requested_length = next_packet -> nx_packet_length + (ULONG)sizeof(USHORT) * 2;
}
-
+
/* Store the packet that owns this transaction. */
transfer_request -> ux_transfer_request_user_specific = next_packet;
/* Arm another transfer. */
_ux_host_stack_transfer_request(transfer_request);
- }
+ }
/* Free the packet that was just sent. First do some housekeeping. */
- current_packet -> nx_packet_prepend_ptr = current_packet -> nx_packet_prepend_ptr + UX_HOST_CLASS_ASIX_ETHERNET_SIZE;
+ current_packet -> nx_packet_prepend_ptr = current_packet -> nx_packet_prepend_ptr + UX_HOST_CLASS_ASIX_ETHERNET_SIZE;
current_packet -> nx_packet_length = current_packet -> nx_packet_length - UX_HOST_CLASS_ASIX_ETHERNET_SIZE;
/* And ask Netx to release it. */
- nx_packet_transmit_release(current_packet);
+ nx_packet_transmit_release(current_packet);
/* There is no status to be reported back to the stack. */
- return;
+ return;
#endif
}
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 c111e07d..65949b86 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
@@ -1,18 +1,19 @@
/***************************************************************************
- * Copyright (c) 2024 Microsoft Corporation
- *
+ * Copyright (c) 2024 Microsoft Corporation
+ * Copyright (c) 2026-present Eclipse ThreadX contributors
+ *
* This program and the accompanying materials are made available under the
* terms of the MIT License which is available at
* https://opensource.org/licenses/MIT.
- *
+ *
* SPDX-License-Identifier: MIT
**************************************************************************/
/**************************************************************************/
/**************************************************************************/
-/** */
-/** USBX Component */
+/** */
+/** USBX Component */
/** */
/** Asix Class */
/** */
@@ -29,62 +30,39 @@
#include "ux_host_stack.h"
-/**************************************************************************/
-/* */
-/* FUNCTION RELEASE */
-/* */
-/* _ux_host_class_asix_write PORTABLE C */
+/**************************************************************************/
+/* */
+/* FUNCTION RELEASE */
+/* */
+/* _ux_host_class_asix_write PORTABLE C */
/* 6.3.0 */
/* AUTHOR */
/* */
/* Chaoqiong Xiao, Microsoft Corporation */
/* */
/* DESCRIPTION */
-/* */
-/* This function writes to the asix interface. The call is blocking */
-/* and only returns when there is either an error or when the transfer */
-/* is complete. */
-/* */
-/* INPUT */
-/* */
-/* asix Pointer to asix class */
-/* packet Packet to write or queue */
-/* */
-/* OUTPUT */
-/* */
-/* Completion Status */
-/* */
-/* CALLS */
-/* */
-/* _ux_host_stack_transfer_request Process transfer request */
+/* */
+/* This function writes to the asix interface. The call is blocking */
+/* and only returns when there is either an error or when the transfer */
+/* is complete. */
+/* */
+/* INPUT */
+/* */
+/* asix Pointer to asix class */
+/* packet Packet to write or queue */
+/* */
+/* OUTPUT */
+/* */
+/* Completion Status */
+/* */
+/* CALLS */
+/* */
+/* _ux_host_stack_transfer_request Process transfer request */
/* _ux_utility_short_put Put 16-bit value */
-/* */
-/* 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), */
-/* resulting in version 6.1 */
-/* 08-02-2021 Wen Wang Modified comment(s), */
-/* fixed spelling error, */
-/* resulting in version 6.1.8 */
-/* 04-25-2022 Chaoqiong Xiao Modified comment(s), */
-/* fixed standalone compile, */
-/* resulting in version 6.1.11 */
-/* 10-31-2022 Chaoqiong Xiao Modified comment(s), */
-/* supported NX packet chain, */
-/* added queue modify protect, */
-/* improved error check, */
-/* resulting in version 6.2.0 */
-/* 10-31-2023 Chaoqiong Xiao Modified comment(s), */
-/* fixed compile warnings, */
-/* improved 64-bit support, */
-/* resulting in version 6.3.0 */
+/* */
+/* CALLED BY */
+/* */
+/* Application */
/* */
/**************************************************************************/
UINT _ux_host_class_asix_write(VOID *asix_class, NX_PACKET *packet)
@@ -118,7 +96,7 @@ ULONG copied;
/* Ensure the instance is valid. */
if (asix -> ux_host_class_asix_state != UX_HOST_CLASS_INSTANCE_LIVE)
- {
+ {
/* Error trap. */
_ux_system_error_handler(UX_SYSTEM_LEVEL_THREAD, UX_SYSTEM_CONTEXT_CLASS, UX_HOST_CLASS_INSTANCE_UNKNOWN);
@@ -139,7 +117,7 @@ ULONG copied;
UX_RESTORE;
/* Release the packet. */
- packet -> nx_packet_prepend_ptr = packet -> nx_packet_prepend_ptr + NX_ETHERNET_SIZE;
+ packet -> nx_packet_prepend_ptr = packet -> nx_packet_prepend_ptr + NX_ETHERNET_SIZE;
packet -> nx_packet_length = packet -> nx_packet_length - NX_ETHERNET_SIZE;
nx_packet_transmit_release(packet);
@@ -150,7 +128,7 @@ ULONG copied;
/* Load the address of the current packet header at the physical header. */
packet_header = packet -> nx_packet_prepend_ptr;
-
+
/* Subtract 2 USHORT to store length of the packet. */
packet_header -= sizeof(USHORT) * 2;
@@ -189,7 +167,7 @@ ULONG copied;
/* Store the length of the payload in the first USHORT. */
_ux_utility_short_put(packet_header, (USHORT)(packet -> nx_packet_length));
-
+
/* Store the negative length of the payload in the first USHORT. */
_ux_utility_short_put(packet_header + sizeof(USHORT), (USHORT)(~packet -> nx_packet_length));
@@ -265,9 +243,9 @@ ULONG copied;
}
else
-
+
{
-
+
/* We get here when there is something in the queue. */
current_packet = asix -> ux_host_class_asix_xmit_queue;
@@ -279,7 +257,7 @@ ULONG copied;
{
/* Remember the current packet. */
current_packet = next_packet;
-
+
/* See what the next packet in the chain is. */
next_packet = current_packet -> nx_packet_queue_next;
}
@@ -295,6 +273,6 @@ ULONG copied;
}
/* We are done here. */
- return(UX_SUCCESS);
+ return(UX_SUCCESS);
#endif
}
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 c67e48c6..aa73ae37 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
@@ -1,10 +1,11 @@
/***************************************************************************
- * Copyright (c) 2024 Microsoft Corporation
- *
+ * Copyright (c) 2024 Microsoft Corporation
+ * Copyright (c) 2026-present Eclipse ThreadX contributors
+ *
* This program and the accompanying materials are made available under the
* terms of the MIT License which is available at
* https://opensource.org/licenses/MIT.
- *
+ *
* SPDX-License-Identifier: MIT
**************************************************************************/
@@ -69,30 +70,6 @@
/* */
/* Audio Class */
/* */
-/* RELEASE HISTORY */
-/* */
-/* DATE NAME DESCRIPTION */
-/* */
-/* 05-19-2020 Chaoqiong Xiao Initial Version 6.0 */
-/* 09-30-2020 Chaoqiong Xiao Modified comment(s), */
-/* resulting in version 6.1 */
-/* 01-31-2022 Chaoqiong Xiao Modified comment(s), */
-/* refined macros names, */
-/* resulting in version 6.1.10 */
-/* 07-29-2022 Chaoqiong Xiao Modified comment(s), */
-/* fixed parameter/variable */
-/* names conflict C++ keyword, */
-/* added interrupt support, */
-/* protect reentry with mutex, */
-/* added feedback support, */
-/* refined error handling, */
-/* resulting in version 6.1.12 */
-/* 10-31-2023 Chaoqiong Xiao Modified comment(s), */
-/* improved AC AS management, */
-/* improved error handling, */
-/* improved descriptors check, */
-/* resulting in version 6.3.0 */
-/* */
/**************************************************************************/
UINT _ux_host_class_audio_activate(UX_HOST_CLASS_COMMAND *command)
{
@@ -364,7 +341,7 @@ UINT status;
{
/* Check interface number to see if it's right AC. */
- if ((ac -> ux_host_class_audio_interface -> ux_interface_configuration ==
+ if ((ac -> ux_host_class_audio_interface -> ux_interface_configuration ==
interface_ptr -> ux_interface_configuration) &&
(ac -> ux_host_class_audio_interface -> ux_interface_descriptor.bInterfaceNumber ==
audio -> ux_host_class_audio_control_interface_number) &&
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 f93505dc..62b177cf 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
@@ -1,10 +1,11 @@
/***************************************************************************
- * Copyright (c) 2024 Microsoft Corporation
- *
+ * Copyright (c) 2024 Microsoft Corporation
+ * Copyright (c) 2026-present Eclipse ThreadX contributors
+ *
* This program and the accompanying materials are made available under the
* terms of the MIT License which is available at
* https://opensource.org/licenses/MIT.
- *
+ *
* SPDX-License-Identifier: MIT
**************************************************************************/
@@ -71,16 +72,6 @@ static inline UINT _ux_host_class_audio_alternate_setting_locate_2(
/* */
/* Audio Class */
/* */
-/* RELEASE HISTORY */
-/* */
-/* DATE NAME DESCRIPTION */
-/* */
-/* 05-19-2020 Chaoqiong Xiao Initial Version 6.0 */
-/* 09-30-2020 Chaoqiong Xiao Modified comment(s), */
-/* resulting in version 6.1 */
-/* 07-29-2022 Chaoqiong Xiao Modified comment(s), */
-/* added audio 2.0 support, */
-/* resulting in version 6.1.12 */
/**************************************************************************/
UINT _ux_host_class_audio_alternate_setting_locate(UX_HOST_CLASS_AUDIO *audio, UX_HOST_CLASS_AUDIO_SAMPLING *audio_sampling,
UINT *alternate_setting)
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 439c867e..11821e74 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
@@ -1,18 +1,19 @@
/***************************************************************************
- * Copyright (c) 2024 Microsoft Corporation
- *
+ * Copyright (c) 2024 Microsoft Corporation
+ * Copyright (c) 2026-present Eclipse ThreadX contributors
+ *
* This program and the accompanying materials are made available under the
* terms of the MIT License which is available at
* https://opensource.org/licenses/MIT.
- *
+ *
* SPDX-License-Identifier: MIT
**************************************************************************/
/**************************************************************************/
/**************************************************************************/
-/** */
-/** USBX Component */
+/** */
+/** USBX Component */
/** */
/** Audio Class */
/** */
@@ -29,52 +30,39 @@
#include "ux_host_stack.h"
-/**************************************************************************/
-/* */
-/* FUNCTION RELEASE */
-/* */
-/* _ux_host_class_audio_configure PORTABLE C */
+/**************************************************************************/
+/* */
+/* FUNCTION RELEASE */
+/* */
+/* _ux_host_class_audio_configure PORTABLE C */
/* 6.1.11 */
/* AUTHOR */
/* */
/* Chaoqiong Xiao, Microsoft Corporation */
/* */
/* DESCRIPTION */
-/* */
+/* */
/* This function calls the USBX stack to do a SET_CONFIGURATION to */
/* the device. Once the device is configured, its interface(s) will */
-/* be activated. */
-/* */
-/* INPUT */
-/* */
-/* audio Pointer to audio class */
-/* */
-/* OUTPUT */
-/* */
-/* Completion Status */
-/* */
-/* CALLS */
-/* */
-/* _ux_host_stack_configuration_interface_get Get interface */
-/* _ux_host_stack_device_configuration_get Get configuration */
-/* _ux_host_stack_device_configuration_select Select configuration */
-/* */
-/* CALLED BY */
-/* */
-/* Audio Class */
-/* */
-/* 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 */
-/* 04-25-2022 Chaoqiong Xiao Modified comment(s), */
-/* internal clean up, */
-/* resulting in version 6.1.11 */
+/* be activated. */
+/* */
+/* INPUT */
+/* */
+/* audio Pointer to audio class */
+/* */
+/* OUTPUT */
+/* */
+/* Completion Status */
+/* */
+/* CALLS */
+/* */
+/* _ux_host_stack_configuration_interface_get Get interface */
+/* _ux_host_stack_device_configuration_get Get configuration */
+/* _ux_host_stack_device_configuration_select Select configuration */
+/* */
+/* CALLED BY */
+/* */
+/* Audio Class */
/* */
/**************************************************************************/
UINT _ux_host_class_audio_configure(UX_HOST_CLASS_AUDIO *audio)
@@ -105,24 +93,24 @@ UX_DEVICE *parent_device;
/* If trace is enabled, insert this event into the trace buffer. */
UX_TRACE_IN_LINE_INSERT(UX_TRACE_ERROR, UX_CONFIGURATION_HANDLE_UNKNOWN, audio -> ux_host_class_audio_device, 0, 0, UX_TRACE_ERRORS, 0, 0)
-
+
return(UX_CONFIGURATION_HANDLE_UNKNOWN);
-
+
}
#if UX_MAX_DEVICES > 1
- /* Check the audio power source and check the parent power source for
+ /* 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)
{
/* Get parent device. */
parent_device = audio -> ux_host_class_audio_device -> ux_device_parent;
-
- /* If the device is NULL, the parent is the root audio and we don't have to worry
+
+ /* If the device is NULL, the parent is the root audio and we don't have to worry
if the parent is not the root audio, check for its power source. */
if ((parent_device != UX_NULL) && (parent_device -> ux_device_power_source == UX_DEVICE_BUS_POWERED))
- {
+ {
/* Error trap. */
_ux_system_error_handler(UX_SYSTEM_LEVEL_THREAD, UX_SYSTEM_CONTEXT_CLASS, UX_CONNECTION_INCOMPATIBLE);
@@ -131,11 +119,11 @@ UX_DEVICE *parent_device;
UX_TRACE_IN_LINE_INSERT(UX_TRACE_ERROR, UX_CONNECTION_INCOMPATIBLE, audio, 0, 0, UX_TRACE_ERRORS, 0, 0)
return(UX_CONNECTION_INCOMPATIBLE);
- }
+ }
}
#endif
- /* We have the valid configuration. Ask the USBX stack to set this configuration */
+ /* 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)
{
@@ -145,7 +133,7 @@ UX_DEVICE *parent_device;
/* If trace is enabled, insert this event into the trace buffer. */
UX_TRACE_IN_LINE_INSERT(UX_TRACE_ERROR, status, audio -> ux_host_class_audio_device, 0, 0, UX_TRACE_ERRORS, 0, 0)
-
+
return(status);
}
@@ -153,7 +141,7 @@ UX_DEVICE *parent_device;
interface_number = 0;
/* We only need to retrieve the audio streaming interface. */
- do
+ do
{
/* Pickup interface. */
@@ -166,7 +154,7 @@ UX_DEVICE *parent_device;
/* Check the type of interface we have found - is it streaming? */
if (interface -> ux_interface_descriptor.bInterfaceSubClass == UX_HOST_CLASS_AUDIO_SUBCLASS_STREAMING)
{
-
+
audio -> ux_host_class_audio_streaming_interface = interface;
audio -> ux_host_class_audio_streaming_interface -> ux_interface_class_instance = (VOID *)audio;
break;
@@ -190,7 +178,7 @@ UX_DEVICE *parent_device;
else
{
- return(UX_SUCCESS);
+ return(UX_SUCCESS);
}
}
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 7dde1ec6..409b2357 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
@@ -1,18 +1,19 @@
/***************************************************************************
- * Copyright (c) 2024 Microsoft Corporation
- *
+ * Copyright (c) 2024 Microsoft Corporation
+ * Copyright (c) 2026-present Eclipse ThreadX contributors
+ *
* This program and the accompanying materials are made available under the
* terms of the MIT License which is available at
* https://opensource.org/licenses/MIT.
- *
+ *
* SPDX-License-Identifier: MIT
**************************************************************************/
/**************************************************************************/
/**************************************************************************/
-/** */
-/** USBX Component */
+/** */
+/** USBX Component */
/** */
/** Audio Class */
/** */
@@ -29,21 +30,21 @@
#include "ux_host_stack.h"
-/**************************************************************************/
-/* */
-/* FUNCTION RELEASE */
-/* */
-/* _ux_host_class_audio_control_get PORTABLE C */
+/**************************************************************************/
+/* */
+/* FUNCTION RELEASE */
+/* */
+/* _ux_host_class_audio_control_get PORTABLE C */
/* 6.1.12 */
/* AUTHOR */
/* */
/* Chaoqiong Xiao, Microsoft Corporation */
/* */
/* DESCRIPTION */
-/* */
+/* */
/* This function obtains the static feature values for a single audio */
/* control on either the master channel or a specific channel. */
-/* */
+/* */
/* Note only control value of BYTE, WORD and DWORD (<4) is supported. */
/* E.g., Graphic Equalizer Control is not supported. */
/* */
@@ -55,49 +56,31 @@
/* ux_host_class_audio_control_request or ux_host_class_audio_feature */
/* functions. */
/* */
-/* INPUT */
-/* */
-/* audio Pointer to audio class */
-/* audio_control Pointer to audio control */
-/* */
-/* OUTPUT */
-/* */
-/* Completion Status */
-/* */
-/* CALLS */
-/* */
-/* _ux_host_stack_class_instance_verify Verify instance is valid */
-/* _ux_host_stack_transfer_request Process transfer request */
-/* _ux_host_semaphore_get Get semaphore */
-/* _ux_host_semaphore_put Release semaphore */
+/* INPUT */
+/* */
+/* audio Pointer to audio class */
+/* audio_control Pointer to audio control */
+/* */
+/* OUTPUT */
+/* */
+/* Completion Status */
+/* */
+/* CALLS */
+/* */
+/* _ux_host_stack_class_instance_verify Verify instance is valid */
+/* _ux_host_stack_transfer_request Process transfer request */
+/* _ux_host_semaphore_get Get semaphore */
+/* _ux_host_semaphore_put Release semaphore */
/* _ux_host_mutex_on Get mutex */
/* _ux_host_mutex_off Release mutex */
-/* _ux_utility_memory_allocate Allocate memory block */
-/* _ux_utility_memory_free Release memory block */
-/* _ux_utility_short_get Read 16-bit value */
-/* */
-/* CALLED BY */
-/* */
-/* Application */
-/* Audio Class */
-/* */
-/* RELEASE HISTORY */
-/* */
-/* DATE NAME DESCRIPTION */
-/* */
-/* 05-19-2020 Chaoqiong Xiao Initial Version 6.0 */
-/* 09-30-2020 Chaoqiong Xiao Modified comment(s), */
-/* resulting in version 6.1 */
-/* 01-31-2022 Chaoqiong Xiao Modified comment(s), */
-/* refined macros names, */
-/* resulting in version 6.1.10 */
-/* 04-25-2022 Chaoqiong Xiao Modified comment(s), */
-/* fixed standalone compile, */
-/* resulting in version 6.1.11 */
-/* 07-29-2022 Chaoqiong Xiao Modified comment(s), */
-/* added audio 2.0 support, */
-/* protect reentry with mutex, */
-/* resulting in version 6.1.12 */
+/* _ux_utility_memory_allocate Allocate memory block */
+/* _ux_utility_memory_free Release memory block */
+/* _ux_utility_short_get Read 16-bit value */
+/* */
+/* CALLED BY */
+/* */
+/* Application */
+/* Audio Class */
/* */
/**************************************************************************/
UINT _ux_host_class_audio_control_get(UX_HOST_CLASS_AUDIO *audio, UX_HOST_CLASS_AUDIO_CONTROL *audio_control)
@@ -368,8 +351,8 @@ UCHAR * control_buffer;
/* */
/* INPUT */
/* */
-/* audio Pointer to audio class */
-/* audio_control Pointer to audio control */
+/* audio Pointer to audio class */
+/* audio_control Pointer to audio control */
/* */
/* OUTPUT */
/* */
@@ -383,12 +366,6 @@ UCHAR * control_buffer;
/* */
/* Application */
/* */
-/* RELEASE HISTORY */
-/* */
-/* DATE NAME DESCRIPTION */
-/* */
-/* 10-31-2023 Chaoqiong Xiao Initial Version 6.3.0 */
-/* */
/**************************************************************************/
UINT _uxe_host_class_audio_control_get(UX_HOST_CLASS_AUDIO *audio, UX_HOST_CLASS_AUDIO_CONTROL *audio_control)
{
diff --git a/common/usbx_host_classes/src/ux_host_class_audio_control_request.c b/common/usbx_host_classes/src/ux_host_class_audio_control_request.c
index 50c923cf..81ca4038 100644
--- a/common/usbx_host_classes/src/ux_host_class_audio_control_request.c
+++ b/common/usbx_host_classes/src/ux_host_class_audio_control_request.c
@@ -1,10 +1,11 @@
/***************************************************************************
- * Copyright (c) 2024 Microsoft Corporation
- *
+ * Copyright (c) 2024 Microsoft Corporation
+ * Copyright (c) 2026-present Eclipse ThreadX contributors
+ *
* This program and the accompanying materials are made available under the
* terms of the MIT License which is available at
* https://opensource.org/licenses/MIT.
- *
+ *
* SPDX-License-Identifier: MIT
**************************************************************************/
@@ -77,12 +78,6 @@
/* Application */
/* Audio Class */
/* */
-/* RELEASE HISTORY */
-/* */
-/* DATE NAME DESCRIPTION */
-/* */
-/* 07-29-2022 Chaoqiong Xiao Initial Version 6.1.12 */
-/* */
/**************************************************************************/
UINT _ux_host_class_audio_control_request(UX_HOST_CLASS_AUDIO *audio,
UINT streaming_control,
@@ -212,12 +207,6 @@ UINT status;
/* Application */
/* Audio Class */
/* */
-/* RELEASE HISTORY */
-/* */
-/* DATE NAME DESCRIPTION */
-/* */
-/* 10-31-2023 Chaoqiong Xiao Initial Version 6.3.0 */
-/* */
/**************************************************************************/
UINT _uxe_host_class_audio_control_request(UX_HOST_CLASS_AUDIO *audio,
UINT streaming_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 c79f4707..2ff4fe87 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
@@ -1,18 +1,19 @@
/***************************************************************************
- * Copyright (c) 2024 Microsoft Corporation
- *
+ * Copyright (c) 2024 Microsoft Corporation
+ * Copyright (c) 2026-present Eclipse ThreadX contributors
+ *
* This program and the accompanying materials are made available under the
* terms of the MIT License which is available at
* https://opensource.org/licenses/MIT.
- *
+ *
* SPDX-License-Identifier: MIT
**************************************************************************/
/**************************************************************************/
/**************************************************************************/
-/** */
-/** USBX Component */
+/** */
+/** USBX Component */
/** */
/** Audio Class */
/** */
@@ -29,21 +30,21 @@
#include "ux_host_stack.h"
-/**************************************************************************/
-/* */
-/* FUNCTION RELEASE */
-/* */
-/* _ux_host_class_audio_control_value_get PORTABLE C */
+/**************************************************************************/
+/* */
+/* FUNCTION RELEASE */
+/* */
+/* _ux_host_class_audio_control_value_get PORTABLE C */
/* 6.1.12 */
/* AUTHOR */
/* */
/* Chaoqiong Xiao, Microsoft Corporation */
/* */
/* DESCRIPTION */
-/* */
+/* */
/* This function obtains the dynamic feature values for a single audio */
-/* control on either the master channel or a specific channel. */
-/* */
+/* control on either the master channel or a specific channel. */
+/* */
/* Note only control value of BYTE, WORD and DWORD (<4) is supported. */
/* E.g., Graphic Equalizer Control is not supported. */
/* */
@@ -53,50 +54,29 @@
/* ux_host_class_audio_control_request or ux_host_class_audio_feature */
/* functions. */
/* */
-/* INPUT */
-/* */
-/* audio Pointer to audio class */
-/* audio_control Pointer to audio control */
-/* */
-/* OUTPUT */
-/* */
-/* Completion Status */
-/* */
-/* CALLS */
-/* */
-/* _ux_host_stack_class_instance_verify Verify instance is valid */
-/* _ux_host_stack_transfer_request Process transfer request */
-/* _ux_host_semaphore_get Get semaphore */
+/* INPUT */
+/* */
+/* audio Pointer to audio class */
+/* audio_control Pointer to audio control */
+/* */
+/* OUTPUT */
+/* */
+/* Completion Status */
+/* */
+/* CALLS */
+/* */
+/* _ux_host_stack_class_instance_verify Verify instance is valid */
+/* _ux_host_stack_transfer_request Process transfer request */
+/* _ux_host_semaphore_get Get semaphore */
/* _ux_host_mutex_on Get mutex */
/* _ux_host_mutex_off Release mutex */
-/* _ux_utility_memory_allocate Allocate memory block */
-/* _ux_utility_memory_free Release memory block */
-/* _ux_utility_short_get Read 16-bit value */
-/* */
-/* CALLED BY */
-/* */
-/* Audio Class */
-/* */
-/* RELEASE HISTORY */
-/* */
-/* DATE NAME DESCRIPTION */
-/* */
-/* 05-19-2020 Chaoqiong Xiao Initial Version 6.0 */
-/* 09-30-2020 Chaoqiong Xiao Modified comment(s), */
-/* resulting in version 6.1 */
-/* 01-31-2022 Chaoqiong Xiao Modified comment(s), */
-/* refined macros names, */
-/* resulting in version 6.1.10 */
-/* 04-25-2022 Chaoqiong Xiao Modified comment(s), */
-/* fixed standalone compile, */
-/* resulting in version 6.1.11 */
-/* 07-29-2022 Chaoqiong Xiao Modified comment(s), */
-/* added audio 2.0 support, */
-/* protect reentry with mutex, */
-/* fixed error return code, */
-/* fixed EP0 protection, */
-/* supported more selectors, */
-/* resulting in version 6.1.12 */
+/* _ux_utility_memory_allocate Allocate memory block */
+/* _ux_utility_memory_free Release memory block */
+/* _ux_utility_short_get Read 16-bit value */
+/* */
+/* CALLED BY */
+/* */
+/* Audio Class */
/* */
/**************************************************************************/
UINT _ux_host_class_audio_control_value_get(UX_HOST_CLASS_AUDIO *audio, UX_HOST_CLASS_AUDIO_CONTROL *audio_control)
@@ -117,7 +97,7 @@ UCHAR * control_buffer;
/* Ensure the instance is valid. */
if (_ux_host_stack_class_instance_verify(_ux_system_host_class_audio_name, (VOID *) audio) != UX_SUCCESS)
- {
+ {
/* Error trap. */
_ux_system_error_handler(UX_SYSTEM_LEVEL_THREAD, UX_SYSTEM_CONTEXT_CLASS, UX_HOST_CLASS_INSTANCE_UNKNOWN);
@@ -143,11 +123,11 @@ UCHAR * control_buffer;
/* Unprotect thread reentry to this instance. */
_ux_host_mutex_off(&audio -> ux_host_class_audio_mutex);
- /* Return error. */
+ /* Return error. */
return(UX_MEMORY_INSUFFICIENT);
}
- /* Protect the control endpoint semaphore here. It will be unprotected in the
+ /* Protect the control endpoint semaphore here. It will be unprotected in the
transfer request function. */
status = _ux_host_semaphore_get(&audio -> ux_host_class_audio_device -> ux_device_protection_semaphore, UX_WAIT_FOREVER);
@@ -219,8 +199,8 @@ UCHAR * control_buffer;
/* */
/* INPUT */
/* */
-/* audio Pointer to audio class */
-/* audio_control Pointer to audio control */
+/* audio Pointer to audio class */
+/* audio_control Pointer to audio control */
/* */
/* OUTPUT */
/* */
@@ -235,12 +215,6 @@ UCHAR * control_buffer;
/* */
/* Application */
/* */
-/* RELEASE HISTORY */
-/* */
-/* DATE NAME DESCRIPTION */
-/* */
-/* 10-31-2023 Chaoqiong Xiao Initial Version 6.3.0 */
-/* */
/**************************************************************************/
UINT _uxe_host_class_audio_control_value_get(UX_HOST_CLASS_AUDIO *audio, UX_HOST_CLASS_AUDIO_CONTROL *audio_control)
{
diff --git a/common/usbx_host_classes/src/ux_host_class_audio_control_value_set.c b/common/usbx_host_classes/src/ux_host_class_audio_control_value_set.c
index 0412129c..7060e63e 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
@@ -1,18 +1,19 @@
/***************************************************************************
- * Copyright (c) 2024 Microsoft Corporation
- *
+ * Copyright (c) 2024 Microsoft Corporation
+ * Copyright (c) 2026-present Eclipse ThreadX contributors
+ *
* This program and the accompanying materials are made available under the
* terms of the MIT License which is available at
* https://opensource.org/licenses/MIT.
- *
+ *
* SPDX-License-Identifier: MIT
**************************************************************************/
/**************************************************************************/
/**************************************************************************/
-/** */
-/** USBX Component */
+/** */
+/** USBX Component */
/** */
/** Audio Class */
/** */
@@ -29,21 +30,21 @@
#include "ux_host_stack.h"
-/**************************************************************************/
-/* */
-/* FUNCTION RELEASE */
-/* */
-/* _ux_host_class_audio_control_value_set PORTABLE C */
+/**************************************************************************/
+/* */
+/* FUNCTION RELEASE */
+/* */
+/* _ux_host_class_audio_control_value_set PORTABLE C */
/* 6.1.12 */
/* AUTHOR */
/* */
/* Chaoqiong Xiao, Microsoft Corporation */
/* */
/* DESCRIPTION */
-/* */
+/* */
/* This function updates the dynamic feature values for a single audio */
-/* control on either the master channel or a specific channel. */
-/* */
+/* control on either the master channel or a specific channel. */
+/* */
/* Note only control value of BYTE, WORD and DWORD (<4) is supported. */
/* E.g., Graphic Equalizer Control is not supported. */
/* */
@@ -53,51 +54,31 @@
/* ux_host_class_audio_control_request or ux_host_class_audio_feature */
/* functions. */
/* */
-/* INPUT */
-/* */
-/* audio Pointer to audio class */
-/* audio_control Pointer to audio control */
-/* */
-/* OUTPUT */
-/* */
-/* Completion Status */
-/* */
-/* CALLS */
-/* */
-/* _ux_host_stack_class_instance_verify Verify instance is valid */
-/* _ux_host_stack_transfer_request Process transfer request */
-/* _ux_host_semaphore_get Get semaphore */
-/* _ux_host_semaphore_put Release semaphore */
+/* INPUT */
+/* */
+/* audio Pointer to audio class */
+/* audio_control Pointer to audio control */
+/* */
+/* OUTPUT */
+/* */
+/* Completion Status */
+/* */
+/* CALLS */
+/* */
+/* _ux_host_stack_class_instance_verify Verify instance is valid */
+/* _ux_host_stack_transfer_request Process transfer request */
+/* _ux_host_semaphore_get Get semaphore */
+/* _ux_host_semaphore_put Release semaphore */
/* _ux_host_mutex_on Get mutex */
/* _ux_host_mutex_off Release mutex */
-/* _ux_utility_memory_allocate Allocate memory block */
-/* _ux_utility_memory_free Release memory block */
-/* _ux_utility_short_put Write 16-bit value */
-/* */
-/* CALLED BY */
-/* */
-/* Application */
-/* Audio Class */
-/* */
-/* RELEASE HISTORY */
-/* */
-/* DATE NAME DESCRIPTION */
-/* */
-/* 05-19-2020 Chaoqiong Xiao Initial Version 6.0 */
-/* 09-30-2020 Chaoqiong Xiao Modified comment(s), */
-/* resulting in version 6.1 */
-/* 01-31-2022 Chaoqiong Xiao Modified comment(s), */
-/* refined macros names, */
-/* resulting in version 6.1.10 */
-/* 04-25-2022 Chaoqiong Xiao Modified comment(s), */
-/* fixed standalone compile, */
-/* resulting in version 6.1.11 */
-/* 07-29-2022 Chaoqiong Xiao Modified comment(s), */
-/* added audio 2.0 support, */
-/* protect reentry with mutex, */
-/* fixed error return code, */
-/* supported more selectors, */
-/* resulting in version 6.1.12 */
+/* _ux_utility_memory_allocate Allocate memory block */
+/* _ux_utility_memory_free Release memory block */
+/* _ux_utility_short_put Write 16-bit value */
+/* */
+/* CALLED BY */
+/* */
+/* Application */
+/* Audio Class */
/* */
/**************************************************************************/
UINT _ux_host_class_audio_control_value_set(UX_HOST_CLASS_AUDIO *audio, UX_HOST_CLASS_AUDIO_CONTROL *audio_control)
@@ -118,7 +99,7 @@ UCHAR * control_buffer;
/* Ensure the instance is valid. */
if (_ux_host_stack_class_instance_verify(_ux_system_host_class_audio_name, (VOID *) audio) != UX_SUCCESS)
- {
+ {
/* If trace is enabled, insert this event into the trace buffer. */
UX_TRACE_IN_LINE_INSERT(UX_TRACE_ERROR, UX_HOST_CLASS_INSTANCE_UNKNOWN, audio, 0, 0, UX_TRACE_ERRORS, 0, 0)
@@ -141,11 +122,11 @@ UCHAR * control_buffer;
/* Unprotect thread reentry to this instance. */
_ux_host_mutex_off(&audio -> ux_host_class_audio_mutex);
- /* Return an error. */
+ /* Return an error. */
return(UX_MEMORY_INSUFFICIENT);
}
- /* Protect the control endpoint semaphore here. It will be unprotected in the
+ /* Protect the control endpoint semaphore here. It will be unprotected in the
transfer request function. */
status = _ux_host_semaphore_get(&audio -> ux_host_class_audio_device -> ux_device_protection_semaphore, UX_WAIT_FOREVER);
@@ -281,8 +262,8 @@ UCHAR * control_buffer;
/* */
/* INPUT */
/* */
-/* audio Pointer to audio class */
-/* audio_control Pointer to audio control */
+/* audio Pointer to audio class */
+/* audio_control Pointer to audio control */
/* */
/* OUTPUT */
/* */
@@ -297,12 +278,6 @@ UCHAR * control_buffer;
/* */
/* Application */
/* */
-/* RELEASE HISTORY */
-/* */
-/* DATE NAME DESCRIPTION */
-/* */
-/* 10-31-2023 Chaoqiong Xiao Initial Version 6.3.0 */
-/* */
/**************************************************************************/
UINT _uxe_host_class_audio_control_value_set(UX_HOST_CLASS_AUDIO *audio, UX_HOST_CLASS_AUDIO_CONTROL *audio_control)
{
diff --git a/common/usbx_host_classes/src/ux_host_class_audio_deactivate.c b/common/usbx_host_classes/src/ux_host_class_audio_deactivate.c
index 85100fdc..754e8e94 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
@@ -1,18 +1,19 @@
/***************************************************************************
- * Copyright (c) 2024 Microsoft Corporation
- *
+ * Copyright (c) 2024 Microsoft Corporation
+ * Copyright (c) 2026-present Eclipse ThreadX contributors
+ *
* This program and the accompanying materials are made available under the
* terms of the MIT License which is available at
* https://opensource.org/licenses/MIT.
- *
+ *
* SPDX-License-Identifier: MIT
**************************************************************************/
/**************************************************************************/
/**************************************************************************/
-/** */
-/** USBX Component */
+/** */
+/** USBX Component */
/** */
/** Audio Class */
/** */
@@ -29,60 +30,41 @@
#include "ux_host_stack.h"
-/**************************************************************************/
-/* */
-/* FUNCTION RELEASE */
-/* */
-/* _ux_host_class_audio_deactivate PORTABLE C */
+/**************************************************************************/
+/* */
+/* FUNCTION RELEASE */
+/* */
+/* _ux_host_class_audio_deactivate PORTABLE C */
/* 6.3.0 */
/* AUTHOR */
/* */
/* Chaoqiong Xiao, Microsoft Corporation */
/* */
/* DESCRIPTION */
-/* */
+/* */
/* This function is called when this instance of the audio has been */
-/* removed from the bus either directly or indirectly. The iso pipes */
-/* will be destroyed and the instanced removed. */
-/* */
-/* INPUT */
-/* */
-/* command Pointer to command */
-/* */
-/* OUTPUT */
-/* */
-/* Completion Status */
-/* */
-/* CALLS */
-/* */
-/* _ux_host_stack_class_instance_destroy Destroy class instance */
-/* _ux_host_stack_endpoint_transfer_abort Abort outstanding transfer */
+/* removed from the bus either directly or indirectly. The iso pipes */
+/* will be destroyed and the instanced removed. */
+/* */
+/* INPUT */
+/* */
+/* command Pointer to command */
+/* */
+/* OUTPUT */
+/* */
+/* Completion Status */
+/* */
+/* CALLS */
+/* */
+/* _ux_host_stack_class_instance_destroy Destroy class instance */
+/* _ux_host_stack_endpoint_transfer_abort Abort outstanding transfer */
/* _ux_host_mutex_on Get mutex */
/* _ux_host_mutex_delete Delete mutex */
-/* _ux_utility_memory_free Release memory block */
-/* */
-/* CALLED BY */
-/* */
-/* Audio Class */
-/* */
-/* RELEASE HISTORY */
-/* */
-/* DATE NAME DESCRIPTION */
-/* */
-/* 05-19-2020 Chaoqiong Xiao Initial Version 6.0 */
-/* 09-30-2020 Chaoqiong Xiao Modified comment(s), */
-/* resulting in version 6.1 */
-/* 01-31-2022 Chaoqiong Xiao Modified comment(s), */
-/* refined macros names, */
-/* resulting in version 6.1.10 */
-/* 07-29-2022 Chaoqiong Xiao Modified comment(s), */
-/* added interrupt support, */
-/* protect reentry with mutex, */
-/* added feedback support, */
-/* resulting in version 6.1.12 */
-/* 10-31-2023 Chaoqiong Xiao Modified comment(s), */
-/* improved AC AS management, */
-/* resulting in version 6.3.0 */
+/* _ux_utility_memory_free Release memory block */
+/* */
+/* CALLED BY */
+/* */
+/* Audio Class */
/* */
/**************************************************************************/
UINT _ux_host_class_audio_deactivate(UX_HOST_CLASS_COMMAND *command)
@@ -133,7 +115,7 @@ UINT i;
/* Protect thread reentry to this instance. */
_ux_host_mutex_on(&audio -> ux_host_class_audio_mutex);
-
+
/* We need to abort transactions on the iso pipe. */
if (audio -> ux_host_class_audio_isochronous_endpoint)
_ux_host_stack_endpoint_transfer_abort(audio -> ux_host_class_audio_isochronous_endpoint);
@@ -147,7 +129,7 @@ UINT i;
/* The enumeration thread needs to sleep a while to allow the application or the class that may be using
endpoints to exit properly. */
- _ux_host_thread_schedule_other(UX_THREAD_PRIORITY_ENUM);
+ _ux_host_thread_schedule_other(UX_THREAD_PRIORITY_ENUM);
#if defined(UX_HOST_CLASS_AUDIO_INTERRUPT_SUPPORT)
@@ -168,11 +150,11 @@ UINT i;
that the device is removed. */
if (_ux_system_host -> ux_system_host_change_function != UX_NULL)
{
-
+
/* Inform the application the device is removed. */
_ux_system_host -> ux_system_host_change_function(UX_DEVICE_REMOVAL, audio -> ux_host_class_audio_class, (VOID *) audio);
}
-
+
/* If trace is enabled, insert this event into the trace buffer. */
UX_TRACE_IN_LINE_INSERT(UX_TRACE_HOST_CLASS_AUDIO_DEACTIVATE, audio, 0, 0, 0, UX_TRACE_HOST_CLASS_EVENTS, 0, 0)
@@ -181,8 +163,8 @@ UINT i;
/* Free the audio instance memory. */
_ux_utility_memory_free(audio);
-
+
/* Return successful completion. */
- return(UX_SUCCESS);
+ return(UX_SUCCESS);
}
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 8c2e1b00..dd403d6b 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
@@ -1,18 +1,19 @@
/***************************************************************************
- * Copyright (c) 2024 Microsoft Corporation
- *
+ * Copyright (c) 2024 Microsoft Corporation
+ * Copyright (c) 2026-present Eclipse ThreadX contributors
+ *
* This program and the accompanying materials are made available under the
* terms of the MIT License which is available at
* https://opensource.org/licenses/MIT.
- *
+ *
* SPDX-License-Identifier: MIT
**************************************************************************/
/**************************************************************************/
/**************************************************************************/
-/** */
-/** USBX Component */
+/** */
+/** USBX Component */
/** */
/** Audio Class */
/** */
@@ -29,52 +30,40 @@
#include "ux_host_stack.h"
-/**************************************************************************/
-/* */
-/* FUNCTION RELEASE */
-/* */
-/* _ux_host_class_audio_descriptor_get PORTABLE C */
+/**************************************************************************/
+/* */
+/* FUNCTION RELEASE */
+/* */
+/* _ux_host_class_audio_descriptor_get PORTABLE C */
/* 6.1.12 */
/* AUTHOR */
/* */
/* Chaoqiong Xiao, Microsoft Corporation */
/* */
/* DESCRIPTION */
-/* */
-/* This function obtains the entire audio configuration descriptors. */
-/* This is needed because the audio class has many class specific */
-/* descriptors which describe the alternate settings that can be used. */
-/* */
-/* INPUT */
-/* */
-/* audio Pointer to audio class */
-/* */
-/* OUTPUT */
-/* */
-/* Completion Status */
-/* */
-/* CALLS */
-/* */
-/* _ux_host_stack_transfer_request Process transfer request */
-/* _ux_utility_descriptor_parse Parse descriptor */
-/* _ux_utility_memory_allocate Allocate memory block */
-/* _ux_utility_memory_free Release memory block */
-/* */
-/* CALLED BY */
-/* */
-/* Audio Class */
-/* */
-/* RELEASE HISTORY */
-/* */
-/* DATE NAME DESCRIPTION */
-/* */
-/* 05-19-2020 Chaoqiong Xiao Initial Version 6.0 */
-/* 09-30-2020 Chaoqiong Xiao Modified comment(s), */
-/* resulting in version 6.1 */
-/* 07-29-2022 Chaoqiong Xiao Modified comment(s), */
-/* used shared device config */
-/* descriptor for enum scan, */
-/* resulting in version 6.1.12 */
+/* */
+/* This function obtains the entire audio configuration descriptors. */
+/* This is needed because the audio class has many class specific */
+/* descriptors which describe the alternate settings that can be used. */
+/* */
+/* INPUT */
+/* */
+/* audio Pointer to audio class */
+/* */
+/* OUTPUT */
+/* */
+/* Completion Status */
+/* */
+/* CALLS */
+/* */
+/* _ux_host_stack_transfer_request Process transfer request */
+/* _ux_utility_descriptor_parse Parse descriptor */
+/* _ux_utility_memory_allocate Allocate memory block */
+/* _ux_utility_memory_free Release memory block */
+/* */
+/* CALLED BY */
+/* */
+/* Audio Class */
/* */
/**************************************************************************/
UINT _ux_host_class_audio_descriptor_get(UX_HOST_CLASS_AUDIO *audio)
@@ -133,10 +122,10 @@ ULONG total_configuration_length;
if ((status == UX_SUCCESS) && (transfer_request -> ux_transfer_request_actual_length == total_configuration_length))
{
- /* Save the address of the entire configuration descriptor of the audio device. */
+ /* Save the address of the entire configuration descriptor of the audio device. */
audio -> ux_host_class_audio_configuration_descriptor = descriptor;
- /* Save the length of the entire descriptor too. */
+ /* Save the length of the entire descriptor too. */
audio -> ux_host_class_audio_configuration_descriptor_length = total_configuration_length;
/* Keep descriptor to be shared for this device. */
diff --git a/common/usbx_host_classes/src/ux_host_class_audio_descriptors_parse.c b/common/usbx_host_classes/src/ux_host_class_audio_descriptors_parse.c
index 3b4aebdb..08f43e99 100644
--- a/common/usbx_host_classes/src/ux_host_class_audio_descriptors_parse.c
+++ b/common/usbx_host_classes/src/ux_host_class_audio_descriptors_parse.c
@@ -1,10 +1,11 @@
/***************************************************************************
- * Copyright (c) 2024 Microsoft Corporation
- *
+ * Copyright (c) 2024 Microsoft Corporation
+ * Copyright (c) 2026-present Eclipse ThreadX contributors
+ *
* This program and the accompanying materials are made available under the
* terms of the MIT License which is available at
* https://opensource.org/licenses/MIT.
- *
+ *
* SPDX-License-Identifier: MIT
**************************************************************************/
@@ -73,14 +74,6 @@
/* Audio Class */
/* Application */
/* */
-/* RELEASE HISTORY */
-/* */
-/* DATE NAME DESCRIPTION */
-/* */
-/* 07-29-2022 Chaoqiong Xiao Initial Version 6.1.12 */
-/* 10-31-2023 Chaoqiong Xiao Modified comment(s), */
-/* resulting in version 6.3.0 */
-/* */
/**************************************************************************/
UINT _ux_host_class_audio_descriptors_parse(UX_HOST_CLASS_AUDIO *audio,
UINT(*parse_function)(VOID *arg,
@@ -242,12 +235,6 @@ UINT status;
/* */
/* Application */
/* */
-/* RELEASE HISTORY */
-/* */
-/* DATE NAME DESCRIPTION */
-/* */
-/* 10-31-2023 Chaoqiong Xiao Initial Version 6.3.0 */
-/* */
/**************************************************************************/
UINT _uxe_host_class_audio_descriptors_parse(UX_HOST_CLASS_AUDIO *audio,
UINT(*parse_function)(VOID *arg,
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 357071cb..16049f1e 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
@@ -1,18 +1,19 @@
/***************************************************************************
- * Copyright (c) 2024 Microsoft Corporation
- *
+ * Copyright (c) 2024 Microsoft Corporation
+ * Copyright (c) 2026-present Eclipse ThreadX contributors
+ *
* This program and the accompanying materials are made available under the
* terms of the MIT License which is available at
* https://opensource.org/licenses/MIT.
- *
+ *
* SPDX-License-Identifier: MIT
**************************************************************************/
/**************************************************************************/
/**************************************************************************/
-/** */
-/** USBX Component */
+/** */
+/** USBX Component */
/** */
/** Audio Class */
/** */
@@ -30,50 +31,38 @@
#if !defined(UX_HOST_CLASS_AUDIO_DISABLE_CONTROLS)
-/**************************************************************************/
-/* */
-/* FUNCTION RELEASE */
-/* */
-/* _ux_host_class_audio_device_controls_list_get PORTABLE C */
+/**************************************************************************/
+/* */
+/* FUNCTION RELEASE */
+/* */
+/* _ux_host_class_audio_device_controls_list_get PORTABLE C */
/* 6.1.12 */
/* AUTHOR */
/* */
/* Chaoqiong Xiao, Microsoft Corporation */
/* */
/* DESCRIPTION */
-/* */
+/* */
/* This function obtains the controls of first found feature unit */
-/* for the audio device. */
-/* */
-/* INPUT */
-/* */
-/* audio Pointer to audio class */
-/* */
-/* OUTPUT */
-/* */
-/* Completion Status */
-/* */
-/* CALLS */
-/* */
-/* _ux_utility_descriptor_parse Parse descriptor */
-/* _ux_utility_long_get Get 32-bit word */
-/* _ux_utility_short_get Get 16-bit word */
-/* */
-/* CALLED BY */
-/* */
-/* Audio Class */
-/* */
-/* RELEASE HISTORY */
-/* */
-/* DATE NAME DESCRIPTION */
-/* */
-/* 05-19-2020 Chaoqiong Xiao Initial Version 6.0 */
-/* 09-30-2020 Chaoqiong Xiao Modified comment(s), */
-/* resulting in version 6.1 */
-/* 07-29-2022 Chaoqiong Xiao Modified comment(s), */
-/* added audio 2.0 support, */
-/* internal clean up, */
-/* resulting in version 6.1.12 */
+/* for the audio device. */
+/* */
+/* INPUT */
+/* */
+/* audio Pointer to audio class */
+/* */
+/* OUTPUT */
+/* */
+/* Completion Status */
+/* */
+/* CALLS */
+/* */
+/* _ux_utility_descriptor_parse Parse descriptor */
+/* _ux_utility_long_get Get 32-bit word */
+/* _ux_utility_short_get Get 16-bit word */
+/* */
+/* CALLED BY */
+/* */
+/* Audio Class */
/* */
/**************************************************************************/
UINT _ux_host_class_audio_device_controls_list_get(UX_HOST_CLASS_AUDIO *audio)
@@ -90,7 +79,7 @@ ULONG control_size_bytes;
UCHAR * control_bit_map_address;
ULONG channel_number;
ULONG itt_nb_channels;
-
+
/* Get the descriptor to the entire configuration */
descriptor = audio -> ux_host_class_audio_configuration_descriptor;
@@ -99,9 +88,9 @@ ULONG itt_nb_channels;
/* Get AC interface number. */
ac_interface = audio -> ux_host_class_audio_control_interface_number;
- /* Default is Interface descriptor not yet found. */
+ /* Default is Interface descriptor not yet found. */
descriptor_found = UX_FALSE;
-
+
/* Scan the descriptor for the Audio Streaming interface. */
while (total_descriptor_length)
{
@@ -132,7 +121,7 @@ ULONG itt_nb_channels;
/* Ensure we have the correct AC interface for Audio streaming. */
if (ac_interface == descriptor[2])
-
+
/* Mark we have found it. */
descriptor_found = UX_TRUE;
else
@@ -170,7 +159,7 @@ ULONG itt_nb_channels;
/* Get the number of channels and check for maximum allowed. */
if (itt_nb_channels > UX_HOST_CLASS_AUDIO_MAX_CHANNEL)
audio -> ux_host_class_audio_channels = UX_HOST_CLASS_AUDIO_MAX_CHANNEL;
- else
+ else
audio -> ux_host_class_audio_channels = itt_nb_channels;
break;
@@ -205,20 +194,20 @@ ULONG itt_nb_channels;
/* Each control has the same size. */
switch (control_size_bytes)
{
-
+
case 1:
/* Byte aligned control. */
audio -> ux_host_class_audio_channel_control[channel_number] = (ULONG) *control_bit_map_address;
break;
-
+
case 2:
/* Word aligned control. */
audio -> ux_host_class_audio_channel_control[channel_number] = (ULONG) _ux_utility_short_get(control_bit_map_address);
break;
-
+
case 4:
@@ -226,13 +215,13 @@ ULONG itt_nb_channels;
audio -> ux_host_class_audio_channel_control[channel_number] = _ux_utility_long_get(control_bit_map_address);
break;
-
+
default:
/* Not sure what we should do here, we ignore the control. */
break;
}
-
+
/* Point to the next control. */
control_bit_map_address += control_size_bytes;
}
@@ -242,7 +231,7 @@ ULONG itt_nb_channels;
}
}
break;
- }
+ }
/* Verify if the descriptor is still valid. */
if (descriptor_length > total_descriptor_length)
@@ -255,7 +244,7 @@ ULONG itt_nb_channels;
UX_TRACE_IN_LINE_INSERT(UX_TRACE_ERROR, UX_DESCRIPTOR_CORRUPTED, descriptor, 0, 0, UX_TRACE_ERRORS, 0, 0)
return(UX_DESCRIPTOR_CORRUPTED);
- }
+ }
/* Jump to the next descriptor if we have not reached the end. */
descriptor += descriptor_length;
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 85aa9a80..146c95b9 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
@@ -1,18 +1,19 @@
/***************************************************************************
- * Copyright (c) 2024 Microsoft Corporation
- *
+ * Copyright (c) 2024 Microsoft Corporation
+ * Copyright (c) 2026-present Eclipse ThreadX contributors
+ *
* This program and the accompanying materials are made available under the
* terms of the MIT License which is available at
* https://opensource.org/licenses/MIT.
- *
+ *
* SPDX-License-Identifier: MIT
**************************************************************************/
/**************************************************************************/
/**************************************************************************/
-/** */
-/** USBX Component */
+/** */
+/** USBX Component */
/** */
/** Audio Class */
/** */
@@ -29,50 +30,35 @@
#include "ux_host_stack.h"
-/**************************************************************************/
-/* */
-/* FUNCTION RELEASE */
-/* */
-/* _ux_host_class_audio_device_type_get PORTABLE C */
+/**************************************************************************/
+/* */
+/* FUNCTION RELEASE */
+/* */
+/* _ux_host_class_audio_device_type_get PORTABLE C */
/* 6.3.0 */
/* AUTHOR */
/* */
/* Chaoqiong Xiao, Microsoft Corporation */
/* */
/* DESCRIPTION */
-/* */
-/* This function obtains the device type. */
-/* */
-/* INPUT */
-/* */
-/* audio Pointer to audio class */
-/* */
-/* OUTPUT */
-/* */
-/* Completion Status */
-/* */
-/* CALLS */
-/* */
-/* _ux_utility_descriptor_parse Parse descriptor */
-/* */
-/* CALLED BY */
-/* */
-/* Audio Class */
-/* */
-/* RELEASE HISTORY */
-/* */
-/* DATE NAME DESCRIPTION */
-/* */
-/* 05-19-2020 Chaoqiong Xiao Initial Version 6.0 */
-/* 09-30-2020 Chaoqiong Xiao Modified comment(s), */
-/* resulting in version 6.1 */
-/* 07-29-2022 Chaoqiong Xiao Modified comment(s), */
-/* removed protocol store, */
-/* added audio 2.0 support, */
-/* resulting in version 6.1.12 */
-/* 10-31-2023 Chaoqiong Xiao Modified comment(s), */
-/* improved descriptors check, */
-/* resulting in version 6.3.0 */
+/* */
+/* This function obtains the device type. */
+/* */
+/* INPUT */
+/* */
+/* audio Pointer to audio class */
+/* */
+/* OUTPUT */
+/* */
+/* Completion Status */
+/* */
+/* CALLS */
+/* */
+/* _ux_utility_descriptor_parse Parse descriptor */
+/* */
+/* CALLED BY */
+/* */
+/* Audio Class */
/* */
/**************************************************************************/
UINT _ux_host_class_audio_device_type_get(UX_HOST_CLASS_AUDIO *audio)
@@ -92,14 +78,14 @@ UINT i;
/* Get the descriptor to the entire configuration. */
descriptor = audio -> ux_host_class_audio_configuration_descriptor;
total_descriptor_length = audio -> ux_host_class_audio_configuration_descriptor_length;
-
- /* Default is Interface descriptor not yet found. */
+
+ /* Default is Interface descriptor not yet found. */
descriptor_found = UX_FALSE;
iad = UX_NULL;
interface_descriptor = UX_NULL;
interface_number = audio -> ux_host_class_audio_streaming_interface
-> ux_interface_descriptor.bInterfaceNumber;
-
+
/* Scan the descriptor for the Audio Streaming interface. */
while (total_descriptor_length)
{
@@ -232,7 +218,7 @@ UINT i;
default:
break;
- }
+ }
/* Verify if the descriptor is still valid. */
if (descriptor_length > total_descriptor_length)
@@ -245,7 +231,7 @@ UINT i;
UX_TRACE_IN_LINE_INSERT(UX_TRACE_ERROR, UX_DESCRIPTOR_CORRUPTED, descriptor, 0, 0, UX_TRACE_ERRORS, 0, 0)
return(UX_DESCRIPTOR_CORRUPTED);
- }
+ }
/* Jump to the next descriptor if we have not reached the end. */
descriptor += descriptor_length;
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 a7833c72..157cfb20 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
@@ -1,10 +1,11 @@
/***************************************************************************
- * Copyright (c) 2024 Microsoft Corporation
- *
+ * Copyright (c) 2024 Microsoft Corporation
+ * Copyright (c) 2026-present Eclipse ThreadX contributors
+ *
* This program and the accompanying materials are made available under the
* terms of the MIT License which is available at
* https://opensource.org/licenses/MIT.
- *
+ *
* SPDX-License-Identifier: MIT
**************************************************************************/
@@ -59,19 +60,6 @@
/* */
/* Audio Class */
/* */
-/* RELEASE HISTORY */
-/* */
-/* DATE NAME DESCRIPTION */
-/* */
-/* 05-19-2020 Chaoqiong Xiao Initial Version 6.0 */
-/* 09-30-2020 Chaoqiong Xiao Modified comment(s), */
-/* resulting in version 6.1 */
-/* 07-29-2022 Chaoqiong Xiao Modified comment(s), */
-/* saved transfer direction, */
-/* added feedback support, */
-/* refined ISO support logic, */
-/* resulting in version 6.1.12 */
-/* */
/**************************************************************************/
UINT _ux_host_class_audio_endpoints_get(UX_HOST_CLASS_AUDIO *audio)
{
diff --git a/common/usbx_host_classes/src/ux_host_class_audio_entity_control_get.c b/common/usbx_host_classes/src/ux_host_class_audio_entity_control_get.c
index 0fd73f0f..3f62ae68 100644
--- a/common/usbx_host_classes/src/ux_host_class_audio_entity_control_get.c
+++ b/common/usbx_host_classes/src/ux_host_class_audio_entity_control_get.c
@@ -1,10 +1,11 @@
/***************************************************************************
- * Copyright (c) 2024 Microsoft Corporation
- *
+ * Copyright (c) 2024 Microsoft Corporation
+ * Copyright (c) 2026-present Eclipse ThreadX contributors
+ *
* This program and the accompanying materials are made available under the
* terms of the MIT License which is available at
* https://opensource.org/licenses/MIT.
- *
+ *
* SPDX-License-Identifier: MIT
**************************************************************************/
@@ -73,12 +74,6 @@
/* Application */
/* Audio Class */
/* */
-/* RELEASE HISTORY */
-/* */
-/* DATE NAME DESCRIPTION */
-/* */
-/* 07-29-2022 Chaoqiong Xiao Initial Version 6.1.12 */
-/* */
/**************************************************************************/
UINT _ux_host_class_audio_entity_control_get(UX_HOST_CLASS_AUDIO *audio, UX_HOST_CLASS_AUDIO_CONTROL *audio_control)
{
@@ -368,12 +363,6 @@ ULONG n_subs, sub, pos, min, max, res, size;
/* */
/* Application */
/* */
-/* RELEASE HISTORY */
-/* */
-/* DATE NAME DESCRIPTION */
-/* */
-/* 10-31-2023 Chaoqiong Xiao Initial Version 6.3.0 */
-/* */
/**************************************************************************/
UINT _uxe_host_class_audio_entity_control_get(UX_HOST_CLASS_AUDIO *audio, UX_HOST_CLASS_AUDIO_CONTROL *audio_control)
{
diff --git a/common/usbx_host_classes/src/ux_host_class_audio_entity_control_value_get.c b/common/usbx_host_classes/src/ux_host_class_audio_entity_control_value_get.c
index 76bdf476..6a280245 100644
--- a/common/usbx_host_classes/src/ux_host_class_audio_entity_control_value_get.c
+++ b/common/usbx_host_classes/src/ux_host_class_audio_entity_control_value_get.c
@@ -1,10 +1,11 @@
/***************************************************************************
- * Copyright (c) 2024 Microsoft Corporation
- *
+ * Copyright (c) 2024 Microsoft Corporation
+ * Copyright (c) 2026-present Eclipse ThreadX contributors
+ *
* This program and the accompanying materials are made available under the
* terms of the MIT License which is available at
* https://opensource.org/licenses/MIT.
- *
+ *
* SPDX-License-Identifier: MIT
**************************************************************************/
@@ -70,12 +71,6 @@
/* */
/* Audio Class */
/* */
-/* RELEASE HISTORY */
-/* */
-/* DATE NAME DESCRIPTION */
-/* */
-/* 07-29-2022 Chaoqiong Xiao Initial Version 6.1.12 */
-/* */
/**************************************************************************/
UINT _ux_host_class_audio_entity_control_value_get(UX_HOST_CLASS_AUDIO *audio, UX_HOST_CLASS_AUDIO_CONTROL *audio_control)
{
@@ -185,12 +180,6 @@ ULONG actual_size;
/* */
/* Application */
/* */
-/* RELEASE HISTORY */
-/* */
-/* DATE NAME DESCRIPTION */
-/* */
-/* 10-31-2023 Chaoqiong Xiao Initial Version 6.3.0 */
-/* */
/**************************************************************************/
UINT _uxe_host_class_audio_entity_control_value_get(UX_HOST_CLASS_AUDIO *audio, UX_HOST_CLASS_AUDIO_CONTROL *audio_control)
{
diff --git a/common/usbx_host_classes/src/ux_host_class_audio_entity_control_value_set.c b/common/usbx_host_classes/src/ux_host_class_audio_entity_control_value_set.c
index e9638331..bf346e91 100644
--- a/common/usbx_host_classes/src/ux_host_class_audio_entity_control_value_set.c
+++ b/common/usbx_host_classes/src/ux_host_class_audio_entity_control_value_set.c
@@ -1,10 +1,11 @@
/***************************************************************************
- * Copyright (c) 2024 Microsoft Corporation
- *
+ * Copyright (c) 2024 Microsoft Corporation
+ * Copyright (c) 2026-present Eclipse ThreadX contributors
+ *
* This program and the accompanying materials are made available under the
* terms of the MIT License which is available at
* https://opensource.org/licenses/MIT.
- *
+ *
* SPDX-License-Identifier: MIT
**************************************************************************/
@@ -71,12 +72,6 @@
/* Application */
/* Audio Class */
/* */
-/* RELEASE HISTORY */
-/* */
-/* DATE NAME DESCRIPTION */
-/* */
-/* 07-29-2022 Chaoqiong Xiao Initial Version 6.1.12 */
-/* */
/**************************************************************************/
UINT _ux_host_class_audio_entity_control_value_set(UX_HOST_CLASS_AUDIO *audio, UX_HOST_CLASS_AUDIO_CONTROL *audio_control)
{
@@ -175,12 +170,6 @@ ULONG actual_size;
/* */
/* Application */
/* */
-/* RELEASE HISTORY */
-/* */
-/* DATE NAME DESCRIPTION */
-/* */
-/* 10-31-2023 Chaoqiong Xiao Initial Version 6.3.0 */
-/* */
/**************************************************************************/
UINT _uxe_host_class_audio_entity_control_value_set(UX_HOST_CLASS_AUDIO *audio, UX_HOST_CLASS_AUDIO_CONTROL *audio_control)
{
diff --git a/common/usbx_host_classes/src/ux_host_class_audio_entry.c b/common/usbx_host_classes/src/ux_host_class_audio_entry.c
index 512d36d3..92ecaf66 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
@@ -1,18 +1,19 @@
/***************************************************************************
- * Copyright (c) 2024 Microsoft Corporation
- *
+ * Copyright (c) 2024 Microsoft Corporation
+ * Copyright (c) 2026-present Eclipse ThreadX contributors
+ *
* This program and the accompanying materials are made available under the
* terms of the MIT License which is available at
* https://opensource.org/licenses/MIT.
- *
+ *
* SPDX-License-Identifier: MIT
**************************************************************************/
/**************************************************************************/
/**************************************************************************/
-/** */
-/** USBX Component */
+/** */
+/** USBX Component */
/** */
/** Audio Class */
/** */
@@ -29,50 +30,39 @@
#include "ux_host_stack.h"
-/**************************************************************************/
-/* */
-/* FUNCTION RELEASE */
-/* */
-/* _ux_host_class_audio_entry PORTABLE C */
+/**************************************************************************/
+/* */
+/* FUNCTION RELEASE */
+/* */
+/* _ux_host_class_audio_entry PORTABLE C */
/* 6.1.12 */
/* AUTHOR */
/* */
/* Chaoqiong Xiao, Microsoft Corporation */
/* */
/* DESCRIPTION */
-/* */
-/* This function is the entry point of the Audio class. It will be */
-/* called by the USBX stack enumeration module when there is a new */
-/* audio device (speaker, microphone ...) on the bus or when the audio */
-/* device is removed. */
-/* */
-/* INPUT */
-/* */
-/* command Pointer to command */
-/* */
-/* OUTPUT */
-/* */
-/* Completion Status */
-/* */
-/* CALLS */
-/* */
-/* _ux_host_class_audio_activate Activate audio class */
-/* _ux_host_class_audio_deactivate Deactivate audio class */
-/* */
-/* CALLED BY */
-/* */
-/* Host Stack */
-/* */
-/* RELEASE HISTORY */
-/* */
-/* DATE NAME DESCRIPTION */
-/* */
-/* 05-19-2020 Chaoqiong Xiao Initial Version 6.0 */
-/* 09-30-2020 Chaoqiong Xiao Modified comment(s), */
-/* resulting in version 6.1 */
-/* 07-29-2022 Chaoqiong Xiao Modified comment(s), */
-/* added audio 2.0 support, */
-/* resulting in version 6.1.12 */
+/* */
+/* This function is the entry point of the Audio class. It will be */
+/* called by the USBX stack enumeration module when there is a new */
+/* audio device (speaker, microphone ...) on the bus or when the audio */
+/* device is removed. */
+/* */
+/* INPUT */
+/* */
+/* command Pointer to command */
+/* */
+/* OUTPUT */
+/* */
+/* Completion Status */
+/* */
+/* CALLS */
+/* */
+/* _ux_host_class_audio_activate Activate audio class */
+/* _ux_host_class_audio_deactivate Deactivate audio class */
+/* */
+/* CALLED BY */
+/* */
+/* Host Stack */
/* */
/**************************************************************************/
UINT _ux_host_class_audio_entry(UX_HOST_CLASS_COMMAND *command)
@@ -100,24 +90,24 @@ UINT status;
(command -> ux_host_class_command_protocol == UX_HOST_CLASS_AUDIO_PROTOCOL_IP_VERSION_01_00)
#endif
)
- return(UX_SUCCESS);
- else
- return(UX_NO_CLASS_MATCH);
-
-
+ return(UX_SUCCESS);
+ else
+ return(UX_NO_CLASS_MATCH);
+
+
case UX_HOST_CLASS_COMMAND_ACTIVATE:
/* The activate command is used when the device inserted has found a parent and
is ready to complete the enumeration. */
status = _ux_host_class_audio_activate(command);
-
- /* Return completion status. */
+
+ /* Return completion status. */
return(status);
case UX_HOST_CLASS_COMMAND_DEACTIVATE:
- /* The deactivate command is used when the device has been extracted either
+ /* The deactivate command is used when the device has been extracted either
directly or when its parents has been extracted. */
status = _ux_host_class_audio_deactivate(command);
@@ -125,7 +115,7 @@ UINT status;
return(status);
- default:
+ default:
/* Error trap. */
_ux_system_error_handler(UX_SYSTEM_LEVEL_THREAD, UX_SYSTEM_CONTEXT_CLASS, UX_FUNCTION_NOT_SUPPORTED);
@@ -134,6 +124,6 @@ UINT status;
UX_TRACE_IN_LINE_INSERT(UX_TRACE_ERROR, UX_FUNCTION_NOT_SUPPORTED, 0, 0, 0, UX_TRACE_ERRORS, 0, 0)
return(UX_FUNCTION_NOT_SUPPORTED);
- }
+ }
}
diff --git a/common/usbx_host_classes/src/ux_host_class_audio_feedback_get.c b/common/usbx_host_classes/src/ux_host_class_audio_feedback_get.c
index 0223869b..75855599 100644
--- a/common/usbx_host_classes/src/ux_host_class_audio_feedback_get.c
+++ b/common/usbx_host_classes/src/ux_host_class_audio_feedback_get.c
@@ -1,10 +1,11 @@
/***************************************************************************
- * Copyright (c) 2024 Microsoft Corporation
- *
+ * Copyright (c) 2024 Microsoft Corporation
+ * Copyright (c) 2026-present Eclipse ThreadX contributors
+ *
* This program and the accompanying materials are made available under the
* terms of the MIT License which is available at
* https://opensource.org/licenses/MIT.
- *
+ *
* SPDX-License-Identifier: MIT
**************************************************************************/
@@ -61,12 +62,6 @@
/* */
/* Application */
/* */
-/* RELEASE HISTORY */
-/* */
-/* DATE NAME DESCRIPTION */
-/* */
-/* 07-29-2022 Chaoqiong Xiao Initial Version 6.1.12 */
-/* */
/**************************************************************************/
UINT _ux_host_class_audio_feedback_get(UX_HOST_CLASS_AUDIO *audio, UCHAR *feedback)
{
@@ -131,12 +126,6 @@ UINT _ux_host_class_audio_feedback_get(UX_HOST_CLASS_AUDIO *audio, UCHAR *feedb
/* */
/* Application */
/* */
-/* RELEASE HISTORY */
-/* */
-/* DATE NAME DESCRIPTION */
-/* */
-/* 10-31-2023 Chaoqiong Xiao Initial Version 6.3.0 */
-/* */
/**************************************************************************/
UINT _uxe_host_class_audio_feedback_get(UX_HOST_CLASS_AUDIO *audio, UCHAR *feedback)
{
diff --git a/common/usbx_host_classes/src/ux_host_class_audio_feedback_set.c b/common/usbx_host_classes/src/ux_host_class_audio_feedback_set.c
index 74c83fd2..4f69ddd5 100644
--- a/common/usbx_host_classes/src/ux_host_class_audio_feedback_set.c
+++ b/common/usbx_host_classes/src/ux_host_class_audio_feedback_set.c
@@ -1,10 +1,11 @@
/***************************************************************************
- * Copyright (c) 2024 Microsoft Corporation
- *
+ * Copyright (c) 2024 Microsoft Corporation
+ * Copyright (c) 2026-present Eclipse ThreadX contributors
+ *
* This program and the accompanying materials are made available under the
* terms of the MIT License which is available at
* https://opensource.org/licenses/MIT.
- *
+ *
* SPDX-License-Identifier: MIT
**************************************************************************/
@@ -65,12 +66,6 @@
/* */
/* Application */
/* */
-/* RELEASE HISTORY */
-/* */
-/* DATE NAME DESCRIPTION */
-/* */
-/* 07-29-2022 Chaoqiong Xiao Initial Version 6.1.12 */
-/* */
/**************************************************************************/
UINT _ux_host_class_audio_feedback_set(UX_HOST_CLASS_AUDIO *audio, UCHAR *feedback)
{
@@ -148,12 +143,6 @@ UX_TRANSFER *transfer;
/* */
/* Application */
/* */
-/* RELEASE HISTORY */
-/* */
-/* DATE NAME DESCRIPTION */
-/* */
-/* 10-31-2023 Chaoqiong Xiao Initial Version 6.3.0 */
-/* */
/**************************************************************************/
UINT _uxe_host_class_audio_feedback_set(UX_HOST_CLASS_AUDIO *audio, UCHAR *feedback)
{
diff --git a/common/usbx_host_classes/src/ux_host_class_audio_feedback_transfer_completed.c b/common/usbx_host_classes/src/ux_host_class_audio_feedback_transfer_completed.c
index 8e3f62d8..f6f9b8b8 100644
--- a/common/usbx_host_classes/src/ux_host_class_audio_feedback_transfer_completed.c
+++ b/common/usbx_host_classes/src/ux_host_class_audio_feedback_transfer_completed.c
@@ -1,10 +1,11 @@
/***************************************************************************
- * Copyright (c) 2024 Microsoft Corporation
- *
+ * Copyright (c) 2024 Microsoft Corporation
+ * Copyright (c) 2026-present Eclipse ThreadX contributors
+ *
* This program and the accompanying materials are made available under the
* terms of the MIT License which is available at
* https://opensource.org/licenses/MIT.
- *
+ *
* SPDX-License-Identifier: MIT
**************************************************************************/
@@ -60,12 +61,6 @@
/* */
/* HCD */
/* */
-/* RELEASE HISTORY */
-/* */
-/* DATE NAME DESCRIPTION */
-/* */
-/* 07-29-2022 Chaoqiong Xiao Initial Version 6.1.12 */
-/* */
/**************************************************************************/
VOID _ux_host_class_audio_feedback_transfer_completed(UX_TRANSFER *transfer_request)
{
diff --git a/common/usbx_host_classes/src/ux_host_class_audio_interrupt_notification.c b/common/usbx_host_classes/src/ux_host_class_audio_interrupt_notification.c
index c483e07d..5a67daf7 100644
--- a/common/usbx_host_classes/src/ux_host_class_audio_interrupt_notification.c
+++ b/common/usbx_host_classes/src/ux_host_class_audio_interrupt_notification.c
@@ -1,10 +1,11 @@
/***************************************************************************
- * Copyright (c) 2024 Microsoft Corporation
- *
+ * Copyright (c) 2024 Microsoft Corporation
+ * Copyright (c) 2026-present Eclipse ThreadX contributors
+ *
* This program and the accompanying materials are made available under the
* terms of the MIT License which is available at
* https://opensource.org/licenses/MIT.
- *
+ *
* SPDX-License-Identifier: MIT
**************************************************************************/
@@ -62,12 +63,6 @@
/* */
/* HCD */
/* */
-/* RELEASE HISTORY */
-/* */
-/* DATE NAME DESCRIPTION */
-/* */
-/* 07-29-2022 Chaoqiong Xiao Initial Version 6.1.12 */
-/* */
/**************************************************************************/
VOID _ux_host_class_audio_interrupt_notification(UX_TRANSFER *transfer_request)
{
diff --git a/common/usbx_host_classes/src/ux_host_class_audio_interrupt_start.c b/common/usbx_host_classes/src/ux_host_class_audio_interrupt_start.c
index a308a1a0..ea5587dc 100644
--- a/common/usbx_host_classes/src/ux_host_class_audio_interrupt_start.c
+++ b/common/usbx_host_classes/src/ux_host_class_audio_interrupt_start.c
@@ -1,10 +1,11 @@
/***************************************************************************
- * Copyright (c) 2024 Microsoft Corporation
- *
+ * Copyright (c) 2024 Microsoft Corporation
+ * Copyright (c) 2026-present Eclipse ThreadX contributors
+ *
* This program and the accompanying materials are made available under the
* terms of the MIT License which is available at
* https://opensource.org/licenses/MIT.
- *
+ *
* SPDX-License-Identifier: MIT
**************************************************************************/
@@ -69,12 +70,6 @@
/* */
/* Application */
/* */
-/* RELEASE HISTORY */
-/* */
-/* DATE NAME DESCRIPTION */
-/* */
-/* 07-29-2022 Chaoqiong Xiao Initial Version 6.1.12 */
-/* */
/**************************************************************************/
UINT _ux_host_class_audio_interrupt_start(UX_HOST_CLASS_AUDIO_AC *audio,
VOID(*callback_function)(UX_HOST_CLASS_AUDIO_AC *audio,
@@ -110,7 +105,7 @@ UINT status;
endpoint = audio -> ux_host_class_audio_interrupt_endpoint;
if (endpoint == UX_NULL)
return(UX_FUNCTION_NOT_SUPPORTED);
-
+
/* Check if interrupt started. */
if (audio -> ux_host_class_audio_interrupt_started)
return(UX_ALREADY_ACTIVATED);
@@ -174,12 +169,6 @@ UINT status;
/* */
/* Application */
/* */
-/* RELEASE HISTORY */
-/* */
-/* DATE NAME DESCRIPTION */
-/* */
-/* 10-31-2023 Chaoqiong Xiao Initial Version 6.3.0 */
-/* */
/**************************************************************************/
UINT _uxe_host_class_audio_interrupt_start(UX_HOST_CLASS_AUDIO_AC *audio,
VOID(*callback_function)(UX_HOST_CLASS_AUDIO_AC *audio,
diff --git a/common/usbx_host_classes/src/ux_host_class_audio_raw_sampling_parse.c b/common/usbx_host_classes/src/ux_host_class_audio_raw_sampling_parse.c
index 0e511cd2..46ee9c82 100644
--- a/common/usbx_host_classes/src/ux_host_class_audio_raw_sampling_parse.c
+++ b/common/usbx_host_classes/src/ux_host_class_audio_raw_sampling_parse.c
@@ -1,5 +1,6 @@
/***************************************************************************
* Copyright (c) 2024 Microsoft Corporation
+ * Copyright (c) 2026-present Eclipse ThreadX contributors
*
* This program and the accompanying materials are made available under the
* terms of the MIT License which is available at
@@ -117,12 +118,6 @@ static inline UINT _ux_host_class_audio20_sampling_parse(UX_HOST_CLASS_AUDIO *au
/* Application */
/* Audio Class */
/* */
-/* RELEASE HISTORY */
-/* */
-/* DATE NAME DESCRIPTION */
-/* */
-/* 07-29-2022 Chaoqiong Xiao Initial Version 6.1.12 */
-/* */
/**************************************************************************/
UINT _ux_host_class_audio_raw_sampling_parse(UX_HOST_CLASS_AUDIO *audio,
UINT(*parse_function)(VOID *arg,
@@ -852,12 +847,6 @@ UINT status;
/* */
/* Application */
/* */
-/* RELEASE HISTORY */
-/* */
-/* DATE NAME DESCRIPTION */
-/* */
-/* 10-31-2023 Chaoqiong Xiao Initial Version 6.3.0 */
-/* */
/**************************************************************************/
UINT _uxe_host_class_audio_raw_sampling_parse(UX_HOST_CLASS_AUDIO *audio,
UINT(*parse_function)(VOID *arg,
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 3303ccf2..ac386c7f 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
@@ -1,18 +1,19 @@
/***************************************************************************
- * Copyright (c) 2024 Microsoft Corporation
- *
+ * Copyright (c) 2024 Microsoft Corporation
+ * Copyright (c) 2026-present Eclipse ThreadX contributors
+ *
* This program and the accompanying materials are made available under the
* terms of the MIT License which is available at
* https://opensource.org/licenses/MIT.
- *
+ *
* SPDX-License-Identifier: MIT
**************************************************************************/
/**************************************************************************/
/**************************************************************************/
-/** */
-/** USBX Component */
+/** */
+/** USBX Component */
/** */
/** Audio Class */
/** */
@@ -29,67 +30,43 @@
#include "ux_host_stack.h"
-/**************************************************************************/
-/* */
-/* FUNCTION RELEASE */
-/* */
-/* _ux_host_class_audio_read PORTABLE C */
+/**************************************************************************/
+/* */
+/* FUNCTION RELEASE */
+/* */
+/* _ux_host_class_audio_read PORTABLE C */
/* 6.1.12 */
/* AUTHOR */
/* */
/* Chaoqiong Xiao, Microsoft Corporation */
/* */
/* DESCRIPTION */
-/* */
-/* This function reads from the audio streaming interface. */
+/* */
+/* This function reads from the audio streaming interface. */
/* */
/* Note the request buffer should be ready for at least one packet, */
/* and request length is always limited to one packet size. */
-/* */
-/* INPUT */
-/* */
-/* audio Pointer to audio class */
-/* audio_transfer_request Pointer to transfer request */
-/* */
-/* OUTPUT */
-/* */
-/* Completion Status */
-/* */
-/* CALLS */
-/* */
-/* _ux_host_class_audio_transfer_request Audio transfer request */
-/* _ux_host_stack_class_instance_verify Verify instance is valid */
+/* */
+/* INPUT */
+/* */
+/* audio Pointer to audio class */
+/* audio_transfer_request Pointer to transfer request */
+/* */
+/* OUTPUT */
+/* */
+/* Completion Status */
+/* */
+/* CALLS */
+/* */
+/* _ux_host_class_audio_transfer_request Audio transfer request */
+/* _ux_host_stack_class_instance_verify Verify instance is valid */
/* _ux_host_mutex_on Get mutex */
/* _ux_host_mutex_off Release mutex */
-/* */
-/* CALLED BY */
-/* */
-/* Application */
-/* Audio Class */
-/* */
-/* RELEASE HISTORY */
-/* */
-/* DATE NAME DESCRIPTION */
-/* */
-/* 05-19-2020 Chaoqiong Xiao Initial Version 6.0 */
-/* 09-30-2020 Chaoqiong Xiao Modified comment(s), */
-/* resulting in version 6.1 */
-/* 10-15-2021 Chaoqiong Xiao Modified comment(s), */
-/* use pre-calculated value */
-/* instead of wMaxPacketSize, */
-/* resulting in version 6.1.9 */
-/* 01-31-2022 Chaoqiong Xiao Modified comment(s), */
-/* refined macros names, */
-/* resulting in version 6.1.10 */
-/* 04-25-2022 Chaoqiong Xiao Modified comment(s), */
-/* fixed standalone compile, */
-/* resulting in version 6.1.11 */
-/* 07-29-2022 Chaoqiong Xiao Modified comment(s), */
-/* refined packet size manage, */
-/* protect reentry with mutex, */
-/* refined transfer implement, */
-/* fixed error return code, */
-/* resulting in version 6.1.12 */
+/* */
+/* CALLED BY */
+/* */
+/* Application */
+/* Audio Class */
/* */
/**************************************************************************/
UINT _ux_host_class_audio_read(UX_HOST_CLASS_AUDIO *audio, UX_HOST_CLASS_AUDIO_TRANSFER_REQUEST *audio_transfer_request)
@@ -99,12 +76,12 @@ UINT status;
ULONG mps;
/* If trace is enabled, insert this event into the trace buffer. */
- UX_TRACE_IN_LINE_INSERT(UX_TRACE_HOST_CLASS_AUDIO_READ, audio, audio_transfer_request -> ux_host_class_audio_transfer_request_data_pointer,
+ UX_TRACE_IN_LINE_INSERT(UX_TRACE_HOST_CLASS_AUDIO_READ, audio, audio_transfer_request -> ux_host_class_audio_transfer_request_data_pointer,
audio_transfer_request -> ux_host_class_audio_transfer_request_requested_length, 0, UX_TRACE_HOST_CLASS_EVENTS, 0, 0)
/* Ensure the instance is valid. */
if (_ux_host_stack_class_instance_verify(_ux_system_host_class_audio_name, (VOID *) audio) != UX_SUCCESS)
- {
+ {
/* Error trap. */
_ux_system_error_handler(UX_SYSTEM_LEVEL_THREAD, UX_SYSTEM_CONTEXT_CLASS, UX_HOST_CLASS_INSTANCE_UNKNOWN);
@@ -165,8 +142,8 @@ ULONG mps;
/* */
/* INPUT */
/* */
-/* audio Pointer to audio class */
-/* audio_transfer_request Pointer to transfer request */
+/* audio Pointer to audio class */
+/* audio_transfer_request Pointer to transfer request */
/* */
/* OUTPUT */
/* */
@@ -180,12 +157,6 @@ ULONG mps;
/* */
/* Application */
/* */
-/* RELEASE HISTORY */
-/* */
-/* DATE NAME DESCRIPTION */
-/* */
-/* 10-31-2023 Chaoqiong Xiao Initial Version 6.3.0 */
-/* */
/**************************************************************************/
UINT _uxe_host_class_audio_read(UX_HOST_CLASS_AUDIO *audio, UX_HOST_CLASS_AUDIO_TRANSFER_REQUEST *audio_transfer_request)
{
diff --git a/common/usbx_host_classes/src/ux_host_class_audio_stop.c b/common/usbx_host_classes/src/ux_host_class_audio_stop.c
index 340abd98..b37313a3 100644
--- a/common/usbx_host_classes/src/ux_host_class_audio_stop.c
+++ b/common/usbx_host_classes/src/ux_host_class_audio_stop.c
@@ -1,10 +1,11 @@
/***************************************************************************
- * Copyright (c) 2024 Microsoft Corporation
- *
+ * Copyright (c) 2024 Microsoft Corporation
+ * Copyright (c) 2026-present Eclipse ThreadX contributors
+ *
* This program and the accompanying materials are made available under the
* terms of the MIT License which is available at
* https://opensource.org/licenses/MIT.
- *
+ *
* SPDX-License-Identifier: MIT
**************************************************************************/
@@ -64,12 +65,6 @@
/* */
/* Application */
/* */
-/* RELEASE HISTORY */
-/* */
-/* DATE NAME DESCRIPTION */
-/* */
-/* 07-29-2022 Chaoqiong Xiao Initial Version 6.1.12 */
-/* */
/**************************************************************************/
UINT _ux_host_class_audio_stop(UX_HOST_CLASS_AUDIO *audio)
{
@@ -82,7 +77,7 @@ UINT streaming_interface;
/* Ensure the instance is valid. */
if (_ux_host_stack_class_instance_verify(_ux_system_host_class_audio_name, (VOID *) audio) != UX_SUCCESS)
- {
+ {
/* Error trap. */
_ux_system_error_handler(UX_SYSTEM_LEVEL_THREAD, UX_SYSTEM_CONTEXT_CLASS, UX_HOST_CLASS_INSTANCE_UNKNOWN);
@@ -184,7 +179,7 @@ UINT streaming_interface;
/* */
/* INPUT */
/* */
-/* audio Pointer to audio class */
+/* audio Pointer to audio class */
/* */
/* OUTPUT */
/* */
@@ -198,12 +193,6 @@ UINT streaming_interface;
/* */
/* Application */
/* */
-/* RELEASE HISTORY */
-/* */
-/* DATE NAME DESCRIPTION */
-/* */
-/* 10-31-2023 Chaoqiong Xiao Initial Version 6.3.0 */
-/* */
/**************************************************************************/
UINT _uxe_host_class_audio_stop(UX_HOST_CLASS_AUDIO *audio)
{
diff --git a/common/usbx_host_classes/src/ux_host_class_audio_streaming_sampling_get.c b/common/usbx_host_classes/src/ux_host_class_audio_streaming_sampling_get.c
index 9cd2025e..99a6a6ce 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
@@ -1,10 +1,11 @@
/***************************************************************************
- * Copyright (c) 2024 Microsoft Corporation
- *
+ * Copyright (c) 2024 Microsoft Corporation
+ * Copyright (c) 2026-present Eclipse ThreadX contributors
+ *
* This program and the accompanying materials are made available under the
* terms of the MIT License which is available at
* https://opensource.org/licenses/MIT.
- *
+ *
* SPDX-License-Identifier: MIT
**************************************************************************/
@@ -67,24 +68,6 @@
/* Application */
/* Audio Class */
/* */
-/* RELEASE HISTORY */
-/* */
-/* DATE NAME DESCRIPTION */
-/* */
-/* 05-19-2020 Chaoqiong Xiao Initial Version 6.0 */
-/* 09-30-2020 Chaoqiong Xiao Modified comment(s), */
-/* resulting in version 6.1 */
-/* 01-31-2022 Chaoqiong Xiao Modified comment(s), */
-/* refined macros names, */
-/* resulting in version 6.1.10 */
-/* 04-25-2022 Chaoqiong Xiao Modified comment(s), */
-/* fixed standalone compile, */
-/* resulting in version 6.1.11 */
-/* 07-29-2022 Chaoqiong Xiao Modified comment(s), */
-/* protect reentry with mutex, */
-/* fixed error return code, */
-/* resulting in version 6.1.12 */
-/* */
/**************************************************************************/
UINT _ux_host_class_audio_streaming_sampling_get(UX_HOST_CLASS_AUDIO *audio, UX_HOST_CLASS_AUDIO_SAMPLING_CHARACTERISTICS *audio_sampling)
{
@@ -494,12 +477,6 @@ UINT previous_match_found;
/* */
/* Application */
/* */
-/* RELEASE HISTORY */
-/* */
-/* DATE NAME DESCRIPTION */
-/* */
-/* 10-31-2023 Chaoqiong Xiao Initial Version 6.3.0 */
-/* */
/**************************************************************************/
UINT _uxe_host_class_audio_streaming_sampling_get(UX_HOST_CLASS_AUDIO *audio, UX_HOST_CLASS_AUDIO_SAMPLING_CHARACTERISTICS *audio_sampling)
{
diff --git a/common/usbx_host_classes/src/ux_host_class_audio_streaming_sampling_set.c b/common/usbx_host_classes/src/ux_host_class_audio_streaming_sampling_set.c
index 1655dc39..1537910a 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
@@ -1,10 +1,11 @@
/***************************************************************************
- * Copyright (c) 2024 Microsoft Corporation
- *
+ * Copyright (c) 2024 Microsoft Corporation
+ * Copyright (c) 2026-present Eclipse ThreadX contributors
+ *
* This program and the accompanying materials are made available under the
* terms of the MIT License which is available at
* https://opensource.org/licenses/MIT.
- *
+ *
* SPDX-License-Identifier: MIT
**************************************************************************/
@@ -72,33 +73,6 @@
/* Application */
/* Audio Class */
/* */
-/* RELEASE HISTORY */
-/* */
-/* DATE NAME DESCRIPTION */
-/* */
-/* 05-19-2020 Chaoqiong Xiao Initial Version 6.0 */
-/* 09-30-2020 Chaoqiong Xiao Modified comment(s), */
-/* resulting in version 6.1 */
-/* 01-31-2022 Chaoqiong Xiao Modified comment(s), */
-/* refined macros names, */
-/* resulting in version 6.1.10 */
-/* 04-25-2022 Chaoqiong Xiao Modified comment(s), */
-/* fixed standalone compile, */
-/* resulting in version 6.1.11 */
-/* 07-29-2022 Chaoqiong Xiao Modified comment(s), */
-/* fixed parameter/variable */
-/* names conflict C++ keyword, */
-/* added audio 2.0 support, */
-/* internal clean up, */
-/* set sample rate if needed, */
-/* protect reentry with mutex, */
-/* fixed error return code, */
-/* used endpoints get API, */
-/* resulting in version 6.1.12 */
-/* 03-08-2023 Chaoqiong Xiao Modified comment(s), */
-/* improved frequency check, */
-/* resulting in version 6.2.1 */
-/* */
/**************************************************************************/
UINT _ux_host_class_audio_streaming_sampling_set(UX_HOST_CLASS_AUDIO *audio, UX_HOST_CLASS_AUDIO_SAMPLING *audio_sampling)
{
@@ -404,8 +378,8 @@ ULONG res_bytes;
/* */
/* INPUT */
/* */
-/* audio Pointer to audio class */
-/* audio_sampling Pointer to audio sampling */
+/* audio Pointer to audio class */
+/* audio_sampling Pointer to audio sampling */
/* */
/* OUTPUT */
/* */
@@ -420,12 +394,6 @@ ULONG res_bytes;
/* */
/* Application */
/* */
-/* RELEASE HISTORY */
-/* */
-/* DATE NAME DESCRIPTION */
-/* */
-/* 10-31-2023 Chaoqiong Xiao Initial Version 6.3.0 */
-/* */
/**************************************************************************/
UINT _uxe_host_class_audio_streaming_sampling_set(UX_HOST_CLASS_AUDIO *audio, UX_HOST_CLASS_AUDIO_SAMPLING *audio_sampling)
{
diff --git a/common/usbx_host_classes/src/ux_host_class_audio_streaming_terminal_get.c b/common/usbx_host_classes/src/ux_host_class_audio_streaming_terminal_get.c
index 3b366ac6..28bb9014 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
@@ -1,18 +1,19 @@
/***************************************************************************
- * Copyright (c) 2024 Microsoft Corporation
- *
+ * Copyright (c) 2024 Microsoft Corporation
+ * Copyright (c) 2026-present Eclipse ThreadX contributors
+ *
* This program and the accompanying materials are made available under the
* terms of the MIT License which is available at
* https://opensource.org/licenses/MIT.
- *
+ *
* SPDX-License-Identifier: MIT
**************************************************************************/
/**************************************************************************/
/**************************************************************************/
-/** */
-/** USBX Component */
+/** */
+/** USBX Component */
/** */
/** Audio Class */
/** */
@@ -29,45 +30,37 @@
#include "ux_host_stack.h"
-/**************************************************************************/
-/* */
-/* FUNCTION RELEASE */
-/* */
-/* _ux_host_class_audio_streaming_terminal_get PORTABLE C */
+/**************************************************************************/
+/* */
+/* FUNCTION RELEASE */
+/* */
+/* _ux_host_class_audio_streaming_terminal_get PORTABLE C */
/* 6.1 */
/* AUTHOR */
/* */
/* Chaoqiong Xiao, Microsoft Corporation */
/* */
/* DESCRIPTION */
-/* */
+/* */
/* This function searches and retrieves the streaming terminal. This */
-/* terminal is used to further search which of the input\output */
-/* terminals describes if the device is audio IN or audio OUT. */
-/* */
-/* INPUT */
-/* */
-/* audio Pointer to audio class */
-/* */
-/* OUTPUT */
-/* */
-/* Completion Status */
-/* */
-/* CALLS */
-/* */
-/* _ux_utility_descriptor_parse Parse descriptor */
-/* */
-/* CALLED BY */
-/* */
-/* Audio Class */
-/* */
-/* RELEASE HISTORY */
-/* */
-/* DATE NAME DESCRIPTION */
-/* */
-/* 05-19-2020 Chaoqiong Xiao Initial Version 6.0 */
-/* 09-30-2020 Chaoqiong Xiao Modified comment(s), */
-/* resulting in version 6.1 */
+/* terminal is used to further search which of the input\output */
+/* terminals describes if the device is audio IN or audio OUT. */
+/* */
+/* INPUT */
+/* */
+/* audio Pointer to audio class */
+/* */
+/* OUTPUT */
+/* */
+/* Completion Status */
+/* */
+/* CALLS */
+/* */
+/* _ux_utility_descriptor_parse Parse descriptor */
+/* */
+/* CALLED BY */
+/* */
+/* Audio Class */
/* */
/**************************************************************************/
UINT _ux_host_class_audio_streaming_terminal_get(UX_HOST_CLASS_AUDIO *audio)
@@ -81,16 +74,16 @@ ULONG descriptor_length;
ULONG descriptor_type;
ULONG descriptor_subtype;
ULONG descriptor_found;
-
+
/* Get the descriptor to the entire configuration */
descriptor = audio -> ux_host_class_audio_configuration_descriptor;
total_descriptor_length = audio -> ux_host_class_audio_configuration_descriptor_length;
-
- /* Default is Interface descriptor not yet found. */
+
+ /* Default is Interface descriptor not yet found. */
descriptor_found = UX_FALSE;
audio -> ux_host_class_audio_terminal_link = 0xffffffff;
-
+
/* Scan the descriptor for the Audio Streaming interface. */
while (total_descriptor_length)
{
@@ -112,7 +105,7 @@ ULONG descriptor_found;
return(UX_DESCRIPTOR_CORRUPTED);
}
-
+
/* Process relative to the descriptor type. */
switch(descriptor_type)
{
@@ -128,15 +121,15 @@ ULONG descriptor_found;
if ((interface_descriptor.bInterfaceClass == UX_HOST_CLASS_AUDIO_CLASS) &&
(interface_descriptor.bInterfaceSubClass == UX_HOST_CLASS_AUDIO_SUBCLASS_STREAMING) &&
(interface_descriptor.bInterfaceNumber == audio -> ux_host_class_audio_streaming_interface -> ux_interface_descriptor.bInterfaceNumber))
-
+
/* Mark we have found it. */
descriptor_found = UX_TRUE;
else
-
+
descriptor_found = UX_FALSE;
break;
-
-
+
+
case UX_HOST_CLASS_AUDIO_CS_INTERFACE:
/* First make sure we have found the correct generic interface descriptor. */
@@ -149,18 +142,18 @@ ULONG descriptor_found;
case UX_HOST_CLASS_AUDIO_CS_AS_GENERAL:
-
+
/* Make the descriptor machine independent. */
_ux_utility_descriptor_parse(descriptor, _ux_system_class_audio_streaming_interface_descriptor_structure,
UX_HOST_CLASS_AUDIO_STREAMING_INTERFACE_DESCRIPTOR_ENTRIES, (UCHAR *) &streaming_interface_descriptor);
-
+
/* Save the terminal link. */
audio -> ux_host_class_audio_terminal_link = streaming_interface_descriptor.bTerminalLink;
return(UX_SUCCESS);
}
}
break;
- }
+ }
/* Verify if the descriptor is still valid. */
if (descriptor_length > total_descriptor_length)
@@ -173,7 +166,7 @@ ULONG descriptor_found;
UX_TRACE_IN_LINE_INSERT(UX_TRACE_ERROR, UX_DESCRIPTOR_CORRUPTED, descriptor, 0, 0, UX_TRACE_ERRORS, 0, 0)
return(UX_DESCRIPTOR_CORRUPTED);
- }
+ }
/* Jump to the next descriptor if we have not reached the end. */
descriptor += descriptor_length;
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 020d4f91..649e7739 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
@@ -1,18 +1,19 @@
/***************************************************************************
- * Copyright (c) 2024 Microsoft Corporation
- *
+ * Copyright (c) 2024 Microsoft Corporation
+ * Copyright (c) 2026-present Eclipse ThreadX contributors
+ *
* This program and the accompanying materials are made available under the
* terms of the MIT License which is available at
* https://opensource.org/licenses/MIT.
- *
+ *
* SPDX-License-Identifier: MIT
**************************************************************************/
/**************************************************************************/
/**************************************************************************/
-/** */
-/** USBX Component */
+/** */
+/** USBX Component */
/** */
/** Audio Class */
/** */
@@ -29,48 +30,37 @@
#include "ux_host_stack.h"
-/**************************************************************************/
-/* */
-/* FUNCTION RELEASE */
-/* */
-/* _ux_host_class_audio_transfer_request PORTABLE C */
+/**************************************************************************/
+/* */
+/* FUNCTION RELEASE */
+/* */
+/* _ux_host_class_audio_transfer_request PORTABLE C */
/* 6.1.12 */
/* AUTHOR */
/* */
/* Chaoqiong Xiao, Microsoft Corporation */
/* */
/* DESCRIPTION */
-/* */
-/* This function submits an isochronous audio transfer request to the */
-/* USBX stack. */
-/* */
-/* INPUT */
-/* */
-/* audio Pointer to audio class */
-/* audio_transfer_request Pointer to transfer request */
-/* */
-/* OUTPUT */
-/* */
-/* Completion Status */
-/* */
-/* CALLS */
-/* */
-/* _ux_host_stack_transfer_request Process transfer request */
-/* */
-/* CALLED BY */
-/* */
-/* Audio Class */
-/* */
-/* RELEASE HISTORY */
-/* */
-/* DATE NAME DESCRIPTION */
-/* */
-/* 05-19-2020 Chaoqiong Xiao Initial Version 6.0 */
-/* 09-30-2020 Chaoqiong Xiao Modified comment(s), */
-/* resulting in version 6.1 */
-/* 07-29-2022 Chaoqiong Xiao Modified comment(s), */
-/* refined transfer implement, */
-/* resulting in version 6.1.12 */
+/* */
+/* This function submits an isochronous audio transfer request to the */
+/* USBX stack. */
+/* */
+/* INPUT */
+/* */
+/* audio Pointer to audio class */
+/* audio_transfer_request Pointer to transfer request */
+/* */
+/* OUTPUT */
+/* */
+/* Completion Status */
+/* */
+/* CALLS */
+/* */
+/* _ux_host_stack_transfer_request Process transfer request */
+/* */
+/* CALLED BY */
+/* */
+/* Audio Class */
/* */
/**************************************************************************/
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 c11a1a29..9dca9fa5 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
@@ -1,18 +1,19 @@
/***************************************************************************
- * Copyright (c) 2024 Microsoft Corporation
- *
+ * Copyright (c) 2024 Microsoft Corporation
+ * Copyright (c) 2026-present Eclipse ThreadX contributors
+ *
* This program and the accompanying materials are made available under the
* terms of the MIT License which is available at
* https://opensource.org/licenses/MIT.
- *
+ *
* SPDX-License-Identifier: MIT
**************************************************************************/
/**************************************************************************/
/**************************************************************************/
-/** */
-/** USBX Component */
+/** */
+/** USBX Component */
/** */
/** Audio Class */
/** */
@@ -29,52 +30,44 @@
#include "ux_host_stack.h"
-/**************************************************************************/
-/* */
-/* FUNCTION RELEASE */
-/* */
-/* _ux_host_class_audio_transfer_request_completed PORTABLE C */
+/**************************************************************************/
+/* */
+/* FUNCTION RELEASE */
+/* */
+/* _ux_host_class_audio_transfer_request_completed PORTABLE C */
/* 6.1 */
/* AUTHOR */
/* */
/* Chaoqiong Xiao, Microsoft Corporation */
/* */
/* DESCRIPTION */
-/* */
-/* This function receives a completion call back on a isoch transfer */
-/* request. */
-/* */
-/* INPUT */
-/* */
-/* transfer_request Pointer to transfer request */
-/* */
-/* OUTPUT */
-/* */
-/* None */
-/* */
-/* CALLS */
-/* */
-/* (ux_host_class_audio_transfer_request_completion_function) */
-/* Transfer request completion */
-/* */
-/* CALLED BY */
-/* */
-/* Audio Class */
-/* */
-/* RELEASE HISTORY */
-/* */
-/* DATE NAME DESCRIPTION */
-/* */
-/* 05-19-2020 Chaoqiong Xiao Initial Version 6.0 */
-/* 09-30-2020 Chaoqiong Xiao Modified comment(s), */
-/* resulting in version 6.1 */
+/* */
+/* This function receives a completion call back on a isoch transfer */
+/* request. */
+/* */
+/* INPUT */
+/* */
+/* transfer_request Pointer to transfer request */
+/* */
+/* OUTPUT */
+/* */
+/* None */
+/* */
+/* CALLS */
+/* */
+/* (ux_host_class_audio_transfer_request_completion_function) */
+/* Transfer request completion */
+/* */
+/* CALLED BY */
+/* */
+/* Audio Class */
/* */
/**************************************************************************/
VOID _ux_host_class_audio_transfer_request_completed(UX_TRANSFER *transfer_request)
{
UX_HOST_CLASS_AUDIO_TRANSFER_REQUEST *audio_transfer_request;
-
+
/* Get the pointer to the audio specific transfer request, by nature of the lined transfer requests,
the corresponding transfer request has to be the head transfer request in the audio instance. */
@@ -87,7 +80,7 @@ UX_HOST_CLASS_AUDIO_TRANSFER_REQUEST *audio_transfer_request;
/* The caller's transfer request needs to be updated. */
audio_transfer_request -> ux_host_class_audio_transfer_request_actual_length = transfer_request -> ux_transfer_request_actual_length;
audio_transfer_request -> ux_host_class_audio_transfer_request_completion_code = transfer_request -> ux_transfer_request_completion_code;
-
+
/* Call the completion routine. */
audio_transfer_request -> ux_host_class_audio_transfer_request_completion_function(audio_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 b06d5a6b..dd860bbf 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
@@ -1,18 +1,19 @@
/***************************************************************************
- * Copyright (c) 2024 Microsoft Corporation
- *
+ * Copyright (c) 2024 Microsoft Corporation
+ * Copyright (c) 2026-present Eclipse ThreadX contributors
+ *
* This program and the accompanying materials are made available under the
* terms of the MIT License which is available at
* https://opensource.org/licenses/MIT.
- *
+ *
* SPDX-License-Identifier: MIT
**************************************************************************/
/**************************************************************************/
/**************************************************************************/
-/** */
-/** USBX Component */
+/** */
+/** USBX Component */
/** */
/** Audio Class */
/** */
@@ -29,63 +30,43 @@
#include "ux_host_stack.h"
-/**************************************************************************/
-/* */
-/* FUNCTION RELEASE */
-/* */
-/* _ux_host_class_audio_write PORTABLE C */
+/**************************************************************************/
+/* */
+/* FUNCTION RELEASE */
+/* */
+/* _ux_host_class_audio_write PORTABLE C */
/* 6.1.12 */
/* AUTHOR */
/* */
/* Chaoqiong Xiao, Microsoft Corporation */
/* */
/* DESCRIPTION */
-/* */
-/* This function writes to the audio streaming interface. */
+/* */
+/* This function writes to the audio streaming interface. */
/* */
/* Note the request packet size should not exceed endpoint max packet */
/* size, and the request length should be aligned with packet size. */
-/* */
-/* INPUT */
-/* */
-/* audio Pointer to audio class */
-/* audio_transfer_request Pointer to transfer request */
-/* */
-/* OUTPUT */
-/* */
-/* Completion Status */
-/* */
-/* CALLS */
-/* */
-/* _ux_host_class_audio_transfer_request Start audio transfer request */
-/* _ux_host_stack_class_instance_verify Verify instance is valid */
+/* */
+/* INPUT */
+/* */
+/* audio Pointer to audio class */
+/* audio_transfer_request Pointer to transfer request */
+/* */
+/* OUTPUT */
+/* */
+/* Completion Status */
+/* */
+/* CALLS */
+/* */
+/* _ux_host_class_audio_transfer_request Start audio transfer request */
+/* _ux_host_stack_class_instance_verify Verify instance is valid */
/* _ux_host_mutex_on Get mutex */
/* _ux_host_mutex_off Release mutex */
-/* */
-/* CALLED BY */
-/* */
-/* Application */
-/* Audio Class */
-/* */
-/* RELEASE HISTORY */
-/* */
-/* DATE NAME DESCRIPTION */
-/* */
-/* 05-19-2020 Chaoqiong Xiao Initial Version 6.0 */
-/* 09-30-2020 Chaoqiong Xiao Modified comment(s), */
-/* resulting in version 6.1 */
-/* 01-31-2022 Chaoqiong Xiao Modified comment(s), */
-/* refined macros names, */
-/* resulting in version 6.1.10 */
-/* 04-25-2022 Chaoqiong Xiao Modified comment(s), */
-/* fixed standalone compile, */
-/* resulting in version 6.1.11 */
-/* 07-29-2022 Chaoqiong Xiao Modified comment(s), */
-/* refined packet size manage, */
-/* protect reentry with mutex, */
-/* refined transfer implement, */
-/* fixed error return code, */
-/* resulting in version 6.1.12 */
+/* */
+/* CALLED BY */
+/* */
+/* Application */
+/* Audio Class */
/* */
/**************************************************************************/
UINT _ux_host_class_audio_write(UX_HOST_CLASS_AUDIO *audio, UX_HOST_CLASS_AUDIO_TRANSFER_REQUEST *audio_transfer_request)
@@ -95,12 +76,12 @@ UINT status;
ULONG mps;
/* If trace is enabled, insert this event into the trace buffer. */
- UX_TRACE_IN_LINE_INSERT(UX_TRACE_HOST_CLASS_AUDIO_WRITE, audio, audio_transfer_request -> ux_host_class_audio_transfer_request_data_pointer,
+ UX_TRACE_IN_LINE_INSERT(UX_TRACE_HOST_CLASS_AUDIO_WRITE, audio, audio_transfer_request -> ux_host_class_audio_transfer_request_data_pointer,
audio_transfer_request -> ux_host_class_audio_transfer_request_requested_length, 0, UX_TRACE_HOST_CLASS_EVENTS, 0, 0)
/* Ensure the instance is valid. */
if (_ux_host_stack_class_instance_verify(_ux_system_host_class_audio_name, (VOID *) audio) != UX_SUCCESS)
- {
+ {
/* Error trap. */
_ux_system_error_handler(UX_SYSTEM_LEVEL_THREAD, UX_SYSTEM_CONTEXT_CLASS, UX_HOST_CLASS_INSTANCE_UNKNOWN);
@@ -161,8 +142,8 @@ ULONG mps;
/* */
/* INPUT */
/* */
-/* audio Pointer to audio class */
-/* audio_transfer_request Pointer to transfer request */
+/* audio Pointer to audio class */
+/* audio_transfer_request Pointer to transfer request */
/* */
/* OUTPUT */
/* */
@@ -176,12 +157,6 @@ ULONG mps;
/* */
/* Application */
/* */
-/* RELEASE HISTORY */
-/* */
-/* DATE NAME DESCRIPTION */
-/* */
-/* 10-31-2023 Chaoqiong Xiao Initial Version 6.3.0 */
-/* */
/**************************************************************************/
UINT _uxe_host_class_audio_write(UX_HOST_CLASS_AUDIO *audio, UX_HOST_CLASS_AUDIO_TRANSFER_REQUEST *audio_transfer_request)
{
diff --git a/common/usbx_host_classes/src/ux_host_class_cdc_acm_activate.c b/common/usbx_host_classes/src/ux_host_class_cdc_acm_activate.c
index 5f6d534c..2c9b18c5 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
@@ -1,10 +1,11 @@
/***************************************************************************
- * Copyright (c) 2024 Microsoft Corporation
- *
+ * Copyright (c) 2024 Microsoft Corporation
+ * Copyright (c) 2026-present Eclipse ThreadX contributors
+ *
* This program and the accompanying materials are made available under the
* terms of the MIT License which is available at
* https://opensource.org/licenses/MIT.
- *
+ *
* SPDX-License-Identifier: MIT
**************************************************************************/
@@ -69,27 +70,6 @@
/* _ux_host_class_cdc_acm_entry Entry of cdc_acm class */
/* _ux_utility_delay_ms Delay ms */
/* */
-/* RELEASE HISTORY */
-/* */
-/* DATE NAME DESCRIPTION */
-/* */
-/* 05-19-2020 Chaoqiong Xiao Initial Version 6.0 */
-/* 09-30-2020 Chaoqiong Xiao Modified comment(s), */
-/* resulting in version 6.1 */
-/* 01-31-2022 Chaoqiong Xiao Modified comment(s), */
-/* added standalone support, */
-/* used defined line coding */
-/* instead of magic number, */
-/* resulting in version 6.1.10 */
-/* 07-29-2022 Chaoqiong Xiao Modified comment(s), */
-/* improved error handling, */
-/* fixed parameter/variable */
-/* names conflict C++ keyword, */
-/* resulting in version 6.1.12 */
-/* 10-31-2023 Chaoqiong Xiao Modified comment(s), */
-/* improved control searching, */
-/* resulting in version 6.3.0 */
-/* */
/**************************************************************************/
UINT _ux_host_class_cdc_acm_activate(UX_HOST_CLASS_COMMAND *command)
{
@@ -345,7 +325,7 @@ UX_HOST_CLASS_CDC_ACM_LINE_STATE line_state;
#endif
/* On error case, it's possible data buffer allocated for interrupt endpoint and transfer started, stop and free it. */
- if (cdc_acm -> ux_host_class_cdc_acm_interrupt_endpoint &&
+ if (cdc_acm -> ux_host_class_cdc_acm_interrupt_endpoint &&
cdc_acm -> ux_host_class_cdc_acm_interrupt_endpoint -> ux_endpoint_transfer_request.ux_transfer_request_data_pointer)
{
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 54b7f88f..e5884d41 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
@@ -1,10 +1,11 @@
/***************************************************************************
- * Copyright (c) 2024 Microsoft Corporation
- *
+ * Copyright (c) 2024 Microsoft Corporation
+ * Copyright (c) 2026-present Eclipse ThreadX contributors
+ *
* This program and the accompanying materials are made available under the
* terms of the MIT License which is available at
* https://opensource.org/licenses/MIT.
- *
+ *
* SPDX-License-Identifier: MIT
**************************************************************************/
@@ -64,18 +65,6 @@
/* */
/* _ux_host_class_cdc_acm_activate */
/* */
-/* RELEASE HISTORY */
-/* */
-/* DATE NAME DESCRIPTION */
-/* */
-/* 05-19-2020 Chaoqiong Xiao Initial Version 6.0 */
-/* 09-30-2020 Chaoqiong Xiao Modified comment(s), */
-/* resulting in version 6.1 */
-/* 03-08-2023 Chaoqiong Xiao Modified comment(s), */
-/* fixed capabilities get from */
-/* multiple CDC-ACM functions, */
-/* resulting in version 6.2.1 */
-/* */
/**************************************************************************/
UINT _ux_host_class_cdc_acm_capabilities_get(UX_HOST_CLASS_CDC_ACM *cdc_acm)
{
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 dfc43b20..2416a049 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
@@ -1,10 +1,11 @@
/***************************************************************************
- * Copyright (c) 2024 Microsoft Corporation
- *
+ * Copyright (c) 2024 Microsoft Corporation
+ * Copyright (c) 2026-present Eclipse ThreadX contributors
+ *
* This program and the accompanying materials are made available under the
* terms of the MIT License which is available at
* https://opensource.org/licenses/MIT.
- *
+ *
* SPDX-License-Identifier: MIT
**************************************************************************/
@@ -71,19 +72,6 @@
/* */
/* Application */
/* */
-/* RELEASE HISTORY */
-/* */
-/* DATE NAME DESCRIPTION */
-/* */
-/* 05-19-2020 Chaoqiong Xiao Initial Version 6.0 */
-/* 09-30-2020 Chaoqiong Xiao Modified comment(s), */
-/* resulting in version 6.1 */
-/* 01-31-2022 Chaoqiong Xiao Modified comment(s), */
-/* added standalone support, */
-/* resulting in version 6.1.10 */
-/* 10-31-2023 Yajun xia Modified comment(s), */
-/* resulting in version 6.3.0 */
-/* */
/**************************************************************************/
UINT _ux_host_class_cdc_acm_command(UX_HOST_CLASS_CDC_ACM *cdc_acm, ULONG command,
ULONG value, UCHAR *data_buffer, ULONG data_length)
@@ -248,12 +236,6 @@ ULONG request_direction;
/* Application */
/* CDC ACM Class */
/* */
-/* RELEASE HISTORY */
-/* */
-/* DATE NAME DESCRIPTION */
-/* */
-/* 10-31-2023 Chaoqiong Xiao Initial Version 6.3.0 */
-/* */
/**************************************************************************/
UINT _uxe_host_class_cdc_acm_command(UX_HOST_CLASS_CDC_ACM *cdc_acm, ULONG command,
ULONG value, UCHAR *data_buffer, ULONG data_length)
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 8b7a6f0d..ffe6268b 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
@@ -1,18 +1,19 @@
/***************************************************************************
- * Copyright (c) 2024 Microsoft Corporation
- *
+ * Copyright (c) 2024 Microsoft Corporation
+ * Copyright (c) 2026-present Eclipse ThreadX contributors
+ *
* This program and the accompanying materials are made available under the
* terms of the MIT License which is available at
* https://opensource.org/licenses/MIT.
- *
+ *
* SPDX-License-Identifier: MIT
**************************************************************************/
/**************************************************************************/
/**************************************************************************/
-/** */
-/** USBX Component */
+/** */
+/** USBX Component */
/** */
/** CDC ACM Class */
/** */
@@ -29,50 +30,40 @@
#include "ux_host_stack.h"
-/**************************************************************************/
-/* */
-/* FUNCTION RELEASE */
-/* */
-/* _ux_host_class_cdc_acm_configure PORTABLE C */
+/**************************************************************************/
+/* */
+/* FUNCTION RELEASE */
+/* */
+/* _ux_host_class_cdc_acm_configure PORTABLE C */
/* 6.1 */
/* AUTHOR */
/* */
/* Chaoqiong Xiao, Microsoft Corporation */
/* */
/* DESCRIPTION */
-/* */
+/* */
/* This function calls the USBX stack to do a SET_CONFIGURATION to the */
-/* cdc_acm. Once the cdc_acm is configured, its interface will be */
-/* activated. The bulk endpoints (1 IN, 1 OUT ) and the optional */
-/* interrupt endpoint are enumerated. */
-/* */
-/* INPUT */
-/* */
-/* cdc_acm Pointer to cdc_acm class */
-/* */
-/* OUTPUT */
-/* */
-/* Completion Status */
-/* */
-/* CALLS */
-/* */
-/* _ux_host_stack_configuration_interface_get Get interface */
-/* _ux_host_stack_device_configuration_get Get configuration */
-/* _ux_host_stack_device_configuration_select Select configuration */
-/* */
-/* CALLED BY */
-/* */
-/* _ux_host_class_cdc_acm_activate Data Pump class activate */
-/* */
-/* 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 */
+/* cdc_acm. Once the cdc_acm is configured, its interface will be */
+/* activated. The bulk endpoints (1 IN, 1 OUT ) and the optional */
+/* interrupt endpoint are enumerated. */
+/* */
+/* INPUT */
+/* */
+/* cdc_acm Pointer to cdc_acm class */
+/* */
+/* OUTPUT */
+/* */
+/* Completion Status */
+/* */
+/* CALLS */
+/* */
+/* _ux_host_stack_configuration_interface_get Get interface */
+/* _ux_host_stack_device_configuration_get Get configuration */
+/* _ux_host_stack_device_configuration_select Select configuration */
+/* */
+/* CALLED BY */
+/* */
+/* _ux_host_class_cdc_acm_activate Data Pump class activate */
/* */
/**************************************************************************/
UINT _ux_host_class_cdc_acm_configure(UX_HOST_CLASS_CDC_ACM *cdc_acm)
@@ -95,29 +86,29 @@ UX_DEVICE *parent_device;
status = _ux_host_stack_device_configuration_get(cdc_acm -> ux_host_class_cdc_acm_device, 0, &configuration);
if (status != UX_SUCCESS)
{
-
+
/* Error trap. */
_ux_system_error_handler(UX_SYSTEM_LEVEL_THREAD, UX_SYSTEM_CONTEXT_CLASS, UX_CONFIGURATION_HANDLE_UNKNOWN);
/* If trace is enabled, insert this event into the trace buffer. */
UX_TRACE_IN_LINE_INSERT(UX_TRACE_ERROR, UX_CONFIGURATION_HANDLE_UNKNOWN, cdc_acm -> ux_host_class_cdc_acm_device, 0, 0, UX_TRACE_ERRORS, 0, 0)
-
+
return(UX_CONFIGURATION_HANDLE_UNKNOWN);
}
#if UX_MAX_DEVICES > 1
- /* Check the cdc_acm power source and check the parent power source for
+ /* 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)
{
/* Get parent device pointer. */
parent_device = cdc_acm -> ux_host_class_cdc_acm_device -> ux_device_parent;
-
- /* If the device is NULL, the parent is the root cdc_acm and we don't have to worry
+
+ /* If the device is NULL, the parent is the root cdc_acm and we don't have to worry
if the parent is not the root cdc_acm, check for its power source. */
if ((parent_device != UX_NULL) && (parent_device -> ux_device_power_source == UX_DEVICE_BUS_POWERED))
- {
+ {
/* Error trap. */
_ux_system_error_handler(UX_SYSTEM_LEVEL_THREAD, UX_SYSTEM_CONTEXT_CLASS, UX_CONNECTION_INCOMPATIBLE);
@@ -126,24 +117,24 @@ UX_DEVICE *parent_device;
UX_TRACE_IN_LINE_INSERT(UX_TRACE_ERROR, UX_CONNECTION_INCOMPATIBLE, cdc_acm, 0, 0, UX_TRACE_ERRORS, 0, 0)
return(UX_CONNECTION_INCOMPATIBLE);
- }
+ }
}
#endif
- /* We have the valid configuration. Ask the USBX stack to set this configuration. */
+ /* 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)
return(status);
- /* If the operation went well, the cdc_acm default alternate setting for the cdc_acm interface is
- active and the interrupt endpoint is now enabled. We have to memorize the first interface since
+ /* If the operation went well, the cdc_acm default alternate setting for the cdc_acm interface is
+ active and the interrupt endpoint is now enabled. We have to memorize the first interface since
the interrupt endpoint is hooked to it. */
status = _ux_host_stack_configuration_interface_get(configuration, 0, 0, &cdc_acm -> ux_host_class_cdc_acm_interface);
if (status != UX_SUCCESS)
{
/* Store the instance in the interface container, this is for the USB stack
- when it needs to invoke the class. */
+ when it needs to invoke the class. */
cdc_acm -> ux_host_class_cdc_acm_interface -> ux_interface_class_instance = (VOID *) cdc_acm;
}
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 fd86fac9..fa9781d2 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
@@ -1,18 +1,19 @@
/***************************************************************************
- * Copyright (c) 2024 Microsoft Corporation
- *
+ * Copyright (c) 2024 Microsoft Corporation
+ * Copyright (c) 2026-present Eclipse ThreadX contributors
+ *
* This program and the accompanying materials are made available under the
* terms of the MIT License which is available at
* https://opensource.org/licenses/MIT.
- *
+ *
* SPDX-License-Identifier: MIT
**************************************************************************/
/**************************************************************************/
/**************************************************************************/
-/** */
-/** USBX Component */
+/** */
+/** USBX Component */
/** */
/** CDC ACM Class */
/** */
@@ -29,54 +30,43 @@
#include "ux_host_stack.h"
-/**************************************************************************/
-/* */
-/* FUNCTION RELEASE */
-/* */
-/* _ux_host_class_cdc_acm_deactivate PORTABLE C */
+/**************************************************************************/
+/* */
+/* FUNCTION RELEASE */
+/* */
+/* _ux_host_class_cdc_acm_deactivate PORTABLE C */
/* 6.1.10 */
/* AUTHOR */
/* */
/* Chaoqiong Xiao, Microsoft Corporation */
/* */
/* DESCRIPTION */
-/* */
+/* */
/* This function is called when this instance of the cdc_acm has been */
-/* removed from the bus either directly or indirectly. The bulk in\out */
-/* and optional interrupt pipes will be destroyed and the instance */
-/* removed. */
-/* */
-/* INPUT */
-/* */
-/* command CDC ACM class command pointer */
-/* */
-/* OUTPUT */
-/* */
-/* Completion Status */
-/* */
-/* CALLS */
-/* */
-/* _ux_host_stack_class_instance_destroy Destroy the class instance */
-/* _ux_host_stack_endpoint_transfer_abort Abort endpoint transfer */
-/* _ux_utility_memory_free Free memory block */
-/* _ux_host_semaphore_get Get protection semaphore */
-/* _ux_host_semaphore_delete Delete protection semaphore */
+/* removed from the bus either directly or indirectly. The bulk in\out */
+/* and optional interrupt pipes will be destroyed and the instance */
+/* removed. */
+/* */
+/* INPUT */
+/* */
+/* command CDC ACM class command pointer */
+/* */
+/* OUTPUT */
+/* */
+/* Completion Status */
+/* */
+/* CALLS */
+/* */
+/* _ux_host_stack_class_instance_destroy Destroy the class instance */
+/* _ux_host_stack_endpoint_transfer_abort Abort endpoint transfer */
+/* _ux_utility_memory_free Free memory block */
+/* _ux_host_semaphore_get Get protection semaphore */
+/* _ux_host_semaphore_delete Delete protection semaphore */
/* _ux_utility_thread_schedule_other Schedule other threads */
-/* */
-/* CALLED BY */
-/* */
-/* _ux_host_class_cdc_acm_entry Entry of cdc_acm class */
-/* */
-/* RELEASE HISTORY */
-/* */
-/* DATE NAME DESCRIPTION */
-/* */
-/* 05-19-2020 Chaoqiong Xiao Initial Version 6.0 */
-/* 09-30-2020 Chaoqiong Xiao Modified comment(s), */
-/* resulting in version 6.1 */
-/* 01-31-2022 Chaoqiong Xiao Modified comment(s), */
-/* added standalone support, */
-/* resulting in version 6.1.10 */
+/* */
+/* CALLED BY */
+/* */
+/* _ux_host_class_cdc_acm_entry Entry of cdc_acm class */
/* */
/**************************************************************************/
UINT _ux_host_class_cdc_acm_deactivate(UX_HOST_CLASS_COMMAND *command)
@@ -112,9 +102,9 @@ UX_HOST_CLASS_CDC_ACM *cdc_acm_inst;
/* If the interrupt endpoint is defined, clean any pending transfer. */
if (cdc_acm -> ux_host_class_cdc_acm_interrupt_endpoint != UX_NULL)
- {
+ {
transfer_request = &cdc_acm -> ux_host_class_cdc_acm_interrupt_endpoint -> ux_endpoint_transfer_request;
-
+
/* And abort any transfer. */
_ux_host_stack_endpoint_transfer_abort(cdc_acm -> ux_host_class_cdc_acm_interrupt_endpoint);
@@ -145,34 +135,34 @@ UX_HOST_CLASS_CDC_ACM *cdc_acm_inst;
}
else
{
-
- /* We come to this point when the device has been extracted and this is the data class.
- So there may have been a transaction being scheduled.
+
+ /* We come to this point when the device has been extracted and this is the data class.
+ So there may have been a transaction being scheduled.
We make sure the transaction has been completed by the controller driver.
When the device is extracted, the controller tries multiple times the transaction and retires it
- with a DEVICE_NOT_RESPONDING error code.
-
+ with a DEVICE_NOT_RESPONDING error code.
+
First we take care of endpoint IN. */
transfer_request = &cdc_acm -> ux_host_class_cdc_acm_bulk_in_endpoint -> ux_endpoint_transfer_request;
if (transfer_request -> ux_transfer_request_completion_code == UX_TRANSFER_STATUS_PENDING)
/* We need to abort transactions on the bulk In pipe. */
_ux_host_stack_endpoint_transfer_abort(cdc_acm -> ux_host_class_cdc_acm_bulk_in_endpoint);
-
- /* Then endpoint OUT. */
+
+ /* Then endpoint OUT. */
transfer_request = &cdc_acm -> ux_host_class_cdc_acm_bulk_out_endpoint -> ux_endpoint_transfer_request;
if (transfer_request -> ux_transfer_request_completion_code == UX_TRANSFER_STATUS_PENDING)
-
+
/* We need to abort transactions on the bulk Out pipe. */
_ux_host_stack_endpoint_transfer_abort(cdc_acm -> ux_host_class_cdc_acm_bulk_out_endpoint);
-
+
}
#if !defined(UX_HOST_STANDALONE)
/* The enumeration thread needs to sleep a while to allow the application or the class that may be using
endpoints to exit properly. */
- _ux_host_thread_schedule_other(UX_THREAD_PRIORITY_ENUM);
+ _ux_host_thread_schedule_other(UX_THREAD_PRIORITY_ENUM);
#else
/* If there is allocated resource, free it. */
@@ -195,7 +185,7 @@ UX_HOST_CLASS_CDC_ACM *cdc_acm_inst;
that the device is removed. */
if (_ux_system_host -> ux_system_host_change_function != UX_NULL)
{
-
+
/* Inform the application the device is removed. */
_ux_system_host -> ux_system_host_change_function(UX_DEVICE_REMOVAL, cdc_acm -> ux_host_class_cdc_acm_class, (VOID *) cdc_acm);
}
@@ -210,6 +200,6 @@ UX_HOST_CLASS_CDC_ACM *cdc_acm_inst;
UX_TRACE_OBJECT_UNREGISTER(cdc_acm);
/* Return successful status. */
- return(UX_SUCCESS);
+ return(UX_SUCCESS);
}
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 5b067631..055387ae 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
@@ -1,18 +1,19 @@
/***************************************************************************
- * Copyright (c) 2024 Microsoft Corporation
- *
+ * Copyright (c) 2024 Microsoft Corporation
+ * Copyright (c) 2026-present Eclipse ThreadX contributors
+ *
* This program and the accompanying materials are made available under the
* terms of the MIT License which is available at
* https://opensource.org/licenses/MIT.
- *
+ *
* SPDX-License-Identifier: MIT
**************************************************************************/
/**************************************************************************/
/**************************************************************************/
-/** */
-/** USBX Component */
+/** */
+/** USBX Component */
/** */
/** CDC ACM Class */
/** */
@@ -29,58 +30,37 @@
#include "ux_host_stack.h"
-/**************************************************************************/
-/* */
-/* FUNCTION RELEASE */
-/* */
-/* _ux_host_class_cdc_acm_endpoints_get PORTABLE C */
+/**************************************************************************/
+/* */
+/* FUNCTION RELEASE */
+/* */
+/* _ux_host_class_cdc_acm_endpoints_get PORTABLE C */
/* 6.3.0 */
/* AUTHOR */
/* */
/* Chaoqiong Xiao, Microsoft Corporation */
/* */
/* DESCRIPTION */
-/* */
+/* */
/* This function distinguishes for either the Data or Control Class. */
-/* For the data class, we mount the bulk in and bulk out endpoints. */
-/* For the control class, we mount the optional interrupt endpoint. */
-/* */
-/* INPUT */
-/* */
-/* cdc_acm Pointer to cdc_acm class */
-/* */
-/* OUTPUT */
-/* */
-/* Completion Status */
-/* */
-/* CALLS */
-/* */
-/* _ux_host_stack_interface_endpoint_get Get interface endpoint */
-/* */
-/* CALLED BY */
-/* */
-/* _ux_host_class_cdc_acm_activate Activate cdc_acm class */
-/* */
-/* RELEASE HISTORY */
-/* */
-/* DATE NAME DESCRIPTION */
-/* */
-/* 05-19-2020 Chaoqiong Xiao Initial Version 6.0 */
-/* 09-30-2020 Chaoqiong Xiao Modified comment(s), */
-/* resulting in version 6.1 */
-/* 10-15-2021 Chaoqiong Xiao Modified comment(s), */
-/* use pre-calculated value */
-/* instead of wMaxPacketSize, */
-/* resulting in version 6.1.9 */
-/* 01-31-2022 Chaoqiong Xiao Modified comment(s), */
-/* initialized timeout value, */
-/* resulting in version 6.1.10 */
-/* 04-25-2022 Chaoqiong Xiao Modified comment(s), */
-/* internal clean up, */
-/* resulting in version 6.1.11 */
-/* 10-31-2023 Chaoqiong Xiao Modified comment(s), */
-/* checked endpoint get status,*/
-/* resulting in version 6.3.0 */
+/* For the data class, we mount the bulk in and bulk out endpoints. */
+/* For the control class, we mount the optional interrupt endpoint. */
+/* */
+/* INPUT */
+/* */
+/* cdc_acm Pointer to cdc_acm class */
+/* */
+/* OUTPUT */
+/* */
+/* Completion Status */
+/* */
+/* CALLS */
+/* */
+/* _ux_host_stack_interface_endpoint_get Get interface endpoint */
+/* */
+/* CALLED BY */
+/* */
+/* _ux_host_class_cdc_acm_activate Activate cdc_acm class */
/* */
/**************************************************************************/
UINT _ux_host_class_cdc_acm_endpoints_get(UX_HOST_CLASS_CDC_ACM *cdc_acm)
@@ -99,15 +79,15 @@ UX_TRANSFER *transfer_request;
/* Search the bulk OUT endpoint. It is attached to the interface container. */
for (endpoint_index = 0; endpoint_index < cdc_acm -> ux_host_class_cdc_acm_interface -> ux_interface_descriptor.bNumEndpoints;
endpoint_index++)
- {
-
+ {
+
/* Get interface endpoint. */
status = _ux_host_stack_interface_endpoint_get(cdc_acm -> ux_host_class_cdc_acm_interface, endpoint_index, &endpoint);
/* Check status. */
if (status != UX_SUCCESS)
continue;
-
+
/* Check if endpoint is bulk and OUT. */
if (((endpoint -> ux_endpoint_descriptor.bEndpointAddress & UX_ENDPOINT_DIRECTION) == UX_ENDPOINT_OUT) &&
((endpoint -> ux_endpoint_descriptor.bmAttributes & UX_MASK_ENDPOINT_TYPE) == UX_BULK_ENDPOINT))
@@ -166,8 +146,8 @@ UX_TRANSFER *transfer_request;
/* Search the Interrupt endpoint. It is attached to the interface container of the control interface. It is not mandatory. */
for (endpoint_index = 0; endpoint_index < cdc_acm -> ux_host_class_cdc_acm_interface -> ux_interface_descriptor.bNumEndpoints;
endpoint_index++)
- {
-
+ {
+
/* Get the endpoint handle. */
status = _ux_host_stack_interface_endpoint_get(cdc_acm -> ux_host_class_cdc_acm_interface, endpoint_index, &endpoint);
@@ -201,19 +181,19 @@ UX_TRANSFER *transfer_request;
transfer_request -> ux_transfer_request_completion_function = _ux_host_class_cdc_acm_transfer_request_completed;
/* Obtain a buffer for this transaction. The buffer will always be reused. */
- transfer_request -> ux_transfer_request_data_pointer = _ux_utility_memory_allocate(UX_SAFE_ALIGN, UX_CACHE_SAFE_MEMORY,
+ transfer_request -> ux_transfer_request_data_pointer = _ux_utility_memory_allocate(UX_SAFE_ALIGN, UX_CACHE_SAFE_MEMORY,
transfer_request -> ux_transfer_request_requested_length);
/* If the endpoint is available and we have memory, we start the interrupt endpoint. */
if (transfer_request -> ux_transfer_request_data_pointer != UX_NULL)
{
-
+
/* The transfer on the interrupt endpoint can be started. */
status = _ux_host_stack_transfer_request(transfer_request);
-
+
/* Check error, if endpoint interrupt IN transfer not successful, do not proceed. */
if (status != UX_SUCCESS)
-
+
/* Error, do not proceed. */
return(status);
}
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 271dc658..8f03ead6 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
@@ -1,18 +1,19 @@
/***************************************************************************
- * Copyright (c) 2024 Microsoft Corporation
- *
+ * Copyright (c) 2024 Microsoft Corporation
+ * Copyright (c) 2026-present Eclipse ThreadX contributors
+ *
* This program and the accompanying materials are made available under the
* terms of the MIT License which is available at
* https://opensource.org/licenses/MIT.
- *
+ *
* SPDX-License-Identifier: MIT
**************************************************************************/
/**************************************************************************/
/**************************************************************************/
-/** */
-/** USBX Component */
+/** */
+/** USBX Component */
/** */
/** Acm Cdc Class */
/** */
@@ -46,58 +47,43 @@ static inline UINT _ux_host_class_cdc_acm_activate_wait(UX_HOST_CLASS_COMMAND *
#endif
-/**************************************************************************/
-/* */
-/* FUNCTION RELEASE */
-/* */
-/* _ux_host_class_cdc_acm_entry PORTABLE C */
+/**************************************************************************/
+/* */
+/* FUNCTION RELEASE */
+/* */
+/* _ux_host_class_cdc_acm_entry PORTABLE C */
/* 6.1.12 */
/* AUTHOR */
/* */
/* Chaoqiong Xiao, Microsoft Corporation */
/* */
/* DESCRIPTION */
-/* */
-/* This function is the entry point of the cdc_acm class. It will be */
-/* called by the USBX stack enumeration module when there is a new */
-/* cdc_acm on the bus or when the USB cdc_acm is removed. */
-/* */
-/* A CDC class can have multiple interfaces, one for Control and one */
-/* for Data. Here we filter for the Communication Class with ACM */
-/* subclass and the Communication Data Class. */
-/* */
-/* */
-/* INPUT */
-/* */
+/* */
+/* This function is the entry point of the cdc_acm class. It will be */
+/* called by the USBX stack enumeration module when there is a new */
+/* cdc_acm on the bus or when the USB cdc_acm is removed. */
+/* */
+/* A CDC class can have multiple interfaces, one for Control and one */
+/* for Data. Here we filter for the Communication Class with ACM */
+/* subclass and the Communication Data Class. */
+/* */
+/* */
+/* INPUT */
+/* */
/* command Acm Cdc class command */
-/* */
-/* OUTPUT */
-/* */
-/* Completion Status */
-/* */
-/* CALLS */
-/* */
-/* _ux_host_class_cdc_acm_activate Activate cdc_acm class */
-/* _ux_host_class_cdc_acm_deactivate Deactivate cdc_acm class */
-/* */
-/* CALLED BY */
-/* */
-/* Acm Cdc Class */
-/* */
-/* RELEASE HISTORY */
-/* */
-/* DATE NAME DESCRIPTION */
-/* */
-/* 05-19-2020 Chaoqiong Xiao Initial Version 6.0 */
-/* 09-30-2020 Chaoqiong Xiao Modified comment(s), */
-/* resulting in version 6.1 */
-/* 01-31-2022 Chaoqiong Xiao Modified comment(s), */
-/* added standalone support, */
-/* resulting in version 6.1.10 */
-/* 07-29-2022 Chaoqiong Xiao Modified comment(s), */
-/* fixed parameter/variable */
-/* names conflict C++ keyword, */
-/* resulting in version 6.1.12 */
+/* */
+/* OUTPUT */
+/* */
+/* Completion Status */
+/* */
+/* CALLS */
+/* */
+/* _ux_host_class_cdc_acm_activate Activate cdc_acm class */
+/* _ux_host_class_cdc_acm_deactivate Deactivate cdc_acm class */
+/* */
+/* CALLED BY */
+/* */
+/* Acm Cdc Class */
/* */
/**************************************************************************/
UINT _ux_host_class_cdc_acm_entry(UX_HOST_CLASS_COMMAND *command)
@@ -124,31 +110,31 @@ UINT status;
{
/* Check for IAD presence. */
if ((command -> ux_host_class_command_iad_class == 0) && (command -> ux_host_class_command_iad_subclass == 0))
-
+
/* No IAD, we accept this class. */
- return(UX_SUCCESS);
-
+ return(UX_SUCCESS);
+
else
{
if ((command -> ux_host_class_command_iad_class == UX_HOST_CLASS_CDC_CONTROL_CLASS) &&
(command -> ux_host_class_command_iad_subclass == UX_HOST_CLASS_CDC_ACM_SUBCLASS))
-
+
/* There is an IAD and this is for CDC-ACM. */
- return(UX_SUCCESS);
+ return(UX_SUCCESS);
else
-
+
/* The IAD does not match with CDC-ACM. */
- return(UX_NO_CLASS_MATCH);
+ return(UX_NO_CLASS_MATCH);
}
}
- else
+ else
/* No match. */
- return(UX_NO_CLASS_MATCH);
-
+ return(UX_NO_CLASS_MATCH);
+
case UX_HOST_CLASS_COMMAND_ACTIVATE:
/* The activate command is used when the device inserted has found a parent and
@@ -164,13 +150,13 @@ UINT status;
case UX_HOST_CLASS_COMMAND_DEACTIVATE:
- /* The deactivate command is used when the device has been extracted either
+ /* The deactivate command is used when the device has been extracted either
directly or when its parents has been extracted. */
status = _ux_host_class_cdc_acm_deactivate(command);
return(status);
- default:
-
+ default:
+
/* Error trap. */
_ux_system_error_handler(UX_SYSTEM_LEVEL_THREAD, UX_SYSTEM_CONTEXT_CLASS, UX_FUNCTION_NOT_SUPPORTED);
@@ -178,7 +164,7 @@ UINT status;
UX_TRACE_IN_LINE_INSERT(UX_TRACE_ERROR, UX_FUNCTION_NOT_SUPPORTED, 0, 0, 0, UX_TRACE_ERRORS, 0, 0)
return(UX_FUNCTION_NOT_SUPPORTED);
- }
+ }
}
#if defined(UX_HOST_STANDALONE)
@@ -546,7 +532,7 @@ ULONG tick, diff;
{
/* On error case, it's possible data buffer allocated for interrupt endpoint and transfer started, stop and free it. */
- if (cdc_acm -> ux_host_class_cdc_acm_interrupt_endpoint &&
+ if (cdc_acm -> ux_host_class_cdc_acm_interrupt_endpoint &&
cdc_acm -> ux_host_class_cdc_acm_interrupt_endpoint -> ux_endpoint_transfer_request.ux_transfer_request_data_pointer)
{
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 dd2ad9f9..4b53d50d 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
@@ -1,10 +1,11 @@
/***************************************************************************
- * Copyright (c) 2024 Microsoft Corporation
- *
+ * Copyright (c) 2024 Microsoft Corporation
+ * Copyright (c) 2026-present Eclipse ThreadX contributors
+ *
* This program and the accompanying materials are made available under the
* terms of the MIT License which is available at
* https://opensource.org/licenses/MIT.
- *
+ *
* SPDX-License-Identifier: MIT
**************************************************************************/
@@ -68,19 +69,6 @@
/* */
/* Application */
/* */
-/* RELEASE HISTORY */
-/* */
-/* DATE NAME DESCRIPTION */
-/* */
-/* 05-19-2020 Chaoqiong Xiao Initial Version 6.0 */
-/* 09-30-2020 Chaoqiong Xiao Modified comment(s), */
-/* resulting in version 6.1 */
-/* 01-31-2022 Chaoqiong Xiao Modified comment(s), */
-/* added standalone support, */
-/* resulting in version 6.1.10 */
-/* 10-31-2023 Chaoqiong Xiao Modified comment(s), */
-/* resulting in version 6.3.0 */
-/* */
/**************************************************************************/
UINT _ux_host_class_cdc_acm_ioctl(UX_HOST_CLASS_CDC_ACM *cdc_acm, ULONG ioctl_function,
VOID *parameter)
@@ -374,12 +362,6 @@ UX_TRANSFER *transfer;
/* */
/* Application */
/* */
-/* RELEASE HISTORY */
-/* */
-/* DATE NAME DESCRIPTION */
-/* */
-/* 10-31-2023 Chaoqiong Xiao Initial Version 6.3.0 */
-/* */
/**************************************************************************/
UINT _uxe_host_class_cdc_acm_ioctl(UX_HOST_CLASS_CDC_ACM *cdc_acm, ULONG ioctl_function,
VOID *parameter)
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 6f561c06..d9e48902 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
@@ -1,18 +1,19 @@
/***************************************************************************
- * Copyright (c) 2024 Microsoft Corporation
- *
+ * Copyright (c) 2024 Microsoft Corporation
+ * Copyright (c) 2026-present Eclipse ThreadX contributors
+ *
* This program and the accompanying materials are made available under the
* terms of the MIT License which is available at
* https://opensource.org/licenses/MIT.
- *
+ *
* SPDX-License-Identifier: MIT
**************************************************************************/
/**************************************************************************/
/**************************************************************************/
-/** */
-/** USBX Component */
+/** */
+/** USBX Component */
/** */
/** ACM CDC Class */
/** */
@@ -29,56 +30,45 @@
#include "ux_host_stack.h"
-/**************************************************************************/
-/* */
-/* FUNCTION RELEASE */
-/* */
-/* _ux_host_class_cdc_acm_read PORTABLE C */
+/**************************************************************************/
+/* */
+/* FUNCTION RELEASE */
+/* */
+/* _ux_host_class_cdc_acm_read PORTABLE C */
/* 6.1.10 */
/* AUTHOR */
/* */
/* Chaoqiong Xiao, Microsoft Corporation */
/* */
/* DESCRIPTION */
-/* */
-/* This function reads from the cdc_acm interface. The call is */
-/* blocking and only returns when there is either an error or when */
+/* */
+/* This function reads from the cdc_acm interface. The call is */
+/* blocking and only returns when there is either an error or when */
/* the transfer is complete. */
/* */
-/* INPUT */
-/* */
-/* cdc_acm Pointer to cdc_acm class */
+/* INPUT */
+/* */
+/* cdc_acm Pointer to cdc_acm class */
/* data_pointer Pointer to buffer */
/* requested_length Requested data read */
/* actual_length Actual data read */
-/* */
-/* OUTPUT */
-/* */
-/* Completion Status */
-/* */
-/* CALLS */
-/* */
-/* _ux_host_stack_transfer_request Process transfer request */
-/* _ux_host_stack_transfer_request_abort Abort transfer request */
-/* _ux_host_semaphore_get Get protection semaphore */
-/* */
-/* 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), */
-/* resulting in version 6.1 */
-/* 01-31-2022 Chaoqiong Xiao Modified comment(s), */
-/* added standalone support, */
-/* resulting in version 6.1.10 */
+/* */
+/* OUTPUT */
+/* */
+/* Completion Status */
+/* */
+/* CALLS */
+/* */
+/* _ux_host_stack_transfer_request Process transfer request */
+/* _ux_host_stack_transfer_request_abort Abort transfer request */
+/* _ux_host_semaphore_get Get protection semaphore */
+/* */
+/* CALLED BY */
+/* */
+/* Application */
/* */
/**************************************************************************/
-UINT _ux_host_class_cdc_acm_read (UX_HOST_CLASS_CDC_ACM *cdc_acm, UCHAR *data_pointer,
+UINT _ux_host_class_cdc_acm_read (UX_HOST_CLASS_CDC_ACM *cdc_acm, UCHAR *data_pointer,
ULONG requested_length, ULONG *actual_length)
{
@@ -88,13 +78,13 @@ ULONG transfer_request_length;
#if defined(UX_HOST_STANDALONE)
ULONG transfer_flags;
#endif
-
+
/* If trace is enabled, insert this event into the trace buffer. */
UX_TRACE_IN_LINE_INSERT(UX_TRACE_HOST_CLASS_CDC_ACM_READ, cdc_acm, 0, 0, 0, UX_TRACE_HOST_CLASS_EVENTS, 0, 0)
/* Ensure the instance is valid. */
if (cdc_acm -> ux_host_class_cdc_acm_state != UX_HOST_CLASS_INSTANCE_LIVE)
- {
+ {
/* Error trap. */
_ux_system_error_handler(UX_SYSTEM_LEVEL_THREAD, UX_SYSTEM_CONTEXT_CLASS, UX_HOST_CLASS_INSTANCE_UNKNOWN);
@@ -108,7 +98,7 @@ ULONG transfer_flags;
/* As further protection, we must ensure this instance of the interface is the data interface and not
the control interface ! */
if (cdc_acm -> ux_host_class_cdc_acm_interface -> ux_interface_descriptor.bInterfaceClass != UX_HOST_CLASS_CDC_DATA_CLASS)
- {
+ {
/* Error trap. */
_ux_system_error_handler(UX_SYSTEM_LEVEL_THREAD, UX_SYSTEM_CONTEXT_CLASS, UX_HOST_CLASS_INSTANCE_UNKNOWN);
@@ -118,7 +108,7 @@ ULONG transfer_flags;
return(UX_HOST_CLASS_INSTANCE_UNKNOWN);
}
-
+
/* Start by resetting the actual length of the transfer to zero. */
*actual_length = 0;
@@ -142,11 +132,11 @@ ULONG transfer_flags;
transfer_request_length = transfer_request -> ux_transfer_request_maximum_length;
else
transfer_request_length = requested_length;
-
+
/* Initialize the transfer request. */
transfer_request -> ux_transfer_request_data_pointer = data_pointer;
transfer_request -> ux_transfer_request_requested_length = transfer_request_length;
-
+
/* Perform the transfer. */
status = _ux_host_stack_transfer_request(transfer_request);
@@ -165,20 +155,20 @@ ULONG transfer_flags;
/* All transfers pending need to abort. There may have been a partial transfer. */
_ux_host_stack_transfer_request_abort(transfer_request);
-
- /* Update the length of the actual data transferred. We do this after the
+
+ /* Update the length of the actual data transferred. We do this after the
abort of the transfer request in case some data was actually received. */
*actual_length += transfer_request -> ux_transfer_request_actual_length;
-
+
/* Set the completion code. */
transfer_request -> ux_transfer_request_completion_code = UX_TRANSFER_TIMEOUT;
-
+
/* Error trap. */
_ux_system_error_handler(UX_SYSTEM_LEVEL_THREAD, UX_SYSTEM_CONTEXT_CLASS, UX_TRANSFER_TIMEOUT);
/* If trace is enabled, insert this event into the trace buffer. */
UX_TRACE_IN_LINE_INSERT(UX_TRACE_ERROR, UX_TRANSFER_TIMEOUT, transfer_request, 0, 0, UX_TRACE_ERRORS, 0, 0)
-
+
/* There was an error, return to the caller */
return(UX_TRANSFER_TIMEOUT);
}
@@ -189,7 +179,7 @@ ULONG transfer_flags;
#if defined(UX_HOST_STANDALONE)
- /* Update the length of the actual data transferred. We do this after the
+ /* Update the length of the actual data transferred. We do this after the
abort of the transfer request in case some data was actually received. */
*actual_length += transfer_request -> ux_transfer_request_actual_length;
@@ -203,23 +193,23 @@ ULONG transfer_flags;
/* Update the length of the transfer. Normally all the data has to be received. */
*actual_length += transfer_request -> ux_transfer_request_actual_length;
-
+
/* Check for completion of transfer. If the transfer is partial, return to caller.
The transfer is marked as successful but the caller will need to check the length
actually received and determine if a partial transfer is OK. */
if (transfer_request_length != transfer_request -> ux_transfer_request_actual_length)
{
-
+
/* Return success to caller. */
return(UX_SUCCESS);
}
- /* Update the data pointer for next transfer. */
+ /* Update the data pointer for next transfer. */
data_pointer += transfer_request_length;
-
+
/* Update what is left to receive. */
- requested_length -= transfer_request_length;
- }
+ requested_length -= transfer_request_length;
+ }
#if defined(UX_HOST_STANDALONE)
@@ -228,7 +218,7 @@ ULONG transfer_flags;
#endif
/* We get here when all the transfers went through without errors. */
- return(UX_SUCCESS);
+ return(UX_SUCCESS);
}
@@ -265,14 +255,8 @@ ULONG transfer_flags;
/* */
/* Application */
/* */
-/* RELEASE HISTORY */
-/* */
-/* DATE NAME DESCRIPTION */
-/* */
-/* 10-31-2023 Chaoqiong Xiao Initial Version 6.3.0 */
-/* */
/**************************************************************************/
-UINT _uxe_host_class_cdc_acm_read (UX_HOST_CLASS_CDC_ACM *cdc_acm, UCHAR *data_pointer,
+UINT _uxe_host_class_cdc_acm_read (UX_HOST_CLASS_CDC_ACM *cdc_acm, UCHAR *data_pointer,
ULONG requested_length, ULONG *actual_length)
{
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 d54bfdaf..54de1fed 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
@@ -1,10 +1,11 @@
/***************************************************************************
- * Copyright (c) 2024 Microsoft Corporation
- *
+ * Copyright (c) 2024 Microsoft Corporation
+ * Copyright (c) 2026-present Eclipse ThreadX contributors
+ *
* This program and the accompanying materials are made available under the
* terms of the MIT License which is available at
* https://opensource.org/licenses/MIT.
- *
+ *
* SPDX-License-Identifier: MIT
**************************************************************************/
@@ -61,14 +62,6 @@
/* */
/* Application */
/* */
-/* RELEASE HISTORY */
-/* */
-/* DATE NAME DESCRIPTION */
-/* */
-/* 05-19-2020 Chaoqiong Xiao Initial Version 6.0 */
-/* 09-30-2020 Chaoqiong Xiao Modified comment(s), */
-/* resulting in version 6.1 */
-/* */
/**************************************************************************/
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 30c25adc..e69b2bc5 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
@@ -1,18 +1,19 @@
/***************************************************************************
- * Copyright (c) 2024 Microsoft Corporation
- *
+ * Copyright (c) 2024 Microsoft Corporation
+ * Copyright (c) 2026-present Eclipse ThreadX contributors
+ *
* This program and the accompanying materials are made available under the
* terms of the MIT License which is available at
* https://opensource.org/licenses/MIT.
- *
+ *
* SPDX-License-Identifier: MIT
**************************************************************************/
/**************************************************************************/
/**************************************************************************/
-/** */
-/** USBX Component */
+/** */
+/** USBX Component */
/** */
/** ACM CDC Class */
/** */
@@ -29,63 +30,55 @@
#include "ux_host_stack.h"
-/**************************************************************************/
-/* */
-/* FUNCTION RELEASE */
-/* */
-/* _ux_host_class_cdc_acm_reception_start PORTABLE C */
+/**************************************************************************/
+/* */
+/* FUNCTION RELEASE */
+/* */
+/* _ux_host_class_cdc_acm_reception_start PORTABLE C */
/* 6.1 */
/* AUTHOR */
/* */
/* Chaoqiong Xiao, Microsoft Corporation */
/* */
/* DESCRIPTION */
-/* */
-/* This function starts a reception with the ACM modem. This mechanism */
-/* allows for non blocking calls based on a packet orientated round */
+/* */
+/* This function starts a reception with the ACM modem. This mechanism */
+/* allows for non blocking calls based on a packet orientated round */
/* robbin buffer. When a packet is fully or partially received, an */
/* application callback function is invoked and a new transfer request */
/* is rescheduled. */
/* */
-/* INPUT */
-/* */
-/* cdc_acm Pointer to cdc_acm class */
+/* INPUT */
+/* */
+/* cdc_acm Pointer to cdc_acm class */
/* cdc_acm_reception Pointer to reception struct */
-/* */
-/* OUTPUT */
-/* */
-/* Completion Status */
-/* */
-/* CALLS */
-/* */
-/* _ux_host_stack_transfer_request Process transfer request */
-/* */
-/* 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), */
-/* resulting in version 6.1 */
+/* */
+/* OUTPUT */
+/* */
+/* Completion Status */
+/* */
+/* CALLS */
+/* */
+/* _ux_host_stack_transfer_request Process transfer request */
+/* */
+/* CALLED BY */
+/* */
+/* Application */
/* */
/**************************************************************************/
-UINT _ux_host_class_cdc_acm_reception_start (UX_HOST_CLASS_CDC_ACM *cdc_acm,
+UINT _ux_host_class_cdc_acm_reception_start (UX_HOST_CLASS_CDC_ACM *cdc_acm,
UX_HOST_CLASS_CDC_ACM_RECEPTION *cdc_acm_reception)
{
UX_TRANSFER *transfer_request;
UINT status;
-
+
/* If trace is enabled, insert this event into the trace buffer. */
UX_TRACE_IN_LINE_INSERT(UX_TRACE_HOST_CLASS_CDC_ACM_RECEPTION_START, cdc_acm, 0, 0, 0, UX_TRACE_HOST_CLASS_EVENTS, 0, 0)
/* Ensure the instance is valid. */
if (cdc_acm -> ux_host_class_cdc_acm_state != UX_HOST_CLASS_INSTANCE_LIVE)
- {
+ {
/* Error trap. */
_ux_system_error_handler(UX_SYSTEM_LEVEL_THREAD, UX_SYSTEM_CONTEXT_CLASS, UX_HOST_CLASS_INSTANCE_UNKNOWN);
@@ -99,7 +92,7 @@ UINT status;
/* As further protection, we must ensure this instance of the interface is the data interface and not
the control interface ! */
if (cdc_acm -> ux_host_class_cdc_acm_interface -> ux_interface_descriptor.bInterfaceClass != UX_HOST_CLASS_CDC_DATA_CLASS)
- {
+ {
/* Error trap. */
_ux_system_error_handler(UX_SYSTEM_LEVEL_THREAD, UX_SYSTEM_CONTEXT_CLASS, UX_HOST_CLASS_INSTANCE_UNKNOWN);
@@ -109,23 +102,23 @@ UINT status;
return(UX_HOST_CLASS_INSTANCE_UNKNOWN);
}
-
+
/* Start by aligning the head and tail of buffers to the same address supplied by the application. */
cdc_acm_reception -> ux_host_class_cdc_acm_reception_data_head = cdc_acm_reception -> ux_host_class_cdc_acm_reception_data_buffer;
cdc_acm_reception -> ux_host_class_cdc_acm_reception_data_tail = cdc_acm_reception -> ux_host_class_cdc_acm_reception_data_buffer;
/* Get the pointer to the bulk in endpoint in the transfer_request. */
transfer_request = &cdc_acm -> ux_host_class_cdc_acm_bulk_in_endpoint -> ux_endpoint_transfer_request;
-
+
/* Initialize the transfer request. */
transfer_request -> ux_transfer_request_class_instance = (VOID *) cdc_acm;
transfer_request -> ux_transfer_request_data_pointer = cdc_acm_reception -> ux_host_class_cdc_acm_reception_data_head;
transfer_request -> ux_transfer_request_requested_length = cdc_acm_reception -> ux_host_class_cdc_acm_reception_block_size;
transfer_request -> ux_transfer_request_completion_function = _ux_host_class_cdc_acm_reception_callback;
-
+
/* Save the acm reception structure in the acm structure. */
cdc_acm -> ux_host_class_cdc_acm_reception = cdc_acm_reception;
-
+
/* And declare we have a transfer in progress. */
cdc_acm_reception -> ux_host_class_cdc_acm_reception_state = UX_HOST_CLASS_CDC_ACM_RECEPTION_STATE_STARTED;
@@ -137,8 +130,8 @@ UINT status;
in progress flag. */
if (status != UX_SUCCESS)
cdc_acm_reception -> ux_host_class_cdc_acm_reception_state = UX_HOST_CLASS_CDC_ACM_RECEPTION_STATE_STOPPED;
-
- return(status);
+
+ return(status);
}
@@ -174,14 +167,8 @@ UINT status;
/* */
/* Application */
/* */
-/* RELEASE HISTORY */
-/* */
-/* DATE NAME DESCRIPTION */
-/* */
-/* 10-31-2023 Chaoqiong Xiao Initial Version 6.3.0 */
-/* */
/**************************************************************************/
-UINT _uxe_host_class_cdc_acm_reception_start (UX_HOST_CLASS_CDC_ACM *cdc_acm,
+UINT _uxe_host_class_cdc_acm_reception_start (UX_HOST_CLASS_CDC_ACM *cdc_acm,
UX_HOST_CLASS_CDC_ACM_RECEPTION *cdc_acm_reception)
{
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 4815a092..52d37ef0 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
@@ -1,18 +1,19 @@
/***************************************************************************
- * Copyright (c) 2024 Microsoft Corporation
- *
+ * Copyright (c) 2024 Microsoft Corporation
+ * Copyright (c) 2026-present Eclipse ThreadX contributors
+ *
* This program and the accompanying materials are made available under the
* terms of the MIT License which is available at
* https://opensource.org/licenses/MIT.
- *
+ *
* SPDX-License-Identifier: MIT
**************************************************************************/
/**************************************************************************/
/**************************************************************************/
-/** */
-/** USBX Component */
+/** */
+/** USBX Component */
/** */
/** ACM CDC Class */
/** */
@@ -29,53 +30,42 @@
#include "ux_host_stack.h"
-/**************************************************************************/
-/* */
-/* FUNCTION RELEASE */
-/* */
-/* _ux_host_class_cdc_acm_reception_stop PORTABLE C */
+/**************************************************************************/
+/* */
+/* FUNCTION RELEASE */
+/* */
+/* _ux_host_class_cdc_acm_reception_stop PORTABLE C */
/* 6.1.10 */
/* AUTHOR */
/* */
/* Chaoqiong Xiao, Microsoft Corporation */
/* */
/* DESCRIPTION */
-/* */
-/* This function stops background reception previously started by */
+/* */
+/* This function stops background reception previously started by */
/* ux_host_class_cdc_acm_reception_start. */
/* */
-/* INPUT */
-/* */
-/* cdc_acm Pointer to cdc_acm class */
+/* INPUT */
+/* */
+/* cdc_acm Pointer to cdc_acm class */
/* cdc_acm_reception Pointer to reception struct */
-/* */
-/* OUTPUT */
-/* */
-/* Completion Status */
-/* */
-/* CALLS */
-/* */
+/* */
+/* OUTPUT */
+/* */
+/* Completion Status */
+/* */
+/* CALLS */
+/* */
/* _ux_host_stack_endpoint_transfer_abort */
/* Abort transfer */
/* _ux_host_semaphore_get Get semaphore */
-/* */
-/* 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), */
-/* resulting in version 6.1 */
-/* 01-31-2022 Chaoqiong Xiao Modified comment(s), */
-/* added standalone support, */
-/* resulting in version 6.1.10 */
+/* */
+/* CALLED BY */
+/* */
+/* Application */
/* */
/**************************************************************************/
-UINT _ux_host_class_cdc_acm_reception_stop(UX_HOST_CLASS_CDC_ACM *cdc_acm,
+UINT _ux_host_class_cdc_acm_reception_stop(UX_HOST_CLASS_CDC_ACM *cdc_acm,
UX_HOST_CLASS_CDC_ACM_RECEPTION *cdc_acm_reception)
{
@@ -86,7 +76,7 @@ UX_TRANSFER *transfer_request;
/* Ensure the instance is valid. */
if (cdc_acm -> ux_host_class_cdc_acm_state != UX_HOST_CLASS_INSTANCE_LIVE)
- {
+ {
/* Error trap. */
_ux_system_error_handler(UX_SYSTEM_LEVEL_THREAD, UX_SYSTEM_CONTEXT_CLASS, UX_HOST_CLASS_INSTANCE_UNKNOWN);
@@ -100,7 +90,7 @@ UX_TRANSFER *transfer_request;
/* As further protection, we must ensure this instance of the interface is the data interface and not
the control interface ! */
if (cdc_acm -> ux_host_class_cdc_acm_interface -> ux_interface_descriptor.bInterfaceClass != UX_HOST_CLASS_CDC_DATA_CLASS)
- {
+ {
/* Error trap. */
_ux_system_error_handler(UX_SYSTEM_LEVEL_THREAD, UX_SYSTEM_CONTEXT_CLASS, UX_HOST_CLASS_INSTANCE_UNKNOWN);
@@ -110,11 +100,11 @@ UX_TRANSFER *transfer_request;
return(UX_HOST_CLASS_INSTANCE_UNKNOWN);
}
-
+
/* Check if we do have transfers for this application. If none, nothing to do. */
if (cdc_acm_reception -> ux_host_class_cdc_acm_reception_state == UX_HOST_CLASS_CDC_ACM_RECEPTION_STATE_STOPPED)
return(UX_SUCCESS);
-
+
/* We need to abort transactions on the bulk In pipe. */
_ux_host_stack_endpoint_transfer_abort(cdc_acm -> ux_host_class_cdc_acm_bulk_in_endpoint);
@@ -129,9 +119,9 @@ UX_TRANSFER *transfer_request;
#if !defined(UX_HOST_STANDALONE)
- /* Clear semaphore counts that were (incorrectly) increased during each transfer
+ /* Clear semaphore counts that were (incorrectly) increased during each transfer
completion. */
- while (transfer_request -> ux_transfer_request_semaphore.tx_semaphore_count)
+ while (_ux_host_semaphore_waiting(&(transfer_request -> ux_transfer_request_semaphore)))
_ux_host_semaphore_get(&transfer_request -> ux_transfer_request_semaphore, 0);
#endif
@@ -171,14 +161,8 @@ UX_TRANSFER *transfer_request;
/* */
/* Application */
/* */
-/* RELEASE HISTORY */
-/* */
-/* DATE NAME DESCRIPTION */
-/* */
-/* 10-31-2023 Chaoqiong Xiao Initial Version 6.3.0 */
-/* */
/**************************************************************************/
-UINT _uxe_host_class_cdc_acm_reception_stop(UX_HOST_CLASS_CDC_ACM *cdc_acm,
+UINT _uxe_host_class_cdc_acm_reception_stop(UX_HOST_CLASS_CDC_ACM *cdc_acm,
UX_HOST_CLASS_CDC_ACM_RECEPTION *cdc_acm_reception)
{
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 40ede123..34e34f77 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
@@ -1,18 +1,19 @@
/***************************************************************************
- * Copyright (c) 2024 Microsoft Corporation
- *
+ * Copyright (c) 2024 Microsoft Corporation
+ * Copyright (c) 2026-present Eclipse ThreadX contributors
+ *
* This program and the accompanying materials are made available under the
* terms of the MIT License which is available at
* https://opensource.org/licenses/MIT.
- *
+ *
* SPDX-License-Identifier: MIT
**************************************************************************/
/**************************************************************************/
/**************************************************************************/
-/** */
-/** USBX Component */
+/** */
+/** USBX Component */
/** */
/** CDC_ACM Class */
/** */
@@ -29,46 +30,38 @@
#include "ux_host_stack.h"
-/**************************************************************************/
-/* */
-/* FUNCTION RELEASE */
-/* */
-/* _ux_host_class_cdc_acm_transfer_request_completed PORTABLE C */
+/**************************************************************************/
+/* */
+/* FUNCTION RELEASE */
+/* */
+/* _ux_host_class_cdc_acm_transfer_request_completed PORTABLE C */
/* 6.1 */
/* AUTHOR */
/* */
/* Chaoqiong Xiao, Microsoft Corporation */
/* */
/* DESCRIPTION */
-/* */
-/* This function is called by the completion thread when a transfer */
-/* request has been completed either because the transfer is */
-/* successful or there was an error. */
-/* */
-/* INPUT */
-/* */
-/* transfer_request Pointer to transfer request */
-/* */
-/* OUTPUT */
-/* */
-/* None */
-/* */
-/* CALLS */
/* */
-/* _ux_host_stack_transfer_request Transfer request */
+/* This function is called by the completion thread when a transfer */
+/* request has been completed either because the transfer is */
+/* successful or there was an error. */
+/* */
+/* INPUT */
+/* */
+/* transfer_request Pointer to transfer request */
+/* */
+/* OUTPUT */
+/* */
+/* None */
+/* */
+/* CALLS */
+/* */
+/* _ux_host_stack_transfer_request Transfer request */
/* _ux_utility_short_get Get 16-bit value */
-/* */
-/* CALLED BY */
-/* */
-/* USBX stack */
-/* */
-/* RELEASE HISTORY */
-/* */
-/* DATE NAME DESCRIPTION */
-/* */
-/* 05-19-2020 Chaoqiong Xiao Initial Version 6.0 */
-/* 09-30-2020 Chaoqiong Xiao Modified comment(s), */
-/* resulting in version 6.1 */
+/* */
+/* CALLED BY */
+/* */
+/* USBX stack */
/* */
/**************************************************************************/
VOID _ux_host_class_cdc_acm_transfer_request_completed(UX_TRANSFER *transfer_request)
@@ -81,7 +74,7 @@ ULONG notification_value;
/* Get the class instance for this transfer request. */
cdc_acm = (UX_HOST_CLASS_CDC_ACM *) transfer_request -> ux_transfer_request_class_instance;
-
+
/* Check the state of the transfer. If there is an error, we do not proceed with this notification. */
if (transfer_request -> ux_transfer_request_completion_code != UX_SUCCESS)
@@ -92,17 +85,17 @@ ULONG notification_value;
cdc_acm -> ux_host_class_cdc_acm_notification_count++;
/* Get the notification. */
- notification_type = (ULONG) *(transfer_request -> ux_transfer_request_data_pointer + UX_HOST_CLASS_CDC_ACM_NPF_NOTIFICATION_TYPE);
-
+ notification_type = (ULONG) *(transfer_request -> ux_transfer_request_data_pointer + UX_HOST_CLASS_CDC_ACM_NPF_NOTIFICATION_TYPE);
+
/* And the value. */
- notification_value = (ULONG) _ux_utility_short_get(transfer_request -> ux_transfer_request_data_pointer + UX_HOST_CLASS_CDC_ACM_NPF_VALUE);
-
+ notification_value = (ULONG) _ux_utility_short_get(transfer_request -> ux_transfer_request_data_pointer + UX_HOST_CLASS_CDC_ACM_NPF_VALUE);
+
/* If there is a callback present, invoke it. */
if (cdc_acm -> ux_host_class_cdc_acm_device_status_change_callback != UX_NULL)
-
+
/* There is a callback, send the status change to the application. */
cdc_acm -> ux_host_class_cdc_acm_device_status_change_callback(cdc_acm, notification_type, notification_value);
-
+
/* Reactivate the CDC_ACM interrupt pipe. */
_ux_host_stack_transfer_request(transfer_request);
diff --git a/common/usbx_host_classes/src/ux_host_class_cdc_acm_transmission_callback.c b/common/usbx_host_classes/src/ux_host_class_cdc_acm_transmission_callback.c
index 8e5fe334..fc988c8a 100644
--- a/common/usbx_host_classes/src/ux_host_class_cdc_acm_transmission_callback.c
+++ b/common/usbx_host_classes/src/ux_host_class_cdc_acm_transmission_callback.c
@@ -1,10 +1,11 @@
/***************************************************************************
- * Copyright (c) 2024 Microsoft Corporation
- *
+ * Copyright (c) 2024 Microsoft Corporation
+ * Copyright (c) 2026-present Eclipse ThreadX contributors
+ *
* This program and the accompanying materials are made available under the
* terms of the MIT License which is available at
* https://opensource.org/licenses/MIT.
- *
+ *
* SPDX-License-Identifier: MIT
**************************************************************************/
@@ -64,12 +65,6 @@
/* */
/* Application */
/* */
-/* RELEASE HISTORY */
-/* */
-/* DATE NAME DESCRIPTION */
-/* */
-/* 01-31-2022 Chaoqiong Xiao Initial Version 6.1.10 */
-/* */
/**************************************************************************/
VOID _ux_host_class_cdc_acm_transmission_callback(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 a6341d5e..4939ac5e 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
@@ -1,18 +1,19 @@
/***************************************************************************
- * Copyright (c) 2024 Microsoft Corporation
- *
+ * Copyright (c) 2024 Microsoft Corporation
+ * Copyright (c) 2026-present Eclipse ThreadX contributors
+ *
* This program and the accompanying materials are made available under the
* terms of the MIT License which is available at
* https://opensource.org/licenses/MIT.
- *
+ *
* SPDX-License-Identifier: MIT
**************************************************************************/
/**************************************************************************/
/**************************************************************************/
-/** */
-/** USBX Component */
+/** */
+/** USBX Component */
/** */
/** CDC ACM Class */
/** */
@@ -29,59 +30,45 @@
#include "ux_host_stack.h"
-/**************************************************************************/
-/* */
-/* FUNCTION RELEASE */
-/* */
-/* _ux_host_class_cdc_acm_write PORTABLE C */
+/**************************************************************************/
+/* */
+/* FUNCTION RELEASE */
+/* */
+/* _ux_host_class_cdc_acm_write PORTABLE C */
/* 6.1.10 */
/* AUTHOR */
/* */
/* Chaoqiong Xiao, Microsoft Corporation */
/* */
/* DESCRIPTION */
-/* */
-/* This function writes to the cdc_acm interface. The call is blocking */
-/* and only returns when there is either an error or when the transfer */
-/* is complete. */
-/* */
-/* INPUT */
-/* */
-/* cdc_acm Pointer to cdc_acm class */
-/* data_pointer Pointer to data to write */
-/* requested_length Length of data to write */
-/* actual_length Actual length of data written */
-/* */
-/* OUTPUT */
-/* */
-/* Completion Status */
-/* */
-/* CALLS */
-/* */
-/* _ux_host_stack_transfer_request Process transfer request */
-/* _ux_host_stack_transfer_request_abort Abort transfer request */
-/* _ux_host_semaphore_get Get protection semaphore */
-/* */
-/* 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), */
-/* resulting in version 6.1 */
-/* 12-31-2020 Chaoqiong Xiao Modified comment(s), */
-/* fixed ZLP sending, */
-/* resulting in version 6.1.3 */
-/* 01-31-2022 Chaoqiong Xiao Modified comment(s), */
-/* added standalone support, */
-/* resulting in version 6.1.10 */
+/* */
+/* This function writes to the cdc_acm interface. The call is blocking */
+/* and only returns when there is either an error or when the transfer */
+/* is complete. */
+/* */
+/* INPUT */
+/* */
+/* cdc_acm Pointer to cdc_acm class */
+/* data_pointer Pointer to data to write */
+/* requested_length Length of data to write */
+/* actual_length Actual length of data written */
+/* */
+/* OUTPUT */
+/* */
+/* Completion Status */
+/* */
+/* CALLS */
+/* */
+/* _ux_host_stack_transfer_request Process transfer request */
+/* _ux_host_stack_transfer_request_abort Abort transfer request */
+/* _ux_host_semaphore_get Get protection semaphore */
+/* */
+/* CALLED BY */
+/* */
+/* Application */
/* */
/**************************************************************************/
-UINT _ux_host_class_cdc_acm_write(UX_HOST_CLASS_CDC_ACM *cdc_acm, UCHAR *data_pointer,
+UINT _ux_host_class_cdc_acm_write(UX_HOST_CLASS_CDC_ACM *cdc_acm, UCHAR *data_pointer,
ULONG requested_length, ULONG *actual_length)
{
@@ -91,13 +78,13 @@ ULONG transfer_request_length;
#if defined(UX_HOST_STANDALONE)
ULONG transfer_flags;
#endif
-
+
/* If trace is enabled, insert this event into the trace buffer. */
UX_TRACE_IN_LINE_INSERT(UX_TRACE_HOST_CLASS_CDC_ACM_WRITE, cdc_acm, 0, 0, 0, UX_TRACE_HOST_CLASS_EVENTS, 0, 0)
/* Ensure the instance is valid. */
if (cdc_acm -> ux_host_class_cdc_acm_state != UX_HOST_CLASS_INSTANCE_LIVE)
- {
+ {
/* Error trap. */
_ux_system_error_handler(UX_SYSTEM_LEVEL_THREAD, UX_SYSTEM_CONTEXT_CLASS, UX_HOST_CLASS_INSTANCE_UNKNOWN);
@@ -111,7 +98,7 @@ ULONG transfer_flags;
/* As further protection, we must ensure this instance of the interface is the data interface and not
the control interface ! */
if (cdc_acm -> ux_host_class_cdc_acm_interface -> ux_interface_descriptor.bInterfaceClass != UX_HOST_CLASS_CDC_DATA_CLASS)
- {
+ {
/* Error trap. */
_ux_system_error_handler(UX_SYSTEM_LEVEL_THREAD, UX_SYSTEM_CONTEXT_CLASS, UX_HOST_CLASS_INSTANCE_UNKNOWN);
@@ -151,11 +138,11 @@ ULONG transfer_flags;
transfer_request_length = transfer_request -> ux_transfer_request_maximum_length;
else
transfer_request_length = requested_length;
-
+
/* Initialize the transfer_request. */
transfer_request -> ux_transfer_request_data_pointer = data_pointer;
transfer_request -> ux_transfer_request_requested_length = transfer_request_length;
-
+
/* Perform the transfer. */
status = _ux_host_stack_transfer_request(transfer_request);
@@ -174,20 +161,20 @@ ULONG transfer_flags;
/* All transfers pending need to abort. There may have been a partial transfer. */
_ux_host_stack_transfer_request_abort(transfer_request);
-
- /* Update the length of the actual data transferred. We do this after the
+
+ /* Update the length of the actual data transferred. We do this after the
abort of the transfer_request in case some data actually went out. */
*actual_length += transfer_request -> ux_transfer_request_actual_length;
-
+
/* Set the completion code. */
transfer_request -> ux_transfer_request_completion_code = UX_TRANSFER_TIMEOUT;
-
+
/* Error trap. */
_ux_system_error_handler(UX_SYSTEM_LEVEL_THREAD, UX_SYSTEM_CONTEXT_CLASS, UX_TRANSFER_TIMEOUT);
/* If trace is enabled, insert this event into the trace buffer. */
UX_TRACE_IN_LINE_INSERT(UX_TRACE_ERROR, UX_TRANSFER_TIMEOUT, transfer_request, 0, 0, UX_TRACE_ERRORS, 0, 0)
-
+
/* There was an error, return to the caller. */
return(UX_TRANSFER_TIMEOUT);
}
@@ -198,7 +185,7 @@ ULONG transfer_flags;
#if defined(UX_HOST_STANDALONE)
- /* Update the length of the actual data transferred. We do this after the
+ /* Update the length of the actual data transferred. We do this after the
abort of the transfer request in case some data was actually received. */
*actual_length += transfer_request -> ux_transfer_request_actual_length;
@@ -215,7 +202,7 @@ ULONG transfer_flags;
/* Update the length of the transfer. Normally all the data has to be sent. */
*actual_length += transfer_request -> ux_transfer_request_actual_length;
-
+
/* Check for completion of transfer. If the transfer is partial, return to caller.
The transfer is marked as successful but the caller will need to check the length
actually sent and determine if a partial transfer is OK. */
@@ -226,11 +213,11 @@ ULONG transfer_flags;
return(UX_SUCCESS);
}
- /* Update the data pointer for next transfer. */
+ /* Update the data pointer for next transfer. */
data_pointer += transfer_request_length;
-
+
/* Update what is left to send out. */
- requested_length -= transfer_request_length;
+ requested_length -= transfer_request_length;
} while (requested_length);
@@ -244,7 +231,7 @@ ULONG transfer_flags;
#endif
/* We get here when all the transfers went through without errors. */
- return(UX_SUCCESS);
+ return(UX_SUCCESS);
}
@@ -281,14 +268,8 @@ ULONG transfer_flags;
/* */
/* Application */
/* */
-/* RELEASE HISTORY */
-/* */
-/* DATE NAME DESCRIPTION */
-/* */
-/* 10-31-2023 Chaoqiong Xiao Initial Version 6.3.0 */
-/* */
/**************************************************************************/
-UINT _uxe_host_class_cdc_acm_write(UX_HOST_CLASS_CDC_ACM *cdc_acm, UCHAR *data_pointer,
+UINT _uxe_host_class_cdc_acm_write(UX_HOST_CLASS_CDC_ACM *cdc_acm, UCHAR *data_pointer,
ULONG requested_length, ULONG *actual_length)
{
diff --git a/common/usbx_host_classes/src/ux_host_class_cdc_acm_write_with_callback.c b/common/usbx_host_classes/src/ux_host_class_cdc_acm_write_with_callback.c
index 7f5ad7b1..1196ce81 100644
--- a/common/usbx_host_classes/src/ux_host_class_cdc_acm_write_with_callback.c
+++ b/common/usbx_host_classes/src/ux_host_class_cdc_acm_write_with_callback.c
@@ -1,10 +1,11 @@
/***************************************************************************
- * Copyright (c) 2024 Microsoft Corporation
- *
+ * Copyright (c) 2024 Microsoft Corporation
+ * Copyright (c) 2026-present Eclipse ThreadX contributors
+ *
* This program and the accompanying materials are made available under the
* terms of the MIT License which is available at
* https://opensource.org/licenses/MIT.
- *
+ *
* SPDX-License-Identifier: MIT
**************************************************************************/
@@ -77,12 +78,6 @@
/* */
/* Application */
/* */
-/* RELEASE HISTORY */
-/* */
-/* DATE NAME DESCRIPTION */
-/* */
-/* 01-31-2022 Chaoqiong Xiao Initial Version 6.1.10 */
-/* */
/**************************************************************************/
UINT _ux_host_class_cdc_acm_write_with_callback(UX_HOST_CLASS_CDC_ACM *cdc_acm,
UCHAR *data_pointer, ULONG requested_length)
@@ -194,12 +189,6 @@ ULONG transfer_request_length;
/* */
/* Application */
/* */
-/* RELEASE HISTORY */
-/* */
-/* DATE NAME DESCRIPTION */
-/* */
-/* 10-31-2023 Chaoqiong Xiao Initial Version 6.3.0 */
-/* */
/**************************************************************************/
UINT _uxe_host_class_cdc_acm_write_with_callback(UX_HOST_CLASS_CDC_ACM *cdc_acm,
UCHAR *data_pointer, ULONG requested_length)
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 93d47a3b..03d417b0 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
@@ -1,18 +1,19 @@
/***************************************************************************
- * Copyright (c) 2024 Microsoft Corporation
- *
+ * Copyright (c) 2024 Microsoft Corporation
+ * Copyright (c) 2026-present Eclipse ThreadX contributors
+ *
* This program and the accompanying materials are made available under the
* terms of the MIT License which is available at
* https://opensource.org/licenses/MIT.
- *
+ *
* SPDX-License-Identifier: MIT
**************************************************************************/
/**************************************************************************/
/**************************************************************************/
-/** */
-/** USBX Component */
+/** */
+/** USBX Component */
/** */
/** CDC ECM Class */
/** */
@@ -31,37 +32,37 @@
UX_HOST_CLASS_CDC_ECM_NX_ETHERNET_POOL_ALLOCSIZE_ASSERT
#if !defined(UX_HOST_STANDALONE)
-/**************************************************************************/
-/* */
-/* FUNCTION RELEASE */
-/* */
-/* _ux_host_class_cdc_ecm_activate PORTABLE C */
+/**************************************************************************/
+/* */
+/* FUNCTION RELEASE */
+/* */
+/* _ux_host_class_cdc_ecm_activate PORTABLE C */
/* 6.2.0 */
/* AUTHOR */
/* */
/* Chaoqiong Xiao, Microsoft Corporation */
/* */
/* DESCRIPTION */
-/* */
-/* This function creates the cdc_ecm instance, configure the device. */
-/* */
-/* INPUT */
-/* */
-/* command CDC ECM class command pointer */
-/* */
-/* OUTPUT */
-/* */
-/* Completion Status */
-/* */
-/* CALLS */
-/* */
+/* */
+/* This function creates the cdc_ecm instance, configure the device. */
+/* */
+/* INPUT */
+/* */
+/* command CDC ECM class command pointer */
+/* */
+/* OUTPUT */
+/* */
+/* Completion Status */
+/* */
+/* CALLS */
+/* */
/* _ux_host_stack_transfer_request Transfer request */
-/* _ux_host_class_cdc_ecm_endpoints_get Get endpoints of cdc_ecm */
+/* _ux_host_class_cdc_ecm_endpoints_get Get endpoints of cdc_ecm */
/* _ux_host_class_cdc_ecm_mac_address_get Get MAC address */
-/* _ux_host_stack_class_instance_create Create class instance */
-/* _ux_host_stack_class_instance_destroy Destroy the class instance */
-/* _ux_utility_memory_allocate Allocate memory block */
-/* _ux_utility_memory_free Free memory block */
+/* _ux_host_stack_class_instance_create Create class instance */
+/* _ux_host_stack_class_instance_destroy Destroy the class instance */
+/* _ux_utility_memory_allocate Allocate memory block */
+/* _ux_utility_memory_free Free memory block */
/* _ux_host_semaphore_create Create semaphore */
/* _ux_host_semaphore_delete Delete semaphore */
/* _ux_utility_thread_create Create thread */
@@ -70,43 +71,10 @@ UX_HOST_CLASS_CDC_ECM_NX_ETHERNET_POOL_ALLOCSIZE_ASSERT
/* _ux_network_driver_activate Activate NetX USB interface*/
/* nx_packet_pool_create Create NetX packet pool */
/* nx_packet_pool_delete Delete NetX packet pool */
-/* */
-/* CALLED BY */
-/* */
-/* _ux_host_class_cdc_ecm_entry Entry of cdc_ecm class */
-/* */
-/* RELEASE HISTORY */
-/* */
-/* 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 */
-/* 02-02-2021 Xiuwen Cai Modified comment(s), added */
-/* compile option for using */
-/* packet pool from NetX, */
-/* resulting in version 6.1.4 */
-/* 01-31-2022 Chaoqiong Xiao Modified comment(s), */
-/* refined macros names, */
-/* resulting in version 6.1.10 */
-/* 04-25-2022 Chaoqiong Xiao Modified comment(s), */
-/* fixed standalone compile, */
-/* resulting in version 6.1.11 */
-/* 07-29-2022 Chaoqiong Xiao Modified comment(s), */
-/* fixed parameter/variable */
-/* names conflict C++ keyword, */
-/* resulting in version 6.1.12 */
-/* 10-31-2022 Chaoqiong Xiao Modified comment(s), */
-/* deprecated ECM pool option, */
-/* supported NX packet chain, */
-/* resulting in version 6.2.0 */
-/* 10-31-2023 Chaoqiong Xiao Modified comment(s), */
-/* rejected the CDC ECM data */
-/* interface not next to ctrl, */
-/* resulting in version 6.3.0 */
+/* */
+/* CALLED BY */
+/* */
+/* _ux_host_class_cdc_ecm_entry Entry of cdc_ecm class */
/* */
/**************************************************************************/
UINT _ux_host_class_cdc_ecm_activate(UX_HOST_CLASS_COMMAND *command)
@@ -149,7 +117,7 @@ UX_INTERFACE *cur_interface;
cdc_ecm -> ux_host_class_cdc_ecm_interface_data = interface_ptr;
/* We need to link the data and control interfaces together. In order
- to do this, we first need to find the control interface. Per the spec,
+ to do this, we first need to find the control interface. Per the spec,
it should be behind this one. */
/* Set the current interface to the second interface. */
@@ -215,7 +183,7 @@ UX_INTERFACE *cur_interface;
{
/* Allocate a Thread stack. */
- cdc_ecm -> ux_host_class_cdc_ecm_thread_stack =
+ cdc_ecm -> ux_host_class_cdc_ecm_thread_stack =
_ux_utility_memory_allocate(UX_NO_ALIGN, UX_REGULAR_MEMORY, UX_THREAD_STACK_SIZE);
if (cdc_ecm -> ux_host_class_cdc_ecm_thread_stack == UX_NULL)
status = UX_MEMORY_INSUFFICIENT;
@@ -225,13 +193,13 @@ UX_INTERFACE *cur_interface;
{
/* Create the semaphore for aborting bulk in transfers. */
- status = _ux_host_semaphore_create(&cdc_ecm -> ux_host_class_cdc_ecm_bulk_in_transfer_waiting_for_check_and_arm_to_finish_semaphore,
+ status = _ux_host_semaphore_create(&cdc_ecm -> ux_host_class_cdc_ecm_bulk_in_transfer_waiting_for_check_and_arm_to_finish_semaphore,
"host CDC-ECM bulk in wait semaphore", 0);
if (status == UX_SUCCESS)
{
/* Create the semaphore for aborting bulk out transfers. */
- status = _ux_host_semaphore_create(&cdc_ecm -> ux_host_class_cdc_ecm_bulk_out_transfer_waiting_for_check_and_arm_to_finish_semaphore,
+ status = _ux_host_semaphore_create(&cdc_ecm -> ux_host_class_cdc_ecm_bulk_out_transfer_waiting_for_check_and_arm_to_finish_semaphore,
"host CDC-ECM bulk out wait semaphore", 0);
if (status == UX_SUCCESS)
{
@@ -244,9 +212,9 @@ UX_INTERFACE *cur_interface;
/* Create the cdc_ecm class thread. We do not start it yet. */
status = _ux_utility_thread_create(&cdc_ecm -> ux_host_class_cdc_ecm_thread,
"ux_host_cdc_ecm_thread", _ux_host_class_cdc_ecm_thread,
- (ULONG) (ALIGN_TYPE) cdc_ecm,
+ (ULONG) (ALIGN_TYPE) cdc_ecm,
cdc_ecm -> ux_host_class_cdc_ecm_thread_stack,
- UX_THREAD_STACK_SIZE,
+ UX_THREAD_STACK_SIZE,
UX_THREAD_PRIORITY_CLASS,
UX_THREAD_PRIORITY_CLASS,
UX_NO_TIME_SLICE, UX_DONT_START);
@@ -256,7 +224,7 @@ UX_INTERFACE *cur_interface;
UX_THREAD_EXTENSION_PTR_SET(&(cdc_ecm -> ux_host_class_cdc_ecm_thread), cdc_ecm)
/* We now need to retrieve the MAC address of the node which is embedded in the ECM descriptor.
- We will parse the entire configuration descriptor of the device and look for the ECM Ethernet Networking Functional Descriptor. */
+ We will parse the entire configuration descriptor of the device and look for the ECM Ethernet Networking Functional Descriptor. */
status = _ux_host_class_cdc_ecm_mac_address_get(cdc_ecm);
if (status == UX_SUCCESS)
@@ -264,7 +232,7 @@ UX_INTERFACE *cur_interface;
/* Setup the physical address of this IP instance. */
physical_address_msw = (ULONG)((cdc_ecm -> ux_host_class_cdc_ecm_node_id[0] << 8) | (cdc_ecm -> ux_host_class_cdc_ecm_node_id[1]));
- physical_address_lsw = (ULONG)((cdc_ecm -> ux_host_class_cdc_ecm_node_id[2] << 24) | (cdc_ecm -> ux_host_class_cdc_ecm_node_id[3] << 16) |
+ physical_address_lsw = (ULONG)((cdc_ecm -> ux_host_class_cdc_ecm_node_id[2] << 24) | (cdc_ecm -> ux_host_class_cdc_ecm_node_id[3] << 16) |
(cdc_ecm -> ux_host_class_cdc_ecm_node_id[4] << 8) | (cdc_ecm -> ux_host_class_cdc_ecm_node_id[5]));
/* The ethernet link is down by default. */
@@ -275,8 +243,8 @@ UX_INTERFACE *cur_interface;
{
/* Register this interface to the NetX USB interface broker. */
- status = _ux_network_driver_activate((VOID *) cdc_ecm, _ux_host_class_cdc_ecm_write,
- &cdc_ecm -> ux_host_class_cdc_ecm_network_handle,
+ status = _ux_network_driver_activate((VOID *) cdc_ecm, _ux_host_class_cdc_ecm_write,
+ &cdc_ecm -> ux_host_class_cdc_ecm_network_handle,
physical_address_msw, physical_address_lsw);
}
@@ -309,18 +277,18 @@ UX_INTERFACE *cur_interface;
/* Now we can start the CDC-ECM thread. */
_ux_utility_thread_resume(&cdc_ecm -> ux_host_class_cdc_ecm_thread);
- /* We need to inform the application if a function has been programmed
+ /* We need to inform the application if a function has been programmed
in the system structure. */
if (_ux_system_host -> ux_system_host_change_function != UX_NULL)
{
-
+
/* Call system change function. Note that the application should
wait until the link state is up until using this instance. The
link state is changed to up by the CDC-ECM thread, which isn't
started until after the data interface has been processed. */
_ux_system_host -> ux_system_host_change_function(UX_DEVICE_INSERTION, cdc_ecm -> ux_host_class_cdc_ecm_class, (VOID *) cdc_ecm);
}
-
+
/* If trace is enabled, insert this event into the trace buffer. */
UX_TRACE_IN_LINE_INSERT(UX_TRACE_HOST_CLASS_CDC_ECM_ACTIVATE, cdc_ecm, 0, 0, 0, UX_TRACE_HOST_CLASS_EVENTS, 0, 0)
@@ -367,8 +335,8 @@ UX_INTERFACE *cur_interface;
_ux_utility_memory_free(cdc_ecm -> ux_host_class_cdc_ecm_thread_stack);
_ux_utility_memory_free(cdc_ecm);
-
+
/* Return completion status. */
- return(status);
+ return(status);
}
#endif
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 554167a5..a36721c0 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
@@ -1,18 +1,19 @@
/***************************************************************************
- * Copyright (c) 2024 Microsoft Corporation
- *
+ * Copyright (c) 2024 Microsoft Corporation
+ * Copyright (c) 2026-present Eclipse ThreadX contributors
+ *
* This program and the accompanying materials are made available under the
* terms of the MIT License which is available at
* https://opensource.org/licenses/MIT.
- *
+ *
* SPDX-License-Identifier: MIT
**************************************************************************/
/**************************************************************************/
/**************************************************************************/
-/** */
-/** USBX Component */
+/** */
+/** USBX Component */
/** */
/** CDC ECM Class */
/** */
@@ -30,68 +31,42 @@
#if !defined(UX_HOST_STANDALONE)
-/**************************************************************************/
-/* */
-/* FUNCTION RELEASE */
-/* */
-/* _ux_host_class_cdc_ecm_deactivate PORTABLE C */
+/**************************************************************************/
+/* */
+/* FUNCTION RELEASE */
+/* */
+/* _ux_host_class_cdc_ecm_deactivate PORTABLE C */
/* 6.2.0 */
/* AUTHOR */
/* */
/* Chaoqiong Xiao, Microsoft Corporation */
/* */
/* DESCRIPTION */
-/* */
+/* */
/* This function is called when this instance of the cdc_ecm has been */
-/* removed from the bus either directly or indirectly. The bulk in\out */
-/* and interrupt pipes will be destroyed and the instance */
-/* removed. */
-/* */
-/* INPUT */
-/* */
-/* command CDC ECM class command pointer */
-/* */
-/* OUTPUT */
-/* */
-/* Completion Status */
-/* */
-/* CALLS */
-/* */
-/* _ux_host_stack_class_instance_destroy Destroy the class instance */
-/* _ux_host_stack_endpoint_transfer_abort Abort endpoint transfer */
-/* _ux_utility_memory_free Free memory block */
-/* _ux_host_semaphore_get Get protection semaphore */
-/* _ux_host_semaphore_delete Delete protection semaphore */
-/* */
-/* CALLED BY */
-/* */
-/* _ux_host_class_cdc_ecm_entry Entry of cdc_ecm class */
-/* */
-/* RELEASE HISTORY */
-/* */
-/* 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 */
-/* 02-02-2021 Xiuwen Cai Modified comment(s), added */
-/* compile option for using */
-/* packet pool from NetX, */
-/* resulting in version 6.1.4 */
-/* 01-31-2022 Chaoqiong Xiao Modified comment(s), */
-/* refined macros names, */
-/* resulting in version 6.1.10 */
-/* 04-25-2022 Chaoqiong Xiao Modified comment(s), */
-/* internal clean up, */
-/* fixed standalone compile, */
-/* resulting in version 6.1.11 */
-/* 10-31-2022 Chaoqiong Xiao Modified comment(s), */
-/* deprecated ECM pool option, */
-/* supported NX packet chain, */
-/* resulting in version 6.2.0 */
+/* removed from the bus either directly or indirectly. The bulk in\out */
+/* and interrupt pipes will be destroyed and the instance */
+/* removed. */
+/* */
+/* INPUT */
+/* */
+/* command CDC ECM class command pointer */
+/* */
+/* OUTPUT */
+/* */
+/* Completion Status */
+/* */
+/* CALLS */
+/* */
+/* _ux_host_stack_class_instance_destroy Destroy the class instance */
+/* _ux_host_stack_endpoint_transfer_abort Abort endpoint transfer */
+/* _ux_utility_memory_free Free memory block */
+/* _ux_host_semaphore_get Get protection semaphore */
+/* _ux_host_semaphore_delete Delete protection semaphore */
+/* */
+/* CALLED BY */
+/* */
+/* _ux_host_class_cdc_ecm_entry Entry of cdc_ecm class */
/* */
/**************************************************************************/
UINT _ux_host_class_cdc_ecm_deactivate(UX_HOST_CLASS_COMMAND *command)
@@ -110,11 +85,11 @@ UX_TRANSFER *transfer_request;
/* The cdc_ecm is being shut down. */
cdc_ecm -> ux_host_class_cdc_ecm_state = UX_HOST_CLASS_INSTANCE_SHUTDOWN;
-
+
/* If the interrupt endpoint is defined, abort transfers so the link state
doesn't change. */
if (cdc_ecm -> ux_host_class_cdc_ecm_interrupt_endpoint != UX_NULL)
- {
+ {
/* Get the transfer request. */
transfer_request = &cdc_ecm -> ux_host_class_cdc_ecm_interrupt_endpoint -> ux_endpoint_transfer_request;
@@ -123,8 +98,8 @@ UX_TRANSFER *transfer_request;
_ux_host_stack_transfer_request_abort(transfer_request);
}
- /* Check if link was up to see if we should clean the transmit queue. If
- the link is pending down, that means the CDC-ECM thread is in the process
+ /* Check if link was up to see if we should clean the transmit queue. If
+ the link is pending down, that means the CDC-ECM thread is in the process
of cleaning the transmit queue. */
if (cdc_ecm -> ux_host_class_cdc_ecm_link_state == UX_HOST_CLASS_CDC_ECM_LINK_STATE_UP)
@@ -134,7 +109,7 @@ UX_TRANSFER *transfer_request;
transfer_request = &cdc_ecm -> ux_host_class_cdc_ecm_bulk_in_endpoint -> ux_endpoint_transfer_request;
/* Now abort all transfers. It's possible we're executing right before the transfer
- is armed. If this is the case, then the transfer will not be aborted if we do the abort right now; instead,
+ is armed. If this is the case, then the transfer will not be aborted if we do the abort right now; instead,
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. */
@@ -175,7 +150,7 @@ UX_TRANSFER *transfer_request;
_ux_host_stack_class_instance_destroy(cdc_ecm -> ux_host_class_cdc_ecm_class, (VOID *) cdc_ecm);
/* Now wait for all threads to leave the instance before freeing the resources. */
- _ux_host_thread_schedule_other(UX_THREAD_PRIORITY_ENUM);
+ _ux_host_thread_schedule_other(UX_THREAD_PRIORITY_ENUM);
/* Free the memory used by the interrupt endpoint. */
if (cdc_ecm -> ux_host_class_cdc_ecm_interrupt_endpoint != UX_NULL)
@@ -207,7 +182,7 @@ UX_TRANSFER *transfer_request;
/* Before we free the device resources, we need to inform the application
that the device is removed. */
if (_ux_system_host -> ux_system_host_change_function != UX_NULL)
-
+
/* Inform the application the device is removed. */
_ux_system_host -> ux_system_host_change_function(UX_DEVICE_REMOVAL, cdc_ecm -> ux_host_class_cdc_ecm_class, (VOID *) cdc_ecm);
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 fab30f15..59811dcd 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
@@ -1,10 +1,11 @@
/***************************************************************************
- * Copyright (c) 2024 Microsoft Corporation
- *
+ * Copyright (c) 2024 Microsoft Corporation
+ * Copyright (c) 2026-present Eclipse ThreadX contributors
+ *
* This program and the accompanying materials are made available under the
* terms of the MIT License which is available at
* https://opensource.org/licenses/MIT.
- *
+ *
* SPDX-License-Identifier: MIT
**************************************************************************/
@@ -61,21 +62,6 @@
/* */
/* _ux_host_class_cdc_ecm_activate Activate cdc_ecm class */
/* */
-/* RELEASE HISTORY */
-/* */
-/* DATE NAME DESCRIPTION */
-/* */
-/* 05-19-2020 Chaoqiong Xiao Initial Version 6.0 */
-/* 09-30-2020 Chaoqiong Xiao Modified comment(s), */
-/* resulting in version 6.1 */
-/* 10-15-2021 Chaoqiong Xiao Modified comment(s), */
-/* use pre-calculated value */
-/* instead of wMaxPacketSize, */
-/* resulting in version 6.1.9 */
-/* 10-31-2023 Chaoqiong Xiao Modified comment(s), */
-/* checked endpoint get status,*/
-/* resulting in version 6.3.0 */
-/* */
/**************************************************************************/
UINT _ux_host_class_cdc_ecm_endpoints_get(UX_HOST_CLASS_CDC_ECM *cdc_ecm)
{
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 66534dad..28077368 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
@@ -1,18 +1,19 @@
/***************************************************************************
- * Copyright (c) 2024 Microsoft Corporation
- *
+ * Copyright (c) 2024 Microsoft Corporation
+ * Copyright (c) 2026-present Eclipse ThreadX contributors
+ *
* This program and the accompanying materials are made available under the
* terms of the MIT License which is available at
* https://opensource.org/licenses/MIT.
- *
+ *
* SPDX-License-Identifier: MIT
**************************************************************************/
/**************************************************************************/
/**************************************************************************/
-/** */
-/** USBX Component */
+/** */
+/** USBX Component */
/** */
/** CDC ECM Class */
/** */
@@ -29,50 +30,39 @@
#include "ux_host_stack.h"
-/**************************************************************************/
-/* */
-/* FUNCTION RELEASE */
-/* */
-/* _ux_host_class_cdc_ecm_entry PORTABLE C */
+/**************************************************************************/
+/* */
+/* FUNCTION RELEASE */
+/* */
+/* _ux_host_class_cdc_ecm_entry PORTABLE C */
/* 6.1.11 */
/* AUTHOR */
/* */
/* Chaoqiong Xiao, Microsoft Corporation */
/* */
/* DESCRIPTION */
-/* */
-/* This function is the entry point of the cdc_ecm class. It will be */
-/* called by the USBX stack enumeration module when there is a new */
-/* cdc_ecm ethernet device on the bus or when the it is removed. */
-/* */
-/* */
-/* INPUT */
-/* */
+/* */
+/* This function is the entry point of the cdc_ecm class. It will be */
+/* called by the USBX stack enumeration module when there is a new */
+/* cdc_ecm ethernet device on the bus or when the it is removed. */
+/* */
+/* */
+/* INPUT */
+/* */
/* command CDC ECM class command */
-/* */
-/* OUTPUT */
-/* */
-/* Completion Status */
-/* */
-/* CALLS */
-/* */
-/* _ux_host_class_cdc_ecm_activate Activate cdc_ecm class */
-/* _ux_host_class_cdc_ecm_deactivate Deactivate cdc_ecm class */
-/* */
-/* CALLED BY */
-/* */
-/* CDC ECM Class */
-/* */
-/* RELEASE HISTORY */
-/* */
-/* DATE NAME DESCRIPTION */
-/* */
-/* 05-19-2020 Chaoqiong Xiao Initial Version 6.0 */
-/* 09-30-2020 Chaoqiong Xiao Modified comment(s), */
-/* resulting in version 6.1 */
-/* 04-25-2022 Chaoqiong Xiao Modified comment(s), */
-/* fixed standalone compile, */
-/* resulting in version 6.1.11 */
+/* */
+/* OUTPUT */
+/* */
+/* Completion Status */
+/* */
+/* CALLS */
+/* */
+/* _ux_host_class_cdc_ecm_activate Activate cdc_ecm class */
+/* _ux_host_class_cdc_ecm_deactivate Deactivate cdc_ecm class */
+/* */
+/* CALLED BY */
+/* */
+/* CDC ECM Class */
/* */
/**************************************************************************/
UINT _ux_host_class_cdc_ecm_entry(UX_HOST_CLASS_COMMAND *command)
@@ -96,7 +86,7 @@ UINT status;
this device or not. */
if(command -> ux_host_class_command_usage == UX_HOST_CLASS_COMMAND_USAGE_CSP)
{
-
+
/* We are in CSP mode. Check if CDC-ECM Control or Data. */
if (((command -> ux_host_class_command_class == UX_HOST_CLASS_CDC_DATA_CLASS) && (command -> ux_host_class_command_subclass == 0)) ||
((command -> ux_host_class_command_class == UX_HOST_CLASS_CDC_CONTROL_CLASS) &&
@@ -104,36 +94,36 @@ UINT status;
{
/* Check for IAD presence. */
if ((command -> ux_host_class_command_iad_class == 0) && (command -> ux_host_class_command_iad_subclass == 0))
-
+
/* No IAD, we accept this class. */
- return(UX_SUCCESS);
-
+ return(UX_SUCCESS);
+
else
{
-
+
if ((command -> ux_host_class_command_iad_class == UX_HOST_CLASS_CDC_CONTROL_CLASS) &&
(command -> ux_host_class_command_iad_subclass == UX_HOST_CLASS_CDC_ECM_CONTROL_SUBCLASS))
-
+
/* There is an IAD and this is for CDC-ACM. */
- return(UX_SUCCESS);
+ return(UX_SUCCESS);
else
-
+
/* The IAD does not match with CDC-ACM. */
- return(UX_NO_CLASS_MATCH);
+ return(UX_NO_CLASS_MATCH);
}
}
/* Not CDC-ECM control or data class. */
- return(UX_NO_CLASS_MATCH);
-
+ return(UX_NO_CLASS_MATCH);
+
}
- else
+ else
/* No match. */
- return(UX_NO_CLASS_MATCH);
-
+ return(UX_NO_CLASS_MATCH);
+
case UX_HOST_CLASS_COMMAND_ACTIVATE:
/* The activate command is used when the device inserted has found a parent and
@@ -143,13 +133,13 @@ UINT status;
case UX_HOST_CLASS_COMMAND_DEACTIVATE:
- /* The deactivate command is used when the device has been extracted either
+ /* The deactivate command is used when the device has been extracted either
directly or when its parents has been extracted. */
status = _ux_host_class_cdc_ecm_deactivate(command);
return(status);
- default:
-
+ default:
+
/* Error trap. */
_ux_system_error_handler(UX_SYSTEM_LEVEL_THREAD, UX_SYSTEM_CONTEXT_CLASS, UX_FUNCTION_NOT_SUPPORTED);
@@ -157,7 +147,7 @@ UINT status;
UX_TRACE_IN_LINE_INSERT(UX_TRACE_ERROR, UX_FUNCTION_NOT_SUPPORTED, 0, 0, 0, UX_TRACE_ERRORS, 0, 0)
return(UX_FUNCTION_NOT_SUPPORTED);
- }
+ }
#endif
}
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 3bda7fc6..ca6168f8 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
@@ -1,18 +1,19 @@
/***************************************************************************
- * Copyright (c) 2024 Microsoft Corporation
- *
+ * Copyright (c) 2024 Microsoft Corporation
+ * Copyright (c) 2026-present Eclipse ThreadX contributors
+ *
* This program and the accompanying materials are made available under the
* terms of the MIT License which is available at
* https://opensource.org/licenses/MIT.
- *
+ *
* SPDX-License-Identifier: MIT
**************************************************************************/
/**************************************************************************/
/**************************************************************************/
-/** */
-/** USBX Component */
+/** */
+/** USBX Component */
/** */
/** CDC ECM Class */
/** */
@@ -29,50 +30,36 @@
#include "ux_host_stack.h"
-/**************************************************************************/
-/* */
-/* FUNCTION RELEASE */
-/* */
-/* _ux_host_class_cdc_ecm_interrupt_notification PORTABLE C */
+/**************************************************************************/
+/* */
+/* FUNCTION RELEASE */
+/* */
+/* _ux_host_class_cdc_ecm_interrupt_notification PORTABLE C */
/* 6.1.11 */
/* AUTHOR */
/* */
/* Chaoqiong Xiao, Microsoft Corporation */
/* */
/* DESCRIPTION */
-/* */
-/* This function is called by the stack when an interrupt packet as */
-/* been received. */
-/* */
-/* INPUT */
-/* */
-/* transfer_request Pointer to transfer request */
-/* */
-/* OUTPUT */
-/* */
-/* None */
-/* */
-/* CALLS */
-/* */
+/* */
+/* This function is called by the stack when an interrupt packet as */
+/* been received. */
+/* */
+/* INPUT */
+/* */
+/* transfer_request Pointer to transfer request */
+/* */
+/* OUTPUT */
+/* */
/* None */
-/* */
-/* CALLED BY */
-/* */
-/* USBX stack */
-/* */
-/* RELEASE HISTORY */
-/* */
-/* DATE NAME DESCRIPTION */
-/* */
-/* 05-19-2020 Chaoqiong Xiao Initial Version 6.0 */
-/* 09-30-2020 Chaoqiong Xiao Modified comment(s), */
-/* resulting in version 6.1 */
-/* 01-31-2022 Chaoqiong Xiao Modified comment(s), */
-/* refined macros names, */
-/* resulting in version 6.1.10 */
-/* 04-25-2022 Chaoqiong Xiao Modified comment(s), */
-/* fixed standalone compile, */
-/* resulting in version 6.1.11 */
+/* */
+/* CALLS */
+/* */
+/* None */
+/* */
+/* CALLED BY */
+/* */
+/* USBX stack */
/* */
/**************************************************************************/
VOID _ux_host_class_cdc_ecm_interrupt_notification(UX_TRANSFER *transfer_request)
@@ -85,7 +72,7 @@ ULONG notification_value;
/* Get the control class instance for this transfer request. */
cdc_ecm = (UX_HOST_CLASS_CDC_ECM *) transfer_request -> ux_transfer_request_class_instance;
-
+
/* Check the state of the transfer. If there is an error, we do not proceed with this notification. */
if (transfer_request -> ux_transfer_request_completion_code != UX_SUCCESS)
@@ -102,10 +89,10 @@ ULONG notification_value;
cdc_ecm -> ux_host_class_cdc_ecm_notification_count++;
/* Get the notification. */
- notification_type = (ULONG) *(transfer_request -> ux_transfer_request_data_pointer + UX_HOST_CLASS_CDC_ECM_NPF_NOTIFICATION_TYPE);
-
+ notification_type = (ULONG) *(transfer_request -> ux_transfer_request_data_pointer + UX_HOST_CLASS_CDC_ECM_NPF_NOTIFICATION_TYPE);
+
/* And the value. */
- notification_value = (ULONG) *(transfer_request -> ux_transfer_request_data_pointer + UX_HOST_CLASS_CDC_ECM_NPF_VALUE);
+ notification_value = (ULONG) *(transfer_request -> ux_transfer_request_data_pointer + UX_HOST_CLASS_CDC_ECM_NPF_VALUE);
/* Check if the notification is a Network notification. */
if (notification_type == UX_HOST_CLASS_CDC_ECM_NOTIFICATION_NETWORK_CONNECTION)
@@ -116,13 +103,13 @@ ULONG notification_value;
{
/* Link is up. See if we know about that. */
- if (cdc_ecm -> ux_host_class_cdc_ecm_link_state != UX_HOST_CLASS_CDC_ECM_LINK_STATE_UP &&
+ if (cdc_ecm -> ux_host_class_cdc_ecm_link_state != UX_HOST_CLASS_CDC_ECM_LINK_STATE_UP &&
cdc_ecm -> ux_host_class_cdc_ecm_link_state != UX_HOST_CLASS_CDC_ECM_LINK_STATE_PENDING_UP)
{
-
+
/* Memorize the new link state. */
- cdc_ecm -> ux_host_class_cdc_ecm_link_state = UX_HOST_CLASS_CDC_ECM_LINK_STATE_PENDING_UP;
-
+ cdc_ecm -> ux_host_class_cdc_ecm_link_state = UX_HOST_CLASS_CDC_ECM_LINK_STATE_PENDING_UP;
+
/* We need to inform the cdc_ecm thread of this change. */
_ux_host_semaphore_put(&cdc_ecm -> ux_host_class_cdc_ecm_interrupt_notification_semaphore);
}
@@ -131,7 +118,7 @@ ULONG notification_value;
{
/* Link is down. See if we know about that. */
- if (cdc_ecm -> ux_host_class_cdc_ecm_link_state != UX_HOST_CLASS_CDC_ECM_LINK_STATE_DOWN &&
+ if (cdc_ecm -> ux_host_class_cdc_ecm_link_state != UX_HOST_CLASS_CDC_ECM_LINK_STATE_DOWN &&
cdc_ecm -> ux_host_class_cdc_ecm_link_state != UX_HOST_CLASS_CDC_ECM_LINK_STATE_PENDING_DOWN)
{
@@ -141,7 +128,7 @@ ULONG notification_value;
cdc_ecm -> ux_host_class_cdc_ecm_link_state = UX_HOST_CLASS_CDC_ECM_LINK_STATE_PENDING_DOWN;
/* Now abort all transfers. It's possible we're executing right before the transfer
- is armed. If this is the case, then the transfer will not be aborted if we do the abort right now; instead,
+ is armed. If this is the case, then the transfer will not be aborted if we do the abort right now; instead,
we should wait until after the transfer is armed. We must look at the CDC-ECM thread's state. */
/* Is it in the process of checking the link state and arming the transfer? */
@@ -166,8 +153,8 @@ ULONG notification_value;
/* We need to inform the CDC-ECM thread of this change. */
_ux_host_semaphore_put(&cdc_ecm -> ux_host_class_cdc_ecm_interrupt_notification_semaphore);
}
- }
- }
+ }
+ }
/* Reactivate the CDC_ECM interrupt pipe. */
_ux_host_stack_transfer_request(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 c934197a..1a353e71 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
@@ -1,18 +1,19 @@
/***************************************************************************
- * Copyright (c) 2024 Microsoft Corporation
- *
+ * Copyright (c) 2024 Microsoft Corporation
+ * Copyright (c) 2026-present Eclipse ThreadX contributors
+ *
* This program and the accompanying materials are made available under the
* terms of the MIT License which is available at
* https://opensource.org/licenses/MIT.
- *
+ *
* SPDX-License-Identifier: MIT
**************************************************************************/
/**************************************************************************/
/**************************************************************************/
-/** */
-/** USBX Component */
+/** */
+/** USBX Component */
/** */
/** CDC ECM Class */
/** */
@@ -29,53 +30,39 @@
#include "ux_host_stack.h"
-/**************************************************************************/
-/* */
-/* FUNCTION RELEASE */
-/* */
-/* _ux_host_class_cdc_ecm_mac_address_get PORTABLE C */
+/**************************************************************************/
+/* */
+/* FUNCTION RELEASE */
+/* */
+/* _ux_host_class_cdc_ecm_mac_address_get PORTABLE C */
/* 6.2.0 */
/* AUTHOR */
/* */
/* Chaoqiong Xiao, Microsoft Corporation */
/* */
/* DESCRIPTION */
-/* */
+/* */
/* This function calls the USBX stack to retrieve the MAC address from */
-/* the configuration descriptor. */
-/* */
-/* INPUT */
-/* */
-/* cdc_ecm Pointer to cdc_ecm class */
-/* */
-/* OUTPUT */
-/* */
-/* Completion Status */
-/* */
-/* CALLS */
-/* */
+/* the configuration descriptor. */
+/* */
+/* INPUT */
+/* */
+/* cdc_ecm Pointer to cdc_ecm class */
+/* */
+/* OUTPUT */
+/* */
+/* Completion Status */
+/* */
+/* CALLS */
+/* */
/* _ux_host_stack_transfer_request Transfer request */
/* _ux_utility_memory_allocate Allocate memory */
/* _ux_utility_memory_free Free memory */
/* _ux_utility_descriptor_parse Parse descriptors */
-/* */
-/* CALLED BY */
-/* */
-/* _ux_host_class_cdc_ecm_activate CDC ECM class activate */
-/* */
-/* RELEASE HISTORY */
-/* */
-/* DATE NAME DESCRIPTION */
-/* */
-/* 05-19-2020 Chaoqiong Xiao Initial Version 6.0 */
-/* 09-30-2020 Chaoqiong Xiao Modified comment(s), */
-/* resulting in version 6.1 */
-/* 07-29-2022 Chaoqiong Xiao Modified comment(s), */
-/* checked MAC string length, */
-/* resulting in version 6.1.12 */
-/* 10-31-2022 Chaoqiong Xiao Modified comment(s), */
-/* checked descriptor length, */
-/* resulting in version 6.2.0 */
+/* */
+/* CALLED BY */
+/* */
+/* _ux_host_class_cdc_ecm_activate CDC ECM class activate */
/* */
/**************************************************************************/
UINT _ux_host_class_cdc_ecm_mac_address_get(UX_HOST_CLASS_CDC_ECM *cdc_ecm)
@@ -90,9 +77,9 @@ UCHAR *start_descriptor = UX_NULL;
ULONG configuration_index;
ULONG total_configuration_length;
UINT descriptor_length;
-UINT descriptor_type;
-UINT descriptor_subtype;
-UX_HOST_CLASS_ECM_INTERFACE_DESCRIPTOR ecm_interface_descriptor;
+UINT descriptor_type;
+UINT descriptor_subtype;
+UX_HOST_CLASS_ECM_INTERFACE_DESCRIPTOR ecm_interface_descriptor;
UCHAR *mac_address_string;
ULONG string_index;
ULONG string_length;
@@ -101,22 +88,22 @@ UCHAR element_hexa_upper;
UCHAR element_hexa_lower;
/* We now need to retrieve the MAC address of the node which is embedded in the ECM descriptor.
- We will parse the entire configuration descriptor of the device and look for the ECM Ethernet Networking Functional Descriptor. */
+ We will parse the entire configuration descriptor of the device and look for the ECM Ethernet Networking Functional Descriptor. */
configuration_index = (ULONG)cdc_ecm -> ux_host_class_cdc_ecm_interface_data -> ux_interface_configuration -> ux_configuration_descriptor.bConfigurationValue -1;
-
+
/* We need to get the default control endpoint transfer request pointer. */
control_endpoint = &cdc_ecm -> ux_host_class_cdc_ecm_device -> ux_device_control_endpoint;
transfer_request = &control_endpoint -> ux_endpoint_transfer_request;
-
- /* Need to allocate memory for the descriptor. Since we do not know the size of the
+
+ /* Need to allocate memory for the descriptor. Since we do not know the size of the
descriptor, we first read the first bytes. */
descriptor = _ux_utility_memory_allocate(UX_SAFE_ALIGN, UX_CACHE_SAFE_MEMORY, UX_CONFIGURATION_DESCRIPTOR_LENGTH);
if (descriptor == UX_NULL)
return(UX_MEMORY_INSUFFICIENT);
-
+
/* Memorize the descriptor start address. */
start_descriptor = descriptor;
-
+
/* Create a transfer request for the GET_DESCRIPTOR request. */
transfer_request -> ux_transfer_request_data_pointer = descriptor;
transfer_request -> ux_transfer_request_requested_length = UX_CONFIGURATION_DESCRIPTOR_LENGTH;
@@ -127,45 +114,45 @@ UCHAR element_hexa_lower;
/* Send request to HCD layer. */
status = _ux_host_stack_transfer_request(transfer_request);
-
+
/* Check for correct transfer and entire descriptor returned. */
if ((status == UX_SUCCESS) && (transfer_request -> ux_transfer_request_actual_length == UX_CONFIGURATION_DESCRIPTOR_LENGTH))
{
-
+
/* Parse the descriptor so that we can read the total length. */
_ux_utility_descriptor_parse(descriptor, _ux_system_configuration_descriptor_structure,
UX_CONFIGURATION_DESCRIPTOR_ENTRIES, (UCHAR *) &configuration_descriptor);
-
+
/* We don't need this descriptor now. */
_ux_utility_memory_free(descriptor);
-
+
/* Reallocate the memory necessary for the reading the entire descriptor. */
total_configuration_length = configuration_descriptor.wTotalLength;
descriptor = _ux_utility_memory_allocate(UX_SAFE_ALIGN, UX_CACHE_SAFE_MEMORY, total_configuration_length);
if (descriptor == UX_NULL)
return(UX_MEMORY_INSUFFICIENT);
-
+
/* Save this descriptor address. */
start_descriptor = descriptor;
-
- /* Read the descriptor again with the correct length this time. */
+
+ /* Read the descriptor again with the correct length this time. */
transfer_request -> ux_transfer_request_requested_length = total_configuration_length;
-
+
/* Since the address of the descriptor may have changed, reprogram it. */
transfer_request -> ux_transfer_request_data_pointer = descriptor;
-
+
/* Send request to HCD layer. */
status = _ux_host_stack_transfer_request(transfer_request);
-
+
/* Check for correct transfer and entire descriptor returned. */
if ((status == UX_SUCCESS) && (transfer_request -> ux_transfer_request_actual_length == configuration_descriptor.wTotalLength))
{
-
- /* The ECM descriptor is embedded within the configuration descriptor. We parse the
+
+ /* The ECM descriptor is embedded within the configuration descriptor. We parse the
entire descriptor to locate the ECM functional descriptor portion. */
while (total_configuration_length)
{
-
+
/* Gather the length and type of the descriptor. */
descriptor_length = *descriptor;
descriptor_type = *(descriptor + 1);
@@ -184,31 +171,31 @@ UCHAR element_hexa_lower;
/* Return error. */
return(UX_DESCRIPTOR_CORRUPTED);
}
-
+
/* Check the type for an interface descriptor and the subtype for a ECM functional descriptor. */
if ((descriptor_type == UX_HOST_CLASS_CDC_ECM_CS_INTERFACE) && (descriptor_subtype == UX_HOST_CLASS_CDC_ECM_FUNCTIONAL_DESCRIPTOR))
{
-
+
/* Parse the interface descriptor and make it machine independent. */
_ux_utility_descriptor_parse(descriptor,
_ux_system_ecm_interface_descriptor_structure,
UX_HOST_CLASS_CDC_ECM_INTERFACE_DESCRIPTOR_ENTRIES,
(UCHAR *) &ecm_interface_descriptor);
-
-
+
+
/* Release the memory. */
_ux_utility_memory_free(start_descriptor);
-
+
/* We now have the ECM functional descriptor in memory. We can retrieve the index of the iMACAddress
which we need for NetX. */
/* Allocate memory for the MAC address. */
mac_address_string = _ux_utility_memory_allocate(UX_SAFE_ALIGN, UX_CACHE_SAFE_MEMORY, UX_HOST_CLASS_CDC_ECM_MAC_ADDRESS_STRING_LENGTH);
-
+
/* Check memory allocation. */
if (mac_address_string == UX_NULL)
return(UX_MEMORY_INSUFFICIENT);
-
+
/* Create a transfer request for the GET_DESCRIPTOR request. */
transfer_request -> ux_transfer_request_data_pointer = mac_address_string;
transfer_request -> ux_transfer_request_requested_length = UX_HOST_CLASS_CDC_ECM_MAC_ADDRESS_STRING_LENGTH;
@@ -216,10 +203,10 @@ UCHAR element_hexa_lower;
transfer_request -> ux_transfer_request_type = UX_REQUEST_IN | UX_REQUEST_TYPE_STANDARD | UX_REQUEST_TARGET_DEVICE;
transfer_request -> ux_transfer_request_value = (UX_STRING_DESCRIPTOR_ITEM << 8) | ecm_interface_descriptor.iMACAddress;
transfer_request -> ux_transfer_request_index = 0x0409;
-
+
/* Send request to HCD layer. */
status = _ux_host_stack_transfer_request(transfer_request);
-
+
/* Check for correct transfer. */
if (status == UX_SUCCESS)
{
@@ -241,78 +228,78 @@ UCHAR element_hexa_lower;
}
else
{
-
+
/* No error in length, decode the string. */
string_length -=2;
string_length = string_length / 2;
-
- /* Now we have a string of 12 hex ASCII digits to be translated into 6 hex digit bytes.
+
+ /* Now we have a string of 12 hex ASCII digits to be translated into 6 hex digit bytes.
and copy into the node ID. */
for (string_index = 0; string_index < string_length; string_index++)
{
-
+
/* Get the upper element from the ASCII string. */
element_content = *(mac_address_string + (string_index * 2) + 2);
-
+
/* We have a valid element content. Turn it into a hex decimal value. Note
that only hex digits are allowed. */
if (element_content <= '9')
-
+
/* We have a digit. */
element_hexa_upper = (UCHAR)(element_content - '0');
-
+
else
- {
+ {
/* We have a 'A' to 'F' or 'a' to 'f' value. */
- if (element_content >= 'a')
-
+ if (element_content >= 'a')
+
/* We have a 'a' to 'f' char. */
element_hexa_upper = (UCHAR)(element_content - 'a' + 10);
-
- else
-
+
+ else
+
/* We have a 'A' to 'F' char. */
element_hexa_upper = (UCHAR)(element_content - 'A' + 10);
-
+
}
-
+
/* Get the lower element from the ASCII string. */
element_content = *(mac_address_string + ((string_index + 1) * 2) + 2);
-
+
/* We have a valid element content. Turn it into a hexa decimal value. Note
that only hex digits are allowed. */
if (element_content <= '9')
-
+
/* We have a digit. */
element_hexa_lower = (UCHAR)(element_content - '0');
-
+
else
- {
+ {
/* We have a 'A' to 'F' or 'a' to 'f' value. */
if (element_content >= 'a')
-
+
/* We have a 'a' to 'f' char. */
element_hexa_lower = (UCHAR)(element_content - 'a' + 10);
-
- else
-
+
+ else
+
/* We have a 'A' to 'F' char. */
element_hexa_lower = (UCHAR)(element_content - 'A' + 10);
-
- }
-
+
+ }
+
/* Assemble the byte from the 2 nibbles and store it into the node_id. */
*(cdc_ecm -> ux_host_class_cdc_ecm_node_id + string_index / 2) = (UCHAR)(element_hexa_upper << 4 | element_hexa_lower);
-
+
/* Skip the lower nibble. */
string_index ++;
-
+
}
-
+
/* Operation was successful ! */
status = UX_SUCCESS;
}
- }
+ }
else
{
@@ -331,14 +318,14 @@ UCHAR element_hexa_lower;
/* 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_configuration_length -= descriptor_length;
}
}
- }
+ }
}
-
+
/* Error trap. */
_ux_system_error_handler(UX_SYSTEM_LEVEL_THREAD, UX_SYSTEM_CONTEXT_CLASS, UX_DESCRIPTOR_CORRUPTED);
@@ -350,5 +337,5 @@ UCHAR element_hexa_lower;
/* Return an error. */
return(UX_DESCRIPTOR_CORRUPTED);
-
-}
+
+}
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 88d0a4c4..454349b8 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
@@ -1,5 +1,6 @@
/***************************************************************************
* Copyright (c) 2024 Microsoft Corporation
+ * Copyright (c) 2026-present Eclipse ThreadX contributors
*
* This program and the accompanying materials are made available under the
* terms of the MIT License which is available at
@@ -72,33 +73,6 @@
/* */
/* CDC ECM class initialization */
/* */
-/* RELEASE HISTORY */
-/* */
-/* 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 */
-/* 02-02-2021 Xiuwen Cai Modified comment(s), added */
-/* compile option for using */
-/* packet pool from NetX, */
-/* resulting in version 6.1.4 */
-/* 01-31-2022 Chaoqiong Xiao Modified comment(s), */
-/* refined macros names, */
-/* resulting in version 6.1.10 */
-/* 04-25-2022 Chaoqiong Xiao Modified comment(s), */
-/* fixed standalone compile, */
-/* resulting in version 6.1.11 */
-/* 10-31-2022 Chaoqiong Xiao Modified comment(s), */
-/* no length from IP header, */
-/* deprecated ECM pool option, */
-/* supported NX packet chain, */
-/* resulting in version 6.2.0 */
-/* */
/**************************************************************************/
VOID _ux_host_class_cdc_ecm_thread(ULONG parameter)
{
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 a50c7c79..43693a51 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
@@ -1,18 +1,19 @@
/***************************************************************************
- * Copyright (c) 2024 Microsoft Corporation
- *
+ * Copyright (c) 2024 Microsoft Corporation
+ * Copyright (c) 2026-present Eclipse ThreadX contributors
+ *
* This program and the accompanying materials are made available under the
* terms of the MIT License which is available at
* https://opensource.org/licenses/MIT.
- *
+ *
* SPDX-License-Identifier: MIT
**************************************************************************/
/**************************************************************************/
/**************************************************************************/
-/** */
-/** USBX Component */
+/** */
+/** USBX Component */
/** */
/** CDC-ECM Class */
/** */
@@ -29,59 +30,38 @@
#include "ux_host_stack.h"
-/**************************************************************************/
-/* */
-/* FUNCTION RELEASE */
-/* */
-/* _ux_host_class_cdc_ecm_transmission_callback PORTABLE C */
+/**************************************************************************/
+/* */
+/* FUNCTION RELEASE */
+/* */
+/* _ux_host_class_cdc_ecm_transmission_callback PORTABLE C */
/* 6.2.0 */
/* AUTHOR */
/* */
/* Chaoqiong Xiao, Microsoft Corporation */
/* */
/* DESCRIPTION */
-/* */
-/* This function is the callback from the USBX transfer functions, */
-/* it is called when a full or partial transfer has been done for a */
+/* */
+/* This function is the callback from the USBX transfer functions, */
+/* it is called when a full or partial transfer has been done for a */
/* bulk out transfer. */
/* */
-/* INPUT */
-/* */
-/* transfer_request Pointer to transfer request */
-/* */
-/* OUTPUT */
-/* */
-/* None */
-/* */
-/* CALLS */
-/* */
-/* _ux_host_stack_transfer_request Process transfer request */
+/* INPUT */
+/* */
+/* transfer_request Pointer to transfer request */
+/* */
+/* OUTPUT */
+/* */
+/* None */
+/* */
+/* CALLS */
+/* */
+/* _ux_host_stack_transfer_request Process transfer request */
/* nx_packet_transmit_release Release NetX packet */
-/* */
-/* 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), */
-/* resulting in version 6.1 */
-/* 02-02-2021 Chaoqiong Xiao Modified comment(s), fixed */
-/* ZLP issue for transmission, */
-/* resulting in version 6.1.4 */
-/* 10-15-2021 Chaoqiong Xiao Modified comment(s), */
-/* use pre-calculated value */
-/* instead of wMaxPacketSize, */
-/* resulting in version 6.1.9 */
-/* 04-25-2022 Chaoqiong Xiao Modified comment(s), */
-/* fixed standalone compile, */
-/* resulting in version 6.1.11 */
-/* 10-31-2022 Chaoqiong Xiao Modified comment(s), */
-/* supported NX packet chain, */
-/* resulting in version 6.2.0 */
+/* */
+/* CALLED BY */
+/* */
+/* Application */
/* */
/**************************************************************************/
VOID _ux_host_class_cdc_ecm_transmission_callback(UX_TRANSFER *transfer_request)
@@ -97,7 +77,7 @@ UCHAR *packet_header;
#ifdef UX_HOST_CLASS_CDC_ECM_PACKET_CHAIN_SUPPORT
ULONG copied;
#endif
-
+
/* Get the data and control class instances for this transfer request. */
cdc_ecm = (UX_HOST_CLASS_CDC_ECM *) transfer_request -> ux_transfer_request_class_instance;
@@ -105,23 +85,23 @@ ULONG copied;
if (cdc_ecm -> ux_host_class_cdc_ecm_link_state != UX_HOST_CLASS_CDC_ECM_LINK_STATE_UP ||
cdc_ecm -> ux_host_class_cdc_ecm_state == UX_HOST_CLASS_INSTANCE_SHUTDOWN)
- /* The CDC-ECM thread or deactivation routine is in the process of freeing
+ /* The CDC-ECM thread or deactivation routine is in the process of freeing
the queue. Just return so we are not simultaneously accessing it. */
return;
/* Get the packet associated with this transfer. */
current_packet = cdc_ecm -> ux_host_class_cdc_ecm_xmit_queue_head;
-
+
/* Do a sanity check on the packet. */
if (current_packet == UX_NULL)
{
-
+
/* Error trap. */
_ux_system_error_handler(UX_SYSTEM_LEVEL_THREAD, UX_SYSTEM_CONTEXT_CLASS, UX_FATAL_ERROR);
/* If trace is enabled, insert this event into the trace buffer. */
UX_TRACE_IN_LINE_INSERT(UX_TRACE_ERROR, UX_INTERFACE_HANDLE_UNKNOWN, cdc_ecm, 0, 0, UX_FATAL_ERROR, 0, 0)
-
+
/* Something went terribly wrong. Do not proceed. */
return;
}
@@ -150,7 +130,7 @@ ULONG copied;
/* Set the next packet (or a NULL value) as the head of the xmit queue. */
cdc_ecm -> ux_host_class_cdc_ecm_xmit_queue_head = next_packet;
-
+
/* If there is nothing else or if the link is down no need to rearm a packet. */
if (next_packet != UX_NULL)
{
@@ -171,17 +151,17 @@ ULONG copied;
/* Load the address of the current packet header at the physical header. */
packet_header = next_packet -> nx_packet_prepend_ptr;
}
-
+
/* Prepare the values for this new transmission. */
transfer_request -> ux_transfer_request_data_pointer = packet_header;
transfer_request -> ux_transfer_request_requested_length = next_packet -> nx_packet_length;
-
+
/* Store the packet that owns this transaction. */
transfer_request -> ux_transfer_request_user_specific = next_packet;
/* If error log is enabled, insert this message into the log buffer. */
- UX_DEBUG_LOG("_ux_host_class_cdc_ecm_transmission_callback", "Sending packet", next_packet, next_packet, _ux_system -> ux_system_mutex.tx_mutex_suspended_count)
-
+ UX_DEBUG_LOG("_ux_host_class_cdc_ecm_transmission_callback", "Sending packet", next_packet, next_packet, _ux_system_mutex_suspended_count(&_ux_system -> ux_system_mutex))
+
/* If there is an error, the system will hang up. Not much we can do to
fix this. */
_ux_host_stack_transfer_request(transfer_request);
@@ -189,13 +169,13 @@ ULONG copied;
/* If error log is enabled, insert this message into the log buffer. */
UX_DEBUG_LOG("_ux_host_class_cdc_ecm_transmission_callback", "Freeing transmitted packet", 0, transfer_request, current_packet)
-
+
/* Free the packet that was just sent. First do some housekeeping. */
- current_packet -> nx_packet_prepend_ptr = current_packet -> nx_packet_prepend_ptr + UX_HOST_CLASS_CDC_ECM_ETHERNET_SIZE;
+ current_packet -> nx_packet_prepend_ptr = current_packet -> nx_packet_prepend_ptr + UX_HOST_CLASS_CDC_ECM_ETHERNET_SIZE;
current_packet -> nx_packet_length = current_packet -> nx_packet_length - UX_HOST_CLASS_CDC_ECM_ETHERNET_SIZE;
/* And ask Netx to release it. */
- nx_packet_transmit_release(current_packet);
+ nx_packet_transmit_release(current_packet);
}
else
{
@@ -207,6 +187,6 @@ ULONG copied;
}
/* There is no status to be reported back to the stack. */
- return;
+ return;
#endif
}
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 e6aa42d1..5f53f36d 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
@@ -1,18 +1,19 @@
/***************************************************************************
- * Copyright (c) 2024 Microsoft Corporation
- *
+ * Copyright (c) 2024 Microsoft Corporation
+ * Copyright (c) 2026-present Eclipse ThreadX contributors
+ *
* This program and the accompanying materials are made available under the
* terms of the MIT License which is available at
* https://opensource.org/licenses/MIT.
- *
+ *
* SPDX-License-Identifier: MIT
**************************************************************************/
/**************************************************************************/
/**************************************************************************/
-/** */
-/** USBX Component */
+/** */
+/** USBX Component */
/** */
/** CDC_ECM Class */
/** */
@@ -30,54 +31,37 @@
#if !defined(UX_HOST_STANDALONE)
-/**************************************************************************/
-/* */
-/* FUNCTION RELEASE */
-/* */
-/* _ux_host_class_cdc_ecm_transmit_queue_clean PORTABLE C */
+/**************************************************************************/
+/* */
+/* FUNCTION RELEASE */
+/* */
+/* _ux_host_class_cdc_ecm_transmit_queue_clean PORTABLE C */
/* 6.1.11 */
/* AUTHOR */
/* */
/* Chaoqiong Xiao, Microsoft Corporation */
/* */
/* DESCRIPTION */
-/* */
-/* This function cleans the transmit queue. */
-/* */
-/* INPUT */
-/* */
-/* cdc_ecm CDC ECM instance */
-/* */
-/* OUTPUT */
-/* */
-/* No return value */
-/* */
-/* CALLS */
-/* */
-/* _ux_host_semaphore_get Get bulk out semaphore */
-/* _ux_host_stack_endpoint_transfer_abort Abort endpoint transfer */
-/* nx_packet_transmit_release Release NetX packet */
-/* */
-/* CALLED BY */
-/* */
-/* CDC ECM thread and deactivation */
-/* */
-/* RELEASE HISTORY */
-/* */
-/* 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 */
-/* 01-31-2022 Chaoqiong Xiao Modified comment(s), */
-/* refined macros names, */
-/* resulting in version 6.1.10 */
-/* 04-25-2022 Chaoqiong Xiao Modified comment(s), */
-/* fixed standalone compile, */
-/* resulting in version 6.1.11 */
+/* */
+/* This function cleans the transmit queue. */
+/* */
+/* INPUT */
+/* */
+/* cdc_ecm CDC ECM instance */
+/* */
+/* OUTPUT */
+/* */
+/* No return value */
+/* */
+/* CALLS */
+/* */
+/* _ux_host_semaphore_get Get bulk out semaphore */
+/* _ux_host_stack_endpoint_transfer_abort Abort endpoint transfer */
+/* nx_packet_transmit_release Release NetX packet */
+/* */
+/* CALLED BY */
+/* */
+/* CDC ECM thread and deactivation */
/* */
/**************************************************************************/
VOID _ux_host_class_cdc_ecm_transmit_queue_clean(UX_HOST_CLASS_CDC_ECM *cdc_ecm)
@@ -131,13 +115,13 @@ NX_PACKET *next_packet;
while (current_packet != UX_NULL)
{
- /* We must get the next packet before releasing the current packet
- because nxe_packet_transmit_release sets the pointer we pass
+ /* We must get the next packet before releasing the current packet
+ because nxe_packet_transmit_release sets the pointer we pass
to null. */
next_packet = current_packet -> nx_packet_queue_next;
/* Free the packet. First do some housekeeping. */
- current_packet -> nx_packet_prepend_ptr = current_packet -> nx_packet_prepend_ptr + UX_HOST_CLASS_CDC_ECM_ETHERNET_SIZE;
+ current_packet -> nx_packet_prepend_ptr = current_packet -> nx_packet_prepend_ptr + UX_HOST_CLASS_CDC_ECM_ETHERNET_SIZE;
current_packet -> nx_packet_length = current_packet -> nx_packet_length - UX_HOST_CLASS_CDC_ECM_ETHERNET_SIZE;
/* And ask Netx to release it. */
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 4bb9179b..443e23c3 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
@@ -1,18 +1,19 @@
/***************************************************************************
- * Copyright (c) 2024 Microsoft Corporation
- *
+ * Copyright (c) 2024 Microsoft Corporation
+ * Copyright (c) 2026-present Eclipse ThreadX contributors
+ *
* This program and the accompanying materials are made available under the
* terms of the MIT License which is available at
* https://opensource.org/licenses/MIT.
- *
+ *
* SPDX-License-Identifier: MIT
**************************************************************************/
/**************************************************************************/
/**************************************************************************/
-/** */
-/** USBX Component */
+/** */
+/** USBX Component */
/** */
/** CDC ECM Class */
/** */
@@ -30,59 +31,39 @@
#if !defined(UX_HOST_STANDALONE)
-/**************************************************************************/
-/* */
-/* FUNCTION RELEASE */
-/* */
-/* _ux_host_class_cdc_ecm_write PORTABLE C */
+/**************************************************************************/
+/* */
+/* FUNCTION RELEASE */
+/* */
+/* _ux_host_class_cdc_ecm_write PORTABLE C */
/* 6.2.0 */
/* AUTHOR */
/* */
/* Chaoqiong Xiao, Microsoft Corporation */
/* */
/* DESCRIPTION */
-/* */
-/* This function writes to the cdc_ecm interface. The call is */
+/* */
+/* This function writes to the cdc_ecm interface. The call is */
/* non-blocking and queues the packet if there is an on-going write. */
-/* */
-/* INPUT */
-/* */
-/* cdc_ecm Pointer to cdc_ecm class */
-/* packet Packet to write or queue */
-/* */
-/* OUTPUT */
-/* */
-/* Completion Status */
-/* */
-/* CALLS */
-/* */
-/* _ux_host_stack_transfer_request Process transfer request */
-/* _ux_host_semaphore_put Release protection semaphore */
+/* */
+/* INPUT */
+/* */
+/* cdc_ecm Pointer to cdc_ecm class */
+/* packet Packet to write or queue */
+/* */
+/* OUTPUT */
+/* */
+/* Completion Status */
+/* */
+/* CALLS */
+/* */
+/* _ux_host_stack_transfer_request Process transfer request */
+/* _ux_host_semaphore_put Release protection semaphore */
/* nx_packet_transmit_release Release NetX packet */
-/* */
-/* 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), */
-/* used UX prefix to refer to */
-/* TX symbols instead of using */
-/* them directly, */
-/* resulting in version 6.1 */
-/* 01-31-2022 Chaoqiong Xiao Modified comment(s), */
-/* refined macros names, */
-/* resulting in version 6.1.10 */
-/* 04-25-2022 Chaoqiong Xiao Modified comment(s), */
-/* fixed standalone compile, */
-/* resulting in version 6.1.11 */
-/* 10-31-2022 Chaoqiong Xiao Modified comment(s), */
-/* supported NX packet chain, */
-/* resulting in version 6.2.0 */
+/* */
+/* CALLED BY */
+/* */
+/* Application */
/* */
/**************************************************************************/
UINT _ux_host_class_cdc_ecm_write(VOID *cdc_ecm_class, NX_PACKET *packet)
@@ -115,7 +96,7 @@ ULONG copied;
/* Ensure the instance is valid. */
if (cdc_ecm -> ux_host_class_cdc_ecm_state != UX_HOST_CLASS_INSTANCE_LIVE)
- {
+ {
/* Restore interrupts. */
UX_RESTORE
@@ -152,10 +133,10 @@ ULONG copied;
/* Check the queue. See if there is something that is being sent. */
if (cdc_ecm -> ux_host_class_cdc_ecm_xmit_queue_head == UX_NULL)
{
-
+
/* Reset the queue pointer of this packet. */
packet -> nx_packet_queue_next = UX_NULL;
-
+
/* Memorize this packet at the beginning of the queue. */
cdc_ecm -> ux_host_class_cdc_ecm_xmit_queue_head = packet;
cdc_ecm -> ux_host_class_cdc_ecm_xmit_queue_tail = packet;
@@ -201,7 +182,7 @@ ULONG copied;
/* Setup the transaction parameters. */
transfer_request -> ux_transfer_request_data_pointer = packet_header;
transfer_request -> ux_transfer_request_requested_length = packet -> nx_packet_length;
-
+
/* Store the packet that owns this transaction. */
transfer_request -> ux_transfer_request_user_specific = packet;
@@ -217,12 +198,12 @@ ULONG copied;
/* We cleared the queue, so we must free the packet. First
we need to clean it before passing it to NetX. */
- packet -> nx_packet_prepend_ptr = packet -> nx_packet_prepend_ptr + UX_HOST_CLASS_CDC_ECM_ETHERNET_SIZE;
+ packet -> nx_packet_prepend_ptr = packet -> nx_packet_prepend_ptr + UX_HOST_CLASS_CDC_ECM_ETHERNET_SIZE;
packet -> nx_packet_length = packet -> nx_packet_length - UX_HOST_CLASS_CDC_ECM_ETHERNET_SIZE;
/* And ask Netx to release it. */
nx_packet_transmit_release(packet);
-
+
/* Could not arm this transfer. */
status = UX_ERROR;
}
@@ -255,7 +236,7 @@ ULONG copied;
UX_RESTORE
/* Release the packet. */
- packet -> nx_packet_prepend_ptr = packet -> nx_packet_prepend_ptr + UX_HOST_CLASS_CDC_ECM_ETHERNET_SIZE;
+ packet -> nx_packet_prepend_ptr = packet -> nx_packet_prepend_ptr + UX_HOST_CLASS_CDC_ECM_ETHERNET_SIZE;
packet -> nx_packet_length = packet -> nx_packet_length - UX_HOST_CLASS_CDC_ECM_ETHERNET_SIZE;
nx_packet_transmit_release(packet);
@@ -272,6 +253,6 @@ ULONG copied;
_ux_host_semaphore_put(&cdc_ecm -> ux_host_class_cdc_ecm_bulk_out_transfer_waiting_for_check_and_arm_to_finish_semaphore);
/* We are done here. */
- return(status);
+ return(status);
}
#endif
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 a5304075..05b77b09 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
@@ -1,18 +1,19 @@
/***************************************************************************
- * Copyright (c) 2024 Microsoft Corporation
- *
+ * Copyright (c) 2024 Microsoft Corporation
+ * Copyright (c) 2026-present Eclipse ThreadX contributors
+ *
* This program and the accompanying materials are made available under the
* terms of the MIT License which is available at
* https://opensource.org/licenses/MIT.
- *
+ *
* SPDX-License-Identifier: MIT
**************************************************************************/
/**************************************************************************/
/**************************************************************************/
-/** */
-/** USBX Component */
+/** */
+/** USBX Component */
/** */
/** Generic Serial Host module class */
/** */
@@ -29,54 +30,40 @@
#include "ux_host_stack.h"
-/**************************************************************************/
-/* */
-/* FUNCTION RELEASE */
-/* */
-/* _ux_host_class_gser_activate PORTABLE C */
+/**************************************************************************/
+/* */
+/* FUNCTION RELEASE */
+/* */
+/* _ux_host_class_gser_activate PORTABLE C */
/* 6.3.0 */
/* AUTHOR */
/* */
/* Chaoqiong Xiao, Microsoft Corporation */
/* */
/* DESCRIPTION */
-/* */
-/* This function calls the USBX stack to activate the class. */
-/* */
-/* INPUT */
-/* */
-/* command Dpump class command pointer */
-/* */
-/* OUTPUT */
-/* */
-/* Completion Status */
-/* */
-/* CALLS */
-/* */
-/* _ux_host_class_gser_configure Configure gser class */
-/* _ux_host_class_gser_endpoints_get Get endpoints of gser */
-/* _ux_host_stack_class_instance_create Create class instance */
-/* _ux_host_stack_class_instance_destroy Destroy the class instance */
-/* _ux_utility_memory_allocate Allocate memory block */
-/* _ux_utility_memory_free Free memory block */
-/* */
-/* CALLED BY */
-/* */
-/* _ux_host_class_gser_entry Entry of gser class */
-/* */
-/* RELEASE HISTORY */
-/* */
-/* DATE NAME DESCRIPTION */
-/* */
-/* 05-19-2020 Chaoqiong Xiao Initial Version 6.0 */
-/* 09-30-2020 Chaoqiong Xiao Modified comment(s), */
-/* resulting in version 6.1 */
-/* 04-25-2022 Chaoqiong Xiao Modified comment(s), */
-/* internal clean up, */
-/* resulting in version 6.1.11 */
-/* 10-31-2023 Chaoqiong Xiao Modified comment(s), */
-/* improved error handling, */
-/* resulting in version 6.3.0 */
+/* */
+/* This function calls the USBX stack to activate the class. */
+/* */
+/* INPUT */
+/* */
+/* command Dpump class command pointer */
+/* */
+/* OUTPUT */
+/* */
+/* Completion Status */
+/* */
+/* CALLS */
+/* */
+/* _ux_host_class_gser_configure Configure gser class */
+/* _ux_host_class_gser_endpoints_get Get endpoints of gser */
+/* _ux_host_stack_class_instance_create Create class instance */
+/* _ux_host_stack_class_instance_destroy Destroy the class instance */
+/* _ux_utility_memory_allocate Allocate memory block */
+/* _ux_utility_memory_free Free memory block */
+/* */
+/* CALLED BY */
+/* */
+/* _ux_host_class_gser_entry Entry of gser class */
/* */
/**************************************************************************/
UINT _ux_host_class_gser_activate(UX_HOST_CLASS_COMMAND *command)
@@ -101,9 +88,9 @@ ULONG interface_index;
/* Store the device container into the gser class instance. */
gser -> ux_host_class_gser_device = device;
-
+
/* Store the instance in the device container, this is for the USBX stack
- when it needs to invoke the class for deactivation. */
+ when it needs to invoke the class for deactivation. */
device -> ux_device_class_instance = (VOID *) gser;
/* Create this class instance. */
@@ -127,14 +114,14 @@ ULONG interface_index;
if a function has been programmed in the system structure. */
if (_ux_system_host -> ux_system_host_change_function != UX_NULL)
{
-
+
/* Call system change function. */
_ux_system_host -> ux_system_host_change_function(UX_DEVICE_INSERTION, gser -> ux_host_class_gser_class, (VOID *) gser);
}
/* If trace is enabled, insert this event into the trace buffer. */
UX_TRACE_IN_LINE_INSERT(UX_TRACE_HOST_CLASS_GSER_ACTIVATE, gser, 0, 0, 0, UX_TRACE_HOST_CLASS_EVENTS, 0, 0)
-
+
/* If trace is enabled, register this object. */
UX_TRACE_OBJECT_REGISTER(UX_TRACE_HOST_OBJECT_TYPE_INTERFACE, gser, 0, 0, 0)
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 c24020f7..204f86ac 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
@@ -1,10 +1,11 @@
/***************************************************************************
- * Copyright (c) 2024 Microsoft Corporation
- *
+ * Copyright (c) 2024 Microsoft Corporation
+ * Copyright (c) 2026-present Eclipse ThreadX contributors
+ *
* This program and the accompanying materials are made available under the
* terms of the MIT License which is available at
* https://opensource.org/licenses/MIT.
- *
+ *
* SPDX-License-Identifier: MIT
**************************************************************************/
@@ -71,19 +72,6 @@
/* */
/* Application */
/* */
-/* RELEASE HISTORY */
-/* */
-/* DATE NAME DESCRIPTION */
-/* */
-/* 05-19-2020 Chaoqiong Xiao Initial Version 6.0 */
-/* 09-30-2020 Chaoqiong Xiao Modified comment(s), */
-/* resulting in version 6.1 */
-/* 01-31-2022 Chaoqiong Xiao Modified comment(s), */
-/* refined macros names, */
-/* resulting in version 6.1.10 */
-/* 10-31-2023 Yajun xia Modified comment(s), */
-/* resulting in version 6.3.0 */
-/* */
/**************************************************************************/
UINT _ux_host_class_gser_command(UX_HOST_CLASS_GSER *gser, ULONG interface_index, ULONG command,
ULONG value, UCHAR *data_buffer, ULONG data_length)
@@ -203,12 +191,6 @@ ULONG request_direction;
/* */
/* Application */
/* */
-/* RELEASE HISTORY */
-/* */
-/* DATE NAME DESCRIPTION */
-/* */
-/* 10-31-2023 Chaoqiong Xiao Initial Version 6.3.0 */
-/* */
/**************************************************************************/
UINT _uxe_host_class_gser_command(UX_HOST_CLASS_GSER *gser, ULONG interface_index, ULONG command,
ULONG value, UCHAR *data_buffer, ULONG data_length)
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 4783d146..5bd26d64 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
@@ -1,18 +1,19 @@
/***************************************************************************
- * Copyright (c) 2024 Microsoft Corporation
- *
+ * Copyright (c) 2024 Microsoft Corporation
+ * Copyright (c) 2026-present Eclipse ThreadX contributors
+ *
* This program and the accompanying materials are made available under the
* terms of the MIT License which is available at
* https://opensource.org/licenses/MIT.
- *
+ *
* SPDX-License-Identifier: MIT
**************************************************************************/
/**************************************************************************/
/**************************************************************************/
-/** */
-/** USBX Component */
+/** */
+/** USBX Component */
/** */
/** Generic Serial Host module class */
/** */
@@ -29,56 +30,40 @@
#include "ux_host_stack.h"
-/**************************************************************************/
-/* */
-/* FUNCTION RELEASE */
-/* */
-/* _ux_host_class_gser_configure PORTABLE C */
+/**************************************************************************/
+/* */
+/* FUNCTION RELEASE */
+/* */
+/* _ux_host_class_gser_configure PORTABLE C */
/* 6.3.0 */
/* AUTHOR */
/* */
/* Chaoqiong Xiao, Microsoft Corporation */
/* */
/* DESCRIPTION */
-/* */
+/* */
/* This function calls the USBX stack to do a SET_CONFIGURATION to the */
-/* gser. Once the gser is configured, its interface will be */
-/* activated. The bulk endpoints enumerated(1 IN, 1 OUT ). */
-/* */
-/* INPUT */
-/* */
-/* gser Pointer to gser class */
-/* */
-/* OUTPUT */
-/* */
-/* Completion Status */
-/* */
-/* CALLS */
-/* */
-/* _ux_host_stack_configuration_interface_get Get interface */
-/* _ux_host_stack_device_configuration_get Get configuration */
-/* _ux_host_stack_device_configuration_select Select configuration */
+/* gser. Once the gser is configured, its interface will be */
+/* activated. The bulk endpoints enumerated(1 IN, 1 OUT ). */
+/* */
+/* INPUT */
+/* */
+/* gser Pointer to gser class */
+/* */
+/* OUTPUT */
+/* */
+/* Completion Status */
+/* */
+/* CALLS */
+/* */
+/* _ux_host_stack_configuration_interface_get Get interface */
+/* _ux_host_stack_device_configuration_get Get configuration */
+/* _ux_host_stack_device_configuration_select Select configuration */
/* _ux_host_semaphore_create Create semaphore */
-/* */
-/* CALLED BY */
-/* */
-/* _ux_host_class_gser_activate gser class activate */
-/* */
-/* 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 */
-/* 01-31-2022 Chaoqiong Xiao Modified comment(s), */
-/* refined macros names, */
-/* resulting in version 6.1.10 */
-/* 10-31-2023 Chaoqiong Xiao Modified comment(s), */
-/* removed interface link, */
-/* resulting in version 6.3.0 */
+/* */
+/* CALLED BY */
+/* */
+/* _ux_host_class_gser_activate gser class activate */
/* */
/**************************************************************************/
UINT _ux_host_class_gser_configure(UX_HOST_CLASS_GSER *gser)
@@ -102,29 +87,29 @@ UX_DEVICE *parent_device;
status = _ux_host_stack_device_configuration_get(gser -> ux_host_class_gser_device, 0, &configuration);
if (status != UX_SUCCESS)
{
-
+
/* Error trap. */
_ux_system_error_handler(UX_SYSTEM_LEVEL_THREAD, UX_SYSTEM_CONTEXT_CLASS, UX_CONFIGURATION_HANDLE_UNKNOWN);
/* If trace is enabled, insert this event into the trace buffer. */
UX_TRACE_IN_LINE_INSERT(UX_TRACE_ERROR, UX_CONFIGURATION_HANDLE_UNKNOWN, gser -> ux_host_class_gser_device, 0, 0, UX_TRACE_ERRORS, 0, 0)
-
+
return(UX_CONFIGURATION_HANDLE_UNKNOWN);
}
#if UX_MAX_DEVICES > 1
- /* Check the gser power source and check the parent power source for
+ /* 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)
{
/* Get parent device pointer. */
parent_device = gser -> ux_host_class_gser_device -> ux_device_parent;
-
- /* If the device is NULL, the parent is the root gser and we don't have to worry
+
+ /* If the device is NULL, the parent is the root gser and we don't have to worry
if the parent is not the root gser, check for its power source. */
if ((parent_device != UX_NULL) && (parent_device -> ux_device_power_source == UX_DEVICE_BUS_POWERED))
- {
+ {
/* Error trap. */
_ux_system_error_handler(UX_SYSTEM_LEVEL_THREAD, UX_SYSTEM_CONTEXT_CLASS, UX_CONFIGURATION_HANDLE_UNKNOWN);
@@ -133,16 +118,16 @@ UX_DEVICE *parent_device;
UX_TRACE_IN_LINE_INSERT(UX_TRACE_ERROR, UX_CONNECTION_INCOMPATIBLE, gser, 0, 0, UX_TRACE_ERRORS, 0, 0)
return(UX_CONNECTION_INCOMPATIBLE);
- }
+ }
}
#endif
- /* We have the valid configuration. Ask the USBX stack to set this configuration. */
+ /* 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)
return(status);
- /* If the operation went well, the gser default alternate setting for the gser interface is
+ /* If the operation went well, the gser default alternate setting for the gser interface is
active. We have to scan all interfaces and attach them. Each interface has an semaphore as well for protection. */
for (interface_index = 0; interface_index < UX_HOST_CLASS_GSER_INTERFACE_NUMBER; interface_index++)
{
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 7984f83a..add0b121 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
@@ -1,18 +1,19 @@
/***************************************************************************
- * Copyright (c) 2024 Microsoft Corporation
- *
+ * Copyright (c) 2024 Microsoft Corporation
+ * Copyright (c) 2026-present Eclipse ThreadX contributors
+ *
* This program and the accompanying materials are made available under the
* terms of the MIT License which is available at
* https://opensource.org/licenses/MIT.
- *
+ *
* SPDX-License-Identifier: MIT
**************************************************************************/
/**************************************************************************/
/**************************************************************************/
-/** */
-/** USBX Component */
+/** */
+/** USBX Component */
/** */
/** Generic Serial Host module class */
/** */
@@ -29,53 +30,42 @@
#include "ux_host_stack.h"
-/**************************************************************************/
-/* */
-/* FUNCTION RELEASE */
-/* */
-/* _ux_host_class_gser_deactivate PORTABLE C */
+/**************************************************************************/
+/* */
+/* FUNCTION RELEASE */
+/* */
+/* _ux_host_class_gser_deactivate PORTABLE C */
/* 6.1.10 */
/* AUTHOR */
/* */
/* Chaoqiong Xiao, Microsoft Corporation */
/* */
/* DESCRIPTION */
-/* */
+/* */
/* This function is called when this instance of the gser has been */
-/* removed from the bus either directly or indirectly. The bulk in\out */
-/* pipes will be destroyed and the instanced removed. */
-/* */
-/* INPUT */
-/* */
-/* command Swar class command pointer */
-/* */
-/* OUTPUT */
-/* */
-/* Completion Status */
-/* */
-/* CALLS */
-/* */
-/* _ux_host_stack_class_instance_destroy Destroy the class instance */
+/* removed from the bus either directly or indirectly. The bulk in\out */
+/* pipes will be destroyed and the instanced removed. */
+/* */
+/* INPUT */
+/* */
+/* command Swar class command pointer */
+/* */
+/* OUTPUT */
+/* */
+/* Completion Status */
+/* */
+/* CALLS */
+/* */
+/* _ux_host_stack_class_instance_destroy Destroy the class instance */
/* _ux_host_stack_endpoint_transfer_abort */
-/* Abort endpoint transfer */
-/* _ux_utility_memory_free Free memory block */
-/* _ux_host_semaphore_delete Delete protection semaphore */
+/* Abort endpoint transfer */
+/* _ux_utility_memory_free Free memory block */
+/* _ux_host_semaphore_delete Delete protection semaphore */
/* _ux_utility_thread_schedule_other Schedule other threads */
-/* */
-/* CALLED BY */
-/* */
-/* _ux_host_class_gser_entry Entry of gser class */
-/* */
-/* RELEASE HISTORY */
-/* */
-/* DATE NAME DESCRIPTION */
-/* */
-/* 05-19-2020 Chaoqiong Xiao Initial Version 6.0 */
-/* 09-30-2020 Chaoqiong Xiao Modified comment(s), */
-/* resulting in version 6.1 */
-/* 01-31-2022 Chaoqiong Xiao Modified comment(s), */
-/* refined macros names, */
-/* resulting in version 6.1.10 */
+/* */
+/* CALLED BY */
+/* */
+/* _ux_host_class_gser_entry Entry of gser class */
/* */
/**************************************************************************/
UINT _ux_host_class_gser_deactivate(UX_HOST_CLASS_COMMAND *command)
@@ -101,13 +91,13 @@ ULONG interface_index;
/* The enumeration thread needs to sleep a while to allow the application or the class that may be using
endpoints to exit properly. */
- _ux_host_thread_schedule_other(UX_THREAD_PRIORITY_ENUM);
+ _ux_host_thread_schedule_other(UX_THREAD_PRIORITY_ENUM);
/* Destroy the semaphore. */
_ux_host_semaphore_delete(&gser -> ux_host_class_gser_interface_array[interface_index].ux_host_class_gser_semaphore);
}
-
+
/* Destroy the instance. */
_ux_host_stack_class_instance_destroy(gser -> ux_host_class_gser_class, (VOID *) gser);
@@ -115,7 +105,7 @@ ULONG interface_index;
that the device is removed. */
if (_ux_system_host -> ux_system_host_change_function != UX_NULL)
{
-
+
/* Inform the application the device is removed. */
_ux_system_host -> ux_system_host_change_function(UX_DEVICE_REMOVAL, gser -> ux_host_class_gser_class, (VOID *) gser);
}
@@ -129,6 +119,6 @@ ULONG interface_index;
_ux_utility_memory_free(gser);
/* Return successful status. */
- return(UX_SUCCESS);
+ return(UX_SUCCESS);
}
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 9d2bde54..2caa4460 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
@@ -1,18 +1,19 @@
/***************************************************************************
- * Copyright (c) 2024 Microsoft Corporation
- *
+ * Copyright (c) 2024 Microsoft Corporation
+ * Copyright (c) 2026-present Eclipse ThreadX contributors
+ *
* This program and the accompanying materials are made available under the
* terms of the MIT License which is available at
* https://opensource.org/licenses/MIT.
- *
+ *
* SPDX-License-Identifier: MIT
**************************************************************************/
/**************************************************************************/
/**************************************************************************/
-/** */
-/** USBX Component */
+/** */
+/** USBX Component */
/** */
/** Generic Serial Host module class */
/** */
@@ -29,44 +30,36 @@
#include "ux_host_stack.h"
-/**************************************************************************/
-/* */
-/* FUNCTION RELEASE */
-/* */
-/* _ux_host_class_gser_endpoints_get PORTABLE C */
+/**************************************************************************/
+/* */
+/* FUNCTION RELEASE */
+/* */
+/* _ux_host_class_gser_endpoints_get PORTABLE C */
/* 6.1 */
/* AUTHOR */
/* */
/* Chaoqiong Xiao, Microsoft Corporation */
/* */
/* DESCRIPTION */
-/* */
+/* */
/* This function search for the handle of the bulk out and bulk in */
-/* endpoints. The Generic Serial USB device has multiple interfaces. */
-/* */
-/* INPUT */
-/* */
-/* gser Pointer to gser class */
-/* */
-/* OUTPUT */
-/* */
-/* Completion Status */
-/* */
-/* CALLS */
-/* */
-/* _ux_host_stack_interface_endpoint_get Get interface endpoint */
-/* */
-/* CALLED BY */
-/* */
-/* _ux_host_class_gser_activate Activate gser class */
-/* */
-/* RELEASE HISTORY */
-/* */
-/* DATE NAME DESCRIPTION */
-/* */
-/* 05-19-2020 Chaoqiong Xiao Initial Version 6.0 */
-/* 09-30-2020 Chaoqiong Xiao Modified comment(s), */
-/* resulting in version 6.1 */
+/* endpoints. The Generic Serial USB device has multiple interfaces. */
+/* */
+/* INPUT */
+/* */
+/* gser Pointer to gser class */
+/* */
+/* OUTPUT */
+/* */
+/* Completion Status */
+/* */
+/* CALLS */
+/* */
+/* _ux_host_stack_interface_endpoint_get Get interface endpoint */
+/* */
+/* CALLED BY */
+/* */
+/* _ux_host_class_gser_activate Activate gser class */
/* */
/**************************************************************************/
UINT _ux_host_class_gser_endpoints_get(UX_HOST_CLASS_GSER *gser)
@@ -77,85 +70,85 @@ UX_ENDPOINT *endpoint;
ULONG endpoint_index;
ULONG interface_index;
- /* Search the endpoints on all interfaces. */
+ /* Search the endpoints on all interfaces. */
for (interface_index = 0; interface_index < UX_HOST_CLASS_GSER_INTERFACE_NUMBER; interface_index++)
{
/* Search the bulk OUT endpoint. It is attached to the interface container. */
for (endpoint_index = 0; endpoint_index < gser -> ux_host_class_gser_interface_array[interface_index].ux_host_class_gser_interface -> ux_interface_descriptor.bNumEndpoints;
endpoint_index++)
- {
-
+ {
+
/* Get interface endpoint. */
status = _ux_host_stack_interface_endpoint_get(gser -> ux_host_class_gser_interface_array[interface_index].ux_host_class_gser_interface, endpoint_index, &endpoint);
-
+
/* Check the completion status. */
if (status == UX_SUCCESS)
{
-
+
/* Check if endpoint is bulk and OUT. */
if (((endpoint -> ux_endpoint_descriptor.bEndpointAddress & UX_ENDPOINT_DIRECTION) == UX_ENDPOINT_OUT) &&
((endpoint -> ux_endpoint_descriptor.bmAttributes & UX_MASK_ENDPOINT_TYPE) == UX_BULK_ENDPOINT))
{
-
+
/* This transfer_request always have the OUT direction. */
endpoint -> ux_endpoint_transfer_request.ux_transfer_request_type = UX_REQUEST_OUT;
-
+
/* We have found the bulk endpoint, save it. */
gser -> ux_host_class_gser_interface_array[interface_index].ux_host_class_gser_bulk_out_endpoint = endpoint;
break;
}
- }
- }
-
+ }
+ }
+
/* The bulk out endpoint is mandatory. */
if (gser -> ux_host_class_gser_interface_array[interface_index].ux_host_class_gser_bulk_out_endpoint == UX_NULL)
{
-
+
/* Error trap. */
_ux_system_error_handler(UX_SYSTEM_LEVEL_THREAD, UX_SYSTEM_CONTEXT_CLASS, UX_ENDPOINT_HANDLE_UNKNOWN);
/* If trace is enabled, insert this event into the trace buffer. */
UX_TRACE_IN_LINE_INSERT(UX_TRACE_ERROR, UX_ENDPOINT_HANDLE_UNKNOWN, gser, 0, 0, UX_TRACE_ERRORS, 0, 0)
-
+
return(UX_ENDPOINT_HANDLE_UNKNOWN);
}
-
+
/* Search the bulk IN endpoint. It is attached to the interface container. */
-
+
for (endpoint_index = 0; endpoint_index < gser -> ux_host_class_gser_interface_array[interface_index].ux_host_class_gser_interface -> ux_interface_descriptor.bNumEndpoints;
endpoint_index++)
- {
-
+ {
+
/* Get the endpoint handle. */
status = _ux_host_stack_interface_endpoint_get(gser -> ux_host_class_gser_interface_array[interface_index].ux_host_class_gser_interface, endpoint_index, &endpoint);
-
+
/* Check the completion status. */
if (status == UX_SUCCESS)
{
-
+
/* Check if endpoint is bulk and IN. */
if (((endpoint -> ux_endpoint_descriptor.bEndpointAddress & UX_ENDPOINT_DIRECTION) == UX_ENDPOINT_IN) &&
((endpoint -> ux_endpoint_descriptor.bmAttributes & UX_MASK_ENDPOINT_TYPE) == UX_BULK_ENDPOINT))
{
-
+
/* This transfer_request always have the IN direction. */
endpoint -> ux_endpoint_transfer_request.ux_transfer_request_type = UX_REQUEST_IN;
-
+
/* We have found the bulk endpoint, save it. */
gser -> ux_host_class_gser_interface_array[interface_index].ux_host_class_gser_bulk_in_endpoint = endpoint;
break;
}
- }
- }
-
+ }
+ }
+
/* The bulk in endpoint is mandatory. */
if (gser -> ux_host_class_gser_interface_array[interface_index].ux_host_class_gser_bulk_in_endpoint == UX_NULL)
- {
-
+ {
+
/* If trace is enabled, insert this event into the trace buffer. */
UX_TRACE_IN_LINE_INSERT(UX_TRACE_ERROR, UX_ENDPOINT_HANDLE_UNKNOWN, gser, 0, 0, UX_TRACE_ERRORS, 0, 0)
-
+
return(UX_ENDPOINT_HANDLE_UNKNOWN);
}
}
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 89ca2593..c52b2d21 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
@@ -1,18 +1,19 @@
/***************************************************************************
- * Copyright (c) 2024 Microsoft Corporation
- *
+ * Copyright (c) 2024 Microsoft Corporation
+ * Copyright (c) 2026-present Eclipse ThreadX contributors
+ *
* This program and the accompanying materials are made available under the
* terms of the MIT License which is available at
* https://opensource.org/licenses/MIT.
- *
+ *
* SPDX-License-Identifier: MIT
**************************************************************************/
/**************************************************************************/
/**************************************************************************/
-/** */
-/** USBX Component */
+/** */
+/** USBX Component */
/** */
/** Generic Serial Host module class */
/** */
@@ -29,46 +30,38 @@
#include "ux_host_stack.h"
-/**************************************************************************/
-/* */
-/* FUNCTION RELEASE */
-/* */
-/* _ux_host_class_gser_entry PORTABLE C */
+/**************************************************************************/
+/* */
+/* FUNCTION RELEASE */
+/* */
+/* _ux_host_class_gser_entry PORTABLE C */
/* 6.1 */
/* AUTHOR */
/* */
/* Chaoqiong Xiao, Microsoft Corporation */
/* */
/* DESCRIPTION */
-/* */
-/* This function is the entry point of the gser class. It will be */
-/* called by the USBX stack enumeration module when there is a new */
-/* gser on the bus or when the USB gser is removed. */
-/* */
-/* INPUT */
-/* */
+/* */
+/* This function is the entry point of the gser class. It will be */
+/* called by the USBX stack enumeration module when there is a new */
+/* gser on the bus or when the USB gser is removed. */
+/* */
+/* INPUT */
+/* */
/* command gser class command */
-/* */
-/* OUTPUT */
-/* */
-/* Completion Status */
-/* */
-/* CALLS */
-/* */
-/* _ux_host_class_gser_activate Activate gser class */
-/* _ux_host_class_gser_deactivate Deactivate gser class */
-/* */
-/* CALLED BY */
-/* */
-/* Data pump Class */
-/* */
-/* RELEASE HISTORY */
-/* */
-/* DATE NAME DESCRIPTION */
-/* */
-/* 05-19-2020 Chaoqiong Xiao Initial Version 6.0 */
-/* 09-30-2020 Chaoqiong Xiao Modified comment(s), */
-/* resulting in version 6.1 */
+/* */
+/* OUTPUT */
+/* */
+/* Completion Status */
+/* */
+/* CALLS */
+/* */
+/* _ux_host_class_gser_activate Activate gser class */
+/* _ux_host_class_gser_deactivate Deactivate gser class */
+/* */
+/* CALLED BY */
+/* */
+/* Data pump Class */
/* */
/**************************************************************************/
UINT _ux_host_class_gser_entry(UX_HOST_CLASS_COMMAND *command)
@@ -89,10 +82,10 @@ UINT status;
if(((command -> ux_host_class_command_usage == UX_HOST_CLASS_COMMAND_USAGE_PIDVID) &&
(command -> ux_host_class_command_pid == UX_HOST_CLASS_GSER_PRODUCT_ID) &&
(command -> ux_host_class_command_vid == UX_HOST_CLASS_GSER_VENDOR_ID )))
- return(UX_SUCCESS);
- else
- return(UX_NO_CLASS_MATCH);
-
+ return(UX_SUCCESS);
+ else
+ return(UX_NO_CLASS_MATCH);
+
case UX_HOST_CLASS_COMMAND_ACTIVATE:
/* The activate command is used when the device inserted has found a parent and
@@ -102,13 +95,13 @@ UINT status;
case UX_HOST_CLASS_COMMAND_DEACTIVATE:
- /* The deactivate command is used when the device has been extracted either
+ /* The deactivate command is used when the device has been extracted either
directly or when its parents has been extracted. */
status = _ux_host_class_gser_deactivate(command);
return(status);
- default:
-
+ default:
+
/* Error trap. */
_ux_system_error_handler(UX_SYSTEM_LEVEL_THREAD, UX_SYSTEM_CONTEXT_CLASS, UX_FUNCTION_NOT_SUPPORTED);
@@ -116,6 +109,6 @@ UINT status;
UX_TRACE_IN_LINE_INSERT(UX_TRACE_ERROR, UX_FUNCTION_NOT_SUPPORTED, 0, 0, 0, UX_TRACE_ERRORS, 0, 0)
return(UX_FUNCTION_NOT_SUPPORTED);
- }
+ }
}
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 53510989..ecabf526 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
@@ -1,10 +1,11 @@
/***************************************************************************
- * Copyright (c) 2024 Microsoft Corporation
- *
+ * Copyright (c) 2024 Microsoft Corporation
+ * Copyright (c) 2026-present Eclipse ThreadX contributors
+ *
* This program and the accompanying materials are made available under the
* terms of the MIT License which is available at
* https://opensource.org/licenses/MIT.
- *
+ *
* SPDX-License-Identifier: MIT
**************************************************************************/
@@ -68,16 +69,6 @@
/* */
/* Application */
/* */
-/* RELEASE HISTORY */
-/* */
-/* DATE NAME DESCRIPTION */
-/* */
-/* 05-19-2020 Chaoqiong Xiao Initial Version 6.0 */
-/* 09-30-2020 Chaoqiong Xiao Modified comment(s), */
-/* resulting in version 6.1 */
-/* 10-31-2023 Yajun xia Modified comment(s), */
-/* resulting in version 6.3.0 */
-/* */
/**************************************************************************/
UINT _ux_host_class_gser_ioctl(UX_HOST_CLASS_GSER *gser, ULONG interface_index, ULONG ioctl_function,
VOID *parameter)
@@ -321,12 +312,6 @@ ULONG value;
/* */
/* Application */
/* */
-/* RELEASE HISTORY */
-/* */
-/* DATE NAME DESCRIPTION */
-/* */
-/* 10-31-2023 Chaoqiong Xiao Initial Version 6.3.0 */
-/* */
/**************************************************************************/
UINT _uxe_host_class_gser_ioctl(UX_HOST_CLASS_GSER *gser, ULONG interface_index, ULONG ioctl_function,
VOID *parameter)
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 34dc92dc..a9bf2e47 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
@@ -1,18 +1,19 @@
/***************************************************************************
- * Copyright (c) 2024 Microsoft Corporation
- *
+ * Copyright (c) 2024 Microsoft Corporation
+ * Copyright (c) 2026-present Eclipse ThreadX contributors
+ *
* This program and the accompanying materials are made available under the
* terms of the MIT License which is available at
* https://opensource.org/licenses/MIT.
- *
+ *
* SPDX-License-Identifier: MIT
**************************************************************************/
/**************************************************************************/
/**************************************************************************/
-/** */
-/** USBX Component */
+/** */
+/** USBX Component */
/** */
/** Generic Serial Host module class */
/** */
@@ -29,77 +30,62 @@
#include "ux_host_stack.h"
-/**************************************************************************/
-/* */
-/* FUNCTION RELEASE */
-/* */
-/* _ux_host_class_gser_read PORTABLE C */
+/**************************************************************************/
+/* */
+/* FUNCTION RELEASE */
+/* */
+/* _ux_host_class_gser_read PORTABLE C */
/* 6.1.11 */
/* AUTHOR */
/* */
/* Chaoqiong Xiao, Microsoft Corporation */
/* */
/* DESCRIPTION */
-/* */
-/* This function reads from the gser interface. The call is */
-/* blocking and only returns when there is either an error or when */
+/* */
+/* This function reads from the gser interface. The call is */
+/* blocking and only returns when there is either an error or when */
/* the transfer is complete. */
/* */
-/* INPUT */
-/* */
-/* gser Pointer to gser class */
+/* INPUT */
+/* */
+/* gser Pointer to gser class */
/* data_pointer Pointer to buffer */
/* requested_length Requested data read */
/* actual_length Actual data read */
-/* */
-/* OUTPUT */
-/* */
-/* Completion Status */
-/* */
-/* CALLS */
-/* */
-/* _ux_host_stack_transfer_request Process transfer request */
-/* _ux_host_stack_transfer_request_abort Abort transfer request */
-/* _ux_host_semaphore_get Get protection semaphore */
-/* _ux_host_semaphore_put Release protection semaphore */
-/* */
-/* 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), */
-/* prefixed UX to MS_TO_TICK, */
-/* resulting in version 6.1 */
-/* 01-31-2022 Chaoqiong Xiao Modified comment(s), */
-/* refined macros names, */
-/* resulting in version 6.1.10 */
-/* 04-25-2022 Chaoqiong Xiao Modified comment(s), */
-/* fixed standalone compile, */
-/* resulting in version 6.1.11 */
+/* */
+/* OUTPUT */
+/* */
+/* Completion Status */
+/* */
+/* CALLS */
+/* */
+/* _ux_host_stack_transfer_request Process transfer request */
+/* _ux_host_stack_transfer_request_abort Abort transfer request */
+/* _ux_host_semaphore_get Get protection semaphore */
+/* _ux_host_semaphore_put Release protection semaphore */
+/* */
+/* CALLED BY */
+/* */
+/* Application */
/* */
/**************************************************************************/
-UINT _ux_host_class_gser_read(UX_HOST_CLASS_GSER *gser,
+UINT _ux_host_class_gser_read(UX_HOST_CLASS_GSER *gser,
ULONG interface_index,
- UCHAR *data_pointer,
- ULONG requested_length,
+ UCHAR *data_pointer,
+ ULONG requested_length,
ULONG *actual_length)
{
UX_TRANSFER *transfer_request;
UINT status;
ULONG transfer_request_length;
-
+
/* If trace is enabled, insert this event into the trace buffer. */
UX_TRACE_IN_LINE_INSERT(UX_TRACE_HOST_CLASS_GSER_READ, gser, data_pointer, requested_length, 0, UX_TRACE_HOST_CLASS_EVENTS, 0, 0)
-
+
/* Ensure the instance is valid. */
if (gser -> ux_host_class_gser_state != UX_HOST_CLASS_INSTANCE_LIVE)
- {
+ {
/* Error trap. */
_ux_system_error_handler(UX_SYSTEM_LEVEL_THREAD, UX_SYSTEM_CONTEXT_CLASS, UX_HOST_CLASS_INSTANCE_UNKNOWN);
@@ -123,7 +109,7 @@ ULONG transfer_request_length;
/* Save the interface number in the Transfer Request. */
transfer_request -> ux_transfer_request_user_specific = (VOID *)(ALIGN_TYPE)interface_index;
-
+
/* Perform a transfer on the bulk in endpoint until either the transfer is
completed or until there is an error. */
while (requested_length)
@@ -134,18 +120,18 @@ ULONG transfer_request_length;
transfer_request_length = transfer_request -> ux_transfer_request_maximum_length;
else
transfer_request_length = requested_length;
-
+
/* Initialize the transfer request. */
transfer_request -> ux_transfer_request_data_pointer = data_pointer;
transfer_request -> ux_transfer_request_requested_length = transfer_request_length;
-
+
/* Perform the transfer. */
status = _ux_host_stack_transfer_request(transfer_request);
/* If the transfer is successful, we need to wait for the transfer request to be completed. */
if (status == UX_SUCCESS)
{
-
+
/* Wait for the completion of the transfer_request. */
status = _ux_host_semaphore_get(&transfer_request -> ux_transfer_request_semaphore, UX_MS_TO_TICK(UX_HOST_CLASS_GSER_CLASS_TRANSFER_TIMEOUT));
@@ -155,26 +141,26 @@ ULONG transfer_request_length;
/* All transfers pending need to abort. There may have been a partial transfer. */
_ux_host_stack_transfer_request_abort(transfer_request);
-
- /* Update the length of the actual data transferred. We do this after the
+
+ /* Update the length of the actual data transferred. We do this after the
abort of the transfer request in case some data was actually received. */
*actual_length += transfer_request -> ux_transfer_request_actual_length;
-
+
/* Unprotect thread reentry to this instance. */
_ux_host_semaphore_put(&gser -> ux_host_class_gser_interface_array[interface_index].ux_host_class_gser_semaphore);
/* Set the completion code. */
transfer_request -> ux_transfer_request_completion_code = UX_TRANSFER_TIMEOUT;
-
+
/* Error trap. */
_ux_system_error_handler(UX_SYSTEM_LEVEL_THREAD, UX_SYSTEM_CONTEXT_CLASS, UX_TRANSFER_TIMEOUT);
/* If trace is enabled, insert this event into the trace buffer. */
UX_TRACE_IN_LINE_INSERT(UX_TRACE_ERROR, UX_TRANSFER_TIMEOUT, transfer_request, 0, 0, UX_TRACE_ERRORS, 0, 0)
-
+
/* There was an error, return to the caller */
return(UX_TRANSFER_TIMEOUT);
- }
+ }
}
else
{
@@ -188,32 +174,32 @@ ULONG transfer_request_length;
/* Update the length of the transfer. Normally all the data has to be received. */
*actual_length += transfer_request -> ux_transfer_request_actual_length;
-
+
/* Check for completion of transfer. If the transfer is partial, return to caller.
The transfer is marked as successful but the caller will need to check the length
actually received and determine if a partial transfer is OK. */
if (transfer_request_length != transfer_request -> ux_transfer_request_actual_length)
{
-
+
/* Unprotect thread reentry to this instance. */
_ux_host_semaphore_put(&gser -> ux_host_class_gser_interface_array[interface_index].ux_host_class_gser_semaphore);
-
+
/* Return success to caller. */
return(UX_SUCCESS);
}
- /* Update the data pointer for next transfer. */
+ /* Update the data pointer for next transfer. */
data_pointer += transfer_request_length;
-
+
/* Update what is left to receive. */
- requested_length -= transfer_request_length;
- }
+ requested_length -= transfer_request_length;
+ }
/* Unprotect thread reentry to this instance. */
_ux_host_semaphore_put(&gser -> ux_host_class_gser_interface_array[interface_index].ux_host_class_gser_semaphore);
/* We get here when all the transfers went through without errors. */
- return(UX_SUCCESS);
+ return(UX_SUCCESS);
}
@@ -233,7 +219,7 @@ ULONG transfer_request_length;
/* */
/* INPUT */
/* */
-/* gser Pointer to GSER class */
+/* gser Pointer to GSER class */
/* data_pointer Pointer to buffer */
/* requested_length Requested data read */
/* actual_length Actual data read */
@@ -250,17 +236,11 @@ ULONG transfer_request_length;
/* */
/* Application */
/* */
-/* RELEASE HISTORY */
-/* */
-/* DATE NAME DESCRIPTION */
-/* */
-/* 10-31-2023 Chaoqiong Xiao Initial Version 6.3.0 */
-/* */
/**************************************************************************/
-UINT _uxe_host_class_gser_read(UX_HOST_CLASS_GSER *gser,
+UINT _uxe_host_class_gser_read(UX_HOST_CLASS_GSER *gser,
ULONG interface_index,
- UCHAR *data_pointer,
- ULONG requested_length,
+ UCHAR *data_pointer,
+ ULONG requested_length,
ULONG *actual_length)
{
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 10630b4c..29a91c5a 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
@@ -1,18 +1,19 @@
/***************************************************************************
- * Copyright (c) 2024 Microsoft Corporation
- *
+ * Copyright (c) 2024 Microsoft Corporation
+ * Copyright (c) 2026-present Eclipse ThreadX contributors
+ *
* This program and the accompanying materials are made available under the
* terms of the MIT License which is available at
* https://opensource.org/licenses/MIT.
- *
+ *
* SPDX-License-Identifier: MIT
**************************************************************************/
/**************************************************************************/
/**************************************************************************/
-/** */
-/** USBX Component */
+/** */
+/** USBX Component */
/** */
/** Generic Serial Host module class */
/** */
@@ -29,45 +30,37 @@
#include "ux_host_stack.h"
-/**************************************************************************/
-/* */
-/* FUNCTION RELEASE */
-/* */
-/* _ux_host_class_gser_reception_callback PORTABLE C */
+/**************************************************************************/
+/* */
+/* FUNCTION RELEASE */
+/* */
+/* _ux_host_class_gser_reception_callback PORTABLE C */
/* 6.1 */
/* AUTHOR */
/* */
/* Chaoqiong Xiao, Microsoft Corporation */
/* */
/* DESCRIPTION */
-/* */
-/* This function is the callback from the USBX transfer functions, */
-/* it is called when a full or partial transfer has been done for a */
+/* */
+/* This function is the callback from the USBX transfer functions, */
+/* it is called when a full or partial transfer has been done for a */
/* bulk in transfer. It calls back the application. */
/* */
-/* INPUT */
-/* */
-/* transfer_request Pointer to transfer request */
-/* */
-/* OUTPUT */
-/* */
-/* None */
-/* */
-/* CALLS */
-/* */
-/* _ux_host_stack_transfer_request Process transfer request */
-/* */
-/* 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), */
-/* resulting in version 6.1 */
+/* INPUT */
+/* */
+/* transfer_request Pointer to transfer request */
+/* */
+/* OUTPUT */
+/* */
+/* None */
+/* */
+/* CALLS */
+/* */
+/* _ux_host_stack_transfer_request Process transfer request */
+/* */
+/* CALLED BY */
+/* */
+/* Application */
/* */
/**************************************************************************/
VOID _ux_host_class_gser_reception_callback (UX_TRANSFER *transfer_request)
@@ -76,30 +69,30 @@ VOID _ux_host_class_gser_reception_callback (UX_TRANSFER *transfer_request)
UX_HOST_CLASS_GSER *gser;
UX_HOST_CLASS_GSER_RECEPTION *gser_reception;
ULONG interface_index;
-
+
/* Get the class instance for this transfer request. */
gser = (UX_HOST_CLASS_GSER *) transfer_request -> ux_transfer_request_class_instance;
/* The interface index was stored into the user specific field. */
- interface_index = (ULONG) (ALIGN_TYPE) transfer_request -> ux_transfer_request_user_specific;
-
+ interface_index = (ULONG) (ALIGN_TYPE) transfer_request -> ux_transfer_request_user_specific;
+
/* Get the pointer to the acm reception structure. */
gser_reception = gser -> ux_host_class_gser_interface_array[interface_index].ux_host_class_gser_reception;
/* Check the state of the transfer. If there is an error, we do not proceed with this report. */
if (transfer_request -> ux_transfer_request_completion_code != UX_SUCCESS)
{
-
+
/* The reception is stopped. */
gser_reception -> ux_host_class_gser_reception_state = UX_HOST_CLASS_GSER_RECEPTION_STATE_STOPPED;
/* We do not proceed. */
- return;
-
+ return;
+
}
/* And move to the next reception buffer. Check if we are at the end of the application buffer. */
- if (gser_reception -> ux_host_class_gser_reception_data_head + gser_reception -> ux_host_class_gser_reception_block_size >=
+ if (gser_reception -> ux_host_class_gser_reception_data_head + gser_reception -> ux_host_class_gser_reception_block_size >=
gser_reception -> ux_host_class_gser_reception_data_buffer + gser_reception -> ux_host_class_gser_reception_data_buffer_size)
{
@@ -114,19 +107,19 @@ ULONG interface_index;
UX_TRACE_IN_LINE_INSERT(UX_TRACE_ERROR, UX_BUFFER_OVERFLOW, transfer_request, 0, 0, UX_TRACE_ERRORS, 0, 0)
/* We have an overflow. We cannot continue. Report to the application. */
- gser_reception -> ux_host_class_gser_reception_callback(gser, UX_BUFFER_OVERFLOW, UX_NULL, 0);
-
+ gser_reception -> ux_host_class_gser_reception_callback(gser, UX_BUFFER_OVERFLOW, UX_NULL, 0);
+
/* And stop the transfer in progress flag. */
gser_reception -> ux_host_class_gser_reception_state = UX_HOST_CLASS_GSER_RECEPTION_STATE_STOPPED;
-
+
return;
}
else
-
+
/* Program the head to be at the beginning of the application buffer. */
gser_reception -> ux_host_class_gser_reception_data_head = gser_reception -> ux_host_class_gser_reception_data_buffer;
-
- }
+
+ }
else
/* Program the head to be after the current buffer. */
@@ -134,7 +127,7 @@ ULONG interface_index;
/* We need to report this transfer to the application. */
- gser_reception -> ux_host_class_gser_reception_callback(gser,
+ gser_reception -> ux_host_class_gser_reception_callback(gser,
transfer_request -> ux_transfer_request_completion_code,
transfer_request -> ux_transfer_request_data_pointer,
transfer_request -> ux_transfer_request_actual_length);
@@ -143,6 +136,6 @@ ULONG interface_index;
_ux_host_stack_transfer_request(transfer_request);
/* There is no status to be reported back to the stack. */
- return;
+ return;
}
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 6f117380..84932280 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
@@ -1,18 +1,19 @@
/***************************************************************************
- * Copyright (c) 2024 Microsoft Corporation
- *
+ * Copyright (c) 2024 Microsoft Corporation
+ * Copyright (c) 2026-present Eclipse ThreadX contributors
+ *
* This program and the accompanying materials are made available under the
* terms of the MIT License which is available at
* https://opensource.org/licenses/MIT.
- *
+ *
* SPDX-License-Identifier: MIT
**************************************************************************/
/**************************************************************************/
/**************************************************************************/
-/** */
-/** USBX Component */
+/** */
+/** USBX Component */
/** */
/** Generic Serial Host module class */
/** */
@@ -29,64 +30,56 @@
#include "ux_host_stack.h"
-/**************************************************************************/
-/* */
-/* FUNCTION RELEASE */
-/* */
-/* _ux_host_class_gser_reception_start PORTABLE C */
+/**************************************************************************/
+/* */
+/* FUNCTION RELEASE */
+/* */
+/* _ux_host_class_gser_reception_start PORTABLE C */
/* 6.1 */
/* AUTHOR */
/* */
/* Chaoqiong Xiao, Microsoft Corporation */
/* */
/* DESCRIPTION */
-/* */
-/* This function starts a reception with the generic serial class. This*/
-/* allows for non blocking calls based on a packet orientated round */
+/* */
+/* This function starts a reception with the generic serial class. This*/
+/* allows for non blocking calls based on a packet orientated round */
/* robbin buffer. When a packet is fully or partially received, an */
/* application callback function is invoked and a new transfer request */
/* is rescheduled. */
/* */
-/* INPUT */
-/* */
-/* gser Pointer to gser class */
+/* INPUT */
+/* */
+/* gser Pointer to gser class */
/* gser_reception Pointer to reception struct */
-/* */
-/* OUTPUT */
-/* */
-/* Completion Status */
-/* */
-/* CALLS */
-/* */
-/* _ux_host_stack_transfer_request Process transfer request */
-/* */
-/* 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), */
-/* resulting in version 6.1 */
+/* */
+/* OUTPUT */
+/* */
+/* Completion Status */
+/* */
+/* CALLS */
+/* */
+/* _ux_host_stack_transfer_request Process transfer request */
+/* */
+/* CALLED BY */
+/* */
+/* Application */
/* */
/**************************************************************************/
-UINT _ux_host_class_gser_reception_start (UX_HOST_CLASS_GSER *gser,
+UINT _ux_host_class_gser_reception_start (UX_HOST_CLASS_GSER *gser,
UX_HOST_CLASS_GSER_RECEPTION *gser_reception)
{
UX_TRANSFER *transfer_request;
UINT status;
ULONG interface_index;
-
+
/* If trace is enabled, insert this event into the trace buffer. */
UX_TRACE_IN_LINE_INSERT(UX_TRACE_HOST_CLASS_GSER_RECEPTION_START, gser, 0, 0, 0, UX_TRACE_HOST_CLASS_EVENTS, 0, 0)
/* Ensure the instance is valid. */
if (gser -> ux_host_class_gser_state != UX_HOST_CLASS_INSTANCE_LIVE)
- {
+ {
/* Error trap. */
_ux_system_error_handler(UX_SYSTEM_LEVEL_THREAD, UX_SYSTEM_CONTEXT_CLASS, UX_HOST_CLASS_INSTANCE_UNKNOWN);
@@ -106,7 +99,7 @@ ULONG interface_index;
/* Get the pointer to the bulk in endpoint in the transfer_request. */
transfer_request = &gser -> ux_host_class_gser_interface_array[interface_index].ux_host_class_gser_bulk_in_endpoint -> ux_endpoint_transfer_request;
-
+
/* Save the interface number in the Transfer Request. */
transfer_request -> ux_transfer_request_user_specific = (VOID *) (ALIGN_TYPE) interface_index;
@@ -115,13 +108,13 @@ ULONG interface_index;
transfer_request -> ux_transfer_request_data_pointer = gser_reception -> ux_host_class_gser_reception_data_head;
transfer_request -> ux_transfer_request_requested_length = gser_reception -> ux_host_class_gser_reception_block_size;
transfer_request -> ux_transfer_request_completion_function = _ux_host_class_gser_reception_callback;
-
+
/* Save the acm reception structure in the acm structure. */
gser -> ux_host_class_gser_interface_array[interface_index].ux_host_class_gser_reception = gser_reception;
-
+
/* And declare we have a transfer in progress. */
gser_reception -> ux_host_class_gser_reception_state = UX_HOST_CLASS_GSER_RECEPTION_STATE_STARTED;
-
+
/* Arm a first transfer on the bulk in endpoint. There is a callback to this function so we return to the caller
right away. */
status = _ux_host_stack_transfer_request(transfer_request);
@@ -130,8 +123,8 @@ ULONG interface_index;
in progress flag. */
if (status != UX_SUCCESS)
gser_reception -> ux_host_class_gser_reception_state = UX_HOST_CLASS_GSER_RECEPTION_STATE_STOPPED;
-
- return(status);
+
+ return(status);
}
@@ -167,14 +160,8 @@ ULONG interface_index;
/* */
/* Application */
/* */
-/* RELEASE HISTORY */
-/* */
-/* DATE NAME DESCRIPTION */
-/* */
-/* 10-31-2023 Chaoqiong Xiao Initial Version 6.3.0 */
-/* */
/**************************************************************************/
-UINT _uxe_host_class_gser_reception_start (UX_HOST_CLASS_GSER *gser,
+UINT _uxe_host_class_gser_reception_start (UX_HOST_CLASS_GSER *gser,
UX_HOST_CLASS_GSER_RECEPTION *gser_reception)
{
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 45b764ad..760f2b87 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
@@ -1,18 +1,19 @@
/***************************************************************************
- * Copyright (c) 2024 Microsoft Corporation
- *
+ * Copyright (c) 2024 Microsoft Corporation
+ * Copyright (c) 2026-present Eclipse ThreadX contributors
+ *
* This program and the accompanying materials are made available under the
* terms of the MIT License which is available at
* https://opensource.org/licenses/MIT.
- *
+ *
* SPDX-License-Identifier: MIT
**************************************************************************/
/**************************************************************************/
/**************************************************************************/
-/** */
-/** USBX Component */
+/** */
+/** USBX Component */
/** */
/** Generic Serial Host module class */
/** */
@@ -29,52 +30,44 @@
#include "ux_host_stack.h"
-/**************************************************************************/
-/* */
-/* FUNCTION RELEASE */
-/* */
-/* _ux_host_class_gser_reception_stop PORTABLE C */
+/**************************************************************************/
+/* */
+/* FUNCTION RELEASE */
+/* */
+/* _ux_host_class_gser_reception_stop PORTABLE C */
/* 6.1 */
/* AUTHOR */
/* */
/* Chaoqiong Xiao, Microsoft Corporation */
/* */
/* DESCRIPTION */
-/* */
-/* This function starts a reception with the generic modem. This way */
-/* allows for non blocking calls based on a packet orientated round */
+/* */
+/* This function starts a reception with the generic modem. This way */
+/* allows for non blocking calls based on a packet orientated round */
/* robbin buffer. When a packet is fully or partially received, an */
/* application callback function is invoked and a new transfer request */
/* is rescheduled. */
/* */
-/* INPUT */
-/* */
-/* gser Pointer to gser class */
+/* INPUT */
+/* */
+/* gser Pointer to gser class */
/* gser_reception Pointer to reception struct */
-/* */
-/* OUTPUT */
-/* */
-/* Completion Status */
-/* */
-/* CALLS */
-/* */
+/* */
+/* OUTPUT */
+/* */
+/* Completion Status */
+/* */
+/* CALLS */
+/* */
/* _ux_host_stack_endpoint_transfer_abort */
-/* Abort transfer request */
-/* */
-/* 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), */
-/* resulting in version 6.1 */
+/* Abort transfer request */
+/* */
+/* CALLED BY */
+/* */
+/* Application */
/* */
/**************************************************************************/
-UINT _ux_host_class_gser_reception_stop (UX_HOST_CLASS_GSER *gser,
+UINT _ux_host_class_gser_reception_stop (UX_HOST_CLASS_GSER *gser,
UX_HOST_CLASS_GSER_RECEPTION *gser_reception)
{
@@ -85,7 +78,7 @@ ULONG interface_index;
/* Ensure the instance is valid. */
if (gser -> ux_host_class_gser_state != UX_HOST_CLASS_INSTANCE_LIVE)
- {
+ {
/* If trace is enabled, insert this event into the trace buffer. */
UX_TRACE_IN_LINE_INSERT(UX_TRACE_ERROR, UX_HOST_CLASS_INSTANCE_UNKNOWN, gser, 0, 0, UX_TRACE_ERRORS, 0, 0)
@@ -96,7 +89,7 @@ ULONG interface_index;
/* Check if we do have transfers for this application. If none, nothing to do. */
if (gser_reception -> ux_host_class_gser_reception_state == UX_HOST_CLASS_GSER_RECEPTION_STATE_STOPPED)
return(UX_SUCCESS);
-
+
/* Get the interface index. */
interface_index = gser_reception -> ux_host_class_gser_reception_interface_index;
@@ -142,14 +135,8 @@ ULONG interface_index;
/* */
/* Application */
/* */
-/* RELEASE HISTORY */
-/* */
-/* DATE NAME DESCRIPTION */
-/* */
-/* 10-31-2023 Chaoqiong Xiao Initial Version 6.3.0 */
-/* */
/**************************************************************************/
-UINT _uxe_host_class_gser_reception_stop (UX_HOST_CLASS_GSER *gser,
+UINT _uxe_host_class_gser_reception_stop (UX_HOST_CLASS_GSER *gser,
UX_HOST_CLASS_GSER_RECEPTION *gser_reception)
{
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 31694c52..b6a40b26 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
@@ -1,18 +1,19 @@
/***************************************************************************
- * Copyright (c) 2024 Microsoft Corporation
- *
+ * Copyright (c) 2024 Microsoft Corporation
+ * Copyright (c) 2026-present Eclipse ThreadX contributors
+ *
* This program and the accompanying materials are made available under the
* terms of the MIT License which is available at
* https://opensource.org/licenses/MIT.
- *
+ *
* SPDX-License-Identifier: MIT
**************************************************************************/
/**************************************************************************/
/**************************************************************************/
-/** */
-/** USBX Component */
+/** */
+/** USBX Component */
/** */
/** Generic Serial Host module class */
/** */
@@ -28,77 +29,62 @@
#include "ux_host_class_gser.h"
#include "ux_host_stack.h"
-/**************************************************************************/
-/* */
-/* FUNCTION RELEASE */
-/* */
-/* _ux_host_class_gser_write PORTABLE C */
+/**************************************************************************/
+/* */
+/* FUNCTION RELEASE */
+/* */
+/* _ux_host_class_gser_write PORTABLE C */
/* 6.1.11 */
/* AUTHOR */
/* */
/* Chaoqiong Xiao, Microsoft Corporation */
/* */
/* DESCRIPTION */
-/* */
-/* This function writes to the gser interface. The call is blocking */
-/* and only returns when there is either an error or when the transfer */
-/* is complete. */
-/* */
-/* INPUT */
-/* */
-/* gser Pointer to gser class */
-/* data_pointer Pointer to data to write */
-/* requested_length Length of data to write */
-/* actual_length Actual length of data written */
-/* */
-/* OUTPUT */
-/* */
-/* Completion Status */
-/* */
-/* CALLS */
-/* */
-/* _ux_host_stack_transfer_request Process transfer request */
-/* _ux_host_stack_transfer_request_abort Abort transfer request */
-/* _ux_host_semaphore_get Get protection semaphore */
-/* _ux_host_semaphore_put Release protection semaphore */
-/* */
-/* 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), */
-/* prefixed UX to MS_TO_TICK, */
-/* resulting in version 6.1 */
-/* 01-31-2022 Chaoqiong Xiao Modified comment(s), */
-/* refined macros names, */
-/* resulting in version 6.1.10 */
-/* 04-25-2022 Chaoqiong Xiao Modified comment(s), */
-/* fixed standalone compile, */
-/* resulting in version 6.1.11 */
+/* */
+/* This function writes to the gser interface. The call is blocking */
+/* and only returns when there is either an error or when the transfer */
+/* is complete. */
+/* */
+/* INPUT */
+/* */
+/* gser Pointer to gser class */
+/* data_pointer Pointer to data to write */
+/* requested_length Length of data to write */
+/* actual_length Actual length of data written */
+/* */
+/* OUTPUT */
+/* */
+/* Completion Status */
+/* */
+/* CALLS */
+/* */
+/* _ux_host_stack_transfer_request Process transfer request */
+/* _ux_host_stack_transfer_request_abort Abort transfer request */
+/* _ux_host_semaphore_get Get protection semaphore */
+/* _ux_host_semaphore_put Release protection semaphore */
+/* */
+/* CALLED BY */
+/* */
+/* Application */
/* */
/**************************************************************************/
-UINT _ux_host_class_gser_write(UX_HOST_CLASS_GSER *gser,
+UINT _ux_host_class_gser_write(UX_HOST_CLASS_GSER *gser,
ULONG interface_index,
- UCHAR * data_pointer,
- ULONG requested_length,
+ UCHAR * data_pointer,
+ ULONG requested_length,
ULONG *actual_length)
{
UX_TRANSFER *transfer_request;
UINT status;
ULONG transfer_request_length;
-
+
/* If trace is enabled, insert this event into the trace buffer. */
UX_TRACE_IN_LINE_INSERT(UX_TRACE_HOST_CLASS_GSER_WRITE, gser, data_pointer, requested_length, 0, UX_TRACE_HOST_CLASS_EVENTS, 0, 0)
-
+
/* Ensure the instance is valid. */
if (gser -> ux_host_class_gser_state != UX_HOST_CLASS_INSTANCE_LIVE)
- {
+ {
/* If trace is enabled, insert this event into the trace buffer. */
UX_TRACE_IN_LINE_INSERT(UX_TRACE_ERROR, UX_HOST_CLASS_INSTANCE_UNKNOWN, gser, 0, 0, UX_TRACE_ERRORS, 0, 0)
@@ -115,10 +101,10 @@ ULONG transfer_request_length;
/* Get the pointer to the bulk out endpoint transfer request. */
transfer_request = &gser -> ux_host_class_gser_interface_array[interface_index].ux_host_class_gser_bulk_out_endpoint -> ux_endpoint_transfer_request;
-
+
/* Save the interface number in the Transfer Request. */
transfer_request -> ux_transfer_request_user_specific = (VOID *) (ALIGN_TYPE) interface_index;
-
+
/* Perform a transfer on the bulk out endpoint until either the transfer is
completed or when there is an error. */
do
@@ -129,18 +115,18 @@ ULONG transfer_request_length;
transfer_request_length = transfer_request -> ux_transfer_request_maximum_length;
else
transfer_request_length = requested_length;
-
+
/* Initialize the transfer_request. */
transfer_request -> ux_transfer_request_data_pointer = data_pointer;
transfer_request -> ux_transfer_request_requested_length = transfer_request_length;
-
+
/* Perform the transfer. */
status = _ux_host_stack_transfer_request(transfer_request);
/* If the transfer is successful, we need to wait for the transfer request to be completed. */
if (status == UX_SUCCESS)
{
-
+
/* Wait for the completion of the transfer request. */
status = _ux_host_semaphore_get(&transfer_request -> ux_transfer_request_semaphore, UX_MS_TO_TICK(UX_HOST_CLASS_GSER_CLASS_TRANSFER_TIMEOUT));
@@ -150,23 +136,23 @@ ULONG transfer_request_length;
/* All transfers pending need to abort. There may have been a partial transfer. */
_ux_host_stack_transfer_request_abort(transfer_request);
-
- /* Update the length of the actual data transferred. We do this after the
+
+ /* Update the length of the actual data transferred. We do this after the
abort of the transfer_request in case some data actually went out. */
*actual_length += transfer_request -> ux_transfer_request_actual_length;
-
+
/* Unprotect thread reentry to this instance. */
_ux_host_semaphore_put(&gser -> ux_host_class_gser_interface_array[interface_index].ux_host_class_gser_semaphore);
/* Set the completion code. */
transfer_request -> ux_transfer_request_completion_code = UX_TRANSFER_TIMEOUT;
-
+
/* If trace is enabled, insert this event into the trace buffer. */
UX_TRACE_IN_LINE_INSERT(UX_TRACE_ERROR, UX_TRANSFER_TIMEOUT, transfer_request, 0, 0, UX_TRACE_ERRORS, 0, 0)
-
+
/* There was an error, return to the caller. */
return(UX_TRANSFER_TIMEOUT);
- }
+ }
}
else
{
@@ -180,7 +166,7 @@ ULONG transfer_request_length;
/* Update the length of the transfer. Normally all the data has to be sent. */
*actual_length += transfer_request -> ux_transfer_request_actual_length;
-
+
/* Check for completion of transfer. If the transfer is partial, return to caller.
The transfer is marked as successful but the caller will need to check the length
actually sent and determine if a partial transfer is OK. */
@@ -194,20 +180,20 @@ ULONG transfer_request_length;
return(UX_SUCCESS);
}
- /* Update the data pointer for next transfer. */
+ /* Update the data pointer for next transfer. */
data_pointer += transfer_request_length;
-
+
/* Update what is left to send out. */
- requested_length -= transfer_request_length;
+ requested_length -= transfer_request_length;
} while (requested_length != 0);
-
+
/* Unprotect thread reentry to this instance. */
_ux_host_semaphore_put(&gser -> ux_host_class_gser_interface_array[interface_index].ux_host_class_gser_semaphore);
/* We get here when all the transfers went through without errors. */
- return(UX_SUCCESS);
+ return(UX_SUCCESS);
}
@@ -227,7 +213,7 @@ ULONG transfer_request_length;
/* */
/* INPUT */
/* */
-/* gser Pointer to GSER class */
+/* gser Pointer to GSER class */
/* data_pointer Pointer to buffer */
/* requested_length Requested data write */
/* actual_length Actual data write */
@@ -244,17 +230,11 @@ ULONG transfer_request_length;
/* */
/* Application */
/* */
-/* RELEASE HISTORY */
-/* */
-/* DATE NAME DESCRIPTION */
-/* */
-/* 10-31-2023 Chaoqiong Xiao Initial Version 6.3.0 */
-/* */
/**************************************************************************/
-UINT _uxe_host_class_gser_write(UX_HOST_CLASS_GSER *gser,
+UINT _uxe_host_class_gser_write(UX_HOST_CLASS_GSER *gser,
ULONG interface_index,
- UCHAR *data_pointer,
- ULONG requested_length,
+ UCHAR *data_pointer,
+ ULONG requested_length,
ULONG *actual_length)
{
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 00789572..2188cdac 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
@@ -1,18 +1,19 @@
/***************************************************************************
- * Copyright (c) 2024 Microsoft Corporation
- *
+ * Copyright (c) 2024 Microsoft Corporation
+ * Copyright (c) 2026-present Eclipse ThreadX contributors
+ *
* This program and the accompanying materials are made available under the
* terms of the MIT License which is available at
* https://opensource.org/licenses/MIT.
- *
+ *
* SPDX-License-Identifier: MIT
**************************************************************************/
/**************************************************************************/
/**************************************************************************/
-/** */
-/** USBX Component */
+/** */
+/** USBX Component */
/** */
/** HID Class */
/** */
@@ -29,59 +30,44 @@
#include "ux_host_stack.h"
-/**************************************************************************/
-/* */
-/* FUNCTION RELEASE */
-/* */
-/* _ux_host_class_hid_activate PORTABLE C */
+/**************************************************************************/
+/* */
+/* FUNCTION RELEASE */
+/* */
+/* _ux_host_class_hid_activate PORTABLE C */
/* 6.1.12 */
/* AUTHOR */
/* */
/* Chaoqiong Xiao, Microsoft Corporation */
/* */
/* DESCRIPTION */
-/* */
-/* This function performs the enumeration of the HID class. */
-/* */
-/* INPUT */
-/* */
-/* command Pointer to command */
-/* */
-/* OUTPUT */
-/* */
-/* Completion Status */
-/* */
-/* CALLS */
-/* */
-/* _ux_host_class_hid_client_search HID client search */
-/* _ux_host_class_hid_configure Configure HID */
-/* _ux_host_class_hid_descriptor_parse Parse descriptor */
-/* _ux_host_class_hid_interrupt_endpoint_search Search endpoint */
+/* */
+/* This function performs the enumeration of the HID class. */
+/* */
+/* INPUT */
+/* */
+/* command Pointer to command */
+/* */
+/* OUTPUT */
+/* */
+/* Completion Status */
+/* */
+/* CALLS */
+/* */
+/* _ux_host_class_hid_client_search HID client search */
+/* _ux_host_class_hid_configure Configure HID */
+/* _ux_host_class_hid_descriptor_parse Parse descriptor */
+/* _ux_host_class_hid_interrupt_endpoint_search Search endpoint */
/* _ux_host_class_hid_instance_clean Clean up instance resources */
-/* _ux_host_stack_class_instance_create Create class instance */
-/* _ux_host_stack_class_instance_destroy Destroy class instance */
-/* _ux_utility_memory_allocate Allocate memory block */
+/* _ux_host_stack_class_instance_create Create class instance */
+/* _ux_host_stack_class_instance_destroy Destroy class instance */
+/* _ux_utility_memory_allocate Allocate memory block */
/* _ux_utility_memory_free Free memory */
-/* _ux_host_semaphore_create Create semaphore */
-/* */
-/* CALLED BY */
-/* */
-/* HID Class */
-/* */
-/* RELEASE HISTORY */
-/* */
-/* DATE NAME DESCRIPTION */
-/* */
-/* 05-19-2020 Chaoqiong Xiao Initial Version 6.0 */
-/* 09-30-2020 Chaoqiong Xiao Modified comment(s), */
-/* resulting in version 6.1 */
-/* 01-31-2022 Chaoqiong Xiao Modified comment(s), */
-/* added standalone support, */
-/* resulting in version 6.1.10 */
-/* 07-29-2022 Chaoqiong Xiao Modified comment(s), */
-/* fixed parameter/variable */
-/* names conflict C++ keyword, */
-/* resulting in version 6.1.12 */
+/* _ux_host_semaphore_create Create semaphore */
+/* */
+/* CALLED BY */
+/* */
+/* HID Class */
/* */
/**************************************************************************/
UINT _ux_host_class_hid_activate(UX_HOST_CLASS_COMMAND *command)
@@ -95,12 +81,12 @@ UINT status;
/* The HID is always activated by the interface descriptor and not the
device descriptor. */
interface_ptr = (UX_INTERFACE *) command -> ux_host_class_command_container;
-
+
/* Instantiate this HID class */
hid = _ux_utility_memory_allocate(UX_NO_ALIGN, UX_REGULAR_MEMORY,sizeof(UX_HOST_CLASS_HID));
if (hid == UX_NULL)
return(UX_MEMORY_INSUFFICIENT);
-
+
/* Store the class container into this instance. */
hid -> ux_host_class_hid_class = command -> ux_host_class_command_class_ptr;
@@ -144,7 +130,7 @@ UINT status;
{
/* Search the HID interrupt endpoint but do not start it. */
- status = _ux_host_class_hid_interrupt_endpoint_search(hid);
+ status = _ux_host_class_hid_interrupt_endpoint_search(hid);
}
/* If HID interrupt endpoint is found, goes on. */
@@ -179,7 +165,7 @@ UINT status;
UX_TRACE_OBJECT_REGISTER(UX_TRACE_HOST_OBJECT_TYPE_INTERFACE, hid, 0, 0, 0)
/* Return completion code. */
- return(status);
+ return(status);
}
else
{
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 c8a17783..fcc42a75 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
@@ -1,18 +1,19 @@
/***************************************************************************
- * Copyright (c) 2024 Microsoft Corporation
- *
+ * Copyright (c) 2024 Microsoft Corporation
+ * Copyright (c) 2026-present Eclipse ThreadX contributors
+ *
* This program and the accompanying materials are made available under the
* terms of the MIT License which is available at
* https://opensource.org/licenses/MIT.
- *
+ *
* SPDX-License-Identifier: MIT
**************************************************************************/
/**************************************************************************/
/**************************************************************************/
-/** */
-/** USBX Component */
+/** */
+/** USBX Component */
/** */
/** HID Class */
/** */
@@ -30,66 +31,52 @@
UX_COMPILE_TIME_ASSERT(!UX_OVERFLOW_CHECK_MULC_ULONG(UX_HOST_CLASS_HID_MAX_CLIENTS, sizeof(UX_HOST_CLASS_HID_CLIENT)), UX_HOST_CLASS_HID_MAX_CLIENTS_mem_alloc_ovf)
-/**************************************************************************/
-/* */
-/* FUNCTION RELEASE */
-/* */
-/* _ux_host_class_hid_client_register PORTABLE C */
+/**************************************************************************/
+/* */
+/* FUNCTION RELEASE */
+/* */
+/* _ux_host_class_hid_client_register PORTABLE C */
/* 6.1.12 */
/* AUTHOR */
/* */
/* Chaoqiong Xiao, Microsoft Corporation */
/* */
/* DESCRIPTION */
-/* */
-/* This function registers a USB HID client to the HID class. The */
-/* mechanism is similar to the USB stack class registration. The Class */
-/* must specify an entry point for the USB stack to send commands */
+/* */
+/* This function registers a USB HID client to the HID class. The */
+/* mechanism is similar to the USB stack class registration. 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 hid_client_name must be NULL-terminated and */
/* the length of it (without the NULL-terminator itself) must be no */
/* larger than UX_HOST_CLASS_HID_MAX_CLIENT_NAME_LENGTH. */
/* */
-/* INPUT */
-/* */
+/* INPUT */
+/* */
/* hid_client_name Name of HID client */
-/* hid_client_handler Handler for HID client */
-/* */
-/* OUTPUT */
-/* */
-/* Completion Status */
-/* */
-/* CALLS */
-/* */
-/* _ux_host_stack_class_get Get class */
-/* _ux_utility_memory_allocate Allocate memory block */
-/* _ux_utility_memory_copy Copy memory block */
+/* hid_client_handler Handler for HID client */
+/* */
+/* OUTPUT */
+/* */
+/* Completion Status */
+/* */
+/* CALLS */
+/* */
+/* _ux_host_stack_class_get Get class */
+/* _ux_utility_memory_allocate Allocate memory block */
+/* _ux_utility_memory_copy Copy memory block */
/* _ux_utility_string_length_check Check C string and return */
/* length if null-terminated */
-/* */
-/* CALLED BY */
-/* */
-/* Application */
-/* HID Class */
-/* */
-/* RELEASE HISTORY */
-/* */
-/* DATE NAME DESCRIPTION */
-/* */
-/* 05-19-2020 Chaoqiong Xiao Initial Version 6.0 */
-/* 09-30-2020 Chaoqiong Xiao Modified comment(s), */
-/* verified memset and memcpy */
-/* cases, */
-/* resulting in version 6.1 */
-/* 07-29-2022 Chaoqiong Xiao Modified comment(s), */
-/* fixed parameter/variable */
-/* names conflict C++ keyword, */
-/* resulting in version 6.1.12 */
+/* */
+/* CALLED BY */
+/* */
+/* Application */
+/* HID Class */
/* */
/**************************************************************************/
UINT _ux_host_class_hid_client_register(UCHAR *hid_client_name,
@@ -101,7 +88,7 @@ ULONG hid_client_index;
UINT status;
UX_HOST_CLASS_HID_CLIENT *hid_client;
UINT client_name_length = 0;
-
+
/* If trace is enabled, insert this event into the trace buffer. */
UX_TRACE_IN_LINE_INSERT(UX_TRACE_HOST_CLASS_HID_CLIENT_REGISTER, hid_client_name, 0, 0, 0, UX_TRACE_HOST_CLASS_EVENTS, 0, 0)
@@ -117,7 +104,7 @@ UINT client_name_length = 0;
if (status != UX_SUCCESS)
return(status);
- /* From the class container, we get the client pointer which has the list of
+ /* From the class container, we get the client pointer which has the list of
HID clients. If the pointer is NULL, the client list was not assigned. */
if (class_ptr -> ux_host_class_client == UX_NULL)
{
@@ -125,9 +112,9 @@ UINT client_name_length = 0;
/* Allocate memory for the class client.
* Allocate size overflow static checked outside the function.
*/
- class_ptr -> ux_host_class_client = _ux_utility_memory_allocate(UX_NO_ALIGN, UX_REGULAR_MEMORY,
+ class_ptr -> ux_host_class_client = _ux_utility_memory_allocate(UX_NO_ALIGN, UX_REGULAR_MEMORY,
sizeof(UX_HOST_CLASS_HID_CLIENT)*UX_HOST_CLASS_HID_MAX_CLIENTS);
-
+
/* Check for successful allocation. */
if (class_ptr -> ux_host_class_client == UX_NULL)
return(UX_MEMORY_INSUFFICIENT);
@@ -146,7 +133,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); /* Use case of memcpy is verified. */
-
+
/* Memorize the handler address of this client. */
hid_client -> ux_host_class_hid_client_handler = hid_client_handler;
@@ -176,7 +163,7 @@ UINT client_name_length = 0;
/* Try the next class. */
hid_client++;
- }
+ }
/* Error trap. */
_ux_system_error_handler(UX_SYSTEM_LEVEL_THREAD, UX_SYSTEM_CONTEXT_CLASS, UX_MEMORY_ARRAY_FULL);
@@ -219,12 +206,6 @@ UINT client_name_length = 0;
/* */
/* Application */
/* */
-/* RELEASE HISTORY */
-/* */
-/* DATE NAME DESCRIPTION */
-/* */
-/* 10-31-2023 Chaoqiong Xiao Initial Version 6.3.0 */
-/* */
/**************************************************************************/
UINT _uxe_host_class_hid_client_register(UCHAR *hid_client_name,
UINT (*hid_client_handler)(struct UX_HOST_CLASS_HID_CLIENT_COMMAND_STRUCT *))
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 c7c6aff9..bf688853 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
@@ -1,18 +1,19 @@
/***************************************************************************
- * Copyright (c) 2024 Microsoft Corporation
- *
+ * Copyright (c) 2024 Microsoft Corporation
+ * Copyright (c) 2026-present Eclipse ThreadX contributors
+ *
* This program and the accompanying materials are made available under the
* terms of the MIT License which is available at
* https://opensource.org/licenses/MIT.
- *
+ *
* SPDX-License-Identifier: MIT
**************************************************************************/
/**************************************************************************/
/**************************************************************************/
-/** */
-/** USBX Component */
+/** */
+/** USBX Component */
/** */
/** HID Class */
/** */
@@ -29,44 +30,36 @@
#include "ux_host_stack.h"
-/**************************************************************************/
-/* */
-/* FUNCTION RELEASE */
-/* */
-/* _ux_host_class_hid_client_search PORTABLE C */
+/**************************************************************************/
+/* */
+/* FUNCTION RELEASE */
+/* */
+/* _ux_host_class_hid_client_search PORTABLE C */
/* 6.1 */
/* AUTHOR */
/* */
/* Chaoqiong Xiao, Microsoft Corporation */
/* */
/* DESCRIPTION */
-/* */
+/* */
/* This function searches for a HID client that wants to own this HID */
-/* device. */
-/* */
-/* INPUT */
-/* */
-/* hid Pointer to HID class */
-/* */
-/* OUTPUT */
-/* */
-/* Completion Status */
-/* */
-/* CALLS */
-/* */
-/* (ux_host_class_hid_client_handler) HID client handler */
-/* */
-/* CALLED BY */
-/* */
-/* HID Class */
-/* */
-/* RELEASE HISTORY */
-/* */
-/* DATE NAME DESCRIPTION */
-/* */
-/* 05-19-2020 Chaoqiong Xiao Initial Version 6.0 */
-/* 09-30-2020 Chaoqiong Xiao Modified comment(s), */
-/* resulting in version 6.1 */
+/* device. */
+/* */
+/* INPUT */
+/* */
+/* hid Pointer to HID class */
+/* */
+/* OUTPUT */
+/* */
+/* Completion Status */
+/* */
+/* CALLS */
+/* */
+/* (ux_host_class_hid_client_handler) HID client handler */
+/* */
+/* CALLED BY */
+/* */
+/* HID Class */
/* */
/**************************************************************************/
UINT _ux_host_class_hid_client_search(UX_HOST_CLASS_HID *hid)
@@ -84,10 +77,10 @@ UX_HOST_CLASS_HID_CLIENT_COMMAND hid_client_command;
hid_client_command.ux_host_class_hid_client_command_instance = hid;
hid_client_command.ux_host_class_hid_client_command_container = (VOID *) hid -> ux_host_class_hid_class;
hid_client_command.ux_host_class_hid_client_command_request = UX_HOST_CLASS_COMMAND_QUERY;
-
+
/* Dereference the client pointer into a HID client pointer. */
hid_client = (UX_HOST_CLASS_HID_CLIENT *) hid -> ux_host_class_hid_class -> ux_host_class_client;
-
+
/* If the hid_client pointer is NULL, the array of clients was not initialized. */
if (hid_client == UX_NULL)
{
@@ -100,7 +93,7 @@ UX_HOST_CLASS_HID_CLIENT_COMMAND hid_client_command;
return(UX_HOST_CLASS_HID_UNKNOWN);
}
-
+
/* We need to parse the hid client driver table to find a registered client. */
for (hid_client_index = 0; hid_client_index < UX_HOST_CLASS_HID_MAX_CLIENTS; hid_client_index++)
{
@@ -111,7 +104,7 @@ UX_HOST_CLASS_HID_CLIENT_COMMAND hid_client_command;
/* Call the HID client with a query command. */
status = hid_client -> ux_host_class_hid_client_handler(&hid_client_command);
-
+
/* Have we found a HID client? */
if (status == UX_SUCCESS)
{
@@ -128,7 +121,7 @@ UX_HOST_CLASS_HID_CLIENT_COMMAND hid_client_command;
/* Unmount the client if activation fail. */
if (status != UX_SUCCESS)
hid -> ux_host_class_hid_client = UX_NULL;
-
+
/* Return completion status. */
return(status);
}
@@ -136,7 +129,7 @@ UX_HOST_CLASS_HID_CLIENT_COMMAND hid_client_command;
/* Try the next HID client. */
hid_client++;
- }
+ }
/* Error trap. */
_ux_system_error_handler(UX_SYSTEM_LEVEL_THREAD, UX_SYSTEM_CONTEXT_CLASS, UX_HOST_CLASS_HID_UNKNOWN);
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 90e92012..feb0d61f 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
@@ -1,18 +1,19 @@
/***************************************************************************
- * Copyright (c) 2024 Microsoft Corporation
- *
+ * Copyright (c) 2024 Microsoft Corporation
+ * Copyright (c) 2026-present Eclipse ThreadX contributors
+ *
* This program and the accompanying materials are made available under the
* terms of the MIT License which is available at
* https://opensource.org/licenses/MIT.
- *
+ *
* SPDX-License-Identifier: MIT
**************************************************************************/
/**************************************************************************/
/**************************************************************************/
-/** */
-/** USBX Component */
+/** */
+/** USBX Component */
/** */
/** HID Class */
/** */
@@ -29,53 +30,40 @@
#include "ux_host_stack.h"
-/**************************************************************************/
-/* */
-/* FUNCTION RELEASE */
-/* */
-/* _ux_host_class_hid_configure PORTABLE C */
+/**************************************************************************/
+/* */
+/* FUNCTION RELEASE */
+/* */
+/* _ux_host_class_hid_configure PORTABLE C */
/* 6.1.11 */
/* AUTHOR */
/* */
/* Chaoqiong Xiao, Microsoft Corporation */
/* */
/* DESCRIPTION */
-/* */
-/* This function calls the USBX stack to do a SET_CONFIGURATION to the */
-/* HID. Once the HID is configured, its interface will be activated */
-/* and all the endpoints enumerated (1 interrupt endpoint in the case */
-/* of the HID). */
-/* */
-/* INPUT */
-/* */
-/* hid Pointer to HID class */
-/* */
-/* OUTPUT */
-/* */
-/* Completion Status */
-/* */
-/* CALLS */
-/* */
-/* _ux_host_stack_configuration_interface_get Get interface */
-/* _ux_host_stack_device_configuration_get Get configuration */
-/* _ux_host_stack_device_configuration_select Select configuration */
-/* */
-/* CALLED BY */
-/* */
-/* HID Class */
-/* */
-/* 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 */
-/* 04-25-2022 Chaoqiong Xiao Modified comment(s), */
-/* internal clean up, */
-/* resulting in version 6.1.11 */
+/* */
+/* This function calls the USBX stack to do a SET_CONFIGURATION to the */
+/* HID. Once the HID is configured, its interface will be activated */
+/* and all the endpoints enumerated (1 interrupt endpoint in the case */
+/* of the HID). */
+/* */
+/* INPUT */
+/* */
+/* hid Pointer to HID class */
+/* */
+/* OUTPUT */
+/* */
+/* Completion Status */
+/* */
+/* CALLS */
+/* */
+/* _ux_host_stack_configuration_interface_get Get interface */
+/* _ux_host_stack_device_configuration_get Get configuration */
+/* _ux_host_stack_device_configuration_select Select configuration */
+/* */
+/* CALLED BY */
+/* */
+/* HID Class */
/* */
/**************************************************************************/
UINT _ux_host_class_hid_configure(UX_HOST_CLASS_HID *hid)
@@ -97,32 +85,32 @@ UX_DEVICE *parent_device;
status = _ux_host_stack_device_configuration_get(hid -> ux_host_class_hid_device, 0, &configuration);
if (status != UX_SUCCESS)
{
-
+
/* Error trap. */
_ux_system_error_handler(UX_SYSTEM_LEVEL_THREAD, UX_SYSTEM_CONTEXT_CLASS, UX_CONFIGURATION_HANDLE_UNKNOWN);
/* If trace is enabled, insert this event into the trace buffer. */
UX_TRACE_IN_LINE_INSERT(UX_TRACE_ERROR, UX_CONFIGURATION_HANDLE_UNKNOWN, hid -> ux_host_class_hid_device, 0, 0, UX_TRACE_ERRORS, 0, 0)
-
+
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;
-
- /* Check the HID power source and check the parent power source for
+
+ /* Check the HID power source and check the parent power source for
incompatible connections. */
if (hid -> ux_host_class_hid_device -> ux_device_power_source == UX_DEVICE_BUS_POWERED)
{
-
- /* If the device is NULL, the parent is the root hid and we don't have to worry.
+
+ /* If the device is NULL, the parent is the root hid and we don't have to worry.
If the parent is not the root HID, check for its power source. */
if ((parent_device != UX_NULL) && (parent_device -> ux_device_power_source == UX_DEVICE_BUS_POWERED))
- {
+ {
/* Error trap. */
_ux_system_error_handler(UX_SYSTEM_LEVEL_THREAD, UX_SYSTEM_CONTEXT_CLASS, UX_CONNECTION_INCOMPATIBLE);
@@ -131,15 +119,15 @@ UX_DEVICE *parent_device;
UX_TRACE_IN_LINE_INSERT(UX_TRACE_ERROR, UX_CONNECTION_INCOMPATIBLE, hid, 0, 0, UX_TRACE_ERRORS, 0, 0)
return(UX_CONNECTION_INCOMPATIBLE);
- }
+ }
}
#endif
- /* We have the valid configuration. Ask the USBX stack to set this configuration. */
+ /* We have the valid configuration. Ask the USBX stack to set this configuration. */
_ux_host_stack_device_configuration_select(configuration);
- /* If the operation went well, the hid default alternate setting for the HID interface is active
- and the interrupt endpoint is now enabled. We have to memorize the first interface since the
+ /* If the operation went well, the hid default alternate setting for the HID interface is active
+ and the interrupt endpoint is now enabled. We have to memorize the first interface since the
interrupt endpoint is hooked to it. */
status = _ux_host_stack_configuration_interface_get(configuration, 0, 0, &hid -> ux_host_class_hid_interface);
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 c129a735..eab333f2 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
@@ -1,5 +1,6 @@
/***************************************************************************
* Copyright (c) 2024 Microsoft Corporation
+ * Copyright (c) 2026-present Eclipse ThreadX contributors
*
* This program and the accompanying materials are made available under the
* terms of the MIT License which is available at
@@ -68,17 +69,6 @@
/* */
/* HID Class */
/* */
-/* RELEASE HISTORY */
-/* */
-/* DATE NAME DESCRIPTION */
-/* */
-/* 05-19-2020 Chaoqiong Xiao Initial Version 6.0 */
-/* 09-30-2020 Chaoqiong Xiao Modified comment(s), */
-/* resulting in version 6.1 */
-/* 01-31-2022 Chaoqiong Xiao Modified comment(s), */
-/* added standalone support, */
-/* resulting in version 6.1.10 */
-/* */
/**************************************************************************/
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 99e2f45f..618c8ae2 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
@@ -1,18 +1,19 @@
/***************************************************************************
- * Copyright (c) 2024 Microsoft Corporation
- *
+ * Copyright (c) 2024 Microsoft Corporation
+ * Copyright (c) 2026-present Eclipse ThreadX contributors
+ *
* This program and the accompanying materials are made available under the
* terms of the MIT License which is available at
* https://opensource.org/licenses/MIT.
- *
+ *
* SPDX-License-Identifier: MIT
**************************************************************************/
/**************************************************************************/
/**************************************************************************/
-/** */
-/** USBX Component */
+/** */
+/** USBX Component */
/** */
/** HID Class */
/** */
@@ -29,52 +30,40 @@
#include "ux_host_stack.h"
-/**************************************************************************/
-/* */
-/* FUNCTION RELEASE */
-/* */
-/* _ux_host_class_hid_descriptor_parse PORTABLE C */
+/**************************************************************************/
+/* */
+/* FUNCTION RELEASE */
+/* */
+/* _ux_host_class_hid_descriptor_parse PORTABLE C */
/* 6.1.12 */
/* AUTHOR */
/* */
/* Chaoqiong Xiao, Microsoft Corporation */
/* */
/* DESCRIPTION */
-/* */
-/* This function obtains the HID descriptor and parses it. */
-/* */
-/* INPUT */
-/* */
-/* hid Pointer to HID class */
-/* */
-/* OUTPUT */
-/* */
-/* Completion Status */
-/* */
-/* CALLS */
-/* */
-/* _ux_host_class_hid_report_descriptor_get */
-/* Get HID report descriptor */
-/* _ux_host_stack_transfer_request Process transfer request */
-/* _ux_utility_descriptor_parse Parse descriptor */
-/* _ux_utility_memory_allocate Allocate memory block */
-/* _ux_utility_memory_free Release memory block */
-/* */
-/* CALLED BY */
-/* */
-/* HID Class */
-/* */
-/* RELEASE HISTORY */
-/* */
-/* DATE NAME DESCRIPTION */
-/* */
-/* 05-19-2020 Chaoqiong Xiao Initial Version 6.0 */
-/* 09-30-2020 Chaoqiong Xiao Modified comment(s), */
-/* resulting in version 6.1 */
-/* 07-29-2022 Chaoqiong Xiao Modified comment(s), */
-/* used shared device config */
-/* descriptor for enum scan, */
-/* resulting in version 6.1.12 */
+/* */
+/* This function obtains the HID descriptor and parses it. */
+/* */
+/* INPUT */
+/* */
+/* hid Pointer to HID class */
+/* */
+/* OUTPUT */
+/* */
+/* Completion Status */
+/* */
+/* CALLS */
+/* */
+/* _ux_host_class_hid_report_descriptor_get */
+/* Get HID report descriptor */
+/* _ux_host_stack_transfer_request Process transfer request */
+/* _ux_utility_descriptor_parse Parse descriptor */
+/* _ux_utility_memory_allocate Allocate memory block */
+/* _ux_utility_memory_free Release memory block */
+/* */
+/* CALLED BY */
+/* */
+/* HID Class */
/* */
/**************************************************************************/
UINT _ux_host_class_hid_descriptor_parse(UX_HOST_CLASS_HID *hid)
@@ -91,7 +80,7 @@ UX_INTERFACE_DESCRIPTOR interface_descriptor;
UINT status;
ULONG total_configuration_length;
UINT descriptor_length;
-UINT descriptor_type;
+UINT descriptor_type;
ULONG current_interface;
/* Get device, current configuration. */
@@ -113,7 +102,7 @@ ULONG current_interface;
control_endpoint = &device -> ux_device_control_endpoint;
transfer_request = &control_endpoint -> ux_endpoint_transfer_request;
- /* Need to allocate memory for the descriptor. Since we do not know the size of the
+ /* Need to allocate memory for the descriptor. Since we do not know the size of the
descriptor, we first read the first bytes. */
descriptor = _ux_utility_memory_allocate(UX_SAFE_ALIGN, UX_CACHE_SAFE_MEMORY, total_configuration_length);
if (descriptor == UX_NULL)
@@ -137,7 +126,7 @@ ULONG current_interface;
if (transfer_request -> ux_transfer_request_actual_length != total_configuration_length)
status = UX_DESCRIPTOR_CORRUPTED;
}
-
+
/* Reset the current interface to keep compiler warnings happy. */
current_interface = 0;
@@ -145,15 +134,15 @@ ULONG current_interface;
if (status == UX_SUCCESS)
{
- /* The HID descriptor is embedded within the configuration descriptor. We parse the
+ /* The HID descriptor is embedded within the configuration descriptor. We parse the
entire descriptor to locate the HID portion. */
while (total_configuration_length)
{
-
+
/* Gather the length and type of the descriptor. */
descriptor_length = *descriptor;
descriptor_type = *(descriptor + 1);
-
+
/* Make sure this descriptor has at least the minimum length. */
if (descriptor_length < 3)
{
@@ -183,7 +172,7 @@ ULONG current_interface;
/* Memorize the interface we are scanning. */
current_interface = interface_descriptor.bInterfaceNumber;
}
-
+
/* Check the type for an interface descriptor. */
/* Check if the descriptor belongs to interface attached to this instance. */
if (descriptor_type == UX_HOST_CLASS_HID_DESCRIPTOR)
@@ -208,7 +197,7 @@ ULONG current_interface;
return(status);
}
}
-
+
/* Verify if the descriptor is still valid. */
if (descriptor_length > total_configuration_length)
{
@@ -225,10 +214,10 @@ ULONG current_interface;
/* Return an error. */
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_configuration_length -= descriptor_length;
}
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 b7edf1b1..09024323 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
@@ -1,10 +1,11 @@
/***************************************************************************
- * Copyright (c) 2024 Microsoft Corporation
- *
+ * Copyright (c) 2024 Microsoft Corporation
+ * Copyright (c) 2026-present Eclipse ThreadX contributors
+ *
* This program and the accompanying materials are made available under the
* terms of the MIT License which is available at
* https://opensource.org/licenses/MIT.
- *
+ *
* SPDX-License-Identifier: MIT
**************************************************************************/
@@ -80,23 +81,6 @@ static inline UINT _ux_host_class_hid_activate_wait(UX_HOST_CLASS_COMMAND *comma
/* Application */
/* HID Class */
/* */
-/* RELEASE HISTORY */
-/* */
-/* 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 */
-/* 01-31-2022 Chaoqiong Xiao Modified comment(s), */
-/* added standalone support, */
-/* resulting in version 6.1.10 */
-/* 07-29-2022 Chaoqiong Xiao Modified comment(s), */
-/* fixed uninited variable, */
-/* fixed parameter/variable */
-/* names conflict C++ keyword, */
-/* resulting in version 6.1.12 */
-/* */
/**************************************************************************/
UINT _ux_host_class_hid_entry(UX_HOST_CLASS_COMMAND *command)
{
@@ -374,7 +358,7 @@ UINT status = UX_SUCCESS;
{
/* Get one item from the report and analyze it. */
- _ux_host_class_hid_report_item_analyse(descriptor, &item);
+ _ux_host_class_hid_report_item_analyse(descriptor, length, &item);
/* Point the descriptor right after the item identifier. */
descriptor += item.ux_host_class_hid_item_report_format;
@@ -389,7 +373,7 @@ UINT status = UX_SUCCESS;
status = _ux_host_class_hid_global_item_parse(hid, &item, descriptor);
break;
-
+
case UX_HOST_CLASS_HID_TYPE_MAIN:
/* This is a main item. */
@@ -401,13 +385,13 @@ UINT status = UX_SUCCESS;
/* This is a local item. */
status = _ux_host_class_hid_local_item_parse(hid, &item, descriptor);
- break;
+ break;
default:
/* This is a reserved item, meaning it shouldn't be used! */
- /* Set status to error. The check after this switch statement
+ /* Set status to error. The check after this switch statement
will handle the rest. */
status = UX_DESCRIPTOR_CORRUPTED;
break;
@@ -421,7 +405,7 @@ UINT status = UX_SUCCESS;
/* Jump to the next item. */
descriptor += item.ux_host_class_hid_item_report_length;
-
+
/* Verify that the report descriptor is not corrupted. */
if (length < item.ux_host_class_hid_item_report_length)
{
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 5ef3113c..92ca0c5f 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
@@ -1,18 +1,19 @@
/***************************************************************************
- * Copyright (c) 2024 Microsoft Corporation
- *
+ * Copyright (c) 2024 Microsoft Corporation
+ * Copyright (c) 2026-present Eclipse ThreadX contributors
+ *
* This program and the accompanying materials are made available under the
* terms of the MIT License which is available at
* https://opensource.org/licenses/MIT.
- *
+ *
* SPDX-License-Identifier: MIT
**************************************************************************/
/**************************************************************************/
/**************************************************************************/
-/** */
-/** USBX Component */
+/** */
+/** USBX Component */
/** */
/** HID Class */
/** */
@@ -29,48 +30,37 @@
#include "ux_host_stack.h"
-/**************************************************************************/
-/* */
-/* FUNCTION RELEASE */
-/* */
-/* _ux_host_class_hid_field_decompress PORTABLE C */
+/**************************************************************************/
+/* */
+/* FUNCTION RELEASE */
+/* */
+/* _ux_host_class_hid_field_decompress PORTABLE C */
/* 6.3.0 */
/* AUTHOR */
/* */
/* Chaoqiong Xiao, Microsoft Corporation */
/* */
/* DESCRIPTION */
-/* */
-/* This function will decompress a field and return the usage/value. */
-/* */
-/* INPUT */
-/* */
-/* hid_field Pointer to HID field */
-/* report_buffer Pointer to report buffer */
-/* client_report Pointer to client report */
-/* */
-/* OUTPUT */
-/* */
-/* Completion Status */
-/* */
-/* CALLS */
-/* */
-/* None */
-/* */
-/* CALLED BY */
-/* */
-/* HID Class */
-/* */
-/* RELEASE HISTORY */
-/* */
-/* DATE NAME DESCRIPTION */
-/* */
-/* 05-19-2020 Chaoqiong Xiao Initial Version 6.0 */
-/* 09-30-2020 Chaoqiong Xiao Modified comment(s), */
-/* resulting in version 6.1 */
-/* 10-31-2023 Chaoqiong Xiao Modified comment(s), */
-/* improved usage handling, */
-/* resulting in version 6.3.0 */
+/* */
+/* This function will decompress a field and return the usage/value. */
+/* */
+/* INPUT */
+/* */
+/* hid_field Pointer to HID field */
+/* report_buffer Pointer to report buffer */
+/* client_report Pointer to client report */
+/* */
+/* OUTPUT */
+/* */
+/* Completion Status */
+/* */
+/* CALLS */
+/* */
+/* None */
+/* */
+/* CALLED BY */
+/* */
+/* HID Class */
/* */
/**************************************************************************/
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)
@@ -93,40 +83,40 @@ ULONG report_content;
/* Calculate the bit start address. Hopefully things will be on a boundary but not necessary. */
data_offset_bit = hid_field -> ux_host_class_hid_field_report_offset & 7;
- /* Each report field has a report_count value. This count is used to extract values from the
+ /* Each report field has a report_count value. This count is used to extract values from the
incoming report and build each usage/value instance. */
for (field_report_count = 0; field_report_count < hid_field -> ux_host_class_hid_field_report_count; field_report_count++)
{
/* Get the report size in bits. */
field_report_size = hid_field -> ux_host_class_hid_field_report_size;
-
+
/* We use the bit offset for this report and not the generic field bit offset. */
data_offset_bit_in_report = data_offset_bit;
-
+
/* Reset the local value. */
field_value = 0;
-
+
/* And start with bit 0 in the target value. */
field_value_bit_shifting = 0;
-
+
/* Build the value field bit by bit. */
while (field_report_size-- != 0)
{
- /* Read the content. This method is redundant if we are not changing byte but it
+ /* Read the content. This method is redundant if we are not changing byte but it
makes the algorithm much easier. */
- report_content = (ULONG) *(report_buffer + data_offset_byte + (data_offset_bit_in_report >> 3));
-
+ report_content = (ULONG) *(report_buffer + data_offset_byte + (data_offset_bit_in_report >> 3));
+
/* Shift the current value content to allow space to store the new bit. */
field_value |= ((report_content >> (data_offset_bit_in_report & 7)) & 1) << field_value_bit_shifting;
-
+
/* Move to next bit in the report. */
data_offset_bit_in_report++;
-
+
/* And the next bit in the value. */
field_value_bit_shifting++;
- }
+ }
/* The Usage value will depend if the data is defined as a variable or an array in the HID report. */
if (hid_field -> ux_host_class_hid_field_value & UX_HOST_CLASS_HID_ITEM_VARIABLE)
@@ -141,8 +131,8 @@ ULONG report_content;
else
{
- /* This is an array, so compute the usage from the min value, the report count and the
- computed report value. */
+ /* This is an array, so compute the usage from the min value, the report count and the
+ computed report value. */
field_usage = hid_field -> ux_host_class_hid_field_usage_min + (ULONG)((SLONG)field_value - hid_field -> ux_host_class_hid_field_logical_min);
/* Also add the usage page. */
@@ -157,7 +147,7 @@ ULONG report_content;
/* Calculate the next address for this field. */
data_offset_bit += hid_field -> ux_host_class_hid_field_report_size;
- }
+ }
/* Return successful completion. */
return(UX_SUCCESS);
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 1988d993..9323792b 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
@@ -1,18 +1,19 @@
/***************************************************************************
- * Copyright (c) 2024 Microsoft Corporation
- *
+ * Copyright (c) 2024 Microsoft Corporation
+ * Copyright (c) 2026-present Eclipse ThreadX contributors
+ *
* This program and the accompanying materials are made available under the
* terms of the MIT License which is available at
* https://opensource.org/licenses/MIT.
- *
+ *
* SPDX-License-Identifier: MIT
**************************************************************************/
/**************************************************************************/
/**************************************************************************/
-/** */
-/** USBX Component */
+/** */
+/** USBX Component */
/** */
/** HID Class */
/** */
@@ -29,48 +30,38 @@
#include "ux_host_stack.h"
-/**************************************************************************/
-/* */
-/* FUNCTION RELEASE */
-/* */
-/* _ux_host_class_hid_global_item_parse PORTABLE C */
+/**************************************************************************/
+/* */
+/* FUNCTION RELEASE */
+/* */
+/* _ux_host_class_hid_global_item_parse PORTABLE C */
/* 6.1 */
/* AUTHOR */
/* */
/* Chaoqiong Xiao, Microsoft Corporation */
/* */
/* DESCRIPTION */
-/* */
-/* This function parses a global item from the report descriptor. */
-/* */
-/* INPUT */
-/* */
-/* hid Pointer to HID class */
-/* item Pointer to item */
-/* descriptor Pointer to descriptor */
-/* */
-/* OUTPUT */
-/* */
-/* Completion Status */
-/* */
-/* CALLS */
-/* */
-/* _ux_host_class_hid_item_data_get Get data item */
-/* _ux_utility_memory_copy Copy memory block */
-/* */
-/* CALLED BY */
-/* */
-/* HID Class */
-/* */
-/* RELEASE HISTORY */
-/* */
-/* DATE NAME DESCRIPTION */
-/* */
-/* 05-19-2020 Chaoqiong Xiao Initial Version 6.0 */
-/* 09-30-2020 Chaoqiong Xiao Modified comment(s), */
-/* verified memset and memcpy */
-/* cases, */
-/* resulting in version 6.1 */
+/* */
+/* This function parses a global item from the report descriptor. */
+/* */
+/* INPUT */
+/* */
+/* hid Pointer to HID class */
+/* item Pointer to item */
+/* descriptor Pointer to descriptor */
+/* */
+/* OUTPUT */
+/* */
+/* Completion Status */
+/* */
+/* CALLS */
+/* */
+/* _ux_host_class_hid_item_data_get Get data item */
+/* _ux_utility_memory_copy Copy memory block */
+/* */
+/* CALLED BY */
+/* */
+/* HID Class */
/* */
/**************************************************************************/
UINT _ux_host_class_hid_global_item_parse(UX_HOST_CLASS_HID *hid, UX_HOST_CLASS_HID_ITEM *item, UCHAR *descriptor)
@@ -89,7 +80,7 @@ UX_HOST_CLASS_HID_PARSER *hid_parser;
case UX_HOST_CLASS_HID_GLOBAL_TAG_USAGE_PAGE:
/* Usage Page Tag. */
- hid_parser -> ux_host_class_hid_parser_global.ux_host_class_hid_global_item_usage_page =
+ hid_parser -> ux_host_class_hid_parser_global.ux_host_class_hid_global_item_usage_page =
_ux_host_class_hid_item_data_get(descriptor, item);
break;
@@ -97,7 +88,7 @@ UX_HOST_CLASS_HID_PARSER *hid_parser;
case UX_HOST_CLASS_HID_GLOBAL_TAG_LOGICAL_MINIMUM:
/* Logical Minimum Tag. */
- hid_parser -> ux_host_class_hid_parser_global.ux_host_class_hid_global_item_logical_min =
+ hid_parser -> ux_host_class_hid_parser_global.ux_host_class_hid_global_item_logical_min =
(SLONG) _ux_host_class_hid_item_data_get(descriptor, item);
break;
@@ -105,7 +96,7 @@ UX_HOST_CLASS_HID_PARSER *hid_parser;
case UX_HOST_CLASS_HID_GLOBAL_TAG_LOGICAL_MAXIMUM:
/* Logical Maximum Tag. */
- hid_parser -> ux_host_class_hid_parser_global.ux_host_class_hid_global_item_logical_max =
+ hid_parser -> ux_host_class_hid_parser_global.ux_host_class_hid_global_item_logical_max =
(SLONG) _ux_host_class_hid_item_data_get(descriptor, item);
break;
@@ -113,7 +104,7 @@ UX_HOST_CLASS_HID_PARSER *hid_parser;
case UX_HOST_CLASS_HID_GLOBAL_TAG_PHYSICAL_MINIMUM:
/* Physical Minimum Tag. */
- hid_parser -> ux_host_class_hid_parser_global.ux_host_class_hid_global_item_physical_min =
+ hid_parser -> ux_host_class_hid_parser_global.ux_host_class_hid_global_item_physical_min =
(SLONG) _ux_host_class_hid_item_data_get(descriptor, item);
break;
@@ -121,7 +112,7 @@ UX_HOST_CLASS_HID_PARSER *hid_parser;
case UX_HOST_CLASS_HID_GLOBAL_TAG_PHYSICAL_MAXIMUM:
/* Physical Maximum Tag. */
- hid_parser -> ux_host_class_hid_parser_global.ux_host_class_hid_global_item_physical_max =
+ hid_parser -> ux_host_class_hid_parser_global.ux_host_class_hid_global_item_physical_max =
(SLONG) _ux_host_class_hid_item_data_get(descriptor, item);
break;
@@ -129,15 +120,15 @@ UX_HOST_CLASS_HID_PARSER *hid_parser;
case UX_HOST_CLASS_HID_GLOBAL_TAG_UNIT_EXPONENT:
/* Unit Exponent Tag. */
- hid_parser -> ux_host_class_hid_parser_global.ux_host_class_hid_global_item_unit_expo =
+ hid_parser -> ux_host_class_hid_parser_global.ux_host_class_hid_global_item_unit_expo =
_ux_host_class_hid_item_data_get(descriptor, item);
break;
-
+
case UX_HOST_CLASS_HID_GLOBAL_TAG_UNIT:
/* Unit tag. */
- hid_parser -> ux_host_class_hid_parser_global.ux_host_class_hid_global_item_unit =
+ hid_parser -> ux_host_class_hid_parser_global.ux_host_class_hid_global_item_unit =
_ux_host_class_hid_item_data_get(descriptor, item);
break;
@@ -145,7 +136,7 @@ UX_HOST_CLASS_HID_PARSER *hid_parser;
case UX_HOST_CLASS_HID_GLOBAL_TAG_REPORT_SIZE:
/* Report Size tag. */
- hid_parser -> ux_host_class_hid_parser_global.ux_host_class_hid_global_item_report_size =
+ hid_parser -> ux_host_class_hid_parser_global.ux_host_class_hid_global_item_report_size =
_ux_host_class_hid_item_data_get(descriptor, item);
if (hid_parser -> ux_host_class_hid_parser_global.ux_host_class_hid_global_item_report_size > UX_HOST_CLASS_HID_REPORT_SIZE)
@@ -156,9 +147,9 @@ UX_HOST_CLASS_HID_PARSER *hid_parser;
/* If trace is enabled, insert this event into the trace buffer. */
UX_TRACE_IN_LINE_INSERT(UX_TRACE_ERROR, UX_HOST_CLASS_HID_REPORT_OVERFLOW, hid, 0, 0, UX_TRACE_ERRORS, 0, 0)
-
+
return(UX_HOST_CLASS_HID_REPORT_OVERFLOW);
- }
+ }
break;
@@ -166,7 +157,7 @@ UX_HOST_CLASS_HID_PARSER *hid_parser;
case UX_HOST_CLASS_HID_GLOBAL_TAG_REPORT_ID:
/* Report ID tag. */
- hid_parser -> ux_host_class_hid_parser_global.ux_host_class_hid_global_item_report_id =
+ hid_parser -> ux_host_class_hid_parser_global.ux_host_class_hid_global_item_report_id =
_ux_host_class_hid_item_data_get(descriptor, item);
break;
@@ -174,7 +165,7 @@ UX_HOST_CLASS_HID_PARSER *hid_parser;
case UX_HOST_CLASS_HID_GLOBAL_TAG_REPORT_COUNT:
/* Report Count tag. */
- hid_parser -> ux_host_class_hid_parser_global.ux_host_class_hid_global_item_report_count =
+ hid_parser -> ux_host_class_hid_parser_global.ux_host_class_hid_global_item_report_count =
_ux_host_class_hid_item_data_get(descriptor, item);
if (hid_parser -> ux_host_class_hid_parser_global.ux_host_class_hid_global_item_report_count > UX_HOST_CLASS_HID_USAGES)
@@ -188,7 +179,7 @@ UX_HOST_CLASS_HID_PARSER *hid_parser;
return(UX_HOST_CLASS_HID_USAGE_OVERFLOW);
}
-
+
break;
case UX_HOST_CLASS_HID_GLOBAL_TAG_PUSH:
@@ -205,13 +196,13 @@ UX_HOST_CLASS_HID_PARSER *hid_parser;
return(UX_HOST_CLASS_HID_PUSH_OVERFLOW);
}
-
+
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)); /* Use case of memcpy is verified. */
break;
-
+
case UX_HOST_CLASS_HID_GLOBAL_TAG_POP:
/* Pop tag. */
@@ -244,7 +235,7 @@ UX_HOST_CLASS_HID_PARSER *hid_parser;
/* This tag was not recognized or is not supported. */
return(UX_HOST_CLASS_HID_TAG_UNSUPPORTED);
- }
+ }
/* We get here when the tag has been processed successfully. */
return(UX_SUCCESS);
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 ad12a0b3..e1208842 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
@@ -1,18 +1,19 @@
/***************************************************************************
- * Copyright (c) 2024 Microsoft Corporation
- *
+ * Copyright (c) 2024 Microsoft Corporation
+ * Copyright (c) 2026-present Eclipse ThreadX contributors
+ *
* This program and the accompanying materials are made available under the
* terms of the MIT License which is available at
* https://opensource.org/licenses/MIT.
- *
+ *
* SPDX-License-Identifier: MIT
**************************************************************************/
/**************************************************************************/
/**************************************************************************/
-/** */
-/** USBX Component */
+/** */
+/** USBX Component */
/** */
/** HID Class */
/** */
@@ -29,53 +30,40 @@
#include "ux_host_stack.h"
-/**************************************************************************/
-/* */
-/* FUNCTION RELEASE */
-/* */
-/* _ux_host_class_hid_idle_get PORTABLE C */
+/**************************************************************************/
+/* */
+/* FUNCTION RELEASE */
+/* */
+/* _ux_host_class_hid_idle_get PORTABLE C */
/* 6.1.10 */
/* AUTHOR */
/* */
/* Chaoqiong Xiao, Microsoft Corporation */
/* */
/* DESCRIPTION */
-/* */
-/* This function performs a GET_IDLE to the HID device. */
-/* */
-/* INPUT */
-/* */
-/* hid Pointer to HID class */
-/* idle_time Idle time */
-/* report_id Report ID */
-/* */
-/* OUTPUT */
-/* */
-/* Completion Status */
-/* */
-/* CALLS */
-/* */
-/* _ux_host_stack_class_instance_verify Verify instance is valid */
-/* _ux_host_stack_transfer_request Process transfer request */
-/* _ux_host_semaphore_get Get protection semaphore */
-/* _ux_host_semaphore_put Release protection semaphore */
-/* */
-/* CALLED BY */
-/* */
-/* HID Class */
-/* */
-/* RELEASE HISTORY */
-/* */
-/* DATE NAME DESCRIPTION */
-/* */
-/* 05-19-2020 Chaoqiong Xiao Initial Version 6.0 */
-/* 09-30-2020 Chaoqiong Xiao Modified comment(s), */
-/* protected default control */
-/* endpoint before using it, */
-/* resulting in version 6.1 */
-/* 01-31-2022 Chaoqiong Xiao Modified comment(s), */
-/* added standalone support, */
-/* resulting in version 6.1.10 */
+/* */
+/* This function performs a GET_IDLE to the HID device. */
+/* */
+/* INPUT */
+/* */
+/* hid Pointer to HID class */
+/* idle_time Idle time */
+/* report_id Report ID */
+/* */
+/* OUTPUT */
+/* */
+/* Completion Status */
+/* */
+/* CALLS */
+/* */
+/* _ux_host_stack_class_instance_verify Verify instance is valid */
+/* _ux_host_stack_transfer_request Process transfer request */
+/* _ux_host_semaphore_get Get protection semaphore */
+/* _ux_host_semaphore_put Release protection semaphore */
+/* */
+/* CALLED BY */
+/* */
+/* HID Class */
/* */
/**************************************************************************/
UINT _ux_host_class_hid_idle_get(UX_HOST_CLASS_HID *hid, USHORT *idle_time, USHORT report_id)
@@ -93,7 +81,7 @@ UINT status;
/* Ensure the instance is valid. */
if (_ux_host_stack_class_instance_verify(_ux_system_host_class_hid_name, (VOID *) hid) != UX_SUCCESS)
- {
+ {
/* If trace is enabled, insert this event into the trace buffer. */
UX_TRACE_IN_LINE_INSERT(UX_TRACE_ERROR, UX_HOST_CLASS_INSTANCE_UNKNOWN, hid, 0, 0, UX_TRACE_ERRORS, 0, 0)
@@ -119,7 +107,7 @@ UINT status;
status = _ux_host_semaphore_get(&hid -> ux_host_class_hid_semaphore, UX_WAIT_FOREVER);
if (status != UX_SUCCESS)
-
+
/* Return error. */
return(status);
#endif
@@ -136,7 +124,7 @@ UINT status;
return(UX_MEMORY_INSUFFICIENT);
}
- /* Protect the control endpoint semaphore here. It will be unprotected in the
+ /* Protect the control endpoint semaphore here. It will be unprotected in the
transfer request function. */
#if defined(UX_HOST_STANDALONE)
UX_DISABLE
@@ -193,7 +181,7 @@ UINT status;
/* Check for correct transfer and for the entire descriptor returned. */
if ((status == UX_SUCCESS) && (transfer_request -> ux_transfer_request_actual_length == 1))
- *idle_time = (USHORT) *idle_byte;
+ *idle_time = (USHORT) *idle_byte;
/* Free used resources. */
_ux_utility_memory_free(idle_byte);
@@ -226,8 +214,8 @@ UINT status;
/* INPUT */
/* */
/* hid Pointer to HID class */
-/* idle_time Idle time */
-/* report_id Report ID */
+/* idle_time Idle time */
+/* report_id Report ID */
/* */
/* OUTPUT */
/* */
@@ -241,12 +229,6 @@ UINT status;
/* */
/* Application */
/* */
-/* RELEASE HISTORY */
-/* */
-/* DATE NAME DESCRIPTION */
-/* */
-/* 10-31-2023 Chaoqiong Xiao Initial Version 6.3.0 */
-/* */
/**************************************************************************/
UINT _uxe_host_class_hid_idle_get(UX_HOST_CLASS_HID *hid, USHORT *idle_time, USHORT report_id)
{
diff --git a/common/usbx_host_classes/src/ux_host_class_hid_idle_set.c b/common/usbx_host_classes/src/ux_host_class_hid_idle_set.c
index a7c8ce79..fe74debd 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
@@ -1,18 +1,19 @@
/***************************************************************************
- * Copyright (c) 2024 Microsoft Corporation
- *
+ * Copyright (c) 2024 Microsoft Corporation
+ * Copyright (c) 2026-present Eclipse ThreadX contributors
+ *
* This program and the accompanying materials are made available under the
* terms of the MIT License which is available at
* https://opensource.org/licenses/MIT.
- *
+ *
* SPDX-License-Identifier: MIT
**************************************************************************/
/**************************************************************************/
/**************************************************************************/
-/** */
-/** USBX Component */
+/** */
+/** USBX Component */
/** */
/** HID Class */
/** */
@@ -29,53 +30,40 @@
#include "ux_host_stack.h"
-/**************************************************************************/
-/* */
-/* FUNCTION RELEASE */
-/* */
-/* _ux_host_class_hid_idle_set PORTABLE C */
+/**************************************************************************/
+/* */
+/* FUNCTION RELEASE */
+/* */
+/* _ux_host_class_hid_idle_set PORTABLE C */
/* 6.1.10 */
/* AUTHOR */
/* */
/* Chaoqiong Xiao, Microsoft Corporation */
/* */
/* DESCRIPTION */
-/* */
-/* This function performs a SET_IDLE to the HID device. */
-/* */
-/* INPUT */
-/* */
-/* hid Pointer to HID class */
-/* idle_time Idle time */
-/* report_id Report ID */
-/* */
-/* OUTPUT */
-/* */
-/* Completion Status */
-/* */
-/* CALLS */
-/* */
-/* _ux_host_stack_class_instance_verify Verify instance is valid */
-/* _ux_host_stack_transfer_request Process transfer request */
-/* _ux_host_semaphore_get Get protection semaphore */
-/* _ux_host_semaphore_put Release protection semaphore */
-/* */
-/* CALLED BY */
-/* */
-/* HID Class */
-/* */
-/* RELEASE HISTORY */
-/* */
-/* DATE NAME DESCRIPTION */
-/* */
-/* 05-19-2020 Chaoqiong Xiao Initial Version 6.0 */
-/* 09-30-2020 Chaoqiong Xiao Modified comment(s), */
-/* protected default control */
-/* endpoint before using it, */
-/* resulting in version 6.1 */
-/* 01-31-2022 Chaoqiong Xiao Modified comment(s), */
-/* added standalone support, */
-/* resulting in version 6.1.10 */
+/* */
+/* This function performs a SET_IDLE to the HID device. */
+/* */
+/* INPUT */
+/* */
+/* hid Pointer to HID class */
+/* idle_time Idle time */
+/* report_id Report ID */
+/* */
+/* OUTPUT */
+/* */
+/* Completion Status */
+/* */
+/* CALLS */
+/* */
+/* _ux_host_stack_class_instance_verify Verify instance is valid */
+/* _ux_host_stack_transfer_request Process transfer request */
+/* _ux_host_semaphore_get Get protection semaphore */
+/* _ux_host_semaphore_put Release protection semaphore */
+/* */
+/* CALLED BY */
+/* */
+/* HID Class */
/* */
/**************************************************************************/
UINT _ux_host_class_hid_idle_set(UX_HOST_CLASS_HID *hid, USHORT idle_time, USHORT report_id)
@@ -98,7 +86,7 @@ UINT status;
/* Ensure the instance is valid. */
if (_ux_host_stack_class_instance_verify(_ux_system_host_class_hid_name, (VOID *) hid) != UX_SUCCESS)
- {
+ {
/* If trace is enabled, insert this event into the trace buffer. */
UX_TRACE_IN_LINE_INSERT(UX_TRACE_ERROR, UX_HOST_CLASS_INSTANCE_UNKNOWN, hid, 0, 0, UX_TRACE_ERRORS, 0, 0)
@@ -115,7 +103,7 @@ UINT status;
if (status != UX_SUCCESS)
return(status);
- /* Protect the control endpoint semaphore here. It will be unprotected in the
+ /* Protect the control endpoint semaphore here. It will be unprotected in the
transfer request function. */
status = _ux_host_semaphore_get(&hid -> ux_host_class_hid_device -> ux_device_protection_semaphore, UX_WAIT_FOREVER);
@@ -181,12 +169,6 @@ UINT status;
/* */
/* Application */
/* */
-/* RELEASE HISTORY */
-/* */
-/* DATE NAME DESCRIPTION */
-/* */
-/* 10-31-2023 Chaoqiong Xiao Initial Version 6.3.0 */
-/* */
/**************************************************************************/
UINT _uxe_host_class_hid_idle_set(UX_HOST_CLASS_HID *hid, USHORT idle_time, USHORT report_id)
{
diff --git a/common/usbx_host_classes/src/ux_host_class_hid_idle_set_run.c b/common/usbx_host_classes/src/ux_host_class_hid_idle_set_run.c
index 927d88cb..386bab80 100644
--- a/common/usbx_host_classes/src/ux_host_class_hid_idle_set_run.c
+++ b/common/usbx_host_classes/src/ux_host_class_hid_idle_set_run.c
@@ -1,10 +1,11 @@
/***************************************************************************
- * Copyright (c) 2024 Microsoft Corporation
- *
+ * Copyright (c) 2024 Microsoft Corporation
+ * Copyright (c) 2026-present Eclipse ThreadX contributors
+ *
* This program and the accompanying materials are made available under the
* terms of the MIT License which is available at
* https://opensource.org/licenses/MIT.
- *
+ *
* SPDX-License-Identifier: MIT
**************************************************************************/
@@ -65,12 +66,6 @@
/* */
/* HID Class */
/* */
-/* RELEASE HISTORY */
-/* */
-/* DATE NAME DESCRIPTION */
-/* */
-/* 01-31-2022 Chaoqiong Xiao Initial Version 6.1.10 */
-/* */
/**************************************************************************/
UINT _ux_host_class_hid_idle_set_run(UX_HOST_CLASS_HID *hid, USHORT idle_time, USHORT report_id)
{
@@ -195,8 +190,8 @@ UINT status;
/* INPUT */
/* */
/* hid Pointer to HID class */
-/* idle_time Idle time */
-/* report_id Report ID */
+/* idle_time Idle time */
+/* report_id Report ID */
/* */
/* OUTPUT */
/* */
@@ -210,12 +205,6 @@ UINT status;
/* */
/* Application */
/* */
-/* RELEASE HISTORY */
-/* */
-/* DATE NAME DESCRIPTION */
-/* */
-/* 10-31-2023 Chaoqiong Xiao Initial Version 6.3.0 */
-/* */
/**************************************************************************/
UINT _uxe_host_class_hid_idle_set_run(UX_HOST_CLASS_HID *hid, USHORT idle_time, USHORT report_id)
{
diff --git a/common/usbx_host_classes/src/ux_host_class_hid_instance_clean.c b/common/usbx_host_classes/src/ux_host_class_hid_instance_clean.c
index 9bc62b9c..690cd5fd 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
@@ -1,18 +1,19 @@
/***************************************************************************
- * Copyright (c) 2024 Microsoft Corporation
- *
+ * Copyright (c) 2024 Microsoft Corporation
+ * Copyright (c) 2026-present Eclipse ThreadX contributors
+ *
* This program and the accompanying materials are made available under the
* terms of the MIT License which is available at
* https://opensource.org/licenses/MIT.
- *
+ *
* SPDX-License-Identifier: MIT
**************************************************************************/
/**************************************************************************/
/**************************************************************************/
-/** */
-/** USBX Component */
+/** */
+/** USBX Component */
/** */
/** HID Class */
/** */
@@ -29,43 +30,35 @@
#include "ux_host_stack.h"
-/**************************************************************************/
-/* */
-/* FUNCTION RELEASE */
-/* */
-/* _ux_host_class_hid_instance_clean PORTABLE C */
+/**************************************************************************/
+/* */
+/* FUNCTION RELEASE */
+/* */
+/* _ux_host_class_hid_instance_clean PORTABLE C */
/* 6.1 */
/* AUTHOR */
/* */
/* Chaoqiong Xiao, Microsoft Corporation */
/* */
/* DESCRIPTION */
-/* */
-/* This function cleans all the components of a HID instance. */
-/* */
-/* INPUT */
-/* */
-/* hid Pointer to HID class */
-/* */
-/* OUTPUT */
-/* */
-/* Completion Status */
-/* */
-/* CALLS */
-/* */
-/* _ux_utility_memory_free Release memory block */
-/* */
-/* CALLED BY */
-/* */
-/* HID Class */
-/* */
-/* RELEASE HISTORY */
-/* */
-/* DATE NAME DESCRIPTION */
-/* */
-/* 05-19-2020 Chaoqiong Xiao Initial Version 6.0 */
-/* 09-30-2020 Chaoqiong Xiao Modified comment(s), */
-/* resulting in version 6.1 */
+/* */
+/* This function cleans all the components of a HID instance. */
+/* */
+/* INPUT */
+/* */
+/* hid Pointer to HID class */
+/* */
+/* OUTPUT */
+/* */
+/* Completion Status */
+/* */
+/* CALLS */
+/* */
+/* _ux_utility_memory_free Release memory block */
+/* */
+/* CALLED BY */
+/* */
+/* HID Class */
/* */
/**************************************************************************/
UINT _ux_host_class_hid_instance_clean(UX_HOST_CLASS_HID *hid)
@@ -88,26 +81,26 @@ UX_HOST_CLASS_HID_FIELD *hid_next_field;
/* Get the next report before we clean the current report. */
hid_next_report = hid_report -> ux_host_class_hid_report_next_report;
-
+
/* Get the first field in the report. */
hid_field = hid_report -> ux_host_class_hid_report_field;
-
+
/* Clean all the fields attached. */
while (hid_field != UX_NULL)
{
/* Get the next field before we clean the current field. */
- hid_next_field = hid_field -> ux_host_class_hid_field_next_field;
-
+ hid_next_field = hid_field -> ux_host_class_hid_field_next_field;
+
/* Free the usage table. */
if (hid_field -> ux_host_class_hid_field_usages != UX_NULL)
_ux_utility_memory_free(hid_field -> ux_host_class_hid_field_usages);
-
+
/* Free the value table. */
if (hid_field -> ux_host_class_hid_field_values != UX_NULL)
_ux_utility_memory_free(hid_field -> ux_host_class_hid_field_values);
-
- /* Now free the field memory. */
+
+ /* Now free the field memory. */
_ux_utility_memory_free(hid_field);
/* Next field. */
@@ -128,26 +121,26 @@ UX_HOST_CLASS_HID_FIELD *hid_next_field;
/* Get the next report before we clean the current report. */
hid_next_report = hid_report -> ux_host_class_hid_report_next_report;
-
+
/* Get the first field in the report. */
hid_field = hid_report -> ux_host_class_hid_report_field;
-
+
/* Clean all the fields attached. */
while (hid_field != UX_NULL)
{
/* Get the next field before we clean the current field. */
- hid_next_field = hid_field -> ux_host_class_hid_field_next_field;
-
+ hid_next_field = hid_field -> ux_host_class_hid_field_next_field;
+
/* Free the usage table. */
if (hid_field -> ux_host_class_hid_field_usages != UX_NULL)
_ux_utility_memory_free(hid_field -> ux_host_class_hid_field_usages);
-
+
/* Free the value table. */
if (hid_field -> ux_host_class_hid_field_values != UX_NULL)
_ux_utility_memory_free(hid_field -> ux_host_class_hid_field_values);
-
- /* Now free the field memory. */
+
+ /* Now free the field memory. */
_ux_utility_memory_free(hid_field);
/* Next field. */
@@ -168,26 +161,26 @@ UX_HOST_CLASS_HID_FIELD *hid_next_field;
/* Get the next report before we clean the current report. */
hid_next_report = hid_report -> ux_host_class_hid_report_next_report;
-
+
/* Get the first field in the report. */
hid_field = hid_report -> ux_host_class_hid_report_field;
-
+
/* Clean all the fields attached. */
while (hid_field != UX_NULL)
{
/* Get the next field before we clean the current field. */
- hid_next_field = hid_field -> ux_host_class_hid_field_next_field;
-
+ hid_next_field = hid_field -> ux_host_class_hid_field_next_field;
+
/* Free the usage table. */
if (hid_field -> ux_host_class_hid_field_usages != UX_NULL)
_ux_utility_memory_free(hid_field -> ux_host_class_hid_field_usages);
-
+
/* Free the value table. */
if (hid_field -> ux_host_class_hid_field_values != UX_NULL)
_ux_utility_memory_free(hid_field -> ux_host_class_hid_field_values);
-
- /* Now free the field memory. */
+
+ /* Now free the field memory. */
_ux_utility_memory_free(hid_field);
/* Next field. */
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 ece410fa..d094b484 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
@@ -1,18 +1,19 @@
/***************************************************************************
- * Copyright (c) 2024 Microsoft Corporation
- *
+ * Copyright (c) 2024 Microsoft Corporation
+ * Copyright (c) 2026-present Eclipse ThreadX contributors
+ *
* This program and the accompanying materials are made available under the
* terms of the MIT License which is available at
* https://opensource.org/licenses/MIT.
- *
+ *
* SPDX-License-Identifier: MIT
**************************************************************************/
/**************************************************************************/
/**************************************************************************/
-/** */
-/** USBX Component */
+/** */
+/** USBX Component */
/** */
/** HID Class */
/** */
@@ -29,55 +30,39 @@
#include "ux_host_stack.h"
-/**************************************************************************/
-/* */
-/* FUNCTION RELEASE */
-/* */
-/* _ux_host_class_hid_interrupt_endpoint_search PORTABLE C */
+/**************************************************************************/
+/* */
+/* FUNCTION RELEASE */
+/* */
+/* _ux_host_class_hid_interrupt_endpoint_search PORTABLE C */
/* 6.1.12 */
/* AUTHOR */
/* */
/* Chaoqiong Xiao, Microsoft Corporation */
/* */
/* DESCRIPTION */
-/* */
-/* This function searches for the handle of the only interrupt */
+/* */
+/* This function searches for the handle of the only interrupt */
/* endpoint in the default alternate setting of the HID interface. */
-/* The interrupt endpoint should always be there. The actual first */
-/* transfer on the interrupt endpoint does not start until a HID */
-/* client has claimed ownership of the HID device. */
-/* */
-/* INPUT */
-/* */
-/* hid Pointer to HID class */
-/* */
-/* OUTPUT */
-/* */
-/* Completion Status */
-/* */
-/* CALLS */
-/* */
-/* _ux_utility_memory_allocate Allocate memory block */
-/* */
-/* CALLED BY */
-/* */
-/* HID Class */
-/* */
-/* RELEASE HISTORY */
-/* */
-/* DATE NAME DESCRIPTION */
-/* */
-/* 05-19-2020 Chaoqiong Xiao Initial Version 6.0 */
-/* 09-30-2020 Chaoqiong Xiao Modified comment(s), */
-/* resulting in version 6.1 */
-/* 01-31-2022 Xiuwen Cai, CQ Xiao Modified comment(s), */
-/* added interrupt OUT support,*/
-/* added timeout initialize, */
-/* resulting in version 6.1.10 */
-/* 07-29-2022 Chaoqiong Xiao Modified comment(s), */
-/* fixed parameter/variable */
-/* names conflict C++ keyword, */
-/* resulting in version 6.1.12 */
+/* The interrupt endpoint should always be there. The actual first */
+/* transfer on the interrupt endpoint does not start until a HID */
+/* client has claimed ownership of the HID device. */
+/* */
+/* INPUT */
+/* */
+/* hid Pointer to HID class */
+/* */
+/* OUTPUT */
+/* */
+/* Completion Status */
+/* */
+/* CALLS */
+/* */
+/* _ux_utility_memory_allocate Allocate memory block */
+/* */
+/* CALLED BY */
+/* */
+/* HID Class */
/* */
/**************************************************************************/
UINT _ux_host_class_hid_interrupt_endpoint_search(UX_HOST_CLASS_HID *hid)
@@ -121,7 +106,7 @@ UX_TRANSFER *transfer_request;
transfer_request -> ux_transfer_request_timeout_value = UX_WAIT_FOREVER;
/* Obtain a buffer for this transaction. The buffer will always be reused. */
- transfer_request -> ux_transfer_request_data_pointer = _ux_utility_memory_allocate(UX_SAFE_ALIGN, UX_CACHE_SAFE_MEMORY,
+ transfer_request -> ux_transfer_request_data_pointer = _ux_utility_memory_allocate(UX_SAFE_ALIGN, UX_CACHE_SAFE_MEMORY,
transfer_request -> ux_transfer_request_requested_length);
/* If the endpoint is available and we have memory, we mark the interrupt endpoint as ready. */
@@ -130,7 +115,7 @@ UX_TRANSFER *transfer_request;
hid -> ux_host_class_hid_interrupt_endpoint_status = UX_HOST_CLASS_HID_INTERRUPT_ENDPOINT_READY;
status = UX_SUCCESS;
#if !defined(UX_HOST_CLASS_HID_INTERRUPT_OUT_SUPPORT)
-
+
/* We have found the interrupt IN endpoint, just stop searching. */
break;
#endif
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 50cf05f1..5fc12983 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
@@ -1,18 +1,19 @@
/***************************************************************************
- * Copyright (c) 2024 Microsoft Corporation
- *
+ * Copyright (c) 2024 Microsoft Corporation
+ * Copyright (c) 2026-present Eclipse ThreadX contributors
+ *
* This program and the accompanying materials are made available under the
* terms of the MIT License which is available at
* https://opensource.org/licenses/MIT.
- *
+ *
* SPDX-License-Identifier: MIT
**************************************************************************/
/**************************************************************************/
/**************************************************************************/
-/** */
-/** USBX Component */
+/** */
+/** USBX Component */
/** */
/** HID Class */
/** */
@@ -29,45 +30,37 @@
#include "ux_host_stack.h"
-/**************************************************************************/
-/* */
-/* FUNCTION RELEASE */
-/* */
-/* _ux_host_class_hid_item_data_get PORTABLE C */
+/**************************************************************************/
+/* */
+/* FUNCTION RELEASE */
+/* */
+/* _ux_host_class_hid_item_data_get PORTABLE C */
/* 6.1 */
/* AUTHOR */
/* */
/* Chaoqiong Xiao, Microsoft Corporation */
/* */
/* DESCRIPTION */
-/* */
+/* */
/* This function returns a data from the descriptor based on its size, */
-/* format and whether it is signed or not. */
-/* */
-/* INPUT */
-/* */
-/* descriptor Pointer to descriptor */
-/* item Pointer to item */
-/* */
-/* OUTPUT */
-/* */
-/* ULONG data value */
-/* */
-/* CALLS */
-/* */
-/* _ux_utility_short_get Get 16-bit value */
-/* */
-/* CALLED BY */
-/* */
-/* HID Class */
-/* */
-/* RELEASE HISTORY */
-/* */
-/* DATE NAME DESCRIPTION */
-/* */
-/* 05-19-2020 Chaoqiong Xiao Initial Version 6.0 */
-/* 09-30-2020 Chaoqiong Xiao Modified comment(s), */
-/* resulting in version 6.1 */
+/* format and whether it is signed or not. */
+/* */
+/* INPUT */
+/* */
+/* descriptor Pointer to descriptor */
+/* item Pointer to item */
+/* */
+/* OUTPUT */
+/* */
+/* ULONG data value */
+/* */
+/* CALLS */
+/* */
+/* _ux_utility_short_get Get 16-bit value */
+/* */
+/* CALLED BY */
+/* */
+/* HID Class */
/* */
/**************************************************************************/
ULONG _ux_host_class_hid_item_data_get(UCHAR *descriptor, UX_HOST_CLASS_HID_ITEM *item)
@@ -75,7 +68,7 @@ ULONG _ux_host_class_hid_item_data_get(UCHAR *descriptor, UX_HOST_CLASS_HID_ITE
ULONG value;
-
+
/* Get the length of the item. */
switch (item -> ux_host_class_hid_item_report_length)
{
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 36a13a9c..af2d5c6e 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
@@ -1,18 +1,19 @@
/***************************************************************************
- * Copyright (c) 2024 Microsoft Corporation
- *
+ * Copyright (c) 2024 Microsoft Corporation
+ * Copyright (c) 2026-present Eclipse ThreadX contributors
+ *
* This program and the accompanying materials are made available under the
* terms of the MIT License which is available at
* https://opensource.org/licenses/MIT.
- *
+ *
* SPDX-License-Identifier: MIT
**************************************************************************/
/**************************************************************************/
/**************************************************************************/
-/** */
-/** USBX Component */
+/** */
+/** USBX Component */
/** */
/** HID Keyboard Client */
/** */
@@ -92,64 +93,47 @@ UX_HOST_CLASS_HID_KEYBOARD_LAYOUT ux_host_class_hid_keyboard_layout =
UX_HOST_CLASS_HID_KEYBOARD_KEYS_KEYPAD_UPPER_RANGE_DEFAULT,
};
-/**************************************************************************/
-/* */
-/* FUNCTION RELEASE */
-/* */
-/* _ux_host_class_hid_keyboard_activate PORTABLE C */
+/**************************************************************************/
+/* */
+/* FUNCTION RELEASE */
+/* */
+/* _ux_host_class_hid_keyboard_activate PORTABLE C */
/* 6.1.11 */
/* AUTHOR */
/* */
/* Chaoqiong Xiao, Microsoft Corporation */
/* */
/* DESCRIPTION */
-/* */
-/* This function performs the enumeration of a HID Keyboard Client. */
-/* */
-/* INPUT */
-/* */
+/* */
+/* This function performs the enumeration of a HID Keyboard Client. */
+/* */
+/* INPUT */
+/* */
/* command Pointer to command */
-/* */
-/* OUTPUT */
-/* */
-/* Completion Status */
-/* */
-/* CALLS */
-/* */
+/* */
+/* OUTPUT */
+/* */
+/* Completion Status */
+/* */
+/* CALLS */
+/* */
/* _ux_host_class_hid_periodic_report_start */
-/* Start periodic report */
+/* Start periodic report */
/* _ux_host_class_hid_report_callback_register */
-/* Register callback */
+/* Register callback */
/* _ux_host_class_hid_report_id_get Get the report ID */
/* _ux_host_class_hid_idle_set Set the idle rate */
/* _ux_host_class_hid_report_set Do SET_REPORT */
-/* _ux_utility_memory_allocate Allocate memory block */
-/* _ux_utility_memory_free Free memory block */
+/* _ux_utility_memory_allocate Allocate memory block */
+/* _ux_utility_memory_free Free memory block */
/* _ux_host_semaphore_create Create semaphore */
/* _ux_host_semaphore_delete Delete semaphore */
/* _ux_utility_thread_create Create thread */
/* _ux_utility_thread_delete Delete thread */
-/* */
-/* CALLED BY */
-/* */
-/* HID Class */
-/* */
-/* RELEASE HISTORY */
-/* */
-/* 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 */
-/* 01-31-2022 Chaoqiong Xiao Modified comment(s), */
-/* added standalone support, */
-/* resulting in version 6.1.10 */
-/* 04-25-2022 Chaoqiong Xiao Modified comment(s), */
-/* fixed clients management, */
-/* resulting in version 6.1.11 */
+/* */
+/* CALLED BY */
+/* */
+/* HID Class */
/* */
/**************************************************************************/
UINT _ux_host_class_hid_keyboard_activate(UX_HOST_CLASS_HID_CLIENT_COMMAND *command)
@@ -177,7 +161,7 @@ UX_HOST_CLASS_HID_FIELD *field;
/* Get some memory for both the HID class instance and copy of this client
and for the callback. */
client_keyboard = (UX_HOST_CLASS_HID_CLIENT_KEYBOARD *)
- _ux_utility_memory_allocate(UX_NO_ALIGN, UX_REGULAR_MEMORY,
+ _ux_utility_memory_allocate(UX_NO_ALIGN, UX_REGULAR_MEMORY,
sizeof(UX_HOST_CLASS_HID_CLIENT_KEYBOARD));
if (client_keyboard == UX_NULL)
return(UX_MEMORY_INSUFFICIENT);
@@ -319,7 +303,7 @@ UX_HOST_CLASS_HID_FIELD *field;
to the callback because it involves using the commands on the Control Pipe which cannot
be done during callbacks. First allocate some stack memory. */
keyboard_instance -> ux_host_class_hid_keyboard_thread_stack = _ux_utility_memory_allocate(UX_NO_ALIGN, UX_REGULAR_MEMORY, UX_THREAD_STACK_SIZE);
-
+
/* Check if stack memory was allocated. */
if (keyboard_instance -> ux_host_class_hid_keyboard_thread_stack == UX_NULL)
status = (UX_MEMORY_INSUFFICIENT);
@@ -328,7 +312,7 @@ UX_HOST_CLASS_HID_FIELD *field;
/* If we are OK, go on. */
if (status == UX_SUCCESS)
- /* Then create the actual thread. */
+ /* Then create the actual thread. */
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,
@@ -376,19 +360,19 @@ UX_HOST_CLASS_HID_FIELD *field;
/* The report ID should exist. If there is an error, we do not proceed. */
if (status == UX_SUCCESS)
{
-
+
/* Memorize the report pointer. */
client_report.ux_host_class_hid_client_report = report_id.ux_host_class_hid_report_get_report;
-
+
/* The report set is raw since the LEDs mask is already in the right format. */
client_report.ux_host_class_hid_client_report_flags = UX_HOST_CLASS_HID_REPORT_RAW;
-
+
/* The length of this report is 1 byte. */
client_report.ux_host_class_hid_client_report_length = 1;
-
+
/* The output report buffer is the LED mask field. */
client_report.ux_host_class_hid_client_report_buffer = &keyboard_instance -> ux_host_class_hid_keyboard_led_mask;
-
+
/* The HID class will perform the SET_REPORT command. Do not check for error here, this is
handled by the function itself. */
status = _ux_host_class_hid_report_set(hid, &client_report);
@@ -425,7 +409,7 @@ UX_HOST_CLASS_HID_FIELD *field;
if a function has been programmed in the system structure. */
if (_ux_system_host -> ux_system_host_change_function != UX_NULL)
{
-
+
/* Call system change function. */
_ux_system_host -> ux_system_host_change_function(UX_HID_CLIENT_INSERTION, hid -> ux_host_class_hid_class, (VOID *) hid_client);
}
@@ -434,7 +418,7 @@ UX_HOST_CLASS_HID_FIELD *field;
UX_TRACE_IN_LINE_INSERT(UX_TRACE_HOST_CLASS_HID_KEYBOARD_ACTIVATE, hid, keyboard_instance, 0, 0, UX_TRACE_HOST_CLASS_EVENTS, 0, 0)
/* Return completion status. */
- return(status);
+ return(status);
}
/* There is error, delete thread. */
@@ -455,7 +439,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 != UX_EMPTY)
+ if (_ux_host_semaphore_created(&keyboard_instance -> ux_host_class_hid_keyboard_semaphore))
_ux_host_semaphore_delete(&keyboard_instance -> ux_host_class_hid_keyboard_semaphore);
#endif
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 dd6b59c1..8ac89c2b 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
@@ -1,18 +1,19 @@
/***************************************************************************
- * Copyright (c) 2024 Microsoft Corporation
- *
+ * Copyright (c) 2024 Microsoft Corporation
+ * Copyright (c) 2026-present Eclipse ThreadX contributors
+ *
* This program and the accompanying materials are made available under the
* terms of the MIT License which is available at
* https://opensource.org/licenses/MIT.
- *
+ *
* SPDX-License-Identifier: MIT
**************************************************************************/
/**************************************************************************/
/**************************************************************************/
-/** */
-/** USBX Component */
+/** */
+/** USBX Component */
/** */
/** HID Keyboard Client */
/** */
@@ -29,59 +30,46 @@
#include "ux_host_class_hid_keyboard.h"
#include "ux_host_stack.h"
-/**************************************************************************/
-/* */
-/* FUNCTION RELEASE */
-/* */
-/* _ux_host_class_hid_keyboard_callback PORTABLE C */
+/**************************************************************************/
+/* */
+/* FUNCTION RELEASE */
+/* */
+/* _ux_host_class_hid_keyboard_callback PORTABLE C */
/* 6.1.10 */
/* AUTHOR */
/* */
/* Chaoqiong Xiao, Microsoft Corporation */
/* */
/* DESCRIPTION */
-/* */
-/* This function is the callback mechanism for a report registration. */
-/* */
-/* INPUT */
-/* */
-/* callback Pointer to callback */
-/* */
-/* OUTPUT */
-/* */
-/* None */
-/* */
-/* CALLS */
-/* */
-/* _ux_utility_memory_copy Copy memory */
-/* _ux_utility_memory_set Set memory */
-/* */
-/* CALLED BY */
-/* */
-/* HID Class when a report is generated */
-/* */
-/* RELEASE HISTORY */
-/* */
-/* DATE NAME DESCRIPTION */
-/* */
-/* 05-19-2020 Chaoqiong Xiao Initial Version 6.0 */
-/* 09-30-2020 Chaoqiong Xiao Modified comment(s), */
-/* verified memset and memcpy */
-/* cases, */
-/* resulting in version 6.1 */
-/* 01-31-2022 Chaoqiong Xiao Modified comment(s), */
-/* added standalone support, */
-/* resulting in version 6.1.10 */
+/* */
+/* This function is the callback mechanism for a report registration. */
+/* */
+/* INPUT */
+/* */
+/* callback Pointer to callback */
+/* */
+/* OUTPUT */
+/* */
+/* None */
+/* */
+/* CALLS */
+/* */
+/* _ux_utility_memory_copy Copy memory */
+/* _ux_utility_memory_set Set memory */
+/* */
+/* CALLED BY */
+/* */
+/* HID Class when a report is generated */
/* */
/**************************************************************************/
VOID _ux_host_class_hid_keyboard_callback(UX_HOST_CLASS_HID_REPORT_CALLBACK *callback)
{
-/* This array contains the bit for each alternate key (modifier or lock key)
- that we report to the application. For example, if you wanted to set the
+/* This array contains the bit for each alternate key (modifier or lock key)
+ that we report to the application. For example, if you wanted to set the
bit for the CAPS_LOCK key, you would do:
keyboard_instance -> ux_host_class_hid_keyboard_alternate_key_state |= alternate_key_bits[0];
- Index 0 is used since it corresponds to the CAPS_LOCK bit in the array. Note
+ Index 0 is used since it corresponds to the CAPS_LOCK bit in the array. Note
that _alternate_key_state is what we report to the application. */
const ULONG alternate_key_bits[] = {
UX_HID_KEYBOARD_STATE_CAPS_LOCK,
@@ -297,7 +285,7 @@ UCHAR *state_action;
switch(key_usage)
{
- /* This is the usage of a modifier key. Set or clear the appropriate
+ /* This is the usage of a modifier key. Set or clear the appropriate
bits in the alternate key state bitmap. */
case UX_HID_MODIFIER_KEY_LEFT_SHIFT :
case UX_HID_MODIFIER_KEY_RIGHT_SHIFT :
@@ -341,8 +329,8 @@ UCHAR *state_action;
key_state = KEY_STATE_NO_KEY;
break;
#endif
-
- /* This is the usage of a regular key. Here, we just get the decoded
+
+ /* This is the usage of a regular key. Here, we just get the decoded
value; we will add it to the queue later. */
default :
@@ -528,7 +516,7 @@ UCHAR *state_action;
#endif
}
- /* If we get here, then we have a regular key. Now it's time to save
+ /* If we get here, then we have a regular key. Now it's time to save
raw/decoded key in the key queue. */
/* This key should now be inserted in the circular array for the application to retrieve it. */
@@ -568,7 +556,7 @@ UCHAR *state_action;
#if !defined(UX_HOST_CLASS_HID_KEYBOARD_EVENTS_KEY_CHANGES_MODE)
/* 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
+ 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); /* Use case of memcpy is verified. */
#else
@@ -578,6 +566,6 @@ UCHAR *state_action;
#endif
/* Return to caller. */
- return;
+ return;
}
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 bfbf609c..942d9883 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
@@ -1,18 +1,19 @@
/***************************************************************************
- * Copyright (c) 2024 Microsoft Corporation
- *
+ * Copyright (c) 2024 Microsoft Corporation
+ * Copyright (c) 2026-present Eclipse ThreadX contributors
+ *
* This program and the accompanying materials are made available under the
* terms of the MIT License which is available at
* https://opensource.org/licenses/MIT.
- *
+ *
* SPDX-License-Identifier: MIT
**************************************************************************/
/**************************************************************************/
/**************************************************************************/
-/** */
-/** USBX Component */
+/** */
+/** USBX Component */
/** */
/** HID Keyboard Client */
/** */
@@ -30,56 +31,39 @@
#include "ux_host_stack.h"
-/**************************************************************************/
-/* */
-/* FUNCTION RELEASE */
-/* */
-/* _ux_host_class_hid_keyboard_deactivate PORTABLE C */
+/**************************************************************************/
+/* */
+/* FUNCTION RELEASE */
+/* */
+/* _ux_host_class_hid_keyboard_deactivate PORTABLE C */
/* 6.3.0 */
/* AUTHOR */
/* */
/* Chaoqiong Xiao, Microsoft Corporation */
/* */
/* DESCRIPTION */
-/* */
-/* This function performs the deactivation of a HID Keyboard Client. */
-/* */
-/* INPUT */
-/* */
+/* */
+/* This function performs the deactivation of a HID Keyboard Client. */
+/* */
+/* INPUT */
+/* */
/* command Pointer to command */
-/* */
-/* OUTPUT */
-/* */
-/* Completion Status */
-/* */
-/* CALLS */
-/* */
+/* */
+/* OUTPUT */
+/* */
+/* Completion Status */
+/* */
+/* CALLS */
+/* */
/* _ux_host_class_hid_periodic_report_stop */
-/* Stop periodic report */
+/* Stop periodic report */
/* _ux_utility_memory_free Release memory block */
/* _ux_host_semaphore_delete Delete semaphore */
/* _ux_utility_thread_delete Delete thread */
-/* */
-/* CALLED BY */
-/* */
-/* HID Class */
-/* */
-/* RELEASE HISTORY */
-/* */
-/* DATE NAME DESCRIPTION */
-/* */
-/* 05-19-2020 Chaoqiong Xiao Initial Version 6.0 */
-/* 09-30-2020 Chaoqiong Xiao Modified comment(s), */
-/* resulting in version 6.1 */
-/* 01-31-2022 Chaoqiong Xiao Modified comment(s), */
-/* added standalone support, */
-/* resulting in version 6.1.10 */
-/* 04-25-2022 Chaoqiong Xiao Modified comment(s), */
-/* internal clean up, */
-/* resulting in version 6.1.11 */
-/* 10-31-2023 Chaoqiong Xiao Modified comment(s), */
-/* improved unload sequence, */
-/* resulting in version 6.3.0 */
+/* */
+/* CALLED BY */
+/* */
+/* HID Class */
/* */
/**************************************************************************/
UINT _ux_host_class_hid_keyboard_deactivate(UX_HOST_CLASS_HID_CLIENT_COMMAND *command)
@@ -119,7 +103,7 @@ UINT status = UX_SUCCESS;
if a function has been programmed in the system structure. */
if (_ux_system_host -> ux_system_host_change_function != UX_NULL)
{
-
+
/* Call system change function. */
_ux_system_host -> ux_system_host_change_function(UX_HID_CLIENT_REMOVAL, hid -> ux_host_class_hid_class, (VOID *) hid_client);
}
@@ -140,6 +124,6 @@ UINT status = UX_SUCCESS;
_ux_utility_memory_free(hid_client -> ux_host_class_hid_client_local_instance);
/* Return completion status. */
- return(status);
+ return(status);
}
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 fea93241..4e4582e6 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
@@ -1,18 +1,19 @@
/***************************************************************************
- * Copyright (c) 2024 Microsoft Corporation
- *
+ * Copyright (c) 2024 Microsoft Corporation
+ * Copyright (c) 2026-present Eclipse ThreadX contributors
+ *
* This program and the accompanying materials are made available under the
* terms of the MIT License which is available at
* https://opensource.org/licenses/MIT.
- *
+ *
* SPDX-License-Identifier: MIT
**************************************************************************/
/**************************************************************************/
/**************************************************************************/
-/** */
-/** USBX Component */
+/** */
+/** USBX Component */
/** */
/** HID Keyboard Client */
/** */
@@ -44,51 +45,40 @@ static inline UINT _ux_host_class_hid_keyboard_activate_wait(UX_HOST_CLASS_HID_
#endif
-/**************************************************************************/
-/* */
-/* FUNCTION RELEASE */
-/* */
-/* _ux_host_class_hid_keyboard_entry PORTABLE C */
+/**************************************************************************/
+/* */
+/* FUNCTION RELEASE */
+/* */
+/* _ux_host_class_hid_keyboard_entry PORTABLE C */
/* 6.1.10 */
/* AUTHOR */
/* */
/* Chaoqiong Xiao, Microsoft Corporation */
/* */
/* DESCRIPTION */
-/* */
+/* */
/* This function is the entry point of the HID keyboard client. */
-/* This function is called by the HID class after it has parsed a new */
-/* HID report descriptor and is searching for a HID client. */
-/* */
-/* INPUT */
-/* */
+/* This function is called by the HID class after it has parsed a new */
+/* HID report descriptor and is searching for a HID client. */
+/* */
+/* INPUT */
+/* */
/* command Pointer to command */
-/* */
-/* OUTPUT */
-/* */
-/* Completion Status */
-/* */
-/* CALLS */
-/* */
-/* _ux_host_class_hid_keyboard_activate */
-/* Activate HID keyboard */
-/* _ux_host_class_hid_keyboard_deactivate */
-/* Deactivate HID keyboard */
-/* */
-/* CALLED BY */
-/* */
-/* HID Class */
-/* */
-/* RELEASE HISTORY */
-/* */
-/* DATE NAME DESCRIPTION */
-/* */
-/* 05-19-2020 Chaoqiong Xiao Initial Version 6.0 */
-/* 09-30-2020 Chaoqiong Xiao Modified comment(s), */
-/* resulting in version 6.1 */
-/* 01-31-2022 Chaoqiong Xiao Modified comment(s), */
-/* added standalone support, */
-/* resulting in version 6.1.10 */
+/* */
+/* OUTPUT */
+/* */
+/* Completion Status */
+/* */
+/* CALLS */
+/* */
+/* _ux_host_class_hid_keyboard_activate */
+/* Activate HID keyboard */
+/* _ux_host_class_hid_keyboard_deactivate */
+/* Deactivate HID keyboard */
+/* */
+/* CALLED BY */
+/* */
+/* HID Class */
/* */
/**************************************************************************/
UINT _ux_host_class_hid_keyboard_entry(UX_HOST_CLASS_HID_CLIENT_COMMAND *command)
@@ -109,10 +99,10 @@ UINT status;
this device or not */
if ((command -> ux_host_class_hid_client_command_page == UX_HOST_CLASS_HID_PAGE_GENERIC_DESKTOP_CONTROLS) &&
(command -> ux_host_class_hid_client_command_usage == UX_HOST_CLASS_HID_GENERIC_DESKTOP_KEYBOARD))
- return(UX_SUCCESS);
- else
- return(UX_NO_CLASS_MATCH);
-
+ return(UX_SUCCESS);
+ else
+ return(UX_NO_CLASS_MATCH);
+
case UX_HOST_CLASS_COMMAND_ACTIVATE:
@@ -138,7 +128,7 @@ UINT status;
/* Return completion status. */
return(status);
- }
+ }
/* Return error status. */
return(UX_ERROR);
@@ -249,7 +239,7 @@ UINT status;
if a function has been programmed in the system structure. */
if (_ux_system_host -> ux_system_host_change_function != UX_NULL)
{
-
+
/* Call system change function. */
_ux_system_host -> ux_system_host_change_function(UX_HID_CLIENT_INSERTION, hid -> ux_host_class_hid_class, (VOID *) hid_client);
}
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 2e351e22..e4e76763 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
@@ -1,10 +1,11 @@
/***************************************************************************
- * Copyright (c) 2024 Microsoft Corporation
- *
+ * Copyright (c) 2024 Microsoft Corporation
+ * Copyright (c) 2026-present Eclipse ThreadX contributors
+ *
* This program and the accompanying materials are made available under the
* terms of the MIT License which is available at
* https://opensource.org/licenses/MIT.
- *
+ *
* SPDX-License-Identifier: MIT
**************************************************************************/
@@ -64,14 +65,6 @@ extern UX_HOST_CLASS_HID_KEYBOARD_LAYOUT ux_host_class_hid_keyboard_layout;
/* */
/* HID Keyboard Client */
/* */
-/* RELEASE HISTORY */
-/* */
-/* DATE NAME DESCRIPTION */
-/* */
-/* 05-19-2020 Chaoqiong Xiao Initial Version 6.0 */
-/* 09-30-2020 Chaoqiong Xiao Modified comment(s), */
-/* resulting in version 6.1 */
-/* */
/**************************************************************************/
UINT _ux_host_class_hid_keyboard_ioctl(UX_HOST_CLASS_HID_KEYBOARD *keyboard_instance,
ULONG ioctl_function, VOID *parameter)
@@ -155,12 +148,6 @@ UINT status = UX_SUCCESS;
/* */
/* Application */
/* */
-/* RELEASE HISTORY */
-/* */
-/* DATE NAME DESCRIPTION */
-/* */
-/* 10-31-2023 Chaoqiong Xiao Initial Version 6.3.0 */
-/* */
/**************************************************************************/
UINT _uxe_host_class_hid_keyboard_ioctl(UX_HOST_CLASS_HID_KEYBOARD *keyboard_instance,
ULONG ioctl_function, VOID *parameter)
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 ea6df88f..41e225b7 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
@@ -1,18 +1,19 @@
/***************************************************************************
- * Copyright (c) 2024 Microsoft Corporation
- *
+ * Copyright (c) 2024 Microsoft Corporation
+ * Copyright (c) 2026-present Eclipse ThreadX contributors
+ *
* This program and the accompanying materials are made available under the
* terms of the MIT License which is available at
* https://opensource.org/licenses/MIT.
- *
+ *
* SPDX-License-Identifier: MIT
**************************************************************************/
/**************************************************************************/
/**************************************************************************/
-/** */
-/** USBX Component */
+/** */
+/** USBX Component */
/** */
/** HID Remote Control Class */
/** */
@@ -30,49 +31,41 @@
#include "ux_host_stack.h"
-/**************************************************************************/
-/* */
-/* FUNCTION RELEASE */
-/* */
-/* _ux_host_class_hid_keyboard_key_get PORTABLE C */
+/**************************************************************************/
+/* */
+/* FUNCTION RELEASE */
+/* */
+/* _ux_host_class_hid_keyboard_key_get PORTABLE C */
/* 6.1 */
/* AUTHOR */
/* */
/* Chaoqiong Xiao, Microsoft Corporation */
/* */
/* DESCRIPTION */
-/* */
-/* This function reads the key and keyboard state from the */
-/* round-robin buffer. */
-/* */
-/* INPUT */
-/* */
-/* keyboard_instance Pointer to remote control */
-/* keyboard key Pointer to keyboard key */
-/* keyboard state Pointer to keyboard state */
-/* */
-/* OUTPUT */
-/* */
-/* Completion Status */
-/* */
-/* CALLS */
-/* */
-/* _ux_host_stack_class_instance_verify Verify instance */
-/* */
-/* CALLED BY */
-/* */
-/* User application */
-/* */
-/* RELEASE HISTORY */
-/* */
-/* DATE NAME DESCRIPTION */
-/* */
-/* 05-19-2020 Chaoqiong Xiao Initial Version 6.0 */
-/* 09-30-2020 Chaoqiong Xiao Modified comment(s), */
-/* resulting in version 6.1 */
+/* */
+/* This function reads the key and keyboard state from the */
+/* round-robin buffer. */
+/* */
+/* INPUT */
+/* */
+/* keyboard_instance Pointer to remote control */
+/* keyboard key Pointer to keyboard key */
+/* keyboard state Pointer to keyboard state */
+/* */
+/* OUTPUT */
+/* */
+/* Completion Status */
+/* */
+/* CALLS */
+/* */
+/* _ux_host_stack_class_instance_verify Verify instance */
+/* */
+/* CALLED BY */
+/* */
+/* User application */
/* */
/**************************************************************************/
-UINT _ux_host_class_hid_keyboard_key_get(UX_HOST_CLASS_HID_KEYBOARD *keyboard_instance,
+UINT _ux_host_class_hid_keyboard_key_get(UX_HOST_CLASS_HID_KEYBOARD *keyboard_instance,
ULONG *keyboard_key, ULONG *keyboard_state)
{
@@ -84,10 +77,10 @@ UX_HOST_CLASS_HID *hid;
/* Get the HID class associated with the HID client. */
hid = keyboard_instance -> ux_host_class_hid_keyboard_hid;
-
+
/* Ensure the instance is valid. */
if (_ux_host_stack_class_instance_verify(_ux_system_host_class_hid_name, (VOID *) hid) != UX_SUCCESS)
- {
+ {
/* If trace is enabled, insert this event into the trace buffer. */
UX_TRACE_IN_LINE_INSERT(UX_TRACE_ERROR, UX_HOST_CLASS_INSTANCE_UNKNOWN, hid, 0, 0, UX_TRACE_ERRORS, 0, 0)
@@ -119,7 +112,7 @@ UX_HOST_CLASS_HID *hid;
keyboard_instance -> ux_host_class_hid_keyboard_usage_array_tail = array_tail;
/* The status will tell the application there is something valid in the key/state. */
- return(UX_SUCCESS);
+ return(UX_SUCCESS);
}
/**************************************************************************/
@@ -138,9 +131,9 @@ UX_HOST_CLASS_HID *hid;
/* */
/* INPUT */
/* */
-/* keyboard_instance Pointer to remote control */
-/* keyboard key Pointer to keyboard key */
-/* keyboard state Pointer to keyboard state */
+/* keyboard_instance Pointer to remote control */
+/* keyboard key Pointer to keyboard key */
+/* keyboard state Pointer to keyboard state */
/* */
/* OUTPUT */
/* */
@@ -154,14 +147,8 @@ UX_HOST_CLASS_HID *hid;
/* */
/* Application */
/* */
-/* RELEASE HISTORY */
-/* */
-/* DATE NAME DESCRIPTION */
-/* */
-/* 10-31-2023 Chaoqiong Xiao Initial Version 6.3.0 */
-/* */
/**************************************************************************/
-UINT _uxe_host_class_hid_keyboard_key_get(UX_HOST_CLASS_HID_KEYBOARD *keyboard_instance,
+UINT _uxe_host_class_hid_keyboard_key_get(UX_HOST_CLASS_HID_KEYBOARD *keyboard_instance,
ULONG *keyboard_key, ULONG *keyboard_state)
{
diff --git a/common/usbx_host_classes/src/ux_host_class_hid_keyboard_tasks_run.c b/common/usbx_host_classes/src/ux_host_class_hid_keyboard_tasks_run.c
index 5c769f87..4f7e8c07 100644
--- a/common/usbx_host_classes/src/ux_host_class_hid_keyboard_tasks_run.c
+++ b/common/usbx_host_classes/src/ux_host_class_hid_keyboard_tasks_run.c
@@ -1,10 +1,11 @@
/***************************************************************************
- * Copyright (c) 2024 Microsoft Corporation
- *
+ * Copyright (c) 2024 Microsoft Corporation
+ * Copyright (c) 2026-present Eclipse ThreadX contributors
+ *
* This program and the accompanying materials are made available under the
* terms of the MIT License which is available at
* https://opensource.org/licenses/MIT.
- *
+ *
* SPDX-License-Identifier: MIT
**************************************************************************/
@@ -65,16 +66,6 @@
/* */
/* USBX Host HID */
/* */
-/* RELEASE HISTORY */
-/* */
-/* DATE NAME DESCRIPTION */
-/* */
-/* 01-31-2022 Chaoqiong Xiao Initial Version 6.1.10 */
-/* 10-31-2022 Chaoqiong Xiao Modified comment(s), */
-/* improved HID OUTPUT report */
-/* handling in standalone mode,*/
-/* resulting in version 6.2.0 */
-/* */
/**************************************************************************/
VOID _ux_host_class_hid_keyboard_tasks_run(UX_HOST_CLASS_HID_CLIENT *client)
{
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 c25c9d00..f406c02b 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
@@ -1,18 +1,19 @@
/***************************************************************************
- * Copyright (c) 2024 Microsoft Corporation
- *
+ * Copyright (c) 2024 Microsoft Corporation
+ * Copyright (c) 2026-present Eclipse ThreadX contributors
+ *
* This program and the accompanying materials are made available under the
* terms of the MIT License which is available at
* https://opensource.org/licenses/MIT.
- *
+ *
* SPDX-License-Identifier: MIT
**************************************************************************/
/**************************************************************************/
/**************************************************************************/
-/** */
-/** USBX Component */
+/** */
+/** USBX Component */
/** */
/** HID Keyboard Client */
/** */
@@ -30,52 +31,41 @@
#include "ux_host_stack.h"
-/**************************************************************************/
-/* */
-/* FUNCTION RELEASE */
-/* */
-/* _ux_host_class_hid_keyboard_thread PORTABLE C */
+/**************************************************************************/
+/* */
+/* FUNCTION RELEASE */
+/* */
+/* _ux_host_class_hid_keyboard_thread PORTABLE C */
/* 6.1.10 */
/* AUTHOR */
/* */
/* Chaoqiong Xiao, Microsoft Corporation */
/* */
/* DESCRIPTION */
-/* */
+/* */
/* This file contains the keyboard thread used to process the changes */
-/* in the keyboard LEDs. */
+/* in the keyboard LEDs. */
/* */
/* It's for RTOS mode. */
-/* */
-/* INPUT */
-/* */
-/* keyboard_instance The keyboard instance for */
-/* there was a change in LEDs */
-/* */
-/* OUTPUT */
-/* */
-/* None */
-/* */
-/* CALLS */
-/* */
-/* _ux_host_semaphore_get Get signal semaphore */
+/* */
+/* INPUT */
+/* */
+/* keyboard_instance The keyboard instance for */
+/* there was a change in LEDs */
+/* */
+/* OUTPUT */
+/* */
+/* None */
+/* */
+/* CALLS */
+/* */
+/* _ux_host_semaphore_get Get signal semaphore */
/* _ux_host_class_hid_report_id_get Get report ID */
/* _ux_host_class_hid_report_set Do SET_REPORT */
-/* */
-/* CALLED BY */
-/* */
-/* ThreadX */
-/* */
-/* RELEASE HISTORY */
-/* */
-/* DATE NAME DESCRIPTION */
-/* */
-/* 05-19-2020 Chaoqiong Xiao Initial Version 6.0 */
-/* 09-30-2020 Chaoqiong Xiao Modified comment(s), */
-/* resulting in version 6.1 */
-/* 01-31-2022 Chaoqiong Xiao Modified comment(s), */
-/* refined macros names, */
-/* resulting in version 6.1.10 */
+/* */
+/* CALLED BY */
+/* */
+/* ThreadX */
/* */
/**************************************************************************/
VOID _ux_host_class_hid_keyboard_thread(ULONG thread_input)
@@ -89,47 +79,47 @@ UX_HOST_CLASS_HID_KEYBOARD *keyboard_instance;
/* Cast the thread_input variable into the proper format. */
UX_THREAD_EXTENSION_PTR_GET(keyboard_instance, UX_HOST_CLASS_HID_KEYBOARD, thread_input)
- /* Loop forever waiting for changes signaled through the semaphore. */
+ /* Loop forever waiting for changes signaled through the semaphore. */
while (1)
- {
+ {
/* Wait for the semaphore to be put by the root hub or a regular hub. */
status = _ux_host_semaphore_get(&keyboard_instance -> ux_host_class_hid_keyboard_semaphore, UX_WAIT_FOREVER);
-
+
/* The semaphore could be awaken because the semaphore was destroyed by the HID client
when the keyboard is removed. */
- if (status == UX_SUCCESS)
+ if (status == UX_SUCCESS)
{
- /* We got awaken by the keyboard callback which indicates a change on the LEDs has to happen.
+ /* We got awaken by the keyboard callback which indicates a change on the LEDs has to happen.
We need to build the field for the leds. */
keyboard_instance -> ux_host_class_hid_keyboard_led_mask = keyboard_instance -> ux_host_class_hid_keyboard_alternate_key_state &
UX_HID_KEYBOARD_STATE_MASK_LOCK;
-
+
/* Recall the HID instance for this client. */
hid = keyboard_instance -> ux_host_class_hid_keyboard_hid;
-
+
/* We need to find the OUTPUT report for the keyboard LEDs. */
report_id.ux_host_class_hid_report_get_report = UX_NULL;
report_id.ux_host_class_hid_report_get_type = UX_HOST_CLASS_HID_REPORT_TYPE_OUTPUT;
status = _ux_host_class_hid_report_id_get(hid, &report_id);
-
+
/* The report ID should exist. If there is an error, we do not proceed. */
if (status == UX_SUCCESS)
{
-
+
/* Memorize the report pointer. */
client_report.ux_host_class_hid_client_report = report_id.ux_host_class_hid_report_get_report;
-
+
/* The report set is raw since the LEDs mask is already in the right format. */
client_report.ux_host_class_hid_client_report_flags = UX_HOST_CLASS_HID_REPORT_RAW;
-
+
/* The length of this report is 1 byte. */
client_report.ux_host_class_hid_client_report_length = 1;
-
+
/* The output report buffer is the LED mask field. */
client_report.ux_host_class_hid_client_report_buffer = &keyboard_instance -> ux_host_class_hid_keyboard_led_mask;
-
+
/* The HID class will perform the SET_REPORT command. */
_ux_host_class_hid_report_set(hid, &client_report);
}
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 1fd63c31..fc879f75 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
@@ -1,18 +1,19 @@
/***************************************************************************
- * Copyright (c) 2024 Microsoft Corporation
- *
+ * Copyright (c) 2024 Microsoft Corporation
+ * Copyright (c) 2026-present Eclipse ThreadX contributors
+ *
* This program and the accompanying materials are made available under the
* terms of the MIT License which is available at
* https://opensource.org/licenses/MIT.
- *
+ *
* SPDX-License-Identifier: MIT
**************************************************************************/
/**************************************************************************/
/**************************************************************************/
-/** */
-/** USBX Component */
+/** */
+/** USBX Component */
/** */
/** HID Class */
/** */
@@ -29,45 +30,37 @@
#include "ux_host_stack.h"
-/**************************************************************************/
-/* */
-/* FUNCTION RELEASE */
-/* */
-/* _ux_host_class_hid_local_item_parse PORTABLE C */
+/**************************************************************************/
+/* */
+/* FUNCTION RELEASE */
+/* */
+/* _ux_host_class_hid_local_item_parse PORTABLE C */
/* 6.1 */
/* AUTHOR */
/* */
/* Chaoqiong Xiao, Microsoft Corporation */
/* */
/* DESCRIPTION */
-/* */
-/* This function parses a local item from the report descriptor. */
-/* */
-/* INPUT */
-/* */
-/* hid Pointer to HID class */
-/* item Pointer to item */
-/* descriptor Pointer to descriptor */
-/* */
-/* OUTPUT */
-/* */
-/* Completion Status */
-/* */
-/* CALLS */
-/* */
-/* _ux_host_class_hid_item_data_get Get data item */
-/* */
-/* CALLED BY */
-/* */
-/* HID Class */
-/* */
-/* RELEASE HISTORY */
-/* */
-/* DATE NAME DESCRIPTION */
-/* */
-/* 05-19-2020 Chaoqiong Xiao Initial Version 6.0 */
-/* 09-30-2020 Chaoqiong Xiao Modified comment(s), */
-/* resulting in version 6.1 */
+/* */
+/* This function parses a local item from the report descriptor. */
+/* */
+/* INPUT */
+/* */
+/* hid Pointer to HID class */
+/* item Pointer to item */
+/* descriptor Pointer to descriptor */
+/* */
+/* OUTPUT */
+/* */
+/* Completion Status */
+/* */
+/* CALLS */
+/* */
+/* _ux_host_class_hid_item_data_get Get data item */
+/* */
+/* CALLED BY */
+/* */
+/* HID Class */
/* */
/**************************************************************************/
UINT _ux_host_class_hid_local_item_parse(UX_HOST_CLASS_HID *hid, UX_HOST_CLASS_HID_ITEM *item, UCHAR *descriptor)
@@ -81,11 +74,11 @@ ULONG delimiter_set;
/* Get the temporary parser structure pointer. */
hid_parser = &hid -> ux_host_class_hid_parser;
-
+
/* Analyze the tag. */
switch (item -> ux_host_class_hid_item_report_tag)
{
-
+
case UX_HOST_CLASS_HID_LOCAL_TAG_USAGE:
/* Local usage tag, check if we have an overflow. */
@@ -98,7 +91,7 @@ ULONG delimiter_set;
/* If trace is enabled, insert this event into the trace buffer. */
UX_TRACE_IN_LINE_INSERT(UX_TRACE_ERROR, UX_HOST_CLASS_HID_USAGE_OVERFLOW, hid, 0, 0, UX_TRACE_ERRORS, 0, 0)
- return(UX_HOST_CLASS_HID_USAGE_OVERFLOW);
+ return(UX_HOST_CLASS_HID_USAGE_OVERFLOW);
}
/* Obtain the usage from the descriptor. */
@@ -119,7 +112,7 @@ ULONG delimiter_set;
case UX_HOST_CLASS_HID_LOCAL_TAG_USAGE_MINIMUM:
/* Usage Minimum tag. */
- hid_parser -> ux_host_class_hid_parser_local.ux_host_class_hid_local_item_usage_min =
+ hid_parser -> ux_host_class_hid_parser_local.ux_host_class_hid_local_item_usage_min =
(ULONG) _ux_host_class_hid_item_data_get(descriptor, item);
break;
@@ -128,7 +121,7 @@ ULONG delimiter_set;
case UX_HOST_CLASS_HID_LOCAL_TAG_USAGE_MAXIMUM:
/* Usage Maximum tag. */
- hid_parser -> ux_host_class_hid_parser_local.ux_host_class_hid_local_item_usage_max =
+ hid_parser -> ux_host_class_hid_parser_local.ux_host_class_hid_local_item_usage_max =
(ULONG) _ux_host_class_hid_item_data_get(descriptor, item);
/* Check if the maximum value is coherent with the minimum. */
@@ -143,7 +136,7 @@ ULONG delimiter_set;
return(UX_HOST_CLASS_HID_MIN_MAX_ERROR);
}
-
+
/* Get the boundaries for the usage values which are defined when encountering the USAGE MAX tag. */
usage_min = (ULONG)(hid_parser -> ux_host_class_hid_parser_local.ux_host_class_hid_local_item_usage_min);
usage_max = (ULONG)(hid_parser -> ux_host_class_hid_parser_local.ux_host_class_hid_local_item_usage_max);
@@ -164,7 +157,7 @@ ULONG delimiter_set;
return(UX_HOST_CLASS_HID_USAGE_OVERFLOW);
}
-
+
/* Combine the global usage with the local usage to form a unique usage ID. */
usage = usage_min | (hid_parser -> ux_host_class_hid_parser_global.ux_host_class_hid_global_item_usage_page << 16);
@@ -173,9 +166,9 @@ ULONG delimiter_set;
/* We have one more usage now. */
hid_parser -> ux_host_class_hid_parser_local.ux_host_class_hid_local_item_number_usage++;
-
+
/* Next usage value. */
- usage_min++;
+ usage_min++;
}
break;
@@ -199,12 +192,12 @@ ULONG delimiter_set;
_ux_system_error_handler(UX_SYSTEM_LEVEL_THREAD, UX_SYSTEM_CONTEXT_CLASS, UX_HOST_CLASS_HID_DELIMITER_ERROR);
return(UX_HOST_CLASS_HID_DELIMITER_ERROR);
- }
+ }
/* Mark the opening of the delimiter. */
hid_parser -> ux_host_class_hid_parser_local.ux_host_class_hid_local_item_delimiter_level = 1;
- break;
+ break;
case UX_HOST_CLASS_HID_DELIMITER_CLOSE:
@@ -216,12 +209,12 @@ ULONG delimiter_set;
_ux_system_error_handler(UX_SYSTEM_LEVEL_THREAD, UX_SYSTEM_CONTEXT_CLASS, UX_HOST_CLASS_HID_DELIMITER_ERROR);
return(UX_HOST_CLASS_HID_DELIMITER_ERROR);
- }
+ }
/* Mark the closing of the delimiter. */
hid_parser -> ux_host_class_hid_parser_local.ux_host_class_hid_local_item_delimiter_level = 0;
- break;
+ break;
default:
@@ -230,7 +223,7 @@ ULONG delimiter_set;
/* We got a wrong delimiter set. */
return(UX_HOST_CLASS_HID_DELIMITER_ERROR);
- }
+ }
break;
default:
@@ -243,8 +236,8 @@ ULONG delimiter_set;
/* This tag is either unknown or unsupported. */
return(UX_HOST_CLASS_HID_TAG_UNSUPPORTED);
- }
-
+ }
+
/* Return status. Always SUCCESS if we get here.*/
return(UX_SUCCESS);
}
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 45318ee5..31dd67da 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
@@ -1,18 +1,19 @@
/***************************************************************************
- * Copyright (c) 2024 Microsoft Corporation
- *
+ * Copyright (c) 2024 Microsoft Corporation
+ * Copyright (c) 2026-present Eclipse ThreadX contributors
+ *
* This program and the accompanying materials are made available under the
* terms of the MIT License which is available at
* https://opensource.org/licenses/MIT.
- *
+ *
* SPDX-License-Identifier: MIT
**************************************************************************/
/**************************************************************************/
/**************************************************************************/
-/** */
-/** USBX Component */
+/** */
+/** USBX Component */
/** */
/** HID Class */
/** */
@@ -29,49 +30,39 @@
#include "ux_host_stack.h"
-/**************************************************************************/
-/* */
-/* FUNCTION RELEASE */
-/* */
-/* _ux_host_class_hid_main_item_parse PORTABLE C */
+/**************************************************************************/
+/* */
+/* FUNCTION RELEASE */
+/* */
+/* _ux_host_class_hid_main_item_parse PORTABLE C */
/* 6.1 */
/* AUTHOR */
/* */
/* Chaoqiong Xiao, Microsoft Corporation */
/* */
/* DESCRIPTION */
-/* */
-/* This function parses a main item from the report descriptor. */
-/* */
-/* INPUT */
-/* */
-/* hid Pointer to HID class */
-/* item Pointer to item */
-/* descriptor Pointer to descriptor */
-/* */
-/* OUTPUT */
-/* */
-/* Completion Status */
-/* */
-/* CALLS */
-/* */
-/* _ux_host_class_hid_item_data_get Get data item */
-/* _ux_host_class_hid_report_add Add report */
-/* _ux_utility_memory_set Memory block set */
-/* */
-/* CALLED BY */
-/* */
-/* HID Class */
-/* */
-/* RELEASE HISTORY */
-/* */
-/* DATE NAME DESCRIPTION */
-/* */
-/* 05-19-2020 Chaoqiong Xiao Initial Version 6.0 */
-/* 09-30-2020 Chaoqiong Xiao Modified comment(s), */
-/* verified memset and memcpy */
-/* cases, */
-/* resulting in version 6.1 */
+/* */
+/* This function parses a main item from the report descriptor. */
+/* */
+/* INPUT */
+/* */
+/* hid Pointer to HID class */
+/* item Pointer to item */
+/* descriptor Pointer to descriptor */
+/* */
+/* OUTPUT */
+/* */
+/* Completion Status */
+/* */
+/* CALLS */
+/* */
+/* _ux_host_class_hid_item_data_get Get data item */
+/* _ux_host_class_hid_report_add Add report */
+/* _ux_utility_memory_set Memory block set */
+/* */
+/* CALLED BY */
+/* */
+/* HID Class */
/* */
/**************************************************************************/
UINT _ux_host_class_hid_main_item_parse(UX_HOST_CLASS_HID *hid, UX_HOST_CLASS_HID_ITEM *item, UCHAR *descriptor)
@@ -91,7 +82,7 @@ ULONG collection_type;
case UX_HOST_CLASS_HID_MAIN_TAG_COLLECTION:
- /* We have a new collection to open. If the collection type is application,
+ /* We have a new collection to open. If the collection type is application,
we have to differentiate the first collection. */
collection_type = _ux_host_class_hid_item_data_get(descriptor, item);
@@ -104,7 +95,7 @@ ULONG collection_type;
{
/* It is the first application. Since the main usage and page have not yet
- been defined, we use the global page and the current local usage. */
+ been defined, we use the global page and the current local usage. */
hid_parser -> ux_host_class_hid_parser_main_page = hid_parser -> ux_host_class_hid_parser_global.ux_host_class_hid_global_item_usage_page;
hid_parser -> ux_host_class_hid_parser_main_usage = hid_parser -> ux_host_class_hid_parser_local.ux_host_class_hid_local_item_usages[0];
}
@@ -114,7 +105,7 @@ ULONG collection_type;
/* Add one collection to this report */
hid_parser -> ux_host_class_hid_parser_number_collection++;
-
+
/* Set the status to success. */
status = UX_SUCCESS;
}
@@ -123,7 +114,7 @@ ULONG collection_type;
if (hid_parser -> ux_host_class_hid_parser_number_collection >= UX_HOST_CLASS_HID_MAX_COLLECTION)
{
-
+
/* Error trap. */
_ux_system_error_handler(UX_SYSTEM_LEVEL_THREAD, UX_SYSTEM_CONTEXT_CLASS, UX_HOST_CLASS_HID_COLLECTION_OVERFLOW);
@@ -144,14 +135,14 @@ ULONG collection_type;
status = UX_SUCCESS;
}
}
- break;
+ break;
case UX_HOST_CLASS_HID_MAIN_TAG_END_COLLECTION:
- /* We need to pop back the last collection. */
+ /* We need to pop back the last collection. */
if (hid_parser -> ux_host_class_hid_parser_number_collection == 0)
{
-
+
/* Error trap. */
_ux_system_error_handler(UX_SYSTEM_LEVEL_THREAD, UX_SYSTEM_CONTEXT_CLASS, UX_HOST_CLASS_HID_COLLECTION_OVERFLOW);
@@ -160,7 +151,7 @@ ULONG collection_type;
return(UX_HOST_CLASS_HID_COLLECTION_OVERFLOW);
}
-
+
else
hid_parser -> ux_host_class_hid_parser_number_collection--;
@@ -175,8 +166,8 @@ ULONG collection_type;
/* We need to add a report. */
status = _ux_host_class_hid_report_add(hid, descriptor, item);
break;
- }
-
+ }
+
/* 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)); /* Use case of memset is verified. */
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 c6d3d4c4..ec49be50 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
@@ -1,18 +1,19 @@
/***************************************************************************
- * Copyright (c) 2024 Microsoft Corporation
- *
+ * Copyright (c) 2024 Microsoft Corporation
+ * Copyright (c) 2026-present Eclipse ThreadX contributors
+ *
* This program and the accompanying materials are made available under the
* terms of the MIT License which is available at
* https://opensource.org/licenses/MIT.
- *
+ *
* SPDX-License-Identifier: MIT
**************************************************************************/
/**************************************************************************/
/**************************************************************************/
-/** */
-/** USBX Component */
+/** */
+/** USBX Component */
/** */
/** HID Mouse Client Class */
/** */
@@ -30,30 +31,30 @@
#include "ux_host_stack.h"
-/**************************************************************************/
-/* */
-/* FUNCTION RELEASE */
-/* */
-/* _ux_host_class_hid_mouse_activate PORTABLE C */
+/**************************************************************************/
+/* */
+/* FUNCTION RELEASE */
+/* */
+/* _ux_host_class_hid_mouse_activate PORTABLE C */
/* 6.1.11 */
/* AUTHOR */
/* */
/* Chaoqiong Xiao, Microsoft Corporation */
/* */
/* DESCRIPTION */
-/* */
-/* This function performs the enumeration of a HID mouse. */
-/* */
-/* INPUT */
-/* */
-/* command Pointer to command */
-/* */
-/* OUTPUT */
-/* */
-/* Completion Status */
-/* */
-/* CALLS */
-/* */
+/* */
+/* This function performs the enumeration of a HID mouse. */
+/* */
+/* INPUT */
+/* */
+/* command Pointer to command */
+/* */
+/* OUTPUT */
+/* */
+/* Completion Status */
+/* */
+/* CALLS */
+/* */
/* _ux_host_class_hid_idle_set Set idle rate */
/* _ux_host_class_hid_report_callback_register */
/* Register report callback */
@@ -62,24 +63,10 @@
/* Start periodic report */
/* _ux_utility_memory_allocate Allocate memory block */
/* _ux_utility_memory_free Free memory block */
-/* */
-/* CALLED BY */
-/* */
-/* HID Mouse Class */
-/* */
-/* RELEASE HISTORY */
-/* */
-/* DATE NAME DESCRIPTION */
-/* */
-/* 05-19-2020 Chaoqiong Xiao Initial Version 6.0 */
-/* 09-30-2020 Chaoqiong Xiao Modified comment(s), */
-/* resulting in version 6.1 */
-/* 01-31-2022 Chaoqiong Xiao Modified comment(s), */
-/* added standalone support, */
-/* resulting in version 6.1.10 */
-/* 04-25-2022 Chaoqiong Xiao Modified comment(s), */
-/* fixed clients management, */
-/* resulting in version 6.1.11 */
+/* */
+/* CALLED BY */
+/* */
+/* HID Mouse Class */
/* */
/**************************************************************************/
UINT _ux_host_class_hid_mouse_activate(UX_HOST_CLASS_HID_CLIENT_COMMAND *command)
@@ -102,7 +89,7 @@ UINT status;
/* Get some memory for both the HID class instance and copy of this client
and for the callback. */
client_mouse = (UX_HOST_CLASS_HID_CLIENT_MOUSE *)
- _ux_utility_memory_allocate(UX_NO_ALIGN, UX_REGULAR_MEMORY,
+ _ux_utility_memory_allocate(UX_NO_ALIGN, UX_REGULAR_MEMORY,
sizeof(UX_HOST_CLASS_HID_CLIENT_MOUSE));
if(client_mouse == UX_NULL)
return(UX_MEMORY_INSUFFICIENT);
@@ -221,7 +208,7 @@ UINT status;
_ux_utility_memory_free(mouse_instance);
/* Return completion status. */
- return(status);
+ return(status);
#endif
}
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 da3712e4..ef5fe65e 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
@@ -1,18 +1,19 @@
/***************************************************************************
- * Copyright (c) 2024 Microsoft Corporation
- *
+ * Copyright (c) 2024 Microsoft Corporation
+ * Copyright (c) 2026-present Eclipse ThreadX contributors
+ *
* This program and the accompanying materials are made available under the
* terms of the MIT License which is available at
* https://opensource.org/licenses/MIT.
- *
+ *
* SPDX-License-Identifier: MIT
**************************************************************************/
/**************************************************************************/
/**************************************************************************/
-/** */
-/** USBX Component */
+/** */
+/** USBX Component */
/** */
/** HID Mouse Client Class */
/** */
@@ -30,47 +31,39 @@
#include "ux_host_stack.h"
-/**************************************************************************/
-/* */
-/* FUNCTION RELEASE */
-/* */
-/* _ux_host_class_hid_mouse_buttons_get PORTABLE C */
+/**************************************************************************/
+/* */
+/* FUNCTION RELEASE */
+/* */
+/* _ux_host_class_hid_mouse_buttons_get PORTABLE C */
/* 6.1 */
/* AUTHOR */
/* */
/* Chaoqiong Xiao, Microsoft Corporation */
/* */
/* DESCRIPTION */
-/* */
+/* */
/* This function reads the mouse buttons and reports it to the user. */
-/* */
-/* INPUT */
-/* */
-/* mouse_instance Pointer to mouse instance */
-/* mouse_buttons Current Mouse Buttons */
-/* */
-/* OUTPUT */
-/* */
-/* Completion Status */
-/* */
-/* CALLS */
-/* */
-/* _ux_host_stack_class_instance_verify Verify instance */
-/* */
-/* CALLED BY */
-/* */
-/* HID Mouse Class */
-/* */
-/* RELEASE HISTORY */
-/* */
-/* DATE NAME DESCRIPTION */
-/* */
-/* 05-19-2020 Chaoqiong Xiao Initial Version 6.0 */
-/* 09-30-2020 Chaoqiong Xiao Modified comment(s), */
-/* resulting in version 6.1 */
+/* */
+/* INPUT */
+/* */
+/* mouse_instance Pointer to mouse instance */
+/* mouse_buttons Current Mouse Buttons */
+/* */
+/* OUTPUT */
+/* */
+/* Completion Status */
+/* */
+/* CALLS */
+/* */
+/* _ux_host_stack_class_instance_verify Verify instance */
+/* */
+/* CALLED BY */
+/* */
+/* HID Mouse Class */
/* */
/**************************************************************************/
-UINT _ux_host_class_hid_mouse_buttons_get(UX_HOST_CLASS_HID_MOUSE *mouse_instance,
+UINT _ux_host_class_hid_mouse_buttons_get(UX_HOST_CLASS_HID_MOUSE *mouse_instance,
ULONG *mouse_buttons)
{
@@ -78,10 +71,10 @@ UX_HOST_CLASS_HID *hid;
/* Get the HID class associated with the HID client. */
hid = mouse_instance -> ux_host_class_hid_mouse_hid;
-
+
/* Ensure the instance is valid. */
if (_ux_host_stack_class_instance_verify(_ux_system_host_class_hid_name, (VOID *) hid) != UX_SUCCESS)
- {
+ {
/* Error trap. */
_ux_system_error_handler(UX_SYSTEM_LEVEL_THREAD, UX_SYSTEM_CONTEXT_CLASS, UX_HOST_CLASS_INSTANCE_UNKNOWN);
@@ -96,7 +89,7 @@ UX_HOST_CLASS_HID *hid;
*mouse_buttons = mouse_instance -> ux_host_class_hid_mouse_buttons;
/* The status will tell the application there is something valid in the usage/value. */
- return(UX_SUCCESS);
+ return(UX_SUCCESS);
}
/**************************************************************************/
@@ -130,14 +123,8 @@ UX_HOST_CLASS_HID *hid;
/* */
/* Application */
/* */
-/* RELEASE HISTORY */
-/* */
-/* DATE NAME DESCRIPTION */
-/* */
-/* 10-31-2023 Chaoqiong Xiao Initial Version 6.3.0 */
-/* */
/**************************************************************************/
-UINT _uxe_host_class_hid_mouse_buttons_get(UX_HOST_CLASS_HID_MOUSE *mouse_instance,
+UINT _uxe_host_class_hid_mouse_buttons_get(UX_HOST_CLASS_HID_MOUSE *mouse_instance,
ULONG *mouse_buttons)
{
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 44d2adf9..312bff1b 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
@@ -1,18 +1,19 @@
/***************************************************************************
- * Copyright (c) 2024 Microsoft Corporation
- *
+ * Copyright (c) 2024 Microsoft Corporation
+ * Copyright (c) 2026-present Eclipse ThreadX contributors
+ *
* This program and the accompanying materials are made available under the
* terms of the MIT License which is available at
* https://opensource.org/licenses/MIT.
- *
+ *
* SPDX-License-Identifier: MIT
**************************************************************************/
/**************************************************************************/
/**************************************************************************/
-/** */
-/** USBX Component */
+/** */
+/** USBX Component */
/** */
/** HID Mouse Client Class */
/** */
@@ -30,45 +31,37 @@
#include "ux_host_stack.h"
-/**************************************************************************/
-/* */
-/* FUNCTION RELEASE */
-/* */
-/* _ux_host_class_hid_mouse_callback PORTABLE C */
+/**************************************************************************/
+/* */
+/* FUNCTION RELEASE */
+/* */
+/* _ux_host_class_hid_mouse_callback PORTABLE C */
/* 6.1 */
/* AUTHOR */
/* */
/* Chaoqiong Xiao, Microsoft Corporation */
/* */
/* DESCRIPTION */
-/* */
-/* This function is the callback mechanism for a report registration. */
+/* */
+/* This function is the callback mechanism for a report registration. */
/* For the mouse, we filter the mouse coordinate changes and the */
/* state of the buttons. */
-/* */
-/* INPUT */
-/* */
-/* callback Pointer to callback */
-/* */
-/* OUTPUT */
-/* */
-/* None */
-/* */
-/* CALLS */
-/* */
-/* None */
-/* */
-/* CALLED BY */
-/* */
-/* HID Class */
-/* */
-/* RELEASE HISTORY */
-/* */
-/* DATE NAME DESCRIPTION */
-/* */
-/* 05-19-2020 Chaoqiong Xiao Initial Version 6.0 */
-/* 09-30-2020 Chaoqiong Xiao Modified comment(s), */
-/* resulting in version 6.1 */
+/* */
+/* INPUT */
+/* */
+/* callback Pointer to callback */
+/* */
+/* OUTPUT */
+/* */
+/* None */
+/* */
+/* CALLS */
+/* */
+/* None */
+/* */
+/* CALLED BY */
+/* */
+/* HID Class */
/* */
/**************************************************************************/
VOID _ux_host_class_hid_mouse_callback(UX_HOST_CLASS_HID_REPORT_CALLBACK *callback)
@@ -90,7 +83,7 @@ UX_HOST_CLASS_HID_MOUSE *mouse_instance;
/* X/Y Axis movement. */
case UX_HOST_CLASS_HID_MOUSE_AXIS_X :
-
+
/* Add the deplacement to the position. */
mouse_instance -> ux_host_class_hid_mouse_x_position += (SCHAR) callback -> ux_host_class_hid_report_callback_value;
@@ -104,20 +97,20 @@ UX_HOST_CLASS_HID_MOUSE *mouse_instance;
/* Buttons. */
case UX_HOST_CLASS_HID_MOUSE_BUTTON_1 :
-
+
/* Check the state of button 1. */
if (callback -> ux_host_class_hid_report_callback_value == UX_TRUE)
mouse_instance -> ux_host_class_hid_mouse_buttons |= UX_HOST_CLASS_HID_MOUSE_BUTTON_1_PRESSED;
- else
+ else
mouse_instance -> ux_host_class_hid_mouse_buttons &= (ULONG)~UX_HOST_CLASS_HID_MOUSE_BUTTON_1_PRESSED;
break;
-
+
case UX_HOST_CLASS_HID_MOUSE_BUTTON_2 :
/* Check the state of button 2. */
if (callback -> ux_host_class_hid_report_callback_value == UX_TRUE)
mouse_instance -> ux_host_class_hid_mouse_buttons |= UX_HOST_CLASS_HID_MOUSE_BUTTON_2_PRESSED;
- else
+ else
mouse_instance -> ux_host_class_hid_mouse_buttons &= (ULONG)~UX_HOST_CLASS_HID_MOUSE_BUTTON_2_PRESSED;
break;
@@ -126,7 +119,7 @@ UX_HOST_CLASS_HID_MOUSE *mouse_instance;
/* Check the state of button 3. */
if (callback -> ux_host_class_hid_report_callback_value == UX_TRUE)
mouse_instance -> ux_host_class_hid_mouse_buttons |= UX_HOST_CLASS_HID_MOUSE_BUTTON_3_PRESSED;
- else
+ else
mouse_instance -> ux_host_class_hid_mouse_buttons &= (ULONG)~UX_HOST_CLASS_HID_MOUSE_BUTTON_3_PRESSED;
break;
@@ -137,14 +130,14 @@ UX_HOST_CLASS_HID_MOUSE *mouse_instance;
mouse_instance -> ux_host_class_hid_mouse_wheel += (SCHAR) callback -> ux_host_class_hid_report_callback_value;
break;
-
+
default :
/* We have received a Usage we don't know about. Ignore it. */
break;
- }
+ }
/* Return to caller. */
- return;
+ return;
}
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 dda5b72f..cc2206c0 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
@@ -1,18 +1,19 @@
/***************************************************************************
- * Copyright (c) 2024 Microsoft Corporation
- *
+ * Copyright (c) 2024 Microsoft Corporation
+ * Copyright (c) 2026-present Eclipse ThreadX contributors
+ *
* This program and the accompanying materials are made available under the
* terms of the MIT License which is available at
* https://opensource.org/licenses/MIT.
- *
+ *
* SPDX-License-Identifier: MIT
**************************************************************************/
/**************************************************************************/
/**************************************************************************/
-/** */
-/** USBX Component */
+/** */
+/** USBX Component */
/** */
/** HID Mouse Client Class */
/** */
@@ -30,48 +31,37 @@
#include "ux_host_stack.h"
-/**************************************************************************/
-/* */
-/* FUNCTION RELEASE */
-/* */
-/* _ux_host_class_hid_mouse_deactivate PORTABLE C */
+/**************************************************************************/
+/* */
+/* FUNCTION RELEASE */
+/* */
+/* _ux_host_class_hid_mouse_deactivate PORTABLE C */
/* 6.3.0 */
/* AUTHOR */
/* */
/* Chaoqiong Xiao, Microsoft Corporation */
/* */
/* DESCRIPTION */
-/* */
-/* This function performs the deactivation of a HID mouse. */
-/* */
-/* INPUT */
-/* */
-/* command Pointer to command */
-/* */
-/* OUTPUT */
-/* */
-/* Completion Status */
-/* */
-/* CALLS */
-/* */
-/* _ux_host_class_hid_periodic_report_stop */
-/* Stop periodic report */
-/* _ux_utility_memory_free Free memory block */
-/* */
-/* CALLED BY */
-/* */
-/* HID Mouse Class */
-/* */
-/* RELEASE HISTORY */
-/* */
-/* DATE NAME DESCRIPTION */
-/* */
-/* 05-19-2020 Chaoqiong Xiao Initial Version 6.0 */
-/* 09-30-2020 Chaoqiong Xiao Modified comment(s), */
-/* resulting in version 6.1 */
-/* 10-31-2023 Chaoqiong Xiao Modified comment(s), */
-/* improved unload sequence, */
-/* resulting in version 6.3.0 */
+/* */
+/* This function performs the deactivation of a HID mouse. */
+/* */
+/* INPUT */
+/* */
+/* command Pointer to command */
+/* */
+/* OUTPUT */
+/* */
+/* Completion Status */
+/* */
+/* CALLS */
+/* */
+/* _ux_host_class_hid_periodic_report_stop */
+/* Stop periodic report */
+/* _ux_utility_memory_free Free memory block */
+/* */
+/* CALLED BY */
+/* */
+/* HID Mouse Class */
/* */
/**************************************************************************/
UINT _ux_host_class_hid_mouse_deactivate(UX_HOST_CLASS_HID_CLIENT_COMMAND *command)
@@ -98,7 +88,7 @@ UINT status;
if a function has been programmed in the system structure. */
if (_ux_system_host -> ux_system_host_change_function != UX_NULL)
{
-
+
/* Call system change function. */
_ux_system_host -> ux_system_host_change_function(UX_HID_CLIENT_REMOVAL, hid -> ux_host_class_hid_class, (VOID *) hid_client);
}
@@ -107,6 +97,6 @@ UINT status;
_ux_utility_memory_free(hid_client -> ux_host_class_hid_client_local_instance);
/* Return completion status. */
- return(status);
+ return(status);
}
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 bc286fbe..141651a3 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
@@ -1,18 +1,19 @@
/***************************************************************************
- * Copyright (c) 2024 Microsoft Corporation
- *
+ * Copyright (c) 2024 Microsoft Corporation
+ * Copyright (c) 2026-present Eclipse ThreadX contributors
+ *
* This program and the accompanying materials are made available under the
* terms of the MIT License which is available at
* https://opensource.org/licenses/MIT.
- *
+ *
* SPDX-License-Identifier: MIT
**************************************************************************/
/**************************************************************************/
/**************************************************************************/
-/** */
-/** USBX Component */
+/** */
+/** USBX Component */
/** */
/** HID Mouse Client Class */
/** */
@@ -41,49 +42,38 @@ static inline UINT _ux_host_class_hid_mouse_activate_wait(UX_HOST_CLASS_HID_CLIE
#endif
-/**************************************************************************/
-/* */
-/* FUNCTION RELEASE */
-/* */
-/* _ux_host_class_hid_mouse_entry PORTABLE C */
+/**************************************************************************/
+/* */
+/* FUNCTION RELEASE */
+/* */
+/* _ux_host_class_hid_mouse_entry PORTABLE C */
/* 6.1.10 */
/* AUTHOR */
/* */
/* Chaoqiong Xiao, Microsoft Corporation */
/* */
/* DESCRIPTION */
-/* */
-/* This function is the entry point of the HID Mouse client. This */
+/* */
+/* This function is the entry point of the HID Mouse client. This */
/* function is called by the HID class after it has parsed a new HID */
-/* report descriptor and is searching for a HID client. */
-/* */
-/* INPUT */
-/* */
-/* command Pointer to command */
-/* */
-/* OUTPUT */
-/* */
-/* Completion Status */
-/* */
-/* CALLS */
-/* */
-/* _ux_host_class_hid_mouse_activate Activate HID mouse class */
-/* _ux_host_class_hid_mouse_deactivate Deactivate HID mouse class */
-/* */
-/* CALLED BY */
-/* */
-/* Host Stack */
-/* */
-/* RELEASE HISTORY */
-/* */
-/* DATE NAME DESCRIPTION */
-/* */
-/* 05-19-2020 Chaoqiong Xiao Initial Version 6.0 */
-/* 09-30-2020 Chaoqiong Xiao Modified comment(s), */
-/* resulting in version 6.1 */
-/* 01-31-2022 Chaoqiong Xiao Modified comment(s), */
-/* added standalone support, */
-/* resulting in version 6.1.10 */
+/* report descriptor and is searching for a HID client. */
+/* */
+/* INPUT */
+/* */
+/* command Pointer to command */
+/* */
+/* OUTPUT */
+/* */
+/* Completion Status */
+/* */
+/* CALLS */
+/* */
+/* _ux_host_class_hid_mouse_activate Activate HID mouse class */
+/* _ux_host_class_hid_mouse_deactivate Deactivate HID mouse class */
+/* */
+/* CALLED BY */
+/* */
+/* Host Stack */
/* */
/**************************************************************************/
UINT _ux_host_class_hid_mouse_entry(UX_HOST_CLASS_HID_CLIENT_COMMAND *command)
@@ -104,11 +94,11 @@ UINT status;
this device or not. */
if ((command -> ux_host_class_hid_client_command_page == UX_HOST_CLASS_HID_PAGE_GENERIC_DESKTOP_CONTROLS) &&
(command -> ux_host_class_hid_client_command_usage == UX_HOST_CLASS_HID_GENERIC_DESKTOP_MOUSE))
- return(UX_SUCCESS);
- else
- return(UX_NO_CLASS_MATCH);
-
-
+ return(UX_SUCCESS);
+ else
+ return(UX_NO_CLASS_MATCH);
+
+
case UX_HOST_CLASS_COMMAND_ACTIVATE:
/* The activate command is used by the HID class to start the HID client. */
@@ -132,7 +122,7 @@ UINT status;
/* Return completion status. */
return(status);
- }
+ }
/* Return error status. */
return(UX_ERROR);
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 3f77ef9c..e84a2f7d 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
@@ -1,18 +1,19 @@
/***************************************************************************
- * Copyright (c) 2024 Microsoft Corporation
- *
+ * Copyright (c) 2024 Microsoft Corporation
+ * Copyright (c) 2026-present Eclipse ThreadX contributors
+ *
* This program and the accompanying materials are made available under the
* terms of the MIT License which is available at
* https://opensource.org/licenses/MIT.
- *
+ *
* SPDX-License-Identifier: MIT
**************************************************************************/
/**************************************************************************/
/**************************************************************************/
-/** */
-/** USBX Component */
+/** */
+/** USBX Component */
/** */
/** HID Mouse Client Class */
/** */
@@ -30,50 +31,42 @@
#include "ux_host_stack.h"
-/**************************************************************************/
-/* */
-/* FUNCTION RELEASE */
-/* */
-/* _ux_host_class_hid_mouse_position_get PORTABLE C */
+/**************************************************************************/
+/* */
+/* FUNCTION RELEASE */
+/* */
+/* _ux_host_class_hid_mouse_position_get PORTABLE C */
/* 6.1 */
/* AUTHOR */
/* */
/* Chaoqiong Xiao, Microsoft Corporation */
/* */
/* DESCRIPTION */
-/* */
+/* */
/* This function reads the mouse position and reports it to the user. */
-/* We have the X and Y coordinates passed by the application. */
-/* */
-/* INPUT */
-/* */
-/* mouse_instance Pointer to mouse instance */
-/* mouse_x_position Current Mouse X Position */
-/* mouse_y_position Current Mouse Y Position */
-/* */
-/* OUTPUT */
-/* */
-/* Completion Status */
-/* */
-/* CALLS */
-/* */
-/* None */
-/* */
-/* CALLED BY */
-/* */
-/* HID Mouse Class */
-/* */
-/* RELEASE HISTORY */
-/* */
-/* DATE NAME DESCRIPTION */
-/* */
-/* 05-19-2020 Chaoqiong Xiao Initial Version 6.0 */
-/* 09-30-2020 Chaoqiong Xiao Modified comment(s), */
-/* resulting in version 6.1 */
+/* We have the X and Y coordinates passed by the application. */
+/* */
+/* INPUT */
+/* */
+/* mouse_instance Pointer to mouse instance */
+/* mouse_x_position Current Mouse X Position */
+/* mouse_y_position Current Mouse Y Position */
+/* */
+/* OUTPUT */
+/* */
+/* Completion Status */
+/* */
+/* CALLS */
+/* */
+/* None */
+/* */
+/* CALLED BY */
+/* */
+/* HID Mouse Class */
/* */
/**************************************************************************/
-UINT _ux_host_class_hid_mouse_position_get(UX_HOST_CLASS_HID_MOUSE *mouse_instance,
- SLONG *mouse_x_position,
+UINT _ux_host_class_hid_mouse_position_get(UX_HOST_CLASS_HID_MOUSE *mouse_instance,
+ SLONG *mouse_x_position,
SLONG *mouse_y_position)
{
@@ -81,10 +74,10 @@ UX_HOST_CLASS_HID *hid;
/* Get the HID class associated with the HID client. */
hid = mouse_instance -> ux_host_class_hid_mouse_hid;
-
+
/* Ensure the instance is valid. */
if (_ux_host_stack_class_instance_verify(_ux_system_host_class_hid_name, (VOID *) hid) != UX_SUCCESS)
- {
+ {
/* Error trap. */
_ux_system_error_handler(UX_SYSTEM_LEVEL_THREAD, UX_SYSTEM_CONTEXT_CLASS, UX_HOST_CLASS_INSTANCE_UNKNOWN);
@@ -102,7 +95,7 @@ UX_HOST_CLASS_HID *hid;
*mouse_y_position = mouse_instance -> ux_host_class_hid_mouse_y_position;
/* The status will tell the application there is something valid in the usage/value. */
- return(UX_SUCCESS);
+ return(UX_SUCCESS);
}
/**************************************************************************/
@@ -137,15 +130,9 @@ UX_HOST_CLASS_HID *hid;
/* */
/* Application */
/* */
-/* RELEASE HISTORY */
-/* */
-/* DATE NAME DESCRIPTION */
-/* */
-/* 10-31-2023 Chaoqiong Xiao Initial Version 6.3.0 */
-/* */
/**************************************************************************/
-UINT _uxe_host_class_hid_mouse_position_get(UX_HOST_CLASS_HID_MOUSE *mouse_instance,
- SLONG *mouse_x_position,
+UINT _uxe_host_class_hid_mouse_position_get(UX_HOST_CLASS_HID_MOUSE *mouse_instance,
+ SLONG *mouse_x_position,
SLONG *mouse_y_position)
{
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 b949048c..057164bb 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
@@ -1,18 +1,19 @@
/***************************************************************************
- * Copyright (c) 2024 Microsoft Corporation
- *
+ * Copyright (c) 2024 Microsoft Corporation
+ * Copyright (c) 2026-present Eclipse ThreadX contributors
+ *
* This program and the accompanying materials are made available under the
* terms of the MIT License which is available at
* https://opensource.org/licenses/MIT.
- *
+ *
* SPDX-License-Identifier: MIT
**************************************************************************/
/**************************************************************************/
/**************************************************************************/
-/** */
-/** USBX Component */
+/** */
+/** USBX Component */
/** */
/** HID Mouse Client Class */
/** */
@@ -30,58 +31,50 @@
#include "ux_host_stack.h"
-/**************************************************************************/
-/* */
-/* FUNCTION RELEASE */
-/* */
-/* _ux_host_class_hid_mouse_wheel_get PORTABLE C */
+/**************************************************************************/
+/* */
+/* FUNCTION RELEASE */
+/* */
+/* _ux_host_class_hid_mouse_wheel_get PORTABLE C */
/* 6.1 */
/* AUTHOR */
/* */
/* Chaoqiong Xiao, Microsoft Corporation */
/* */
/* DESCRIPTION */
-/* */
+/* */
/* This function reads the mouse wheel position (up or down). */
-/* */
-/* INPUT */
-/* */
-/* mouse_instance Pointer to mouse instance */
-/* mouse_wheel_movement Current Mouse wheel movement */
-/* */
-/* OUTPUT */
-/* */
-/* Completion Status */
-/* */
-/* CALLS */
-/* */
-/* None */
-/* */
-/* CALLED BY */
-/* */
-/* HID Mouse Class */
-/* */
-/* RELEASE HISTORY */
-/* */
-/* DATE NAME DESCRIPTION */
-/* */
-/* 05-19-2020 Chaoqiong Xiao Initial Version 6.0 */
-/* 09-30-2020 Chaoqiong Xiao Modified comment(s), */
-/* resulting in version 6.1 */
+/* */
+/* INPUT */
+/* */
+/* mouse_instance Pointer to mouse instance */
+/* mouse_wheel_movement Current Mouse wheel movement */
+/* */
+/* OUTPUT */
+/* */
+/* Completion Status */
+/* */
+/* CALLS */
+/* */
+/* None */
+/* */
+/* CALLED BY */
+/* */
+/* HID Mouse Class */
/* */
/**************************************************************************/
-UINT _ux_host_class_hid_mouse_wheel_get(UX_HOST_CLASS_HID_MOUSE *mouse_instance,
- SLONG *mouse_wheel_movement)
+UINT _ux_host_class_hid_mouse_wheel_get(UX_HOST_CLASS_HID_MOUSE *mouse_instance,
+ SLONG *mouse_wheel_movement)
{
UX_HOST_CLASS_HID *hid;
/* Get the HID class associated with the HID client. */
hid = mouse_instance -> ux_host_class_hid_mouse_hid;
-
+
/* Ensure the instance is valid. */
if (_ux_host_stack_class_instance_verify(_ux_system_host_class_hid_name, (VOID *) hid) != UX_SUCCESS)
- {
+ {
/* Error trap. */
_ux_system_error_handler(UX_SYSTEM_LEVEL_THREAD, UX_SYSTEM_CONTEXT_CLASS, UX_HOST_CLASS_INSTANCE_UNKNOWN);
@@ -96,7 +89,7 @@ UX_HOST_CLASS_HID *hid;
*mouse_wheel_movement = (SLONG)(mouse_instance -> ux_host_class_hid_mouse_wheel);
/* The status will tell the application there is something valid in the usage/value. */
- return(UX_SUCCESS);
+ return(UX_SUCCESS);
}
/**************************************************************************/
@@ -130,15 +123,9 @@ UX_HOST_CLASS_HID *hid;
/* */
/* Application */
/* */
-/* RELEASE HISTORY */
-/* */
-/* DATE NAME DESCRIPTION */
-/* */
-/* 10-31-2023 Chaoqiong Xiao Initial Version 6.3.0 */
-/* */
/**************************************************************************/
-UINT _uxe_host_class_hid_mouse_wheel_get(UX_HOST_CLASS_HID_MOUSE *mouse_instance,
- SLONG *mouse_wheel_movement)
+UINT _uxe_host_class_hid_mouse_wheel_get(UX_HOST_CLASS_HID_MOUSE *mouse_instance,
+ SLONG *mouse_wheel_movement)
{
/* Sanity checks. */
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 9d2b59ac..ae98157e 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
@@ -1,18 +1,19 @@
/***************************************************************************
- * Copyright (c) 2024 Microsoft Corporation
- *
+ * Copyright (c) 2024 Microsoft Corporation
+ * Copyright (c) 2026-present Eclipse ThreadX contributors
+ *
* This program and the accompanying materials are made available under the
* terms of the MIT License which is available at
* https://opensource.org/licenses/MIT.
- *
+ *
* SPDX-License-Identifier: MIT
**************************************************************************/
/**************************************************************************/
/**************************************************************************/
-/** */
-/** USBX Component */
+/** */
+/** USBX Component */
/** */
/** HID Class */
/** */
@@ -29,51 +30,40 @@
#include "ux_host_stack.h"
-/**************************************************************************/
-/* */
-/* FUNCTION RELEASE */
-/* */
-/* _ux_host_class_hid_periodic_report_start PORTABLE C */
+/**************************************************************************/
+/* */
+/* FUNCTION RELEASE */
+/* */
+/* _ux_host_class_hid_periodic_report_start PORTABLE C */
/* 6.1.10 */
/* AUTHOR */
/* */
/* Chaoqiong Xiao, Microsoft Corporation */
/* */
/* DESCRIPTION */
-/* */
+/* */
/* This function starts the interrupt endpoint to obtain the periodic */
-/* report. */
-/* */
-/* INPUT */
-/* */
-/* hid Pointer to HID class */
-/* */
-/* OUTPUT */
-/* */
-/* Completion Status */
-/* */
-/* CALLS */
-/* */
-/* _ux_host_stack_class_instance_verify Verify instance is valid */
-/* _ux_host_stack_transfer_request Process transfer request */
-/* _ux_host_semaphore_get Get protection semaphore */
-/* _ux_host_semaphore_put Release protection semaphore */
-/* */
-/* CALLED BY */
-/* */
-/* Application */
-/* HID Class */
-/* */
-/* RELEASE HISTORY */
-/* */
-/* DATE NAME DESCRIPTION */
-/* */
-/* 05-19-2020 Chaoqiong Xiao Initial Version 6.0 */
-/* 09-30-2020 Chaoqiong Xiao Modified comment(s), */
-/* resulting in version 6.1 */
-/* 01-31-2022 Chaoqiong Xiao Modified comment(s), */
-/* added standalone support, */
-/* resulting in version 6.1.10 */
+/* report. */
+/* */
+/* INPUT */
+/* */
+/* hid Pointer to HID class */
+/* */
+/* OUTPUT */
+/* */
+/* Completion Status */
+/* */
+/* CALLS */
+/* */
+/* _ux_host_stack_class_instance_verify Verify instance is valid */
+/* _ux_host_stack_transfer_request Process transfer request */
+/* _ux_host_semaphore_get Get protection semaphore */
+/* _ux_host_semaphore_put Release protection semaphore */
+/* */
+/* CALLED BY */
+/* */
+/* Application */
+/* HID Class */
/* */
/**************************************************************************/
UINT _ux_host_class_hid_periodic_report_start(UX_HOST_CLASS_HID *hid)
@@ -87,7 +77,7 @@ UX_TRANSFER *transfer_request;
/* Ensure the instance is valid. */
if (_ux_host_stack_class_instance_verify(_ux_system_host_class_hid_name, (VOID *) hid) != UX_SUCCESS)
- {
+ {
/* Error trap. */
_ux_system_error_handler(UX_SYSTEM_LEVEL_THREAD, UX_SYSTEM_CONTEXT_CLASS, UX_HOST_CLASS_INSTANCE_UNKNOWN);
@@ -127,7 +117,7 @@ UX_TRANSFER *transfer_request;
/* Check the status. If no error, adjust the status of the periodic endpoint
to active. */
if (status == UX_SUCCESS)
- hid -> ux_host_class_hid_interrupt_endpoint_status = UX_HOST_CLASS_HID_INTERRUPT_ENDPOINT_ACTIVE;
+ hid -> ux_host_class_hid_interrupt_endpoint_status = UX_HOST_CLASS_HID_INTERRUPT_ENDPOINT_ACTIVE;
/* Unprotect thread reentry to this instance. */
_ux_host_class_hid_unlock(hid);
@@ -168,12 +158,6 @@ UX_TRANSFER *transfer_request;
/* */
/* Application */
/* */
-/* RELEASE HISTORY */
-/* */
-/* DATE NAME DESCRIPTION */
-/* */
-/* 10-31-2023 Chaoqiong Xiao Initial Version 6.3.0 */
-/* */
/**************************************************************************/
UINT _uxe_host_class_hid_periodic_report_start(UX_HOST_CLASS_HID *hid)
{
diff --git a/common/usbx_host_classes/src/ux_host_class_hid_periodic_report_stop.c b/common/usbx_host_classes/src/ux_host_class_hid_periodic_report_stop.c
index d18eb3b8..e3af1238 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
@@ -1,18 +1,19 @@
/***************************************************************************
- * Copyright (c) 2024 Microsoft Corporation
- *
+ * Copyright (c) 2024 Microsoft Corporation
+ * Copyright (c) 2026-present Eclipse ThreadX contributors
+ *
* This program and the accompanying materials are made available under the
* terms of the MIT License which is available at
* https://opensource.org/licenses/MIT.
- *
+ *
* SPDX-License-Identifier: MIT
**************************************************************************/
/**************************************************************************/
/**************************************************************************/
-/** */
-/** USBX Component */
+/** */
+/** USBX Component */
/** */
/** HID Class */
/** */
@@ -29,51 +30,40 @@
#include "ux_host_stack.h"
-/**************************************************************************/
-/* */
-/* FUNCTION RELEASE */
-/* */
-/* _ux_host_class_hid_periodic_report_stop PORTABLE C */
+/**************************************************************************/
+/* */
+/* FUNCTION RELEASE */
+/* */
+/* _ux_host_class_hid_periodic_report_stop PORTABLE C */
/* 6.1.10 */
/* AUTHOR */
/* */
/* Chaoqiong Xiao, Microsoft Corporation */
/* */
/* DESCRIPTION */
-/* */
-/* This function stops the interrupt endpoint of the HID class */
-/* instance. */
-/* */
-/* INPUT */
-/* */
-/* hid Pointer to HID class */
-/* */
-/* OUTPUT */
-/* */
-/* Completion Status */
-/* */
-/* CALLS */
-/* */
-/* _ux_host_stack_class_instance_verify Verify instance is valid */
-/* _ux_host_stack_endpoint_transfer_abort Abort transfer on endpoint */
-/* _ux_host_semaphore_get Get protection semaphore */
-/* _ux_host_semaphore_put Release protection semaphore */
-/* */
-/* CALLED BY */
-/* */
-/* Application */
-/* HID Class */
-/* */
-/* RELEASE HISTORY */
-/* */
-/* DATE NAME DESCRIPTION */
-/* */
-/* 05-19-2020 Chaoqiong Xiao Initial Version 6.0 */
-/* 09-30-2020 Chaoqiong Xiao Modified comment(s), */
-/* resulting in version 6.1 */
-/* 01-31-2022 Chaoqiong Xiao Modified comment(s), */
-/* added standalone support, */
-/* resulting in version 6.1.10 */
+/* */
+/* This function stops the interrupt endpoint of the HID class */
+/* instance. */
+/* */
+/* INPUT */
+/* */
+/* hid Pointer to HID class */
+/* */
+/* OUTPUT */
+/* */
+/* Completion Status */
+/* */
+/* CALLS */
+/* */
+/* _ux_host_stack_class_instance_verify Verify instance is valid */
+/* _ux_host_stack_endpoint_transfer_abort Abort transfer on endpoint */
+/* _ux_host_semaphore_get Get protection semaphore */
+/* _ux_host_semaphore_put Release protection semaphore */
+/* */
+/* CALLED BY */
+/* */
+/* Application */
+/* HID Class */
/* */
/**************************************************************************/
UINT _ux_host_class_hid_periodic_report_stop(UX_HOST_CLASS_HID *hid)
@@ -81,7 +71,7 @@ UINT _ux_host_class_hid_periodic_report_stop(UX_HOST_CLASS_HID *hid)
/* Ensure the instance is valid. */
if (_ux_host_stack_class_instance_verify(_ux_system_host_class_hid_name, (VOID *) hid) != UX_SUCCESS)
- {
+ {
/* Error trap. */
_ux_system_error_handler(UX_SYSTEM_LEVEL_THREAD, UX_SYSTEM_CONTEXT_CLASS, UX_HOST_CLASS_INSTANCE_UNKNOWN);
@@ -94,7 +84,7 @@ UINT _ux_host_class_hid_periodic_report_stop(UX_HOST_CLASS_HID *hid)
/* Check the status of the interrupt endpoint. */
if (hid -> ux_host_class_hid_interrupt_endpoint_status != UX_HOST_CLASS_HID_INTERRUPT_ENDPOINT_ACTIVE)
- {
+ {
/* Error trap. */
_ux_system_error_handler(UX_SYSTEM_LEVEL_THREAD, UX_SYSTEM_CONTEXT_CLASS, UX_HOST_CLASS_HID_PERIODIC_REPORT_ERROR);
@@ -109,7 +99,7 @@ UINT _ux_host_class_hid_periodic_report_stop(UX_HOST_CLASS_HID *hid)
_ux_host_stack_endpoint_transfer_abort(hid -> ux_host_class_hid_interrupt_endpoint);
/* Regardless of the status, we update the status of the endpoint. */
- hid -> ux_host_class_hid_interrupt_endpoint_status = UX_HOST_CLASS_HID_INTERRUPT_ENDPOINT_READY;
+ hid -> ux_host_class_hid_interrupt_endpoint_status = UX_HOST_CLASS_HID_INTERRUPT_ENDPOINT_READY;
/* Return successful status. */
return(UX_SUCCESS);
@@ -147,12 +137,6 @@ UINT _ux_host_class_hid_periodic_report_stop(UX_HOST_CLASS_HID *hid)
/* */
/* Application */
/* */
-/* RELEASE HISTORY */
-/* */
-/* DATE NAME DESCRIPTION */
-/* */
-/* 10-31-2023 Chaoqiong Xiao Initial Version 6.3.0 */
-/* */
/**************************************************************************/
UINT _uxe_host_class_hid_periodic_report_stop(UX_HOST_CLASS_HID *hid)
{
diff --git a/common/usbx_host_classes/src/ux_host_class_hid_protocol_get.c b/common/usbx_host_classes/src/ux_host_class_hid_protocol_get.c
new file mode 100644
index 00000000..54c1d6ff
--- /dev/null
+++ b/common/usbx_host_classes/src/ux_host_class_hid_protocol_get.c
@@ -0,0 +1,142 @@
+/***************************************************************************
+ * Copyright (c) 2025-present Eclipse ThreadX Contributors
+ *
+ * This program and the accompanying materials are made available under the
+ * terms of the MIT License which is available at
+ * https://opensource.org/licenses/MIT.
+ *
+ * SPDX-License-Identifier: MIT
+ **************************************************************************/
+
+
+/**************************************************************************/
+/**************************************************************************/
+/** */
+/** USBX Component */
+/** */
+/** Host HID Class */
+/** */
+/**************************************************************************/
+/**************************************************************************/
+
+/* Include necessary system files. */
+
+#define UX_SOURCE_CODE
+
+#include "ux_api.h"
+#include "ux_host_class_hid.h"
+#include "ux_host_stack.h"
+
+/**************************************************************************/
+/* */
+/* FUNCTION RELEASE */
+/* */
+/* _ux_host_class_hid_protocol_get PORTABLE C */
+/* */
+/* DESCRIPTION */
+/* */
+/* This function performs a GET_PROTOCOL to the HID device to read */
+/* current protocol (BOOT=0 or REPORT=1). */
+/* */
+/* INPUT */
+/* */
+/* hid Pointer to HID class */
+/* protocol Destination for protocol */
+/* */
+/* OUTPUT */
+/* */
+/* Completion Status */
+/* */
+/* CALLED BY */
+/* */
+/* Application */
+/* */
+/* RELEASE HISTORY */
+/* */
+/* DATE NAME DESCRIPTION */
+/* */
+/**************************************************************************/
+UINT _ux_host_class_hid_protocol_get(UX_HOST_CLASS_HID *hid, USHORT *protocol)
+{
+
+UX_ENDPOINT *control_endpoint;
+UX_TRANSFER *transfer_request;
+UINT status;
+
+ /* Ensure the instance is valid. */
+ if (_ux_host_stack_class_instance_verify(_ux_system_host_class_hid_name, (VOID *) hid) != UX_SUCCESS)
+ {
+
+ /* If trace is enabled, insert this event into the trace buffer. */
+ UX_TRACE_IN_LINE_INSERT(UX_TRACE_ERROR, UX_HOST_CLASS_INSTANCE_UNKNOWN, hid, 0, 0, UX_TRACE_ERRORS, 0, 0)
+
+#if defined(UX_HOST_STANDALONE)
+ hid -> ux_host_class_hid_status = UX_HOST_CLASS_INSTANCE_UNKNOWN;
+#endif
+
+ return(UX_HOST_CLASS_INSTANCE_UNKNOWN);
+ }
+
+ _ux_utility_memory_set(protocol, 0, sizeof(USHORT));
+
+ /* Get the default control endpoint transfer request pointer. */
+ control_endpoint = &hid -> ux_host_class_hid_device -> ux_device_control_endpoint;
+ transfer_request = &control_endpoint -> ux_endpoint_transfer_request;
+
+#if !defined(UX_HOST_STANDALONE)
+
+ /* Protect thread reentry to this instance. */
+ status = _ux_host_semaphore_get(&hid -> ux_host_class_hid_semaphore, UX_WAIT_FOREVER);
+ if (status != UX_SUCCESS)
+ return(status);
+
+#endif
+
+ /* Create a transfer request for the GET_PROTOCOL request. */
+ transfer_request -> ux_transfer_request_data_pointer = (UCHAR *) protocol;
+ transfer_request -> ux_transfer_request_requested_length = 1;
+ transfer_request -> ux_transfer_request_function = UX_HOST_CLASS_HID_GET_PROTOCOL;
+ transfer_request -> ux_transfer_request_type = UX_REQUEST_IN | UX_REQUEST_TYPE_CLASS | UX_REQUEST_TARGET_INTERFACE;
+ transfer_request -> ux_transfer_request_value = 0;
+ transfer_request -> ux_transfer_request_index = hid -> ux_host_class_hid_interface -> ux_interface_descriptor.bInterfaceNumber;
+
+ /* Send request to HCD layer. */
+ status = _ux_host_stack_transfer_request(transfer_request);
+
+#if !defined(UX_HOST_STANDALONE)
+ /* Unprotect thread reentry to this instance. */
+ _ux_host_semaphore_put(&hid -> ux_host_class_hid_semaphore);
+#endif
+
+ return(status);
+}
+
+/**************************************************************************/
+/* */
+/* FUNCTION RELEASE */
+/* */
+/* _uxe_host_class_hid_protocol_get PORTABLE C */
+/* */
+/* DESCRIPTION */
+/* */
+/* This function checks errors in HID protocol get function call. */
+/* */
+/* INPUT */
+/* */
+/* hid Pointer to HID class */
+/* protocol Destination for protocol */
+/* */
+/* OUTPUT */
+/* */
+/* Status */
+/* */
+/**************************************************************************/
+UINT _uxe_host_class_hid_protocol_get(UX_HOST_CLASS_HID *hid, USHORT *protocol)
+{
+ /* Sanity check. */
+ if (hid == UX_NULL || protocol == UX_NULL)
+ return(UX_INVALID_PARAMETER);
+
+ /* Invoke protocol get function. */
+ return(_ux_host_class_hid_protocol_get(hid, protocol));
+}
diff --git a/common/usbx_host_classes/src/ux_host_class_hid_protocol_set.c b/common/usbx_host_classes/src/ux_host_class_hid_protocol_set.c
new file mode 100644
index 00000000..1a4a4c48
--- /dev/null
+++ b/common/usbx_host_classes/src/ux_host_class_hid_protocol_set.c
@@ -0,0 +1,145 @@
+/***************************************************************************
+ * Copyright (c) 2025-present Eclipse ThreadX Contributors
+ *
+ * This program and the accompanying materials are made available under the
+ * terms of the MIT License which is available at
+ * https://opensource.org/licenses/MIT.
+ *
+ * SPDX-License-Identifier: MIT
+ **************************************************************************/
+
+
+/**************************************************************************/
+/**************************************************************************/
+/** */
+/** USBX Component */
+/** */
+/** Host HID Class */
+/** */
+/**************************************************************************/
+/**************************************************************************/
+
+/* Include necessary system files. */
+
+#define UX_SOURCE_CODE
+
+#include "ux_api.h"
+#include "ux_host_class_hid.h"
+#include "ux_host_stack.h"
+
+/**************************************************************************/
+/* */
+/* FUNCTION RELEASE */
+/* */
+/* _ux_host_class_hid_protocol_set PORTABLE C */
+/* */
+/* DESCRIPTION */
+/* */
+/* This function performs a SET_PROTOCOL to the HID device to switch */
+/* between BOOT (0) and REPORT (1) protocols. */
+/* */
+/* INPUT */
+/* */
+/* hid Pointer to HID class */
+/* protocol Protocol (BOOT/REPORT) */
+/* */
+/* OUTPUT */
+/* */
+/* Completion Status */
+/* */
+/* CALLED BY */
+/* */
+/* Application */
+/* */
+/* RELEASE HISTORY */
+/* */
+/* DATE NAME DESCRIPTION */
+/* */
+/**************************************************************************/
+UINT _ux_host_class_hid_protocol_set(UX_HOST_CLASS_HID *hid, USHORT protocol)
+{
+
+UX_ENDPOINT *control_endpoint;
+UX_TRANSFER *transfer_request;
+UINT status;
+
+ /* Ensure the instance is valid. */
+ if (_ux_host_stack_class_instance_verify(_ux_system_host_class_hid_name, (VOID *) hid) != UX_SUCCESS)
+ {
+
+ /* If trace is enabled, insert this event into the trace buffer. */
+ UX_TRACE_IN_LINE_INSERT(UX_TRACE_ERROR, UX_HOST_CLASS_INSTANCE_UNKNOWN, hid, 0, 0, UX_TRACE_ERRORS, 0, 0)
+
+#if defined(UX_HOST_STANDALONE)
+ hid -> ux_host_class_hid_status = UX_HOST_CLASS_INSTANCE_UNKNOWN;
+#endif
+ return(UX_HOST_CLASS_INSTANCE_UNKNOWN);
+ }
+
+ /* Get the default control endpoint transfer request pointer. */
+ control_endpoint = &hid -> ux_host_class_hid_device -> ux_device_control_endpoint;
+ transfer_request = &control_endpoint -> ux_endpoint_transfer_request;
+
+#if !defined(UX_HOST_STANDALONE)
+
+ /* Protect thread reentry to this instance. */
+ status = _ux_host_semaphore_get(&hid -> ux_host_class_hid_semaphore, UX_WAIT_FOREVER);
+ if (status != UX_SUCCESS)
+ return(status);
+
+#endif
+
+ /* Create a transfer request for the SET_PROTOCOL 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_HOST_CLASS_HID_SET_PROTOCOL;
+ transfer_request -> ux_transfer_request_type = UX_REQUEST_OUT | UX_REQUEST_TYPE_CLASS | UX_REQUEST_TARGET_INTERFACE;
+ transfer_request -> ux_transfer_request_value = (UINT)protocol;
+ transfer_request -> ux_transfer_request_index = hid -> ux_host_class_hid_interface -> ux_interface_descriptor.bInterfaceNumber;
+
+ /* Send request to HCD layer. */
+ status = _ux_host_stack_transfer_request(transfer_request);
+
+#if !defined(UX_HOST_STANDALONE)
+ /* Unprotect thread reentry to this instance. */
+ _ux_host_semaphore_put(&hid -> ux_host_class_hid_semaphore);
+#endif
+
+ /* Return the function status. */
+ return(status);
+}
+
+/**************************************************************************/
+/* */
+/* FUNCTION RELEASE */
+/* */
+/* _uxe_host_class_hid_protocol_set PORTABLE C */
+/* */
+/* DESCRIPTION */
+/* */
+/* This function checks errors in HID protocol set function call. */
+/* */
+/* INPUT */
+/* */
+/* hid Pointer to HID class */
+/* protocol Protocol (BOOT/REPORT) */
+/* */
+/* OUTPUT */
+/* */
+/* Status */
+/* */
+/**************************************************************************/
+UINT _uxe_host_class_hid_protocol_set(UX_HOST_CLASS_HID *hid, USHORT protocol)
+{
+ /* Sanity check. */
+ if (hid == UX_NULL)
+ return(UX_INVALID_PARAMETER);
+
+ /* Validate protocol value: must be BOOT(0) or REPORT(1). */
+ if (protocol != UX_HOST_CLASS_HID_PROTOCOL_BOOT &&
+ protocol != UX_HOST_CLASS_HID_PROTOCOL_REPORT)
+ return(UX_INVALID_PARAMETER);
+
+ /* Invoke protocol set function. */
+ return(_ux_host_class_hid_protocol_set(hid, protocol));
+}
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 89c780d8..c353fceb 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
@@ -1,18 +1,19 @@
/***************************************************************************
- * Copyright (c) 2024 Microsoft Corporation
- *
+ * Copyright (c) 2024 Microsoft Corporation
+ * Copyright (c) 2026-present Eclipse ThreadX contributors
+ *
* This program and the accompanying materials are made available under the
* terms of the MIT License which is available at
* https://opensource.org/licenses/MIT.
- *
+ *
* SPDX-License-Identifier: MIT
**************************************************************************/
/**************************************************************************/
/**************************************************************************/
-/** */
-/** USBX Component */
+/** */
+/** USBX Component */
/** */
/** HID Remote Control Class */
/** */
@@ -30,49 +31,38 @@
#include "ux_host_stack.h"
-/**************************************************************************/
-/* */
-/* FUNCTION RELEASE */
-/* */
-/* _ux_host_class_hid_remote_control_activate PORTABLE C */
+/**************************************************************************/
+/* */
+/* FUNCTION RELEASE */
+/* */
+/* _ux_host_class_hid_remote_control_activate PORTABLE C */
/* 6.1.11 */
/* AUTHOR */
/* */
/* Chaoqiong Xiao, Microsoft Corporation */
/* */
/* DESCRIPTION */
-/* */
-/* This function performs the enumeration of a HID Remote Control */
-/* class. */
-/* */
-/* INPUT */
-/* */
+/* */
+/* This function performs the enumeration of a HID Remote Control */
+/* class. */
+/* */
+/* INPUT */
+/* */
/* command Pointer to command */
-/* */
-/* OUTPUT */
-/* */
-/* Completion Status */
-/* */
-/* CALLS */
-/* */
-/* _ux_host_class_hid_periodic_report_start Start periodic report */
-/* _ux_host_class_hid_report_callback_register Register callback */
-/* _ux_utility_memory_allocate Allocate memory block */
-/* */
-/* CALLED BY */
-/* */
-/* HID Remote Control Class */
-/* */
-/* RELEASE HISTORY */
-/* */
-/* DATE NAME DESCRIPTION */
-/* */
-/* 05-19-2020 Chaoqiong Xiao Initial Version 6.0 */
-/* 09-30-2020 Chaoqiong Xiao Modified comment(s), */
-/* resulting in version 6.1 */
-/* 04-25-2022 Chaoqiong Xiao Modified comment(s), */
-/* fixed clients management, */
-/* resulting in version 6.1.11 */
+/* */
+/* OUTPUT */
+/* */
+/* Completion Status */
+/* */
+/* CALLS */
+/* */
+/* _ux_host_class_hid_periodic_report_start Start periodic report */
+/* _ux_host_class_hid_report_callback_register Register callback */
+/* _ux_utility_memory_allocate Allocate memory block */
+/* */
+/* CALLED BY */
+/* */
+/* HID Remote Control Class */
/* */
/**************************************************************************/
UINT _ux_host_class_hid_remote_control_activate(UX_HOST_CLASS_HID_CLIENT_COMMAND *command)
@@ -92,7 +82,7 @@ UINT status = UX_SUCCESS;
/* Get some memory for both the HID class instance and copy of this client
and for the callback. */
client_remote_control = (UX_HOST_CLASS_HID_CLIENT_REMOTE_CONTROL *)
- _ux_utility_memory_allocate(UX_NO_ALIGN, UX_REGULAR_MEMORY,
+ _ux_utility_memory_allocate(UX_NO_ALIGN, UX_REGULAR_MEMORY,
sizeof(UX_HOST_CLASS_HID_CLIENT_REMOTE_CONTROL));
if (client_remote_control == UX_NULL)
return(UX_MEMORY_INSUFFICIENT);
@@ -116,7 +106,7 @@ UINT status = UX_SUCCESS;
* Size calculation overflow is checked near where _USAGE_ARRAY_LENGTH is defined.
*/
remote_control_instance -> ux_host_class_hid_remote_control_usage_array = (ULONG *)
- _ux_utility_memory_allocate(UX_NO_ALIGN, UX_REGULAR_MEMORY,
+ _ux_utility_memory_allocate(UX_NO_ALIGN, UX_REGULAR_MEMORY,
UX_HOST_CLASS_HID_REMOTE_CONTROL_USAGE_ARRAY_LENGTH*4);
/* Check memory pointer. */
@@ -183,6 +173,6 @@ UINT status = UX_SUCCESS;
_ux_utility_memory_free(remote_control_instance);
/* Return completion status. */
- return(status);
+ return(status);
}
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 139198ca..88292c3c 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
@@ -1,18 +1,19 @@
/***************************************************************************
- * Copyright (c) 2024 Microsoft Corporation
- *
+ * Copyright (c) 2024 Microsoft Corporation
+ * Copyright (c) 2026-present Eclipse ThreadX contributors
+ *
* This program and the accompanying materials are made available under the
* terms of the MIT License which is available at
* https://opensource.org/licenses/MIT.
- *
+ *
* SPDX-License-Identifier: MIT
**************************************************************************/
/**************************************************************************/
/**************************************************************************/
-/** */
-/** USBX Component */
+/** */
+/** USBX Component */
/** */
/** HID Remote Control Class */
/** */
@@ -30,43 +31,35 @@
#include "ux_host_stack.h"
-/**************************************************************************/
-/* */
-/* FUNCTION RELEASE */
-/* */
-/* _ux_host_class_hid_remote_control_callback PORTABLE C */
+/**************************************************************************/
+/* */
+/* FUNCTION RELEASE */
+/* */
+/* _ux_host_class_hid_remote_control_callback PORTABLE C */
/* 6.1 */
/* AUTHOR */
/* */
/* Chaoqiong Xiao, Microsoft Corporation */
/* */
/* DESCRIPTION */
-/* */
-/* This function is the callback mechanism for a report registration. */
-/* */
-/* INPUT */
-/* */
-/* callback Pointer to callback */
-/* */
-/* OUTPUT */
-/* */
-/* None */
-/* */
-/* CALLS */
-/* */
-/* None */
-/* */
-/* CALLED BY */
-/* */
-/* HID Remote Control Class */
-/* */
-/* RELEASE HISTORY */
-/* */
-/* DATE NAME DESCRIPTION */
-/* */
-/* 05-19-2020 Chaoqiong Xiao Initial Version 6.0 */
-/* 09-30-2020 Chaoqiong Xiao Modified comment(s), */
-/* resulting in version 6.1 */
+/* */
+/* This function is the callback mechanism for a report registration. */
+/* */
+/* INPUT */
+/* */
+/* callback Pointer to callback */
+/* */
+/* OUTPUT */
+/* */
+/* None */
+/* */
+/* CALLS */
+/* */
+/* None */
+/* */
+/* CALLED BY */
+/* */
+/* HID Remote Control Class */
/* */
/**************************************************************************/
VOID _ux_host_class_hid_remote_control_callback(UX_HOST_CLASS_HID_REPORT_CALLBACK *callback)
@@ -93,8 +86,8 @@ ULONG *array_head_next;
array_head = remote_control_instance -> ux_host_class_hid_remote_control_usage_array_head;
array_tail = remote_control_instance -> ux_host_class_hid_remote_control_usage_array_tail;
- /* We have a single usage/value. We have to store it into the array. If the array overflows,
- there is no mechanism for flow control here so we ignore the usage/value until the
+ /* We have a single usage/value. We have to store it into the array. If the array overflows,
+ there is no mechanism for flow control here so we ignore the usage/value until the
applications makes more room in the array. */
/* Get position where next head will be. */
@@ -127,6 +120,6 @@ ULONG *array_head_next;
}
/* Return to caller. */
- return;
+ return;
}
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 57d7562d..1db2e56b 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
@@ -1,18 +1,19 @@
/***************************************************************************
- * Copyright (c) 2024 Microsoft Corporation
- *
+ * Copyright (c) 2024 Microsoft Corporation
+ * Copyright (c) 2026-present Eclipse ThreadX contributors
+ *
* This program and the accompanying materials are made available under the
* terms of the MIT License which is available at
* https://opensource.org/licenses/MIT.
- *
+ *
* SPDX-License-Identifier: MIT
**************************************************************************/
/**************************************************************************/
/**************************************************************************/
-/** */
-/** USBX Component */
+/** */
+/** USBX Component */
/** */
/** HID Remote Control Class */
/** */
@@ -30,48 +31,37 @@
#include "ux_host_stack.h"
-/**************************************************************************/
-/* */
-/* FUNCTION RELEASE */
-/* */
-/* _ux_host_class_hid_remote_control_deactivate PORTABLE C */
+/**************************************************************************/
+/* */
+/* FUNCTION RELEASE */
+/* */
+/* _ux_host_class_hid_remote_control_deactivate PORTABLE C */
/* 6.3.0 */
/* AUTHOR */
/* */
/* Chaoqiong Xiao, Microsoft Corporation */
/* */
/* DESCRIPTION */
-/* */
-/* This function performs the deactivation of a HID Remote Control */
-/* class instance. */
-/* */
-/* INPUT */
-/* */
+/* */
+/* This function performs the deactivation of a HID Remote Control */
+/* class instance. */
+/* */
+/* INPUT */
+/* */
/* command Pointer to command */
-/* */
-/* OUTPUT */
-/* */
-/* Completion Status */
-/* */
-/* CALLS */
-/* */
-/* _ux_host_class_hid_periodic_report_stop Stop periodic report */
+/* */
+/* OUTPUT */
+/* */
+/* Completion Status */
+/* */
+/* CALLS */
+/* */
+/* _ux_host_class_hid_periodic_report_stop Stop periodic report */
/* _ux_utility_memory_free Release memory block */
-/* */
-/* CALLED BY */
-/* */
-/* HID Remote Control Class */
-/* */
-/* RELEASE HISTORY */
-/* */
-/* DATE NAME DESCRIPTION */
-/* */
-/* 05-19-2020 Chaoqiong Xiao Initial Version 6.0 */
-/* 09-30-2020 Chaoqiong Xiao Modified comment(s), */
-/* resulting in version 6.1 */
-/* 10-31-2023 Chaoqiong Xiao Modified comment(s), */
-/* improved unload sequence, */
-/* resulting in version 6.3.0 */
+/* */
+/* CALLED BY */
+/* */
+/* HID Remote Control Class */
/* */
/**************************************************************************/
UINT _ux_host_class_hid_remote_control_deactivate(UX_HOST_CLASS_HID_CLIENT_COMMAND *command)
@@ -82,7 +72,7 @@ UX_HOST_CLASS_HID_CLIENT *hid_client;
UX_HOST_CLASS_HID_REMOTE_CONTROL *remote_control_instance;
UINT status;
-
+
/* Get the instance to the HID class. */
hid = command -> ux_host_class_hid_client_command_instance;
@@ -102,7 +92,7 @@ UINT status;
if a function has been programmed in the system structure. */
if (_ux_system_host -> ux_system_host_change_function != UX_NULL)
{
-
+
/* Call system change function. */
_ux_system_host -> ux_system_host_change_function(UX_HID_CLIENT_REMOVAL, hid -> ux_host_class_hid_class, (VOID *) hid_client);
}
@@ -114,6 +104,6 @@ UINT status;
_ux_utility_memory_free(hid_client -> ux_host_class_hid_client_local_instance);
/* Return completion status. */
- return(status);
+ return(status);
}
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 172b3136..a7c51042 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
@@ -1,18 +1,19 @@
/***************************************************************************
- * Copyright (c) 2024 Microsoft Corporation
- *
+ * Copyright (c) 2024 Microsoft Corporation
+ * Copyright (c) 2026-present Eclipse ThreadX contributors
+ *
* This program and the accompanying materials are made available under the
* terms of the MIT License which is available at
* https://opensource.org/licenses/MIT.
- *
+ *
* SPDX-License-Identifier: MIT
**************************************************************************/
/**************************************************************************/
/**************************************************************************/
-/** */
-/** USBX Component */
+/** */
+/** USBX Component */
/** */
/** HID Remote Control Class */
/** */
@@ -30,51 +31,40 @@
#include "ux_host_stack.h"
-/**************************************************************************/
-/* */
-/* FUNCTION RELEASE */
-/* */
-/* _ux_host_class_hid_remote_control_entry PORTABLE C */
+/**************************************************************************/
+/* */
+/* FUNCTION RELEASE */
+/* */
+/* _ux_host_class_hid_remote_control_entry PORTABLE C */
/* 6.1.10 */
/* AUTHOR */
/* */
/* Chaoqiong Xiao, Microsoft Corporation */
/* */
/* DESCRIPTION */
-/* */
+/* */
/* This function is the entry point of the HID Remote Control client. */
-/* This function is called by the HID class after it has parsed a new */
-/* HID report descriptor and is searching for a HID client. */
-/* */
-/* INPUT */
-/* */
+/* This function is called by the HID class after it has parsed a new */
+/* HID report descriptor and is searching for a HID client. */
+/* */
+/* INPUT */
+/* */
/* command Pointer to command */
-/* */
-/* OUTPUT */
-/* */
-/* Completion Status */
-/* */
-/* CALLS */
-/* */
-/* _ux_host_class_hid_remote_control_activate */
-/* Activate HID RC class */
-/* _ux_host_class_hid_remote_control_deactivate */
-/* Deactivate HID RC class */
-/* */
-/* CALLED BY */
-/* */
-/* Host Stack */
-/* */
-/* RELEASE HISTORY */
-/* */
-/* DATE NAME DESCRIPTION */
-/* */
-/* 05-19-2020 Chaoqiong Xiao Initial Version 6.0 */
-/* 09-30-2020 Chaoqiong Xiao Modified comment(s), */
-/* resulting in version 6.1 */
-/* 01-31-2022 Chaoqiong Xiao Modified comment(s), */
-/* added standalone support, */
-/* resulting in version 6.1.10 */
+/* */
+/* OUTPUT */
+/* */
+/* Completion Status */
+/* */
+/* CALLS */
+/* */
+/* _ux_host_class_hid_remote_control_activate */
+/* Activate HID RC class */
+/* _ux_host_class_hid_remote_control_deactivate */
+/* Deactivate HID RC class */
+/* */
+/* CALLED BY */
+/* */
+/* Host Stack */
/* */
/**************************************************************************/
UINT _ux_host_class_hid_remote_control_entry(UX_HOST_CLASS_HID_CLIENT_COMMAND *command)
@@ -95,10 +85,10 @@ UINT status;
this device or not */
if ((command -> ux_host_class_hid_client_command_page == UX_HOST_CLASS_HID_PAGE_CONSUMER) &&
(command -> ux_host_class_hid_client_command_usage == UX_HOST_CLASS_HID_CONSUMER_REMOTE_CONTROL))
- return(UX_SUCCESS);
- else
- return(UX_NO_CLASS_MATCH);
-
+ return(UX_SUCCESS);
+ else
+ return(UX_NO_CLASS_MATCH);
+
case UX_HOST_CLASS_COMMAND_ACTIVATE:
@@ -128,7 +118,7 @@ UINT status;
default:
break;
- }
+ }
/* Return error status. */
return(UX_ERROR);
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 03e3f747..183e5c6a 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
@@ -1,18 +1,19 @@
/***************************************************************************
- * Copyright (c) 2024 Microsoft Corporation
- *
+ * Copyright (c) 2024 Microsoft Corporation
+ * Copyright (c) 2026-present Eclipse ThreadX contributors
+ *
* This program and the accompanying materials are made available under the
* terms of the MIT License which is available at
* https://opensource.org/licenses/MIT.
- *
+ *
* SPDX-License-Identifier: MIT
**************************************************************************/
/**************************************************************************/
/**************************************************************************/
-/** */
-/** USBX Component */
+/** */
+/** USBX Component */
/** */
/** HID Remote Control Class */
/** */
@@ -30,46 +31,38 @@
#include "ux_host_stack.h"
-/**************************************************************************/
-/* */
-/* FUNCTION RELEASE */
-/* */
-/* _ux_host_class_hid_remote_control_usage_get PORTABLE C */
+/**************************************************************************/
+/* */
+/* FUNCTION RELEASE */
+/* */
+/* _ux_host_class_hid_remote_control_usage_get PORTABLE C */
/* 6.1 */
/* AUTHOR */
/* */
/* Chaoqiong Xiao, Microsoft Corporation */
/* */
/* DESCRIPTION */
-/* */
-/* This function reads the usage and value from the remote control */
-/* round-robin buffer. */
-/* */
-/* INPUT */
-/* */
-/* remote_control_instance Pointer to remote control */
-/* usage Pointer to usage */
-/* value Pointer to value */
-/* */
-/* OUTPUT */
-/* */
-/* Completion Status */
-/* */
-/* CALLS */
-/* */
-/* None */
-/* */
-/* CALLED BY */
-/* */
-/* HID Remote Control Class */
-/* */
-/* RELEASE HISTORY */
-/* */
-/* DATE NAME DESCRIPTION */
-/* */
-/* 05-19-2020 Chaoqiong Xiao Initial Version 6.0 */
-/* 09-30-2020 Chaoqiong Xiao Modified comment(s), */
-/* resulting in version 6.1 */
+/* */
+/* This function reads the usage and value from the remote control */
+/* round-robin buffer. */
+/* */
+/* INPUT */
+/* */
+/* remote_control_instance Pointer to remote control */
+/* usage Pointer to usage */
+/* value Pointer to value */
+/* */
+/* OUTPUT */
+/* */
+/* Completion Status */
+/* */
+/* CALLS */
+/* */
+/* None */
+/* */
+/* CALLED BY */
+/* */
+/* HID Remote Control Class */
/* */
/**************************************************************************/
UINT _ux_host_class_hid_remote_control_usage_get(UX_HOST_CLASS_HID_REMOTE_CONTROL *remote_control_instance, ULONG *usage, ULONG *value)
@@ -83,10 +76,10 @@ UX_HOST_CLASS_HID *hid;
/* Get the HID class associated with the HID client. */
hid = remote_control_instance -> ux_host_class_hid_remote_control_hid;
-
+
/* Ensure the instance is valid. */
if (_ux_host_stack_class_instance_verify(_ux_system_host_class_hid_name, (VOID *) hid) != UX_SUCCESS)
- {
+ {
/* Error trap. */
_ux_system_error_handler(UX_SYSTEM_LEVEL_THREAD, UX_SYSTEM_CONTEXT_CLASS, UX_HOST_CLASS_INSTANCE_UNKNOWN);
@@ -121,7 +114,7 @@ UX_HOST_CLASS_HID *hid;
remote_control_instance -> ux_host_class_hid_remote_control_usage_array_tail = array_tail;
/* The status will tell the application there is something valid in the usage/value. */
- return(UX_SUCCESS);
+ return(UX_SUCCESS);
}
/**************************************************************************/
@@ -157,12 +150,6 @@ UX_HOST_CLASS_HID *hid;
/* */
/* Application */
/* */
-/* RELEASE HISTORY */
-/* */
-/* DATE NAME DESCRIPTION */
-/* */
-/* 10-31-2023 Chaoqiong Xiao Initial Version 6.3.0 */
-/* */
/**************************************************************************/
UINT _uxe_host_class_hid_remote_control_usage_get(
UX_HOST_CLASS_HID_REMOTE_CONTROL *remote_control_instance,
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 f8a29783..6293e323 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
@@ -1,18 +1,19 @@
/***************************************************************************
- * Copyright (c) 2024 Microsoft Corporation
- *
+ * Copyright (c) 2024 Microsoft Corporation
+ * Copyright (c) 2026-present Eclipse ThreadX contributors
+ *
* This program and the accompanying materials are made available under the
* terms of the MIT License which is available at
* https://opensource.org/licenses/MIT.
- *
+ *
* SPDX-License-Identifier: MIT
**************************************************************************/
/**************************************************************************/
/**************************************************************************/
-/** */
-/** USBX Component */
+/** */
+/** USBX Component */
/** */
/** HID Class */
/** */
@@ -29,58 +30,41 @@
#include "ux_host_stack.h"
-/**************************************************************************/
-/* */
-/* FUNCTION RELEASE */
-/* */
-/* _ux_host_class_hid_report_add PORTABLE C */
+/**************************************************************************/
+/* */
+/* FUNCTION RELEASE */
+/* */
+/* _ux_host_class_hid_report_add PORTABLE C */
/* 6.3.0 */
/* AUTHOR */
/* */
/* Chaoqiong Xiao, Microsoft Corporation */
/* */
/* DESCRIPTION */
-/* */
-/* This function adds a report (input/output/feature) to the current */
-/* parser. */
-/* */
-/* INPUT */
-/* */
-/* hid Pointer to HID class */
-/* descriptor Pointer to descriptor */
-/* item Pointer to item */
-/* */
-/* OUTPUT */
-/* */
-/* Completion Status */
-/* */
-/* CALLS */
-/* */
-/* _ux_host_class_hid_item_data_get Get data item */
-/* _ux_utility_memory_allocate Allocate memory block */
-/* _ux_utility_memory_copy Copy memory block */
-/* _ux_utility_memory_free Release memory block */
-/* */
-/* CALLED BY */
-/* */
-/* HID Class */
-/* */
-/* RELEASE HISTORY */
-/* */
-/* DATE NAME DESCRIPTION */
-/* */
-/* 05-19-2020 Chaoqiong Xiao Initial Version 6.0 */
-/* 09-30-2020 Chaoqiong Xiao Modified comment(s), */
-/* verified memset and memcpy */
-/* cases, */
-/* resulting in version 6.1 */
-/* 08-02-2021 Wen Wang Modified comment(s), */
-/* fixed spelling error, */
-/* resulting in version 6.1.8 */
-/* 10-31-2023 Chaoqiong Xiao Modified comment(s), */
-/* fixed field managing issue, */
-/* improved usage handling, */
-/* resulting in version 6.3.0 */
+/* */
+/* This function adds a report (input/output/feature) to the current */
+/* parser. */
+/* */
+/* INPUT */
+/* */
+/* hid Pointer to HID class */
+/* descriptor Pointer to descriptor */
+/* item Pointer to item */
+/* */
+/* OUTPUT */
+/* */
+/* Completion Status */
+/* */
+/* CALLS */
+/* */
+/* _ux_host_class_hid_item_data_get Get data item */
+/* _ux_utility_memory_allocate Allocate memory block */
+/* _ux_utility_memory_copy Copy memory block */
+/* _ux_utility_memory_free Release memory block */
+/* */
+/* CALLED BY */
+/* */
+/* HID Class */
/* */
/**************************************************************************/
UINT _ux_host_class_hid_report_add(UX_HOST_CLASS_HID *hid, UCHAR *descriptor, UX_HOST_CLASS_HID_ITEM *item)
@@ -107,7 +91,7 @@ ULONG current_field_address;
if (new_hid_report == UX_NULL)
return(UX_MEMORY_INSUFFICIENT);
- /* We need to select the report entry based on the type of report. If the entry in the
+ /* We need to select the report entry based on the type of report. If the entry in the
report chain is NULL, this is the first report so update the start of the chain. */
switch (item -> ux_host_class_hid_item_report_tag)
{
@@ -120,7 +104,7 @@ ULONG current_field_address;
/* This is a Input report. */
new_hid_report -> ux_host_class_hid_report_type = UX_HOST_CLASS_HID_REPORT_TYPE_INPUT;
- break;
+ break;
case UX_HOST_CLASS_HID_MAIN_TAG_OUTPUT:
@@ -131,7 +115,7 @@ ULONG current_field_address;
/* This is output report. */
new_hid_report -> ux_host_class_hid_report_type = UX_HOST_CLASS_HID_REPORT_TYPE_OUTPUT;
break;
-
+
case UX_HOST_CLASS_HID_MAIN_TAG_FEATURE:
hid_report = hid_parser -> ux_host_class_hid_parser_feature_report;
@@ -140,7 +124,7 @@ ULONG current_field_address;
/* This is a Feature report. */
new_hid_report -> ux_host_class_hid_report_type = UX_HOST_CLASS_HID_REPORT_TYPE_FEATURE;
- break;
+ break;
default:
@@ -155,7 +139,7 @@ ULONG current_field_address;
/* Return an error. */
return(UX_HOST_CLASS_HID_REPORT_ERROR);
- }
+ }
/* If there is a preceding report, locate the end of the report chain. */
if (hid_report != UX_NULL)
@@ -163,9 +147,9 @@ ULONG current_field_address;
while (hid_report -> ux_host_class_hid_report_next_report != UX_NULL)
hid_report = hid_report -> ux_host_class_hid_report_next_report;
- }
+ }
- /* If this report is part of the current global report, use the last report
+ /* If this report is part of the current global report, use the last report
to add the fields. */
if ((hid_report != UX_NULL) && (hid_report -> ux_host_class_hid_report_id == hid_parser -> ux_host_class_hid_parser_global.ux_host_class_hid_global_item_report_id))
{
@@ -201,7 +185,7 @@ ULONG current_field_address;
hid_field_count = hid_parser -> ux_host_class_hid_parser_global.ux_host_class_hid_global_item_report_count;
/* If the field count is null, this is only padding and there is no field to be allocated to the report. */
- if (hid_field_count == 0)
+ if (hid_field_count == 0)
return(UX_SUCCESS);
/* Create the field structure. */
@@ -256,14 +240,14 @@ ULONG current_field_address;
/* Allocate memory for the usages. */
new_hid_field -> ux_host_class_hid_field_usages = _ux_utility_memory_allocate_mulc_safe(UX_NO_ALIGN, UX_REGULAR_MEMORY, hid_parser -> ux_host_class_hid_parser_local.ux_host_class_hid_local_item_number_usage, 4);
- if (new_hid_field -> ux_host_class_hid_field_usages == UX_NULL)
+ if (new_hid_field -> ux_host_class_hid_field_usages == UX_NULL)
{
_ux_utility_memory_free(new_hid_field -> ux_host_class_hid_field_values);
_ux_utility_memory_free(new_hid_field);
return(UX_MEMORY_INSUFFICIENT);
}
-
+
/* 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_parser -> ux_host_class_hid_parser_local.ux_host_class_hid_local_item_number_usage * 4); /* Use case of memcpy is verified. */
}
@@ -271,8 +255,8 @@ ULONG current_field_address;
/* Save the number of usages. */
new_hid_field -> ux_host_class_hid_field_number_usage = hid_parser -> ux_host_class_hid_parser_local.ux_host_class_hid_local_item_number_usage;
- /* Attach the new field to the report. The report may already contain a field, if so parse the chain
- until we reach the end of the chain. */
+ /* Attach the new field to the report. The report may already contain a field, if so parse the chain
+ until we reach the end of the chain. */
new_hid_report -> ux_host_class_hid_report_number_item += hid_field_count;
if (new_hid_report -> ux_host_class_hid_report_field == UX_NULL)
{
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 e49825bc..9db44655 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
@@ -1,18 +1,19 @@
/***************************************************************************
- * Copyright (c) 2024 Microsoft Corporation
- *
+ * Copyright (c) 2024 Microsoft Corporation
+ * Copyright (c) 2026-present Eclipse ThreadX contributors
+ *
* This program and the accompanying materials are made available under the
* terms of the MIT License which is available at
* https://opensource.org/licenses/MIT.
- *
+ *
* SPDX-License-Identifier: MIT
**************************************************************************/
/**************************************************************************/
/**************************************************************************/
-/** */
-/** USBX Component */
+/** */
+/** USBX Component */
/** */
/** HID Class */
/** */
@@ -29,55 +30,44 @@
#include "ux_host_stack.h"
-/**************************************************************************/
-/* */
-/* FUNCTION RELEASE */
-/* */
-/* _ux_host_class_hid_report_callback_register PORTABLE C */
+/**************************************************************************/
+/* */
+/* FUNCTION RELEASE */
+/* */
+/* _ux_host_class_hid_report_callback_register PORTABLE C */
/* 6.1.10 */
/* AUTHOR */
/* */
/* Chaoqiong Xiao, Microsoft Corporation */
/* */
/* DESCRIPTION */
-/* */
+/* */
/* This function will register a report callback to a HID report. */
/* This function should be called by a HID client when it has been */
/* instantiated by a new HID device. */
/* */
-/* The registration process will allow the HID class to call a */
-/* function in the HID client when an asynchronous report is present. */
-/* */
-/* INPUT */
-/* */
-/* hid Pointer to HID class */
-/* call_back HID report callback */
-/* */
-/* OUTPUT */
-/* */
-/* Completion Status */
-/* */
-/* CALLS */
-/* */
-/* _ux_host_stack_class_instance_verify Verify class instance is valid*/
-/* _ux_host_semaphore_get Get protection semaphore */
-/* _ux_host_semaphore_put Release protection semaphore */
-/* */
-/* CALLED BY */
-/* */
-/* Application */
-/* HID Class */
-/* */
-/* RELEASE HISTORY */
-/* */
-/* DATE NAME DESCRIPTION */
-/* */
-/* 05-19-2020 Chaoqiong Xiao Initial Version 6.0 */
-/* 09-30-2020 Chaoqiong Xiao Modified comment(s), */
-/* resulting in version 6.1 */
-/* 01-31-2022 Chaoqiong Xiao Modified comment(s), */
-/* added standalone support, */
-/* resulting in version 6.1.10 */
+/* The registration process will allow the HID class to call a */
+/* function in the HID client when an asynchronous report is present. */
+/* */
+/* INPUT */
+/* */
+/* hid Pointer to HID class */
+/* call_back HID report callback */
+/* */
+/* OUTPUT */
+/* */
+/* Completion Status */
+/* */
+/* CALLS */
+/* */
+/* _ux_host_stack_class_instance_verify Verify class instance is valid*/
+/* _ux_host_semaphore_get Get protection semaphore */
+/* _ux_host_semaphore_put Release protection semaphore */
+/* */
+/* CALLED BY */
+/* */
+/* Application */
+/* HID Class */
/* */
/**************************************************************************/
UINT _ux_host_class_hid_report_callback_register(UX_HOST_CLASS_HID *hid, UX_HOST_CLASS_HID_REPORT_CALLBACK *call_back)
@@ -91,7 +81,7 @@ UX_HOST_CLASS_HID_REPORT *hid_report;
/* Ensure the instance is valid. */
if (_ux_host_stack_class_instance_verify(_ux_system_host_class_hid_name, (VOID *) hid) != UX_SUCCESS)
- {
+ {
/* Error trap. */
_ux_system_error_handler(UX_SYSTEM_LEVEL_THREAD, UX_SYSTEM_CONTEXT_CLASS, UX_HOST_CLASS_INSTANCE_UNKNOWN);
@@ -107,7 +97,7 @@ UX_HOST_CLASS_HID_REPORT *hid_report;
/* Search for the report ID. Note that this can only be an Input report! */
hid_report = hid -> ux_host_class_hid_parser.ux_host_class_hid_parser_input_report;
-
+
/* Parse all the report IDs in search of the one specified by the user. */
while (hid_report != UX_NULL)
{
@@ -115,7 +105,7 @@ UX_HOST_CLASS_HID_REPORT *hid_report;
/* Check report ID. */
if (hid_report -> ux_host_class_hid_report_id == call_back -> ux_host_class_hid_report_callback_id)
{
-
+
/* We have found the correct report. Set the call back function, buffer and flags. */
hid_report -> ux_host_class_hid_report_callback_function = call_back -> ux_host_class_hid_report_callback_function;
hid_report -> ux_host_class_hid_report_callback_buffer = call_back -> ux_host_class_hid_report_callback_buffer;
@@ -128,9 +118,9 @@ UX_HOST_CLASS_HID_REPORT *hid_report;
/* Tell the user the report was OK and the call back was registered. */
return(UX_SUCCESS);
}
-
+
/* Jump to next report. */
- hid_report = hid_report -> ux_host_class_hid_report_next_report;
+ hid_report = hid_report -> ux_host_class_hid_report_next_report;
}
/* Unprotect thread reentry to this instance. */
@@ -180,12 +170,6 @@ UX_HOST_CLASS_HID_REPORT *hid_report;
/* */
/* Application */
/* */
-/* RELEASE HISTORY */
-/* */
-/* DATE NAME DESCRIPTION */
-/* */
-/* 10-31-2023 Chaoqiong Xiao Initial Version 6.3.0 */
-/* */
/**************************************************************************/
UINT _uxe_host_class_hid_report_callback_register(UX_HOST_CLASS_HID *hid, UX_HOST_CLASS_HID_REPORT_CALLBACK *call_back)
{
diff --git a/common/usbx_host_classes/src/ux_host_class_hid_report_compress.c b/common/usbx_host_classes/src/ux_host_class_hid_report_compress.c
index ee6efb0a..37a7e7ef 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
@@ -1,18 +1,19 @@
/***************************************************************************
- * Copyright (c) 2024 Microsoft Corporation
- *
+ * Copyright (c) 2024 Microsoft Corporation
+ * Copyright (c) 2026-present Eclipse ThreadX contributors
+ *
* This program and the accompanying materials are made available under the
* terms of the MIT License which is available at
* https://opensource.org/licenses/MIT.
- *
+ *
* SPDX-License-Identifier: MIT
**************************************************************************/
/**************************************************************************/
/**************************************************************************/
-/** */
-/** USBX Component */
+/** */
+/** USBX Component */
/** */
/** HID Class */
/** */
@@ -29,46 +30,38 @@
#include "ux_host_stack.h"
-/**************************************************************************/
-/* */
-/* FUNCTION RELEASE */
-/* */
-/* _ux_host_class_hid_report_compress PORTABLE C */
+/**************************************************************************/
+/* */
+/* FUNCTION RELEASE */
+/* */
+/* _ux_host_class_hid_report_compress PORTABLE C */
/* 6.1 */
/* AUTHOR */
/* */
/* Chaoqiong Xiao, Microsoft Corporation */
/* */
/* DESCRIPTION */
-/* */
-/* This function will compress a client report into a report buffer. */
-/* */
-/* INPUT */
-/* */
-/* hid Pointer to HID class */
-/* client_report Pointer to client report */
-/* report_buffer Pointer to report buffer */
-/* report_length Length of report */
-/* */
-/* OUTPUT */
-/* */
-/* Completion Status */
-/* */
-/* CALLS */
-/* */
-/* None */
-/* */
-/* CALLED BY */
-/* */
-/* HID Class */
-/* */
-/* RELEASE HISTORY */
-/* */
-/* DATE NAME DESCRIPTION */
-/* */
-/* 05-19-2020 Chaoqiong Xiao Initial Version 6.0 */
-/* 09-30-2020 Chaoqiong Xiao Modified comment(s), */
-/* resulting in version 6.1 */
+/* */
+/* This function will compress a client report into a report buffer. */
+/* */
+/* INPUT */
+/* */
+/* hid Pointer to HID class */
+/* client_report Pointer to client report */
+/* report_buffer Pointer to report buffer */
+/* report_length Length of report */
+/* */
+/* OUTPUT */
+/* */
+/* Completion Status */
+/* */
+/* CALLS */
+/* */
+/* None */
+/* */
+/* CALLED BY */
+/* */
+/* HID Class */
/* */
/**************************************************************************/
UINT _ux_host_class_hid_report_compress(UX_HOST_CLASS_HID *hid, UX_HOST_CLASS_HID_CLIENT_REPORT *client_report,
@@ -173,7 +166,7 @@ UCHAR is_valid_usage;
/* Isolate each bit from the report value. */
value = (UCHAR) client_value & 1;
-
+
/* Shift the isolated bit to its right space in the report byte. */
value = (UCHAR)(value << data_offset_bit);
@@ -189,7 +182,7 @@ UCHAR is_valid_usage;
/* If so increment the report address. */
report_buffer++;
-
+
/* Reset offset bit. */
data_offset_bit = 0;
}
@@ -197,7 +190,7 @@ UCHAR is_valid_usage;
/* Move to the next bit. */
client_value = client_value >> 1;
}
- }
+ }
/* Move to the next field. */
hid_field = hid_field -> ux_host_class_hid_field_next_field;
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 b0810c10..a736bf33 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
@@ -1,18 +1,19 @@
/***************************************************************************
- * Copyright (c) 2024 Microsoft Corporation
- *
+ * Copyright (c) 2024 Microsoft Corporation
+ * Copyright (c) 2026-present Eclipse ThreadX contributors
+ *
* This program and the accompanying materials are made available under the
* terms of the MIT License which is available at
* https://opensource.org/licenses/MIT.
- *
+ *
* SPDX-License-Identifier: MIT
**************************************************************************/
/**************************************************************************/
/**************************************************************************/
-/** */
-/** USBX Component */
+/** */
+/** USBX Component */
/** */
/** HID Class */
/** */
@@ -29,46 +30,38 @@
#include "ux_host_stack.h"
-/**************************************************************************/
-/* */
-/* FUNCTION RELEASE */
-/* */
-/* _ux_host_class_hid_report_decompress PORTABLE C */
+/**************************************************************************/
+/* */
+/* FUNCTION RELEASE */
+/* */
+/* _ux_host_class_hid_report_decompress PORTABLE C */
/* 6.1 */
/* AUTHOR */
/* */
/* Chaoqiong Xiao, Microsoft Corporation */
/* */
/* DESCRIPTION */
-/* */
-/* This function will decompress a raw report into a client buffer. */
-/* */
-/* INPUT */
-/* */
-/* hid Pointer to HID class */
-/* client_report Pointer to client report */
-/* report_buffer Pointer to report buffer */
-/* report_length Length of report */
-/* */
-/* OUTPUT */
-/* */
-/* Completion Status */
-/* */
-/* CALLS */
-/* */
-/* _ux_host_class_hid_field_decompress Decompress field */
-/* */
-/* CALLED BY */
-/* */
-/* HID Class */
-/* */
-/* RELEASE HISTORY */
-/* */
-/* DATE NAME DESCRIPTION */
-/* */
-/* 05-19-2020 Chaoqiong Xiao Initial Version 6.0 */
-/* 09-30-2020 Chaoqiong Xiao Modified comment(s), */
-/* resulting in version 6.1 */
+/* */
+/* This function will decompress a raw report into a client buffer. */
+/* */
+/* INPUT */
+/* */
+/* hid Pointer to HID class */
+/* client_report Pointer to client report */
+/* report_buffer Pointer to report buffer */
+/* report_length Length of report */
+/* */
+/* OUTPUT */
+/* */
+/* Completion Status */
+/* */
+/* CALLS */
+/* */
+/* _ux_host_class_hid_field_decompress Decompress field */
+/* */
+/* CALLED BY */
+/* */
+/* HID Class */
/* */
/**************************************************************************/
UINT _ux_host_class_hid_report_decompress(UX_HOST_CLASS_HID *hid, UX_HOST_CLASS_HID_CLIENT_REPORT *client_report,
@@ -77,18 +70,18 @@ UINT _ux_host_class_hid_report_decompress(UX_HOST_CLASS_HID *hid, UX_HOST_CLASS
UX_HOST_CLASS_HID_REPORT *hid_report;
UX_HOST_CLASS_HID_FIELD *hid_field;
-
+
UX_PARAMETER_NOT_USED(hid);
/* Get the report pointer from the caller. */
hid_report = client_report -> ux_host_class_hid_client_report;
- /* Check if this report has a ID field in the front. An ID field is required
+ /* Check if this report has a ID field in the front. An ID field is required
if report ID is non null. */
if (hid_report -> ux_host_class_hid_report_id != 0)
{
- /* We have an ID tag in the report. The ID tag is the first byte of the report. Skip the
+ /* We have an ID tag in the report. The ID tag is the first byte of the report. Skip the
ID tag and adjust the length. */
report_buffer++;
report_length--;
@@ -96,7 +89,7 @@ UX_HOST_CLASS_HID_FIELD *hid_field;
/* Get the first field associated with the report. */
hid_field = hid_report -> ux_host_class_hid_report_field;
-
+
/* We need to decompress each field defined in the report. */
while (hid_field != UX_NULL)
{
@@ -108,7 +101,7 @@ UX_HOST_CLASS_HID_FIELD *hid_field;
hid_field = hid_field -> ux_host_class_hid_field_next_field;
}
- /* Return successful completion. */
+ /* Return successful completion. */
return(UX_SUCCESS);
}
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 bb39cfe6..5f383fbc 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
@@ -1,10 +1,11 @@
/***************************************************************************
- * Copyright (c) 2024 Microsoft Corporation
- *
+ * Copyright (c) 2024 Microsoft Corporation
+ * Copyright (c) 2026-present Eclipse ThreadX contributors
+ *
* This program and the accompanying materials are made available under the
* terms of the MIT License which is available at
* https://opensource.org/licenses/MIT.
- *
+ *
* SPDX-License-Identifier: MIT
**************************************************************************/
@@ -66,14 +67,6 @@
/* */
/* HID Class */
/* */
-/* RELEASE HISTORY */
-/* */
-/* DATE NAME DESCRIPTION */
-/* */
-/* 05-19-2020 Chaoqiong Xiao Initial Version 6.0 */
-/* 09-30-2020 Chaoqiong Xiao Modified comment(s), */
-/* resulting in version 6.1 */
-/* */
/**************************************************************************/
UINT _ux_host_class_hid_report_descriptor_get(UX_HOST_CLASS_HID *hid, ULONG length)
{
@@ -118,7 +111,7 @@ UINT status;
{
/* Get one item from the report and analyze it. */
/* Make sure this descriptor has at least the minimum length. */
- analysis_failure = _ux_host_class_hid_report_item_analyse(descriptor, &item);
+ analysis_failure = _ux_host_class_hid_report_item_analyse(descriptor, length, &item);
if (analysis_failure)
{
/* Error trap. */
@@ -130,7 +123,7 @@ UINT status;
/* Return error status. */
status = (UX_DESCRIPTOR_CORRUPTED);
}
-
+
/* Point the descriptor right after the item identifier. */
descriptor += item.ux_host_class_hid_item_report_format;
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 970696fe..eb040d4e 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
@@ -1,18 +1,19 @@
/***************************************************************************
- * Copyright (c) 2024 Microsoft Corporation
- *
+ * Copyright (c) 2024 Microsoft Corporation
+ * Copyright (c) 2026-present Eclipse ThreadX contributors
+ *
* This program and the accompanying materials are made available under the
* terms of the MIT License which is available at
* https://opensource.org/licenses/MIT.
- *
+ *
* SPDX-License-Identifier: MIT
**************************************************************************/
/**************************************************************************/
/**************************************************************************/
-/** */
-/** USBX Component */
+/** */
+/** USBX Component */
/** */
/** HID Class */
/** */
@@ -29,59 +30,45 @@
#include "ux_host_stack.h"
-/**************************************************************************/
-/* */
-/* FUNCTION RELEASE */
-/* */
-/* _ux_host_class_hid_report_get PORTABLE C */
+/**************************************************************************/
+/* */
+/* FUNCTION RELEASE */
+/* */
+/* _ux_host_class_hid_report_get PORTABLE C */
/* 6.1.10 */
/* AUTHOR */
/* */
/* Chaoqiong Xiao, Microsoft Corporation */
/* */
/* DESCRIPTION */
-/* */
+/* */
/* This function gets a report (input/output/feature) from the device. */
-/* The report can be either decompressed by the stack or raw. */
-/* */
-/* INPUT */
-/* */
-/* hid Pointer to HID class */
-/* client_report Pointer to client report */
-/* */
-/* OUTPUT */
-/* */
-/* Completion Status */
-/* */
-/* CALLS */
-/* */
-/* _ux_host_class_hid_report_decompress Decompress HID report */
-/* _ux_host_stack_class_instance_verify Verify the instance is valid */
-/* _ux_host_stack_transfer_request Process transfer request */
-/* _ux_utility_memory_allocate Allocate memory block */
-/* _ux_utility_memory_copy Copy memory block */
-/* _ux_utility_memory_free Release memory block */
-/* _ux_host_semaphore_get Get protection semaphore */
-/* _ux_host_semaphore_put Release protection semaphore */
-/* */
-/* CALLED BY */
-/* */
-/* Application */
-/* HID Class */
-/* */
-/* RELEASE HISTORY */
-/* */
-/* DATE NAME DESCRIPTION */
-/* */
-/* 05-19-2020 Chaoqiong Xiao Initial Version 6.0 */
-/* 09-30-2020 Chaoqiong Xiao Modified comment(s), */
-/* verified memset and memcpy */
-/* cases, accepted both INPUT */
-/* and FEATURE reports, */
-/* resulting in version 6.1 */
-/* 01-31-2022 Chaoqiong Xiao Modified comment(s), */
-/* added standalone support, */
-/* resulting in version 6.1.10 */
+/* The report can be either decompressed by the stack or raw. */
+/* */
+/* INPUT */
+/* */
+/* hid Pointer to HID class */
+/* client_report Pointer to client report */
+/* */
+/* OUTPUT */
+/* */
+/* Completion Status */
+/* */
+/* CALLS */
+/* */
+/* _ux_host_class_hid_report_decompress Decompress HID report */
+/* _ux_host_stack_class_instance_verify Verify the instance is valid */
+/* _ux_host_stack_transfer_request Process transfer request */
+/* _ux_utility_memory_allocate Allocate memory block */
+/* _ux_utility_memory_copy Copy memory block */
+/* _ux_utility_memory_free Release memory block */
+/* _ux_host_semaphore_get Get protection semaphore */
+/* _ux_host_semaphore_put Release protection semaphore */
+/* */
+/* CALLED BY */
+/* */
+/* Application */
+/* HID Class */
/* */
/**************************************************************************/
UINT _ux_host_class_hid_report_get(UX_HOST_CLASS_HID *hid, UX_HOST_CLASS_HID_CLIENT_REPORT *client_report)
@@ -100,7 +87,7 @@ UINT status;
/* Ensure the instance is valid. */
if (_ux_host_stack_class_instance_verify(_ux_system_host_class_hid_name, (VOID *) hid) != UX_SUCCESS)
- {
+ {
/* Error trap. */
_ux_system_error_handler(UX_SYSTEM_LEVEL_THREAD, UX_SYSTEM_CONTEXT_CLASS, UX_HOST_CLASS_INSTANCE_UNKNOWN);
@@ -124,7 +111,7 @@ UINT status;
/* Unprotect thread reentry to this instance. */
_ux_host_class_hid_unlock(hid);
-
+
/* If trace is enabled, insert this event into the trace buffer. */
UX_TRACE_IN_LINE_INSERT(UX_TRACE_ERROR, UX_HOST_CLASS_HID_REPORT_ERROR, hid, 0, 0, UX_TRACE_ERRORS, 0, 0)
@@ -138,7 +125,7 @@ UINT status;
/* Unprotect thread reentry to this instance. */
_ux_host_class_hid_unlock(hid);
-
+
/* Error trap. */
_ux_system_error_handler(UX_SYSTEM_LEVEL_THREAD, UX_SYSTEM_CONTEXT_CLASS, UX_HOST_CLASS_HID_REPORT_ERROR);
@@ -148,7 +135,7 @@ UINT status;
/* Return error code. */
return(UX_HOST_CLASS_HID_REPORT_ERROR);
}
-
+
/* Get some memory for reading the report. */
report_buffer = _ux_utility_memory_allocate(UX_SAFE_ALIGN, UX_CACHE_SAFE_MEMORY, hid_report -> ux_host_class_hid_report_byte_length);
if (report_buffer == UX_NULL)
@@ -158,14 +145,14 @@ UINT status;
_ux_host_class_hid_unlock(hid);
/* Return error code. */
- return(UX_MEMORY_INSUFFICIENT);
- }
+ return(UX_MEMORY_INSUFFICIENT);
+ }
/* We need to get the default control endpoint transfer request pointer. */
control_endpoint = &hid -> ux_host_class_hid_device -> ux_device_control_endpoint;
transfer_request = &control_endpoint -> ux_endpoint_transfer_request;
- /* Protect the control endpoint semaphore here. It will be unprotected in the
+ /* Protect the control endpoint semaphore here. It will be unprotected in the
transfer request function. */
#if defined(UX_HOST_STANDALONE)
UX_DISABLE
@@ -221,22 +208,22 @@ UINT status;
/* Ensure the user has given us enough memory for the raw buffer. */
if (client_report -> ux_host_class_hid_client_report_length >= transfer_request -> ux_transfer_request_actual_length)
{
-
+
/* We have enough memory to store the raw buffer. */
_ux_utility_memory_copy(client_report -> ux_host_class_hid_client_report_buffer, report_buffer, transfer_request -> ux_transfer_request_actual_length); /* Use case of memcpy is verified. */
-
+
/* Set status to success. */
status = UX_SUCCESS;
}
else
{
-
+
/* Error trap. */
_ux_system_error_handler(UX_SYSTEM_LEVEL_THREAD, UX_SYSTEM_CONTEXT_CLASS, UX_BUFFER_OVERFLOW);
/* If trace is enabled, insert this event into the trace buffer. */
UX_TRACE_IN_LINE_INSERT(UX_TRACE_ERROR, UX_BUFFER_OVERFLOW, transfer_request, 0, 0, UX_TRACE_ERRORS, 0, 0)
-
+
/* Set overflow status. */
status = UX_BUFFER_OVERFLOW;
}
@@ -250,7 +237,7 @@ UINT status;
}
else
{
-
+
/* Error trap. */
_ux_system_error_handler(UX_SYSTEM_LEVEL_THREAD, UX_SYSTEM_CONTEXT_CLASS, UX_HOST_CLASS_HID_REPORT_ERROR);
@@ -263,7 +250,7 @@ UINT status;
/* Free all resources. */
_ux_utility_memory_free(report_buffer);
-
+
/* Unprotect thread reentry to this instance. */
_ux_host_class_hid_unlock(hid);
@@ -302,12 +289,6 @@ UINT status;
/* */
/* Application */
/* */
-/* RELEASE HISTORY */
-/* */
-/* DATE NAME DESCRIPTION */
-/* */
-/* 10-31-2023 Chaoqiong Xiao Initial Version 6.3.0 */
-/* */
/**************************************************************************/
UINT _uxe_host_class_hid_report_get(UX_HOST_CLASS_HID *hid, UX_HOST_CLASS_HID_CLIENT_REPORT *client_report)
{
diff --git a/common/usbx_host_classes/src/ux_host_class_hid_report_id_get.c b/common/usbx_host_classes/src/ux_host_class_hid_report_id_get.c
index 03dafe8d..bbc73553 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
@@ -1,18 +1,19 @@
/***************************************************************************
- * Copyright (c) 2024 Microsoft Corporation
- *
+ * Copyright (c) 2024 Microsoft Corporation
+ * Copyright (c) 2026-present Eclipse ThreadX contributors
+ *
* This program and the accompanying materials are made available under the
* terms of the MIT License which is available at
* https://opensource.org/licenses/MIT.
- *
+ *
* SPDX-License-Identifier: MIT
**************************************************************************/
/**************************************************************************/
/**************************************************************************/
-/** */
-/** USBX Component */
+/** */
+/** USBX Component */
/** */
/** HID Class */
/** */
@@ -29,54 +30,43 @@
#include "ux_host_stack.h"
-/**************************************************************************/
-/* */
-/* FUNCTION RELEASE */
-/* */
-/* _ux_host_class_hid_report_id_get PORTABLE C */
+/**************************************************************************/
+/* */
+/* FUNCTION RELEASE */
+/* */
+/* _ux_host_class_hid_report_id_get PORTABLE C */
/* 6.1.10 */
/* AUTHOR */
/* */
/* Chaoqiong Xiao, Microsoft Corporation */
/* */
/* DESCRIPTION */
-/* */
+/* */
/* This function retrieves the report after */
/* report_id -> ux_host_class_hid_report_get_id and stores it in the */
-/* same pointer. If report_id -> ux_host_class_hid_report_get_id is */
+/* same pointer. If report_id -> ux_host_class_hid_report_get_id is */
/* null, retrieves the first report of the type specified by */
-/* report_id -> ux_host_class_hid_report_get_type. */
-/* */
-/* INPUT */
-/* */
-/* hid Pointer to HID class */
-/* report_id Report id structure */
-/* */
-/* OUTPUT */
-/* */
-/* Completion Status */
-/* */
-/* CALLS */
-/* */
-/* _ux_host_semaphore_get Get protection semaphore */
-/* _ux_host_semaphore_put Release protection semaphore */
-/* _ux_host_stack_class_instance_verify Verify class instance is valid*/
-/* */
-/* CALLED BY */
-/* */
-/* Application */
-/* HID Class */
-/* */
-/* RELEASE HISTORY */
-/* */
-/* DATE NAME DESCRIPTION */
-/* */
-/* 05-19-2020 Chaoqiong Xiao Initial Version 6.0 */
-/* 09-30-2020 Chaoqiong Xiao Modified comment(s), */
-/* resulting in version 6.1 */
-/* 01-31-2022 Chaoqiong Xiao Modified comment(s), */
-/* added standalone support, */
-/* resulting in version 6.1.10 */
+/* report_id -> ux_host_class_hid_report_get_type. */
+/* */
+/* INPUT */
+/* */
+/* hid Pointer to HID class */
+/* report_id Report id structure */
+/* */
+/* OUTPUT */
+/* */
+/* Completion Status */
+/* */
+/* CALLS */
+/* */
+/* _ux_host_semaphore_get Get protection semaphore */
+/* _ux_host_semaphore_put Release protection semaphore */
+/* _ux_host_stack_class_instance_verify Verify class instance is valid*/
+/* */
+/* CALLED BY */
+/* */
+/* Application */
+/* HID Class */
/* */
/**************************************************************************/
UINT _ux_host_class_hid_report_id_get(UX_HOST_CLASS_HID *hid, UX_HOST_CLASS_HID_REPORT_GET_ID *report_id)
@@ -86,11 +76,11 @@ UX_INTERRUPT_SAVE_AREA
#endif
UINT status;
UX_HOST_CLASS_HID_REPORT *next_hid_report;
-
+
/* Ensure the instance is valid. */
if (_ux_host_stack_class_instance_verify(_ux_system_host_class_hid_name, (VOID *) hid) != UX_SUCCESS)
- {
+ {
/* Error trap. */
_ux_system_error_handler(UX_SYSTEM_LEVEL_THREAD, UX_SYSTEM_CONTEXT_CLASS, UX_HOST_CLASS_INSTANCE_UNKNOWN);
@@ -129,7 +119,7 @@ UX_HOST_CLASS_HID_REPORT *next_hid_report;
/* Search for the feature report ID. */
next_hid_report = hid -> ux_host_class_hid_parser.ux_host_class_hid_parser_feature_report;
break;
-
+
default :
/* Error trap. */
@@ -156,7 +146,7 @@ UX_HOST_CLASS_HID_REPORT *next_hid_report;
/* We want the first report, memorize the ID. */
report_id -> ux_host_class_hid_report_get_id = next_hid_report -> ux_host_class_hid_report_id;
-
+
/* And remember where we left. */
report_id -> ux_host_class_hid_report_get_report = next_hid_report;
@@ -172,7 +162,7 @@ UX_HOST_CLASS_HID_REPORT *next_hid_report;
/* No more reports. */
status = UX_HOST_CLASS_HID_REPORT_ERROR;
}
-
+
/* Unprotect thread reentry to this instance. */
_ux_host_class_hid_unlock(hid);
@@ -211,12 +201,6 @@ UX_HOST_CLASS_HID_REPORT *next_hid_report;
/* */
/* Application */
/* */
-/* RELEASE HISTORY */
-/* */
-/* DATE NAME DESCRIPTION */
-/* */
-/* 10-31-2023 Chaoqiong Xiao Initial Version 6.3.0 */
-/* */
/**************************************************************************/
UINT _uxe_host_class_hid_report_id_get(UX_HOST_CLASS_HID *hid, UX_HOST_CLASS_HID_REPORT_GET_ID *report_id)
{
diff --git a/common/usbx_host_classes/src/ux_host_class_hid_report_item_analyse.c b/common/usbx_host_classes/src/ux_host_class_hid_report_item_analyse.c
index 7ff20bf7..8d60189e 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
@@ -1,18 +1,19 @@
/***************************************************************************
- * Copyright (c) 2024 Microsoft Corporation
- *
+ * Copyright (c) 2024 Microsoft Corporation
+ * Copyright (c) 2026-present Eclipse ThreadX contributors
+ *
* This program and the accompanying materials are made available under the
* terms of the MIT License which is available at
* https://opensource.org/licenses/MIT.
- *
+ *
* SPDX-License-Identifier: MIT
**************************************************************************/
/**************************************************************************/
/**************************************************************************/
-/** */
-/** USBX Component */
+/** */
+/** USBX Component */
/** */
/** HID Class */
/** */
@@ -29,57 +30,56 @@
#include "ux_host_stack.h"
-/**************************************************************************/
-/* */
-/* FUNCTION RELEASE */
-/* */
-/* _ux_host_class_hid_report_item_analyse PORTABLE C */
+/**************************************************************************/
+/* */
+/* FUNCTION RELEASE */
+/* */
+/* _ux_host_class_hid_report_item_analyse PORTABLE C */
/* 6.1 */
/* AUTHOR */
/* */
/* Chaoqiong Xiao, Microsoft Corporation */
/* */
/* DESCRIPTION */
-/* */
-/* This function gets the report descriptor and analyzes it. */
-/* */
-/* INPUT */
-/* */
-/* descriptor Pointer to descriptor */
-/* item Pointer to item */
-/* */
-/* OUTPUT */
-/* */
-/* Completion Status */
-/* */
-/* CALLS */
-/* */
-/* None */
-/* */
-/* CALLED BY */
-/* */
-/* HID Class */
-/* */
-/* RELEASE HISTORY */
-/* */
-/* DATE NAME DESCRIPTION */
-/* */
-/* 05-19-2020 Chaoqiong Xiao Initial Version 6.0 */
-/* 09-30-2020 Chaoqiong Xiao Modified comment(s), */
-/* resulting in version 6.1 */
+/* */
+/* This function gets the report descriptor and analyzes it. */
+/* */
+/* INPUT */
+/* */
+/* descriptor Pointer to descriptor */
+/* length Length of descriptor */
+/* item Pointer to item */
+/* */
+/* OUTPUT */
+/* */
+/* Completion Status */
+/* */
+/* CALLS */
+/* */
+/* None */
+/* */
+/* CALLED BY */
+/* */
+/* HID Class */
/* */
/**************************************************************************/
-UINT _ux_host_class_hid_report_item_analyse(UCHAR *descriptor, UX_HOST_CLASS_HID_ITEM *item)
+UINT _ux_host_class_hid_report_item_analyse(UCHAR *descriptor, ULONG length, UX_HOST_CLASS_HID_ITEM *item)
{
UCHAR item_byte;
-UINT result = UX_SUCCESS;
+UINT result = UX_SUCCESS;
+
+ /* Make sure descriptor has minimal length.*/
+ if (length == 0)
+ {
+ return(UX_DESCRIPTOR_CORRUPTED);
+ }
/* Get the first byte from the descriptor. */
item_byte = *descriptor;
-
+
/* We need to determine if this is a short or long item.
- For long items, the tag is always 1111. */
+ For long items, the tag is always 1111. */
if ((item_byte & UX_HOST_CLASS_HID_ITEM_TAG_MASK) == UX_HOST_CLASS_HID_ITEM_TAG_LONG)
{
@@ -90,7 +90,7 @@ UINT result = UX_SUCCESS;
item -> ux_host_class_hid_item_report_type = (item_byte >> 2) & 3;
/* Make sure descriptor has minimal length.*/
- if (sizeof(descriptor) >= 3)
+ if (length >= 3)
{
/* Get its length (byte 1). */
item -> ux_host_class_hid_item_report_length = (USHORT) *(descriptor + 1);
@@ -98,7 +98,7 @@ UINT result = UX_SUCCESS;
/* Then the tag (byte 2). */
item -> ux_host_class_hid_item_report_tag = *(descriptor + 2);
}
- else
+ else
{
result = UX_DESCRIPTOR_CORRUPTED;
}
@@ -108,7 +108,7 @@ UINT result = UX_SUCCESS;
/* We have a short item. Mark its format */
item -> ux_host_class_hid_item_report_format = UX_HOST_CLASS_HID_ITEM_TAG_SHORT;
-
+
/* Get the length of the item. */
switch (item_byte & UX_HOST_CLASS_HID_ITEM_LENGTH_MASK)
{
@@ -127,11 +127,14 @@ UINT result = UX_SUCCESS;
/* Set the type. */
item -> ux_host_class_hid_item_report_type = (item_byte >> 2) & 3;
- /* Set the tag. */
- item -> ux_host_class_hid_item_report_tag = item_byte >> 4;
+ /* Then the tag. */
+ item -> ux_host_class_hid_item_report_tag = (item_byte >> 4) & 0xf;
+
+ /* Mark its format. For short items, this is always 1. */
+ item -> ux_host_class_hid_item_report_format = 1;
+
}
- /* Return successful completion. */
+ /* Return result. */
return(result);
}
-
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 ee955026..c2ecbad1 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
@@ -1,18 +1,19 @@
/***************************************************************************
- * Copyright (c) 2024 Microsoft Corporation
- *
+ * Copyright (c) 2024 Microsoft Corporation
+ * Copyright (c) 2026-present Eclipse ThreadX contributors
+ *
* This program and the accompanying materials are made available under the
* terms of the MIT License which is available at
* https://opensource.org/licenses/MIT.
- *
+ *
* SPDX-License-Identifier: MIT
**************************************************************************/
/**************************************************************************/
/**************************************************************************/
-/** */
-/** USBX Component */
+/** */
+/** USBX Component */
/** */
/** HID Class */
/** */
@@ -113,60 +114,45 @@ UCHAR *current_report_buffer;
return(UX_SUCCESS);
}
-/**************************************************************************/
-/* */
-/* FUNCTION RELEASE */
-/* */
-/* _ux_host_class_hid_report_set PORTABLE C */
+/**************************************************************************/
+/* */
+/* FUNCTION RELEASE */
+/* */
+/* _ux_host_class_hid_report_set PORTABLE C */
/* 6.1.10 */
/* AUTHOR */
/* */
/* Chaoqiong Xiao, Microsoft Corporation */
/* */
/* DESCRIPTION */
-/* */
+/* */
/* This function sets a report (input/output/feature) to the device. */
-/* The report can be either decompressed by the stack or raw. */
-/* */
-/* INPUT */
-/* */
-/* hid Pointer to HID class */
-/* client_report Pointer to client report */
-/* */
-/* OUTPUT */
-/* */
-/* Completion Status */
-/* */
-/* CALLS */
-/* */
-/* _ux_host_class_hid_report_compress Compress HID report */
-/* _ux_host_stack_class_instance_verify Verify the instance is valid */
-/* _ux_host_stack_transfer_request Process transfer request */
-/* _ux_utility_memory_allocate Allocate memory block */
-/* _ux_utility_memory_copy Copy memory block */
-/* _ux_utility_memory_free Release memory block */
-/* _ux_host_semaphore_get Get protection semaphore */
-/* _ux_host_semaphore_put Release protection semaphore */
-/* */
-/* CALLED BY */
-/* */
-/* Application */
-/* HID Class */
-/* */
-/* RELEASE HISTORY */
-/* */
-/* DATE NAME DESCRIPTION */
-/* */
-/* 05-19-2020 Chaoqiong Xiao Initial Version 6.0 */
-/* 09-30-2020 Chaoqiong Xiao Modified comment(s), */
-/* verified memset and memcpy */
-/* cases, */
-/* resulting in version 6.1 */
-/* 01-31-2022 Xiuwen Cai, CQ Xiao Modified comment(s), */
-/* added interrupt OUT support,*/
-/* added standalone support, */
-/* refined code sequence, */
-/* resulting in version 6.1.10 */
+/* The report can be either decompressed by the stack or raw. */
+/* */
+/* INPUT */
+/* */
+/* hid Pointer to HID class */
+/* client_report Pointer to client report */
+/* */
+/* OUTPUT */
+/* */
+/* Completion Status */
+/* */
+/* CALLS */
+/* */
+/* _ux_host_class_hid_report_compress Compress HID report */
+/* _ux_host_stack_class_instance_verify Verify the instance is valid */
+/* _ux_host_stack_transfer_request Process transfer request */
+/* _ux_utility_memory_allocate Allocate memory block */
+/* _ux_utility_memory_copy Copy memory block */
+/* _ux_utility_memory_free Release memory block */
+/* _ux_host_semaphore_get Get protection semaphore */
+/* _ux_host_semaphore_put Release protection semaphore */
+/* */
+/* CALLED BY */
+/* */
+/* Application */
+/* HID Class */
/* */
/**************************************************************************/
UINT _ux_host_class_hid_report_set(UX_HOST_CLASS_HID *hid, UX_HOST_CLASS_HID_CLIENT_REPORT *client_report)
@@ -191,7 +177,7 @@ UINT status;
/* Ensure the instance is valid. */
if (_ux_host_stack_class_instance_verify(_ux_system_host_class_hid_name, (VOID *) hid) != UX_SUCCESS)
- {
+ {
/* Error trap. */
_ux_system_error_handler(UX_SYSTEM_LEVEL_THREAD, UX_SYSTEM_CONTEXT_CLASS, UX_HOST_CLASS_INSTANCE_UNKNOWN);
@@ -222,15 +208,15 @@ UINT status;
/* We need to get the default control endpoint transfer request pointer. */
control_endpoint = &hid -> ux_host_class_hid_device -> ux_device_control_endpoint;
transfer_request = &control_endpoint -> ux_endpoint_transfer_request;
-
- /* Protect the control endpoint semaphore here. It will be unprotected in the
+
+ /* Protect the control endpoint semaphore here. It will be unprotected in the
transfer request function. */
status = _ux_host_semaphore_get(&hid -> ux_host_class_hid_device -> ux_device_protection_semaphore, UX_WAIT_FOREVER);
-
+
/* Check for status. */
if (status != UX_SUCCESS)
{
-
+
/* Something went wrong. */
/* Unprotect thread reentry to this instance. */
_ux_host_class_hid_unlock(hid);
@@ -270,7 +256,7 @@ UINT status;
/* Send request to HCD layer. */
status = _ux_host_stack_transfer_request(transfer_request);
#if defined(UX_HOST_CLASS_HID_INTERRUPT_OUT_SUPPORT)
-
+
/* Check if interrupt OUT endpoint is used. */
if ((hid -> ux_host_class_hid_interrupt_out_endpoint != UX_NULL) && (status == UX_SUCCESS))
{
@@ -302,13 +288,13 @@ UINT status;
status = UX_HOST_CLASS_HID_REPORT_ERROR;
}
-
+
/* Free all resources. */
_ux_utility_memory_free(report_buffer);
/* Unprotect thread reentry to this instance. */
_ux_host_class_hid_unlock(hid);
-
+
/* Return the function status */
return(status);
#endif
@@ -345,12 +331,6 @@ UINT status;
/* */
/* Application */
/* */
-/* RELEASE HISTORY */
-/* */
-/* DATE NAME DESCRIPTION */
-/* */
-/* 10-31-2023 Chaoqiong Xiao Initial Version 6.3.0 */
-/* */
/**************************************************************************/
UINT _uxe_host_class_hid_report_set(UX_HOST_CLASS_HID *hid, UX_HOST_CLASS_HID_CLIENT_REPORT *client_report)
{
diff --git a/common/usbx_host_classes/src/ux_host_class_hid_report_set_run.c b/common/usbx_host_classes/src/ux_host_class_hid_report_set_run.c
index 874a6ebc..5a2b0240 100644
--- a/common/usbx_host_classes/src/ux_host_class_hid_report_set_run.c
+++ b/common/usbx_host_classes/src/ux_host_class_hid_report_set_run.c
@@ -1,10 +1,11 @@
/***************************************************************************
- * Copyright (c) 2024 Microsoft Corporation
- *
+ * Copyright (c) 2024 Microsoft Corporation
+ * Copyright (c) 2026-present Eclipse ThreadX contributors
+ *
* This program and the accompanying materials are made available under the
* terms of the MIT License which is available at
* https://opensource.org/licenses/MIT.
- *
+ *
* SPDX-License-Identifier: MIT
**************************************************************************/
@@ -76,15 +77,6 @@ extern UINT ux_host_class_hid_report_set_buffer_allocate(
/* Application */
/* HID Class */
/* */
-/* RELEASE HISTORY */
-/* */
-/* DATE NAME DESCRIPTION */
-/* */
-/* 01-31-2022 Chaoqiong Xiao Initial Version 6.1.10 */
-/* 07-29-2022 Chaoqiong Xiao Modified comment(s), */
-/* added interrupt OUT support,*/
-/* resulting in version 6.1.12 */
-/* */
/**************************************************************************/
UINT _ux_host_class_hid_report_set_run(UX_HOST_CLASS_HID *hid, UX_HOST_CLASS_HID_CLIENT_REPORT *client_report)
{
@@ -277,12 +269,6 @@ UINT status;
/* */
/* Application */
/* */
-/* RELEASE HISTORY */
-/* */
-/* DATE NAME DESCRIPTION */
-/* */
-/* 10-31-2023 Chaoqiong Xiao Initial Version 6.3.0 */
-/* */
/**************************************************************************/
UINT _uxe_host_class_hid_report_set_run(UX_HOST_CLASS_HID *hid, UX_HOST_CLASS_HID_CLIENT_REPORT *client_report)
{
diff --git a/common/usbx_host_classes/src/ux_host_class_hid_resources_free.c b/common/usbx_host_classes/src/ux_host_class_hid_resources_free.c
index ccbac3de..0fe8efca 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
@@ -1,18 +1,19 @@
/***************************************************************************
- * Copyright (c) 2024 Microsoft Corporation
- *
+ * Copyright (c) 2024 Microsoft Corporation
+ * Copyright (c) 2026-present Eclipse ThreadX contributors
+ *
* This program and the accompanying materials are made available under the
* terms of the MIT License which is available at
* https://opensource.org/licenses/MIT.
- *
+ *
* SPDX-License-Identifier: MIT
**************************************************************************/
/**************************************************************************/
/**************************************************************************/
-/** */
-/** USBX Component */
+/** */
+/** USBX Component */
/** */
/** HID Class */
/** */
@@ -29,43 +30,35 @@
#include "ux_host_stack.h"
-/**************************************************************************/
-/* */
-/* FUNCTION RELEASE */
-/* */
-/* _ux_host_class_hid_resources_free PORTABLE C */
+/**************************************************************************/
+/* */
+/* FUNCTION RELEASE */
+/* */
+/* _ux_host_class_hid_resources_free PORTABLE C */
/* 6.1 */
/* AUTHOR */
/* */
/* Chaoqiong Xiao, Microsoft Corporation */
/* */
/* DESCRIPTION */
-/* */
-/* This function frees the resources allocated to a HID device. */
-/* */
-/* INPUT */
-/* */
-/* hid Pointer to HID class */
-/* */
-/* OUTPUT */
-/* */
-/* Completion Status */
-/* */
-/* CALLS */
-/* */
-/* None */
-/* */
-/* CALLED BY */
-/* */
-/* HID Class */
-/* */
-/* RELEASE HISTORY */
-/* */
-/* DATE NAME DESCRIPTION */
-/* */
-/* 05-19-2020 Chaoqiong Xiao Initial Version 6.0 */
-/* 09-30-2020 Chaoqiong Xiao Modified comment(s), */
-/* resulting in version 6.1 */
+/* */
+/* This function frees the resources allocated to a HID device. */
+/* */
+/* INPUT */
+/* */
+/* hid Pointer to HID class */
+/* */
+/* OUTPUT */
+/* */
+/* Completion Status */
+/* */
+/* CALLS */
+/* */
+/* None */
+/* */
+/* CALLED BY */
+/* */
+/* HID Class */
/* */
/**************************************************************************/
UINT _ux_host_class_hid_resources_free(UX_HOST_CLASS_HID *hid)
diff --git a/common/usbx_host_classes/src/ux_host_class_hid_tasks_run.c b/common/usbx_host_classes/src/ux_host_class_hid_tasks_run.c
index a112831b..7edbcc7e 100644
--- a/common/usbx_host_classes/src/ux_host_class_hid_tasks_run.c
+++ b/common/usbx_host_classes/src/ux_host_class_hid_tasks_run.c
@@ -1,10 +1,11 @@
/***************************************************************************
- * Copyright (c) 2024 Microsoft Corporation
- *
+ * Copyright (c) 2024 Microsoft Corporation
+ * Copyright (c) 2026-present Eclipse ThreadX contributors
+ *
* This program and the accompanying materials are made available under the
* terms of the MIT License which is available at
* https://opensource.org/licenses/MIT.
- *
+ *
* SPDX-License-Identifier: MIT
**************************************************************************/
@@ -66,12 +67,6 @@ static inline VOID _ux_host_class_hid_inst_tasks_run(UX_HOST_CLASS_HID *hid);
/* */
/* USBX Host Stack */
/* */
-/* RELEASE HISTORY */
-/* */
-/* DATE NAME DESCRIPTION */
-/* */
-/* 01-31-2022 Chaoqiong Xiao Initial Version 6.1.10 */
-/* */
/**************************************************************************/
UINT _ux_host_class_hid_tasks_run(UX_HOST_CLASS *hid_class)
{
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 dbadc1c8..da27a74a 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
@@ -1,18 +1,19 @@
/***************************************************************************
- * Copyright (c) 2024 Microsoft Corporation
- *
+ * Copyright (c) 2024 Microsoft Corporation
+ * Copyright (c) 2026-present Eclipse ThreadX contributors
+ *
* This program and the accompanying materials are made available under the
* terms of the MIT License which is available at
* https://opensource.org/licenses/MIT.
- *
+ *
* SPDX-License-Identifier: MIT
**************************************************************************/
/**************************************************************************/
/**************************************************************************/
-/** */
-/** USBX Component */
+/** */
+/** USBX Component */
/** */
/** HID Class */
/** */
@@ -29,53 +30,42 @@
#include "ux_host_stack.h"
-/**************************************************************************/
-/* */
-/* FUNCTION RELEASE */
-/* */
-/* _ux_host_class_hid_transfer_request_completed PORTABLE C */
+/**************************************************************************/
+/* */
+/* FUNCTION RELEASE */
+/* */
+/* _ux_host_class_hid_transfer_request_completed PORTABLE C */
/* 6.2.1 */
/* AUTHOR */
/* */
/* Chaoqiong Xiao, Microsoft Corporation */
/* */
/* DESCRIPTION */
-/* */
-/* This function is called by the completion thread when a transfer */
-/* request has been completed either because the transfer is */
-/* successful or there was an error. */
-/* */
-/* INPUT */
-/* */
-/* transfer_request Pointer to transfer request */
-/* */
-/* OUTPUT */
-/* */
-/* None */
-/* */
-/* CALLS */
-/* */
-/* (ux_host_class_hid_report_callback_function) */
-/* Callback function for report */
-/* _ux_host_class_hid_report_decompress Decompress HID report */
-/* _ux_host_stack_transfer_request Process transfer request */
-/* _ux_utility_memory_allocate Allocate memory block */
-/* _ux_utility_memory_free Release memory block */
-/* */
-/* CALLED BY */
-/* */
-/* HID Class */
-/* */
-/* RELEASE HISTORY */
-/* */
-/* DATE NAME DESCRIPTION */
-/* */
-/* 05-19-2020 Chaoqiong Xiao Initial Version 6.0 */
-/* 09-30-2020 Chaoqiong Xiao Modified comment(s), */
-/* resulting in version 6.1 */
-/* 03-08-2023 Chaoqiong Xiao Modified comment(s), */
-/* supported report IDs, */
-/* resulting in version 6.2.1 */
+/* */
+/* This function is called by the completion thread when a transfer */
+/* request has been completed either because the transfer is */
+/* successful or there was an error. */
+/* */
+/* INPUT */
+/* */
+/* transfer_request Pointer to transfer request */
+/* */
+/* OUTPUT */
+/* */
+/* None */
+/* */
+/* CALLS */
+/* */
+/* (ux_host_class_hid_report_callback_function) */
+/* Callback function for report */
+/* _ux_host_class_hid_report_decompress Decompress HID report */
+/* _ux_host_stack_transfer_request Process transfer request */
+/* _ux_utility_memory_allocate Allocate memory block */
+/* _ux_utility_memory_free Release memory block */
+/* */
+/* CALLED BY */
+/* */
+/* HID Class */
/* */
/**************************************************************************/
VOID _ux_host_class_hid_transfer_request_completed(UX_TRANSFER *transfer_request)
@@ -97,28 +87,28 @@ ULONG field_report_count;
/* Get the class instance for this transfer request. */
hid = (UX_HOST_CLASS_HID *) transfer_request -> ux_transfer_request_class_instance;
-
+
/* Check the state of the transfer. If there is an error, we do not proceed with this report. */
if (transfer_request -> ux_transfer_request_completion_code != UX_SUCCESS)
{
/* We have an error. We do not rehook another transfer if the device instance is shutting down or
if the transfer was aborted by the class. */
- if ((hid -> ux_host_class_hid_state == UX_HOST_CLASS_INSTANCE_SHUTDOWN) ||
+ if ((hid -> ux_host_class_hid_state == UX_HOST_CLASS_INSTANCE_SHUTDOWN) ||
(transfer_request -> ux_transfer_request_completion_code == UX_TRANSFER_STATUS_ABORT))
/* We do not proceed. */
return;
else
- {
+ {
/* Reactivate the HID interrupt pipe. */
_ux_host_stack_transfer_request(transfer_request);
-
+
/* We do not proceed. */
- return;
- }
+ return;
+ }
}
/* Get the client instance attached to the HID. */
@@ -178,10 +168,10 @@ ULONG field_report_count;
/* Build the callback structure status. */
callback.ux_host_class_hid_report_callback_status = status;
-
+
/* Set the flags to indicate the type of report. */
callback.ux_host_class_hid_report_callback_flags = hid_report -> ux_host_class_hid_report_callback_flags;
-
+
/* Call the report owner. */
hid_report -> ux_host_class_hid_report_callback_function(&callback);
}
@@ -260,16 +250,16 @@ ULONG field_report_count;
/* Add the length actually valid in the caller's buffer. */
callback.ux_host_class_hid_report_callback_actual_length = client_report.ux_host_class_hid_client_report_actual_length;
-
+
/* Add the caller's buffer address. */
callback.ux_host_class_hid_report_callback_buffer = client_report.ux_host_class_hid_client_report_buffer;
-
+
/* Build the callback structure status. */
callback.ux_host_class_hid_report_callback_status = status;
-
+
/* Set the flags to indicate the type of report. */
callback.ux_host_class_hid_report_callback_flags = hid_report -> ux_host_class_hid_report_callback_flags;
-
+
/* Call the report owner. */
hid_report -> ux_host_class_hid_report_callback_function(&callback);
}
@@ -278,7 +268,7 @@ ULONG field_report_count;
_ux_utility_memory_free(client_buffer);
}
}
- }
+ }
/* Check latest status. */
if (status != UX_SUCCESS)
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 2b7f3a0a..0406648d 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
@@ -1,18 +1,19 @@
/***************************************************************************
- * Copyright (c) 2024 Microsoft Corporation
- *
+ * Copyright (c) 2024 Microsoft Corporation
+ * Copyright (c) 2026-present Eclipse ThreadX contributors
+ *
* This program and the accompanying materials are made available under the
* terms of the MIT License which is available at
* https://opensource.org/licenses/MIT.
- *
+ *
* SPDX-License-Identifier: MIT
**************************************************************************/
/**************************************************************************/
/**************************************************************************/
-/** */
-/** USBX Component */
+/** */
+/** USBX Component */
/** */
/** HUB Class */
/** */
@@ -29,63 +30,47 @@
#include "ux_host_stack.h"
-/**************************************************************************/
-/* */
-/* FUNCTION RELEASE */
-/* */
-/* _ux_host_class_hub_activate PORTABLE C */
+/**************************************************************************/
+/* */
+/* FUNCTION RELEASE */
+/* */
+/* _ux_host_class_hub_activate PORTABLE C */
/* 6.1.12 */
/* AUTHOR */
/* */
/* Chaoqiong Xiao, Microsoft Corporation */
/* */
/* DESCRIPTION */
-/* */
-/* This function performs the enumeration of the HUB. The HUB */
-/* descriptor is read, the interrupt endpoint activated, power is set */
-/* to the downstream ports and the HUB instance will be awaken when */
-/* there is a status change on the HUB or one of the ports. */
-/* */
-/* INPUT */
-/* */
-/* command Pointer to command */
-/* */
-/* OUTPUT */
-/* */
-/* Completion Status */
-/* */
-/* CALLS */
-/* */
-/* _ux_host_class_hub_configure Configure HUB */
-/* _ux_host_class_hub_descriptor_get Get descriptor */
+/* */
+/* This function performs the enumeration of the HUB. The HUB */
+/* descriptor is read, the interrupt endpoint activated, power is set */
+/* to the downstream ports and the HUB instance will be awaken when */
+/* there is a status change on the HUB or one of the ports. */
+/* */
+/* INPUT */
+/* */
+/* command Pointer to command */
+/* */
+/* OUTPUT */
+/* */
+/* Completion Status */
+/* */
+/* CALLS */
+/* */
+/* _ux_host_class_hub_configure Configure HUB */
+/* _ux_host_class_hub_descriptor_get Get descriptor */
/* _ux_host_class_hub_interrupt_endpoint_start */
-/* Start interrupt endpoint */
-/* _ux_host_class_hub_ports_power Power ports */
-/* _ux_host_stack_class_instance_create Create class instance */
-/* _ux_host_stack_class_instance_destroy Destroy class instance */
-/* _ux_utility_memory_allocate Allocate memory block */
+/* Start interrupt endpoint */
+/* _ux_host_class_hub_ports_power Power ports */
+/* _ux_host_stack_class_instance_create Create class instance */
+/* _ux_host_stack_class_instance_destroy Destroy class instance */
+/* _ux_utility_memory_allocate Allocate memory block */
/* _ux_utility_memory_free Free memory block */
-/* _ux_host_semaphore_create Create semaphore */
-/* */
-/* CALLED BY */
-/* */
-/* HUB Class */
-/* */
-/* 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 */
-/* 01-31-2022 Chaoqiong Xiao Modified comment(s), */
-/* refined macros names, */
-/* resulting in version 6.1.10 */
-/* 07-29-2022 Chaoqiong Xiao Modified comment(s), */
-/* added standalone support, */
-/* resulting in version 6.1.12 */
+/* _ux_host_semaphore_create Create semaphore */
+/* */
+/* CALLED BY */
+/* */
+/* HUB Class */
/* */
/**************************************************************************/
UINT _ux_host_class_hub_activate(UX_HOST_CLASS_COMMAND *command)
@@ -111,18 +96,18 @@ UINT status;
hub = (UX_HOST_CLASS_HUB *) _ux_utility_memory_allocate(UX_NO_ALIGN, UX_REGULAR_MEMORY, sizeof(UX_HOST_CLASS_HUB));
if (hub == UX_NULL)
return(UX_MEMORY_INSUFFICIENT);
-
+
/* Store the class container into this instance. */
hub -> ux_host_class_hub_class = command -> ux_host_class_command_class_ptr;
- /* Store the device container instance in the HUB instance, this is for
+ /* Store the device container instance in the HUB instance, this is for
the class instance when it needs to talk to the USBX stack. */
hub -> ux_host_class_hub_device = device;
#if defined(UX_HOST_STANDALONE)
/* Store the instance in the device container, this is for the USBX stack
- when it needs to invoke the class. */
+ when it needs to invoke the class. */
device -> ux_device_class_instance = (VOID *) hub;
/* Store the hub interface. */
@@ -142,29 +127,29 @@ UINT status;
#else
/* Configure the HUB. */
- status = _ux_host_class_hub_configure(hub);
+ status = _ux_host_class_hub_configure(hub);
if (status == UX_SUCCESS)
{
/* Get the HUB descriptor. */
- status = _ux_host_class_hub_descriptor_get(hub);
+ status = _ux_host_class_hub_descriptor_get(hub);
if (status == UX_SUCCESS)
{
/* Power up the HUB downstream ports. This function always returns
- success since we may be dealing with multiple ports. */
+ success since we may be dealing with multiple ports. */
_ux_host_class_hub_ports_power(hub);
/* Search the HUB interrupt endpoint and start it. */
- status = _ux_host_class_hub_interrupt_endpoint_start(hub);
+ status = _ux_host_class_hub_interrupt_endpoint_start(hub);
if (status == UX_SUCCESS)
{
/* Create this class instance. */
_ux_host_stack_class_instance_create(hub -> ux_host_class_hub_class, (VOID *) hub);
-
+
/* Store the instance in the device container, this is for the USBX stack
- when it needs to invoke the class. */
+ when it needs to invoke the class. */
device -> ux_device_class_instance = (VOID *) hub;
/* Mark the HUB as live now. */
@@ -174,7 +159,7 @@ UINT status;
if a function has been programmed in the system structure. */
if (_ux_system_host -> ux_system_host_change_function != UX_NULL)
{
-
+
/* Call system change function. */
_ux_system_host -> ux_system_host_change_function(UX_DEVICE_INSERTION, hub -> ux_host_class_hub_class, (VOID *) hub);
}
@@ -199,5 +184,5 @@ UINT status;
#endif
/* Return completion status. */
- return(status);
+ return(status);
}
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 c2800e99..ff0e521f 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
@@ -1,18 +1,19 @@
/***************************************************************************
- * Copyright (c) 2024 Microsoft Corporation
- *
+ * Copyright (c) 2024 Microsoft Corporation
+ * Copyright (c) 2026-present Eclipse ThreadX contributors
+ *
* This program and the accompanying materials are made available under the
* terms of the MIT License which is available at
* https://opensource.org/licenses/MIT.
- *
+ *
* SPDX-License-Identifier: MIT
**************************************************************************/
/**************************************************************************/
/**************************************************************************/
-/** */
-/** USBX Component */
+/** */
+/** USBX Component */
/** */
/** HUB Class */
/** */
@@ -29,52 +30,41 @@
#include "ux_host_stack.h"
-/**************************************************************************/
-/* */
-/* FUNCTION RELEASE */
-/* */
-/* _ux_host_class_hub_change_detect PORTABLE C */
+/**************************************************************************/
+/* */
+/* FUNCTION RELEASE */
+/* */
+/* _ux_host_class_hub_change_detect PORTABLE C */
/* 6.1.12 */
/* AUTHOR */
/* */
/* Chaoqiong Xiao, Microsoft Corporation */
/* */
/* DESCRIPTION */
-/* */
-/* This function is called by the enumeration thread when there has */
-/* been activity on the HUB. */
+/* */
+/* This function is called by the enumeration thread when there has */
+/* been activity on the HUB. */
/* */
/* In standalone mode there is nothing to do here, activities are */
/* processed in hub tasks function. */
-/* */
-/* INPUT */
-/* */
-/* None */
-/* */
-/* OUTPUT */
-/* */
-/* None */
-/* */
-/* CALLS */
-/* */
-/* _ux_host_class_hub_change_process Process HUB change */
-/* _ux_host_stack_class_get Get class */
-/* _ux_host_stack_class_instance_get Get class instance */
-/* */
-/* CALLED BY */
-/* */
-/* HUB Class */
-/* */
-/* RELEASE HISTORY */
-/* */
-/* DATE NAME DESCRIPTION */
-/* */
-/* 05-19-2020 Chaoqiong Xiao Initial Version 6.0 */
-/* 09-30-2020 Chaoqiong Xiao Modified comment(s), */
-/* resulting in version 6.1 */
-/* 07-29-2022 Chaoqiong Xiao Modified comment(s), */
-/* added standalone support, */
-/* resulting in version 6.1.12 */
+/* */
+/* INPUT */
+/* */
+/* None */
+/* */
+/* OUTPUT */
+/* */
+/* None */
+/* */
+/* CALLS */
+/* */
+/* _ux_host_class_hub_change_process Process HUB change */
+/* _ux_host_stack_class_get Get class */
+/* _ux_host_stack_class_instance_get Get class instance */
+/* */
+/* CALLED BY */
+/* */
+/* HUB Class */
/* */
/**************************************************************************/
VOID _ux_host_class_hub_change_detect(VOID)
@@ -106,7 +96,7 @@ UINT class_index;
if (status == UX_SUCCESS)
{
- /* We have found an instance of a HUB, check if it is live and if the HUB has
+ /* We have found an instance of a HUB, check if it is live and if the HUB has
detected a change before we proceed. */
if (hub -> ux_host_class_hub_change_semaphore != 0)
{
@@ -121,7 +111,7 @@ UINT class_index;
hub -> ux_host_class_hub_change_semaphore--;
}
}
- } while (status == UX_SUCCESS);
+ } while (status == UX_SUCCESS);
/* We have parsed all the HUB instances. */
return;
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 06887813..290871fd 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
@@ -1,18 +1,19 @@
/***************************************************************************
- * Copyright (c) 2024 Microsoft Corporation
- *
+ * Copyright (c) 2024 Microsoft Corporation
+ * Copyright (c) 2026-present Eclipse ThreadX contributors
+ *
* This program and the accompanying materials are made available under the
* terms of the MIT License which is available at
* https://opensource.org/licenses/MIT.
- *
+ *
* SPDX-License-Identifier: MIT
**************************************************************************/
/**************************************************************************/
/**************************************************************************/
-/** */
-/** USBX Component */
+/** */
+/** USBX Component */
/** */
/** Hub Class */
/** */
@@ -29,46 +30,38 @@
#include "ux_host_stack.h"
-/**************************************************************************/
-/* */
-/* FUNCTION RELEASE */
-/* */
-/* _ux_host_class_hub_change_process PORTABLE C */
+/**************************************************************************/
+/* */
+/* FUNCTION RELEASE */
+/* */
+/* _ux_host_class_hub_change_process PORTABLE C */
/* 6.1 */
/* AUTHOR */
/* */
/* Chaoqiong Xiao, Microsoft Corporation */
/* */
/* DESCRIPTION */
-/* */
+/* */
/* This function is called by the topology thread when there has been */
-/* activity on the HUB. */
-/* */
-/* INPUT */
-/* */
-/* hub Pointer to HUB */
-/* */
-/* OUTPUT */
-/* */
-/* Completion Status */
-/* */
-/* CALLS */
-/* */
-/* _ux_host_class_hub_port_change_process Port change process */
-/* _ux_host_stack_transfer_request Process transfer request */
-/* _ux_utility_short_get Get 16-bit word */
-/* */
-/* CALLED BY */
-/* */
-/* HUB Class */
-/* */
-/* RELEASE HISTORY */
-/* */
-/* DATE NAME DESCRIPTION */
-/* */
-/* 05-19-2020 Chaoqiong Xiao Initial Version 6.0 */
-/* 09-30-2020 Chaoqiong Xiao Modified comment(s), */
-/* resulting in version 6.1 */
+/* activity on the HUB. */
+/* */
+/* INPUT */
+/* */
+/* hub Pointer to HUB */
+/* */
+/* OUTPUT */
+/* */
+/* Completion Status */
+/* */
+/* CALLS */
+/* */
+/* _ux_host_class_hub_port_change_process Port change process */
+/* _ux_host_stack_transfer_request Process transfer request */
+/* _ux_utility_short_get Get 16-bit word */
+/* */
+/* CALLED BY */
+/* */
+/* HUB Class */
/* */
/**************************************************************************/
UINT _ux_host_class_hub_change_process(UX_HOST_CLASS_HUB *hub)
@@ -78,14 +71,14 @@ UX_TRANSFER *transfer_request;
USHORT port_status_change_bits;
UINT port_index;
UINT status;
-
+
/* Now get the transfer_request attached to the interrupt endpoint. */
transfer_request = &hub -> ux_host_class_hub_interrupt_endpoint -> ux_endpoint_transfer_request;
- /* The interrupt pipe buffer contains the status change for each of the ports
+ /* The interrupt pipe buffer contains the status change for each of the ports
the length of the buffer can be 1 or 2 depending on the number of ports.
- Usually, since HUBs can be bus powered the maximum number of ports is 4.
+ Usually, since HUBs can be bus powered the maximum number of ports is 4.
We must be taking precautions on how we read the buffer content for
big endian machines. */
if (transfer_request -> ux_transfer_request_actual_length == 1)
@@ -104,7 +97,7 @@ UINT status;
/* The HUB could also have changed. */
if (port_status_change_bits & 1)
_ux_host_class_hub_hub_change_process(hub);
-
+
/* The actual length should be cleared for the next transfer. */
transfer_request -> ux_transfer_request_actual_length = 0;
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 62d79235..42841000 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
@@ -1,18 +1,19 @@
/***************************************************************************
- * Copyright (c) 2024 Microsoft Corporation
- *
+ * Copyright (c) 2024 Microsoft Corporation
+ * Copyright (c) 2026-present Eclipse ThreadX contributors
+ *
* This program and the accompanying materials are made available under the
* terms of the MIT License which is available at
* https://opensource.org/licenses/MIT.
- *
+ *
* SPDX-License-Identifier: MIT
**************************************************************************/
/**************************************************************************/
/**************************************************************************/
-/** */
-/** USBX Component */
+/** */
+/** USBX Component */
/** */
/** HUB Class */
/** */
@@ -29,58 +30,45 @@
#include "ux_host_stack.h"
-/**************************************************************************/
-/* */
-/* FUNCTION RELEASE */
-/* */
-/* _ux_host_class_hub_configure PORTABLE C */
+/**************************************************************************/
+/* */
+/* FUNCTION RELEASE */
+/* */
+/* _ux_host_class_hub_configure PORTABLE C */
/* 6.1.11 */
/* AUTHOR */
/* */
/* Chaoqiong Xiao, Microsoft Corporation */
/* */
/* DESCRIPTION */
-/* */
+/* */
/* This function calls the USBX stack to do a SET_CONFIGURATION to the */
-/* HUB. Once the HUB is configured, its interface will be activated */
-/* and all the endpoints enumerated (1 interrupt endpoint in the case */
-/* of the HUB). */
-/* */
-/* INPUT */
-/* */
-/* hub Pointer to HUB */
-/* */
-/* OUTPUT */
-/* */
-/* Completion Status */
-/* */
-/* CALLS */
-/* */
-/* _ux_host_stack_device_configuration_get Get device configuration */
-/* _ux_host_stack_device_configuration_select */
-/* Select device configuration */
-/* _ux_host_stack_configuration_interface_get */
-/* Get interface */
-/* _ux_host_stack_transfer_request Process transfer request */
-/* _ux_utility_memory_allocate Allocate memory block */
-/* _ux_utility_memory_free Release memory block */
-/* */
-/* CALLED BY */
-/* */
-/* HUB Class */
-/* */
-/* 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 */
-/* 04-25-2022 Chaoqiong Xiao Modified comment(s), */
-/* internal clean up, */
-/* resulting in version 6.1.11 */
+/* HUB. Once the HUB is configured, its interface will be activated */
+/* and all the endpoints enumerated (1 interrupt endpoint in the case */
+/* of the HUB). */
+/* */
+/* INPUT */
+/* */
+/* hub Pointer to HUB */
+/* */
+/* OUTPUT */
+/* */
+/* Completion Status */
+/* */
+/* CALLS */
+/* */
+/* _ux_host_stack_device_configuration_get Get device configuration */
+/* _ux_host_stack_device_configuration_select */
+/* Select device configuration */
+/* _ux_host_stack_configuration_interface_get */
+/* Get interface */
+/* _ux_host_stack_transfer_request Process transfer request */
+/* _ux_utility_memory_allocate Allocate memory block */
+/* _ux_utility_memory_free Release memory block */
+/* */
+/* CALLED BY */
+/* */
+/* HUB Class */
/* */
/**************************************************************************/
UINT _ux_host_class_hub_configure(UX_HOST_CLASS_HUB *hub)
@@ -100,16 +88,16 @@ UX_DEVICE *parent_device;
/* A HUB normally has one configuration. So retrieve the 1st configuration
only. */
_ux_host_stack_device_configuration_get(hub -> ux_host_class_hub_device, 0, &configuration);
-
+
/* Get the device container for this configuration. */
device = configuration -> ux_configuration_device;
-
- /* To find the true source of the HUB power source, we need to do a GET_STATUS of
+
+ /* 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;
transfer_request = &control_endpoint -> ux_endpoint_transfer_request;
- /* Allocate a buffer for the device status: 2 bytes. */
+ /* Allocate a buffer for the device status: 2 bytes. */
device_status_data = _ux_utility_memory_allocate(UX_SAFE_ALIGN, UX_CACHE_SAFE_MEMORY, 2);
if (device_status_data == UX_NULL)
return(UX_MEMORY_INSUFFICIENT);
@@ -128,7 +116,7 @@ UX_DEVICE *parent_device;
/* Check the status and the length of the data returned. */
if ((status == UX_SUCCESS) && (transfer_request -> ux_transfer_request_actual_length == 2))
{
-
+
/* The data returned is good, now analyze power source. */
if (*device_status_data & UX_STATUS_DEVICE_SELF_POWERED)
device -> ux_device_power_source = UX_DEVICE_SELF_POWERED;
@@ -140,7 +128,7 @@ UX_DEVICE *parent_device;
}
else
{
-
+
/* Free the buffer resource now. */
_ux_utility_memory_free(device_status_data);
@@ -152,21 +140,21 @@ UX_DEVICE *parent_device;
/* Return an error. */
return(UX_CONNECTION_INCOMPATIBLE);
- }
+ }
#if UX_MAX_DEVICES > 1
- /* Check the HUB power source and check the parent power source for
+ /* 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 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))
- {
+ {
/* Error trap. */
_ux_system_error_handler(UX_SYSTEM_LEVEL_THREAD, UX_SYSTEM_CONTEXT_HUB, UX_CONNECTION_INCOMPATIBLE);
@@ -175,15 +163,15 @@ UX_DEVICE *parent_device;
UX_TRACE_IN_LINE_INSERT(UX_TRACE_ERROR, UX_CONNECTION_INCOMPATIBLE, hub, 0, 0, UX_TRACE_ERRORS, 0, 0)
return(UX_CONNECTION_INCOMPATIBLE);
- }
+ }
}
#endif
- /* We have the valid configuration. Ask the USBX stack to set this configuration. */
+ /* We have the valid configuration. Ask the USBX stack to set this configuration. */
_ux_host_stack_device_configuration_select(configuration);
- /* If the operation went well, the HUB default alternate setting for the HUB interface is
- active and the interrupt endpoint is now enabled. We have to memorize the first interface
+ /* If the operation went well, the HUB default alternate setting for the HUB interface is
+ active and the interrupt endpoint is now enabled. We have to memorize the first interface
since the interrupt endpoint is hooked to it. */
status = _ux_host_stack_configuration_interface_get(configuration, 0, 0, &hub -> ux_host_class_hub_interface);
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 5ff219eb..faa23325 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
@@ -1,18 +1,19 @@
/***************************************************************************
- * Copyright (c) 2024 Microsoft Corporation
- *
+ * Copyright (c) 2024 Microsoft Corporation
+ * Copyright (c) 2026-present Eclipse ThreadX contributors
+ *
* This program and the accompanying materials are made available under the
* terms of the MIT License which is available at
* https://opensource.org/licenses/MIT.
- *
+ *
* SPDX-License-Identifier: MIT
**************************************************************************/
/**************************************************************************/
/**************************************************************************/
-/** */
-/** USBX Component */
+/** */
+/** USBX Component */
/** */
/** HUB Class */
/** */
@@ -29,63 +30,44 @@
#include "ux_host_stack.h"
-/**************************************************************************/
-/* */
-/* FUNCTION RELEASE */
-/* */
-/* _ux_host_class_hub_deactivate PORTABLE C */
+/**************************************************************************/
+/* */
+/* FUNCTION RELEASE */
+/* */
+/* _ux_host_class_hub_deactivate PORTABLE C */
/* 6.3.0 */
/* AUTHOR */
/* */
/* Chaoqiong Xiao, Microsoft Corporation */
/* */
/* DESCRIPTION */
-/* */
+/* */
/* This function is called when this instance of the HUB has been */
-/* removed from the bus either directly or indirectly. The interrupt */
-/* pipe will be destroyed and the instance removed. */
-/* */
-/* INPUT */
-/* */
-/* command Pointer to class command */
-/* */
-/* OUTPUT */
-/* */
-/* Completion Status */
-/* */
-/* CALLS */
-/* */
-/* _ux_host_stack_class_instance_destroy Destroy class instance */
-/* _ux_host_stack_device_remove Remove device */
+/* removed from the bus either directly or indirectly. The interrupt */
+/* pipe will be destroyed and the instance removed. */
+/* */
+/* INPUT */
+/* */
+/* command Pointer to class command */
+/* */
+/* OUTPUT */
+/* */
+/* Completion Status */
+/* */
+/* CALLS */
+/* */
+/* _ux_host_stack_class_instance_destroy Destroy class instance */
+/* _ux_host_stack_device_remove Remove device */
/* _ux_host_stack_endpoint_transfer_abort */
-/* Abort transfer */
-/* _ux_utility_memory_free Release memory block */
-/* _ux_host_semaphore_get Get semaphore */
-/* _ux_host_semaphore_put Release semaphore */
+/* Abort transfer */
+/* _ux_utility_memory_free Release memory block */
+/* _ux_host_semaphore_get Get semaphore */
+/* _ux_host_semaphore_put Release semaphore */
/* _ux_utility_thread_schedule_other Schedule other threads */
-/* */
-/* CALLED BY */
-/* */
-/* HUB Class */
-/* */
-/* 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 */
-/* 01-31-2022 Chaoqiong Xiao Modified comment(s), */
-/* refined macros names, */
-/* resulting in version 6.1.10 */
-/* 07-29-2022 Chaoqiong Xiao Modified comment(s), */
-/* added standalone support, */
-/* resulting in version 6.1.12 */
-/* 10-31-2023 Chaoqiong Xiao Modified comment(s), */
-/* improved deactivate flow, */
-/* resulting in version 6.3.0 */
+/* */
+/* CALLED BY */
+/* */
+/* HUB Class */
/* */
/**************************************************************************/
UINT _ux_host_class_hub_deactivate(UX_HOST_CLASS_COMMAND *command)
@@ -105,7 +87,7 @@ UINT port_index;
/* The HUB is being shut down. */
hub -> ux_host_class_hub_state = UX_HOST_CLASS_INSTANCE_SHUTDOWN;
-
+
/* We need to abort transactions on the interrupt pipe. */
#if defined(UX_HOST_STANDALONE)
if (hub -> ux_host_class_hub_interrupt_endpoint)
@@ -134,7 +116,7 @@ UINT port_index;
/* The enumeration thread needs to sleep a while to allow the application or the class that may be using
endpoints to exit properly. */
- _ux_host_thread_schedule_other(UX_THREAD_PRIORITY_ENUM);
+ _ux_host_thread_schedule_other(UX_THREAD_PRIORITY_ENUM);
/* Then de allocate the memory. */
#if defined(UX_HOST_STANDALONE)
@@ -156,7 +138,7 @@ UINT port_index;
that the device is removed. */
if (_ux_system_host -> ux_system_host_change_function != UX_NULL)
{
-
+
/* Inform the application the device is removed. */
_ux_system_host -> ux_system_host_change_function(UX_DEVICE_REMOVAL, hub -> ux_host_class_hub_class, (VOID *) hub);
}
@@ -169,7 +151,7 @@ UINT port_index;
#if defined(UX_HOST_STANDALONE)
- /* Unlink from device class instance. */
+ /* Unlink from device class instance. */
hub -> ux_host_class_hub_device -> ux_device_class_instance = (VOID *) hub;
#endif
@@ -177,5 +159,5 @@ UINT port_index;
_ux_utility_memory_free(hub);
/* Return successful completion. */
- return(UX_SUCCESS);
+ return(UX_SUCCESS);
}
diff --git a/common/usbx_host_classes/src/ux_host_class_hub_descriptor_get.c b/common/usbx_host_classes/src/ux_host_class_hub_descriptor_get.c
index dea9ba31..f32c9c31 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
@@ -1,18 +1,19 @@
/***************************************************************************
- * Copyright (c) 2024 Microsoft Corporation
- *
+ * Copyright (c) 2024 Microsoft Corporation
+ * Copyright (c) 2026-present Eclipse ThreadX contributors
+ *
* This program and the accompanying materials are made available under the
* terms of the MIT License which is available at
* https://opensource.org/licenses/MIT.
- *
+ *
* SPDX-License-Identifier: MIT
**************************************************************************/
/**************************************************************************/
/**************************************************************************/
-/** */
-/** USBX Component */
+/** */
+/** USBX Component */
/** */
/** HUB Class */
/** */
@@ -123,59 +124,40 @@ ULONG port_index;
#endif
-/**************************************************************************/
-/* */
-/* FUNCTION RELEASE */
-/* */
-/* _ux_host_class_hub_descriptor_get PORTABLE C */
+/**************************************************************************/
+/* */
+/* FUNCTION RELEASE */
+/* */
+/* _ux_host_class_hub_descriptor_get PORTABLE C */
/* 6.3.0 */
/* AUTHOR */
/* */
/* Chaoqiong Xiao, Microsoft Corporation */
/* */
/* DESCRIPTION */
-/* */
-/* This function obtains the HUB descriptor. This descriptor contains */
-/* the number of downstream ports and the power characteristics of the */
-/* HUB (self powered or bus powered). */
-/* */
-/* INPUT */
-/* */
-/* hub Pointer to HUB */
-/* */
-/* OUTPUT */
-/* */
-/* Completion Status */
-/* */
-/* CALLS */
-/* */
-/* _ux_host_stack_transfer_request Process transfer request */
-/* _ux_utility_memory_allocate Allocate memory block */
-/* _ux_utility_memory_free Release memory block */
-/* _ux_utility_descriptor_parse Parse descriptor */
-/* */
-/* CALLED BY */
-/* */
-/* HUB Class */
-/* */
-/* 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 */
-/* 01-31-2022 Chaoqiong Xiao Modified comment(s), */
-/* improved protocol handling, */
-/* resulting in version 6.1.10 */
-/* 07-29-2022 Chaoqiong Xiao Modified comment(s), */
-/* added standalone support, */
-/* resulting in version 6.1.12 */
-/* 10-31-2023 Chaoqiong Xiao Modified comment(s), */
-/* fixed compile warnings, */
-/* resulting in version 6.3.0 */
+/* */
+/* This function obtains the HUB descriptor. This descriptor contains */
+/* the number of downstream ports and the power characteristics of the */
+/* HUB (self powered or bus powered). */
+/* */
+/* INPUT */
+/* */
+/* hub Pointer to HUB */
+/* */
+/* OUTPUT */
+/* */
+/* Completion Status */
+/* */
+/* CALLS */
+/* */
+/* _ux_host_stack_transfer_request Process transfer request */
+/* _ux_utility_memory_allocate Allocate memory block */
+/* _ux_utility_memory_free Release memory block */
+/* _ux_utility_descriptor_parse Parse descriptor */
+/* */
+/* CALLED BY */
+/* */
+/* HUB Class */
/* */
/**************************************************************************/
UINT _ux_host_class_hub_descriptor_get(UX_HOST_CLASS_HUB *hub)
diff --git a/common/usbx_host_classes/src/ux_host_class_hub_entry.c b/common/usbx_host_classes/src/ux_host_class_hub_entry.c
index f6276239..9215cc8d 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
@@ -1,10 +1,11 @@
/***************************************************************************
- * Copyright (c) 2024 Microsoft Corporation
- *
+ * Copyright (c) 2024 Microsoft Corporation
+ * Copyright (c) 2026-present Eclipse ThreadX contributors
+ *
* This program and the accompanying materials are made available under the
* terms of the MIT License which is available at
* https://opensource.org/licenses/MIT.
- *
+ *
* SPDX-License-Identifier: MIT
**************************************************************************/
@@ -68,26 +69,6 @@ static inline UINT _ux_host_class_hub_activate_wait(UX_HOST_CLASS_COMMAND *comma
/* */
/* Host Stack */
/* */
-/* RELEASE HISTORY */
-/* */
-/* 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 */
-/* 07-29-2022 Chaoqiong Xiao Modified comment(s), */
-/* added standalone support, */
-/* resulting in version 6.1.12 */
-/* 10-31-2022 Chaoqiong Xiao Modified comment(s), */
-/* fixed power on delay calc, */
-/* resulting in version 6.2.0 */
-/* 10-31-2023 Chaoqiong Xiao Modified comment(s), */
-/* fixed fail code sequence, */
-/* fixed compile warnings, */
-/* resulting in version 6.3.0 */
-/* */
/**************************************************************************/
UINT _ux_host_class_hub_entry(UX_HOST_CLASS_COMMAND *command)
{
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 b0531d7a..934b51f9 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
@@ -1,18 +1,19 @@
/***************************************************************************
- * Copyright (c) 2024 Microsoft Corporation
- *
+ * Copyright (c) 2024 Microsoft Corporation
+ * Copyright (c) 2026-present Eclipse ThreadX contributors
+ *
* This program and the accompanying materials are made available under the
* terms of the MIT License which is available at
* https://opensource.org/licenses/MIT.
- *
+ *
* SPDX-License-Identifier: MIT
**************************************************************************/
/**************************************************************************/
/**************************************************************************/
-/** */
-/** USBX Component */
+/** */
+/** USBX Component */
/** */
/** HUB Class */
/** */
@@ -29,54 +30,43 @@
#include "ux_host_stack.h"
-/**************************************************************************/
-/* */
-/* FUNCTION RELEASE */
-/* */
-/* _ux_host_class_hub_feature PORTABLE C */
+/**************************************************************************/
+/* */
+/* FUNCTION RELEASE */
+/* */
+/* _ux_host_class_hub_feature PORTABLE C */
/* 6.1.12 */
/* AUTHOR */
/* */
/* Chaoqiong Xiao, Microsoft Corporation */
/* */
/* DESCRIPTION */
-/* */
+/* */
/* This function will send a command to the HUB on a specific port. */
-/* The commands can be SET_FEATURE or CLEAR_FEATURE. */
+/* The commands can be SET_FEATURE or CLEAR_FEATURE. */
/* */
/* In standalone mode, this functioin prepares the control transfer */
/* request context of specific command, for host stack transfer */
/* function to process, in next steps. */
-/* */
-/* INPUT */
-/* */
-/* hub Pointer to HUB class */
-/* port Port number */
-/* command Command to send */
-/* feature Feature to send */
-/* */
-/* OUTPUT */
-/* */
-/* Completion Status */
-/* */
-/* CALLS */
-/* */
-/* _ux_host_stack_transfer_request Process transfer request */
-/* */
-/* CALLED BY */
-/* */
-/* HUB Class */
-/* */
-/* RELEASE HISTORY */
-/* */
-/* DATE NAME DESCRIPTION */
-/* */
-/* 05-19-2020 Chaoqiong Xiao Initial Version 6.0 */
-/* 09-30-2020 Chaoqiong Xiao Modified comment(s), */
-/* resulting in version 6.1 */
-/* 07-29-2022 Chaoqiong Xiao Modified comment(s), */
-/* added standalone support, */
-/* resulting in version 6.1.12 */
+/* */
+/* INPUT */
+/* */
+/* hub Pointer to HUB class */
+/* port Port number */
+/* command Command to send */
+/* feature Feature to send */
+/* */
+/* OUTPUT */
+/* */
+/* Completion Status */
+/* */
+/* CALLS */
+/* */
+/* _ux_host_stack_transfer_request Process transfer request */
+/* */
+/* CALLED BY */
+/* */
+/* HUB Class */
/* */
/**************************************************************************/
UINT _ux_host_class_hub_feature(UX_HOST_CLASS_HUB *hub, UINT port, UINT command, UINT function)
@@ -94,7 +84,7 @@ UINT status;
/* The target is DEVICE for the HUB and OTHER for the downstream ports. */
if (port == 0)
- target = UX_REQUEST_TARGET_DEVICE;
+ target = UX_REQUEST_TARGET_DEVICE;
else
target = UX_REQUEST_TARGET_OTHER;
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 32f48330..ade9578b 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
@@ -1,18 +1,19 @@
/***************************************************************************
- * Copyright (c) 2024 Microsoft Corporation
- *
+ * Copyright (c) 2024 Microsoft Corporation
+ * Copyright (c) 2026-present Eclipse ThreadX contributors
+ *
* This program and the accompanying materials are made available under the
* terms of the MIT License which is available at
* https://opensource.org/licenses/MIT.
- *
+ *
* SPDX-License-Identifier: MIT
**************************************************************************/
/**************************************************************************/
/**************************************************************************/
-/** */
-/** USBX Component */
+/** */
+/** USBX Component */
/** */
/** HUB Class */
/** */
@@ -29,44 +30,36 @@
#include "ux_host_stack.h"
-/**************************************************************************/
-/* */
-/* FUNCTION RELEASE */
-/* */
-/* _ux_host_class_hub_hub_change_process PORTABLE C */
+/**************************************************************************/
+/* */
+/* FUNCTION RELEASE */
+/* */
+/* _ux_host_class_hub_hub_change_process PORTABLE C */
/* 6.1 */
/* AUTHOR */
/* */
/* Chaoqiong Xiao, Microsoft Corporation */
/* */
/* DESCRIPTION */
-/* */
+/* */
/* This function is called when there is a change on the HUB itself */
-/* (not a HUB port!). */
-/* */
-/* INPUT */
-/* */
-/* hub Pointer to HUB class */
-/* */
-/* OUTPUT */
-/* */
-/* Completion Status */
-/* */
-/* CALLS */
-/* */
-/* None */
-/* */
-/* CALLED BY */
-/* */
-/* HUB Class */
-/* */
-/* RELEASE HISTORY */
-/* */
-/* DATE NAME DESCRIPTION */
-/* */
-/* 05-19-2020 Chaoqiong Xiao Initial Version 6.0 */
-/* 09-30-2020 Chaoqiong Xiao Modified comment(s), */
-/* resulting in version 6.1 */
+/* (not a HUB port!). */
+/* */
+/* INPUT */
+/* */
+/* hub Pointer to HUB class */
+/* */
+/* OUTPUT */
+/* */
+/* Completion Status */
+/* */
+/* CALLS */
+/* */
+/* None */
+/* */
+/* CALLED BY */
+/* */
+/* HUB Class */
/* */
/**************************************************************************/
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 9d3f35a5..df6acfcf 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
@@ -1,18 +1,19 @@
/***************************************************************************
- * Copyright (c) 2024 Microsoft Corporation
- *
+ * Copyright (c) 2024 Microsoft Corporation
+ * Copyright (c) 2026-present Eclipse ThreadX contributors
+ *
* This program and the accompanying materials are made available under the
* terms of the MIT License which is available at
* https://opensource.org/licenses/MIT.
- *
+ *
* SPDX-License-Identifier: MIT
**************************************************************************/
/**************************************************************************/
/**************************************************************************/
-/** */
-/** USBX Component */
+/** */
+/** USBX Component */
/** */
/** HUB Class */
/** */
@@ -29,56 +30,41 @@
#include "ux_host_stack.h"
-/**************************************************************************/
-/* */
-/* FUNCTION RELEASE */
-/* */
-/* _ux_host_class_hub_interrupt_endpoint_start PORTABLE C */
+/**************************************************************************/
+/* */
+/* FUNCTION RELEASE */
+/* */
+/* _ux_host_class_hub_interrupt_endpoint_start PORTABLE C */
/* 6.1.12 */
/* AUTHOR */
/* */
/* Chaoqiong Xiao, Microsoft Corporation */
/* */
/* DESCRIPTION */
-/* */
+/* */
/* This function search for the handle of the only interrupt endpoint */
-/* in the default alternate setting of the HUB interface. The */
+/* in the default alternate setting of the HUB interface. The */
/* interrupt endpoint should always be there. When it is located, the */
/* first transfer for this endpoint is made. The HUB will report status*/
-/* changes on this pipe. */
-/* */
-/* INPUT */
-/* */
-/* hub Pointer to HUB class */
-/* */
-/* OUTPUT */
-/* */
-/* Completion Status */
-/* */
-/* CALLS */
-/* */
-/* _ux_host_stack_interface_endpoint_get Get endpoint of interface */
-/* _ux_host_stack_transfer_request Process transfer request */
-/* _ux_utility_memory_allocate Allocate memory block */
-/* */
-/* CALLED BY */
-/* */
-/* HUB Class */
-/* */
-/* RELEASE HISTORY */
-/* */
-/* DATE NAME DESCRIPTION */
-/* */
-/* 05-19-2020 Chaoqiong Xiao Initial Version 6.0 */
-/* 09-30-2020 Chaoqiong Xiao Modified comment(s), */
-/* resulting in version 6.1 */
-/* 10-15-2021 Chaoqiong Xiao Modified comment(s), */
-/* use pre-calculated value */
-/* instead of wMaxPacketSize, */
-/* resulting in version 6.1.9 */
-/* 07-29-2022 Chaoqiong Xiao Modified comment(s), */
-/* added timeout value init, */
-/* resulting in version 6.1.12 */
+/* changes on this pipe. */
+/* */
+/* INPUT */
+/* */
+/* hub Pointer to HUB class */
+/* */
+/* OUTPUT */
+/* */
+/* Completion Status */
+/* */
+/* CALLS */
+/* */
+/* _ux_host_stack_interface_endpoint_get Get endpoint of interface */
+/* _ux_host_stack_transfer_request Process transfer request */
+/* _ux_utility_memory_allocate Allocate memory block */
+/* */
+/* CALLED BY */
+/* */
+/* HUB Class */
/* */
/**************************************************************************/
UINT _ux_host_class_hub_interrupt_endpoint_start(UX_HOST_CLASS_HUB *hub)
@@ -94,8 +80,8 @@ UX_TRANSFER *transfer_request;
/* Check completion status. */
if (status != UX_SUCCESS)
return(status);
-
- /* Do a sanity check on the nature of the endpoint. Must be interrupt and its direction must be IN. */
+
+ /* Do a sanity check on the nature of the endpoint. Must be interrupt and its direction must be IN. */
if (((hub -> ux_host_class_hub_interrupt_endpoint -> ux_endpoint_descriptor.bEndpointAddress & UX_ENDPOINT_DIRECTION) == UX_ENDPOINT_IN) &&
((hub -> ux_host_class_hub_interrupt_endpoint -> ux_endpoint_descriptor.bmAttributes & UX_MASK_ENDPOINT_TYPE) == UX_INTERRUPT_ENDPOINT))
{
@@ -118,7 +104,7 @@ UX_TRANSFER *transfer_request;
transfer_request -> ux_transfer_request_completion_function = _ux_host_class_hub_transfer_request_completed;
/* Obtain a buffer for this transaction. The buffer will always be reused. */
- transfer_request -> ux_transfer_request_data_pointer = _ux_utility_memory_allocate(UX_SAFE_ALIGN, UX_CACHE_SAFE_MEMORY,
+ transfer_request -> ux_transfer_request_data_pointer = _ux_utility_memory_allocate(UX_SAFE_ALIGN, UX_CACHE_SAFE_MEMORY,
transfer_request -> ux_transfer_request_requested_length);
/* Check the memory pointer. */
@@ -137,8 +123,8 @@ UX_TRANSFER *transfer_request;
/* Return completion status. */
return(status);
- }
-
+ }
+
/* Error trap. */
_ux_system_error_handler(UX_SYSTEM_LEVEL_THREAD, UX_SYSTEM_CONTEXT_HUB, UX_ENDPOINT_HANDLE_UNKNOWN);
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 46d3703c..14ef0786 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
@@ -1,18 +1,19 @@
/***************************************************************************
- * Copyright (c) 2024 Microsoft Corporation
- *
+ * Copyright (c) 2024 Microsoft Corporation
+ * Copyright (c) 2026-present Eclipse ThreadX contributors
+ *
* This program and the accompanying materials are made available under the
* terms of the MIT License which is available at
* https://opensource.org/licenses/MIT.
- *
+ *
* SPDX-License-Identifier: MIT
**************************************************************************/
/**************************************************************************/
/**************************************************************************/
-/** */
-/** USBX Component */
+/** */
+/** USBX Component */
/** */
/** HUB Class */
/** */
@@ -29,64 +30,43 @@
#include "ux_host_stack.h"
-/**************************************************************************/
-/* */
-/* FUNCTION RELEASE */
-/* */
-/* _ux_host_class_hub_port_change_connection_process PORTABLE C */
+/**************************************************************************/
+/* */
+/* FUNCTION RELEASE */
+/* */
+/* _ux_host_class_hub_port_change_connection_process PORTABLE C */
/* 6.1.12 */
/* AUTHOR */
/* */
/* Chaoqiong Xiao, Microsoft Corporation */
/* */
/* DESCRIPTION */
-/* */
+/* */
/* This function will process a connection change on the port. This */
-/* indicates that a device has been attached to the port. */
-/* */
-/* INPUT */
-/* */
-/* hub Pointer to HUB class */
-/* port Port number */
-/* port_status Port status */
-/* */
-/* OUTPUT */
-/* */
-/* None */
-/* */
-/* CALLS */
-/* */
-/* _ux_host_class_hub_feature Set HUB feature */
-/* _ux_host_class_hub_port_reset Reset port */
-/* _ux_host_class_hub_status_get Get status */
-/* _ux_host_stack_new_device_create Create new device */
-/* _ux_host_stack_device_remove Remove device */
-/* _ux_utility_delay_ms Thread sleep */
-/* */
-/* CALLED BY */
-/* */
-/* HUB Class */
-/* */
-/* 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 */
-/* 02-02-2021 Chaoqiong Xiao Modified comment(s), */
-/* handled more fail cases, */
-/* updated internal call, */
-/* added notification for */
-/* device connection, */
-/* added disconnection check */
-/* in enumeration retries, */
-/* resulting in version 6.1.4 */
-/* 07-29-2022 Chaoqiong Xiao Modified comment(s), */
-/* added standalone support, */
-/* resulting in version 6.1.12 */
+/* indicates that a device has been attached to the port. */
+/* */
+/* INPUT */
+/* */
+/* hub Pointer to HUB class */
+/* port Port number */
+/* port_status Port status */
+/* */
+/* OUTPUT */
+/* */
+/* None */
+/* */
+/* CALLS */
+/* */
+/* _ux_host_class_hub_feature Set HUB feature */
+/* _ux_host_class_hub_port_reset Reset port */
+/* _ux_host_class_hub_status_get Get status */
+/* _ux_host_stack_new_device_create Create new device */
+/* _ux_host_stack_device_remove Remove device */
+/* _ux_utility_delay_ms Thread sleep */
+/* */
+/* CALLED BY */
+/* */
+/* HUB Class */
/* */
/**************************************************************************/
VOID _ux_host_class_hub_port_change_connection_process(UX_HOST_CLASS_HUB *hub, UINT port, UINT port_status)
@@ -102,14 +82,14 @@ UINT status;
USHORT local_port_status;
USHORT local_port_change;
#endif
-
+
/* If trace is enabled, insert this event into the trace buffer. */
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 = 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
+ /* If there is a device attached on this HUB, there is a new device and it should
be enumerated. */
if (port_status & UX_HOST_CLASS_HUB_PORT_STATUS_CONNECTION)
{
@@ -122,10 +102,10 @@ USHORT local_port_change;
/* There was a device attached previously. Perform a removal. */
_ux_host_stack_device_remove(hcd, hub -> ux_host_class_hub_device, port);
-
+
}
else
-
+
/* Mark device connection. */
hub -> ux_host_class_hub_port_state |= (UINT)(1 << port);
@@ -133,7 +113,7 @@ USHORT local_port_change;
/* Port operations are done outside. */
#else
- /* Tell the hub to clear the change bit for this port so that we do
+ /* Tell the hub to clear the change bit for this port so that we do
not process the same change event again. */
_ux_host_class_hub_feature(hub, port, UX_CLEAR_FEATURE, UX_HOST_CLASS_HUB_C_PORT_CONNECTION);
@@ -148,7 +128,7 @@ USHORT local_port_change;
status = _ux_host_class_hub_port_reset(hub, port);
if (status != UX_SUCCESS)
return;
-
+
/* Reset succeeded, so perform a new port status after reset to force speed reevaluation. */
status = _ux_host_class_hub_status_get(hub, port, &local_port_status, &local_port_change);
if (status != UX_SUCCESS)
@@ -166,18 +146,18 @@ USHORT local_port_change;
if (local_port_status & UX_HOST_CLASS_HUB_PORT_STATUS_HIGH_SPEED)
device_speed = UX_HIGH_SPEED_DEVICE;
- else
+ else
device_speed = UX_FULL_SPEED_DEVICE;
- }
-
- /* Decide how much power this device can draw. This depends if the HUB is self
+ }
+
+ /* Decide how much power this device can draw. This depends if the HUB is self
powered or bus powered. */
if (hub -> ux_host_class_hub_device -> ux_device_power_source == UX_DEVICE_BUS_POWERED)
/* Hub is bus powered. */
port_power = UX_MAX_BUS_POWER;
- else
-
+ else
+
/* Hub is self powered. */
port_power = UX_MAX_SELF_POWER;
@@ -244,7 +224,7 @@ USHORT local_port_change;
/* If trace is enabled, insert this event into the trace buffer. */
UX_TRACE_IN_LINE_INSERT(UX_TRACE_ERROR, UX_DEVICE_ENUMERATION_FAILURE, port, 0, 0, UX_TRACE_ERRORS, 0, 0)
#endif
- }
+ }
else
{
@@ -271,7 +251,7 @@ USHORT local_port_change;
/* We must clear the connection change condition so that we don't get awaken again. */
_ux_host_class_hub_feature(hub, port, UX_CLEAR_FEATURE, UX_HOST_CLASS_HUB_C_PORT_CONNECTION);
#endif
- }
+ }
/* Return to caller. */
return;
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 4bb84448..926d4280 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
@@ -1,18 +1,19 @@
/***************************************************************************
- * Copyright (c) 2024 Microsoft Corporation
- *
+ * Copyright (c) 2024 Microsoft Corporation
+ * Copyright (c) 2026-present Eclipse ThreadX contributors
+ *
* This program and the accompanying materials are made available under the
* terms of the MIT License which is available at
* https://opensource.org/licenses/MIT.
- *
+ *
* SPDX-License-Identifier: MIT
**************************************************************************/
/**************************************************************************/
/**************************************************************************/
-/** */
-/** USBX Component */
+/** */
+/** USBX Component */
/** */
/** HUB Class */
/** */
@@ -29,45 +30,37 @@
#include "ux_host_stack.h"
-/**************************************************************************/
-/* */
-/* FUNCTION RELEASE */
-/* */
-/* _ux_host_class_hub_port_change_enable_process PORTABLE C */
+/**************************************************************************/
+/* */
+/* FUNCTION RELEASE */
+/* */
+/* _ux_host_class_hub_port_change_enable_process PORTABLE C */
/* 6.1 */
/* AUTHOR */
/* */
/* Chaoqiong Xiao, Microsoft Corporation */
/* */
/* DESCRIPTION */
-/* */
-/* This function will process a enable condition change. */
-/* */
-/* INPUT */
-/* */
-/* hub Pointer to HUB class */
-/* port Port number */
-/* port_status Port status */
-/* */
-/* OUTPUT */
-/* */
-/* None */
-/* */
-/* CALLS */
-/* */
-/* _ux_host_class_hub_feature Set HUB feature */
-/* */
-/* CALLED BY */
-/* */
-/* HUB Class */
-/* */
-/* RELEASE HISTORY */
-/* */
-/* DATE NAME DESCRIPTION */
-/* */
-/* 05-19-2020 Chaoqiong Xiao Initial Version 6.0 */
-/* 09-30-2020 Chaoqiong Xiao Modified comment(s), */
-/* resulting in version 6.1 */
+/* */
+/* This function will process a enable condition change. */
+/* */
+/* INPUT */
+/* */
+/* hub Pointer to HUB class */
+/* port Port number */
+/* port_status Port status */
+/* */
+/* OUTPUT */
+/* */
+/* None */
+/* */
+/* CALLS */
+/* */
+/* _ux_host_class_hub_feature Set HUB feature */
+/* */
+/* CALLED BY */
+/* */
+/* HUB Class */
/* */
/**************************************************************************/
VOID _ux_host_class_hub_port_change_enable_process(UX_HOST_CLASS_HUB *hub, UINT port, UINT port_status)
@@ -80,8 +73,8 @@ VOID _ux_host_class_hub_port_change_enable_process(UX_HOST_CLASS_HUB *hub, UINT
/* Here we simply clear the condition so that we don't get awaken again. */
_ux_host_class_hub_feature(hub, port, UX_CLEAR_FEATURE, UX_HOST_CLASS_HUB_C_PORT_ENABLE);
-
+
/* Return to caller. */
return;
-}
+}
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 8280e090..be627b0f 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
@@ -1,18 +1,19 @@
/***************************************************************************
- * Copyright (c) 2024 Microsoft Corporation
- *
+ * Copyright (c) 2024 Microsoft Corporation
+ * Copyright (c) 2026-present Eclipse ThreadX contributors
+ *
* This program and the accompanying materials are made available under the
* terms of the MIT License which is available at
* https://opensource.org/licenses/MIT.
- *
+ *
* SPDX-License-Identifier: MIT
**************************************************************************/
/**************************************************************************/
/**************************************************************************/
-/** */
-/** USBX Component */
+/** */
+/** USBX Component */
/** */
/** HUB Class */
/** */
@@ -29,45 +30,37 @@
#include "ux_host_stack.h"
-/**************************************************************************/
-/* */
-/* FUNCTION RELEASE */
-/* */
-/* _ux_host_class_hub_port_change_over_current_process PORTABLE C */
+/**************************************************************************/
+/* */
+/* FUNCTION RELEASE */
+/* */
+/* _ux_host_class_hub_port_change_over_current_process PORTABLE C */
/* 6.1 */
/* AUTHOR */
/* */
/* Chaoqiong Xiao, Microsoft Corporation */
/* */
/* DESCRIPTION */
-/* */
-/* This function will process a over current condition change. */
-/* */
-/* INPUT */
-/* */
-/* hub Pointer to HUB class */
-/* port Port number */
-/* port_status Port status */
-/* */
-/* OUTPUT */
-/* */
-/* None */
-/* */
-/* CALLS */
-/* */
-/* _ux_host_class_hub_feature Set HUB feature */
-/* */
-/* CALLED BY */
-/* */
-/* HUB Class */
-/* */
-/* RELEASE HISTORY */
-/* */
-/* DATE NAME DESCRIPTION */
-/* */
-/* 05-19-2020 Chaoqiong Xiao Initial Version 6.0 */
-/* 09-30-2020 Chaoqiong Xiao Modified comment(s), */
-/* resulting in version 6.1 */
+/* */
+/* This function will process a over current condition change. */
+/* */
+/* INPUT */
+/* */
+/* hub Pointer to HUB class */
+/* port Port number */
+/* port_status Port status */
+/* */
+/* OUTPUT */
+/* */
+/* None */
+/* */
+/* CALLS */
+/* */
+/* _ux_host_class_hub_feature Set HUB feature */
+/* */
+/* CALLED BY */
+/* */
+/* HUB Class */
/* */
/**************************************************************************/
VOID _ux_host_class_hub_port_change_over_current_process(UX_HOST_CLASS_HUB *hub, UINT port, UINT port_status)
@@ -86,5 +79,5 @@ VOID _ux_host_class_hub_port_change_over_current_process(UX_HOST_CLASS_HUB *hub
/* Return to caller. */
return;
-}
+}
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 32d33548..9538ce4d 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
@@ -1,18 +1,19 @@
/***************************************************************************
- * Copyright (c) 2024 Microsoft Corporation
- *
+ * Copyright (c) 2024 Microsoft Corporation
+ * Copyright (c) 2026-present Eclipse ThreadX contributors
+ *
* This program and the accompanying materials are made available under the
* terms of the MIT License which is available at
* https://opensource.org/licenses/MIT.
- *
+ *
* SPDX-License-Identifier: MIT
**************************************************************************/
/**************************************************************************/
/**************************************************************************/
-/** */
-/** USBX Component */
+/** */
+/** USBX Component */
/** */
/** HUB Class */
/** */
@@ -29,54 +30,46 @@
#include "ux_host_stack.h"
-/**************************************************************************/
-/* */
-/* FUNCTION RELEASE */
-/* */
-/* _ux_host_class_hub_port_change_process PORTABLE C */
+/**************************************************************************/
+/* */
+/* FUNCTION RELEASE */
+/* */
+/* _ux_host_class_hub_port_change_process PORTABLE C */
/* 6.1 */
/* AUTHOR */
/* */
/* Chaoqiong Xiao, Microsoft Corporation */
/* */
/* DESCRIPTION */
-/* */
-/* This function will process a port change indication. */
-/* */
-/* INPUT */
-/* */
-/* hub Pointer to HUB class */
-/* port Port number */
-/* */
-/* OUTPUT */
-/* */
-/* Completion Status */
-/* */
-/* CALLS */
-/* */
-/* _ux_host_class_hub_port_change_connection_process */
-/* Process connection */
-/* _ux_host_class_hub_port_change_enable_process */
-/* Enable process */
-/* _ux_host_class_hub_port_change_over_current_process */
-/* Change over current process */
-/* _ux_host_class_hub_port_change_reset_process */
-/* Reset process */
-/* _ux_host_class_hub_port_change_suspend_process */
-/* Suspend process */
-/* _ux_host_class_hub_status_get Get HUB status */
-/* */
-/* CALLED BY */
-/* */
-/* HUB Class */
-/* */
-/* RELEASE HISTORY */
-/* */
-/* DATE NAME DESCRIPTION */
-/* */
-/* 05-19-2020 Chaoqiong Xiao Initial Version 6.0 */
-/* 09-30-2020 Chaoqiong Xiao Modified comment(s), */
-/* resulting in version 6.1 */
+/* */
+/* This function will process a port change indication. */
+/* */
+/* INPUT */
+/* */
+/* hub Pointer to HUB class */
+/* port Port number */
+/* */
+/* OUTPUT */
+/* */
+/* Completion Status */
+/* */
+/* CALLS */
+/* */
+/* _ux_host_class_hub_port_change_connection_process */
+/* Process connection */
+/* _ux_host_class_hub_port_change_enable_process */
+/* Enable process */
+/* _ux_host_class_hub_port_change_over_current_process */
+/* Change over current process */
+/* _ux_host_class_hub_port_change_reset_process */
+/* Reset process */
+/* _ux_host_class_hub_port_change_suspend_process */
+/* Suspend process */
+/* _ux_host_class_hub_status_get Get HUB status */
+/* */
+/* CALLED BY */
+/* */
+/* HUB Class */
/* */
/**************************************************************************/
UINT _ux_host_class_hub_port_change_process(UX_HOST_CLASS_HUB *hub, UINT port)
@@ -85,30 +78,30 @@ UINT _ux_host_class_hub_port_change_process(UX_HOST_CLASS_HUB *hub, UINT port)
USHORT port_status;
USHORT port_change;
UINT status;
-
+
/* First step is to retrieve the status on the port with a GET_STATUS. */
status = _ux_host_class_hub_status_get(hub, port, &port_status, &port_change);
if (status != UX_SUCCESS)
return(status);
-
- /* On return of the GET_STATUS, the port change field has been updated
+
+ /* On return of the GET_STATUS, the port change field has been updated
check for each of the bits it may contain. */
if (port_change & UX_HOST_CLASS_HUB_PORT_CHANGE_CONNECTION)
- _ux_host_class_hub_port_change_connection_process(hub, port, port_status);
+ _ux_host_class_hub_port_change_connection_process(hub, port, port_status);
if (port_change & UX_HOST_CLASS_HUB_PORT_CHANGE_ENABLE)
- _ux_host_class_hub_port_change_enable_process(hub, port, port_status);
+ _ux_host_class_hub_port_change_enable_process(hub, port, port_status);
if (port_change & UX_HOST_CLASS_HUB_PORT_CHANGE_SUSPEND)
- _ux_host_class_hub_port_change_suspend_process(hub, port, port_status);
+ _ux_host_class_hub_port_change_suspend_process(hub, port, port_status);
if (port_change & UX_HOST_CLASS_HUB_PORT_CHANGE_OVER_CURRENT)
- _ux_host_class_hub_port_change_over_current_process(hub, port, port_status);
+ _ux_host_class_hub_port_change_over_current_process(hub, port, port_status);
if (port_change & UX_HOST_CLASS_HUB_PORT_CHANGE_RESET)
- _ux_host_class_hub_port_change_reset_process(hub, port, port_status);
-
+ _ux_host_class_hub_port_change_reset_process(hub, port, port_status);
+
/* Return successful completion. */
return(UX_SUCCESS);
}
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 cc31c061..01af42d7 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
@@ -1,18 +1,19 @@
/***************************************************************************
- * Copyright (c) 2024 Microsoft Corporation
- *
+ * Copyright (c) 2024 Microsoft Corporation
+ * Copyright (c) 2026-present Eclipse ThreadX contributors
+ *
* This program and the accompanying materials are made available under the
* terms of the MIT License which is available at
* https://opensource.org/licenses/MIT.
- *
+ *
* SPDX-License-Identifier: MIT
**************************************************************************/
/**************************************************************************/
/**************************************************************************/
-/** */
-/** USBX Component */
+/** */
+/** USBX Component */
/** */
/** HUB Class */
/** */
@@ -29,45 +30,37 @@
#include "ux_host_stack.h"
-/**************************************************************************/
-/* */
-/* FUNCTION RELEASE */
-/* */
-/* _ux_host_class_hub_port_change_reset_process PORTABLE C */
+/**************************************************************************/
+/* */
+/* FUNCTION RELEASE */
+/* */
+/* _ux_host_class_hub_port_change_reset_process PORTABLE C */
/* 6.1 */
/* AUTHOR */
/* */
/* Chaoqiong Xiao, Microsoft Corporation */
/* */
/* DESCRIPTION */
-/* */
-/* This function will process a reset condition change. */
-/* */
-/* INPUT */
-/* */
-/* hub Pointer to HUB class */
-/* port Port number */
-/* port_status Status of port */
-/* */
-/* OUTPUT */
-/* */
-/* None */
-/* */
-/* CALLS */
-/* */
-/* _ux_host_class_hub_feature Set HUB class feature */
-/* */
-/* CALLED BY */
-/* */
-/* HUB Class */
-/* */
-/* RELEASE HISTORY */
-/* */
-/* DATE NAME DESCRIPTION */
-/* */
-/* 05-19-2020 Chaoqiong Xiao Initial Version 6.0 */
-/* 09-30-2020 Chaoqiong Xiao Modified comment(s), */
-/* resulting in version 6.1 */
+/* */
+/* This function will process a reset condition change. */
+/* */
+/* INPUT */
+/* */
+/* hub Pointer to HUB class */
+/* port Port number */
+/* port_status Status of port */
+/* */
+/* OUTPUT */
+/* */
+/* None */
+/* */
+/* CALLS */
+/* */
+/* _ux_host_class_hub_feature Set HUB class feature */
+/* */
+/* CALLED BY */
+/* */
+/* HUB Class */
/* */
/**************************************************************************/
VOID _ux_host_class_hub_port_change_reset_process(UX_HOST_CLASS_HUB *hub, UINT port, UINT port_status)
@@ -84,4 +77,4 @@ VOID _ux_host_class_hub_port_change_reset_process(UX_HOST_CLASS_HUB *hub, UINT
/* Return to caller. */
return;
}
-
+
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 b83ab88b..0e6a1f80 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
@@ -1,18 +1,19 @@
/***************************************************************************
- * Copyright (c) 2024 Microsoft Corporation
- *
+ * Copyright (c) 2024 Microsoft Corporation
+ * Copyright (c) 2026-present Eclipse ThreadX contributors
+ *
* This program and the accompanying materials are made available under the
* terms of the MIT License which is available at
* https://opensource.org/licenses/MIT.
- *
+ *
* SPDX-License-Identifier: MIT
**************************************************************************/
/**************************************************************************/
/**************************************************************************/
-/** */
-/** USBX Component */
+/** */
+/** USBX Component */
/** */
/** HUB Class */
/** */
@@ -29,45 +30,37 @@
#include "ux_host_stack.h"
-/**************************************************************************/
-/* */
-/* FUNCTION RELEASE */
-/* */
-/* _ux_host_class_hub_port_change_suspend_process PORTABLE C */
+/**************************************************************************/
+/* */
+/* FUNCTION RELEASE */
+/* */
+/* _ux_host_class_hub_port_change_suspend_process PORTABLE C */
/* 6.1 */
/* AUTHOR */
/* */
/* Chaoqiong Xiao, Microsoft Corporation */
/* */
/* DESCRIPTION */
-/* */
-/* This function will process a suspend condition change. */
-/* */
-/* INPUT */
-/* */
-/* hub Pointer to HUB class */
-/* port Port number */
-/* port_status Status of port */
-/* */
-/* OUTPUT */
-/* */
-/* None */
-/* */
-/* CALLS */
-/* */
-/* _ux_host_class_hub_feature Set HUB class feature */
-/* */
-/* CALLED BY */
-/* */
-/* HUB Class */
-/* */
-/* RELEASE HISTORY */
-/* */
-/* DATE NAME DESCRIPTION */
-/* */
-/* 05-19-2020 Chaoqiong Xiao Initial Version 6.0 */
-/* 09-30-2020 Chaoqiong Xiao Modified comment(s), */
-/* resulting in version 6.1 */
+/* */
+/* This function will process a suspend condition change. */
+/* */
+/* INPUT */
+/* */
+/* hub Pointer to HUB class */
+/* port Port number */
+/* port_status Status of port */
+/* */
+/* OUTPUT */
+/* */
+/* None */
+/* */
+/* CALLS */
+/* */
+/* _ux_host_class_hub_feature Set HUB class feature */
+/* */
+/* CALLED BY */
+/* */
+/* HUB Class */
/* */
/**************************************************************************/
VOID _ux_host_class_hub_port_change_suspend_process(UX_HOST_CLASS_HUB *hub, UINT port, UINT port_status)
@@ -83,5 +76,5 @@ VOID _ux_host_class_hub_port_change_suspend_process(UX_HOST_CLASS_HUB *hub, UIN
/* Return to caller. */
return;
-}
+}
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 c9fd6e99..027fc773 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
@@ -1,18 +1,19 @@
/***************************************************************************
- * Copyright (c) 2024 Microsoft Corporation
- *
+ * Copyright (c) 2024 Microsoft Corporation
+ * Copyright (c) 2026-present Eclipse ThreadX contributors
+ *
* This program and the accompanying materials are made available under the
* terms of the MIT License which is available at
* https://opensource.org/licenses/MIT.
- *
+ *
* SPDX-License-Identifier: MIT
**************************************************************************/
/**************************************************************************/
/**************************************************************************/
-/** */
-/** USBX Component */
+/** */
+/** USBX Component */
/** */
/** HUB Class */
/** */
@@ -29,55 +30,47 @@
#include "ux_host_stack.h"
-/**************************************************************************/
-/* */
-/* FUNCTION RELEASE */
-/* */
-/* _ux_host_class_hub_port_reset PORTABLE C */
+/**************************************************************************/
+/* */
+/* FUNCTION RELEASE */
+/* */
+/* _ux_host_class_hub_port_reset PORTABLE C */
/* 6.1 */
/* AUTHOR */
/* */
/* Chaoqiong Xiao, Microsoft Corporation */
/* */
/* DESCRIPTION */
-/* */
-/* This function will reset a downstream port of the HUB. When the */
-/* port is reset, the hardware logic of the HUB also enables it. */
-/* */
-/* INPUT */
-/* */
-/* hub Pointer to HUB class */
-/* port Port number */
-/* */
-/* OUTPUT */
-/* */
-/* Completion Status */
-/* */
-/* CALLS */
-/* */
-/* _ux_host_class_hub_port_change_reset_process Reset HUB */
-/* _ux_host_class_hub_feature Set HUB class feature */
-/* _ux_host_class_hub_status_get Get HUB status */
-/* _ux_utility_delay_ms Thread sleep */
-/* */
-/* CALLED BY */
-/* */
-/* HUB Class */
-/* */
-/* RELEASE HISTORY */
-/* */
-/* DATE NAME DESCRIPTION */
-/* */
-/* 05-19-2020 Chaoqiong Xiao Initial Version 6.0 */
-/* 09-30-2020 Chaoqiong Xiao Modified comment(s), */
-/* resulting in version 6.1 */
+/* */
+/* This function will reset a downstream port of the HUB. When the */
+/* port is reset, the hardware logic of the HUB also enables it. */
+/* */
+/* INPUT */
+/* */
+/* hub Pointer to HUB class */
+/* port Port number */
+/* */
+/* OUTPUT */
+/* */
+/* Completion Status */
+/* */
+/* CALLS */
+/* */
+/* _ux_host_class_hub_port_change_reset_process Reset HUB */
+/* _ux_host_class_hub_feature Set HUB class feature */
+/* _ux_host_class_hub_status_get Get HUB status */
+/* _ux_utility_delay_ms Thread sleep */
+/* */
+/* CALLED BY */
+/* */
+/* HUB Class */
/* */
/**************************************************************************/
UINT _ux_host_class_hub_port_reset(UX_HOST_CLASS_HUB *hub, UINT port)
{
UINT status;
-UINT port_enable_retry;
+UINT port_enable_retry;
USHORT port_status;
USHORT port_change;
@@ -99,16 +92,16 @@ USHORT port_change;
status = _ux_host_class_hub_status_get(hub, port, &port_status, &port_change);
if (status != UX_SUCCESS)
return(status);
-
- /* On return of the GET_STATUS, the port_change field has been updated.
+
+ /* On return of the GET_STATUS, the port_change field has been updated.
Check for each of the bits it may contain. */
if (port_change & UX_HOST_CLASS_HUB_PORT_CHANGE_RESET)
{
-
+
/* The port has been successfully reset. */
/* Clear the RESET change bit. */
- _ux_host_class_hub_port_change_reset_process(hub, port, port_status);
+ _ux_host_class_hub_port_change_reset_process(hub, port, port_status);
/* Return success. */
return(UX_SUCCESS);
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 2ffb6d50..72b76d3e 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
@@ -1,18 +1,19 @@
/***************************************************************************
- * Copyright (c) 2024 Microsoft Corporation
- *
+ * Copyright (c) 2024 Microsoft Corporation
+ * Copyright (c) 2026-present Eclipse ThreadX contributors
+ *
* This program and the accompanying materials are made available under the
* terms of the MIT License which is available at
* https://opensource.org/licenses/MIT.
- *
+ *
* SPDX-License-Identifier: MIT
**************************************************************************/
/**************************************************************************/
/**************************************************************************/
-/** */
-/** USBX Component */
+/** */
+/** USBX Component */
/** */
/** HUB Class */
/** */
@@ -29,59 +30,51 @@
#include "ux_host_stack.h"
-/**************************************************************************/
-/* */
-/* FUNCTION RELEASE */
-/* */
-/* _ux_host_class_hub_ports_power PORTABLE C */
+/**************************************************************************/
+/* */
+/* FUNCTION RELEASE */
+/* */
+/* _ux_host_class_hub_ports_power PORTABLE C */
/* 6.1 */
/* AUTHOR */
/* */
/* Chaoqiong Xiao, Microsoft Corporation */
/* */
/* DESCRIPTION */
-/* */
+/* */
/* This function will power up each downstream port attached to the */
-/* HUB. There is a delay after powering up each port, otherwise we may */
+/* HUB. There is a delay after powering up each port, otherwise we may */
/* not detect device insertion. */
/* */
/* There are 3 port power modes: */
/* */
-/* 1) Gang power: In this case we only power the first */
-/* port and all ports should be powered at */
+/* 1) Gang power: In this case we only power the first */
+/* port and all ports should be powered at */
/* the same time */
/* */
-/* 2) Individual power: In this case we power individually each */
+/* 2) Individual power: In this case we power individually each */
/* port */
/* */
/* 3) No power switching: In this case the power is applied to the */
/* downstream ports when the upstream port */
-/* receives power. */
-/* */
-/* INPUT */
-/* */
-/* hub Pointer to HUB class */
-/* */
-/* OUTPUT */
-/* */
-/* Completion Status */
-/* */
-/* CALLS */
-/* */
-/* _ux_host_class_hub_feature Set HUB class feature */
-/* _ux_utility_delay_ms Thread sleep */
-/* */
-/* CALLED BY */
-/* */
-/* HUB Class */
-/* */
-/* RELEASE HISTORY */
-/* */
-/* DATE NAME DESCRIPTION */
-/* */
-/* 05-19-2020 Chaoqiong Xiao Initial Version 6.0 */
-/* 09-30-2020 Chaoqiong Xiao Modified comment(s), */
-/* resulting in version 6.1 */
+/* receives power. */
+/* */
+/* INPUT */
+/* */
+/* hub Pointer to HUB class */
+/* */
+/* OUTPUT */
+/* */
+/* Completion Status */
+/* */
+/* CALLS */
+/* */
+/* _ux_host_class_hub_feature Set HUB class feature */
+/* _ux_utility_delay_ms Thread sleep */
+/* */
+/* CALLED BY */
+/* */
+/* HUB Class */
/* */
/**************************************************************************/
UINT _ux_host_class_hub_ports_power(UX_HOST_CLASS_HUB *hub)
@@ -90,7 +83,7 @@ UINT _ux_host_class_hub_ports_power(UX_HOST_CLASS_HUB *hub)
UINT nb_ports;
UINT port_index;
UINT status;
-
+
/* Check for the power management mode: no power switching. */
if(hub -> ux_host_class_hub_descriptor.wHubCharacteristics & UX_HOST_CLASS_HUB_NO_POWER_SWITCHING)
@@ -116,10 +109,10 @@ UINT status;
}
else
{
-
+
/* Now we need to wait for the power to be stable. */
_ux_utility_delay_ms(((ULONG) (hub -> ux_host_class_hub_descriptor.bPwrOn2PwrGood) * 2));
-
+
/* Set the HUB status to powered. */
hub -> ux_host_class_hub_port_power |= (UINT)(1 << port_index);
}
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 42278d1a..14332c3b 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
@@ -1,18 +1,19 @@
/***************************************************************************
- * Copyright (c) 2024 Microsoft Corporation
- *
+ * Copyright (c) 2024 Microsoft Corporation
+ * Copyright (c) 2026-present Eclipse ThreadX contributors
+ *
* This program and the accompanying materials are made available under the
* terms of the MIT License which is available at
* https://opensource.org/licenses/MIT.
- *
+ *
* SPDX-License-Identifier: MIT
**************************************************************************/
/**************************************************************************/
/**************************************************************************/
-/** */
-/** USBX Component */
+/** */
+/** USBX Component */
/** */
/** HUB Class */
/** */
@@ -29,58 +30,47 @@
#include "ux_host_stack.h"
-/**************************************************************************/
-/* */
-/* FUNCTION RELEASE */
-/* */
-/* _ux_host_class_hub_status_get PORTABLE C */
+/**************************************************************************/
+/* */
+/* FUNCTION RELEASE */
+/* */
+/* _ux_host_class_hub_status_get PORTABLE C */
/* 6.1.12 */
/* AUTHOR */
/* */
/* Chaoqiong Xiao, Microsoft Corporation */
/* */
/* DESCRIPTION */
-/* */
-/* This function will do a GET_STATUS from the HUB. This function */
-/* retrieves the current status and the changed bits. */
+/* */
+/* This function will do a GET_STATUS from the HUB. This function */
+/* retrieves the current status and the changed bits. */
/* */
/* In standalone mode, this functioin prepares the control transfer */
/* request data memory and request context of specific command, for */
/* host stack transfer function to process, in next steps. The */
/* allocated memory must be freed after transfer request is processed. */
-/* */
-/* INPUT */
-/* */
-/* hub Pointer to HUB class */
-/* port Port of device */
-/* port_status Destination for port status */
-/* port_change Destination for port change */
-/* */
-/* OUTPUT */
-/* */
-/* Completion Status */
-/* */
-/* CALLS */
-/* */
-/* _ux_host_stack_transfer_request Process transfer request */
-/* _ux_utility_memory_allocate Allocate memory block */
-/* _ux_utility_memory_free Release memory block */
-/* _ux_utility_short_get Get 16-bit word */
-/* */
-/* CALLED BY */
-/* */
-/* HUB Class */
-/* */
-/* RELEASE HISTORY */
-/* */
-/* DATE NAME DESCRIPTION */
-/* */
-/* 05-19-2020 Chaoqiong Xiao Initial Version 6.0 */
-/* 09-30-2020 Chaoqiong Xiao Modified comment(s), */
-/* resulting in version 6.1 */
-/* 07-29-2022 Chaoqiong Xiao Modified comment(s), */
-/* added standalone support, */
-/* resulting in version 6.1.12 */
+/* */
+/* INPUT */
+/* */
+/* hub Pointer to HUB class */
+/* port Port of device */
+/* port_status Destination for port status */
+/* port_change Destination for port change */
+/* */
+/* OUTPUT */
+/* */
+/* Completion Status */
+/* */
+/* CALLS */
+/* */
+/* _ux_host_stack_transfer_request Process transfer request */
+/* _ux_utility_memory_allocate Allocate memory block */
+/* _ux_utility_memory_free Release memory block */
+/* _ux_utility_short_get Get 16-bit word */
+/* */
+/* CALLED BY */
+/* */
+/* HUB Class */
/* */
/**************************************************************************/
UINT _ux_host_class_hub_status_get(UX_HOST_CLASS_HUB *hub, UINT port, USHORT *port_status, USHORT *port_change)
@@ -99,11 +89,11 @@ UINT status;
/* The target is DEVICE for the HUB and OTHER for the downstream ports. */
if (port == 0)
- target = UX_REQUEST_TARGET_DEVICE;
+ target = UX_REQUEST_TARGET_DEVICE;
else
target = UX_REQUEST_TARGET_OTHER;
- /* Allocate a buffer for the port status and change: 2 words. */
+ /* Allocate a buffer for the port status and change: 2 words. */
port_data = _ux_utility_memory_allocate(UX_SAFE_ALIGN, UX_CACHE_SAFE_MEMORY, 4);
if(port_data == UX_NULL)
return(UX_MEMORY_INSUFFICIENT);
diff --git a/common/usbx_host_classes/src/ux_host_class_hub_tasks_run.c b/common/usbx_host_classes/src/ux_host_class_hub_tasks_run.c
index 88e3639c..d06331c4 100644
--- a/common/usbx_host_classes/src/ux_host_class_hub_tasks_run.c
+++ b/common/usbx_host_classes/src/ux_host_class_hub_tasks_run.c
@@ -1,10 +1,11 @@
/***************************************************************************
- * Copyright (c) 2024 Microsoft Corporation
- *
+ * Copyright (c) 2024 Microsoft Corporation
+ * Copyright (c) 2026-present Eclipse ThreadX contributors
+ *
* This program and the accompanying materials are made available under the
* terms of the MIT License which is available at
* https://opensource.org/licenses/MIT.
- *
+ *
* SPDX-License-Identifier: MIT
**************************************************************************/
@@ -81,19 +82,6 @@ static inline VOID _ux_host_class_hub_inst_tasks_run(UX_HOST_CLASS_HUB *hub);
/* */
/* USBX Host Stack */
/* */
-/* RELEASE HISTORY */
-/* */
-/* DATE NAME DESCRIPTION */
-/* */
-/* 07-29-2022 Chaoqiong Xiao Initial Version 6.1.12 */
-/* 10-31-2022 Chaoqiong Xiao Modified comment(s), */
-/* fixed reset speed handling, */
-/* resulting in version 6.2.0 */
-/* 03-08-2023 Chaoqiong Xiao Modified comment(s), */
-/* fixed compile issue if only */
-/* one device is supported, */
-/* resulting in version 6.2.1 */
-/* */
/**************************************************************************/
UINT _ux_host_class_hub_tasks_run(UX_HOST_CLASS *hub_class)
{
diff --git a/common/usbx_host_classes/src/ux_host_class_hub_transfer_request_completed.c b/common/usbx_host_classes/src/ux_host_class_hub_transfer_request_completed.c
index ab386c77..d0dc1cd0 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
@@ -1,18 +1,19 @@
/***************************************************************************
- * Copyright (c) 2024 Microsoft Corporation
- *
+ * Copyright (c) 2024 Microsoft Corporation
+ * Copyright (c) 2026-present Eclipse ThreadX contributors
+ *
* This program and the accompanying materials are made available under the
* terms of the MIT License which is available at
* https://opensource.org/licenses/MIT.
- *
+ *
* SPDX-License-Identifier: MIT
**************************************************************************/
/**************************************************************************/
/**************************************************************************/
-/** */
-/** USBX Component */
+/** */
+/** USBX Component */
/** */
/** HUB Class */
/** */
@@ -29,25 +30,25 @@
#include "ux_host_class_hub.h"
-/**************************************************************************/
-/* */
-/* FUNCTION RELEASE */
-/* */
-/* _ux_host_class_hub_transfer_request_completed PORTABLE C */
+/**************************************************************************/
+/* */
+/* FUNCTION RELEASE */
+/* */
+/* _ux_host_class_hub_transfer_request_completed PORTABLE C */
/* 6.1.12 */
/* AUTHOR */
/* */
/* Chaoqiong Xiao, Microsoft Corporation */
/* */
/* DESCRIPTION */
-/* */
-/* This function is called by the completion thread when a transfer */
-/* request has been completed either because the transfer is */
+/* */
+/* This function is called by the completion thread when a transfer */
+/* request has been completed either because the transfer is */
/* successful or there was an error. */
/* */
/* Because the HUB influences the topology of the USB, the insertion */
-/* or extraction of devices cannot be done during the transfer request */
-/* thread. We post a signal to the topology thread to wake up and */
+/* or extraction of devices cannot be done during the transfer request */
+/* thread. We post a signal to the topology thread to wake up and */
/* treat these changes on the HUB status. */
/* */
/* In RTOS mode, the interrupt pipe is not reactivated here. We will */
@@ -56,36 +57,22 @@
/* */
/* In standalone mode, the interrupt pipe is reactivated here. The */
/* bitmap in buffer is examined in hub tasks function. */
-/* */
-/* INPUT */
-/* */
-/* transfer_request Pointer to transfer request */
-/* */
-/* OUTPUT */
-/* */
-/* None */
-/* */
-/* CALLS */
-/* */
-/* _ux_host_semaphore_put Put the signaling semaphore */
-/* */
-/* CALLED BY */
-/* */
-/* HUB Class */
-/* */
-/* RELEASE HISTORY */
-/* */
-/* DATE NAME DESCRIPTION */
-/* */
-/* 05-19-2020 Chaoqiong Xiao Initial Version 6.0 */
-/* 09-30-2020 Chaoqiong Xiao Modified comment(s), */
-/* resulting in version 6.1 */
-/* 01-31-2022 Chaoqiong Xiao Modified comment(s), */
-/* refined macros names, */
-/* resulting in version 6.1.10 */
-/* 07-29-2022 Chaoqiong Xiao Modified comment(s), */
-/* added standalone support, */
-/* resulting in version 6.1.12 */
+/* */
+/* INPUT */
+/* */
+/* transfer_request Pointer to transfer request */
+/* */
+/* OUTPUT */
+/* */
+/* None */
+/* */
+/* CALLS */
+/* */
+/* _ux_host_semaphore_put Put the signaling semaphore */
+/* */
+/* CALLED BY */
+/* */
+/* HUB Class */
/* */
/**************************************************************************/
VOID _ux_host_class_hub_transfer_request_completed(UX_TRANSFER *transfer_request)
@@ -104,7 +91,7 @@ UX_HOST_CLASS_HUB *hub;
/* We have an error. We do not rehook another transfer if the device instance is shutting down or
if the transfer was aborted by the class. */
- if ((hub -> ux_host_class_hub_state == UX_HOST_CLASS_INSTANCE_SHUTDOWN) ||
+ if ((hub -> ux_host_class_hub_state == UX_HOST_CLASS_INSTANCE_SHUTDOWN) ||
(transfer_request -> ux_transfer_request_completion_code == UX_TRANSFER_STATUS_ABORT) ||
(transfer_request -> ux_transfer_request_completion_code == UX_TRANSFER_NO_ANSWER))
@@ -112,14 +99,14 @@ UX_HOST_CLASS_HUB *hub;
return;
else
- {
+ {
/* Reactivate the HUB interrupt pipe. */
_ux_host_stack_transfer_request(transfer_request);
-
+
/* We do not proceed. */
- return;
- }
+ return;
+ }
}
#if defined(UX_HOST_STANDALONE)
@@ -130,7 +117,7 @@ UX_HOST_CLASS_HUB *hub;
/* We need to memorize which HUB instance has received a change signal. */
hub -> ux_host_class_hub_change_semaphore++;
-
+
/* Now we can set the semaphore, the enum thread will wake up and will
call the HUB instance which has a status change. */
_ux_host_semaphore_put(&_ux_system_host -> ux_system_host_enum_semaphore);
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 dc54949a..471e45e7 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
@@ -1,18 +1,19 @@
/***************************************************************************
- * Copyright (c) 2024 Microsoft Corporation
- *
+ * Copyright (c) 2024 Microsoft Corporation
+ * Copyright (c) 2026-present Eclipse ThreadX contributors
+ *
* This program and the accompanying materials are made available under the
* terms of the MIT License which is available at
* https://opensource.org/licenses/MIT.
- *
+ *
* SPDX-License-Identifier: MIT
**************************************************************************/
/**************************************************************************/
/**************************************************************************/
-/** */
-/** USBX Component */
+/** */
+/** USBX Component */
/** */
/** PIMA Class */
/** */
@@ -29,52 +30,40 @@
#include "ux_host_stack.h"
-/**************************************************************************/
-/* */
-/* FUNCTION RELEASE */
-/* */
-/* _ux_host_class_pima_activate PORTABLE C */
+/**************************************************************************/
+/* */
+/* FUNCTION RELEASE */
+/* */
+/* _ux_host_class_pima_activate PORTABLE C */
/* 6.1.12 */
/* AUTHOR */
/* */
/* Chaoqiong Xiao, Microsoft Corporation */
/* */
/* DESCRIPTION */
-/* */
-/* This function creates the ACM instance, configure the device ... */
-/* */
-/* INPUT */
-/* */
-/* command Pima class command pointer */
-/* */
-/* OUTPUT */
-/* */
-/* Completion Status */
-/* */
-/* CALLS */
-/* */
-/* _ux_host_class_pima_configure Configure pima class */
-/* _ux_host_class_pima_endpoints_get Get endpoints of pima */
-/* _ux_host_stack_class_instance_create Create class instance */
-/* _ux_host_stack_class_instance_destroy Destroy the class instance */
-/* _ux_utility_memory_allocate Allocate memory block */
-/* _ux_utility_memory_free Free memory block */
-/* */
-/* CALLED BY */
-/* */
-/* _ux_host_class_pima_entry Entry of pima class */
-/* */
-/* RELEASE HISTORY */
-/* */
-/* DATE NAME DESCRIPTION */
-/* */
-/* 05-19-2020 Chaoqiong Xiao Initial Version 6.0 */
-/* 09-30-2020 Chaoqiong Xiao Modified comment(s), */
-/* resulting in version 6.1 */
-/* 07-29-2022 Chaoqiong Xiao Modified comment(s), */
-/* fixed parameter/variable */
-/* names conflict C++ keyword, */
-/* resulting in version 6.1.12 */
+/* */
+/* This function creates the ACM instance, configure the device ... */
+/* */
+/* INPUT */
+/* */
+/* command Pima class command pointer */
+/* */
+/* OUTPUT */
+/* */
+/* Completion Status */
+/* */
+/* CALLS */
+/* */
+/* _ux_host_class_pima_configure Configure pima class */
+/* _ux_host_class_pima_endpoints_get Get endpoints of pima */
+/* _ux_host_stack_class_instance_create Create class instance */
+/* _ux_host_stack_class_instance_destroy Destroy the class instance */
+/* _ux_utility_memory_allocate Allocate memory block */
+/* _ux_utility_memory_free Free memory block */
+/* */
+/* CALLED BY */
+/* */
+/* _ux_host_class_pima_entry Entry of pima class */
/* */
/**************************************************************************/
UINT _ux_host_class_pima_activate(UX_HOST_CLASS_COMMAND *command)
@@ -147,7 +136,7 @@ UINT status;
if a function has been programmed in the system structure. */
if (_ux_system_host -> ux_system_host_change_function != UX_NULL)
{
-
+
/* Call system change function. */
_ux_system_host -> ux_system_host_change_function(UX_DEVICE_INSERTION, pima -> ux_host_class_pima_class, (VOID *) pima);
}
@@ -176,6 +165,6 @@ UINT status;
_ux_utility_memory_free(pima);
/* Return completion status. */
- return(status);
+ return(status);
}
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 ae459170..0e783a29 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
@@ -1,10 +1,11 @@
/***************************************************************************
- * Copyright (c) 2024 Microsoft Corporation
- *
+ * Copyright (c) 2024 Microsoft Corporation
+ * Copyright (c) 2026-present Eclipse ThreadX contributors
+ *
* This program and the accompanying materials are made available under the
* terms of the MIT License which is available at
* https://opensource.org/licenses/MIT.
- *
+ *
* SPDX-License-Identifier: MIT
**************************************************************************/
@@ -67,20 +68,6 @@
/* */
/* Application */
/* */
-/* RELEASE HISTORY */
-/* */
-/* 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 */
-/* 01-31-2022 Chaoqiong Xiao Modified comment(s), */
-/* refined macros names, */
-/* resulting in version 6.1.10 */
-/* 10-31-2023 Yajun xia Modified comment(s), */
-/* resulting in version 6.3.0 */
-/* */
/**************************************************************************/
UINT _ux_host_class_pima_command(UX_HOST_CLASS_PIMA *pima, UX_HOST_CLASS_PIMA_COMMAND *command,
ULONG direction, UCHAR *data_buffer, ULONG data_length,
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 02aebc47..cbc9e1d6 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
@@ -1,18 +1,19 @@
/***************************************************************************
- * Copyright (c) 2024 Microsoft Corporation
- *
+ * Copyright (c) 2024 Microsoft Corporation
+ * Copyright (c) 2026-present Eclipse ThreadX contributors
+ *
* This program and the accompanying materials are made available under the
* terms of the MIT License which is available at
* https://opensource.org/licenses/MIT.
- *
+ *
* SPDX-License-Identifier: MIT
**************************************************************************/
/**************************************************************************/
/**************************************************************************/
-/** */
-/** USBX Component */
+/** */
+/** USBX Component */
/** */
/** PIMA Class */
/** */
@@ -29,50 +30,40 @@
#include "ux_host_stack.h"
-/**************************************************************************/
-/* */
-/* FUNCTION RELEASE */
-/* */
-/* _ux_host_class_pima_configure PORTABLE C */
+/**************************************************************************/
+/* */
+/* FUNCTION RELEASE */
+/* */
+/* _ux_host_class_pima_configure PORTABLE C */
/* 6.1 */
/* AUTHOR */
/* */
/* Chaoqiong Xiao, Microsoft Corporation */
/* */
/* DESCRIPTION */
-/* */
+/* */
/* This function calls the USBX stack to do a SET_CONFIGURATION to the */
-/* pima. Once the pima is configured, its interface will be */
-/* activated. The bulk endpoints (1 IN, 1 OUT ) and the interrupt */
-/* endpoint are enumerated. */
-/* */
-/* INPUT */
-/* */
-/* pima Pointer to pima class */
-/* */
-/* OUTPUT */
-/* */
-/* Completion Status */
-/* */
-/* CALLS */
-/* */
-/* _ux_host_stack_configuration_interface_get Get interface */
-/* _ux_host_stack_device_configuration_get Get configuration */
-/* _ux_host_stack_device_configuration_select Select configuration */
-/* */
-/* CALLED BY */
-/* */
-/* _ux_host_class_pima_activate Pima class activate */
-/* */
-/* 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 */
+/* pima. Once the pima is configured, its interface will be */
+/* activated. The bulk endpoints (1 IN, 1 OUT ) and the interrupt */
+/* endpoint are enumerated. */
+/* */
+/* INPUT */
+/* */
+/* pima Pointer to pima class */
+/* */
+/* OUTPUT */
+/* */
+/* Completion Status */
+/* */
+/* CALLS */
+/* */
+/* _ux_host_stack_configuration_interface_get Get interface */
+/* _ux_host_stack_device_configuration_get Get configuration */
+/* _ux_host_stack_device_configuration_select Select configuration */
+/* */
+/* CALLED BY */
+/* */
+/* _ux_host_class_pima_activate Pima class activate */
/* */
/**************************************************************************/
UINT _ux_host_class_pima_configure(UX_HOST_CLASS_PIMA *pima)
@@ -101,23 +92,23 @@ UX_DEVICE *parent_device;
/* If trace is enabled, insert this event into the trace buffer. */
UX_TRACE_IN_LINE_INSERT(UX_TRACE_ERROR, UX_CONFIGURATION_HANDLE_UNKNOWN, pima -> ux_host_class_pima_device, 0, 0, UX_TRACE_ERRORS, 0, 0)
-
+
return(UX_CONFIGURATION_HANDLE_UNKNOWN);
}
#if UX_MAX_DEVICES > 1
- /* Check the pima power source and check the parent power source for
+ /* 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)
{
/* Get parent device pointer. */
parent_device = pima -> ux_host_class_pima_device -> ux_device_parent;
-
- /* If the device is NULL, the parent is the root pima and we don't have to worry
+
+ /* If the device is NULL, the parent is the root pima and we don't have to worry
if the parent is not the root pima, check for its power source. */
if ((parent_device != UX_NULL) && (parent_device -> ux_device_power_source == UX_DEVICE_BUS_POWERED))
- {
+ {
/* Error trap. */
_ux_system_error_handler(UX_SYSTEM_LEVEL_THREAD, UX_SYSTEM_CONTEXT_CLASS, UX_CONNECTION_INCOMPATIBLE);
@@ -126,24 +117,24 @@ UX_DEVICE *parent_device;
UX_TRACE_IN_LINE_INSERT(UX_TRACE_ERROR, UX_CONNECTION_INCOMPATIBLE, pima, 0, 0, UX_TRACE_ERRORS, 0, 0)
return(UX_CONNECTION_INCOMPATIBLE);
- }
+ }
}
#endif
- /* We have the valid configuration. Ask the USBX stack to set this configuration. */
+ /* 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)
return(status);
- /* If the operation went well, the pima default alternate setting for the pima interface is
- active and the interrupt endpoint is now enabled. We have to memorize the first interface since
+ /* If the operation went well, the pima default alternate setting for the pima interface is
+ active and the interrupt endpoint is now enabled. We have to memorize the first interface since
the interrupt endpoint is hooked to it. */
status = _ux_host_stack_configuration_interface_get(configuration, 0, 0, &pima -> ux_host_class_pima_interface);
if (status != UX_SUCCESS)
{
/* Store the instance in the interface container, this is for the USB stack
- when it needs to invoke the class. */
+ when it needs to invoke the class. */
pima -> ux_host_class_pima_interface -> ux_interface_class_instance = (VOID *) pima;
}
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 ac4d1c42..ee900537 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
@@ -1,18 +1,19 @@
/***************************************************************************
- * Copyright (c) 2024 Microsoft Corporation
- *
+ * Copyright (c) 2024 Microsoft Corporation
+ * Copyright (c) 2026-present Eclipse ThreadX contributors
+ *
* This program and the accompanying materials are made available under the
* terms of the MIT License which is available at
* https://opensource.org/licenses/MIT.
- *
+ *
* SPDX-License-Identifier: MIT
**************************************************************************/
/**************************************************************************/
/**************************************************************************/
-/** */
-/** USBX Component */
+/** */
+/** USBX Component */
/** */
/** PIMA Class */
/** */
@@ -29,54 +30,39 @@
#include "ux_host_stack.h"
-/**************************************************************************/
-/* */
-/* FUNCTION RELEASE */
-/* */
-/* _ux_host_class_pima_deactivate PORTABLE C */
+/**************************************************************************/
+/* */
+/* FUNCTION RELEASE */
+/* */
+/* _ux_host_class_pima_deactivate PORTABLE C */
/* 6.3.0 */
/* AUTHOR */
/* */
/* Chaoqiong Xiao, Microsoft Corporation */
/* */
/* DESCRIPTION */
-/* */
+/* */
/* This function is called when this instance of the pima has been */
-/* removed from the bus either directly or indirectly. The bulk in\out */
-/* and interrupt pipes will be destroyed and the instance removed. */
-/* */
-/* INPUT */
-/* */
-/* command PIMA class command pointer */
-/* */
-/* OUTPUT */
-/* */
-/* Completion Status */
-/* */
-/* CALLS */
-/* */
-/* _ux_host_stack_class_instance_destroy Destroy the class instance */
-/* _ux_host_stack_endpoint_transfer_abort Abort endpoint transfer */
-/* _ux_utility_memory_free Free memory block */
-/* */
-/* CALLED BY */
-/* */
-/* _ux_host_class_pima_entry Entry of pima class */
-/* */
-/* RELEASE HISTORY */
-/* */
-/* DATE NAME DESCRIPTION */
-/* */
-/* 05-19-2020 Chaoqiong Xiao Initial Version 6.0 */
-/* 09-30-2020 Chaoqiong Xiao Modified comment(s), */
-/* resulting in version 6.1 */
-/* 01-31-2022 Chaoqiong Xiao Modified comment(s), */
-/* refined macros names, */
-/* resulting in version 6.1.10 */
-/* 10-31-2023 Chaoqiong Xiao Modified comment(s), */
-/* improved INT EP support, */
-/* removed unused semaphore, */
-/* resulting in version 6.3.0 */
+/* removed from the bus either directly or indirectly. The bulk in\out */
+/* and interrupt pipes will be destroyed and the instance removed. */
+/* */
+/* INPUT */
+/* */
+/* command PIMA class command pointer */
+/* */
+/* OUTPUT */
+/* */
+/* Completion Status */
+/* */
+/* CALLS */
+/* */
+/* _ux_host_stack_class_instance_destroy Destroy the class instance */
+/* _ux_host_stack_endpoint_transfer_abort Abort endpoint transfer */
+/* _ux_utility_memory_free Free memory block */
+/* */
+/* CALLED BY */
+/* */
+/* _ux_host_class_pima_entry Entry of pima class */
/* */
/**************************************************************************/
UINT _ux_host_class_pima_deactivate(UX_HOST_CLASS_COMMAND *command)
@@ -96,8 +82,8 @@ UX_TRANSFER *transfer_request;
/* We come to this point when the device has been extracted. So there may have been a transaction
being scheduled. We make sure the transaction has been completed by the controller driver.
When the device is extracted, the controller tries multiple times the transaction and retires it
- with a DEVICE_NOT_RESPONDING error code.
-
+ with a DEVICE_NOT_RESPONDING error code.
+
First we take care of endpoint IN. */
transfer_request = &pima -> ux_host_class_pima_bulk_in_endpoint -> ux_endpoint_transfer_request;
if (transfer_request -> ux_transfer_request_completion_code == UX_TRANSFER_STATUS_PENDING)
@@ -106,20 +92,20 @@ UX_TRANSFER *transfer_request;
_ux_host_stack_endpoint_transfer_abort(pima -> ux_host_class_pima_bulk_in_endpoint);
- /* Then endpoint OUT. */
+ /* Then endpoint OUT. */
transfer_request = &pima -> ux_host_class_pima_bulk_out_endpoint -> ux_endpoint_transfer_request;
if (transfer_request -> ux_transfer_request_completion_code == UX_TRANSFER_STATUS_PENDING)
/* We need to abort transactions on the bulk Out pipe. We normally don't need that anymore. */
_ux_host_stack_endpoint_transfer_abort(pima -> ux_host_class_pima_bulk_out_endpoint);
-
+
/* Then interrupt endpoint. */
if (pima -> ux_host_class_pima_interrupt_endpoint != UX_NULL)
{
transfer_request = &pima -> ux_host_class_pima_interrupt_endpoint -> ux_endpoint_transfer_request;
if (transfer_request -> ux_transfer_request_completion_code == UX_TRANSFER_STATUS_PENDING)
-
+
/* We need to abort transactions on the Interrupt pipe. */
_ux_host_stack_endpoint_transfer_abort(pima -> ux_host_class_pima_interrupt_endpoint);
@@ -129,7 +115,7 @@ UX_TRANSFER *transfer_request;
/* The enumeration thread needs to sleep a while to allow the application or the class that may be using
endpoints to exit properly. */
- _ux_host_thread_schedule_other(UX_THREAD_PRIORITY_ENUM);
+ _ux_host_thread_schedule_other(UX_THREAD_PRIORITY_ENUM);
/* Free the header container buffer. */
if (pima -> ux_host_class_pima_container != UX_NULL)
@@ -153,11 +139,11 @@ UX_TRANSFER *transfer_request;
/* Reset the magic field. */
pima_session -> ux_host_class_pima_session_magic = 0;
-
+
/* Declare the session closed. */
pima_session -> ux_host_class_pima_session_state = UX_HOST_CLASS_PIMA_SESSION_STATE_CLOSED;
- }
+ }
}
/* Destroy the instance. */
@@ -167,7 +153,7 @@ UX_TRANSFER *transfer_request;
that the device is removed. */
if (_ux_system_host -> ux_system_host_change_function != UX_NULL)
{
-
+
/* Inform the application the device is removed. */
_ux_system_host -> ux_system_host_change_function(UX_DEVICE_REMOVAL, pima -> ux_host_class_pima_class, (VOID *) pima);
}
@@ -182,6 +168,6 @@ UX_TRANSFER *transfer_request;
_ux_utility_memory_free(pima);
/* Return successful status. */
- return(UX_SUCCESS);
+ return(UX_SUCCESS);
}
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 e676c8d6..b90429ac 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
@@ -1,10 +1,11 @@
/***************************************************************************
- * Copyright (c) 2024 Microsoft Corporation
- *
+ * Copyright (c) 2024 Microsoft Corporation
+ * Copyright (c) 2026-present Eclipse ThreadX contributors
+ *
* This program and the accompanying materials are made available under the
* terms of the MIT License which is available at
* https://opensource.org/licenses/MIT.
- *
+ *
* SPDX-License-Identifier: MIT
**************************************************************************/
@@ -66,22 +67,6 @@
/* */
/* USB application */
/* */
-/* RELEASE HISTORY */
-/* */
-/* DATE NAME DESCRIPTION */
-/* */
-/* 05-19-2020 Chaoqiong Xiao Initial Version 6.0 */
-/* 09-30-2020 Chaoqiong Xiao Modified comment(s), */
-/* verified memset and memcpy */
-/* cases, */
-/* resulting in version 6.1 */
-/* 07-29-2022 Chaoqiong Xiao Modified comment(s), */
-/* fixed DeviceInfo extract, */
-/* resulting in version 6.1.12 */
-/* 10-31-2023 Chaoqiong Xiao Modified comment(s), */
-/* fixed compile warnings, */
-/* resulting in version 6.3.0 */
-/* */
/**************************************************************************/
UINT _ux_host_class_pima_device_info_get(UX_HOST_CLASS_PIMA *pima,
UX_HOST_CLASS_PIMA_DEVICE *pima_device)
@@ -394,12 +379,6 @@ UINT status;
/* */
/* USB application */
/* */
-/* RELEASE HISTORY */
-/* */
-/* DATE NAME DESCRIPTION */
-/* */
-/* 10-31-2023 Yajun xia Initial Version 6.3.0 */
-/* */
/**************************************************************************/
UINT _uxe_host_class_pima_device_info_get(UX_HOST_CLASS_PIMA *pima,
UX_HOST_CLASS_PIMA_DEVICE *pima_device)
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 b7886af7..f1717fc4 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
@@ -1,18 +1,19 @@
/***************************************************************************
- * Copyright (c) 2024 Microsoft Corporation
- *
+ * Copyright (c) 2024 Microsoft Corporation
+ * Copyright (c) 2026-present Eclipse ThreadX contributors
+ *
* This program and the accompanying materials are made available under the
* terms of the MIT License which is available at
* https://opensource.org/licenses/MIT.
- *
+ *
* SPDX-License-Identifier: MIT
**************************************************************************/
/**************************************************************************/
/**************************************************************************/
-/** */
-/** USBX Component */
+/** */
+/** USBX Component */
/** */
/** PIMA Class */
/** */
@@ -29,42 +30,34 @@
#include "ux_host_stack.h"
-/**************************************************************************/
-/* */
-/* FUNCTION RELEASE */
-/* */
-/* _ux_host_class_pima_device_reset PORTABLE C */
+/**************************************************************************/
+/* */
+/* FUNCTION RELEASE */
+/* */
+/* _ux_host_class_pima_device_reset PORTABLE C */
/* 6.1 */
/* AUTHOR */
/* */
/* Chaoqiong Xiao, Microsoft Corporation */
/* */
/* DESCRIPTION */
-/* */
-/* This function resets the device. */
-/* INPUT */
-/* */
-/* pima Pointer to pima class */
-/* */
-/* OUTPUT */
-/* */
-/* Completion Status */
-/* */
-/* CALLS */
-/* */
+/* */
+/* This function resets the device. */
+/* INPUT */
+/* */
+/* pima Pointer to pima class */
+/* */
+/* OUTPUT */
+/* */
+/* Completion Status */
+/* */
+/* CALLS */
+/* */
/* _ux_host_stack_transfer_request Transfer request */
-/* */
-/* CALLED BY */
-/* */
-/* USB application */
-/* */
-/* RELEASE HISTORY */
-/* */
-/* DATE NAME DESCRIPTION */
-/* */
-/* 05-19-2020 Chaoqiong Xiao Initial Version 6.0 */
-/* 09-30-2020 Chaoqiong Xiao Modified comment(s), */
-/* resulting in version 6.1 */
+/* */
+/* CALLED BY */
+/* */
+/* USB application */
/* */
/**************************************************************************/
UINT _ux_host_class_pima_device_reset(UX_HOST_CLASS_PIMA *pima)
@@ -73,7 +66,7 @@ UINT _ux_host_class_pima_device_reset(UX_HOST_CLASS_PIMA *pima)
UX_TRANSFER *transfer_request;
UX_ENDPOINT *control_endpoint;
UINT status;
-
+
/* If trace is enabled, insert this event into the trace buffer. */
UX_TRACE_IN_LINE_INSERT(UX_TRACE_HOST_CLASS_PIMA_DEVICE_RESET, pima, 0, 0, 0, UX_TRACE_HOST_CLASS_EVENTS, 0, 0)
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 aa669052..f6eed7ff 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
@@ -1,18 +1,19 @@
/***************************************************************************
- * Copyright (c) 2024 Microsoft Corporation
- *
+ * Copyright (c) 2024 Microsoft Corporation
+ * Copyright (c) 2026-present Eclipse ThreadX contributors
+ *
* This program and the accompanying materials are made available under the
* terms of the MIT License which is available at
* https://opensource.org/licenses/MIT.
- *
+ *
* SPDX-License-Identifier: MIT
**************************************************************************/
/**************************************************************************/
/**************************************************************************/
-/** */
-/** USBX Component */
+/** */
+/** USBX Component */
/** */
/** PIMA Class */
/** */
@@ -29,51 +30,36 @@
#include "ux_host_stack.h"
-/**************************************************************************/
-/* */
-/* FUNCTION RELEASE */
-/* */
-/* _ux_host_class_pima_endpoints_get PORTABLE C */
+/**************************************************************************/
+/* */
+/* FUNCTION RELEASE */
+/* */
+/* _ux_host_class_pima_endpoints_get PORTABLE C */
/* 6.1.11 */
/* AUTHOR */
/* */
/* Chaoqiong Xiao, Microsoft Corporation */
/* */
/* DESCRIPTION */
-/* */
+/* */
/* This function enables the bulk in bulk out and interrupt endpoints. */
-/* */
-/* INPUT */
-/* */
-/* pima Pointer to pima class */
-/* */
-/* OUTPUT */
-/* */
-/* Completion Status */
-/* */
-/* CALLS */
-/* */
+/* */
+/* INPUT */
+/* */
+/* pima Pointer to pima class */
+/* */
+/* OUTPUT */
+/* */
+/* Completion Status */
+/* */
+/* CALLS */
+/* */
/* _ux_host_stack_transfer_request Transfer request */
-/* _ux_host_stack_interface_endpoint_get Get interface endpoint */
-/* */
-/* CALLED BY */
-/* */
-/* _ux_host_class_pima_activate Activate pima class */
-/* */
-/* RELEASE HISTORY */
-/* */
-/* DATE NAME DESCRIPTION */
-/* */
-/* 05-19-2020 Chaoqiong Xiao Initial Version 6.0 */
-/* 09-30-2020 Chaoqiong Xiao Modified comment(s), */
-/* resulting in version 6.1 */
-/* 10-15-2021 Chaoqiong Xiao Modified comment(s), */
-/* use pre-calculated value */
-/* instead of wMaxPacketSize, */
-/* resulting in version 6.1.9 */
-/* 04-25-2022 Chaoqiong Xiao Modified comment(s), */
-/* internal clean up, */
-/* resulting in version 6.1.11 */
+/* _ux_host_stack_interface_endpoint_get Get interface endpoint */
+/* */
+/* CALLED BY */
+/* */
+/* _ux_host_class_pima_activate Activate pima class */
/* */
/**************************************************************************/
UINT _ux_host_class_pima_endpoints_get(UX_HOST_CLASS_PIMA *pima)
@@ -89,34 +75,34 @@ UX_TRANSFER *transfer_request;
/* Search the bulk OUT endpoint. It is attached to the interface container. */
for (endpoint_index = 0; endpoint_index < pima -> ux_host_class_pima_interface -> ux_interface_descriptor.bNumEndpoints;
endpoint_index++)
- {
-
+ {
+
/* Get interface endpoint. */
status = _ux_host_stack_interface_endpoint_get(pima -> ux_host_class_pima_interface, endpoint_index, &endpoint);
-
+
/* Check the completion status. */
if (status == UX_SUCCESS)
{
-
+
/* Check if endpoint is bulk and OUT. */
if (((endpoint -> ux_endpoint_descriptor.bEndpointAddress & UX_ENDPOINT_DIRECTION) == UX_ENDPOINT_OUT) &&
((endpoint -> ux_endpoint_descriptor.bmAttributes & UX_MASK_ENDPOINT_TYPE) == UX_BULK_ENDPOINT))
{
-
+
/* This transfer_request always have the OUT direction. */
endpoint -> ux_endpoint_transfer_request.ux_transfer_request_type = UX_REQUEST_OUT;
-
+
/* We have found the bulk endpoint, save it. */
pima -> ux_host_class_pima_bulk_out_endpoint = endpoint;
break;
}
- }
- }
-
+ }
+ }
+
/* The bulk out endpoint is mandatory. */
if (pima -> ux_host_class_pima_bulk_out_endpoint == UX_NULL)
{
-
+
/* Error trap. */
_ux_system_error_handler(UX_SYSTEM_LEVEL_THREAD, UX_SYSTEM_CONTEXT_CLASS, UX_ENDPOINT_HANDLE_UNKNOWN);
@@ -125,33 +111,33 @@ UX_TRANSFER *transfer_request;
return(UX_ENDPOINT_HANDLE_UNKNOWN);
}
-
+
/* Search the bulk IN endpoint. It is attached to the interface container. */
for (endpoint_index = 0; endpoint_index < pima -> ux_host_class_pima_interface -> ux_interface_descriptor.bNumEndpoints;
endpoint_index++)
- {
-
+ {
+
/* Get the endpoint handle. */
status = _ux_host_stack_interface_endpoint_get(pima -> ux_host_class_pima_interface, endpoint_index, &endpoint);
-
+
/* Check the completion status. */
if (status == UX_SUCCESS)
{
-
+
/* Check if endpoint is bulk and IN. */
if (((endpoint -> ux_endpoint_descriptor.bEndpointAddress & UX_ENDPOINT_DIRECTION) == UX_ENDPOINT_IN) &&
((endpoint -> ux_endpoint_descriptor.bmAttributes & UX_MASK_ENDPOINT_TYPE) == UX_BULK_ENDPOINT))
{
-
+
/* This transfer_request always have the IN direction. */
endpoint -> ux_endpoint_transfer_request.ux_transfer_request_type = UX_REQUEST_IN;
-
+
/* We have found the bulk endpoint, save it. */
pima -> ux_host_class_pima_bulk_in_endpoint = endpoint;
break;
}
- }
- }
+ }
+ }
/* The bulk in endpoint is mandatory. */
if (pima -> ux_host_class_pima_bulk_in_endpoint == UX_NULL)
@@ -165,27 +151,27 @@ UX_TRANSFER *transfer_request;
return(UX_ENDPOINT_HANDLE_UNKNOWN);
}
-
+
/* Search the Interrupt endpoint. It is attached to the interface container of the control interface. It is not mandatory. */
for (endpoint_index = 0; endpoint_index < pima -> ux_host_class_pima_interface -> ux_interface_descriptor.bNumEndpoints;
endpoint_index++)
- {
-
+ {
+
/* Get the endpoint handle. */
status = _ux_host_stack_interface_endpoint_get(pima -> ux_host_class_pima_interface, endpoint_index, &endpoint);
-
+
/* Check the completion status. */
if (status == UX_SUCCESS)
{
-
+
/* Check if endpoint is Interrupt and IN. */
if (((endpoint -> ux_endpoint_descriptor.bEndpointAddress & UX_ENDPOINT_DIRECTION) == UX_ENDPOINT_IN) &&
((endpoint -> ux_endpoint_descriptor.bmAttributes & UX_MASK_ENDPOINT_TYPE) == UX_INTERRUPT_ENDPOINT))
{
-
+
/* This transfer_request always have the IN direction. */
endpoint -> ux_endpoint_transfer_request.ux_transfer_request_type = UX_REQUEST_IN;
-
+
/* We have found the interrupt endpoint, save it. */
pima -> ux_host_class_pima_interrupt_endpoint = endpoint;
@@ -204,18 +190,18 @@ UX_TRANSFER *transfer_request;
transfer_request -> ux_transfer_request_completion_function = _ux_host_class_pima_notification;
/* Obtain a buffer for this transaction. The buffer will always be reused. */
- transfer_request -> ux_transfer_request_data_pointer = _ux_utility_memory_allocate(UX_SAFE_ALIGN, UX_CACHE_SAFE_MEMORY,
+ transfer_request -> ux_transfer_request_data_pointer = _ux_utility_memory_allocate(UX_SAFE_ALIGN, UX_CACHE_SAFE_MEMORY,
transfer_request -> ux_transfer_request_requested_length);
/* Check memory allocation. */
if (transfer_request -> ux_transfer_request_data_pointer != UX_NULL)
{
-
+
/* The transfer on the interrupt endpoint can be started. */
_ux_host_stack_transfer_request(transfer_request);
}
-
+
else
{
@@ -228,13 +214,13 @@ UX_TRANSFER *transfer_request;
/* We must return an error. */
return(UX_ENDPOINT_HANDLE_UNKNOWN);
}
-
+
break;
}
- }
- }
-
-
+ }
+ }
+
+
/* All endpoints have been mounted. */
return(UX_SUCCESS);
}
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 b9e74300..c8e9cdb3 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
@@ -1,18 +1,19 @@
/***************************************************************************
- * Copyright (c) 2024 Microsoft Corporation
- *
+ * Copyright (c) 2024 Microsoft Corporation
+ * Copyright (c) 2026-present Eclipse ThreadX contributors
+ *
* This program and the accompanying materials are made available under the
* terms of the MIT License which is available at
* https://opensource.org/licenses/MIT.
- *
+ *
* SPDX-License-Identifier: MIT
**************************************************************************/
/**************************************************************************/
/**************************************************************************/
-/** */
-/** USBX Component */
+/** */
+/** USBX Component */
/** */
/** Pima Class */
/** */
@@ -29,47 +30,39 @@
#include "ux_host_stack.h"
-/**************************************************************************/
-/* */
-/* FUNCTION RELEASE */
-/* */
-/* _ux_host_class_pima_entry PORTABLE C */
+/**************************************************************************/
+/* */
+/* FUNCTION RELEASE */
+/* */
+/* _ux_host_class_pima_entry PORTABLE C */
/* 6.1 */
/* AUTHOR */
/* */
/* Chaoqiong Xiao, Microsoft Corporation */
/* */
/* DESCRIPTION */
-/* */
-/* This function is the entry point of the pima class. It will be */
-/* called by the USBX stack enumeration module when there is a new */
-/* pima on the bus or when the USB pima is removed. */
-/* */
-/* */
-/* INPUT */
-/* */
+/* */
+/* This function is the entry point of the pima class. It will be */
+/* called by the USBX stack enumeration module when there is a new */
+/* pima on the bus or when the USB pima is removed. */
+/* */
+/* */
+/* INPUT */
+/* */
/* command Pima class command */
-/* */
-/* OUTPUT */
-/* */
-/* Completion Status */
-/* */
-/* CALLS */
-/* */
-/* _ux_host_class_pima_activate Activate pima class */
-/* _ux_host_class_pima_deactivate Deactivate pima class */
-/* */
-/* CALLED BY */
-/* */
-/* USBX stack */
-/* */
-/* RELEASE HISTORY */
-/* */
-/* DATE NAME DESCRIPTION */
-/* */
-/* 05-19-2020 Chaoqiong Xiao Initial Version 6.0 */
-/* 09-30-2020 Chaoqiong Xiao Modified comment(s), */
-/* resulting in version 6.1 */
+/* */
+/* OUTPUT */
+/* */
+/* Completion Status */
+/* */
+/* CALLS */
+/* */
+/* _ux_host_class_pima_activate Activate pima class */
+/* _ux_host_class_pima_deactivate Deactivate pima class */
+/* */
+/* CALLED BY */
+/* */
+/* USBX stack */
/* */
/**************************************************************************/
UINT _ux_host_class_pima_entry(UX_HOST_CLASS_COMMAND *command)
@@ -91,10 +84,10 @@ UINT status;
((command -> ux_host_class_command_class == UX_HOST_CLASS_PIMA_CLASS) &&
(command -> ux_host_class_command_subclass == UX_HOST_CLASS_PIMA_SUBCLASS) &&
(command -> ux_host_class_command_protocol == UX_HOST_CLASS_PIMA_PROTOCOL)))
- return(UX_SUCCESS);
- else
- return(UX_NO_CLASS_MATCH);
-
+ return(UX_SUCCESS);
+ else
+ return(UX_NO_CLASS_MATCH);
+
case UX_HOST_CLASS_COMMAND_ACTIVATE:
/* The activate command is used when the device inserted has found a parent and
@@ -104,13 +97,13 @@ UINT status;
case UX_HOST_CLASS_COMMAND_DEACTIVATE:
- /* The deactivate command is used when the device has been extracted either
+ /* The deactivate command is used when the device has been extracted either
directly or when its parents has been extracted. */
status = _ux_host_class_pima_deactivate(command);
return(status);
- default:
-
+ default:
+
/* Error trap. */
_ux_system_error_handler(UX_SYSTEM_LEVEL_THREAD, UX_SYSTEM_CONTEXT_CLASS, UX_FUNCTION_NOT_SUPPORTED);
@@ -118,6 +111,6 @@ UINT status;
UX_TRACE_IN_LINE_INSERT(UX_TRACE_ERROR, UX_FUNCTION_NOT_SUPPORTED, 0, 0, 0, UX_TRACE_ERRORS, 0, 0)
return(UX_FUNCTION_NOT_SUPPORTED);
- }
+ }
}
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 b9aa3031..2058d2a4 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
@@ -1,18 +1,19 @@
/***************************************************************************
- * Copyright (c) 2024 Microsoft Corporation
- *
+ * Copyright (c) 2024 Microsoft Corporation
+ * Copyright (c) 2026-present Eclipse ThreadX contributors
+ *
* This program and the accompanying materials are made available under the
* terms of the MIT License which is available at
* https://opensource.org/licenses/MIT.
- *
+ *
* SPDX-License-Identifier: MIT
**************************************************************************/
/**************************************************************************/
/**************************************************************************/
-/** */
-/** USBX Component */
+/** */
+/** USBX Component */
/** */
/** Pima Class */
/** */
@@ -29,50 +30,40 @@
#include "ux_host_stack.h"
-/**************************************************************************/
-/* */
-/* FUNCTION RELEASE */
-/* */
-/* _ux_host_class_pima_notification PORTABLE C */
+/**************************************************************************/
+/* */
+/* FUNCTION RELEASE */
+/* */
+/* _ux_host_class_pima_notification PORTABLE C */
/* 6.1 */
/* AUTHOR */
/* */
/* Chaoqiong Xiao, Microsoft Corporation */
/* */
/* DESCRIPTION */
-/* */
-/* This function is called by the completion thread when a transfer */
-/* request has been completed either because the transfer is */
-/* successful or there was an error. */
-/* */
-/* INPUT */
-/* */
-/* transfer_request Pointer to transfer request */
-/* */
-/* OUTPUT */
-/* */
-/* None */
-/* */
-/* CALLS */
-/* */
+/* */
+/* This function is called by the completion thread when a transfer */
+/* request has been completed either because the transfer is */
+/* successful or there was an error. */
+/* */
+/* INPUT */
+/* */
+/* transfer_request Pointer to transfer request */
+/* */
+/* OUTPUT */
+/* */
+/* None */
+/* */
+/* CALLS */
+/* */
/* _ux_host_stack_transfer_request Transfer request */
/* _ux_utility_memory_copy Copy memory */
/* _ux_utility_short_get Get 16-bit value */
/* _ux_utility_long_get Get 32-bit value */
-/* */
-/* CALLED BY */
-/* */
-/* USBX stack */
-/* */
-/* RELEASE HISTORY */
-/* */
-/* DATE NAME DESCRIPTION */
-/* */
-/* 05-19-2020 Chaoqiong Xiao Initial Version 6.0 */
-/* 09-30-2020 Chaoqiong Xiao Modified comment(s), */
-/* verified memset and memcpy */
-/* cases, */
-/* resulting in version 6.1 */
+/* */
+/* CALLED BY */
+/* */
+/* USBX stack */
/* */
/**************************************************************************/
VOID _ux_host_class_pima_notification(UX_TRANSFER *transfer_request)
@@ -84,29 +75,29 @@ UX_HOST_CLASS_PIMA_EVENT pima_event;
/* Get the class instance for this transfer request. */
pima = (UX_HOST_CLASS_PIMA *) transfer_request -> ux_transfer_request_class_instance;
-
+
/* Check the state of the transfer. If there is an error, we do not proceed with this notification. */
if (transfer_request -> ux_transfer_request_completion_code != UX_SUCCESS)
{
/* We have an error. We do not rehook another transfer if the device instance is shutting down or
if the transfer was aborted by the class.. */
- if ((pima -> ux_host_class_pima_state == UX_HOST_CLASS_INSTANCE_SHUTDOWN) ||
+ if ((pima -> ux_host_class_pima_state == UX_HOST_CLASS_INSTANCE_SHUTDOWN) ||
(transfer_request -> ux_transfer_request_completion_code == UX_TRANSFER_STATUS_ABORT))
/* We do not proceed. */
return;
else
- {
+ {
/* Reactivate the PIMA interrupt pipe. */
_ux_host_stack_transfer_request(transfer_request);
-
+
/* We do not proceed. */
- return;
- }
-
+ return;
+ }
+
}
/* Check if this packet is the first, if so we have the total length expected in the event. */
@@ -115,33 +106,33 @@ UX_HOST_CLASS_PIMA_EVENT pima_event;
/* First packet. Maybe the only one needed. It may happen that the notification event is split amongst
several interrupt packets. */
- pima -> ux_host_class_pima_event_buffer_expected_length = _ux_utility_long_get(transfer_request -> ux_transfer_request_data_pointer
+ pima -> ux_host_class_pima_event_buffer_expected_length = _ux_utility_long_get(transfer_request -> ux_transfer_request_data_pointer
+ UX_HOST_CLASS_PIMA_AEI_DATA_LENGTH);
/* Set the current offset to the beginning of the buffer. */
pima -> ux_host_class_pima_event_buffer_current_offset = pima -> ux_host_class_pima_event_buffer;
-
+
}
-
+
/* Check the length of this payload and make sure we have enough space. */
- if ((pima -> ux_host_class_pima_event_buffer_current_length + transfer_request -> ux_transfer_request_actual_length) <=
+ if ((pima -> ux_host_class_pima_event_buffer_current_length + transfer_request -> ux_transfer_request_actual_length) <=
UX_HOST_CLASS_PIMA_AEI_MAX_LENGTH)
{
-
+
/* 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,
+ _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); /* 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;
-
+
/* Adjust the length. */
pima -> ux_host_class_pima_event_buffer_current_length += transfer_request -> ux_transfer_request_actual_length;
}
else
-
+
/* We come here when we have a buffer overflow. Do not proceed. */
- return;
+ return;
/* Check if we have a complete notification event. */
if (pima -> ux_host_class_pima_event_buffer_current_length == pima -> ux_host_class_pima_event_buffer_expected_length)
@@ -149,68 +140,68 @@ UX_HOST_CLASS_PIMA_EVENT pima_event;
/* Save the current event in the pima instance. First, unpack the event code. */
pima -> ux_host_class_pima_event_code = _ux_utility_short_get(pima -> ux_host_class_pima_event_buffer + UX_HOST_CLASS_PIMA_AEI_EVENT_CODE);
-
+
/* Unpack the Transaction ID. */
pima -> ux_host_class_pima_event_transaction_id = _ux_utility_long_get(pima -> ux_host_class_pima_event_buffer + UX_HOST_CLASS_PIMA_AEI_TRANSACTION_ID);
-
+
/* Unpack the parameter 1. */
pima -> ux_host_class_pima_event_parameter_1 = _ux_utility_long_get(pima -> ux_host_class_pima_event_buffer + UX_HOST_CLASS_PIMA_AEI_PARAMETER_1);
-
+
/* Unpack the parameter 2. */
pima -> ux_host_class_pima_event_parameter_2 = _ux_utility_long_get(pima -> ux_host_class_pima_event_buffer + UX_HOST_CLASS_PIMA_AEI_PARAMETER_2);
-
+
/* Unpack the parameter 3. */
pima -> ux_host_class_pima_event_parameter_3 = _ux_utility_long_get(pima -> ux_host_class_pima_event_buffer + UX_HOST_CLASS_PIMA_AEI_PARAMETER_3);
-
+
/* Check if a session is valid. */
if (pima -> ux_host_class_pima_session != UX_NULL)
{
-
+
/* Get session pointer. */
pima_session = pima -> ux_host_class_pima_session;
-
+
/* Check if this session is valid or not. */
if ((pima_session -> ux_host_class_pima_session_magic == UX_HOST_CLASS_PIMA_MAGIC_NUMBER) &&
(pima_session -> ux_host_class_pima_session_state == UX_HOST_CLASS_PIMA_SESSION_STATE_OPENED))
{
-
+
/* If the application demanded a callback when event occur, create a event notification
message. */
if (pima_session -> ux_host_class_pima_session_event_callback != UX_NULL)
{
-
+
/* Fill in the pima event structure. First with pima instance. */
pima_event.ux_host_class_pima_event_pima_instance = pima;
-
+
/* Fill in the opened session pointer. Since the pima class only supports
one session, this address is hardwired to the opened session and is not coming from
the event buffer. */
pima_event.ux_host_class_pima_event_session = pima_session;
-
+
/* Fill in all the event parameters in the event callback structure. */
pima_event.ux_host_class_pima_event_code = pima -> ux_host_class_pima_event_code;
pima_event.ux_host_class_pima_event_transaction_id = pima -> ux_host_class_pima_event_transaction_id;
pima_event.ux_host_class_pima_event_parameter_1 = pima -> ux_host_class_pima_event_parameter_1;
pima_event.ux_host_class_pima_event_parameter_2 = pima -> ux_host_class_pima_event_parameter_2;
pima_event.ux_host_class_pima_event_parameter_3 = pima -> ux_host_class_pima_event_parameter_3;
-
+
/* Send this event to the application. */
pima_session -> ux_host_class_pima_session_event_callback(&pima_event);
/* If trace is enabled, insert this event into the trace buffer. */
- UX_TRACE_IN_LINE_INSERT(UX_TRACE_HOST_CLASS_PIMA_NOTIFICATION, pima,
- pima -> ux_host_class_pima_event_code,
- pima -> ux_host_class_pima_event_transaction_id,
- pima -> ux_host_class_pima_event_parameter_1,
- UX_TRACE_HOST_CLASS_EVENTS, 0, 0)
-
+ UX_TRACE_IN_LINE_INSERT(UX_TRACE_HOST_CLASS_PIMA_NOTIFICATION, pima,
+ pima -> ux_host_class_pima_event_code,
+ pima -> ux_host_class_pima_event_transaction_id,
+ pima -> ux_host_class_pima_event_parameter_1,
+ UX_TRACE_HOST_CLASS_EVENTS, 0, 0)
+
}
}
}
-
+
/* We will receive a complete new transaction. */
pima -> ux_host_class_pima_event_buffer_current_length = 0;
- }
+ }
/* Reactivate the PIMA interrupt pipe. */
_ux_host_stack_transfer_request(transfer_request);
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 09e32de7..f58a0a8c 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
@@ -1,10 +1,11 @@
/***************************************************************************
- * Copyright (c) 2024 Microsoft Corporation
- *
+ * Copyright (c) 2024 Microsoft Corporation
+ * Copyright (c) 2026-present Eclipse ThreadX contributors
+ *
* This program and the accompanying materials are made available under the
* terms of the MIT License which is available at
* https://opensource.org/licenses/MIT.
- *
+ *
* SPDX-License-Identifier: MIT
**************************************************************************/
@@ -62,16 +63,6 @@
/* */
/* USB application */
/* */
-/* RELEASE HISTORY */
-/* */
-/* DATE NAME DESCRIPTION */
-/* */
-/* 05-19-2020 Chaoqiong Xiao Initial Version 6.0 */
-/* 09-30-2020 Chaoqiong Xiao Modified comment(s), */
-/* resulting in version 6.1 */
-/* 10-31-2023 Yajun xia Modified comment(s), */
-/* resulting in version 6.3.0 */
-/* */
/**************************************************************************/
UINT _ux_host_class_pima_num_objects_get(UX_HOST_CLASS_PIMA *pima,
UX_HOST_CLASS_PIMA_SESSION *pima_session,
@@ -157,12 +148,6 @@ UINT status;
/* */
/* USB application */
/* */
-/* RELEASE HISTORY */
-/* */
-/* DATE NAME DESCRIPTION */
-/* */
-/* 10-31-2023 Yajun xia Initial Version 6.3.0 */
-/* */
/**************************************************************************/
UINT _uxe_host_class_pima_num_objects_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_close.c b/common/usbx_host_classes/src/ux_host_class_pima_object_close.c
index 87528558..7be723d7 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
@@ -1,10 +1,11 @@
/***************************************************************************
- * Copyright (c) 2024 Microsoft Corporation
- *
+ * Copyright (c) 2024 Microsoft Corporation
+ * Copyright (c) 2026-present Eclipse ThreadX contributors
+ *
* This program and the accompanying materials are made available under the
* terms of the MIT License which is available at
* https://opensource.org/licenses/MIT.
- *
+ *
* SPDX-License-Identifier: MIT
**************************************************************************/
@@ -64,18 +65,6 @@
/* */
/* USB application */
/* */
-/* RELEASE HISTORY */
-/* */
-/* 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 */
-/* 01-31-2022 Chaoqiong Xiao Modified comment(s), */
-/* refined macros names, */
-/* resulting in version 6.1.10 */
-/* */
/**************************************************************************/
UINT _ux_host_class_pima_object_close(UX_HOST_CLASS_PIMA *pima,
UX_HOST_CLASS_PIMA_SESSION *pima_session,
@@ -255,12 +244,6 @@ UINT status;
/* */
/* USB application */
/* */
-/* RELEASE HISTORY */
-/* */
-/* DATE NAME DESCRIPTION */
-/* */
-/* 10-31-2023 Yajun xia Initial Version 6.3.0 */
-/* */
/**************************************************************************/
UINT _uxe_host_class_pima_object_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_object_copy.c b/common/usbx_host_classes/src/ux_host_class_pima_object_copy.c
index 3fe8d071..dc114baa 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
@@ -1,18 +1,19 @@
/***************************************************************************
- * Copyright (c) 2024 Microsoft Corporation
- *
+ * Copyright (c) 2024 Microsoft Corporation
+ * Copyright (c) 2026-present Eclipse ThreadX contributors
+ *
* This program and the accompanying materials are made available under the
* terms of the MIT License which is available at
* https://opensource.org/licenses/MIT.
- *
+ *
* SPDX-License-Identifier: MIT
**************************************************************************/
/**************************************************************************/
/**************************************************************************/
-/** */
-/** USBX Component */
+/** */
+/** USBX Component */
/** */
/** PIMA Class */
/** */
@@ -29,53 +30,45 @@
#include "ux_host_stack.h"
-/**************************************************************************/
-/* */
-/* FUNCTION RELEASE */
-/* */
-/* _ux_host_class_pima_object_copy PORTABLE C */
+/**************************************************************************/
+/* */
+/* FUNCTION RELEASE */
+/* */
+/* _ux_host_class_pima_object_copy PORTABLE C */
/* 6.1 */
/* AUTHOR */
/* */
/* Chaoqiong Xiao, Microsoft Corporation */
/* */
/* DESCRIPTION */
-/* */
-/* This function copies one object from one location to another. */
-/* */
-/* INPUT */
-/* */
-/* pima Pointer to pima class */
-/* pima_session Pointer to pima session */
-/* object_handle Object handle to move */
-/* storage_id destination storage ID */
-/* parent_object_handle Parent object handle */
-/* */
-/* OUTPUT */
-/* */
-/* Completion Status */
-/* */
-/* CALLS */
-/* */
+/* */
+/* This function copies one object from one location to another. */
+/* */
+/* INPUT */
+/* */
+/* pima Pointer to pima class */
+/* pima_session Pointer to pima session */
+/* object_handle Object handle to move */
+/* storage_id destination storage ID */
+/* parent_object_handle Parent object handle */
+/* */
+/* OUTPUT */
+/* */
+/* Completion Status */
+/* */
+/* CALLS */
+/* */
/* _ux_host_class_pima_command Pima command function */
-/* */
-/* CALLED BY */
-/* */
-/* USB application */
-/* */
-/* RELEASE HISTORY */
-/* */
-/* DATE NAME DESCRIPTION */
-/* */
-/* 05-19-2020 Chaoqiong Xiao Initial Version 6.0 */
-/* 09-30-2020 Chaoqiong Xiao Modified comment(s), */
-/* resulting in version 6.1 */
+/* */
+/* CALLED BY */
+/* */
+/* USB application */
/* */
/**************************************************************************/
-UINT _ux_host_class_pima_object_copy(UX_HOST_CLASS_PIMA *pima,
+UINT _ux_host_class_pima_object_copy(UX_HOST_CLASS_PIMA *pima,
UX_HOST_CLASS_PIMA_SESSION *pima_session,
ULONG object_handle,
- ULONG storage_id,
+ ULONG storage_id,
ULONG parent_object_handle)
{
@@ -95,25 +88,25 @@ UINT status;
/* Issue command to get the object info. 3 parameter. */
command.ux_host_class_pima_command_nb_parameters = 3;
-
+
/* Parameter 1 is the Object Handle. */
command.ux_host_class_pima_command_parameter_1 = object_handle;
-
+
/* Parameter 2 is the Storage ID. */
command.ux_host_class_pima_command_parameter_2 = storage_id;
/* Parameter 3 is the Parent Object ID. */
command.ux_host_class_pima_command_parameter_3 = parent_object_handle;
-
+
/* Other parameters unused. */
command.ux_host_class_pima_command_parameter_4 = 0;
command.ux_host_class_pima_command_parameter_5 = 0;
-
+
/* Then set the command to COPY_OBJECT. */
command.ux_host_class_pima_command_operation_code = UX_HOST_CLASS_PIMA_OC_COPY_OBJECT;
/* Issue the command. */
- status = _ux_host_class_pima_command(pima, &command, UX_HOST_CLASS_PIMA_DATA_PHASE_NONE , UX_NULL,
+ status = _ux_host_class_pima_command(pima, &command, UX_HOST_CLASS_PIMA_DATA_PHASE_NONE , UX_NULL,
0, 0);
/* Return completion status. */
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 deb176ed..a4e151f3 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
@@ -1,10 +1,11 @@
/***************************************************************************
- * Copyright (c) 2024 Microsoft Corporation
- *
+ * Copyright (c) 2024 Microsoft Corporation
+ * Copyright (c) 2026-present Eclipse ThreadX contributors
+ *
* This program and the accompanying materials are made available under the
* terms of the MIT License which is available at
* https://opensource.org/licenses/MIT.
- *
+ *
* SPDX-License-Identifier: MIT
**************************************************************************/
@@ -64,14 +65,6 @@
/* */
/* USB application */
/* */
-/* RELEASE HISTORY */
-/* */
-/* DATE NAME DESCRIPTION */
-/* */
-/* 05-19-2020 Chaoqiong Xiao Initial Version 6.0 */
-/* 09-30-2020 Chaoqiong Xiao Modified comment(s), */
-/* resulting in version 6.1 */
-/* */
/**************************************************************************/
UINT _ux_host_class_pima_object_delete(UX_HOST_CLASS_PIMA *pima,
UX_HOST_CLASS_PIMA_SESSION *pima_session,
@@ -147,12 +140,6 @@ UINT status;
/* */
/* USB application */
/* */
-/* RELEASE HISTORY */
-/* */
-/* DATE NAME DESCRIPTION */
-/* */
-/* 10-31-2023 Yajun xia Initial Version 6.3.0 */
-/* */
/**************************************************************************/
UINT _uxe_host_class_pima_object_delete(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_get.c b/common/usbx_host_classes/src/ux_host_class_pima_object_get.c
index 9c0de9bf..d6377aa5 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
@@ -1,10 +1,11 @@
/***************************************************************************
- * Copyright (c) 2024 Microsoft Corporation
- *
+ * Copyright (c) 2024 Microsoft Corporation
+ * Copyright (c) 2026-present Eclipse ThreadX contributors
+ *
* This program and the accompanying materials are made available under the
* terms of the MIT License which is available at
* https://opensource.org/licenses/MIT.
- *
+ *
* SPDX-License-Identifier: MIT
**************************************************************************/
@@ -71,20 +72,6 @@
/* */
/* USB application */
/* */
-/* RELEASE HISTORY */
-/* */
-/* 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 */
-/* 01-31-2022 Chaoqiong Xiao Modified comment(s), */
-/* refined macros names, */
-/* resulting in version 6.1.10 */
-/* */
/**************************************************************************/
UINT _ux_host_class_pima_object_get(UX_HOST_CLASS_PIMA *pima,
UX_HOST_CLASS_PIMA_SESSION *pima_session,
@@ -454,12 +441,6 @@ UINT status;
/* */
/* USB application */
/* */
-/* RELEASE HISTORY */
-/* */
-/* DATE NAME DESCRIPTION */
-/* */
-/* 10-31-2023 Yajun xia Initial Version 6.3.0 */
-/* */
/**************************************************************************/
UINT _uxe_host_class_pima_object_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_handles_get.c b/common/usbx_host_classes/src/ux_host_class_pima_object_handles_get.c
index 5addd3b2..950c299a 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
@@ -1,10 +1,11 @@
/***************************************************************************
- * Copyright (c) 2024 Microsoft Corporation
- *
+ * Copyright (c) 2024 Microsoft Corporation
+ * Copyright (c) 2026-present Eclipse ThreadX contributors
+ *
* This program and the accompanying materials are made available under the
* terms of the MIT License which is available at
* https://opensource.org/licenses/MIT.
- *
+ *
* SPDX-License-Identifier: MIT
**************************************************************************/
@@ -72,17 +73,6 @@
/* */
/* USB application */
/* */
-/* RELEASE HISTORY */
-/* */
-/* DATE NAME DESCRIPTION */
-/* */
-/* 05-19-2020 Chaoqiong Xiao Initial Version 6.0 */
-/* 09-30-2020 Chaoqiong Xiao Modified comment(s), */
-/* resulting in version 6.1 */
-/* 07-29-2022 Chaoqiong Xiao Modified comment(s), */
-/* improved num objects check, */
-/* resulting in version 6.1.12 */
-/* */
/**************************************************************************/
UINT _ux_host_class_pima_object_handles_get(UX_HOST_CLASS_PIMA *pima, UX_HOST_CLASS_PIMA_SESSION *pima_session,
ULONG *object_handles_array, ULONG object_handles_length,
@@ -218,12 +208,6 @@ UINT status;
/* */
/* USB application */
/* */
-/* RELEASE HISTORY */
-/* */
-/* DATE NAME DESCRIPTION */
-/* */
-/* 10-31-2023 Yajun xia Initial Version 6.3.0 */
-/* */
/**************************************************************************/
UINT _uxe_host_class_pima_object_handles_get(UX_HOST_CLASS_PIMA *pima, UX_HOST_CLASS_PIMA_SESSION *pima_session,
ULONG *object_handles_array, ULONG object_handles_length,
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 013786ea..a7610fa4 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
@@ -1,10 +1,11 @@
/***************************************************************************
- * Copyright (c) 2024 Microsoft Corporation
- *
+ * Copyright (c) 2024 Microsoft Corporation
+ * Copyright (c) 2026-present Eclipse ThreadX contributors
+ *
* This program and the accompanying materials are made available under the
* terms of the MIT License which is available at
* https://opensource.org/licenses/MIT.
- *
+ *
* SPDX-License-Identifier: MIT
**************************************************************************/
@@ -66,20 +67,6 @@
/* */
/* USB application */
/* */
-/* RELEASE HISTORY */
-/* */
-/* DATE NAME DESCRIPTION */
-/* */
-/* 05-19-2020 Chaoqiong Xiao Initial Version 6.0 */
-/* 09-30-2020 Chaoqiong Xiao Modified comment(s), */
-/* verified memset and memcpy */
-/* cases, */
-/* resulting in version 6.1 */
-/* 10-31-2023 Yajun Xia Modified comment(s), */
-/* fixed allocated buffer */
-/* pointer checking issue, */
-/* resulting in version 6.3.0 */
-/* */
/**************************************************************************/
UINT _ux_host_class_pima_object_info_get(UX_HOST_CLASS_PIMA *pima,
UX_HOST_CLASS_PIMA_SESSION *pima_session,
@@ -272,12 +259,6 @@ UINT status;
/* */
/* USB application */
/* */
-/* RELEASE HISTORY */
-/* */
-/* DATE NAME DESCRIPTION */
-/* */
-/* 10-31-2023 Yajun xia Initial Version 6.3.0 */
-/* */
/**************************************************************************/
UINT _uxe_host_class_pima_object_info_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_send.c b/common/usbx_host_classes/src/ux_host_class_pima_object_info_send.c
index a618a76d..64c9e467 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
@@ -1,10 +1,11 @@
/***************************************************************************
- * Copyright (c) 2024 Microsoft Corporation
- *
+ * Copyright (c) 2024 Microsoft Corporation
+ * Copyright (c) 2026-present Eclipse ThreadX contributors
+ *
* This program and the accompanying materials are made available under the
* terms of the MIT License which is available at
* https://opensource.org/licenses/MIT.
- *
+ *
* SPDX-License-Identifier: MIT
**************************************************************************/
@@ -68,20 +69,6 @@
/* */
/* USB application */
/* */
-/* RELEASE HISTORY */
-/* */
-/* DATE NAME DESCRIPTION */
-/* */
-/* 05-19-2020 Chaoqiong Xiao Initial Version 6.0 */
-/* 09-30-2020 Chaoqiong Xiao Modified comment(s), */
-/* verified memset and memcpy */
-/* cases, */
-/* resulting in version 6.1 */
-/* 10-31-2023 Yajun Xia Modified comment(s), */
-/* fixed allocated buffer */
-/* pointer checking issue, */
-/* resulting in version 6.3.0 */
-/* */
/**************************************************************************/
UINT _ux_host_class_pima_object_info_send(UX_HOST_CLASS_PIMA *pima,
UX_HOST_CLASS_PIMA_SESSION *pima_session,
@@ -291,12 +278,6 @@ UINT status;
/* */
/* USB application */
/* */
-/* RELEASE HISTORY */
-/* */
-/* DATE NAME DESCRIPTION */
-/* */
-/* 10-31-2023 Yajun xia Initial Version 6.3.0 */
-/* */
/**************************************************************************/
UINT _uxe_host_class_pima_object_info_send(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_move.c b/common/usbx_host_classes/src/ux_host_class_pima_object_move.c
index c28ae4fc..69ff4290 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
@@ -1,18 +1,19 @@
/***************************************************************************
- * Copyright (c) 2024 Microsoft Corporation
- *
+ * Copyright (c) 2024 Microsoft Corporation
+ * Copyright (c) 2026-present Eclipse ThreadX contributors
+ *
* This program and the accompanying materials are made available under the
* terms of the MIT License which is available at
* https://opensource.org/licenses/MIT.
- *
+ *
* SPDX-License-Identifier: MIT
**************************************************************************/
/**************************************************************************/
/**************************************************************************/
-/** */
-/** USBX Component */
+/** */
+/** USBX Component */
/** */
/** PIMA Class */
/** */
@@ -29,53 +30,45 @@
#include "ux_host_stack.h"
-/**************************************************************************/
-/* */
-/* FUNCTION RELEASE */
-/* */
-/* _ux_host_class_pima_object_move PORTABLE C */
+/**************************************************************************/
+/* */
+/* FUNCTION RELEASE */
+/* */
+/* _ux_host_class_pima_object_move PORTABLE C */
/* 6.1 */
/* AUTHOR */
/* */
/* Chaoqiong Xiao, Microsoft Corporation */
/* */
/* DESCRIPTION */
-/* */
-/* This function moves an object from one location to another. */
-/* */
-/* INPUT */
-/* */
-/* pima Pointer to pima class */
-/* pima_session Pointer to pima session */
-/* object_handle Object handle to move */
-/* storage_id destination storage ID */
-/* parent_object_handle Parent object handle */
-/* */
-/* OUTPUT */
-/* */
-/* Completion Status */
-/* */
-/* CALLS */
-/* */
+/* */
+/* This function moves an object from one location to another. */
+/* */
+/* INPUT */
+/* */
+/* pima Pointer to pima class */
+/* pima_session Pointer to pima session */
+/* object_handle Object handle to move */
+/* storage_id destination storage ID */
+/* parent_object_handle Parent object handle */
+/* */
+/* OUTPUT */
+/* */
+/* Completion Status */
+/* */
+/* CALLS */
+/* */
/* _ux_host_class_pima_command Pima command function */
-/* */
-/* CALLED BY */
-/* */
-/* USB application */
-/* */
-/* RELEASE HISTORY */
-/* */
-/* DATE NAME DESCRIPTION */
-/* */
-/* 05-19-2020 Chaoqiong Xiao Initial Version 6.0 */
-/* 09-30-2020 Chaoqiong Xiao Modified comment(s), */
-/* resulting in version 6.1 */
+/* */
+/* CALLED BY */
+/* */
+/* USB application */
/* */
/**************************************************************************/
-UINT _ux_host_class_pima_object_move(UX_HOST_CLASS_PIMA *pima,
+UINT _ux_host_class_pima_object_move(UX_HOST_CLASS_PIMA *pima,
UX_HOST_CLASS_PIMA_SESSION *pima_session,
ULONG object_handle,
- ULONG storage_id,
+ ULONG storage_id,
ULONG parent_object_handle)
{
@@ -95,25 +88,25 @@ UINT status;
/* Issue command to get the object info. 3 parameter. */
command.ux_host_class_pima_command_nb_parameters = 3;
-
+
/* Parameter 1 is the Object Handle. */
command.ux_host_class_pima_command_parameter_1 = object_handle;
-
+
/* Parameter 2 is the Storage ID. */
command.ux_host_class_pima_command_parameter_2 = storage_id;
/* Parameter 3 is the Parent Object ID. */
command.ux_host_class_pima_command_parameter_3 = parent_object_handle;
-
+
/* Other parameters unused. */
command.ux_host_class_pima_command_parameter_4 = 0;
command.ux_host_class_pima_command_parameter_5 = 0;
-
+
/* Then set the command to MOVE_OBJECT. */
command.ux_host_class_pima_command_operation_code = UX_HOST_CLASS_PIMA_OC_MOVE_OBJECT;
/* Issue the command. */
- status = _ux_host_class_pima_command(pima, &command, UX_HOST_CLASS_PIMA_DATA_PHASE_NONE , UX_NULL,
+ status = _ux_host_class_pima_command(pima, &command, UX_HOST_CLASS_PIMA_DATA_PHASE_NONE , UX_NULL,
0, 0);
/* Return completion status. */
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 23d14959..8e4acb8b 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
@@ -1,10 +1,11 @@
/***************************************************************************
- * Copyright (c) 2024 Microsoft Corporation
- *
+ * Copyright (c) 2024 Microsoft Corporation
+ * Copyright (c) 2026-present Eclipse ThreadX contributors
+ *
* This program and the accompanying materials are made available under the
* terms of the MIT License which is available at
* https://opensource.org/licenses/MIT.
- *
+ *
* SPDX-License-Identifier: MIT
**************************************************************************/
@@ -61,14 +62,6 @@
/* */
/* USB application */
/* */
-/* RELEASE HISTORY */
-/* */
-/* DATE NAME DESCRIPTION */
-/* */
-/* 05-19-2020 Chaoqiong Xiao Initial Version 6.0 */
-/* 09-30-2020 Chaoqiong Xiao Modified comment(s), */
-/* resulting in version 6.1 */
-/* */
/**************************************************************************/
UINT _ux_host_class_pima_object_open(UX_HOST_CLASS_PIMA *pima,
UX_HOST_CLASS_PIMA_SESSION *pima_session,
@@ -136,12 +129,6 @@ UINT _ux_host_class_pima_object_open(UX_HOST_CLASS_PIMA *pima,
/* */
/* USB application */
/* */
-/* RELEASE HISTORY */
-/* */
-/* DATE NAME DESCRIPTION */
-/* */
-/* 10-31-2023 Yajun xia Initial Version 6.3.0 */
-/* */
/**************************************************************************/
UINT _uxe_host_class_pima_object_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_object_send.c b/common/usbx_host_classes/src/ux_host_class_pima_object_send.c
index 30998092..e51ab08f 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
@@ -1,10 +1,11 @@
/***************************************************************************
- * Copyright (c) 2024 Microsoft Corporation
- *
+ * Copyright (c) 2024 Microsoft Corporation
+ * Copyright (c) 2026-present Eclipse ThreadX contributors
+ *
* This program and the accompanying materials are made available under the
* terms of the MIT License which is available at
* https://opensource.org/licenses/MIT.
- *
+ *
* SPDX-License-Identifier: MIT
**************************************************************************/
@@ -72,20 +73,6 @@
/* */
/* USB application */
/* */
-/* RELEASE HISTORY */
-/* */
-/* 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 */
-/* 01-31-2022 Chaoqiong Xiao Modified comment(s), */
-/* refined macros names, */
-/* resulting in version 6.1.10 */
-/* */
/**************************************************************************/
UINT _ux_host_class_pima_object_send(UX_HOST_CLASS_PIMA *pima,
UX_HOST_CLASS_PIMA_SESSION *pima_session,
@@ -418,12 +405,6 @@ UINT status;
/* */
/* USB application */
/* */
-/* RELEASE HISTORY */
-/* */
-/* DATE NAME DESCRIPTION */
-/* */
-/* 10-31-2023 Yajun xia Initial Version 6.3.0 */
-/* */
/**************************************************************************/
UINT _uxe_host_class_pima_object_send(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_transfer_abort.c b/common/usbx_host_classes/src/ux_host_class_pima_object_transfer_abort.c
index b51c9d6f..c0943e4b 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
@@ -1,10 +1,11 @@
/***************************************************************************
- * Copyright (c) 2024 Microsoft Corporation
- *
+ * Copyright (c) 2024 Microsoft Corporation
+ * Copyright (c) 2026-present Eclipse ThreadX contributors
+ *
* This program and the accompanying materials are made available under the
* terms of the MIT License which is available at
* https://opensource.org/licenses/MIT.
- *
+ *
* SPDX-License-Identifier: MIT
**************************************************************************/
@@ -61,14 +62,6 @@
/* */
/* USB application */
/* */
-/* RELEASE HISTORY */
-/* */
-/* DATE NAME DESCRIPTION */
-/* */
-/* 05-19-2020 Chaoqiong Xiao Initial Version 6.0 */
-/* 09-30-2020 Chaoqiong Xiao Modified comment(s), */
-/* resulting in version 6.1 */
-/* */
/**************************************************************************/
UINT _ux_host_class_pima_object_transfer_abort(UX_HOST_CLASS_PIMA *pima,
UX_HOST_CLASS_PIMA_SESSION *pima_session,
@@ -141,12 +134,6 @@ UINT status;
/* */
/* USB application */
/* */
-/* RELEASE HISTORY */
-/* */
-/* DATE NAME DESCRIPTION */
-/* */
-/* 10-31-2023 Yajun xia Initial Version 6.3.0 */
-/* */
/**************************************************************************/
UINT _uxe_host_class_pima_object_transfer_abort(UX_HOST_CLASS_PIMA *pima,
UX_HOST_CLASS_PIMA_SESSION *pima_session,
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 9f11ccf5..356baf8e 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
@@ -1,18 +1,19 @@
/***************************************************************************
- * Copyright (c) 2024 Microsoft Corporation
- *
+ * Copyright (c) 2024 Microsoft Corporation
+ * Copyright (c) 2026-present Eclipse ThreadX contributors
+ *
* This program and the accompanying materials are made available under the
* terms of the MIT License which is available at
* https://opensource.org/licenses/MIT.
- *
+ *
* SPDX-License-Identifier: MIT
**************************************************************************/
/**************************************************************************/
/**************************************************************************/
-/** */
-/** USBX Component */
+/** */
+/** USBX Component */
/** */
/** Pima Class */
/** */
@@ -33,70 +34,53 @@
#error UX_SLAVE_REQUEST_DATA_MAX_LENGTH too small, please check
#endif
-/**************************************************************************/
-/* */
-/* FUNCTION RELEASE */
-/* */
-/* _ux_host_class_pima_read PORTABLE C */
+/**************************************************************************/
+/* */
+/* FUNCTION RELEASE */
+/* */
+/* _ux_host_class_pima_read PORTABLE C */
/* 6.1.12 */
/* AUTHOR */
/* */
/* Chaoqiong Xiao, Microsoft Corporation */
/* */
/* DESCRIPTION */
-/* */
-/* This function reads a data payload from the Pima device. This */
-/* function first read a header followed by some data. */
+/* */
+/* This function reads a data payload from the Pima device. This */
+/* function first read a header followed by some data. */
/* */
/* Note header only transfer and partial transfer is not accepted. */
-/* */
-/* INPUT */
-/* */
-/* pima Pointer to pima class */
-/* data_pointer Pointer to data to read */
-/* data_length Length of data to read */
-/* callback_function Application function to call */
-/* to get the rest of the data */
-/* max_payload_data Maximum data received in one */
-/* data payload. */
-/* */
-/* OUTPUT */
-/* */
-/* Completion Status */
-/* */
-/* CALLS */
-/* */
-/* _ux_host_stack_transfer_request Process transfer request */
-/* _ux_host_stack_transfer_request_abort Abort transfer request */
+/* */
+/* INPUT */
+/* */
+/* pima Pointer to pima class */
+/* data_pointer Pointer to data to read */
+/* data_length Length of data to read */
+/* callback_function Application function to call */
+/* to get the rest of the data */
+/* max_payload_data Maximum data received in one */
+/* data payload. */
+/* */
+/* OUTPUT */
+/* */
+/* Completion Status */
+/* */
+/* CALLS */
+/* */
+/* _ux_host_stack_transfer_request Process transfer request */
+/* _ux_host_stack_transfer_request_abort Abort transfer request */
/* _ux_host_stack_endpoint_reset Reset endpoint */
-/* _ux_host_semaphore_get Get protection semaphore */
+/* _ux_host_semaphore_get Get protection semaphore */
/* _ux_utility_long_get Get a long 32 bit value */
/* _ux_utility_short_get Get a short 16 bit value */
/* _ux_utility_memory_copy Copy memory */
-/* */
-/* 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), */
-/* prefixed UX to MS_TO_TICK, */
-/* verified memset and memcpy */
-/* cases, */
-/* resulting in version 6.1 */
-/* 01-31-2022 Chaoqiong Xiao Modified comment(s), */
-/* refined macros names, */
-/* resulting in version 6.1.10 */
-/* 07-29-2022 Chaoqiong Xiao Modified comment(s), */
-/* improved length checks, */
-/* resulting in version 6.1.12 */
+/* */
+/* CALLED BY */
+/* */
+/* Application */
/* */
/**************************************************************************/
-UINT _ux_host_class_pima_read(UX_HOST_CLASS_PIMA *pima, UCHAR *data_pointer,
+UINT _ux_host_class_pima_read(UX_HOST_CLASS_PIMA *pima, UCHAR *data_pointer,
ULONG data_length,
ULONG max_payload_length)
@@ -114,10 +98,10 @@ ULONG payload_length;
/* We use the Bulk In pipe for receiving data .. */
transfer_request = &pima -> ux_host_class_pima_bulk_in_endpoint -> ux_endpoint_transfer_request;
-
+
/* Get the pointer to the ptp payload. */
ptp_payload = pima -> ux_host_class_pima_container ;
-
+
/* Calculate the requested length for this payload. */
requested_length = UX_HOST_CLASS_PIMA_CONTAINER_SIZE;
@@ -131,7 +115,7 @@ ULONG payload_length;
/* If the transfer is successful, we need to wait for the transfer request to be completed. */
if (status == UX_SUCCESS)
{
-
+
/* Wait for the completion of the transfer request. */
status = _ux_host_semaphore_get(&transfer_request -> ux_transfer_request_semaphore, UX_MS_TO_TICK(UX_HOST_CLASS_PIMA_CLASS_TRANSFER_TIMEOUT));
@@ -147,10 +131,10 @@ ULONG payload_length;
/* The endpoint was halted by a transfer error and needs to be reset. */
_ux_host_stack_endpoint_reset(pima -> ux_host_class_pima_bulk_out_endpoint);
-
+
/* There was an error, return to the caller. */
return(status);
- }
+ }
}
else
{
@@ -175,11 +159,11 @@ ULONG payload_length;
/* Check for remainder in last packet. */
if ((header_length % pima -> ux_host_class_pima_bulk_in_endpoint -> ux_endpoint_descriptor.wMaxPacketSize) == 0)
-
+
/* We have a ZLP condition on a IN. */
pima -> ux_host_class_pima_zlp_flag = UX_HOST_CLASS_PIMA_ZLP_IN;
else
-
+
/* Do not expect a ZLP. */
pima -> ux_host_class_pima_zlp_flag = UX_HOST_CLASS_PIMA_ZLP_NONE;
@@ -189,18 +173,18 @@ ULONG payload_length;
/* We may have had data in the first packet, if so adjust the data_length. */
data_length = header_length - transfer_request -> ux_transfer_request_actual_length;
-
+
/* Copying the necessary partial memory. */
- _ux_utility_memory_copy(data_pointer, ptp_payload + UX_HOST_CLASS_PIMA_DATA_HEADER_SIZE,
+ _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); /* 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);
-
+
/* Now we can read the data from the device. */
while(data_length)
{
-
+
/* Check if need to split the data payload into smaller packets. */
if (data_length > max_payload_length)
@@ -209,8 +193,8 @@ ULONG payload_length;
else
/* Either this is the last packet or we we have a small packet to send. */
- payload_length = data_length;
-
+ payload_length = data_length;
+
/* Initialize the transfer_request. */
transfer_request -> ux_transfer_request_data_pointer = data_pointer;
transfer_request -> ux_transfer_request_requested_length = payload_length;
@@ -221,7 +205,7 @@ ULONG payload_length;
/* If the transfer is successful, we need to wait for the transfer request to be completed. */
if (status == UX_SUCCESS)
{
-
+
/* Wait for the completion of the transfer request. */
status = _ux_host_semaphore_get(&transfer_request -> ux_transfer_request_semaphore, UX_MS_TO_TICK(UX_HOST_CLASS_PIMA_CLASS_TRANSFER_TIMEOUT));
@@ -231,32 +215,32 @@ ULONG payload_length;
/* All transfers pending need to abort. There may have been a partial transfer. */
_ux_host_stack_transfer_request_abort(transfer_request);
-
+
/* The endpoint was halted by a transfer error and needs to be reset. */
_ux_host_stack_endpoint_reset(pima -> ux_host_class_pima_bulk_in_endpoint);
/* The endpoint was halted by a transfer error and needs to be reset. */
_ux_host_stack_endpoint_reset(pima -> ux_host_class_pima_bulk_out_endpoint);
-
+
/* There was an error, return to the caller. */
return(status);
- }
+ }
}
else
{
/* There was a non transfer error, no partial transfer to be checked */
return(status);
- }
+ }
/* Check for completion of transfer. If the transfer is partial, return to caller.
Partial transfer is not OK. */
if (payload_length != transfer_request -> ux_transfer_request_actual_length)
- return(UX_TRANSFER_ERROR);
+ return(UX_TRANSFER_ERROR);
/* Adjust the total length to transfer. */
data_length -= payload_length;
-
+
/* Adjust the data pointer. */
data_pointer += payload_length;
@@ -265,7 +249,7 @@ ULONG payload_length;
/* If we have a ZLP condition, read from the device one more time with a zero packet. */
if (pima -> ux_host_class_pima_zlp_flag == UX_HOST_CLASS_PIMA_ZLP_IN)
{
-
+
/* Initialize the transfer_request. */
transfer_request -> ux_transfer_request_data_pointer = UX_NULL;
transfer_request -> ux_transfer_request_requested_length = 0;
@@ -276,7 +260,7 @@ ULONG payload_length;
/* If the transfer is successful, we need to wait for the transfer request to be completed. */
if (status == UX_SUCCESS)
{
-
+
/* Wait for the completion of the transfer request. */
status = _ux_host_semaphore_get(&transfer_request -> ux_transfer_request_semaphore, UX_MS_TO_TICK(UX_HOST_CLASS_PIMA_CLASS_TRANSFER_TIMEOUT));
@@ -286,22 +270,22 @@ ULONG payload_length;
/* All transfers pending need to abort. There may have been a partial transfer. */
_ux_host_stack_transfer_request_abort(transfer_request);
-
+
/* The endpoint was halted by a transfer error and needs to be reset. */
_ux_host_stack_endpoint_reset(pima -> ux_host_class_pima_bulk_in_endpoint);
/* The endpoint was halted by a transfer error and needs to be reset. */
_ux_host_stack_endpoint_reset(pima -> ux_host_class_pima_bulk_out_endpoint);
-
+
/* There was an error, return to the caller. */
return(status);
- }
-
+ }
+
/* Reset the ZLP. */
pima -> ux_host_class_pima_zlp_flag = UX_HOST_CLASS_PIMA_ZLP_NONE;
}
- }
-
+ }
+
/* We have finished receiving the data. */
return(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 2d75be66..056d92e7 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
@@ -1,18 +1,19 @@
/***************************************************************************
- * Copyright (c) 2024 Microsoft Corporation
- *
+ * Copyright (c) 2024 Microsoft Corporation
+ * Copyright (c) 2026-present Eclipse ThreadX contributors
+ *
* This program and the accompanying materials are made available under the
* terms of the MIT License which is available at
* https://opensource.org/licenses/MIT.
- *
+ *
* SPDX-License-Identifier: MIT
**************************************************************************/
/**************************************************************************/
/**************************************************************************/
-/** */
-/** USBX Component */
+/** */
+/** USBX Component */
/** */
/** PIMA Class */
/** */
@@ -29,48 +30,40 @@
#include "ux_host_stack.h"
-/**************************************************************************/
-/* */
-/* FUNCTION RELEASE */
-/* */
-/* _ux_host_class_pima_request_cancel PORTABLE C */
+/**************************************************************************/
+/* */
+/* FUNCTION RELEASE */
+/* */
+/* _ux_host_class_pima_request_cancel PORTABLE C */
/* 6.1 */
/* AUTHOR */
/* */
/* Chaoqiong Xiao, Microsoft Corporation */
/* */
/* DESCRIPTION */
-/* */
-/* This function cancels a request. */
-/* INPUT */
-/* */
-/* pima Pointer to pima class */
-/* */
-/* OUTPUT */
-/* */
-/* Completion Status */
-/* */
-/* CALLS */
-/* */
+/* */
+/* This function cancels a request. */
+/* INPUT */
+/* */
+/* pima Pointer to pima class */
+/* */
+/* OUTPUT */
+/* */
+/* Completion Status */
+/* */
+/* CALLS */
+/* */
/* _ux_host_stack_transfer_request Transfer request */
/* _ux_utility_memory_allocate Allocate memory */
/* _ux_utility_memory_free Free memory */
/* _ux_utility_short_put Put 16-bit value */
/* _ux_utility_short_get Get 16-bit value */
/* _ux_utility_long_put Put 32-bit value */
-/* _ux_utility_delay_ms Delay ms */
-/* */
-/* CALLED BY */
-/* */
-/* USB application */
-/* */
-/* RELEASE HISTORY */
-/* */
-/* DATE NAME DESCRIPTION */
-/* */
-/* 05-19-2020 Chaoqiong Xiao Initial Version 6.0 */
-/* 09-30-2020 Chaoqiong Xiao Modified comment(s), */
-/* resulting in version 6.1 */
+/* _ux_utility_delay_ms Delay ms */
+/* */
+/* CALLED BY */
+/* */
+/* USB application */
/* */
/**************************************************************************/
UINT _ux_host_class_pima_request_cancel(UX_HOST_CLASS_PIMA *pima)
@@ -94,13 +87,13 @@ ULONG command_retry_counter;
return(UX_MEMORY_INSUFFICIENT);
/* Fill in the payload buffer with cancellation code. */
- _ux_utility_short_put(request_payload + UX_HOST_CLASS_PIMA_REQUEST_CANCEL_OFFSET_CODE,
+ _ux_utility_short_put(request_payload + UX_HOST_CLASS_PIMA_REQUEST_CANCEL_OFFSET_CODE,
UX_HOST_CLASS_PIMA_REQUEST_CANCEL_CODE );
-
+
/* Fill in the payload buffer with transactionID. */
- _ux_utility_long_put(request_payload + UX_HOST_CLASS_PIMA_REQUEST_CANCEL_OFFSET_TRANSACTION_ID,
+ _ux_utility_long_put(request_payload + UX_HOST_CLASS_PIMA_REQUEST_CANCEL_OFFSET_TRANSACTION_ID,
pima -> ux_host_class_pima_transaction_id++);
-
+
/* We need to get the default control endpoint transfer request pointer. */
control_endpoint = &pima -> ux_host_class_pima_device -> ux_device_control_endpoint;
transfer_request = &control_endpoint -> ux_endpoint_transfer_request;
@@ -134,7 +127,7 @@ ULONG command_retry_counter;
transfer_request -> ux_transfer_request_type = UX_REQUEST_IN | UX_REQUEST_TYPE_CLASS | UX_REQUEST_TARGET_INTERFACE;
transfer_request -> ux_transfer_request_value = 0;
transfer_request -> ux_transfer_request_index = 0;
-
+
/* Send request to HCD layer. */
status = _ux_host_stack_transfer_request(transfer_request);
@@ -153,10 +146,10 @@ ULONG command_retry_counter;
status = UX_ERROR;
break;
}
-
+
/* Extract the device status. */
device_status = _ux_utility_short_get(request_payload + UX_HOST_CLASS_PIMA_REQUEST_STATUS_OFFSET_CODE);
-
+
/* If the device status is OK, we have a successful cancellation. */
if (device_status == UX_HOST_CLASS_PIMA_RC_OK)
{
@@ -164,18 +157,18 @@ ULONG command_retry_counter;
/* Status is OK. exit the command loop. */
status = UX_SUCCESS;
break;
- }
+ }
else
{
/* Force the status to error. */
- status = UX_ERROR;
+ status = UX_ERROR;
/* We should wait a little bit before re-issuing the command. */
- _ux_utility_delay_ms(UX_HOST_CLASS_PIMA_REQUEST_STATUS_COMMAND_DELAY);
-
- }
- }
+ _ux_utility_delay_ms(UX_HOST_CLASS_PIMA_REQUEST_STATUS_COMMAND_DELAY);
+
+ }
+ }
}
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 f475c1e6..cd5c2ce2 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
@@ -1,10 +1,11 @@
/***************************************************************************
- * Copyright (c) 2024 Microsoft Corporation
- *
+ * Copyright (c) 2024 Microsoft Corporation
+ * Copyright (c) 2026-present Eclipse ThreadX contributors
+ *
* This program and the accompanying materials are made available under the
* terms of the MIT License which is available at
* https://opensource.org/licenses/MIT.
- *
+ *
* SPDX-License-Identifier: MIT
**************************************************************************/
@@ -60,16 +61,6 @@
/* */
/* USB application */
/* */
-/* RELEASE HISTORY */
-/* */
-/* DATE NAME DESCRIPTION */
-/* */
-/* 05-19-2020 Chaoqiong Xiao Initial Version 6.0 */
-/* 09-30-2020 Chaoqiong Xiao Modified comment(s), */
-/* resulting in version 6.1 */
-/* 10-31-2023 Yajun xia Modified comment(s), */
-/* resulting in version 6.3.0 */
-/* */
/**************************************************************************/
UINT _ux_host_class_pima_session_close(UX_HOST_CLASS_PIMA *pima, UX_HOST_CLASS_PIMA_SESSION *pima_session)
{
@@ -156,12 +147,6 @@ UINT status;
/* */
/* USB application */
/* */
-/* RELEASE HISTORY */
-/* */
-/* DATE NAME DESCRIPTION */
-/* */
-/* 10-31-2023 Yajun xia Initial Version 6.3.0 */
-/* */
/**************************************************************************/
UINT _uxe_host_class_pima_session_close(UX_HOST_CLASS_PIMA *pima, UX_HOST_CLASS_PIMA_SESSION *pima_session)
{
diff --git a/common/usbx_host_classes/src/ux_host_class_pima_session_open.c b/common/usbx_host_classes/src/ux_host_class_pima_session_open.c
index e24475be..4096ad8d 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
@@ -1,10 +1,11 @@
/***************************************************************************
- * Copyright (c) 2024 Microsoft Corporation
- *
+ * Copyright (c) 2024 Microsoft Corporation
+ * Copyright (c) 2026-present Eclipse ThreadX contributors
+ *
* This program and the accompanying materials are made available under the
* terms of the MIT License which is available at
* https://opensource.org/licenses/MIT.
- *
+ *
* SPDX-License-Identifier: MIT
**************************************************************************/
@@ -62,16 +63,6 @@
/* */
/* USB application */
/* */
-/* RELEASE HISTORY */
-/* */
-/* DATE NAME DESCRIPTION */
-/* */
-/* 05-19-2020 Chaoqiong Xiao Initial Version 6.0 */
-/* 09-30-2020 Chaoqiong Xiao Modified comment(s), */
-/* resulting in version 6.1 */
-/* 10-31-2023 Yajun xia Modified comment(s), */
-/* resulting in version 6.3.0 */
-/* */
/**************************************************************************/
UINT _ux_host_class_pima_session_open(UX_HOST_CLASS_PIMA *pima, UX_HOST_CLASS_PIMA_SESSION *pima_session)
{
@@ -161,12 +152,6 @@ ULONG status;
/* */
/* USB application */
/* */
-/* RELEASE HISTORY */
-/* */
-/* DATE NAME DESCRIPTION */
-/* */
-/* 10-31-2023 Yajun xia Initial Version 6.3.0 */
-/* */
/**************************************************************************/
UINT _uxe_host_class_pima_session_open(UX_HOST_CLASS_PIMA *pima, UX_HOST_CLASS_PIMA_SESSION *pima_session)
{
diff --git a/common/usbx_host_classes/src/ux_host_class_pima_storage_ids_get.c b/common/usbx_host_classes/src/ux_host_class_pima_storage_ids_get.c
index fbc130b5..7a4954c6 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
@@ -1,10 +1,11 @@
/***************************************************************************
- * Copyright (c) 2024 Microsoft Corporation
- *
+ * Copyright (c) 2024 Microsoft Corporation
+ * Copyright (c) 2026-present Eclipse ThreadX contributors
+ *
* This program and the accompanying materials are made available under the
* terms of the MIT License which is available at
* https://opensource.org/licenses/MIT.
- *
+ *
* SPDX-License-Identifier: MIT
**************************************************************************/
@@ -67,17 +68,6 @@
/* */
/* USB application */
/* */
-/* RELEASE HISTORY */
-/* */
-/* DATE NAME DESCRIPTION */
-/* */
-/* 05-19-2020 Chaoqiong Xiao Initial Version 6.0 */
-/* 09-30-2020 Chaoqiong Xiao Modified comment(s), */
-/* resulting in version 6.1 */
-/* 07-29-2022 Chaoqiong Xiao Modified comment(s), */
-/* improved array size check, */
-/* resulting in version 6.1.12 */
-/* */
/**************************************************************************/
UINT _ux_host_class_pima_storage_ids_get(UX_HOST_CLASS_PIMA *pima, UX_HOST_CLASS_PIMA_SESSION *pima_session,
ULONG *storage_ids_array, ULONG storage_id_length)
@@ -197,12 +187,6 @@ ULONG nb_storage_ids;
/* */
/* USB application */
/* */
-/* RELEASE HISTORY */
-/* */
-/* DATE NAME DESCRIPTION */
-/* */
-/* 10-31-2023 Yajun xia Initial Version 6.3.0 */
-/* */
/**************************************************************************/
UINT _uxe_host_class_pima_storage_ids_get(UX_HOST_CLASS_PIMA *pima, UX_HOST_CLASS_PIMA_SESSION *pima_session,
ULONG *storage_ids_array, ULONG storage_id_length)
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 99c568c4..94620d33 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
@@ -1,10 +1,11 @@
/***************************************************************************
- * Copyright (c) 2024 Microsoft Corporation
- *
+ * Copyright (c) 2024 Microsoft Corporation
+ * Copyright (c) 2026-present Eclipse ThreadX contributors
+ *
* This program and the accompanying materials are made available under the
* terms of the MIT License which is available at
* https://opensource.org/licenses/MIT.
- *
+ *
* SPDX-License-Identifier: MIT
**************************************************************************/
@@ -66,21 +67,6 @@
/* */
/* USB application */
/* */
-/* RELEASE HISTORY */
-/* */
-/* DATE NAME DESCRIPTION */
-/* */
-/* 05-19-2020 Chaoqiong Xiao Initial Version 6.0 */
-/* 09-30-2020 Chaoqiong Xiao Modified comment(s), */
-/* verified memset and memcpy */
-/* cases, */
-/* resulting in version 6.1 */
-/* 10-31-2023 Yajun xia Modified comment(s), */
-/* resulting in version 6.3.0 */
-/* xx-xx-xxxx Chaoqiong Xiao Modified comment(s), */
-/* fixed unicode string copy, */
-/* resulting in version 6.x */
-/* */
/**************************************************************************/
UINT _ux_host_class_pima_storage_info_get(UX_HOST_CLASS_PIMA *pima,
UX_HOST_CLASS_PIMA_SESSION *pima_session,
@@ -224,12 +210,6 @@ ULONG unicode_string_length, unicode_string_bytes
/* */
/* USB application */
/* */
-/* RELEASE HISTORY */
-/* */
-/* DATE NAME DESCRIPTION */
-/* */
-/* 10-31-2023 Yajun xia Initial Version 6.3.0 */
-/* */
/**************************************************************************/
UINT _uxe_host_class_pima_storage_info_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_thumb_get.c b/common/usbx_host_classes/src/ux_host_class_pima_thumb_get.c
index d3d6e043..f687b0a0 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
@@ -1,10 +1,11 @@
/***************************************************************************
- * Copyright (c) 2024 Microsoft Corporation
- *
+ * Copyright (c) 2024 Microsoft Corporation
+ * Copyright (c) 2026-present Eclipse ThreadX contributors
+ *
* This program and the accompanying materials are made available under the
* terms of the MIT License which is available at
* https://opensource.org/licenses/MIT.
- *
+ *
* SPDX-License-Identifier: MIT
**************************************************************************/
@@ -70,20 +71,6 @@
/* */
/* USB application */
/* */
-/* RELEASE HISTORY */
-/* */
-/* 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 */
-/* 01-31-2022 Chaoqiong Xiao Modified comment(s), */
-/* refined macros names, */
-/* resulting in version 6.1.10 */
-/* */
/**************************************************************************/
UINT _ux_host_class_pima_thumb_get(UX_HOST_CLASS_PIMA *pima,
UX_HOST_CLASS_PIMA_SESSION *pima_session,
@@ -414,12 +401,6 @@ UINT status;
/* */
/* USB application */
/* */
-/* RELEASE HISTORY */
-/* */
-/* DATE NAME DESCRIPTION */
-/* */
-/* 10-31-2023 Yajun xia Initial Version 6.3.0 */
-/* */
/**************************************************************************/
UINT _uxe_host_class_pima_thumb_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_write.c b/common/usbx_host_classes/src/ux_host_class_pima_write.c
index 6d344035..9de850b9 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
@@ -1,18 +1,19 @@
/***************************************************************************
- * Copyright (c) 2024 Microsoft Corporation
- *
+ * Copyright (c) 2024 Microsoft Corporation
+ * Copyright (c) 2026-present Eclipse ThreadX contributors
+ *
* This program and the accompanying materials are made available under the
* terms of the MIT License which is available at
* https://opensource.org/licenses/MIT.
- *
+ *
* SPDX-License-Identifier: MIT
**************************************************************************/
/**************************************************************************/
/**************************************************************************/
-/** */
-/** USBX Component */
+/** */
+/** USBX Component */
/** */
/** Pima Class */
/** */
@@ -29,66 +30,52 @@
#include "ux_host_stack.h"
-/**************************************************************************/
-/* */
-/* FUNCTION RELEASE */
-/* */
-/* _ux_host_class_pima_write PORTABLE C */
+/**************************************************************************/
+/* */
+/* FUNCTION RELEASE */
+/* */
+/* _ux_host_class_pima_write PORTABLE C */
/* 6.1.10 */
/* AUTHOR */
/* */
/* Chaoqiong Xiao, Microsoft Corporation */
/* */
/* DESCRIPTION */
-/* */
-/* This function writes a data payload to the Pima device. This */
-/* function first write a header followed by some data. */
-/* */
-/* INPUT */
-/* */
-/* pima Pointer to pima class */
-/* data_pointer Pointer to data to write */
-/* data_length Length of data to write */
-/* operation_code Code to send in header (this */
-/* is from the command block */
-/* max_payload_data Maximum data sent in one load */
-/* */
-/* OUTPUT */
-/* */
-/* Completion Status */
-/* */
-/* CALLS */
-/* */
-/* _ux_host_stack_transfer_request Process transfer request */
-/* _ux_host_stack_transfer_request_abort Abort transfer request */
+/* */
+/* This function writes a data payload to the Pima device. This */
+/* function first write a header followed by some data. */
+/* */
+/* INPUT */
+/* */
+/* pima Pointer to pima class */
+/* data_pointer Pointer to data to write */
+/* data_length Length of data to write */
+/* operation_code Code to send in header (this */
+/* is from the command block */
+/* max_payload_data Maximum data sent in one load */
+/* */
+/* OUTPUT */
+/* */
+/* Completion Status */
+/* */
+/* CALLS */
+/* */
+/* _ux_host_stack_transfer_request Process transfer request */
+/* _ux_host_stack_transfer_request_abort Abort transfer request */
/* _ux_host_stack_endpoint_reset Reset endpoint */
/* _ux_utility_memory_copy Copy memory */
-/* _ux_host_semaphore_get Get protection semaphore */
+/* _ux_host_semaphore_get Get protection semaphore */
/* _ux_utility_long_put Put a long 32 bit value */
/* _ux_utility_short_put Put a short 16 bit value */
-/* */
-/* 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), */
-/* prefixed UX to MS_TO_TICK, */
-/* verified memset and memcpy */
-/* cases, */
-/* resulting in version 6.1 */
-/* 01-31-2022 Chaoqiong Xiao Modified comment(s), */
-/* refined macros names, */
-/* resulting in version 6.1.10 */
+/* */
+/* CALLED BY */
+/* */
+/* Application */
/* */
/**************************************************************************/
-UINT _ux_host_class_pima_write(UX_HOST_CLASS_PIMA *pima, UCHAR *data_pointer,
+UINT _ux_host_class_pima_write(UX_HOST_CLASS_PIMA *pima, UCHAR *data_pointer,
ULONG data_length,
- ULONG operation_code,
+ ULONG operation_code,
ULONG max_payload_length)
{
@@ -106,10 +93,10 @@ ULONG payload_length;
/* We use the Bulk Out pipe for receiving data .. */
transfer_request = &pima -> ux_host_class_pima_bulk_out_endpoint -> ux_endpoint_transfer_request;
-
+
/* Get the pointer to the ptp payload. */
ptp_payload = pima -> ux_host_class_pima_container ;
-
+
/* Initialize the transfer_request. */
transfer_request -> ux_transfer_request_data_pointer = ptp_payload;
@@ -118,47 +105,47 @@ ULONG payload_length;
/* Check for remainder in last packet. */
if (((data_length + UX_HOST_CLASS_PIMA_DATA_HEADER_SIZE) % pima -> ux_host_class_pima_bulk_out_endpoint -> ux_endpoint_descriptor.wMaxPacketSize) == 0)
-
+
/* We have a ZLP condition on a OUT. */
pima -> ux_host_class_pima_zlp_flag = UX_HOST_CLASS_PIMA_ZLP_OUT;
else
-
+
/* Do not expect a ZLP. */
pima -> ux_host_class_pima_zlp_flag = UX_HOST_CLASS_PIMA_ZLP_NONE;
/* Container type is a data type. */
*(ptp_payload + UX_HOST_CLASS_PIMA_DATA_HEADER_TYPE) = UX_HOST_CLASS_PIMA_CT_DATA_BLOCK;
-
+
/* Put the operation code. */
*(ptp_payload + UX_HOST_CLASS_PIMA_DATA_HEADER_CODE) = (UCHAR)pima -> ux_host_class_pima_operation_code;
-
+
/* Store the transaction ID. */
- _ux_utility_long_put(ptp_payload + UX_HOST_CLASS_PIMA_DATA_HEADER_TRANSACTION_ID,
+ _ux_utility_long_put(ptp_payload + UX_HOST_CLASS_PIMA_DATA_HEADER_TRANSACTION_ID,
pima -> ux_host_class_pima_transaction_id);
/* Calculate the requested length in the first container. */
requested_length = data_length + UX_HOST_CLASS_PIMA_DATA_HEADER_SIZE;
-
+
/* Can we fill the container ? */
if(requested_length > UX_HOST_CLASS_PIMA_CONTAINER_SIZE)
/* We have more data in the payload than the first container so adjust the length. */
requested_length = UX_HOST_CLASS_PIMA_CONTAINER_SIZE;
-
+
/* Add the data payload to fill that container. */
- _ux_utility_memory_copy(ptp_payload + UX_HOST_CLASS_PIMA_DATA_HEADER_SIZE, data_pointer,
+ _ux_utility_memory_copy(ptp_payload + UX_HOST_CLASS_PIMA_DATA_HEADER_SIZE, data_pointer,
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;
-
+
/* Send request to HCD layer. */
status = _ux_host_stack_transfer_request(transfer_request);
/* If the transfer is successful, we need to wait for the transfer request to be completed. */
if (status == UX_SUCCESS)
{
-
+
/* Wait for the completion of the transfer request. */
status = _ux_host_semaphore_get(&transfer_request -> ux_transfer_request_semaphore, UX_MS_TO_TICK(UX_HOST_CLASS_PIMA_CLASS_TRANSFER_TIMEOUT));
@@ -174,11 +161,11 @@ ULONG payload_length;
/* The endpoint was halted by a transfer error and needs to be reset. */
_ux_host_stack_endpoint_reset(pima -> ux_host_class_pima_bulk_out_endpoint);
-
-
+
+
/* There was an error, return to the caller. */
return(status);
- }
+ }
}
else
{
@@ -189,14 +176,14 @@ ULONG payload_length;
/* Isolate the length of the data payload that still needs to be sent. */
data_length -= (requested_length - UX_HOST_CLASS_PIMA_DATA_HEADER_SIZE);
-
+
/* Adjust the data payload pointer. */
data_pointer += (requested_length - UX_HOST_CLASS_PIMA_DATA_HEADER_SIZE);
-
+
/* Now we can send the data to the device. */
while(data_length)
{
-
+
/* Check if need to split the data payload into smaller packets. */
if (data_length > max_payload_length)
@@ -205,8 +192,8 @@ ULONG payload_length;
else
/* Either this is the last packet or we we have a small packet to send. */
- payload_length = data_length;
-
+ payload_length = data_length;
+
/* Initialize the transfer_request. */
transfer_request -> ux_transfer_request_data_pointer = data_pointer;
transfer_request -> ux_transfer_request_requested_length = payload_length;
@@ -217,7 +204,7 @@ ULONG payload_length;
/* If the transfer is successful, we need to wait for the transfer request to be completed. */
if (status == UX_SUCCESS)
{
-
+
/* Wait for the completion of the transfer request. */
status = _ux_host_semaphore_get(&transfer_request -> ux_transfer_request_semaphore, UX_MS_TO_TICK(UX_HOST_CLASS_PIMA_CLASS_TRANSFER_TIMEOUT));
@@ -227,32 +214,32 @@ ULONG payload_length;
/* All transfers pending need to abort. There may have been a partial transfer. */
_ux_host_stack_transfer_request_abort(transfer_request);
-
+
/* The endpoint was halted by a transfer error and needs to be reset. */
_ux_host_stack_endpoint_reset(pima -> ux_host_class_pima_bulk_in_endpoint);
/* The endpoint was halted by a transfer error and needs to be reset. */
_ux_host_stack_endpoint_reset(pima -> ux_host_class_pima_bulk_out_endpoint);
-
+
/* There was an error, return to the caller. */
return(status);
- }
+ }
}
else
{
/* There was a non transfer error, no partial transfer to be checked */
return(status);
- }
+ }
/* Check for completion of transfer. If the transfer is partial, return to caller.
Partial transfer is not OK. */
if (payload_length != transfer_request -> ux_transfer_request_actual_length)
- return(UX_TRANSFER_ERROR);
+ return(UX_TRANSFER_ERROR);
/* Adjust the total length to transfer. */
data_length -= payload_length;
-
+
/* Adjust the data pointer. */
data_pointer += payload_length;
@@ -261,7 +248,7 @@ ULONG payload_length;
/* If we have a ZLP condition, write the device one more time with a zero packet. */
if (pima -> ux_host_class_pima_zlp_flag == UX_HOST_CLASS_PIMA_ZLP_OUT)
{
-
+
/* Initialize the transfer_request. */
transfer_request -> ux_transfer_request_data_pointer = UX_NULL;
transfer_request -> ux_transfer_request_requested_length = 0;
@@ -272,7 +259,7 @@ ULONG payload_length;
/* If the transfer is successful, we need to wait for the transfer request to be completed. */
if (status == UX_SUCCESS)
{
-
+
/* Wait for the completion of the transfer request. */
status = _ux_host_semaphore_get(&transfer_request -> ux_transfer_request_semaphore, UX_MS_TO_TICK(UX_HOST_CLASS_PIMA_CLASS_TRANSFER_TIMEOUT));
@@ -282,21 +269,21 @@ ULONG payload_length;
/* All transfers pending need to abort. There may have been a partial transfer. */
_ux_host_stack_transfer_request_abort(transfer_request);
-
+
/* The endpoint was halted by a transfer error and needs to be reset. */
_ux_host_stack_endpoint_reset(pima -> ux_host_class_pima_bulk_in_endpoint);
/* The endpoint was halted by a transfer error and needs to be reset. */
_ux_host_stack_endpoint_reset(pima -> ux_host_class_pima_bulk_out_endpoint);
-
+
/* There was an error, return to the caller. */
return(status);
- }
-
+ }
+
/* Reset the ZLP. */
pima -> ux_host_class_pima_zlp_flag = UX_HOST_CLASS_PIMA_ZLP_NONE;
}
- }
+ }
/* We have finished receiving the data. */
return(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 c64ee074..cc501d85 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
@@ -1,10 +1,11 @@
/***************************************************************************
- * Copyright (c) 2024 Microsoft Corporation
- *
+ * Copyright (c) 2024 Microsoft Corporation
+ * Copyright (c) 2026-present Eclipse ThreadX contributors
+ *
* This program and the accompanying materials are made available under the
* terms of the MIT License which is available at
* https://opensource.org/licenses/MIT.
- *
+ *
* SPDX-License-Identifier: MIT
**************************************************************************/
@@ -66,21 +67,6 @@
/* */
/* _ux_host_class_printer_entry Entry of printer class */
/* */
-/* RELEASE HISTORY */
-/* */
-/* DATE NAME DESCRIPTION */
-/* */
-/* 05-19-2020 Chaoqiong Xiao Initial Version 6.0 */
-/* 09-30-2020 Chaoqiong Xiao Modified comment(s), */
-/* resulting in version 6.1 */
-/* 01-31-2022 Chaoqiong Xiao Modified comment(s), */
-/* added standalone support, */
-/* resulting in version 6.1.10 */
-/* 07-29-2022 Chaoqiong Xiao Modified comment(s), */
-/* fixed parameter/variable */
-/* names conflict C++ keyword, */
-/* resulting in version 6.1.12 */
-/* */
/**************************************************************************/
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 28894c91..2a324717 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
@@ -1,18 +1,19 @@
/***************************************************************************
- * Copyright (c) 2024 Microsoft Corporation
- *
+ * Copyright (c) 2024 Microsoft Corporation
+ * Copyright (c) 2026-present Eclipse ThreadX contributors
+ *
* This program and the accompanying materials are made available under the
* terms of the MIT License which is available at
* https://opensource.org/licenses/MIT.
- *
+ *
* SPDX-License-Identifier: MIT
**************************************************************************/
/**************************************************************************/
/**************************************************************************/
-/** */
-/** USBX Component */
+/** */
+/** USBX Component */
/** */
/** Printer Class */
/** */
@@ -29,49 +30,39 @@
#include "ux_host_stack.h"
-/**************************************************************************/
-/* */
-/* FUNCTION RELEASE */
-/* */
-/* _ux_host_class_printer_configure PORTABLE C */
+/**************************************************************************/
+/* */
+/* FUNCTION RELEASE */
+/* */
+/* _ux_host_class_printer_configure PORTABLE C */
/* 6.1 */
/* AUTHOR */
/* */
/* Chaoqiong Xiao, Microsoft Corporation */
/* */
/* DESCRIPTION */
-/* */
+/* */
/* This function calls the USBX stack to do a SET_CONFIGURATION to the */
-/* printer. Once the printer is configured, its interface will be */
-/* activated. The bulk endpoints enumerated(1 IN, 1 OUT ). */
-/* */
-/* INPUT */
-/* */
-/* printer Pointer to printer class */
-/* */
-/* OUTPUT */
-/* */
-/* Completion Status */
-/* */
-/* CALLS */
-/* */
-/* _ux_host_stack_configuration_interface_get Get interface */
-/* _ux_host_stack_device_configuration_get Get configuration */
-/* _ux_host_stack_device_configuration_select Select configuration */
-/* */
-/* CALLED BY */
-/* */
-/* _ux_host_class_printer_activate Printer class activate */
-/* */
-/* 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 */
+/* printer. Once the printer is configured, its interface will be */
+/* activated. The bulk endpoints enumerated(1 IN, 1 OUT ). */
+/* */
+/* INPUT */
+/* */
+/* printer Pointer to printer class */
+/* */
+/* OUTPUT */
+/* */
+/* Completion Status */
+/* */
+/* CALLS */
+/* */
+/* _ux_host_stack_configuration_interface_get Get interface */
+/* _ux_host_stack_device_configuration_get Get configuration */
+/* _ux_host_stack_device_configuration_select Select configuration */
+/* */
+/* CALLED BY */
+/* */
+/* _ux_host_class_printer_activate Printer class activate */
/* */
/**************************************************************************/
UINT _ux_host_class_printer_configure(UX_HOST_CLASS_PRINTER *printer)
@@ -94,29 +85,29 @@ UX_DEVICE *parent_device;
status = _ux_host_stack_device_configuration_get(printer -> ux_host_class_printer_device, 0, &configuration);
if (status != UX_SUCCESS)
{
-
+
/* Error trap. */
_ux_system_error_handler(UX_SYSTEM_LEVEL_THREAD, UX_SYSTEM_CONTEXT_CLASS, UX_CONFIGURATION_HANDLE_UNKNOWN);
/* If trace is enabled, insert this event into the trace buffer. */
UX_TRACE_IN_LINE_INSERT(UX_TRACE_ERROR, UX_CONFIGURATION_HANDLE_UNKNOWN, printer -> ux_host_class_printer_device, 0, 0, UX_TRACE_ERRORS, 0, 0)
-
+
return(UX_CONFIGURATION_HANDLE_UNKNOWN);
}
#if UX_MAX_DEVICES > 1
- /* Check the printer power source and check the parent power source for
+ /* 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)
{
/* Get parent device pointer. */
parent_device = printer -> ux_host_class_printer_device -> ux_device_parent;
-
- /* If the device is NULL, the parent is the root printer and we don't have to worry
+
+ /* If the device is NULL, the parent is the root printer and we don't have to worry
if the parent is not the root printer, check for its power source. */
if ((parent_device != UX_NULL) && (parent_device -> ux_device_power_source == UX_DEVICE_BUS_POWERED))
- {
+ {
/* Error trap. */
_ux_system_error_handler(UX_SYSTEM_LEVEL_THREAD, UX_SYSTEM_CONTEXT_CLASS, UX_CONNECTION_INCOMPATIBLE);
@@ -125,24 +116,24 @@ UX_DEVICE *parent_device;
UX_TRACE_IN_LINE_INSERT(UX_TRACE_ERROR, UX_CONNECTION_INCOMPATIBLE, printer, 0, 0, UX_TRACE_ERRORS, 0, 0)
return(UX_CONNECTION_INCOMPATIBLE);
- }
+ }
}
#endif
- /* We have the valid configuration. Ask the USBX stack to set this configuration. */
+ /* 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)
return(status);
- /* If the operation went well, the printer default alternate setting for the printer interface is
- active and the interrupt endpoint is now enabled. We have to memorize the first interface since
+ /* If the operation went well, the printer default alternate setting for the printer interface is
+ active and the interrupt endpoint is now enabled. We have to memorize the first interface since
the interrupt endpoint is hooked to it. */
status = _ux_host_stack_configuration_interface_get(configuration, 0, 0, &printer -> ux_host_class_printer_interface);
if (status != UX_SUCCESS)
{
/* Store the instance in the interface container, this is for the USB stack
- when it needs to invoke the class. */
+ when it needs to invoke the class. */
printer -> ux_host_class_printer_interface -> ux_interface_class_instance = (VOID *) printer;
}
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 ed3e96ea..ac10359c 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
@@ -1,10 +1,11 @@
/***************************************************************************
- * Copyright (c) 2024 Microsoft Corporation
- *
+ * Copyright (c) 2024 Microsoft Corporation
+ * Copyright (c) 2026-present Eclipse ThreadX contributors
+ *
* This program and the accompanying materials are made available under the
* terms of the MIT License which is available at
* https://opensource.org/licenses/MIT.
- *
+ *
* SPDX-License-Identifier: MIT
**************************************************************************/
@@ -67,17 +68,6 @@
/* */
/* _ux_host_class_printer_entry Entry of printer class */
/* */
-/* RELEASE HISTORY */
-/* */
-/* DATE NAME DESCRIPTION */
-/* */
-/* 05-19-2020 Chaoqiong Xiao Initial Version 6.0 */
-/* 09-30-2020 Chaoqiong Xiao Modified comment(s), */
-/* resulting in version 6.1 */
-/* 01-31-2022 Chaoqiong Xiao Modified comment(s), */
-/* added standalone support, */
-/* resulting in version 6.1.10 */
-/* */
/**************************************************************************/
UINT _ux_host_class_printer_deactivate(UX_HOST_CLASS_COMMAND *command)
{
diff --git a/common/usbx_host_classes/src/ux_host_class_printer_device_id_get.c b/common/usbx_host_classes/src/ux_host_class_printer_device_id_get.c
index 241a267b..a7ef7e93 100644
--- a/common/usbx_host_classes/src/ux_host_class_printer_device_id_get.c
+++ b/common/usbx_host_classes/src/ux_host_class_printer_device_id_get.c
@@ -1,10 +1,11 @@
/***************************************************************************
- * Copyright (c) 2024 Microsoft Corporation
- *
+ * Copyright (c) 2024 Microsoft Corporation
+ * Copyright (c) 2026-present Eclipse ThreadX contributors
+ *
* This program and the accompanying materials are made available under the
* terms of the MIT License which is available at
* https://opensource.org/licenses/MIT.
- *
+ *
* SPDX-License-Identifier: MIT
**************************************************************************/
@@ -70,22 +71,6 @@
/* */
/* Application */
/* */
-/* RELEASE HISTORY */
-/* */
-/* DATE NAME DESCRIPTION */
-/* */
-/* 02-02-2021 Chaoqiong Xiao Initial Version 6.1.4 */
-/* 01-31-2022 Chaoqiong Xiao Modified comment(s), */
-/* added standalone support, */
-/* resulting in version 6.1.10 */
-/* 07-29-2022 Chaoqiong Xiao Modified comment(s), */
-/* fixed parameter/variable */
-/* names conflict C++ keyword, */
-/* resulting in version 6.1.12 */
-/* 10-31-2023 Chaoqiong Xiao Modified comment(s), */
-/* fixed compile warnings, */
-/* resulting in version 6.3.0 */
-/* */
/**************************************************************************/
UINT _ux_host_class_printer_device_id_get(UX_HOST_CLASS_PRINTER *printer, UCHAR *descriptor_buffer, ULONG length)
{
@@ -198,12 +183,6 @@ UINT status;
/* */
/* Application */
/* */
-/* RELEASE HISTORY */
-/* */
-/* DATE NAME DESCRIPTION */
-/* */
-/* 10-31-2023 Yajun xia Initial Version 6.3.0 */
-/* */
/**************************************************************************/
UINT _uxe_host_class_printer_device_id_get(UX_HOST_CLASS_PRINTER *printer, UCHAR *descriptor_buffer, ULONG length)
{
diff --git a/common/usbx_host_classes/src/ux_host_class_printer_endpoints_get.c b/common/usbx_host_classes/src/ux_host_class_printer_endpoints_get.c
index 83fb68bf..07dcaaf7 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
@@ -1,18 +1,19 @@
/***************************************************************************
- * Copyright (c) 2024 Microsoft Corporation
- *
+ * Copyright (c) 2024 Microsoft Corporation
+ * Copyright (c) 2026-present Eclipse ThreadX contributors
+ *
* This program and the accompanying materials are made available under the
* terms of the MIT License which is available at
* https://opensource.org/licenses/MIT.
- *
+ *
* SPDX-License-Identifier: MIT
**************************************************************************/
/**************************************************************************/
/**************************************************************************/
-/** */
-/** USBX Component */
+/** */
+/** USBX Component */
/** */
/** Printer Class */
/** */
@@ -29,47 +30,36 @@
#include "ux_host_stack.h"
-/**************************************************************************/
-/* */
-/* FUNCTION RELEASE */
-/* */
-/* _ux_host_class_printer_endpoints_get PORTABLE C */
+/**************************************************************************/
+/* */
+/* FUNCTION RELEASE */
+/* */
+/* _ux_host_class_printer_endpoints_get PORTABLE C */
/* 6.1.10 */
/* AUTHOR */
/* */
/* Chaoqiong Xiao, Microsoft Corporation */
/* */
/* DESCRIPTION */
-/* */
+/* */
/* This function search for the handle of the bulk out endpoint and */
-/* optionally the bulk in endpoint of the printer is bidirectional. */
-/* */
-/* INPUT */
-/* */
-/* printer Pointer to printer class */
-/* */
-/* OUTPUT */
-/* */
-/* Completion Status */
-/* */
-/* CALLS */
-/* */
-/* _ux_host_stack_interface_endpoint_get Get interface endpoint */
-/* */
-/* CALLED BY */
-/* */
-/* _ux_host_class_printer_activate Activate printer class */
-/* */
-/* RELEASE HISTORY */
-/* */
-/* DATE NAME DESCRIPTION */
-/* */
-/* 05-19-2020 Chaoqiong Xiao Initial Version 6.0 */
-/* 09-30-2020 Chaoqiong Xiao Modified comment(s), */
-/* resulting in version 6.1 */
-/* 01-31-2022 Chaoqiong Xiao Modified comment(s), */
-/* initialized timeout values, */
-/* resulting in version 6.1.10 */
+/* optionally the bulk in endpoint of the printer is bidirectional. */
+/* */
+/* INPUT */
+/* */
+/* printer Pointer to printer class */
+/* */
+/* OUTPUT */
+/* */
+/* Completion Status */
+/* */
+/* CALLS */
+/* */
+/* _ux_host_stack_interface_endpoint_get Get interface endpoint */
+/* */
+/* CALLED BY */
+/* */
+/* _ux_host_class_printer_activate Activate printer class */
/* */
/**************************************************************************/
UINT _ux_host_class_printer_endpoints_get(UX_HOST_CLASS_PRINTER *printer)
@@ -83,7 +73,7 @@ UX_ENDPOINT *endpoint;
/* Search the bulk OUT endpoint. It is attached to the interface container. */
for (endpoint_index = 0; endpoint_index < printer -> ux_host_class_printer_interface -> ux_interface_descriptor.bNumEndpoints;
endpoint_index++)
- {
+ {
/* Get interface endpoint. */
status = _ux_host_stack_interface_endpoint_get(printer -> ux_host_class_printer_interface, endpoint_index, &endpoint);
@@ -108,8 +98,8 @@ UX_ENDPOINT *endpoint;
printer -> ux_host_class_printer_bulk_out_endpoint = endpoint;
break;
}
- }
- }
+ }
+ }
/* The bulk out endpoint is mandatory. */
if (printer -> ux_host_class_printer_bulk_out_endpoint == UX_NULL)
@@ -120,18 +110,18 @@ UX_ENDPOINT *endpoint;
return(UX_ENDPOINT_HANDLE_UNKNOWN);
}
-
+
/* Search the bulk IN endpoint. This endpoint is optional and only valid for
bidirectional printers. It is attached to the interface container. */
- if ((printer -> ux_host_class_printer_interface -> ux_interface_descriptor.bInterfaceProtocol ==
+ if ((printer -> ux_host_class_printer_interface -> ux_interface_descriptor.bInterfaceProtocol ==
UX_HOST_CLASS_PRINTER_PROTOCOL_BI_DIRECTIONAL) ||
- (printer -> ux_host_class_printer_interface -> ux_interface_descriptor.bInterfaceProtocol ==
+ (printer -> ux_host_class_printer_interface -> ux_interface_descriptor.bInterfaceProtocol ==
UX_HOST_CLASS_PRINTER_PROTOCOL_IEEE_1284_4_BI_DIR))
- {
+ {
for (endpoint_index = 0; endpoint_index < printer -> ux_host_class_printer_interface -> ux_interface_descriptor.bNumEndpoints;
endpoint_index++)
- {
+ {
/* Get the endpoint handle. */
status = _ux_host_stack_interface_endpoint_get(printer -> ux_host_class_printer_interface, endpoint_index, &endpoint);
@@ -156,8 +146,8 @@ UX_ENDPOINT *endpoint;
printer -> ux_host_class_printer_bulk_in_endpoint = endpoint;
break;
}
- }
- }
+ }
+ }
/* The bulk in endpoint is mandatory for these protocol. */
if (printer -> ux_host_class_printer_bulk_in_endpoint == UX_NULL)
@@ -168,7 +158,7 @@ UX_ENDPOINT *endpoint;
return(UX_ENDPOINT_HANDLE_UNKNOWN);
}
- }
+ }
/* All endpoints have been mounted. */
return(UX_SUCCESS);
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 7c222428..0e82e0e3 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
@@ -1,18 +1,19 @@
/***************************************************************************
- * Copyright (c) 2024 Microsoft Corporation
- *
+ * Copyright (c) 2024 Microsoft Corporation
+ * Copyright (c) 2026-present Eclipse ThreadX contributors
+ *
* This program and the accompanying materials are made available under the
* terms of the MIT License which is available at
* https://opensource.org/licenses/MIT.
- *
+ *
* SPDX-License-Identifier: MIT
**************************************************************************/
/**************************************************************************/
/**************************************************************************/
-/** */
-/** USBX Component */
+/** */
+/** USBX Component */
/** */
/** Printer Class */
/** */
@@ -44,54 +45,38 @@ extern VOID _ux_host_class_printer_name_parse(UX_HOST_CLASS_PRINTER *printer,
static inline UINT _ux_host_class_printer_activate_wait(UX_HOST_CLASS_COMMAND *command);
#endif
-/**************************************************************************/
-/* */
-/* FUNCTION RELEASE */
-/* */
-/* _ux_host_class_printer_entry PORTABLE C */
+/**************************************************************************/
+/* */
+/* FUNCTION RELEASE */
+/* */
+/* _ux_host_class_printer_entry PORTABLE C */
/* 6.1.12 */
/* AUTHOR */
/* */
/* Chaoqiong Xiao, Microsoft Corporation */
/* */
/* DESCRIPTION */
-/* */
-/* This function is the entry point of the printer class. It will be */
-/* called by the USBX stack enumeration module when there is a new */
-/* printer on the bus or when the USB printer is removed. */
-/* */
-/* INPUT */
-/* */
-/* command Printer class command */
-/* */
-/* OUTPUT */
-/* */
-/* Completion Status */
-/* */
-/* CALLS */
-/* */
-/* _ux_host_class_printer_activate Activate printer class */
-/* _ux_host_class_printer_deactivate Deactivate printer class */
-/* */
-/* CALLED BY */
-/* */
-/* Printer Class */
-/* */
-/* RELEASE HISTORY */
-/* */
-/* DATE NAME DESCRIPTION */
-/* */
-/* 05-19-2020 Chaoqiong Xiao Initial Version 6.0 */
-/* 09-30-2020 Chaoqiong Xiao Modified comment(s), */
-/* resulting in version 6.1 */
-/* 01-31-2022 Chaoqiong Xiao Modified comment(s), */
-/* added standalone support, */
-/* resulting in version 6.1.10 */
-/* 07-29-2022 Chaoqiong Xiao Modified comment(s), */
-/* removed compile warning, */
-/* fixed parameter/variable */
-/* names conflict C++ keyword, */
-/* resulting in version 6.1.12 */
+/* */
+/* This function is the entry point of the printer class. It will be */
+/* called by the USBX stack enumeration module when there is a new */
+/* printer on the bus or when the USB printer is removed. */
+/* */
+/* INPUT */
+/* */
+/* command Printer class command */
+/* */
+/* OUTPUT */
+/* */
+/* Completion Status */
+/* */
+/* CALLS */
+/* */
+/* _ux_host_class_printer_activate Activate printer class */
+/* _ux_host_class_printer_deactivate Deactivate printer class */
+/* */
+/* CALLED BY */
+/* */
+/* Printer Class */
/* */
/**************************************************************************/
UINT _ux_host_class_printer_entry(UX_HOST_CLASS_COMMAND *command)
@@ -111,10 +96,10 @@ UINT status;
this device or not. */
if((command -> ux_host_class_command_usage == UX_HOST_CLASS_COMMAND_USAGE_CSP) &&
(command -> ux_host_class_command_class == UX_HOST_CLASS_PRINTER_CLASS))
- return(UX_SUCCESS);
- else
- return(UX_NO_CLASS_MATCH);
-
+ return(UX_SUCCESS);
+ else
+ return(UX_NO_CLASS_MATCH);
+
case UX_HOST_CLASS_COMMAND_ACTIVATE:
/* The activate command is used when the device inserted has found a parent and
@@ -130,18 +115,18 @@ UINT status;
case UX_HOST_CLASS_COMMAND_DEACTIVATE:
- /* The deactivate command is used when the device has been extracted either
+ /* The deactivate command is used when the device has been extracted either
directly or when its parents has been extracted. */
status = _ux_host_class_printer_deactivate(command);
return(status);
- default:
-
+ default:
+
/* 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)
return(UX_FUNCTION_NOT_SUPPORTED);
- }
+ }
}
#if defined(UX_HOST_STANDALONE)
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 40914b13..1047e53b 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
@@ -1,10 +1,11 @@
/***************************************************************************
- * Copyright (c) 2024 Microsoft Corporation
- *
+ * Copyright (c) 2024 Microsoft Corporation
+ * Copyright (c) 2026-present Eclipse ThreadX contributors
+ *
* This program and the accompanying materials are made available under the
* terms of the MIT License which is available at
* https://opensource.org/licenses/MIT.
- *
+ *
* SPDX-License-Identifier: MIT
**************************************************************************/
@@ -155,30 +156,6 @@ UINT printer_name_length;
/* */
/* Printer Class */
/* */
-/* RELEASE HISTORY */
-/* */
-/* DATE NAME DESCRIPTION */
-/* */
-/* 05-19-2020 Chaoqiong Xiao Initial Version 6.0 */
-/* 09-30-2020 Chaoqiong Xiao Modified comment(s), */
-/* verified memset and memcpy */
-/* cases, */
-/* resulting in version 6.1 */
-/* 02-02-2021 Chaoqiong Xiao Modified comment(s), */
-/* supported interface other */
-/* than number zero, */
-/* resulting in version 6.1.4 */
-/* 01-31-2022 Chaoqiong Xiao Modified comment(s), */
-/* added standalone support, */
-/* resulting in version 6.1.10 */
-/* 07-29-2022 Chaoqiong Xiao Modified comment(s), */
-/* fixed parameter/variable */
-/* names conflict C++ keyword, */
-/* resulting in version 6.1.12 */
-/* 10-31-2023 Chaoqiong Xiao Modified comment(s), */
-/* fixed compile warnings, */
-/* resulting in version 6.3.0 */
-/* */
/**************************************************************************/
UINT _ux_host_class_printer_name_get(UX_HOST_CLASS_PRINTER *printer)
{
@@ -271,12 +248,6 @@ UINT status;
/* */
/* Application */
/* */
-/* RELEASE HISTORY */
-/* */
-/* DATE NAME DESCRIPTION */
-/* */
-/* 10-31-2023 Yajun xia Initial Version 6.3.0 */
-/* */
/**************************************************************************/
UINT _uxe_host_class_printer_name_get(UX_HOST_CLASS_PRINTER *printer)
{
diff --git a/common/usbx_host_classes/src/ux_host_class_printer_read.c b/common/usbx_host_classes/src/ux_host_class_printer_read.c
index 409278f1..1a1d0a58 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
@@ -1,10 +1,11 @@
/***************************************************************************
- * Copyright (c) 2024 Microsoft Corporation
- *
+ * Copyright (c) 2024 Microsoft Corporation
+ * Copyright (c) 2026-present Eclipse ThreadX contributors
+ *
* This program and the accompanying materials are made available under the
* terms of the MIT License which is available at
* https://opensource.org/licenses/MIT.
- *
+ *
* SPDX-License-Identifier: MIT
**************************************************************************/
@@ -70,19 +71,6 @@
/* */
/* Application */
/* */
-/* RELEASE HISTORY */
-/* */
-/* 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 */
-/* 01-31-2022 Chaoqiong Xiao Modified comment(s), */
-/* added standalone support, */
-/* adjusted bi-dir check, */
-/* resulting in version 6.1.10 */
-/* */
/**************************************************************************/
UINT _ux_host_class_printer_read (UX_HOST_CLASS_PRINTER *printer, UCHAR *data_pointer,
ULONG requested_length, ULONG *actual_length)
@@ -303,12 +291,6 @@ ULONG transfer_request_length;
/* */
/* Application */
/* */
-/* RELEASE HISTORY */
-/* */
-/* DATE NAME DESCRIPTION */
-/* */
-/* 10-31-2023 Yajun xia Initial Version 6.3.0 */
-/* */
/**************************************************************************/
UINT _uxe_host_class_printer_read (UX_HOST_CLASS_PRINTER *printer, UCHAR *data_pointer,
ULONG requested_length, ULONG *actual_length)
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 1a89e01a..1f60b6da 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
@@ -1,10 +1,11 @@
/***************************************************************************
- * Copyright (c) 2024 Microsoft Corporation
- *
+ * Copyright (c) 2024 Microsoft Corporation
+ * Copyright (c) 2026-present Eclipse ThreadX contributors
+ *
* This program and the accompanying materials are made available under the
* terms of the MIT License which is available at
* https://opensource.org/licenses/MIT.
- *
+ *
* SPDX-License-Identifier: MIT
**************************************************************************/
@@ -62,25 +63,6 @@
/* */
/* Application */
/* */
-/* RELEASE HISTORY */
-/* */
-/* DATE NAME DESCRIPTION */
-/* */
-/* 05-19-2020 Chaoqiong Xiao Initial Version 6.0 */
-/* 09-30-2020 Chaoqiong Xiao Modified comment(s), */
-/* resulting in version 6.1 */
-/* 02-02-2021 Chaoqiong Xiao Modified comment(s), */
-/* supported interface other */
-/* than number zero, */
-/* resulting in version 6.1.4 */
-/* 01-31-2022 Chaoqiong Xiao Modified comment(s), */
-/* added standalone support, */
-/* resulting in version 6.1.10 */
-/* 07-29-2022 Chaoqiong Xiao Modified comment(s), */
-/* fixed parameter/variable */
-/* names conflict C++ keyword, */
-/* resulting in version 6.1.12 */
-/* */
/**************************************************************************/
UINT _ux_host_class_printer_soft_reset(UX_HOST_CLASS_PRINTER *printer)
{
@@ -201,12 +183,6 @@ UINT status;
/* */
/* Application */
/* */
-/* RELEASE HISTORY */
-/* */
-/* DATE NAME DESCRIPTION */
-/* */
-/* 10-31-2023 Yajun xia Initial Version 6.3.0 */
-/* */
/**************************************************************************/
UINT _uxe_host_class_printer_soft_reset(UX_HOST_CLASS_PRINTER *printer)
{
diff --git a/common/usbx_host_classes/src/ux_host_class_printer_status_get.c b/common/usbx_host_classes/src/ux_host_class_printer_status_get.c
index 9cc2696d..e82faa4f 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
@@ -1,10 +1,11 @@
/***************************************************************************
- * Copyright (c) 2024 Microsoft Corporation
- *
+ * Copyright (c) 2024 Microsoft Corporation
+ * Copyright (c) 2026-present Eclipse ThreadX contributors
+ *
* This program and the accompanying materials are made available under the
* terms of the MIT License which is available at
* https://opensource.org/licenses/MIT.
- *
+ *
* SPDX-License-Identifier: MIT
**************************************************************************/
@@ -67,25 +68,6 @@
/* */
/* Application */
/* */
-/* RELEASE HISTORY */
-/* */
-/* DATE NAME DESCRIPTION */
-/* */
-/* 05-19-2020 Chaoqiong Xiao Initial Version 6.0 */
-/* 09-30-2020 Chaoqiong Xiao Modified comment(s), */
-/* resulting in version 6.1 */
-/* 02-02-2021 Chaoqiong Xiao Modified comment(s), */
-/* supported interface other */
-/* than number zero, */
-/* resulting in version 6.1.4 */
-/* 01-31-2022 Chaoqiong Xiao Modified comment(s), */
-/* added standalone support, */
-/* resulting in version 6.1.10 */
-/* 07-29-2022 Chaoqiong Xiao Modified comment(s), */
-/* fixed parameter/variable */
-/* names conflict C++ keyword, */
-/* resulting in version 6.1.12 */
-/* */
/**************************************************************************/
UINT _ux_host_class_printer_status_get(UX_HOST_CLASS_PRINTER *printer, ULONG *printer_status)
{
@@ -240,12 +222,6 @@ UCHAR * printer_status_buffer;
/* */
/* Application */
/* */
-/* RELEASE HISTORY */
-/* */
-/* DATE NAME DESCRIPTION */
-/* */
-/* 10-31-2023 Yajun xia Initial Version 6.3.0 */
-/* */
/**************************************************************************/
UINT _uxe_host_class_printer_status_get(UX_HOST_CLASS_PRINTER *printer, ULONG *printer_status)
{
diff --git a/common/usbx_host_classes/src/ux_host_class_printer_write.c b/common/usbx_host_classes/src/ux_host_class_printer_write.c
index cedb2f30..111b0cb5 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
@@ -1,10 +1,11 @@
/***************************************************************************
- * Copyright (c) 2024 Microsoft Corporation
- *
+ * Copyright (c) 2024 Microsoft Corporation
+ * Copyright (c) 2026-present Eclipse ThreadX contributors
+ *
* This program and the accompanying materials are made available under the
* terms of the MIT License which is available at
* https://opensource.org/licenses/MIT.
- *
+ *
* SPDX-License-Identifier: MIT
**************************************************************************/
@@ -67,21 +68,6 @@
/* */
/* Application */
/* */
-/* RELEASE HISTORY */
-/* */
-/* 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 */
-/* 10-15-2021 Chaoqiong Xiao Modified comment(s), */
-/* fixed ZLP sending issue, */
-/* resulting in version 6.1.9 */
-/* 01-31-2022 Chaoqiong Xiao Modified comment(s), */
-/* added standalone support, */
-/* resulting in version 6.1.10 */
-/* */
/**************************************************************************/
UINT _ux_host_class_printer_write(UX_HOST_CLASS_PRINTER *printer, UCHAR * data_pointer,
ULONG requested_length, ULONG *actual_length)
@@ -286,12 +272,6 @@ ULONG transfer_request_length;
/* */
/* Application */
/* */
-/* RELEASE HISTORY */
-/* */
-/* DATE NAME DESCRIPTION */
-/* */
-/* 10-31-2023 Yajun xia Initial Version 6.3.0 */
-/* */
/**************************************************************************/
UINT _uxe_host_class_printer_write(UX_HOST_CLASS_PRINTER *printer, UCHAR * data_pointer,
ULONG requested_length, ULONG *actual_length)
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 5866c5da..e2afb35f 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
@@ -1,18 +1,19 @@
/***************************************************************************
- * Copyright (c) 2024 Microsoft Corporation
- *
+ * Copyright (c) 2024 Microsoft Corporation
+ * Copyright (c) 2026-present Eclipse ThreadX contributors
+ *
* This program and the accompanying materials are made available under the
* terms of the MIT License which is available at
* https://opensource.org/licenses/MIT.
- *
+ *
* SPDX-License-Identifier: MIT
**************************************************************************/
/**************************************************************************/
/**************************************************************************/
-/** */
-/** USBX Component */
+/** */
+/** USBX Component */
/** */
/** Prolific Class */
/** */
@@ -29,54 +30,43 @@
#include "ux_host_stack.h"
-/**************************************************************************/
-/* */
-/* FUNCTION RELEASE */
-/* */
-/* _ux_host_class_prolific_activate PORTABLE C */
+/**************************************************************************/
+/* */
+/* FUNCTION RELEASE */
+/* */
+/* _ux_host_class_prolific_activate PORTABLE C */
/* 6.1.10 */
/* AUTHOR */
/* */
/* Chaoqiong Xiao, Microsoft Corporation */
/* */
/* DESCRIPTION */
-/* */
-/* This function creates the prolific instance, configure the device. */
-/* */
-/* INPUT */
-/* */
-/* command DLC class command pointer */
-/* */
-/* OUTPUT */
-/* */
-/* Completion Status */
-/* */
-/* CALLS */
-/* */
-/* _ux_host_class_prolific_configure Configure prolific class */
+/* */
+/* This function creates the prolific instance, configure the device. */
+/* */
+/* INPUT */
+/* */
+/* command DLC class command pointer */
+/* */
+/* OUTPUT */
+/* */
+/* Completion Status */
+/* */
+/* CALLS */
+/* */
+/* _ux_host_class_prolific_configure Configure prolific class */
/* _ux_host_class_prolific_endpoints_get Get endpoints of prolific */
-/* _ux_host_class_prolific_setup Set up prolific device */
-/* _ux_host_stack_class_instance_create Create class instance */
-/* _ux_host_stack_class_instance_destroy Destroy the class instance */
-/* _ux_utility_memory_allocate Allocate memory block */
-/* _ux_utility_memory_free Free memory block */
+/* _ux_host_class_prolific_setup Set up prolific device */
+/* _ux_host_stack_class_instance_create Create class instance */
+/* _ux_host_stack_class_instance_destroy Destroy the class instance */
+/* _ux_utility_memory_allocate Allocate memory block */
+/* _ux_utility_memory_free Free memory block */
/* _ux_host_semaphore_create Create prolific semaphore */
/* _ux_host_class_prolific_ioctl IOCTL function for DLC */
-/* */
-/* CALLED BY */
-/* */
-/* _ux_host_class_prolific_entry Entry of prolific class */
-/* */
-/* RELEASE HISTORY */
-/* */
-/* DATE NAME DESCRIPTION */
-/* */
-/* 05-19-2020 Chaoqiong Xiao Initial Version 6.0 */
-/* 09-30-2020 Chaoqiong Xiao Modified comment(s), */
-/* resulting in version 6.1 */
-/* 01-31-2022 Chaoqiong Xiao Modified comment(s), */
-/* refined macros names, */
-/* resulting in version 6.1.10 */
+/* */
+/* CALLED BY */
+/* */
+/* _ux_host_class_prolific_entry Entry of prolific class */
/* */
/**************************************************************************/
UINT _ux_host_class_prolific_activate(UX_HOST_CLASS_COMMAND *command)
@@ -103,16 +93,16 @@ UINT status;
prolific -> ux_host_class_prolific_device = device;
/* Store the instance in the device container, this is for the USBX stack
- when it needs to invoke the class for deactivation. */
+ when it needs to invoke the class for deactivation. */
device -> ux_device_class_instance = (VOID *) prolific;
/* Create this class instance. */
_ux_host_stack_class_instance_create(prolific -> ux_host_class_prolific_class, (VOID *) prolific);
/* Configure the prolific. */
- status = _ux_host_class_prolific_configure(prolific);
+ status = _ux_host_class_prolific_configure(prolific);
- /* Get the prolific endpoint(s). We need to search for Bulk Out and Bulk In endpoints
+ /* Get the prolific endpoint(s). We need to search for Bulk Out and Bulk In endpoints
and the interrupt endpoint. */
if (status == UX_SUCCESS)
status = _ux_host_class_prolific_endpoints_get(prolific);
@@ -122,7 +112,7 @@ UINT status;
{
/* Store chip version for further reference. */
- prolific -> ux_host_class_prolific_version = device -> ux_device_descriptor.bcdDevice;
+ prolific -> ux_host_class_prolific_version = device -> ux_device_descriptor.bcdDevice;
/* Mark the prolific instance as mounting now. */
prolific -> ux_host_class_prolific_state = UX_HOST_CLASS_INSTANCE_MOUNTING;
@@ -149,7 +139,7 @@ UINT status;
line_state.ux_host_class_prolific_line_state_dtr = 1;
status = _ux_host_class_prolific_ioctl(prolific, UX_HOST_CLASS_PROLIFIC_IOCTL_SET_LINE_STATE, (VOID *) &line_state);
}
-
+
/* Create the semaphore to protect 2 threads from accessing the same prolific instance. */
if (status == UX_SUCCESS)
{
@@ -169,7 +159,7 @@ UINT status;
if a function has been programmed in the system structure. */
if (_ux_system_host -> ux_system_host_change_function != UX_NULL)
{
-
+
/* Call system change function. */
_ux_system_host -> ux_system_host_change_function(UX_DEVICE_INSERTION, prolific -> ux_host_class_prolific_class, (VOID *) prolific);
}
@@ -191,6 +181,6 @@ UINT status;
_ux_utility_memory_free(prolific);
/* Return completion status. */
- return(status);
+ return(status);
}
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 acac6c12..ba5ff5e1 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
@@ -1,10 +1,11 @@
/***************************************************************************
- * Copyright (c) 2024 Microsoft Corporation
- *
+ * Copyright (c) 2024 Microsoft Corporation
+ * Copyright (c) 2026-present Eclipse ThreadX contributors
+ *
* This program and the accompanying materials are made available under the
* terms of the MIT License which is available at
* https://opensource.org/licenses/MIT.
- *
+ *
* SPDX-License-Identifier: MIT
**************************************************************************/
@@ -71,19 +72,6 @@
/* */
/* Application */
/* */
-/* RELEASE HISTORY */
-/* */
-/* DATE NAME DESCRIPTION */
-/* */
-/* 05-19-2020 Chaoqiong Xiao Initial Version 6.0 */
-/* 09-30-2020 Chaoqiong Xiao Modified comment(s), */
-/* resulting in version 6.1 */
-/* 01-31-2022 Chaoqiong Xiao Modified comment(s), */
-/* refined macros names, */
-/* resulting in version 6.1.10 */
-/* 10-31-2023 Yajun xia Modified comment(s), */
-/* resulting in version 6.3.0 */
-/* */
/**************************************************************************/
UINT _ux_host_class_prolific_command(UX_HOST_CLASS_PROLIFIC *prolific, ULONG command,
ULONG value, UCHAR *data_buffer, ULONG data_length)
@@ -159,12 +147,6 @@ UINT status;
/* */
/* Application */
/* */
-/* RELEASE HISTORY */
-/* */
-/* DATE NAME DESCRIPTION */
-/* */
-/* 10-31-2023 Chaoqiong Xiao Initial Version 6.3.0 */
-/* */
/**************************************************************************/
UINT _uxe_host_class_prolific_command(UX_HOST_CLASS_PROLIFIC *prolific, ULONG command,
ULONG value, UCHAR *data_buffer, ULONG data_length)
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 7909c16b..e42cc45a 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
@@ -1,18 +1,19 @@
/***************************************************************************
- * Copyright (c) 2024 Microsoft Corporation
- *
+ * Copyright (c) 2024 Microsoft Corporation
+ * Copyright (c) 2026-present Eclipse ThreadX contributors
+ *
* This program and the accompanying materials are made available under the
* terms of the MIT License which is available at
* https://opensource.org/licenses/MIT.
- *
+ *
* SPDX-License-Identifier: MIT
**************************************************************************/
/**************************************************************************/
/**************************************************************************/
-/** */
-/** USBX Component */
+/** */
+/** USBX Component */
/** */
/** Prolific Class */
/** */
@@ -29,53 +30,40 @@
#include "ux_host_stack.h"
-/**************************************************************************/
-/* */
-/* FUNCTION RELEASE */
-/* */
-/* _ux_host_class_prolific_configure PORTABLE C */
+/**************************************************************************/
+/* */
+/* FUNCTION RELEASE */
+/* */
+/* _ux_host_class_prolific_configure PORTABLE C */
/* 6.3.0 */
/* AUTHOR */
/* */
/* Chaoqiong Xiao, Microsoft Corporation */
/* */
/* DESCRIPTION */
-/* */
+/* */
/* This function calls the USBX stack to do a SET_CONFIGURATION to the */
-/* prolific. Once the prolific is configured, its interface will be */
-/* activated. The bulk endpoints (1 IN, 1 OUT ) and the optional */
-/* interrupt endpoint are enumerated. */
-/* */
-/* INPUT */
-/* */
-/* prolific Pointer to prolific class */
-/* */
-/* OUTPUT */
-/* */
-/* Completion Status */
-/* */
-/* CALLS */
-/* */
-/* _ux_host_stack_configuration_interface_get Get interface */
-/* _ux_host_stack_device_configuration_get Get configuration */
-/* _ux_host_stack_device_configuration_select Select configuration */
-/* */
-/* CALLED BY */
-/* */
-/* _ux_host_class_prolific_activate Prolific class activate */
-/* */
-/* 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 */
-/* 10-31-2023 Chaoqiong Xiao Modified comment(s), */
-/* removed interface link, */
-/* resulting in version 6.3.0 */
+/* prolific. Once the prolific is configured, its interface will be */
+/* activated. The bulk endpoints (1 IN, 1 OUT ) and the optional */
+/* interrupt endpoint are enumerated. */
+/* */
+/* INPUT */
+/* */
+/* prolific Pointer to prolific class */
+/* */
+/* OUTPUT */
+/* */
+/* Completion Status */
+/* */
+/* CALLS */
+/* */
+/* _ux_host_stack_configuration_interface_get Get interface */
+/* _ux_host_stack_device_configuration_get Get configuration */
+/* _ux_host_stack_device_configuration_select Select configuration */
+/* */
+/* CALLED BY */
+/* */
+/* _ux_host_class_prolific_activate Prolific class activate */
/* */
/**************************************************************************/
UINT _ux_host_class_prolific_configure(UX_HOST_CLASS_PROLIFIC *prolific)
@@ -98,29 +86,29 @@ UX_DEVICE *parent_device;
status = _ux_host_stack_device_configuration_get(prolific -> ux_host_class_prolific_device, 0, &configuration);
if (status != UX_SUCCESS)
{
-
+
/* Error trap. */
_ux_system_error_handler(UX_SYSTEM_LEVEL_THREAD, UX_SYSTEM_CONTEXT_CLASS, UX_CONFIGURATION_HANDLE_UNKNOWN);
/* If trace is enabled, insert this event into the trace buffer. */
UX_TRACE_IN_LINE_INSERT(UX_TRACE_ERROR, UX_CONFIGURATION_HANDLE_UNKNOWN, prolific -> ux_host_class_prolific_device, 0, 0, UX_TRACE_ERRORS, 0, 0)
-
+
return(UX_CONFIGURATION_HANDLE_UNKNOWN);
}
#if UX_MAX_DEVICES > 1
- /* Check the prolific power source and check the parent power source for
+ /* 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)
{
/* Get parent device pointer. */
parent_device = prolific -> ux_host_class_prolific_device -> ux_device_parent;
-
- /* If the device is NULL, the parent is the root prolific and we don't have to worry
+
+ /* If the device is NULL, the parent is the root prolific and we don't have to worry
if the parent is not the root prolific, check for its power source. */
if ((parent_device != UX_NULL) && (parent_device -> ux_device_power_source == UX_DEVICE_BUS_POWERED))
- {
+ {
/* Error trap. */
_ux_system_error_handler(UX_SYSTEM_LEVEL_THREAD, UX_SYSTEM_CONTEXT_CLASS, UX_CONNECTION_INCOMPATIBLE);
@@ -129,17 +117,17 @@ UX_DEVICE *parent_device;
UX_TRACE_IN_LINE_INSERT(UX_TRACE_ERROR, UX_CONNECTION_INCOMPATIBLE, prolific, 0, 0, UX_TRACE_ERRORS, 0, 0)
return(UX_CONNECTION_INCOMPATIBLE);
- }
+ }
}
#endif
- /* We have the valid configuration. Ask the USBX stack to set this configuration. */
+ /* 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)
return(status);
- /* If the operation went well, the prolific default alternate setting for the prolific interface is
- active and the interrupt endpoint is now enabled. We have to memorize the first interface since
+ /* If the operation went well, the prolific default alternate setting for the prolific interface is
+ active and the interrupt endpoint is now enabled. We have to memorize the first interface since
the interrupt endpoint is hooked to it. */
status = _ux_host_stack_configuration_interface_get(configuration, 0, 0, &prolific -> ux_host_class_prolific_interface);
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 51a6974e..cbcfdc7c 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
@@ -1,18 +1,19 @@
/***************************************************************************
- * Copyright (c) 2024 Microsoft Corporation
- *
+ * Copyright (c) 2024 Microsoft Corporation
+ * Copyright (c) 2026-present Eclipse ThreadX contributors
+ *
* This program and the accompanying materials are made available under the
* terms of the MIT License which is available at
* https://opensource.org/licenses/MIT.
- *
+ *
* SPDX-License-Identifier: MIT
**************************************************************************/
/**************************************************************************/
/**************************************************************************/
-/** */
-/** USBX Component */
+/** */
+/** USBX Component */
/** */
/** Prolific Class */
/** */
@@ -29,54 +30,43 @@
#include "ux_host_stack.h"
-/**************************************************************************/
-/* */
-/* FUNCTION RELEASE */
-/* */
-/* _ux_host_class_prolific_deactivate PORTABLE C */
+/**************************************************************************/
+/* */
+/* FUNCTION RELEASE */
+/* */
+/* _ux_host_class_prolific_deactivate PORTABLE C */
/* 6.1.10 */
/* AUTHOR */
/* */
/* Chaoqiong Xiao, Microsoft Corporation */
/* */
/* DESCRIPTION */
-/* */
+/* */
/* This function is called when this instance of the prolific has been */
-/* removed from the bus either directly or indirectly. The bulk in\out */
-/* and optional interrupt pipes will be destroyed and the instance */
-/* removed. */
-/* */
-/* INPUT */
-/* */
-/* command Prolific class command pointer */
-/* */
-/* OUTPUT */
-/* */
-/* Completion Status */
-/* */
-/* CALLS */
-/* */
-/* _ux_host_stack_class_instance_destroy Destroy the class instance */
-/* _ux_host_stack_endpoint_transfer_abort Abort endpoint transfer */
-/* _ux_utility_memory_free Free memory block */
-/* _ux_host_semaphore_get Get protection semaphore */
-/* _ux_host_semaphore_delete Delete protection semaphore */
+/* removed from the bus either directly or indirectly. The bulk in\out */
+/* and optional interrupt pipes will be destroyed and the instance */
+/* removed. */
+/* */
+/* INPUT */
+/* */
+/* command Prolific class command pointer */
+/* */
+/* OUTPUT */
+/* */
+/* Completion Status */
+/* */
+/* CALLS */
+/* */
+/* _ux_host_stack_class_instance_destroy Destroy the class instance */
+/* _ux_host_stack_endpoint_transfer_abort Abort endpoint transfer */
+/* _ux_utility_memory_free Free memory block */
+/* _ux_host_semaphore_get Get protection semaphore */
+/* _ux_host_semaphore_delete Delete protection semaphore */
/* _ux_utility_thread_schedule_other Schedule other threads */
-/* */
-/* CALLED BY */
-/* */
-/* _ux_host_class_prolific_entry Entry of prolific class */
-/* */
-/* RELEASE HISTORY */
-/* */
-/* DATE NAME DESCRIPTION */
-/* */
-/* 05-19-2020 Chaoqiong Xiao Initial Version 6.0 */
-/* 09-30-2020 Chaoqiong Xiao Modified comment(s), */
-/* resulting in version 6.1 */
-/* 01-31-2022 Chaoqiong Xiao Modified comment(s), */
-/* refined macros names, */
-/* resulting in version 6.1.10 */
+/* */
+/* CALLED BY */
+/* */
+/* _ux_host_class_prolific_entry Entry of prolific class */
/* */
/**************************************************************************/
UINT _ux_host_class_prolific_deactivate(UX_HOST_CLASS_COMMAND *command)
@@ -102,40 +92,40 @@ UINT status;
/* If the interrupt endpoint is defined, clean any pending transfer. */
if (prolific -> ux_host_class_prolific_interrupt_endpoint != UX_NULL)
- {
-
+ {
+
/* Wait for any current transfer to be out of pending. */
transfer_request = &prolific -> ux_host_class_prolific_interrupt_endpoint -> ux_endpoint_transfer_request;
if (transfer_request -> ux_transfer_request_completion_code == UX_TRANSFER_STATUS_PENDING)
/* And abort any transfer. */
_ux_host_stack_endpoint_transfer_abort(prolific -> ux_host_class_prolific_interrupt_endpoint);
-
+
/* And free the memory used by the interrupt endpoint. */
_ux_utility_memory_free(transfer_request -> ux_transfer_request_data_pointer);
-
+
}
-
-
+
+
/* First we take care of cleaning endpoint IN. */
transfer_request = &prolific -> ux_host_class_prolific_bulk_in_endpoint -> ux_endpoint_transfer_request;
if (transfer_request -> ux_transfer_request_completion_code == UX_TRANSFER_STATUS_PENDING)
/* We need to abort transactions on the bulk In pipe. */
_ux_host_stack_endpoint_transfer_abort(prolific -> ux_host_class_prolific_bulk_in_endpoint);
-
-
- /* Then endpoint OUT. */
+
+
+ /* Then endpoint OUT. */
transfer_request = &prolific -> ux_host_class_prolific_bulk_out_endpoint -> ux_endpoint_transfer_request;
if (transfer_request -> ux_transfer_request_completion_code == UX_TRANSFER_STATUS_PENDING)
/* We need to abort transactions on the bulk Out pipe. */
_ux_host_stack_endpoint_transfer_abort(prolific -> ux_host_class_prolific_bulk_out_endpoint);
-
+
/* The enumeration thread needs to sleep a while to allow the application or the class that may be using
endpoints to exit properly. */
- _ux_host_thread_schedule_other(UX_THREAD_PRIORITY_ENUM);
+ _ux_host_thread_schedule_other(UX_THREAD_PRIORITY_ENUM);
/* Destroy the instance. */
_ux_host_stack_class_instance_destroy(prolific -> ux_host_class_prolific_class, (VOID *) prolific);
@@ -147,7 +137,7 @@ UINT status;
that the device is removed. */
if (_ux_system_host -> ux_system_host_change_function != UX_NULL)
{
-
+
/* Inform the application the device is removed. */
_ux_system_host -> ux_system_host_change_function(UX_DEVICE_REMOVAL, prolific -> ux_host_class_prolific_class, (VOID *) prolific);
}
@@ -162,6 +152,6 @@ UINT status;
_ux_utility_memory_free(prolific);
/* Return successful status. */
- return(UX_SUCCESS);
+ return(UX_SUCCESS);
}
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 7e0c4efa..448bbf73 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
@@ -1,18 +1,19 @@
/***************************************************************************
- * Copyright (c) 2024 Microsoft Corporation
- *
+ * Copyright (c) 2024 Microsoft Corporation
+ * Copyright (c) 2026-present Eclipse ThreadX contributors
+ *
* This program and the accompanying materials are made available under the
* terms of the MIT License which is available at
* https://opensource.org/licenses/MIT.
- *
+ *
* SPDX-License-Identifier: MIT
**************************************************************************/
/**************************************************************************/
/**************************************************************************/
-/** */
-/** USBX Component */
+/** */
+/** USBX Component */
/** */
/** Prolific Class */
/** */
@@ -29,54 +30,39 @@
#include "ux_host_stack.h"
-/**************************************************************************/
-/* */
-/* FUNCTION RELEASE */
-/* */
-/* _ux_host_class_prolific_endpoints_get PORTABLE C */
+/**************************************************************************/
+/* */
+/* FUNCTION RELEASE */
+/* */
+/* _ux_host_class_prolific_endpoints_get PORTABLE C */
/* 6.1.11 */
/* AUTHOR */
/* */
/* Chaoqiong Xiao, Microsoft Corporation */
/* */
/* DESCRIPTION */
-/* */
+/* */
/* This function distinguishes for either the Data or Control Class. */
-/* For the data class, we mount the bulk in and bulk out endpoints. */
-/* For the control class, we mount the optional interrupt endpoint. */
-/* */
-/* INPUT */
-/* */
-/* prolific Pointer to prolific class */
-/* */
-/* OUTPUT */
-/* */
-/* Completion Status */
-/* */
-/* CALLS */
+/* For the data class, we mount the bulk in and bulk out endpoints. */
+/* For the control class, we mount the optional interrupt endpoint. */
+/* */
+/* INPUT */
/* */
-/* _ux_host_stack_transfer_request Transfer request */
-/* _ux_host_stack_interface_endpoint_get Get interface endpoint */
+/* prolific Pointer to prolific class */
+/* */
+/* OUTPUT */
+/* */
+/* Completion Status */
+/* */
+/* CALLS */
+/* */
+/* _ux_host_stack_transfer_request Transfer request */
+/* _ux_host_stack_interface_endpoint_get Get interface endpoint */
/* _ux_utility_memory_allocate Allocate memory */
-/* */
-/* CALLED BY */
-/* */
-/* _ux_host_class_prolific_activate Activate prolific class */
-/* */
-/* RELEASE HISTORY */
-/* */
-/* DATE NAME DESCRIPTION */
-/* */
-/* 05-19-2020 Chaoqiong Xiao Initial Version 6.0 */
-/* 09-30-2020 Chaoqiong Xiao Modified comment(s), */
-/* resulting in version 6.1 */
-/* 10-15-2021 Chaoqiong Xiao Modified comment(s), */
-/* use pre-calculated value */
-/* instead of wMaxPacketSize, */
-/* resulting in version 6.1.9 */
-/* 04-25-2022 Chaoqiong Xiao Modified comment(s), */
-/* internal clean up, */
-/* resulting in version 6.1.11 */
+/* */
+/* CALLED BY */
+/* */
+/* _ux_host_class_prolific_activate Activate prolific class */
/* */
/**************************************************************************/
UINT _ux_host_class_prolific_endpoints_get(UX_HOST_CLASS_PROLIFIC *prolific)
@@ -87,34 +73,34 @@ UINT endpoint_index;
UX_ENDPOINT *endpoint;
UX_TRANSFER *transfer_request;
-
+
/* Search the bulk OUT endpoint. It is attached to the interface container. */
for (endpoint_index = 0; endpoint_index < prolific -> ux_host_class_prolific_interface -> ux_interface_descriptor.bNumEndpoints;
endpoint_index++)
- {
-
+ {
+
/* Get interface endpoint. */
status = _ux_host_stack_interface_endpoint_get(prolific -> ux_host_class_prolific_interface, endpoint_index, &endpoint);
-
+
/* Check the completion status. */
if (status == UX_SUCCESS)
{
-
+
/* Check if endpoint is bulk and OUT. */
if (((endpoint -> ux_endpoint_descriptor.bEndpointAddress & UX_ENDPOINT_DIRECTION) == UX_ENDPOINT_OUT) &&
((endpoint -> ux_endpoint_descriptor.bmAttributes & UX_MASK_ENDPOINT_TYPE) == UX_BULK_ENDPOINT))
{
-
+
/* This transfer_request always have the OUT direction. */
endpoint -> ux_endpoint_transfer_request.ux_transfer_request_type = UX_REQUEST_OUT;
-
+
/* We have found the bulk endpoint, save it. */
prolific -> ux_host_class_prolific_bulk_out_endpoint = endpoint;
break;
}
- }
- }
-
+ }
+ }
+
/* The bulk out endpoint is mandatory. */
if (prolific -> ux_host_class_prolific_bulk_out_endpoint == UX_NULL)
{
@@ -127,33 +113,33 @@ UX_TRANSFER *transfer_request;
return(UX_ENDPOINT_HANDLE_UNKNOWN);
}
-
+
/* Search the bulk IN endpoint. It is attached to the interface container. */
for (endpoint_index = 0; endpoint_index < prolific -> ux_host_class_prolific_interface -> ux_interface_descriptor.bNumEndpoints;
endpoint_index++)
- {
-
+ {
+
/* Get the endpoint handle. */
status = _ux_host_stack_interface_endpoint_get(prolific -> ux_host_class_prolific_interface, endpoint_index, &endpoint);
-
+
/* Check the completion status. */
if (status == UX_SUCCESS)
{
-
+
/* Check if endpoint is bulk and IN. */
if (((endpoint -> ux_endpoint_descriptor.bEndpointAddress & UX_ENDPOINT_DIRECTION) == UX_ENDPOINT_IN) &&
((endpoint -> ux_endpoint_descriptor.bmAttributes & UX_MASK_ENDPOINT_TYPE) == UX_BULK_ENDPOINT))
{
-
+
/* This transfer_request always have the IN direction. */
endpoint -> ux_endpoint_transfer_request.ux_transfer_request_type = UX_REQUEST_IN;
-
+
/* We have found the bulk endpoint, save it. */
prolific -> ux_host_class_prolific_bulk_in_endpoint = endpoint;
break;
}
- }
- }
+ }
+ }
/* The bulk in endpoint is mandatory. */
if (prolific -> ux_host_class_prolific_bulk_in_endpoint == UX_NULL)
@@ -167,27 +153,27 @@ UX_TRANSFER *transfer_request;
return(UX_ENDPOINT_HANDLE_UNKNOWN);
}
-
+
/* Search the Interrupt endpoint. It is mandatory. */
for (endpoint_index = 0; endpoint_index < prolific -> ux_host_class_prolific_interface -> ux_interface_descriptor.bNumEndpoints;
endpoint_index++)
- {
-
+ {
+
/* Get the endpoint handle. */
status = _ux_host_stack_interface_endpoint_get(prolific -> ux_host_class_prolific_interface, endpoint_index, &endpoint);
-
+
/* Check the completion status. */
if (status == UX_SUCCESS)
{
-
+
/* Check if endpoint is Interrupt and IN. */
if (((endpoint -> ux_endpoint_descriptor.bEndpointAddress & UX_ENDPOINT_DIRECTION) == UX_ENDPOINT_IN) &&
((endpoint -> ux_endpoint_descriptor.bmAttributes & UX_MASK_ENDPOINT_TYPE) == UX_INTERRUPT_ENDPOINT))
{
-
+
/* This transfer_request always have the IN direction. */
endpoint -> ux_endpoint_transfer_request.ux_transfer_request_type = UX_REQUEST_IN;
-
+
/* We have found the interrupt endpoint, save it. */
prolific -> ux_host_class_prolific_interrupt_endpoint = endpoint;
@@ -206,18 +192,18 @@ UX_TRANSFER *transfer_request;
transfer_request -> ux_transfer_request_completion_function = _ux_host_class_prolific_transfer_request_completed;
/* Obtain a buffer for this transaction. The buffer will always be reused. */
- transfer_request -> ux_transfer_request_data_pointer = _ux_utility_memory_allocate(UX_SAFE_ALIGN, UX_CACHE_SAFE_MEMORY,
+ transfer_request -> ux_transfer_request_data_pointer = _ux_utility_memory_allocate(UX_SAFE_ALIGN, UX_CACHE_SAFE_MEMORY,
transfer_request -> ux_transfer_request_requested_length);
/* If the endpoint is available and we have memory, we start the interrupt endpoint. */
if (transfer_request -> ux_transfer_request_data_pointer != UX_NULL)
{
-
+
/* The transfer on the interrupt endpoint can be started. */
_ux_host_stack_transfer_request(transfer_request);
}
-
+
else
{
@@ -230,11 +216,11 @@ UX_TRANSFER *transfer_request;
/* We must return an error. */
return(UX_ENDPOINT_HANDLE_UNKNOWN);
}
-
+
break;
}
- }
- }
+ }
+ }
/* The interrupt endpoint is mandatory. */
if (prolific -> ux_host_class_prolific_interrupt_endpoint == UX_NULL)
@@ -248,8 +234,8 @@ UX_TRANSFER *transfer_request;
return(UX_ENDPOINT_HANDLE_UNKNOWN);
}
- else
-
+ else
+
/* All endpoints have been mounted. */
return(UX_SUCCESS);
}
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 a1c347b9..5c340289 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
@@ -1,18 +1,19 @@
/***************************************************************************
- * Copyright (c) 2024 Microsoft Corporation
- *
+ * Copyright (c) 2024 Microsoft Corporation
+ * Copyright (c) 2026-present Eclipse ThreadX contributors
+ *
* This program and the accompanying materials are made available under the
* terms of the MIT License which is available at
* https://opensource.org/licenses/MIT.
- *
+ *
* SPDX-License-Identifier: MIT
**************************************************************************/
/**************************************************************************/
/**************************************************************************/
-/** */
-/** USBX Component */
+/** */
+/** USBX Component */
/** */
/** Prolific Class */
/** */
@@ -29,47 +30,39 @@
#include "ux_host_stack.h"
-/**************************************************************************/
-/* */
-/* FUNCTION RELEASE */
-/* */
-/* _ux_host_class_prolific_entry PORTABLE C */
+/**************************************************************************/
+/* */
+/* FUNCTION RELEASE */
+/* */
+/* _ux_host_class_prolific_entry PORTABLE C */
/* 6.1 */
/* AUTHOR */
/* */
/* Chaoqiong Xiao, Microsoft Corporation */
/* */
/* DESCRIPTION */
-/* */
-/* This function is the entry point of the prolific class. It will be */
-/* called by the USBX stack enumeration module when there is a new */
-/* prolific on the bus or when the USB prolific is removed. */
-/* */
-/* */
-/* INPUT */
-/* */
+/* */
+/* This function is the entry point of the prolific class. It will be */
+/* called by the USBX stack enumeration module when there is a new */
+/* prolific on the bus or when the USB prolific is removed. */
+/* */
+/* */
+/* INPUT */
+/* */
/* command Prolific class command */
-/* */
-/* OUTPUT */
-/* */
-/* Completion Status */
-/* */
-/* CALLS */
-/* */
-/* _ux_host_class_prolific_activate Activate prolific class */
-/* _ux_host_class_prolific_deactivate Deactivate prolific class */
-/* */
-/* CALLED BY */
-/* */
-/* Acm Cdc Class */
-/* */
-/* RELEASE HISTORY */
-/* */
-/* DATE NAME DESCRIPTION */
-/* */
-/* 05-19-2020 Chaoqiong Xiao Initial Version 6.0 */
-/* 09-30-2020 Chaoqiong Xiao Modified comment(s), */
-/* resulting in version 6.1 */
+/* */
+/* OUTPUT */
+/* */
+/* Completion Status */
+/* */
+/* CALLS */
+/* */
+/* _ux_host_class_prolific_activate Activate prolific class */
+/* _ux_host_class_prolific_deactivate Deactivate prolific class */
+/* */
+/* CALLED BY */
+/* */
+/* Acm Cdc Class */
/* */
/**************************************************************************/
UINT _ux_host_class_prolific_entry(UX_HOST_CLASS_COMMAND *command)
@@ -90,10 +83,10 @@ UINT status;
if(((command -> ux_host_class_command_usage == UX_HOST_CLASS_COMMAND_USAGE_PIDVID) &&
(command -> ux_host_class_command_pid == 0x2303) &&
(command -> ux_host_class_command_vid == 0x67b)))
- return(UX_SUCCESS);
- else
- return(UX_NO_CLASS_MATCH);
-
+ return(UX_SUCCESS);
+ else
+ return(UX_NO_CLASS_MATCH);
+
case UX_HOST_CLASS_COMMAND_ACTIVATE:
/* The activate command is used when the device inserted has found a parent and
@@ -103,17 +96,17 @@ UINT status;
case UX_HOST_CLASS_COMMAND_DEACTIVATE:
- /* The deactivate command is used when the device has been extracted either
+ /* The deactivate command is used when the device has been extracted either
directly or when its parents has been extracted. */
status = _ux_host_class_prolific_deactivate(command);
return(status);
- default:
-
+ default:
+
/* 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)
return(UX_FUNCTION_NOT_SUPPORTED);
- }
+ }
}
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 8b0fe488..3bc5c2bc 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
@@ -1,10 +1,11 @@
/***************************************************************************
- * Copyright (c) 2024 Microsoft Corporation
- *
+ * Copyright (c) 2024 Microsoft Corporation
+ * Copyright (c) 2026-present Eclipse ThreadX contributors
+ *
* This program and the accompanying materials are made available under the
* terms of the MIT License which is available at
* https://opensource.org/licenses/MIT.
- *
+ *
* SPDX-License-Identifier: MIT
**************************************************************************/
@@ -69,19 +70,6 @@
/* */
/* Application */
/* */
-/* RELEASE HISTORY */
-/* */
-/* DATE NAME DESCRIPTION */
-/* */
-/* 05-19-2020 Chaoqiong Xiao Initial Version 6.0 */
-/* 09-30-2020 Chaoqiong Xiao Modified comment(s), */
-/* resulting in version 6.1 */
-/* 04-25-2022 Chaoqiong Xiao Modified comment(s), */
-/* internal clean up, */
-/* resulting in version 6.1.11 */
-/* 10-31-2023 Yajun xia Modified comment(s), */
-/* resulting in version 6.3.0 */
-/* */
/**************************************************************************/
UINT _ux_host_class_prolific_ioctl(UX_HOST_CLASS_PROLIFIC *prolific, ULONG ioctl_function,
VOID *parameter)
@@ -368,12 +356,6 @@ VOID (*callback_function) (struct UX_HOST_CLASS_P
/* */
/* Application */
/* */
-/* RELEASE HISTORY */
-/* */
-/* DATE NAME DESCRIPTION */
-/* */
-/* 10-31-2023 Chaoqiong Xiao Initial Version 6.3.0 */
-/* */
/**************************************************************************/
UINT _uxe_host_class_prolific_ioctl(UX_HOST_CLASS_PROLIFIC *prolific, ULONG ioctl_function,
VOID *parameter)
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 d6e74ed0..e82d4ade 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
@@ -1,18 +1,19 @@
/***************************************************************************
- * Copyright (c) 2024 Microsoft Corporation
- *
+ * Copyright (c) 2024 Microsoft Corporation
+ * Copyright (c) 2026-present Eclipse ThreadX contributors
+ *
* This program and the accompanying materials are made available under the
* terms of the MIT License which is available at
* https://opensource.org/licenses/MIT.
- *
+ *
* SPDX-License-Identifier: MIT
**************************************************************************/
/**************************************************************************/
/**************************************************************************/
-/** */
-/** USBX Component */
+/** */
+/** USBX Component */
/** */
/** Prolific Class */
/** */
@@ -29,71 +30,59 @@
#include "ux_host_stack.h"
-/**************************************************************************/
-/* */
-/* FUNCTION RELEASE */
-/* */
-/* _ux_host_class_prolific_read PORTABLE C */
+/**************************************************************************/
+/* */
+/* FUNCTION RELEASE */
+/* */
+/* _ux_host_class_prolific_read PORTABLE C */
/* 6.1.10 */
/* AUTHOR */
/* */
/* Chaoqiong Xiao, Microsoft Corporation */
/* */
/* DESCRIPTION */
-/* */
-/* This function reads from the prolific interface. The call is */
-/* blocking and only returns when there is either an error or when */
+/* */
+/* This function reads from the prolific interface. The call is */
+/* blocking and only returns when there is either an error or when */
/* the transfer is complete. */
/* */
-/* INPUT */
-/* */
-/* prolific Pointer to prolific class */
+/* INPUT */
+/* */
+/* prolific Pointer to prolific class */
/* data_pointer Pointer to buffer */
/* requested_length Requested data read */
/* actual_length Actual data read */
-/* */
-/* OUTPUT */
-/* */
-/* Completion Status */
-/* */
-/* CALLS */
-/* */
-/* _ux_host_stack_transfer_request Process transfer request */
-/* _ux_host_stack_transfer_request_abort Abort transfer request */
-/* _ux_host_semaphore_get Get protection semaphore */
-/* _ux_host_semaphore_put Release protection semaphore */
-/* */
-/* 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), */
-/* prefixed UX to MS_TO_TICK, */
-/* resulting in version 6.1 */
-/* 01-31-2022 Chaoqiong Xiao Modified comment(s), */
-/* refined macros names, */
-/* resulting in version 6.1.10 */
+/* */
+/* OUTPUT */
+/* */
+/* Completion Status */
+/* */
+/* CALLS */
+/* */
+/* _ux_host_stack_transfer_request Process transfer request */
+/* _ux_host_stack_transfer_request_abort Abort transfer request */
+/* _ux_host_semaphore_get Get protection semaphore */
+/* _ux_host_semaphore_put Release protection semaphore */
+/* */
+/* CALLED BY */
+/* */
+/* Application */
/* */
/**************************************************************************/
-UINT _ux_host_class_prolific_read (UX_HOST_CLASS_PROLIFIC *prolific, UCHAR *data_pointer,
+UINT _ux_host_class_prolific_read (UX_HOST_CLASS_PROLIFIC *prolific, UCHAR *data_pointer,
ULONG requested_length, ULONG *actual_length)
{
UX_TRANSFER *transfer_request;
UINT status;
ULONG transfer_request_length;
-
+
/* If trace is enabled, insert this event into the trace buffer. */
UX_TRACE_IN_LINE_INSERT(UX_TRACE_HOST_CLASS_PROLIFIC_READ, prolific, data_pointer, requested_length, 0, UX_TRACE_HOST_CLASS_EVENTS, 0, 0)
/* Ensure the instance is valid. */
if (prolific -> ux_host_class_prolific_state != UX_HOST_CLASS_INSTANCE_LIVE)
- {
+ {
/* Error trap. */
_ux_system_error_handler(UX_SYSTEM_LEVEL_THREAD, UX_SYSTEM_CONTEXT_CLASS, UX_HOST_CLASS_INSTANCE_UNKNOWN);
@@ -109,7 +98,7 @@ ULONG transfer_request_length;
/* Get the pointer to the bulk in endpoint in the transfer_request. */
transfer_request = &prolific -> ux_host_class_prolific_bulk_in_endpoint -> ux_endpoint_transfer_request;
-
+
/* Perform a transfer on the bulk in endpoint until either the transfer is
completed or until there is an error. */
while (requested_length)
@@ -120,18 +109,18 @@ ULONG transfer_request_length;
transfer_request_length = transfer_request -> ux_transfer_request_maximum_length;
else
transfer_request_length = requested_length;
-
+
/* Initialize the transfer request. */
transfer_request -> ux_transfer_request_data_pointer = data_pointer;
transfer_request -> ux_transfer_request_requested_length = transfer_request_length;
-
+
/* Perform the transfer. */
status = _ux_host_stack_transfer_request(transfer_request);
/* If the transfer is successful, we need to wait for the transfer request to be completed. */
if (status == UX_SUCCESS)
{
-
+
/* Wait for the completion of the transfer_request. */
status = _ux_host_semaphore_get(&transfer_request -> ux_transfer_request_semaphore, UX_MS_TO_TICK(UX_HOST_CLASS_PROLIFIC_CLASS_TRANSFER_TIMEOUT));
@@ -141,23 +130,23 @@ ULONG transfer_request_length;
/* All transfers pending need to abort. There may have been a partial transfer. */
_ux_host_stack_transfer_request_abort(transfer_request);
-
- /* Update the length of the actual data transferred. We do this after the
+
+ /* Update the length of the actual data transferred. We do this after the
abort of the transfer request in case some data was actually received. */
*actual_length += transfer_request -> ux_transfer_request_actual_length;
-
+
/* Set the completion code. */
transfer_request -> ux_transfer_request_completion_code = UX_TRANSFER_TIMEOUT;
-
+
/* Error trap. */
_ux_system_error_handler(UX_SYSTEM_LEVEL_THREAD, UX_SYSTEM_CONTEXT_CLASS, UX_TRANSFER_TIMEOUT);
/* If trace is enabled, insert this event into the trace buffer. */
UX_TRACE_IN_LINE_INSERT(UX_TRACE_ERROR, UX_TRANSFER_TIMEOUT, transfer_request, 0, 0, UX_TRACE_ERRORS, 0, 0)
-
+
/* There was an error, return to the caller */
return(UX_TRANSFER_TIMEOUT);
- }
+ }
}
else
{
@@ -172,26 +161,26 @@ ULONG transfer_request_length;
/* Check for completion status. */
if (transfer_request -> ux_transfer_request_completion_code != UX_SUCCESS)
return(transfer_request -> ux_transfer_request_completion_code);
-
+
/* Check for completion of transfer. If the transfer is partial, return to caller.
The transfer is marked as successful but the caller will need to check the length
actually received and determine if a partial transfer is OK. */
if (transfer_request_length != transfer_request -> ux_transfer_request_actual_length)
{
-
+
/* Return success to caller. */
return(UX_SUCCESS);
}
- /* Update the data pointer for next transfer. */
+ /* Update the data pointer for next transfer. */
data_pointer += transfer_request_length;
-
+
/* Update what is left to receive. */
- requested_length -= transfer_request_length;
- }
+ requested_length -= transfer_request_length;
+ }
/* We get here when all the transfers went through without errors. */
- return(UX_SUCCESS);
+ return(UX_SUCCESS);
}
@@ -228,14 +217,8 @@ ULONG transfer_request_length;
/* */
/* Application */
/* */
-/* RELEASE HISTORY */
-/* */
-/* DATE NAME DESCRIPTION */
-/* */
-/* 10-31-2023 Chaoqiong Xiao Initial Version 6.3.0 */
-/* */
/**************************************************************************/
-UINT _uxe_host_class_prolific_read (UX_HOST_CLASS_PROLIFIC *prolific, UCHAR *data_pointer,
+UINT _uxe_host_class_prolific_read (UX_HOST_CLASS_PROLIFIC *prolific, UCHAR *data_pointer,
ULONG requested_length, ULONG *actual_length)
{
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 c3badf97..d84e325a 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
@@ -1,18 +1,19 @@
/***************************************************************************
- * Copyright (c) 2024 Microsoft Corporation
- *
+ * Copyright (c) 2024 Microsoft Corporation
+ * Copyright (c) 2026-present Eclipse ThreadX contributors
+ *
* This program and the accompanying materials are made available under the
* terms of the MIT License which is available at
* https://opensource.org/licenses/MIT.
- *
+ *
* SPDX-License-Identifier: MIT
**************************************************************************/
/**************************************************************************/
/**************************************************************************/
-/** */
-/** USBX Component */
+/** */
+/** USBX Component */
/** */
/** Prolific Class */
/** */
@@ -29,45 +30,37 @@
#include "ux_host_stack.h"
-/**************************************************************************/
-/* */
-/* FUNCTION RELEASE */
-/* */
-/* _ux_host_class_prolific_reception_callback PORTABLE C */
+/**************************************************************************/
+/* */
+/* FUNCTION RELEASE */
+/* */
+/* _ux_host_class_prolific_reception_callback PORTABLE C */
/* 6.1 */
/* AUTHOR */
/* */
/* Chaoqiong Xiao, Microsoft Corporation */
/* */
/* DESCRIPTION */
-/* */
-/* This function is the callback from the USBX transfer functions, */
-/* it is called when a full or partial transfer has been done for a */
+/* */
+/* This function is the callback from the USBX transfer functions, */
+/* it is called when a full or partial transfer has been done for a */
/* bulk in transfer. It calls back the application. */
/* */
-/* INPUT */
-/* */
-/* transfer_request Pointer to transfer request */
-/* */
-/* OUTPUT */
-/* */
-/* None */
-/* */
-/* CALLS */
-/* */
-/* _ux_host_stack_transfer_request Process transfer request */
-/* */
-/* 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), */
-/* resulting in version 6.1 */
+/* INPUT */
+/* */
+/* transfer_request Pointer to transfer request */
+/* */
+/* OUTPUT */
+/* */
+/* None */
+/* */
+/* CALLS */
+/* */
+/* _ux_host_stack_transfer_request Process transfer request */
+/* */
+/* CALLED BY */
+/* */
+/* Application */
/* */
/**************************************************************************/
VOID _ux_host_class_prolific_reception_callback (UX_TRANSFER *transfer_request)
@@ -75,27 +68,27 @@ VOID _ux_host_class_prolific_reception_callback (UX_TRANSFER *transfer_request)
UX_HOST_CLASS_PROLIFIC *prolific;
UX_HOST_CLASS_PROLIFIC_RECEPTION *prolific_reception;
-
+
/* Get the class instance for this transfer request. */
prolific = (UX_HOST_CLASS_PROLIFIC *) transfer_request -> ux_transfer_request_class_instance;
-
+
/* Get the pointer to the prolific reception structure. */
prolific_reception = prolific -> ux_host_class_prolific_reception;
/* Check the state of the transfer. If there is an error, we do not proceed with this report. */
if (transfer_request -> ux_transfer_request_completion_code != UX_SUCCESS)
{
-
+
/* The reception is stopped. */
prolific_reception -> ux_host_class_prolific_reception_state = UX_HOST_CLASS_PROLIFIC_RECEPTION_STATE_STOPPED;
-
+
/* We may have an device extraction. We cannot continue. Report to the application. */
- prolific_reception -> ux_host_class_prolific_reception_callback(prolific, transfer_request -> ux_transfer_request_completion_code, UX_NULL, 0);
-
+ prolific_reception -> ux_host_class_prolific_reception_callback(prolific, transfer_request -> ux_transfer_request_completion_code, UX_NULL, 0);
+
/* We do not proceed. */
- return;
-
+ return;
+
}
/* Check if the class is in shutdown. */
@@ -105,7 +98,7 @@ UX_HOST_CLASS_PROLIFIC_RECEPTION *prolific_reception;
return;
/* And move to the next reception buffer. Check if we are at the end of the application buffer. */
- if (prolific_reception -> ux_host_class_prolific_reception_data_head + prolific_reception -> ux_host_class_prolific_reception_block_size >=
+ if (prolific_reception -> ux_host_class_prolific_reception_data_head + prolific_reception -> ux_host_class_prolific_reception_block_size >=
prolific_reception -> ux_host_class_prolific_reception_data_buffer + prolific_reception -> ux_host_class_prolific_reception_data_buffer_size)
{
@@ -120,19 +113,19 @@ UX_HOST_CLASS_PROLIFIC_RECEPTION *prolific_reception;
UX_TRACE_IN_LINE_INSERT(UX_TRACE_ERROR, UX_BUFFER_OVERFLOW, transfer_request, 0, 0, UX_TRACE_ERRORS, 0, 0)
/* We have an overflow. We cannot continue. Report to the application. */
- prolific_reception -> ux_host_class_prolific_reception_callback(prolific, UX_BUFFER_OVERFLOW, UX_NULL, 0);
-
+ prolific_reception -> ux_host_class_prolific_reception_callback(prolific, UX_BUFFER_OVERFLOW, UX_NULL, 0);
+
/* And stop the transfer in progress flag. */
prolific_reception -> ux_host_class_prolific_reception_state = UX_HOST_CLASS_PROLIFIC_RECEPTION_STATE_STOPPED;
-
+
return;
}
else
-
+
/* Program the head to be at the beginning of the application buffer. */
prolific_reception -> ux_host_class_prolific_reception_data_head = prolific_reception -> ux_host_class_prolific_reception_data_buffer;
-
- }
+
+ }
else
/* Program the head to be after the current buffer. */
@@ -140,7 +133,7 @@ UX_HOST_CLASS_PROLIFIC_RECEPTION *prolific_reception;
/* We need to report this transfer to the application. */
- prolific_reception -> ux_host_class_prolific_reception_callback(prolific,
+ prolific_reception -> ux_host_class_prolific_reception_callback(prolific,
transfer_request -> ux_transfer_request_completion_code,
transfer_request -> ux_transfer_request_data_pointer,
transfer_request -> ux_transfer_request_actual_length);
@@ -151,6 +144,6 @@ UX_HOST_CLASS_PROLIFIC_RECEPTION *prolific_reception;
_ux_host_stack_transfer_request(transfer_request);
/* There is no status to be reported back to the stack. */
- return;
+ return;
}
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 5cf80a90..8ea43bb5 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
@@ -1,18 +1,19 @@
/***************************************************************************
- * Copyright (c) 2024 Microsoft Corporation
- *
+ * Copyright (c) 2024 Microsoft Corporation
+ * Copyright (c) 2026-present Eclipse ThreadX contributors
+ *
* This program and the accompanying materials are made available under the
* terms of the MIT License which is available at
* https://opensource.org/licenses/MIT.
- *
+ *
* SPDX-License-Identifier: MIT
**************************************************************************/
/**************************************************************************/
/**************************************************************************/
-/** */
-/** USBX Component */
+/** */
+/** USBX Component */
/** */
/** Prolific Class */
/** */
@@ -29,63 +30,55 @@
#include "ux_host_stack.h"
-/**************************************************************************/
-/* */
-/* FUNCTION RELEASE */
-/* */
-/* _ux_host_class_prolific_reception_start PORTABLE C */
+/**************************************************************************/
+/* */
+/* FUNCTION RELEASE */
+/* */
+/* _ux_host_class_prolific_reception_start PORTABLE C */
/* 6.1 */
/* AUTHOR */
/* */
/* Chaoqiong Xiao, Microsoft Corporation */
/* */
/* DESCRIPTION */
-/* */
-/* This function starts a reception with the DLC modem. This mechanism */
-/* allows for non blocking calls based on a packet orientated round */
+/* */
+/* This function starts a reception with the DLC modem. This mechanism */
+/* allows for non blocking calls based on a packet orientated round */
/* robbin buffer. When a packet is fully or partially received, an */
/* application callback function is invoked and a new transfer request */
/* is rescheduled. */
/* */
-/* INPUT */
-/* */
-/* prolific Pointer to prolific class */
+/* INPUT */
+/* */
+/* prolific Pointer to prolific class */
/* prolific_reception Pointer to reception struct */
-/* */
-/* OUTPUT */
-/* */
-/* Completion Status */
-/* */
-/* CALLS */
-/* */
-/* _ux_host_stack_transfer_request Process transfer request */
-/* */
-/* 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), */
-/* resulting in version 6.1 */
+/* */
+/* OUTPUT */
+/* */
+/* Completion Status */
+/* */
+/* CALLS */
+/* */
+/* _ux_host_stack_transfer_request Process transfer request */
+/* */
+/* CALLED BY */
+/* */
+/* Application */
/* */
/**************************************************************************/
-UINT _ux_host_class_prolific_reception_start (UX_HOST_CLASS_PROLIFIC *prolific,
+UINT _ux_host_class_prolific_reception_start (UX_HOST_CLASS_PROLIFIC *prolific,
UX_HOST_CLASS_PROLIFIC_RECEPTION *prolific_reception)
{
UX_TRANSFER *transfer_request;
UINT status;
-
+
/* If trace is enabled, insert this event into the trace buffer. */
UX_TRACE_IN_LINE_INSERT(UX_TRACE_HOST_CLASS_PROLIFIC_RECEPTION_START, prolific, 0, 0, 0, UX_TRACE_HOST_CLASS_EVENTS, 0, 0)
/* Ensure the instance is valid. */
if (prolific -> ux_host_class_prolific_state != UX_HOST_CLASS_INSTANCE_LIVE)
- {
+ {
/* Error trap. */
_ux_system_error_handler(UX_SYSTEM_LEVEL_THREAD, UX_SYSTEM_CONTEXT_CLASS, UX_HOST_CLASS_INSTANCE_UNKNOWN);
@@ -102,19 +95,19 @@ UINT status;
/* Get the pointer to the bulk in endpoint in the transfer_request. */
transfer_request = &prolific -> ux_host_class_prolific_bulk_in_endpoint -> ux_endpoint_transfer_request;
-
+
/* Initialize the transfer request. */
transfer_request -> ux_transfer_request_class_instance = (VOID *) prolific;
transfer_request -> ux_transfer_request_data_pointer = prolific_reception -> ux_host_class_prolific_reception_data_head;
transfer_request -> ux_transfer_request_requested_length = prolific_reception -> ux_host_class_prolific_reception_block_size;
transfer_request -> ux_transfer_request_completion_function = _ux_host_class_prolific_reception_callback;
-
+
/* Save the prolific reception structure in the prolific structure. */
prolific -> ux_host_class_prolific_reception = prolific_reception;
-
+
/* And declare we have a transfer in progress. */
prolific_reception -> ux_host_class_prolific_reception_state = UX_HOST_CLASS_PROLIFIC_RECEPTION_STATE_STARTED;
-
+
/* Arm a first transfer on the bulk in endpoint. There is a callback to this function so we return to the caller
right away. */
status = _ux_host_stack_transfer_request(transfer_request);
@@ -123,8 +116,8 @@ UINT status;
in progress flag. */
if (status != UX_SUCCESS)
prolific_reception -> ux_host_class_prolific_reception_state = UX_HOST_CLASS_PROLIFIC_RECEPTION_STATE_STOPPED;
-
- return(status);
+
+ return(status);
}
@@ -160,14 +153,8 @@ UINT status;
/* */
/* Application */
/* */
-/* RELEASE HISTORY */
-/* */
-/* DATE NAME DESCRIPTION */
-/* */
-/* 10-31-2023 Chaoqiong Xiao Initial Version 6.3.0 */
-/* */
/**************************************************************************/
-UINT _uxe_host_class_prolific_reception_start (UX_HOST_CLASS_PROLIFIC *prolific,
+UINT _uxe_host_class_prolific_reception_start (UX_HOST_CLASS_PROLIFIC *prolific,
UX_HOST_CLASS_PROLIFIC_RECEPTION *prolific_reception)
{
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 bb963c17..f5ad3cd4 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
@@ -1,18 +1,19 @@
/***************************************************************************
- * Copyright (c) 2024 Microsoft Corporation
- *
+ * Copyright (c) 2024 Microsoft Corporation
+ * Copyright (c) 2026-present Eclipse ThreadX contributors
+ *
* This program and the accompanying materials are made available under the
* terms of the MIT License which is available at
* https://opensource.org/licenses/MIT.
- *
+ *
* SPDX-License-Identifier: MIT
**************************************************************************/
/**************************************************************************/
/**************************************************************************/
-/** */
-/** USBX Component */
+/** */
+/** USBX Component */
/** */
/** Prolific Class */
/** */
@@ -29,52 +30,44 @@
#include "ux_host_stack.h"
-/**************************************************************************/
-/* */
-/* FUNCTION RELEASE */
-/* */
-/* _ux_host_class_prolific_reception_stop PORTABLE C */
+/**************************************************************************/
+/* */
+/* FUNCTION RELEASE */
+/* */
+/* _ux_host_class_prolific_reception_stop PORTABLE C */
/* 6.1 */
/* AUTHOR */
/* */
/* Chaoqiong Xiao, Microsoft Corporation */
/* */
/* DESCRIPTION */
-/* */
-/* This function starts a reception with a prolific device. This */
-/* mechanism allows for non blocking calls based on a packet */
+/* */
+/* This function starts a reception with a prolific device. This */
+/* mechanism allows for non blocking calls based on a packet */
/* orientated round robbin buffer. When a packet is fully or partially */
/* received, an application callback function is invoked and a new */
/* transfer request is rescheduled. */
/* */
-/* INPUT */
-/* */
-/* prolific Pointer to prolific class */
+/* INPUT */
+/* */
+/* prolific Pointer to prolific class */
/* prolific_reception Pointer to reception struct */
-/* */
-/* OUTPUT */
-/* */
-/* Completion Status */
-/* */
-/* CALLS */
-/* */
-/* _ux_host_stack_endpoint_transfer_abort */
+/* */
+/* OUTPUT */
+/* */
+/* Completion Status */
+/* */
+/* CALLS */
+/* */
+/* _ux_host_stack_endpoint_transfer_abort */
/* Abort transfer */
-/* */
-/* 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), */
-/* resulting in version 6.1 */
+/* */
+/* CALLED BY */
+/* */
+/* Application */
/* */
/**************************************************************************/
-UINT _ux_host_class_prolific_reception_stop (UX_HOST_CLASS_PROLIFIC *prolific,
+UINT _ux_host_class_prolific_reception_stop (UX_HOST_CLASS_PROLIFIC *prolific,
UX_HOST_CLASS_PROLIFIC_RECEPTION *prolific_reception)
{
@@ -83,7 +76,7 @@ UINT _ux_host_class_prolific_reception_stop (UX_HOST_CLASS_PROLIFIC *prolific,
/* Ensure the instance is valid. */
if (prolific -> ux_host_class_prolific_state != UX_HOST_CLASS_INSTANCE_LIVE)
- {
+ {
/* Error trap. */
_ux_system_error_handler(UX_SYSTEM_LEVEL_THREAD, UX_SYSTEM_CONTEXT_CLASS, UX_HOST_CLASS_INSTANCE_UNKNOWN);
@@ -97,7 +90,7 @@ UINT _ux_host_class_prolific_reception_stop (UX_HOST_CLASS_PROLIFIC *prolific,
/* Check if we do have transfers for this application. If none, nothing to do. */
if (prolific_reception -> ux_host_class_prolific_reception_state == UX_HOST_CLASS_PROLIFIC_RECEPTION_STATE_STOPPED)
return(UX_SUCCESS);
-
+
/* We need to abort transactions on the bulk In pipe. */
_ux_host_stack_endpoint_transfer_abort(prolific -> ux_host_class_prolific_bulk_in_endpoint);
@@ -141,14 +134,8 @@ UINT _ux_host_class_prolific_reception_stop (UX_HOST_CLASS_PROLIFIC *prolific,
/* */
/* Application */
/* */
-/* RELEASE HISTORY */
-/* */
-/* DATE NAME DESCRIPTION */
-/* */
-/* 10-31-2023 Chaoqiong Xiao Initial Version 6.3.0 */
-/* */
/**************************************************************************/
-UINT _uxe_host_class_prolific_reception_stop (UX_HOST_CLASS_PROLIFIC *prolific,
+UINT _uxe_host_class_prolific_reception_stop (UX_HOST_CLASS_PROLIFIC *prolific,
UX_HOST_CLASS_PROLIFIC_RECEPTION *prolific_reception)
{
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 37911373..6cbd9acf 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
@@ -1,18 +1,19 @@
/***************************************************************************
- * Copyright (c) 2024 Microsoft Corporation
- *
+ * Copyright (c) 2024 Microsoft Corporation
+ * Copyright (c) 2026-present Eclipse ThreadX contributors
+ *
* This program and the accompanying materials are made available under the
* terms of the MIT License which is available at
* https://opensource.org/licenses/MIT.
- *
+ *
* SPDX-License-Identifier: MIT
**************************************************************************/
/**************************************************************************/
/**************************************************************************/
-/** */
-/** USBX Component */
+/** */
+/** USBX Component */
/** */
/** Prolific Class */
/** */
@@ -29,50 +30,39 @@
#include "ux_host_stack.h"
-/**************************************************************************/
-/* */
-/* FUNCTION RELEASE */
-/* */
-/* _ux_host_class_prolific_setup PORTABLE C */
+/**************************************************************************/
+/* */
+/* FUNCTION RELEASE */
+/* */
+/* _ux_host_class_prolific_setup PORTABLE C */
/* 6.1.11 */
/* AUTHOR */
/* */
/* Chaoqiong Xiao, Microsoft Corporation */
/* */
/* DESCRIPTION */
-/* */
-/* This function obtains the entire prolific configuration descriptors.*/
-/* This is needed because the prolific class needs to know if commands */
-/* are routed through the comm interface or the data class. */
-/* */
-/* INPUT */
-/* */
-/* prolific Pointer to prolific class */
-/* */
-/* OUTPUT */
-/* */
-/* Completion Status */
-/* */
-/* CALLS */
-/* */
-/* _ux_host_stack_transfer_request Process transfer request */
-/* _ux_utility_memory_allocate Allocate memory block */
-/* _ux_utility_memory_free Release memory block */
-/* */
-/* CALLED BY */
-/* */
-/* _ux_host_class_prolific_activate */
-/* */
-/* RELEASE HISTORY */
-/* */
-/* DATE NAME DESCRIPTION */
-/* */
-/* 05-19-2020 Chaoqiong Xiao Initial Version 6.0 */
-/* 09-30-2020 Chaoqiong Xiao Modified comment(s), */
-/* resulting in version 6.1 */
-/* 04-25-2022 Chaoqiong Xiao Modified comment(s), */
-/* internal clean up, */
-/* resulting in version 6.1.11 */
+/* */
+/* This function obtains the entire prolific configuration descriptors.*/
+/* This is needed because the prolific class needs to know if commands */
+/* are routed through the comm interface or the data class. */
+/* */
+/* INPUT */
+/* */
+/* prolific Pointer to prolific class */
+/* */
+/* OUTPUT */
+/* */
+/* Completion Status */
+/* */
+/* CALLS */
+/* */
+/* _ux_host_stack_transfer_request Process transfer request */
+/* _ux_utility_memory_allocate Allocate memory block */
+/* _ux_utility_memory_free Release memory block */
+/* */
+/* CALLED BY */
+/* */
+/* _ux_host_class_prolific_activate */
/* */
/**************************************************************************/
UINT _ux_host_class_prolific_setup(UX_HOST_CLASS_PROLIFIC *prolific)
@@ -93,11 +83,11 @@ UINT status;
return(UX_MEMORY_INSUFFICIENT);
/* Set the device type. Can be either 0, 1 or HX. */
- if (prolific -> ux_host_class_prolific_device -> ux_device_descriptor.bDeviceClass == 0x02)
-
+ if (prolific -> ux_host_class_prolific_device -> ux_device_descriptor.bDeviceClass == 0x02)
+
/* Device is of type 0. */
prolific -> ux_host_class_prolific_device_type = UX_HOST_CLASS_PROLIFIC_DEVICE_TYPE_0;
-
+
else
{
@@ -106,14 +96,14 @@ UINT status;
/* Device is of type HX. */
prolific -> ux_host_class_prolific_device_type = UX_HOST_CLASS_PROLIFIC_DEVICE_TYPE_HX;
-
+
else
-
+
/* Default case : type 1. */
prolific -> ux_host_class_prolific_device_type = UX_HOST_CLASS_PROLIFIC_DEVICE_TYPE_1;
- }
-
+ }
+
/* Create a transfer request for the prolific setup request # 1. */
transfer_request -> ux_transfer_request_data_pointer = setup_buffer;
transfer_request -> ux_transfer_request_requested_length = 1;
@@ -136,7 +126,7 @@ UINT status;
return(status);
}
-
+
/* Create a transfer request for the prolific setup request # 2. */
transfer_request -> ux_transfer_request_data_pointer = setup_buffer;
transfer_request -> ux_transfer_request_requested_length = 0;
@@ -159,7 +149,7 @@ UINT status;
return(status);
}
-
+
/* Create a transfer request for the prolific setup request # 3. */
transfer_request -> ux_transfer_request_data_pointer = setup_buffer;
transfer_request -> ux_transfer_request_requested_length = 1;
@@ -205,7 +195,7 @@ UINT status;
return(status);
}
-
+
/* Create a transfer request for the prolific setup request # 5. */
transfer_request -> ux_transfer_request_data_pointer = setup_buffer;
transfer_request -> ux_transfer_request_requested_length = 1;
@@ -228,7 +218,7 @@ UINT status;
return(status);
}
-
+
/* Create a transfer request for the prolific setup request # 6. */
transfer_request -> ux_transfer_request_data_pointer = setup_buffer;
transfer_request -> ux_transfer_request_requested_length = 0;
@@ -251,7 +241,7 @@ UINT status;
return(status);
}
-
+
/* Create a transfer request for the prolific setup request # 7. */
transfer_request -> ux_transfer_request_data_pointer = setup_buffer;
transfer_request -> ux_transfer_request_requested_length = 1;
@@ -354,7 +344,7 @@ UINT status;
/* Chip is not HX. */
transfer_request -> ux_transfer_request_index = 0x24;
-
+
transfer_request -> ux_transfer_request_data_pointer = setup_buffer;
transfer_request -> ux_transfer_request_requested_length = 0;
transfer_request -> ux_transfer_request_function = 1;
@@ -372,20 +362,20 @@ UINT status;
transfer_request -> ux_transfer_request_type = UX_REQUEST_OUT | UX_REQUEST_TYPE_VENDOR | UX_REQUEST_TARGET_DEVICE;
transfer_request -> ux_transfer_request_value = UX_HOST_CLASS_PROLIFIC_COMMAND_PIPE1_RESET;
transfer_request -> ux_transfer_request_index = 0;
-
+
/* Send request to HCD layer. */
status = _ux_host_stack_transfer_request(transfer_request);
-
+
/* Check status, if error, do not proceed. */
if (status != UX_SUCCESS || transfer_request -> ux_transfer_request_completion_code != UX_SUCCESS)
{
-
+
/* Free all used resources. */
_ux_utility_memory_free(setup_buffer);
-
+
/* Return completion status. */
return(UX_TRANSFER_ERROR);
-
+
}
/* Reset upstream data pipes part 2. */
@@ -395,20 +385,20 @@ UINT status;
transfer_request -> ux_transfer_request_type = UX_REQUEST_OUT | UX_REQUEST_TYPE_VENDOR | UX_REQUEST_TARGET_DEVICE;
transfer_request -> ux_transfer_request_value = UX_HOST_CLASS_PROLIFIC_COMMAND_PIPE2_RESET;
transfer_request -> ux_transfer_request_index = 0;
-
+
/* Send request to HCD layer. */
status = _ux_host_stack_transfer_request(transfer_request);
-
+
/* Check status, if error, do not proceed. */
if (status != UX_SUCCESS || transfer_request -> ux_transfer_request_completion_code != UX_SUCCESS)
{
-
+
/* Free all used resources. */
_ux_utility_memory_free(setup_buffer);
-
+
/* Return completion status. */
return(UX_TRANSFER_ERROR);
-
+
}
/* Free all used resources. */
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 00f9d659..a19c94ba 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
@@ -1,18 +1,19 @@
/***************************************************************************
- * Copyright (c) 2024 Microsoft Corporation
- *
+ * Copyright (c) 2024 Microsoft Corporation
+ * Copyright (c) 2026-present Eclipse ThreadX contributors
+ *
* This program and the accompanying materials are made available under the
* terms of the MIT License which is available at
* https://opensource.org/licenses/MIT.
- *
+ *
* SPDX-License-Identifier: MIT
**************************************************************************/
/**************************************************************************/
/**************************************************************************/
-/** */
-/** USBX Component */
+/** */
+/** USBX Component */
/** */
/** PROLIFIC Class */
/** */
@@ -29,49 +30,37 @@
#include "ux_host_stack.h"
-/**************************************************************************/
-/* */
-/* FUNCTION RELEASE */
-/* */
-/* _ux_host_class_prolific_transfer_request_completed PORTABLE C */
+/**************************************************************************/
+/* */
+/* FUNCTION RELEASE */
+/* */
+/* _ux_host_class_prolific_transfer_request_completed PORTABLE C */
/* 6.1.9 */
/* AUTHOR */
/* */
/* Chaoqiong Xiao, Microsoft Corporation */
/* */
/* DESCRIPTION */
-/* */
-/* This function is called by the completion thread when a transfer */
-/* request has been completed either because the transfer is */
-/* successful or there was an error. */
-/* */
-/* INPUT */
-/* */
-/* transfer_request Pointer to transfer request */
-/* */
-/* OUTPUT */
-/* */
-/* None */
-/* */
-/* CALLS */
-/* */
+/* */
+/* This function is called by the completion thread when a transfer */
+/* request has been completed either because the transfer is */
+/* successful or there was an error. */
+/* */
+/* INPUT */
+/* */
+/* transfer_request Pointer to transfer request */
+/* */
+/* OUTPUT */
+/* */
+/* None */
+/* */
+/* CALLS */
+/* */
/* _ux_host_stack_transfer_request Transfer request */
-/* */
-/* CALLED BY */
-/* */
-/* USBX stack */
-/* */
-/* RELEASE HISTORY */
-/* */
-/* DATE NAME DESCRIPTION */
-/* */
-/* 05-19-2020 Chaoqiong Xiao Initial Version 6.0 */
-/* 09-30-2020 Chaoqiong Xiao Modified comment(s), */
-/* resulting in version 6.1 */
-/* 10-15-2021 Chaoqiong Xiao Modified comment(s), */
-/* use pre-calculated value */
-/* instead of wMaxPacketSize, */
-/* resulting in version 6.1.9 */
+/* */
+/* CALLED BY */
+/* */
+/* USBX stack */
/* */
/**************************************************************************/
VOID _ux_host_class_prolific_transfer_request_completed(UX_TRANSFER *transfer_request)
@@ -82,7 +71,7 @@ UX_HOST_CLASS_PROLIFIC *prolific;
/* Get the class instance for this transfer request. */
prolific = (UX_HOST_CLASS_PROLIFIC *) transfer_request -> ux_transfer_request_class_instance;
-
+
/* Check the state of the transfer. If there is an error, we do not proceed with this notification. */
if (transfer_request -> ux_transfer_request_completion_code != UX_SUCCESS)
@@ -99,29 +88,29 @@ UX_HOST_CLASS_PROLIFIC *prolific;
prolific -> ux_host_class_prolific_notification_count++;
/* Look at what the the status is. First ensure the length of our interrupt pipe data is correct. */
- if (transfer_request -> ux_transfer_request_actual_length ==
+ if (transfer_request -> ux_transfer_request_actual_length ==
transfer_request -> ux_transfer_request_requested_length)
{
/* Check if device is present. */
- if ((*(transfer_request -> ux_transfer_request_data_pointer + UX_HOST_CLASS_PROLIFIC_DEVICE_STATE_OFFSET) &
+ if ((*(transfer_request -> ux_transfer_request_data_pointer + UX_HOST_CLASS_PROLIFIC_DEVICE_STATE_OFFSET) &
UX_HOST_CLASS_PROLIFIC_DEVICE_STATE_MASK) == 0)
-
+
/* Device is not present. */
prolific -> ux_host_class_prolific_device_state = UX_HOST_CLASS_PROLIFIC_DEVICE_NOT_PRESENT;
- else
-
+ else
+
/* Device is present. */
prolific -> ux_host_class_prolific_device_state = UX_HOST_CLASS_PROLIFIC_DEVICE_PRESENT;
/* If there is a callback present, invoke it. */
if (prolific -> ux_host_class_prolific_device_status_change_callback != UX_NULL)
-
+
/* There is a callback, send the status change to the application. */
prolific -> ux_host_class_prolific_device_status_change_callback(prolific, prolific -> ux_host_class_prolific_device_state);
- }
+ }
/* Reactivate the PROLIFIC interrupt pipe. */
_ux_host_stack_transfer_request(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 8c5224ff..465c0492 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
@@ -1,18 +1,19 @@
/***************************************************************************
- * Copyright (c) 2024 Microsoft Corporation
- *
+ * Copyright (c) 2024 Microsoft Corporation
+ * Copyright (c) 2026-present Eclipse ThreadX contributors
+ *
* This program and the accompanying materials are made available under the
* terms of the MIT License which is available at
* https://opensource.org/licenses/MIT.
- *
+ *
* SPDX-License-Identifier: MIT
**************************************************************************/
/**************************************************************************/
/**************************************************************************/
-/** */
-/** USBX Component */
+/** */
+/** USBX Component */
/** */
/** Prolific Class */
/** */
@@ -29,70 +30,58 @@
#include "ux_host_stack.h"
-/**************************************************************************/
-/* */
-/* FUNCTION RELEASE */
-/* */
-/* _ux_host_class_prolific_write PORTABLE C */
+/**************************************************************************/
+/* */
+/* FUNCTION RELEASE */
+/* */
+/* _ux_host_class_prolific_write PORTABLE C */
/* 6.1.10 */
/* AUTHOR */
/* */
/* Chaoqiong Xiao, Microsoft Corporation */
/* */
/* DESCRIPTION */
-/* */
-/* This function writes to the prolific interface. The call is blocking*/
-/* and only returns when there is either an error or when the transfer */
-/* is complete. */
-/* */
-/* INPUT */
-/* */
-/* prolific Pointer to prolific class */
-/* data_pointer Pointer to data to write */
-/* requested_length Length of data to write */
-/* actual_length Actual length of data written */
-/* */
-/* OUTPUT */
-/* */
-/* Completion Status */
-/* */
-/* CALLS */
-/* */
-/* _ux_host_stack_transfer_request Process transfer request */
-/* _ux_host_stack_transfer_request_abort Abort transfer request */
-/* _ux_host_semaphore_get Get protection semaphore */
-/* */
-/* 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), */
-/* prefixed UX to MS_TO_TICK, */
-/* resulting in version 6.1 */
-/* 01-31-2022 Chaoqiong Xiao Modified comment(s), */
-/* refined macros names, */
-/* resulting in version 6.1.10 */
+/* */
+/* This function writes to the prolific interface. The call is blocking*/
+/* and only returns when there is either an error or when the transfer */
+/* is complete. */
+/* */
+/* INPUT */
+/* */
+/* prolific Pointer to prolific class */
+/* data_pointer Pointer to data to write */
+/* requested_length Length of data to write */
+/* actual_length Actual length of data written */
+/* */
+/* OUTPUT */
+/* */
+/* Completion Status */
+/* */
+/* CALLS */
+/* */
+/* _ux_host_stack_transfer_request Process transfer request */
+/* _ux_host_stack_transfer_request_abort Abort transfer request */
+/* _ux_host_semaphore_get Get protection semaphore */
+/* */
+/* CALLED BY */
+/* */
+/* Application */
/* */
/**************************************************************************/
-UINT _ux_host_class_prolific_write(UX_HOST_CLASS_PROLIFIC *prolific, UCHAR *data_pointer,
+UINT _ux_host_class_prolific_write(UX_HOST_CLASS_PROLIFIC *prolific, UCHAR *data_pointer,
ULONG requested_length, ULONG *actual_length)
{
UX_TRANSFER *transfer_request;
UINT status;
ULONG transfer_request_length;
-
+
/* If trace is enabled, insert this event into the trace buffer. */
UX_TRACE_IN_LINE_INSERT(UX_TRACE_HOST_CLASS_PROLIFIC_WRITE, prolific, data_pointer, requested_length, 0, UX_TRACE_HOST_CLASS_EVENTS, 0, 0)
/* Ensure the instance is valid. */
if (prolific -> ux_host_class_prolific_state != UX_HOST_CLASS_INSTANCE_LIVE)
- {
+ {
/* Error trap. */
_ux_system_error_handler(UX_SYSTEM_LEVEL_THREAD, UX_SYSTEM_CONTEXT_CLASS, UX_HOST_CLASS_INSTANCE_UNKNOWN);
@@ -108,7 +97,7 @@ ULONG transfer_request_length;
/* Get the pointer to the bulk out endpoint transfer request. */
transfer_request = &prolific -> ux_host_class_prolific_bulk_out_endpoint -> ux_endpoint_transfer_request;
-
+
/* Perform a transfer on the bulk out endpoint until either the transfer is
completed or when there is an error. */
while (requested_length)
@@ -119,18 +108,18 @@ ULONG transfer_request_length;
transfer_request_length = transfer_request -> ux_transfer_request_maximum_length;
else
transfer_request_length = requested_length;
-
+
/* Initialize the transfer_request. */
transfer_request -> ux_transfer_request_data_pointer = data_pointer;
transfer_request -> ux_transfer_request_requested_length = transfer_request_length;
-
+
/* Perform the transfer. */
status = _ux_host_stack_transfer_request(transfer_request);
/* If the transfer is successful, we need to wait for the transfer request to be completed. */
if (status == UX_SUCCESS)
{
-
+
/* Wait for the completion of the transfer request. */
status = _ux_host_semaphore_get(&transfer_request -> ux_transfer_request_semaphore, UX_MS_TO_TICK(UX_HOST_CLASS_PROLIFIC_CLASS_TRANSFER_TIMEOUT));
@@ -140,23 +129,23 @@ ULONG transfer_request_length;
/* All transfers pending need to abort. There may have been a partial transfer. */
_ux_host_stack_transfer_request_abort(transfer_request);
-
- /* Update the length of the actual data transferred. We do this after the
+
+ /* Update the length of the actual data transferred. We do this after the
abort of the transfer_request in case some data actually went out. */
*actual_length += transfer_request -> ux_transfer_request_actual_length;
-
+
/* Set the completion code. */
transfer_request -> ux_transfer_request_completion_code = UX_TRANSFER_TIMEOUT;
-
+
/* Error trap. */
_ux_system_error_handler(UX_SYSTEM_LEVEL_THREAD, UX_SYSTEM_CONTEXT_CLASS, UX_TRANSFER_TIMEOUT);
/* If trace is enabled, insert this event into the trace buffer. */
UX_TRACE_IN_LINE_INSERT(UX_TRACE_ERROR, UX_TRANSFER_TIMEOUT, transfer_request, 0, 0, UX_TRACE_ERRORS, 0, 0)
-
+
/* There was an error, return to the caller. */
return(UX_TRANSFER_TIMEOUT);
- }
+ }
}
else
{
@@ -171,7 +160,7 @@ ULONG transfer_request_length;
/* Check for completion status. */
if (transfer_request -> ux_transfer_request_completion_code != UX_SUCCESS)
return(transfer_request -> ux_transfer_request_completion_code);
-
+
/* Check for completion of transfer. If the transfer is partial, return to caller.
The transfer is marked as successful but the caller will need to check the length
actually sent and determine if a partial transfer is OK. */
@@ -182,15 +171,15 @@ ULONG transfer_request_length;
return(UX_SUCCESS);
}
- /* Update the data pointer for next transfer. */
+ /* Update the data pointer for next transfer. */
data_pointer += transfer_request_length;
-
+
/* Update what is left to send out. */
- requested_length -= transfer_request_length;
- }
+ requested_length -= transfer_request_length;
+ }
/* We get here when all the transfers went through without errors. */
- return(UX_SUCCESS);
+ return(UX_SUCCESS);
}
@@ -227,14 +216,8 @@ ULONG transfer_request_length;
/* */
/* Application */
/* */
-/* RELEASE HISTORY */
-/* */
-/* DATE NAME DESCRIPTION */
-/* */
-/* 10-31-2023 Chaoqiong Xiao Initial Version 6.3.0 */
-/* */
/**************************************************************************/
-UINT _uxe_host_class_prolific_write(UX_HOST_CLASS_PROLIFIC *prolific, UCHAR *data_pointer,
+UINT _uxe_host_class_prolific_write(UX_HOST_CLASS_PROLIFIC *prolific, UCHAR *data_pointer,
ULONG requested_length, ULONG *actual_length)
{
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 33feb31a..57103064 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
@@ -1,10 +1,11 @@
/***************************************************************************
- * Copyright (c) 2024 Microsoft Corporation
- *
+ * Copyright (c) 2024 Microsoft Corporation
+ * Copyright (c) 2026-present Eclipse ThreadX contributors
+ *
* This program and the accompanying materials are made available under the
* terms of the MIT License which is available at
* https://opensource.org/licenses/MIT.
- *
+ *
* SPDX-License-Identifier: MIT
**************************************************************************/
@@ -69,26 +70,6 @@
/* */
/* Storage Class */
/* */
-/* RELEASE HISTORY */
-/* */
-/* DATE NAME DESCRIPTION */
-/* */
-/* 05-19-2020 Chaoqiong Xiao Initial Version 6.0 */
-/* 09-30-2020 Chaoqiong Xiao Modified comment(s), */
-/* resulting in version 6.1 */
-/* 01-31-2022 Chaoqiong Xiao Modified comment(s), */
-/* added standalone support. */
-/* resulting in version 6.1.10 */
-/* 07-29-2022 Chaoqiong Xiao Modified comment(s), */
-/* fixed parameter/variable */
-/* names conflict C++ keyword, */
-/* resulting in version 6.1.12 */
-/* 10-31-2023 Chaoqiong Xiao Modified comment(s), */
-/* moved class/sub/protocol */
-/* check and endpoints get */
-/* into _activate function, */
-/* resulting in version 6.3.0 */
-/* */
/**************************************************************************/
UINT _ux_host_class_storage_activate(UX_HOST_CLASS_COMMAND *command)
{
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 631fe231..30bd5e65 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
@@ -1,18 +1,19 @@
/***************************************************************************
- * Copyright (c) 2024 Microsoft Corporation
- *
+ * Copyright (c) 2024 Microsoft Corporation
+ * Copyright (c) 2026-present Eclipse ThreadX contributors
+ *
* This program and the accompanying materials are made available under the
* terms of the MIT License which is available at
* https://opensource.org/licenses/MIT.
- *
+ *
* SPDX-License-Identifier: MIT
**************************************************************************/
/**************************************************************************/
/**************************************************************************/
-/** */
-/** USBX Component */
+/** */
+/** USBX Component */
/** */
/** Storage Class */
/** */
@@ -29,53 +30,41 @@
#include "ux_host_stack.h"
-/**************************************************************************/
-/* */
-/* FUNCTION RELEASE */
-/* */
-/* _ux_host_class_storage_cbw_initialize PORTABLE C */
+/**************************************************************************/
+/* */
+/* FUNCTION RELEASE */
+/* */
+/* _ux_host_class_storage_cbw_initialize PORTABLE C */
/* 6.1.3 */
/* AUTHOR */
/* */
/* Chaoqiong Xiao, Microsoft Corporation */
/* */
/* DESCRIPTION */
-/* */
-/* This function will initialize the Command Block Wrapper (CBW) that */
+/* */
+/* This function will initialize the Command Block Wrapper (CBW) that */
/* encapsulate the SCSI request to be sent to the storage device. */
-/* The CBW is normally used only for the BO protocol. */
-/* */
-/* INPUT */
-/* */
-/* storage Pointer to storage class */
-/* flags Flags for transfer */
-/* data_transfer_length Length of data transfer */
-/* command_length Length of command */
-/* */
-/* OUTPUT */
-/* */
-/* None */
-/* */
-/* CALLS */
-/* */
-/* _ux_utility_long_put Write a 32-bit value */
-/* _ux_utility_memory_set Set memory to a value */
-/* */
-/* CALLED BY */
-/* */
-/* Storage Class */
-/* */
-/* RELEASE HISTORY */
-/* */
-/* DATE NAME DESCRIPTION */
-/* */
-/* 05-19-2020 Chaoqiong Xiao Initial Version 6.0 */
-/* 09-30-2020 Chaoqiong Xiao Modified comment(s), */
-/* verified memset and memcpy */
-/* cases, */
-/* resulting in version 6.1 */
-/* 12-31-2020 Chaoqiong Xiao Modified comment(s), */
-/* resulting in version 6.1.3 */
+/* The CBW is normally used only for the BO protocol. */
+/* */
+/* INPUT */
+/* */
+/* storage Pointer to storage class */
+/* flags Flags for transfer */
+/* data_transfer_length Length of data transfer */
+/* command_length Length of command */
+/* */
+/* OUTPUT */
+/* */
+/* None */
+/* */
+/* CALLS */
+/* */
+/* _ux_utility_long_put Write a 32-bit value */
+/* _ux_utility_memory_set Set memory to a value */
+/* */
+/* CALLED BY */
+/* */
+/* Storage Class */
/* */
/**************************************************************************/
VOID _ux_host_class_storage_cbw_initialize(UX_HOST_CLASS_STORAGE *storage, UINT flags,
@@ -83,15 +72,15 @@ VOID _ux_host_class_storage_cbw_initialize(UX_HOST_CLASS_STORAGE *storage, UINT
{
UCHAR *cbw;
-
+
/* Use a pointer for the cbw, easier to manipulate. */
cbw = (UCHAR *) storage -> ux_host_class_storage_cbw;
/* Store the signature of the CBW. */
_ux_utility_long_put(cbw, UX_HOST_CLASS_STORAGE_CBW_SIGNATURE_MASK);
-
- /* Set the Tag, this value is simply an arbitrary number that is echoed by
+
+ /* Set the Tag, this value is simply an arbitrary number that is echoed by
the device in the CSW. */
_ux_utility_long_put(cbw + UX_HOST_CLASS_STORAGE_CBW_TAG, UX_HOST_CLASS_STORAGE_CBW_TAG_MASK);
@@ -100,7 +89,7 @@ UCHAR *cbw;
/* Store the CBW Flag field that contains the transfer flags. */
*(cbw + UX_HOST_CLASS_STORAGE_CBW_FLAGS) = (UCHAR)flags;
-
+
/* Store the LUN value. */
*(cbw + UX_HOST_CLASS_STORAGE_CBW_LUN) = (UCHAR)storage -> ux_host_class_storage_lun;
diff --git a/common/usbx_host_classes/src/ux_host_class_storage_check_run.c b/common/usbx_host_classes/src/ux_host_class_storage_check_run.c
index 0bd2d750..4e9a0a20 100644
--- a/common/usbx_host_classes/src/ux_host_class_storage_check_run.c
+++ b/common/usbx_host_classes/src/ux_host_class_storage_check_run.c
@@ -1,10 +1,11 @@
/***************************************************************************
- * Copyright (c) 2024 Microsoft Corporation
- *
+ * Copyright (c) 2024 Microsoft Corporation
+ * Copyright (c) 2026-present Eclipse ThreadX contributors
+ *
* This program and the accompanying materials are made available under the
* terms of the MIT License which is available at
* https://opensource.org/licenses/MIT.
- *
+ *
* SPDX-License-Identifier: MIT
**************************************************************************/
@@ -73,15 +74,6 @@
/* */
/* Storage Class */
/* */
-/* RELEASE HISTORY */
-/* */
-/* DATE NAME DESCRIPTION */
-/* */
-/* 01-31-2022 Chaoqiong Xiao Initial Version 6.1.10 */
-/* 03-08-2023 Chaoqiong Xiao Modified comment(s), */
-/* checked device state, */
-/* resulting in version 6.2.1 */
-/* */
/**************************************************************************/
UINT _ux_host_class_storage_check_run(UX_HOST_CLASS_STORAGE *storage)
{
diff --git a/common/usbx_host_classes/src/ux_host_class_storage_configure.c b/common/usbx_host_classes/src/ux_host_class_storage_configure.c
index ad172b35..ccce0031 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
@@ -1,18 +1,19 @@
/***************************************************************************
- * Copyright (c) 2024 Microsoft Corporation
- *
+ * Copyright (c) 2024 Microsoft Corporation
+ * Copyright (c) 2026-present Eclipse ThreadX contributors
+ *
* This program and the accompanying materials are made available under the
* terms of the MIT License which is available at
* https://opensource.org/licenses/MIT.
- *
+ *
* SPDX-License-Identifier: MIT
**************************************************************************/
/**************************************************************************/
/**************************************************************************/
-/** */
-/** USBX Component */
+/** */
+/** USBX Component */
/** */
/** Storage Class */
/** */
@@ -29,49 +30,39 @@
#include "ux_host_stack.h"
-/**************************************************************************/
-/* */
-/* FUNCTION RELEASE */
-/* */
-/* _ux_host_class_storage_configure PORTABLE C */
+/**************************************************************************/
+/* */
+/* FUNCTION RELEASE */
+/* */
+/* _ux_host_class_storage_configure PORTABLE C */
/* 6.1 */
/* AUTHOR */
/* */
/* Chaoqiong Xiao, Microsoft Corporation */
/* */
/* DESCRIPTION */
-/* */
+/* */
/* This function calls the USBX stack to do a SET_CONFIGURATION to the */
/* storage device. Once the storage is configured, its interface will */
-/* be activated. The bulk endpoints enumerated(1 IN, 1 OUT). */
-/* */
-/* INPUT */
-/* */
-/* storage Pointer to storage class */
-/* */
-/* OUTPUT */
-/* */
-/* Completion Status */
-/* */
-/* CALLS */
-/* */
-/* _ux_host_stack_configuration_interface_get Get configuration */
-/* _ux_host_stack_device_configuration_get Get device config */
-/* _ux_host_stack_device_configuration_select Select configuration */
-/* */
-/* CALLED BY */
-/* */
-/* Storage Class */
-/* */
-/* 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 */
+/* be activated. The bulk endpoints enumerated(1 IN, 1 OUT). */
+/* */
+/* INPUT */
+/* */
+/* storage Pointer to storage class */
+/* */
+/* OUTPUT */
+/* */
+/* Completion Status */
+/* */
+/* CALLS */
+/* */
+/* _ux_host_stack_configuration_interface_get Get configuration */
+/* _ux_host_stack_device_configuration_get Get device config */
+/* _ux_host_stack_device_configuration_select Select configuration */
+/* */
+/* CALLED BY */
+/* */
+/* Storage Class */
/* */
/**************************************************************************/
UINT _ux_host_class_storage_configure(UX_HOST_CLASS_STORAGE *storage)
@@ -96,29 +87,29 @@ UX_DEVICE *parent_device;
/* Check completion status. */
if (status != UX_SUCCESS)
{
-
+
/* Error trap. */
_ux_system_error_handler(UX_SYSTEM_LEVEL_THREAD, UX_SYSTEM_CONTEXT_CLASS, UX_CONFIGURATION_HANDLE_UNKNOWN);
/* If trace is enabled, insert this event into the trace buffer. */
UX_TRACE_IN_LINE_INSERT(UX_TRACE_ERROR, UX_CONFIGURATION_HANDLE_UNKNOWN, storage -> ux_host_class_storage_device, 0, 0, UX_TRACE_ERRORS, 0, 0)
-
+
return(UX_CONFIGURATION_HANDLE_UNKNOWN);
}
#if UX_MAX_DEVICES > 1
- /* Check the storage device power source and check the parent power source for
+ /* 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)
{
/* Pickup pointer to parent device. */
parent_device = storage -> ux_host_class_storage_device -> ux_device_parent;
-
- /* If the device is NULL, the parent is the root hub and we don't have to worry
+
+ /* 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))
- {
+ {
/* Error trap. */
_ux_system_error_handler(UX_SYSTEM_LEVEL_THREAD, UX_SYSTEM_CONTEXT_CLASS, UX_CONNECTION_INCOMPATIBLE);
@@ -127,11 +118,11 @@ UX_DEVICE *parent_device;
UX_TRACE_IN_LINE_INSERT(UX_TRACE_ERROR, UX_CONNECTION_INCOMPATIBLE, storage, 0, 0, UX_TRACE_ERRORS, 0, 0)
return(UX_CONNECTION_INCOMPATIBLE);
- }
+ }
}
#endif
- /* We have the valid configuration. Ask the USBX stack to set this configuration. */
+ /* 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)
return(status);
@@ -145,7 +136,7 @@ UX_DEVICE *parent_device;
if (status != UX_SUCCESS)
{
/* Store the instance in the interface container, this is for the USBX stack
- when it needs to invoke the class. */
+ when it needs to invoke the class. */
storage -> ux_host_class_storage_interface -> ux_interface_class_instance = (VOID *) storage;
}
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 db56781a..578d54f1 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
@@ -1,18 +1,19 @@
/***************************************************************************
- * Copyright (c) 2024 Microsoft Corporation
- *
+ * Copyright (c) 2024 Microsoft Corporation
+ * Copyright (c) 2026-present Eclipse ThreadX contributors
+ *
* This program and the accompanying materials are made available under the
* terms of the MIT License which is available at
* https://opensource.org/licenses/MIT.
- *
+ *
* SPDX-License-Identifier: MIT
**************************************************************************/
/**************************************************************************/
/**************************************************************************/
-/** */
-/** USBX Component */
+/** */
+/** USBX Component */
/** */
/** Storage Class */
/** */
@@ -29,66 +30,43 @@
#include "ux_host_stack.h"
-/**************************************************************************/
-/* */
-/* FUNCTION RELEASE */
-/* */
-/* _ux_host_class_storage_deactivate PORTABLE C */
+/**************************************************************************/
+/* */
+/* FUNCTION RELEASE */
+/* */
+/* _ux_host_class_storage_deactivate PORTABLE C */
/* 6.1.10 */
/* AUTHOR */
/* */
/* Chaoqiong Xiao, Microsoft Corporation */
/* */
/* DESCRIPTION */
-/* */
-/* This function is called when this instance of the storage device */
-/* has been removed from the bus either directly or indirectly. The */
-/* bulk in\out pipes will be destroyed and the instanced removed. */
-/* */
-/* INPUT */
-/* */
-/* command Pointer to class command */
-/* */
-/* OUTPUT */
-/* */
-/* Completion Status */
-/* */
-/* CALLS */
-/* */
-/* 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 */
-/* _ux_host_semaphore_get Get protection semaphore */
-/* _ux_host_semaphore_delete Delete protection semaphore */
+/* */
+/* This function is called when this instance of the storage device */
+/* has been removed from the bus either directly or indirectly. The */
+/* bulk in\out pipes will be destroyed and the instanced removed. */
+/* */
+/* INPUT */
+/* */
+/* command Pointer to class command */
+/* */
+/* OUTPUT */
+/* */
+/* Completion Status */
+/* */
+/* CALLS */
+/* */
+/* 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 */
+/* _ux_host_semaphore_get Get protection semaphore */
+/* _ux_host_semaphore_delete Delete protection semaphore */
/* _ux_utility_thread_schedule_other Schedule other threads */
-/* */
-/* CALLED BY */
-/* */
-/* Storage Class */
-/* */
-/* RELEASE HISTORY */
-/* */
-/* 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 */
-/* 04-02-2021 Chaoqiong Xiao Modified comment(s), */
-/* fixed compile issues with */
-/* some macro options, */
-/* resulting in version 6.1.6 */
-/* 01-31-2022 Chaoqiong Xiao Modified comment(s), */
-/* improved media insert/eject */
-/* management without FX, */
-/* resulting in version 6.1.10 */
+/* */
+/* CALLED BY */
+/* */
+/* Storage Class */
/* */
/**************************************************************************/
UINT _ux_host_class_storage_deactivate(UX_HOST_CLASS_COMMAND *command)
@@ -107,7 +85,7 @@ VOID *memory;
/* Get the instance for this class. */
storage = (UX_HOST_CLASS_STORAGE *) command -> ux_host_class_command_instance;
-
+
/* We need the class container. */
class_inst = storage -> ux_host_class_storage_class;
@@ -120,18 +98,18 @@ VOID *memory;
/* We come to this point when the device has been extracted. So there may have been a transaction
being scheduled. We make sure the transaction has been completed by the controller driver.
When the device is extracted, the controller tries multiple times the transaction and retires it
- with a DEVICE_NOT_RESPONDING error code.
-
+ with a DEVICE_NOT_RESPONDING error code.
+
First we take care of endpoint OUT. */
/* We need to abort transactions on the bulk pipes. */
if (storage -> ux_host_class_storage_bulk_out_endpoint != UX_NULL)
_ux_host_stack_endpoint_transfer_abort(storage -> ux_host_class_storage_bulk_out_endpoint);
-
- /* Then endpoint IN. */
+
+ /* Then endpoint IN. */
if (storage -> ux_host_class_storage_bulk_in_endpoint != UX_NULL)
_ux_host_stack_endpoint_transfer_abort(storage -> ux_host_class_storage_bulk_in_endpoint);
-
+
#ifdef UX_HOST_CLASS_STORAGE_INCLUDE_LEGACY_PROTOCOL_SUPPORT
/* Was the protocol CBI ? */
if (storage -> ux_host_class_storage_interface -> ux_interface_descriptor.bInterfaceProtocol == UX_HOST_CLASS_STORAGE_PROTOCOL_CBI)
@@ -153,7 +131,7 @@ VOID *memory;
/* The enumeration thread needs to sleep a while to allow the application or the class that may be using
endpoints to exit properly. */
- _ux_host_thread_schedule_other(UX_THREAD_PRIORITY_ENUM);
+ _ux_host_thread_schedule_other(UX_THREAD_PRIORITY_ENUM);
/* Inform UX_MEDIA (default FileX) of the deactivation of all Media attached to this instance. */
@@ -171,7 +149,7 @@ VOID *memory;
/* Check if the media was properly opened. */
if (storage_media -> ux_host_class_storage_media_status == UX_HOST_CLASS_STORAGE_MEDIA_MOUNTED)
{
-
+
/* We preserve the memory used by this media. */
memory = storage_media -> ux_host_class_storage_media_memory;
@@ -180,13 +158,13 @@ VOID *memory;
/* This device is now unmounted. */
storage_media -> ux_host_class_storage_media_status = UX_HOST_CLASS_STORAGE_MEDIA_UNMOUNTED;
-
+
/* Reset the media ID. */
ux_media_id_set(media, 0);
-
+
/* Free the memory block used for data transfer on behalf of UX_MEDIA (default FileX). */
_ux_utility_memory_free(memory);
- }
+ }
}
#else
@@ -227,7 +205,7 @@ VOID *memory;
that the device is removed. */
if (_ux_system_host -> ux_system_host_change_function != UX_NULL)
{
-
+
/* Inform the application the device is removed. */
_ux_system_host -> ux_system_host_change_function(UX_DEVICE_REMOVAL, storage -> ux_host_class_storage_class, (VOID *) storage);
}
@@ -242,6 +220,6 @@ VOID *memory;
_ux_utility_memory_free(storage);
/* Return successful completion. */
- return(UX_SUCCESS);
+ return(UX_SUCCESS);
}
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 373a8a0e..42448629 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
@@ -1,18 +1,19 @@
/***************************************************************************
- * Copyright (c) 2024 Microsoft Corporation
- *
+ * Copyright (c) 2024 Microsoft Corporation
+ * Copyright (c) 2026-present Eclipse ThreadX contributors
+ *
* This program and the accompanying materials are made available under the
* terms of the MIT License which is available at
* https://opensource.org/licenses/MIT.
- *
+ *
* SPDX-License-Identifier: MIT
**************************************************************************/
/**************************************************************************/
/**************************************************************************/
-/** */
-/** USBX Component */
+/** */
+/** USBX Component */
/** */
/** Storage Class */
/** */
@@ -30,67 +31,44 @@
#if !defined(UX_HOST_STANDALONE)
-/**************************************************************************/
-/* */
-/* FUNCTION RELEASE */
-/* */
-/* _ux_host_class_storage_device_initialize PORTABLE C */
+/**************************************************************************/
+/* */
+/* FUNCTION RELEASE */
+/* */
+/* _ux_host_class_storage_device_initialize PORTABLE C */
/* 6.3.0 */
/* AUTHOR */
/* */
/* Chaoqiong Xiao, Microsoft Corporation */
/* */
/* DESCRIPTION */
-/* */
-/* This function initializes the USB storage device. */
-/* */
+/* */
+/* This function initializes the USB storage device. */
+/* */
/* This function is for RTOS mode. */
-/* */
-/* INPUT */
-/* */
-/* storage Pointer to storage class */
-/* */
-/* OUTPUT */
-/* */
-/* Completion Status */
-/* */
-/* CALLS */
-/* */
-/* _ux_host_class_storage_device_reset Reset device */
-/* _ux_host_class_storage_max_lun_get Get maximum number of LUNs */
-/* _ux_host_class_storage_media_characteristics_get */
-/* Get media characteristics */
+/* */
+/* INPUT */
+/* */
+/* storage Pointer to storage class */
+/* */
+/* OUTPUT */
+/* */
+/* Completion Status */
+/* */
+/* CALLS */
+/* */
+/* _ux_host_class_storage_device_reset Reset device */
+/* _ux_host_class_storage_max_lun_get Get maximum number of LUNs */
+/* _ux_host_class_storage_media_characteristics_get */
+/* Get media characteristics */
/* _ux_host_class_storage_media_format_capacity_get */
/* Get format capacity */
-/* _ux_host_class_storage_media_mount Mount the media */
-/* _ux_utility_delay_ms Delay ms */
-/* */
-/* CALLED BY */
-/* */
-/* Storage Class */
-/* */
-/* RELEASE HISTORY */
-/* */
-/* 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 */
-/* 08-02-2021 Wen Wang Modified comment(s), */
-/* fixed logic of creating */
-/* multiple storage media, */
-/* resulting in version 6.1.8 */
-/* 01-31-2022 Chaoqiong Xiao Modified comment(s), */
-/* improved media insert/eject */
-/* management without FX, */
-/* resulting in version 6.1.10 */
-/* 10-31-2023 Chaoqiong Xiao Modified comment(s), */
-/* moved class/sub/protocol */
-/* check and endpoints get */
-/* into _activate function, */
-/* resulting in version 6.3.0 */
+/* _ux_host_class_storage_media_mount Mount the media */
+/* _ux_utility_delay_ms Delay ms */
+/* */
+/* CALLED BY */
+/* */
+/* Storage Class */
/* */
/**************************************************************************/
UINT _ux_host_class_storage_device_initialize(UX_HOST_CLASS_STORAGE *storage)
@@ -112,8 +90,8 @@ UINT inst_index;
return(status);
/* We need to wait for some device to settle. The INTUIX Flash disk is an example of
- these device who fail the first Inquiry command if sent too quickly.
- The timing does not have to be precise so we use the thread sleep function.
+ these device who fail the first Inquiry command if sent too quickly.
+ The timing does not have to be precise so we use the thread sleep function.
The default sleep value is 2 seconds. */
_ux_utility_delay_ms(UX_HOST_CLASS_STORAGE_DEVICE_INIT_DELAY);
@@ -154,7 +132,7 @@ UINT inst_index;
/* Store the LUN type in the LUN type array. */
storage -> ux_host_class_storage_lun_types[lun_index] = storage -> ux_host_class_storage_media_type;
- /* Check the media type. We support regular FAT drives and optical drives.
+ /* Check the media type. We support regular FAT drives and optical drives.
No CD-ROM support in this release. */
switch (storage -> ux_host_class_storage_media_type)
{
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 4ec4ec80..7c4e3dd0 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
@@ -1,10 +1,11 @@
/***************************************************************************
- * Copyright (c) 2024 Microsoft Corporation
- *
+ * Copyright (c) 2024 Microsoft Corporation
+ * Copyright (c) 2026-present Eclipse ThreadX contributors
+ *
* This program and the accompanying materials are made available under the
* terms of the MIT License which is available at
* https://opensource.org/licenses/MIT.
- *
+ *
* SPDX-License-Identifier: MIT
**************************************************************************/
@@ -61,20 +62,6 @@
/* */
/* Storage Class */
/* */
-/* RELEASE HISTORY */
-/* */
-/* DATE NAME DESCRIPTION */
-/* */
-/* 05-19-2020 Chaoqiong Xiao Initial Version 6.0 */
-/* 09-30-2020 Chaoqiong Xiao Modified comment(s), */
-/* resulting in version 6.1 */
-/* 01-31-2022 Chaoqiong Xiao Modified comment(s), */
-/* added standalone support, */
-/* resulting in version 6.1.10 */
-/* 04-25-2022 Chaoqiong Xiao Modified comment(s), */
-/* internal clean up, */
-/* resulting in version 6.1.11 */
-/* */
/**************************************************************************/
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 2a86c567..cad4404f 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
@@ -1,10 +1,11 @@
/***************************************************************************
- * Copyright (c) 2024 Microsoft Corporation
- *
+ * Copyright (c) 2024 Microsoft Corporation
+ * Copyright (c) 2026-present Eclipse ThreadX contributors
+ *
* This program and the accompanying materials are made available under the
* terms of the MIT License which is available at
* https://opensource.org/licenses/MIT.
- *
+ *
* SPDX-License-Identifier: MIT
**************************************************************************/
@@ -64,17 +65,6 @@
/* */
/* Storage Class */
/* */
-/* RELEASE HISTORY */
-/* */
-/* DATE NAME DESCRIPTION */
-/* */
-/* 05-19-2020 Chaoqiong Xiao Initial Version 6.0 */
-/* 09-30-2020 Chaoqiong Xiao Modified comment(s), */
-/* resulting in version 6.1 */
-/* 01-31-2022 Chaoqiong Xiao Modified comment(s), */
-/* added standalone support, */
-/* resulting in version 6.1.10 */
-/* */
/**************************************************************************/
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 4a555786..2dd0684a 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
@@ -1,10 +1,11 @@
/***************************************************************************
- * Copyright (c) 2024 Microsoft Corporation
- *
+ * Copyright (c) 2024 Microsoft Corporation
+ * Copyright (c) 2026-present Eclipse ThreadX contributors
+ *
* This program and the accompanying materials are made available under the
* terms of the MIT License which is available at
* https://opensource.org/licenses/MIT.
- *
+ *
* SPDX-License-Identifier: MIT
**************************************************************************/
@@ -123,25 +124,6 @@ VOID _ux_host_class_storage_driver_entry(UX_MEDIA *media);
/* */
/* FileX */
/* */
-/* RELEASE HISTORY */
-/* */
-/* 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 */
-/* 01-31-2022 Chaoqiong Xiao Modified comment(s), */
-/* resulting in version 6.1.10 */
-/* 04-25-2022 Chaoqiong Xiao Modified comment(s), */
-/* added implement to support */
-/* external FX mode, */
-/* resulting in version 6.1.11 */
-/* 07-29-2022 Chaoqiong Xiao Modified comment(s), */
-/* improved external FX mode, */
-/* resulting in version 6.1.12 */
-/* */
/**************************************************************************/
VOID _ux_host_class_storage_driver_entry(FX_MEDIA *media)
{
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 18b8b683..68f1386e 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
@@ -1,10 +1,11 @@
/***************************************************************************
- * Copyright (c) 2024 Microsoft Corporation
- *
+ * Copyright (c) 2024 Microsoft Corporation
+ * Copyright (c) 2026-present Eclipse ThreadX contributors
+ *
* This program and the accompanying materials are made available under the
* terms of the MIT License which is available at
* https://opensource.org/licenses/MIT.
- *
+ *
* SPDX-License-Identifier: MIT
**************************************************************************/
@@ -61,24 +62,6 @@
/* */
/* Storage Class */
/* */
-/* RELEASE HISTORY */
-/* */
-/* DATE NAME DESCRIPTION */
-/* */
-/* 05-19-2020 Chaoqiong Xiao Initial Version 6.0 */
-/* 09-30-2020 Chaoqiong Xiao Modified comment(s), */
-/* resulting in version 6.1 */
-/* 10-15-2021 Chaoqiong Xiao Modified comment(s), */
-/* use pre-calculated value */
-/* instead of wMaxPacketSize, */
-/* resulting in version 6.1.9 */
-/* 01-31-2022 Chaoqiong Xiao Modified comment(s), */
-/* initial the timeout value, */
-/* resulting in version 6.1.10 */
-/* 10-31-2023 Chaoqiong Xiao Modified comment(s), */
-/* checked endpoint get status,*/
-/* resulting in version 6.3.0 */
-/* */
/**************************************************************************/
UINT _ux_host_class_storage_endpoints_get(UX_HOST_CLASS_STORAGE *storage)
{
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 1efdee25..b4064f62 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
@@ -1,18 +1,19 @@
/***************************************************************************
- * Copyright (c) 2024 Microsoft Corporation
- *
+ * Copyright (c) 2024 Microsoft Corporation
+ * Copyright (c) 2026-present Eclipse ThreadX contributors
+ *
* This program and the accompanying materials are made available under the
* terms of the MIT License which is available at
* https://opensource.org/licenses/MIT.
- *
+ *
* SPDX-License-Identifier: MIT
**************************************************************************/
/**************************************************************************/
/**************************************************************************/
-/** */
-/** USBX Component */
+/** */
+/** USBX Component */
/** */
/** Storage Class */
/** */
@@ -30,70 +31,49 @@
UX_COMPILE_TIME_ASSERT(!UX_OVERFLOW_CHECK_MULC_ULONG(sizeof(UX_HOST_CLASS_STORAGE_MEDIA), UX_HOST_CLASS_STORAGE_MAX_MEDIA), UX_HOST_CLASS_STORAGE_MAX_MEDIA_mul_ovf)
-/**************************************************************************/
-/* */
-/* FUNCTION RELEASE */
-/* */
-/* _ux_host_class_storage_entry PORTABLE C */
+/**************************************************************************/
+/* */
+/* FUNCTION RELEASE */
+/* */
+/* _ux_host_class_storage_entry PORTABLE C */
/* 6.1.10 */
/* AUTHOR */
/* */
/* Chaoqiong Xiao, Microsoft Corporation */
/* */
/* DESCRIPTION */
-/* */
-/* This function is the entry point of the storage class. It will be */
-/* called by the USBX stack enumeration module when there is a new */
+/* */
+/* This function is the entry point of the storage class. It will be */
+/* called by the USBX stack enumeration module when there is a new */
/* USB disk on the bus or when the USB disk is removed. */
/* */
-/* Version 2.0 of the storage class only supports USB FAT media and */
-/* not CD-ROM. */
-/* */
-/* INPUT */
-/* */
-/* command Pointer to class command */
-/* */
-/* OUTPUT */
-/* */
-/* Completion Status */
-/* */
-/* CALLS */
-/* */
-/* _ux_host_class_storage_activate Activate storage class */
-/* _ux_host_class_storage_deactivate Deactivate storage class */
-/* _ux_utility_memory_allocate Allocate memory block */
+/* Version 2.0 of the storage class only supports USB FAT media and */
+/* not CD-ROM. */
+/* */
+/* INPUT */
+/* */
+/* command Pointer to class command */
+/* */
+/* OUTPUT */
+/* */
+/* Completion Status */
+/* */
+/* CALLS */
+/* */
+/* _ux_host_class_storage_activate Activate storage class */
+/* _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_delete Delete storage class thread */
-/* */
-/* CALLED BY */
-/* */
-/* Host Stack */
-/* */
-/* RELEASE HISTORY */
-/* */
-/* 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 */
-/* 11-09-2020 Chaoqiong Xiao Modified comment(s), */
-/* fixed class ext access, */
-/* resulting in version 6.1.2 */
-/* 01-31-2022 Chaoqiong Xiao Modified comment(s), */
-/* added standalone support, */
-/* resulting in version 6.1.10 */
+/* _ux_utility_thread_delete Delete storage class thread */
+/* */
+/* CALLED BY */
+/* */
+/* Host Stack */
/* */
/**************************************************************************/
UINT _ux_host_class_storage_entry(UX_HOST_CLASS_COMMAND *command)
-{
+{
UINT status;
UX_HOST_CLASS *class_inst;
@@ -113,10 +93,10 @@ UX_HOST_CLASS_STORAGE_EXT *class_ext;
this device or not. */
if ((command -> ux_host_class_command_usage == UX_HOST_CLASS_COMMAND_USAGE_CSP) &&
(command -> ux_host_class_command_class == UX_HOST_CLASS_STORAGE_CLASS))
- return(UX_SUCCESS);
- else
- return(UX_NO_CLASS_MATCH);
-
+ return(UX_SUCCESS);
+ else
+ return(UX_NO_CLASS_MATCH);
+
case UX_HOST_CLASS_COMMAND_ACTIVATE:
/* We are assuming the device will mount. If this is the first activation of
@@ -145,9 +125,9 @@ UX_HOST_CLASS_STORAGE_EXT *class_ext;
status = _ux_host_thread_create(&class_ext -> ux_host_class_thread,
"ux_host_storage_thread",
_ux_host_class_storage_thread_entry,
- (ULONG) (ALIGN_TYPE) class_inst,
+ (ULONG) (ALIGN_TYPE) class_inst,
class_ext -> ux_host_class_thread_stack,
- UX_HOST_CLASS_STORAGE_THREAD_STACK_SIZE,
+ UX_HOST_CLASS_STORAGE_THREAD_STACK_SIZE,
UX_HOST_CLASS_STORAGE_THREAD_PRIORITY_CLASS,
UX_HOST_CLASS_STORAGE_THREAD_PRIORITY_CLASS,
UX_NO_TIME_SLICE, UX_DONT_START);
@@ -205,7 +185,7 @@ UX_HOST_CLASS_STORAGE_EXT *class_ext;
case UX_HOST_CLASS_COMMAND_DEACTIVATE:
- /* The deactivate command is used when the device has been extracted either
+ /* The deactivate command is used when the device has been extracted either
directly or when its parents has been extracted. */
status = _ux_host_class_storage_deactivate(command);
@@ -249,7 +229,7 @@ UX_HOST_CLASS_STORAGE_EXT *class_ext;
/* Return success. */
return(UX_SUCCESS);
- default:
+ default:
/* Error trap. */
_ux_system_error_handler(UX_SYSTEM_LEVEL_THREAD, UX_SYSTEM_CONTEXT_CLASS, UX_FUNCTION_NOT_SUPPORTED);
@@ -259,6 +239,6 @@ UX_HOST_CLASS_STORAGE_EXT *class_ext;
/* Return an error. */
return(UX_FUNCTION_NOT_SUPPORTED);
- }
+ }
}
diff --git a/common/usbx_host_classes/src/ux_host_class_storage_lock.c b/common/usbx_host_classes/src/ux_host_class_storage_lock.c
index 5fb85d16..4c8d5b2a 100644
--- a/common/usbx_host_classes/src/ux_host_class_storage_lock.c
+++ b/common/usbx_host_classes/src/ux_host_class_storage_lock.c
@@ -1,10 +1,11 @@
/***************************************************************************
- * Copyright (c) 2024 Microsoft Corporation
- *
+ * Copyright (c) 2024 Microsoft Corporation
+ * Copyright (c) 2026-present Eclipse ThreadX contributors
+ *
* This program and the accompanying materials are made available under the
* terms of the MIT License which is available at
* https://opensource.org/licenses/MIT.
- *
+ *
* SPDX-License-Identifier: MIT
**************************************************************************/
@@ -65,15 +66,6 @@
/* */
/* Storage Class */
/* */
-/* RELEASE HISTORY */
-/* */
-/* DATE NAME DESCRIPTION */
-/* */
-/* 01-31-2022 Chaoqiong Xiao Initial Version 6.1.10 */
-/* 03-08-2023 Chaoqiong Xiao Modified comment(s), */
-/* checked device state, */
-/* resulting in version 6.2.1 */
-/* */
/**************************************************************************/
UINT _ux_host_class_storage_lock(UX_HOST_CLASS_STORAGE *storage, ULONG wait)
{
@@ -190,12 +182,6 @@ UX_DEVICE *device;
/* */
/* Application */
/* */
-/* RELEASE HISTORY */
-/* */
-/* DATE NAME DESCRIPTION */
-/* */
-/* 10-31-2023 Chaoqiong Xiao Initial Version 6.3.0 */
-/* */
/**************************************************************************/
UINT _uxe_host_class_storage_lock(UX_HOST_CLASS_STORAGE *storage, ULONG wait)
{
diff --git a/common/usbx_host_classes/src/ux_host_class_storage_max_lun_get.c b/common/usbx_host_classes/src/ux_host_class_storage_max_lun_get.c
index 0ab07c66..de208483 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
@@ -1,10 +1,11 @@
/***************************************************************************
- * Copyright (c) 2024 Microsoft Corporation
- *
+ * Copyright (c) 2024 Microsoft Corporation
+ * Copyright (c) 2026-present Eclipse ThreadX contributors
+ *
* This program and the accompanying materials are made available under the
* terms of the MIT License which is available at
* https://opensource.org/licenses/MIT.
- *
+ *
* SPDX-License-Identifier: MIT
**************************************************************************/
@@ -62,17 +63,6 @@
/* */
/* Storage Class */
/* */
-/* RELEASE HISTORY */
-/* */
-/* DATE NAME DESCRIPTION */
-/* */
-/* 05-19-2020 Chaoqiong Xiao Initial Version 6.0 */
-/* 09-30-2020 Chaoqiong Xiao Modified comment(s), */
-/* resulting in version 6.1 */
-/* 01-31-2022 Chaoqiong Xiao Modified comment(s), */
-/* added standalone support, */
-/* resulting in version 6.1.10 */
-/* */
/**************************************************************************/
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 f6a692a9..f78c57d8 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
@@ -1,10 +1,11 @@
/***************************************************************************
- * Copyright (c) 2024 Microsoft Corporation
- *
+ * Copyright (c) 2024 Microsoft Corporation
+ * Copyright (c) 2026-present Eclipse ThreadX contributors
+ *
* This program and the accompanying materials are made available under the
* terms of the MIT License which is available at
* https://opensource.org/licenses/MIT.
- *
+ *
* SPDX-License-Identifier: MIT
**************************************************************************/
@@ -66,19 +67,6 @@
/* */
/* Storage Class */
/* */
-/* RELEASE HISTORY */
-/* */
-/* 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 */
-/* 01-31-2022 Chaoqiong Xiao Modified comment(s), */
-/* added standalone support, */
-/* resulting in version 6.1.10 */
-/* */
/**************************************************************************/
UINT _ux_host_class_storage_media_capacity_get(UX_HOST_CLASS_STORAGE *storage)
{
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 2cb22548..df8083dc 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
@@ -1,18 +1,19 @@
/***************************************************************************
- * Copyright (c) 2024 Microsoft Corporation
- *
+ * Copyright (c) 2024 Microsoft Corporation
+ * Copyright (c) 2026-present Eclipse ThreadX contributors
+ *
* This program and the accompanying materials are made available under the
* terms of the MIT License which is available at
* https://opensource.org/licenses/MIT.
- *
+ *
* SPDX-License-Identifier: MIT
**************************************************************************/
/**************************************************************************/
/**************************************************************************/
-/** */
-/** USBX Component */
+/** */
+/** USBX Component */
/** */
/** Storage Class */
/** */
@@ -29,52 +30,41 @@
#include "ux_host_stack.h"
-/**************************************************************************/
-/* */
-/* FUNCTION RELEASE */
-/* */
-/* _ux_host_class_storage_media_characteristics_get PORTABLE C */
+/**************************************************************************/
+/* */
+/* FUNCTION RELEASE */
+/* */
+/* _ux_host_class_storage_media_characteristics_get PORTABLE C */
/* 6.1.10 */
/* AUTHOR */
/* */
/* Chaoqiong Xiao, Microsoft Corporation */
/* */
/* DESCRIPTION */
-/* */
+/* */
/* This function will send a INQUIRY command to get the type of */
-/* device/media we are dealing with. */
-/* */
-/* INPUT */
-/* */
-/* storage Pointer to storage class */
-/* */
-/* OUTPUT */
-/* */
-/* Completion Status */
-/* */
-/* CALLS */
-/* */
-/* _ux_host_class_storage_cbw_initialize Initialize CBW */
-/* _ux_host_class_storage_transport Send command */
+/* device/media we are dealing with. */
+/* */
+/* INPUT */
+/* */
+/* storage Pointer to storage class */
+/* */
+/* OUTPUT */
+/* */
+/* Completion Status */
+/* */
+/* CALLS */
+/* */
+/* _ux_host_class_storage_cbw_initialize Initialize CBW */
+/* _ux_host_class_storage_transport Send command */
/* _ux_host_class_storage_media_capacity_get */
/* Get media capacity */
-/* _ux_utility_memory_allocate Allocate memory block */
-/* _ux_utility_memory_free Release memory block */
-/* */
-/* CALLED BY */
-/* */
-/* Storage Class */
-/* */
-/* RELEASE HISTORY */
-/* */
-/* DATE NAME DESCRIPTION */
-/* */
-/* 05-19-2020 Chaoqiong Xiao Initial Version 6.0 */
-/* 09-30-2020 Chaoqiong Xiao Modified comment(s), */
-/* resulting in version 6.1 */
-/* 01-31-2022 Chaoqiong Xiao Modified comment(s), */
-/* added standalone support, */
-/* resulting in version 6.1.10 */
+/* _ux_utility_memory_allocate Allocate memory block */
+/* _ux_utility_memory_free Release memory block */
+/* */
+/* CALLED BY */
+/* */
+/* Storage Class */
/* */
/**************************************************************************/
UINT _ux_host_class_storage_media_characteristics_get(UX_HOST_CLASS_STORAGE *storage)
@@ -100,10 +90,10 @@ UINT command_length;
/* Initialize the CBW for this command. */
_ux_host_class_storage_cbw_initialize(storage, UX_HOST_CLASS_STORAGE_DATA_IN, UX_HOST_CLASS_STORAGE_INQUIRY_RESPONSE_LENGTH, command_length);
-
+
/* Prepare the INQUIRY command block. */
*(cbw + UX_HOST_CLASS_STORAGE_CBW_CB + UX_HOST_CLASS_STORAGE_INQUIRY_OPERATION) = UX_HOST_CLASS_STORAGE_SCSI_INQUIRY;
-
+
/* Store the length of the Inquiry Response. */
*(cbw + UX_HOST_CLASS_STORAGE_CBW_CB + UX_HOST_CLASS_STORAGE_INQUIRY_ALLOCATION_LENGTH) = UX_HOST_CLASS_STORAGE_INQUIRY_RESPONSE_LENGTH;
@@ -136,13 +126,13 @@ UINT command_length;
/* Attempt to read the device capacity in order to retrieve the Sector Size. If the command fails,
we will default to 512 bytes for a regular drive and 2048 bytes for a CD-ROM or optical drive. */
status = _ux_host_class_storage_media_capacity_get(storage);
- }
+ }
/* Free the memory resource used for the command response. */
_ux_utility_memory_free(inquiry_response);
-
+
/* Return completion status. */
- return(status);
+ return(status);
#endif
}
diff --git a/common/usbx_host_classes/src/ux_host_class_storage_media_check.c b/common/usbx_host_classes/src/ux_host_class_storage_media_check.c
index e8ab7426..ac0d838c 100644
--- a/common/usbx_host_classes/src/ux_host_class_storage_media_check.c
+++ b/common/usbx_host_classes/src/ux_host_class_storage_media_check.c
@@ -1,10 +1,11 @@
/***************************************************************************
- * Copyright (c) 2024 Microsoft Corporation
- *
+ * Copyright (c) 2024 Microsoft Corporation
+ * Copyright (c) 2026-present Eclipse ThreadX contributors
+ *
* This program and the accompanying materials are made available under the
* terms of the MIT License which is available at
* https://opensource.org/licenses/MIT.
- *
+ *
* SPDX-License-Identifier: MIT
**************************************************************************/
@@ -67,12 +68,6 @@
/* */
/* Storage Class */
/* */
-/* RELEASE HISTORY */
-/* */
-/* DATE NAME DESCRIPTION */
-/* */
-/* 05-19-2020 Chaoqiong Xiao Initial Version 6.1.10 */
-/* */
/**************************************************************************/
UINT _ux_host_class_storage_media_check(UX_HOST_CLASS_STORAGE *storage)
{
@@ -114,12 +109,6 @@ UINT status;
/* */
/* Application */
/* */
-/* RELEASE HISTORY */
-/* */
-/* DATE NAME DESCRIPTION */
-/* */
-/* 10-31-2023 Chaoqiong Xiao Initial Version 6.3.0 */
-/* */
/**************************************************************************/
UINT _uxe_host_class_storage_media_check(UX_HOST_CLASS_STORAGE *storage)
{
diff --git a/common/usbx_host_classes/src/ux_host_class_storage_media_format_capacity_get.c b/common/usbx_host_classes/src/ux_host_class_storage_media_format_capacity_get.c
index 473dee55..7f4a2364 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
@@ -1,18 +1,19 @@
/***************************************************************************
- * Copyright (c) 2024 Microsoft Corporation
- *
+ * Copyright (c) 2024 Microsoft Corporation
+ * Copyright (c) 2026-present Eclipse ThreadX contributors
+ *
* This program and the accompanying materials are made available under the
* terms of the MIT License which is available at
* https://opensource.org/licenses/MIT.
- *
+ *
* SPDX-License-Identifier: MIT
**************************************************************************/
/**************************************************************************/
/**************************************************************************/
-/** */
-/** USBX Component */
+/** */
+/** USBX Component */
/** */
/** Storage Class */
/** */
@@ -29,52 +30,41 @@
#include "ux_host_stack.h"
-/**************************************************************************/
-/* */
-/* FUNCTION RELEASE */
-/* */
-/* _ux_host_class_storage_media_format_capacity_get PORTABLE C */
+/**************************************************************************/
+/* */
+/* FUNCTION RELEASE */
+/* */
+/* _ux_host_class_storage_media_format_capacity_get PORTABLE C */
/* 6.1.10 */
/* AUTHOR */
/* */
/* Chaoqiong Xiao, Microsoft Corporation */
/* */
/* DESCRIPTION */
-/* */
+/* */
/* This function will send a READ_FORMAT_CAPACITY command to the */
-/* device. Some USB storage disk require this function for the sanity */
-/* of their state machine. */
-/* */
-/* INPUT */
-/* */
-/* storage Pointer to storage class */
-/* */
-/* OUTPUT */
-/* */
-/* Completion Status */
-/* */
-/* CALLS */
-/* */
-/* _ux_host_class_storage_cbw_initialize Initialize CBW */
-/* _ux_host_class_storage_transport Send command */
-/* _ux_utility_memory_allocate Allocate memory block */
-/* _ux_utility_memory_free Release memory block */
+/* device. Some USB storage disk require this function for the sanity */
+/* of their state machine. */
+/* */
+/* INPUT */
+/* */
+/* storage Pointer to storage class */
+/* */
+/* OUTPUT */
+/* */
+/* Completion Status */
+/* */
+/* CALLS */
+/* */
+/* _ux_host_class_storage_cbw_initialize Initialize CBW */
+/* _ux_host_class_storage_transport Send command */
+/* _ux_utility_memory_allocate Allocate memory block */
+/* _ux_utility_memory_free Release memory block */
/* _ux_utility_short_put_big_endian Put 32-bit big endian */
-/* */
-/* CALLED BY */
-/* */
-/* Storage Class */
-/* */
-/* RELEASE HISTORY */
-/* */
-/* DATE NAME DESCRIPTION */
-/* */
-/* 05-19-2020 Chaoqiong Xiao Initial Version 6.0 */
-/* 09-30-2020 Chaoqiong Xiao Modified comment(s), */
-/* resulting in version 6.1 */
-/* 01-31-2022 Chaoqiong Xiao Modified comment(s), */
-/* added standalone support, */
-/* resulting in version 6.1.10 */
+/* */
+/* CALLED BY */
+/* */
+/* Storage Class */
/* */
/**************************************************************************/
UINT _ux_host_class_storage_media_format_capacity_get(UX_HOST_CLASS_STORAGE *storage)
@@ -102,10 +92,10 @@ UINT command_length;
/* Initialize the CBW for this command. */
_ux_host_class_storage_cbw_initialize(storage, UX_HOST_CLASS_STORAGE_DATA_IN, UX_HOST_CLASS_STORAGE_READ_FORMAT_RESPONSE_LENGTH, command_length);
-
+
/* Prepare the READ FORMAT CAPACITY command block. */
*(cbw + UX_HOST_CLASS_STORAGE_CBW_CB + UX_HOST_CLASS_STORAGE_READ_FORMAT_OPERATION) = UX_HOST_CLASS_STORAGE_SCSI_READ_FORMAT_CAPACITY;
-
+
/* Store the number of sectors to read. */
_ux_utility_short_put_big_endian(cbw + UX_HOST_CLASS_STORAGE_CBW_CB + UX_HOST_CLASS_STORAGE_READ_FORMAT_PARAMETER_LIST_LENGTH, UX_HOST_CLASS_STORAGE_READ_FORMAT_RESPONSE_LENGTH);
@@ -132,7 +122,7 @@ UINT command_length;
_ux_utility_memory_free(read_format_capacity_response);
/* If we have a transport error, there is not much we can do, we do not fail. */
- return(UX_SUCCESS);
+ return(UX_SUCCESS);
#endif
}
diff --git a/common/usbx_host_classes/src/ux_host_class_storage_media_get.c b/common/usbx_host_classes/src/ux_host_class_storage_media_get.c
index d28dcfbf..bb7085a1 100644
--- a/common/usbx_host_classes/src/ux_host_class_storage_media_get.c
+++ b/common/usbx_host_classes/src/ux_host_class_storage_media_get.c
@@ -1,10 +1,11 @@
/***************************************************************************
- * Copyright (c) 2024 Microsoft Corporation
- *
+ * Copyright (c) 2024 Microsoft Corporation
+ * Copyright (c) 2026-present Eclipse ThreadX contributors
+ *
* This program and the accompanying materials are made available under the
* terms of the MIT License which is available at
* https://opensource.org/licenses/MIT.
- *
+ *
* SPDX-License-Identifier: MIT
**************************************************************************/
@@ -62,21 +63,6 @@
/* */
/* Storage Class */
/* */
-/* RELEASE HISTORY */
-/* */
-/* DATE NAME DESCRIPTION */
-/* */
-/* 09-30-2020 Chaoqiong Xiao Initial Version 6.1 */
-/* 08-02-2021 Wen Wang Modified comment(s), */
-/* fixed spelling error, */
-/* resulting in version 6.1.8 */
-/* 01-31-2022 Chaoqiong Xiao Modified comment(s), */
-/* refined media to search, */
-/* resulting in version 6.1.10 */
-/* 07-29-2022 Chaoqiong Xiao Modified comment(s), */
-/* cleared CSTAT warning, */
-/* resulting in version 6.1.12 */
-/* */
/**************************************************************************/
UINT _ux_host_class_storage_media_get(UX_HOST_CLASS_STORAGE *storage,
ULONG media_lun,
@@ -167,12 +153,6 @@ UINT scan_index;
/* */
/* Application */
/* */
-/* RELEASE HISTORY */
-/* */
-/* DATE NAME DESCRIPTION */
-/* */
-/* 10-31-2023 Chaoqiong Xiao Initial Version 6.3.0 */
-/* */
/**************************************************************************/
UINT _uxe_host_class_storage_media_get(UX_HOST_CLASS_STORAGE *storage,
ULONG media_lun,
diff --git a/common/usbx_host_classes/src/ux_host_class_storage_media_lock.c b/common/usbx_host_classes/src/ux_host_class_storage_media_lock.c
index e0011a29..7114e953 100644
--- a/common/usbx_host_classes/src/ux_host_class_storage_media_lock.c
+++ b/common/usbx_host_classes/src/ux_host_class_storage_media_lock.c
@@ -1,10 +1,11 @@
/***************************************************************************
- * Copyright (c) 2024 Microsoft Corporation
- *
+ * Copyright (c) 2024 Microsoft Corporation
+ * Copyright (c) 2026-present Eclipse ThreadX contributors
+ *
* This program and the accompanying materials are made available under the
* terms of the MIT License which is available at
* https://opensource.org/licenses/MIT.
- *
+ *
* SPDX-License-Identifier: MIT
**************************************************************************/
@@ -61,15 +62,6 @@
/* */
/* Storage Class */
/* */
-/* RELEASE HISTORY */
-/* */
-/* DATE NAME DESCRIPTION */
-/* */
-/* 09-30-2020 Chaoqiong Xiao Initial Version 6.1 */
-/* 01-31-2022 Chaoqiong Xiao Modified comment(s), */
-/* added standalone support, */
-/* resulting in version 6.1.10 */
-/* */
/**************************************************************************/
UINT _ux_host_class_storage_media_lock(UX_HOST_CLASS_STORAGE_MEDIA *storage_media, ULONG wait)
{
@@ -136,12 +128,6 @@ UINT status;
/* */
/* Application */
/* */
-/* RELEASE HISTORY */
-/* */
-/* DATE NAME DESCRIPTION */
-/* */
-/* 10-31-2023 Chaoqiong Xiao Initial Version 6.3.0 */
-/* */
/**************************************************************************/
UINT _uxe_host_class_storage_media_lock(UX_HOST_CLASS_STORAGE_MEDIA *storage_media, ULONG wait)
{
diff --git a/common/usbx_host_classes/src/ux_host_class_storage_media_mount.c b/common/usbx_host_classes/src/ux_host_class_storage_media_mount.c
index ce4c1d72..d43bbd6c 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
@@ -1,10 +1,11 @@
/***************************************************************************
- * Copyright (c) 2024 Microsoft Corporation
- *
+ * Copyright (c) 2024 Microsoft Corporation
+ * Copyright (c) 2026-present Eclipse ThreadX contributors
+ *
* This program and the accompanying materials are made available under the
* terms of the MIT License which is available at
* https://opensource.org/licenses/MIT.
- *
+ *
* SPDX-License-Identifier: MIT
**************************************************************************/
@@ -78,19 +79,6 @@
/* */
/* Storage Class */
/* */
-/* RELEASE HISTORY */
-/* */
-/* 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 */
-/* 10-15-2021 Chaoqiong Xiao Modified comment(s), */
-/* fixed exFAT mounting, */
-/* resulting in version 6.1.9 */
-/* */
/**************************************************************************/
UINT _ux_host_class_storage_media_mount(UX_HOST_CLASS_STORAGE *storage, ULONG sector)
{
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 fe4c9c76..17f70346 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
@@ -1,18 +1,19 @@
/***************************************************************************
- * Copyright (c) 2024 Microsoft Corporation
- *
+ * Copyright (c) 2024 Microsoft Corporation
+ * Copyright (c) 2026-present Eclipse ThreadX contributors
+ *
* This program and the accompanying materials are made available under the
* terms of the MIT License which is available at
* https://opensource.org/licenses/MIT.
- *
+ *
* SPDX-License-Identifier: MIT
**************************************************************************/
/**************************************************************************/
/**************************************************************************/
-/** */
-/** USBX Component */
+/** */
+/** USBX Component */
/** */
/** Storage Class */
/** */
@@ -29,60 +30,42 @@
#include "ux_host_stack.h"
-/**************************************************************************/
-/* */
-/* FUNCTION RELEASE */
-/* */
-/* _ux_host_class_storage_media_open PORTABLE C */
+/**************************************************************************/
+/* */
+/* FUNCTION RELEASE */
+/* */
+/* _ux_host_class_storage_media_open PORTABLE C */
/* 6.2.0 */
/* AUTHOR */
/* */
/* Chaoqiong Xiao, Microsoft Corporation */
/* */
/* DESCRIPTION */
-/* */
+/* */
/* 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 */
-/* */
-/* storage Pointer to storage class */
-/* hidden_sectors Number of hidden sectors */
-/* */
-/* OUTPUT */
-/* */
-/* Completion Status */
-/* */
-/* CALLS */
-/* */
-/* ux_media_open Media open */
+/* UX_MEDIA (default FileX) dependencies. */
+/* */
+/* INPUT */
+/* */
+/* storage Pointer to storage class */
+/* hidden_sectors Number of hidden sectors */
+/* */
+/* OUTPUT */
+/* */
+/* Completion Status */
+/* */
+/* CALLS */
+/* */
+/* ux_media_open Media open */
/* _ux_host_class_storage_media_protection_check */
-/* Check for protection */
-/* _ux_utility_memory_allocate Allocate memory block */
+/* Check for protection */
+/* _ux_utility_memory_allocate Allocate memory block */
/* _ux_utility_memory_free Free memory block */
-/* */
-/* CALLED BY */
-/* */
-/* _ux_host_class_storage_media_mount Media open */
-/* */
-/* RELEASE HISTORY */
-/* */
-/* 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 */
-/* 10-31-2022 Chaoqiong Xiao Modified comment(s), */
-/* added buffer size check, */
-/* resulting in version 6.2.0 */
+/* */
+/* CALLED BY */
+/* */
+/* _ux_host_class_storage_media_mount Media open */
/* */
/**************************************************************************/
UINT _ux_host_class_storage_media_open(UX_HOST_CLASS_STORAGE *storage, ULONG hidden_sectors)
@@ -98,11 +81,11 @@ UINT media_index;
UX_HOST_CLASS_STORAGE_MEDIA *storage_media;
UX_MEDIA *media;
UX_HOST_CLASS *class_inst;
-
+
/* We need the class container. */
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_inst -> ux_host_class_media;
@@ -112,14 +95,14 @@ UX_HOST_CLASS *class_inst;
/* Get the USBX Integrated Media pointer for that media. */
media = &storage_media -> ux_host_class_storage_media;
-
+
/* Is the media valid? */
if (ux_media_id_get(media) == 0)
{
/* Save the storage instance in the media instance. */
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;
@@ -142,11 +125,11 @@ UX_HOST_CLASS *class_inst;
/* 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 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
- devices and there is a great deal of overhead when doing read/writes, it is better
+ /* 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
+ devices and there is a great deal of overhead when doing read/writes, it is better
to leave the default buffer size or even increase it. */
storage_media -> ux_host_class_storage_media_memory = _ux_utility_memory_allocate(UX_SAFE_ALIGN, UX_CACHE_SAFE_MEMORY, UX_HOST_CLASS_STORAGE_MEMORY_BUFFER_SIZE);
if (storage_media -> ux_host_class_storage_media_memory == UX_NULL)
@@ -157,7 +140,7 @@ UX_HOST_CLASS *class_inst;
/* 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,
+ storage, storage_media -> ux_host_class_storage_media_memory,
UX_HOST_CLASS_STORAGE_MEMORY_BUFFER_SIZE);
/* If the media is mounted, update the status for the application. */
@@ -170,7 +153,7 @@ UX_HOST_CLASS *class_inst;
_ux_utility_memory_free(storage_media -> ux_host_class_storage_media_memory);
/* Return completion status. */
- return(status);
+ return(status);
}
/* Move to next entry in the media array. */
@@ -183,7 +166,7 @@ UX_HOST_CLASS *class_inst;
/* If trace is enabled, insert this event into the trace buffer. */
UX_TRACE_IN_LINE_INSERT(UX_TRACE_ERROR, UX_HOST_CLASS_MEMORY_ERROR, storage, 0, 0, UX_TRACE_ERRORS, 0, 0)
- /* Return error. */
+ /* 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 1c9375cc..e270b584 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
@@ -1,18 +1,19 @@
/***************************************************************************
- * Copyright (c) 2024 Microsoft Corporation
- *
+ * Copyright (c) 2024 Microsoft Corporation
+ * Copyright (c) 2026-present Eclipse ThreadX contributors
+ *
* This program and the accompanying materials are made available under the
* terms of the MIT License which is available at
* https://opensource.org/licenses/MIT.
- *
+ *
* SPDX-License-Identifier: MIT
**************************************************************************/
/**************************************************************************/
/**************************************************************************/
-/** */
-/** USBX Component */
+/** */
+/** USBX Component */
/** */
/** Storage Class */
/** */
@@ -29,49 +30,41 @@
#include "ux_host_stack.h"
-/**************************************************************************/
-/* */
-/* FUNCTION RELEASE */
-/* */
-/* _ux_host_class_storage_media_protection_check PORTABLE C */
+/**************************************************************************/
+/* */
+/* FUNCTION RELEASE */
+/* */
+/* _ux_host_class_storage_media_protection_check PORTABLE C */
/* 6.1 */
/* AUTHOR */
/* */
/* Chaoqiong Xiao, Microsoft Corporation */
/* */
/* DESCRIPTION */
-/* */
+/* */
/* This function will send a MODE_SENSE command to retrieve the medium */
-/* and device parameters. */
-/* */
-/* INPUT */
-/* */
-/* storage Pointer to storage class */
-/* */
-/* OUTPUT */
-/* */
-/* Completion Status */
-/* */
-/* CALLS */
-/* */
-/* _ux_host_class_storage_cbw_initialize Initialize CBW */
-/* _ux_host_class_storage_transport Send command */
-/* _ux_utility_memory_allocate Allocate memory block */
-/* _ux_utility_memory_free Release memory block */
-/* _ux_utility_short_get_big_endian Get short value */
-/* _ux_utility_short_put_big_endian Put short value */
-/* */
-/* CALLED BY */
-/* */
-/* Storage Class */
-/* */
-/* RELEASE HISTORY */
-/* */
-/* DATE NAME DESCRIPTION */
-/* */
-/* 05-19-2020 Chaoqiong Xiao Initial Version 6.0 */
-/* 09-30-2020 Chaoqiong Xiao Modified comment(s), */
-/* resulting in version 6.1 */
+/* and device parameters. */
+/* */
+/* INPUT */
+/* */
+/* storage Pointer to storage class */
+/* */
+/* OUTPUT */
+/* */
+/* Completion Status */
+/* */
+/* CALLS */
+/* */
+/* _ux_host_class_storage_cbw_initialize Initialize CBW */
+/* _ux_host_class_storage_transport Send command */
+/* _ux_utility_memory_allocate Allocate memory block */
+/* _ux_utility_memory_free Release memory block */
+/* _ux_utility_short_get_big_endian Get short value */
+/* _ux_utility_short_put_big_endian Put short value */
+/* */
+/* CALLED BY */
+/* */
+/* Storage Class */
/* */
/**************************************************************************/
UINT _ux_host_class_storage_media_protection_check(UX_HOST_CLASS_STORAGE *storage)
@@ -99,11 +92,11 @@ ULONG wp_parameter_location;
/* Initialize the CBW for this command. */
_ux_host_class_storage_cbw_initialize(storage, UX_HOST_CLASS_STORAGE_DATA_IN, UX_HOST_CLASS_STORAGE_MODE_SENSE_ALL_PAGE_LENGTH, command_length);
-
+
/* Prepare the MODE_SENSE command block. Distinguish between SUBCLASSES. */
switch (storage -> ux_host_class_storage_interface -> ux_interface_descriptor.bInterfaceSubClass)
{
-
+
case UX_HOST_CLASS_STORAGE_SUBCLASS_RBC :
#ifdef UX_HOST_CLASS_STORAGE_INCLUDE_LEGACY_PROTOCOL_SUPPORT
case UX_HOST_CLASS_STORAGE_SUBCLASS_UFI :
@@ -112,15 +105,15 @@ ULONG wp_parameter_location;
wp_parameter_location = UX_HOST_CLASS_STORAGE_MODE_SENSE_RESPONSE_ATTRIBUTES;
break;
- default :
+ default :
*(cbw + UX_HOST_CLASS_STORAGE_CBW_CB + UX_HOST_CLASS_STORAGE_MODE_SENSE_OPERATION) = UX_HOST_CLASS_STORAGE_SCSI_MODE_SENSE_SHORT;
wp_parameter_location = UX_HOST_CLASS_STORAGE_MODE_SENSE_RESPONSE_ATTRIBUTES_SHORT;
break;
}
-
+
/* We ask for all pages. */
*(cbw + UX_HOST_CLASS_STORAGE_CBW_CB + UX_HOST_CLASS_STORAGE_MODE_SENSE_PC_PAGE_CODE) = UX_HOST_CLASS_STORAGE_MODE_SENSE_ALL_PAGE;
-
+
/* Store the length of the Inquiry Response. */
_ux_utility_short_put_big_endian(cbw + UX_HOST_CLASS_STORAGE_CBW_CB + UX_HOST_CLASS_STORAGE_MODE_SENSE_PARAMETER_LIST_LENGTH, UX_HOST_CLASS_STORAGE_MODE_SENSE_ALL_PAGE_LENGTH);
@@ -128,10 +121,10 @@ ULONG wp_parameter_location;
mode_sense_response = _ux_utility_memory_allocate(UX_SAFE_ALIGN, UX_CACHE_SAFE_MEMORY, UX_HOST_CLASS_STORAGE_MODE_SENSE_ALL_PAGE_LENGTH);
if (mode_sense_response == UX_NULL)
return(UX_MEMORY_INSUFFICIENT);
-
+
/* Send the command to transport layer. */
status = _ux_host_class_storage_transport(storage, mode_sense_response);
-
+
/* Reset the Write Protected flag. */
storage -> ux_host_class_storage_write_protected_media = UX_FALSE;
@@ -146,16 +139,16 @@ ULONG wp_parameter_location;
/* The Mode Sense response tells us if the media is Write protected or not. */
if (*(mode_sense_response + wp_parameter_location) & UX_HOST_CLASS_STORAGE_MODE_SENSE_RESPONSE_ATTRIBUTES_WP)
-
+
/* The Mode Sense response tells us if the media is Write protected or not. */
storage -> ux_host_class_storage_write_protected_media = UX_TRUE;
- }
- }
+ }
+ }
/* Free the memory resource used for the command response. */
_ux_utility_memory_free(mode_sense_response);
-
+
/* Return completion status. */
- return(status);
+ return(status);
}
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 a4d6e1cb..2faa7145 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
@@ -1,18 +1,19 @@
/***************************************************************************
- * Copyright (c) 2024 Microsoft Corporation
- *
+ * Copyright (c) 2024 Microsoft Corporation
+ * Copyright (c) 2026-present Eclipse ThreadX contributors
+ *
* This program and the accompanying materials are made available under the
* terms of the MIT License which is available at
* https://opensource.org/licenses/MIT.
- *
+ *
* SPDX-License-Identifier: MIT
**************************************************************************/
/**************************************************************************/
/**************************************************************************/
-/** */
-/** USBX Component */
+/** */
+/** USBX Component */
/** */
/** Storage Class */
/** */
@@ -64,7 +65,7 @@ ULONG command_length;
UX_HOST_CLASS_STORAGE_DATA_IN,
sector_count * storage -> ux_host_class_storage_sector_size,
command_length);
-
+
/* Prepare the MEDIA READ command block. */
*(cbw_cb + UX_HOST_CLASS_STORAGE_READ_OPERATION) = UX_HOST_CLASS_STORAGE_SCSI_READ16;
@@ -76,55 +77,41 @@ ULONG command_length;
}
-/**************************************************************************/
-/* */
-/* FUNCTION RELEASE */
-/* */
-/* _ux_host_class_storage_media_read PORTABLE C */
+/**************************************************************************/
+/* */
+/* FUNCTION RELEASE */
+/* */
+/* _ux_host_class_storage_media_read PORTABLE C */
/* 6.2.1 */
/* AUTHOR */
/* */
/* Chaoqiong Xiao, Microsoft Corporation */
/* */
/* DESCRIPTION */
-/* */
-/* This function will read one or more logical sector from the media. */
-/* */
-/* INPUT */
-/* */
-/* storage Pointer to storage class */
-/* sector_start Starting sector */
-/* sector_count Number of sectors to read */
-/* data_pointer Pointer to data to read */
-/* */
-/* OUTPUT */
-/* */
-/* Completion Status */
-/* */
-/* CALLS */
-/* */
-/* _ux_host_class_storage_cbw_initialize Initialize the CBW */
-/* _ux_host_class_storage_transport Send command */
-/* _ux_utility_long_put_big_endian Put 32-bit word */
-/* _ux_utility_short_put_big_endian Put 16-bit word */
-/* */
-/* CALLED BY */
-/* */
-/* Storage Class */
-/* */
-/* RELEASE HISTORY */
-/* */
-/* DATE NAME DESCRIPTION */
-/* */
-/* 05-19-2020 Chaoqiong Xiao Initial Version 6.0 */
-/* 09-30-2020 Chaoqiong Xiao Modified comment(s), */
-/* resulting in version 6.1 */
-/* 01-31-2022 Chaoqiong Xiao Modified comment(s), */
-/* added standalone support, */
-/* resulting in version 6.1.10 */
-/* 03-08-2023 Chaoqiong Xiao Modified comment(s), */
-/* checked device removal, */
-/* resulting in version 6.2.1 */
+/* */
+/* This function will read one or more logical sector from the media. */
+/* */
+/* INPUT */
+/* */
+/* storage Pointer to storage class */
+/* sector_start Starting sector */
+/* sector_count Number of sectors to read */
+/* data_pointer Pointer to data to read */
+/* */
+/* OUTPUT */
+/* */
+/* Completion Status */
+/* */
+/* CALLS */
+/* */
+/* _ux_host_class_storage_cbw_initialize Initialize the CBW */
+/* _ux_host_class_storage_transport Send command */
+/* _ux_utility_long_put_big_endian Put 32-bit word */
+/* _ux_utility_short_put_big_endian Put 16-bit word */
+/* */
+/* CALLED BY */
+/* */
+/* Storage Class */
/* */
/**************************************************************************/
UINT _ux_host_class_storage_media_read(UX_HOST_CLASS_STORAGE *storage, ULONG sector_start,
@@ -189,7 +176,7 @@ UINT media_retry;
/* Check if the media in the device has been removed. If so
we have to tell UX_MEDIA (default FileX) that the media is closed. */
- return(UX_HOST_CLASS_STORAGE_SENSE_ERROR);
+ return(UX_HOST_CLASS_STORAGE_SENSE_ERROR);
#endif
}
@@ -227,12 +214,6 @@ UINT media_retry;
/* */
/* Application */
/* */
-/* RELEASE HISTORY */
-/* */
-/* DATE NAME DESCRIPTION */
-/* */
-/* 10-31-2023 Chaoqiong Xiao Initial Version 6.3.0 */
-/* */
/**************************************************************************/
UINT _uxe_host_class_storage_media_read(UX_HOST_CLASS_STORAGE *storage, ULONG sector_start,
ULONG sector_count, UCHAR *data_pointer)
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 3ef79d68..b68ba552 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
@@ -1,18 +1,19 @@
/***************************************************************************
- * Copyright (c) 2024 Microsoft Corporation
- *
+ * Copyright (c) 2024 Microsoft Corporation
+ * Copyright (c) 2026-present Eclipse ThreadX contributors
+ *
* This program and the accompanying materials are made available under the
* terms of the MIT License which is available at
* https://opensource.org/licenses/MIT.
- *
+ *
* SPDX-License-Identifier: MIT
**************************************************************************/
/**************************************************************************/
/**************************************************************************/
-/** */
-/** USBX Component */
+/** */
+/** USBX Component */
/** */
/** Storage Class */
/** */
@@ -29,48 +30,40 @@
#include "ux_host_stack.h"
-/**************************************************************************/
-/* */
-/* FUNCTION RELEASE */
-/* */
-/* _ux_host_class_storage_media_recovery_sense_get PORTABLE C */
+/**************************************************************************/
+/* */
+/* FUNCTION RELEASE */
+/* */
+/* _ux_host_class_storage_media_recovery_sense_get PORTABLE C */
/* 6.1 */
/* AUTHOR */
/* */
/* Chaoqiong Xiao, Microsoft Corporation */
/* */
/* DESCRIPTION */
-/* */
+/* */
/* This function will send a MODE_SENSE command to recover from a read */
-/* and write error. */
-/* */
-/* INPUT */
-/* */
-/* storage Pointer to storage class */
-/* */
-/* OUTPUT */
-/* */
-/* Completion Status */
-/* */
-/* CALLS */
-/* */
-/* _ux_host_class_storage_cbw_initialize Initialize CBW */
-/* _ux_host_class_storage_transport Send command */
-/* _ux_utility_memory_allocate Allocate memory block */
-/* _ux_utility_memory_free Release memory block */
-/* _ux_utility_short_put_big_endian Put short value */
-/* */
-/* CALLED BY */
-/* */
-/* Storage Class */
-/* */
-/* RELEASE HISTORY */
-/* */
-/* DATE NAME DESCRIPTION */
-/* */
-/* 05-19-2020 Chaoqiong Xiao Initial Version 6.0 */
-/* 09-30-2020 Chaoqiong Xiao Modified comment(s), */
-/* resulting in version 6.1 */
+/* and write error. */
+/* */
+/* INPUT */
+/* */
+/* storage Pointer to storage class */
+/* */
+/* OUTPUT */
+/* */
+/* Completion Status */
+/* */
+/* CALLS */
+/* */
+/* _ux_host_class_storage_cbw_initialize Initialize CBW */
+/* _ux_host_class_storage_transport Send command */
+/* _ux_utility_memory_allocate Allocate memory block */
+/* _ux_utility_memory_free Release memory block */
+/* _ux_utility_short_put_big_endian Put short value */
+/* */
+/* CALLED BY */
+/* */
+/* Storage Class */
/* */
/**************************************************************************/
UINT _ux_host_class_storage_media_recovery_sense_get(UX_HOST_CLASS_STORAGE *storage)
@@ -97,11 +90,11 @@ UINT command_length;
/* Initialize the CBW for this command. */
_ux_host_class_storage_cbw_initialize(storage, UX_HOST_CLASS_STORAGE_DATA_IN, UX_HOST_CLASS_STORAGE_MODE_SENSE_TP_PAGE, command_length);
-
+
/* Prepare the MODE_SENSE command block. Distinguish between SUBCLASSES. */
switch (storage -> ux_host_class_storage_interface -> ux_interface_descriptor.bInterfaceSubClass)
{
-
+
case UX_HOST_CLASS_STORAGE_SUBCLASS_RBC :
#ifdef UX_HOST_CLASS_STORAGE_INCLUDE_LEGACY_PROTOCOL_SUPPORT
case UX_HOST_CLASS_STORAGE_SUBCLASS_UFI :
@@ -109,14 +102,14 @@ UINT command_length;
*(cbw + UX_HOST_CLASS_STORAGE_CBW_CB + UX_HOST_CLASS_STORAGE_MODE_SENSE_OPERATION) = UX_HOST_CLASS_STORAGE_SCSI_MODE_SENSE;
break;
- default :
+ default :
*(cbw + UX_HOST_CLASS_STORAGE_CBW_CB + UX_HOST_CLASS_STORAGE_MODE_SENSE_OPERATION) = UX_HOST_CLASS_STORAGE_SCSI_MODE_SENSE_SHORT;
break;
}
-
+
/* We ask for a specific page page but we put the buffer to maximum size. */
*(cbw + UX_HOST_CLASS_STORAGE_CBW_CB + UX_HOST_CLASS_STORAGE_MODE_SENSE_PC_PAGE_CODE) = UX_HOST_CLASS_STORAGE_MODE_SENSE_TP_PAGE;
-
+
/* Store the length of the Mode Sense Response. */
_ux_utility_short_put_big_endian(cbw + UX_HOST_CLASS_STORAGE_CBW_CB + UX_HOST_CLASS_STORAGE_MODE_SENSE_PARAMETER_LIST_LENGTH, UX_HOST_CLASS_STORAGE_MODE_SENSE_ALL_PAGE_LENGTH);
@@ -124,14 +117,14 @@ UINT command_length;
mode_sense_response = _ux_utility_memory_allocate(UX_SAFE_ALIGN, UX_CACHE_SAFE_MEMORY, UX_HOST_CLASS_STORAGE_MODE_SENSE_ALL_PAGE_LENGTH);
if (mode_sense_response == UX_NULL)
return(UX_MEMORY_INSUFFICIENT);
-
+
/* Send the command to transport layer. */
status = _ux_host_class_storage_transport(storage, mode_sense_response);
-
+
/* Free the memory resource used for the command response. */
_ux_utility_memory_free(mode_sense_response);
-
+
/* Return completion status. */
- return(status);
+ return(status);
}
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 28595464..8da7f268 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
@@ -1,18 +1,19 @@
/***************************************************************************
- * Copyright (c) 2024 Microsoft Corporation
- *
+ * Copyright (c) 2024 Microsoft Corporation
+ * Copyright (c) 2026-present Eclipse ThreadX contributors
+ *
* This program and the accompanying materials are made available under the
* terms of the MIT License which is available at
* https://opensource.org/licenses/MIT.
- *
+ *
* SPDX-License-Identifier: MIT
**************************************************************************/
/**************************************************************************/
/**************************************************************************/
-/** */
-/** USBX Component */
+/** */
+/** USBX Component */
/** */
/** Storage Class */
/** */
@@ -75,55 +76,41 @@ ULONG command_length;
}
-/**************************************************************************/
-/* */
-/* FUNCTION RELEASE */
-/* */
-/* _ux_host_class_storage_media_write PORTABLE C */
+/**************************************************************************/
+/* */
+/* FUNCTION RELEASE */
+/* */
+/* _ux_host_class_storage_media_write PORTABLE C */
/* 6.2.1 */
/* AUTHOR */
/* */
/* Chaoqiong Xiao, Microsoft Corporation */
/* */
/* DESCRIPTION */
-/* */
-/* This function will write one or more logical sector to the media. */
-/* */
-/* INPUT */
-/* */
-/* storage Pointer to storage class */
-/* sector_start Starting sector */
-/* sector_count Number of sectors to write */
-/* data_pointer Pointer to data to write */
-/* */
-/* OUTPUT */
-/* */
-/* Completion Status */
-/* */
-/* CALLS */
-/* */
-/* _ux_host_class_storage_cbw_initialize Initialize the CBW */
-/* _ux_host_class_storage_transport Send command */
-/* _ux_utility_long_put_big_endian Put 32-bit word */
-/* _ux_utility_short_put_big_endian Put 16-bit word */
-/* */
-/* CALLED BY */
-/* */
-/* Storage Class */
-/* */
-/* RELEASE HISTORY */
-/* */
-/* DATE NAME DESCRIPTION */
-/* */
-/* 05-19-2020 Chaoqiong Xiao Initial Version 6.0 */
-/* 09-30-2020 Chaoqiong Xiao Modified comment(s), */
-/* resulting in version 6.1 */
-/* 01-31-2022 Chaoqiong Xiao Modified comment(s), */
-/* added standalone support, */
-/* resulting in version 6.1.10 */
-/* 03-08-2023 Chaoqiong Xiao Modified comment(s), */
-/* checked device removal, */
-/* resulting in version 6.2.1 */
+/* */
+/* This function will write one or more logical sector to the media. */
+/* */
+/* INPUT */
+/* */
+/* storage Pointer to storage class */
+/* sector_start Starting sector */
+/* sector_count Number of sectors to write */
+/* data_pointer Pointer to data to write */
+/* */
+/* OUTPUT */
+/* */
+/* Completion Status */
+/* */
+/* CALLS */
+/* */
+/* _ux_host_class_storage_cbw_initialize Initialize the CBW */
+/* _ux_host_class_storage_transport Send command */
+/* _ux_utility_long_put_big_endian Put 32-bit word */
+/* _ux_utility_short_put_big_endian Put 16-bit word */
+/* */
+/* CALLED BY */
+/* */
+/* Storage Class */
/* */
/**************************************************************************/
UINT _ux_host_class_storage_media_write(UX_HOST_CLASS_STORAGE *storage, ULONG sector_start,
@@ -166,7 +153,7 @@ UINT media_retry;
}
/* Return sense error. */
- return(UX_HOST_CLASS_STORAGE_SENSE_ERROR);
+ return(UX_HOST_CLASS_STORAGE_SENSE_ERROR);
#endif
}
@@ -204,12 +191,6 @@ UINT media_retry;
/* */
/* Application */
/* */
-/* RELEASE HISTORY */
-/* */
-/* DATE NAME DESCRIPTION */
-/* */
-/* 10-31-2023 Chaoqiong Xiao Initial Version 6.3.0 */
-/* */
/**************************************************************************/
UINT _uxe_host_class_storage_media_write(UX_HOST_CLASS_STORAGE *storage, ULONG sector_start,
ULONG sector_count, UCHAR *data_pointer)
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 4f86b280..eb82008b 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
@@ -1,18 +1,19 @@
/***************************************************************************
- * Copyright (c) 2024 Microsoft Corporation
- *
+ * Copyright (c) 2024 Microsoft Corporation
+ * Copyright (c) 2026-present Eclipse ThreadX contributors
+ *
* This program and the accompanying materials are made available under the
* terms of the MIT License which is available at
* https://opensource.org/licenses/MIT.
- *
+ *
* SPDX-License-Identifier: MIT
**************************************************************************/
/**************************************************************************/
/**************************************************************************/
-/** */
-/** USBX Component */
+/** */
+/** USBX Component */
/** */
/** Storage Class */
/** */
@@ -27,54 +28,41 @@
#include "ux_api.h"
#include "ux_host_class_storage.h"
#include "ux_host_stack.h"
-/**************************************************************************/
-/* */
-/* FUNCTION RELEASE */
-/* */
-/* _ux_host_class_storage_partition_read PORTABLE C */
+/**************************************************************************/
+/* */
+/* FUNCTION RELEASE */
+/* */
+/* _ux_host_class_storage_partition_read PORTABLE C */
/* 6.1.2 */
/* AUTHOR */
/* */
/* Chaoqiong Xiao, Microsoft Corporation */
/* */
/* DESCRIPTION */
-/* */
+/* */
/* This function will analyze the partition table and parse all the */
/* partitions. It may happen that a partition entry points to a */
-/* secondary partition table. */
-/* */
-/* INPUT */
-/* */
-/* storage Pointer to storage class */
-/* sector_memory Pointer to memory for sector */
-/* sector Sector number */
-/* */
-/* OUTPUT */
-/* */
-/* Completion Status */
-/* */
-/* CALLS */
-/* */
-/* _ux_host_class_storage_media_mount Mount media */
-/* _ux_host_class_storage_media_open Open media */
-/* _ux_utility_long_get Get 32-bit word */
-/* */
-/* CALLED BY */
-/* */
-/* _ux_host_class_storage_media_mount Mount media */
-/* */
-/* RELEASE HISTORY */
-/* */
-/* 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 */
-/* 11-09-2020 Chaoqiong Xiao Modified comment(s), */
-/* added exFAT support, */
-/* resulting in version 6.1.2 */
+/* secondary partition table. */
+/* */
+/* INPUT */
+/* */
+/* storage Pointer to storage class */
+/* sector_memory Pointer to memory for sector */
+/* sector Sector number */
+/* */
+/* OUTPUT */
+/* */
+/* Completion Status */
+/* */
+/* CALLS */
+/* */
+/* _ux_host_class_storage_media_mount Mount media */
+/* _ux_host_class_storage_media_open Open media */
+/* _ux_utility_long_get Get 32-bit word */
+/* */
+/* CALLED BY */
+/* */
+/* _ux_host_class_storage_media_mount Mount media */
/* */
/**************************************************************************/
UINT _ux_host_class_storage_partition_read(UX_HOST_CLASS_STORAGE *storage, UCHAR *sector_memory, ULONG sector)
@@ -87,7 +75,7 @@ UINT _ux_host_class_storage_partition_read(UX_HOST_CLASS_STORAGE *storage, UCHA
#else
UINT status = UX_ERROR;
UINT partition_index;
-
+
/* Check recursion/mount count before processing. */
if (storage -> ux_host_class_storage_mounted_partitions_count > UX_HOST_CLASS_STORAGE_MAX_PARTITIONS_COUNT)
{
diff --git a/common/usbx_host_classes/src/ux_host_class_storage_read_write_run.c b/common/usbx_host_classes/src/ux_host_class_storage_read_write_run.c
index a7026cdd..e6fc7e30 100644
--- a/common/usbx_host_classes/src/ux_host_class_storage_read_write_run.c
+++ b/common/usbx_host_classes/src/ux_host_class_storage_read_write_run.c
@@ -1,10 +1,11 @@
/***************************************************************************
- * Copyright (c) 2024 Microsoft Corporation
- *
+ * Copyright (c) 2024 Microsoft Corporation
+ * Copyright (c) 2026-present Eclipse ThreadX contributors
+ *
* This program and the accompanying materials are made available under the
* terms of the MIT License which is available at
* https://opensource.org/licenses/MIT.
- *
+ *
* SPDX-License-Identifier: MIT
**************************************************************************/
@@ -87,15 +88,6 @@ extern VOID _ux_host_class_storage_write_initialize(UX_HOST_CLASS_STORAGE *stora
/* */
/* Storage Class */
/* */
-/* RELEASE HISTORY */
-/* */
-/* DATE NAME DESCRIPTION */
-/* */
-/* 01-31-2022 Chaoqiong Xiao Initial Version 6.1.10 */
-/* 03-08-2023 Chaoqiong Xiao Modified comment(s), */
-/* checked device state, */
-/* resulting in version 6.2.1 */
-/* */
/**************************************************************************/
UINT _ux_host_class_storage_read_write_run(UX_HOST_CLASS_STORAGE *storage,
ULONG read_write,
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 4a5e16d0..55ed66f2 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
@@ -1,18 +1,19 @@
/***************************************************************************
- * Copyright (c) 2024 Microsoft Corporation
- *
+ * Copyright (c) 2024 Microsoft Corporation
+ * Copyright (c) 2026-present Eclipse ThreadX contributors
+ *
* This program and the accompanying materials are made available under the
* terms of the MIT License which is available at
* https://opensource.org/licenses/MIT.
- *
+ *
* SPDX-License-Identifier: MIT
**************************************************************************/
/**************************************************************************/
/**************************************************************************/
-/** */
-/** USBX Component */
+/** */
+/** USBX Component */
/** */
/** Storage Class */
/** */
@@ -29,54 +30,41 @@
#include "ux_host_stack.h"
-/**************************************************************************/
-/* */
-/* FUNCTION RELEASE */
-/* */
-/* _ux_host_class_storage_request_sense PORTABLE C */
+/**************************************************************************/
+/* */
+/* FUNCTION RELEASE */
+/* */
+/* _ux_host_class_storage_request_sense PORTABLE C */
/* 6.1.10 */
/* AUTHOR */
/* */
/* Chaoqiong Xiao, Microsoft Corporation */
/* */
/* DESCRIPTION */
-/* */
-/* This function will send a request sense to the device to see what */
-/* error happened during the last command. Request sense commands */
-/* cannot be nested. */
-/* */
-/* INPUT */
-/* */
-/* storage Pointer to storage class */
-/* */
-/* OUTPUT */
-/* */
-/* Completion Status */
-/* */
-/* CALLS */
-/* */
-/* _ux_host_class_storage_cbw_initialize Initialize CBW */
-/* _ux_host_class_storage_transport Send command */
-/* _ux_utility_memory_allocate Allocate memory block */
-/* _ux_utility_memory_copy Copy memory block */
-/* _ux_utility_memory_free Release memory block */
-/* */
-/* CALLED BY */
-/* */
-/* Storage Class */
-/* */
-/* RELEASE HISTORY */
-/* */
-/* DATE NAME DESCRIPTION */
-/* */
-/* 05-19-2020 Chaoqiong Xiao Initial Version 6.0 */
-/* 09-30-2020 Chaoqiong Xiao Modified comment(s), */
-/* verified memset and memcpy */
-/* cases, */
-/* resulting in version 6.1 */
-/* 01-31-2022 Chaoqiong Xiao Modified comment(s), */
-/* added standalone support, */
-/* resulting in version 6.1.10 */
+/* */
+/* This function will send a request sense to the device to see what */
+/* error happened during the last command. Request sense commands */
+/* cannot be nested. */
+/* */
+/* INPUT */
+/* */
+/* storage Pointer to storage class */
+/* */
+/* OUTPUT */
+/* */
+/* Completion Status */
+/* */
+/* CALLS */
+/* */
+/* _ux_host_class_storage_cbw_initialize Initialize CBW */
+/* _ux_host_class_storage_transport Send command */
+/* _ux_utility_memory_allocate Allocate memory block */
+/* _ux_utility_memory_copy Copy memory block */
+/* _ux_utility_memory_free Release memory block */
+/* */
+/* CALLED BY */
+/* */
+/* Storage Class */
/* */
/**************************************************************************/
UINT _ux_host_class_storage_request_sense(UX_HOST_CLASS_STORAGE *storage)
@@ -95,7 +83,7 @@ ULONG sense_code;
/* Clear the former sense code value. */
storage -> ux_host_class_storage_sense_code = 0;
-
+
/* Use a pointer for the cbw, easier to manipulate. */
cbw = (UCHAR *) storage -> ux_host_class_storage_cbw;
@@ -112,17 +100,17 @@ ULONG sense_code;
/* Check of we are reentering a REQUEST SENSE command which is illegal. */
if (*(cbw + UX_HOST_CLASS_STORAGE_CBW_CB + UX_HOST_CLASS_STORAGE_REQUEST_SENSE_OPERATION) == UX_HOST_CLASS_STORAGE_SCSI_REQUEST_SENSE)
return(UX_ERROR);
-
- /* Save the current command so that we can re-initiate it after the
+
+ /* 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); /* 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);
-
+
/* Prepare the REQUEST SENSE command block. */
*(cbw + UX_HOST_CLASS_STORAGE_CBW_CB + UX_HOST_CLASS_STORAGE_REQUEST_SENSE_OPERATION) = UX_HOST_CLASS_STORAGE_SCSI_REQUEST_SENSE;
-
+
/* Store the length of the Request Sense Response. */
*(cbw + UX_HOST_CLASS_STORAGE_CBW_CB + UX_HOST_CLASS_STORAGE_REQUEST_SENSE_ALLOCATION_LENGTH) = UX_HOST_CLASS_STORAGE_REQUEST_SENSE_RESPONSE_LENGTH;
@@ -150,8 +138,8 @@ ULONG sense_code;
if (status == UX_SUCCESS)
{
- /* We have a successful transaction, even though the sense code could reflect an error. The sense code
- will be assembled and store in the device instance. */
+ /* We have a successful transaction, even though the sense code could reflect an error. The sense code
+ will be assembled and store in the device instance. */
sense_code = UX_HOST_CLASS_STORAGE_SENSE_STATUS(
(ULONG) *(request_sense_response +
UX_HOST_CLASS_STORAGE_REQUEST_SENSE_RESPONSE_SENSE_KEY),
@@ -162,7 +150,7 @@ ULONG sense_code;
/* Store the sense code in the storage instance. */
storage -> ux_host_class_storage_sense_code = sense_code;
- }
+ }
/* Free the memory resource used for the command response. */
_ux_utility_memory_free(request_sense_response);
@@ -170,8 +158,8 @@ ULONG sense_code;
/* 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); /* Use case of memcpy is verified. */
- /* Return completion code. */
- return(status);
+ /* Return completion code. */
+ return(status);
#endif
}
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 f6d87c55..6cc81b9c 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
@@ -1,18 +1,19 @@
/***************************************************************************
- * Copyright (c) 2024 Microsoft Corporation
- *
+ * Copyright (c) 2024 Microsoft Corporation
+ * Copyright (c) 2026-present Eclipse ThreadX contributors
+ *
* This program and the accompanying materials are made available under the
* terms of the MIT License which is available at
* https://opensource.org/licenses/MIT.
- *
+ *
* SPDX-License-Identifier: MIT
**************************************************************************/
/**************************************************************************/
/**************************************************************************/
-/** */
-/** USBX Component */
+/** */
+/** USBX Component */
/** */
/** Storage Class */
/** */
@@ -29,45 +30,37 @@
#include "ux_host_stack.h"
-/**************************************************************************/
-/* */
-/* FUNCTION RELEASE */
-/* */
-/* _ux_host_class_storage_sense_code_translate PORTABLE C */
+/**************************************************************************/
+/* */
+/* FUNCTION RELEASE */
+/* */
+/* _ux_host_class_storage_sense_code_translate PORTABLE C */
/* 6.1 */
/* AUTHOR */
/* */
/* Chaoqiong Xiao, Microsoft Corporation */
/* */
/* DESCRIPTION */
-/* */
-/* This function will perform a conversion between the SCSI error */
-/* codes and error codes expected by FileX. */
-/* */
-/* INPUT */
-/* */
-/* storage Pointer to storage class */
-/* status Status to convert */
-/* */
-/* OUTPUT */
-/* */
-/* Converted Status */
-/* */
-/* CALLS */
-/* */
-/* None */
-/* */
-/* CALLED BY */
-/* */
-/* Storage Class */
-/* */
-/* RELEASE HISTORY */
-/* */
-/* DATE NAME DESCRIPTION */
-/* */
-/* 05-19-2020 Chaoqiong Xiao Initial Version 6.0 */
-/* 09-30-2020 Chaoqiong Xiao Modified comment(s), */
-/* resulting in version 6.1 */
+/* */
+/* This function will perform a conversion between the SCSI error */
+/* codes and error codes expected by FileX. */
+/* */
+/* INPUT */
+/* */
+/* storage Pointer to storage class */
+/* status Status to convert */
+/* */
+/* OUTPUT */
+/* */
+/* Converted Status */
+/* */
+/* CALLS */
+/* */
+/* None */
+/* */
+/* CALLED BY */
+/* */
+/* Storage Class */
/* */
/**************************************************************************/
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 93c9b6c4..8e6e9156 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
@@ -1,18 +1,19 @@
/***************************************************************************
- * Copyright (c) 2024 Microsoft Corporation
- *
+ * Copyright (c) 2024 Microsoft Corporation
+ * Copyright (c) 2026-present Eclipse ThreadX contributors
+ *
* This program and the accompanying materials are made available under the
* terms of the MIT License which is available at
* https://opensource.org/licenses/MIT.
- *
+ *
* SPDX-License-Identifier: MIT
**************************************************************************/
/**************************************************************************/
/**************************************************************************/
-/** */
-/** USBX Component */
+/** */
+/** USBX Component */
/** */
/** Storage Class */
/** */
@@ -29,48 +30,40 @@
#include "ux_host_stack.h"
-/**************************************************************************/
-/* */
-/* FUNCTION RELEASE */
-/* */
-/* _ux_host_class_storage_start_stop PORTABLE C */
+/**************************************************************************/
+/* */
+/* FUNCTION RELEASE */
+/* */
+/* _ux_host_class_storage_start_stop PORTABLE C */
/* 6.1 */
/* AUTHOR */
/* */
/* Chaoqiong Xiao, Microsoft Corporation */
/* */
/* DESCRIPTION */
-/* */
-/* This function starts or stops the UFI device. */
-/* */
-/* INPUT */
-/* */
-/* storage Pointer to storage class */
-/* start_stop_flag 1 or 0 if start/stop */
-/* */
-/* OUTPUT */
-/* */
-/* Completion Status */
-/* */
-/* CALLS */
-/* */
-/* _ux_host_class_storage_cbw_initialize Initialize the CBW */
-/* _ux_host_class_storage_transport Send transport layer command */
-/* */
-/* CALLED BY */
-/* */
-/* Storage Class */
-/* */
-/* RELEASE HISTORY */
-/* */
-/* DATE NAME DESCRIPTION */
-/* */
-/* 05-19-2020 Chaoqiong Xiao Initial Version 6.0 */
-/* 09-30-2020 Chaoqiong Xiao Modified comment(s), */
-/* resulting in version 6.1 */
+/* */
+/* This function starts or stops the UFI device. */
+/* */
+/* INPUT */
+/* */
+/* storage Pointer to storage class */
+/* start_stop_flag 1 or 0 if start/stop */
+/* */
+/* OUTPUT */
+/* */
+/* Completion Status */
+/* */
+/* CALLS */
+/* */
+/* _ux_host_class_storage_cbw_initialize Initialize the CBW */
+/* _ux_host_class_storage_transport Send transport layer command */
+/* */
+/* CALLED BY */
+/* */
+/* Storage Class */
/* */
/**************************************************************************/
-UINT _ux_host_class_storage_start_stop(UX_HOST_CLASS_STORAGE *storage,
+UINT _ux_host_class_storage_start_stop(UX_HOST_CLASS_STORAGE *storage,
ULONG start_stop_signal)
{
@@ -78,7 +71,7 @@ UINT status;
UCHAR *cbw;
UINT command_length;
ULONG command_retry;
-
+
/* If trace is enabled, insert this event into the trace buffer. */
UX_TRACE_IN_LINE_INSERT(UX_TRACE_HOST_CLASS_STORAGE_START_STOP, storage, start_stop_signal, 0, 0, UX_TRACE_HOST_CLASS_EVENTS, 0, 0)
@@ -97,7 +90,7 @@ ULONG command_retry;
/* Initialize the CBW for this command. */
_ux_host_class_storage_cbw_initialize(storage, 0, 0, command_length);
-
+
/* Prepare the START STOP command block. */
*(cbw + UX_HOST_CLASS_STORAGE_CBW_CB + UX_HOST_CLASS_STORAGE_START_STOP_OPERATION) = UX_HOST_CLASS_STORAGE_SCSI_START_STOP;
@@ -107,18 +100,18 @@ ULONG command_retry;
/* On floppies, this operation tends to fail a few times. So we try harder. */
for (command_retry = 0; command_retry < 50; command_retry++)
{
-
+
/* Send the command to transport layer. */
status = _ux_host_class_storage_transport(storage, UX_NULL);
/* If we have a transport error give up. */
- if(status != UX_SUCCESS)
+ if(status != UX_SUCCESS)
/* Return completion status. */
- return(status);
+ return(status);
/* Check the CSW. We may learn something there about the state of the device. */
- if (storage -> ux_host_class_storage_sense_code == 0)
+ if (storage -> ux_host_class_storage_sense_code == 0)
return(UX_SUCCESS);
}
diff --git a/common/usbx_host_classes/src/ux_host_class_storage_tasks_run.c b/common/usbx_host_classes/src/ux_host_class_storage_tasks_run.c
index c356e28b..9b8995da 100644
--- a/common/usbx_host_classes/src/ux_host_class_storage_tasks_run.c
+++ b/common/usbx_host_classes/src/ux_host_class_storage_tasks_run.c
@@ -1,10 +1,11 @@
/***************************************************************************
- * Copyright (c) 2024 Microsoft Corporation
- *
+ * Copyright (c) 2024 Microsoft Corporation
+ * Copyright (c) 2026-present Eclipse ThreadX contributors
+ *
* This program and the accompanying materials are made available under the
* terms of the MIT License which is available at
* https://opensource.org/licenses/MIT.
- *
+ *
* SPDX-License-Identifier: MIT
**************************************************************************/
@@ -89,19 +90,6 @@ static inline UINT _ux_host_class_storage_transport_sense_check(UX_HOST_CLASS_ST
/* */
/* USBX Host Stack */
/* */
-/* RELEASE HISTORY */
-/* */
-/* DATE NAME DESCRIPTION */
-/* */
-/* 01-31-2022 Chaoqiong Xiao Initial Version 6.1.10 */
-/* 07-29-2022 Chaoqiong Xiao Modified comment(s), */
-/* fixed parameter/variable */
-/* names conflict C++ keyword, */
-/* resulting in version 6.1.12 */
-/* 10-31-2022 Chaoqiong Xiao Modified comment(s), */
-/* improved internal logic, */
-/* resulting in version 6.2.0 */
-/* */
/**************************************************************************/
UINT _ux_host_class_storage_tasks_run(UX_HOST_CLASS *storage_class)
{
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 69fea305..d5ff05da 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
@@ -1,10 +1,11 @@
/***************************************************************************
- * Copyright (c) 2024 Microsoft Corporation
- *
+ * Copyright (c) 2024 Microsoft Corporation
+ * Copyright (c) 2026-present Eclipse ThreadX contributors
+ *
* This program and the accompanying materials are made available under the
* terms of the MIT License which is available at
* https://opensource.org/licenses/MIT.
- *
+ *
* SPDX-License-Identifier: MIT
**************************************************************************/
@@ -78,27 +79,6 @@
/* */
/* ThreadX */
/* */
-/* RELEASE HISTORY */
-/* */
-/* 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 */
-/* 01-31-2022 Chaoqiong Xiao Modified comment(s), */
-/* refined macros names, */
-/* resulting in version 6.1.10 */
-/* 04-25-2022 Chaoqiong Xiao Modified comment(s), */
-/* internal clean up, */
-/* resulting in version 6.1.11 */
-/* */
/**************************************************************************/
VOID _ux_host_class_storage_thread_entry(ULONG class_address)
{
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 64cfd4d2..af5fcdd4 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
@@ -1,10 +1,11 @@
/***************************************************************************
- * Copyright (c) 2024 Microsoft Corporation
- *
+ * Copyright (c) 2024 Microsoft Corporation
+ * Copyright (c) 2026-present Eclipse ThreadX contributors
+ *
* This program and the accompanying materials are made available under the
* terms of the MIT License which is available at
* https://opensource.org/licenses/MIT.
- *
+ *
* SPDX-License-Identifier: MIT
**************************************************************************/
@@ -66,17 +67,6 @@
/* */
/* Storage Class */
/* */
-/* RELEASE HISTORY */
-/* */
-/* DATE NAME DESCRIPTION */
-/* */
-/* 05-19-2020 Chaoqiong Xiao Initial Version 6.0 */
-/* 09-30-2020 Chaoqiong Xiao Modified comment(s), */
-/* resulting in version 6.1 */
-/* 01-31-2022 Chaoqiong Xiao Modified comment(s), */
-/* refined macros names, */
-/* resulting in version 6.1.10 */
-/* */
/**************************************************************************/
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 46e11623..630a0556 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
@@ -1,10 +1,11 @@
/***************************************************************************
- * Copyright (c) 2024 Microsoft Corporation
- *
+ * Copyright (c) 2024 Microsoft Corporation
+ * Copyright (c) 2026-present Eclipse ThreadX contributors
+ *
* This program and the accompanying materials are made available under the
* terms of the MIT License which is available at
* https://opensource.org/licenses/MIT.
- *
+ *
* SPDX-License-Identifier: MIT
**************************************************************************/
@@ -70,18 +71,6 @@
/* */
/* Storage Class */
/* */
-/* RELEASE HISTORY */
-/* */
-/* 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 */
-/* 01-31-2022 Chaoqiong Xiao Modified comment(s), */
-/* refined macros names, */
-/* resulting in version 6.1.10 */
-/* */
/**************************************************************************/
UINT _ux_host_class_storage_transport_bo(UX_HOST_CLASS_STORAGE *storage, UCHAR *data_pointer)
{
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 64540f32..c02cb779 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
@@ -1,18 +1,19 @@
/***************************************************************************
- * Copyright (c) 2024 Microsoft Corporation
- *
+ * Copyright (c) 2024 Microsoft Corporation
+ * Copyright (c) 2026-present Eclipse ThreadX contributors
+ *
* This program and the accompanying materials are made available under the
* terms of the MIT License which is available at
* https://opensource.org/licenses/MIT.
- *
+ *
* SPDX-License-Identifier: MIT
**************************************************************************/
/**************************************************************************/
/**************************************************************************/
-/** */
-/** USBX Component */
+/** */
+/** USBX Component */
/** */
/** Storage Class */
/** */
@@ -30,57 +31,41 @@
#if !defined(UX_HOST_STANDALONE)
-/**************************************************************************/
-/* */
-/* FUNCTION RELEASE */
-/* */
-/* _ux_host_class_storage_transport_cb PORTABLE C */
+/**************************************************************************/
+/* */
+/* FUNCTION RELEASE */
+/* */
+/* _ux_host_class_storage_transport_cb PORTABLE C */
/* 6.1.11 */
/* AUTHOR */
/* */
/* Chaoqiong Xiao, Microsoft Corporation */
/* */
/* DESCRIPTION */
-/* */
-/* This function is the transport layer for the Control/Bulk */
-/* transport. The command is sent on the control endpoint and the */
-/* data payload on the bulk endpoint. */
-/* */
-/* INPUT */
-/* */
-/* storage Pointer to storage class */
-/* data_pointer Pointer to data */
-/* */
-/* OUTPUT */
-/* */
-/* Completion Status */
-/* */
-/* CALLS */
-/* */
-/* _ux_host_stack_transfer_request Process host stack transfer */
-/* _ux_host_stack_transfer_request_abort Abort transfer request */
-/* _ux_utility_long_get Get 32-bit word */
-/* _ux_host_semaphore_get Get semaphore */
-/* */
-/* CALLED BY */
-/* */
-/* Storage Class */
-/* */
-/* RELEASE HISTORY */
-/* */
-/* 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 */
-/* 01-31-2022 Chaoqiong Xiao Modified comment(s), */
-/* fixed CB request index, */
-/* refined macros names, */
-/* resulting in version 6.1.10 */
-/* 04-25-2022 Chaoqiong Xiao Modified comment(s), */
-/* internal clean up, */
-/* resulting in version 6.1.11 */
+/* */
+/* This function is the transport layer for the Control/Bulk */
+/* transport. The command is sent on the control endpoint and the */
+/* data payload on the bulk endpoint. */
+/* */
+/* INPUT */
+/* */
+/* storage Pointer to storage class */
+/* data_pointer Pointer to data */
+/* */
+/* OUTPUT */
+/* */
+/* Completion Status */
+/* */
+/* CALLS */
+/* */
+/* _ux_host_stack_transfer_request Process host stack transfer */
+/* _ux_host_stack_transfer_request_abort Abort transfer request */
+/* _ux_utility_long_get Get 32-bit word */
+/* _ux_host_semaphore_get Get semaphore */
+/* */
+/* CALLED BY */
+/* */
+/* Storage Class */
/* */
/**************************************************************************/
UINT _ux_host_class_storage_transport_cb(UX_HOST_CLASS_STORAGE *storage, UCHAR *data_pointer)
@@ -92,7 +77,7 @@ UCHAR *ufi;
UCHAR *cbw;
ULONG data_phase_requested_length;
UX_ENDPOINT *control_endpoint;
-
+
/* Reset the data phase memory size. */
storage -> ux_host_class_storage_data_phase_length = 0;
@@ -108,7 +93,7 @@ UX_ENDPOINT *control_endpoint;
transfer_request -> ux_transfer_request_type = UX_REQUEST_OUT | UX_REQUEST_TYPE_CLASS | UX_REQUEST_TARGET_INTERFACE;
transfer_request -> ux_transfer_request_value = 0;
transfer_request -> ux_transfer_request_index = storage -> ux_host_class_storage_interface -> ux_interface_descriptor.bInterfaceNumber;
-
+
/* Use a pointer for the ufi portion of the command. */
cbw = (UCHAR *) storage -> ux_host_class_storage_cbw;
ufi = cbw + UX_HOST_CLASS_STORAGE_CBW_CB;
@@ -125,22 +110,22 @@ UX_ENDPOINT *control_endpoint;
if (transfer_request -> ux_transfer_request_completion_code != UX_SUCCESS)
return(transfer_request -> ux_transfer_request_completion_code);
- /* Get the length of the data payload. */
+ /* Get the length of the data payload. */
data_phase_requested_length = _ux_utility_long_get(cbw + UX_HOST_CLASS_STORAGE_CBW_DATA_LENGTH);
-
- /* Perform the data stage - if there is any. */
+
+ /* Perform the data stage - if there is any. */
if (data_phase_requested_length != 0)
{
/* Check the direction and determine which endpoint to use. */
if (*(cbw + UX_HOST_CLASS_STORAGE_CBW_FLAGS) == UX_HOST_CLASS_STORAGE_DATA_IN)
transfer_request = &storage -> ux_host_class_storage_bulk_in_endpoint -> ux_endpoint_transfer_request;
- else
+ else
transfer_request = &storage -> ux_host_class_storage_bulk_out_endpoint -> ux_endpoint_transfer_request;
/* Fill in the transfer request data payload buffer. */
transfer_request -> ux_transfer_request_data_pointer = data_pointer;
-
+
/* Store the requested length in the transfer request. */
transfer_request -> ux_transfer_request_requested_length = data_phase_requested_length;
@@ -154,7 +139,7 @@ UX_ENDPOINT *control_endpoint;
/* Wait for the completion of the transfer request. */
status = _ux_host_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.
+ /* 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
sector read. */
storage -> ux_host_class_storage_data_phase_length += transfer_request -> ux_transfer_request_actual_length;
@@ -165,19 +150,19 @@ UX_ENDPOINT *control_endpoint;
/* All transfers pending need to abort. There may have been a partial transfer. */
_ux_host_stack_transfer_request_abort(transfer_request);
-
+
/* Set the completion code. */
transfer_request -> ux_transfer_request_completion_code = UX_TRANSFER_TIMEOUT;
-
+
/* Error trap. */
_ux_system_error_handler(UX_SYSTEM_LEVEL_THREAD, UX_SYSTEM_CONTEXT_CLASS, UX_TRANSFER_TIMEOUT);
/* If trace is enabled, insert this event into the trace buffer. */
UX_TRACE_IN_LINE_INSERT(UX_TRACE_ERROR, UX_TRANSFER_TIMEOUT, transfer_request, 0, 0, UX_TRACE_ERRORS, 0, 0)
-
+
/* There was an error, return to the caller. */
return(UX_TRANSFER_TIMEOUT);
- }
+ }
}
/* Return the status code. */
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 5bf42a86..527c3617 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
@@ -1,18 +1,19 @@
/***************************************************************************
- * Copyright (c) 2024 Microsoft Corporation
- *
+ * Copyright (c) 2024 Microsoft Corporation
+ * Copyright (c) 2026-present Eclipse ThreadX contributors
+ *
* This program and the accompanying materials are made available under the
* terms of the MIT License which is available at
* https://opensource.org/licenses/MIT.
- *
+ *
* SPDX-License-Identifier: MIT
**************************************************************************/
/**************************************************************************/
/**************************************************************************/
-/** */
-/** USBX Component */
+/** */
+/** USBX Component */
/** */
/** Storage Class */
/** */
@@ -30,59 +31,43 @@
#if !defined(UX_HOST_STANDALONE)
-/**************************************************************************/
-/* */
-/* FUNCTION RELEASE */
-/* */
-/* _ux_host_class_storage_transport_cbi PORTABLE C */
+/**************************************************************************/
+/* */
+/* FUNCTION RELEASE */
+/* */
+/* _ux_host_class_storage_transport_cbi PORTABLE C */
/* 6.1.11 */
/* AUTHOR */
/* */
/* Chaoqiong Xiao, Microsoft Corporation */
/* */
/* DESCRIPTION */
-/* */
+/* */
/* This function is the transport layer for the Control/Bulk/Interrupt */
-/* transport. The command is sent on the control endpoint, the data */
-/* payload on the bulk endpoint. The status from the command is */
-/* returned by the interrupt endpoint. This transport is mainly used */
-/* by storage devices that have very slow read/write commands. */
-/* */
-/* INPUT */
-/* */
-/* storage Pointer to storage class */
-/* data_pointer Pointer to data */
-/* */
-/* OUTPUT */
-/* */
-/* Completion Status */
-/* */
-/* CALLS */
-/* */
-/* _ux_host_stack_transfer_request Process host stack transfer */
-/* _ux_host_stack_transfer_request_abort Abort transfer request */
-/* _ux_utility_long_get Get 32-bit word */
-/* _ux_host_semaphore_get Get semaphore */
-/* */
-/* CALLED BY */
-/* */
-/* Storage Class */
-/* */
-/* RELEASE HISTORY */
-/* */
-/* 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 */
-/* 01-31-2022 Chaoqiong Xiao Modified comment(s), */
-/* fixed CBI request index, */
-/* refined macros names, */
-/* resulting in version 6.1.10 */
-/* 04-25-2022 Chaoqiong Xiao Modified comment(s), */
-/* internal clean up, */
-/* resulting in version 6.1.11 */
+/* transport. The command is sent on the control endpoint, the data */
+/* payload on the bulk endpoint. The status from the command is */
+/* returned by the interrupt endpoint. This transport is mainly used */
+/* by storage devices that have very slow read/write commands. */
+/* */
+/* INPUT */
+/* */
+/* storage Pointer to storage class */
+/* data_pointer Pointer to data */
+/* */
+/* OUTPUT */
+/* */
+/* Completion Status */
+/* */
+/* CALLS */
+/* */
+/* _ux_host_stack_transfer_request Process host stack transfer */
+/* _ux_host_stack_transfer_request_abort Abort transfer request */
+/* _ux_utility_long_get Get 32-bit word */
+/* _ux_host_semaphore_get Get semaphore */
+/* */
+/* CALLED BY */
+/* */
+/* Storage Class */
/* */
/**************************************************************************/
UINT _ux_host_class_storage_transport_cbi(UX_HOST_CLASS_STORAGE *storage, UCHAR *data_pointer)
@@ -110,7 +95,7 @@ UX_ENDPOINT *control_endpoint;
transfer_request -> ux_transfer_request_type = UX_REQUEST_OUT | UX_REQUEST_TYPE_CLASS | UX_REQUEST_TARGET_INTERFACE;
transfer_request -> ux_transfer_request_value = 0;
transfer_request -> ux_transfer_request_index = storage -> ux_host_class_storage_interface -> ux_interface_descriptor.bInterfaceNumber;
-
+
/* Use a pointer for the ufi portion of the command. */
cbw = (UCHAR *) storage -> ux_host_class_storage_cbw;
ufi = cbw + UX_HOST_CLASS_STORAGE_CBW_CB;
@@ -126,23 +111,23 @@ UX_ENDPOINT *control_endpoint;
a reset recovery. */
if (transfer_request -> ux_transfer_request_completion_code != UX_SUCCESS)
return(transfer_request -> ux_transfer_request_completion_code);
-
- /* Get the length of the data payload. */
+
+ /* Get the length of the data payload. */
data_phase_requested_length = _ux_utility_long_get(cbw+UX_HOST_CLASS_STORAGE_CBW_DATA_LENGTH);
-
- /* Perform the data stage - if there is any. */
+
+ /* Perform the data stage - if there is any. */
if (data_phase_requested_length != 0)
{
/* Check the direction and determine which endpoint to use. */
if (*(cbw+UX_HOST_CLASS_STORAGE_CBW_FLAGS) == UX_HOST_CLASS_STORAGE_DATA_IN)
transfer_request = &storage -> ux_host_class_storage_bulk_in_endpoint -> ux_endpoint_transfer_request;
- else
+ else
transfer_request = &storage -> ux_host_class_storage_bulk_out_endpoint -> ux_endpoint_transfer_request;
/* Fill in the transfer_request data payload buffer. */
transfer_request -> ux_transfer_request_data_pointer = data_pointer;
-
+
/* Store the requested length in the transfer request. */
transfer_request -> ux_transfer_request_requested_length = data_phase_requested_length;
@@ -156,7 +141,7 @@ UX_ENDPOINT *control_endpoint;
/* Wait for the completion of the transfer request. */
status = _ux_host_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.
+ /* 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
sector read. */
storage -> ux_host_class_storage_data_phase_length += transfer_request -> ux_transfer_request_actual_length;
@@ -167,19 +152,19 @@ UX_ENDPOINT *control_endpoint;
/* All transfers pending need to abort. There may have been a partial transfer. */
_ux_host_stack_transfer_request_abort(transfer_request);
-
+
/* Set the completion code. */
transfer_request -> ux_transfer_request_completion_code = UX_TRANSFER_TIMEOUT;
-
+
/* Error trap. */
_ux_system_error_handler(UX_SYSTEM_LEVEL_THREAD, UX_SYSTEM_CONTEXT_CLASS, UX_TRANSFER_TIMEOUT);
/* If trace is enabled, insert this event into the trace buffer. */
UX_TRACE_IN_LINE_INSERT(UX_TRACE_ERROR, UX_TRANSFER_TIMEOUT, transfer_request, 0, 0, UX_TRACE_ERRORS, 0, 0)
-
+
/* There was an error, return to the caller. */
return(UX_TRANSFER_TIMEOUT);
- }
+ }
/* We need to check the completion code as well. */
if (transfer_request -> ux_transfer_request_completion_code != UX_SUCCESS)
@@ -194,7 +179,7 @@ UX_ENDPOINT *control_endpoint;
/* Check the status of the data payload. */
if (status != UX_SUCCESS)
return(status);
-
+
/* We must wait for the interrupt endpoint to return the status stage now. This can
take a fairly long time. */
status = _ux_host_semaphore_get(&transfer_request -> ux_transfer_request_semaphore, UX_MS_TO_TICK(UX_HOST_CLASS_STORAGE_CBI_STATUS_TIMEOUT));
diff --git a/common/usbx_host_classes/src/ux_host_class_storage_transport_run.c b/common/usbx_host_classes/src/ux_host_class_storage_transport_run.c
index 2afe8927..8beb7ba6 100644
--- a/common/usbx_host_classes/src/ux_host_class_storage_transport_run.c
+++ b/common/usbx_host_classes/src/ux_host_class_storage_transport_run.c
@@ -1,10 +1,11 @@
/***************************************************************************
- * Copyright (c) 2024 Microsoft Corporation
- *
+ * Copyright (c) 2024 Microsoft Corporation
+ * Copyright (c) 2026-present Eclipse ThreadX contributors
+ *
* This program and the accompanying materials are made available under the
* terms of the MIT License which is available at
* https://opensource.org/licenses/MIT.
- *
+ *
* SPDX-License-Identifier: MIT
**************************************************************************/
@@ -91,19 +92,6 @@ static inline VOID _ux_host_class_storage_transport_ep_reset(UX_HOST_CLASS_STORA
/* */
/* Storage Class */
/* */
-/* RELEASE HISTORY */
-/* */
-/* DATE NAME DESCRIPTION */
-/* */
-/* 01-31-2022 Chaoqiong Xiao Initial Version 6.1.10 */
-/* 07-29-2022 Chaoqiong Xiao Modified comment(s), */
-/* fixed parameter/variable */
-/* names conflict C++ keyword, */
-/* resulting in version 6.1.12 */
-/* 10-31-2022 Chaoqiong Xiao Modified comment(s), */
-/* improved internal logic, */
-/* resulting in version 6.2.0 */
-/* */
/**************************************************************************/
UINT _ux_host_class_storage_transport_run(UX_HOST_CLASS_STORAGE *storage)
{
@@ -480,7 +468,7 @@ ULONG requested_length;
if (storage -> ux_host_class_storage_trans_stage == UX_HOST_CLASS_STORAGE_STAGE_DATA)
{
/* Update data count. */
- storage -> ux_host_class_storage_data_phase_length +=
+ storage -> ux_host_class_storage_data_phase_length +=
trans -> ux_transfer_request_requested_length;
/* Check if all data is done. */
@@ -533,7 +521,7 @@ UCHAR csw_status;
storage -> ux_host_class_storage_trans_data =
storage -> ux_host_class_storage_trans_data_bak;
- /* Get sense code from response buffer. */
+ /* Get sense code from response buffer. */
sense_code = UX_HOST_CLASS_STORAGE_SENSE_STATUS(
(ULONG) *(resp + UX_HOST_CLASS_STORAGE_REQUEST_SENSE_RESPONSE_SENSE_KEY),
(ULONG) *(resp + UX_HOST_CLASS_STORAGE_REQUEST_SENSE_RESPONSE_CODE),
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 fc8a3285..b9ddc5e2 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
@@ -1,18 +1,19 @@
/***************************************************************************
- * Copyright (c) 2024 Microsoft Corporation
- *
+ * Copyright (c) 2024 Microsoft Corporation
+ * Copyright (c) 2026-present Eclipse ThreadX contributors
+ *
* This program and the accompanying materials are made available under the
* terms of the MIT License which is available at
* https://opensource.org/licenses/MIT.
- *
+ *
* SPDX-License-Identifier: MIT
**************************************************************************/
/**************************************************************************/
/**************************************************************************/
-/** */
-/** USBX Component */
+/** */
+/** USBX Component */
/** */
/** Storage Class */
/** */
@@ -29,49 +30,38 @@
#include "ux_host_stack.h"
-/**************************************************************************/
-/* */
-/* FUNCTION RELEASE */
-/* */
-/* _ux_host_class_storage_unit_ready_test PORTABLE C */
+/**************************************************************************/
+/* */
+/* FUNCTION RELEASE */
+/* */
+/* _ux_host_class_storage_unit_ready_test PORTABLE C */
/* 6.1.10 */
/* AUTHOR */
/* */
/* Chaoqiong Xiao, Microsoft Corporation */
/* */
/* DESCRIPTION */
-/* */
-/* This function will verify that a SCSI unit is ready for data */
-/* transfer. This command is used when the device does not mount */
-/* when power is supplied. */
-/* */
-/* INPUT */
-/* */
-/* storage Pointer to storage class */
-/* */
-/* OUTPUT */
-/* */
-/* Completion Status */
-/* */
-/* CALLS */
-/* */
-/* _ux_host_class_storage_cbw_initialize Initialize the CBW */
-/* _ux_host_class_storage_transport Send transport layer command */
-/* */
-/* CALLED BY */
-/* */
-/* Storage Class */
-/* */
-/* RELEASE HISTORY */
-/* */
-/* DATE NAME DESCRIPTION */
-/* */
-/* 05-19-2020 Chaoqiong Xiao Initial Version 6.0 */
-/* 09-30-2020 Chaoqiong Xiao Modified comment(s), */
-/* resulting in version 6.1 */
-/* 01-31-2022 Chaoqiong Xiao Modified comment(s), */
-/* added standalone support, */
-/* resulting in version 6.1.10 */
+/* */
+/* This function will verify that a SCSI unit is ready for data */
+/* transfer. This command is used when the device does not mount */
+/* when power is supplied. */
+/* */
+/* INPUT */
+/* */
+/* storage Pointer to storage class */
+/* */
+/* OUTPUT */
+/* */
+/* Completion Status */
+/* */
+/* CALLS */
+/* */
+/* _ux_host_class_storage_cbw_initialize Initialize the CBW */
+/* _ux_host_class_storage_transport Send transport layer command */
+/* */
+/* CALLED BY */
+/* */
+/* Storage Class */
/* */
/**************************************************************************/
UINT _ux_host_class_storage_unit_ready_test(UX_HOST_CLASS_STORAGE *storage)
@@ -80,7 +70,7 @@ UINT _ux_host_class_storage_unit_ready_test(UX_HOST_CLASS_STORAGE *storage)
UINT status;
UCHAR *cbw;
UINT command_length;
-
+
/* If trace is enabled, insert this event into the trace buffer. */
UX_TRACE_IN_LINE_INSERT(UX_TRACE_HOST_CLASS_STORAGE_UNIT_READY_TEST, storage, 0, 0, 0, UX_TRACE_HOST_CLASS_EVENTS, 0, 0)
@@ -99,7 +89,7 @@ UINT command_length;
/* Initialize the CBW for this command. */
_ux_host_class_storage_cbw_initialize(storage, 0, 0, command_length);
-
+
/* Prepare the TEST UNIT READY command block. */
*(cbw + UX_HOST_CLASS_STORAGE_CBW_CB + UX_HOST_CLASS_STORAGE_TEST_READY_OPERATION) = UX_HOST_CLASS_STORAGE_SCSI_TEST_READY;
@@ -117,5 +107,5 @@ UINT command_length;
#endif
/* Return completion status. */
- return(status);
+ return(status);
}
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 9ea13544..282a5aa9 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
@@ -1,18 +1,19 @@
/***************************************************************************
- * Copyright (c) 2024 Microsoft Corporation
- *
+ * Copyright (c) 2024 Microsoft Corporation
+ * Copyright (c) 2026-present Eclipse ThreadX contributors
+ *
* This program and the accompanying materials are made available under the
* terms of the MIT License which is available at
* https://opensource.org/licenses/MIT.
- *
+ *
* SPDX-License-Identifier: MIT
**************************************************************************/
/**************************************************************************/
/**************************************************************************/
-/** */
-/** USBX Component */
+/** */
+/** USBX Component */
/** */
/** Host Sierra Wireless AR module class */
/** */
@@ -29,52 +30,41 @@
#include "ux_host_stack.h"
-/**************************************************************************/
-/* */
-/* FUNCTION RELEASE */
-/* */
-/* _ux_host_class_swar_activate PORTABLE C */
+/**************************************************************************/
+/* */
+/* FUNCTION RELEASE */
+/* */
+/* _ux_host_class_swar_activate PORTABLE C */
/* 6.1.10 */
/* AUTHOR */
/* */
/* Chaoqiong Xiao, Microsoft Corporation */
/* */
/* DESCRIPTION */
-/* */
-/* This function calls the USBX stack to activate the class. */
-/* */
-/* INPUT */
-/* */
-/* command Dpump class command pointer */
-/* */
-/* OUTPUT */
-/* */
-/* Completion Status */
-/* */
-/* CALLS */
-/* */
-/* _ux_host_class_swar_configure Configure swar class */
-/* _ux_host_class_swar_endpoints_get Get endpoints of swar */
-/* _ux_host_stack_class_instance_create Create class instance */
-/* _ux_host_stack_class_instance_destroy Destroy the class instance */
-/* _ux_utility_memory_allocate Allocate memory block */
-/* _ux_utility_memory_free Free memory block */
-/* _ux_host_semaphore_create Create swar semaphore */
-/* */
-/* CALLED BY */
-/* */
-/* _ux_host_class_swar_entry Entry of swar class */
-/* */
-/* RELEASE HISTORY */
-/* */
-/* DATE NAME DESCRIPTION */
-/* */
-/* 05-19-2020 Chaoqiong Xiao Initial Version 6.0 */
-/* 09-30-2020 Chaoqiong Xiao Modified comment(s), */
-/* resulting in version 6.1 */
-/* 01-31-2022 Chaoqiong Xiao Modified comment(s), */
-/* refined macros names, */
-/* resulting in version 6.1.10 */
+/* */
+/* This function calls the USBX stack to activate the class. */
+/* */
+/* INPUT */
+/* */
+/* command Dpump class command pointer */
+/* */
+/* OUTPUT */
+/* */
+/* Completion Status */
+/* */
+/* CALLS */
+/* */
+/* _ux_host_class_swar_configure Configure swar class */
+/* _ux_host_class_swar_endpoints_get Get endpoints of swar */
+/* _ux_host_stack_class_instance_create Create class instance */
+/* _ux_host_stack_class_instance_destroy Destroy the class instance */
+/* _ux_utility_memory_allocate Allocate memory block */
+/* _ux_utility_memory_free Free memory block */
+/* _ux_host_semaphore_create Create swar semaphore */
+/* */
+/* CALLED BY */
+/* */
+/* _ux_host_class_swar_entry Entry of swar class */
/* */
/**************************************************************************/
UINT _ux_host_class_swar_activate(UX_HOST_CLASS_COMMAND *command)
@@ -83,7 +73,7 @@ UINT _ux_host_class_swar_activate(UX_HOST_CLASS_COMMAND *command)
UX_DEVICE *device;
UX_HOST_CLASS_SWAR *swar;
UINT status;
-
+
/* The Sierra Wireless class is always activated by the device descriptor. */
device = (UX_DEVICE *) command -> ux_host_class_command_container;
@@ -100,7 +90,7 @@ UINT status;
swar -> ux_host_class_swar_device = device;
/* Store the instance in the device container, this is for the USBX stack
- when it needs to invoke the class for deactivation. */
+ when it needs to invoke the class for deactivation. */
device -> ux_device_class_instance = (VOID *) swar;
/* Create this class instance. */
@@ -154,6 +144,6 @@ UINT status;
_ux_utility_memory_free(swar);
/* Return completion status. */
- return(status);
+ return(status);
}
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 df417f25..422668ea 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
@@ -1,18 +1,19 @@
/***************************************************************************
- * Copyright (c) 2024 Microsoft Corporation
- *
+ * Copyright (c) 2024 Microsoft Corporation
+ * Copyright (c) 2026-present Eclipse ThreadX contributors
+ *
* This program and the accompanying materials are made available under the
* terms of the MIT License which is available at
* https://opensource.org/licenses/MIT.
- *
+ *
* SPDX-License-Identifier: MIT
**************************************************************************/
/**************************************************************************/
/**************************************************************************/
-/** */
-/** USBX Component */
+/** */
+/** USBX Component */
/** */
/** Host Sierra Wireless AR module class */
/** */
@@ -29,52 +30,39 @@
#include "ux_host_stack.h"
-/**************************************************************************/
-/* */
-/* FUNCTION RELEASE */
-/* */
-/* _ux_host_class_swar_configure PORTABLE C */
+/**************************************************************************/
+/* */
+/* FUNCTION RELEASE */
+/* */
+/* _ux_host_class_swar_configure PORTABLE C */
/* 6.3.0 */
/* AUTHOR */
/* */
/* Chaoqiong Xiao, Microsoft Corporation */
/* */
/* DESCRIPTION */
-/* */
+/* */
/* This function calls the USBX stack to do a SET_CONFIGURATION to the */
-/* swar. Once the swar is configured, its interface will be */
-/* activated. The bulk endpoints enumerated(1 IN, 1 OUT ). */
-/* */
-/* INPUT */
-/* */
-/* swar Pointer to swar class */
-/* */
-/* OUTPUT */
-/* */
-/* Completion Status */
-/* */
-/* CALLS */
-/* */
-/* _ux_host_stack_configuration_interface_get Get interface */
-/* _ux_host_stack_device_configuration_get Get configuration */
-/* _ux_host_stack_device_configuration_select Select configuration */
-/* */
-/* CALLED BY */
-/* */
-/* _ux_host_class_swar_activate swar class activate */
-/* */
-/* 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 */
-/* 10-31-2023 Chaoqiong Xiao Modified comment(s), */
-/* removed interface link, */
-/* resulting in version 6.3.0 */
+/* swar. Once the swar is configured, its interface will be */
+/* activated. The bulk endpoints enumerated(1 IN, 1 OUT ). */
+/* */
+/* INPUT */
+/* */
+/* swar Pointer to swar class */
+/* */
+/* OUTPUT */
+/* */
+/* Completion Status */
+/* */
+/* CALLS */
+/* */
+/* _ux_host_stack_configuration_interface_get Get interface */
+/* _ux_host_stack_device_configuration_get Get configuration */
+/* _ux_host_stack_device_configuration_select Select configuration */
+/* */
+/* CALLED BY */
+/* */
+/* _ux_host_class_swar_activate swar class activate */
/* */
/**************************************************************************/
UINT _ux_host_class_swar_configure(UX_HOST_CLASS_SWAR *swar)
@@ -97,29 +85,29 @@ UX_DEVICE *parent_device;
status = _ux_host_stack_device_configuration_get(swar -> ux_host_class_swar_device, 0, &configuration);
if (status != UX_SUCCESS)
{
-
+
/* Error trap. */
_ux_system_error_handler(UX_SYSTEM_LEVEL_THREAD, UX_SYSTEM_CONTEXT_CLASS, UX_CONFIGURATION_HANDLE_UNKNOWN);
/* If trace is enabled, insert this event into the trace buffer. */
UX_TRACE_IN_LINE_INSERT(UX_TRACE_ERROR, UX_CONFIGURATION_HANDLE_UNKNOWN, swar -> ux_host_class_swar_device, 0, 0, UX_TRACE_ERRORS, 0, 0)
-
+
return(UX_CONFIGURATION_HANDLE_UNKNOWN);
}
#if UX_MAX_DEVICES > 1
- /* Check the swar power source and check the parent power source for
+ /* 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)
{
/* Get parent device pointer. */
parent_device = swar -> ux_host_class_swar_device -> ux_device_parent;
-
- /* If the device is NULL, the parent is the root swar and we don't have to worry
+
+ /* If the device is NULL, the parent is the root swar and we don't have to worry
if the parent is not the root swar, check for its power source. */
if ((parent_device != UX_NULL) && (parent_device -> ux_device_power_source == UX_DEVICE_BUS_POWERED))
- {
+ {
/* Error trap. */
_ux_system_error_handler(UX_SYSTEM_LEVEL_THREAD, UX_SYSTEM_CONTEXT_CLASS, UX_CONNECTION_INCOMPATIBLE);
@@ -128,16 +116,16 @@ UX_DEVICE *parent_device;
UX_TRACE_IN_LINE_INSERT(UX_TRACE_ERROR, UX_CONNECTION_INCOMPATIBLE, swar, 0, 0, UX_TRACE_ERRORS, 0, 0)
return(UX_CONNECTION_INCOMPATIBLE);
- }
+ }
}
#endif
- /* We have the valid configuration. Ask the USBX stack to set this configuration. */
+ /* 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)
return(status);
- /* If the operation went well, the swar default alternate setting for the swar interface is
+ /* If the operation went well, the swar default alternate setting for the swar interface is
active. We have to memorize the data interface since the bulk in/out endpoints are hooked to it. */
status = _ux_host_stack_configuration_interface_get(configuration, UX_HOST_CLASS_SWAR_DATA_INTERFACE, 0, &swar -> ux_host_class_swar_interface);
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 301dc116..f209bc2f 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
@@ -1,18 +1,19 @@
/***************************************************************************
- * Copyright (c) 2024 Microsoft Corporation
- *
+ * Copyright (c) 2024 Microsoft Corporation
+ * Copyright (c) 2026-present Eclipse ThreadX contributors
+ *
* This program and the accompanying materials are made available under the
* terms of the MIT License which is available at
* https://opensource.org/licenses/MIT.
- *
+ *
* SPDX-License-Identifier: MIT
**************************************************************************/
/**************************************************************************/
/**************************************************************************/
-/** */
-/** USBX Component */
+/** */
+/** USBX Component */
/** */
/** Host Sierra Wireless AR module class */
/** */
@@ -29,54 +30,43 @@
#include "ux_host_stack.h"
-/**************************************************************************/
-/* */
-/* FUNCTION RELEASE */
-/* */
-/* _ux_host_class_swar_deactivate PORTABLE C */
+/**************************************************************************/
+/* */
+/* FUNCTION RELEASE */
+/* */
+/* _ux_host_class_swar_deactivate PORTABLE C */
/* 6.1.10 */
/* AUTHOR */
/* */
/* Chaoqiong Xiao, Microsoft Corporation */
/* */
/* DESCRIPTION */
-/* */
+/* */
/* This function is called when this instance of the swar has been */
-/* removed from the bus either directly or indirectly. The bulk in\out */
-/* pipes will be destroyed and the instanced removed. */
-/* */
-/* INPUT */
-/* */
-/* command Swar class command pointer */
-/* */
-/* OUTPUT */
-/* */
-/* Completion Status */
-/* */
-/* CALLS */
-/* */
-/* _ux_host_stack_class_instance_destroy Destroy the class instance */
+/* removed from the bus either directly or indirectly. The bulk in\out */
+/* pipes will be destroyed and the instanced removed. */
+/* */
+/* INPUT */
+/* */
+/* command Swar class command pointer */
+/* */
+/* OUTPUT */
+/* */
+/* Completion Status */
+/* */
+/* CALLS */
+/* */
+/* _ux_host_stack_class_instance_destroy Destroy the class instance */
/* _ux_host_stack_endpoint_transfer_abort */
-/* Abort endpoint transfer */
-/* _ux_utility_memory_free Free memory block */
-/* _ux_host_semaphore_get Get protection semaphore */
-/* _ux_host_semaphore_delete Delete protection semaphore */
+/* Abort endpoint transfer */
+/* _ux_utility_memory_free Free memory block */
+/* _ux_host_semaphore_get Get protection semaphore */
+/* _ux_host_semaphore_delete Delete protection semaphore */
/* _ux_utility_thread_schedule_other Schedule other threads */
-/* */
-/* CALLED BY */
-/* */
-/* _ux_host_class_swar_entry Entry of swar class */
-/* */
-/* RELEASE HISTORY */
-/* */
-/* DATE NAME DESCRIPTION */
-/* */
-/* 05-19-2020 Chaoqiong Xiao Initial Version 6.0 */
-/* 09-30-2020 Chaoqiong Xiao Modified comment(s), */
-/* resulting in version 6.1 */
-/* 01-31-2022 Chaoqiong Xiao Modified comment(s), */
-/* refined macros names, */
-/* resulting in version 6.1.10 */
+/* */
+/* CALLED BY */
+/* */
+/* _ux_host_class_swar_entry Entry of swar class */
/* */
/**************************************************************************/
UINT _ux_host_class_swar_deactivate(UX_HOST_CLASS_COMMAND *command)
@@ -95,7 +85,7 @@ UINT status;
/* Protect thread reentry to this instance. */
status = _ux_host_semaphore_get(&swar -> ux_host_class_swar_semaphore, UX_WAIT_FOREVER);
if (status != UX_SUCCESS)
- {
+ {
/* Error trap. */
_ux_system_error_handler(UX_SYSTEM_LEVEL_THREAD, UX_SYSTEM_CONTEXT_CLASS, UX_HOST_CLASS_INSTANCE_UNKNOWN);
@@ -105,7 +95,7 @@ UINT status;
return(UX_HOST_CLASS_INSTANCE_UNKNOWN);
}
-
+
/* We need to abort transactions on the bulk Out pipe. */
_ux_host_stack_endpoint_transfer_abort(swar -> ux_host_class_swar_bulk_out_endpoint);
@@ -114,7 +104,7 @@ UINT status;
/* The enumeration thread needs to sleep a while to allow the application or the class that may be using
endpoints to exit properly. */
- _ux_host_thread_schedule_other(UX_THREAD_PRIORITY_ENUM);
+ _ux_host_thread_schedule_other(UX_THREAD_PRIORITY_ENUM);
/* Destroy the instance. */
_ux_host_stack_class_instance_destroy(swar -> ux_host_class_swar_class, (VOID *) swar);
@@ -126,7 +116,7 @@ UINT status;
that the device is removed. */
if (_ux_system_host -> ux_system_host_change_function != UX_NULL)
{
-
+
/* Inform the application the device is removed. */
_ux_system_host -> ux_system_host_change_function(UX_DEVICE_REMOVAL, swar -> ux_host_class_swar_class, (VOID *) swar);
}
@@ -140,6 +130,6 @@ UINT status;
_ux_utility_memory_free(swar);
/* Return successful status. */
- return(UX_SUCCESS);
+ return(UX_SUCCESS);
}
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 52bdbc22..09647812 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
@@ -1,18 +1,19 @@
/***************************************************************************
- * Copyright (c) 2024 Microsoft Corporation
- *
+ * Copyright (c) 2024 Microsoft Corporation
+ * Copyright (c) 2026-present Eclipse ThreadX contributors
+ *
* This program and the accompanying materials are made available under the
* terms of the MIT License which is available at
* https://opensource.org/licenses/MIT.
- *
+ *
* SPDX-License-Identifier: MIT
**************************************************************************/
/**************************************************************************/
/**************************************************************************/
-/** */
-/** USBX Component */
+/** */
+/** USBX Component */
/** */
/** Host Sierra Wireless AR module class */
/** */
@@ -29,46 +30,38 @@
#include "ux_host_stack.h"
-/**************************************************************************/
-/* */
-/* FUNCTION RELEASE */
-/* */
-/* _ux_host_class_swar_endpoints_get PORTABLE C */
+/**************************************************************************/
+/* */
+/* FUNCTION RELEASE */
+/* */
+/* _ux_host_class_swar_endpoints_get PORTABLE C */
/* 6.1 */
/* AUTHOR */
/* */
/* Chaoqiong Xiao, Microsoft Corporation */
/* */
/* DESCRIPTION */
-/* */
+/* */
/* This function search for the handle of the bulk out and bulk in */
-/* endpoints. The Sierra Wireless USB device has multiple interfaces. */
-/* We first need to find the interface which uses Bulk endpoints to */
-/* carry data. */
-/* */
-/* INPUT */
-/* */
-/* swar Pointer to swar class */
-/* */
-/* OUTPUT */
-/* */
-/* Completion Status */
-/* */
-/* CALLS */
-/* */
-/* _ux_host_stack_interface_endpoint_get Get interface endpoint */
-/* */
-/* CALLED BY */
-/* */
-/* _ux_host_class_swar_activate Activate swar class */
-/* */
-/* RELEASE HISTORY */
-/* */
-/* DATE NAME DESCRIPTION */
-/* */
-/* 05-19-2020 Chaoqiong Xiao Initial Version 6.0 */
-/* 09-30-2020 Chaoqiong Xiao Modified comment(s), */
-/* resulting in version 6.1 */
+/* endpoints. The Sierra Wireless USB device has multiple interfaces. */
+/* We first need to find the interface which uses Bulk endpoints to */
+/* carry data. */
+/* */
+/* INPUT */
+/* */
+/* swar Pointer to swar class */
+/* */
+/* OUTPUT */
+/* */
+/* Completion Status */
+/* */
+/* CALLS */
+/* */
+/* _ux_host_stack_interface_endpoint_get Get interface endpoint */
+/* */
+/* CALLED BY */
+/* */
+/* _ux_host_class_swar_activate Activate swar class */
/* */
/**************************************************************************/
UINT _ux_host_class_swar_endpoints_get(UX_HOST_CLASS_SWAR *swar)
@@ -81,7 +74,7 @@ UINT endpoint_index;
/* Search the bulk OUT endpoint. It is attached to the interface container. */
for (endpoint_index = 0; endpoint_index < swar -> ux_host_class_swar_interface -> ux_interface_descriptor.bNumEndpoints;
endpoint_index++)
- {
+ {
/* Get interface endpoint. */
status = _ux_host_stack_interface_endpoint_get(swar -> ux_host_class_swar_interface, endpoint_index, &endpoint);
@@ -102,8 +95,8 @@ UINT endpoint_index;
swar -> ux_host_class_swar_bulk_out_endpoint = endpoint;
break;
}
- }
- }
+ }
+ }
/* The bulk out endpoint is mandatory. */
if (swar -> ux_host_class_swar_bulk_out_endpoint == UX_NULL)
@@ -117,12 +110,12 @@ UINT endpoint_index;
return(UX_ENDPOINT_HANDLE_UNKNOWN);
}
-
+
/* Search the bulk IN endpoint. It is attached to the interface container. */
for (endpoint_index = 0; endpoint_index < swar -> ux_host_class_swar_interface -> ux_interface_descriptor.bNumEndpoints;
endpoint_index++)
- {
+ {
/* Get the endpoint handle. */
status = _ux_host_stack_interface_endpoint_get(swar -> ux_host_class_swar_interface, endpoint_index, &endpoint);
@@ -143,12 +136,12 @@ UINT endpoint_index;
swar -> ux_host_class_swar_bulk_in_endpoint = endpoint;
break;
}
- }
- }
+ }
+ }
/* The bulk in endpoint is mandatory. */
if (swar -> ux_host_class_swar_bulk_in_endpoint == UX_NULL)
- {
+ {
/* Error trap. */
_ux_system_error_handler(UX_SYSTEM_LEVEL_THREAD, UX_SYSTEM_CONTEXT_CLASS, UX_ENDPOINT_HANDLE_UNKNOWN);
@@ -158,7 +151,7 @@ UINT endpoint_index;
return(UX_ENDPOINT_HANDLE_UNKNOWN);
}
-
+
/* All endpoints have been mounted. */
return(UX_SUCCESS);
}
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 980485fe..b47d4b2a 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
@@ -1,18 +1,19 @@
/***************************************************************************
- * Copyright (c) 2024 Microsoft Corporation
- *
+ * Copyright (c) 2024 Microsoft Corporation
+ * Copyright (c) 2026-present Eclipse ThreadX contributors
+ *
* This program and the accompanying materials are made available under the
* terms of the MIT License which is available at
* https://opensource.org/licenses/MIT.
- *
+ *
* SPDX-License-Identifier: MIT
**************************************************************************/
/**************************************************************************/
/**************************************************************************/
-/** */
-/** USBX Component */
+/** */
+/** USBX Component */
/** */
/** Host Sierra Wireless AR module class */
/** */
@@ -29,46 +30,38 @@
#include "ux_host_stack.h"
-/**************************************************************************/
-/* */
-/* FUNCTION RELEASE */
-/* */
-/* _ux_host_class_swar_entry PORTABLE C */
+/**************************************************************************/
+/* */
+/* FUNCTION RELEASE */
+/* */
+/* _ux_host_class_swar_entry PORTABLE C */
/* 6.1 */
/* AUTHOR */
/* */
/* Chaoqiong Xiao, Microsoft Corporation */
/* */
/* DESCRIPTION */
-/* */
-/* This function is the entry point of the swar class. It will be */
-/* called by the USBX stack enumeration module when there is a new */
-/* swar on the bus or when the USB swar is removed. */
-/* */
-/* INPUT */
-/* */
+/* */
+/* This function is the entry point of the swar class. It will be */
+/* called by the USBX stack enumeration module when there is a new */
+/* swar on the bus or when the USB swar is removed. */
+/* */
+/* INPUT */
+/* */
/* command swar class command */
-/* */
-/* OUTPUT */
-/* */
-/* Completion Status */
-/* */
-/* CALLS */
-/* */
-/* _ux_host_class_swar_activate Activate swar class */
-/* _ux_host_class_swar_deactivate Deactivate swar class */
-/* */
-/* CALLED BY */
-/* */
-/* Data pump Class */
-/* */
-/* RELEASE HISTORY */
-/* */
-/* DATE NAME DESCRIPTION */
-/* */
-/* 05-19-2020 Chaoqiong Xiao Initial Version 6.0 */
-/* 09-30-2020 Chaoqiong Xiao Modified comment(s), */
-/* resulting in version 6.1 */
+/* */
+/* OUTPUT */
+/* */
+/* Completion Status */
+/* */
+/* CALLS */
+/* */
+/* _ux_host_class_swar_activate Activate swar class */
+/* _ux_host_class_swar_deactivate Deactivate swar class */
+/* */
+/* CALLED BY */
+/* */
+/* Data pump Class */
/* */
/**************************************************************************/
UINT _ux_host_class_swar_entry(UX_HOST_CLASS_COMMAND *command)
@@ -89,10 +82,10 @@ UINT status;
if(((command -> ux_host_class_command_usage == UX_HOST_CLASS_COMMAND_USAGE_PIDVID) &&
(command -> ux_host_class_command_pid == UX_HOST_CLASS_SWAR_PRODUCT_ID) &&
(command -> ux_host_class_command_vid == UX_HOST_CLASS_SWAR_VENDOR_ID )))
- return(UX_SUCCESS);
- else
- return(UX_NO_CLASS_MATCH);
-
+ return(UX_SUCCESS);
+ else
+ return(UX_NO_CLASS_MATCH);
+
case UX_HOST_CLASS_COMMAND_ACTIVATE:
/* The activate command is used when the device inserted has found a parent and
@@ -102,13 +95,13 @@ UINT status;
case UX_HOST_CLASS_COMMAND_DEACTIVATE:
- /* The deactivate command is used when the device has been extracted either
+ /* The deactivate command is used when the device has been extracted either
directly or when its parents has been extracted. */
status = _ux_host_class_swar_deactivate(command);
return(status);
- default:
-
+ default:
+
/* Error trap. */
_ux_system_error_handler(UX_SYSTEM_LEVEL_THREAD, UX_SYSTEM_CONTEXT_CLASS, UX_FUNCTION_NOT_SUPPORTED);
@@ -116,6 +109,6 @@ UINT status;
UX_TRACE_IN_LINE_INSERT(UX_TRACE_ERROR, UX_FUNCTION_NOT_SUPPORTED, 0, 0, 0, UX_TRACE_ERRORS, 0, 0)
return(UX_FUNCTION_NOT_SUPPORTED);
- }
+ }
}
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 2c8255ee..f22648b3 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
@@ -1,10 +1,11 @@
/***************************************************************************
- * Copyright (c) 2024 Microsoft Corporation
- *
+ * Copyright (c) 2024 Microsoft Corporation
+ * Copyright (c) 2026-present Eclipse ThreadX contributors
+ *
* This program and the accompanying materials are made available under the
* terms of the MIT License which is available at
* https://opensource.org/licenses/MIT.
- *
+ *
* SPDX-License-Identifier: MIT
**************************************************************************/
@@ -64,16 +65,6 @@
/* */
/* Application */
/* */
-/* RELEASE HISTORY */
-/* */
-/* DATE NAME DESCRIPTION */
-/* */
-/* 05-19-2020 Chaoqiong Xiao Initial Version 6.0 */
-/* 09-30-2020 Chaoqiong Xiao Modified comment(s), */
-/* resulting in version 6.1 */
-/* 10-31-2023 Yajun xia Modified comment(s), */
-/* resulting in version 6.3.0 */
-/* */
/**************************************************************************/
UINT _ux_host_class_swar_ioctl(UX_HOST_CLASS_SWAR *swar, ULONG ioctl_function,
VOID *parameter)
@@ -161,12 +152,6 @@ UINT status;
/* */
/* Application */
/* */
-/* RELEASE HISTORY */
-/* */
-/* DATE NAME DESCRIPTION */
-/* */
-/* 10-31-2023 Chaoqiong Xiao Initial Version 6.3.0 */
-/* */
/**************************************************************************/
UINT _uxe_host_class_swar_ioctl(UX_HOST_CLASS_SWAR *swar, ULONG ioctl_function,
VOID *parameter)
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 cdb10afe..bb09cd7b 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
@@ -1,18 +1,19 @@
/***************************************************************************
- * Copyright (c) 2024 Microsoft Corporation
- *
+ * Copyright (c) 2024 Microsoft Corporation
+ * Copyright (c) 2026-present Eclipse ThreadX contributors
+ *
* This program and the accompanying materials are made available under the
* terms of the MIT License which is available at
* https://opensource.org/licenses/MIT.
- *
+ *
* SPDX-License-Identifier: MIT
**************************************************************************/
/**************************************************************************/
/**************************************************************************/
-/** */
-/** USBX Component */
+/** */
+/** USBX Component */
/** */
/** Host Sierra Wireless AR module class */
/** */
@@ -29,75 +30,60 @@
#include "ux_host_stack.h"
-/**************************************************************************/
-/* */
-/* FUNCTION RELEASE */
-/* */
-/* _ux_host_class_swar_read PORTABLE C */
+/**************************************************************************/
+/* */
+/* FUNCTION RELEASE */
+/* */
+/* _ux_host_class_swar_read PORTABLE C */
/* 6.1.11 */
/* AUTHOR */
/* */
/* Chaoqiong Xiao, Microsoft Corporation */
/* */
/* DESCRIPTION */
-/* */
-/* This function reads from the swar interface. The call is */
-/* blocking and only returns when there is either an error or when */
+/* */
+/* This function reads from the swar interface. The call is */
+/* blocking and only returns when there is either an error or when */
/* the transfer is complete. */
/* */
-/* INPUT */
-/* */
-/* swar Pointer to swar class */
+/* INPUT */
+/* */
+/* swar Pointer to swar class */
/* data_pointer Pointer to buffer */
/* requested_length Requested data read */
/* actual_length Actual data read */
-/* */
-/* OUTPUT */
-/* */
-/* Completion Status */
-/* */
-/* CALLS */
-/* */
-/* _ux_host_stack_class_instance_verify Verify the class instance */
-/* _ux_host_stack_transfer_request Process transfer request */
-/* _ux_host_stack_transfer_request_abort Abort transfer request */
-/* _ux_host_semaphore_get Get protection semaphore */
-/* _ux_host_semaphore_put Release protection semaphore */
-/* */
-/* 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), */
-/* prefixed UX to MS_TO_TICK, */
-/* resulting in version 6.1 */
-/* 01-31-2022 Chaoqiong Xiao Modified comment(s), */
-/* refined macros names, */
-/* resulting in version 6.1.10 */
-/* 04-25-2022 Chaoqiong Xiao Modified comment(s), */
-/* fixed standalone compile, */
-/* resulting in version 6.1.11 */
+/* */
+/* OUTPUT */
+/* */
+/* Completion Status */
+/* */
+/* CALLS */
+/* */
+/* _ux_host_stack_class_instance_verify Verify the class instance */
+/* _ux_host_stack_transfer_request Process transfer request */
+/* _ux_host_stack_transfer_request_abort Abort transfer request */
+/* _ux_host_semaphore_get Get protection semaphore */
+/* _ux_host_semaphore_put Release protection semaphore */
+/* */
+/* CALLED BY */
+/* */
+/* Application */
/* */
/**************************************************************************/
-UINT _ux_host_class_swar_read(UX_HOST_CLASS_SWAR *swar, UCHAR *data_pointer,
+UINT _ux_host_class_swar_read(UX_HOST_CLASS_SWAR *swar, UCHAR *data_pointer,
ULONG requested_length, ULONG *actual_length)
{
UX_TRANSFER *transfer_request;
UINT status;
ULONG transfer_request_length;
-
+
/* If trace is enabled, insert this event into the trace buffer. */
UX_TRACE_IN_LINE_INSERT(UX_TRACE_HOST_CLASS_SWAR_READ, swar, data_pointer, requested_length, 0, UX_TRACE_HOST_CLASS_EVENTS, 0, 0)
-
+
/* Ensure the instance is valid. */
if (_ux_host_stack_class_instance_verify(_ux_system_host_class_swar_name, (VOID *) swar) != UX_SUCCESS)
- {
+ {
/* Error trap. */
_ux_system_error_handler(UX_SYSTEM_LEVEL_THREAD, UX_SYSTEM_CONTEXT_CLASS, UX_HOST_CLASS_INSTANCE_UNKNOWN);
@@ -118,7 +104,7 @@ ULONG transfer_request_length;
/* Get the pointer to the bulk in endpoint in the transfer_request. */
transfer_request = &swar -> ux_host_class_swar_bulk_in_endpoint -> ux_endpoint_transfer_request;
-
+
/* Perform a transfer on the bulk in endpoint until either the transfer is
completed or until there is an error. */
while (requested_length)
@@ -129,18 +115,18 @@ ULONG transfer_request_length;
transfer_request_length = transfer_request -> ux_transfer_request_maximum_length;
else
transfer_request_length = requested_length;
-
+
/* Initialize the transfer request. */
transfer_request -> ux_transfer_request_data_pointer = data_pointer;
transfer_request -> ux_transfer_request_requested_length = transfer_request_length;
-
+
/* Perform the transfer. */
status = _ux_host_stack_transfer_request(transfer_request);
/* If the transfer is successful, we need to wait for the transfer request to be completed. */
if (status == UX_SUCCESS)
{
-
+
/* Wait for the completion of the transfer_request. */
status = _ux_host_semaphore_get(&transfer_request -> ux_transfer_request_semaphore, UX_MS_TO_TICK(UX_HOST_CLASS_SWAR_CLASS_TRANSFER_TIMEOUT));
@@ -150,26 +136,26 @@ ULONG transfer_request_length;
/* All transfers pending need to abort. There may have been a partial transfer. */
_ux_host_stack_transfer_request_abort(transfer_request);
-
- /* Update the length of the actual data transferred. We do this after the
+
+ /* Update the length of the actual data transferred. We do this after the
abort of the transfer request in case some data was actually received. */
*actual_length += transfer_request -> ux_transfer_request_actual_length;
-
+
/* Unprotect thread reentry to this instance. */
_ux_host_semaphore_put(&swar -> ux_host_class_swar_semaphore);
/* Set the completion code. */
transfer_request -> ux_transfer_request_completion_code = UX_TRANSFER_TIMEOUT;
-
+
/* Error trap. */
_ux_system_error_handler(UX_SYSTEM_LEVEL_THREAD, UX_SYSTEM_CONTEXT_CLASS, UX_TRANSFER_TIMEOUT);
/* If trace is enabled, insert this event into the trace buffer. */
UX_TRACE_IN_LINE_INSERT(UX_TRACE_ERROR, UX_TRANSFER_TIMEOUT, transfer_request, 0, 0, UX_TRACE_ERRORS, 0, 0)
-
+
/* There was an error, return to the caller */
return(UX_TRANSFER_TIMEOUT);
- }
+ }
}
else
{
@@ -183,32 +169,32 @@ ULONG transfer_request_length;
/* Update the length of the transfer. Normally all the data has to be received. */
*actual_length += transfer_request -> ux_transfer_request_actual_length;
-
+
/* Check for completion of transfer. If the transfer is partial, return to caller.
The transfer is marked as successful but the caller will need to check the length
actually received and determine if a partial transfer is OK. */
if (transfer_request_length != transfer_request -> ux_transfer_request_actual_length)
{
-
+
/* Unprotect thread reentry to this instance. */
_ux_host_semaphore_put(&swar -> ux_host_class_swar_semaphore);
-
+
/* Return success to caller. */
return(UX_SUCCESS);
}
- /* Update the data pointer for next transfer. */
+ /* Update the data pointer for next transfer. */
data_pointer += transfer_request_length;
-
+
/* Update what is left to receive. */
- requested_length -= transfer_request_length;
- }
+ requested_length -= transfer_request_length;
+ }
/* Unprotect thread reentry to this instance. */
_ux_host_semaphore_put(&swar -> ux_host_class_swar_semaphore);
/* We get here when all the transfers went through without errors. */
- return(UX_SUCCESS);
+ return(UX_SUCCESS);
}
@@ -245,14 +231,8 @@ ULONG transfer_request_length;
/* */
/* Application */
/* */
-/* RELEASE HISTORY */
-/* */
-/* DATE NAME DESCRIPTION */
-/* */
-/* 10-31-2023 Chaoqiong Xiao Initial Version 6.3.0 */
-/* */
/**************************************************************************/
-UINT _uxe_host_class_swar_read (UX_HOST_CLASS_SWAR *swar, UCHAR *data_pointer,
+UINT _uxe_host_class_swar_read (UX_HOST_CLASS_SWAR *swar, UCHAR *data_pointer,
ULONG requested_length, ULONG *actual_length)
{
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 c5defb35..c9803986 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
@@ -1,18 +1,19 @@
/***************************************************************************
- * Copyright (c) 2024 Microsoft Corporation
- *
+ * Copyright (c) 2024 Microsoft Corporation
+ * Copyright (c) 2026-present Eclipse ThreadX contributors
+ *
* This program and the accompanying materials are made available under the
* terms of the MIT License which is available at
* https://opensource.org/licenses/MIT.
- *
+ *
* SPDX-License-Identifier: MIT
**************************************************************************/
/**************************************************************************/
/**************************************************************************/
-/** */
-/** USBX Component */
+/** */
+/** USBX Component */
/** */
/** Host Sierra Wireless AR module class */
/** */
@@ -29,45 +30,37 @@
#include "ux_host_stack.h"
-/**************************************************************************/
-/* */
-/* FUNCTION RELEASE */
-/* */
-/* _ux_host_class_swar_reception_callback PORTABLE C */
+/**************************************************************************/
+/* */
+/* FUNCTION RELEASE */
+/* */
+/* _ux_host_class_swar_reception_callback PORTABLE C */
/* 6.1 */
/* AUTHOR */
/* */
/* Chaoqiong Xiao, Microsoft Corporation */
/* */
/* DESCRIPTION */
-/* */
-/* This function is the callback from the USBX transfer functions, */
-/* it is called when a full or partial transfer has been done for a */
+/* */
+/* This function is the callback from the USBX transfer functions, */
+/* it is called when a full or partial transfer has been done for a */
/* bulk in transfer. It calls back the application. */
/* */
-/* INPUT */
-/* */
-/* transfer_request Pointer to transfer request */
-/* */
-/* OUTPUT */
-/* */
-/* None */
-/* */
-/* CALLS */
-/* */
-/* _ux_host_stack_transfer_request Process transfer request */
-/* */
-/* 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), */
-/* resulting in version 6.1 */
+/* INPUT */
+/* */
+/* transfer_request Pointer to transfer request */
+/* */
+/* OUTPUT */
+/* */
+/* None */
+/* */
+/* CALLS */
+/* */
+/* _ux_host_stack_transfer_request Process transfer request */
+/* */
+/* CALLED BY */
+/* */
+/* Application */
/* */
/**************************************************************************/
VOID _ux_host_class_swar_reception_callback (UX_TRANSFER *transfer_request)
@@ -75,27 +68,27 @@ VOID _ux_host_class_swar_reception_callback (UX_TRANSFER *transfer_request)
UX_HOST_CLASS_SWAR *swar;
UX_HOST_CLASS_SWAR_RECEPTION *swar_reception;
-
+
/* Get the class instance for this transfer request. */
swar = (UX_HOST_CLASS_SWAR *) transfer_request -> ux_transfer_request_class_instance;
-
+
/* Get the pointer to the acm reception structure. */
swar_reception = swar -> ux_host_class_swar_reception;
/* Check the state of the transfer. If there is an error, we do not proceed with this report. */
if (transfer_request -> ux_transfer_request_completion_code != UX_SUCCESS)
{
-
+
/* The reception is stopped. */
swar_reception -> ux_host_class_swar_reception_state = UX_HOST_CLASS_SWAR_RECEPTION_STATE_STOPPED;
/* We do not proceed. */
- return;
-
+ return;
+
}
/* And move to the next reception buffer. Check if we are at the end of the application buffer. */
- if (swar_reception -> ux_host_class_swar_reception_data_head + swar_reception -> ux_host_class_swar_reception_block_size >=
+ if (swar_reception -> ux_host_class_swar_reception_data_head + swar_reception -> ux_host_class_swar_reception_block_size >=
swar_reception -> ux_host_class_swar_reception_data_buffer + swar_reception -> ux_host_class_swar_reception_data_buffer_size)
{
@@ -110,19 +103,19 @@ UX_HOST_CLASS_SWAR_RECEPTION *swar_reception;
UX_TRACE_IN_LINE_INSERT(UX_TRACE_ERROR, UX_BUFFER_OVERFLOW, transfer_request, 0, 0, UX_TRACE_ERRORS, 0, 0)
/* We have an overflow. We cannot continue. Report to the application. */
- swar_reception -> ux_host_class_swar_reception_callback(swar, UX_BUFFER_OVERFLOW, UX_NULL, 0);
-
+ swar_reception -> ux_host_class_swar_reception_callback(swar, UX_BUFFER_OVERFLOW, UX_NULL, 0);
+
/* And stop the transfer in progress flag. */
swar_reception -> ux_host_class_swar_reception_state = UX_HOST_CLASS_SWAR_RECEPTION_STATE_STOPPED;
-
+
return;
}
else
-
+
/* Program the head to be at the beginning of the application buffer. */
swar_reception -> ux_host_class_swar_reception_data_head = swar_reception -> ux_host_class_swar_reception_data_buffer;
-
- }
+
+ }
else
/* Program the head to be after the current buffer. */
@@ -130,7 +123,7 @@ UX_HOST_CLASS_SWAR_RECEPTION *swar_reception;
/* We need to report this transfer to the application. */
- swar_reception -> ux_host_class_swar_reception_callback(swar,
+ swar_reception -> ux_host_class_swar_reception_callback(swar,
transfer_request -> ux_transfer_request_completion_code,
transfer_request -> ux_transfer_request_data_pointer,
transfer_request -> ux_transfer_request_actual_length);
@@ -139,6 +132,6 @@ UX_HOST_CLASS_SWAR_RECEPTION *swar_reception;
_ux_host_stack_transfer_request(transfer_request);
/* There is no status to be reported back to the stack. */
- return;
+ return;
}
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 fc522fc9..74b690a9 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
@@ -1,18 +1,19 @@
/***************************************************************************
- * Copyright (c) 2024 Microsoft Corporation
- *
+ * Copyright (c) 2024 Microsoft Corporation
+ * Copyright (c) 2026-present Eclipse ThreadX contributors
+ *
* This program and the accompanying materials are made available under the
* terms of the MIT License which is available at
* https://opensource.org/licenses/MIT.
- *
+ *
* SPDX-License-Identifier: MIT
**************************************************************************/
/**************************************************************************/
/**************************************************************************/
-/** */
-/** USBX Component */
+/** */
+/** USBX Component */
/** */
/** Host Sierra Wireless AR module class */
/** */
@@ -29,64 +30,56 @@
#include "ux_host_stack.h"
-/**************************************************************************/
-/* */
-/* FUNCTION RELEASE */
-/* */
-/* _ux_host_class_swar_reception_start PORTABLE C */
+/**************************************************************************/
+/* */
+/* FUNCTION RELEASE */
+/* */
+/* _ux_host_class_swar_reception_start PORTABLE C */
/* 6.1 */
/* AUTHOR */
/* */
/* Chaoqiong Xiao, Microsoft Corporation */
/* */
/* DESCRIPTION */
-/* */
-/* This function starts a reception with the Sierra modem. This way */
-/* allows for non blocking calls based on a packet orientated round */
+/* */
+/* This function starts a reception with the Sierra modem. This way */
+/* allows for non blocking calls based on a packet orientated round */
/* robbin buffer. When a packet is fully or partially received, an */
/* application callback function is invoked and a new transfer request */
/* is rescheduled. */
/* */
-/* INPUT */
-/* */
-/* swar Pointer to swar class */
+/* INPUT */
+/* */
+/* swar Pointer to swar class */
/* swar_reception Pointer to reception struct */
-/* */
-/* OUTPUT */
-/* */
-/* Completion Status */
-/* */
-/* CALLS */
-/* */
-/* _ux_host_stack_class_instance_verify Verify the class instance */
-/* _ux_host_stack_transfer_request Process transfer request */
-/* */
-/* 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), */
-/* resulting in version 6.1 */
+/* */
+/* OUTPUT */
+/* */
+/* Completion Status */
+/* */
+/* CALLS */
+/* */
+/* _ux_host_stack_class_instance_verify Verify the class instance */
+/* _ux_host_stack_transfer_request Process transfer request */
+/* */
+/* CALLED BY */
+/* */
+/* Application */
/* */
/**************************************************************************/
-UINT _ux_host_class_swar_reception_start (UX_HOST_CLASS_SWAR *swar,
+UINT _ux_host_class_swar_reception_start (UX_HOST_CLASS_SWAR *swar,
UX_HOST_CLASS_SWAR_RECEPTION *swar_reception)
{
UX_TRANSFER *transfer_request;
UINT status;
-
+
/* If trace is enabled, insert this event into the trace buffer. */
UX_TRACE_IN_LINE_INSERT(UX_TRACE_HOST_CLASS_SWAR_RECEPTION_START, swar, 0, 0, 0, UX_TRACE_HOST_CLASS_EVENTS, 0, 0)
/* Ensure the instance is valid. */
if (_ux_host_stack_class_instance_verify(_ux_system_host_class_swar_name, (VOID *) swar) != UX_SUCCESS)
- {
+ {
/* Error trap. */
_ux_system_error_handler(UX_SYSTEM_LEVEL_THREAD, UX_SYSTEM_CONTEXT_CLASS, UX_HOST_CLASS_INSTANCE_UNKNOWN);
@@ -103,19 +96,19 @@ UINT status;
/* Get the pointer to the bulk in endpoint in the transfer_request. */
transfer_request = &swar -> ux_host_class_swar_bulk_in_endpoint -> ux_endpoint_transfer_request;
-
+
/* Initialize the transfer request. */
transfer_request -> ux_transfer_request_class_instance = (VOID *) swar;
transfer_request -> ux_transfer_request_data_pointer = swar_reception -> ux_host_class_swar_reception_data_head;
transfer_request -> ux_transfer_request_requested_length = swar_reception -> ux_host_class_swar_reception_block_size;
transfer_request -> ux_transfer_request_completion_function = _ux_host_class_swar_reception_callback;
-
+
/* Save the acm reception structure in the acm structure. */
swar -> ux_host_class_swar_reception = swar_reception;
-
+
/* And declare we have a transfer in progress. */
swar_reception -> ux_host_class_swar_reception_state = UX_HOST_CLASS_SWAR_RECEPTION_STATE_STARTED;
-
+
/* Arm a first transfer on the bulk in endpoint. There is a callback to this function so we return to the caller
right away. */
status = _ux_host_stack_transfer_request(transfer_request);
@@ -124,8 +117,8 @@ UINT status;
in progress flag. */
if (status != UX_SUCCESS)
swar_reception -> ux_host_class_swar_reception_state = UX_HOST_CLASS_SWAR_RECEPTION_STATE_STOPPED;
-
- return(status);
+
+ return(status);
}
@@ -161,14 +154,8 @@ UINT status;
/* */
/* Application */
/* */
-/* RELEASE HISTORY */
-/* */
-/* DATE NAME DESCRIPTION */
-/* */
-/* 10-31-2023 Chaoqiong Xiao Initial Version 6.3.0 */
-/* */
/**************************************************************************/
-UINT _uxe_host_class_swar_reception_start (UX_HOST_CLASS_SWAR *swar,
+UINT _uxe_host_class_swar_reception_start (UX_HOST_CLASS_SWAR *swar,
UX_HOST_CLASS_SWAR_RECEPTION *swar_reception)
{
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 5d896321..549350f9 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
@@ -1,18 +1,19 @@
/***************************************************************************
- * Copyright (c) 2024 Microsoft Corporation
- *
+ * Copyright (c) 2024 Microsoft Corporation
+ * Copyright (c) 2026-present Eclipse ThreadX contributors
+ *
* This program and the accompanying materials are made available under the
* terms of the MIT License which is available at
* https://opensource.org/licenses/MIT.
- *
+ *
* SPDX-License-Identifier: MIT
**************************************************************************/
/**************************************************************************/
/**************************************************************************/
-/** */
-/** USBX Component */
+/** */
+/** USBX Component */
/** */
/** Host Sierra Wireless AR module class */
/** */
@@ -29,53 +30,45 @@
#include "ux_host_stack.h"
-/**************************************************************************/
-/* */
-/* FUNCTION RELEASE */
-/* */
-/* _ux_host_class_swar_reception_stop PORTABLE C */
+/**************************************************************************/
+/* */
+/* FUNCTION RELEASE */
+/* */
+/* _ux_host_class_swar_reception_stop PORTABLE C */
/* 6.1 */
/* AUTHOR */
/* */
/* Chaoqiong Xiao, Microsoft Corporation */
/* */
/* DESCRIPTION */
-/* */
-/* This function starts a reception with the Sierra modem. This way */
-/* allows for non blocking calls based on a packet orientated round */
+/* */
+/* This function starts a reception with the Sierra modem. This way */
+/* allows for non blocking calls based on a packet orientated round */
/* robbin buffer. When a packet is fully or partially received, an */
/* application callback function is invoked and a new transfer request */
/* is rescheduled. */
/* */
-/* INPUT */
-/* */
-/* swar Pointer to swar class */
+/* INPUT */
+/* */
+/* swar Pointer to swar class */
/* swar_reception Pointer to reception struct */
-/* */
-/* OUTPUT */
-/* */
-/* Completion Status */
-/* */
-/* CALLS */
-/* */
-/* _ux_host_stack_class_instance_verify Verify the class instance */
+/* */
+/* OUTPUT */
+/* */
+/* Completion Status */
+/* */
+/* CALLS */
+/* */
+/* _ux_host_stack_class_instance_verify Verify the class instance */
/* _ux_host_stack_endpoint_transfer_abort */
/* Abort transfer */
-/* */
-/* 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), */
-/* resulting in version 6.1 */
+/* */
+/* CALLED BY */
+/* */
+/* Application */
/* */
/**************************************************************************/
-UINT _ux_host_class_swar_reception_stop (UX_HOST_CLASS_SWAR *swar,
+UINT _ux_host_class_swar_reception_stop (UX_HOST_CLASS_SWAR *swar,
UX_HOST_CLASS_SWAR_RECEPTION *swar_reception)
{
@@ -84,7 +77,7 @@ UINT _ux_host_class_swar_reception_stop (UX_HOST_CLASS_SWAR *swar,
/* Ensure the instance is valid. */
if (_ux_host_stack_class_instance_verify(_ux_system_host_class_swar_name, (VOID *) swar) != UX_SUCCESS)
- {
+ {
/* Error trap. */
_ux_system_error_handler(UX_SYSTEM_LEVEL_THREAD, UX_SYSTEM_CONTEXT_CLASS, UX_HOST_CLASS_INSTANCE_UNKNOWN);
@@ -98,7 +91,7 @@ UINT _ux_host_class_swar_reception_stop (UX_HOST_CLASS_SWAR *swar,
/* Check if we do have transfers for this application. If none, nothing to do. */
if (swar_reception -> ux_host_class_swar_reception_state == UX_HOST_CLASS_SWAR_RECEPTION_STATE_STOPPED)
return(UX_SUCCESS);
-
+
/* We need to abort transactions on the bulk In pipe. */
_ux_host_stack_endpoint_transfer_abort(swar -> ux_host_class_swar_bulk_in_endpoint);
@@ -141,14 +134,8 @@ UINT _ux_host_class_swar_reception_stop (UX_HOST_CLASS_SWAR *swar,
/* */
/* Application */
/* */
-/* RELEASE HISTORY */
-/* */
-/* DATE NAME DESCRIPTION */
-/* */
-/* 10-31-2023 Chaoqiong Xiao Initial Version 6.3.0 */
-/* */
/**************************************************************************/
-UINT _uxe_host_class_swar_reception_stop (UX_HOST_CLASS_SWAR *swar,
+UINT _uxe_host_class_swar_reception_stop (UX_HOST_CLASS_SWAR *swar,
UX_HOST_CLASS_SWAR_RECEPTION *swar_reception)
{
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 bff6121a..32595764 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
@@ -1,18 +1,19 @@
/***************************************************************************
- * Copyright (c) 2024 Microsoft Corporation
- *
+ * Copyright (c) 2024 Microsoft Corporation
+ * Copyright (c) 2026-present Eclipse ThreadX contributors
+ *
* This program and the accompanying materials are made available under the
* terms of the MIT License which is available at
* https://opensource.org/licenses/MIT.
- *
+ *
* SPDX-License-Identifier: MIT
**************************************************************************/
/**************************************************************************/
/**************************************************************************/
-/** */
-/** USBX Component */
+/** */
+/** USBX Component */
/** */
/** Host Sierra Wireless AR module class */
/** */
@@ -29,74 +30,60 @@
#include "ux_host_stack.h"
-/**************************************************************************/
-/* */
-/* FUNCTION RELEASE */
-/* */
-/* _ux_host_class_swar_write PORTABLE C */
+/**************************************************************************/
+/* */
+/* FUNCTION RELEASE */
+/* */
+/* _ux_host_class_swar_write PORTABLE C */
/* 6.1.11 */
/* AUTHOR */
/* */
/* Chaoqiong Xiao, Microsoft Corporation */
/* */
/* DESCRIPTION */
-/* */
-/* This function writes to the swar interface. The call is blocking */
-/* and only returns when there is either an error or when the transfer */
-/* is complete. */
-/* */
-/* INPUT */
-/* */
-/* swar Pointer to swar class */
-/* data_pointer Pointer to data to write */
-/* requested_length Length of data to write */
-/* actual_length Actual length of data written */
-/* */
-/* OUTPUT */
-/* */
-/* Completion Status */
-/* */
-/* CALLS */
-/* */
-/* _ux_host_stack_class_instance_verify Verify the class instance */
-/* _ux_host_stack_transfer_request Process transfer request */
-/* _ux_host_stack_transfer_request_abort Abort transfer request */
-/* _ux_host_semaphore_get Get protection semaphore */
-/* _ux_host_semaphore_put Release protection semaphore */
-/* */
-/* 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), */
-/* resulting in version 6.1 */
-/* 01-31-2022 Chaoqiong Xiao Modified comment(s), */
-/* refined macros names, */
-/* resulting in version 6.1.10 */
-/* 04-25-2022 Chaoqiong Xiao Modified comment(s), */
-/* fixed standalone compile, */
-/* resulting in version 6.1.11 */
+/* */
+/* This function writes to the swar interface. The call is blocking */
+/* and only returns when there is either an error or when the transfer */
+/* is complete. */
+/* */
+/* INPUT */
+/* */
+/* swar Pointer to swar class */
+/* data_pointer Pointer to data to write */
+/* requested_length Length of data to write */
+/* actual_length Actual length of data written */
+/* */
+/* OUTPUT */
+/* */
+/* Completion Status */
+/* */
+/* CALLS */
+/* */
+/* _ux_host_stack_class_instance_verify Verify the class instance */
+/* _ux_host_stack_transfer_request Process transfer request */
+/* _ux_host_stack_transfer_request_abort Abort transfer request */
+/* _ux_host_semaphore_get Get protection semaphore */
+/* _ux_host_semaphore_put Release protection semaphore */
+/* */
+/* CALLED BY */
+/* */
+/* Application */
/* */
/**************************************************************************/
-UINT _ux_host_class_swar_write(UX_HOST_CLASS_SWAR *swar, UCHAR * data_pointer,
+UINT _ux_host_class_swar_write(UX_HOST_CLASS_SWAR *swar, UCHAR * data_pointer,
ULONG requested_length, ULONG *actual_length)
{
UX_TRANSFER *transfer_request;
UINT status;
ULONG transfer_request_length;
-
+
/* If trace is enabled, insert this event into the trace buffer. */
UX_TRACE_IN_LINE_INSERT(UX_TRACE_HOST_CLASS_SWAR_WRITE, swar, data_pointer, requested_length, 0, UX_TRACE_HOST_CLASS_EVENTS, 0, 0)
-
+
/* Ensure the instance is valid. */
if(_ux_host_stack_class_instance_verify((UCHAR *) _ux_system_host_class_swar_name, (VOID *) swar) != UX_SUCCESS)
- {
+ {
/* Error trap. */
_ux_system_error_handler(UX_SYSTEM_LEVEL_THREAD, UX_SYSTEM_CONTEXT_CLASS, UX_HOST_CLASS_INSTANCE_UNKNOWN);
@@ -117,7 +104,7 @@ ULONG transfer_request_length;
/* Get the pointer to the bulk out endpoint transfer request. */
transfer_request = &swar -> ux_host_class_swar_bulk_out_endpoint -> ux_endpoint_transfer_request;
-
+
/* Perform a transfer on the bulk out endpoint until either the transfer is
completed or when there is an error. */
do
@@ -128,18 +115,18 @@ ULONG transfer_request_length;
transfer_request_length = transfer_request -> ux_transfer_request_maximum_length;
else
transfer_request_length = requested_length;
-
+
/* Initialize the transfer_request. */
transfer_request -> ux_transfer_request_data_pointer = data_pointer;
transfer_request -> ux_transfer_request_requested_length = transfer_request_length;
-
+
/* Perform the transfer. */
status = _ux_host_stack_transfer_request(transfer_request);
/* If the transfer is successful, we need to wait for the transfer request to be completed. */
if (status == UX_SUCCESS)
{
-
+
/* Wait for the completion of the transfer request. */
status = _ux_host_semaphore_get(&transfer_request -> ux_transfer_request_semaphore, UX_HOST_CLASS_SWAR_CLASS_TRANSFER_TIMEOUT);
@@ -149,26 +136,26 @@ ULONG transfer_request_length;
/* All transfers pending need to abort. There may have been a partial transfer. */
_ux_host_stack_transfer_request_abort(transfer_request);
-
- /* Update the length of the actual data transferred. We do this after the
+
+ /* Update the length of the actual data transferred. We do this after the
abort of the transfer_request in case some data actually went out. */
*actual_length += transfer_request -> ux_transfer_request_actual_length;
-
+
/* Unprotect thread reentry to this instance. */
_ux_host_semaphore_put(&swar -> ux_host_class_swar_semaphore);
/* Set the completion code. */
transfer_request -> ux_transfer_request_completion_code = UX_TRANSFER_TIMEOUT;
-
+
/* Error trap. */
_ux_system_error_handler(UX_SYSTEM_LEVEL_THREAD, UX_SYSTEM_CONTEXT_CLASS, UX_TRANSFER_TIMEOUT);
/* If trace is enabled, insert this event into the trace buffer. */
UX_TRACE_IN_LINE_INSERT(UX_TRACE_ERROR, UX_TRANSFER_TIMEOUT, transfer_request, 0, 0, UX_TRACE_ERRORS, 0, 0)
-
+
/* There was an error, return to the caller. */
return(UX_TRANSFER_TIMEOUT);
- }
+ }
}
else
{
@@ -182,7 +169,7 @@ ULONG transfer_request_length;
/* Update the length of the transfer. Normally all the data has to be sent. */
*actual_length += transfer_request -> ux_transfer_request_actual_length;
-
+
/* Check for completion of transfer. If the transfer is partial, return to caller.
The transfer is marked as successful but the caller will need to check the length
actually sent and determine if a partial transfer is OK. */
@@ -196,20 +183,20 @@ ULONG transfer_request_length;
return(UX_SUCCESS);
}
- /* Update the data pointer for next transfer. */
+ /* Update the data pointer for next transfer. */
data_pointer += transfer_request_length;
-
+
/* Update what is left to send out. */
- requested_length -= transfer_request_length;
+ requested_length -= transfer_request_length;
} while (requested_length != 0);
-
+
/* Unprotect thread reentry to this instance. */
_ux_host_semaphore_put(&swar -> ux_host_class_swar_semaphore);
/* We get here when all the transfers went through without errors. */
- return(UX_SUCCESS);
+ return(UX_SUCCESS);
}
@@ -246,14 +233,8 @@ ULONG transfer_request_length;
/* */
/* Application */
/* */
-/* RELEASE HISTORY */
-/* */
-/* DATE NAME DESCRIPTION */
-/* */
-/* 10-31-2023 Chaoqiong Xiao Initial Version 6.3.0 */
-/* */
/**************************************************************************/
-UINT _uxe_host_class_swar_write(UX_HOST_CLASS_SWAR *swar, UCHAR *data_pointer,
+UINT _uxe_host_class_swar_write(UX_HOST_CLASS_SWAR *swar, UCHAR *data_pointer,
ULONG requested_length, ULONG *actual_length)
{
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 ad0cd7b6..989e0c0c 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
@@ -1,18 +1,19 @@
/***************************************************************************
- * Copyright (c) 2024 Microsoft Corporation
- *
+ * Copyright (c) 2024 Microsoft Corporation
+ * Copyright (c) 2026-present Eclipse ThreadX contributors
+ *
* This program and the accompanying materials are made available under the
* terms of the MIT License which is available at
* https://opensource.org/licenses/MIT.
- *
+ *
* SPDX-License-Identifier: MIT
**************************************************************************/
/**************************************************************************/
/**************************************************************************/
-/** */
-/** USBX Component */
+/** */
+/** USBX Component */
/** */
/** Video Class */
/** */
@@ -52,7 +53,7 @@ typedef struct UX_HOST_CLASS_VIDEO_DESCRIPTORS_PARSER_STRUCT
static UINT _ux_host_class_video_descriptors_parser(VOID *arg,
UCHAR *packed_interface_descriptor,
- UCHAR *packed_entity_descriptor)
+ UCHAR *packed_entity_descriptor)
{
UX_HOST_CLASS_VIDEO_DESCRIPTORS_PARSER *parser;
@@ -164,72 +165,47 @@ UCHAR *baInterfaceNr;
}
-/**************************************************************************/
-/* */
-/* FUNCTION RELEASE */
-/* */
-/* _ux_host_class_video_activate PORTABLE C */
+/**************************************************************************/
+/* */
+/* FUNCTION RELEASE */
+/* */
+/* _ux_host_class_video_activate PORTABLE C */
/* 6.2.0 */
/* AUTHOR */
/* */
/* Chaoqiong Xiao, Microsoft Corporation */
/* */
/* DESCRIPTION */
-/* */
+/* */
/* This function activates the video class. It may be called twice by */
-/* the same device if there is a video control interface to this */
-/* device. */
-/* */
-/* INPUT */
-/* */
-/* command Pointer to command */
-/* */
-/* OUTPUT */
-/* */
-/* Completion Status */
-/* */
-/* CALLS */
-/* */
-/* _ux_host_class_video_configure Configure the video class */
-/* _ux_host_class_video_descriptor_get Get video descriptor */
+/* the same device if there is a video control interface to this */
+/* device. */
+/* */
+/* INPUT */
+/* */
+/* command Pointer to command */
+/* */
+/* OUTPUT */
+/* */
+/* Completion Status */
+/* */
+/* CALLS */
+/* */
+/* _ux_host_class_video_configure Configure the video class */
+/* _ux_host_class_video_descriptor_get Get video descriptor */
/* _ux_host_class_video_input_terminal_get */
/* Get input terminal */
/* _ux_host_class_video_input_format_get Get input format */
/* _ux_host_class_video_control_list_get Get controls */
-/* _ux_host_stack_class_instance_create Create class instance */
-/* _ux_host_stack_class_instance_destroy Destroy class instance */
-/* _ux_utility_memory_allocate Allocate a memory block */
-/* _ux_utility_memory_free Free a memory block */
-/* _ux_host_semaphore_create Create protection semaphore */
-/* */
-/* CALLED BY */
-/* */
-/* Video Class */
-/* */
-/* RELEASE HISTORY */
-/* */
-/* DATE NAME DESCRIPTION */
-/* */
-/* 05-19-2020 Chaoqiong Xiao Initial Version 6.0 */
-/* 09-30-2020 Chaoqiong Xiao Modified comment(s), */
-/* used entities parsing API, */
-/* created new semaphore to */
-/* protect control requests, */
-/* resulting in version 6.1 */
-/* 01-31-2022 Chaoqiong Xiao Modified comment(s), */
-/* refined macros names, */
-/* resulting in version 6.1.10 */
-/* 04-25-2022 Chaoqiong Xiao Modified comment(s), */
-/* internal clean up, */
-/* fixed standalone compile, */
-/* resulting in version 6.1.11 */
-/* 07-29-2022 Chaoqiong Xiao Modified comment(s), */
-/* fixed parameter/variable */
-/* names conflict C++ keyword, */
-/* resulting in version 6.1.12 */
-/* 10-31-2022 Chaoqiong Xiao Modified comment(s), */
-/* improved VC header check, */
-/* resulting in version 6.2.0 */
+/* _ux_host_stack_class_instance_create Create class instance */
+/* _ux_host_stack_class_instance_destroy Destroy class instance */
+/* _ux_utility_memory_allocate Allocate a memory block */
+/* _ux_utility_memory_free Free a memory block */
+/* _ux_host_semaphore_create Create protection semaphore */
+/* */
+/* CALLED BY */
+/* */
+/* Video Class */
/* */
/**************************************************************************/
UINT _ux_host_class_video_activate(UX_HOST_CLASS_COMMAND *command)
@@ -250,7 +226,7 @@ UX_HOST_CLASS_VIDEO_DESCRIPTORS_PARSER parser;
we will search the video control interface for the device. */
if (interface_ptr -> ux_interface_descriptor.bInterfaceSubClass == UX_HOST_CLASS_VIDEO_SUBCLASS_CONTROL)
return(UX_SUCCESS);
-
+
/* Obtain memory for this class instance. */
video = (UX_HOST_CLASS_VIDEO *) _ux_utility_memory_allocate(UX_NO_ALIGN, UX_REGULAR_MEMORY, sizeof(UX_HOST_CLASS_VIDEO));
if (video == UX_NULL)
@@ -270,9 +246,9 @@ UX_HOST_CLASS_VIDEO_DESCRIPTORS_PARSER parser;
/* Create this class instance. */
_ux_host_stack_class_instance_create(video -> ux_host_class_video_class, (VOID *) video);
-
+
/* Configure the video. */
- status = _ux_host_class_video_configure(video);
+ status = _ux_host_class_video_configure(video);
/* Get the video descriptor (all the class specific stuff) and memorize them
as we will need these descriptors to change settings. */
@@ -321,7 +297,7 @@ UX_HOST_CLASS_VIDEO_DESCRIPTORS_PARSER parser;
if a function has been programmed in the system structure. */
if (_ux_system_host -> ux_system_host_change_function != UX_NULL)
{
-
+
/* Call system change function. */
_ux_system_host -> ux_system_host_change_function(UX_DEVICE_INSERTION, video -> ux_host_class_video_class, (VOID *) video);
}
@@ -355,6 +331,6 @@ UX_HOST_CLASS_VIDEO_DESCRIPTORS_PARSER parser;
_ux_utility_memory_free(video);
/* Return completion status. */
- return(status);
+ return(status);
}
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 035041dd..df0d26d8 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
@@ -1,18 +1,19 @@
/***************************************************************************
- * Copyright (c) 2024 Microsoft Corporation
- *
+ * Copyright (c) 2024 Microsoft Corporation
+ * Copyright (c) 2026-present Eclipse ThreadX contributors
+ *
* This program and the accompanying materials are made available under the
* terms of the MIT License which is available at
* https://opensource.org/licenses/MIT.
- *
+ *
* SPDX-License-Identifier: MIT
**************************************************************************/
/**************************************************************************/
/**************************************************************************/
-/** */
-/** USBX Component */
+/** */
+/** USBX Component */
/** */
/** Video Class */
/** */
@@ -29,53 +30,37 @@
#include "ux_host_stack.h"
-/**************************************************************************/
-/* */
-/* FUNCTION RELEASE */
-/* */
-/* _ux_host_class_video_alternate_setting_locate PORTABLE C */
+/**************************************************************************/
+/* */
+/* FUNCTION RELEASE */
+/* */
+/* _ux_host_class_video_alternate_setting_locate PORTABLE C */
/* 6.1.12 */
/* AUTHOR */
/* */
/* Chaoqiong Xiao, Microsoft Corporation */
/* */
/* DESCRIPTION */
-/* */
-/* This function finds the alternate setting for the specific format. */
-/* */
-/* INPUT */
-/* */
-/* video Pointer to video class */
-/* alternate_setting Pointer to located alternate */
-/* setting */
-/* */
-/* OUTPUT */
-/* */
-/* Completion Status */
-/* */
-/* CALLS */
-/* */
-/* _ux_system_error_handler Log system error */
-/* */
-/* CALLED BY */
-/* */
-/* Video Class */
-/* */
-/* RELEASE HISTORY */
-/* */
-/* DATE NAME DESCRIPTION */
-/* */
-/* 05-19-2020 Chaoqiong Xiao Initial Version 6.0 */
-/* 09-30-2020 Chaoqiong Xiao Modified comment(s), */
-/* resulting in version 6.1 */
-/* 10-15-2021 Chaoqiong Xiao Modified comment(s), */
-/* use pre-calculated value */
-/* instead of wMaxPacketSize, */
-/* resulting in version 6.1.9 */
-/* 07-29-2022 Chaoqiong Xiao Modified comment(s), */
-/* fixed parameter/variable */
-/* names conflict C++ keyword, */
-/* resulting in version 6.1.12 */
+/* */
+/* This function finds the alternate setting for the specific format. */
+/* */
+/* INPUT */
+/* */
+/* video Pointer to video class */
+/* alternate_setting Pointer to located alternate */
+/* setting */
+/* */
+/* OUTPUT */
+/* */
+/* Completion Status */
+/* */
+/* CALLS */
+/* */
+/* _ux_system_error_handler Log system error */
+/* */
+/* CALLED BY */
+/* */
+/* Video Class */
/* */
/**************************************************************************/
UINT _ux_host_class_video_alternate_setting_locate(UX_HOST_CLASS_VIDEO *video, UINT max_payload_size, UINT *alternate_setting)
@@ -104,7 +89,7 @@ UINT alternate_setting_found;
if ((interface_ptr -> ux_interface_descriptor.bInterfaceNumber == streaming_interface) &&
(interface_ptr -> ux_interface_first_endpoint != 0))
{
-
+
/* Get the max packet size of the endpoint. */
endpoint = interface_ptr -> ux_interface_first_endpoint;
payload_size = endpoint -> ux_endpoint_transfer_request.ux_transfer_request_packet_length;
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 bd42a593..0c921f31 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
@@ -1,18 +1,19 @@
/***************************************************************************
- * Copyright (c) 2024 Microsoft Corporation
- *
+ * Copyright (c) 2024 Microsoft Corporation
+ * Copyright (c) 2026-present Eclipse ThreadX contributors
+ *
* This program and the accompanying materials are made available under the
* terms of the MIT License which is available at
* https://opensource.org/licenses/MIT.
- *
+ *
* SPDX-License-Identifier: MIT
**************************************************************************/
/**************************************************************************/
/**************************************************************************/
-/** */
-/** USBX Component */
+/** */
+/** USBX Component */
/** */
/** Video Class */
/** */
@@ -29,68 +30,46 @@
#include "ux_host_stack.h"
-/**************************************************************************/
-/* */
-/* FUNCTION RELEASE */
-/* */
-/* _ux_host_class_video_channel_start PORTABLE C */
+/**************************************************************************/
+/* */
+/* FUNCTION RELEASE */
+/* */
+/* _ux_host_class_video_channel_start PORTABLE C */
/* 6.1.12 */
/* AUTHOR */
/* */
/* Chaoqiong Xiao, Microsoft Corporation */
/* */
/* DESCRIPTION */
-/* */
-/* This function starts the video channel. */
-/* */
-/* INPUT */
-/* */
-/* video Pointer to video class */
-/* channel_parameter Pointer to video channel */
-/* */
-/* OUTPUT */
-/* */
-/* Completion Status */
-/* */
-/* CALLS */
-/* */
+/* */
+/* This function starts the video channel. */
+/* */
+/* INPUT */
+/* */
+/* video Pointer to video class */
+/* channel_parameter Pointer to video channel */
+/* */
+/* OUTPUT */
+/* */
+/* Completion Status */
+/* */
+/* CALLS */
+/* */
/* _ux_host_class_video_alternate_setting_locate */
/* Search alternate setting */
/* _ux_host_stack_interface_setting_select */
/* Select alternate setting */
/* _ux_host_stack_interface_endpoint_get Get interface endpoint */
-/* _ux_host_stack_transfer_request Process transfer request */
-/* _ux_host_semaphore_get Get semaphore */
-/* _ux_host_semaphore_put Release semaphore */
-/* _ux_utility_memory_allocate Allocate memory block */
-/* _ux_utility_memory_free Release memory block */
+/* _ux_host_stack_transfer_request Process transfer request */
+/* _ux_host_semaphore_get Get semaphore */
+/* _ux_host_semaphore_put Release semaphore */
+/* _ux_utility_memory_allocate Allocate memory block */
+/* _ux_utility_memory_free Release memory block */
/* _ux_utility_long_get Get 32-bit value */
-/* */
-/* CALLED BY */
-/* */
-/* Video Class */
-/* */
-/* RELEASE HISTORY */
-/* */
-/* DATE NAME DESCRIPTION */
-/* */
-/* 05-19-2020 Chaoqiong Xiao Initial Version 6.0 */
-/* 09-30-2020 Chaoqiong Xiao Modified comment(s), */
-/* resulting in version 6.1 */
-/* 10-15-2021 Chaoqiong Xiao Modified comment(s), */
-/* fixed bandwidth check, */
-/* saved max payload size, */
-/* resulting in version 6.1.9 */
-/* 01-31-2022 Chaoqiong Xiao Modified comment(s), */
-/* refined macros names, */
-/* resulting in version 6.1.10 */
-/* 04-25-2022 Chaoqiong Xiao Modified comment(s), */
-/* fixed standalone compile, */
-/* resulting in version 6.1.11 */
-/* 07-29-2022 Chaoqiong Xiao Modified comment(s), */
-/* fixed parameter/variable */
-/* names conflict C++ keyword, */
-/* resulting in version 6.1.12 */
+/* */
+/* CALLED BY */
+/* */
+/* Video Class */
/* */
/**************************************************************************/
UINT _ux_host_class_video_channel_start(UX_HOST_CLASS_VIDEO *video, UX_HOST_CLASS_VIDEO_PARAMETER_CHANNEL *video_parameter)
@@ -127,7 +106,7 @@ UINT max_payload_size;
/* Unprotect thread reentry to this instance. */
_ux_host_semaphore_put(&video -> ux_host_class_video_semaphore);
- /* Return error. */
+ /* Return error. */
return(UX_MEMORY_INSUFFICIENT);
}
@@ -150,12 +129,12 @@ UINT max_payload_size;
/* Send request to HCD layer. */
status = _ux_host_stack_transfer_request(transfer_request);
-
+
/* Check for correct transfer. Buffer may not be all what we asked for. */
if (status == UX_SUCCESS)
{
-
-
+
+
/* Create a transfer request for the SET_CUR_buffer request. */
transfer_request -> ux_transfer_request_data_pointer = control_buffer;
transfer_request -> ux_transfer_request_requested_length = UX_HOST_CLASS_VIDEO_PROBE_COMMIT_LENGTH;
@@ -163,14 +142,14 @@ UINT max_payload_size;
transfer_request -> ux_transfer_request_type = UX_REQUEST_IN | UX_REQUEST_TYPE_CLASS | UX_REQUEST_TARGET_INTERFACE;
transfer_request -> ux_transfer_request_value = UX_HOST_CLASS_VIDEO_VS_PROBE_CONTROL << 8;
transfer_request -> ux_transfer_request_index = streaming_interface;
-
+
/* Send request to HCD layer. */
status = _ux_host_stack_transfer_request(transfer_request);
-
+
/* Check for correct transfer. */
if (status == UX_SUCCESS)
{
-
+
/* We did the GET_CUR and SET_CUR for Probe Control. Now we can commit to the bandwidth. */
/* Create a transfer request for the SET_CUR_buffer request. */
transfer_request -> ux_transfer_request_data_pointer = control_buffer;
@@ -179,14 +158,14 @@ UINT max_payload_size;
transfer_request -> ux_transfer_request_type = UX_REQUEST_OUT | UX_REQUEST_TYPE_CLASS | UX_REQUEST_TARGET_INTERFACE;
transfer_request -> ux_transfer_request_value = UX_HOST_CLASS_VIDEO_VS_COMMIT_CONTROL << 8;
transfer_request -> ux_transfer_request_index = streaming_interface;
-
+
/* Send request to HCD layer. */
status = _ux_host_stack_transfer_request(transfer_request);
-
+
/* Check for correct transfer. */
if (status == UX_SUCCESS)
{
-
+
/* Check if user has request specific bandwidth selection. */
if (video_parameter -> ux_host_class_video_parameter_channel_bandwidth_selection == 0)
{
@@ -208,69 +187,69 @@ UINT max_payload_size;
{
/* Now the Commit has been done, the alternate setting can be requested. */
- /* We found the alternate setting for the sampling values demanded, now we need
+ /* We found the alternate setting for the sampling values demanded, now we need
to search its container. */
configuration = video -> ux_host_class_video_streaming_interface -> ux_interface_configuration;
- interface_ptr = configuration -> ux_configuration_first_interface;
+ interface_ptr = configuration -> ux_configuration_first_interface;
/* Scan all interfaces. */
- while (interface_ptr != UX_NULL)
+ while (interface_ptr != UX_NULL)
{
-
+
/* We search for both the right interface and alternate setting. */
if ((interface_ptr -> ux_interface_descriptor.bInterfaceNumber == streaming_interface) &&
(interface_ptr -> ux_interface_descriptor.bAlternateSetting == alternate_setting))
{
-
- /* We have found the right interface/alternate setting combination
+
+ /* We have found the right interface/alternate setting combination
The stack will select it for us. */
status = _ux_host_stack_interface_setting_select(interface_ptr);
-
+
/* If the alternate setting for the streaming interface could be selected, we memorize it. */
if (status == UX_SUCCESS)
{
-
+
/* Memorize the interface. */
video -> ux_host_class_video_streaming_interface = interface_ptr;
-
+
/* We need to research the isoch endpoint now. */
for (endpoint_index = 0; endpoint_index < interface_ptr -> ux_interface_descriptor.bNumEndpoints; endpoint_index++)
- {
-
+ {
+
/* Get the list of endpoints one by one. */
status = _ux_host_stack_interface_endpoint_get(video -> ux_host_class_video_streaming_interface,
endpoint_index, &endpoint);
-
+
/* Check completion status. */
if (status == UX_SUCCESS)
{
-
+
/* Check if endpoint is ISOCH, regardless of the direction. */
if ((endpoint -> ux_endpoint_descriptor.bmAttributes & UX_MASK_ENDPOINT_TYPE) == UX_ISOCHRONOUS_ENDPOINT)
{
-
+
/* We have found the isoch endpoint, save it. */
video -> ux_host_class_video_isochronous_endpoint = endpoint;
-
+
/* Save the max payload size.
It's not exceeding endpoint bandwidth since the interface alternate
setting is located by max payload size. */
video -> ux_host_class_video_current_max_payload_size = max_payload_size;
-
+
/* Free all used resources. */
_ux_utility_memory_free(control_buffer);
/* Unprotect thread reentry to this instance. */
_ux_host_semaphore_put(&video -> ux_host_class_video_semaphore);
-
+
/* Return successful completion. */
- return(UX_SUCCESS);
+ return(UX_SUCCESS);
}
- }
- }
+ }
+ }
}
}
-
+
/* Move to next interface. */
interface_ptr = interface_ptr -> ux_interface_next_interface;
}
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 7f5b7fd8..5e750f46 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
@@ -1,18 +1,19 @@
/***************************************************************************
- * Copyright (c) 2024 Microsoft Corporation
- *
+ * Copyright (c) 2024 Microsoft Corporation
+ * Copyright (c) 2026-present Eclipse ThreadX contributors
+ *
* This program and the accompanying materials are made available under the
* terms of the MIT License which is available at
* https://opensource.org/licenses/MIT.
- *
+ *
* SPDX-License-Identifier: MIT
**************************************************************************/
/**************************************************************************/
/**************************************************************************/
-/** */
-/** USBX Component */
+/** */
+/** USBX Component */
/** */
/** Video Class */
/** */
@@ -29,56 +30,43 @@
#include "ux_host_stack.h"
-/**************************************************************************/
-/* */
-/* FUNCTION RELEASE */
-/* */
-/* _ux_host_class_video_configure PORTABLE C */
+/**************************************************************************/
+/* */
+/* FUNCTION RELEASE */
+/* */
+/* _ux_host_class_video_configure PORTABLE C */
/* 6.1.11 */
/* AUTHOR */
/* */
/* Chaoqiong Xiao, Microsoft Corporation */
/* */
/* DESCRIPTION */
-/* */
+/* */
/* This function calls the USBX stack to do a SET_CONFIGURATION to */
/* the device. Once the device is configured, its interface(s) will */
-/* be activated. */
-/* */
-/* INPUT */
-/* */
-/* video Pointer to video class */
-/* */
-/* OUTPUT */
-/* */
-/* Completion Status */
-/* */
-/* CALLS */
-/* */
+/* be activated. */
+/* */
+/* INPUT */
+/* */
+/* video Pointer to video class */
+/* */
+/* OUTPUT */
+/* */
+/* Completion Status */
+/* */
+/* CALLS */
+/* */
/* _ux_host_stack_configuration_interface_get */
-/* Get interface */
+/* Get interface */
/* _ux_host_stack_device_configuration_get */
-/* Get configuration */
+/* Get configuration */
/* _ux_host_stack_device_configuration_select */
-/* Select configuration */
+/* Select configuration */
/* _ux_system_error_handler Log system error */
-/* */
-/* CALLED BY */
-/* */
-/* Video Class */
-/* */
-/* RELEASE HISTORY */
-/* */
-/* DATE NAME DESCRIPTION */
-/* */
-/* 05-19-2020 Chaoqiong Xiao Initial Version 6.0 */
-/* 09-30-2020 Chaoqiong Xiao Modified comment(s), */
-/* optimized based on compile */
-/* definitions, */
-/* resulting in version 6.1 */
-/* 04-25-2022 Chaoqiong Xiao Modified comment(s), */
-/* internal clean up, */
-/* resulting in version 6.1.11 */
+/* */
+/* CALLED BY */
+/* */
+/* Video Class */
/* */
/**************************************************************************/
UINT _ux_host_class_video_configure(UX_HOST_CLASS_VIDEO *video)
@@ -109,24 +97,24 @@ UX_DEVICE *parent_device;
/* If trace is enabled, insert this event into the trace buffer. */
UX_TRACE_IN_LINE_INSERT(UX_TRACE_ERROR, UX_CONFIGURATION_HANDLE_UNKNOWN, video -> ux_host_class_video_device, 0, 0, UX_TRACE_ERRORS, 0, 0)
-
+
return(UX_CONFIGURATION_HANDLE_UNKNOWN);
-
+
}
#if UX_MAX_DEVICES > 1
- /* Check the video power source and check the parent power source for
+ /* 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)
{
/* Get parent device. */
parent_device = video -> ux_host_class_video_device -> ux_device_parent;
-
- /* If the device is NULL, the parent is the root video and we don't have to worry
+
+ /* If the device is NULL, the parent is the root video and we don't have to worry
if the parent is not the root video, check for its power source. */
if ((parent_device != UX_NULL) && (parent_device -> ux_device_power_source == UX_DEVICE_BUS_POWERED))
- {
+ {
/* Error trap. */
_ux_system_error_handler(UX_SYSTEM_LEVEL_THREAD, UX_SYSTEM_CONTEXT_CLASS, UX_CONNECTION_INCOMPATIBLE);
@@ -135,11 +123,11 @@ UX_DEVICE *parent_device;
//UX_TRACE_IN_LINE_INSERT(UX_TRACE_ERROR, UX_CONNECTION_INCOMPATIBLE, video, 0, 0, UX_TRACE_ERRORS, 0, 0)
return(UX_CONNECTION_INCOMPATIBLE);
- }
+ }
}
#endif
- /* We have the valid configuration. Ask the USBX stack to set this configuration */
+ /* 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)
return(status);
@@ -148,7 +136,7 @@ UX_DEVICE *parent_device;
interface_number = 0;
/* We only need to retrieve the video streaming interface. */
- do
+ do
{
/* Pickup interface. */
@@ -161,7 +149,7 @@ UX_DEVICE *parent_device;
/* Check the type of interface we have found - is it streaming? */
if (interface -> ux_interface_descriptor.bInterfaceSubClass == UX_HOST_CLASS_VIDEO_SUBCLASS_STREAMING)
{
-
+
video -> ux_host_class_video_streaming_interface = interface;
video -> ux_host_class_video_streaming_interface -> ux_interface_class_instance = (VOID *)video;
break;
@@ -186,7 +174,7 @@ UX_DEVICE *parent_device;
return(UX_INTERFACE_HANDLE_UNKNOWN);
}
- return(UX_SUCCESS);
+ return(UX_SUCCESS);
}
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 b245cec3..023a4716 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
@@ -1,10 +1,11 @@
/***************************************************************************
- * Copyright (c) 2024 Microsoft Corporation
- *
+ * Copyright (c) 2024 Microsoft Corporation
+ * Copyright (c) 2026-present Eclipse ThreadX contributors
+ *
* This program and the accompanying materials are made available under the
* terms of the MIT License which is available at
* https://opensource.org/licenses/MIT.
- *
+ *
* SPDX-License-Identifier: MIT
**************************************************************************/
@@ -68,20 +69,6 @@
/* Application */
/* Video Class */
/* */
-/* RELEASE HISTORY */
-/* */
-/* DATE NAME DESCRIPTION */
-/* */
-/* 05-19-2020 Chaoqiong Xiao Initial Version 6.0 */
-/* 09-30-2020 Chaoqiong Xiao Modified comment(s), */
-/* resulting in version 6.1 */
-/* 01-31-2022 Chaoqiong Xiao Modified comment(s), */
-/* refined macros names, */
-/* resulting in version 6.1.10 */
-/* 04-25-2022 Chaoqiong Xiao Modified comment(s), */
-/* fixed standalone compile, */
-/* resulting in version 6.1.11 */
-/* */
/**************************************************************************/
UINT _ux_host_class_video_control_get(UX_HOST_CLASS_VIDEO *video, UX_HOST_CLASS_VIDEO_CONTROL *video_control)
{
@@ -249,12 +236,6 @@ UCHAR * control_buffer;
/* Application */
/* Video Class */
/* */
-/* RELEASE HISTORY */
-/* */
-/* DATE NAME DESCRIPTION */
-/* */
-/* 10-31-2023 Yajun xia Initial Version 6.3.0 */
-/* */
/**************************************************************************/
UINT _uxe_host_class_video_control_get(UX_HOST_CLASS_VIDEO *video, UX_HOST_CLASS_VIDEO_CONTROL *video_control)
{
diff --git a/common/usbx_host_classes/src/ux_host_class_video_control_list_get.c b/common/usbx_host_classes/src/ux_host_class_video_control_list_get.c
index bf4ab59e..11bf4fd1 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
@@ -1,18 +1,19 @@
/***************************************************************************
- * Copyright (c) 2024 Microsoft Corporation
- *
+ * Copyright (c) 2024 Microsoft Corporation
+ * Copyright (c) 2026-present Eclipse ThreadX contributors
+ *
* This program and the accompanying materials are made available under the
* terms of the MIT License which is available at
* https://opensource.org/licenses/MIT.
- *
+ *
* SPDX-License-Identifier: MIT
**************************************************************************/
/**************************************************************************/
/**************************************************************************/
-/** */
-/** USBX Component */
+/** */
+/** USBX Component */
/** */
/** Video Class */
/** */
@@ -29,10 +30,10 @@
#include "ux_host_stack.h"
-/**************************************************************************/
-/* */
-/* FUNCTION RELEASE */
-/* */
+/**************************************************************************/
+/* */
+/* FUNCTION RELEASE */
+/* */
/* _ux_host_class_video_control_list_get PORTABLE C */
/* 6.1 */
/* AUTHOR */
@@ -40,33 +41,25 @@
/* Chaoqiong Xiao, Microsoft Corporation */
/* */
/* DESCRIPTION */
-/* */
+/* */
/* This function obtains the controls for the video device. */
-/* */
-/* INPUT */
-/* */
-/* video Pointer to video class */
-/* */
-/* OUTPUT */
-/* */
-/* Completion Status */
-/* */
-/* CALLS */
-/* */
-/* _ux_utility_descriptor_parse Parse descriptor */
+/* */
+/* INPUT */
+/* */
+/* video Pointer to video class */
+/* */
+/* OUTPUT */
+/* */
+/* Completion Status */
+/* */
+/* CALLS */
+/* */
+/* _ux_utility_descriptor_parse Parse descriptor */
/* _ux_system_error_handler Log system error */
-/* */
-/* CALLED BY */
-/* */
-/* Video Class */
-/* */
-/* RELEASE HISTORY */
-/* */
-/* DATE NAME DESCRIPTION */
-/* */
-/* 05-19-2020 Chaoqiong Xiao Initial Version 6.0 */
-/* 09-30-2020 Chaoqiong Xiao Modified comment(s), */
-/* resulting in version 6.1 */
+/* */
+/* CALLED BY */
+/* */
+/* Video Class */
/* */
/**************************************************************************/
UINT _ux_host_class_video_control_list_get(UX_HOST_CLASS_VIDEO *video)
@@ -85,7 +78,7 @@ ULONG interface_found;
/* 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 it yet. */
interface_found = UX_FALSE;
@@ -116,16 +109,16 @@ ULONG interface_found;
{
case UX_INTERFACE_DESCRIPTOR_ITEM:
-
+
/* Parse the interface descriptor and make it machine independent. */
_ux_utility_descriptor_parse(descriptor, _ux_system_interface_descriptor_structure,
UX_INTERFACE_DESCRIPTOR_ENTRIES, (UCHAR *) &interface_descriptor);
-
+
/* Ensure we have the correct interface for Video Control. */
if ((interface_descriptor.bInterfaceClass == UX_HOST_CLASS_VIDEO_CLASS) &&
(interface_descriptor.bInterfaceSubClass == UX_HOST_CLASS_VIDEO_SUBCLASS_CONTROL))
{
-
+
/* Mark we have found it. */
interface_found = UX_TRUE;
@@ -135,15 +128,15 @@ ULONG interface_found;
}
else
{
-
+
/* Haven't found it. */
interface_found = UX_FALSE;
}
break;
-
-
+
+
case UX_HOST_CLASS_VIDEO_CS_INTERFACE:
-
+
/* First make sure we have found the correct generic interface descriptor. */
if ((interface_found == UX_TRUE) && (descriptor_subtype == UX_HOST_CLASS_VIDEO_VC_PROCESSING_UNIT))
{
@@ -157,7 +150,7 @@ ULONG interface_found;
/* We are done here. */
return(UX_SUCCESS);
}
-
+
break;
}
@@ -172,7 +165,7 @@ ULONG interface_found;
//UX_TRACE_IN_LINE_INSERT(UX_TRACE_ERROR, UX_DESCRIPTOR_CORRUPTED, descriptor, 0, 0, UX_TRACE_ERRORS, 0, 0)
return(UX_DESCRIPTOR_CORRUPTED);
- }
+ }
/* Jump to the next descriptor if we have not reached the end. */
descriptor += descriptor_length;
diff --git a/common/usbx_host_classes/src/ux_host_class_video_control_request.c b/common/usbx_host_classes/src/ux_host_class_video_control_request.c
index 6ff3377a..59f2ec4d 100644
--- a/common/usbx_host_classes/src/ux_host_class_video_control_request.c
+++ b/common/usbx_host_classes/src/ux_host_class_video_control_request.c
@@ -1,10 +1,11 @@
/***************************************************************************
- * Copyright (c) 2024 Microsoft Corporation
- *
+ * Copyright (c) 2024 Microsoft Corporation
+ * Copyright (c) 2026-present Eclipse ThreadX contributors
+ *
* This program and the accompanying materials are made available under the
* terms of the MIT License which is available at
* https://opensource.org/licenses/MIT.
- *
+ *
* SPDX-License-Identifier: MIT
**************************************************************************/
@@ -71,19 +72,6 @@
/* */
/* Application */
/* */
-/* RELEASE HISTORY */
-/* */
-/* DATE NAME DESCRIPTION */
-/* */
-/* 09-30-2020 Chaoqiong Xiao Initial Version 6.1 */
-/* 01-31-2022 Chaoqiong Xiao Modified comment(s), */
-/* refined macros names, */
-/* resulting in version 6.1.10 */
-/* 07-29-2022 Chaoqiong Xiao Modified comment(s), */
-/* fixed parameter/variable */
-/* names conflict C++ keyword, */
-/* resulting in version 6.1.12 */
-/* */
/**************************************************************************/
UINT _ux_host_class_video_control_request(UX_HOST_CLASS_VIDEO *video,
UINT request, UCHAR interface_index,
@@ -246,12 +234,6 @@ UCHAR interface_number;
/* Application */
/* Video Class */
/* */
-/* RELEASE HISTORY */
-/* */
-/* DATE NAME DESCRIPTION */
-/* */
-/* 10-31-2023 Yajun xia Initial Version 6.3.0 */
-/* */
/**************************************************************************/
UINT _uxe_host_class_video_control_request(UX_HOST_CLASS_VIDEO *video,
UINT request, UCHAR interface_index,
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 b9c0aa2f..a9190eb0 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
@@ -1,10 +1,11 @@
/***************************************************************************
- * Copyright (c) 2024 Microsoft Corporation
- *
+ * Copyright (c) 2024 Microsoft Corporation
+ * Copyright (c) 2026-present Eclipse ThreadX contributors
+ *
* This program and the accompanying materials are made available under the
* terms of the MIT License which is available at
* https://opensource.org/licenses/MIT.
- *
+ *
* SPDX-License-Identifier: MIT
**************************************************************************/
@@ -68,20 +69,6 @@
/* Application */
/* Video Class */
/* */
-/* RELEASE HISTORY */
-/* */
-/* DATE NAME DESCRIPTION */
-/* */
-/* 05-19-2020 Chaoqiong Xiao Initial Version 6.0 */
-/* 09-30-2020 Chaoqiong Xiao Modified comment(s), */
-/* resulting in version 6.1 */
-/* 01-31-2022 Chaoqiong Xiao Modified comment(s), */
-/* refined macros names, */
-/* resulting in version 6.1.10 */
-/* 04-25-2022 Chaoqiong Xiao Modified comment(s), */
-/* fixed standalone compile, */
-/* resulting in version 6.1.11 */
-/* */
/**************************************************************************/
UINT _ux_host_class_video_control_value_get(UX_HOST_CLASS_VIDEO *video, UX_HOST_CLASS_VIDEO_CONTROL *video_control)
{
@@ -211,12 +198,6 @@ UCHAR * control_buffer;
/* Application */
/* Video Class */
/* */
-/* RELEASE HISTORY */
-/* */
-/* DATE NAME DESCRIPTION */
-/* */
-/* 10-31-2023 Yajun xia Initial Version 6.3.0 */
-/* */
/**************************************************************************/
UINT _uxe_host_class_video_control_value_get(UX_HOST_CLASS_VIDEO *video, UX_HOST_CLASS_VIDEO_CONTROL *video_control)
{
diff --git a/common/usbx_host_classes/src/ux_host_class_video_control_value_set.c b/common/usbx_host_classes/src/ux_host_class_video_control_value_set.c
index dcd197d8..25d7ea33 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
@@ -1,10 +1,11 @@
/***************************************************************************
- * Copyright (c) 2024 Microsoft Corporation
- *
+ * Copyright (c) 2024 Microsoft Corporation
+ * Copyright (c) 2026-present Eclipse ThreadX contributors
+ *
* This program and the accompanying materials are made available under the
* terms of the MIT License which is available at
* https://opensource.org/licenses/MIT.
- *
+ *
* SPDX-License-Identifier: MIT
**************************************************************************/
@@ -67,20 +68,6 @@
/* Application */
/* Video Class */
/* */
-/* RELEASE HISTORY */
-/* */
-/* DATE NAME DESCRIPTION */
-/* */
-/* 05-19-2020 Chaoqiong Xiao Initial Version 6.0 */
-/* 09-30-2020 Chaoqiong Xiao Modified comment(s), */
-/* resulting in version 6.1 */
-/* 01-31-2022 Chaoqiong Xiao Modified comment(s), */
-/* refined macros names, */
-/* resulting in version 6.1.10 */
-/* 04-25-2022 Chaoqiong Xiao Modified comment(s), */
-/* fixed standalone compile, */
-/* resulting in version 6.1.11 */
-/* */
/**************************************************************************/
UINT _ux_host_class_video_control_value_set(UX_HOST_CLASS_VIDEO *video, UX_HOST_CLASS_VIDEO_CONTROL *video_control)
{
@@ -207,12 +194,6 @@ UCHAR * control_buffer;
/* Application */
/* Video Class */
/* */
-/* RELEASE HISTORY */
-/* */
-/* DATE NAME DESCRIPTION */
-/* */
-/* 10-31-2023 Yajun xia Initial Version 6.3.0 */
-/* */
/**************************************************************************/
UINT _uxe_host_class_video_control_value_set(UX_HOST_CLASS_VIDEO *video, UX_HOST_CLASS_VIDEO_CONTROL *video_control)
{
diff --git a/common/usbx_host_classes/src/ux_host_class_video_deactivate.c b/common/usbx_host_classes/src/ux_host_class_video_deactivate.c
index 0fb63b03..2f1798c3 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
@@ -1,18 +1,19 @@
/***************************************************************************
- * Copyright (c) 2024 Microsoft Corporation
- *
+ * Copyright (c) 2024 Microsoft Corporation
+ * Copyright (c) 2026-present Eclipse ThreadX contributors
+ *
* This program and the accompanying materials are made available under the
* terms of the MIT License which is available at
* https://opensource.org/licenses/MIT.
- *
+ *
* SPDX-License-Identifier: MIT
**************************************************************************/
/**************************************************************************/
/**************************************************************************/
-/** */
-/** USBX Component */
+/** */
+/** USBX Component */
/** */
/** Video Class */
/** */
@@ -29,61 +30,43 @@
#include "ux_host_stack.h"
-/**************************************************************************/
-/* */
-/* FUNCTION RELEASE */
-/* */
-/* _ux_host_class_video_deactivate PORTABLE C */
+/**************************************************************************/
+/* */
+/* FUNCTION RELEASE */
+/* */
+/* _ux_host_class_video_deactivate PORTABLE C */
/* 6.1.10 */
/* AUTHOR */
/* */
/* Chaoqiong Xiao, Microsoft Corporation */
/* */
/* DESCRIPTION */
-/* */
+/* */
/* This function is called when this instance of the video has been */
-/* removed from the bus either directly or indirectly. The iso pipes */
-/* will be destroyed and the instanced removed. */
-/* */
-/* INPUT */
-/* */
-/* command Pointer to command */
-/* */
-/* OUTPUT */
-/* */
-/* Completion Status */
-/* */
-/* CALLS */
-/* */
-/* _ux_host_stack_class_instance_destroy Destroy class instance */
+/* removed from the bus either directly or indirectly. The iso pipes */
+/* will be destroyed and the instanced removed. */
+/* */
+/* INPUT */
+/* */
+/* command Pointer to command */
+/* */
+/* OUTPUT */
+/* */
+/* Completion Status */
+/* */
+/* CALLS */
+/* */
+/* _ux_host_stack_class_instance_destroy Destroy class instance */
/* _ux_host_stack_endpoint_transfer_abort */
-/* Abort outstanding transfer */
-/* _ux_host_semaphore_get Get semaphore */
-/* _ux_host_semaphore_delete Delete semaphore */
-/* _ux_utility_memory_free Release memory block */
+/* Abort outstanding transfer */
+/* _ux_host_semaphore_get Get semaphore */
+/* _ux_host_semaphore_delete Delete semaphore */
+/* _ux_utility_memory_free Release memory block */
/* _ux_utility_thread_schedule_other Schedule other threads */
-/* */
-/* CALLED BY */
-/* */
-/* Video Class */
-/* */
-/* RELEASE HISTORY */
-/* */
-/* DATE NAME DESCRIPTION */
-/* */
-/* 05-19-2020 Chaoqiong Xiao Initial Version 6.0 */
-/* 09-30-2020 Chaoqiong Xiao Modified comment(s), */
-/* fixed issue of aborting */
-/* transfer without endpoint */
-/* ready, deleted new semaphore*/
-/* for control requests, */
-/* resulting in version 6.1 */
-/* 11-09-2020 Chaoqiong Xiao Modified comment(s), */
-/* freed descriptor memory, */
-/* resulting in version 6.1.2 */
-/* 01-31-2022 Chaoqiong Xiao Modified comment(s), */
-/* refined macros names, */
-/* resulting in version 6.1.10 */
+/* */
+/* CALLED BY */
+/* */
+/* Video Class */
/* */
/**************************************************************************/
UINT _ux_host_class_video_deactivate(UX_HOST_CLASS_COMMAND *command)
@@ -104,14 +87,14 @@ UINT status;
/* Return error. */
return(status);
-
+
/* We need to abort transactions on the iso out pipe. */
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. */
- _ux_host_thread_schedule_other(UX_THREAD_PRIORITY_ENUM);
+ _ux_host_thread_schedule_other(UX_THREAD_PRIORITY_ENUM);
/* Free descriptor memory. */
if (video -> ux_host_class_video_configuration_descriptor)
@@ -128,11 +111,11 @@ UINT status;
that the device is removed. */
if (_ux_system_host -> ux_system_host_change_function != UX_NULL)
{
-
+
/* Inform the application the device is removed. */
_ux_system_host -> ux_system_host_change_function(UX_DEVICE_REMOVAL, video -> ux_host_class_video_class, (VOID *) video);
}
-
+
/* If trace is enabled, insert this event into the trace buffer. */
//UX_TRACE_IN_LINE_INSERT(UX_TRACE_HOST_CLASS_VIDEO_DEACTIVATE, video, 0, 0, 0, UX_TRACE_HOST_CLASS_EVENTS, 0, 0)
@@ -141,8 +124,8 @@ UINT status;
/* Free the video instance memory. */
_ux_utility_memory_free(video);
-
+
/* Return successful completion. */
- return(UX_SUCCESS);
+ return(UX_SUCCESS);
}
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 cc1ff679..6e2d9f58 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
@@ -1,18 +1,19 @@
/***************************************************************************
- * Copyright (c) 2024 Microsoft Corporation
- *
+ * Copyright (c) 2024 Microsoft Corporation
+ * Copyright (c) 2026-present Eclipse ThreadX contributors
+ *
* This program and the accompanying materials are made available under the
* terms of the MIT License which is available at
* https://opensource.org/licenses/MIT.
- *
+ *
* SPDX-License-Identifier: MIT
**************************************************************************/
/**************************************************************************/
/**************************************************************************/
-/** */
-/** USBX Component */
+/** */
+/** USBX Component */
/** */
/** Video Class */
/** */
@@ -29,52 +30,40 @@
#include "ux_host_stack.h"
-/**************************************************************************/
-/* */
-/* FUNCTION RELEASE */
-/* */
-/* _ux_host_class_video_descriptor_get PORTABLE C */
+/**************************************************************************/
+/* */
+/* FUNCTION RELEASE */
+/* */
+/* _ux_host_class_video_descriptor_get PORTABLE C */
/* 6.1.12 */
/* AUTHOR */
/* */
/* Chaoqiong Xiao, Microsoft Corporation */
/* */
/* DESCRIPTION */
-/* */
-/* This function obtains the entire video configuration descriptors. */
-/* This is needed because the video class has many class specific */
-/* descriptors which describe the alternate settings that can be used. */
-/* */
-/* INPUT */
-/* */
-/* video Pointer to video class */
-/* */
-/* OUTPUT */
-/* */
-/* Completion Status */
-/* */
-/* CALLS */
-/* */
-/* _ux_host_stack_transfer_request Process transfer request */
-/* _ux_utility_descriptor_parse Parse descriptor */
-/* _ux_utility_memory_allocate Allocate memory block */
-/* _ux_utility_memory_free Release memory block */
-/* */
-/* CALLED BY */
-/* */
-/* Video Class */
-/* */
-/* RELEASE HISTORY */
-/* */
-/* DATE NAME DESCRIPTION */
-/* */
-/* 05-19-2020 Chaoqiong Xiao Initial Version 6.0 */
-/* 09-30-2020 Chaoqiong Xiao Modified comment(s), */
-/* resulting in version 6.1 */
-/* 07-29-2022 Chaoqiong Xiao Modified comment(s), */
-/* used shared device config */
-/* descriptor for enum scan, */
-/* resulting in version 6.1.12 */
+/* */
+/* This function obtains the entire video configuration descriptors. */
+/* This is needed because the video class has many class specific */
+/* descriptors which describe the alternate settings that can be used. */
+/* */
+/* INPUT */
+/* */
+/* video Pointer to video class */
+/* */
+/* OUTPUT */
+/* */
+/* Completion Status */
+/* */
+/* CALLS */
+/* */
+/* _ux_host_stack_transfer_request Process transfer request */
+/* _ux_utility_descriptor_parse Parse descriptor */
+/* _ux_utility_memory_allocate Allocate memory block */
+/* _ux_utility_memory_free Release memory block */
+/* */
+/* CALLED BY */
+/* */
+/* Video Class */
/* */
/**************************************************************************/
UINT _ux_host_class_video_descriptor_get(UX_HOST_CLASS_VIDEO *video)
@@ -132,10 +121,10 @@ ULONG total_configuration_length;
if ((status == UX_SUCCESS) && (transfer_request -> ux_transfer_request_actual_length == total_configuration_length))
{
- /* Save the address of the entire configuration descriptor of the video device. */
+ /* Save the address of the entire configuration descriptor of the video device. */
video -> ux_host_class_video_configuration_descriptor = descriptor;
- /* Save the length of the entire descriptor too. */
+ /* Save the length of the entire descriptor too. */
video -> ux_host_class_video_configuration_descriptor_length = total_configuration_length;
/* Keep descriptor to be shared for this device. */
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 56509137..e330ad7d 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
@@ -1,18 +1,19 @@
/***************************************************************************
- * Copyright (c) 2024 Microsoft Corporation
- *
+ * Copyright (c) 2024 Microsoft Corporation
+ * Copyright (c) 2026-present Eclipse ThreadX contributors
+ *
* This program and the accompanying materials are made available under the
* terms of the MIT License which is available at
* https://opensource.org/licenses/MIT.
- *
+ *
* SPDX-License-Identifier: MIT
**************************************************************************/
/**************************************************************************/
/**************************************************************************/
-/** */
-/** USBX Component */
+/** */
+/** USBX Component */
/** */
/** Video Class */
/** */
@@ -29,44 +30,36 @@
#include "ux_host_stack.h"
-/**************************************************************************/
-/* */
-/* FUNCTION RELEASE */
-/* */
-/* _ux_host_class_video_endpoints_get PORTABLE C */
+/**************************************************************************/
+/* */
+/* FUNCTION RELEASE */
+/* */
+/* _ux_host_class_video_endpoints_get PORTABLE C */
/* 6.1 */
/* AUTHOR */
/* */
/* Chaoqiong Xiao, Microsoft Corporation */
/* */
/* DESCRIPTION */
-/* */
-/* This function searches for the handle of the isochronous endpoints. */
-/* */
-/* INPUT */
-/* */
-/* video Pointer to video class */
-/* */
-/* OUTPUT */
-/* */
-/* Completion Status */
-/* */
-/* CALLS */
-/* */
-/* _ux_host_stack_interface_endpoint_get Get interface endpoint */
+/* */
+/* This function searches for the handle of the isochronous endpoints. */
+/* */
+/* INPUT */
+/* */
+/* video Pointer to video class */
+/* */
+/* OUTPUT */
+/* */
+/* Completion Status */
+/* */
+/* CALLS */
+/* */
+/* _ux_host_stack_interface_endpoint_get Get interface endpoint */
/* _ux_system_error_handler Log system error */
-/* */
-/* CALLED BY */
-/* */
-/* Video Class */
-/* */
-/* RELEASE HISTORY */
-/* */
-/* DATE NAME DESCRIPTION */
-/* */
-/* 05-19-2020 Chaoqiong Xiao Initial Version 6.0 */
-/* 09-30-2020 Chaoqiong Xiao Modified comment(s), */
-/* resulting in version 6.1 */
+/* */
+/* CALLED BY */
+/* */
+/* Video Class */
/* */
/**************************************************************************/
UINT _ux_host_class_video_endpoints_get(UX_HOST_CLASS_VIDEO *video)
@@ -80,7 +73,7 @@ UX_ENDPOINT *endpoint;
/* Search the ISO OUT endpoint. It is attached to the interface container. */
for (endpoint_index = 0; endpoint_index < video -> ux_host_class_video_streaming_interface -> ux_interface_descriptor.bNumEndpoints;
endpoint_index++)
- {
+ {
/* Get interface endpoint. */
status = _ux_host_stack_interface_endpoint_get(video -> ux_host_class_video_streaming_interface, endpoint_index, &endpoint);
@@ -98,13 +91,13 @@ UX_ENDPOINT *endpoint;
video -> ux_host_class_video_isochronous_endpoint = endpoint;
break;
}
- }
- }
+ }
+ }
/* The isochronous endpoint is mandatory. If we didn't find it, return an error. */
if (video -> ux_host_class_video_isochronous_endpoint == UX_NULL)
{
-
+
/* Error trap. */
_ux_system_error_handler(UX_SYSTEM_LEVEL_THREAD, UX_SYSTEM_CONTEXT_CLASS, UX_ENDPOINT_HANDLE_UNKNOWN);
@@ -113,8 +106,8 @@ UX_ENDPOINT *endpoint;
return(UX_ENDPOINT_HANDLE_UNKNOWN);
}
-
- /* Return successful status. */
+
+ /* Return successful status. */
return(UX_SUCCESS);
}
diff --git a/common/usbx_host_classes/src/ux_host_class_video_entities_parse.c b/common/usbx_host_classes/src/ux_host_class_video_entities_parse.c
index 2927ee98..bf252f39 100644
--- a/common/usbx_host_classes/src/ux_host_class_video_entities_parse.c
+++ b/common/usbx_host_classes/src/ux_host_class_video_entities_parse.c
@@ -1,10 +1,11 @@
/***************************************************************************
- * Copyright (c) 2024 Microsoft Corporation
- *
+ * Copyright (c) 2024 Microsoft Corporation
+ * Copyright (c) 2026-present Eclipse ThreadX contributors
+ *
* This program and the accompanying materials are made available under the
* terms of the MIT License which is available at
* https://opensource.org/licenses/MIT.
- *
+ *
* SPDX-License-Identifier: MIT
**************************************************************************/
@@ -73,19 +74,6 @@
/* Video Class */
/* Application */
/* */
-/* RELEASE HISTORY */
-/* */
-/* DATE NAME DESCRIPTION */
-/* */
-/* 09-30-2020 Chaoqiong Xiao Initial Version 6.1 */
-/* 08-02-2021 Wen Wang Modified comment(s), */
-/* fixed spelling error, */
-/* resulting in version 6.1.8 */
-/* 07-29-2022 Chaoqiong Xiao Modified comment(s), */
-/* fixed parameter/variable */
-/* names conflict C++ keyword, */
-/* resulting in version 6.1.12 */
-/* */
/**************************************************************************/
UINT _ux_host_class_video_entities_parse(UX_HOST_CLASS_VIDEO *video,
UINT(*parse_function)(VOID *arg,
@@ -222,12 +210,6 @@ UINT status;
/* Video Class */
/* Application */
/* */
-/* RELEASE HISTORY */
-/* */
-/* DATE NAME DESCRIPTION */
-/* */
-/* 10-31-2023 Yajun xia Initial Version 6.3.0 */
-/* */
/**************************************************************************/
UINT _uxe_host_class_video_entities_parse(UX_HOST_CLASS_VIDEO *video,
UINT(*parse_function)(VOID *arg,
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 d22d6e5c..146fb860 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
@@ -1,18 +1,19 @@
/***************************************************************************
- * Copyright (c) 2024 Microsoft Corporation
- *
+ * Copyright (c) 2024 Microsoft Corporation
+ * Copyright (c) 2026-present Eclipse ThreadX contributors
+ *
* This program and the accompanying materials are made available under the
* terms of the MIT License which is available at
* https://opensource.org/licenses/MIT.
- *
+ *
* SPDX-License-Identifier: MIT
**************************************************************************/
/**************************************************************************/
/**************************************************************************/
-/** */
-/** USBX Component */
+/** */
+/** USBX Component */
/** */
/** Video Class */
/** */
@@ -29,48 +30,40 @@
#include "ux_host_stack.h"
-/**************************************************************************/
-/* */
-/* FUNCTION RELEASE */
-/* */
-/* _ux_host_class_video_entry PORTABLE C */
+/**************************************************************************/
+/* */
+/* FUNCTION RELEASE */
+/* */
+/* _ux_host_class_video_entry PORTABLE C */
/* 6.1 */
/* AUTHOR */
/* */
/* Chaoqiong Xiao, Microsoft Corporation */
/* */
/* DESCRIPTION */
-/* */
-/* This function is the entry point of the Video class. It will be */
-/* called by the USBX stack enumeration module when there is a new */
-/* video device (speaker, microphone ...) on the bus or when the video */
-/* device is removed. */
-/* */
-/* INPUT */
-/* */
-/* command Pointer to command */
-/* */
-/* OUTPUT */
-/* */
-/* Completion Status */
-/* */
-/* CALLS */
-/* */
-/* _ux_host_class_video_activate Activate video class */
+/* */
+/* This function is the entry point of the Video class. It will be */
+/* called by the USBX stack enumeration module when there is a new */
+/* video device (speaker, microphone ...) on the bus or when the video */
+/* device is removed. */
+/* */
+/* INPUT */
+/* */
+/* command Pointer to command */
+/* */
+/* OUTPUT */
+/* */
+/* Completion Status */
+/* */
+/* CALLS */
+/* */
+/* _ux_host_class_video_activate Activate video class */
/* _ux_host_class_video_deactivate Deactivate video class */
-/* _ux_system_error_handler Log system error */
-/* */
-/* CALLED BY */
-/* */
-/* Host Stack */
-/* */
-/* RELEASE HISTORY */
-/* */
-/* DATE NAME DESCRIPTION */
-/* */
-/* 05-19-2020 Chaoqiong Xiao Initial Version 6.0 */
-/* 09-30-2020 Chaoqiong Xiao Modified comment(s), */
-/* resulting in version 6.1 */
+/* _ux_system_error_handler Log system error */
+/* */
+/* CALLED BY */
+/* */
+/* Host Stack */
/* */
/**************************************************************************/
UINT _ux_host_class_video_entry(UX_HOST_CLASS_COMMAND *command)
@@ -92,29 +85,29 @@ UINT status = UX_SUCCESS;
if ((command -> ux_host_class_command_usage == UX_HOST_CLASS_COMMAND_USAGE_CSP) &&
(command -> ux_host_class_command_class == UX_HOST_CLASS_VIDEO_CLASS))
status = UX_SUCCESS;
- else
- status = UX_NO_CLASS_MATCH;
+ else
+ status = UX_NO_CLASS_MATCH;
break;
-
+
case UX_HOST_CLASS_COMMAND_ACTIVATE:
/* The activate command is used when the device inserted has found a parent and
is ready to complete the enumeration. */
status = _ux_host_class_video_activate(command);
-
+
break;
case UX_HOST_CLASS_COMMAND_DEACTIVATE:
- /* The deactivate command is used when the device has been extracted either
+ /* The deactivate command is used when the device has been extracted either
directly or when its parents has been extracted. */
status = _ux_host_class_video_deactivate(command);
break;
- default:
+ default:
/* Error trap. */
_ux_system_error_handler(UX_SYSTEM_LEVEL_THREAD, UX_SYSTEM_CONTEXT_CLASS, UX_FUNCTION_NOT_SUPPORTED);
@@ -123,7 +116,7 @@ UINT status = UX_SUCCESS;
//UX_TRACE_IN_LINE_INSERT(UX_TRACE_ERROR, UX_FUNCTION_NOT_SUPPORTED, 0, 0, 0, UX_TRACE_ERRORS, 0, 0)
status = UX_FUNCTION_NOT_SUPPORTED;
- }
+ }
return(status);
}
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 223a7f17..dc6d1174 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
@@ -1,10 +1,11 @@
/***************************************************************************
- * Copyright (c) 2024 Microsoft Corporation
- *
+ * Copyright (c) 2024 Microsoft Corporation
+ * Copyright (c) 2026-present Eclipse ThreadX contributors
+ *
* This program and the accompanying materials are made available under the
* terms of the MIT License which is available at
* https://opensource.org/licenses/MIT.
- *
+ *
* SPDX-License-Identifier: MIT
**************************************************************************/
@@ -60,17 +61,6 @@
/* */
/* Video Class */
/* */
-/* RELEASE HISTORY */
-/* */
-/* DATE NAME DESCRIPTION */
-/* */
-/* 05-19-2020 Chaoqiong Xiao Initial Version 6.0 */
-/* 09-30-2020 Chaoqiong Xiao Modified comment(s), */
-/* resulting in version 6.1 */
-/* 10-31-2023 Chaoqiong Xiao Modified comment(s), */
-/* improved extracted data, */
-/* resulting in version 6.3.0 */
-/* */
/**************************************************************************/
UINT _ux_host_class_video_format_data_get(UX_HOST_CLASS_VIDEO *video, UX_HOST_CLASS_VIDEO_PARAMETER_FORMAT_DATA *format_parameter)
{
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 34dd511d..97c1f921 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
@@ -1,10 +1,11 @@
/***************************************************************************
- * Copyright (c) 2024 Microsoft Corporation
- *
+ * Copyright (c) 2024 Microsoft Corporation
+ * Copyright (c) 2026-present Eclipse ThreadX contributors
+ *
* This program and the accompanying materials are made available under the
* terms of the MIT License which is available at
* https://opensource.org/licenses/MIT.
- *
+ *
* SPDX-License-Identifier: MIT
**************************************************************************/
@@ -80,17 +81,6 @@ static const UCHAR _ux_host_class_video_frame_descriptor_offsets[][5] =
/* */
/* Video Class */
/* */
-/* RELEASE HISTORY */
-/* */
-/* DATE NAME DESCRIPTION */
-/* */
-/* 05-19-2020 Chaoqiong Xiao Initial Version 6.0 */
-/* 09-30-2020 Chaoqiong Xiao Modified comment(s), */
-/* resulting in version 6.1 */
-/* 10-31-2023 Chaoqiong Xiao Modified comment(s), */
-/* improved extracted data, */
-/* resulting in version 6.3.0 */
-/* */
/**************************************************************************/
UINT _ux_host_class_video_frame_data_get(UX_HOST_CLASS_VIDEO *video, UX_HOST_CLASS_VIDEO_PARAMETER_FRAME_DATA *frame_parameter)
{
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 3c0112d9..21d936a2 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
@@ -1,18 +1,19 @@
/***************************************************************************
- * Copyright (c) 2024 Microsoft Corporation
- *
+ * Copyright (c) 2024 Microsoft Corporation
+ * Copyright (c) 2026-present Eclipse ThreadX contributors
+ *
* This program and the accompanying materials are made available under the
* terms of the MIT License which is available at
* https://opensource.org/licenses/MIT.
- *
+ *
* SPDX-License-Identifier: MIT
**************************************************************************/
/**************************************************************************/
/**************************************************************************/
-/** */
-/** USBX Component */
+/** */
+/** USBX Component */
/** */
/** Video Class */
/** */
@@ -29,49 +30,38 @@
#include "ux_host_stack.h"
-/**************************************************************************/
-/* */
-/* FUNCTION RELEASE */
-/* */
-/* _ux_host_class_video_frame_interval_get PORTABLE C */
+/**************************************************************************/
+/* */
+/* FUNCTION RELEASE */
+/* */
+/* _ux_host_class_video_frame_interval_get PORTABLE C */
/* 6.1.2 */
/* AUTHOR */
/* */
/* Chaoqiong Xiao, Microsoft Corporation */
/* */
/* DESCRIPTION */
-/* */
+/* */
/* This function finds the frame intervals within the frame. */
-/* */
-/* INPUT */
-/* */
-/* video Pointer to video class */
-/* interval_parameter Interval request structure */
-/* */
-/* OUTPUT */
-/* */
-/* Completion Status */
-/* */
-/* CALLS */
-/* */
+/* */
+/* INPUT */
+/* */
+/* video Pointer to video class */
+/* interval_parameter Interval request structure */
+/* */
+/* OUTPUT */
+/* */
+/* Completion Status */
+/* */
+/* CALLS */
+/* */
/* _ux_system_error_handler Log system error */
-/* _ux_utility_descriptor_parse Parse descriptor */
+/* _ux_utility_descriptor_parse Parse descriptor */
/* _ux_utility_long_get Get 32-bit value */
-/* */
-/* CALLED BY */
-/* */
-/* Video Class */
-/* */
-/* RELEASE HISTORY */
-/* */
-/* DATE NAME DESCRIPTION */
-/* */
-/* 05-19-2020 Chaoqiong Xiao Initial Version 6.0 */
-/* 09-30-2020 Chaoqiong Xiao Modified comment(s), */
-/* resulting in version 6.1 */
-/* 11-09-2020 Chaoqiong Xiao Modified comment(s), */
-/* fixed compile warnings 64b, */
-/* resulting in version 6.1.2 */
+/* */
+/* CALLED BY */
+/* */
+/* Video Class */
/* */
/**************************************************************************/
UINT _ux_host_class_video_frame_interval_get(UX_HOST_CLASS_VIDEO *video, UX_HOST_CLASS_VIDEO_PARAMETER_FRAME_INTERVAL *interval_parameter)
@@ -89,7 +79,7 @@ ULONG i;
/* Get the descriptor to the selected format. */
descriptor = video -> ux_host_class_video_current_format_address;
total_descriptor_length = video -> ux_host_class_video_length_formats;
-
+
/* Descriptors are arranged in order. First FORMAT then FRAME. */
while (total_descriptor_length)
{
@@ -119,19 +109,19 @@ ULONG i;
/* Process relative to descriptor type. */
switch (descriptor_subtype)
{
-
+
case UX_HOST_CLASS_VIDEO_VS_FRAME_UNCOMPRESSED :
case UX_HOST_CLASS_VIDEO_VS_FRAME_MJPEG :
case UX_HOST_CLASS_VIDEO_VS_FRAME_FRAME_BASED :
-
+
/* We found a Frame descriptor. Is it the right one ? */
if (interval_parameter -> ux_host_class_video_parameter_frame_requested == *(descriptor + 3))
{
-
+
/* Make the descriptor machine independent. */
_ux_utility_descriptor_parse(descriptor, _ux_system_class_video_frame_descriptor_structure,
UX_HOST_CLASS_VIDEO_FRAME_DESCRIPTOR_ENTRIES, (UCHAR *) &frame_descriptor);
-
+
/* Check the frame interval type. */
if (frame_descriptor.bFrameIntervalType == 0)
{
@@ -167,10 +157,10 @@ ULONG i;
/* We are done here. */
return(UX_SUCCESS);
}
-
+
break;
-
- }
+
+ }
}
/* Verify if the descriptor is still valid. */
@@ -184,7 +174,7 @@ ULONG i;
//UX_TRACE_IN_LINE_INSERT(UX_TRACE_ERROR, UX_DESCRIPTOR_CORRUPTED, descriptor, 0, 0, UX_TRACE_ERRORS, 0, 0)
return(UX_DESCRIPTOR_CORRUPTED);
- }
+ }
/* Jump to the next descriptor if we have not reached the end. */
descriptor += descriptor_length;
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 8c202a3d..96180bc6 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
@@ -1,10 +1,11 @@
/***************************************************************************
- * Copyright (c) 2024 Microsoft Corporation
- *
+ * Copyright (c) 2024 Microsoft Corporation
+ * Copyright (c) 2026-present Eclipse ThreadX contributors
+ *
* This program and the accompanying materials are made available under the
* terms of the MIT License which is available at
* https://opensource.org/licenses/MIT.
- *
+ *
* SPDX-License-Identifier: MIT
**************************************************************************/
@@ -71,27 +72,6 @@
/* */
/* Application */
/* */
-/* RELEASE HISTORY */
-/* */
-/* DATE NAME DESCRIPTION */
-/* */
-/* 05-19-2020 Chaoqiong Xiao Initial Version 6.0 */
-/* 09-30-2020 Chaoqiong Xiao Modified comment(s), */
-/* resulting in version 6.1 */
-/* 10-15-2021 Chaoqiong Xiao Modified comment(s), */
-/* validated max payload size, */
-/* resulting in version 6.1.9 */
-/* 01-31-2022 Chaoqiong Xiao Modified comment(s), */
-/* refined macros names, */
-/* resulting in version 6.1.10 */
-/* 04-25-2022 Chaoqiong Xiao Modified comment(s), */
-/* internal clean up, */
-/* fixed standalone compile, */
-/* resulting in version 6.1.11 */
-/* 10-31-2023 Yajun xia, CQ Xiao Modified comment(s), */
-/* improved interval checking, */
-/* resulting in version 6.3.0 */
-/* */
/**************************************************************************/
UINT _ux_host_class_video_frame_parameters_set(UX_HOST_CLASS_VIDEO *video, ULONG frame_format, ULONG width, ULONG height, ULONG frame_interval)
{
@@ -352,12 +332,6 @@ ULONG max_payload_size;
/* */
/* Application */
/* */
-/* RELEASE HISTORY */
-/* */
-/* DATE NAME DESCRIPTION */
-/* */
-/* 10-31-2023 Yajun xia Initial Version 6.3.0 */
-/* */
/**************************************************************************/
UINT _uxe_host_class_video_frame_parameters_set(UX_HOST_CLASS_VIDEO *video, ULONG frame_format, ULONG width, ULONG height, ULONG frame_interval)
{
diff --git a/common/usbx_host_classes/src/ux_host_class_video_input_format_get.c b/common/usbx_host_classes/src/ux_host_class_video_input_format_get.c
index 214c43ff..7d34f399 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
@@ -1,18 +1,19 @@
/***************************************************************************
- * Copyright (c) 2024 Microsoft Corporation
- *
+ * Copyright (c) 2024 Microsoft Corporation
+ * Copyright (c) 2026-present Eclipse ThreadX contributors
+ *
* This program and the accompanying materials are made available under the
* terms of the MIT License which is available at
* https://opensource.org/licenses/MIT.
- *
+ *
* SPDX-License-Identifier: MIT
**************************************************************************/
/**************************************************************************/
/**************************************************************************/
-/** */
-/** USBX Component */
+/** */
+/** USBX Component */
/** */
/** Video Class */
/** */
@@ -29,44 +30,36 @@
#include "ux_host_stack.h"
-/**************************************************************************/
-/* */
-/* FUNCTION RELEASE */
-/* */
-/* _ux_host_class_video_input_format_get PORTABLE C */
+/**************************************************************************/
+/* */
+/* FUNCTION RELEASE */
+/* */
+/* _ux_host_class_video_input_format_get PORTABLE C */
/* 6.1 */
/* AUTHOR */
/* */
/* Chaoqiong Xiao, Microsoft Corporation */
/* */
/* DESCRIPTION */
-/* */
-/* This function finds the input format(s) for the input terminal. */
-/* */
-/* INPUT */
-/* */
-/* video Pointer to video class */
-/* */
-/* OUTPUT */
-/* */
-/* Completion Status */
-/* */
-/* CALLS */
-/* */
-/* _ux_utility_descriptor_parse Parse descriptor */
-/* _ux_system_error_handler Log system error */
-/* */
-/* CALLED BY */
-/* */
-/* Video Class */
-/* */
-/* RELEASE HISTORY */
-/* */
-/* DATE NAME DESCRIPTION */
-/* */
-/* 05-19-2020 Chaoqiong Xiao Initial Version 6.0 */
-/* 09-30-2020 Chaoqiong Xiao Modified comment(s), */
-/* resulting in version 6.1 */
+/* */
+/* This function finds the input format(s) for the input terminal. */
+/* */
+/* INPUT */
+/* */
+/* video Pointer to video class */
+/* */
+/* OUTPUT */
+/* */
+/* Completion Status */
+/* */
+/* CALLS */
+/* */
+/* _ux_utility_descriptor_parse Parse descriptor */
+/* _ux_system_error_handler Log system error */
+/* */
+/* CALLED BY */
+/* */
+/* Video Class */
/* */
/**************************************************************************/
UINT _ux_host_class_video_input_format_get(UX_HOST_CLASS_VIDEO *video)
@@ -85,10 +78,10 @@ ULONG descriptor_found;
/* Get the descriptor to the entire configuration. */
descriptor = video -> ux_host_class_video_configuration_descriptor;
total_descriptor_length = video -> ux_host_class_video_configuration_descriptor_length;
-
- /* Default is Interface descriptor not yet found. */
+
+ /* Default is Interface descriptor not yet found. */
descriptor_found = UX_FALSE;
-
+
/* Scan the descriptor for the Video Streaming interface. */
while (total_descriptor_length)
{
@@ -136,7 +129,7 @@ ULONG descriptor_found;
descriptor_found = UX_FALSE;
}
break;
-
+
case UX_HOST_CLASS_VIDEO_CS_INTERFACE:
@@ -150,11 +143,11 @@ ULONG descriptor_found;
case UX_HOST_CLASS_VIDEO_VS_INPUT_HEADER:
-
+
/* Make the descriptor machine independent. */
_ux_utility_descriptor_parse(descriptor, _ux_system_class_video_input_header_descriptor_structure,
UX_HOST_CLASS_VIDEO_INPUT_HEADER_DESCRIPTOR_ENTRIES, (UCHAR *) &input_header_descriptor);
-
+
/* Get the number of formats. */
video -> ux_host_class_video_number_formats = input_header_descriptor.bNumFormats;
@@ -170,7 +163,7 @@ ULONG descriptor_found;
}
}
break;
- }
+ }
/* Verify if the descriptor is still valid. */
if (descriptor_length > total_descriptor_length)
@@ -183,7 +176,7 @@ ULONG descriptor_found;
//UX_TRACE_IN_LINE_INSERT(UX_TRACE_ERROR, UX_DESCRIPTOR_CORRUPTED, descriptor, 0, 0, UX_TRACE_ERRORS, 0, 0)
return(UX_DESCRIPTOR_CORRUPTED);
- }
+ }
/* Jump to the next descriptor if we have not reached the end. */
descriptor += descriptor_length;
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 ecb10583..98d780d7 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
@@ -1,18 +1,19 @@
/***************************************************************************
- * Copyright (c) 2024 Microsoft Corporation
- *
+ * Copyright (c) 2024 Microsoft Corporation
+ * Copyright (c) 2026-present Eclipse ThreadX contributors
+ *
* This program and the accompanying materials are made available under the
* terms of the MIT License which is available at
* https://opensource.org/licenses/MIT.
- *
+ *
* SPDX-License-Identifier: MIT
**************************************************************************/
/**************************************************************************/
/**************************************************************************/
-/** */
-/** USBX Component */
+/** */
+/** USBX Component */
/** */
/** Video Class */
/** */
@@ -29,44 +30,36 @@
#include "ux_host_stack.h"
-/**************************************************************************/
-/* */
-/* FUNCTION RELEASE */
-/* */
-/* _ux_host_class_video_input_terminal_get PORTABLE C */
+/**************************************************************************/
+/* */
+/* FUNCTION RELEASE */
+/* */
+/* _ux_host_class_video_input_terminal_get PORTABLE C */
/* 6.1 */
/* AUTHOR */
/* */
/* Chaoqiong Xiao, Microsoft Corporation */
/* */
/* DESCRIPTION */
-/* */
-/* This function finds the input terminal in the config descriptor. */
-/* */
-/* INPUT */
-/* */
-/* video Pointer to video class */
-/* */
-/* OUTPUT */
-/* */
-/* Completion Status */
-/* */
-/* CALLS */
-/* */
+/* */
+/* This function finds the input terminal in the config descriptor. */
+/* */
+/* INPUT */
+/* */
+/* video Pointer to video class */
+/* */
+/* OUTPUT */
+/* */
+/* Completion Status */
+/* */
+/* CALLS */
+/* */
/* _ux_system_error_handler System error log */
-/* _ux_utility_descriptor_parse Parse descriptor */
-/* */
-/* CALLED BY */
-/* */
-/* Video Class */
-/* */
-/* RELEASE HISTORY */
-/* */
-/* DATE NAME DESCRIPTION */
-/* */
-/* 05-19-2020 Chaoqiong Xiao Initial Version 6.0 */
-/* 09-30-2020 Chaoqiong Xiao Modified comment(s), */
-/* resulting in version 6.1 */
+/* _ux_utility_descriptor_parse Parse descriptor */
+/* */
+/* CALLED BY */
+/* */
+/* Video Class */
/* */
/**************************************************************************/
UINT _ux_host_class_video_input_terminal_get(UX_HOST_CLASS_VIDEO *video)
@@ -80,12 +73,12 @@ ULONG descriptor_length;
ULONG descriptor_type;
ULONG descriptor_subtype;
ULONG interface_found;
-
+
/* 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 it yet. */
interface_found = UX_FALSE;
@@ -116,16 +109,16 @@ ULONG interface_found;
{
case UX_INTERFACE_DESCRIPTOR_ITEM:
-
+
/* Parse the interface descriptor and make it machine independent. */
_ux_utility_descriptor_parse(descriptor, _ux_system_interface_descriptor_structure,
UX_INTERFACE_DESCRIPTOR_ENTRIES, (UCHAR *) &interface_descriptor);
-
+
/* Ensure we have the correct interface for Video Control. */
if ((interface_descriptor.bInterfaceClass == UX_HOST_CLASS_VIDEO_CLASS) &&
(interface_descriptor.bInterfaceSubClass == UX_HOST_CLASS_VIDEO_SUBCLASS_CONTROL))
{
-
+
/* Mark we have found it. */
interface_found = UX_TRUE;
@@ -135,15 +128,15 @@ ULONG interface_found;
}
else
{
-
+
/* Haven't found it. */
interface_found = UX_FALSE;
}
break;
-
-
+
+
case UX_HOST_CLASS_VIDEO_CS_INTERFACE:
-
+
/* First make sure we have found the correct generic interface descriptor. */
if ((interface_found == UX_TRUE) && (descriptor_subtype == UX_HOST_CLASS_VIDEO_VC_INPUT_TERMINAL))
{
@@ -154,15 +147,15 @@ ULONG interface_found;
/* Save the video terminal ID. */
video -> ux_host_class_video_terminal_id = input_terminal_descriptor.bTerminalID;
-
+
/* Save the video terminal type. */
video -> ux_host_class_video_terminal_type = input_terminal_descriptor.wTerminalType;
-
+
/* We are done here. */
return(UX_SUCCESS);
}
-
+
break;
}
@@ -177,7 +170,7 @@ ULONG interface_found;
//UX_TRACE_IN_LINE_INSERT(UX_TRACE_ERROR, UX_DESCRIPTOR_CORRUPTED, descriptor, 0, 0, UX_TRACE_ERRORS, 0, 0)
return(UX_DESCRIPTOR_CORRUPTED);
- }
+ }
/* Jump to the next descriptor if we have not reached the end. */
descriptor += descriptor_length;
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 352db1ae..ee9d0620 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
@@ -1,10 +1,11 @@
/***************************************************************************
- * Copyright (c) 2024 Microsoft Corporation
- *
+ * Copyright (c) 2024 Microsoft Corporation
+ * Copyright (c) 2026-present Eclipse ThreadX contributors
+ *
* This program and the accompanying materials are made available under the
* terms of the MIT License which is available at
* https://opensource.org/licenses/MIT.
- *
+ *
* SPDX-License-Identifier: MIT
**************************************************************************/
@@ -71,20 +72,6 @@
/* */
/* Application */
/* */
-/* RELEASE HISTORY */
-/* */
-/* DATE NAME DESCRIPTION */
-/* */
-/* 05-19-2020 Chaoqiong Xiao Initial Version 6.0 */
-/* 09-30-2020 Chaoqiong Xiao Modified comment(s), */
-/* resulting in version 6.1 */
-/* 07-29-2022 Chaoqiong Xiao Modified comment(s), */
-/* reset indexes of requests */
-/* ring when it is aborted, */
-/* resulting in version 6.1.12 */
-/* 10-31-2023 Yajun xia Modified comment(s), */
-/* resulting in version 6.3.0 */
-/* */
/**************************************************************************/
UINT _ux_host_class_video_ioctl(UX_HOST_CLASS_VIDEO *video, ULONG ioctl_function,
VOID *parameter)
@@ -257,12 +244,6 @@ UX_HOST_CLASS_VIDEO_PARAMETER_FRAME_INTERVAL *interval_parameter;
/* */
/* Application */
/* */
-/* RELEASE HISTORY */
-/* */
-/* DATE NAME DESCRIPTION */
-/* */
-/* 10-31-2023 Yajun xia Initial Version 6.3.0 */
-/* */
/**************************************************************************/
UINT _uxe_host_class_video_ioctl(UX_HOST_CLASS_VIDEO *video, ULONG ioctl_function,
VOID *parameter)
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 4eff69ea..9d400e5b 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
@@ -1,10 +1,11 @@
/***************************************************************************
- * Copyright (c) 2024 Microsoft Corporation
- *
+ * Copyright (c) 2024 Microsoft Corporation
+ * Copyright (c) 2026-present Eclipse ThreadX contributors
+ *
* This program and the accompanying materials are made available under the
* terms of the MIT License which is available at
* https://opensource.org/licenses/MIT.
- *
+ *
* SPDX-License-Identifier: MIT
**************************************************************************/
@@ -60,14 +61,6 @@
/* */
/* Application */
/* */
-/* RELEASE HISTORY */
-/* */
-/* DATE NAME DESCRIPTION */
-/* */
-/* 05-19-2020 Chaoqiong Xiao Initial Version 6.0 */
-/* 09-30-2020 Chaoqiong Xiao Modified comment(s), */
-/* resulting in version 6.1 */
-/* */
/**************************************************************************/
ULONG _ux_host_class_video_max_payload_get(UX_HOST_CLASS_VIDEO *video)
{
@@ -106,12 +99,6 @@ ULONG _ux_host_class_video_max_payload_get(UX_HOST_CLASS_VIDEO *video)
/* */
/* Application */
/* */
-/* RELEASE HISTORY */
-/* */
-/* DATE NAME DESCRIPTION */
-/* */
-/* 10-31-2023 Yajun xia Initial Version 6.3.0 */
-/* */
/**************************************************************************/
ULONG _uxe_host_class_video_max_payload_get(UX_HOST_CLASS_VIDEO *video)
{
diff --git a/common/usbx_host_classes/src/ux_host_class_video_read.c b/common/usbx_host_classes/src/ux_host_class_video_read.c
index 0b08877d..7b13ad4f 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
@@ -1,10 +1,11 @@
/***************************************************************************
- * Copyright (c) 2024 Microsoft Corporation
- *
+ * Copyright (c) 2024 Microsoft Corporation
+ * Copyright (c) 2026-present Eclipse ThreadX contributors
+ *
* This program and the accompanying materials are made available under the
* terms of the MIT License which is available at
* https://opensource.org/licenses/MIT.
- *
+ *
* SPDX-License-Identifier: MIT
**************************************************************************/
@@ -72,24 +73,6 @@
/* Application */
/* Video Class */
/* */
-/* RELEASE HISTORY */
-/* */
-/* DATE NAME DESCRIPTION */
-/* */
-/* 05-19-2020 Chaoqiong Xiao Initial Version 6.0 */
-/* 09-30-2020 Chaoqiong Xiao Modified comment(s), */
-/* resulting in version 6.1 */
-/* 10-15-2021 Chaoqiong Xiao Modified comment(s), */
-/* used input request length */
-/* instead of wMaxPacketSize, */
-/* resulting in version 6.1.9 */
-/* 01-31-2022 Chaoqiong Xiao Modified comment(s), */
-/* refined macros names, */
-/* resulting in version 6.1.10 */
-/* 04-25-2022 Chaoqiong Xiao Modified comment(s), */
-/* fixed standalone compile, */
-/* resulting in version 6.1.11 */
-/* */
/**************************************************************************/
UINT _ux_host_class_video_read(UX_HOST_CLASS_VIDEO *video, UX_HOST_CLASS_VIDEO_TRANSFER_REQUEST *video_transfer_request)
{
@@ -176,12 +159,6 @@ UX_HOST_CLASS_VIDEO_TRANSFER_REQUEST *transfer_list;
/* Application */
/* Video Class */
/* */
-/* RELEASE HISTORY */
-/* */
-/* DATE NAME DESCRIPTION */
-/* */
-/* 10-31-2023 Yajun xia Initial Version 6.3.0 */
-/* */
/**************************************************************************/
UINT _uxe_host_class_video_read(UX_HOST_CLASS_VIDEO *video, UX_HOST_CLASS_VIDEO_TRANSFER_REQUEST *video_transfer_request)
{
diff --git a/common/usbx_host_classes/src/ux_host_class_video_start.c b/common/usbx_host_classes/src/ux_host_class_video_start.c
index 7b472ca8..52069969 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
@@ -1,10 +1,11 @@
/***************************************************************************
- * Copyright (c) 2024 Microsoft Corporation
- *
+ * Copyright (c) 2024 Microsoft Corporation
+ * Copyright (c) 2026-present Eclipse ThreadX contributors
+ *
* This program and the accompanying materials are made available under the
* terms of the MIT License which is available at
* https://opensource.org/licenses/MIT.
- *
+ *
* SPDX-License-Identifier: MIT
**************************************************************************/
@@ -59,14 +60,6 @@
/* */
/* Application */
/* */
-/* RELEASE HISTORY */
-/* */
-/* DATE NAME DESCRIPTION */
-/* */
-/* 05-19-2020 Chaoqiong Xiao Initial Version 6.0 */
-/* 09-30-2020 Chaoqiong Xiao Modified comment(s), */
-/* resulting in version 6.1 */
-/* */
/**************************************************************************/
UINT _ux_host_class_video_start(UX_HOST_CLASS_VIDEO *video)
{
@@ -122,12 +115,6 @@ UINT status;
/* */
/* Application */
/* */
-/* RELEASE HISTORY */
-/* */
-/* DATE NAME DESCRIPTION */
-/* */
-/* 10-31-2023 Yajun xia Initial Version 6.3.0 */
-/* */
/**************************************************************************/
UINT _uxe_host_class_video_start(UX_HOST_CLASS_VIDEO *video)
{
diff --git a/common/usbx_host_classes/src/ux_host_class_video_stop.c b/common/usbx_host_classes/src/ux_host_class_video_stop.c
index dbe5d538..96cfb00b 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
@@ -1,10 +1,11 @@
/***************************************************************************
- * Copyright (c) 2024 Microsoft Corporation
- *
+ * Copyright (c) 2024 Microsoft Corporation
+ * Copyright (c) 2026-present Eclipse ThreadX contributors
+ *
* This program and the accompanying materials are made available under the
* terms of the MIT License which is available at
* https://opensource.org/licenses/MIT.
- *
+ *
* SPDX-License-Identifier: MIT
**************************************************************************/
@@ -64,24 +65,6 @@
/* */
/* Video Class */
/* */
-/* RELEASE HISTORY */
-/* */
-/* DATE NAME DESCRIPTION */
-/* */
-/* 05-19-2020 Chaoqiong Xiao Initial Version 6.0 */
-/* 09-30-2020 Chaoqiong Xiao Modified comment(s), */
-/* resulting in version 6.1 */
-/* 01-31-2022 Chaoqiong Xiao Modified comment(s), */
-/* refined macros names, */
-/* resulting in version 6.1.10 */
-/* 04-25-2022 Chaoqiong Xiao Modified comment(s), */
-/* fixed standalone compile, */
-/* resulting in version 6.1.11 */
-/* 07-29-2022 Chaoqiong Xiao Modified comment(s), */
-/* fixed parameter/variable */
-/* names conflict C++ keyword, */
-/* resulting in version 6.1.12 */
-/* */
/**************************************************************************/
UINT _ux_host_class_video_stop(UX_HOST_CLASS_VIDEO *video)
{
@@ -183,12 +166,6 @@ UINT streaming_interface;
/* */
/* Video Class */
/* */
-/* RELEASE HISTORY */
-/* */
-/* DATE NAME DESCRIPTION */
-/* */
-/* 10-31-2023 Yajun xia Initial Version 6.3.0 */
-/* */
/**************************************************************************/
UINT _uxe_host_class_video_stop(UX_HOST_CLASS_VIDEO *video)
{
diff --git a/common/usbx_host_classes/src/ux_host_class_video_transfer_buffer_add.c b/common/usbx_host_classes/src/ux_host_class_video_transfer_buffer_add.c
index 7c3f2742..524dea8d 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
@@ -1,10 +1,11 @@
/***************************************************************************
- * Copyright (c) 2024 Microsoft Corporation
- *
+ * Copyright (c) 2024 Microsoft Corporation
+ * Copyright (c) 2026-present Eclipse ThreadX contributors
+ *
* This program and the accompanying materials are made available under the
* terms of the MIT License which is available at
* https://opensource.org/licenses/MIT.
- *
+ *
* SPDX-License-Identifier: MIT
**************************************************************************/
@@ -67,29 +68,6 @@
/* */
/* Application */
/* */
-/* RELEASE HISTORY */
-/* */
-/* DATE NAME DESCRIPTION */
-/* */
-/* 05-19-2020 Chaoqiong Xiao Initial Version 6.0 */
-/* 09-30-2020 Chaoqiong Xiao Modified comment(s), */
-/* resulting in version 6.1 */
-/* 10-15-2021 Chaoqiong Xiao Modified comment(s), */
-/* use pre-calculated value */
-/* instead of wMaxPacketSize, */
-/* resulting in version 6.1.9 */
-/* 01-31-2022 Chaoqiong Xiao Modified comment(s), */
-/* refined macros names, */
-/* resulting in version 6.1.10 */
-/* 04-25-2022 Chaoqiong Xiao Modified comment(s), */
-/* fixed standalone compile, */
-/* resulting in version 6.1.11 */
-/* 07-29-2022 Chaoqiong Xiao Modified comment(s), */
-/* set pending on endpoint, */
-/* resulting in version 6.1.12 */
-/* 10-31-2023 Yajun xia Modified comment(s), */
-/* resulting in version 6.3.0 */
-/* */
/**************************************************************************/
UINT _ux_host_class_video_transfer_buffer_add(UX_HOST_CLASS_VIDEO *video, UCHAR* buffer)
{
@@ -216,12 +194,6 @@ ULONG packet_size;
/* */
/* Application */
/* */
-/* RELEASE HISTORY */
-/* */
-/* DATE NAME DESCRIPTION */
-/* */
-/* 10-31-2023 Yajun xia Initial Version 6.3.0 */
-/* */
/**************************************************************************/
UINT _uxe_host_class_video_transfer_buffer_add(UX_HOST_CLASS_VIDEO *video, UCHAR* buffer)
{
diff --git a/common/usbx_host_classes/src/ux_host_class_video_transfer_buffers_add.c b/common/usbx_host_classes/src/ux_host_class_video_transfer_buffers_add.c
index eba553ef..4901e0c2 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
@@ -1,10 +1,11 @@
/***************************************************************************
- * Copyright (c) 2024 Microsoft Corporation
- *
+ * Copyright (c) 2024 Microsoft Corporation
+ * Copyright (c) 2026-present Eclipse ThreadX contributors
+ *
* This program and the accompanying materials are made available under the
* terms of the MIT License which is available at
* https://opensource.org/licenses/MIT.
- *
+ *
* SPDX-License-Identifier: MIT
**************************************************************************/
@@ -76,29 +77,6 @@
/* */
/* Application */
/* */
-/* RELEASE HISTORY */
-/* */
-/* DATE NAME DESCRIPTION */
-/* */
-/* 05-19-2020 Chaoqiong Xiao Initial Version 6.0 */
-/* 09-30-2020 Chaoqiong Xiao Modified comment(s), */
-/* resulting in version 6.1 */
-/* 10-15-2021 Chaoqiong Xiao Modified comment(s), */
-/* use pre-calculated value */
-/* instead of wMaxPacketSize, */
-/* resulting in version 6.1.9 */
-/* 01-31-2022 Chaoqiong Xiao Modified comment(s), */
-/* refined macros names, */
-/* resulting in version 6.1.10 */
-/* 04-25-2022 Chaoqiong Xiao Modified comment(s), */
-/* fixed standalone compile, */
-/* resulting in version 6.1.11 */
-/* 07-29-2022 Chaoqiong Xiao Modified comment(s), */
-/* set pending on endpoint, */
-/* resulting in version 6.1.12 */
-/* 10-31-2023 Yajun xia Modified comment(s), */
-/* resulting in version 6.3.0 */
-/* */
/**************************************************************************/
UINT _ux_host_class_video_transfer_buffers_add(UX_HOST_CLASS_VIDEO *video, UCHAR** buffers, ULONG num_buffers)
{
@@ -265,12 +243,6 @@ UINT i;
/* */
/* Application */
/* */
-/* RELEASE HISTORY */
-/* */
-/* DATE NAME DESCRIPTION */
-/* */
-/* 10-31-2023 Yajun xia Initial Version 6.3.0 */
-/* */
/**************************************************************************/
UINT _uxe_host_class_video_transfer_buffers_add(UX_HOST_CLASS_VIDEO *video, UCHAR** buffers, ULONG num_buffers)
{
diff --git a/common/usbx_host_classes/src/ux_host_class_video_transfer_callback_set.c b/common/usbx_host_classes/src/ux_host_class_video_transfer_callback_set.c
index 62a1eec8..1435aed4 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
@@ -1,10 +1,11 @@
/***************************************************************************
- * Copyright (c) 2024 Microsoft Corporation
- *
+ * Copyright (c) 2024 Microsoft Corporation
+ * Copyright (c) 2026-present Eclipse ThreadX contributors
+ *
* This program and the accompanying materials are made available under the
* terms of the MIT License which is available at
* https://opensource.org/licenses/MIT.
- *
+ *
* SPDX-License-Identifier: MIT
**************************************************************************/
@@ -60,14 +61,6 @@
/* */
/* Application */
/* */
-/* RELEASE HISTORY */
-/* */
-/* DATE NAME DESCRIPTION */
-/* */
-/* 05-19-2020 Chaoqiong Xiao Initial Version 6.0 */
-/* 09-30-2020 Chaoqiong Xiao Modified comment(s), */
-/* resulting in version 6.1 */
-/* */
/**************************************************************************/
VOID _ux_host_class_video_transfer_callback_set(UX_HOST_CLASS_VIDEO *video, VOID (*callback_function)(UX_TRANSFER*))
{
@@ -110,12 +103,6 @@ VOID _ux_host_class_video_transfer_callback_set(UX_HOST_CLASS_VIDEO *video, VOI
/* */
/* Application */
/* */
-/* RELEASE HISTORY */
-/* */
-/* DATE NAME DESCRIPTION */
-/* */
-/* 10-31-2023 Yajun xia Initial Version 6.3.0 */
-/* */
/**************************************************************************/
VOID _uxe_host_class_video_transfer_callback_set(UX_HOST_CLASS_VIDEO *video, VOID (*callback_function)(UX_TRANSFER*))
{
diff --git a/common/usbx_host_classes/src/ux_host_class_video_transfer_request.c b/common/usbx_host_classes/src/ux_host_class_video_transfer_request.c
index 110b4df5..685319f6 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
@@ -1,18 +1,19 @@
/***************************************************************************
- * Copyright (c) 2024 Microsoft Corporation
- *
+ * Copyright (c) 2024 Microsoft Corporation
+ * Copyright (c) 2026-present Eclipse ThreadX contributors
+ *
* This program and the accompanying materials are made available under the
* terms of the MIT License which is available at
* https://opensource.org/licenses/MIT.
- *
+ *
* SPDX-License-Identifier: MIT
**************************************************************************/
/**************************************************************************/
/**************************************************************************/
-/** */
-/** USBX Component */
+/** */
+/** USBX Component */
/** */
/** Video Class */
/** */
@@ -29,18 +30,18 @@
#include "ux_host_stack.h"
-/**************************************************************************/
-/* */
-/* FUNCTION RELEASE */
-/* */
-/* _ux_host_class_video_transfer_request PORTABLE C */
+/**************************************************************************/
+/* */
+/* FUNCTION RELEASE */
+/* */
+/* _ux_host_class_video_transfer_request PORTABLE C */
/* 6.1.12 */
/* AUTHOR */
/* */
/* Chaoqiong Xiao, Microsoft Corporation */
/* */
/* DESCRIPTION */
-/* */
+/* */
/* This function submits an isochronous video transfer request or */
/* isochronous video transfer request list to the USBX stack. */
/* */
@@ -48,33 +49,22 @@
/* a single request is submitted. If the transfer request links into a */
/* list, the whole list is submitted. */
/* */
-/* INPUT */
-/* */
-/* video Pointer to video class */
-/* video_transfer_request Pointer to transfer request */
-/* */
-/* OUTPUT */
-/* */
-/* Completion Status */
-/* */
-/* CALLS */
-/* */
-/* _ux_host_stack_transfer_request Process transfer request */
-/* */
-/* CALLED BY */
-/* */
-/* Video Class */
-/* */
-/* RELEASE HISTORY */
-/* */
-/* DATE NAME DESCRIPTION */
-/* */
-/* 05-19-2020 Chaoqiong Xiao Initial Version 6.0 */
-/* 09-30-2020 Chaoqiong Xiao Modified comment(s), */
-/* resulting in version 6.1 */
-/* 07-29-2022 Chaoqiong Xiao Modified comment(s), */
-/* set pending on endpoint, */
-/* resulting in version 6.1.12 */
+/* INPUT */
+/* */
+/* video Pointer to video class */
+/* video_transfer_request Pointer to transfer request */
+/* */
+/* OUTPUT */
+/* */
+/* Completion Status */
+/* */
+/* CALLS */
+/* */
+/* _ux_host_stack_transfer_request Process transfer request */
+/* */
+/* CALLED BY */
+/* */
+/* Video Class */
/* */
/**************************************************************************/
UINT _ux_host_class_video_transfer_request(UX_HOST_CLASS_VIDEO *video,
@@ -102,7 +92,7 @@ UX_TRANSFER *previous_transfer;
transfer_request = &video_transfer_request -> ux_host_class_video_transfer_request;
/* Select the direction. We do this by taking the endpoint direction. */
- transfer_request -> ux_transfer_request_type = video -> ux_host_class_video_isochronous_endpoint ->
+ transfer_request -> ux_transfer_request_type = video -> ux_host_class_video_isochronous_endpoint ->
ux_endpoint_descriptor.bEndpointAddress & UX_REQUEST_DIRECTION;
/* Fill the transfer request with all the required fields. */
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 f9245267..b056be7f 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
@@ -1,10 +1,11 @@
/***************************************************************************
- * Copyright (c) 2024 Microsoft Corporation
- *
+ * Copyright (c) 2024 Microsoft Corporation
+ * Copyright (c) 2026-present Eclipse ThreadX contributors
+ *
* This program and the accompanying materials are made available under the
* terms of the MIT License which is available at
* https://opensource.org/licenses/MIT.
- *
+ *
* SPDX-License-Identifier: MIT
**************************************************************************/
@@ -61,17 +62,6 @@
/* */
/* Video Class */
/* */
-/* RELEASE HISTORY */
-/* */
-/* DATE NAME DESCRIPTION */
-/* */
-/* 05-19-2020 Chaoqiong Xiao Initial Version 6.0 */
-/* 09-30-2020 Chaoqiong Xiao Modified comment(s), */
-/* resulting in version 6.1 */
-/* 07-29-2022 Chaoqiong Xiao Modified comment(s), */
-/* checked pending state, */
-/* resulting in version 6.1.12 */
-/* */
/**************************************************************************/
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 ee88d0c5..b09f2cf1 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
@@ -1,18 +1,19 @@
/***************************************************************************
- * Copyright (c) 2024 Microsoft Corporation
- *
+ * Copyright (c) 2024 Microsoft Corporation
+ * Copyright (c) 2026-present Eclipse ThreadX contributors
+ *
* This program and the accompanying materials are made available under the
* terms of the MIT License which is available at
* https://opensource.org/licenses/MIT.
- *
+ *
* SPDX-License-Identifier: MIT
**************************************************************************/
/**************************************************************************/
/**************************************************************************/
-/** */
-/** USBX Component */
+/** */
+/** USBX Component */
/** */
/** Video Class */
/** */
@@ -29,52 +30,44 @@
#include "ux_host_stack.h"
-/**************************************************************************/
-/* */
-/* FUNCTION RELEASE */
-/* */
-/* _ux_host_class_video_transfer_request_completed PORTABLE C */
+/**************************************************************************/
+/* */
+/* FUNCTION RELEASE */
+/* */
+/* _ux_host_class_video_transfer_request_completed PORTABLE C */
/* 6.1 */
/* AUTHOR */
/* */
/* Chaoqiong Xiao, Microsoft Corporation */
/* */
/* DESCRIPTION */
-/* */
-/* This function receives a completion call back on an isoch transfer */
-/* request. */
-/* */
-/* INPUT */
-/* */
-/* transfer_request Pointer to transfer request */
-/* */
-/* OUTPUT */
-/* */
-/* None */
-/* */
-/* CALLS */
-/* */
-/* (ux_host_class_video_transfer_request_completion_function) */
-/* Transfer request completion */
-/* */
-/* CALLED BY */
-/* */
-/* Video Class */
-/* */
-/* RELEASE HISTORY */
-/* */
-/* DATE NAME DESCRIPTION */
-/* */
-/* 05-19-2020 Chaoqiong Xiao Initial Version 6.0 */
-/* 09-30-2020 Chaoqiong Xiao Modified comment(s), */
-/* resulting in version 6.1 */
+/* */
+/* This function receives a completion call back on an isoch transfer */
+/* request. */
+/* */
+/* INPUT */
+/* */
+/* transfer_request Pointer to transfer request */
+/* */
+/* OUTPUT */
+/* */
+/* None */
+/* */
+/* CALLS */
+/* */
+/* (ux_host_class_video_transfer_request_completion_function) */
+/* Transfer request completion */
+/* */
+/* CALLED BY */
+/* */
+/* Video Class */
/* */
/**************************************************************************/
VOID _ux_host_class_video_transfer_request_completed(UX_TRANSFER *transfer_request)
{
UX_HOST_CLASS_VIDEO_TRANSFER_REQUEST *video_transfer_request;
-
+
/* Get the pointer to the video specific transfer request, by nature of the lined transfer requests,
the corresponding transfer request has to be the head transfer request in the video instance. */
@@ -87,7 +80,7 @@ UX_HOST_CLASS_VIDEO_TRANSFER_REQUEST *video_transfer_request;
/* The caller's transfer request needs to be updated. */
video_transfer_request -> ux_host_class_video_transfer_request_actual_length = transfer_request -> ux_transfer_request_actual_length;
video_transfer_request -> ux_host_class_video_transfer_request_completion_code = transfer_request -> ux_transfer_request_completion_code;
-
+
/* Call the completion routine. */
video_transfer_request -> ux_host_class_video_transfer_request_completion_function(video_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 598580c9..eec2cb63 100644
--- a/common/usbx_host_controllers/inc/ux_hcd_ehci.h
+++ b/common/usbx_host_controllers/inc/ux_hcd_ehci.h
@@ -1,18 +1,19 @@
/***************************************************************************
- * Copyright (c) 2024 Microsoft Corporation
- *
+ * Copyright (c) 2024 Microsoft Corporation
+ * Copyright (c) 2026-present Eclipse ThreadX contributors
+ *
* This program and the accompanying materials are made available under the
* terms of the MIT License which is available at
* https://opensource.org/licenses/MIT.
- *
+ *
* SPDX-License-Identifier: MIT
**************************************************************************/
/**************************************************************************/
/**************************************************************************/
-/** */
-/** USBX Component */
+/** */
+/** USBX Component */
/** */
/** EHCI Controller */
/** */
@@ -20,55 +21,35 @@
/**************************************************************************/
-/**************************************************************************/
-/* */
-/* COMPONENT DEFINITION RELEASE */
-/* */
-/* ux_hcd_ehci.h PORTABLE C */
+/**************************************************************************/
+/* */
+/* COMPONENT DEFINITION RELEASE */
+/* */
+/* ux_hcd_ehci.h PORTABLE C */
/* 6.1.8 */
/* AUTHOR */
/* */
/* Chaoqiong Xiao, Microsoft Corporation */
/* */
/* DESCRIPTION */
-/* */
+/* */
/* This file contains all the header and extern functions used by the */
-/* USBX host EHCI Controller. */
-/* */
-/* RELEASE HISTORY */
-/* */
-/* 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 */
-/* 11-09-2020 Chaoqiong Xiao Modified comment(s), */
-/* used unsigned defines, */
-/* named unions and structs, */
-/* resulting in version 6.1.2 */
-/* 08-02-2021 Chaoqiong Xiao Modified comment(s), */
-/* fixed spelling error, */
-/* added extern "C" keyword */
-/* for compatibility with C++, */
-/* resulting in version 6.1.8 */
+/* USBX host EHCI Controller. */
/* */
/**************************************************************************/
#ifndef UX_HCD_EHCI_H
#define UX_HCD_EHCI_H
-/* Determine if a C++ compiler is being used. If so, ensure that standard
- C is used to process the API information. */
+/* Determine if a C++ compiler is being used. If so, ensure that standard
+ C is used to process the API information. */
-#ifdef __cplusplus
+#ifdef __cplusplus
-/* Yes, C++ compiler is present. Use standard C. */
-extern "C" {
+/* Yes, C++ compiler is present. Use standard C. */
+extern "C" {
-#endif
+#endif
/* Possible defined EHCI HCD extensions. */
@@ -86,7 +67,7 @@ extern "C" {
#define UX_EHCI_CONTROLLER 2
#define UX_EHCI_MAX_PAYLOAD 16384
-#define UX_EHCI_FRAME_DELAY 4
+#define UX_EHCI_FRAME_DELAY 4
#define UX_EHCI_PAGE_SIZE 4096
#define UX_EHCI_PAGE_ALIGN 0xfffff000
@@ -128,7 +109,7 @@ extern "C" {
/* The number if entries in the periodic tree can be changed to save space IF and only IF the PFLF flag in the HCCPARAMS register
allows it. Setting values less than 1024 in controllers without the ability to change the Frame List Size leads to a EHCI crash. */
-
+
#ifndef UX_EHCI_FRAME_LIST_ENTRIES
#define UX_EHCI_FRAME_LIST_ENTRIES 1024
#endif
@@ -335,30 +316,30 @@ typedef union UX_EHCI_PERIODIC_LINK_POINTER_UNION {
/* Define the EHCI structure. */
typedef struct UX_HCD_EHCI_STRUCT
-{
+{
struct UX_HCD_STRUCT
*ux_hcd_ehci_hcd_owner;
ULONG ux_hcd_ehci_hcor;
- struct UX_EHCI_ED_STRUCT
+ struct UX_EHCI_ED_STRUCT
**ux_hcd_ehci_frame_list;
ULONG *ux_hcd_ehci_base;
UINT ux_hcd_ehci_nb_root_hubs;
- struct UX_EHCI_TD_STRUCT
+ struct UX_EHCI_TD_STRUCT
*ux_hcd_ehci_done_head;
- struct UX_EHCI_ED_STRUCT
+ struct UX_EHCI_ED_STRUCT
*ux_hcd_ehci_ed_list;
- struct UX_EHCI_TD_STRUCT
+ struct UX_EHCI_TD_STRUCT
*ux_hcd_ehci_td_list;
- struct UX_EHCI_FSISO_TD_STRUCT
+ struct UX_EHCI_FSISO_TD_STRUCT
*ux_hcd_ehci_fsiso_td_list;
- struct UX_EHCI_HSISO_TD_STRUCT
+ struct UX_EHCI_HSISO_TD_STRUCT
*ux_hcd_ehci_hsiso_td_list;
- struct UX_EHCI_ED_STRUCT
+ struct UX_EHCI_ED_STRUCT
*ux_hcd_ehci_asynch_head_list;
- struct UX_EHCI_ED_STRUCT
+ struct UX_EHCI_ED_STRUCT
*ux_hcd_ehci_asynch_first_list;
- struct UX_EHCI_ED_STRUCT
+ struct UX_EHCI_ED_STRUCT
*ux_hcd_ehci_asynch_last_list;
struct UX_EHCI_HSISO_TD_STRUCT
*ux_hcd_ehci_hsiso_scan_list;
@@ -379,26 +360,26 @@ typedef struct UX_HCD_EHCI_STRUCT
} UX_HCD_EHCI;
-/* Define EHCI ED structure. */
+/* Define EHCI ED structure. */
typedef struct UX_EHCI_ED_STRUCT
-{
+{
- struct UX_EHCI_ED_STRUCT
+ struct UX_EHCI_ED_STRUCT
*ux_ehci_ed_queue_head;
ULONG ux_ehci_ed_cap0;
ULONG ux_ehci_ed_cap1;
- struct UX_EHCI_TD_STRUCT
+ struct UX_EHCI_TD_STRUCT
*ux_ehci_ed_current_td;
- struct UX_EHCI_TD_STRUCT
+ struct UX_EHCI_TD_STRUCT
*ux_ehci_ed_queue_element;
- struct UX_EHCI_TD_STRUCT
+ struct UX_EHCI_TD_STRUCT
*ux_ehci_ed_alternate_td;
ULONG ux_ehci_ed_state;
- VOID *ux_ehci_ed_bp0;
- VOID *ux_ehci_ed_bp1;
- VOID *ux_ehci_ed_bp2;
- VOID *ux_ehci_ed_bp3;
+ VOID *ux_ehci_ed_bp0;
+ VOID *ux_ehci_ed_bp1;
+ VOID *ux_ehci_ed_bp2;
+ VOID *ux_ehci_ed_bp3;
VOID *ux_ehci_ed_bp4;
/* 12 DWords, 48 bytes QH for controller end. */
@@ -455,7 +436,7 @@ typedef struct UX_EHCI_ED_STRUCT
#define UX_EHCI_QH_MPS_MASK 0x07ff0000u
#define UX_EHCI_QH_NCR 0xf0000000u
#define UX_EHCI_QH_CEF 0x08000000u
-#define UX_EHCI_QH_ED_AD_LOC 8u
+#define UX_EHCI_QH_ED_AD_LOC 8u
#define UX_EHCI_QH_HBPM 0x40000000u
#define UX_EHCI_QH_HBPM_LOC 30u
#define UX_EHCI_QH_HEAD 0x00008000u
@@ -489,24 +470,24 @@ typedef struct UX_EHCI_ED_STRUCT
/* Define EHCI TD structure. */
typedef struct UX_EHCI_TD_STRUCT
-{
+{
- struct UX_EHCI_TD_STRUCT
+ struct UX_EHCI_TD_STRUCT
*ux_ehci_td_link_pointer;
- struct UX_EHCI_TD_STRUCT
+ struct UX_EHCI_TD_STRUCT
*ux_ehci_td_alternate_link_pointer;
ULONG ux_ehci_td_control;
- VOID *ux_ehci_td_bp0;
- VOID *ux_ehci_td_bp1;
- VOID *ux_ehci_td_bp2;
- VOID *ux_ehci_td_bp3;
- VOID *ux_ehci_td_bp4;
+ VOID *ux_ehci_td_bp0;
+ VOID *ux_ehci_td_bp1;
+ VOID *ux_ehci_td_bp2;
+ VOID *ux_ehci_td_bp3;
+ VOID *ux_ehci_td_bp4;
/* 8-DWords, 32-bytes qTD for controller. */
- struct UX_TRANSFER_STRUCT
+ struct UX_TRANSFER_STRUCT
*ux_ehci_td_transfer_request;
- struct UX_EHCI_TD_STRUCT
+ struct UX_EHCI_TD_STRUCT
*ux_ehci_td_next_td_transfer_request;
- struct UX_EHCI_ED_STRUCT
+ struct UX_EHCI_ED_STRUCT
*ux_ehci_td_ed;
ULONG ux_ehci_td_length;
ULONG ux_ehci_td_status;
@@ -538,9 +519,9 @@ typedef struct UX_EHCI_TD_STRUCT
#define UX_EHCI_PID_SETUP 0x00000200u
#define UX_EHCI_PID_MASK 0x00000300u
-#define UX_EHCI_TD_SETUP_PHASE 0x00010000u
-#define UX_EHCI_TD_DATA_PHASE 0x00020000u
-#define UX_EHCI_TD_STATUS_PHASE 0x00040000u
+#define UX_EHCI_TD_SETUP_PHASE 0x00010000u
+#define UX_EHCI_TD_DATA_PHASE 0x00020000u
+#define UX_EHCI_TD_STATUS_PHASE 0x00040000u
/* Define EHCI ISOCHRONOUS TD extension structure. */
@@ -576,7 +557,7 @@ typedef struct UX_EHCI_HSISO_TD_STRUCT
union UX_EHCI_PERIODIC_LINK_POINTER_UNION
ux_ehci_hsiso_td_next_lp;
ULONG ux_ehci_hsiso_td_control[8];
- VOID *ux_ehci_hsiso_td_bp[7];
+ VOID *ux_ehci_hsiso_td_bp[7];
/* 16 DWords, 64-bytes iTD for controller end. */
UCHAR ux_ehci_hsiso_td_status;
UCHAR ux_ehci_hsiso_td_frload; /* REQ load map. */
@@ -584,9 +565,9 @@ typedef struct UX_EHCI_HSISO_TD_STRUCT
union UX_EHCI_PERIODIC_LINK_POINTER_UNION
ux_ehci_hsiso_td_previous_lp;
struct UX_EHCI_HSISO_TD_STRUCT
- *ux_ehci_hsiso_td_next_scan_td;
+ *ux_ehci_hsiso_td_next_scan_td;
struct UX_EHCI_HSISO_TD_STRUCT
- *ux_ehci_hsiso_td_previous_scan_td;
+ *ux_ehci_hsiso_td_previous_scan_td;
struct UX_TRANSFER_STRUCT
*ux_ehci_hsiso_td_fr_transfer[3];
struct UX_EHCI_HSISO_ED_STRUCT
@@ -673,9 +654,9 @@ typedef struct UX_EHCI_FSISO_TD_STRUCT
UCHAR reserved[1];
struct UX_ENDPOINT_STRUCT
*ux_ehci_fsiso_td_endpoint;
- struct UX_TRANSFER_STRUCT
+ struct UX_TRANSFER_STRUCT
*ux_ehci_fsiso_td_transfer_head;
- struct UX_TRANSFER_STRUCT
+ struct UX_TRANSFER_STRUCT
*ux_ehci_fsiso_td_transfer_tail;
union UX_EHCI_PERIODIC_LINK_POINTER_UNION
ux_ehci_fsiso_td_previous_lp;
@@ -841,11 +822,11 @@ VOID _ux_hcd_ehci_transfer_request_process(UX_TRANSFER *transfer_request);
#define ux_hcd_ehci_initialize _ux_hcd_ehci_initialize
#define ux_hcd_ehci_interrupt_handler _ux_hcd_ehci_interrupt_handler
-/* Determine if a C++ compiler is being used. If so, complete the standard
- C conditional started above. */
+/* Determine if a C++ compiler is being used. If so, complete the standard
+ C conditional started above. */
#ifdef __cplusplus
-}
-#endif
+}
+#endif
#endif
diff --git a/common/usbx_host_controllers/inc/ux_hcd_ohci.h b/common/usbx_host_controllers/inc/ux_hcd_ohci.h
index dc0cc6dd..43796087 100644
--- a/common/usbx_host_controllers/inc/ux_hcd_ohci.h
+++ b/common/usbx_host_controllers/inc/ux_hcd_ohci.h
@@ -1,18 +1,19 @@
/***************************************************************************
- * Copyright (c) 2024 Microsoft Corporation
- *
+ * Copyright (c) 2024 Microsoft Corporation
+ * Copyright (c) 2026-present Eclipse ThreadX contributors
+ *
* This program and the accompanying materials are made available under the
* terms of the MIT License which is available at
* https://opensource.org/licenses/MIT.
- *
+ *
* SPDX-License-Identifier: MIT
**************************************************************************/
/**************************************************************************/
/**************************************************************************/
-/** */
-/** USBX Component */
+/** */
+/** USBX Component */
/** */
/** OHCI Controller Driver */
/** */
@@ -20,63 +21,42 @@
/**************************************************************************/
-/**************************************************************************/
-/* */
-/* COMPONENT DEFINITION RELEASE */
-/* */
-/* ux_hcd_ohci.h PORTABLE C */
+/**************************************************************************/
+/* */
+/* COMPONENT DEFINITION RELEASE */
+/* */
+/* ux_hcd_ohci.h PORTABLE C */
/* 6.1.12 */
/* AUTHOR */
/* */
/* Chaoqiong Xiao, Microsoft Corporation */
/* */
/* DESCRIPTION */
-/* */
+/* */
/* This file contains all the header and extern functions used by the */
-/* USBX host OHCI Controller. */
-/* */
-/* RELEASE HISTORY */
-/* */
-/* DATE NAME DESCRIPTION */
-/* */
-/* 05-19-2020 Chaoqiong Xiao Initial Version 6.0 */
-/* 09-30-2020 Chaoqiong Xiao Modified comment(s), */
-/* resulting in version 6.1 */
-/* 11-09-2020 Chaoqiong Xiao Modified comment(s), */
-/* used unsigned defines, */
-/* resulting in version 6.1.2 */
-/* 08-02-2021 Chaoqiong Xiao Modified comment(s), */
-/* added extern "C" keyword */
-/* for compatibility with C++, */
-/* resulting in version 6.1.8 */
-/* 01-31-2022 Xiuwen Cai Modified comment(s), */
-/* fixed HcPeriodicStart value,*/
-/* resulting in version 6.1.10 */
-/* 07-29-2022 Yajun Xia Modified comment(s), */
-/* fixed OHCI PRSC issue, */
-/* resulting in version 6.1.12 */
+/* USBX host OHCI Controller. */
/* */
/**************************************************************************/
#ifndef UX_HCD_OHCI_H
#define UX_HCD_OHCI_H
-/* Determine if a C++ compiler is being used. If so, ensure that standard
- C is used to process the API information. */
+/* Determine if a C++ compiler is being used. If so, ensure that standard
+ C is used to process the API information. */
-#ifdef __cplusplus
+#ifdef __cplusplus
-/* Yes, C++ compiler is present. Use standard C. */
-extern "C" {
+/* Yes, C++ compiler is present. Use standard C. */
+extern "C" {
-#endif
+#endif
/* Define generic OHCI constants. */
#define UX_OHCI_CONTROLLER 1
#define UX_OHCI_MAX_PAYLOAD 4096
-#define UX_OHCI_FRAME_DELAY 4u
+#define UX_OHCI_FRAME_DELAY 4u
/* Define OHCI HCOR register mapping. */
@@ -111,22 +91,22 @@ extern "C" {
#define OHCI_HC_CR_CBSR_1 0x00000001u
#define OHCI_HC_CR_CBSR_2 0x00000002u
#define OHCI_HC_CR_CBSR_3 0x00000003u
-#define OHCI_HC_CR_PLE 0x00000004u
-#define OHCI_HC_CR_IE 0x00000008u
-#define OHCI_HC_CR_CLE 0x00000010u
-#define OHCI_HC_CR_BLE 0x00000020u
+#define OHCI_HC_CR_PLE 0x00000004u
+#define OHCI_HC_CR_IE 0x00000008u
+#define OHCI_HC_CR_CLE 0x00000010u
+#define OHCI_HC_CR_BLE 0x00000020u
#define OHCI_HC_CR_RESET 0x00000000u
#define OHCI_HC_CR_RESUME 0x00000040u
#define OHCI_HC_CR_OPERATIONAL 0x00000080u
#define OHCI_HC_CR_SUSPEND 0x000000c0u
-#define OHCI_HC_CR_IR 0x00000100u
-#define OHCI_HC_CR_RWC 0x00000200u
-#define OHCI_HC_CR_RWE 0x00000400u
+#define OHCI_HC_CR_IR 0x00000100u
+#define OHCI_HC_CR_RWC 0x00000200u
+#define OHCI_HC_CR_RWE 0x00000400u
#define OHCI_HC_CONTROL_VALUE (OHCI_HC_CR_CBSR_3 | OHCI_HC_CR_OPERATIONAL | OHCI_HC_CR_PLE | OHCI_HC_CR_IE | OHCI_HC_CR_CLE | OHCI_HC_CR_BLE)
-/* Define OHCI HCOR command/status bitmaps. */
+/* Define OHCI HCOR command/status bitmaps. */
#define OHCI_HC_CS_HCR 0x00000001u
#define OHCI_HC_CS_CLF 0x00000002u
@@ -166,7 +146,7 @@ extern "C" {
#define OHCI_HC_INT_SO 0x00000001u
#define OHCI_HC_INT_WDH 0x00000002u
-#define OHCI_HC_INT_SF 0x00000004u
+#define OHCI_HC_INT_SF 0x00000004u
#define OHCI_HC_INT_RD 0x00000008u
#define OHCI_HC_INT_UE 0x00000010u
#define OHCI_HC_INT_FNO 0x00000020u
@@ -176,7 +156,7 @@ extern "C" {
#define OHCI_HC_INT_MIE 0x80000000u
-#define OHCI_HC_INTERRUPT_ENABLE_NORMAL (OHCI_HC_INT_WDH | OHCI_HC_INT_RD | OHCI_HC_INT_UE | OHCI_HC_INT_RHSC | OHCI_HC_INT_MIE)
+#define OHCI_HC_INTERRUPT_ENABLE_NORMAL (OHCI_HC_INT_WDH | OHCI_HC_INT_RD | OHCI_HC_INT_UE | OHCI_HC_INT_RHSC | OHCI_HC_INT_MIE)
#define OHCI_HC_INTERRUPT_DISABLE_ALL (OHCI_HC_INT_SO | \
OHCI_HC_INT_WDH | \
@@ -240,7 +220,7 @@ typedef struct UX_HCD_OHCI_HCCA_STRUCT
*ux_hcd_ohci_hcca_ed[32];
USHORT ux_hcd_ohci_hcca_frame_number;
USHORT ux_hcd_ohci_hcca_reserved1;
- struct UX_OHCI_TD_STRUCT
+ struct UX_OHCI_TD_STRUCT
*ux_hcd_ohci_hcca_done_head;
UCHAR ux_hcd_ohci_hcca_reserved2[116];
} UX_HCD_OHCI_HCCA;
@@ -251,19 +231,19 @@ typedef struct UX_HCD_OHCI_HCCA_STRUCT
typedef struct UX_HCD_OHCI_STRUCT
{
- struct UX_HCD_STRUCT
+ struct UX_HCD_STRUCT
*ux_hcd_ohci_hcd_owner;
- struct UX_HCD_OHCI_HCCA_STRUCT
+ struct UX_HCD_OHCI_HCCA_STRUCT
*ux_hcd_ohci_hcca;
ULONG *ux_hcd_ohci_hcor;
UINT ux_hcd_ohci_nb_root_hubs;
- struct UX_OHCI_TD_STRUCT
+ struct UX_OHCI_TD_STRUCT
*ux_hcd_ohci_done_head;
- struct UX_OHCI_ED_STRUCT
+ struct UX_OHCI_ED_STRUCT
*ux_hcd_ohci_ed_list;
- struct UX_OHCI_TD_STRUCT
+ struct UX_OHCI_TD_STRUCT
*ux_hcd_ohci_td_list;
- struct UX_OHCI_ISO_TD_STRUCT
+ struct UX_OHCI_ISO_TD_STRUCT
*ux_hcd_ohci_iso_td_list;
UX_EVENT_FLAGS_GROUP
ux_hcd_ohci_event_flags_group;
@@ -276,16 +256,16 @@ typedef struct UX_OHCI_ED_STRUCT
{
ULONG ux_ohci_ed_dw0;
- struct UX_OHCI_TD_STRUCT
+ struct UX_OHCI_TD_STRUCT
*ux_ohci_ed_tail_td;
- struct UX_OHCI_TD_STRUCT
+ struct UX_OHCI_TD_STRUCT
*ux_ohci_ed_head_td;
- struct UX_OHCI_ED_STRUCT
+ struct UX_OHCI_ED_STRUCT
*ux_ohci_ed_next_ed;
- struct UX_OHCI_ED_STRUCT
+ struct UX_OHCI_ED_STRUCT
*ux_ohci_ed_previous_ed;
ULONG ux_ohci_ed_status;
- struct UX_ENDPOINT_STRUCT
+ struct UX_ENDPOINT_STRUCT
*ux_ohci_ed_endpoint;
ULONG ux_ohci_ed_frame;
} UX_OHCI_ED;
@@ -303,24 +283,24 @@ typedef struct UX_OHCI_ED_STRUCT
#define UX_OHCI_ED_MASK_TD (~0x00000003u)
#define UX_OHCI_ED_OUT 0x0800u
-#define UX_OHCI_ED_IN 0x1000u
+#define UX_OHCI_ED_IN 0x1000u
/* Define OHCI TD structure. */
typedef struct UX_OHCI_TD_STRUCT
-{
+{
ULONG ux_ohci_td_dw0;
UCHAR * ux_ohci_td_cbp;
- struct UX_OHCI_TD_STRUCT
+ struct UX_OHCI_TD_STRUCT
*ux_ohci_td_next_td;
UCHAR * ux_ohci_td_be;
ULONG ux_ohci_td_reserved_1[4];
- struct UX_TRANSFER_STRUCT
+ struct UX_TRANSFER_STRUCT
*ux_ohci_td_transfer_request;
- struct UX_OHCI_TD_STRUCT
+ struct UX_OHCI_TD_STRUCT
*ux_ohci_td_next_td_transfer_request;
- struct UX_OHCI_ED_STRUCT
+ struct UX_OHCI_ED_STRUCT
*ux_ohci_td_ed;
ULONG ux_ohci_td_length;
ULONG ux_ohci_td_status;
@@ -333,13 +313,13 @@ typedef struct UX_OHCI_TD_STRUCT
#define UX_OHCI_TD_OUT 0x00080000u
#define UX_OHCI_TD_IN 0x00100000u
#define UX_OHCI_TD_DEFAULT_DW0 0xf0000000u
-#define UX_OHCI_TD_DATA0 0x02000000u
-#define UX_OHCI_TD_DATA1 0x03000000u
-#define UX_OHCI_TD_R 0x00040000u
+#define UX_OHCI_TD_DATA0 0x02000000u
+#define UX_OHCI_TD_DATA1 0x03000000u
+#define UX_OHCI_TD_R 0x00040000u
-#define UX_OHCI_TD_SETUP_PHASE 0x00010000u
-#define UX_OHCI_TD_DATA_PHASE 0x00020000u
-#define UX_OHCI_TD_STATUS_PHASE 0x00040000u
+#define UX_OHCI_TD_SETUP_PHASE 0x00010000u
+#define UX_OHCI_TD_DATA_PHASE 0x00020000u
+#define UX_OHCI_TD_STATUS_PHASE 0x00040000u
#define UX_OHCI_TD_CC 28u
@@ -350,15 +330,15 @@ typedef struct UX_OHCI_ISO_TD_STRUCT
ULONG ux_ohci_iso_td_dw0;
UCHAR * ux_ohci_iso_td_bp0;
- struct UX_OHCI_TD_STRUCT
+ struct UX_OHCI_TD_STRUCT
*ux_ohci_iso_td_next_td;
UCHAR * ux_ohci_iso_td_be;
USHORT ux_ohci_iso_td_offset_psw[8];
- struct UX_TRANSFER_STRUCT
+ struct UX_TRANSFER_STRUCT
*ux_ohci_iso_td_transfer_request;
- struct UX_OHCI_TD_STRUCT
+ struct UX_OHCI_TD_STRUCT
*ux_ohci_iso_td_next_td_transfer_request;
- struct UX_OHCI_ED_STRUCT
+ struct UX_OHCI_ED_STRUCT
*ux_ohci_iso_td_ed;
ULONG ux_ohci_iso_td_length;
ULONG ux_ohci_iso_td_status;
@@ -418,11 +398,11 @@ VOID _ux_hcd_ohci_transfer_request_process(UX_TRANSFER *transfer_request);
#define ux_hcd_ohci_initialize _ux_hcd_ohci_initialize
#define ux_hcd_ohci_interrupt_handler _ux_hcd_ohci_interrupt_handler
-/* Determine if a C++ compiler is being used. If so, complete the standard
- C conditional started above. */
+/* Determine if a C++ compiler is being used. If so, complete the standard
+ C conditional started above. */
#ifdef __cplusplus
-}
-#endif
+}
+#endif
#endif
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 ad8473a5..b4576cb8 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
@@ -1,18 +1,19 @@
/***************************************************************************
- * Copyright (c) 2024 Microsoft Corporation
- *
+ * Copyright (c) 2024 Microsoft Corporation
+ * Copyright (c) 2026-present Eclipse ThreadX contributors
+ *
* This program and the accompanying materials are made available under the
* terms of the MIT License which is available at
* https://opensource.org/licenses/MIT.
- *
+ *
* SPDX-License-Identifier: MIT
**************************************************************************/
/**************************************************************************/
/**************************************************************************/
-/** */
-/** USBX Component */
+/** */
+/** USBX Component */
/** */
/** EHCI Controller Driver */
/** */
@@ -29,52 +30,41 @@
#include "ux_host_stack.h"
-/**************************************************************************/
-/* */
-/* FUNCTION RELEASE */
-/* */
-/* _ux_hcd_ehci_asynch_td_process PORTABLE C */
+/**************************************************************************/
+/* */
+/* FUNCTION RELEASE */
+/* */
+/* _ux_hcd_ehci_asynch_td_process PORTABLE C */
/* 6.1.10 */
/* AUTHOR */
/* */
/* Chaoqiong Xiao, Microsoft Corporation */
/* */
/* DESCRIPTION */
-/* */
-/* This function processes the isochronous, periodic and asynchronous */
-/* lists in search for transfers that occurred in the past */
-/* (micro-)frame. */
-/* */
-/* INPUT */
-/* */
-/* ed Pointer to ED */
-/* td Pointer to TD */
-/* */
-/* OUTPUT */
-/* */
-/* UX_EHCI_TD * Pointer to TD */
-/* */
-/* CALLS */
-/* */
-/* (ux_transfer_request_completion_function) Completion function */
-/* _ux_hcd_ehci_ed_clean Clean ED */
-/* _ux_host_semaphore_put Put semaphore */
-/* _ux_utility_virtual_address Get virtual address */
-/* */
-/* CALLED BY */
-/* */
+/* */
+/* This function processes the isochronous, periodic and asynchronous */
+/* lists in search for transfers that occurred in the past */
+/* (micro-)frame. */
+/* */
+/* INPUT */
+/* */
+/* ed Pointer to ED */
+/* td Pointer to TD */
+/* */
+/* OUTPUT */
+/* */
+/* UX_EHCI_TD * Pointer to TD */
+/* */
+/* CALLS */
+/* */
+/* (ux_transfer_request_completion_function) Completion function */
+/* _ux_hcd_ehci_ed_clean Clean ED */
+/* _ux_host_semaphore_put Put semaphore */
+/* _ux_utility_virtual_address Get virtual address */
+/* */
+/* CALLED BY */
+/* */
/* EHCI Controller Driver */
-/* */
-/* RELEASE HISTORY */
-/* */
-/* DATE NAME DESCRIPTION */
-/* */
-/* 05-19-2020 Chaoqiong Xiao Initial Version 6.0 */
-/* 09-30-2020 Chaoqiong Xiao Modified comment(s), */
-/* resulting in version 6.1 */
-/* 01-31-2022 Chaoqiong Xiao Modified comment(s), */
-/* refined macros names, */
-/* resulting in version 6.1.10 */
/* */
/**************************************************************************/
UX_EHCI_TD *_ux_hcd_ehci_asynch_td_process(UX_EHCI_ED *ed, UX_EHCI_TD *td)
@@ -88,23 +78,23 @@ ULONG td_element;
ULONG pid;
- /* If the TD is still active, we know that the transfer has not taken place yet. In this case,
+ /* If the TD is still active, we know that the transfer has not taken place yet. In this case,
the TDs following this one do not need to be process and we return a NULL TD. */
if (td -> ux_ehci_td_control & UX_EHCI_TD_ACTIVE)
return(UX_NULL);
-
+
/* We need the transfer request associated with this TD. */
transfer_request = td -> ux_ehci_td_transfer_request;
-
- /* We have a non active TD, meaning the TD was processed. We should explore the error code and
+
+ /* We have a non active TD, meaning the TD was processed. We should explore the error code and
translate it into a generic USBX code. */
td_error = UX_SUCCESS;
-
+
/* Check if the TD was halted due to a major error. Note that the error status may contain an error
but unless the Halt bit is set, it is not fatal. */
if (td -> ux_ehci_td_control & UX_EHCI_TD_HALTED)
{
-
+
/* Default to STALL. */
td_error = UX_TRANSFER_STALLED;
@@ -115,20 +105,20 @@ ULONG pid;
/* Babble ? */
if (td -> ux_ehci_td_control & UX_EHCI_TD_BABBLE_DETECTED)
td_error = UX_TRANSFER_ERROR;
-
+
/* Timeout, CRD, Bad PID ... ? */
if (td -> ux_ehci_td_control & UX_EHCI_TD_TRANSACTION_ERROR)
td_error = UX_TRANSFER_NO_ANSWER;
}
-
+
/* If there is an error, we should terminate this transfer and clean things. */
if (td_error != UX_SUCCESS)
{
/* Update the transfer code. */
transfer_request -> ux_transfer_request_completion_code = td_error;
-
+
/* Clean the link. */
_ux_hcd_ehci_ed_clean(ed);
@@ -141,7 +131,7 @@ ULONG pid;
/* Notify the application for debugging purposes. */
_ux_system_error_handler(UX_SYSTEM_LEVEL_THREAD, UX_SYSTEM_CONTEXT_HCD, td_error);
-
+
/* If trace is enabled, insert this event into the trace buffer. */
UX_TRACE_IN_LINE_INSERT(UX_TRACE_ERROR, td_error, transfer_request, 0, 0, UX_TRACE_ERRORS, 0, 0)
@@ -150,7 +140,7 @@ ULONG pid;
/* Nothing else to be processed in this queue. */
return(UX_NULL);
- }
+ }
/* Update the length of this transaction if the PID is IN or OUT. */
pid = td -> ux_ehci_td_control & UX_EHCI_PID_MASK;
@@ -159,24 +149,24 @@ ULONG pid;
{
td_residual_length = (td -> ux_ehci_td_control >> UX_EHCI_TD_LG_LOC) & UX_EHCI_TD_LG_MASK;
- transfer_request -> ux_transfer_request_actual_length += td -> ux_ehci_td_length - td_residual_length;
+ transfer_request -> ux_transfer_request_actual_length += td -> ux_ehci_td_length - td_residual_length;
}
- /* We get here when there is no error on the transfer. It may be that this transfer is not the last
+ /* We get here when there is no error on the transfer. It may be that this transfer is not the last
one in the link and therefore we process the length received but do not complete the transfer request. */
if (td -> ux_ehci_td_control & UX_EHCI_TD_IOC)
{
- /* Check if this transaction is complete or a short packet occurred, in both case, complete the
+ /* Check if this transaction is complete or a short packet occurred, in both case, complete the
transaction. In the case of a control endpoint in STATUS phase we complete regardless. */
- if ((td_residual_length != 0) ||
- (transfer_request -> ux_transfer_request_actual_length == transfer_request -> ux_transfer_request_requested_length) ||
- (td -> ux_ehci_td_phase & UX_EHCI_TD_STATUS_PHASE))
+ if ((td_residual_length != 0) ||
+ (transfer_request -> ux_transfer_request_actual_length == transfer_request -> ux_transfer_request_requested_length) ||
+ (td -> ux_ehci_td_phase & UX_EHCI_TD_STATUS_PHASE))
{
/* Update the transfer code. */
transfer_request -> ux_transfer_request_completion_code = UX_SUCCESS;
-
+
/* Clean the link. */
_ux_hcd_ehci_ed_clean(ed);
@@ -186,7 +176,7 @@ ULONG pid;
/* We may do a call back. */
if (transfer_request -> ux_transfer_request_completion_function != UX_NULL)
transfer_request -> ux_transfer_request_completion_function(transfer_request);
-
+
/* Wake up the semaphore for this request. */
_ux_host_semaphore_put(&transfer_request -> ux_transfer_request_semaphore);
@@ -199,7 +189,7 @@ ULONG pid;
td_element = (ULONG) td -> ux_ehci_td_link_pointer;
td_element &= ~UX_EHCI_TD_T;
next_td = _ux_utility_virtual_address((VOID *) td_element);
-
+
/* Free the TD that was just treated. */
td -> ux_ehci_td_status = UX_UNUSED;
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 90ca9381..19d6e8fd 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
@@ -1,18 +1,19 @@
/***************************************************************************
- * Copyright (c) 2024 Microsoft Corporation
- *
+ * Copyright (c) 2024 Microsoft Corporation
+ * Copyright (c) 2026-present Eclipse ThreadX contributors
+ *
* This program and the accompanying materials are made available under the
* terms of the MIT License which is available at
* https://opensource.org/licenses/MIT.
- *
+ *
* SPDX-License-Identifier: MIT
**************************************************************************/
/**************************************************************************/
/**************************************************************************/
-/** */
-/** USBX Component */
+/** */
+/** USBX Component */
/** */
/** EHCI Controller Driver */
/** */
@@ -29,54 +30,38 @@
#include "ux_host_stack.h"
-/**************************************************************************/
-/* */
-/* FUNCTION RELEASE */
-/* */
-/* _ux_hcd_ehci_asynchronous_endpoint_create PORTABLE C */
+/**************************************************************************/
+/* */
+/* FUNCTION RELEASE */
+/* */
+/* _ux_hcd_ehci_asynchronous_endpoint_create PORTABLE C */
/* 6.3.0 */
/* AUTHOR */
/* */
/* Chaoqiong Xiao, Microsoft Corporation */
/* */
/* DESCRIPTION */
-/* */
+/* */
/* This function will create an asynchronous endpoint. The control */
-/* and bulk endpoints fall into this category. */
-/* */
-/* INPUT */
-/* */
-/* hcd_ehci Pointer to EHCI controller */
-/* endpoint Pointer to endpoint */
-/* */
-/* OUTPUT */
-/* */
-/* Completion Status */
-/* */
-/* CALLS */
-/* */
-/* _ux_hcd_ehci_ed_obtain Obtain EHCI ED */
-/* _ux_utility_physical_address Get physical address */
-/* */
-/* CALLED BY */
-/* */
+/* and bulk endpoints fall into this category. */
+/* */
+/* INPUT */
+/* */
+/* hcd_ehci Pointer to EHCI controller */
+/* endpoint Pointer to endpoint */
+/* */
+/* OUTPUT */
+/* */
+/* Completion Status */
+/* */
+/* CALLS */
+/* */
+/* _ux_hcd_ehci_ed_obtain Obtain EHCI ED */
+/* _ux_utility_physical_address Get physical address */
+/* */
+/* CALLED BY */
+/* */
/* EHCI Controller Driver */
-/* */
-/* 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 */
-/* 11-09-2020 Chaoqiong Xiao Modified comment(s), */
-/* fixed compile warnings, */
-/* resulting in version 6.1.2 */
-/* 10-31-2023 Chaoqiong Xiao Modified comment(s), */
-/* fixed compile warnings, */
-/* resulting in version 6.3.0 */
/* */
/**************************************************************************/
UINT _ux_hcd_ehci_asynchronous_endpoint_create(UX_HCD_EHCI *hcd_ehci, UX_ENDPOINT *endpoint)
@@ -90,8 +75,8 @@ UX_EHCI_LINK_POINTER queue_head;
/* We need to take into account the nature of the HCD to define the max size
of any transfer in the transfer request. */
endpoint -> ux_endpoint_transfer_request.ux_transfer_request_maximum_length = UX_EHCI_MAX_PAYLOAD;
-
- /* Obtain a ED for this new endpoint. This ED will live as long as the endpoint is active
+
+ /* Obtain a ED for this new endpoint. This ED will live as long as the endpoint is active
and will be the container for the tds. */
ed = _ux_hcd_ehci_ed_obtain(hcd_ehci);
if (ed == UX_NULL)
@@ -105,10 +90,10 @@ UX_EHCI_LINK_POINTER queue_head;
/* Set the default MPS Capability info in the ED. */
ed -> ux_ehci_ed_cap0 = (ULONG)endpoint -> ux_endpoint_descriptor.wMaxPacketSize << UX_EHCI_QH_MPS_LOC;
-
+
/* Set the default NAK reload count. */
ed -> ux_ehci_ed_cap0 |= UX_EHCI_QH_NCR;
-
+
/* If the device is not high speed and the endpoint is control, then the CEF bit must be set to on. */
device = endpoint -> ux_endpoint_device;
if ((device -> ux_device_speed != UX_HIGH_SPEED_DEVICE) &&
@@ -117,15 +102,15 @@ UX_EHCI_LINK_POINTER queue_head;
/* Set the device address. */
ed -> ux_ehci_ed_cap0 |= device -> ux_device_address;
-
+
/* Add the endpoint address. */
ed -> ux_ehci_ed_cap0 |= (endpoint -> ux_endpoint_descriptor.bEndpointAddress &
~UX_ENDPOINT_DIRECTION) << UX_EHCI_QH_ED_AD_LOC;
- /* Set the High Bandwidth Pipe Multiplier to 1. */
+ /* Set the High Bandwidth Pipe Multiplier to 1. */
ed -> ux_ehci_ed_cap1 |= UX_EHCI_QH_HBPM;
-
- /* Set the device speed for full and low speed devices behind a hub the hub address and the
+
+ /* Set the device speed for full and low speed devices behind a hub the hub address and the
port index must be stored in the endpoint. */
switch (device -> ux_device_speed)
{
@@ -137,7 +122,7 @@ UX_EHCI_LINK_POINTER queue_head;
case UX_LOW_SPEED_DEVICE:
-
+
ed -> ux_ehci_ed_cap0 |= UX_EHCI_QH_LOW_SPEED;
break;
@@ -151,14 +136,14 @@ UX_EHCI_LINK_POINTER queue_head;
/* Store the parent hub device address. */
ed -> ux_ehci_ed_cap1 |= device -> ux_device_parent -> ux_device_address << UX_EHCI_QH_HUB_ADDR_LOC;
- /* And the port index onto which this device is attached. */
+ /* 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;
}
-
- /* We need to insert this new endpoint into the asynchronous list. All new EDs are inserted at the
+
+ /* We need to insert this new endpoint into the asynchronous list. All new EDs are inserted at the
end of the list. The current ED will be pointing to the first ED in the list. */
queue_head.void_ptr = _ux_utility_physical_address(hcd_ehci -> ux_hcd_ehci_asynch_first_list);
queue_head.value |= UX_EHCI_QH_TYP_QH;
@@ -173,11 +158,11 @@ UX_EHCI_LINK_POINTER queue_head;
/* Update the link of the previous ED. */
ed -> ux_ehci_ed_previous_ed -> ux_ehci_ed_next_ed = ed;
-
+
/* Remember the new last QH. */
hcd_ehci -> ux_hcd_ehci_asynch_last_list = ed;
/* Return successful completion. */
- return(UX_SUCCESS);
+ return(UX_SUCCESS);
}
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 e6a31de1..9b80e078 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
@@ -1,18 +1,19 @@
/***************************************************************************
- * Copyright (c) 2024 Microsoft Corporation
- *
+ * Copyright (c) 2024 Microsoft Corporation
+ * Copyright (c) 2026-present Eclipse ThreadX contributors
+ *
* This program and the accompanying materials are made available under the
* terms of the MIT License which is available at
* https://opensource.org/licenses/MIT.
- *
+ *
* SPDX-License-Identifier: MIT
**************************************************************************/
/**************************************************************************/
/**************************************************************************/
-/** */
-/** USBX Component */
+/** */
+/** USBX Component */
/** */
/** EHCI Controller Driver */
/** */
@@ -29,46 +30,38 @@
#include "ux_host_stack.h"
-/**************************************************************************/
-/* */
-/* FUNCTION RELEASE */
-/* */
-/* _ux_hcd_ehci_asynchronous_endpoint_destroy PORTABLE C */
+/**************************************************************************/
+/* */
+/* FUNCTION RELEASE */
+/* */
+/* _ux_hcd_ehci_asynchronous_endpoint_destroy PORTABLE C */
/* 6.1 */
/* AUTHOR */
/* */
/* Chaoqiong Xiao, Microsoft Corporation */
/* */
/* DESCRIPTION */
-/* */
+/* */
/* This function will destroy an asynchronous endpoint. The control */
-/* and bulk endpoints fall into this category. */
-/* */
-/* INPUT */
-/* */
-/* hcd_ehci Pointer to EHCI controller */
-/* endpoint Pointer to endpoint */
-/* */
-/* OUTPUT */
-/* */
-/* Completion Status */
-/* */
-/* CALLS */
-/* */
-/* _ux_hcd_ehci_door_bell_wait Wait for door bell */
-/* _ux_utility_physical_address Get physical address */
-/* */
-/* CALLED BY */
-/* */
+/* and bulk endpoints fall into this category. */
+/* */
+/* INPUT */
+/* */
+/* hcd_ehci Pointer to EHCI controller */
+/* endpoint Pointer to endpoint */
+/* */
+/* OUTPUT */
+/* */
+/* Completion Status */
+/* */
+/* CALLS */
+/* */
+/* _ux_hcd_ehci_door_bell_wait Wait for door bell */
+/* _ux_utility_physical_address Get physical address */
+/* */
+/* CALLED BY */
+/* */
/* EHCI Controller Driver */
-/* */
-/* RELEASE HISTORY */
-/* */
-/* DATE NAME DESCRIPTION */
-/* */
-/* 05-19-2020 Chaoqiong Xiao Initial Version 6.0 */
-/* 09-30-2020 Chaoqiong Xiao Modified comment(s), */
-/* resulting in version 6.1 */
/* */
/**************************************************************************/
UINT _ux_hcd_ehci_asynchronous_endpoint_destroy(UX_HCD_EHCI *hcd_ehci, UX_ENDPOINT *endpoint)
@@ -78,7 +71,7 @@ UX_EHCI_ED *ed;
UX_EHCI_ED *previous_ed;
UX_EHCI_ED *next_ed;
UX_EHCI_LINK_POINTER queue_head;
-
+
/* From the endpoint container fetch the EHCI ED descriptor. */
ed = (UX_EHCI_ED *) endpoint -> ux_endpoint_ed;
@@ -88,13 +81,13 @@ UX_EHCI_LINK_POINTER queue_head;
/* Get the next ED in the list for this ED. */
next_ed = ed -> ux_ehci_ed_next_ed;
-
+
/* Point the previous ED to the ED after the ED to be removed. */
previous_ed -> ux_ehci_ed_next_ed = next_ed;
-
+
/* Point the next ED previous pointer to the previous ED. */
next_ed -> ux_ehci_ed_previous_ed = previous_ed;
-
+
/* Now remove the physical link. */
queue_head.void_ptr = _ux_utility_physical_address(next_ed);
queue_head.value |= UX_EHCI_QH_TYP_QH;
@@ -106,11 +99,11 @@ UX_EHCI_LINK_POINTER queue_head;
/* Arm the doorbell and wait for its completion. */
_ux_hcd_ehci_door_bell_wait(hcd_ehci);
-
+
/* Now we can safely make the ED free. */
ed -> ux_ehci_ed_status = UX_UNUSED;
/* Return successful completion. */
- return(UX_SUCCESS);
+ return(UX_SUCCESS);
}
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 8d0e22b1..fe07b427 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
@@ -1,18 +1,19 @@
/***************************************************************************
- * Copyright (c) 2024 Microsoft Corporation
- *
+ * Copyright (c) 2024 Microsoft Corporation
+ * Copyright (c) 2026-present Eclipse ThreadX contributors
+ *
* This program and the accompanying materials are made available under the
* terms of the MIT License which is available at
* https://opensource.org/licenses/MIT.
- *
+ *
* SPDX-License-Identifier: MIT
**************************************************************************/
/**************************************************************************/
/**************************************************************************/
-/** */
-/** USBX Component */
+/** */
+/** USBX Component */
/** */
/** EHCI Controller Driver */
/** */
@@ -29,49 +30,41 @@
#include "ux_host_stack.h"
-/**************************************************************************/
-/* */
-/* FUNCTION RELEASE */
-/* */
-/* _ux_hcd_ehci_controller_disable PORTABLE C */
+/**************************************************************************/
+/* */
+/* FUNCTION RELEASE */
+/* */
+/* _ux_hcd_ehci_controller_disable PORTABLE C */
/* 6.1 */
/* AUTHOR */
/* */
/* Chaoqiong Xiao, Microsoft Corporation */
/* */
/* DESCRIPTION */
-/* */
+/* */
/* This function will disable the EHCI controller. The controller will */
-/* release all its resources (memory, IO ...). After this, the */
+/* release all its resources (memory, IO ...). After this, the */
/* controller will not send SOF any longer. */
/* */
-/* All transactions should have been completed, all classes should */
-/* have been closed. */
-/* */
-/* INPUT */
-/* */
-/* hcd_ehci Pointer to EHCI controller */
-/* */
-/* OUTPUT */
-/* */
-/* Completion Status */
-/* */
-/* CALLS */
-/* */
-/* _ux_hcd_ehci_register_read Read EHCI register */
-/* _ux_hcd_ehci_register_write Write EHCI register */
-/* */
-/* CALLED BY */
-/* */
+/* All transactions should have been completed, all classes should */
+/* have been closed. */
+/* */
+/* INPUT */
+/* */
+/* hcd_ehci Pointer to EHCI controller */
+/* */
+/* OUTPUT */
+/* */
+/* Completion Status */
+/* */
+/* CALLS */
+/* */
+/* _ux_hcd_ehci_register_read Read EHCI register */
+/* _ux_hcd_ehci_register_write Write EHCI register */
+/* */
+/* CALLED BY */
+/* */
/* EHCI Controller Driver */
-/* */
-/* RELEASE HISTORY */
-/* */
-/* DATE NAME DESCRIPTION */
-/* */
-/* 05-19-2020 Chaoqiong Xiao Initial Version 6.0 */
-/* 09-30-2020 Chaoqiong Xiao Modified comment(s), */
-/* resulting in version 6.1 */
/* */
/**************************************************************************/
UINT _ux_hcd_ehci_controller_disable(UX_HCD_EHCI *hcd_ehci)
@@ -79,17 +72,17 @@ UINT _ux_hcd_ehci_controller_disable(UX_HCD_EHCI *hcd_ehci)
UX_HCD *hcd;
ULONG ehci_register;
-
+
/* Point to the generic portion of the host controller structure instance. */
hcd = hcd_ehci -> ux_hcd_ehci_hcd_owner;
-
+
/* Stop the controller. */
ehci_register = _ux_hcd_ehci_register_read(hcd_ehci, EHCI_HCOR_USB_COMMAND);
ehci_register = EHCI_HC_IO_HCRESET;
ehci_register &= ~EHCI_HC_IO_RS;
_ux_hcd_ehci_register_write(hcd_ehci, EHCI_HCOR_USB_COMMAND, ehci_register);
-
+
/* Wait for the Stop signal to be acknowledged by the controller. */
ehci_register = 0;
while ((ehci_register&EHCI_HC_STS_HC_HALTED) == 0)
@@ -97,7 +90,7 @@ ULONG ehci_register;
ehci_register = _ux_hcd_ehci_register_read(hcd_ehci, EHCI_HCCR_HCS_PARAMS);
}
-
+
/* Reflect the state of the controller in the main structure. */
hcd -> ux_hcd_status = UX_HCD_STATUS_HALTED;
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 bc944b28..8f9cdc60 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
@@ -1,10 +1,11 @@
/***************************************************************************
- * Copyright (c) 2024 Microsoft Corporation
- *
+ * Copyright (c) 2024 Microsoft Corporation
+ * Copyright (c) 2026-present Eclipse ThreadX contributors
+ *
* This program and the accompanying materials are made available under the
* terms of the MIT License which is available at
* https://opensource.org/licenses/MIT.
- *
+ *
* SPDX-License-Identifier: MIT
**************************************************************************/
@@ -68,20 +69,6 @@
/* */
/* EHCI Controller Driver */
/* */
-/* RELEASE HISTORY */
-/* */
-/* DATE NAME DESCRIPTION */
-/* */
-/* 05-19-2020 Chaoqiong Xiao Initial Version 6.0 */
-/* 09-30-2020 Chaoqiong Xiao Modified comment(s), */
-/* resulting in version 6.1 */
-/* 11-09-2020 Chaoqiong Xiao Modified comment(s), */
-/* fixed compile warning, */
-/* resulting in version 6.1.2 */
-/* 04-25-2022 Chaoqiong Xiao Modified comment(s), */
-/* fixed standalone compile, */
-/* resulting in version 6.1.11 */
-/* */
/**************************************************************************/
VOID _ux_hcd_ehci_done_queue_process(UX_HCD_EHCI *hcd_ehci)
{
@@ -133,7 +120,7 @@ UX_EHCI_PERIODIC_LINK_POINTER lp;
/* Process TD until there is no next available. */
while (td != UX_NULL)
td = _ux_hcd_ehci_asynch_td_process(ed.ed_ptr, td);
-
+
/* Next ED. */
ed.ed_ptr = ed.ed_ptr -> ux_ehci_ed_next_ed;
}
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 22ba423d..d53eedcf 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
@@ -1,18 +1,19 @@
/***************************************************************************
- * Copyright (c) 2024 Microsoft Corporation
- *
+ * Copyright (c) 2024 Microsoft Corporation
+ * Copyright (c) 2026-present Eclipse ThreadX contributors
+ *
* This program and the accompanying materials are made available under the
* terms of the MIT License which is available at
* https://opensource.org/licenses/MIT.
- *
+ *
* SPDX-License-Identifier: MIT
**************************************************************************/
/**************************************************************************/
/**************************************************************************/
-/** */
-/** USBX Component */
+/** */
+/** USBX Component */
/** */
/** EHCI Controller Driver */
/** */
@@ -29,51 +30,40 @@
#include "ux_host_stack.h"
-/**************************************************************************/
-/* */
-/* FUNCTION RELEASE */
-/* */
-/* _ux_hcd_ehci_door_bell_wait PORTABLE C */
+/**************************************************************************/
+/* */
+/* FUNCTION RELEASE */
+/* */
+/* _ux_hcd_ehci_door_bell_wait PORTABLE C */
/* 6.1.10 */
/* AUTHOR */
/* */
/* Chaoqiong Xiao, Microsoft Corporation */
/* */
/* DESCRIPTION */
-/* */
-/* This function will raise the doorbell and wait for its */
-/* acknowledgement. This mechanism is used to safely remove a physical */
-/* endpoint from EHCI. */
-/* */
-/* INPUT */
-/* */
-/* hcd_ehci Pointer to EHCI controller */
-/* */
-/* OUTPUT */
-/* */
-/* None */
-/* */
-/* CALLS */
-/* */
-/* _ux_hcd_ehci_register_read Read EHCI register */
-/* _ux_hcd_ehci_register_write Write EHCI register */
-/* _ux_host_semaphore_get Get semaphore */
-/* _ux_host_semaphore_put Release semaphore */
-/* */
-/* CALLED BY */
-/* */
+/* */
+/* This function will raise the doorbell and wait for its */
+/* acknowledgement. This mechanism is used to safely remove a physical */
+/* endpoint from EHCI. */
+/* */
+/* INPUT */
+/* */
+/* hcd_ehci Pointer to EHCI controller */
+/* */
+/* OUTPUT */
+/* */
+/* None */
+/* */
+/* CALLS */
+/* */
+/* _ux_hcd_ehci_register_read Read EHCI register */
+/* _ux_hcd_ehci_register_write Write EHCI register */
+/* _ux_host_semaphore_get Get semaphore */
+/* _ux_host_semaphore_put Release semaphore */
+/* */
+/* CALLED BY */
+/* */
/* EHCI Controller Driver */
-/* */
-/* RELEASE HISTORY */
-/* */
-/* DATE NAME DESCRIPTION */
-/* */
-/* 05-19-2020 Chaoqiong Xiao Initial Version 6.0 */
-/* 09-30-2020 Chaoqiong Xiao Modified comment(s), */
-/* resulting in version 6.1 */
-/* 01-31-2022 Chaoqiong Xiao Modified comment(s), */
-/* refined macros names, */
-/* resulting in version 6.1.10 */
/* */
/**************************************************************************/
VOID _ux_hcd_ehci_door_bell_wait(UX_HCD_EHCI *hcd_ehci)
@@ -81,7 +71,7 @@ VOID _ux_hcd_ehci_door_bell_wait(UX_HCD_EHCI *hcd_ehci)
ULONG ehci_register;
UINT status;
-
+
/* Protect against multiple thread entry to this HCD. */
status = _ux_host_semaphore_get(&hcd_ehci -> ux_hcd_ehci_protect_semaphore, UX_WAIT_FOREVER);
@@ -99,7 +89,7 @@ UINT status;
/* Free the protection semaphore. */
_ux_host_semaphore_put(&hcd_ehci -> ux_hcd_ehci_protect_semaphore);
- /* Return to caller. */
+ /* Return to caller. */
return;
}
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 c258dfe4..af6c9daf 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
@@ -1,18 +1,19 @@
/***************************************************************************
- * Copyright (c) 2024 Microsoft Corporation
- *
+ * Copyright (c) 2024 Microsoft Corporation
+ * Copyright (c) 2026-present Eclipse ThreadX contributors
+ *
* This program and the accompanying materials are made available under the
* terms of the MIT License which is available at
* https://opensource.org/licenses/MIT.
- *
+ *
* SPDX-License-Identifier: MIT
**************************************************************************/
/**************************************************************************/
/**************************************************************************/
-/** */
-/** USBX Component */
+/** */
+/** USBX Component */
/** */
/** EHCI Controller Driver */
/** */
@@ -29,44 +30,36 @@
#include "ux_host_stack.h"
-/**************************************************************************/
-/* */
-/* FUNCTION RELEASE */
-/* */
-/* _ux_hcd_ehci_ed_clean PORTABLE C */
+/**************************************************************************/
+/* */
+/* FUNCTION RELEASE */
+/* */
+/* _ux_hcd_ehci_ed_clean PORTABLE C */
/* 6.1 */
/* AUTHOR */
/* */
/* Chaoqiong Xiao, Microsoft Corporation */
/* */
/* DESCRIPTION */
-/* */
-/* This function cleans the tds attached to a ED in case a transfer */
-/* has to be aborted. */
-/* */
-/* INPUT */
-/* */
-/* ed Pointer to ED */
-/* */
-/* OUTPUT */
-/* */
-/* Completion Status */
-/* */
-/* CALLS */
-/* */
-/* _ux_utility_virtual_address Get virtual address */
-/* */
-/* CALLED BY */
-/* */
+/* */
+/* This function cleans the tds attached to a ED in case a transfer */
+/* has to be aborted. */
+/* */
+/* INPUT */
+/* */
+/* ed Pointer to ED */
+/* */
+/* OUTPUT */
+/* */
+/* Completion Status */
+/* */
+/* CALLS */
+/* */
+/* _ux_utility_virtual_address Get virtual address */
+/* */
+/* CALLED BY */
+/* */
/* EHCI Controller Driver */
-/* */
-/* RELEASE HISTORY */
-/* */
-/* DATE NAME DESCRIPTION */
-/* */
-/* 05-19-2020 Chaoqiong Xiao Initial Version 6.0 */
-/* 09-30-2020 Chaoqiong Xiao Modified comment(s), */
-/* resulting in version 6.1 */
/* */
/**************************************************************************/
UINT _ux_hcd_ehci_ed_clean(UX_EHCI_ED *ed)
@@ -74,9 +67,9 @@ UINT _ux_hcd_ehci_ed_clean(UX_EHCI_ED *ed)
UX_EHCI_TD *td;
UX_EHCI_TD *next_td;
-
- /* Get the first pointer to the TD. */
+
+ /* Get the first pointer to the TD. */
td = ed -> ux_ehci_ed_queue_element;
td = (UX_EHCI_TD *) ((ULONG) td & ~UX_EHCI_QH_T);
td = _ux_utility_virtual_address(td);
@@ -106,6 +99,6 @@ UX_EHCI_TD *next_td;
ed -> ux_ehci_ed_last_td = UX_NULL;
/* Return successful completion. */
- return(UX_SUCCESS);
+ return(UX_SUCCESS);
}
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 022692b1..00717d8c 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
@@ -1,18 +1,19 @@
/***************************************************************************
- * Copyright (c) 2024 Microsoft Corporation
- *
+ * Copyright (c) 2024 Microsoft Corporation
+ * Copyright (c) 2026-present Eclipse ThreadX contributors
+ *
* This program and the accompanying materials are made available under the
* terms of the MIT License which is available at
* https://opensource.org/licenses/MIT.
- *
+ *
* SPDX-License-Identifier: MIT
**************************************************************************/
/**************************************************************************/
/**************************************************************************/
-/** */
-/** USBX Component */
+/** */
+/** USBX Component */
/** */
/** EHCI Controller Driver */
/** */
@@ -29,45 +30,35 @@
#include "ux_host_stack.h"
-/**************************************************************************/
-/* */
-/* FUNCTION RELEASE */
-/* */
-/* _ux_hcd_ehci_ed_obtain PORTABLE C */
+/**************************************************************************/
+/* */
+/* FUNCTION RELEASE */
+/* */
+/* _ux_hcd_ehci_ed_obtain PORTABLE C */
/* 6.1 */
/* AUTHOR */
/* */
/* Chaoqiong Xiao, Microsoft Corporation */
/* */
/* DESCRIPTION */
-/* */
-/* This function obtains a free ED from the ED list. */
-/* */
-/* INPUT */
-/* */
-/* hcd_ehci Pointer to EHCI controller */
-/* */
-/* OUTPUT */
-/* */
-/* UX_EHCI_ED * Pointer to ED */
-/* */
-/* CALLS */
-/* */
-/* _ux_utility_memory_set Set memory block */
-/* */
-/* CALLED BY */
-/* */
+/* */
+/* This function obtains a free ED from the ED list. */
+/* */
+/* INPUT */
+/* */
+/* hcd_ehci Pointer to EHCI controller */
+/* */
+/* OUTPUT */
+/* */
+/* UX_EHCI_ED * Pointer to ED */
+/* */
+/* CALLS */
+/* */
+/* _ux_utility_memory_set Set memory block */
+/* */
+/* CALLED BY */
+/* */
/* EHCI Controller Driver */
-/* */
-/* RELEASE HISTORY */
-/* */
-/* DATE NAME DESCRIPTION */
-/* */
-/* 05-19-2020 Chaoqiong Xiao Initial Version 6.0 */
-/* 09-30-2020 Chaoqiong Xiao Modified comment(s), */
-/* verified memset and memcpy */
-/* cases, */
-/* resulting in version 6.1 */
/* */
/**************************************************************************/
UX_EHCI_ED *_ux_hcd_ehci_ed_obtain(UX_HCD_EHCI *hcd_ehci)
@@ -93,9 +84,9 @@ ULONG ed_index;
ed -> ux_ehci_ed_status = UX_USED;
/* We initialize the type of ED and mark its TD terminator to be safe. */
- ed -> ux_ehci_ed_queue_head = (UX_EHCI_ED *) UX_EHCI_QH_TYP_QH;
+ ed -> ux_ehci_ed_queue_head = (UX_EHCI_ED *) UX_EHCI_QH_TYP_QH;
ed -> ux_ehci_ed_queue_element = (UX_EHCI_TD *) UX_EHCI_TD_T;
-
+
/* Success, return ED pointer. */
return(ed);
}
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 d2d05cbd..f3d9343d 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
@@ -1,18 +1,19 @@
/***************************************************************************
- * Copyright (c) 2024 Microsoft Corporation
- *
+ * Copyright (c) 2024 Microsoft Corporation
+ * Copyright (c) 2026-present Eclipse ThreadX contributors
+ *
* This program and the accompanying materials are made available under the
* terms of the MIT License which is available at
* https://opensource.org/licenses/MIT.
- *
+ *
* SPDX-License-Identifier: MIT
**************************************************************************/
/**************************************************************************/
/**************************************************************************/
-/** */
-/** USBX Component */
+/** */
+/** USBX Component */
/** */
/** EHCI Controller Driver */
/** */
@@ -29,44 +30,36 @@
#include "ux_host_stack.h"
-/**************************************************************************/
-/* */
-/* FUNCTION RELEASE */
-/* */
-/* _ux_hcd_ehci_endpoint_reset PORTABLE C */
+/**************************************************************************/
+/* */
+/* FUNCTION RELEASE */
+/* */
+/* _ux_hcd_ehci_endpoint_reset PORTABLE C */
/* 6.1 */
/* AUTHOR */
/* */
/* Chaoqiong Xiao, Microsoft Corporation */
/* */
/* DESCRIPTION */
-/* */
-/* This function will reset an endpoint. */
-/* */
-/* INPUT */
-/* */
-/* hcd_ehci Pointer to EHCI controller */
-/* endpoint Pointer to endpoint */
-/* */
-/* OUTPUT */
-/* */
-/* Completion Status */
-/* */
-/* CALLS */
-/* */
-/* None */
-/* */
-/* CALLED BY */
-/* */
+/* */
+/* This function will reset an endpoint. */
+/* */
+/* INPUT */
+/* */
+/* hcd_ehci Pointer to EHCI controller */
+/* endpoint Pointer to endpoint */
+/* */
+/* OUTPUT */
+/* */
+/* Completion Status */
+/* */
+/* CALLS */
+/* */
+/* None */
+/* */
+/* CALLED BY */
+/* */
/* EHCI Controller Driver */
-/* */
-/* RELEASE HISTORY */
-/* */
-/* DATE NAME DESCRIPTION */
-/* */
-/* 05-19-2020 Chaoqiong Xiao Initial Version 6.0 */
-/* 09-30-2020 Chaoqiong Xiao Modified comment(s), */
-/* resulting in version 6.1 */
/* */
/**************************************************************************/
UINT _ux_hcd_ehci_endpoint_reset(UX_HCD_EHCI *hcd_ehci, UX_ENDPOINT *endpoint)
@@ -87,6 +80,6 @@ ULONG ed_value;
ed -> ux_ehci_ed_state = ed_value;
/* This operation never fails! */
- return(UX_SUCCESS);
+ return(UX_SUCCESS);
}
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 f4eae56c..f25a4829 100644
--- a/common/usbx_host_controllers/src/ux_hcd_ehci_entry.c
+++ b/common/usbx_host_controllers/src/ux_hcd_ehci_entry.c
@@ -1,18 +1,19 @@
/***************************************************************************
- * Copyright (c) 2024 Microsoft Corporation
- *
+ * Copyright (c) 2024 Microsoft Corporation
+ * Copyright (c) 2026-present Eclipse ThreadX contributors
+ *
* This program and the accompanying materials are made available under the
* terms of the MIT License which is available at
* https://opensource.org/licenses/MIT.
- *
+ *
* SPDX-License-Identifier: MIT
**************************************************************************/
/**************************************************************************/
/**************************************************************************/
-/** */
-/** USBX Component */
+/** */
+/** USBX Component */
/** */
/** EHCI Controller Driver */
/** */
@@ -29,65 +30,57 @@
#include "ux_host_stack.h"
-/**************************************************************************/
-/* */
-/* FUNCTION RELEASE */
-/* */
-/* _ux_hcd_ehci_entry PORTABLE C */
+/**************************************************************************/
+/* */
+/* FUNCTION RELEASE */
+/* */
+/* _ux_hcd_ehci_entry PORTABLE C */
/* 6.1 */
/* AUTHOR */
/* */
/* Chaoqiong Xiao, Microsoft Corporation */
/* */
/* DESCRIPTION */
-/* */
+/* */
/* This function dispatch the HCD function internally to the EHCI */
-/* controller. */
-/* */
-/* INPUT */
-/* */
-/* HCD Pointer to HCD */
-/* function Requested function */
-/* parameter Pointer to parameter(s) */
-/* */
-/* OUTPUT */
-/* */
-/* Completion Status */
-/* */
-/* CALLS */
-/* */
-/* _ux_hcd_ehci_asynchronous_endpoint_create Create endpoint */
-/* _ux_hcd_ehci_asynchronous_endpoint_destroy Destroy endpoint */
-/* _ux_hcd_ehci_controller_disable Disable controller */
-/* _ux_hcd_ehci_done_queue_process Process done queue */
-/* _ux_hcd_ehci_endpoint_reset Reset endpoint */
-/* _ux_hcd_ehci_frame_number_get Get frame number */
-/* _ux_hcd_ehci_frame_number_set Set frame number */
-/* _ux_hcd_ehci_interrupt_endpoint_create Endpoint create */
-/* _ux_hcd_ehci_interrupt_endpoint_destroy Endpoint destroy */
-/* _ux_hcd_ehci_isochronous_endpoint_create Endpoint create */
+/* controller. */
+/* */
+/* INPUT */
+/* */
+/* HCD Pointer to HCD */
+/* function Requested function */
+/* parameter Pointer to parameter(s) */
+/* */
+/* OUTPUT */
+/* */
+/* Completion Status */
+/* */
+/* CALLS */
+/* */
+/* _ux_hcd_ehci_asynchronous_endpoint_create Create endpoint */
+/* _ux_hcd_ehci_asynchronous_endpoint_destroy Destroy endpoint */
+/* _ux_hcd_ehci_controller_disable Disable controller */
+/* _ux_hcd_ehci_done_queue_process Process done queue */
+/* _ux_hcd_ehci_endpoint_reset Reset endpoint */
+/* _ux_hcd_ehci_frame_number_get Get frame number */
+/* _ux_hcd_ehci_frame_number_set Set frame number */
+/* _ux_hcd_ehci_interrupt_endpoint_create Endpoint create */
+/* _ux_hcd_ehci_interrupt_endpoint_destroy Endpoint destroy */
+/* _ux_hcd_ehci_isochronous_endpoint_create Endpoint create */
/* _ux_hcd_ehci_isochronous_endpoint_destroy Endpoint destroy */
-/* _ux_hcd_ehci_port_disable Disable port */
-/* _ux_hcd_ehci_port_reset Reset port */
-/* _ux_hcd_ehci_port_resume Resume port */
-/* _ux_hcd_ehci_port_status_get Get port status */
-/* _ux_hcd_ehci_port_suspend Suspend port */
-/* _ux_hcd_ehci_power_down_port Power down port */
-/* _ux_hcd_ehci_power_on_port Power on port */
-/* _ux_hcd_ehci_request_transfer Request transfer */
-/* _ux_hcd_ehci_transfer_abort Abort transfer */
-/* */
-/* CALLED BY */
-/* */
+/* _ux_hcd_ehci_port_disable Disable port */
+/* _ux_hcd_ehci_port_reset Reset port */
+/* _ux_hcd_ehci_port_resume Resume port */
+/* _ux_hcd_ehci_port_status_get Get port status */
+/* _ux_hcd_ehci_port_suspend Suspend port */
+/* _ux_hcd_ehci_power_down_port Power down port */
+/* _ux_hcd_ehci_power_on_port Power on port */
+/* _ux_hcd_ehci_request_transfer Request transfer */
+/* _ux_hcd_ehci_transfer_abort Abort transfer */
+/* */
+/* CALLED BY */
+/* */
/* EHCI Controller Driver */
-/* */
-/* RELEASE HISTORY */
-/* */
-/* DATE NAME DESCRIPTION */
-/* */
-/* 05-19-2020 Chaoqiong Xiao Initial Version 6.0 */
-/* 09-30-2020 Chaoqiong Xiao Modified comment(s), */
-/* resulting in version 6.1 */
/* */
/**************************************************************************/
UINT _ux_hcd_ehci_entry(UX_HCD *hcd, UINT function, VOID *parameter)
@@ -95,12 +88,12 @@ UINT _ux_hcd_ehci_entry(UX_HCD *hcd, UINT function, VOID *parameter)
UINT status;
UX_HCD_EHCI *hcd_ehci;
-
+
/* Check the status of the controller. */
if (hcd -> ux_hcd_status == UX_UNUSED)
{
-
+
/* Error trap. */
_ux_system_error_handler(UX_SYSTEM_LEVEL_THREAD, UX_SYSTEM_CONTEXT_HCD, UX_CONTROLLER_UNKNOWN);
@@ -108,7 +101,7 @@ UX_HCD_EHCI *hcd_ehci;
UX_TRACE_IN_LINE_INSERT(UX_TRACE_ERROR, UX_CONTROLLER_UNKNOWN, 0, 0, 0, UX_TRACE_ERRORS, 0, 0)
return(UX_CONTROLLER_UNKNOWN);
- }
+ }
/* Get the pointer to the EHCI HCD. */
hcd_ehci = (UX_HCD_EHCI *) hcd -> ux_hcd_controller_hardware;
@@ -118,82 +111,82 @@ UX_HCD_EHCI *hcd_ehci;
{
case UX_HCD_DISABLE_CONTROLLER:
-
+
status = _ux_hcd_ehci_controller_disable(hcd_ehci);
break;
-
-
+
+
case UX_HCD_GET_PORT_STATUS:
status = _ux_hcd_ehci_port_status_get(hcd_ehci, (ULONG) parameter);
break;
-
-
+
+
case UX_HCD_ENABLE_PORT:
status = UX_SUCCESS;
break;
-
-
+
+
case UX_HCD_DISABLE_PORT:
status = _ux_hcd_ehci_port_disable(hcd_ehci, (ULONG) parameter);
break;
-
-
+
+
case UX_HCD_POWER_ON_PORT:
status = _ux_hcd_ehci_power_on_port(hcd_ehci, (ULONG) parameter);
break;
-
-
+
+
case UX_HCD_POWER_DOWN_PORT:
status = _ux_hcd_ehci_power_down_port(hcd_ehci, (ULONG) parameter);
break;
-
-
+
+
case UX_HCD_SUSPEND_PORT:
status = _ux_hcd_ehci_port_suspend(hcd_ehci, (ULONG) parameter);
break;
-
-
+
+
case UX_HCD_RESUME_PORT:
status = _ux_hcd_ehci_port_resume(hcd_ehci, (UINT) parameter);
break;
-
-
+
+
case UX_HCD_RESET_PORT:
status = _ux_hcd_ehci_port_reset(hcd_ehci, (ULONG) parameter);
break;
-
-
+
+
case UX_HCD_GET_FRAME_NUMBER:
status = _ux_hcd_ehci_frame_number_get(hcd_ehci, (ULONG *) parameter);
break;
-
-
+
+
case UX_HCD_SET_FRAME_NUMBER:
_ux_hcd_ehci_frame_number_set(hcd_ehci, (ULONG) parameter);
status = UX_SUCCESS;
break;
-
-
+
+
case UX_HCD_TRANSFER_REQUEST:
status = _ux_hcd_ehci_request_transfer(hcd_ehci, (UX_TRANSFER *) parameter);
break;
-
-
+
+
case UX_HCD_TRANSFER_ABORT:
status = _ux_hcd_ehci_transfer_abort(hcd_ehci, (UX_TRANSFER *) parameter);
break;
-
-
+
+
case UX_HCD_CREATE_ENDPOINT:
switch ((((UX_ENDPOINT*) parameter) -> ux_endpoint_descriptor.bmAttributes) & UX_MASK_ENDPOINT_TYPE)
@@ -261,7 +254,7 @@ UX_HCD_EHCI *hcd_ehci;
status = UX_FUNCTION_NOT_SUPPORTED;
break;
- }
+ }
/* Return status to caller. */
return(status);
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 a1fb3e9d..83ffc099 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
@@ -1,18 +1,19 @@
/***************************************************************************
- * Copyright (c) 2024 Microsoft Corporation
- *
+ * Copyright (c) 2024 Microsoft Corporation
+ * Copyright (c) 2026-present Eclipse ThreadX contributors
+ *
* This program and the accompanying materials are made available under the
* terms of the MIT License which is available at
* https://opensource.org/licenses/MIT.
- *
+ *
* SPDX-License-Identifier: MIT
**************************************************************************/
/**************************************************************************/
/**************************************************************************/
-/** */
-/** USBX Component */
+/** */
+/** USBX Component */
/** */
/** EHCI Controller Driver */
/** */
@@ -29,58 +30,50 @@
#include "ux_host_stack.h"
-/**************************************************************************/
-/* */
-/* FUNCTION RELEASE */
-/* */
-/* _ux_hcd_ehci_frame_number_get PORTABLE C */
+/**************************************************************************/
+/* */
+/* FUNCTION RELEASE */
+/* */
+/* _ux_hcd_ehci_frame_number_get PORTABLE C */
/* 6.1 */
/* AUTHOR */
/* */
/* Chaoqiong Xiao, Microsoft Corporation */
/* */
/* DESCRIPTION */
-/* */
+/* */
/* This function will return the frame number currently used by the */
-/* controller. This function is mostly used for isochronous purposes. */
-/* */
-/* INPUT */
-/* */
-/* hcd_ehci Pointer to EHCI controller */
-/* frame_number Pointer to frame number */
-/* */
-/* OUTPUT */
-/* */
-/* Completion Status */
-/* */
-/* CALLS */
-/* */
-/* _ux_hcd_ehci_register_read Read EHCI register */
-/* */
-/* CALLED BY */
-/* */
+/* controller. This function is mostly used for isochronous purposes. */
+/* */
+/* INPUT */
+/* */
+/* hcd_ehci Pointer to EHCI controller */
+/* frame_number Pointer to frame number */
+/* */
+/* OUTPUT */
+/* */
+/* Completion Status */
+/* */
+/* CALLS */
+/* */
+/* _ux_hcd_ehci_register_read Read EHCI register */
+/* */
+/* CALLED BY */
+/* */
/* EHCI Controller Driver */
-/* */
-/* RELEASE HISTORY */
-/* */
-/* DATE NAME DESCRIPTION */
-/* */
-/* 05-19-2020 Chaoqiong Xiao Initial Version 6.0 */
-/* 09-30-2020 Chaoqiong Xiao Modified comment(s), */
-/* resulting in version 6.1 */
/* */
/**************************************************************************/
UINT _ux_hcd_ehci_frame_number_get(UX_HCD_EHCI *hcd_ehci, ULONG *frame_number)
{
ULONG ehci_register;
-
+
/* Read the micro frame number register. */
ehci_register = _ux_hcd_ehci_register_read(hcd_ehci, EHCI_HCOR_FRAME_INDEX);
/* The register is based on micro frames, so we need to divide the
- value by 8 to get to the millisecond frame number. */
+ value by 8 to get to the millisecond frame number. */
*frame_number = (ehci_register >> 3) & 0x3ff;
/* Return successful completion. */
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 f1285df1..a1cb76be 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
@@ -1,18 +1,19 @@
/***************************************************************************
- * Copyright (c) 2024 Microsoft Corporation
- *
+ * Copyright (c) 2024 Microsoft Corporation
+ * Copyright (c) 2026-present Eclipse ThreadX contributors
+ *
* This program and the accompanying materials are made available under the
* terms of the MIT License which is available at
* https://opensource.org/licenses/MIT.
- *
+ *
* SPDX-License-Identifier: MIT
**************************************************************************/
/**************************************************************************/
/**************************************************************************/
-/** */
-/** USBX Component */
+/** */
+/** USBX Component */
/** */
/** EHCI Controller Driver */
/** */
@@ -29,46 +30,38 @@
#include "ux_host_stack.h"
-/**************************************************************************/
-/* */
-/* FUNCTION RELEASE */
-/* */
-/* _ux_hcd_ehci_frame_number_set PORTABLE C */
+/**************************************************************************/
+/* */
+/* FUNCTION RELEASE */
+/* */
+/* _ux_hcd_ehci_frame_number_set PORTABLE C */
/* 6.1 */
/* AUTHOR */
/* */
/* Chaoqiong Xiao, Microsoft Corporation */
/* */
/* DESCRIPTION */
-/* */
-/* This function will set the current frame number to the one */
-/* specified. This function is mostly used for isochronous purposes. */
-/* */
-/* INPUT */
-/* */
-/* hcd_ehci Pointer to EHCI controller */
-/* frame_number Frame number */
-/* */
-/* OUTPUT */
-/* */
-/* None */
-/* */
-/* CALLS */
-/* */
-/* _ux_hcd_ehci_register_read Read EHCI register */
-/* _ux_hcd_ehci_register_write Write EHCI register */
-/* */
-/* CALLED BY */
-/* */
+/* */
+/* This function will set the current frame number to the one */
+/* specified. This function is mostly used for isochronous purposes. */
+/* */
+/* INPUT */
+/* */
+/* hcd_ehci Pointer to EHCI controller */
+/* frame_number Frame number */
+/* */
+/* OUTPUT */
+/* */
+/* None */
+/* */
+/* CALLS */
+/* */
+/* _ux_hcd_ehci_register_read Read EHCI register */
+/* _ux_hcd_ehci_register_write Write EHCI register */
+/* */
+/* CALLED BY */
+/* */
/* EHCI Controller Driver */
-/* */
-/* RELEASE HISTORY */
-/* */
-/* DATE NAME DESCRIPTION */
-/* */
-/* 05-19-2020 Chaoqiong Xiao Initial Version 6.0 */
-/* 09-30-2020 Chaoqiong Xiao Modified comment(s), */
-/* resulting in version 6.1 */
/* */
/**************************************************************************/
VOID _ux_hcd_ehci_frame_number_set(UX_HCD_EHCI *hcd_ehci, ULONG frame_number)
@@ -77,19 +70,19 @@ VOID _ux_hcd_ehci_frame_number_set(UX_HCD_EHCI *hcd_ehci, ULONG frame_number)
ULONG ehci_register;
- /* It is illegal in EHCI to set the frame number while the controller is
+ /* It is illegal in EHCI to set the frame number while the controller is
running. */
ehci_register = _ux_hcd_ehci_register_read(hcd_ehci, EHCI_HCOR_USB_COMMAND);
if (ehci_register & EHCI_HC_IO_RS)
return;
-
+
/* The register is based on micro frames, so we need to multiply the
- value by 8 to get to the millisecond frame number. */
+ value by 8 to get to the millisecond frame number. */
ehci_register = frame_number << 3;
/* Write the frame number, by default the micro frame will be set to 0. */
_ux_hcd_ehci_register_write(hcd_ehci, EHCI_HCOR_FRAME_INDEX, ehci_register);
-
+
/* Return to caller. */
return;
}
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 29ed47dc..0c4bc167 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
@@ -1,18 +1,19 @@
/***************************************************************************
- * Copyright (c) 2024 Microsoft Corporation
- *
+ * Copyright (c) 2024 Microsoft Corporation
+ * Copyright (c) 2026-present Eclipse ThreadX contributors
+ *
* This program and the accompanying materials are made available under the
* terms of the MIT License which is available at
* https://opensource.org/licenses/MIT.
- *
+ *
* SPDX-License-Identifier: MIT
**************************************************************************/
/**************************************************************************/
/**************************************************************************/
-/** */
-/** USBX Component */
+/** */
+/** USBX Component */
/** */
/** EHCI Controller Driver */
/** */
@@ -29,46 +30,36 @@
#include "ux_host_stack.h"
-/**************************************************************************/
-/* */
-/* FUNCTION RELEASE */
-/* */
-/* _ux_hcd_ehci_fsisochronous_td_obtain PORTABLE C */
+/**************************************************************************/
+/* */
+/* FUNCTION RELEASE */
+/* */
+/* _ux_hcd_ehci_fsisochronous_td_obtain PORTABLE C */
/* 6.1 */
/* AUTHOR */
/* */
/* Chaoqiong Xiao, Microsoft Corporation */
/* */
/* DESCRIPTION */
-/* */
-/* This function obtains a free TD from the full speed isochronous */
-/* TD list. */
-/* */
-/* INPUT */
-/* */
-/* hcd_ehci Pointer to EHCI controller */
-/* */
-/* OUTPUT */
-/* */
-/* UX_EHCI_FSISO_TD * Pointer to EHCI FSISO TD */
-/* */
-/* CALLS */
-/* */
-/* None */
-/* */
-/* CALLED BY */
-/* */
+/* */
+/* This function obtains a free TD from the full speed isochronous */
+/* TD list. */
+/* */
+/* INPUT */
+/* */
+/* hcd_ehci Pointer to EHCI controller */
+/* */
+/* OUTPUT */
+/* */
+/* UX_EHCI_FSISO_TD * Pointer to EHCI FSISO TD */
+/* */
+/* CALLS */
+/* */
+/* None */
+/* */
+/* CALLED BY */
+/* */
/* EHCI Controller Driver */
-/* */
-/* RELEASE HISTORY */
-/* */
-/* DATE NAME DESCRIPTION */
-/* */
-/* 05-19-2020 Chaoqiong Xiao Initial Version 6.0 */
-/* 09-30-2020 Chaoqiong Xiao Modified comment(s), */
-/* verified memset and memcpy */
-/* cases, */
-/* resulting in version 6.1 */
/* */
/**************************************************************************/
UX_EHCI_FSISO_TD *_ux_hcd_ehci_fsisochronous_td_obtain(UX_HCD_EHCI *hcd_ehci)
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 8d2f414b..7ae2de86 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
@@ -1,10 +1,11 @@
/***************************************************************************
- * Copyright (c) 2024 Microsoft Corporation
- *
+ * Copyright (c) 2024 Microsoft Corporation
+ * Copyright (c) 2026-present Eclipse ThreadX contributors
+ *
* This program and the accompanying materials are made available under the
* terms of the MIT License which is available at
* https://opensource.org/licenses/MIT.
- *
+ *
* SPDX-License-Identifier: MIT
**************************************************************************/
@@ -66,16 +67,6 @@
/* */
/* EHCI Controller Driver */
/* */
-/* RELEASE HISTORY */
-/* */
-/* DATE NAME DESCRIPTION */
-/* */
-/* 05-19-2020 Chaoqiong Xiao Initial Version 6.0 */
-/* 09-30-2020 Chaoqiong Xiao Modified comment(s), */
-/* resulting in version 6.1 */
-/* 01-31-2022 Chaoqiong Xiao Modified comment(s), */
-/* resulting in version 6.1.10 */
-/* */
/**************************************************************************/
UX_EHCI_FSISO_TD* _ux_hcd_ehci_fsisochronous_tds_process(
UX_HCD_EHCI *hcd_ehci,
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 ddfb557e..b8a26de9 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
@@ -1,10 +1,11 @@
/***************************************************************************
- * Copyright (c) 2024 Microsoft Corporation
- *
+ * Copyright (c) 2024 Microsoft Corporation
+ * Copyright (c) 2026-present Eclipse ThreadX contributors
+ *
* This program and the accompanying materials are made available under the
* terms of the MIT License which is available at
* https://opensource.org/licenses/MIT.
- *
+ *
* SPDX-License-Identifier: MIT
**************************************************************************/
@@ -60,16 +61,6 @@
/* */
/* EHCI Controller Driver */
/* */
-/* RELEASE HISTORY */
-/* */
-/* DATE NAME DESCRIPTION */
-/* */
-/* 05-19-2020 Chaoqiong Xiao Initial Version 6.0 */
-/* 09-30-2020 Chaoqiong Xiao Modified comment(s), */
-/* verified memset and memcpy */
-/* cases, */
-/* resulting in version 6.1 */
-/* */
/**************************************************************************/
UX_EHCI_HSISO_TD *_ux_hcd_ehci_hsisochronous_td_obtain(UX_HCD_EHCI *hcd_ehci)
{
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 94f0548c..d83deb3f 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
@@ -1,10 +1,11 @@
/***************************************************************************
- * Copyright (c) 2024 Microsoft Corporation
- *
+ * Copyright (c) 2024 Microsoft Corporation
+ * Copyright (c) 2026-present Eclipse ThreadX contributors
+ *
* This program and the accompanying materials are made available under the
* terms of the MIT License which is available at
* https://opensource.org/licenses/MIT.
- *
+ *
* SPDX-License-Identifier: MIT
**************************************************************************/
@@ -64,23 +65,6 @@
/* */
/* EHCI Controller Driver */
/* */
-/* RELEASE HISTORY */
-/* */
-/* DATE NAME DESCRIPTION */
-/* */
-/* 05-19-2020 Chaoqiong Xiao Initial Version 6.0 */
-/* 09-30-2020 Chaoqiong Xiao Modified comment(s), */
-/* resulting in version 6.1 */
-/* 11-09-2020 Chaoqiong Xiao Modified comment(s), */
-/* fixed compile warnings, */
-/* resulting in version 6.1.2 */
-/* 01-31-2022 Chaoqiong Xiao Modified comment(s), */
-/* refined macros names, */
-/* resulting in version 6.1.10 */
-/* 07-29-2022 Chaoqiong Xiao Modified comment(s), */
-/* improved uframe handling, */
-/* resulting in version 6.1.12 */
-/* */
/**************************************************************************/
UX_EHCI_HSISO_TD* _ux_hcd_ehci_hsisochronous_tds_process(
UX_HCD_EHCI *hcd_ehci,
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 cde5fb71..7ffb0a21 100644
--- a/common/usbx_host_controllers/src/ux_hcd_ehci_initialize.c
+++ b/common/usbx_host_controllers/src/ux_hcd_ehci_initialize.c
@@ -1,10 +1,11 @@
/***************************************************************************
- * Copyright (c) 2024 Microsoft Corporation
- *
+ * Copyright (c) 2024 Microsoft Corporation
+ * Copyright (c) 2026-present Eclipse ThreadX contributors
+ *
* This program and the accompanying materials are made available under the
* terms of the MIT License which is available at
* https://opensource.org/licenses/MIT.
- *
+ *
* SPDX-License-Identifier: MIT
**************************************************************************/
@@ -98,25 +99,6 @@
/* */
/* EHCI Controller Driver */
/* */
-/* 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 */
-/* 08-02-2021 Wen Wang Modified comment(s), */
-/* fixed spelling error, */
-/* resulting in version 6.1.8 */
-/* 01-31-2022 Chaoqiong Xiao Modified comment(s), */
-/* refined macros names, */
-/* resulting in version 6.1.10 */
-/* 04-25-2022 Chaoqiong Xiao Modified comment(s), */
-/* fixed standalone compile, */
-/* resulting in version 6.1.11 */
-/* */
/**************************************************************************/
UINT _ux_hcd_ehci_initialize(UX_HCD *hcd)
{
@@ -425,12 +407,15 @@ UINT status = UX_SUCCESS;
if (hcd_ehci -> ux_hcd_ehci_hsiso_td_list)
_ux_utility_memory_free(hcd_ehci -> ux_hcd_ehci_hsiso_td_list);
#endif
- if (hcd_ehci -> ux_hcd_ehci_periodic_mutex.tx_mutex_id != 0)
+ if (_ux_host_mutex_created(&hcd_ehci -> ux_hcd_ehci_periodic_mutex))
_ux_host_mutex_delete(&hcd_ehci -> ux_hcd_ehci_periodic_mutex);
- if (hcd_ehci -> ux_hcd_ehci_protect_semaphore.tx_semaphore_id != 0)
+
+ if (_ux_host_semaphore_created(&hcd_ehci -> ux_hcd_ehci_protect_semaphore))
_ux_host_semaphore_delete(&hcd_ehci -> ux_hcd_ehci_protect_semaphore);
- if (hcd_ehci -> ux_hcd_ehci_doorbell_semaphore.tx_semaphore_id != 0)
+
+ if (_ux_host_semaphore_created(&hcd_ehci -> ux_hcd_ehci_doorbell_semaphore))
_ux_host_semaphore_delete(&hcd_ehci -> ux_hcd_ehci_doorbell_semaphore);
+
_ux_utility_memory_free(hcd_ehci);
/* Return error status code. */
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 81c84309..555b7925 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
@@ -1,18 +1,19 @@
/***************************************************************************
- * Copyright (c) 2024 Microsoft Corporation
- *
+ * Copyright (c) 2024 Microsoft Corporation
+ * Copyright (c) 2026-present Eclipse ThreadX contributors
+ *
* This program and the accompanying materials are made available under the
* terms of the MIT License which is available at
* https://opensource.org/licenses/MIT.
- *
+ *
* SPDX-License-Identifier: MIT
**************************************************************************/
/**************************************************************************/
/**************************************************************************/
-/** */
-/** USBX Component */
+/** */
+/** USBX Component */
/** */
/** EHCI Controller Driver */
/** */
@@ -29,83 +30,59 @@
#include "ux_host_stack.h"
-/**************************************************************************/
-/* */
-/* FUNCTION RELEASE */
-/* */
-/* _ux_hcd_ehci_interrupt_endpoint_create PORTABLE C */
+/**************************************************************************/
+/* */
+/* FUNCTION RELEASE */
+/* */
+/* _ux_hcd_ehci_interrupt_endpoint_create PORTABLE C */
/* 6.3.0 */
/* AUTHOR */
/* */
/* Chaoqiong Xiao, Microsoft Corporation */
/* */
/* DESCRIPTION */
-/* */
-/* This function will create an interrupt endpoint. The interrupt */
-/* endpoint has an interval of operation from 1 to 255. In EHCI, the */
+/* */
+/* This function will create an interrupt endpoint. The interrupt */
+/* endpoint has an interval of operation from 1 to 255. In EHCI, the */
/* hardware assisted interrupt is from 1 to 32. */
/* */
/* This routine will match the best interval for the EHCI hardware. */
-/* It will also determine the best node to hook the endpoint based on */
+/* It will also determine the best node to hook the endpoint based on */
/* the load that already exists on the horizontal ED chain. */
/* */
/* For the ones curious about this coding. The tricky part is to */
-/* understand how the interrupt matrix is constructed. We have used */
-/* eds with the skip bit on to build a frame of anchor eds. Each ED */
-/* creates a node for an appropriate combination of interval frequency */
+/* understand how the interrupt matrix is constructed. We have used */
+/* eds with the skip bit on to build a frame of anchor eds. Each ED */
+/* creates a node for an appropriate combination of interval frequency */
/* in the list. */
/* */
/* After obtaining a pointer to the list with the lowest traffic, we */
-/* traverse the list from the highest interval until we reach the */
-/* interval required. At that node, we anchor our real ED to the node */
-/* and link the ED that was attached to the node to our ED. */
-/* */
-/* INPUT */
-/* */
-/* hcd_ehci Pointer to EHCI controller */
-/* endpoint Pointer to endpoint */
-/* */
-/* OUTPUT */
-/* */
-/* Completion Status */
-/* */
-/* CALLS */
-/* */
-/* _ux_hcd_ehci_ed_obtain Obtain an ED */
-/* _ux_hcd_ehci_least_traffic_list_get Get least traffic list */
+/* traverse the list from the highest interval until we reach the */
+/* interval required. At that node, we anchor our real ED to the node */
+/* and link the ED that was attached to the node to our ED. */
+/* */
+/* INPUT */
+/* */
+/* hcd_ehci Pointer to EHCI controller */
+/* endpoint Pointer to endpoint */
+/* */
+/* OUTPUT */
+/* */
+/* Completion Status */
+/* */
+/* CALLS */
+/* */
+/* _ux_hcd_ehci_ed_obtain Obtain an ED */
+/* _ux_hcd_ehci_least_traffic_list_get Get least traffic list */
/* _ux_hcd_ehci_poll_rate_entry_get Get anchor for poll rate */
-/* _ux_utility_physical_address Get physical address */
+/* _ux_utility_physical_address Get physical address */
/* _ux_host_mutex_on Get mutex */
/* _ux_host_mutex_off Put mutex */
/* _ux_hcd_ehci_periodic_descriptor_link Link/unlink descriptor */
-/* */
-/* CALLED BY */
-/* */
+/* */
+/* CALLED BY */
+/* */
/* EHCI Controller Driver */
-/* */
-/* 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 */
-/* 11-09-2020 Chaoqiong Xiao Modified comment(s), */
-/* fixed compile warnings, */
-/* resulting in version 6.1.2 */
-/* 04-02-2021 Chaoqiong Xiao Modified comment(s), */
-/* fixed compile issues with */
-/* some macro options, */
-/* filled max transfer length, */
-/* resulting in version 6.1.6 */
-/* 04-25-2022 Chaoqiong Xiao Modified comment(s), */
-/* fixed standalone compile, */
-/* resulting in version 6.1.11 */
-/* 10-31-2023 Chaoqiong Xiao Modified comment(s), */
-/* fixed split transfer issue, */
-/* resulting in version 6.3.0 */
/* */
/**************************************************************************/
UINT _ux_hcd_ehci_interrupt_endpoint_create(UX_HCD_EHCI *hcd_ehci, UX_ENDPOINT *endpoint)
@@ -145,35 +122,35 @@ UINT i;
of any transfer in the transfer request. */
endpoint -> ux_endpoint_transfer_request.ux_transfer_request_maximum_length = UX_EHCI_MAX_PAYLOAD;
- /* Obtain a ED for this new endpoint. This ED will live as long as the endpoint is
+ /* Obtain a ED for this new endpoint. This ED will live as long as the endpoint is
active and will be the container for the tds. */
ed = _ux_hcd_ehci_ed_obtain(hcd_ehci);
if (ed == UX_NULL)
return(UX_NO_ED_AVAILABLE);
-
+
/* Attach the ED to the endpoint container. */
endpoint -> ux_endpoint_ed = (VOID *) ed;
-
+
/* Now do the opposite, attach the ED container to the physical ED. */
ed -> REF_AS.INTR.ux_ehci_ed_endpoint = endpoint;
/* Set the default MPS Capability info in the ED. */
max_packet_size = endpoint -> ux_endpoint_descriptor.wMaxPacketSize & UX_MAX_PACKET_SIZE_MASK;
ed -> ux_ehci_ed_cap0 = max_packet_size << UX_EHCI_QH_MPS_LOC;
-
+
/* Set the device address. */
ed -> ux_ehci_ed_cap0 |= device -> ux_device_address;
/* Add the endpoint address. */
ed -> ux_ehci_ed_cap0 |= (endpoint -> ux_endpoint_descriptor.bEndpointAddress & ~UX_ENDPOINT_DIRECTION) << UX_EHCI_QH_ED_AD_LOC;
- /* Set the High Bandwidth Pipe Multiplier to number transactions. */
+ /* Set the High Bandwidth Pipe Multiplier to number transactions. */
num_transaction = (endpoint -> ux_endpoint_descriptor.wMaxPacketSize & UX_MAX_NUMBER_OF_TRANSACTIONS_MASK) >> UX_MAX_NUMBER_OF_TRANSACTIONS_SHIFT;
if (num_transaction < 3)
num_transaction ++;
ed -> ux_ehci_ed_cap1 |= (num_transaction << UX_EHCI_QH_HBPM_LOC);
- /* Set the device speed for full and low speed devices behind a HUB. The HUB address and the
+ /* Set the device speed for full and low speed devices behind a HUB. The HUB address and the
port index must be stored in the endpoint. For low/full speed devices, the C-mask field must be set. */
switch (device -> ux_device_speed)
{
@@ -196,7 +173,7 @@ UINT i;
/* Store the parent hub device address. */
ed -> ux_ehci_ed_cap1 |= device -> ux_device_parent -> ux_device_address << UX_EHCI_QH_HUB_ADDR_LOC;
- /* And the port index onto which this device is attached. */
+ /* 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
@@ -259,8 +236,8 @@ UINT i;
/* Get the list index with the least traffic. */
ed_list = _ux_hcd_ehci_least_traffic_list_get(hcd_ehci, microframe_load, microframe_ssplit_count);
- /* Now we need to scan the list of eds from the lowest load entry until we reach the
- appropriate interval node. The depth index is the interval EHCI value and the
+ /* Now we need to scan the list of eds from the lowest load entry until we reach the
+ appropriate interval node. The depth index is the interval EHCI value and the
1st entry is pointed by the ED list entry. */
ed_anchor = _ux_hcd_ehci_poll_rate_entry_get(hcd_ehci, ed_list, poll_depth);
@@ -282,7 +259,7 @@ UINT i;
#if defined(UX_HCD_EHCI_SPLIT_TRANSFER_ENABLE)
if (device -> ux_device_speed != UX_HIGH_SPEED_DEVICE)
{
-
+
/* Skip Y6 since host must not use it. */
if (i == 6)
continue;
@@ -402,7 +379,7 @@ UINT i;
ed_anchor -> REF_AS.ANCHOR.ux_ehci_ed_microframe_load[i] = (USHORT)(ed_anchor -> REF_AS.ANCHOR.ux_ehci_ed_microframe_load[i] + max_packet_size);
}
- /* We found the node entry of the ED pointer that will be the anchor for this interrupt
+ /* We found the node entry of the ED pointer that will be the anchor for this interrupt
endpoint. Now we attach this endpoint to the anchor and rebuild the chain. */
/* Physical LP, with Typ QH, clear T. */
@@ -423,5 +400,5 @@ UINT i;
_ux_host_mutex_off(&hcd_ehci -> ux_hcd_ehci_periodic_mutex);
/* Return successful completion. */
- return(UX_SUCCESS);
+ return(UX_SUCCESS);
}
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 710c2056..1dbe44e8 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
@@ -1,10 +1,11 @@
/***************************************************************************
- * Copyright (c) 2024 Microsoft Corporation
- *
+ * Copyright (c) 2024 Microsoft Corporation
+ * Copyright (c) 2026-present Eclipse ThreadX contributors
+ *
* This program and the accompanying materials are made available under the
* terms of the MIT License which is available at
* https://opensource.org/licenses/MIT.
- *
+ *
* SPDX-License-Identifier: MIT
**************************************************************************/
@@ -64,24 +65,6 @@
/* */
/* EHCI Controller Driver */
/* */
-/* RELEASE HISTORY */
-/* */
-/* DATE NAME DESCRIPTION */
-/* */
-/* 05-19-2020 Chaoqiong Xiao Initial Version 6.0 */
-/* 09-30-2020 Chaoqiong Xiao Modified comment(s), */
-/* resulting in version 6.1 */
-/* 11-09-2020 Chaoqiong Xiao Modified comment(s), */
-/* fixed compile warnings, */
-/* resulting in version 6.1.2 */
-/* 04-02-2021 Chaoqiong Xiao Modified comment(s), */
-/* fixed compile issues with */
-/* some macro options, */
-/* resulting in version 6.1.6 */
-/* 04-25-2022 Chaoqiong Xiao Modified comment(s), */
-/* fixed standalone compile, */
-/* resulting in version 6.1.11 */
-/* */
/**************************************************************************/
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 2ca602a2..3caef3cf 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
@@ -1,18 +1,19 @@
/***************************************************************************
- * Copyright (c) 2024 Microsoft Corporation
- *
+ * Copyright (c) 2024 Microsoft Corporation
+ * Copyright (c) 2026-present Eclipse ThreadX contributors
+ *
* This program and the accompanying materials are made available under the
* terms of the MIT License which is available at
* https://opensource.org/licenses/MIT.
- *
+ *
* SPDX-License-Identifier: MIT
**************************************************************************/
/**************************************************************************/
/**************************************************************************/
-/** */
-/** USBX Component */
+/** */
+/** USBX Component */
/** */
/** EHCI Controller Driver */
/** */
@@ -29,58 +30,47 @@
#include "ux_host_stack.h"
-/**************************************************************************/
-/* */
-/* FUNCTION RELEASE */
-/* */
-/* _ux_hcd_ehci_interrupt_handler PORTABLE C */
+/**************************************************************************/
+/* */
+/* FUNCTION RELEASE */
+/* */
+/* _ux_hcd_ehci_interrupt_handler PORTABLE C */
/* 6.1.10 */
/* AUTHOR */
/* */
/* Chaoqiong Xiao, Microsoft Corporation */
/* */
/* DESCRIPTION */
-/* */
+/* */
/* This function is the interrupt handler for the EHCI interrupts. */
-/* Normally an interrupt occurs from the controller when there is */
-/* either a EOF signal and there has been transfers within the frame */
-/* or when there is a change on one of the downstream ports, a */
+/* Normally an interrupt occurs from the controller when there is */
+/* either a EOF signal and there has been transfers within the frame */
+/* or when there is a change on one of the downstream ports, a */
/* doorbell signal or an unrecoverable error. */
/* */
-/* All we need to do in the ISR is scan the controllers to find out */
-/* which one has issued a IRQ. If there is work to do for this */
-/* controller we need to wake up the corresponding thread to take care */
-/* of the job. */
-/* */
-/* INPUT */
-/* */
-/* None */
-/* */
-/* OUTPUT */
-/* */
-/* None */
-/* */
-/* CALLS */
-/* */
-/* _ux_hcd_ehci_controller_disable Disable controller */
-/* _ux_hcd_ehci_register_read Read EHCI register */
-/* _ux_hcd_ehci_register_write Write EHCI register */
-/* _ux_host_semaphore_put Put semaphore */
-/* */
-/* CALLED BY */
-/* */
+/* All we need to do in the ISR is scan the controllers to find out */
+/* which one has issued a IRQ. If there is work to do for this */
+/* controller we need to wake up the corresponding thread to take care */
+/* of the job. */
+/* */
+/* INPUT */
+/* */
+/* None */
+/* */
+/* OUTPUT */
+/* */
+/* None */
+/* */
+/* CALLS */
+/* */
+/* _ux_hcd_ehci_controller_disable Disable controller */
+/* _ux_hcd_ehci_register_read Read EHCI register */
+/* _ux_hcd_ehci_register_write Write EHCI register */
+/* _ux_host_semaphore_put Put semaphore */
+/* */
+/* CALLED BY */
+/* */
/* EHCI Controller Driver */
-/* */
-/* RELEASE HISTORY */
-/* */
-/* DATE NAME DESCRIPTION */
-/* */
-/* 05-19-2020 Chaoqiong Xiao Initial Version 6.0 */
-/* 09-30-2020 Chaoqiong Xiao Modified comment(s), */
-/* resulting in version 6.1 */
-/* 01-31-2022 Chaoqiong Xiao Modified comment(s), */
-/* refined macros names, */
-/* resulting in version 6.1.10 */
/* */
/**************************************************************************/
VOID _ux_hcd_ehci_interrupt_handler(VOID)
@@ -95,7 +85,7 @@ ULONG root_hub_thread_wakeup = 0;
ULONG port_index;
- /* We need to parse the controller driver table to find all controllers that registered
+ /* We need to parse the controller driver table to find all controllers that registered
as EHCI. */
for (hcd_index = 0; hcd_index < _ux_system_host -> ux_system_host_registered_hcd; hcd_index++)
{
@@ -131,7 +121,7 @@ ULONG port_index;
hcd -> ux_hcd_thread_signal++;
_ux_host_semaphore_put(&_ux_system_host -> ux_system_host_hcd_semaphore);
}
-
+
if (ehci_register & EHCI_HC_STS_HSE)
{
@@ -157,24 +147,24 @@ ULONG port_index;
/* Read the port status. */
ehci_register_port_status = _ux_hcd_ehci_register_read(hcd_ehci, EHCI_HCOR_PORT_SC + port_index);
-
+
/* Check for Connect Status Change signal. */
if (ehci_register_port_status & EHCI_HC_PS_CSC)
- {
+ {
/* Something happened on this port. Signal it to the root hub thread. */
hcd -> ux_hcd_root_hub_signal[port_index]++;
-
+
/* Memorize wake up signal. */
root_hub_thread_wakeup ++;
}
-
+
}
/* We only wake up the root hub thread if there has been device insertion/extraction. */
if (root_hub_thread_wakeup != 0)
- /* The controller has issued a Root hub status change signal.
+ /* The controller has issued a Root hub status change signal.
We need to resume the thread in charge of the USB topology. */
_ux_host_semaphore_put(&_ux_system_host -> ux_system_host_enum_semaphore);
}
@@ -182,7 +172,7 @@ ULONG port_index;
if (ehci_register & EHCI_HC_STS_IAA)
{
- /* The controller has issued a Door Bell status change signal.
+ /* The controller has issued a Door Bell status change signal.
We need to resume the thread who raised the doorbell. */
_ux_host_semaphore_put(&hcd_ehci -> ux_hcd_ehci_doorbell_semaphore);
}
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 31a753a0..e5fa94b9 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
@@ -1,10 +1,11 @@
/***************************************************************************
- * Copyright (c) 2024 Microsoft Corporation
- *
+ * Copyright (c) 2024 Microsoft Corporation
+ * Copyright (c) 2026-present Eclipse ThreadX contributors
+ *
* This program and the accompanying materials are made available under the
* terms of the MIT License which is available at
* https://opensource.org/licenses/MIT.
- *
+ *
* SPDX-License-Identifier: MIT
**************************************************************************/
@@ -68,30 +69,6 @@
/* */
/* EHCI Controller Driver */
/* */
-/* RELEASE HISTORY */
-/* */
-/* DATE NAME DESCRIPTION */
-/* */
-/* 05-19-2020 Chaoqiong Xiao Initial Version 6.0 */
-/* 09-30-2020 Chaoqiong Xiao Modified comment(s), */
-/* resulting in version 6.1 */
-/* 11-09-2020 Chaoqiong Xiao Modified comment(s), */
-/* fixed compile warnings, */
-/* resulting in version 6.1.2 */
-/* 04-02-2021 Chaoqiong Xiao Modified comment(s), */
-/* fixed compile issues with */
-/* some macro options, */
-/* filled max transfer length, */
-/* resulting in version 6.1.6 */
-/* 04-25-2022 Chaoqiong Xiao Modified comment(s), */
-/* fixed standalone compile, */
-/* resulting in version 6.1.11 */
-/* 10-31-2023 Chaoqiong Xiao Modified comment(s), */
-/* fixed error handling, */
-/* fixed split transfer issue, */
-/* fixed compile warnings, */
-/* resulting in version 6.3.0 */
-/* */
/**************************************************************************/
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 c5c620d7..76353e47 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
@@ -1,10 +1,11 @@
/***************************************************************************
- * Copyright (c) 2024 Microsoft Corporation
- *
+ * Copyright (c) 2024 Microsoft Corporation
+ * Copyright (c) 2026-present Eclipse ThreadX contributors
+ *
* This program and the accompanying materials are made available under the
* terms of the MIT License which is available at
* https://opensource.org/licenses/MIT.
- *
+ *
* SPDX-License-Identifier: MIT
**************************************************************************/
@@ -64,24 +65,6 @@
/* */
/* EHCI Controller Driver */
/* */
-/* RELEASE HISTORY */
-/* */
-/* DATE NAME DESCRIPTION */
-/* */
-/* 05-19-2020 Chaoqiong Xiao Initial Version 6.0 */
-/* 09-30-2020 Chaoqiong Xiao Modified comment(s), */
-/* resulting in version 6.1 */
-/* 11-09-2020 Chaoqiong Xiao Modified comment(s), */
-/* fixed compile warnings, */
-/* resulting in version 6.1.2 */
-/* 04-02-2021 Chaoqiong Xiao Modified comment(s), */
-/* fixed compile issues with */
-/* some macro options, */
-/* resulting in version 6.1.6 */
-/* 04-25-2022 Chaoqiong Xiao Modified comment(s), */
-/* fixed standalone compile, */
-/* resulting in version 6.1.11 */
-/* */
/**************************************************************************/
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 3deb7b0c..632c120f 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
@@ -1,10 +1,11 @@
/***************************************************************************
- * Copyright (c) 2024 Microsoft Corporation
- *
+ * Copyright (c) 2024 Microsoft Corporation
+ * Copyright (c) 2026-present Eclipse ThreadX contributors
+ *
* This program and the accompanying materials are made available under the
* terms of the MIT License which is available at
* https://opensource.org/licenses/MIT.
- *
+ *
* SPDX-License-Identifier: MIT
**************************************************************************/
@@ -64,21 +65,6 @@
/* */
/* EHCI Controller Driver */
/* */
-/* RELEASE HISTORY */
-/* */
-/* DATE NAME DESCRIPTION */
-/* */
-/* 05-19-2020 Chaoqiong Xiao Initial Version 6.0 */
-/* 09-30-2020 Chaoqiong Xiao Modified comment(s), */
-/* resulting in version 6.1 */
-/* 11-09-2020 Chaoqiong Xiao Modified comment(s), */
-/* fixed compile warnings, */
-/* resulting in version 6.1.2 */
-/* 04-02-2021 Chaoqiong Xiao Modified comment(s), */
-/* fixed compile issues with */
-/* some macro options, */
-/* resulting in version 6.1.6 */
-/* */
/**************************************************************************/
UX_EHCI_ED *_ux_hcd_ehci_least_traffic_list_get(UX_HCD_EHCI *hcd_ehci,
ULONG microframe_load[8], ULONG microframe_ssplit_count[8])
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 d986d7e6..4c6086cd 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
@@ -1,18 +1,19 @@
/***************************************************************************
- * Copyright (c) 2024 Microsoft Corporation
- *
+ * Copyright (c) 2024 Microsoft Corporation
+ * Copyright (c) 2026-present Eclipse ThreadX contributors
+ *
* This program and the accompanying materials are made available under the
* terms of the MIT License which is available at
* https://opensource.org/licenses/MIT.
- *
+ *
* SPDX-License-Identifier: MIT
**************************************************************************/
/**************************************************************************/
/**************************************************************************/
-/** */
-/** USBX Component */
+/** */
+/** USBX Component */
/** */
/** EHCI Controller Driver */
/** */
@@ -29,44 +30,36 @@
#include "ux_host_stack.h"
-/**************************************************************************/
-/* */
-/* FUNCTION RELEASE */
-/* */
-/* _ux_hcd_ehci_next_td_clean PORTABLE C */
+/**************************************************************************/
+/* */
+/* FUNCTION RELEASE */
+/* */
+/* _ux_hcd_ehci_next_td_clean PORTABLE C */
/* 6.1 */
/* AUTHOR */
/* */
/* Chaoqiong Xiao, Microsoft Corporation */
/* */
/* DESCRIPTION */
-/* */
-/* This function cleans all the tds attached to a ED. The end of the */
-/* TD chain is pointed by the tail TD. */
-/* */
-/* INPUT */
-/* */
-/* TD Pointer to TD */
-/* */
-/* OUTPUT */
-/* */
-/* None */
-/* */
-/* CALLS */
-/* */
-/* None */
-/* */
-/* CALLED BY */
-/* */
+/* */
+/* This function cleans all the tds attached to a ED. The end of the */
+/* TD chain is pointed by the tail TD. */
+/* */
+/* INPUT */
+/* */
+/* TD Pointer to TD */
+/* */
+/* OUTPUT */
+/* */
+/* None */
+/* */
+/* CALLS */
+/* */
+/* None */
+/* */
+/* CALLED BY */
+/* */
/* EHCI Controller Driver */
-/* */
-/* RELEASE HISTORY */
-/* */
-/* DATE NAME DESCRIPTION */
-/* */
-/* 05-19-2020 Chaoqiong Xiao Initial Version 6.0 */
-/* 09-30-2020 Chaoqiong Xiao Modified comment(s), */
-/* resulting in version 6.1 */
/* */
/**************************************************************************/
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 e09ff3bc..53a42f85 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
@@ -1,10 +1,11 @@
/***************************************************************************
- * Copyright (c) 2024 Microsoft Corporation
- *
+ * Copyright (c) 2024 Microsoft Corporation
+ * Copyright (c) 2026-present Eclipse ThreadX contributors
+ *
* This program and the accompanying materials are made available under the
* terms of the MIT License which is available at
* https://opensource.org/licenses/MIT.
- *
+ *
* SPDX-License-Identifier: MIT
**************************************************************************/
@@ -80,14 +81,6 @@
/* */
/* EHCI Controller Driver */
/* */
-/* RELEASE HISTORY */
-/* */
-/* DATE NAME DESCRIPTION */
-/* */
-/* 05-19-2020 Chaoqiong Xiao Initial Version 6.0 */
-/* 09-30-2020 Chaoqiong Xiao Modified comment(s), */
-/* resulting in version 6.1 */
-/* */
/**************************************************************************/
void _ux_hcd_ehci_periodic_descriptor_link(
VOID* prev,
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 fb879bba..944bdcd7 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
@@ -1,18 +1,19 @@
/***************************************************************************
- * Copyright (c) 2024 Microsoft Corporation
- *
+ * Copyright (c) 2024 Microsoft Corporation
+ * Copyright (c) 2026-present Eclipse ThreadX contributors
+ *
* This program and the accompanying materials are made available under the
* terms of the MIT License which is available at
* https://opensource.org/licenses/MIT.
- *
+ *
* SPDX-License-Identifier: MIT
**************************************************************************/
/**************************************************************************/
/**************************************************************************/
-/** */
-/** USBX Component */
+/** */
+/** USBX Component */
/** */
/** EHCI Controller Driver */
/** */
@@ -29,48 +30,37 @@
#include "ux_host_stack.h"
-/**************************************************************************/
-/* */
-/* FUNCTION RELEASE */
-/* */
-/* _ux_hcd_ehci_periodic_tree_create PORTABLE C */
+/**************************************************************************/
+/* */
+/* FUNCTION RELEASE */
+/* */
+/* _ux_hcd_ehci_periodic_tree_create PORTABLE C */
/* 6.1.2 */
/* AUTHOR */
/* */
/* Chaoqiong Xiao, Microsoft Corporation */
/* */
/* DESCRIPTION */
-/* */
+/* */
/* This function creates the periodic static tree for the interrupt */
-/* and isochronous eds. */
-/* */
-/* INPUT */
-/* */
-/* hcd_ehci Pointer to EHCI controller */
-/* */
-/* OUTPUT */
-/* */
-/* Completion Status */
-/* */
-/* CALLS */
-/* */
-/* _ux_hcd_ehci_ed_obtain Obtain an ED */
-/* _ux_utility_physical_address Get physical address */
-/* */
-/* CALLED BY */
-/* */
+/* and isochronous eds. */
+/* */
+/* INPUT */
+/* */
+/* hcd_ehci Pointer to EHCI controller */
+/* */
+/* OUTPUT */
+/* */
+/* Completion Status */
+/* */
+/* CALLS */
+/* */
+/* _ux_hcd_ehci_ed_obtain Obtain an ED */
+/* _ux_utility_physical_address Get physical address */
+/* */
+/* CALLED BY */
+/* */
/* EHCI Controller Driver */
-/* */
-/* RELEASE HISTORY */
-/* */
-/* DATE NAME DESCRIPTION */
-/* */
-/* 05-19-2020 Chaoqiong Xiao Initial Version 6.0 */
-/* 09-30-2020 Chaoqiong Xiao Modified comment(s), */
-/* resulting in version 6.1 */
-/* 11-09-2020 Chaoqiong Xiao Modified comment(s), */
-/* fixed compile warnings, */
-/* resulting in version 6.1.2 */
/* */
/**************************************************************************/
UINT _ux_hcd_ehci_periodic_tree_create(UX_HCD_EHCI *hcd_ehci)
@@ -84,7 +74,7 @@ UINT current_list_entry;
UX_EHCI_ED *ed_list[32];
UX_EHCI_ED *ed_start_list[32];
UX_EHCI_PERIODIC_LINK_POINTER lp;
-
+
/* Start with the 1st list - it has 32 entries. */
list_entries = 32;
@@ -122,7 +112,7 @@ UX_EHCI_PERIODIC_LINK_POINTER lp;
}
else
{
-
+
/* We need to update the previous ED with the link to this new ED. Since
this is a tree structure, this operation is done twice to the 2 previous
eds in the previous list. */
@@ -149,21 +139,21 @@ UX_EHCI_PERIODIC_LINK_POINTER lp;
/* Check the value of the ehci frame list entries. If 0, it was not initialized by the controller init function. */
if (hcd_ehci -> ux_hcd_ehci_frame_list_size == 0)
-
+
/* Value not initialized. Use default. */
hcd_ehci -> ux_hcd_ehci_frame_list_size = UX_EHCI_FRAME_LIST_ENTRIES;
/* The tree has been completed but the entries in the EHCI frame list are in the wrong order.
- We need to swap each entry according to the EHCI specified entry order list so that we
- have a fair interval frequency for each periodic ED. The primary eds are fetched from the
- start list, translated into physical addresses and stored into the frame List. */
+ We need to swap each entry according to the EHCI specified entry order list so that we
+ have a fair interval frequency for each periodic ED. The primary eds are fetched from the
+ start list, translated into physical addresses and stored into the frame List. */
for (current_list_entry = 0; current_list_entry < 32; current_list_entry++)
{
ed = ed_start_list[_ux_system_host_hcd_periodic_tree_entries[current_list_entry]];
*(hcd_ehci -> ux_hcd_ehci_frame_list+current_list_entry) = (UX_EHCI_ED *) _ux_utility_physical_address(ed);
}
-
+
/* We still haven't set the type of each queue head in the list itself. Do that now. */
for (current_list_entry = 0; current_list_entry < 32; current_list_entry++)
{
@@ -173,7 +163,7 @@ UX_EHCI_PERIODIC_LINK_POINTER lp;
hcd_ehci -> ux_hcd_ehci_frame_list[current_list_entry] = lp.ed_ptr;
}
- /* Now the first 32 entries in the frame list have to be duplicated to fill the other entries in the frame list.
+ /* Now the first 32 entries in the frame list have to be duplicated to fill the other entries in the frame list.
If the list is set to 32 entries, nothing is done here. */
for (current_list_entry = 32; current_list_entry < hcd_ehci -> ux_hcd_ehci_frame_list_size; current_list_entry++)
hcd_ehci -> ux_hcd_ehci_frame_list[current_list_entry] = hcd_ehci -> ux_hcd_ehci_frame_list[current_list_entry & 0x1f];
@@ -183,7 +173,7 @@ UX_EHCI_PERIODIC_LINK_POINTER lp;
* 32ms, 16ms, 8ms, 4ms, 2ms, 1ms -- micro-frames
*/
- /* Return successful completion. */
+ /* Return successful completion. */
return(UX_SUCCESS);
}
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 3c0a8ac7..03972935 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
@@ -1,10 +1,11 @@
/***************************************************************************
- * Copyright (c) 2024 Microsoft Corporation
- *
+ * Copyright (c) 2024 Microsoft Corporation
+ * Copyright (c) 2026-present Eclipse ThreadX contributors
+ *
* This program and the accompanying materials are made available under the
* terms of the MIT License which is available at
* https://opensource.org/licenses/MIT.
- *
+ *
* SPDX-License-Identifier: MIT
**************************************************************************/
@@ -70,17 +71,6 @@
/* */
/* EHCI Controller Driver */
/* */
-/* RELEASE HISTORY */
-/* */
-/* DATE NAME DESCRIPTION */
-/* */
-/* 05-19-2020 Chaoqiong Xiao Initial Version 6.0 */
-/* 09-30-2020 Chaoqiong Xiao Modified comment(s), */
-/* resulting in version 6.1 */
-/* 11-09-2020 Chaoqiong Xiao Modified comment(s), */
-/* fixed compile warnings, */
-/* resulting in version 6.1.2 */
-/* */
/**************************************************************************/
UX_EHCI_ED *_ux_hcd_ehci_poll_rate_entry_get(UX_HCD_EHCI *hcd_ehci,
UX_EHCI_ED *ed_list, ULONG poll_depth)
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 977d8097..76b6e85d 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
@@ -1,18 +1,19 @@
/***************************************************************************
- * Copyright (c) 2024 Microsoft Corporation
- *
+ * Copyright (c) 2024 Microsoft Corporation
+ * Copyright (c) 2026-present Eclipse ThreadX contributors
+ *
* This program and the accompanying materials are made available under the
* terms of the MIT License which is available at
* https://opensource.org/licenses/MIT.
- *
+ *
* SPDX-License-Identifier: MIT
**************************************************************************/
/**************************************************************************/
/**************************************************************************/
-/** */
-/** USBX Component */
+/** */
+/** USBX Component */
/** */
/** EHCI Controller Driver */
/** */
@@ -29,46 +30,38 @@
#include "ux_host_stack.h"
-/**************************************************************************/
-/* */
-/* FUNCTION RELEASE */
-/* */
-/* _ux_hcd_ehci_port_disable PORTABLE C */
+/**************************************************************************/
+/* */
+/* FUNCTION RELEASE */
+/* */
+/* _ux_hcd_ehci_port_disable PORTABLE C */
/* 6.1 */
/* AUTHOR */
/* */
/* Chaoqiong Xiao, Microsoft Corporation */
/* */
/* DESCRIPTION */
-/* */
-/* This function will disable a specific port attached to the root */
-/* HUB. */
-/* */
-/* INPUT */
-/* */
-/* hcd_ehci Pointer to EHCI controller */
-/* port_index Port index to disable */
-/* */
-/* OUTPUT */
-/* */
-/* Completion Status */
-/* */
-/* CALLS */
-/* */
-/* _ux_hcd_ehci_register_read Read EHCI register */
-/* _ux_hcd_ehci_register_write Write EHCI register */
-/* */
-/* CALLED BY */
-/* */
+/* */
+/* This function will disable a specific port attached to the root */
+/* HUB. */
+/* */
+/* INPUT */
+/* */
+/* hcd_ehci Pointer to EHCI controller */
+/* port_index Port index to disable */
+/* */
+/* OUTPUT */
+/* */
+/* Completion Status */
+/* */
+/* CALLS */
+/* */
+/* _ux_hcd_ehci_register_read Read EHCI register */
+/* _ux_hcd_ehci_register_write Write EHCI register */
+/* */
+/* CALLED BY */
+/* */
/* EHCI Controller Driver */
-/* */
-/* RELEASE HISTORY */
-/* */
-/* DATE NAME DESCRIPTION */
-/* */
-/* 05-19-2020 Chaoqiong Xiao Initial Version 6.0 */
-/* 09-30-2020 Chaoqiong Xiao Modified comment(s), */
-/* resulting in version 6.1 */
/* */
/**************************************************************************/
UINT _ux_hcd_ehci_port_disable(UX_HCD_EHCI *hcd_ehci, ULONG port_index)
@@ -89,7 +82,7 @@ ULONG ehci_register_port_status;
return(UX_PORT_INDEX_UNKNOWN);
}
-
+
/* Read the port status for this port. */
ehci_register_port_status = _ux_hcd_ehci_register_read(hcd_ehci, EHCI_HCOR_PORT_SC + 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 0bce1d10..bda85da2 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
@@ -1,18 +1,19 @@
/***************************************************************************
- * Copyright (c) 2024 Microsoft Corporation
- *
+ * Copyright (c) 2024 Microsoft Corporation
+ * Copyright (c) 2026-present Eclipse ThreadX contributors
+ *
* This program and the accompanying materials are made available under the
* terms of the MIT License which is available at
* https://opensource.org/licenses/MIT.
- *
+ *
* SPDX-License-Identifier: MIT
**************************************************************************/
/**************************************************************************/
/**************************************************************************/
-/** */
-/** USBX Component */
+/** */
+/** USBX Component */
/** */
/** EHCI Controller Driver */
/** */
@@ -82,50 +83,38 @@
#endif /* ifndef UX_HCD_EHCI_EXT_USBPHY_HIGHSPEED_MODE_SET */
-/**************************************************************************/
-/* */
-/* FUNCTION RELEASE */
-/* */
-/* _ux_hcd_ehci_port_reset PORTABLE C */
+/**************************************************************************/
+/* */
+/* FUNCTION RELEASE */
+/* */
+/* _ux_hcd_ehci_port_reset PORTABLE C */
/* 6.1.8 */
/* AUTHOR */
/* */
/* Chaoqiong Xiao, Microsoft Corporation */
/* */
/* DESCRIPTION */
-/* */
-/* This function will reset a specific port attached to the root HUB. */
-/* */
-/* INPUT */
-/* */
-/* hcd_ehci Pointer to EHCI controller */
-/* port_index Port index to reset */
-/* */
-/* OUTPUT */
-/* */
-/* Completion Status */
-/* */
-/* CALLS */
-/* */
-/* _ux_hcd_ehci_register_read Read EHCI register */
-/* _ux_hcd_ehci_register_write Write EHCI register */
-/* _ux_utility_delay_ms Delay */
-/* */
-/* CALLED BY */
-/* */
+/* */
+/* This function will reset a specific port attached to the root HUB. */
+/* */
+/* INPUT */
+/* */
+/* hcd_ehci Pointer to EHCI controller */
+/* port_index Port index to reset */
+/* */
+/* OUTPUT */
+/* */
+/* Completion Status */
+/* */
+/* CALLS */
+/* */
+/* _ux_hcd_ehci_register_read Read EHCI register */
+/* _ux_hcd_ehci_register_write Write EHCI register */
+/* _ux_utility_delay_ms Delay */
+/* */
+/* CALLED BY */
+/* */
/* EHCI Controller Driver */
-/* */
-/* RELEASE HISTORY */
-/* */
-/* 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 */
-/* 08-02-2021 Wen Wang Modified comment(s), */
-/* fixed spelling error, */
-/* resulting in version 6.1.8 */
/* */
/**************************************************************************/
UINT _ux_hcd_ehci_port_reset(UX_HCD_EHCI *hcd_ehci, ULONG port_index)
@@ -147,15 +136,15 @@ INT i;
return(UX_PORT_INDEX_UNKNOWN);
}
-
- /* Ensure that the downstream port has a device attached. It is unnatural to perform
+
+ /* Ensure that the downstream port has a device attached. It is unnatural to perform
a port reset if there is no device. */
ehci_register_port_status = _ux_hcd_ehci_register_read(hcd_ehci, EHCI_HCOR_PORT_SC + port_index);
-
+
/* Check Device Connection Status. */
if ((ehci_register_port_status & EHCI_HC_PS_CCS) == 0)
{
-
+
/* Error trap. */
_ux_system_error_handler(UX_SYSTEM_LEVEL_THREAD, UX_SYSTEM_CONTEXT_HCD, UX_NO_DEVICE_CONNECTED);
@@ -164,8 +153,8 @@ INT i;
return(UX_NO_DEVICE_CONNECTED);
}
-
- /* Check for the speed of the device. If low speed, we need to send the connection signal
+
+ /* Check for the speed of the device. If low speed, we need to send the connection signal
to the companion chip. Unless we are on a controller with a built-in TT. */
if ((ehci_register_port_status & EHCI_HC_PS_SPEED_MASK) != EHCI_HC_PS_SPEED_LOW || (hcd_ehci -> ux_hcd_ehci_embedded_tt == UX_TRUE))
{
@@ -176,7 +165,7 @@ INT i;
/* Before reset, phy does not know the speed. */
UX_HCD_EHCI_EXT_USBPHY_HIGHSPEED_MODE_SET(hcd_ehci, UX_FALSE);
- /* The device may be high speed or full speed, we try to reset the port for some time
+ /* The device may be high speed or full speed, we try to reset the port for some time
and see if the port is enabled by the host controller. */
_ux_hcd_ehci_register_write(hcd_ehci, EHCI_HCOR_PORT_SC + port_index, (ehci_register_port_status | EHCI_HC_PS_PR));
@@ -191,7 +180,7 @@ INT i;
ehci_register_port_status &= ~EHCI_HC_PS_PR;
_ux_hcd_ehci_register_write(hcd_ehci, EHCI_HCOR_PORT_SC + port_index, ehci_register_port_status);
- /* According to the USB 2.0 spec, the controller may take 2ms to reset the port bit from 1 to 0 after
+ /* According to the USB 2.0 spec, the controller may take 2ms to reset the port bit from 1 to 0 after
we write a 0. Wait until the port reset bit has been turned off completely. */
_ux_utility_delay_ms(EHCI_HC_RH_RESET_SETTLE_DELAY);
}
@@ -202,7 +191,7 @@ INT i;
(ehci_register_port_status & EHCI_HC_PS_EMBEDDED_TT_SPEED_MASK) == EHCI_HC_PS_EMBEDDED_TT_SPEED_HIGH)
break;
- /* Seems we need to set the Port to a Suspend state before forcing the reset. Otherwise some devices fail the
+ /* Seems we need to set the Port to a Suspend state before forcing the reset. Otherwise some devices fail the
HS detection handshake. */
if (i == 0)
{
@@ -225,21 +214,21 @@ INT i;
}
}
- /* We come here when the device is either low speed or full speed. In this case, we release
+ /* We come here when the device is either low speed or full speed. In this case, we release
the ownership of the port to the companion chip. */
_ux_hcd_ehci_register_write(hcd_ehci, EHCI_HCOR_PORT_SC + port_index, (ehci_register_port_status | EHCI_HC_PS_PO));
-
+
/* Delay. */
_ux_utility_delay_ms(EHCI_HC_RH_RESET_DELAY);
-
+
/* If trace is enabled, insert this event into the trace buffer. */
UX_TRACE_IN_LINE_INSERT(UX_TRACE_ERROR, UX_PORT_RESET_FAILED, port_index, 0, 0, UX_TRACE_ERRORS, 0, 0)
/* Error trap. */
_ux_system_error_handler(UX_SYSTEM_LEVEL_THREAD, UX_SYSTEM_CONTEXT_HCD, UX_PORT_RESET_FAILED);
- /* When the root HUB sees an error message, it will give up on this device and the companion chip root HUB
+ /* When the root HUB sees an error message, it will give up on this device and the companion chip root HUB
will pick up the insertion signal again and reawake the root HUB driver. */
- return(UX_PORT_RESET_FAILED);
+ return(UX_PORT_RESET_FAILED);
}
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 a113538b..5bebb650 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
@@ -1,18 +1,19 @@
/***************************************************************************
- * Copyright (c) 2024 Microsoft Corporation
- *
+ * Copyright (c) 2024 Microsoft Corporation
+ * Copyright (c) 2026-present Eclipse ThreadX contributors
+ *
* This program and the accompanying materials are made available under the
* terms of the MIT License which is available at
* https://opensource.org/licenses/MIT.
- *
+ *
* SPDX-License-Identifier: MIT
**************************************************************************/
/**************************************************************************/
/**************************************************************************/
-/** */
-/** USBX Component */
+/** */
+/** USBX Component */
/** */
/** EHCI Controller Driver */
/** */
@@ -29,44 +30,36 @@
#include "ux_host_stack.h"
-/**************************************************************************/
-/* */
-/* FUNCTION RELEASE */
-/* */
-/* _ux_hcd_ehci_port_resume PORTABLE C */
+/**************************************************************************/
+/* */
+/* FUNCTION RELEASE */
+/* */
+/* _ux_hcd_ehci_port_resume PORTABLE C */
/* 6.1 */
/* AUTHOR */
/* */
/* Chaoqiong Xiao, Microsoft Corporation */
/* */
/* DESCRIPTION */
-/* */
-/* This function will resume a specific port attached to the root HUB. */
-/* */
-/* INPUT */
-/* */
-/* hcd_ehci Pointer to EHCI controller */
-/* port_index Port index to resume */
-/* */
-/* OUTPUT */
-/* */
-/* Completion Status */
-/* */
-/* CALLS */
-/* */
-/* None */
-/* */
-/* CALLED BY */
-/* */
+/* */
+/* This function will resume a specific port attached to the root HUB. */
+/* */
+/* INPUT */
+/* */
+/* hcd_ehci Pointer to EHCI controller */
+/* port_index Port index to resume */
+/* */
+/* OUTPUT */
+/* */
+/* Completion Status */
+/* */
+/* CALLS */
+/* */
+/* None */
+/* */
+/* CALLED BY */
+/* */
/* EHCI Controller Driver */
-/* */
-/* RELEASE HISTORY */
-/* */
-/* DATE NAME DESCRIPTION */
-/* */
-/* 05-19-2020 Chaoqiong Xiao Initial Version 6.0 */
-/* 09-30-2020 Chaoqiong Xiao Modified comment(s), */
-/* resulting in version 6.1 */
/* */
/**************************************************************************/
UINT _ux_hcd_ehci_port_resume(UX_HCD_EHCI *hcd_ehci, UINT port_index)
@@ -76,6 +69,6 @@ UINT _ux_hcd_ehci_port_resume(UX_HCD_EHCI *hcd_ehci, UINT port_index)
UX_PARAMETER_NOT_USED(port_index);
/* Not supported, return to caller. */
- return(UX_FUNCTION_NOT_SUPPORTED);
+ return(UX_FUNCTION_NOT_SUPPORTED);
}
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 8fddf583..33bbeb5a 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
@@ -1,18 +1,19 @@
/***************************************************************************
- * Copyright (c) 2024 Microsoft Corporation
- *
+ * Copyright (c) 2024 Microsoft Corporation
+ * Copyright (c) 2026-present Eclipse ThreadX contributors
+ *
* This program and the accompanying materials are made available under the
* terms of the MIT License which is available at
* https://opensource.org/licenses/MIT.
- *
+ *
* SPDX-License-Identifier: MIT
**************************************************************************/
/**************************************************************************/
/**************************************************************************/
-/** */
-/** USBX Component */
+/** */
+/** USBX Component */
/** */
/** EHCI Controller Driver */
/** */
@@ -82,32 +83,32 @@
#endif /* ifndef UX_HCD_EHCI_EXT_USBPHY_HIGHSPEED_MODE_SET */
-/**************************************************************************/
-/* */
-/* FUNCTION RELEASE */
-/* */
-/* _ux_hcd_ehci_port_status_get PORTABLE C */
+/**************************************************************************/
+/* */
+/* FUNCTION RELEASE */
+/* */
+/* _ux_hcd_ehci_port_status_get PORTABLE C */
/* 6.1.8 */
/* AUTHOR */
/* */
/* Chaoqiong Xiao, Microsoft Corporation */
/* */
/* DESCRIPTION */
-/* */
+/* */
/* This function will return the status for each port attached to the */
-/* root HUB. */
-/* */
-/* INPUT */
-/* */
-/* hcd_ehci Pointer to EHCI controller */
-/* port_index Port index to get status for */
-/* */
-/* OUTPUT */
-/* */
-/* Port Status */
-/* */
+/* root HUB. */
+/* */
+/* INPUT */
+/* */
+/* hcd_ehci Pointer to EHCI controller */
+/* port_index Port index to get status for */
+/* */
+/* OUTPUT */
+/* */
+/* Port Status */
+/* */
/* Status of the root hub port with the following format: */
-/* */
+/* */
/* bit 0 device connection status */
/* if 0 : no device connected */
/* if 1 : device connected to the port */
@@ -130,25 +131,13 @@
/* if 00 : low speed device attached */
/* if 01 : full speed device attached */
/* if 10 : high speed device attached */
-/* CALLS */
-/* */
-/* _ux_hcd_ehci_register_read Read EHCI register */
-/* */
-/* CALLED BY */
-/* */
+/* CALLS */
+/* */
+/* _ux_hcd_ehci_register_read Read EHCI register */
+/* */
+/* CALLED BY */
+/* */
/* EHCI Controller Driver */
-/* */
-/* RELEASE HISTORY */
-/* */
-/* 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 */
-/* 08-02-2021 Wen Wang Modified comment(s), */
-/* fixed spelling error, */
-/* resulting in version 6.1.8 */
/* */
/**************************************************************************/
ULONG _ux_hcd_ehci_port_status_get(UX_HCD_EHCI *hcd_ehci, ULONG port_index)
@@ -170,12 +159,12 @@ ULONG port_status;
return(UX_PORT_INDEX_UNKNOWN);
}
-
+
/* The port is valid, build the status mask for this port. This function
returns a controller agnostic bit field. */
port_status = 0;
ehci_register_port_status = _ux_hcd_ehci_register_read(hcd_ehci, EHCI_HCOR_PORT_SC + port_index);
-
+
/* Device Connection Status. */
if (ehci_register_port_status & EHCI_HC_PS_CCS)
port_status |= UX_PS_CCS;
@@ -185,7 +174,7 @@ ULONG port_status;
/* When disconnected PHY does not know speed. */
UX_HCD_EHCI_EXT_USBPHY_HIGHSPEED_MODE_SET(hcd_ehci, UX_FALSE);
}
-
+
/* Port Enable Status. */
if (ehci_register_port_status & EHCI_HC_PS_PE)
port_status |= UX_PS_PES;
@@ -211,8 +200,8 @@ ULONG port_status;
if (ehci_register_port_status & EHCI_HC_PS_PP)
port_status |= UX_PS_PPS;
- /* Port Device Attached speed. This field is valid only if the CCS bit is active.
- Only EHCI high speed devices are meaningful in a regular EHCI controller.
+ /* Port Device Attached speed. This field is valid only if the CCS bit is active.
+ Only EHCI high speed devices are meaningful in a regular EHCI controller.
In embedded EHCI with built-in TTs some bits reflect the true speed of
the device behind the TT. */
if (ehci_register_port_status & EHCI_HC_PS_CCS)
@@ -220,28 +209,28 @@ ULONG port_status;
/* Check for EHCI with embedded TT. */
if (hcd_ehci -> ux_hcd_ehci_embedded_tt == UX_TRUE)
{
-
+
/* Isolate speed from the non EHCI compliant POTSC bits. */
switch (ehci_register_port_status & EHCI_HC_PS_EMBEDDED_TT_SPEED_MASK)
{
-
+
case EHCI_HC_PS_EMBEDDED_TT_SPEED_FULL :
/* Full speed. */
port_status |= UX_PS_DS_FS;
- break;
+ break;
case EHCI_HC_PS_EMBEDDED_TT_SPEED_LOW :
/* Low speed. */
port_status |= UX_PS_DS_LS;
- break;
+ break;
case EHCI_HC_PS_EMBEDDED_TT_SPEED_HIGH :
/* High speed. */
port_status |= UX_PS_DS_HS;
- break;
+ break;
}
}
@@ -250,8 +239,8 @@ ULONG port_status;
/* No embedded TT. Fall back to default HS. */
port_status |= UX_PS_DS_HS;
}
-
+
/* Return port status. */
- return(port_status);
+ return(port_status);
}
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 676eb477..00c80eb1 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
@@ -1,18 +1,19 @@
/***************************************************************************
- * Copyright (c) 2024 Microsoft Corporation
- *
+ * Copyright (c) 2024 Microsoft Corporation
+ * Copyright (c) 2026-present Eclipse ThreadX contributors
+ *
* This program and the accompanying materials are made available under the
* terms of the MIT License which is available at
* https://opensource.org/licenses/MIT.
- *
+ *
* SPDX-License-Identifier: MIT
**************************************************************************/
/**************************************************************************/
/**************************************************************************/
-/** */
-/** USBX Component */
+/** */
+/** USBX Component */
/** */
/** EHCI Controller Driver */
/** */
@@ -29,45 +30,37 @@
#include "ux_host_stack.h"
-/**************************************************************************/
-/* */
-/* FUNCTION RELEASE */
-/* */
-/* _ux_hcd_ehci_port_suspend PORTABLE C */
+/**************************************************************************/
+/* */
+/* FUNCTION RELEASE */
+/* */
+/* _ux_hcd_ehci_port_suspend PORTABLE C */
/* 6.1 */
/* AUTHOR */
/* */
/* Chaoqiong Xiao, Microsoft Corporation */
/* */
/* DESCRIPTION */
-/* */
-/* This function will suspend a specific port attached to the root */
-/* HUB. */
-/* */
-/* INPUT */
-/* */
-/* hcd_ehci Pointer to EHCI controller */
-/* port_index Port index to suspend */
-/* */
-/* OUTPUT */
-/* */
-/* Completion Status */
-/* */
-/* CALLS */
-/* */
-/* None */
-/* */
-/* CALLED BY */
-/* */
+/* */
+/* This function will suspend a specific port attached to the root */
+/* HUB. */
+/* */
+/* INPUT */
+/* */
+/* hcd_ehci Pointer to EHCI controller */
+/* port_index Port index to suspend */
+/* */
+/* OUTPUT */
+/* */
+/* Completion Status */
+/* */
+/* CALLS */
+/* */
+/* None */
+/* */
+/* CALLED BY */
+/* */
/* EHCI Controller Driver */
-/* */
-/* RELEASE HISTORY */
-/* */
-/* DATE NAME DESCRIPTION */
-/* */
-/* 05-19-2020 Chaoqiong Xiao Initial Version 6.0 */
-/* 09-30-2020 Chaoqiong Xiao Modified comment(s), */
-/* resulting in version 6.1 */
/* */
/**************************************************************************/
UINT _ux_hcd_ehci_port_suspend(UX_HCD_EHCI *hcd_ehci, ULONG port_index)
@@ -86,23 +79,23 @@ ULONG ehci_register_port_status;
return(UX_PORT_INDEX_UNKNOWN);
}
-
+
/* Ensure that the downstream port has a device attached. If not, ignore the request. */
ehci_register_port_status = _ux_hcd_ehci_register_read(hcd_ehci, EHCI_HCOR_PORT_SC + port_index);
-
+
/* Check Device Connection Status. */
if ((ehci_register_port_status & EHCI_HC_PS_CCS) == 0)
-
+
/* Nothing on the downstream port. */
return(UX_NO_DEVICE_CONNECTED);
/* Set Suspend. */
ehci_register_port_status |= EHCI_HC_PS_SUSPEND;
-
+
/* Update the port status. */
_ux_hcd_ehci_register_write(hcd_ehci, EHCI_HCOR_PORT_SC + port_index, ehci_register_port_status);
/* Not supported, return error. */
- return(UX_FUNCTION_NOT_SUPPORTED);
+ return(UX_FUNCTION_NOT_SUPPORTED);
}
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 3bfec85c..dafbf08d 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
@@ -1,18 +1,19 @@
/***************************************************************************
- * Copyright (c) 2024 Microsoft Corporation
- *
+ * Copyright (c) 2024 Microsoft Corporation
+ * Copyright (c) 2026-present Eclipse ThreadX contributors
+ *
* This program and the accompanying materials are made available under the
* terms of the MIT License which is available at
* https://opensource.org/licenses/MIT.
- *
+ *
* SPDX-License-Identifier: MIT
**************************************************************************/
/**************************************************************************/
/**************************************************************************/
-/** */
-/** USBX Component */
+/** */
+/** USBX Component */
/** */
/** EHCI Controller Driver */
/** */
@@ -29,45 +30,37 @@
#include "ux_host_stack.h"
-/**************************************************************************/
-/* */
-/* FUNCTION RELEASE */
-/* */
-/* _ux_hcd_ehci_power_down_port PORTABLE C */
+/**************************************************************************/
+/* */
+/* FUNCTION RELEASE */
+/* */
+/* _ux_hcd_ehci_power_down_port PORTABLE C */
/* 6.1 */
/* AUTHOR */
/* */
/* Chaoqiong Xiao, Microsoft Corporation */
/* */
/* DESCRIPTION */
-/* */
-/* This function will power down a specific port attached to the root */
-/* HUB. */
-/* */
-/* INPUT */
-/* */
-/* hcd_ehci Pointer to EHCI controller */
-/* port_index Port index to power down */
-/* */
-/* OUTPUT */
-/* */
-/* Completion Status */
-/* */
-/* CALLS */
-/* */
-/* None */
-/* */
-/* CALLED BY */
-/* */
+/* */
+/* This function will power down a specific port attached to the root */
+/* HUB. */
+/* */
+/* INPUT */
+/* */
+/* hcd_ehci Pointer to EHCI controller */
+/* port_index Port index to power down */
+/* */
+/* OUTPUT */
+/* */
+/* Completion Status */
+/* */
+/* CALLS */
+/* */
+/* None */
+/* */
+/* CALLED BY */
+/* */
/* EHCI Controller Driver */
-/* */
-/* RELEASE HISTORY */
-/* */
-/* DATE NAME DESCRIPTION */
-/* */
-/* 05-19-2020 Chaoqiong Xiao Initial Version 6.0 */
-/* 09-30-2020 Chaoqiong Xiao Modified comment(s), */
-/* resulting in version 6.1 */
/* */
/**************************************************************************/
UINT _ux_hcd_ehci_power_down_port(UX_HCD_EHCI *hcd_ehci, ULONG port_index)
@@ -77,6 +70,6 @@ UINT _ux_hcd_ehci_power_down_port(UX_HCD_EHCI *hcd_ehci, ULONG port_index)
UX_PARAMETER_NOT_USED(port_index);
/* Not supported, return error. */
- return(UX_FUNCTION_NOT_SUPPORTED);
+ return(UX_FUNCTION_NOT_SUPPORTED);
}
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 6967e21c..99401795 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
@@ -1,18 +1,19 @@
/***************************************************************************
- * Copyright (c) 2024 Microsoft Corporation
- *
+ * Copyright (c) 2024 Microsoft Corporation
+ * Copyright (c) 2026-present Eclipse ThreadX contributors
+ *
* This program and the accompanying materials are made available under the
* terms of the MIT License which is available at
* https://opensource.org/licenses/MIT.
- *
+ *
* SPDX-License-Identifier: MIT
**************************************************************************/
/**************************************************************************/
/**************************************************************************/
-/** */
-/** USBX Component */
+/** */
+/** USBX Component */
/** */
/** EHCI Controller Driver */
/** */
@@ -29,44 +30,36 @@
#include "ux_host_stack.h"
-/**************************************************************************/
-/* */
-/* FUNCTION RELEASE */
-/* */
-/* _ux_hcd_ehci_power_on_port PORTABLE C */
+/**************************************************************************/
+/* */
+/* FUNCTION RELEASE */
+/* */
+/* _ux_hcd_ehci_power_on_port PORTABLE C */
/* 6.1 */
/* AUTHOR */
/* */
/* Chaoqiong Xiao, Microsoft Corporation */
/* */
/* DESCRIPTION */
-/* */
-/* This function will power a specific port attached to the root HUB. */
-/* */
-/* INPUT */
-/* */
-/* hcd_ehci Pointer to EHCI controller */
-/* port_index Port index to power */
-/* */
-/* OUTPUT */
-/* */
-/* Completion Status */
-/* */
-/* CALLS */
-/* */
-/* None */
-/* */
-/* CALLED BY */
-/* */
+/* */
+/* This function will power a specific port attached to the root HUB. */
+/* */
+/* INPUT */
+/* */
+/* hcd_ehci Pointer to EHCI controller */
+/* port_index Port index to power */
+/* */
+/* OUTPUT */
+/* */
+/* Completion Status */
+/* */
+/* CALLS */
+/* */
+/* None */
+/* */
+/* CALLED BY */
+/* */
/* EHCI Controller Driver */
-/* */
-/* RELEASE HISTORY */
-/* */
-/* DATE NAME DESCRIPTION */
-/* */
-/* 05-19-2020 Chaoqiong Xiao Initial Version 6.0 */
-/* 09-30-2020 Chaoqiong Xiao Modified comment(s), */
-/* resulting in version 6.1 */
/* */
/**************************************************************************/
UINT _ux_hcd_ehci_power_on_port(UX_HCD_EHCI *hcd_ehci, ULONG port_index)
@@ -76,6 +69,6 @@ UINT _ux_hcd_ehci_power_on_port(UX_HCD_EHCI *hcd_ehci, ULONG port_index)
UX_PARAMETER_NOT_USED(port_index);
/* Not supported, return error code. */
- return(UX_FUNCTION_NOT_SUPPORTED);
+ return(UX_FUNCTION_NOT_SUPPORTED);
}
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 ae52a50e..f750893b 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
@@ -1,18 +1,19 @@
/***************************************************************************
- * Copyright (c) 2024 Microsoft Corporation
- *
+ * Copyright (c) 2024 Microsoft Corporation
+ * Copyright (c) 2026-present Eclipse ThreadX contributors
+ *
* This program and the accompanying materials are made available under the
* terms of the MIT License which is available at
* https://opensource.org/licenses/MIT.
- *
+ *
* SPDX-License-Identifier: MIT
**************************************************************************/
/**************************************************************************/
/**************************************************************************/
-/** */
-/** USBX Component */
+/** */
+/** USBX Component */
/** */
/** EHCI Controller Driver */
/** */
@@ -29,46 +30,38 @@
#include "ux_host_stack.h"
-/**************************************************************************/
-/* */
-/* FUNCTION RELEASE */
-/* */
-/* _ux_hcd_ehci_power_root_hubs PORTABLE C */
+/**************************************************************************/
+/* */
+/* FUNCTION RELEASE */
+/* */
+/* _ux_hcd_ehci_power_root_hubs PORTABLE C */
/* 6.1 */
/* AUTHOR */
/* */
/* Chaoqiong Xiao, Microsoft Corporation */
/* */
/* DESCRIPTION */
-/* */
-/* This function powers individually or in gang mode the root HUBs */
-/* attached to the EHCI controller. */
-/* */
-/* INPUT */
-/* */
-/* hcd_ehci Pointer to EHCI controller */
-/* */
-/* OUTPUT */
-/* */
-/* None */
-/* */
-/* CALLS */
-/* */
-/* _ux_hcd_ehci_register_read Read EHCI register */
-/* _ux_hcd_ehci_register_write Write EHCI register */
-/* _ux_utility_delay_ms Delay */
-/* */
-/* CALLED BY */
-/* */
+/* */
+/* This function powers individually or in gang mode the root HUBs */
+/* attached to the EHCI controller. */
+/* */
+/* INPUT */
+/* */
+/* hcd_ehci Pointer to EHCI controller */
+/* */
+/* OUTPUT */
+/* */
+/* None */
+/* */
+/* CALLS */
+/* */
+/* _ux_hcd_ehci_register_read Read EHCI register */
+/* _ux_hcd_ehci_register_write Write EHCI register */
+/* _ux_utility_delay_ms Delay */
+/* */
+/* CALLED BY */
+/* */
/* EHCI Controller Driver */
-/* */
-/* RELEASE HISTORY */
-/* */
-/* DATE NAME DESCRIPTION */
-/* */
-/* 05-19-2020 Chaoqiong Xiao Initial Version 6.0 */
-/* 09-30-2020 Chaoqiong Xiao Modified comment(s), */
-/* resulting in version 6.1 */
/* */
/**************************************************************************/
VOID _ux_hcd_ehci_power_root_hubs(UX_HCD_EHCI *hcd_ehci)
@@ -78,7 +71,7 @@ ULONG ehci_register;
UINT port_index;
- /* Read the control PPC field. If the PPC field is set, the controller has
+ /* Read the control PPC field. If the PPC field is set, the controller has
implemented port power. */
ehci_register = _ux_hcd_ehci_register_read(hcd_ehci, EHCI_HCCR_HCS_PARAMS);
@@ -88,19 +81,19 @@ UINT port_index;
/* We have power management in this controller. Apply power to each port. */
for (port_index = 0; port_index < hcd_ehci -> ux_hcd_ehci_nb_root_hubs; port_index++)
{
-
+
/* Read register first to preserve existing settings. */
ehci_register = _ux_hcd_ehci_register_read(hcd_ehci, EHCI_HCOR_PORT_SC + port_index);
/* Apply power to a port. */
_ux_hcd_ehci_register_write(hcd_ehci, EHCI_HCOR_PORT_SC + port_index, ehci_register | EHCI_HC_PS_PP);
}
- }
+ }
/* The EHCI needs some time for the power to be stable. */
_ux_utility_delay_ms(EHCI_HC_RH_POWER_STABLE_DELAY);
/* Return to caller. */
return;
-}
+}
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 4de2c884..7e4a6810 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
@@ -1,18 +1,19 @@
/***************************************************************************
- * Copyright (c) 2024 Microsoft Corporation
- *
+ * Copyright (c) 2024 Microsoft Corporation
+ * Copyright (c) 2026-present Eclipse ThreadX contributors
+ *
* This program and the accompanying materials are made available under the
* terms of the MIT License which is available at
* https://opensource.org/licenses/MIT.
- *
+ *
* SPDX-License-Identifier: MIT
**************************************************************************/
/**************************************************************************/
/**************************************************************************/
-/** */
-/** USBX Component */
+/** */
+/** USBX Component */
/** */
/** EHCI Controller Driver */
/** */
@@ -29,50 +30,42 @@
#include "ux_host_stack.h"
-/**************************************************************************/
-/* */
-/* FUNCTION RELEASE */
-/* */
-/* _ux_hcd_ehci_register_read PORTABLE C */
+/**************************************************************************/
+/* */
+/* FUNCTION RELEASE */
+/* */
+/* _ux_hcd_ehci_register_read PORTABLE C */
/* 6.1 */
/* AUTHOR */
/* */
/* Chaoqiong Xiao, Microsoft Corporation */
/* */
/* DESCRIPTION */
-/* */
-/* This function reads a register from the EHCI memory mapped */
-/* registers. */
-/* */
-/* INPUT */
-/* */
-/* hcd_ehci Pointer to EHCI controller */
-/* ehci_register EHCI register to read */
-/* */
-/* OUTPUT */
-/* */
-/* EHCI Register Value */
-/* */
-/* CALLS */
-/* */
-/* None */
-/* */
-/* CALLED BY */
-/* */
+/* */
+/* This function reads a register from the EHCI memory mapped */
+/* registers. */
+/* */
+/* INPUT */
+/* */
+/* hcd_ehci Pointer to EHCI controller */
+/* ehci_register EHCI register to read */
+/* */
+/* OUTPUT */
+/* */
+/* EHCI Register Value */
+/* */
+/* CALLS */
+/* */
+/* None */
+/* */
+/* CALLED BY */
+/* */
/* EHCI Controller Driver */
-/* */
-/* RELEASE HISTORY */
-/* */
-/* DATE NAME DESCRIPTION */
-/* */
-/* 05-19-2020 Chaoqiong Xiao Initial Version 6.0 */
-/* 09-30-2020 Chaoqiong Xiao Modified comment(s), */
-/* resulting in version 6.1 */
/* */
/**************************************************************************/
ULONG _ux_hcd_ehci_register_read(UX_HCD_EHCI *hcd_ehci, ULONG ehci_register)
{
-
+
/* Return value of EHCI register. */
return(*(hcd_ehci -> ux_hcd_ehci_base + 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 398c159d..a3a8d6c6 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
@@ -1,18 +1,19 @@
/***************************************************************************
- * Copyright (c) 2024 Microsoft Corporation
- *
+ * Copyright (c) 2024 Microsoft Corporation
+ * Copyright (c) 2026-present Eclipse ThreadX contributors
+ *
* This program and the accompanying materials are made available under the
* terms of the MIT License which is available at
* https://opensource.org/licenses/MIT.
- *
+ *
* SPDX-License-Identifier: MIT
**************************************************************************/
/**************************************************************************/
/**************************************************************************/
-/** */
-/** USBX Component */
+/** */
+/** USBX Component */
/** */
/** EHCI Controller Driver */
/** */
@@ -29,51 +30,43 @@
#include "ux_host_stack.h"
-/**************************************************************************/
-/* */
-/* FUNCTION RELEASE */
-/* */
-/* _ux_hcd_ehci_register_write PORTABLE C */
+/**************************************************************************/
+/* */
+/* FUNCTION RELEASE */
+/* */
+/* _ux_hcd_ehci_register_write PORTABLE C */
/* 6.1 */
/* AUTHOR */
/* */
/* Chaoqiong Xiao, Microsoft Corporation */
/* */
/* DESCRIPTION */
-/* */
-/* This function writes a register to the EHCI space. */
-/* */
-/* INPUT */
-/* */
-/* hcd_ehci Pointer to EHCI controller */
-/* ehci_register EHCI register to write */
-/* value Value to write */
-/* */
-/* OUTPUT */
-/* */
-/* None */
-/* */
-/* CALLS */
-/* */
-/* None */
-/* */
-/* CALLED BY */
-/* */
+/* */
+/* This function writes a register to the EHCI space. */
+/* */
+/* INPUT */
+/* */
+/* hcd_ehci Pointer to EHCI controller */
+/* ehci_register EHCI register to write */
+/* value Value to write */
+/* */
+/* OUTPUT */
+/* */
+/* None */
+/* */
+/* CALLS */
+/* */
+/* None */
+/* */
+/* CALLED BY */
+/* */
/* EHCI Controller Driver */
-/* */
-/* RELEASE HISTORY */
-/* */
-/* DATE NAME DESCRIPTION */
-/* */
-/* 05-19-2020 Chaoqiong Xiao Initial Version 6.0 */
-/* 09-30-2020 Chaoqiong Xiao Modified comment(s), */
-/* resulting in version 6.1 */
/* */
/**************************************************************************/
VOID _ux_hcd_ehci_register_write(UX_HCD_EHCI *hcd_ehci, ULONG ehci_register, ULONG value)
{
- /* Write to the specified EHCI register. */
+ /* Write to the specified EHCI register. */
*(hcd_ehci -> ux_hcd_ehci_base + ehci_register) = value;
/* Return to caller. */
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 78279dd4..6a9efd0f 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
@@ -1,18 +1,19 @@
/***************************************************************************
- * Copyright (c) 2024 Microsoft Corporation
- *
+ * Copyright (c) 2024 Microsoft Corporation
+ * Copyright (c) 2026-present Eclipse ThreadX contributors
+ *
* This program and the accompanying materials are made available under the
* terms of the MIT License which is available at
* https://opensource.org/licenses/MIT.
- *
+ *
* SPDX-License-Identifier: MIT
**************************************************************************/
/**************************************************************************/
/**************************************************************************/
-/** */
-/** USBX Component */
+/** */
+/** USBX Component */
/** */
/** EHCI Controller Driver */
/** */
@@ -29,50 +30,37 @@
#include "ux_host_stack.h"
-/**************************************************************************/
-/* */
-/* FUNCTION RELEASE */
-/* */
-/* _ux_hcd_ehci_regular_td_obtain PORTABLE C */
+/**************************************************************************/
+/* */
+/* FUNCTION RELEASE */
+/* */
+/* _ux_hcd_ehci_regular_td_obtain PORTABLE C */
/* 6.1.11 */
/* AUTHOR */
/* */
/* Chaoqiong Xiao, Microsoft Corporation */
/* */
/* DESCRIPTION */
-/* */
-/* This function obtains a free TD from the regular TD list. */
-/* */
-/* INPUT */
-/* */
-/* hcd_ehci Pointer to EHCI controller */
-/* */
-/* OUTPUT */
-/* */
-/* UX_EHCI_TD * Pointer to TD */
-/* */
-/* CALLS */
-/* */
-/* _ux_utility_memory_set Set memory block */
+/* */
+/* This function obtains a free TD from the regular TD list. */
+/* */
+/* INPUT */
+/* */
+/* hcd_ehci Pointer to EHCI controller */
+/* */
+/* OUTPUT */
+/* */
+/* UX_EHCI_TD * Pointer to TD */
+/* */
+/* CALLS */
+/* */
+/* _ux_utility_memory_set Set memory block */
/* _ux_host_mutex_on Get protection mutex */
/* _ux_host_mutex_off Release protection mutex */
-/* */
-/* CALLED BY */
-/* */
+/* */
+/* CALLED BY */
+/* */
/* EHCI Controller Driver */
-/* */
-/* RELEASE HISTORY */
-/* */
-/* DATE NAME DESCRIPTION */
-/* */
-/* 05-19-2020 Chaoqiong Xiao Initial Version 6.0 */
-/* 09-30-2020 Chaoqiong Xiao Modified comment(s), */
-/* verified memset and memcpy */
-/* cases, */
-/* resulting in version 6.1 */
-/* 04-25-2022 Chaoqiong Xiao Modified comment(s), */
-/* fixed standalone compile, */
-/* resulting in version 6.1.11 */
/* */
/**************************************************************************/
UX_EHCI_TD *_ux_hcd_ehci_regular_td_obtain(UX_HCD_EHCI *hcd_ehci)
@@ -105,7 +93,7 @@ ULONG td_element;
td_element = UX_EHCI_TD_T;
td -> ux_ehci_td_link_pointer = (UX_EHCI_TD *) td_element;
td -> ux_ehci_td_alternate_link_pointer = (UX_EHCI_TD *) td_element;
-
+
/* Release the protection. */
_ux_host_mutex_off(&_ux_system -> ux_system_mutex);
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 158ac0ab..5cc7ea21 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
@@ -1,18 +1,19 @@
/***************************************************************************
- * Copyright (c) 2024 Microsoft Corporation
- *
+ * Copyright (c) 2024 Microsoft Corporation
+ * Copyright (c) 2026-present Eclipse ThreadX contributors
+ *
* This program and the accompanying materials are made available under the
* terms of the MIT License which is available at
* https://opensource.org/licenses/MIT.
- *
+ *
* SPDX-License-Identifier: MIT
**************************************************************************/
/**************************************************************************/
/**************************************************************************/
-/** */
-/** USBX Component */
+/** */
+/** USBX Component */
/** */
/** EHCI Controller Driver */
/** */
@@ -29,48 +30,40 @@
#include "ux_host_stack.h"
-/**************************************************************************/
-/* */
-/* FUNCTION RELEASE */
-/* */
-/* _ux_hcd_ehci_request_bulk_transfer PORTABLE C */
+/**************************************************************************/
+/* */
+/* FUNCTION RELEASE */
+/* */
+/* _ux_hcd_ehci_request_bulk_transfer PORTABLE C */
/* 6.1 */
/* AUTHOR */
/* */
/* Chaoqiong Xiao, Microsoft Corporation */
/* */
/* DESCRIPTION */
-/* */
-/* This function performs a bulk transfer request. A bulk transfer */
-/* can be larger than the size of the EHCI buffer so it may be */
-/* required to chain multiple tds to accommodate this request. A bulk */
+/* */
+/* This function performs a bulk transfer request. A bulk transfer */
+/* can be larger than the size of the EHCI buffer so it may be */
+/* required to chain multiple tds to accommodate this request. A bulk */
/* transfer is non blocking, so we return before the request is */
-/* completed. */
-/* */
-/* INPUT */
-/* */
-/* hcd_ehci Pointer to EHCI controller */
-/* transfer_request Pointer to transfer request */
-/* */
-/* OUTPUT */
-/* */
-/* Completion Status */
-/* */
-/* CALLS */
-/* */
-/* _ux_hcd_ehci_request_transfer_add Add transfer to ED */
-/* */
-/* CALLED BY */
-/* */
+/* completed. */
+/* */
+/* INPUT */
+/* */
+/* hcd_ehci Pointer to EHCI controller */
+/* transfer_request Pointer to transfer request */
+/* */
+/* OUTPUT */
+/* */
+/* Completion Status */
+/* */
+/* CALLS */
+/* */
+/* _ux_hcd_ehci_request_transfer_add Add transfer to ED */
+/* */
+/* CALLED BY */
+/* */
/* EHCI Controller Driver */
-/* */
-/* RELEASE HISTORY */
-/* */
-/* DATE NAME DESCRIPTION */
-/* */
-/* 05-19-2020 Chaoqiong Xiao Initial Version 6.0 */
-/* 09-30-2020 Chaoqiong Xiao Modified comment(s), */
-/* resulting in version 6.1 */
/* */
/**************************************************************************/
UINT _ux_hcd_ehci_request_bulk_transfer(UX_HCD_EHCI *hcd_ehci, UX_TRANSFER *transfer_request)
@@ -106,28 +99,28 @@ ULONG zlp_flag;
ed -> ux_ehci_ed_bp4 = UX_NULL;
/* It may take more than one TD if the transfer_request length is more than the
- maximum length for an EHCI TD (this is irrelevant of the MaxPacketSize value
+ maximum length for an EHCI TD (this is irrelevant of the MaxPacketSize value
in the endpoint descriptor). EHCI data payload has a maximum size of 16K. */
transfer_request_payload_length = transfer_request -> ux_transfer_request_requested_length;
data_pointer = transfer_request -> ux_transfer_request_data_pointer;
-
+
/* Check for ZLP condition. */
if (transfer_request_payload_length == 0)
-
+
/* We have a zlp condition. */
zlp_flag = UX_TRUE;
else
-
+
/* We do not have a zlp. */
zlp_flag = UX_FALSE;
-
+
/* Build all necessary TDs. */
while ((transfer_request_payload_length != 0) || zlp_flag == UX_TRUE)
{
/* Reset ZLP now. */
- zlp_flag = UX_FALSE;
-
+ zlp_flag = UX_FALSE;
+
/* Check if we are exceeding the max payload. */
if (transfer_request_payload_length > UX_EHCI_MAX_PAYLOAD)
bulk_packet_payload_length = UX_EHCI_MAX_PAYLOAD;
@@ -137,7 +130,7 @@ ULONG zlp_flag;
/* Add this transfer request to the ED. */
if ((transfer_request -> ux_transfer_request_type&UX_REQUEST_DIRECTION) == UX_REQUEST_IN)
pid = UX_EHCI_PID_IN;
- else
+ else
pid = UX_EHCI_PID_OUT;
status = _ux_hcd_ehci_request_transfer_add(hcd_ehci, ed, 0, pid, 0,
@@ -145,16 +138,16 @@ ULONG zlp_flag;
if (status != UX_SUCCESS)
return(status);
-
+
/* Adjust the data payload length and the data payload pointer. */
transfer_request_payload_length -= bulk_packet_payload_length;
data_pointer += bulk_packet_payload_length;
- }
+ }
/* Set the IOC bit in the last TD. */
ed -> ux_ehci_ed_last_td -> ux_ehci_td_control |= UX_EHCI_TD_IOC;
- /* Ensure the IOC bit is set before activating the TD. This is necessary
+ /* Ensure the IOC bit is set before activating the TD. This is necessary
for some processors that perform writes out of order as an optimization. */
UX_DATA_MEMORY_BARRIER
@@ -164,6 +157,6 @@ ULONG zlp_flag;
ed -> ux_ehci_ed_queue_element = (UX_EHCI_TD *) td_component;
/* Return successful completion. */
- return(UX_SUCCESS);
+ return(UX_SUCCESS);
}
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 0c270d42..baa96600 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
@@ -1,18 +1,19 @@
/***************************************************************************
- * Copyright (c) 2024 Microsoft Corporation
- *
+ * Copyright (c) 2024 Microsoft Corporation
+ * Copyright (c) 2026-present Eclipse ThreadX contributors
+ *
* This program and the accompanying materials are made available under the
* terms of the MIT License which is available at
* https://opensource.org/licenses/MIT.
- *
+ *
* SPDX-License-Identifier: MIT
**************************************************************************/
/**************************************************************************/
/**************************************************************************/
-/** */
-/** USBX Component */
+/** */
+/** USBX Component */
/** */
/** EHCI Controller Driver */
/** */
@@ -29,18 +30,18 @@
#include "ux_host_stack.h"
-/**************************************************************************/
-/* */
-/* FUNCTION RELEASE */
-/* */
-/* _ux_hcd_ehci_request_control_transfer PORTABLE C */
+/**************************************************************************/
+/* */
+/* FUNCTION RELEASE */
+/* */
+/* _ux_hcd_ehci_request_control_transfer PORTABLE C */
/* 6.3.0 */
/* AUTHOR */
/* */
/* Chaoqiong Xiao, Microsoft Corporation */
/* */
/* DESCRIPTION */
-/* */
+/* */
/* This function performs a control transfer from a transfer request. */
/* The USB control transfer is in 3 phases (setup, data, status). */
/* This function will chain all phases of the control sequence before */
@@ -48,46 +49,30 @@
/* */
/* The max aggregated size of a data payload in EHCI is 16K. We are */
/* assuming that this size will be sufficient to contain the control */
-/* packet. */
-/* */
-/* INPUT */
-/* */
-/* hcd_ehci Pointer to EHCI controller */
-/* transfer_request Pointer to transfer request */
-/* */
-/* OUTPUT */
-/* */
-/* Completion Status */
-/* */
-/* CALLS */
-/* */
-/* _ux_hcd_ehci_ed_clean Clean TDs */
-/* _ux_hcd_ehci_request_transfer_add Add transfer to ED */
-/* _ux_host_stack_transfer_request_abort Abort transfer request */
-/* _ux_utility_memory_allocate Allocate memory block */
-/* _ux_utility_memory_free Release memory block */
-/* _ux_host_semaphore_get Get semaphore */
-/* _ux_utility_short_put Write a 16-bit value */
-/* */
-/* CALLED BY */
-/* */
+/* packet. */
+/* */
+/* INPUT */
+/* */
+/* hcd_ehci Pointer to EHCI controller */
+/* transfer_request Pointer to transfer request */
+/* */
+/* OUTPUT */
+/* */
+/* Completion Status */
+/* */
+/* CALLS */
+/* */
+/* _ux_hcd_ehci_ed_clean Clean TDs */
+/* _ux_hcd_ehci_request_transfer_add Add transfer to ED */
+/* _ux_host_stack_transfer_request_abort Abort transfer request */
+/* _ux_utility_memory_allocate Allocate memory block */
+/* _ux_utility_memory_free Release memory block */
+/* _ux_host_semaphore_get Get semaphore */
+/* _ux_utility_short_put Write a 16-bit value */
+/* */
+/* CALLED BY */
+/* */
/* EHCI Controller Driver */
-/* */
-/* RELEASE HISTORY */
-/* */
-/* 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 */
-/* 11-09-2020 Chaoqiong Xiao Modified comment(s), */
-/* refined macros names, */
-/* fixed compile warnings, */
-/* resulting in version 6.1.2 */
-/* 10-31-2023 Chaoqiong Xiao Modified comment(s), */
-/* fixed compile warnings, */
-/* resulting in version 6.3.0 */
/* */
/**************************************************************************/
UINT _ux_hcd_ehci_request_control_transfer(UX_HCD_EHCI *hcd_ehci, UX_TRANSFER *transfer_request)
@@ -152,7 +137,7 @@ UINT pid;
/* Build and hook the setup phase to the ED. */
status = _ux_hcd_ehci_request_transfer_add(hcd_ehci, ed, UX_EHCI_TD_SETUP_PHASE, UX_EHCI_PID_SETUP, UX_EHCI_TOGGLE_0,
setup_request, UX_SETUP_SIZE, transfer_request);
- if (status != UX_SUCCESS)
+ if (status != UX_SUCCESS)
{
/* We need to clean the tds attached if any. */
@@ -167,33 +152,33 @@ UINT pid;
if ((transfer_request -> ux_transfer_request_type & UX_REQUEST_DIRECTION) == UX_REQUEST_IN)
pid = UX_EHCI_PID_IN;
- else
-
+ else
+
pid = UX_EHCI_PID_OUT;
status = _ux_hcd_ehci_request_transfer_add(hcd_ehci, ed, UX_EHCI_TD_DATA_PHASE, pid, UX_EHCI_TOGGLE_1,
transfer_request -> ux_transfer_request_data_pointer,
transfer_request -> ux_transfer_request_requested_length,
transfer_request);
- if (status != UX_SUCCESS)
+ if (status != UX_SUCCESS)
{
/* We need to clean the tds attached if any. */
_ux_hcd_ehci_ed_clean(ed);
return(status);
}
- }
+ }
/* Program the status phase. the PID is the opposite of the data phase. */
if ((transfer_request -> ux_transfer_request_type & UX_REQUEST_DIRECTION) == UX_REQUEST_IN)
pid = UX_EHCI_PID_OUT;
- else
+ else
pid = UX_EHCI_PID_IN;
status = _ux_hcd_ehci_request_transfer_add(hcd_ehci, ed, UX_EHCI_TD_STATUS_PHASE, pid,
UX_EHCI_TOGGLE_1, UX_NULL, 0, transfer_request);
- if (status != UX_SUCCESS)
+ if (status != UX_SUCCESS)
{
/* We need to clean the tds attached if any. */
@@ -203,8 +188,8 @@ UINT pid;
/* Set the IOC bit in the last TD. */
ed -> ux_ehci_ed_last_td -> ux_ehci_td_control |= UX_EHCI_TD_IOC;
-
- /* Ensure the IOC bit is set before activating the TD. This is necessary
+
+ /* Ensure the IOC bit is set before activating the TD. This is necessary
for some processors that perform writes out of order as an optimization. */
UX_DATA_MEMORY_BARRIER
@@ -222,7 +207,7 @@ UINT pid;
/* All transfers pending need to abort. There may have been a partial transfer. */
_ux_host_stack_transfer_request_abort(transfer_request);
-
+
/* There was an error, return to the caller. */
transfer_request -> ux_transfer_request_completion_code = UX_TRANSFER_TIMEOUT;
@@ -231,13 +216,13 @@ UINT pid;
/* If trace is enabled, insert this event into the trace buffer. */
UX_TRACE_IN_LINE_INSERT(UX_TRACE_ERROR, UX_TRANSFER_TIMEOUT, transfer_request, 0, 0, UX_TRACE_ERRORS, 0, 0)
-
- }
+
+ }
/* Free the resources. */
_ux_utility_memory_free(setup_request);
/* Return completion status. */
- return(transfer_request -> ux_transfer_request_completion_code);
+ return(transfer_request -> ux_transfer_request_completion_code);
}
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 89310e9c..ceb45c55 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
@@ -1,18 +1,19 @@
/***************************************************************************
- * Copyright (c) 2024 Microsoft Corporation
- *
+ * Copyright (c) 2024 Microsoft Corporation
+ * Copyright (c) 2026-present Eclipse ThreadX contributors
+ *
* This program and the accompanying materials are made available under the
* terms of the MIT License which is available at
* https://opensource.org/licenses/MIT.
- *
+ *
* SPDX-License-Identifier: MIT
**************************************************************************/
/**************************************************************************/
/**************************************************************************/
-/** */
-/** USBX Component */
+/** */
+/** USBX Component */
/** */
/** EHCI Controller Driver */
/** */
@@ -29,47 +30,39 @@
#include "ux_host_stack.h"
-/**************************************************************************/
-/* */
-/* FUNCTION RELEASE */
-/* */
-/* _ux_hcd_ehci_request_interrupt_transfer PORTABLE C */
+/**************************************************************************/
+/* */
+/* FUNCTION RELEASE */
+/* */
+/* _ux_hcd_ehci_request_interrupt_transfer PORTABLE C */
/* 6.1 */
/* AUTHOR */
/* */
/* Chaoqiong Xiao, Microsoft Corporation */
/* */
/* DESCRIPTION */
-/* */
-/* This function performs an interrupt transfer request. An interrupt */
-/* transfer can only be as large as the MaxpacketField in the */
+/* */
+/* This function performs an interrupt transfer request. An interrupt */
+/* transfer can only be as large as the MaxpacketField in the */
/* endpoint descriptor. This was verified at the upper layer and does */
-/* not need to be reverified here. */
-/* */
-/* INPUT */
-/* */
-/* hcd_ehci Pointer to EHCI controller */
-/* transfer_request Pointer to transfer request */
-/* */
-/* OUTPUT */
-/* */
-/* Completion Status */
-/* */
-/* CALLS */
-/* */
-/* _ux_hcd_ehci_request_transfer_add Add transfer to ED */
-/* */
-/* CALLED BY */
-/* */
+/* not need to be reverified here. */
+/* */
+/* INPUT */
+/* */
+/* hcd_ehci Pointer to EHCI controller */
+/* transfer_request Pointer to transfer request */
+/* */
+/* OUTPUT */
+/* */
+/* Completion Status */
+/* */
+/* CALLS */
+/* */
+/* _ux_hcd_ehci_request_transfer_add Add transfer to ED */
+/* */
+/* CALLED BY */
+/* */
/* EHCI Controller Driver */
-/* */
-/* RELEASE HISTORY */
-/* */
-/* DATE NAME DESCRIPTION */
-/* */
-/* 05-19-2020 Chaoqiong Xiao Initial Version 6.0 */
-/* 09-30-2020 Chaoqiong Xiao Modified comment(s), */
-/* resulting in version 6.1 */
/* */
/**************************************************************************/
UINT _ux_hcd_ehci_request_interrupt_transfer(UX_HCD_EHCI *hcd_ehci, UX_TRANSFER *transfer_request)
@@ -80,7 +73,7 @@ UX_EHCI_ED *ed;
ULONG pid;
ULONG td_component;
UINT status;
-
+
/* Get the pointer to the endpoint. */
endpoint = (UX_ENDPOINT *) transfer_request -> ux_transfer_request_endpoint;
@@ -102,7 +95,7 @@ UINT status;
/* Get the correct PID for this transfer. */
if ((transfer_request -> ux_transfer_request_type & UX_REQUEST_DIRECTION) == UX_REQUEST_IN)
pid = UX_EHCI_PID_IN;
- else
+ else
pid = UX_EHCI_PID_OUT;
/* Add this transfer request to the ED. */
@@ -113,12 +106,12 @@ UINT status;
/* Ensure we got the TD allocated properly. */
if (status == UX_SUCCESS)
- {
+ {
/* Set the IOC bit in the last TD. */
ed -> ux_ehci_ed_last_td -> ux_ehci_td_control |= UX_EHCI_TD_IOC;
-
- /* Ensure the IOC bit is set before activating the TD. This is necessary
+
+ /* Ensure the IOC bit is set before activating the TD. This is necessary
for some processors that perform writes out of order as an optimization. */
UX_DATA_MEMORY_BARRIER
@@ -128,7 +121,7 @@ UINT status;
ed -> ux_ehci_ed_queue_element = (UX_EHCI_TD *) td_component;
}
-
+
/* Return completion status. */
return(status);
}
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 01ef2928..101115f6 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
@@ -1,10 +1,11 @@
/***************************************************************************
- * Copyright (c) 2024 Microsoft Corporation
- *
+ * Copyright (c) 2024 Microsoft Corporation
+ * Copyright (c) 2026-present Eclipse ThreadX contributors
+ *
* This program and the accompanying materials are made available under the
* terms of the MIT License which is available at
* https://opensource.org/licenses/MIT.
- *
+ *
* SPDX-License-Identifier: MIT
**************************************************************************/
@@ -72,23 +73,6 @@
/* */
/* EHCI Controller Driver */
/* */
-/* RELEASE HISTORY */
-/* */
-/* DATE NAME DESCRIPTION */
-/* */
-/* 05-19-2020 Chaoqiong Xiao Initial Version 6.0 */
-/* 09-30-2020 Chaoqiong Xiao Modified comment(s), */
-/* resulting in version 6.1 */
-/* 01-31-2022 Chaoqiong Xiao Modified comment(s), */
-/* refined macros names, */
-/* resulting in version 6.1.10 */
-/* 04-25-2022 Chaoqiong Xiao Modified comment(s), */
-/* fixed standalone compile, */
-/* resulting in version 6.1.11 */
-/* 07-29-2022 Chaoqiong Xiao Modified comment(s), */
-/* improved iso start up, */
-/* resulting in version 6.1.12 */
-/* */
/**************************************************************************/
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 e1cc5f44..4bacf37c 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
@@ -1,18 +1,19 @@
/***************************************************************************
- * Copyright (c) 2024 Microsoft Corporation
- *
+ * Copyright (c) 2024 Microsoft Corporation
+ * Copyright (c) 2026-present Eclipse ThreadX contributors
+ *
* This program and the accompanying materials are made available under the
* terms of the MIT License which is available at
* https://opensource.org/licenses/MIT.
- *
+ *
* SPDX-License-Identifier: MIT
**************************************************************************/
/**************************************************************************/
/**************************************************************************/
-/** */
-/** USBX Component */
+/** */
+/** USBX Component */
/** */
/** EHCI Controller Driver */
/** */
@@ -29,53 +30,45 @@
#include "ux_host_stack.h"
-/**************************************************************************/
-/* */
-/* FUNCTION RELEASE */
-/* */
-/* _ux_hcd_ehci_request_transfer PORTABLE C */
+/**************************************************************************/
+/* */
+/* FUNCTION RELEASE */
+/* */
+/* _ux_hcd_ehci_request_transfer PORTABLE C */
/* 6.1 */
/* AUTHOR */
/* */
/* Chaoqiong Xiao, Microsoft Corporation */
/* */
/* DESCRIPTION */
-/* */
+/* */
/* This function is the handler for all the transactions on the USB. */
-/* The transfer request passed as parameter contains the endpoint and */
-/* the device descriptors in addition to the type of transaction de */
-/* be executed. */
+/* The transfer request passed as parameter contains the endpoint and */
+/* the device descriptors in addition to the type of transaction de */
+/* be executed. */
+/* */
+/* This function routes the transfer_request to according to the type */
+/* of transfer to be executed. */
+/* */
+/* INPUT */
+/* */
+/* hcd_ehci Pointer to EHCI controller */
+/* transfer_request Pointer to transfer request */
+/* */
+/* OUTPUT */
+/* */
+/* Completion Status */
+/* */
+/* CALLS */
+/* */
+/* _ux_hcd_ehci_request_control_transfer Start control transfer */
+/* _ux_hcd_ehci_request_bulk_transfer Start bulk transfer */
+/* _ux_hcd_ehci_request_interrupt_transfer Start interrupt transfer */
+/* _ux_hcd_ehci_request_isochronous_transfer Start iso transfer */
+/* */
+/* CALLED BY */
/* */
-/* This function routes the transfer_request to according to the type */
-/* of transfer to be executed. */
-/* */
-/* INPUT */
-/* */
-/* hcd_ehci Pointer to EHCI controller */
-/* transfer_request Pointer to transfer request */
-/* */
-/* OUTPUT */
-/* */
-/* Completion Status */
-/* */
-/* CALLS */
-/* */
-/* _ux_hcd_ehci_request_control_transfer Start control transfer */
-/* _ux_hcd_ehci_request_bulk_transfer Start bulk transfer */
-/* _ux_hcd_ehci_request_interrupt_transfer Start interrupt transfer */
-/* _ux_hcd_ehci_request_isochronous_transfer Start iso transfer */
-/* */
-/* CALLED BY */
-/* */
/* EHCI Controller Driver */
-/* */
-/* RELEASE HISTORY */
-/* */
-/* DATE NAME DESCRIPTION */
-/* */
-/* 05-19-2020 Chaoqiong Xiao Initial Version 6.0 */
-/* 09-30-2020 Chaoqiong Xiao Modified comment(s), */
-/* resulting in version 6.1 */
/* */
/**************************************************************************/
UINT _ux_hcd_ehci_request_transfer(UX_HCD_EHCI *hcd_ehci, UX_TRANSFER *transfer_request)
@@ -83,20 +76,20 @@ UINT _ux_hcd_ehci_request_transfer(UX_HCD_EHCI *hcd_ehci, UX_TRANSFER *transfer
UX_ENDPOINT *endpoint;
UINT status;
-
+
/* Get the pointer to the Endpoint. */
endpoint = (UX_ENDPOINT *) transfer_request -> ux_transfer_request_endpoint;
/* We reset the actual length field of the transfer request as a safety measure. */
transfer_request -> ux_transfer_request_actual_length = 0;
-
+
/* Isolate the endpoint type and route the transfer request. */
switch ((endpoint -> ux_endpoint_descriptor.bmAttributes) & UX_MASK_ENDPOINT_TYPE)
{
case UX_CONTROL_ENDPOINT:
-
+
status = _ux_hcd_ehci_request_control_transfer(hcd_ehci, transfer_request);
break;
@@ -122,6 +115,6 @@ UINT status;
/* Note that it is physically impossible to have a wrong endpoint type here
so no error checking. */
- return(status);
+ return(status);
}
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 3325abaf..978f84f4 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
@@ -1,18 +1,19 @@
/***************************************************************************
- * Copyright (c) 2024 Microsoft Corporation
- *
+ * Copyright (c) 2024 Microsoft Corporation
+ * Copyright (c) 2026-present Eclipse ThreadX contributors
+ *
* This program and the accompanying materials are made available under the
* terms of the MIT License which is available at
* https://opensource.org/licenses/MIT.
- *
+ *
* SPDX-License-Identifier: MIT
**************************************************************************/
/**************************************************************************/
/**************************************************************************/
-/** */
-/** USBX Component */
+/** */
+/** USBX Component */
/** */
/** EHCI Controller Driver */
/** */
@@ -29,52 +30,44 @@
#include "ux_host_stack.h"
-/**************************************************************************/
-/* */
-/* FUNCTION RELEASE */
-/* */
-/* _ux_hcd_ehci_request_transfer_add PORTABLE C */
+/**************************************************************************/
+/* */
+/* FUNCTION RELEASE */
+/* */
+/* _ux_hcd_ehci_request_transfer_add PORTABLE C */
/* 6.1 */
/* AUTHOR */
/* */
/* Chaoqiong Xiao, Microsoft Corporation */
/* */
/* DESCRIPTION */
-/* */
-/* This function adds a component of a transfer to an existing ED. */
-/* */
-/* INPUT */
-/* */
-/* hcd_ehci Pointer to EHCI controller */
+/* */
+/* This function adds a component of a transfer to an existing ED. */
+/* */
+/* INPUT */
+/* */
+/* hcd_ehci Pointer to EHCI controller */
/* ed Pointer to the ED */
/* phase Phase (for control transfers) */
-/* pid PID to be used with this */
+/* pid PID to be used with this */
/* request (SETUP,IN,OUT) */
/* toggle Toggle value 0 or 1 */
/* buffer_address Buffer address for transfer */
/* buffer_length Buffer length */
-/* transfer_request Pointer to transfer request */
-/* */
-/* OUTPUT */
-/* */
-/* Completion Status */
-/* */
-/* CALLS */
-/* */
-/* _ux_hcd_ehci_regular_td_obtain Obtain regular TD */
-/* _ux_utility_physical_address Get physical address */
-/* */
-/* CALLED BY */
-/* */
+/* transfer_request Pointer to transfer request */
+/* */
+/* OUTPUT */
+/* */
+/* Completion Status */
+/* */
+/* CALLS */
+/* */
+/* _ux_hcd_ehci_regular_td_obtain Obtain regular TD */
+/* _ux_utility_physical_address Get physical address */
+/* */
+/* CALLED BY */
+/* */
/* EHCI Controller Driver */
-/* */
-/* RELEASE HISTORY */
-/* */
-/* DATE NAME DESCRIPTION */
-/* */
-/* 05-19-2020 Chaoqiong Xiao Initial Version 6.0 */
-/* 09-30-2020 Chaoqiong Xiao Modified comment(s), */
-/* resulting in version 6.1 */
/* */
/**************************************************************************/
UINT _ux_hcd_ehci_request_transfer_add(UX_HCD_EHCI *hcd_ehci, UX_EHCI_ED *ed, ULONG phase, ULONG pid,
@@ -85,7 +78,7 @@ UX_EHCI_TD *last_td;
UX_EHCI_TD *td;
UX_EHCI_LINK_POINTER lp;
UX_EHCI_POINTER bp;
-
+
/* Obtain a TD for this transaction. */
td = _ux_hcd_ehci_regular_td_obtain(hcd_ehci);
@@ -100,10 +93,10 @@ UX_EHCI_POINTER bp;
/* Mark the TD with the phase. */
td -> ux_ehci_td_phase |= phase;
-
+
/* Set the PID in the control DWORD of the TD. */
td -> ux_ehci_td_control = pid;
-
+
/* Set the buffer address if there is a data payload. */
bp.void_ptr = _ux_utility_physical_address(buffer_address);
td -> ux_ehci_td_bp0 = bp.void_ptr; /* with offset. */
@@ -114,18 +107,18 @@ UX_EHCI_POINTER bp;
td -> ux_ehci_td_bp2 = bp.u8_ptr + UX_EHCI_PAGE_SIZE * 2;
td -> ux_ehci_td_bp3 = bp.u8_ptr + UX_EHCI_PAGE_SIZE * 3;
td -> ux_ehci_td_bp4 = bp.u8_ptr + UX_EHCI_PAGE_SIZE * 4;
-
+
/* Set the length of the data transfer. We keep its original value. */
td -> ux_ehci_td_control |= buffer_length << UX_EHCI_TD_LG_LOC;
td -> ux_ehci_td_length = buffer_length;
-
+
/* Add the completion trigger, the default error count, the active bit. */
td -> ux_ehci_td_control |= UX_EHCI_TD_CERR | UX_EHCI_TD_ACTIVE;
/* Add the toggle value. This value is only used for control transfers. */
td -> ux_ehci_td_control |= toggle;
-
- /* Recall the last TD hooked to the ED. If the value is NULL, this will be the
+
+ /* Recall the last TD hooked to the ED. If the value is NULL, this will be the
first TD and should be hooked to the ED itself.. */
last_td = ed -> ux_ehci_ed_last_td;
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 e3928b11..39a94fe8 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
@@ -1,10 +1,11 @@
/***************************************************************************
- * Copyright (c) 2024 Microsoft Corporation
- *
+ * Copyright (c) 2024 Microsoft Corporation
+ * Copyright (c) 2026-present Eclipse ThreadX contributors
+ *
* This program and the accompanying materials are made available under the
* terms of the MIT License which is available at
* https://opensource.org/licenses/MIT.
- *
+ *
* SPDX-License-Identifier: MIT
**************************************************************************/
@@ -65,26 +66,6 @@
/* */
/* EHCI Controller Driver */
/* */
-/* RELEASE HISTORY */
-/* */
-/* DATE NAME DESCRIPTION */
-/* */
-/* 05-19-2020 Chaoqiong Xiao Initial Version 6.0 */
-/* 09-30-2020 Chaoqiong Xiao Modified comment(s), */
-/* resulting in version 6.1 */
-/* 11-09-2020 Chaoqiong Xiao Modified comment(s), */
-/* fixed compile warnings, */
-/* resulting in version 6.1.2 */
-/* 08-02-2021 Wen Wang Modified comment(s), */
-/* fixed spelling error, */
-/* resulting in version 6.1.8 */
-/* 04-25-2022 Chaoqiong Xiao Modified comment(s), */
-/* fixed standalone compile, */
-/* resulting in version 6.1.11 */
-/* 07-29-2022 Chaoqiong Xiao Modified comment(s), */
-/* improved iso abort support, */
-/* resulting in version 6.1.12 */
-/* */
/**************************************************************************/
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 c50533a0..a681723d 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
@@ -1,18 +1,19 @@
/***************************************************************************
- * Copyright (c) 2024 Microsoft Corporation
- *
+ * Copyright (c) 2024 Microsoft Corporation
+ * Copyright (c) 2026-present Eclipse ThreadX contributors
+ *
* This program and the accompanying materials are made available under the
* terms of the MIT License which is available at
* https://opensource.org/licenses/MIT.
- *
+ *
* SPDX-License-Identifier: MIT
**************************************************************************/
/**************************************************************************/
/**************************************************************************/
-/** */
-/** USBX Component */
+/** */
+/** USBX Component */
/** */
/** EHCI Controller Driver */
/** */
@@ -29,60 +30,49 @@
#include "ux_host_stack.h"
-/**************************************************************************/
-/* */
-/* FUNCTION RELEASE */
-/* */
-/* _ux_hcd_ehci_transfer_request_process PORTABLE C */
+/**************************************************************************/
+/* */
+/* FUNCTION RELEASE */
+/* */
+/* _ux_hcd_ehci_transfer_request_process PORTABLE C */
/* 6.1.10 */
/* AUTHOR */
/* */
/* Chaoqiong Xiao, Microsoft Corporation */
/* */
/* DESCRIPTION */
-/* */
-/* This function process the transfer that was completed either */
-/* successfully because of a partial transmission or because of an */
-/* error. The transfer descriptor tells us what to do with it, either */
-/* put a semaphore to the caller or invoke a completion routine. If a */
-/* completion routine is specified, the routine is called and no */
-/* semaphore is put. */
-/* */
-/* INPUT */
-/* */
-/* transfer_request Pointer to transfer request */
-/* */
-/* OUTPUT */
-/* */
-/* None */
-/* */
-/* CALLS */
-/* */
-/* (ux_transfer_request_completion_function) Transfer complete function*/
-/* _ux_host_semaphore_put Put producer semaphore */
-/* */
-/* CALLED BY */
-/* */
+/* */
+/* This function process the transfer that was completed either */
+/* successfully because of a partial transmission or because of an */
+/* error. The transfer descriptor tells us what to do with it, either */
+/* put a semaphore to the caller or invoke a completion routine. If a */
+/* completion routine is specified, the routine is called and no */
+/* semaphore is put. */
+/* */
+/* INPUT */
+/* */
+/* transfer_request Pointer to transfer request */
+/* */
+/* OUTPUT */
+/* */
+/* None */
+/* */
+/* CALLS */
+/* */
+/* (ux_transfer_request_completion_function) Transfer complete function*/
+/* _ux_host_semaphore_put Put producer semaphore */
+/* */
+/* CALLED BY */
+/* */
/* EHCI Controller Driver */
-/* */
-/* RELEASE HISTORY */
-/* */
-/* DATE NAME DESCRIPTION */
-/* */
-/* 05-19-2020 Chaoqiong Xiao Initial Version 6.0 */
-/* 09-30-2020 Chaoqiong Xiao Modified comment(s), */
-/* resulting in version 6.1 */
-/* 01-31-2022 Chaoqiong Xiao Modified comment(s), */
-/* refined macros names, */
-/* resulting in version 6.1.10 */
/* */
/**************************************************************************/
VOID _ux_hcd_ehci_transfer_request_process(UX_TRANSFER *transfer_request)
{
- /* Check if there is a function for the transfer completion. */
+ /* Check if there is a function for the transfer completion. */
if (transfer_request -> ux_transfer_request_completion_function != UX_NULL)
-
+
/* Yes, so we call it. */
transfer_request -> ux_transfer_request_completion_function(transfer_request);
else
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 b521e451..b7b768d0 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
@@ -1,18 +1,19 @@
/***************************************************************************
- * Copyright (c) 2024 Microsoft Corporation
- *
+ * Copyright (c) 2024 Microsoft Corporation
+ * Copyright (c) 2026-present Eclipse ThreadX contributors
+ *
* This program and the accompanying materials are made available under the
* terms of the MIT License which is available at
* https://opensource.org/licenses/MIT.
- *
+ *
* SPDX-License-Identifier: MIT
**************************************************************************/
/**************************************************************************/
/**************************************************************************/
-/** */
-/** USBX Component */
+/** */
+/** USBX Component */
/** */
/** OHCI Controller Driver */
/** */
@@ -29,54 +30,40 @@
#include "ux_host_stack.h"
-/**************************************************************************/
-/* */
-/* FUNCTION RELEASE */
-/* */
-/* _ux_hcd_ohci_asynchronous_endpoint_create PORTABLE C */
+/**************************************************************************/
+/* */
+/* FUNCTION RELEASE */
+/* */
+/* _ux_hcd_ohci_asynchronous_endpoint_create PORTABLE C */
/* 6.1.12 */
/* AUTHOR */
/* */
/* Chaoqiong Xiao, Microsoft Corporation */
/* */
/* DESCRIPTION */
-/* */
+/* */
/* This function will create an asynchronous endpoint. The control */
-/* and bulk endpoints fall into this category. */
-/* */
-/* INPUT */
-/* */
-/* hcd_ohci Pointer to OHCI HCD */
-/* endpoint Pointer to endpoint */
-/* */
-/* OUTPUT */
-/* */
-/* Completion Status */
-/* */
-/* CALLS */
-/* */
-/* _ux_hcd_ohci_ed_obtain Obtain a new ED */
-/* _ux_hcd_ohci_register_read Read OHCI register */
-/* _ux_hcd_ohci_register_write Write OHCI register */
-/* _ux_utility_physical_address Get physical address */
-/* */
-/* CALLED BY */
-/* */
-/* OHCI Controller Driver */
-/* */
-/* RELEASE HISTORY */
-/* */
-/* DATE NAME DESCRIPTION */
-/* */
-/* 05-19-2020 Chaoqiong Xiao Initial Version 6.0 */
-/* 09-30-2020 Chaoqiong Xiao Modified comment(s), */
-/* resulting in version 6.1 */
-/* 04-25-2022 Chaoqiong Xiao Modified comment(s), */
-/* fixed an addressing issue, */
-/* resulting in version 6.1.11 */
-/* 07-29-2022 Chaoqiong Xiao Modified comment(s), */
-/* fixed addressing issues, */
-/* resulting in version 6.1.12 */
+/* and bulk endpoints fall into this category. */
+/* */
+/* INPUT */
+/* */
+/* hcd_ohci Pointer to OHCI HCD */
+/* endpoint Pointer to endpoint */
+/* */
+/* OUTPUT */
+/* */
+/* Completion Status */
+/* */
+/* CALLS */
+/* */
+/* _ux_hcd_ohci_ed_obtain Obtain a new ED */
+/* _ux_hcd_ohci_register_read Read OHCI register */
+/* _ux_hcd_ohci_register_write Write OHCI register */
+/* _ux_utility_physical_address Get physical address */
+/* */
+/* CALLED BY */
+/* */
+/* OHCI Controller Driver */
/* */
/**************************************************************************/
UINT _ux_hcd_ohci_asynchronous_endpoint_create(UX_HCD_OHCI *hcd_ohci, UX_ENDPOINT *endpoint)
@@ -92,8 +79,8 @@ ULONG ohci_register;
/* We need to take into account the nature of the HCD to define the max size
of any transfer in the transfer request. */
endpoint -> ux_endpoint_transfer_request.ux_transfer_request_maximum_length = UX_OHCI_MAX_PAYLOAD;
-
- /* Obtain a ED for this new endpoint. This ED will live as long as the endpoint is active and
+
+ /* Obtain a ED for this new endpoint. This ED will live as long as the endpoint is active and
will be the container for the TDs. */
ed = _ux_hcd_ohci_ed_obtain(hcd_ohci);
if (ed == UX_NULL)
@@ -113,26 +100,26 @@ ULONG ohci_register;
/* Now do the opposite, attach the ED container to the physical ED. */
ed -> ux_ohci_ed_endpoint = endpoint;
-
+
/* Program the ED for subsequent transfers. We need to set the following things:
- 1) Address of the device
- 2) endpoint number
+ 1) Address of the device
+ 2) endpoint number
3) speed
- 4) format of TD
+ 4) format of TD
5) maximum packet size */
device = endpoint -> ux_endpoint_device;
ed -> ux_ohci_ed_dw0 = device -> ux_device_address |
((ULONG) (endpoint -> ux_endpoint_descriptor.bEndpointAddress & ~UX_ENDPOINT_DIRECTION)) << 7 |
((ULONG) endpoint -> ux_endpoint_descriptor.wMaxPacketSize) << 16;
-
+
if (device -> ux_device_speed == UX_LOW_SPEED_DEVICE)
ed -> ux_ohci_ed_dw0 |= UX_OHCI_ED_LOW_SPEED;
-
+
/* Hook the TD to both the tail and head of the ED. */
ed -> ux_ohci_ed_tail_td = _ux_utility_physical_address(td);
ed -> ux_ohci_ed_head_td = _ux_utility_physical_address(td);
-
- /* We now need to get the type of transfer (control or bulk) to hook this ED to the appropriate list.
+
+ /* We now need to get the type of transfer (control or bulk) to hook this ED to the appropriate list.
We also enable the appropriate list. */
switch ((endpoint -> ux_endpoint_descriptor.bmAttributes) & UX_MASK_ENDPOINT_TYPE)
{
@@ -172,6 +159,6 @@ ULONG ohci_register;
}
/* Return successful completion. */
- return(UX_SUCCESS);
+ return(UX_SUCCESS);
}
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 6910037e..ed26efc4 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
@@ -1,18 +1,19 @@
/***************************************************************************
- * Copyright (c) 2024 Microsoft Corporation
- *
+ * Copyright (c) 2024 Microsoft Corporation
+ * Copyright (c) 2026-present Eclipse ThreadX contributors
+ *
* This program and the accompanying materials are made available under the
* terms of the MIT License which is available at
* https://opensource.org/licenses/MIT.
- *
+ *
* SPDX-License-Identifier: MIT
**************************************************************************/
/**************************************************************************/
/**************************************************************************/
-/** */
-/** USBX Component */
+/** */
+/** USBX Component */
/** */
/** OHCI Controller Driver */
/** */
@@ -29,53 +30,40 @@
#include "ux_hcd_ohci.h"
-/**************************************************************************/
-/* */
-/* FUNCTION RELEASE */
-/* */
-/* _ux_hcd_ohci_asynchronous_endpoint_destroy PORTABLE C */
+/**************************************************************************/
+/* */
+/* FUNCTION RELEASE */
+/* */
+/* _ux_hcd_ohci_asynchronous_endpoint_destroy PORTABLE C */
/* 6.1.11 */
/* AUTHOR */
/* */
/* Chaoqiong Xiao, Microsoft Corporation */
/* */
/* DESCRIPTION */
-/* */
-/* This function will destroy an asynchronous endpoint. The control */
-/* and bulk endpoints fall into this category. */
-/* */
-/* INPUT */
-/* */
-/* hcd_ohci Pointer to OHCI HCD */
-/* endpoint Pointer to endpoint */
-/* */
-/* OUTPUT */
-/* */
-/* Completion Status */
-/* */
-/* CALLS */
-/* */
-/* _ux_hcd_ohci_register_read Read OHCI register */
-/* _ux_hcd_ohci_register_write Write OHCI register */
-/* _ux_utility_virtual_address Get virtual address */
-/* _ux_utility_delay_ms Delay ms */
-/* */
-/* CALLED BY */
-/* */
-/* OHCI Controller Driver */
-/* */
-/* RELEASE HISTORY */
-/* */
-/* DATE NAME DESCRIPTION */
-/* */
-/* 05-19-2020 Chaoqiong Xiao Initial Version 6.0 */
-/* 09-30-2020 Chaoqiong Xiao Modified comment(s), */
-/* fixed physical and virtual */
-/* address conversion, */
-/* resulting in version 6.1 */
-/* 04-25-2022 Chaoqiong Xiao Modified comment(s), */
-/* fixed an addressing issue, */
-/* resulting in version 6.1.11 */
+/* */
+/* This function will destroy an asynchronous endpoint. The control */
+/* and bulk endpoints fall into this category. */
+/* */
+/* INPUT */
+/* */
+/* hcd_ohci Pointer to OHCI HCD */
+/* endpoint Pointer to endpoint */
+/* */
+/* OUTPUT */
+/* */
+/* Completion Status */
+/* */
+/* CALLS */
+/* */
+/* _ux_hcd_ohci_register_read Read OHCI register */
+/* _ux_hcd_ohci_register_write Write OHCI register */
+/* _ux_utility_virtual_address Get virtual address */
+/* _ux_utility_delay_ms Delay ms */
+/* */
+/* CALLED BY */
+/* */
+/* OHCI Controller Driver */
/* */
/**************************************************************************/
UINT _ux_hcd_ohci_asynchronous_endpoint_destroy(UX_HCD_OHCI *hcd_ohci, UX_ENDPOINT *endpoint)
@@ -88,7 +76,7 @@ UX_OHCI_TD *tail_td;
UX_OHCI_TD *head_td;
ULONG value_td;
ULONG ohci_register;
-
+
/* From the endpoint container fetch the OHCI ED descriptor. */
ed = (UX_OHCI_ED*) endpoint -> ux_endpoint_ed;
@@ -96,7 +84,7 @@ ULONG ohci_register;
/* Check if this physical endpoint has been initialized properly! */
if (ed == UX_NULL)
{
-
+
/* Error trap. */
_ux_system_error_handler(UX_SYSTEM_LEVEL_THREAD, UX_SYSTEM_CONTEXT_HCD, UX_ENDPOINT_HANDLE_UNKNOWN);
@@ -108,7 +96,7 @@ ULONG ohci_register;
/* The endpoint may be active. If so, set the skip bit. */
ed -> ux_ohci_ed_dw0 |= UX_OHCI_ED_SKIP;
-
+
/* Wait for the controller to finish the current frame processing. */
_ux_utility_delay_ms(1);
@@ -135,7 +123,7 @@ ULONG ohci_register;
ohci_register &= ~OHCI_HC_CR_CLE;
_ux_hcd_ohci_register_write(hcd_ohci, OHCI_HC_CONTROL, ohci_register);
}
-
+
/* Store the new endpoint in the Control list. */
_ux_hcd_ohci_register_write(hcd_ohci, OHCI_HC_CONTROL_HEAD_ED, (ULONG) next_ed);
break;
@@ -151,7 +139,7 @@ ULONG ohci_register;
ohci_register &= ~OHCI_HC_CR_BLE;
_ux_hcd_ohci_register_write(hcd_ohci, OHCI_HC_CONTROL, ohci_register);
}
-
+
/* Store the new endpoint in the Bulk list */
_ux_hcd_ohci_register_write(hcd_ohci, OHCI_HC_BULK_HEAD_ED, (ULONG) next_ed);
break;
@@ -201,6 +189,6 @@ ULONG ohci_register;
ed -> ux_ohci_ed_status = UX_UNUSED;
/* Return successful completion. */
- return(UX_SUCCESS);
+ return(UX_SUCCESS);
}
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 2f32a4e8..b69695d6 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
@@ -1,18 +1,19 @@
/***************************************************************************
- * Copyright (c) 2024 Microsoft Corporation
- *
+ * Copyright (c) 2024 Microsoft Corporation
+ * Copyright (c) 2026-present Eclipse ThreadX contributors
+ *
* This program and the accompanying materials are made available under the
* terms of the MIT License which is available at
* https://opensource.org/licenses/MIT.
- *
+ *
* SPDX-License-Identifier: MIT
**************************************************************************/
/**************************************************************************/
/**************************************************************************/
-/** */
-/** USBX Component */
+/** */
+/** USBX Component */
/** */
/** OHCI Controller Driver */
/** */
@@ -29,46 +30,38 @@
#include "ux_host_stack.h"
-/**************************************************************************/
-/* */
-/* FUNCTION RELEASE */
-/* */
-/* _ux_hcd_ohci_controller_disable PORTABLE C */
+/**************************************************************************/
+/* */
+/* FUNCTION RELEASE */
+/* */
+/* _ux_hcd_ohci_controller_disable PORTABLE C */
/* 6.1 */
/* AUTHOR */
/* */
/* Chaoqiong Xiao, Microsoft Corporation */
/* */
/* DESCRIPTION */
-/* */
-/* This function will disable the OHCI controller. The controller */
-/* will release all its resources (memory, IO ...). After this, the */
-/* controller will not send SOF any longer. All transactions should */
-/* have been completed, all classes should have been closed. */
-/* */
-/* INPUT */
-/* */
-/* hcd_ohci Pointer to OHCI HCD */
-/* */
-/* OUTPUT */
-/* */
-/* Completion Status */
-/* */
-/* CALLS */
-/* */
-/* _ux_hcd_ohci_register_write Write OHCI register */
-/* */
-/* CALLED BY */
-/* */
-/* OHCI Controller Driver */
-/* */
-/* RELEASE HISTORY */
-/* */
-/* DATE NAME DESCRIPTION */
-/* */
-/* 05-19-2020 Chaoqiong Xiao Initial Version 6.0 */
-/* 09-30-2020 Chaoqiong Xiao Modified comment(s), */
-/* resulting in version 6.1 */
+/* */
+/* This function will disable the OHCI controller. The controller */
+/* will release all its resources (memory, IO ...). After this, the */
+/* controller will not send SOF any longer. All transactions should */
+/* have been completed, all classes should have been closed. */
+/* */
+/* INPUT */
+/* */
+/* hcd_ohci Pointer to OHCI HCD */
+/* */
+/* OUTPUT */
+/* */
+/* Completion Status */
+/* */
+/* CALLS */
+/* */
+/* _ux_hcd_ohci_register_write Write OHCI register */
+/* */
+/* CALLED BY */
+/* */
+/* OHCI Controller Driver */
/* */
/**************************************************************************/
UINT _ux_hcd_ohci_controller_disable(UX_HCD_OHCI *hcd_ohci)
@@ -76,11 +69,11 @@ UINT _ux_hcd_ohci_controller_disable(UX_HCD_OHCI *hcd_ohci)
UX_HCD *hcd;
ULONG ohci_register;
-
+
/* Point to the generic portion of the host controller structure instance. */
hcd = hcd_ohci -> ux_hcd_ohci_hcd_owner;
-
+
/* Set the controller to disabled state. */
ohci_register = OHCI_HC_CR_RESET;
_ux_hcd_ohci_register_write(hcd_ohci, OHCI_HC_CONTROL, ohci_register);
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 12688845..cb177da6 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
@@ -1,18 +1,19 @@
/***************************************************************************
- * Copyright (c) 2024 Microsoft Corporation
- *
+ * Copyright (c) 2024 Microsoft Corporation
+ * Copyright (c) 2026-present Eclipse ThreadX contributors
+ *
* This program and the accompanying materials are made available under the
* terms of the MIT License which is available at
* https://opensource.org/licenses/MIT.
- *
+ *
* SPDX-License-Identifier: MIT
**************************************************************************/
/**************************************************************************/
/**************************************************************************/
-/** */
-/** USBX Component */
+/** */
+/** USBX Component */
/** */
/** OHCI Controller Driver */
/** */
@@ -29,62 +30,48 @@
#include "ux_host_stack.h"
-/**************************************************************************/
-/* */
-/* FUNCTION RELEASE */
-/* */
-/* _ux_hcd_ohci_done_queue_process PORTABLE C */
+/**************************************************************************/
+/* */
+/* FUNCTION RELEASE */
+/* */
+/* _ux_hcd_ohci_done_queue_process PORTABLE C */
/* 6.1.12 */
/* AUTHOR */
/* */
/* Chaoqiong Xiao, Microsoft Corporation */
/* */
/* DESCRIPTION */
-/* */
-/* This function process the done queue that was posted by the */
-/* controller during the last interrupt. The bad news is that the */
-/* list of the TDs in the queue is in the opposite order of their */
-/* actual completion. This FIFO made the OHCI design easier but the */
-/* software has to work harder! */
-/* */
-/* INPUT */
-/* */
-/* hcd_ohci Pointer to OHCI HCD */
-/* */
-/* OUTPUT */
-/* */
-/* None */
-/* */
-/* CALLS */
-/* */
-/* (ux_transfer_request_completion_function) */
-/* Transfer completion function */
-/* _ux_hcd_ohci_endpoint_error_clear Clear endpoint error */
-/* _ux_hcd_ohci_endpoint_reset Reset endpoint */
-/* _ux_hcd_ohci_frame_number_get Get frame number */
-/* _ux_hcd_ohci_next_td_clean Clean next TD */
-/* _ux_hcd_ohci_register_read Read OHCI register */
-/* _ux_hcd_ohci_register_write Write OHCI register */
-/* _ux_host_semaphore_put Put producer semaphore */
-/* _ux_utility_virtual_address Get virtual address */
-/* */
-/* CALLED BY */
-/* */
-/* OHCI Controller Driver */
-/* */
-/* RELEASE HISTORY */
-/* */
-/* DATE NAME DESCRIPTION */
-/* */
-/* 05-19-2020 Chaoqiong Xiao Initial Version 6.0 */
-/* 09-30-2020 Chaoqiong Xiao Modified comment(s), */
-/* resulting in version 6.1 */
-/* 01-31-2022 Chaoqiong Xiao Modified comment(s), */
-/* refined macros names, */
-/* resulting in version 6.1.10 */
-/* 07-29-2022 Chaoqiong Xiao Modified comment(s), */
-/* fixed an addressing issue, */
-/* resulting in version 6.1.12 */
+/* */
+/* This function process the done queue that was posted by the */
+/* controller during the last interrupt. The bad news is that the */
+/* list of the TDs in the queue is in the opposite order of their */
+/* actual completion. This FIFO made the OHCI design easier but the */
+/* software has to work harder! */
+/* */
+/* INPUT */
+/* */
+/* hcd_ohci Pointer to OHCI HCD */
+/* */
+/* OUTPUT */
+/* */
+/* None */
+/* */
+/* CALLS */
+/* */
+/* (ux_transfer_request_completion_function) */
+/* Transfer completion function */
+/* _ux_hcd_ohci_endpoint_error_clear Clear endpoint error */
+/* _ux_hcd_ohci_endpoint_reset Reset endpoint */
+/* _ux_hcd_ohci_frame_number_get Get frame number */
+/* _ux_hcd_ohci_next_td_clean Clean next TD */
+/* _ux_hcd_ohci_register_read Read OHCI register */
+/* _ux_hcd_ohci_register_write Write OHCI register */
+/* _ux_host_semaphore_put Put producer semaphore */
+/* _ux_utility_virtual_address Get virtual address */
+/* */
+/* CALLED BY */
+/* */
+/* OHCI Controller Driver */
/* */
/**************************************************************************/
VOID _ux_hcd_ohci_done_queue_process(UX_HCD_OHCI *hcd_ohci)
@@ -102,17 +89,17 @@ ULONG transaction_length;
ULONG current_frame;
- /* Get the first entry of the done queue. It may be NULL which means there is nothing to do!
- The LSB of the TD pointer may be set by the OHCI controller to indicate that the Interrupt
- status of the controller should be read. The TDs in the list are using physical addresses.
+ /* Get the first entry of the done queue. It may be NULL which means there is nothing to do!
+ The LSB of the TD pointer may be set by the OHCI controller to indicate that the Interrupt
+ status of the controller should be read. The TDs in the list are using physical addresses.
They need to be translated into virtual addresses. */
next_td = _ux_utility_virtual_address((VOID *) ((ULONG) hcd_ohci -> ux_hcd_ohci_done_head & 0xfffffff0));
-
+
/* Reset the last TD in the chain. */
previous_td = UX_NULL;
td = UX_NULL;
- /* The TD we have now is the last in the FIFO, re-traverse the chain to get the TDs in the
+ /* The TD we have now is the last in the FIFO, re-traverse the chain to get the TDs in the
chronological order. */
while (next_td != UX_NULL)
{
@@ -123,10 +110,10 @@ ULONG current_frame;
previous_td = td;
}
- /* Process each TD in their chronological order now. The TD pointer now has the first TD in the
+ /* Process each TD in their chronological order now. The TD pointer now has the first TD in the
list, all values are in virtual addresses. */
while (td != UX_NULL)
- {
+ {
/* Get the pointer to the transfer request attached with this TD. */
transfer_request = td -> ux_ohci_td_transfer_request;
@@ -134,7 +121,7 @@ ULONG current_frame;
/* Get the endpoint associated with the transfer request */
endpoint = transfer_request -> ux_transfer_request_endpoint;
- /* Retrieve the error code for this transaction. There are 3 types of errors:
+ /* Retrieve the error code for this transaction. There are 3 types of errors:
transmission, sequence, system. */
td_error_code = td -> ux_ohci_td_dw0 >> UX_OHCI_TD_CC;
@@ -154,7 +141,7 @@ ULONG current_frame;
/* No error on the transmission of this TD. Update the length of the transfer request. */
transfer_request -> ux_transfer_request_actual_length += td -> ux_ohci_td_length;
- /* Check at the phase of the transfer, if this is a SETUP or DATA phases for a control
+ /* Check at the phase of the transfer, if this is a SETUP or DATA phases for a control
endpoint, we wait for the setup phase or any phase for other types of endpoints. */
if ((td -> ux_ohci_td_status & UX_OHCI_TD_SETUP_PHASE) || (td -> ux_ohci_td_status & UX_OHCI_TD_DATA_PHASE))
break;
@@ -173,14 +160,14 @@ ULONG current_frame;
case UX_OHCI_ERROR_DATA_UNDERRUN:
- /* No error on the transmission of this TD but all data is not accounted for. This is typically
- a short packet and OHCI report it as an error. This allows for the ED to be halted and further
+ /* No error on the transmission of this TD but all data is not accounted for. This is typically
+ a short packet and OHCI report it as an error. This allows for the ED to be halted and further
attached TDs to be stopped. In this case, compute the correct received\sent length and
process the transfer request. */
transfer_request -> ux_transfer_request_actual_length += td -> ux_ohci_td_length - ((ULONG) td -> ux_ohci_td_be -
(ULONG) td -> ux_ohci_td_cbp) - 1;
- /* Check at the phase of the transfer, if this is a SETUP or DATA phases for a control endpoint,
+ /* Check at the phase of the transfer, if this is a SETUP or DATA phases for a control endpoint,
we wait for the setup phase or any phase for other types of endpoints. */
if ((td -> ux_ohci_td_status & UX_OHCI_TD_SETUP_PHASE) || (td -> ux_ohci_td_status & UX_OHCI_TD_DATA_PHASE))
break;
@@ -197,10 +184,10 @@ ULONG current_frame;
break;
-
+
case UX_OHCI_ERROR_STALL:
- /* A stall condition happens when the device refuses the requested command or when a
+ /* A stall condition happens when the device refuses the requested command or when a
parameter in the command is wrong. We retire the transfer_request and mark the error. */
transfer_request -> ux_transfer_request_completion_code = UX_TRANSFER_STALLED;
_ux_hcd_ohci_next_td_clean(td);
@@ -218,9 +205,9 @@ ULONG current_frame;
case UX_OHCI_ERROR_DEVICE_NOT_RESPONDING:
- /* A stall condition happens when the device does not respond to the request. This mostly
- happens at the first GET_DESCRIPTOR after the port is enabled. This error has to be
- picked up by the enumeration module to reset the port and retry the command. */
+ /* A stall condition happens when the device does not respond to the request. This mostly
+ happens at the first GET_DESCRIPTOR after the port is enabled. This error has to be
+ picked up by the enumeration module to reset the port and retry the command. */
transfer_request -> ux_transfer_request_completion_code = UX_TRANSFER_NO_ANSWER;
_ux_hcd_ohci_next_td_clean(td);
if (transfer_request -> ux_transfer_request_completion_function != UX_NULL)
@@ -234,10 +221,10 @@ ULONG current_frame;
_ux_hcd_ohci_endpoint_reset(hcd_ohci, endpoint);
break;
-
+
default:
-
- /* Any other errors default to this section. The command has been repeated 3 times
+
+ /* Any other errors default to this section. The command has been repeated 3 times
and there is still a problem. The endpoint probably should be reset. */
transfer_request -> ux_transfer_request_completion_code = UX_TRANSFER_ERROR;
_ux_hcd_ohci_next_td_clean(td);
@@ -254,27 +241,27 @@ ULONG current_frame;
}
break;
-
+
case UX_ISOCHRONOUS_ENDPOINT:
/* The length of the transfer is in the PSW. */
iso_td = (UX_OHCI_ISO_TD *) td;
-
+
switch (td_error_code)
{
case UX_OHCI_NO_ERROR:
-
- /* No error on the transmission of this TD. All data is accounted for. Check for the
- last TD in the transfer request. If last, process the transfer request. The method
- to calculate the length of the transaction is different between a IN and OUT
- transactions. For a OUT, if the PSW is 0, then all data was transmitted. For an IN
+
+ /* No error on the transmission of this TD. All data is accounted for. Check for the
+ last TD in the transfer request. If last, process the transfer request. The method
+ to calculate the length of the transaction is different between a IN and OUT
+ transactions. For a OUT, if the PSW is 0, then all data was transmitted. For an IN
the PSW indicates the number of bytes received. */
transaction_length = iso_td -> ux_ohci_iso_td_offset_psw[0] & UX_OHCI_ISO_TD_OFFSET;
-
+
if ((transfer_request -> ux_transfer_request_type & UX_REQUEST_DIRECTION) == UX_REQUEST_IN)
{
-
+
transfer_request -> ux_transfer_request_actual_length += transaction_length;
}
else
@@ -286,7 +273,7 @@ ULONG current_frame;
transfer_request -> ux_transfer_request_actual_length += transaction_length;
}
- /* Check if the transfer request is complete or if this is an IN transaction and the length received
+ /* Check if the transfer request is complete or if this is an IN transaction and the length received
is less than the max packet size. */
if ((transfer_request -> ux_transfer_request_actual_length == transfer_request -> ux_transfer_request_requested_length) ||
(((transfer_request -> ux_transfer_request_type & UX_REQUEST_DIRECTION) == UX_REQUEST_IN) &&
@@ -302,7 +289,7 @@ ULONG current_frame;
case UX_OHCI_ERROR_DATA_OVERRRUN:
-
+
/* In this case, we have missed the frame for the isoch transfer. */
_ux_hcd_ohci_frame_number_get(hcd_ohci, ¤t_frame);
transfer_request -> ux_transfer_request_completion_code = UX_TRANSFER_MISSED_FRAME;
@@ -315,7 +302,7 @@ ULONG current_frame;
_ux_host_semaphore_put(&transfer_request -> ux_transfer_request_semaphore);
break;
-
+
default:
/* Some other error happened, in isoch transfer, there is not much we can do. */
@@ -329,7 +316,7 @@ ULONG current_frame;
_ux_host_semaphore_put(&transfer_request -> ux_transfer_request_semaphore);
break;
}
- }
+ }
/* Free the TD that was just treated. */
td -> ux_ohci_td_status = UX_UNUSED;
@@ -338,7 +325,7 @@ ULONG current_frame;
td = _ux_utility_virtual_address(td -> ux_ohci_td_next_td);
}
- /* The OHCI controller is now ready to receive the next done queue. We need to
+ /* The OHCI controller is now ready to receive the next done queue. We need to
reawake the OHCI controller on the WDH signal. */
ohci_register_interrupt = _ux_hcd_ohci_register_read(hcd_ohci, OHCI_HC_INTERRUPT_ENABLE);
ohci_register_interrupt |= OHCI_HC_INT_WDH;
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 7141f25e..32713bd4 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
@@ -1,18 +1,19 @@
/***************************************************************************
- * Copyright (c) 2024 Microsoft Corporation
- *
+ * Copyright (c) 2024 Microsoft Corporation
+ * Copyright (c) 2026-present Eclipse ThreadX contributors
+ *
* This program and the accompanying materials are made available under the
* terms of the MIT License which is available at
* https://opensource.org/licenses/MIT.
- *
+ *
* SPDX-License-Identifier: MIT
**************************************************************************/
/**************************************************************************/
/**************************************************************************/
-/** */
-/** USBX Component */
+/** */
+/** USBX Component */
/** */
/** OHCI Controller Driver */
/** */
@@ -29,45 +30,35 @@
#include "ux_host_stack.h"
-/**************************************************************************/
-/* */
-/* FUNCTION RELEASE */
-/* */
-/* _ux_hcd_ohci_ed_obtain PORTABLE C */
+/**************************************************************************/
+/* */
+/* FUNCTION RELEASE */
+/* */
+/* _ux_hcd_ohci_ed_obtain PORTABLE C */
/* 6.1 */
/* AUTHOR */
/* */
/* Chaoqiong Xiao, Microsoft Corporation */
/* */
/* DESCRIPTION */
-/* */
-/* This function obtains a free ED from the ED list. */
-/* */
-/* INPUT */
-/* */
-/* hcd_ohci Pointer to OHCI HCD */
-/* */
-/* OUTPUT */
-/* */
-/* UX_OHCI_ED * Pointer to ED */
-/* */
-/* CALLS */
-/* */
-/* _ux_utility_memory_set Set memory block */
-/* */
-/* CALLED BY */
-/* */
-/* OHCI Controller Driver */
-/* */
-/* RELEASE HISTORY */
-/* */
-/* DATE NAME DESCRIPTION */
-/* */
-/* 05-19-2020 Chaoqiong Xiao Initial Version 6.0 */
-/* 09-30-2020 Chaoqiong Xiao Modified comment(s), */
-/* verified memset and memcpy */
-/* cases, */
-/* resulting in version 6.1 */
+/* */
+/* This function obtains a free ED from the ED list. */
+/* */
+/* INPUT */
+/* */
+/* hcd_ohci Pointer to OHCI HCD */
+/* */
+/* OUTPUT */
+/* */
+/* UX_OHCI_ED * Pointer to ED */
+/* */
+/* CALLS */
+/* */
+/* _ux_utility_memory_set Set memory block */
+/* */
+/* CALLED BY */
+/* */
+/* OHCI Controller Driver */
/* */
/**************************************************************************/
UX_OHCI_ED *_ux_hcd_ohci_ed_obtain(UX_HCD_OHCI *hcd_ohci)
@@ -95,7 +86,7 @@ ULONG ed_index;
/* Success, return the ED pointer. */
return(ed);
}
-
+
/* Point to the next ED. */
ed++;
}
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 6d479232..d3d17904 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
@@ -1,18 +1,19 @@
/***************************************************************************
- * Copyright (c) 2024 Microsoft Corporation
- *
+ * Copyright (c) 2024 Microsoft Corporation
+ * Copyright (c) 2026-present Eclipse ThreadX contributors
+ *
* This program and the accompanying materials are made available under the
* terms of the MIT License which is available at
* https://opensource.org/licenses/MIT.
- *
+ *
* SPDX-License-Identifier: MIT
**************************************************************************/
/**************************************************************************/
/**************************************************************************/
-/** */
-/** USBX Component */
+/** */
+/** USBX Component */
/** */
/** OHCI Controller Driver */
/** */
@@ -29,48 +30,37 @@
#include "ux_host_stack.h"
-/**************************************************************************/
-/* */
-/* FUNCTION RELEASE */
-/* */
-/* _ux_hcd_ohci_endpoint_error_clear PORTABLE C */
+/**************************************************************************/
+/* */
+/* FUNCTION RELEASE */
+/* */
+/* _ux_hcd_ohci_endpoint_error_clear PORTABLE C */
/* 6.1.2 */
/* AUTHOR */
/* */
/* Chaoqiong Xiao, Microsoft Corporation */
/* */
/* DESCRIPTION */
-/* */
-/* This function will clear the error bit in a OHCI endpoint. This */
-/* command, unlike the reset command does not clear the toggle bit. */
-/* */
-/* INPUT */
-/* */
-/* hcd_ohci Pointer to OHCI HCD */
-/* endpoint Pointer to endpoint */
-/* */
-/* OUTPUT */
-/* */
-/* Completion Status */
-/* */
-/* CALLS */
-/* */
-/* None */
-/* */
-/* CALLED BY */
-/* */
-/* OHCI Controller Driver */
-/* */
-/* RELEASE HISTORY */
-/* */
-/* DATE NAME DESCRIPTION */
-/* */
-/* 05-19-2020 Chaoqiong Xiao Initial Version 6.0 */
-/* 09-30-2020 Chaoqiong Xiao Modified comment(s), */
-/* resulting in version 6.1 */
-/* 11-09-2020 Chaoqiong Xiao Modified comment(s), */
-/* fixed compile warnings, */
-/* resulting in version 6.1.2 */
+/* */
+/* This function will clear the error bit in a OHCI endpoint. This */
+/* command, unlike the reset command does not clear the toggle bit. */
+/* */
+/* INPUT */
+/* */
+/* hcd_ohci Pointer to OHCI HCD */
+/* endpoint Pointer to endpoint */
+/* */
+/* OUTPUT */
+/* */
+/* Completion Status */
+/* */
+/* CALLS */
+/* */
+/* None */
+/* */
+/* CALLED BY */
+/* */
+/* OHCI Controller Driver */
/* */
/**************************************************************************/
UINT _ux_hcd_ohci_endpoint_error_clear(UX_HCD_OHCI *hcd_ohci, UX_ENDPOINT *endpoint)
@@ -91,6 +81,6 @@ ULONG td_value;
ed -> ux_ohci_ed_head_td = (UX_OHCI_TD *) td_value;
/* This operation never fails! */
- return(UX_SUCCESS);
+ return(UX_SUCCESS);
}
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 02c5ffea..b0333fa2 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
@@ -1,18 +1,19 @@
/***************************************************************************
- * Copyright (c) 2024 Microsoft Corporation
- *
+ * Copyright (c) 2024 Microsoft Corporation
+ * Copyright (c) 2026-present Eclipse ThreadX contributors
+ *
* This program and the accompanying materials are made available under the
* terms of the MIT License which is available at
* https://opensource.org/licenses/MIT.
- *
+ *
* SPDX-License-Identifier: MIT
**************************************************************************/
/**************************************************************************/
/**************************************************************************/
-/** */
-/** USBX Component */
+/** */
+/** USBX Component */
/** */
/** OHCI Controller Driver */
/** */
@@ -29,47 +30,36 @@
#include "ux_host_stack.h"
-/**************************************************************************/
-/* */
-/* FUNCTION RELEASE */
-/* */
-/* _ux_hcd_ohci_endpoint_reset PORTABLE C */
+/**************************************************************************/
+/* */
+/* FUNCTION RELEASE */
+/* */
+/* _ux_hcd_ohci_endpoint_reset PORTABLE C */
/* 6.1.2 */
/* AUTHOR */
/* */
/* Chaoqiong Xiao, Microsoft Corporation */
/* */
/* DESCRIPTION */
-/* */
-/* This function will reset an endpoint. */
-/* */
-/* INPUT */
-/* */
-/* hcd_ohci Pointer to OHCI HCD */
-/* endpoint Pointer to endpoint */
-/* */
-/* OUTPUT */
-/* */
-/* Completion Status */
-/* */
-/* CALLS */
-/* */
-/* None */
-/* */
-/* CALLED BY */
-/* */
-/* OHCI Controller Driver */
-/* */
-/* RELEASE HISTORY */
-/* */
-/* DATE NAME DESCRIPTION */
-/* */
-/* 05-19-2020 Chaoqiong Xiao Initial Version 6.0 */
-/* 09-30-2020 Chaoqiong Xiao Modified comment(s), */
-/* resulting in version 6.1 */
-/* 11-09-2020 Chaoqiong Xiao Modified comment(s), */
-/* fixed compile warnings, */
-/* resulting in version 6.1.2 */
+/* */
+/* This function will reset an endpoint. */
+/* */
+/* INPUT */
+/* */
+/* hcd_ohci Pointer to OHCI HCD */
+/* endpoint Pointer to endpoint */
+/* */
+/* OUTPUT */
+/* */
+/* Completion Status */
+/* */
+/* CALLS */
+/* */
+/* None */
+/* */
+/* CALLED BY */
+/* */
+/* OHCI Controller Driver */
/* */
/**************************************************************************/
UINT _ux_hcd_ohci_endpoint_reset(UX_HCD_OHCI *hcd_ohci, UX_ENDPOINT *endpoint)
@@ -90,6 +80,6 @@ ULONG td_value;
ed -> ux_ohci_ed_head_td = (UX_OHCI_TD *) td_value;
/* This operation never fails! */
- return(UX_SUCCESS);
+ return(UX_SUCCESS);
}
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 4565d3b2..baadf5e6 100644
--- a/common/usbx_host_controllers/src/ux_hcd_ohci_entry.c
+++ b/common/usbx_host_controllers/src/ux_hcd_ohci_entry.c
@@ -1,18 +1,19 @@
/***************************************************************************
- * Copyright (c) 2024 Microsoft Corporation
- *
+ * Copyright (c) 2024 Microsoft Corporation
+ * Copyright (c) 2026-present Eclipse ThreadX contributors
+ *
* This program and the accompanying materials are made available under the
* terms of the MIT License which is available at
* https://opensource.org/licenses/MIT.
- *
+ *
* SPDX-License-Identifier: MIT
**************************************************************************/
/**************************************************************************/
/**************************************************************************/
-/** */
-/** USBX Component */
+/** */
+/** USBX Component */
/** */
/** OHCI Controller Driver */
/** */
@@ -29,65 +30,57 @@
#include "ux_host_stack.h"
-/**************************************************************************/
-/* */
-/* FUNCTION RELEASE */
-/* */
-/* _ux_hcd_ohci_entry PORTABLE C */
+/**************************************************************************/
+/* */
+/* FUNCTION RELEASE */
+/* */
+/* _ux_hcd_ohci_entry PORTABLE C */
/* 6.1 */
/* AUTHOR */
/* */
/* Chaoqiong Xiao, Microsoft Corporation */
/* */
/* DESCRIPTION */
-/* */
+/* */
/* This function dispatches the HCD function internally to the OHCI */
-/* controller driver routines. */
-/* */
-/* INPUT */
-/* */
-/* HCD Pointer to HCD */
-/* function Function for driver to perform*/
-/* parameter Pointer to parameter(s) */
-/* */
-/* OUTPUT */
-/* */
-/* Completion Status */
-/* */
-/* CALLS */
-/* */
-/* _ux_hcd_ohci_asynchronous_endpoint_create Create async endpoint */
-/* _ux_hcd_ohci_asynchronous_endpoint_destroy Destroy async endpoint */
-/* _ux_hcd_ohci_controller_disable Disable controller */
-/* _ux_hcd_ohci_done_queue_process Process done queue */
-/* _ux_hcd_ohci_endpoint_reset Reset endpoint */
-/* _ux_hcd_ohci_frame_number_get Get frame number */
-/* _ux_hcd_ohci_frame_number_set Set frame number */
-/* _ux_hcd_ohci_interrupt_endpoint_create Create interrupt endpoint*/
-/* _ux_hcd_ohci_isochronous_endpoint_create Create isoch endpoint */
-/* _ux_hcd_ohci_periodic_endpoint_destroy Destroy periodic endpoint*/
-/* _ux_hcd_ohci_port_enable Enable port */
-/* _ux_hcd_ohci_port_disable Disable port */
-/* _ux_hcd_ohci_port_reset Reset port */
-/* _ux_hcd_ohci_port_resume Resume port */
-/* _ux_hcd_ohci_port_status_get Get port status */
-/* _ux_hcd_ohci_port_suspend Suspend port */
-/* _ux_hcd_ohci_power_down_port Power down port */
-/* _ux_hcd_ohci_power_on_port Power on port */
-/* _ux_hcd_ohci_request_transfer Request transfer */
-/* _ux_hcd_ohci_transfer_abort Abort transfer */
-/* */
-/* CALLED BY */
-/* */
-/* Host Stack */
-/* */
-/* RELEASE HISTORY */
-/* */
-/* DATE NAME DESCRIPTION */
-/* */
-/* 05-19-2020 Chaoqiong Xiao Initial Version 6.0 */
-/* 09-30-2020 Chaoqiong Xiao Modified comment(s), */
-/* resulting in version 6.1 */
+/* controller driver routines. */
+/* */
+/* INPUT */
+/* */
+/* HCD Pointer to HCD */
+/* function Function for driver to perform*/
+/* parameter Pointer to parameter(s) */
+/* */
+/* OUTPUT */
+/* */
+/* Completion Status */
+/* */
+/* CALLS */
+/* */
+/* _ux_hcd_ohci_asynchronous_endpoint_create Create async endpoint */
+/* _ux_hcd_ohci_asynchronous_endpoint_destroy Destroy async endpoint */
+/* _ux_hcd_ohci_controller_disable Disable controller */
+/* _ux_hcd_ohci_done_queue_process Process done queue */
+/* _ux_hcd_ohci_endpoint_reset Reset endpoint */
+/* _ux_hcd_ohci_frame_number_get Get frame number */
+/* _ux_hcd_ohci_frame_number_set Set frame number */
+/* _ux_hcd_ohci_interrupt_endpoint_create Create interrupt endpoint*/
+/* _ux_hcd_ohci_isochronous_endpoint_create Create isoch endpoint */
+/* _ux_hcd_ohci_periodic_endpoint_destroy Destroy periodic endpoint*/
+/* _ux_hcd_ohci_port_enable Enable port */
+/* _ux_hcd_ohci_port_disable Disable port */
+/* _ux_hcd_ohci_port_reset Reset port */
+/* _ux_hcd_ohci_port_resume Resume port */
+/* _ux_hcd_ohci_port_status_get Get port status */
+/* _ux_hcd_ohci_port_suspend Suspend port */
+/* _ux_hcd_ohci_power_down_port Power down port */
+/* _ux_hcd_ohci_power_on_port Power on port */
+/* _ux_hcd_ohci_request_transfer Request transfer */
+/* _ux_hcd_ohci_transfer_abort Abort transfer */
+/* */
+/* CALLED BY */
+/* */
+/* Host Stack */
/* */
/**************************************************************************/
UINT _ux_hcd_ohci_entry(UX_HCD *hcd, UINT function, VOID *parameter)
@@ -95,7 +88,7 @@ UINT _ux_hcd_ohci_entry(UX_HCD *hcd, UINT function, VOID *parameter)
UINT status;
UX_HCD_OHCI *hcd_ohci;
-
+
/* Check the status of the controller. */
if (hcd -> ux_hcd_status == UX_UNUSED)
@@ -109,7 +102,7 @@ UX_HCD_OHCI *hcd_ohci;
return(UX_CONTROLLER_UNKNOWN);
}
-
+
/* Get the pointer to the OHCI HCD. */
hcd_ohci = (UX_HCD_OHCI *) hcd -> ux_hcd_controller_hardware;
@@ -207,15 +200,15 @@ UX_HCD_OHCI *hcd_ohci;
status = _ux_hcd_ohci_asynchronous_endpoint_create(hcd_ohci, (UX_ENDPOINT*) parameter);
break;
-
+
case UX_INTERRUPT_ENDPOINT:
-
+
status = _ux_hcd_ohci_interrupt_endpoint_create(hcd_ohci, (UX_ENDPOINT*) parameter);
break;
case UX_ISOCHRONOUS_ENDPOINT:
-
+
status = _ux_hcd_ohci_isochronous_endpoint_create(hcd_ohci, (UX_ENDPOINT*) parameter);
break;
@@ -224,7 +217,7 @@ UX_HCD_OHCI *hcd_ohci;
case UX_HCD_DESTROY_ENDPOINT:
-
+
switch ((((UX_ENDPOINT*) parameter) -> ux_endpoint_descriptor.bmAttributes) & UX_MASK_ENDPOINT_TYPE)
{
@@ -236,7 +229,7 @@ UX_HCD_OHCI *hcd_ohci;
case UX_INTERRUPT_ENDPOINT:
case UX_ISOCHRONOUS_ENDPOINT:
-
+
status = _ux_hcd_ohci_periodic_endpoint_destroy(hcd_ohci, (UX_ENDPOINT*) parameter);
break;
@@ -245,13 +238,13 @@ UX_HCD_OHCI *hcd_ohci;
case UX_HCD_RESET_ENDPOINT:
-
+
status = _ux_hcd_ohci_endpoint_reset(hcd_ohci, (UX_ENDPOINT*) parameter);
break;
case UX_HCD_PROCESS_DONE_QUEUE:
-
+
_ux_hcd_ohci_done_queue_process(hcd_ohci);
status = UX_SUCCESS;
break;
@@ -267,8 +260,8 @@ UX_HCD_OHCI *hcd_ohci;
/* Set status to not supported. */
status = UX_FUNCTION_NOT_SUPPORTED;
- }
-
+ }
+
/* Return completion status. */
return(status);
}
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 192527d1..1296acb2 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
@@ -1,18 +1,19 @@
/***************************************************************************
- * Copyright (c) 2024 Microsoft Corporation
- *
+ * Copyright (c) 2024 Microsoft Corporation
+ * Copyright (c) 2026-present Eclipse ThreadX contributors
+ *
* This program and the accompanying materials are made available under the
* terms of the MIT License which is available at
* https://opensource.org/licenses/MIT.
- *
+ *
* SPDX-License-Identifier: MIT
**************************************************************************/
/**************************************************************************/
/**************************************************************************/
-/** */
-/** USBX Component */
+/** */
+/** USBX Component */
/** */
/** OHCI Controller Driver */
/** */
@@ -29,47 +30,39 @@
#include "ux_host_stack.h"
-/**************************************************************************/
-/* */
-/* FUNCTION RELEASE */
-/* */
-/* _ux_hcd_ohci_frame_number_get PORTABLE C */
+/**************************************************************************/
+/* */
+/* FUNCTION RELEASE */
+/* */
+/* _ux_hcd_ohci_frame_number_get PORTABLE C */
/* 6.1 */
/* AUTHOR */
/* */
/* Chaoqiong Xiao, Microsoft Corporation */
/* */
/* DESCRIPTION */
-/* */
+/* */
/* This function will return the frame number currently used by the */
/* controller. This function is mostly used for isochronous purposes. */
-/* It is easier to read the frame number off the HCCA structure */
-/* because this can be done without going back to the controller. */
-/* */
-/* INPUT */
-/* */
-/* hcd_ohci Pointer to OHCI controller */
-/* frame_number Pointer to frame number */
-/* */
-/* OUTPUT */
-/* */
-/* None */
-/* */
-/* CALLS */
-/* */
-/* None */
-/* */
-/* CALLED BY */
-/* */
-/* OHCI Controller Driver */
-/* */
-/* RELEASE HISTORY */
-/* */
-/* DATE NAME DESCRIPTION */
-/* */
-/* 05-19-2020 Chaoqiong Xiao Initial Version 6.0 */
-/* 09-30-2020 Chaoqiong Xiao Modified comment(s), */
-/* resulting in version 6.1 */
+/* It is easier to read the frame number off the HCCA structure */
+/* because this can be done without going back to the controller. */
+/* */
+/* INPUT */
+/* */
+/* hcd_ohci Pointer to OHCI controller */
+/* frame_number Pointer to frame number */
+/* */
+/* OUTPUT */
+/* */
+/* None */
+/* */
+/* CALLS */
+/* */
+/* None */
+/* */
+/* CALLED BY */
+/* */
+/* OHCI Controller Driver */
/* */
/**************************************************************************/
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 fdd8cdcf..58626cb3 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
@@ -1,18 +1,19 @@
/***************************************************************************
- * Copyright (c) 2024 Microsoft Corporation
- *
+ * Copyright (c) 2024 Microsoft Corporation
+ * Copyright (c) 2026-present Eclipse ThreadX contributors
+ *
* This program and the accompanying materials are made available under the
* terms of the MIT License which is available at
* https://opensource.org/licenses/MIT.
- *
+ *
* SPDX-License-Identifier: MIT
**************************************************************************/
/**************************************************************************/
/**************************************************************************/
-/** */
-/** USBX Component */
+/** */
+/** USBX Component */
/** */
/** OHCI Controller Driver */
/** */
@@ -29,47 +30,39 @@
#include "ux_host_stack.h"
-/**************************************************************************/
-/* */
-/* FUNCTION RELEASE */
-/* */
-/* _ux_hcd_ohci_frame_number_set PORTABLE C */
+/**************************************************************************/
+/* */
+/* FUNCTION RELEASE */
+/* */
+/* _ux_hcd_ohci_frame_number_set PORTABLE C */
/* 6.1 */
/* AUTHOR */
/* */
/* Chaoqiong Xiao, Microsoft Corporation */
/* */
/* DESCRIPTION */
-/* */
-/* This function will set the current frame number to the one */
+/* */
+/* This function will set the current frame number to the one */
/* specified. This function is mostly used for isochronous purposes. */
-/* Here we need to write to the host controller which in turn will */
-/* update the HCCA at the end of the frame. */
-/* */
-/* INPUT */
-/* */
-/* hcd_ohci Pointer to OHCI controller */
-/* frame_number Frame number to set */
-/* */
-/* OUTPUT */
-/* */
-/* None */
-/* */
-/* CALLS */
-/* */
-/* _ux_hcd_ohci_register_write Write OHCI register */
-/* */
-/* CALLED BY */
-/* */
-/* OHCI Controller Driver */
-/* */
-/* RELEASE HISTORY */
-/* */
-/* DATE NAME DESCRIPTION */
-/* */
-/* 05-19-2020 Chaoqiong Xiao Initial Version 6.0 */
-/* 09-30-2020 Chaoqiong Xiao Modified comment(s), */
-/* resulting in version 6.1 */
+/* Here we need to write to the host controller which in turn will */
+/* update the HCCA at the end of the frame. */
+/* */
+/* INPUT */
+/* */
+/* hcd_ohci Pointer to OHCI controller */
+/* frame_number Frame number to set */
+/* */
+/* OUTPUT */
+/* */
+/* None */
+/* */
+/* CALLS */
+/* */
+/* _ux_hcd_ohci_register_write Write OHCI register */
+/* */
+/* CALLED BY */
+/* */
+/* OHCI Controller Driver */
/* */
/**************************************************************************/
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 eed315fa..b7c9a584 100644
--- a/common/usbx_host_controllers/src/ux_hcd_ohci_initialize.c
+++ b/common/usbx_host_controllers/src/ux_hcd_ohci_initialize.c
@@ -1,18 +1,19 @@
/***************************************************************************
- * Copyright (c) 2024 Microsoft Corporation
- *
+ * Copyright (c) 2024 Microsoft Corporation
+ * Copyright (c) 2026-present Eclipse ThreadX contributors
+ *
* This program and the accompanying materials are made available under the
* terms of the MIT License which is available at
* https://opensource.org/licenses/MIT.
- *
+ *
* SPDX-License-Identifier: MIT
**************************************************************************/
/**************************************************************************/
/**************************************************************************/
-/** */
-/** USBX Component */
+/** */
+/** USBX Component */
/** */
/** OHCI Controller Driver */
/** */
@@ -29,64 +30,45 @@
#include "ux_host_stack.h"
-/**************************************************************************/
-/* */
-/* FUNCTION RELEASE */
-/* */
-/* _ux_hcd_ohci_initialize PORTABLE C */
+/**************************************************************************/
+/* */
+/* FUNCTION RELEASE */
+/* */
+/* _ux_hcd_ohci_initialize PORTABLE C */
/* 6.1.12 */
/* AUTHOR */
/* */
/* Chaoqiong Xiao, Microsoft Corporation */
/* */
/* DESCRIPTION */
-/* */
-/* This function initializes the OHCI controller. It sets the dma */
-/* areas, programs all the OHCI registers, setup the ED and TD */
-/* containers, sets the control, and builds the periodic lists. */
-/* */
-/* INPUT */
-/* */
-/* HCD Pointer to HCD */
-/* */
-/* OUTPUT */
-/* */
-/* Completion Status */
-/* */
-/* CALLS */
-/* */
-/* _ux_hcd_ohci_periodic_tree_create Create OHCI periodic tree */
-/* _ux_hcd_ohci_power_root_hubs Power root HUBs */
-/* _ux_hcd_ohci_register_read Read OHCI register */
-/* _ux_hcd_ohci_register_write Write OHCI register */
-/* _ux_utility_memory_allocate Allocate memory block */
-/* _ux_host_mutex_on Get mutex protection */
-/* _ux_host_mutex_off Release mutex protection */
-/* _ux_utility_physical_address Get physical address */
-/* _ux_utility_set_interrupt_handler Setup interrupt handler */
-/* */
-/* CALLED BY */
-/* */
-/* Host Stack */
-/* */
-/* 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 */
-/* 01-31-2022 Xiuwen Cai Modified comment(s), */
-/* fixed HcPeriodicStart value,*/
-/* resulting in version 6.1.10 */
-/* 04-25-2022 Chaoqiong Xiao Modified comment(s), */
-/* fixed standalone compile, */
-/* resulting in version 6.1.11 */
-/* 07-29-2022 Yajun Xia Modified comment(s), */
-/* fixed OHCI PRSC issue, */
-/* resulting in version 6.1.12 */
+/* */
+/* This function initializes the OHCI controller. It sets the dma */
+/* areas, programs all the OHCI registers, setup the ED and TD */
+/* containers, sets the control, and builds the periodic lists. */
+/* */
+/* INPUT */
+/* */
+/* HCD Pointer to HCD */
+/* */
+/* OUTPUT */
+/* */
+/* Completion Status */
+/* */
+/* CALLS */
+/* */
+/* _ux_hcd_ohci_periodic_tree_create Create OHCI periodic tree */
+/* _ux_hcd_ohci_power_root_hubs Power root HUBs */
+/* _ux_hcd_ohci_register_read Read OHCI register */
+/* _ux_hcd_ohci_register_write Write OHCI register */
+/* _ux_utility_memory_allocate Allocate memory block */
+/* _ux_host_mutex_on Get mutex protection */
+/* _ux_host_mutex_off Release mutex protection */
+/* _ux_utility_physical_address Get physical address */
+/* _ux_utility_set_interrupt_handler Setup interrupt handler */
+/* */
+/* CALLED BY */
+/* */
+/* Host Stack */
/* */
/**************************************************************************/
UINT _ux_hcd_ohci_initialize(UX_HCD *hcd)
@@ -102,7 +84,7 @@ UINT status;
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
+ /* 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
@@ -155,7 +137,7 @@ UINT status;
#if UX_MAX_DEVICES > 1
- /* Read the OHCI controller version, it is either USB 1.0 or 1.1. This is important for
+ /* 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
@@ -164,7 +146,7 @@ UINT status;
This is not compulsory but some controllers demand to start in this state. */
_ux_hcd_ohci_register_write(hcd_ohci, OHCI_HC_CONTROL, 0);
- /* The following is time critical. If we get interrupted here, the controller will go in
+ /* The following is time critical. If we get interrupted here, the controller will go in
suspend mode. Get the protection mutex. */
_ux_host_mutex_on(&_ux_system -> ux_system_mutex);
@@ -178,8 +160,8 @@ UINT status;
ohci_register = _ux_hcd_ohci_register_read(hcd_ohci, OHCI_HC_COMMAND_STATUS);
if ((ohci_register & OHCI_HC_CS_HCR) == 0)
break;
- }
-
+ }
+
/* Check if the controller is reset properly. */
if ((ohci_register & OHCI_HC_CS_HCR) != 0)
{
@@ -195,7 +177,7 @@ UINT status;
return(UX_CONTROLLER_INIT_FAILED);
}
-
+
/* Set the HCCA pointer to the HCOR. */
_ux_hcd_ohci_register_write(hcd_ohci, OHCI_HC_HCCA, (ULONG) _ux_utility_physical_address(hcd_ohci -> ux_hcd_ohci_hcca));
@@ -204,20 +186,20 @@ UINT status;
_ux_hcd_ohci_register_write(hcd_ohci, OHCI_HC_CONTROL_CURRENT_ED, 0);
_ux_hcd_ohci_register_write(hcd_ohci, OHCI_HC_BULK_HEAD_ED, 0);
_ux_hcd_ohci_register_write(hcd_ohci, OHCI_HC_BULK_CURRENT_ED, 0);
-
- /* Turn on the OHCI controller functional registers we will use after this operation,
+
+ /* Turn on the OHCI controller functional registers we will use after this operation,
the controller is operational. */
_ux_hcd_ohci_register_write(hcd_ohci, OHCI_HC_CONTROL, OHCI_HC_CONTROL_VALUE);
hcd -> ux_hcd_status = UX_HCD_STATUS_OPERATIONAL;
- /* We can safely release the mutex protection. */
+ /* We can safely release the mutex protection. */
_ux_host_mutex_off(&_ux_system -> ux_system_mutex);
/* Set the controller interval. */
ohci_register = _ux_hcd_ohci_register_read(hcd_ohci, OHCI_HC_FM_INTERVAL) & OHCI_HC_FM_INTERVAL_CLEAR;
ohci_register |= OHCI_HC_FM_INTERVAL_SET;
_ux_hcd_ohci_register_write(hcd_ohci, OHCI_HC_FM_INTERVAL, ohci_register);
-
+
/* Set HcPeriodicStart to a value that is 90% of the value in FrameInterval field of the HcFmInterval register. */
ohci_register = _ux_hcd_ohci_register_read(hcd_ohci, OHCI_HC_FM_INTERVAL) & OHCI_HC_FM_INTERVAL_FI_MASK;
_ux_hcd_ohci_register_write(hcd_ohci, OHCI_HC_PERIODIC_START, ohci_register * 9 / 10);
@@ -225,8 +207,8 @@ UINT status;
/* Reset all the OHCI interrupts and re-enable only the ones we will use. */
_ux_hcd_ohci_register_write(hcd_ohci, OHCI_HC_INTERRUPT_DISABLE, OHCI_HC_INTERRUPT_DISABLE_ALL);
_ux_hcd_ohci_register_write(hcd_ohci, OHCI_HC_INTERRUPT_ENABLE, OHCI_HC_INTERRUPT_ENABLE_NORMAL);
-
- /* Get the number of ports on the controller. The number of ports needs to be reflected both
+
+ /* Get the number of ports on the controller. The number of ports needs to be reflected both
for the generic HCD container and the local 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);
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 21a86093..a2fd5cdc 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
@@ -1,18 +1,19 @@
/***************************************************************************
- * Copyright (c) 2024 Microsoft Corporation
- *
+ * Copyright (c) 2024 Microsoft Corporation
+ * Copyright (c) 2026-present Eclipse ThreadX contributors
+ *
* This program and the accompanying materials are made available under the
* terms of the MIT License which is available at
* https://opensource.org/licenses/MIT.
- *
+ *
* SPDX-License-Identifier: MIT
**************************************************************************/
/**************************************************************************/
/**************************************************************************/
-/** */
-/** USBX Component */
+/** */
+/** USBX Component */
/** */
/** OHCI Controller Driver */
/** */
@@ -29,20 +30,20 @@
#include "ux_host_stack.h"
-/**************************************************************************/
-/* */
-/* FUNCTION RELEASE */
-/* */
-/* _ux_hcd_ohci_interrupt_endpoint_create PORTABLE C */
+/**************************************************************************/
+/* */
+/* FUNCTION RELEASE */
+/* */
+/* _ux_hcd_ohci_interrupt_endpoint_create PORTABLE C */
/* 6.1.6 */
/* AUTHOR */
/* */
/* Chaoqiong Xiao, Microsoft Corporation */
/* */
/* DESCRIPTION */
-/* */
-/* This function will create an interrupt endpoint. The interrupt */
-/* endpoint has an interval of operation from 1 to 255. In OHCI, the */
+/* */
+/* This function will create an interrupt endpoint. The interrupt */
+/* endpoint has an interval of operation from 1 to 255. In OHCI, the */
/* hardware assisted interrupt is from 1 to 32. */
/* */
/* This routine will match the best interval for the OHCI hardware. */
@@ -51,48 +52,35 @@
/* */
/* For the ones curious about this coding. The tricky part is to */
/* understand how the interrupt matrix is constructed. We have used */
-/* eds with the skip bit on to build a frame of anchor eds. Each ED */
-/* creates a node for an appropriate combination of interval */
+/* eds with the skip bit on to build a frame of anchor eds. Each ED */
+/* creates a node for an appropriate combination of interval */
/* frequency in the list. */
/* */
/* After obtaining a pointer to the list with the lowest traffic, we */
-/* traverse the list from the highest interval until we reach the */
-/* interval required. At that node, we anchor our real ED to the node */
-/* and link the ED that was attached to the node to our ED. */
-/* */
-/* INPUT */
-/* */
-/* hcd_ohci Pointer to OHCI */
-/* endpoint Pointer to endpoint */
-/* */
-/* OUTPUT */
-/* */
-/* Completion Status */
-/* */
-/* CALLS */
-/* */
-/* _ux_hcd_ohci_ed_obtain Obtain OHCI ED */
-/* _ux_hcd_ohci_least_traffic_list_get Get least traffic list */
-/* _ux_hcd_ohci_regular_td_obtain Obtain OHCI regular TD */
-/* _ux_utility_physical_address Get physical address */
-/* _ux_utility_virtual_address Get virtual address */
-/* */
-/* CALLED BY */
-/* */
-/* OHCI Controller Driver */
-/* */
-/* RELEASE HISTORY */
-/* */
-/* DATE NAME DESCRIPTION */
-/* */
-/* 05-19-2020 Chaoqiong Xiao Initial Version 6.0 */
-/* 09-30-2020 Chaoqiong Xiao Modified comment(s), */
-/* fixed physical and virtual */
-/* address conversion, */
-/* resulting in version 6.1 */
-/* 04-02-2021 Chaoqiong Xiao Modified comment(s), */
-/* filled max transfer length, */
-/* resulting in version 6.1.6 */
+/* traverse the list from the highest interval until we reach the */
+/* interval required. At that node, we anchor our real ED to the node */
+/* and link the ED that was attached to the node to our ED. */
+/* */
+/* INPUT */
+/* */
+/* hcd_ohci Pointer to OHCI */
+/* endpoint Pointer to endpoint */
+/* */
+/* OUTPUT */
+/* */
+/* Completion Status */
+/* */
+/* CALLS */
+/* */
+/* _ux_hcd_ohci_ed_obtain Obtain OHCI ED */
+/* _ux_hcd_ohci_least_traffic_list_get Get least traffic list */
+/* _ux_hcd_ohci_regular_td_obtain Obtain OHCI regular TD */
+/* _ux_utility_physical_address Get physical address */
+/* _ux_utility_virtual_address Get virtual address */
+/* */
+/* CALLED BY */
+/* */
+/* OHCI Controller Driver */
/* */
/**************************************************************************/
UINT _ux_hcd_ohci_interrupt_endpoint_create(UX_HCD_OHCI *hcd_ohci, UX_ENDPOINT *endpoint)
@@ -108,7 +96,7 @@ UINT interval_index;
UINT interval_ohci;
- /* Obtain a ED for this new endpoint. This ED will live as long as the endpoint
+ /* Obtain a ED for this new endpoint. This ED will live as long as the endpoint
is active and will be the container for the tds. */
ed = _ux_hcd_ohci_ed_obtain(hcd_ohci);
if (ed == UX_NULL)
@@ -118,7 +106,7 @@ UINT interval_ohci;
td = _ux_hcd_ohci_regular_td_obtain(hcd_ohci);
if (td == UX_NULL)
{
-
+
ed -> ux_ohci_ed_status = UX_UNUSED;
return(UX_NO_TD_AVAILABLE);
}
@@ -131,27 +119,27 @@ UINT interval_ohci;
endpoint -> ux_endpoint_transfer_request.ux_transfer_request_maximum_length = UX_OHCI_MAX_PAYLOAD;
/* Program the ED for subsequent transfers we need to set the following things:
- 1) Address of the device
- 2) endpoint number
+ 1) Address of the device
+ 2) endpoint number
3) speed
- 4) format of TD
+ 4) format of TD
5) maximum packet size */
device = endpoint -> ux_endpoint_device;
ed -> ux_ohci_ed_dw0 = device -> ux_device_address |
((ULONG) (endpoint -> ux_endpoint_descriptor.bEndpointAddress & ~UX_ENDPOINT_DIRECTION)) << 7 |
((ULONG) endpoint -> ux_endpoint_descriptor.wMaxPacketSize) << 16;
-
+
if (device -> ux_device_speed == UX_LOW_SPEED_DEVICE)
ed -> ux_ohci_ed_dw0 |= UX_OHCI_ED_LOW_SPEED;
-
+
/* Hook the TD to both the tail and head of the ED. */
ed -> ux_ohci_ed_tail_td = _ux_utility_physical_address(td);
ed -> ux_ohci_ed_head_td = _ux_utility_physical_address(td);
/* Get the list index with the least traffic. */
ed_list = _ux_hcd_ohci_least_traffic_list_get(hcd_ohci);
-
- /* Get the interval for the endpoint and match it to a OHCI list. We match anything that
+
+ /* Get the interval for the endpoint and match it to a OHCI list. We match anything that
is > 32ms to the 32ms interval list. The 32ms list is list 0, 16ms list is 1 ...
the 1ms list is number 5. */
interval = endpoint -> ux_endpoint_descriptor.bInterval;
@@ -181,17 +169,17 @@ UINT interval_ohci;
/* When we find the first bit of the interval the current value of interval_ohci is set to the the list index. */
if (interval & interval_index)
break;
-
+
/* Go down the tree one entry. */
interval_ohci++;
-
+
/* And shift the bit of the device interval to check. */
interval_index = interval_index >> 1;
}
}
- /* Now we need to scan the list of eds from the lowest load entry until we reach the
- appropriate interval node. The depth index is the interval OHCI value and the 1st
+ /* Now we need to scan the list of eds from the lowest load entry until we reach the
+ appropriate interval node. The depth index is the interval OHCI value and the 1st
entry is pointed by the ED list entry. */
while (interval_ohci--)
{
@@ -199,9 +187,9 @@ UINT interval_ohci;
ed_list = _ux_utility_virtual_address(ed_list -> ux_ohci_ed_next_ed);
while (!(ed_list -> ux_ohci_ed_dw0 & UX_OHCI_ED_SKIP))
ed_list = _ux_utility_virtual_address(ed_list -> ux_ohci_ed_next_ed);
- }
-
- /* We found the node entry of the ED pointer that will be the anchor for this interrupt
+ }
+
+ /* We found the node entry of the ED pointer that will be the anchor for this interrupt
endpoint. Now we attach this endpoint to the anchor and rebuild the chain. */
next_ed = ed_list -> ux_ohci_ed_next_ed;
@@ -217,6 +205,6 @@ UINT interval_ohci;
ed_list -> ux_ohci_ed_next_ed = _ux_utility_physical_address(ed);
/* Return successful completion. */
- return(UX_SUCCESS);
+ return(UX_SUCCESS);
}
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 bad77621..cf07e760 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
@@ -1,18 +1,19 @@
/***************************************************************************
- * Copyright (c) 2024 Microsoft Corporation
- *
+ * Copyright (c) 2024 Microsoft Corporation
+ * Copyright (c) 2026-present Eclipse ThreadX contributors
+ *
* This program and the accompanying materials are made available under the
* terms of the MIT License which is available at
* https://opensource.org/licenses/MIT.
- *
+ *
* SPDX-License-Identifier: MIT
**************************************************************************/
/**************************************************************************/
/**************************************************************************/
-/** */
-/** USBX Component */
+/** */
+/** USBX Component */
/** */
/** OHCI Controller Driver */
/** */
@@ -29,59 +30,45 @@
#include "ux_host_stack.h"
-/**************************************************************************/
-/* */
-/* FUNCTION RELEASE */
-/* */
-/* _ux_hcd_ohci_interrupt_handler PORTABLE C */
+/**************************************************************************/
+/* */
+/* FUNCTION RELEASE */
+/* */
+/* _ux_hcd_ohci_interrupt_handler PORTABLE C */
/* 6.1.12 */
/* AUTHOR */
/* */
/* Chaoqiong Xiao, Microsoft Corporation */
/* */
/* DESCRIPTION */
-/* */
+/* */
/* This function is the interrupt handler for the OHCI interrupts. */
-/* Normally an interrupt occurs from the controller when there is */
-/* either a EOF signal and there has been transfers within the frame */
+/* Normally an interrupt occurs from the controller when there is */
+/* either a EOF signal and there has been transfers within the frame */
/* or when there is a change on one of the downstream ports. */
/* */
-/* All we need to do in the ISR is scan the controllers to find out */
-/* which one has issued a IRQ. If there is work to do for this */
-/* controller we need to wake up the corresponding thread to take */
-/* care of the job. */
-/* */
-/* INPUT */
-/* */
-/* None */
-/* */
-/* OUTPUT */
-/* */
-/* None */
-/* */
-/* CALLS */
-/* */
-/* _ux_hcd_ohci_register_read Read OHCI register */
-/* _ux_hcd_ohci_register_write Write OHCI register */
-/* _ux_host_semaphore_put Put semaphore */
-/* */
-/* CALLED BY */
-/* */
-/* ThreadX Interrupt Handler */
-/* */
-/* RELEASE HISTORY */
-/* */
-/* DATE NAME DESCRIPTION */
-/* */
-/* 05-19-2020 Chaoqiong Xiao Initial Version 6.0 */
-/* 09-30-2020 Chaoqiong Xiao Modified comment(s), */
-/* resulting in version 6.1 */
-/* 01-31-2022 Chaoqiong Xiao Modified comment(s), */
-/* refined macros names, */
-/* resulting in version 6.1.10 */
-/* 07-29-2022 Yajun Xia Modified comment(s), */
-/* fixed OHCI PRSC issue, */
-/* resulting in version 6.1.12 */
+/* All we need to do in the ISR is scan the controllers to find out */
+/* which one has issued a IRQ. If there is work to do for this */
+/* controller we need to wake up the corresponding thread to take */
+/* care of the job. */
+/* */
+/* INPUT */
+/* */
+/* None */
+/* */
+/* OUTPUT */
+/* */
+/* None */
+/* */
+/* CALLS */
+/* */
+/* _ux_hcd_ohci_register_read Read OHCI register */
+/* _ux_hcd_ohci_register_write Write OHCI register */
+/* _ux_host_semaphore_put Put semaphore */
+/* */
+/* CALLED BY */
+/* */
+/* ThreadX Interrupt Handler */
/* */
/**************************************************************************/
VOID _ux_hcd_ohci_interrupt_handler(VOID)
@@ -96,7 +83,7 @@ ULONG root_hub_thread_wakeup = 0;
ULONG port_index;
- /* We need to parse the controller driver table to find all controllers that
+ /* We need to parse the controller driver table to find all controllers that
registered as OHCI. */
for (hcd_index = 0; hcd_index < _ux_system_host -> ux_system_host_registered_hcd; hcd_index++)
{
@@ -120,10 +107,10 @@ ULONG port_index;
if (ohci_register & OHCI_HC_INT_WDH)
{
- /* We have some transferred EDs in the done queue. The controller thread needs
+ /* We have some transferred EDs in the done queue. The controller thread needs
to wake up and process them. */
hcd_ohci -> ux_hcd_ohci_done_head = hcd_ohci -> ux_hcd_ohci_hcca -> ux_hcd_ohci_hcca_done_head;
- hcd_ohci -> ux_hcd_ohci_hcca -> ux_hcd_ohci_hcca_done_head = UX_NULL;
+ hcd_ohci -> ux_hcd_ohci_hcca -> ux_hcd_ohci_hcca_done_head = UX_NULL;
hcd -> ux_hcd_thread_signal++;
_ux_host_semaphore_put(&_ux_system_host -> ux_system_host_hcd_semaphore);
@@ -133,11 +120,11 @@ ULONG port_index;
before we acknowledge the IRQ register. */
_ux_hcd_ohci_register_write(hcd_ohci, OHCI_HC_INTERRUPT_DISABLE, OHCI_HC_INT_WDH);
}
-
+
if (ohci_register & OHCI_HC_INT_UE)
{
- /* The controller has issued a Unrecoverable Error signal. The controller will
+ /* The controller has issued a Unrecoverable Error signal. The controller will
be reset now, and we wake up the HCD thread. */
_ux_hcd_ohci_register_write(hcd_ohci, OHCI_HC_COMMAND_STATUS, OHCI_HC_CS_HCR);
hcd -> ux_hcd_thread_signal++;
@@ -155,17 +142,17 @@ ULONG port_index;
/* Read the port status. */
ohci_register_port_status = _ux_hcd_ohci_register_read(hcd_ohci, OHCI_HC_RH_PORT_STATUS + port_index);
-
+
/* Check for Connect Status Change signal. */
if (ohci_register_port_status & OHCI_HC_PS_CSC)
- {
+ {
/* Something happened on this port. Signal it to the root hub thread. */
hcd -> ux_hcd_root_hub_signal[port_index]++;
-
+
/* Memorize wake up signal. */
root_hub_thread_wakeup ++;
}
-
+
if (ohci_register_port_status & OHCI_HC_PS_PRSC)
{
_ux_host_event_flags_set(&hcd_ohci -> ux_hcd_ohci_event_flags_group, UX_OHCI_PRSC_EVENT, UX_OR);
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 20389559..f6ec193c 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
@@ -1,18 +1,19 @@
/***************************************************************************
- * Copyright (c) 2024 Microsoft Corporation
- *
+ * Copyright (c) 2024 Microsoft Corporation
+ * Copyright (c) 2026-present Eclipse ThreadX contributors
+ *
* This program and the accompanying materials are made available under the
* terms of the MIT License which is available at
* https://opensource.org/licenses/MIT.
- *
+ *
* SPDX-License-Identifier: MIT
**************************************************************************/
/**************************************************************************/
/**************************************************************************/
-/** */
-/** USBX Component */
+/** */
+/** USBX Component */
/** */
/** OHCI Controller Driver */
/** */
@@ -29,50 +30,39 @@
#include "ux_host_stack.h"
-/**************************************************************************/
-/* */
-/* FUNCTION RELEASE */
-/* */
-/* _ux_hcd_ohci_isochronous_endpoint_create PORTABLE C */
+/**************************************************************************/
+/* */
+/* FUNCTION RELEASE */
+/* */
+/* _ux_hcd_ohci_isochronous_endpoint_create PORTABLE C */
/* 6.1.6 */
/* AUTHOR */
/* */
/* Chaoqiong Xiao, Microsoft Corporation */
/* */
/* DESCRIPTION */
-/* */
-/* This function creates an isochronous endpoint. */
-/* */
-/* INPUT */
-/* */
-/* hcd_ohci Pointer to OHCI */
-/* endpoint Pointer to endpoint */
-/* */
-/* OUTPUT */
-/* */
-/* Completion Status */
-/* */
-/* CALLS */
-/* */
-/* _ux_hcd_ohci_ed_obtain Obtain an OHCI ED */
-/* _ux_hcd_ohci_isochronous_td_obtain Obtain an OHCI TD */
-/* _ux_utility_physical_address Get physical address */
-/* _ux_utility_virtual_address Get virtual address */
-/* */
-/* CALLED BY */
-/* */
-/* OHCI Controller Driver */
-/* */
-/* RELEASE HISTORY */
-/* */
-/* DATE NAME DESCRIPTION */
-/* */
-/* 05-19-2020 Chaoqiong Xiao Initial Version 6.0 */
-/* 09-30-2020 Chaoqiong Xiao Modified comment(s), */
-/* resulting in version 6.1 */
-/* 04-02-2021 Chaoqiong Xiao Modified comment(s), */
-/* filled max transfer length, */
-/* resulting in version 6.1.6 */
+/* */
+/* This function creates an isochronous endpoint. */
+/* */
+/* INPUT */
+/* */
+/* hcd_ohci Pointer to OHCI */
+/* endpoint Pointer to endpoint */
+/* */
+/* OUTPUT */
+/* */
+/* Completion Status */
+/* */
+/* CALLS */
+/* */
+/* _ux_hcd_ohci_ed_obtain Obtain an OHCI ED */
+/* _ux_hcd_ohci_isochronous_td_obtain Obtain an OHCI TD */
+/* _ux_utility_physical_address Get physical address */
+/* _ux_utility_virtual_address Get virtual address */
+/* */
+/* CALLED BY */
+/* */
+/* OHCI Controller Driver */
/* */
/**************************************************************************/
UINT _ux_hcd_ohci_isochronous_endpoint_create(UX_HCD_OHCI *hcd_ohci, UX_ENDPOINT *endpoint)
@@ -87,7 +77,7 @@ UX_OHCI_ISO_TD *td;
/* Get the pointer to the HCCA. */
ohci_hcca = hcd_ohci -> ux_hcd_ohci_hcca;
-
+
/* Obtain a ED for this new endpoint. This ED will live as long as
the endpoint is active and will be the container for the tds. */
ed = _ux_hcd_ohci_ed_obtain(hcd_ohci);
@@ -111,17 +101,17 @@ UX_OHCI_ISO_TD *td;
endpoint -> ux_endpoint_descriptor.wMaxPacketSize;
/* Program the ED for subsequent transfers we need to set the following things:
- 1) Address of the device
- 2) endpoint number
+ 1) Address of the device
+ 2) endpoint number
3) speed (always full speed for iso)
- 4) format of TD
+ 4) format of TD
5) maximum packet size */
-
+
device = endpoint -> ux_endpoint_device;
- ed -> ux_ohci_ed_dw0 = device -> ux_device_address | UX_OHCI_ED_ISOCHRONOUS |
+ ed -> ux_ohci_ed_dw0 = device -> ux_device_address | UX_OHCI_ED_ISOCHRONOUS |
((ULONG) (endpoint -> ux_endpoint_descriptor.bEndpointAddress & ~UX_ENDPOINT_DIRECTION)) << 7 |
((ULONG) (endpoint -> ux_endpoint_descriptor.wMaxPacketSize)) << 16;
-
+
/* Hook the TD to both the tail and head of the ED. */
ed -> ux_ohci_ed_tail_td = _ux_utility_physical_address(td);
ed -> ux_ohci_ed_head_td = _ux_utility_physical_address(td);
@@ -134,8 +124,8 @@ UX_OHCI_ISO_TD *td;
/* Now ed_list, points to the last ED, which is in the 1ms entry. */
ed -> ux_ohci_ed_previous_ed = ed_list;
ed_list -> ux_ohci_ed_next_ed = _ux_utility_physical_address(ed);
-
+
/* Return success. */
- return(UX_SUCCESS);
+ return(UX_SUCCESS);
}
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 9077167c..eebda8f1 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
@@ -1,18 +1,19 @@
/***************************************************************************
- * Copyright (c) 2024 Microsoft Corporation
- *
+ * Copyright (c) 2024 Microsoft Corporation
+ * Copyright (c) 2026-present Eclipse ThreadX contributors
+ *
* This program and the accompanying materials are made available under the
* terms of the MIT License which is available at
* https://opensource.org/licenses/MIT.
- *
+ *
* SPDX-License-Identifier: MIT
**************************************************************************/
/**************************************************************************/
/**************************************************************************/
-/** */
-/** USBX Component */
+/** */
+/** USBX Component */
/** */
/** OHCI Controller Driver */
/** */
@@ -29,45 +30,35 @@
#include "ux_host_stack.h"
-/**************************************************************************/
-/* */
-/* FUNCTION RELEASE */
-/* */
-/* _ux_hcd_ohci_isochronous_td_obtain PORTABLE C */
+/**************************************************************************/
+/* */
+/* FUNCTION RELEASE */
+/* */
+/* _ux_hcd_ohci_isochronous_td_obtain PORTABLE C */
/* 6.1 */
/* AUTHOR */
/* */
/* Chaoqiong Xiao, Microsoft Corporation */
/* */
/* DESCRIPTION */
-/* */
-/* This function obtains a free TD from the isochronous TD list. */
-/* */
-/* INPUT */
-/* */
-/* hcd_ohci Pointer to OHCI */
-/* */
-/* OUTPUT */
-/* */
-/* UX_OHCI_ISO_TD * Pointer to OHCI TD */
-/* */
-/* CALLS */
-/* */
-/* _ux_utility_memory_set Set memory block */
-/* */
-/* CALLED BY */
-/* */
-/* OHCI Controller Driver */
-/* */
-/* RELEASE HISTORY */
-/* */
-/* DATE NAME DESCRIPTION */
-/* */
-/* 05-19-2020 Chaoqiong Xiao Initial Version 6.0 */
-/* 09-30-2020 Chaoqiong Xiao Modified comment(s), */
-/* verified memset and memcpy */
-/* cases, */
-/* resulting in version 6.1 */
+/* */
+/* This function obtains a free TD from the isochronous TD list. */
+/* */
+/* INPUT */
+/* */
+/* hcd_ohci Pointer to OHCI */
+/* */
+/* OUTPUT */
+/* */
+/* UX_OHCI_ISO_TD * Pointer to OHCI TD */
+/* */
+/* CALLS */
+/* */
+/* _ux_utility_memory_set Set memory block */
+/* */
+/* CALLED BY */
+/* */
+/* OHCI Controller Driver */
/* */
/**************************************************************************/
UX_OHCI_ISO_TD *_ux_hcd_ohci_isochronous_td_obtain(UX_HCD_OHCI *hcd_ohci)
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 9964bc4c..b52f7b90 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
@@ -1,18 +1,19 @@
/***************************************************************************
- * Copyright (c) 2024 Microsoft Corporation
- *
+ * Copyright (c) 2024 Microsoft Corporation
+ * Copyright (c) 2026-present Eclipse ThreadX contributors
+ *
* This program and the accompanying materials are made available under the
* terms of the MIT License which is available at
* https://opensource.org/licenses/MIT.
- *
+ *
* SPDX-License-Identifier: MIT
**************************************************************************/
/**************************************************************************/
/**************************************************************************/
-/** */
-/** USBX Component */
+/** */
+/** USBX Component */
/** */
/** OHCI Controller Driver */
/** */
@@ -29,44 +30,36 @@
#include "ux_host_stack.h"
-/**************************************************************************/
-/* */
-/* FUNCTION RELEASE */
-/* */
-/* _ux_hcd_ohci_least_traffic_list_get PORTABLE C */
+/**************************************************************************/
+/* */
+/* FUNCTION RELEASE */
+/* */
+/* _ux_hcd_ohci_least_traffic_list_get PORTABLE C */
/* 6.1 */
/* AUTHOR */
/* */
/* Chaoqiong Xiao, Microsoft Corporation */
/* */
/* DESCRIPTION */
-/* */
-/* This function return a pointer to the first ED in the periodic */
-/* tree that has the least traffic registered. */
-/* */
-/* INPUT */
-/* */
-/* hcd_ohci Pointer to OHCI */
-/* */
-/* OUTPUT */
-/* */
-/* UX_OHCI_ED * Pointer to OHCI ED */
-/* */
-/* CALLS */
-/* */
-/* _ux_utility_virtual_address Get virtual address */
-/* */
-/* CALLED BY */
-/* */
-/* OHCI Controller Driver */
-/* */
-/* RELEASE HISTORY */
-/* */
-/* DATE NAME DESCRIPTION */
-/* */
-/* 05-19-2020 Chaoqiong Xiao Initial Version 6.0 */
-/* 09-30-2020 Chaoqiong Xiao Modified comment(s), */
-/* resulting in version 6.1 */
+/* */
+/* This function return a pointer to the first ED in the periodic */
+/* tree that has the least traffic registered. */
+/* */
+/* INPUT */
+/* */
+/* hcd_ohci Pointer to OHCI */
+/* */
+/* OUTPUT */
+/* */
+/* UX_OHCI_ED * Pointer to OHCI ED */
+/* */
+/* CALLS */
+/* */
+/* _ux_utility_virtual_address Get virtual address */
+/* */
+/* CALLED BY */
+/* */
+/* OHCI Controller Driver */
/* */
/**************************************************************************/
UX_OHCI_ED *_ux_hcd_ohci_least_traffic_list_get(UX_HCD_OHCI *hcd_ohci)
@@ -83,13 +76,13 @@ ULONG bandwidth_used;
/* Get the pointer to the HCCA. */
ohci_hcca = hcd_ohci -> ux_hcd_ohci_hcca;
-
+
/* Set the min bandwidth used to a arbitrary maximum value. */
min_bandwidth_used = 0xffffffff;
/* The first ED is the list candidate for now. */
min_bandwidth_ed = _ux_utility_virtual_address(ohci_hcca -> ux_hcd_ohci_hcca_ed[0]);
-
+
/* All list will be scanned. */
for (list_index = 0; list_index < 32; list_index++)
{
@@ -110,25 +103,25 @@ ULONG bandwidth_used;
/* Add to the bandwidth used the max packet size pointed by this ED. */
bandwidth_used += (ed -> ux_ohci_ed_dw0 >> 16) & UX_OHCI_ED_MPS;
- /* Next ED. */
+ /* Next ED. */
ed = _ux_utility_virtual_address(ed -> ux_ohci_ed_next_ed);
}
/* We have processed a list, check the bandwidth used by this list.
- If this bandwidth is the minimum, we memorize the ED. */
+ If this bandwidth is the minimum, we memorize the ED. */
if (bandwidth_used < min_bandwidth_used)
{
- /* We have found a better list with a lower used bandwidth,
+ /* We have found a better list with a lower used bandwidth,
memorize the bandwidth for this list. */
min_bandwidth_used = bandwidth_used;
-
+
/* Memorize the begin ED for this list. */
min_bandwidth_ed = begin_ed;
}
}
-
+
/* Return the ED list with the lowest bandwidth. */
- return(min_bandwidth_ed);
+ return(min_bandwidth_ed);
}
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 4f64562a..7c74c2c5 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
@@ -1,18 +1,19 @@
/***************************************************************************
- * Copyright (c) 2024 Microsoft Corporation
- *
+ * Copyright (c) 2024 Microsoft Corporation
+ * Copyright (c) 2026-present Eclipse ThreadX contributors
+ *
* This program and the accompanying materials are made available under the
* terms of the MIT License which is available at
* https://opensource.org/licenses/MIT.
- *
+ *
* SPDX-License-Identifier: MIT
**************************************************************************/
/**************************************************************************/
/**************************************************************************/
-/** */
-/** USBX Component */
+/** */
+/** USBX Component */
/** */
/** OHCI Controller Driver */
/** */
@@ -29,47 +30,37 @@
#include "ux_host_stack.h"
-/**************************************************************************/
-/* */
-/* FUNCTION RELEASE */
-/* */
-/* _ux_hcd_ohci_next_td_clean PORTABLE C */
+/**************************************************************************/
+/* */
+/* FUNCTION RELEASE */
+/* */
+/* _ux_hcd_ohci_next_td_clean PORTABLE C */
/* 6.1 */
/* AUTHOR */
/* */
/* Chaoqiong Xiao, Microsoft Corporation */
/* */
/* DESCRIPTION */
-/* */
-/* This function cleans all the tds attached to a ED. The end of the */
-/* TD chain is pointed by the tail TD. */
-/* */
-/* INPUT */
-/* */
-/* td Pointer to OHCI TD */
-/* */
-/* OUTPUT */
-/* */
-/* None */
-/* */
-/* CALLS */
-/* */
-/* _ux_utility_physical_address Get physical address */
-/* _ux_utility_virtual_address Get virtual address */
-/* */
-/* CALLED BY */
-/* */
-/* OHCI Controller Driver */
-/* */
-/* RELEASE HISTORY */
-/* */
-/* DATE NAME DESCRIPTION */
-/* */
-/* 05-19-2020 Chaoqiong Xiao Initial Version 6.0 */
-/* 09-30-2020 Chaoqiong Xiao Modified comment(s), */
-/* fixed physical and virtual */
-/* address conversion, */
-/* resulting in version 6.1 */
+/* */
+/* This function cleans all the tds attached to a ED. The end of the */
+/* TD chain is pointed by the tail TD. */
+/* */
+/* INPUT */
+/* */
+/* td Pointer to OHCI TD */
+/* */
+/* OUTPUT */
+/* */
+/* None */
+/* */
+/* CALLS */
+/* */
+/* _ux_utility_physical_address Get physical address */
+/* _ux_utility_virtual_address Get virtual address */
+/* */
+/* CALLED BY */
+/* */
+/* OHCI Controller Driver */
/* */
/**************************************************************************/
VOID _ux_hcd_ohci_next_td_clean(UX_OHCI_TD *td)
@@ -110,7 +101,7 @@ ULONG value_carry;
head_td = _ux_utility_virtual_address(ed -> ux_ohci_ed_head_td);
}
- /* Restore the value carry for next transfers. */
+ /* Restore the value carry for next transfers. */
value_td = (ULONG) ed -> ux_ohci_ed_head_td;
value_td |= value_carry;
ed -> ux_ohci_ed_head_td = (UX_OHCI_TD *) value_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 8e5d8017..0db3963b 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
@@ -1,18 +1,19 @@
/***************************************************************************
- * Copyright (c) 2024 Microsoft Corporation
- *
+ * Copyright (c) 2024 Microsoft Corporation
+ * Copyright (c) 2026-present Eclipse ThreadX contributors
+ *
* This program and the accompanying materials are made available under the
* terms of the MIT License which is available at
* https://opensource.org/licenses/MIT.
- *
+ *
* SPDX-License-Identifier: MIT
**************************************************************************/
/**************************************************************************/
/**************************************************************************/
-/** */
-/** USBX Component */
+/** */
+/** USBX Component */
/** */
/** OHCI Controller Driver */
/** */
@@ -29,49 +30,36 @@
#include "ux_hcd_ohci.h"
-/**************************************************************************/
-/* */
-/* FUNCTION RELEASE */
-/* */
-/* _ux_hcd_ohci_periodic_endpoint_destroy PORTABLE C */
+/**************************************************************************/
+/* */
+/* FUNCTION RELEASE */
+/* */
+/* _ux_hcd_ohci_periodic_endpoint_destroy PORTABLE C */
/* 6.1.2 */
/* AUTHOR */
/* */
/* Chaoqiong Xiao, Microsoft Corporation */
/* */
/* DESCRIPTION */
-/* */
-/* This function will destroy an interrupt or isochronous endpoint. */
-/* */
-/* INPUT */
-/* */
-/* hcd_ohci Pointer to OHCI controller */
-/* endpoint Pointer to endpoint */
-/* */
-/* OUTPUT */
-/* */
-/* Completion Status */
-/* */
-/* CALLS */
-/* */
-/* _ux_utility_delay_ms Delay ms */
-/* */
-/* CALLED BY */
-/* */
-/* OHCI Controller Driver */
-/* */
-/* RELEASE HISTORY */
-/* */
-/* DATE NAME DESCRIPTION */
-/* */
-/* 05-19-2020 Chaoqiong Xiao Initial Version 6.0 */
-/* 09-30-2020 Chaoqiong Xiao Modified comment(s), */
-/* fixed physical and virtual */
-/* address conversion, */
-/* resulting in version 6.1 */
-/* 11-09-2020 Chaoqiong Xiao Modified comment(s), */
-/* fixed compile warnings, */
-/* resulting in version 6.1.2 */
+/* */
+/* This function will destroy an interrupt or isochronous endpoint. */
+/* */
+/* INPUT */
+/* */
+/* hcd_ohci Pointer to OHCI controller */
+/* endpoint Pointer to endpoint */
+/* */
+/* OUTPUT */
+/* */
+/* Completion Status */
+/* */
+/* CALLS */
+/* */
+/* _ux_utility_delay_ms Delay ms */
+/* */
+/* CALLED BY */
+/* */
+/* OHCI Controller Driver */
/* */
/**************************************************************************/
UINT _ux_hcd_ohci_periodic_endpoint_destroy(UX_HCD_OHCI *hcd_ohci, UX_ENDPOINT *endpoint)
@@ -93,7 +81,7 @@ ULONG value_td;
/* Check if this physical endpoint has been initialized properly! */
if (ed == UX_NULL)
{
-
+
/* Error trap. */
_ux_system_error_handler(UX_SYSTEM_LEVEL_THREAD, UX_SYSTEM_CONTEXT_HCD, UX_ENDPOINT_HANDLE_UNKNOWN);
@@ -102,10 +90,10 @@ ULONG value_td;
return(UX_ENDPOINT_HANDLE_UNKNOWN);
}
-
+
/* The endpoint may be active. If so, set the skip bit. */
ed -> ux_ohci_ed_dw0 |= UX_OHCI_ED_SKIP;
-
+
/* Wait for the controller to finish the current frame processing. */
_ux_utility_delay_ms(1);
@@ -157,6 +145,6 @@ ULONG value_td;
ed -> ux_ohci_ed_status = UX_UNUSED;
/* Return success. */
- return(UX_SUCCESS);
+ return(UX_SUCCESS);
}
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 b34f76cd..5022129a 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
@@ -1,18 +1,19 @@
/***************************************************************************
- * Copyright (c) 2024 Microsoft Corporation
- *
+ * Copyright (c) 2024 Microsoft Corporation
+ * Copyright (c) 2026-present Eclipse ThreadX contributors
+ *
* This program and the accompanying materials are made available under the
* terms of the MIT License which is available at
* https://opensource.org/licenses/MIT.
- *
+ *
* SPDX-License-Identifier: MIT
**************************************************************************/
/**************************************************************************/
/**************************************************************************/
-/** */
-/** USBX Component */
+/** */
+/** USBX Component */
/** */
/** OHCI Controller Driver */
/** */
@@ -29,45 +30,37 @@
#include "ux_host_stack.h"
-/**************************************************************************/
-/* */
-/* FUNCTION RELEASE */
-/* */
-/* _ux_hcd_ohci_periodic_tree_create PORTABLE C */
+/**************************************************************************/
+/* */
+/* FUNCTION RELEASE */
+/* */
+/* _ux_hcd_ohci_periodic_tree_create PORTABLE C */
/* 6.1 */
/* AUTHOR */
/* */
/* Chaoqiong Xiao, Microsoft Corporation */
/* */
/* DESCRIPTION */
-/* */
-/* This function creates the periodic static tree for the interrupt */
-/* and isochronous eds. */
-/* */
-/* INPUT */
-/* */
-/* hcd_ohci Pointer to OHCI controller */
-/* */
-/* OUTPUT */
-/* */
-/* Completion Status */
-/* */
-/* CALLS */
-/* */
-/* _ux_hcd_ohci_ed_obtain Obtain an ED */
-/* _ux_utility_physical_address Get physical address */
-/* */
-/* CALLED BY */
-/* */
-/* OHCI Controller Driver */
-/* */
-/* RELEASE HISTORY */
-/* */
-/* DATE NAME DESCRIPTION */
-/* */
-/* 05-19-2020 Chaoqiong Xiao Initial Version 6.0 */
-/* 09-30-2020 Chaoqiong Xiao Modified comment(s), */
-/* resulting in version 6.1 */
+/* */
+/* This function creates the periodic static tree for the interrupt */
+/* and isochronous eds. */
+/* */
+/* INPUT */
+/* */
+/* hcd_ohci Pointer to OHCI controller */
+/* */
+/* OUTPUT */
+/* */
+/* Completion Status */
+/* */
+/* CALLS */
+/* */
+/* _ux_hcd_ohci_ed_obtain Obtain an ED */
+/* _ux_utility_physical_address Get physical address */
+/* */
+/* CALLED BY */
+/* */
+/* OHCI Controller Driver */
/* */
/**************************************************************************/
UINT _ux_hcd_ohci_periodic_tree_create(UX_HCD_OHCI *hcd_ohci)
@@ -80,12 +73,12 @@ UINT list_entries;
UINT current_list_entry;
UX_OHCI_ED *ed_list[32];
UX_OHCI_ED *ed_start_list[32];
-
-
+
+
/* We need the pointer to the HCCA. It contains the pointer to the first
32 periodic entries. */
ohci_hcca = hcd_ohci -> ux_hcd_ohci_hcca;
-
+
/* Start with the 1st list - it has 32 entries. */
list_entries = 32;
@@ -131,10 +124,10 @@ UX_OHCI_ED *ed_start_list[32];
}
/* The tree has been completed but the entries in the HCCA are in the wrong order.
- We need to swap each entry according to the OHCI specified entry order list
- so that we have a fair interval frequency for each periodic ED. The primary eds
- are fetched from the start list, translated into physical addresses and stored
- into the HCCA. */
+ We need to swap each entry according to the OHCI specified entry order list
+ so that we have a fair interval frequency for each periodic ED. The primary eds
+ are fetched from the start list, translated into physical addresses and stored
+ into the HCCA. */
for (current_list_entry = 0; current_list_entry < 32; current_list_entry++)
{
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 093220b5..1f2a3f0a 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
@@ -1,18 +1,19 @@
/***************************************************************************
- * Copyright (c) 2024 Microsoft Corporation
- *
+ * Copyright (c) 2024 Microsoft Corporation
+ * Copyright (c) 2026-present Eclipse ThreadX contributors
+ *
* This program and the accompanying materials are made available under the
* terms of the MIT License which is available at
* https://opensource.org/licenses/MIT.
- *
+ *
* SPDX-License-Identifier: MIT
**************************************************************************/
/**************************************************************************/
/**************************************************************************/
-/** */
-/** USBX Component */
+/** */
+/** USBX Component */
/** */
/** OHCI Controller Driver */
/** */
@@ -29,46 +30,38 @@
#include "ux_host_stack.h"
-/**************************************************************************/
-/* */
-/* FUNCTION RELEASE */
-/* */
-/* _ux_hcd_ohci_port_disable PORTABLE C */
+/**************************************************************************/
+/* */
+/* FUNCTION RELEASE */
+/* */
+/* _ux_hcd_ohci_port_disable PORTABLE C */
/* 6.1 */
/* AUTHOR */
/* */
/* Chaoqiong Xiao, Microsoft Corporation */
/* */
/* DESCRIPTION */
-/* */
-/* This function will disable a specific port attached to the root */
-/* HUB. */
-/* */
-/* INPUT */
-/* */
-/* hcd_ohci Pointer to OHCI controller */
-/* port_index Port index */
-/* */
-/* OUTPUT */
-/* */
-/* Completion Status */
-/* */
-/* CALLS */
-/* */
-/* _ux_hcd_ohci_register_read OHCI register read */
-/* _ux_hcd_ohci_register_write OHCI register write */
-/* */
-/* CALLED BY */
-/* */
-/* OHCI Controller Driver */
-/* */
-/* RELEASE HISTORY */
-/* */
-/* DATE NAME DESCRIPTION */
-/* */
-/* 05-19-2020 Chaoqiong Xiao Initial Version 6.0 */
-/* 09-30-2020 Chaoqiong Xiao Modified comment(s), */
-/* resulting in version 6.1 */
+/* */
+/* This function will disable a specific port attached to the root */
+/* HUB. */
+/* */
+/* INPUT */
+/* */
+/* hcd_ohci Pointer to OHCI controller */
+/* port_index Port index */
+/* */
+/* OUTPUT */
+/* */
+/* Completion Status */
+/* */
+/* CALLS */
+/* */
+/* _ux_hcd_ohci_register_read OHCI register read */
+/* _ux_hcd_ohci_register_write OHCI register write */
+/* */
+/* CALLED BY */
+/* */
+/* OHCI Controller Driver */
/* */
/**************************************************************************/
UINT _ux_hcd_ohci_port_disable(UX_HCD_OHCI *hcd_ohci, ULONG port_index)
@@ -89,7 +82,7 @@ ULONG ohci_register_port_status;
return(UX_PORT_INDEX_UNKNOWN);
}
-
+
/* Read the port status for this port. */
ohci_register_port_status = _ux_hcd_ohci_register_read(hcd_ohci, OHCI_HC_RH_PORT_STATUS + 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 0a0ca080..61556dca 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
@@ -1,18 +1,19 @@
/***************************************************************************
- * Copyright (c) 2024 Microsoft Corporation
- *
+ * Copyright (c) 2024 Microsoft Corporation
+ * Copyright (c) 2026-present Eclipse ThreadX contributors
+ *
* This program and the accompanying materials are made available under the
* terms of the MIT License which is available at
* https://opensource.org/licenses/MIT.
- *
+ *
* SPDX-License-Identifier: MIT
**************************************************************************/
/**************************************************************************/
/**************************************************************************/
-/** */
-/** USBX Component */
+/** */
+/** USBX Component */
/** */
/** OHCI Controller Driver */
/** */
@@ -29,47 +30,39 @@
#include "ux_host_stack.h"
-/**************************************************************************/
-/* */
-/* FUNCTION RELEASE */
-/* */
-/* _ux_hcd_ohci_port_enable PORTABLE C */
+/**************************************************************************/
+/* */
+/* FUNCTION RELEASE */
+/* */
+/* _ux_hcd_ohci_port_enable PORTABLE C */
/* 6.1 */
/* AUTHOR */
/* */
/* Chaoqiong Xiao, Microsoft Corporation */
/* */
/* DESCRIPTION */
-/* */
-/* This function will enable a specific port attached to the root */
-/* HUB. */
-/* */
-/* INPUT */
-/* */
-/* hcd_ohci Pointer to OHCI controller */
-/* port_index Port index */
-/* */
-/* OUTPUT */
-/* */
-/* Completion Status */
-/* */
-/* CALLS */
-/* */
-/* _ux_hcd_ohci_register_read OHCI register read */
-/* _ux_hcd_ohci_register_write OHCI register write */
-/* _ux_utility_delay_ms Delay */
-/* */
-/* CALLED BY */
-/* */
-/* OHCI Controller Driver */
-/* */
-/* RELEASE HISTORY */
-/* */
-/* DATE NAME DESCRIPTION */
-/* */
-/* 05-19-2020 Chaoqiong Xiao Initial Version 6.0 */
-/* 09-30-2020 Chaoqiong Xiao Modified comment(s), */
-/* resulting in version 6.1 */
+/* */
+/* This function will enable a specific port attached to the root */
+/* HUB. */
+/* */
+/* INPUT */
+/* */
+/* hcd_ohci Pointer to OHCI controller */
+/* port_index Port index */
+/* */
+/* OUTPUT */
+/* */
+/* Completion Status */
+/* */
+/* CALLS */
+/* */
+/* _ux_hcd_ohci_register_read OHCI register read */
+/* _ux_hcd_ohci_register_write OHCI register write */
+/* _ux_utility_delay_ms Delay */
+/* */
+/* CALLED BY */
+/* */
+/* OHCI Controller Driver */
/* */
/**************************************************************************/
UINT _ux_hcd_ohci_port_enable(UX_HCD_OHCI *hcd_ohci, ULONG port_index)
@@ -90,15 +83,15 @@ ULONG ohci_register_port_status;
return(UX_PORT_INDEX_UNKNOWN);
}
-
+
/* Ensure that the downstream port has a device attached. It is unnatural
to perform a port enable if there is no device. */
ohci_register_port_status = _ux_hcd_ohci_register_read(hcd_ohci, OHCI_HC_RH_PORT_STATUS + port_index);
-
+
/* Check Device Connection Status. */
if ((ohci_register_port_status & OHCI_HC_PS_CCS) == 0)
{
-
+
/* Error trap. */
_ux_system_error_handler(UX_SYSTEM_LEVEL_THREAD, UX_SYSTEM_CONTEXT_HCD, UX_NO_DEVICE_CONNECTED);
@@ -107,14 +100,14 @@ ULONG ohci_register_port_status;
return(UX_NO_DEVICE_CONNECTED);
}
-
+
/* Wait 50ms before we issue the command, otherwise some device do not answer! */
_ux_utility_delay_ms(UX_PORT_ENABLE_WAIT);
/* Write the command PES to this port. */
_ux_hcd_ohci_register_write(hcd_ohci, OHCI_HC_RH_PORT_STATUS + port_index, OHCI_HC_PS_PES);
- /* Return successful completion. */
+ /* Return successful completion. */
return(UX_SUCCESS);
}
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 e5344773..c6c54d41 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
@@ -1,18 +1,19 @@
/***************************************************************************
- * Copyright (c) 2024 Microsoft Corporation
- *
+ * Copyright (c) 2024 Microsoft Corporation
+ * Copyright (c) 2026-present Eclipse ThreadX contributors
+ *
* This program and the accompanying materials are made available under the
* terms of the MIT License which is available at
* https://opensource.org/licenses/MIT.
- *
+ *
* SPDX-License-Identifier: MIT
**************************************************************************/
/**************************************************************************/
/**************************************************************************/
-/** */
-/** USBX Component */
+/** */
+/** USBX Component */
/** */
/** OHCI Controller Driver */
/** */
@@ -29,49 +30,38 @@
#include "ux_host_stack.h"
-/**************************************************************************/
-/* */
-/* FUNCTION RELEASE */
-/* */
-/* _ux_hcd_ohci_port_reset PORTABLE C */
+/**************************************************************************/
+/* */
+/* FUNCTION RELEASE */
+/* */
+/* _ux_hcd_ohci_port_reset PORTABLE C */
/* 6.1.12 */
/* AUTHOR */
/* */
/* Chaoqiong Xiao, Microsoft Corporation */
/* */
/* DESCRIPTION */
-/* */
-/* This function will reset a specific port attached to the root HUB. */
-/* */
-/* INPUT */
-/* */
-/* hcd_ohci Pointer to OHCI controller */
-/* port_index Port index */
-/* */
-/* OUTPUT */
-/* */
-/* Completion Status */
-/* */
-/* CALLS */
-/* */
-/* _ux_hcd_ohci_register_read OHCI register read */
-/* _ux_hcd_ohci_register_write OHCI register write */
-/* _ux_utility_delay_ms Delay */
-/* */
-/* CALLED BY */
-/* */
-/* OHCI Controller Driver */
-/* */
-/* RELEASE HISTORY */
-/* */
-/* DATE NAME DESCRIPTION */
-/* */
-/* 05-19-2020 Chaoqiong Xiao Initial Version 6.0 */
-/* 09-30-2020 Chaoqiong Xiao Modified comment(s), */
-/* resulting in version 6.1 */
-/* 07-29-2022 Yajun Xia Modified comment(s), */
-/* fixed OHCI PRSC issue, */
-/* resulting in version 6.1.12 */
+/* */
+/* This function will reset a specific port attached to the root HUB. */
+/* */
+/* INPUT */
+/* */
+/* hcd_ohci Pointer to OHCI controller */
+/* port_index Port index */
+/* */
+/* OUTPUT */
+/* */
+/* Completion Status */
+/* */
+/* CALLS */
+/* */
+/* _ux_hcd_ohci_register_read OHCI register read */
+/* _ux_hcd_ohci_register_write OHCI register write */
+/* _ux_utility_delay_ms Delay */
+/* */
+/* CALLED BY */
+/* */
+/* OHCI Controller Driver */
/* */
/**************************************************************************/
UINT _ux_hcd_ohci_port_reset(UX_HCD_OHCI *hcd_ohci, ULONG port_index)
@@ -93,15 +83,15 @@ ULONG actual_flags = 0;
return(UX_PORT_INDEX_UNKNOWN);
}
-
+
/* Ensure that the downstream port has a device attached. It is unnatural
to perform a port reset if there is no device. */
ohci_register_port_status = _ux_hcd_ohci_register_read(hcd_ohci, OHCI_HC_RH_PORT_STATUS + port_index);
-
+
/* Check Device Connection Status. */
if ((ohci_register_port_status & OHCI_HC_PS_CCS) == 0)
{
-
+
/* Error trap. */
_ux_system_error_handler(UX_SYSTEM_LEVEL_THREAD, UX_SYSTEM_CONTEXT_HCD, UX_NO_DEVICE_CONNECTED);
@@ -110,7 +100,7 @@ ULONG actual_flags = 0;
return(UX_NO_DEVICE_CONNECTED);
}
-
+
/* Now we can safely issue a RESET command to this port. */
_ux_hcd_ohci_register_write(hcd_ohci, OHCI_HC_RH_PORT_STATUS + port_index, OHCI_HC_PS_PRS);
@@ -126,6 +116,6 @@ ULONG actual_flags = 0;
UX_TRACE_IN_LINE_INSERT(UX_TRACE_ERROR, UX_PORT_RESET_FAILED, port_index, 0, 0, UX_TRACE_ERRORS, 0, 0)
/* The reset failed! Inform the root HUB driver. This should not really happen in a 1.x controller. */
- return(UX_PORT_RESET_FAILED);
+ return(UX_PORT_RESET_FAILED);
}
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 c7e049a1..29af7549 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
@@ -1,18 +1,19 @@
/***************************************************************************
- * Copyright (c) 2024 Microsoft Corporation
- *
+ * Copyright (c) 2024 Microsoft Corporation
+ * Copyright (c) 2026-present Eclipse ThreadX contributors
+ *
* This program and the accompanying materials are made available under the
* terms of the MIT License which is available at
* https://opensource.org/licenses/MIT.
- *
+ *
* SPDX-License-Identifier: MIT
**************************************************************************/
/**************************************************************************/
/**************************************************************************/
-/** */
-/** USBX Component */
+/** */
+/** USBX Component */
/** */
/** OHCI Controller Driver */
/** */
@@ -29,48 +30,37 @@
#include "ux_host_stack.h"
-/**************************************************************************/
-/* */
-/* FUNCTION RELEASE */
-/* */
-/* _ux_hcd_ohci_port_resume PORTABLE C */
+/**************************************************************************/
+/* */
+/* FUNCTION RELEASE */
+/* */
+/* _ux_hcd_ohci_port_resume PORTABLE C */
/* 6.1.2 */
/* AUTHOR */
/* */
/* Chaoqiong Xiao, Microsoft Corporation */
/* */
/* DESCRIPTION */
-/* */
-/* This function will resume a specific port attached to the root */
-/* HUB. */
-/* */
-/* INPUT */
-/* */
-/* hcd_ohci Pointer to OHCI controller */
-/* port_index Port index */
-/* */
-/* OUTPUT */
-/* */
-/* Completion Status */
-/* */
-/* CALLS */
-/* */
-/* None */
-/* */
-/* CALLED BY */
-/* */
-/* OHCI Controller Driver */
-/* */
-/* RELEASE HISTORY */
-/* */
-/* DATE NAME DESCRIPTION */
-/* */
-/* 05-19-2020 Chaoqiong Xiao Initial Version 6.0 */
-/* 09-30-2020 Chaoqiong Xiao Modified comment(s), */
-/* resulting in version 6.1 */
-/* 11-09-2020 Chaoqiong Xiao Modified comment(s), */
-/* fixed compile warnings, */
-/* resulting in version 6.1.2 */
+/* */
+/* This function will resume a specific port attached to the root */
+/* HUB. */
+/* */
+/* INPUT */
+/* */
+/* hcd_ohci Pointer to OHCI controller */
+/* port_index Port index */
+/* */
+/* OUTPUT */
+/* */
+/* Completion Status */
+/* */
+/* CALLS */
+/* */
+/* None */
+/* */
+/* CALLED BY */
+/* */
+/* OHCI Controller Driver */
/* */
/**************************************************************************/
UINT _ux_hcd_ohci_port_resume(UX_HCD_OHCI *hcd_ohci, UINT port_index)
@@ -78,6 +68,6 @@ UINT _ux_hcd_ohci_port_resume(UX_HCD_OHCI *hcd_ohci, UINT port_index)
UX_PARAMETER_NOT_USED(hcd_ohci);
UX_PARAMETER_NOT_USED(port_index);
- return(UX_FUNCTION_NOT_SUPPORTED);
+ return(UX_FUNCTION_NOT_SUPPORTED);
}
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 287da738..a60bc1c1 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
@@ -1,18 +1,19 @@
/***************************************************************************
- * Copyright (c) 2024 Microsoft Corporation
- *
+ * Copyright (c) 2024 Microsoft Corporation
+ * Copyright (c) 2026-present Eclipse ThreadX contributors
+ *
* This program and the accompanying materials are made available under the
* terms of the MIT License which is available at
* https://opensource.org/licenses/MIT.
- *
+ *
* SPDX-License-Identifier: MIT
**************************************************************************/
/**************************************************************************/
/**************************************************************************/
-/** */
-/** USBX Component */
+/** */
+/** USBX Component */
/** */
/** OHCI Controller Driver */
/** */
@@ -29,32 +30,32 @@
#include "ux_host_stack.h"
-/**************************************************************************/
-/* */
-/* FUNCTION RELEASE */
-/* */
-/* _ux_hcd_ohci_port_status_get PORTABLE C */
+/**************************************************************************/
+/* */
+/* FUNCTION RELEASE */
+/* */
+/* _ux_hcd_ohci_port_status_get PORTABLE C */
/* 6.1 */
/* AUTHOR */
/* */
/* Chaoqiong Xiao, Microsoft Corporation */
/* */
/* DESCRIPTION */
-/* */
+/* */
/* This function will return the status for each port attached to the */
-/* root HUB. */
-/* */
-/* INPUT */
-/* */
-/* hcd_ohci Pointer to OHCI controller */
-/* port_index Port index */
-/* */
-/* OUTPUT */
-/* */
-/* port_status */
-/* */
+/* root HUB. */
+/* */
+/* INPUT */
+/* */
+/* hcd_ohci Pointer to OHCI controller */
+/* port_index Port index */
+/* */
+/* OUTPUT */
+/* */
+/* port_status */
+/* */
/* Status of the root HUB port with the following format: */
-/* */
+/* */
/* bit 0 device connection status */
/* if 0 : no device connected */
/* if 1 : device connected to the port */
@@ -77,22 +78,14 @@
/* if 00 : low speed device attached */
/* if 01 : full speed device attached */
/* if 10 : high speed device attached */
-/* */
-/* CALLS */
-/* */
-/* _ux_hcd_ohci_register_read Read OHCI register */
-/* */
-/* CALLED BY */
-/* */
-/* OHCI Controller Driver */
-/* */
-/* RELEASE HISTORY */
-/* */
-/* DATE NAME DESCRIPTION */
-/* */
-/* 05-19-2020 Chaoqiong Xiao Initial Version 6.0 */
-/* 09-30-2020 Chaoqiong Xiao Modified comment(s), */
-/* resulting in version 6.1 */
+/* */
+/* CALLS */
+/* */
+/* _ux_hcd_ohci_register_read Read OHCI register */
+/* */
+/* CALLED BY */
+/* */
+/* OHCI Controller Driver */
/* */
/**************************************************************************/
ULONG _ux_hcd_ohci_port_status_get(UX_HCD_OHCI *hcd_ohci, ULONG port_index)
@@ -114,16 +107,16 @@ ULONG port_status;
return(UX_PORT_INDEX_UNKNOWN);
}
-
+
/* The port is valid, build the status mask for this port. This function
returns a controller agnostic bit field. */
port_status = 0;
ohci_register_port_status = _ux_hcd_ohci_register_read(hcd_ohci, OHCI_HC_RH_PORT_STATUS + port_index);
-
+
/* Device Connection Status. */
if (ohci_register_port_status & OHCI_HC_PS_CCS)
port_status |= UX_PS_CCS;
-
+
/* Port Enable Status */
if (ohci_register_port_status & OHCI_HC_PS_PES)
port_status |= UX_PS_PES;
@@ -144,7 +137,7 @@ ULONG port_status;
if (ohci_register_port_status & OHCI_HC_PS_PPS)
port_status |= UX_PS_PPS;
- /* Port Device Attached speed. This field is valid only if the CCS bit is active.
+ /* Port Device Attached speed. This field is valid only if the CCS bit is active.
On OHCI, only low speed or full speed are available. */
if (ohci_register_port_status & OHCI_HC_PS_CCS)
{
@@ -156,6 +149,6 @@ ULONG port_status;
}
/* Return port status. */
- return(port_status);
+ return(port_status);
}
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 f2cd6ca2..8e28d108 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
@@ -1,18 +1,19 @@
/***************************************************************************
- * Copyright (c) 2024 Microsoft Corporation
- *
+ * Copyright (c) 2024 Microsoft Corporation
+ * Copyright (c) 2026-present Eclipse ThreadX contributors
+ *
* This program and the accompanying materials are made available under the
* terms of the MIT License which is available at
* https://opensource.org/licenses/MIT.
- *
+ *
* SPDX-License-Identifier: MIT
**************************************************************************/
/**************************************************************************/
/**************************************************************************/
-/** */
-/** USBX Component */
+/** */
+/** USBX Component */
/** */
/** OHCI Controller Driver */
/** */
@@ -29,48 +30,37 @@
#include "ux_host_stack.h"
-/**************************************************************************/
-/* */
-/* FUNCTION RELEASE */
-/* */
-/* _ux_hcd_ohci_port_suspend PORTABLE C */
+/**************************************************************************/
+/* */
+/* FUNCTION RELEASE */
+/* */
+/* _ux_hcd_ohci_port_suspend PORTABLE C */
/* 6.1.2 */
/* AUTHOR */
/* */
/* Chaoqiong Xiao, Microsoft Corporation */
/* */
/* DESCRIPTION */
-/* */
-/* This function will suspend a specific port attached to the root */
-/* HUB. */
-/* */
-/* INPUT */
-/* */
-/* hcd_ohci Pointer to OHCI controller */
-/* port_index Port index */
-/* */
-/* OUTPUT */
-/* */
-/* None */
-/* */
-/* CALLS */
-/* */
-/* None */
-/* */
-/* CALLED BY */
-/* */
-/* OHCI Controller Driver */
-/* */
-/* RELEASE HISTORY */
-/* */
-/* DATE NAME DESCRIPTION */
-/* */
-/* 05-19-2020 Chaoqiong Xiao Initial Version 6.0 */
-/* 09-30-2020 Chaoqiong Xiao Modified comment(s), */
-/* resulting in version 6.1 */
-/* 11-09-2020 Chaoqiong Xiao Modified comment(s), */
-/* fixed compile warnings, */
-/* resulting in version 6.1.2 */
+/* */
+/* This function will suspend a specific port attached to the root */
+/* HUB. */
+/* */
+/* INPUT */
+/* */
+/* hcd_ohci Pointer to OHCI controller */
+/* port_index Port index */
+/* */
+/* OUTPUT */
+/* */
+/* None */
+/* */
+/* CALLS */
+/* */
+/* None */
+/* */
+/* CALLED BY */
+/* */
+/* OHCI Controller Driver */
/* */
/**************************************************************************/
UINT _ux_hcd_ohci_port_suspend(UX_HCD_OHCI *hcd_ohci, ULONG port_index)
@@ -78,6 +68,6 @@ UINT _ux_hcd_ohci_port_suspend(UX_HCD_OHCI *hcd_ohci, ULONG port_index)
UX_PARAMETER_NOT_USED(hcd_ohci);
UX_PARAMETER_NOT_USED(port_index);
- return(UX_FUNCTION_NOT_SUPPORTED);
+ return(UX_FUNCTION_NOT_SUPPORTED);
}
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 3c65d9ce..8c0ee17a 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
@@ -1,18 +1,19 @@
/***************************************************************************
- * Copyright (c) 2024 Microsoft Corporation
- *
+ * Copyright (c) 2024 Microsoft Corporation
+ * Copyright (c) 2026-present Eclipse ThreadX contributors
+ *
* This program and the accompanying materials are made available under the
* terms of the MIT License which is available at
* https://opensource.org/licenses/MIT.
- *
+ *
* SPDX-License-Identifier: MIT
**************************************************************************/
/**************************************************************************/
/**************************************************************************/
-/** */
-/** USBX Component */
+/** */
+/** USBX Component */
/** */
/** OHCI Controller Driver */
/** */
@@ -29,48 +30,37 @@
#include "ux_host_stack.h"
-/**************************************************************************/
-/* */
-/* FUNCTION RELEASE */
-/* */
-/* _ux_hcd_ohci_power_down_port PORTABLE C */
+/**************************************************************************/
+/* */
+/* FUNCTION RELEASE */
+/* */
+/* _ux_hcd_ohci_power_down_port PORTABLE C */
/* 6.1.2 */
/* AUTHOR */
/* */
/* Chaoqiong Xiao, Microsoft Corporation */
/* */
/* DESCRIPTION */
-/* */
-/* This function will power down a specific port attached to the */
-/* root HUB. */
-/* */
-/* INPUT */
-/* */
-/* hcd_ohci Pointer to OHCI controller */
-/* port_index Port index */
-/* */
-/* OUTPUT */
-/* */
-/* None */
-/* */
-/* CALLS */
-/* */
-/* None */
-/* */
-/* CALLED BY */
-/* */
-/* OHCI Controller Driver */
-/* */
-/* RELEASE HISTORY */
-/* */
-/* DATE NAME DESCRIPTION */
-/* */
-/* 05-19-2020 Chaoqiong Xiao Initial Version 6.0 */
-/* 09-30-2020 Chaoqiong Xiao Modified comment(s), */
-/* resulting in version 6.1 */
-/* 11-09-2020 Chaoqiong Xiao Modified comment(s), */
-/* fixed compile warnings, */
-/* resulting in version 6.1.2 */
+/* */
+/* This function will power down a specific port attached to the */
+/* root HUB. */
+/* */
+/* INPUT */
+/* */
+/* hcd_ohci Pointer to OHCI controller */
+/* port_index Port index */
+/* */
+/* OUTPUT */
+/* */
+/* None */
+/* */
+/* CALLS */
+/* */
+/* None */
+/* */
+/* CALLED BY */
+/* */
+/* OHCI Controller Driver */
/* */
/**************************************************************************/
UINT _ux_hcd_ohci_power_down_port(UX_HCD_OHCI *hcd_ohci, ULONG port_index)
@@ -78,6 +68,6 @@ UINT _ux_hcd_ohci_power_down_port(UX_HCD_OHCI *hcd_ohci, ULONG port_index)
UX_PARAMETER_NOT_USED(hcd_ohci);
UX_PARAMETER_NOT_USED(port_index);
- return(UX_FUNCTION_NOT_SUPPORTED);
+ return(UX_FUNCTION_NOT_SUPPORTED);
}
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 4915ef88..24dc3926 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
@@ -1,18 +1,19 @@
/***************************************************************************
- * Copyright (c) 2024 Microsoft Corporation
- *
+ * Copyright (c) 2024 Microsoft Corporation
+ * Copyright (c) 2026-present Eclipse ThreadX contributors
+ *
* This program and the accompanying materials are made available under the
* terms of the MIT License which is available at
* https://opensource.org/licenses/MIT.
- *
+ *
* SPDX-License-Identifier: MIT
**************************************************************************/
/**************************************************************************/
/**************************************************************************/
-/** */
-/** USBX Component */
+/** */
+/** USBX Component */
/** */
/** OHCI Controller Driver */
/** */
@@ -29,47 +30,36 @@
#include "ux_host_stack.h"
-/**************************************************************************/
-/* */
-/* FUNCTION RELEASE */
-/* */
-/* _ux_hcd_ohci_power_on_port PORTABLE C */
+/**************************************************************************/
+/* */
+/* FUNCTION RELEASE */
+/* */
+/* _ux_hcd_ohci_power_on_port PORTABLE C */
/* 6.1.2 */
/* AUTHOR */
/* */
/* Chaoqiong Xiao, Microsoft Corporation */
/* */
/* DESCRIPTION */
-/* */
-/* This function will power a specific port attached to the root HUB. */
-/* */
-/* INPUT */
-/* */
-/* hcd_ohci Pointer to OHCI controller */
-/* port_index Port index */
-/* */
-/* OUTPUT */
-/* */
-/* None */
-/* */
-/* CALLS */
-/* */
-/* None */
-/* */
-/* CALLED BY */
-/* */
-/* OHCI Controller Driver */
-/* */
-/* RELEASE HISTORY */
-/* */
-/* DATE NAME DESCRIPTION */
-/* */
-/* 05-19-2020 Chaoqiong Xiao Initial Version 6.0 */
-/* 09-30-2020 Chaoqiong Xiao Modified comment(s), */
-/* resulting in version 6.1 */
-/* 11-09-2020 Chaoqiong Xiao Modified comment(s), */
-/* fixed compile warnings, */
-/* resulting in version 6.1.2 */
+/* */
+/* This function will power a specific port attached to the root HUB. */
+/* */
+/* INPUT */
+/* */
+/* hcd_ohci Pointer to OHCI controller */
+/* port_index Port index */
+/* */
+/* OUTPUT */
+/* */
+/* None */
+/* */
+/* CALLS */
+/* */
+/* None */
+/* */
+/* CALLED BY */
+/* */
+/* OHCI Controller Driver */
/* */
/**************************************************************************/
UINT _ux_hcd_ohci_power_on_port(UX_HCD_OHCI *hcd_ohci, ULONG port_index)
@@ -77,6 +67,6 @@ UINT _ux_hcd_ohci_power_on_port(UX_HCD_OHCI *hcd_ohci, ULONG port_index)
UX_PARAMETER_NOT_USED(hcd_ohci);
UX_PARAMETER_NOT_USED(port_index);
- return(UX_FUNCTION_NOT_SUPPORTED);
+ return(UX_FUNCTION_NOT_SUPPORTED);
}
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 73ca1cb9..aa74856f 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
@@ -1,18 +1,19 @@
/***************************************************************************
- * Copyright (c) 2024 Microsoft Corporation
- *
+ * Copyright (c) 2024 Microsoft Corporation
+ * Copyright (c) 2026-present Eclipse ThreadX contributors
+ *
* This program and the accompanying materials are made available under the
* terms of the MIT License which is available at
* https://opensource.org/licenses/MIT.
- *
+ *
* SPDX-License-Identifier: MIT
**************************************************************************/
/**************************************************************************/
/**************************************************************************/
-/** */
-/** USBX Component */
+/** */
+/** USBX Component */
/** */
/** OHCI Controller Driver */
/** */
@@ -29,49 +30,38 @@
#include "ux_host_stack.h"
-/**************************************************************************/
-/* */
-/* FUNCTION RELEASE */
-/* */
-/* _ux_hcd_ohci_power_root_hubs PORTABLE C */
+/**************************************************************************/
+/* */
+/* FUNCTION RELEASE */
+/* */
+/* _ux_hcd_ohci_power_root_hubs PORTABLE C */
/* 6.1.2 */
/* AUTHOR */
/* */
/* Chaoqiong Xiao, Microsoft Corporation */
/* */
/* DESCRIPTION */
-/* */
-/* This function powers individually or in gang mode the root HUBs */
-/* attached to the OHCI controller. */
-/* */
-/* INPUT */
-/* */
-/* hcd_ohci Pointer to OHCI controller */
-/* */
-/* OUTPUT */
-/* */
-/* None */
-/* */
-/* CALLS */
-/* */
-/* _ux_hcd_ohci_register_read OHCI register read */
-/* _ux_hcd_ohci_register_write OHCI register write */
-/* _ux_utility_delay_ms Delay */
-/* */
-/* CALLED BY */
-/* */
-/* OHCI Controller Driver */
-/* */
-/* RELEASE HISTORY */
-/* */
-/* DATE NAME DESCRIPTION */
-/* */
-/* 05-19-2020 Chaoqiong Xiao Initial Version 6.0 */
-/* 09-30-2020 Chaoqiong Xiao Modified comment(s), */
-/* resulting in version 6.1 */
-/* 11-09-2020 Chaoqiong Xiao Modified comment(s), */
-/* fixed compile warnings, */
-/* resulting in version 6.1.2 */
+/* */
+/* This function powers individually or in gang mode the root HUBs */
+/* attached to the OHCI controller. */
+/* */
+/* INPUT */
+/* */
+/* hcd_ohci Pointer to OHCI controller */
+/* */
+/* OUTPUT */
+/* */
+/* None */
+/* */
+/* CALLS */
+/* */
+/* _ux_hcd_ohci_register_read OHCI register read */
+/* _ux_hcd_ohci_register_write OHCI register write */
+/* _ux_utility_delay_ms Delay */
+/* */
+/* CALLED BY */
+/* */
+/* OHCI Controller Driver */
/* */
/**************************************************************************/
VOID _ux_hcd_ohci_power_root_hubs(UX_HCD_OHCI *hcd_ohci)
@@ -90,20 +80,20 @@ UINT port_index;
/* Read the RH descriptor B. It will give us the characteristics of the root HUB. */
ohci_register_b = _ux_hcd_ohci_register_read(hcd_ohci, OHCI_HC_RH_DESCRIPTOR_B);
-
+
/* The ports must be power switched. There are 3 possibilities:
- 1) individual
- 2) gang mode
+ 1) individual
+ 2) gang mode
3) a combination of both
- The logic is as follows:
-
+ The logic is as follows:
+
If the PSM bit is not set, gang mode is forced and we use the global power (LPSC) command.
- If PSM is set, each port is powered individually.
-
+ If PSM is set, each port is powered individually.
+
BUT we also need to look into the PPCM field to check if there is any ports
- that may still want to be powered by the global power command. If the bit for a port in
+ that may still want to be powered by the global power command. If the bit for a port in
the mask is set, the power is applied by the local port command in the RH port status (PPS). */
if (ohci_register_a & OHCI_HC_RH_PSM)
{
@@ -118,9 +108,9 @@ UINT port_index;
_ux_hcd_ohci_register_write(hcd_ohci, OHCI_HC_RH_STATUS, OHCI_HC_RS_LPSC);
break;
}
- }
-
- /* Ports have to be powered individually. This is done for each of the ports whose bit mask is
+ }
+
+ /* Ports have to be powered individually. This is done for each of the ports whose bit mask is
set in the PPCM field. */
for (port_index = 0; port_index < hcd_ohci -> ux_hcd_ohci_nb_root_hubs; port_index++)
{
@@ -129,7 +119,7 @@ UINT port_index;
{
ohci_register_port_status = _ux_hcd_ohci_register_read(hcd_ohci, OHCI_HC_RH_PORT_STATUS + port_index);
-
+
ohci_register_port_status |= OHCI_HC_PS_PPS;
_ux_hcd_ohci_register_write(hcd_ohci, OHCI_HC_RH_PORT_STATUS + port_index, ohci_register_port_status);
}
@@ -141,12 +131,12 @@ UINT port_index;
/* Ports have to be powered all at the same time. */
_ux_hcd_ohci_register_write(hcd_ohci, OHCI_HC_RH_STATUS, OHCI_HC_RS_LPSC);
}
-
- /* Wait for the power to be stable. the RH descriptor contains the value POTPGT. We multiply this value by 2
+
+ /* Wait for the power to be stable. the RH descriptor contains the value POTPGT. We multiply this value by 2
and this is the number of milliseconds to wait for power to set. */
_ux_utility_delay_ms(ohci_register_a >> (OHCI_HC_RH_POTPGT - 1));
/* Return to caller. */
return;
-}
+}
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 b84f8fd7..c8d408f2 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
@@ -1,18 +1,19 @@
/***************************************************************************
- * Copyright (c) 2024 Microsoft Corporation
- *
+ * Copyright (c) 2024 Microsoft Corporation
+ * Copyright (c) 2026-present Eclipse ThreadX contributors
+ *
* This program and the accompanying materials are made available under the
* terms of the MIT License which is available at
* https://opensource.org/licenses/MIT.
- *
+ *
* SPDX-License-Identifier: MIT
**************************************************************************/
/**************************************************************************/
/**************************************************************************/
-/** */
-/** USBX Component */
+/** */
+/** USBX Component */
/** */
/** OHCI Controller Driver */
/** */
@@ -29,49 +30,41 @@
#include "ux_host_stack.h"
-/**************************************************************************/
-/* */
-/* FUNCTION RELEASE */
-/* */
-/* _ux_hcd_ohci_register_read PORTABLE C */
+/**************************************************************************/
+/* */
+/* FUNCTION RELEASE */
+/* */
+/* _ux_hcd_ohci_register_read PORTABLE C */
/* 6.1 */
/* AUTHOR */
/* */
/* Chaoqiong Xiao, Microsoft Corporation */
/* */
/* DESCRIPTION */
-/* */
-/* This function reads a register from the OHCI HCOR. */
-/* */
-/* INPUT */
-/* */
-/* hcd_ohci Pointer to OHCI controller */
-/* ohci_register OHCI register to write to */
-/* */
-/* OUTPUT */
-/* */
-/* Value Read */
-/* */
-/* CALLS */
-/* */
-/* None */
-/* */
-/* CALLED BY */
-/* */
-/* OHCI Controller Driver */
-/* */
-/* RELEASE HISTORY */
-/* */
-/* DATE NAME DESCRIPTION */
-/* */
-/* 05-19-2020 Chaoqiong Xiao Initial Version 6.0 */
-/* 09-30-2020 Chaoqiong Xiao Modified comment(s), */
-/* resulting in version 6.1 */
+/* */
+/* This function reads a register from the OHCI HCOR. */
+/* */
+/* INPUT */
+/* */
+/* hcd_ohci Pointer to OHCI controller */
+/* ohci_register OHCI register to write to */
+/* */
+/* OUTPUT */
+/* */
+/* Value Read */
+/* */
+/* CALLS */
+/* */
+/* None */
+/* */
+/* CALLED BY */
+/* */
+/* OHCI Controller Driver */
/* */
/**************************************************************************/
ULONG _ux_hcd_ohci_register_read(UX_HCD_OHCI *hcd_ohci, ULONG ohci_register)
{
-
+
/* Return the value. */
return(*(hcd_ohci -> ux_hcd_ohci_hcor + 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 206578b0..bfc2618f 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
@@ -1,18 +1,19 @@
/***************************************************************************
- * Copyright (c) 2024 Microsoft Corporation
- *
+ * Copyright (c) 2024 Microsoft Corporation
+ * Copyright (c) 2026-present Eclipse ThreadX contributors
+ *
* This program and the accompanying materials are made available under the
* terms of the MIT License which is available at
* https://opensource.org/licenses/MIT.
- *
+ *
* SPDX-License-Identifier: MIT
**************************************************************************/
/**************************************************************************/
/**************************************************************************/
-/** */
-/** USBX Component */
+/** */
+/** USBX Component */
/** */
/** OHCI Controller Driver */
/** */
@@ -29,50 +30,42 @@
#include "ux_host_stack.h"
-/**************************************************************************/
-/* */
-/* FUNCTION RELEASE */
-/* */
-/* _ux_hcd_ohci_register_write PORTABLE C */
+/**************************************************************************/
+/* */
+/* FUNCTION RELEASE */
+/* */
+/* _ux_hcd_ohci_register_write PORTABLE C */
/* 6.1 */
/* AUTHOR */
/* */
/* Chaoqiong Xiao, Microsoft Corporation */
/* */
/* DESCRIPTION */
-/* */
-/* This function writes a register to the OHCI HCOR. */
-/* */
-/* INPUT */
-/* */
-/* hcd_ohci Pointer to OHCI controller */
-/* ohci_register OHCI register to write to */
-/* value Value to write */
-/* */
-/* OUTPUT */
-/* */
-/* None */
-/* */
-/* CALLS */
-/* */
-/* None */
-/* */
-/* CALLED BY */
-/* */
-/* OHCI Controller Driver */
-/* */
-/* RELEASE HISTORY */
-/* */
-/* DATE NAME DESCRIPTION */
-/* */
-/* 05-19-2020 Chaoqiong Xiao Initial Version 6.0 */
-/* 09-30-2020 Chaoqiong Xiao Modified comment(s), */
-/* resulting in version 6.1 */
+/* */
+/* This function writes a register to the OHCI HCOR. */
+/* */
+/* INPUT */
+/* */
+/* hcd_ohci Pointer to OHCI controller */
+/* ohci_register OHCI register to write to */
+/* value Value to write */
+/* */
+/* OUTPUT */
+/* */
+/* None */
+/* */
+/* CALLS */
+/* */
+/* None */
+/* */
+/* CALLED BY */
+/* */
+/* OHCI Controller Driver */
/* */
/**************************************************************************/
VOID _ux_hcd_ohci_register_write(UX_HCD_OHCI *hcd_ohci, ULONG ohci_register, ULONG value)
{
-
+
/* Write to the register. */
*(hcd_ohci -> ux_hcd_ohci_hcor + ohci_register) = 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 14ac35dd..48d5d2d9 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
@@ -1,18 +1,19 @@
/***************************************************************************
- * Copyright (c) 2024 Microsoft Corporation
- *
+ * Copyright (c) 2024 Microsoft Corporation
+ * Copyright (c) 2026-present Eclipse ThreadX contributors
+ *
* This program and the accompanying materials are made available under the
* terms of the MIT License which is available at
* https://opensource.org/licenses/MIT.
- *
+ *
* SPDX-License-Identifier: MIT
**************************************************************************/
/**************************************************************************/
/**************************************************************************/
-/** */
-/** USBX Component */
+/** */
+/** USBX Component */
/** */
/** OHCI Controller Driver */
/** */
@@ -29,50 +30,37 @@
#include "ux_host_stack.h"
-/**************************************************************************/
-/* */
-/* FUNCTION RELEASE */
-/* */
-/* _ux_hcd_ohci_regular_td_obtain PORTABLE C */
+/**************************************************************************/
+/* */
+/* FUNCTION RELEASE */
+/* */
+/* _ux_hcd_ohci_regular_td_obtain PORTABLE C */
/* 6.1.11 */
/* AUTHOR */
/* */
/* Chaoqiong Xiao, Microsoft Corporation */
/* */
/* DESCRIPTION */
-/* */
-/* This function obtains a free TD from the regular TD list. */
-/* */
-/* INPUT */
-/* */
-/* hcd_ohci Pointer to OHCI controller */
-/* */
-/* OUTPUT */
-/* */
-/* *UX_OHCI_TD Regular TD pointer */
-/* */
-/* CALLS */
-/* */
-/* _ux_utility_memory_set Set memory block */
+/* */
+/* This function obtains a free TD from the regular TD list. */
+/* */
+/* INPUT */
+/* */
+/* hcd_ohci Pointer to OHCI controller */
+/* */
+/* OUTPUT */
+/* */
+/* *UX_OHCI_TD Regular TD pointer */
+/* */
+/* CALLS */
+/* */
+/* _ux_utility_memory_set Set memory block */
/* _ux_host_mutex_on Get protection mutex */
-/* _ux_host_mutex_off Release protection mutex */
-/* */
-/* CALLED BY */
-/* */
-/* OHCI Controller Driver */
-/* */
-/* RELEASE HISTORY */
-/* */
-/* DATE NAME DESCRIPTION */
-/* */
-/* 05-19-2020 Chaoqiong Xiao Initial Version 6.0 */
-/* 09-30-2020 Chaoqiong Xiao Modified comment(s), */
-/* verified memset and memcpy */
-/* cases, */
-/* resulting in version 6.1 */
-/* 04-25-2022 Chaoqiong Xiao Modified comment(s), */
-/* fixed standalone compile, */
-/* resulting in version 6.1.11 */
+/* _ux_host_mutex_off Release protection mutex */
+/* */
+/* CALLED BY */
+/* */
+/* OHCI Controller Driver */
/* */
/**************************************************************************/
UX_OHCI_TD *_ux_hcd_ohci_regular_td_obtain(UX_HCD_OHCI *hcd_ohci)
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 6f591c68..02e20ba3 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
@@ -1,18 +1,19 @@
/***************************************************************************
- * Copyright (c) 2024 Microsoft Corporation
- *
+ * Copyright (c) 2024 Microsoft Corporation
+ * Copyright (c) 2026-present Eclipse ThreadX contributors
+ *
* This program and the accompanying materials are made available under the
* terms of the MIT License which is available at
* https://opensource.org/licenses/MIT.
- *
+ *
* SPDX-License-Identifier: MIT
**************************************************************************/
/**************************************************************************/
/**************************************************************************/
-/** */
-/** USBX Component */
+/** */
+/** USBX Component */
/** */
/** OHCI Controller Driver */
/** */
@@ -29,52 +30,44 @@
#include "ux_host_stack.h"
-/**************************************************************************/
-/* */
-/* FUNCTION RELEASE */
-/* */
-/* _ux_hcd_ohci_request_bulk_transfer PORTABLE C */
+/**************************************************************************/
+/* */
+/* FUNCTION RELEASE */
+/* */
+/* _ux_hcd_ohci_request_bulk_transfer PORTABLE C */
/* 6.1 */
/* AUTHOR */
/* */
/* Chaoqiong Xiao, Microsoft Corporation */
/* */
/* DESCRIPTION */
-/* */
-/* This function performs a bulk transfer request. A bulk transfer */
-/* can be larger than the size of the OHCI buffer so it may be */
+/* */
+/* This function performs a bulk transfer request. A bulk transfer */
+/* can be larger than the size of the OHCI buffer so it may be */
/* required to chain multiple tds to accommodate this transfer */
-/* request. A bulk transfer is non blocking, so we return before the */
-/* transfer request is completed. */
-/* */
-/* INPUT */
-/* */
-/* hcd_ohci Pointer to OHCI controller */
-/* transfer_request Pointer to transfer request */
-/* */
-/* OUTPUT */
-/* */
-/* Completion Status */
-/* */
-/* CALLS */
-/* */
-/* _ux_hcd_ohci_register_read Read OHCI register */
-/* _ux_hcd_ohci_register_write Write OHCI register */
-/* _ux_hcd_ohci_regular_td_obtain Get regular TD */
-/* _ux_utility_physical_address Get physical address */
-/* _ux_utility_virtual_address Get virtual address */
-/* */
-/* CALLED BY */
-/* */
-/* OHCI Controller Driver */
-/* */
-/* RELEASE HISTORY */
-/* */
-/* DATE NAME DESCRIPTION */
-/* */
-/* 05-19-2020 Chaoqiong Xiao Initial Version 6.0 */
-/* 09-30-2020 Chaoqiong Xiao Modified comment(s), */
-/* resulting in version 6.1 */
+/* request. A bulk transfer is non blocking, so we return before the */
+/* transfer request is completed. */
+/* */
+/* INPUT */
+/* */
+/* hcd_ohci Pointer to OHCI controller */
+/* transfer_request Pointer to transfer request */
+/* */
+/* OUTPUT */
+/* */
+/* Completion Status */
+/* */
+/* CALLS */
+/* */
+/* _ux_hcd_ohci_register_read Read OHCI register */
+/* _ux_hcd_ohci_register_write Write OHCI register */
+/* _ux_hcd_ohci_regular_td_obtain Get regular TD */
+/* _ux_utility_physical_address Get physical address */
+/* _ux_utility_virtual_address Get virtual address */
+/* */
+/* CALLED BY */
+/* */
+/* OHCI Controller Driver */
/* */
/**************************************************************************/
UINT _ux_hcd_ohci_request_bulk_transfer(UX_HCD_OHCI *hcd_ohci, UX_TRANSFER *transfer_request)
@@ -92,7 +85,7 @@ ULONG bulk_packet_payload_length;
UCHAR * data_pointer;
ULONG ohci_register;
ULONG zlp_flag;
-
+
/* Get the pointer to the Endpoint. */
endpoint = (UX_ENDPOINT *) transfer_request -> ux_transfer_request_endpoint;
@@ -109,28 +102,28 @@ ULONG zlp_flag;
start_data_td = 0;
/* It may take more than one TD if the transfer_request length is more than the
- maximum length for a OHCI TD (this is irrelevant of the MaxPacketSize value in
+ maximum length for a OHCI TD (this is irrelevant of the MaxPacketSize value in
the endpoint descriptor). OHCI data payload has a maximum size of 4K. */
transfer_request_payload_length = transfer_request -> ux_transfer_request_requested_length;
data_pointer = transfer_request -> ux_transfer_request_data_pointer;
-
+
/* Check for ZLP condition. */
if (transfer_request_payload_length == 0)
-
+
/* We have a zlp condition. */
zlp_flag = UX_TRUE;
else
-
+
/* We do not have a zlp. */
zlp_flag = UX_FALSE;
-
+
/* Build all necessary TDs. */
while ((transfer_request_payload_length != 0) || zlp_flag == UX_TRUE)
{
/* Reset ZLP now. */
- zlp_flag = UX_FALSE;
-
+ zlp_flag = UX_FALSE;
+
/* Check if we are exceeding the max payload. */
if (transfer_request_payload_length > UX_OHCI_MAX_PAYLOAD)
@@ -195,19 +188,19 @@ ULONG zlp_flag;
if (start_data_td == UX_NULL)
start_data_td = data_td;
- /* Attach this new TD to the previous one. */
+ /* Attach this new TD to the previous one. */
previous_td -> ux_ohci_td_next_td = _ux_utility_physical_address(data_td);
previous_td -> ux_ohci_td_next_td_transfer_request = data_td;
previous_td = data_td;
}
}
-
- /* At this stage, the Head and Tail in the ED are still the same and the OHCI controller
+
+ /* At this stage, the Head and Tail in the ED are still the same and the OHCI controller
will skip this ED until we have hooked the new tail TD. */
tail_td = _ux_hcd_ohci_regular_td_obtain(hcd_ohci);
if (tail_td == UX_NULL)
{
-
+
/* If there was already a TD chain in progress, free it. */
if (start_data_td != UX_NULL)
{
@@ -238,6 +231,6 @@ ULONG zlp_flag;
_ux_hcd_ohci_register_write(hcd_ohci, OHCI_HC_COMMAND_STATUS, ohci_register);
/* Return successful completion. */
- return(UX_SUCCESS);
+ return(UX_SUCCESS);
}
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 666ac200..f6c92d4f 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
@@ -1,18 +1,19 @@
/***************************************************************************
- * Copyright (c) 2024 Microsoft Corporation
- *
+ * Copyright (c) 2024 Microsoft Corporation
+ * Copyright (c) 2026-present Eclipse ThreadX contributors
+ *
* This program and the accompanying materials are made available under the
* terms of the MIT License which is available at
* https://opensource.org/licenses/MIT.
- *
+ *
* SPDX-License-Identifier: MIT
**************************************************************************/
/**************************************************************************/
/**************************************************************************/
-/** */
-/** USBX Component */
+/** */
+/** USBX Component */
/** */
/** OHCI Controller Driver */
/** */
@@ -29,67 +30,52 @@
#include "ux_host_stack.h"
-/**************************************************************************/
-/* */
-/* FUNCTION RELEASE */
-/* */
-/* _ux_hcd_ohci_request_control_transfer PORTABLE C */
+/**************************************************************************/
+/* */
+/* FUNCTION RELEASE */
+/* */
+/* _ux_hcd_ohci_request_control_transfer PORTABLE C */
/* 6.1.10 */
/* AUTHOR */
/* */
/* Chaoqiong Xiao, Microsoft Corporation */
/* */
/* DESCRIPTION */
-/* */
-/* This function performs a control transfer from a transfer request. */
+/* */
+/* This function performs a control transfer from a transfer request. */
/* The USB control transfer is in 3 phases (setup, data, status). */
/* This function will chain all phases of the control sequence before */
/* setting the OHCI endpoint as a candidate for transfer. */
/* */
/* The maximum aggregated size of a data payload in OHCI is 4K. We */
-/* are assuming that this size will be sufficient to contain the */
-/* control packet. */
-/* */
-/* INPUT */
-/* */
-/* hcd_ohci Pointer to OHCI controller */
-/* transfer_request Pointer to transfer request */
-/* */
-/* OUTPUT */
-/* */
-/* Completion Status */
-/* */
-/* CALLS */
-/* */
-/* _ux_hcd_ohci_register_read Read OHCI register */
-/* _ux_hcd_ohci_register_write Write OHCI register */
-/* _ux_hcd_ohci_regular_td_obtain Get regular TD */
-/* _ux_host_stack_transfer_request_abort Abort transfer request */
-/* _ux_utility_memory_allocate Allocate memory block */
-/* _ux_utility_memory_free Release memory block */
-/* _ux_utility_physical_address Get physical address */
-/* _ux_host_semaphore_get Get semaphore */
-/* _ux_utility_short_put Write 16-bit value */
-/* _ux_utility_virtual_address Get virtual address */
-/* */
-/* CALLED BY */
-/* */
-/* OHCI Controller Driver */
-/* */
-/* RELEASE HISTORY */
-/* */
-/* 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 */
-/* 11-09-2020 Chaoqiong Xiao Modified comment(s), */
-/* fixed compile warnings, */
-/* resulting in version 6.1.2 */
-/* 01-31-2022 Chaoqiong Xiao Modified comment(s), */
-/* refined macros names, */
-/* resulting in version 6.1.10 */
+/* are assuming that this size will be sufficient to contain the */
+/* control packet. */
+/* */
+/* INPUT */
+/* */
+/* hcd_ohci Pointer to OHCI controller */
+/* transfer_request Pointer to transfer request */
+/* */
+/* OUTPUT */
+/* */
+/* Completion Status */
+/* */
+/* CALLS */
+/* */
+/* _ux_hcd_ohci_register_read Read OHCI register */
+/* _ux_hcd_ohci_register_write Write OHCI register */
+/* _ux_hcd_ohci_regular_td_obtain Get regular TD */
+/* _ux_host_stack_transfer_request_abort Abort transfer request */
+/* _ux_utility_memory_allocate Allocate memory block */
+/* _ux_utility_memory_free Release memory block */
+/* _ux_utility_physical_address Get physical address */
+/* _ux_host_semaphore_get Get semaphore */
+/* _ux_utility_short_put Write 16-bit value */
+/* _ux_utility_virtual_address Get virtual address */
+/* */
+/* CALLED BY */
+/* */
+/* OHCI Controller Driver */
/* */
/**************************************************************************/
UINT _ux_hcd_ohci_request_control_transfer(UX_HCD_OHCI *hcd_ohci, UX_TRANSFER *transfer_request)
@@ -106,8 +92,8 @@ UX_OHCI_TD *tail_td;
UX_OHCI_TD *status_td;
ULONG ohci_register;
UINT status;
-
-
+
+
/* Get the pointer to the Endpoint and the Device. */
endpoint = (UX_ENDPOINT *) transfer_request -> ux_transfer_request_endpoint;
device = endpoint -> ux_endpoint_device;
@@ -151,7 +137,7 @@ UINT status;
setup_td -> ux_ohci_td_status |= UX_OHCI_TD_SETUP_PHASE;
/* Check if there is a data phase, if not jump to status phase. */
- data_td = UX_NULL;
+ data_td = UX_NULL;
if (transfer_request -> ux_transfer_request_requested_length != 0)
{
@@ -224,7 +210,7 @@ UINT status;
/* Hook the status phase to the previous TD. */
chain_td -> ux_ohci_td_next_td = _ux_utility_physical_address(status_td);
- /* Since we have consumed out tail TD for the setup packet, we must get another
+ /* Since we have consumed out tail TD for the setup packet, we must get another
one and hook it to the ED's tail. */
tail_td = _ux_hcd_ohci_regular_td_obtain(hcd_ohci);
if (tail_td == UX_NULL)
@@ -239,7 +225,7 @@ UINT status;
/* Hook the new TD to the status TD. */
status_td -> ux_ohci_td_next_td = _ux_utility_physical_address(tail_td);
-
+
/* At this stage, the Head and Tail in the ED are still the same and
the OHCI controller will skip this ED until we have hooked the new
tail TD. */
@@ -260,7 +246,7 @@ UINT status;
/* All transfers pending need to abort. There may have been a partial transfer. */
_ux_host_stack_transfer_request_abort(transfer_request);
-
+
/* There was an error, return to the caller. */
transfer_request -> ux_transfer_request_completion_code = UX_TRANSFER_TIMEOUT;
@@ -269,13 +255,13 @@ UINT status;
/* If trace is enabled, insert this event into the trace buffer. */
UX_TRACE_IN_LINE_INSERT(UX_TRACE_ERROR, UX_TRANSFER_TIMEOUT, transfer_request, 0, 0, UX_TRACE_ERRORS, 0, 0)
-
- }
+
+ }
/* Free the resources. */
_ux_utility_memory_free(setup_request);
/* Return the completion status. */
- return(transfer_request -> ux_transfer_request_completion_code);
+ return(transfer_request -> ux_transfer_request_completion_code);
}
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 f379fd09..6df6624f 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
@@ -1,18 +1,19 @@
/***************************************************************************
- * Copyright (c) 2024 Microsoft Corporation
- *
+ * Copyright (c) 2024 Microsoft Corporation
+ * Copyright (c) 2026-present Eclipse ThreadX contributors
+ *
* This program and the accompanying materials are made available under the
* terms of the MIT License which is available at
* https://opensource.org/licenses/MIT.
- *
+ *
* SPDX-License-Identifier: MIT
**************************************************************************/
/**************************************************************************/
/**************************************************************************/
-/** */
-/** USBX Component */
+/** */
+/** USBX Component */
/** */
/** OHCI Controller Driver */
/** */
@@ -29,49 +30,41 @@
#include "ux_host_stack.h"
-/**************************************************************************/
-/* */
-/* FUNCTION RELEASE */
-/* */
-/* _ux_hcd_ohci_request_interrupt_transfer PORTABLE C */
+/**************************************************************************/
+/* */
+/* FUNCTION RELEASE */
+/* */
+/* _ux_hcd_ohci_request_interrupt_transfer PORTABLE C */
/* 6.1 */
/* AUTHOR */
/* */
/* Chaoqiong Xiao, Microsoft Corporation */
/* */
/* DESCRIPTION */
-/* */
-/* This function performs an interrupt transfer request. An interrupt */
-/* transfer can only be as large as the MaxpacketField in the */
+/* */
+/* This function performs an interrupt transfer request. An interrupt */
+/* transfer can only be as large as the MaxpacketField in the */
/* endpoint descriptor. This was verified at a higher layer and does */
-/* not need to be reverified here. */
-/* */
-/* INPUT */
-/* */
-/* hcd_ohci Pointer to OHCI controller */
-/* transfer_request Pointer to transfer request */
-/* */
-/* OUTPUT */
-/* */
-/* Completion Status */
-/* */
-/* CALLS */
-/* */
-/* _ux_hcd_ohci_regular_td_obtain Get regular TD */
-/* _ux_utility_physical_address Get physical address */
-/* _ux_utility_virtual_address Get virtual address */
-/* */
-/* CALLED BY */
-/* */
-/* OHCI Controller Driver */
-/* */
-/* RELEASE HISTORY */
-/* */
-/* DATE NAME DESCRIPTION */
-/* */
-/* 05-19-2020 Chaoqiong Xiao Initial Version 6.0 */
-/* 09-30-2020 Chaoqiong Xiao Modified comment(s), */
-/* resulting in version 6.1 */
+/* not need to be reverified here. */
+/* */
+/* INPUT */
+/* */
+/* hcd_ohci Pointer to OHCI controller */
+/* transfer_request Pointer to transfer request */
+/* */
+/* OUTPUT */
+/* */
+/* Completion Status */
+/* */
+/* CALLS */
+/* */
+/* _ux_hcd_ohci_regular_td_obtain Get regular TD */
+/* _ux_utility_physical_address Get physical address */
+/* _ux_utility_virtual_address Get virtual address */
+/* */
+/* CALLED BY */
+/* */
+/* OHCI Controller Driver */
/* */
/**************************************************************************/
UINT _ux_hcd_ohci_request_interrupt_transfer(UX_HCD_OHCI *hcd_ohci, UX_TRANSFER *transfer_request)
@@ -81,7 +74,7 @@ UX_ENDPOINT *endpoint;
UX_OHCI_ED *ed;
UX_OHCI_TD *data_td;
UX_OHCI_TD *tail_td;
-
+
/* Get the pointer to the Endpoint. */
endpoint = (UX_ENDPOINT *) transfer_request -> ux_transfer_request_endpoint;
@@ -93,8 +86,8 @@ UX_OHCI_TD *tail_td;
and chain from this one on. */
data_td = _ux_utility_virtual_address(ed -> ux_ohci_ed_tail_td);
- /* Set the direction of the transfer. In USB 1.0, the direction of the Interrupt pipe could
- only be HOST to DEVICE. In 1.1 bidirectional interrupt endpoints can be allowed. The
+ /* Set the direction of the transfer. In USB 1.0, the direction of the Interrupt pipe could
+ only be HOST to DEVICE. In 1.1 bidirectional interrupt endpoints can be allowed. The
direction was checked when the endpoint was initialized. */
if ((transfer_request -> ux_transfer_request_type & UX_REQUEST_DIRECTION) == UX_REQUEST_IN)
@@ -116,7 +109,7 @@ UX_OHCI_TD *tail_td;
data_td -> ux_ohci_td_transfer_request = transfer_request;
data_td -> ux_ohci_td_ed = ed;
- /* At this stage, the Head and Tail in the ED are still the same and the OHCI controller
+ /* At this stage, the Head and Tail in the ED are still the same and the OHCI controller
will skip this ED until we have hooked the new tail TD. */
tail_td = _ux_hcd_ohci_regular_td_obtain(hcd_ohci);
if (tail_td == UX_NULL)
@@ -131,6 +124,6 @@ UX_OHCI_TD *tail_td;
/* There is no need to wake up the ohci controller on this transfer
since periodic transactions will be picked up when the interrupt
tree is scanned. */
- return(UX_SUCCESS);
+ return(UX_SUCCESS);
}
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 996d3a36..a4eb2e81 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
@@ -1,18 +1,19 @@
/***************************************************************************
- * Copyright (c) 2024 Microsoft Corporation
- *
+ * Copyright (c) 2024 Microsoft Corporation
+ * Copyright (c) 2026-present Eclipse ThreadX contributors
+ *
* This program and the accompanying materials are made available under the
* terms of the MIT License which is available at
* https://opensource.org/licenses/MIT.
- *
+ *
* SPDX-License-Identifier: MIT
**************************************************************************/
/**************************************************************************/
/**************************************************************************/
-/** */
-/** USBX Component */
+/** */
+/** USBX Component */
/** */
/** OHCI Controller Driver */
/** */
@@ -29,48 +30,40 @@
#include "ux_host_stack.h"
-/**************************************************************************/
-/* */
-/* FUNCTION RELEASE */
-/* */
-/* _ux_hcd_ohci_request_isochronous_transfer PORTABLE C */
+/**************************************************************************/
+/* */
+/* FUNCTION RELEASE */
+/* */
+/* _ux_hcd_ohci_request_isochronous_transfer PORTABLE C */
/* 6.1 */
/* AUTHOR */
/* */
/* Chaoqiong Xiao, Microsoft Corporation */
/* */
/* DESCRIPTION */
-/* */
-/* This function performs an isochronous transfer request. This */
+/* */
+/* This function performs an isochronous transfer request. This */
/* function does not support multiple packets per TD as there can be */
-/* issues with packets crossing 4K pages. */
-/* */
-/* INPUT */
-/* */
-/* hcd_ohci Pointer to OHCI controller */
-/* transfer_request Pointer to transfer request */
-/* */
-/* OUTPUT */
-/* */
-/* Completion Status */
-/* */
-/* CALLS */
-/* */
-/* _ux_hcd_ohci_isochronous_td_obtain Get isochronous TD */
-/* _ux_utility_physical_address Get physical address */
-/* _ux_utility_virtual_address Get virtual address */
-/* */
-/* CALLED BY */
-/* */
-/* OHCI Controller Driver */
-/* */
-/* RELEASE HISTORY */
-/* */
-/* DATE NAME DESCRIPTION */
-/* */
-/* 05-19-2020 Chaoqiong Xiao Initial Version 6.0 */
-/* 09-30-2020 Chaoqiong Xiao Modified comment(s), */
-/* resulting in version 6.1 */
+/* issues with packets crossing 4K pages. */
+/* */
+/* INPUT */
+/* */
+/* hcd_ohci Pointer to OHCI controller */
+/* transfer_request Pointer to transfer request */
+/* */
+/* OUTPUT */
+/* */
+/* Completion Status */
+/* */
+/* CALLS */
+/* */
+/* _ux_hcd_ohci_isochronous_td_obtain Get isochronous TD */
+/* _ux_utility_physical_address Get physical address */
+/* _ux_utility_virtual_address Get virtual address */
+/* */
+/* CALLED BY */
+/* */
+/* OHCI Controller Driver */
/* */
/**************************************************************************/
UINT _ux_hcd_ohci_request_isochronous_transfer(UX_HCD_OHCI *hcd_ohci, UX_TRANSFER *transfer_request)
@@ -87,7 +80,7 @@ ULONG transfer_request_payload_length;
ULONG isoch_packet_payload_length;
UCHAR * data_pointer;
ULONG current_frame_number;
-
+
/* Get the pointer to the Endpoint. */
endpoint = (UX_ENDPOINT *) transfer_request -> ux_transfer_request_endpoint;
@@ -97,7 +90,7 @@ ULONG current_frame_number;
/* Reset the MPS value of the ED. */
ed -> ux_ohci_ed_dw0 &= UX_OHCI_ED_MPS;
-
+
/* If the transfer request specifies a max packet length other than the endpoint
size, we force the transfer request value into the endpoint. */
if (transfer_request -> ux_transfer_request_packet_length == 0)
@@ -115,7 +108,7 @@ ULONG current_frame_number;
/* Reset the first obtained data TD in case there is a TD shortage while building the list of TDs. */
start_data_td = UX_NULL;
- /* Calculate the frame number to be used to send this payload. If there are no current transfers,
+ /* Calculate the frame number to be used to send this payload. If there are no current transfers,
we take the current frame number and add a safety value (2-5) to it. If here is pending transactions,
we use the frame number stored in the transfer request. */
if (ed -> ux_ohci_ed_tail_td == ed -> ux_ohci_ed_head_td)
@@ -130,13 +123,13 @@ ULONG current_frame_number;
/* Load the start buffer address and URB length to split the URB in multiple TD transfer. */
transfer_request_payload_length = transfer_request -> ux_transfer_request_requested_length;
data_pointer = transfer_request -> ux_transfer_request_data_pointer;
-
+
while (transfer_request_payload_length != 0)
{
/* Set the default CC value. Default is 1 packet per TD frame. */
data_td -> ux_ohci_iso_td_dw0 = UX_OHCI_TD_DEFAULT_DW0;
-
+
/* Set the direction. In Iso, this is done at the ED level. */
if ((transfer_request -> ux_transfer_request_type & UX_REQUEST_DIRECTION) == UX_REQUEST_IN)
@@ -153,7 +146,7 @@ ULONG current_frame_number;
/* Set the condition code for the current packet. */
data_td -> ux_ohci_iso_td_offset_psw[0] |= (USHORT) UX_OHCI_ISO_TD_PSW_CC;
-
+
/* Program the end address of the buffer. */
data_td -> ux_ohci_iso_td_be = ((UCHAR *) _ux_utility_physical_address(data_pointer)) + isoch_packet_payload_length - 1;
@@ -201,12 +194,12 @@ ULONG current_frame_number;
if (start_data_td == UX_NULL)
start_data_td = data_td;
- /* Attach this new TD to the previous one. */
+ /* Attach this new TD to the previous one. */
previous_td -> ux_ohci_iso_td_next_td = _ux_utility_physical_address(data_td);
previous_td = data_td;
}
}
-
+
/* Memorize the next frame number for this ED. */
ed -> ux_ohci_ed_frame = current_frame_number;
@@ -242,6 +235,6 @@ ULONG current_frame_number;
ed -> ux_ohci_ed_tail_td = _ux_utility_physical_address(tail_td);
/* Return successful completion. */
- return(UX_SUCCESS);
+ return(UX_SUCCESS);
}
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 2a9155b0..641121e9 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
@@ -1,18 +1,19 @@
/***************************************************************************
- * Copyright (c) 2024 Microsoft Corporation
- *
+ * Copyright (c) 2024 Microsoft Corporation
+ * Copyright (c) 2026-present Eclipse ThreadX contributors
+ *
* This program and the accompanying materials are made available under the
* terms of the MIT License which is available at
* https://opensource.org/licenses/MIT.
- *
+ *
* SPDX-License-Identifier: MIT
**************************************************************************/
/**************************************************************************/
/**************************************************************************/
-/** */
-/** USBX Component */
+/** */
+/** USBX Component */
/** */
/** OHCI Controller Driver */
/** */
@@ -29,50 +30,42 @@
#include "ux_host_stack.h"
-/**************************************************************************/
-/* */
-/* FUNCTION RELEASE */
-/* */
-/* _ux_hcd_ohci_request_transfer PORTABLE C */
+/**************************************************************************/
+/* */
+/* FUNCTION RELEASE */
+/* */
+/* _ux_hcd_ohci_request_transfer PORTABLE C */
/* 6.1 */
/* AUTHOR */
/* */
/* Chaoqiong Xiao, Microsoft Corporation */
/* */
/* DESCRIPTION */
-/* */
+/* */
/* This function is the handler for all the transactions on the USB. */
-/* The transfer request passed as parameter contains the endpoint and */
-/* the device descriptors in addition to the type of transaction to */
-/* be executed. */
-/* */
-/* INPUT */
-/* */
-/* hcd_ohci Pointer to OHCI controller */
-/* transfer_request Pointer to transfer request */
-/* */
-/* OUTPUT */
-/* */
-/* Completion Status */
-/* */
-/* CALLS */
-/* */
-/* _ux_hcd_ohci_request_bulk_transfer Start bulk transfer */
+/* The transfer request passed as parameter contains the endpoint and */
+/* the device descriptors in addition to the type of transaction to */
+/* be executed. */
+/* */
+/* INPUT */
+/* */
+/* hcd_ohci Pointer to OHCI controller */
+/* transfer_request Pointer to transfer request */
+/* */
+/* OUTPUT */
+/* */
+/* Completion Status */
+/* */
+/* CALLS */
+/* */
+/* _ux_hcd_ohci_request_bulk_transfer Start bulk transfer */
/* _ux_hcd_ohci_request_control_transfer Start control transfer */
-/* _ux_hcd_ohci_request_interrupt_transfer Start interrupt transfer */
-/* _ux_hcd_ohci_request_isochronous_transfer Start isochronous transfer*/
-/* */
-/* CALLED BY */
-/* */
-/* OHCI Controller Driver */
-/* */
-/* RELEASE HISTORY */
-/* */
-/* DATE NAME DESCRIPTION */
-/* */
-/* 05-19-2020 Chaoqiong Xiao Initial Version 6.0 */
-/* 09-30-2020 Chaoqiong Xiao Modified comment(s), */
-/* resulting in version 6.1 */
+/* _ux_hcd_ohci_request_interrupt_transfer Start interrupt transfer */
+/* _ux_hcd_ohci_request_isochronous_transfer Start isochronous transfer*/
+/* */
+/* CALLED BY */
+/* */
+/* OHCI Controller Driver */
/* */
/**************************************************************************/
UINT _ux_hcd_ohci_request_transfer(UX_HCD_OHCI *hcd_ohci, UX_TRANSFER *transfer_request)
@@ -80,14 +73,14 @@ UINT _ux_hcd_ohci_request_transfer(UX_HCD_OHCI *hcd_ohci, UX_TRANSFER *transfer
UX_ENDPOINT *endpoint;
UINT status;
-
+
/* Get the pointer to the Endpoint. */
endpoint = (UX_ENDPOINT *) transfer_request -> ux_transfer_request_endpoint;
/* We reset the actual length field of the transfer request as a safety measure. */
transfer_request -> ux_transfer_request_actual_length = 0;
-
+
/* Isolate the endpoint type and route the transfer request. */
switch ((endpoint -> ux_endpoint_descriptor.bmAttributes) & UX_MASK_ENDPOINT_TYPE)
{
@@ -125,6 +118,6 @@ UINT status;
so no error checking! */
/* Return completion status. */
- return(status);
+ return(status);
}
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 4e8fa2d8..03fc4d79 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
@@ -1,18 +1,19 @@
/***************************************************************************
- * Copyright (c) 2024 Microsoft Corporation
- *
+ * Copyright (c) 2024 Microsoft Corporation
+ * Copyright (c) 2026-present Eclipse ThreadX contributors
+ *
* This program and the accompanying materials are made available under the
* terms of the MIT License which is available at
* https://opensource.org/licenses/MIT.
- *
+ *
* SPDX-License-Identifier: MIT
**************************************************************************/
/**************************************************************************/
/**************************************************************************/
-/** */
-/** USBX Component */
+/** */
+/** USBX Component */
/** */
/** OHCI Controller Driver */
/** */
@@ -29,52 +30,39 @@
#include "ux_host_stack.h"
-/**************************************************************************/
-/* */
-/* FUNCTION RELEASE */
-/* */
-/* _ux_hcd_ohci_transfer_abort PORTABLE C */
+/**************************************************************************/
+/* */
+/* FUNCTION RELEASE */
+/* */
+/* _ux_hcd_ohci_transfer_abort PORTABLE C */
/* 6.1.2 */
/* AUTHOR */
/* */
/* Chaoqiong Xiao, Microsoft Corporation */
/* */
/* DESCRIPTION */
-/* */
-/* This function will abort transactions attached to a transfer */
-/* request. */
-/* */
-/* INPUT */
-/* */
-/* hcd_ohci Pointer to OHCI controller */
-/* transfer_request Pointer to transfer request */
-/* */
-/* OUTPUT */
-/* */
-/* Completion Status */
-/* */
-/* CALLS */
-/* */
-/* _ux_utility_delay_ms Delay */
-/* _ux_utility_physical_address Get physical address */
-/* _ux_utility_virtual_address Get virtual address */
-/* */
-/* CALLED BY */
-/* */
-/* OHCI Controller Driver */
-/* */
-/* RELEASE HISTORY */
-/* */
-/* DATE NAME DESCRIPTION */
-/* */
-/* 05-19-2020 Chaoqiong Xiao Initial Version 6.0 */
-/* 09-30-2020 Chaoqiong Xiao Modified comment(s), */
-/* fixed physical and virtual */
-/* address conversion, */
-/* resulting in version 6.1 */
-/* 11-09-2020 Chaoqiong Xiao Modified comment(s), */
-/* fixed compile warnings, */
-/* resulting in version 6.1.2 */
+/* */
+/* This function will abort transactions attached to a transfer */
+/* request. */
+/* */
+/* INPUT */
+/* */
+/* hcd_ohci Pointer to OHCI controller */
+/* transfer_request Pointer to transfer request */
+/* */
+/* OUTPUT */
+/* */
+/* Completion Status */
+/* */
+/* CALLS */
+/* */
+/* _ux_utility_delay_ms Delay */
+/* _ux_utility_physical_address Get physical address */
+/* _ux_utility_virtual_address Get virtual address */
+/* */
+/* CALLED BY */
+/* */
+/* OHCI Controller Driver */
/* */
/**************************************************************************/
UINT _ux_hcd_ohci_transfer_abort(UX_HCD_OHCI *hcd_ohci, UX_TRANSFER *transfer_request)
@@ -92,10 +80,10 @@ ULONG value_carry;
/* Get the pointer to the endpoint associated with the transfer request. */
endpoint = (UX_ENDPOINT *) transfer_request -> ux_transfer_request_endpoint;
-
+
/* From the endpoint container, get the address of the physical endpoint. */
ed = (UX_OHCI_ED *) endpoint -> ux_endpoint_ed;
-
+
/* Check if this physical endpoint has been initialized properly! */
if (ed == UX_NULL)
{
@@ -111,7 +99,7 @@ ULONG value_carry;
/* The endpoint may be active. If so, set the skip bit. */
ed -> ux_ohci_ed_dw0 |= UX_OHCI_ED_SKIP;
-
+
/* Wait for the controller to finish the current frame processing. */
_ux_utility_delay_ms(1);
@@ -140,7 +128,7 @@ ULONG value_carry;
head_td = _ux_utility_virtual_address(ed -> ux_ohci_ed_head_td);
}
- /* Restore the value carry for next transfers. */
+ /* Restore the value carry for next transfers. */
value_td = (ULONG) ed -> ux_ohci_ed_head_td;
value_td |= value_carry;
ed -> ux_ohci_ed_head_td = (UX_OHCI_TD *) value_td;
@@ -149,6 +137,6 @@ ULONG value_carry;
ed -> ux_ohci_ed_dw0 &= ~UX_OHCI_ED_SKIP;
/* Return successful completion. */
- return(UX_SUCCESS);
+ return(UX_SUCCESS);
}
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 c4807a9c..d07a337b 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
@@ -1,18 +1,19 @@
/***************************************************************************
- * Copyright (c) 2024 Microsoft Corporation
- *
+ * Copyright (c) 2024 Microsoft Corporation
+ * Copyright (c) 2026-present Eclipse ThreadX contributors
+ *
* This program and the accompanying materials are made available under the
* terms of the MIT License which is available at
* https://opensource.org/licenses/MIT.
- *
+ *
* SPDX-License-Identifier: MIT
**************************************************************************/
/**************************************************************************/
/**************************************************************************/
-/** */
-/** USBX Component */
+/** */
+/** USBX Component */
/** */
/** OHCI Controller Driver */
/** */
@@ -29,60 +30,49 @@
#include "ux_host_stack.h"
-/**************************************************************************/
-/* */
-/* FUNCTION RELEASE */
-/* */
-/* _ux_hcd_ohci_transfer_request_process PORTABLE C */
+/**************************************************************************/
+/* */
+/* FUNCTION RELEASE */
+/* */
+/* _ux_hcd_ohci_transfer_request_process PORTABLE C */
/* 6.1.10 */
/* AUTHOR */
/* */
/* Chaoqiong Xiao, Microsoft Corporation */
/* */
/* DESCRIPTION */
-/* */
-/* This function process the transfer request that was completed */
-/* either with success or because of a partial transmission or */
-/* because of an error. The transfer request descriptor tells us what */
-/* to do with it, either put a semaphore to the caller or invoke a */
-/* completion routine. If a completion routine is specified, the */
-/* routine is called and no semaphore is put. */
-/* */
-/* INPUT */
-/* */
-/* transfer_request Pointer to transfer request */
-/* */
-/* OUTPUT */
-/* */
-/* None */
-/* */
-/* CALLS */
-/* */
-/* (ux_transfer_request_completion_function) Completion function */
-/* _ux_host_semaphore_put Signal transfer complete */
-/* */
-/* CALLED BY */
-/* */
-/* OHCI Controller Driver */
-/* */
-/* RELEASE HISTORY */
-/* */
-/* DATE NAME DESCRIPTION */
-/* */
-/* 05-19-2020 Chaoqiong Xiao Initial Version 6.0 */
-/* 09-30-2020 Chaoqiong Xiao Modified comment(s), */
-/* resulting in version 6.1 */
-/* 01-31-2022 Chaoqiong Xiao Modified comment(s), */
-/* refined macros names, */
-/* resulting in version 6.1.10 */
+/* */
+/* This function process the transfer request that was completed */
+/* either with success or because of a partial transmission or */
+/* because of an error. The transfer request descriptor tells us what */
+/* to do with it, either put a semaphore to the caller or invoke a */
+/* completion routine. If a completion routine is specified, the */
+/* routine is called and no semaphore is put. */
+/* */
+/* INPUT */
+/* */
+/* transfer_request Pointer to transfer request */
+/* */
+/* OUTPUT */
+/* */
+/* None */
+/* */
+/* CALLS */
+/* */
+/* (ux_transfer_request_completion_function) Completion function */
+/* _ux_host_semaphore_put Signal transfer complete */
+/* */
+/* CALLED BY */
+/* */
+/* OHCI Controller Driver */
/* */
/**************************************************************************/
VOID _ux_hcd_ohci_transfer_request_process(UX_TRANSFER *transfer_request)
{
- /* Check if there is a function for the transfer completion. */
+ /* Check if there is a function for the transfer completion. */
if (transfer_request -> ux_transfer_request_completion_function != UX_NULL)
-
+
/* Yes, so we call it! */
transfer_request -> ux_transfer_request_completion_function(transfer_request);
else
diff --git a/common/usbx_network/inc/ux_network_driver.h b/common/usbx_network/inc/ux_network_driver.h
index 4355fbbe..20c02c09 100644
--- a/common/usbx_network/inc/ux_network_driver.h
+++ b/common/usbx_network/inc/ux_network_driver.h
@@ -1,18 +1,19 @@
/***************************************************************************
- * Copyright (c) 2024 Microsoft Corporation
- *
+ * Copyright (c) 2024 Microsoft Corporation
+ * Copyright (c) 2026-present Eclipse ThreadX contributors
+ *
* This program and the accompanying materials are made available under the
* terms of the MIT License which is available at
* https://opensource.org/licenses/MIT.
- *
+ *
* SPDX-License-Identifier: MIT
**************************************************************************/
/**************************************************************************/
/**************************************************************************/
-/** */
-/** USBX Component */
+/** */
+/** USBX Component */
/** */
/** USBX Network Driver for NETX 5.3 and above */
/** */
@@ -20,51 +21,35 @@
/**************************************************************************/
-/**************************************************************************/
-/* */
-/* COMPONENT DEFINITION RELEASE */
-/* */
-/* ux_network_driver.h PORTABLE C */
+/**************************************************************************/
+/* */
+/* COMPONENT DEFINITION RELEASE */
+/* */
+/* ux_network_driver.h PORTABLE C */
/* 6.1.12 */
/* AUTHOR */
/* */
/* Chaoqiong Xiao, Microsoft Corporation */
/* */
/* DESCRIPTION */
-/* */
+/* */
/* This file contains all the header and extern functions used by the */
-/* USBX Network driver. */
-/* */
-/* RELEASE HISTORY */
-/* */
-/* DATE NAME DESCRIPTION */
-/* */
-/* 05-19-2020 Chaoqiong Xiao Initial Version 6.0 */
-/* 09-30-2020 Chaoqiong Xiao Modified comment(s), */
-/* resulting in version 6.1 */
-/* 08-02-2021 Wen Wang Modified comment(s), */
-/* fixed spelling error, */
-/* added extern "C" keyword */
-/* for compatibility with C++, */
-/* resulting in version 6.1.8 */
-/* 07-29-2022 Yajun Xia Modified comment(s), */
-/* fixed ipv6 support issue, */
-/* resulting in version 6.1.12 */
+/* USBX Network driver. */
/* */
/**************************************************************************/
#ifndef UX_NETWORK_DRIVER_H
#define UX_NETWORK_DRIVER_H
-/* Determine if a C++ compiler is being used. If so, ensure that standard
- C is used to process the API information. */
+/* Determine if a C++ compiler is being used. If so, ensure that standard
+ C is used to process the API information. */
-#ifdef __cplusplus
+#ifdef __cplusplus
-/* Yes, C++ compiler is present. Use standard C. */
-extern "C" {
+/* Yes, C++ compiler is present. Use standard C. */
+extern "C" {
-#endif
+#endif
#include "tx_api.h"
#include "nx_api.h"
@@ -102,10 +87,10 @@ typedef struct USB_NETWORK_DEVICE_STRUCT
/* The write_function is populated by USB instance activation. */
UINT (*ux_network_device_write_function)(VOID *ux_instance, NX_PACKET *packet_ptr);
-
+
USHORT ux_network_device_usb_link_up;
USHORT ux_network_device_link_status;
-
+
ULONG ux_network_physical_address_msw;
ULONG ux_network_physical_address_lsw;
@@ -127,10 +112,10 @@ VOID _ux_network_driver_link_up(VOID *ux_network_handle);
VOID _ux_network_driver_link_down(VOID *ux_network_handle);
VOID _ux_network_driver_packet_received(VOID *ux_network_handle, NX_PACKET *packet_ptr);
-/* Determine if a C++ compiler is being used. If so, complete the standard
- C conditional started above. */
+/* Determine if a C++ compiler is being used. If so, complete the standard
+ C conditional started above. */
#ifdef __cplusplus
-}
-#endif
+}
+#endif
#endif
diff --git a/common/usbx_network/src/ux_network_driver.c b/common/usbx_network/src/ux_network_driver.c
index 434b2724..e2365d94 100644
--- a/common/usbx_network/src/ux_network_driver.c
+++ b/common/usbx_network/src/ux_network_driver.c
@@ -1,18 +1,19 @@
/***************************************************************************
- * Copyright (c) 2024 Microsoft Corporation
- *
+ * Copyright (c) 2024 Microsoft Corporation
+ * Copyright (c) 2026-present Eclipse ThreadX contributors
+ *
* This program and the accompanying materials are made available under the
* terms of the MIT License which is available at
* https://opensource.org/licenses/MIT.
- *
+ *
* SPDX-License-Identifier: MIT
**************************************************************************/
/**************************************************************************/
/**************************************************************************/
-/** */
-/** USBX Component */
+/** */
+/** USBX Component */
/** */
/** USBX Network Driver for NETX 5.3 and above. */
/** */
@@ -40,47 +41,34 @@ static UINT usb_network_driver_initialized;
static USB_NETWORK_DEVICE_TYPE usb_network_devices[USB_NETWORK_DEVICE_MAX_INSTANCES];
-/**************************************************************************/
-/* */
-/* FUNCTION RELEASE */
-/* */
-/* _ux_network_init PORTABLE C */
+/**************************************************************************/
+/* */
+/* FUNCTION RELEASE */
+/* */
+/* _ux_network_init PORTABLE C */
/* 6.1.11 */
/* AUTHOR */
/* */
/* Chaoqiong Xiao, Microsoft Corporation */
/* */
/* DESCRIPTION */
-/* */
-/* This function is called by the application to initialize the */
-/* USBX portion of the network driver. */
-/* */
-/* INPUT */
-/* */
-/* */
-/* OUTPUT */
-/* */
-/* */
-/* CALLS */
-/* */
+/* */
+/* This function is called by the application to initialize the */
+/* USBX portion of the network driver. */
+/* */
+/* INPUT */
+/* */
+/* */
+/* OUTPUT */
+/* */
+/* */
+/* CALLS */
+/* */
/* None */
-/* */
-/* CALLED BY */
-/* */
-/* Application */
-/* */
-/* RELEASE HISTORY */
-/* */
-/* DATE NAME DESCRIPTION */
-/* */
-/* 05-19-2020 Chaoqiong Xiao Initial Version 6.0 */
-/* 09-30-2020 Chaoqiong Xiao Modified comment(s), */
-/* verified memset and memcpy */
-/* cases, */
-/* resulting in version 6.1 */
-/* 04-25-2022 Chaoqiong Xiao Modified comment(s), */
-/* fixed standalone compile, */
-/* resulting in version 6.1.11 */
+/* */
+/* CALLED BY */
+/* */
+/* Application */
/* */
/**************************************************************************/
UINT _ux_network_driver_init(VOID)
@@ -98,68 +86,54 @@ UINT status = NX_SUCCESS;
/* Reset the network device memory array. */
_ux_utility_memory_set(&usb_network_devices[0], 0, sizeof(usb_network_devices)); /* Use case of memset is verified. */
}
-
+
return(status);
}
-/**************************************************************************/
-/* */
-/* FUNCTION RELEASE */
-/* */
-/* _ux_network_driver_activate PORTABLE C */
+/**************************************************************************/
+/* */
+/* FUNCTION RELEASE */
+/* */
+/* _ux_network_driver_activate PORTABLE C */
/* 6.1.8 */
/* AUTHOR */
/* */
/* Chaoqiong Xiao, Microsoft Corporation */
/* */
/* DESCRIPTION */
-/* */
+/* */
/* The USB network driver activate function is called as the USB instance */
/* is created. This API takes a pointer to the instance, and returns a */
/* ux_network_handle back to instance. Every time the instance receives */
/* a network packet, it should call ux_network_driver_packet_received with*/
/* ux_network_handle. */
/* */
-/* INPUT */
-/* */
-/* ux_instance Instance of the USBX network class */
-/* ux_network_device_write_function Address of the function to write a */
-/* packet when sent by the application */
-/* ux_network_handle Address where to store the network */
-/* handle */
-/* */
-/* physical_address_msw Most significant word of network ad */
-/* */
-/* physical_address_lsw Least significant word of network ad */
-/* */
-/* */
-/* */
-/* OUTPUT */
-/* */
-/* Result */
-/* */
-/* */
-/* CALLS */
-/* */
+/* INPUT */
+/* */
+/* ux_instance Instance of the USBX network class */
+/* ux_network_device_write_function Address of the function to write a */
+/* packet when sent by the application */
+/* ux_network_handle Address where to store the network */
+/* handle */
+/* */
+/* physical_address_msw Most significant word of network ad */
+/* */
+/* physical_address_lsw Least significant word of network ad */
+/* */
+/* */
+/* */
+/* OUTPUT */
+/* */
+/* Result */
+/* */
+/* */
+/* CALLS */
+/* */
/* None */
-/* */
-/* 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), */
-/* used UX prefix to refer to */
-/* TX symbols instead of using */
-/* them directly, */
-/* resulting in version 6.1 */
-/* 08-02-2021 Wen Wang Modified comment(s), */
-/* fixed spelling error, */
-/* resulting in version 6.1.8 */
+/* */
+/* CALLED BY */
+/* */
+/* Application */
/* */
/**************************************************************************/
@@ -167,13 +141,13 @@ 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)
{
-UX_INTERRUPT_SAVE_AREA
+UX_INTERRUPT_SAVE_AREA
UINT i;
/* Critical section. */
UX_DISABLE
-
+
/* Find an available entry in the usb_network_devices table. */
for (i = 0; i < USB_NETWORK_DEVICE_MAX_INSTANCES; i++)
{
@@ -181,7 +155,7 @@ UINT i;
/* If the ptr to instance is NULL, we have a free entry. */
if (usb_network_devices[i].ux_network_device_usb_instance_ptr == NX_NULL)
{
-
+
/* Add the instance of the USBX class driver to the network device. */
usb_network_devices[i].ux_network_device_usb_instance_ptr = ux_instance;
@@ -202,10 +176,10 @@ UINT i;
/* Return error. */
return(USB_NETWORK_DRIVER_FAILURE);
}
-
+
/* Store the write function. */
usb_network_devices[i].ux_network_device_write_function = ux_network_device_write_function;
-
+
/* Store the physical address of the network interface. */
usb_network_devices[i].ux_network_physical_address_msw = physical_address_msw;
usb_network_devices[i].ux_network_physical_address_lsw = physical_address_lsw;
@@ -225,7 +199,7 @@ UINT i;
/* Is there an interface at the NETX level ? */
if (usb_network_devices[i].ux_network_device_interface_ptr)
{
-
+
/* Store the physical address at the NETX level. */
usb_network_devices[i].ux_network_device_interface_ptr -> nx_interface_physical_address_msw = physical_address_msw;
usb_network_devices[i].ux_network_device_interface_ptr -> nx_interface_physical_address_lsw = physical_address_lsw;
@@ -233,86 +207,72 @@ UINT i;
/* Is the link UP ? */
if (usb_network_devices[i].ux_network_device_interface_ptr -> nx_interface_link_up == NX_TRUE)
- /* Yes, store its state. */
+ /* Yes, store its state. */
usb_network_devices[i].ux_network_device_link_status = NX_TRUE;
}
else
/* Link not yet up. */
- usb_network_devices[i].ux_network_device_link_status = NX_FALSE;
+ usb_network_devices[i].ux_network_device_link_status = NX_FALSE;
/* Is there a network handle associated ? */
if (ux_network_handle)
-
+
/* Yes, the application wants to know its address. */
*ux_network_handle = (VOID*)&usb_network_devices[i];
-
+
/* The operation was successful. */
return(USB_NETWORK_DRIVER_SUCCESS);
}
-/**************************************************************************/
-/* */
-/* FUNCTION RELEASE */
-/* */
-/* _ux_network_driver_deactivate PORTABLE C */
+/**************************************************************************/
+/* */
+/* FUNCTION RELEASE */
+/* */
+/* _ux_network_driver_deactivate PORTABLE C */
/* 6.1.8 */
/* AUTHOR */
/* */
/* Chaoqiong Xiao, Microsoft Corporation */
/* */
/* DESCRIPTION */
-/* */
+/* */
/* The USB network driver activate function is called as the USB instance */
/* is created. This API takes a pointer to the instance, and returns a */
/* ux_network_handle back to instance. Every time the instance receives */
/* a network packet, it should call ux_network_driver_packet_received with*/
/* ux_network_handle. */
/* */
-/* INPUT */
-/* */
-/* ux_instance Instance of the USBX network class */
-/* ux_network_device_write_function Address of the function to write a */
-/* packet when sent by the application */
-/* ux_network_handle Address where to store the network */
-/* handle */
-/* */
-/* physical_address_msw Most significant word of network ad */
-/* */
-/* physical_address_lsw Least significant word of network ad */
-/* */
-/* */
-/* */
-/* OUTPUT */
-/* */
-/* Result */
-/* */
-/* */
-/* CALLS */
-/* */
+/* INPUT */
+/* */
+/* ux_instance Instance of the USBX network class */
+/* ux_network_device_write_function Address of the function to write a */
+/* packet when sent by the application */
+/* ux_network_handle Address where to store the network */
+/* handle */
+/* */
+/* physical_address_msw Most significant word of network ad */
+/* */
+/* physical_address_lsw Least significant word of network ad */
+/* */
+/* */
+/* */
+/* OUTPUT */
+/* */
+/* Result */
+/* */
+/* */
+/* CALLS */
+/* */
/* None */
-/* */
-/* 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), */
-/* used UX prefix to refer to */
-/* TX symbols instead of using */
-/* them directly, */
-/* resulting in version 6.1 */
-/* 08-02-2021 Wen Wang Modified comment(s), */
-/* fixed spelling error, */
-/* resulting in version 6.1.8 */
+/* */
+/* CALLED BY */
+/* */
+/* Application */
/* */
/**************************************************************************/
UINT _ux_network_driver_deactivate(VOID *ux_instance, VOID *ux_network_handle)
@@ -330,10 +290,10 @@ USB_NETWORK_DEVICE_TYPE *usb_network_device;
/* Cast the network handle properly. */
usb_network_device = (USB_NETWORK_DEVICE_TYPE*) ux_network_handle;
-
+
/* Critical section. */
UX_DISABLE
-
+
/* The link is down. */
_ux_network_driver_link_down(ux_network_handle);
@@ -380,10 +340,10 @@ USB_NETWORK_DEVICE_TYPE *usb_network_device;
/* All threads are outside of the instance, and can't re-enter because the
link flag has been set to down. Now we can clean up. */
-
+
/* Reset the instance pointer. */
usb_network_device -> ux_network_device_usb_instance_ptr = NX_NULL;
-
+
/* And the write function ptr. */
usb_network_device -> ux_network_device_write_function = NX_NULL;
@@ -392,61 +352,44 @@ USB_NETWORK_DEVICE_TYPE *usb_network_device;
}
-/**************************************************************************/
-/* */
-/* FUNCTION RELEASE */
-/* */
-/* _ux_network_driver_entry PORTABLE C */
+/**************************************************************************/
+/* */
+/* FUNCTION RELEASE */
+/* */
+/* _ux_network_driver_entry PORTABLE C */
/* 6.2.1 */
/* AUTHOR */
/* */
/* Chaoqiong Xiao, Microsoft Corporation */
/* */
/* DESCRIPTION */
-/* */
+/* */
/* This function is called by NETX. This is the dispatcher to all the */
/* NETX function to the driver layer. */
/* */
-/* INPUT */
-/* */
-/* nx_ip_driver Pointer to the NX_IP driver instance */
-/* */
-/* OUTPUT */
-/* */
-/* Result */
-/* */
-/* */
-/* CALLS */
-/* */
+/* INPUT */
+/* */
+/* nx_ip_driver Pointer to the NX_IP driver instance */
+/* */
+/* OUTPUT */
+/* */
+/* Result */
+/* */
+/* */
+/* CALLS */
+/* */
/* None */
-/* */
-/* CALLED BY */
-/* */
-/* NETX */
-/* */
-/* RELEASE HISTORY */
-/* */
-/* 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 */
-/* 07-29-2022 Yajun Xia Modified comment(s), */
-/* fixed ipv6 support issue, */
-/* resulting in version 6.1.12 */
-/* 03-08-2023 Yajun Xia Modified comment(s), */
-/* fixed build issue with NETX,*/
-/* resulting in version 6.2.1 */
+/* */
+/* CALLED BY */
+/* */
+/* NETX */
/* */
/**************************************************************************/
VOID _ux_network_driver_entry(NX_IP_DRIVER *nx_ip_driver)
{
-
-UX_INTERRUPT_SAVE_AREA
+
+UX_INTERRUPT_SAVE_AREA
NX_IP *nx_ip;
NX_PACKET *packet_ptr;
ULONG *ethernet_frame_ptr;
@@ -455,7 +398,7 @@ USB_NETWORK_DEVICE_TYPE *usb_network_device_ptr;
UINT i;
/* Get the pointer to the NX_IP instance. */
- nx_ip = nx_ip_driver -> nx_ip_driver_ptr;
+ nx_ip = nx_ip_driver -> nx_ip_driver_ptr;
/* Set the default status return. */
nx_ip_driver -> nx_ip_driver_status = NX_NOT_SUCCESSFUL;
@@ -477,9 +420,9 @@ UINT i;
/* If the interface pointer is NULL, it is free. */
if (usb_network_devices[i].ux_network_device_interface_ptr == NX_NULL)
break;
-
+
}
-
+
/* Check if we have ran out of instances. */
if (i == USB_NETWORK_DEVICE_MAX_INSTANCES)
@@ -528,14 +471,14 @@ UINT i;
/* Check if instance exists. */
if (usb_network_device_ptr -> ux_network_device_usb_instance_ptr)
{
-
+
/* Store the physical address in the nx interface. */
nx_interface_ptr -> nx_interface_physical_address_msw = usb_network_device_ptr -> ux_network_physical_address_msw;
nx_interface_ptr -> nx_interface_physical_address_lsw = usb_network_device_ptr -> ux_network_physical_address_lsw;
-
+
}
- else
- {
+ else
+ {
/* Reset the physical address. */
nx_interface_ptr -> nx_interface_physical_address_msw = 0;
@@ -543,35 +486,35 @@ UINT i;
}
/* Operation is successful. */
- nx_ip_driver -> nx_ip_driver_status = NX_SUCCESS;
+ nx_ip_driver -> nx_ip_driver_status = NX_SUCCESS;
break;
-
+
case NX_LINK_ENABLE:
/* Set the link state to UP. */
nx_interface_ptr -> nx_interface_link_up = NX_TRUE;
-
+
/* Reflect link state in network device. */
if (usb_network_device_ptr -> ux_network_device_usb_link_up == NX_TRUE)
usb_network_device_ptr -> ux_network_device_link_status = NX_TRUE;
else
usb_network_device_ptr -> ux_network_device_link_status = NX_FALSE;
-
+
nx_ip_driver -> nx_ip_driver_status = NX_SUCCESS;
break;
-
-
+
+
case NX_LINK_DISABLE:
-
+
/* Set the link down. */
nx_interface_ptr -> nx_interface_link_up = NX_FALSE;
usb_network_device_ptr -> ux_network_device_link_status = NX_FALSE;
- nx_ip_driver -> nx_ip_driver_status = NX_SUCCESS;
+ nx_ip_driver -> nx_ip_driver_status = NX_SUCCESS;
break;
-
+
case NX_LINK_PACKET_SEND:
case NX_LINK_PACKET_BROADCAST:
@@ -603,13 +546,13 @@ UINT i;
/* Adjust the prepend pointer. */
packet_ptr -> nx_packet_prepend_ptr = packet_ptr -> nx_packet_prepend_ptr - NX_ETHERNET_SIZE;
-
+
/* Adjust the packet length. */
packet_ptr -> nx_packet_length = packet_ptr -> nx_packet_length + NX_ETHERNET_SIZE;
-
+
/* Setup the ethernet frame pointer to build the ethernet frame. Back up another 2 bytes to get 32-bit word alignment. */
ethernet_frame_ptr = (ULONG*)(packet_ptr -> nx_packet_prepend_ptr - 2);
-
+
/* Build the ethernet frame. */
*ethernet_frame_ptr = nx_ip_driver -> nx_ip_driver_physical_address_msw;
*(ethernet_frame_ptr + 1) = nx_ip_driver -> nx_ip_driver_physical_address_lsw;
@@ -635,12 +578,12 @@ UINT i;
#ifdef FEATURE_NX_IPV6
else if (packet_ptr -> nx_packet_ip_version == NX_IP_VERSION_V6)
*(ethernet_frame_ptr+3) |= NX_ETHERNET_IPV6;
- else
+ else
{
/* Unknown IP version */
/* free the packet that we will not send */
nx_packet_transmit_release(packet_ptr);
- nx_ip_driver -> nx_ip_driver_status = NX_NOT_SUCCESSFUL;
+ nx_ip_driver -> nx_ip_driver_status = NX_NOT_SUCCESSFUL;
break;
}
#endif /* FEATURE_NX_IPV6 */
@@ -651,9 +594,9 @@ UINT i;
NX_CHANGE_ULONG_ENDIAN(*(ethernet_frame_ptr+1));
NX_CHANGE_ULONG_ENDIAN(*(ethernet_frame_ptr+2));
NX_CHANGE_ULONG_ENDIAN(*(ethernet_frame_ptr+3));
-
+
/* Write the packet or queue it. */
- nx_ip_driver -> nx_ip_driver_status =
+ nx_ip_driver -> nx_ip_driver_status =
usb_network_device_ptr -> ux_network_device_write_function(usb_network_device_ptr -> ux_network_device_usb_instance_ptr,
packet_ptr);
@@ -706,13 +649,13 @@ UINT i;
}
break;
-
+
case NX_LINK_UNINITIALIZE:
usb_network_driver_initialized = 0;
break;
-
+
case NX_LINK_MULTICAST_JOIN:
case NX_LINK_MULTICAST_LEAVE:
case NX_LINK_GET_STATUS:
@@ -724,7 +667,7 @@ UINT i;
case NX_LINK_GET_DUPLEX_TYPE:
case NX_LINK_USER_COMMAND :
default:
-
+
/* Invalid driver request. */
nx_ip_driver -> nx_ip_driver_status = NX_UNHANDLED_COMMAND;
@@ -737,53 +680,38 @@ UINT i;
}
-/**************************************************************************/
-/* */
-/* FUNCTION RELEASE */
-/* */
-/* _ux_network_driver_packet_received PORTABLE C */
+/**************************************************************************/
+/* */
+/* FUNCTION RELEASE */
+/* */
+/* _ux_network_driver_packet_received PORTABLE C */
/* 6.3.0 */
/* AUTHOR */
/* */
/* Chaoqiong Xiao, Microsoft Corporation */
/* */
/* DESCRIPTION */
-/* */
+/* */
/* This function is called by USBX when a packet has been receiver over */
/* the USB. */
/* */
-/* INPUT */
-/* */
-/* ux_network_handle Handle of the USB network instance */
-/* packet_ptr Pointer to packet received */
-/* */
-/* OUTPUT */
-/* */
-/* Result */
-/* */
-/* */
-/* CALLS */
-/* */
+/* INPUT */
+/* */
+/* ux_network_handle Handle of the USB network instance */
+/* packet_ptr Pointer to packet received */
+/* */
+/* OUTPUT */
+/* */
+/* Result */
+/* */
+/* */
+/* CALLS */
+/* */
/* None */
-/* */
-/* CALLED BY */
-/* */
-/* USBX */
-/* */
-/* RELEASE HISTORY */
-/* */
-/* DATE NAME DESCRIPTION */
-/* */
-/* 05-19-2020 Chaoqiong Xiao Initial Version 6.0 */
-/* 09-30-2020 Chaoqiong Xiao Modified comment(s), */
-/* resulting in version 6.1 */
-/* 07-29-2022 Yajun Xia Modified comment(s), */
-/* fixed ipv6 support issue, */
-/* resulting in version 6.1.12 */
-/* 10-31-2023 Chaoqiong Xiao Modified comment(s), */
-/* checked packet data length */
-/* before process the packet, */
-/* resulting in version 6.3.0 */
+/* */
+/* CALLED BY */
+/* */
+/* USBX */
/* */
/**************************************************************************/
@@ -820,13 +748,13 @@ NX_IP *nx_ip;
/* Pickup the packet header to determine where the packet needs to be
sent. */
packet_type = _ux_utility_short_get_big_endian(packet_ptr -> nx_packet_prepend_ptr + 12);
-
+
/* Storing in into the packet the interface. */
packet_ptr -> nx_packet_ip_interface = usb_network_device_ptr -> ux_network_device_interface_ptr;
/* Get the IP instance. */
nx_ip = usb_network_device_ptr -> ux_network_device_ip_instance;
-
+
/* Route the incoming packet according to its ethernet type. */
switch (packet_type)
{
@@ -836,98 +764,90 @@ NX_IP *nx_ip;
case NX_ETHERNET_IPV6 :
#endif /* FEATURE_NX_IPV6 */
- /* Note: The length reported by some Ethernet hardware includes
- bytes after the packet as well as the Ethernet header. In some
- cases, the actual packet length after the Ethernet header should
+ /* Note: The length reported by some Ethernet hardware includes
+ bytes after the packet as well as the Ethernet header. In some
+ cases, the actual packet length after the Ethernet header should
be derived from the length in the IP header (lower 16 bits of
the first 32-bit word). */
-
+
/* Clean off the Ethernet header. */
packet_ptr -> nx_packet_prepend_ptr = packet_ptr -> nx_packet_prepend_ptr + NX_ETHERNET_SIZE;
-
+
/* Adjust the packet length. */
packet_ptr -> nx_packet_length = packet_ptr -> nx_packet_length - NX_ETHERNET_SIZE;
-
+
/* Route to the ip receive function. */
_nx_ip_packet_deferred_receive(nx_ip, packet_ptr);
-
+
break;
-
+
case NX_ETHERNET_ARP :
-
+
/* Clean off the Ethernet header. */
packet_ptr -> nx_packet_prepend_ptr = packet_ptr -> nx_packet_prepend_ptr + NX_ETHERNET_SIZE;
-
+
/* Adjust the packet length. */
packet_ptr -> nx_packet_length = packet_ptr -> nx_packet_length - NX_ETHERNET_SIZE;
-
+
/* Route to the ARP receive function. */
_nx_arp_packet_deferred_receive(nx_ip, packet_ptr);
-
+
break;
-
+
case NX_ETHERNET_RARP :
-
+
/* Clean off the Ethernet header. */
- packet_ptr -> nx_packet_prepend_ptr =
+ packet_ptr -> nx_packet_prepend_ptr =
packet_ptr -> nx_packet_prepend_ptr + NX_ETHERNET_SIZE;
-
+
/* Adjust the packet length. */
- packet_ptr -> nx_packet_length =
+ packet_ptr -> nx_packet_length =
packet_ptr -> nx_packet_length - NX_ETHERNET_SIZE;
-
+
/* Route to the RARP receive function. */
_nx_rarp_packet_deferred_receive(nx_ip, packet_ptr);
-
+
break;
-
-
+
+
default :
-
+
/* Invalid ethernet header... release the packet. */
nx_packet_release(packet_ptr);
}
}
-/**************************************************************************/
-/* */
-/* FUNCTION RELEASE */
-/* */
-/* _ux_network_driver_link_up PORTABLE C */
+/**************************************************************************/
+/* */
+/* FUNCTION RELEASE */
+/* */
+/* _ux_network_driver_link_up PORTABLE C */
/* 6.1 */
/* AUTHOR */
/* */
/* Chaoqiong Xiao, Microsoft Corporation */
/* */
/* DESCRIPTION */
-/* */
+/* */
/* This function is called by USBX when the line link is up */
/* */
-/* INPUT */
-/* */
-/* ux_network_handle Handle of the USB network instance */
-/* */
-/* OUTPUT */
-/* */
-/* Result */
-/* */
-/* */
-/* CALLS */
-/* */
+/* INPUT */
+/* */
+/* ux_network_handle Handle of the USB network instance */
+/* */
+/* OUTPUT */
+/* */
+/* Result */
+/* */
+/* */
+/* CALLS */
+/* */
/* None */
-/* */
-/* CALLED BY */
-/* */
-/* USBX */
-/* */
-/* RELEASE HISTORY */
-/* */
-/* DATE NAME DESCRIPTION */
-/* */
-/* 05-19-2020 Chaoqiong Xiao Initial Version 6.0 */
-/* 09-30-2020 Chaoqiong Xiao Modified comment(s), */
-/* resulting in version 6.1 */
+/* */
+/* CALLED BY */
+/* */
+/* USBX */
/* */
/**************************************************************************/
@@ -935,14 +855,14 @@ VOID _ux_network_driver_link_up(VOID *ux_network_handle)
{
USB_NETWORK_DEVICE_TYPE *usb_network_device_ptr = (USB_NETWORK_DEVICE_TYPE*)ux_network_handle;
-
- /* The USB side of the link is UP. */
+
+ /* The USB side of the link is UP. */
usb_network_device_ptr -> ux_network_device_usb_link_up = NX_TRUE;
/* Check if there is an existing interface. */
if (usb_network_device_ptr -> ux_network_device_interface_ptr)
{
-
+
/* Set link status. */
if (usb_network_device_ptr -> ux_network_device_interface_ptr -> nx_interface_link_up)
usb_network_device_ptr -> ux_network_device_link_status = NX_TRUE;
@@ -952,51 +872,43 @@ USB_NETWORK_DEVICE_TYPE *usb_network_device_ptr = (USB_NETWORK_DEVICE_TYPE*)ux_n
}
-/**************************************************************************/
-/* */
-/* FUNCTION RELEASE */
-/* */
-/* _ux_network_driver_link_down PORTABLE C */
+/**************************************************************************/
+/* */
+/* FUNCTION RELEASE */
+/* */
+/* _ux_network_driver_link_down PORTABLE C */
/* 6.1 */
/* AUTHOR */
/* */
/* Chaoqiong Xiao, Microsoft Corporation */
/* */
/* DESCRIPTION */
-/* */
+/* */
/* This function is called by USBX when the link is down. */
/* */
-/* INPUT */
-/* */
-/* ux_network_handle Handle of the USB network instance */
-/* */
-/* OUTPUT */
-/* */
-/* Result */
-/* */
-/* */
-/* CALLS */
-/* */
+/* INPUT */
+/* */
+/* ux_network_handle Handle of the USB network instance */
+/* */
+/* OUTPUT */
+/* */
+/* Result */
+/* */
+/* */
+/* CALLS */
+/* */
/* None */
-/* */
-/* CALLED BY */
-/* */
-/* USBX */
-/* */
-/* RELEASE HISTORY */
-/* */
-/* DATE NAME DESCRIPTION */
-/* */
-/* 05-19-2020 Chaoqiong Xiao Initial Version 6.0 */
-/* 09-30-2020 Chaoqiong Xiao Modified comment(s), */
-/* resulting in version 6.1 */
+/* */
+/* CALLED BY */
+/* */
+/* USBX */
/* */
/**************************************************************************/
VOID _ux_network_driver_link_down(VOID *ux_network_handle)
{
USB_NETWORK_DEVICE_TYPE *usb_network_device_ptr = (USB_NETWORK_DEVICE_TYPE*)ux_network_handle;
-
+
/* Set the USB link status. */
usb_network_device_ptr -> ux_network_device_usb_link_up = NX_FALSE;
diff --git a/common/usbx_pictbridge/inc/ux_pictbridge.h b/common/usbx_pictbridge/inc/ux_pictbridge.h
index fbdc60dd..188aa604 100644
--- a/common/usbx_pictbridge/inc/ux_pictbridge.h
+++ b/common/usbx_pictbridge/inc/ux_pictbridge.h
@@ -1,18 +1,19 @@
/***************************************************************************
- * Copyright (c) 2024 Microsoft Corporation
- *
+ * Copyright (c) 2024 Microsoft Corporation
+ * Copyright (c) 2026-present Eclipse ThreadX contributors
+ *
* This program and the accompanying materials are made available under the
* terms of the MIT License which is available at
* https://opensource.org/licenses/MIT.
- *
+ *
* SPDX-License-Identifier: MIT
**************************************************************************/
/**************************************************************************/
/**************************************************************************/
-/** */
-/** USBX Component */
+/** */
+/** USBX Component */
/** */
/** Pictbridge Application */
/** */
@@ -20,57 +21,39 @@
/**************************************************************************/
-/**************************************************************************/
-/* */
-/* COMPONENT DEFINITION RELEASE */
-/* */
-/* ux_pictbridge.h PORTABLE C */
+/**************************************************************************/
+/* */
+/* COMPONENT DEFINITION RELEASE */
+/* */
+/* ux_pictbridge.h PORTABLE C */
/* 6.1.12 */
/* AUTHOR */
/* */
/* Chaoqiong Xiao, Microsoft Corporation */
/* */
/* DESCRIPTION */
-/* */
+/* */
/* This file contains all the header and extern functions used by the */
-/* USBX Pictbridge application */
-/* */
-/* RELEASE HISTORY */
-/* */
-/* 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 */
-/* 08-02-2021 Wen Wang Modified comment(s), */
-/* added extern "C" keyword */
-/* for compatibility with C++, */
-/* resulting in version 6.1.8 */
-/* 07-29-2022 Chaoqiong Xiao Modified comment(s), */
-/* added magic number defines, */
-/* resulting in version 6.1.12 */
+/* USBX Pictbridge application */
/* */
/**************************************************************************/
#ifndef UX_PICTBRIDGE_H
#define UX_PICTBRIDGE_H
-/* Determine if a C++ compiler is being used. If so, ensure that standard
- C is used to process the API information. */
+/* Determine if a C++ compiler is being used. If so, ensure that standard
+ C is used to process the API information. */
-#ifdef __cplusplus
+#ifdef __cplusplus
-/* Yes, C++ compiler is present. Use standard C. */
-extern "C" {
+/* Yes, C++ compiler is present. Use standard C. */
+extern "C" {
-#endif
+#endif
struct UX_PICTBRIDGE_STRUCT;
-/* Define the behaviour of this Pictbridge device : DPSHOST or DPSCLIENT.
+/* Define the behaviour of this Pictbridge device : DPSHOST or DPSCLIENT.
This should be done in the project management tool. */
#ifndef UX_PICTBRIDGE_DPSHOST_NO
#define UX_PICTBRIDGE_DPSHOST
@@ -92,7 +75,7 @@ struct UX_PICTBRIDGE_STRUCT;
/* Define PICTBRIDGE main equivalences. */
#define UX_PICTBRIDGE_MAX_FILE_NAME_SIZE 63
-#define UX_PICTBRIDGE_MAX_TAG_SIZE 64
+#define UX_PICTBRIDGE_MAX_TAG_SIZE 64
#define UX_PICTBRIDGE_MAX_ELEMENT_SIZE 128
#define UX_PICTBRIDGE_MAX_TAG_DEPTH 16
#define UX_PICTBRIDGE_MAX_VARIABLE_SIZE 128
@@ -402,32 +385,32 @@ struct UX_PICTBRIDGE_STRUCT;
#define UX_PICTBRIDGE_FILE_TYPES_EXIF_JPEG 0x53010000
#define UX_PICTBRIDGE_FILE_TYPES_OTHER_EXIF 0x53020000
#define UX_PICTBRIDGE_FILE_TYPES_JPEG 0x53030000
-#define UX_PICTBRIDGE_FILE_TYPES_TIFF_EP 0x53040000
-#define UX_PICTBRIDGE_FILE_TYPES_FLASHPIX 0x53050000
-#define UX_PICTBRIDGE_FILE_TYPES_BMP 0x53060000
-#define UX_PICTBRIDGE_FILE_TYPES_CIFF 0x53070000
-#define UX_PICTBRIDGE_FILE_TYPES_GIF 0x53080000
-#define UX_PICTBRIDGE_FILE_TYPES_JFIF 0x53090000
-#define UX_PICTBRIDGE_FILE_TYPES_PCD 0x530A0000
-#define UX_PICTBRIDGE_FILE_TYPES_PICT 0x530B0000
-#define UX_PICTBRIDGE_FILE_TYPES_PNG 0x530C0000
-#define UX_PICTBRIDGE_FILE_TYPES_TIFF 0x530D0000
-#define UX_PICTBRIDGE_FILE_TYPES_TIFF_IT 0x530E0000
-#define UX_PICTBRIDGE_FILE_TYPES_JP2 0x530F0000
-#define UX_PICTBRIDGE_FILE_TYPES_JPX 0x53110000
-#define UX_PICTBRIDGE_FILE_TYPES_UNDEFINED 0x53120000
-#define UX_PICTBRIDGE_FILE_TYPES_ASSOCIATION 0x53130000
-#define UX_PICTBRIDGE_FILE_TYPES_SCRIPT 0x53140000
-#define UX_PICTBRIDGE_FILE_TYPES_EXECUTABLE 0x53150000
-#define UX_PICTBRIDGE_FILE_TYPES_TEXT 0x53160000
-#define UX_PICTBRIDGE_FILE_TYPES_HTML 0x53170000
-#define UX_PICTBRIDGE_FILE_TYPES_DPOF 0x53180000
-#define UX_PICTBRIDGE_FILE_TYPES_AIFF 0x53190000
-#define UX_PICTBRIDGE_FILE_TYPES_WAV 0x531A0000
-#define UX_PICTBRIDGE_FILE_TYPES_MP3 0x531B0000
-#define UX_PICTBRIDGE_FILE_TYPES_AVI 0x531C0000
-#define UX_PICTBRIDGE_FILE_TYPES_MPEG 0x531D0000
-#define UX_PICTBRIDGE_FILE_TYPES_ASF 0x531E0000
+#define UX_PICTBRIDGE_FILE_TYPES_TIFF_EP 0x53040000
+#define UX_PICTBRIDGE_FILE_TYPES_FLASHPIX 0x53050000
+#define UX_PICTBRIDGE_FILE_TYPES_BMP 0x53060000
+#define UX_PICTBRIDGE_FILE_TYPES_CIFF 0x53070000
+#define UX_PICTBRIDGE_FILE_TYPES_GIF 0x53080000
+#define UX_PICTBRIDGE_FILE_TYPES_JFIF 0x53090000
+#define UX_PICTBRIDGE_FILE_TYPES_PCD 0x530A0000
+#define UX_PICTBRIDGE_FILE_TYPES_PICT 0x530B0000
+#define UX_PICTBRIDGE_FILE_TYPES_PNG 0x530C0000
+#define UX_PICTBRIDGE_FILE_TYPES_TIFF 0x530D0000
+#define UX_PICTBRIDGE_FILE_TYPES_TIFF_IT 0x530E0000
+#define UX_PICTBRIDGE_FILE_TYPES_JP2 0x530F0000
+#define UX_PICTBRIDGE_FILE_TYPES_JPX 0x53110000
+#define UX_PICTBRIDGE_FILE_TYPES_UNDEFINED 0x53120000
+#define UX_PICTBRIDGE_FILE_TYPES_ASSOCIATION 0x53130000
+#define UX_PICTBRIDGE_FILE_TYPES_SCRIPT 0x53140000
+#define UX_PICTBRIDGE_FILE_TYPES_EXECUTABLE 0x53150000
+#define UX_PICTBRIDGE_FILE_TYPES_TEXT 0x53160000
+#define UX_PICTBRIDGE_FILE_TYPES_HTML 0x53170000
+#define UX_PICTBRIDGE_FILE_TYPES_DPOF 0x53180000
+#define UX_PICTBRIDGE_FILE_TYPES_AIFF 0x53190000
+#define UX_PICTBRIDGE_FILE_TYPES_WAV 0x531A0000
+#define UX_PICTBRIDGE_FILE_TYPES_MP3 0x531B0000
+#define UX_PICTBRIDGE_FILE_TYPES_AVI 0x531C0000
+#define UX_PICTBRIDGE_FILE_TYPES_MPEG 0x531D0000
+#define UX_PICTBRIDGE_FILE_TYPES_ASF 0x531E0000
/* Define Pictbridge action result codes. */
@@ -632,7 +615,7 @@ typedef struct UX_PICTBRIDGE_EVENT_STRUCT
ULONG ux_pictbridge_event_parameter_1;
ULONG ux_pictbridge_event_parameter_2;
ULONG ux_pictbridge_event_parameter_3;
-
+
} UX_PICTBRIDGE_EVENT;
/* Define Pictbridge structure. */
@@ -698,49 +681,49 @@ UINT _ux_pictbridge_xml_function_input_getcapability_capability_layouts(UX_PICT
UINT _ux_pictbridge_xml_function_input_getcapability_capability_papertypes(UX_PICTBRIDGE *pictbridge, UCHAR *input_variable, UCHAR *input_string, UCHAR *xml_parameter);
UINT _ux_pictbridge_xml_function_input_startjob(UX_PICTBRIDGE *pictbridge, UCHAR *input_variable, UCHAR *input_string, UCHAR *xml_parameter);
UINT _ux_pictbridge_xml_function_input_startjob_printinfo(UX_PICTBRIDGE *pictbridge, UCHAR *input_variable, UCHAR *input_string, UCHAR *xml_parameter);
-UINT _ux_pictbridge_xml_function_input_startjob_jobconfig_quality(UX_PICTBRIDGE *pictbridge, UCHAR *input_variable, UCHAR *input_string, UCHAR *xml_parameter);
-UINT _ux_pictbridge_xml_function_input_startjob_jobconfig_papersize(UX_PICTBRIDGE *pictbridge, UCHAR *input_variable, UCHAR *input_string, UCHAR *xml_parameter);
-UINT _ux_pictbridge_xml_function_input_startjob_jobconfig_papertype(UX_PICTBRIDGE *pictbridge, UCHAR *input_variable, UCHAR *input_string, UCHAR *xml_parameter);
-UINT _ux_pictbridge_xml_function_input_startjob_jobconfig_filetype(UX_PICTBRIDGE *pictbridge, UCHAR *input_variable, UCHAR *input_string, UCHAR *xml_parameter);
-UINT _ux_pictbridge_xml_function_input_startjob_jobconfig_dateprint(UX_PICTBRIDGE *pictbridge, UCHAR *input_variable, UCHAR *input_string, UCHAR *xml_parameter);
-UINT _ux_pictbridge_xml_function_input_startjob_jobconfig_filenameprint(UX_PICTBRIDGE *pictbridge, UCHAR *input_variable, UCHAR *input_string, UCHAR *xml_parameter);
-UINT _ux_pictbridge_xml_function_input_startjob_jobconfig_imageoptimize(UX_PICTBRIDGE *pictbridge, UCHAR *input_variable, UCHAR *input_string, UCHAR *xml_parameter);
-UINT _ux_pictbridge_xml_function_input_startjob_jobconfig_layout(UX_PICTBRIDGE *pictbridge, UCHAR *input_variable, UCHAR *input_string, UCHAR *xml_parameter);
-UINT _ux_pictbridge_xml_function_input_startjob_jobconfig_fixedsize(UX_PICTBRIDGE *pictbridge, UCHAR *input_variable, UCHAR *input_string, UCHAR *xml_parameter);
-UINT _ux_pictbridge_xml_function_input_startjob_jobconfig_cropping(UX_PICTBRIDGE *pictbridge, UCHAR *input_variable, UCHAR *input_string, UCHAR *xml_parameter);
-UINT _ux_pictbridge_xml_function_input_startjob_printinfo_croppingarea(UX_PICTBRIDGE *pictbridge, UCHAR *input_variable, UCHAR *input_string, UCHAR *xml_parameter);
-UINT _ux_pictbridge_xml_function_input_startjob_printinfo_fileid(UX_PICTBRIDGE *pictbridge, UCHAR *input_variable, UCHAR *input_string, UCHAR *xml_parameter);
-UINT _ux_pictbridge_xml_function_input_startjob_printinfo_filename(UX_PICTBRIDGE *pictbridge, UCHAR *input_variable, UCHAR *input_string, UCHAR *xml_parameter);
-UINT _ux_pictbridge_xml_function_input_startjob_printinfo_date(UX_PICTBRIDGE *pictbridge, UCHAR *input_variable, UCHAR *input_string, UCHAR *xml_parameter);
-UINT _ux_pictbridge_xml_function_input_startjob_printinfo_copies(UX_PICTBRIDGE *pictbridge, UCHAR *input_variable, UCHAR *input_string, UCHAR *xml_parameter);
-UINT _ux_pictbridge_xml_function_input_startjob_printinfo_prtpid(UX_PICTBRIDGE *pictbridge, UCHAR *input_variable, UCHAR *input_string, UCHAR *xml_parameter);
-UINT _ux_pictbridge_xml_function_input_startjob_printinfo_filepath(UX_PICTBRIDGE *pictbridge, UCHAR *input_variable, UCHAR *input_string, UCHAR *xml_parameter);
-UINT _ux_pictbridge_xml_function_input_startjob_printinfo_copyid(UX_PICTBRIDGE *pictbridge, UCHAR *input_variable, UCHAR *input_string, UCHAR *xml_parameter);
-UINT _ux_pictbridge_xml_function_input_notifydevicestatus_dpsprintservicestatus(UX_PICTBRIDGE *pictbridge, UCHAR *input_variable, UCHAR *input_string, UCHAR *xml_parameter);
-UINT _ux_pictbridge_xml_function_input_notifydevicestatus_jobendreason(UX_PICTBRIDGE *pictbridge, UCHAR *input_variable, UCHAR *input_string, UCHAR *xml_parameter);
-UINT _ux_pictbridge_xml_function_input_notifydevicestatus_errorstatus(UX_PICTBRIDGE *pictbridge, UCHAR *input_variable, UCHAR *input_string, UCHAR *xml_parameter);
-UINT _ux_pictbridge_xml_function_input_notifydevicestatus_errorreason(UX_PICTBRIDGE *pictbridge, UCHAR *input_variable, UCHAR *input_string, UCHAR *xml_parameter);
-UINT _ux_pictbridge_xml_function_input_notifydevicestatus_capabilitychanged(UX_PICTBRIDGE *pictbridge, UCHAR *input_variable, UCHAR *input_string, UCHAR *xml_parameter);
-UINT _ux_pictbridge_xml_function_input_notifydevicestatus_disconnectenable(UX_PICTBRIDGE *pictbridge, UCHAR *input_variable, UCHAR *input_string, UCHAR *xml_parameter);
-UINT _ux_pictbridge_xml_function_input_notifydevicestatus_newjobok(UX_PICTBRIDGE *pictbridge, UCHAR *input_variable, UCHAR *input_string, UCHAR *xml_parameter);
+UINT _ux_pictbridge_xml_function_input_startjob_jobconfig_quality(UX_PICTBRIDGE *pictbridge, UCHAR *input_variable, UCHAR *input_string, UCHAR *xml_parameter);
+UINT _ux_pictbridge_xml_function_input_startjob_jobconfig_papersize(UX_PICTBRIDGE *pictbridge, UCHAR *input_variable, UCHAR *input_string, UCHAR *xml_parameter);
+UINT _ux_pictbridge_xml_function_input_startjob_jobconfig_papertype(UX_PICTBRIDGE *pictbridge, UCHAR *input_variable, UCHAR *input_string, UCHAR *xml_parameter);
+UINT _ux_pictbridge_xml_function_input_startjob_jobconfig_filetype(UX_PICTBRIDGE *pictbridge, UCHAR *input_variable, UCHAR *input_string, UCHAR *xml_parameter);
+UINT _ux_pictbridge_xml_function_input_startjob_jobconfig_dateprint(UX_PICTBRIDGE *pictbridge, UCHAR *input_variable, UCHAR *input_string, UCHAR *xml_parameter);
+UINT _ux_pictbridge_xml_function_input_startjob_jobconfig_filenameprint(UX_PICTBRIDGE *pictbridge, UCHAR *input_variable, UCHAR *input_string, UCHAR *xml_parameter);
+UINT _ux_pictbridge_xml_function_input_startjob_jobconfig_imageoptimize(UX_PICTBRIDGE *pictbridge, UCHAR *input_variable, UCHAR *input_string, UCHAR *xml_parameter);
+UINT _ux_pictbridge_xml_function_input_startjob_jobconfig_layout(UX_PICTBRIDGE *pictbridge, UCHAR *input_variable, UCHAR *input_string, UCHAR *xml_parameter);
+UINT _ux_pictbridge_xml_function_input_startjob_jobconfig_fixedsize(UX_PICTBRIDGE *pictbridge, UCHAR *input_variable, UCHAR *input_string, UCHAR *xml_parameter);
+UINT _ux_pictbridge_xml_function_input_startjob_jobconfig_cropping(UX_PICTBRIDGE *pictbridge, UCHAR *input_variable, UCHAR *input_string, UCHAR *xml_parameter);
+UINT _ux_pictbridge_xml_function_input_startjob_printinfo_croppingarea(UX_PICTBRIDGE *pictbridge, UCHAR *input_variable, UCHAR *input_string, UCHAR *xml_parameter);
+UINT _ux_pictbridge_xml_function_input_startjob_printinfo_fileid(UX_PICTBRIDGE *pictbridge, UCHAR *input_variable, UCHAR *input_string, UCHAR *xml_parameter);
+UINT _ux_pictbridge_xml_function_input_startjob_printinfo_filename(UX_PICTBRIDGE *pictbridge, UCHAR *input_variable, UCHAR *input_string, UCHAR *xml_parameter);
+UINT _ux_pictbridge_xml_function_input_startjob_printinfo_date(UX_PICTBRIDGE *pictbridge, UCHAR *input_variable, UCHAR *input_string, UCHAR *xml_parameter);
+UINT _ux_pictbridge_xml_function_input_startjob_printinfo_copies(UX_PICTBRIDGE *pictbridge, UCHAR *input_variable, UCHAR *input_string, UCHAR *xml_parameter);
+UINT _ux_pictbridge_xml_function_input_startjob_printinfo_prtpid(UX_PICTBRIDGE *pictbridge, UCHAR *input_variable, UCHAR *input_string, UCHAR *xml_parameter);
+UINT _ux_pictbridge_xml_function_input_startjob_printinfo_filepath(UX_PICTBRIDGE *pictbridge, UCHAR *input_variable, UCHAR *input_string, UCHAR *xml_parameter);
+UINT _ux_pictbridge_xml_function_input_startjob_printinfo_copyid(UX_PICTBRIDGE *pictbridge, UCHAR *input_variable, UCHAR *input_string, UCHAR *xml_parameter);
+UINT _ux_pictbridge_xml_function_input_notifydevicestatus_dpsprintservicestatus(UX_PICTBRIDGE *pictbridge, UCHAR *input_variable, UCHAR *input_string, UCHAR *xml_parameter);
+UINT _ux_pictbridge_xml_function_input_notifydevicestatus_jobendreason(UX_PICTBRIDGE *pictbridge, UCHAR *input_variable, UCHAR *input_string, UCHAR *xml_parameter);
+UINT _ux_pictbridge_xml_function_input_notifydevicestatus_errorstatus(UX_PICTBRIDGE *pictbridge, UCHAR *input_variable, UCHAR *input_string, UCHAR *xml_parameter);
+UINT _ux_pictbridge_xml_function_input_notifydevicestatus_errorreason(UX_PICTBRIDGE *pictbridge, UCHAR *input_variable, UCHAR *input_string, UCHAR *xml_parameter);
+UINT _ux_pictbridge_xml_function_input_notifydevicestatus_capabilitychanged(UX_PICTBRIDGE *pictbridge, UCHAR *input_variable, UCHAR *input_string, UCHAR *xml_parameter);
+UINT _ux_pictbridge_xml_function_input_notifydevicestatus_disconnectenable(UX_PICTBRIDGE *pictbridge, UCHAR *input_variable, UCHAR *input_string, UCHAR *xml_parameter);
+UINT _ux_pictbridge_xml_function_input_notifydevicestatus_newjobok(UX_PICTBRIDGE *pictbridge, UCHAR *input_variable, UCHAR *input_string, UCHAR *xml_parameter);
UINT _ux_pictbridge_xml_function_output_result(UX_PICTBRIDGE *pictbridge, UCHAR *input_variable, UCHAR *input_string, UCHAR *xml_parameter);
-UINT _ux_pictbridge_xml_function_output_getcapability_capability_qualities(UX_PICTBRIDGE *pictbridge, UCHAR *input_variable, UCHAR *input_string, UCHAR *xml_parameter);
-UINT _ux_pictbridge_xml_function_output_getcapability_capability_papersizes(UX_PICTBRIDGE *pictbridge, UCHAR *input_variable, UCHAR *input_string, UCHAR *xml_parameter);
-UINT _ux_pictbridge_xml_function_output_getcapability_capability_filetypes(UX_PICTBRIDGE *pictbridge, UCHAR *input_variable, UCHAR *input_string, UCHAR *xml_parameter);
-UINT _ux_pictbridge_xml_function_output_getcapability_capability_dateprints(UX_PICTBRIDGE *pictbridge, UCHAR *input_variable, UCHAR *input_string, UCHAR *xml_parameter);
-UINT _ux_pictbridge_xml_function_output_getcapability_capability_filenameprints(UX_PICTBRIDGE *pictbridge, UCHAR *input_variable, UCHAR *input_string, UCHAR *xml_parameter);
-UINT _ux_pictbridge_xml_function_output_getcapability_capability_imageoptimizes(UX_PICTBRIDGE *pictbridge, UCHAR *input_variable, UCHAR *input_string, UCHAR *xml_parameter);
-UINT _ux_pictbridge_xml_function_output_getcapability_capability_fixedsizes(UX_PICTBRIDGE *pictbridge, UCHAR *input_variable, UCHAR *input_string, UCHAR *xml_parameter);
-UINT _ux_pictbridge_xml_function_output_getcapability_capability_croppings(UX_PICTBRIDGE *pictbridge, UCHAR *input_variable, UCHAR *input_string, UCHAR *xml_parameter);
-UINT _ux_pictbridge_xml_function_output_getcapability_capability_papertypes(UX_PICTBRIDGE *pictbridge, UCHAR *input_variable, UCHAR *input_string, UCHAR *xml_parameter);
-UINT _ux_pictbridge_xml_function_output_getcapability_capability_layouts(UX_PICTBRIDGE *pictbridge, UCHAR *input_variable, UCHAR *input_string, UCHAR *xml_parameter);
-UINT _ux_pictbridge_xml_function_output_getdevicestatus_dpsprintservicestatus(UX_PICTBRIDGE *pictbridge, UCHAR *input_variable, UCHAR *input_string, UCHAR *xml_parameter);
-UINT _ux_pictbridge_xml_function_output_getdevicestatus_jobendreason(UX_PICTBRIDGE *pictbridge, UCHAR *input_variable, UCHAR *input_string, UCHAR *xml_parameter);
-UINT _ux_pictbridge_xml_function_output_getdevicestatus_errorstatus(UX_PICTBRIDGE *pictbridge, UCHAR *input_variable, UCHAR *input_string, UCHAR *xml_parameter);
-UINT _ux_pictbridge_xml_function_output_getdevicestatus_errorreason(UX_PICTBRIDGE *pictbridge, UCHAR *input_variable, UCHAR *input_string, UCHAR *xml_parameter);
-UINT _ux_pictbridge_xml_function_output_getdevicestatus_disconnectenable(UX_PICTBRIDGE *pictbridge, UCHAR *input_variable, UCHAR *input_string, UCHAR *xml_parameter);
-UINT _ux_pictbridge_xml_function_output_getdevicestatus_capabilitychanged(UX_PICTBRIDGE *pictbridge, UCHAR *input_variable, UCHAR *input_string, UCHAR *xml_parameter);
-UINT _ux_pictbridge_xml_function_output_getdevicestatus_newjobok(UX_PICTBRIDGE *pictbridge, UCHAR *input_variable, UCHAR *input_string, UCHAR *xml_parameter);
+UINT _ux_pictbridge_xml_function_output_getcapability_capability_qualities(UX_PICTBRIDGE *pictbridge, UCHAR *input_variable, UCHAR *input_string, UCHAR *xml_parameter);
+UINT _ux_pictbridge_xml_function_output_getcapability_capability_papersizes(UX_PICTBRIDGE *pictbridge, UCHAR *input_variable, UCHAR *input_string, UCHAR *xml_parameter);
+UINT _ux_pictbridge_xml_function_output_getcapability_capability_filetypes(UX_PICTBRIDGE *pictbridge, UCHAR *input_variable, UCHAR *input_string, UCHAR *xml_parameter);
+UINT _ux_pictbridge_xml_function_output_getcapability_capability_dateprints(UX_PICTBRIDGE *pictbridge, UCHAR *input_variable, UCHAR *input_string, UCHAR *xml_parameter);
+UINT _ux_pictbridge_xml_function_output_getcapability_capability_filenameprints(UX_PICTBRIDGE *pictbridge, UCHAR *input_variable, UCHAR *input_string, UCHAR *xml_parameter);
+UINT _ux_pictbridge_xml_function_output_getcapability_capability_imageoptimizes(UX_PICTBRIDGE *pictbridge, UCHAR *input_variable, UCHAR *input_string, UCHAR *xml_parameter);
+UINT _ux_pictbridge_xml_function_output_getcapability_capability_fixedsizes(UX_PICTBRIDGE *pictbridge, UCHAR *input_variable, UCHAR *input_string, UCHAR *xml_parameter);
+UINT _ux_pictbridge_xml_function_output_getcapability_capability_croppings(UX_PICTBRIDGE *pictbridge, UCHAR *input_variable, UCHAR *input_string, UCHAR *xml_parameter);
+UINT _ux_pictbridge_xml_function_output_getcapability_capability_papertypes(UX_PICTBRIDGE *pictbridge, UCHAR *input_variable, UCHAR *input_string, UCHAR *xml_parameter);
+UINT _ux_pictbridge_xml_function_output_getcapability_capability_layouts(UX_PICTBRIDGE *pictbridge, UCHAR *input_variable, UCHAR *input_string, UCHAR *xml_parameter);
+UINT _ux_pictbridge_xml_function_output_getdevicestatus_dpsprintservicestatus(UX_PICTBRIDGE *pictbridge, UCHAR *input_variable, UCHAR *input_string, UCHAR *xml_parameter);
+UINT _ux_pictbridge_xml_function_output_getdevicestatus_jobendreason(UX_PICTBRIDGE *pictbridge, UCHAR *input_variable, UCHAR *input_string, UCHAR *xml_parameter);
+UINT _ux_pictbridge_xml_function_output_getdevicestatus_errorstatus(UX_PICTBRIDGE *pictbridge, UCHAR *input_variable, UCHAR *input_string, UCHAR *xml_parameter);
+UINT _ux_pictbridge_xml_function_output_getdevicestatus_errorreason(UX_PICTBRIDGE *pictbridge, UCHAR *input_variable, UCHAR *input_string, UCHAR *xml_parameter);
+UINT _ux_pictbridge_xml_function_output_getdevicestatus_disconnectenable(UX_PICTBRIDGE *pictbridge, UCHAR *input_variable, UCHAR *input_string, UCHAR *xml_parameter);
+UINT _ux_pictbridge_xml_function_output_getdevicestatus_capabilitychanged(UX_PICTBRIDGE *pictbridge, UCHAR *input_variable, UCHAR *input_string, UCHAR *xml_parameter);
+UINT _ux_pictbridge_xml_function_output_getdevicestatus_newjobok(UX_PICTBRIDGE *pictbridge, UCHAR *input_variable, UCHAR *input_string, UCHAR *xml_parameter);
/* Remapping of pictbridge functions that point to a NULL function.. */
@@ -819,62 +802,62 @@ UINT _ux_pictbridge_dpsclient_object_data_send(UX_SLAVE_CLASS_PIMA *pima, ULONG
UCHAR *object_buffer, ULONG object_offset,
ULONG object_length);
UINT _ux_pictbridge_dpsclient_object_number_get(UX_SLAVE_CLASS_PIMA *pima, ULONG object_format_code, ULONG object_association, ULONG *number_objects);
-UINT _ux_pictbridge_dpsclient_object_info_get(UX_SLAVE_CLASS_PIMA *pima, ULONG object_handle,
+UINT _ux_pictbridge_dpsclient_object_info_get(UX_SLAVE_CLASS_PIMA *pima, ULONG object_handle,
UX_SLAVE_CLASS_PIMA_OBJECT **object);
-UINT _ux_pictbridge_dpsclient_object_info_send(UX_SLAVE_CLASS_PIMA *pima, UX_SLAVE_CLASS_PIMA_OBJECT *object,
+UINT _ux_pictbridge_dpsclient_object_info_send(UX_SLAVE_CLASS_PIMA *pima, UX_SLAVE_CLASS_PIMA_OBJECT *object,
ULONG storage_id, ULONG parent_object_handle, ULONG *object_handle);
UINT _ux_pictbridge_dpsclient_object_delete(UX_SLAVE_CLASS_PIMA *pima, ULONG object_handle);
-UINT _ux_pictbridge_dpsclient_object_handles_get(UX_SLAVE_CLASS_PIMA *pima,
- ULONG object_handles_format_code,
- ULONG object_handles_association,
+UINT _ux_pictbridge_dpsclient_object_handles_get(UX_SLAVE_CLASS_PIMA *pima,
+ ULONG object_handles_format_code,
+ ULONG object_handles_association,
ULONG *object_handles_array,
ULONG object_handles_max_number);
-UINT _ux_pictbridge_dpsclient_input_object_prepare(UX_PICTBRIDGE *pictbridge,
- ULONG input_function,
+UINT _ux_pictbridge_dpsclient_input_object_prepare(UX_PICTBRIDGE *pictbridge,
+ ULONG input_function,
ULONG input_subfunction,
ULONG input_parameter);
-UINT _ux_pictbridge_dpsclient_input_object_configure_print_service(UX_PICTBRIDGE *pictbridge,
- UCHAR *pima_object_buffer,
- ULONG object_length,
- UCHAR **pima_object_buffer_updated,
+UINT _ux_pictbridge_dpsclient_input_object_configure_print_service(UX_PICTBRIDGE *pictbridge,
+ UCHAR *pima_object_buffer,
+ ULONG object_length,
+ UCHAR **pima_object_buffer_updated,
ULONG *object_length_updated);
-UINT _ux_pictbridge_dpsclient_input_object_get_capability(UX_PICTBRIDGE *pictbridge,
+UINT _ux_pictbridge_dpsclient_input_object_get_capability(UX_PICTBRIDGE *pictbridge,
ULONG input_subcode,
ULONG input_parameter,
- UCHAR *pima_object_buffer,
- ULONG object_length,
- UCHAR **pima_object_buffer_updated,
+ UCHAR *pima_object_buffer,
+ ULONG object_length,
+ UCHAR **pima_object_buffer_updated,
ULONG *object_length_updated);
-UINT _ux_pictbridge_dpsclient_input_object_startjob(UX_PICTBRIDGE *pictbridge,
+UINT _ux_pictbridge_dpsclient_input_object_startjob(UX_PICTBRIDGE *pictbridge,
ULONG input_subcode,
ULONG input_parameter,
- UCHAR *pima_object_buffer,
- ULONG object_length,
- UCHAR **pima_object_buffer_updated,
+ UCHAR *pima_object_buffer,
+ ULONG object_length,
+ UCHAR **pima_object_buffer_updated,
ULONG *object_length_updated);
-UINT _ux_pictbridge_dpsclient_input_object_abortjob(UX_PICTBRIDGE *pictbridge,
+UINT _ux_pictbridge_dpsclient_input_object_abortjob(UX_PICTBRIDGE *pictbridge,
ULONG input_subcode,
ULONG input_parameter,
- UCHAR *pima_object_buffer,
- ULONG object_length,
- UCHAR **pima_object_buffer_updated,
+ UCHAR *pima_object_buffer,
+ ULONG object_length,
+ UCHAR **pima_object_buffer_updated,
ULONG *object_length_updated);
-UINT _ux_pictbridge_dpsclient_input_object_continuejob(UX_PICTBRIDGE *pictbridge,
+UINT _ux_pictbridge_dpsclient_input_object_continuejob(UX_PICTBRIDGE *pictbridge,
ULONG input_subcode,
ULONG input_parameter,
- UCHAR *pima_object_buffer,
- ULONG object_length,
- UCHAR **pima_object_buffer_updated,
+ UCHAR *pima_object_buffer,
+ ULONG object_length,
+ UCHAR **pima_object_buffer_updated,
ULONG *object_length_updated);
UINT _ux_pictbridge_dpsclient_start(UX_PICTBRIDGE *pictbridge);
UINT _ux_pictbridge_dpsclient_api_configure_print_service(UX_PICTBRIDGE *pictbridge);
-UINT _ux_pictbridge_dpsclient_api_capability(UX_PICTBRIDGE *pictbridge, ULONG capability_code,
+UINT _ux_pictbridge_dpsclient_api_capability(UX_PICTBRIDGE *pictbridge, ULONG capability_code,
ULONG capability_parameter);
UINT _ux_pictbridge_dpsclient_api_device_status(UX_PICTBRIDGE *pictbridge);
UINT _ux_pictbridge_dpsclient_api_start_job(UX_PICTBRIDGE *pictbridge);
UINT _ux_pictbridge_dpsclient_api_abort_job(UX_PICTBRIDGE *pictbridge);
UINT _ux_pictbridge_dpsclient_api_continue_job(UX_PICTBRIDGE *pictbridge);
-UINT _ux_pictbridge_dpsclient_register_event_callback_function(UX_PICTBRIDGE *pictbridge,
+UINT _ux_pictbridge_dpsclient_register_event_callback_function(UX_PICTBRIDGE *pictbridge,
UINT (*event_callback_function)(struct UX_PICTBRIDGE_STRUCT *pictbridge, UINT event_flag));
@@ -913,34 +896,34 @@ UINT _ux_pictbridge_dpshost_object_get(UX_PICTBRIDGE *pictbridge, ULONG object_
UINT _ux_pictbridge_dpshost_response_get(UX_PICTBRIDGE *pictbridge);
UINT _ux_pictbridge_dpshost_input_object_send(UX_PICTBRIDGE *pictbridge, ULONG input_function);
UINT _ux_pictbridge_dpshost_output_object_create(UX_PICTBRIDGE *pictbridge);
-UINT _ux_pictbridge_dpshost_output_object_configure_print_service(UX_PICTBRIDGE *pictbridge,
- UCHAR *pima_object_buffer,
- ULONG object_length,
- UCHAR **pima_object_buffer_updated,
+UINT _ux_pictbridge_dpshost_output_object_configure_print_service(UX_PICTBRIDGE *pictbridge,
+ UCHAR *pima_object_buffer,
+ ULONG object_length,
+ UCHAR **pima_object_buffer_updated,
ULONG *object_length_updated);
-UINT _ux_pictbridge_dpshost_input_object_notify_job_status(UX_PICTBRIDGE *pictbridge,
- UCHAR *pima_object_buffer,
- ULONG object_length,
- UCHAR **pima_object_buffer_updated,
+UINT _ux_pictbridge_dpshost_input_object_notify_job_status(UX_PICTBRIDGE *pictbridge,
+ UCHAR *pima_object_buffer,
+ ULONG object_length,
+ UCHAR **pima_object_buffer_updated,
ULONG *object_length_updated);
-UINT _ux_pictbridge_dpshost_input_object_notify_device_status(UX_PICTBRIDGE *pictbridge,
- UCHAR *pima_object_buffer,
- ULONG object_length,
- UCHAR **pima_object_buffer_updated,
+UINT _ux_pictbridge_dpshost_input_object_notify_device_status(UX_PICTBRIDGE *pictbridge,
+ UCHAR *pima_object_buffer,
+ ULONG object_length,
+ UCHAR **pima_object_buffer_updated,
ULONG *object_length_updated);
-UINT _ux_pictbridge_dpshost_output_object_get_capability(UX_PICTBRIDGE *pictbridge,
- UCHAR *pima_object_buffer,
- ULONG object_length,
- UCHAR **pima_object_buffer_updated,
+UINT _ux_pictbridge_dpshost_output_object_get_capability(UX_PICTBRIDGE *pictbridge,
+ UCHAR *pima_object_buffer,
+ ULONG object_length,
+ UCHAR **pima_object_buffer_updated,
ULONG *object_length_updated);
-UINT _ux_pictbridge_dpshost_output_object_get_device_status(UX_PICTBRIDGE *pictbridge,
- UCHAR *pima_object_buffer,
- ULONG object_length,
- UCHAR **pima_object_buffer_updated,
+UINT _ux_pictbridge_dpshost_output_object_get_device_status(UX_PICTBRIDGE *pictbridge,
+ UCHAR *pima_object_buffer,
+ ULONG object_length,
+ UCHAR **pima_object_buffer_updated,
ULONG *object_length_updated);
/* Define Pictbridge Client API prototypes. */
@@ -957,7 +940,7 @@ UINT _ux_pictbridge_array_element_to_array_hexa(UCHAR *element, ULONG *hexa_arr
UINT _ux_pictbridge_element_to_decimal(UCHAR *element, ULONG *decimal_value);
UINT _ux_pictbridge_element_to_hexa(UCHAR *element, ULONG *hexa_value);
UINT _ux_pictbridge_hexa_to_element(ULONG hexa_value, UCHAR *element);
-UINT _ux_pictbridge_tag_name_get(UCHAR *input_buffer, ULONG input_length,
+UINT _ux_pictbridge_tag_name_get(UCHAR *input_buffer, ULONG input_length,
UCHAR *tag_name,
UCHAR *variable_name,
UCHAR *variable_string,
@@ -968,20 +951,20 @@ UINT _ux_pictbridge_tag_name_scan(UX_PICTBRIDGE_XML_ITEM *tag_item,
UCHAR *tag_name,
UX_PICTBRIDGE_XML_ITEM **tag_entry);
UINT _ux_pictbridge_hexa_to_major_minor(ULONG hexa_value, UCHAR *output_buffer);
-UINT _ux_pictbridge_hexa_to_decimal_string(ULONG hexa_value, UCHAR *decimal_string,
+UINT _ux_pictbridge_hexa_to_decimal_string(ULONG hexa_value, UCHAR *decimal_string,
ULONG leading_zero_flag, ULONG max_digit_string_size);
-UINT _ux_pictbridge_object_tag_line_add(UCHAR *pima_object_buffer,
- ULONG object_length,
+UINT _ux_pictbridge_object_tag_line_add(UCHAR *pima_object_buffer,
+ ULONG object_length,
UCHAR *tag_element_string,
ULONG tag_flag,
UCHAR *tag_variable,
ULONG tag_variable_value,
VOID *tag_element,
- UCHAR **pima_object_buffer_updated,
+ UCHAR **pima_object_buffer_updated,
ULONG *object_length_updated);
UINT _ux_pictbridge_input_object_create(UX_PICTBRIDGE *pictbridge, ULONG input_function);
-
+
/* Define external strings and xml tag lines. */
@@ -993,44 +976,44 @@ extern UCHAR _ux_pictbridge_hrequest_name[];
extern UCHAR _ux_pictbridge_hrsponse_name[];
extern UCHAR _ux_pictbridge_drequest_name[];
extern UCHAR _ux_pictbridge_drsponse_name[];
-extern UCHAR _ux_pictbridge_xml_tag_line_xmlversion[];
-extern UCHAR _ux_pictbridge_xml_tag_line_dpsxmlns[];
-extern UCHAR _ux_pictbridge_xml_tag_line_dps[];
-extern UCHAR _ux_pictbridge_xml_tag_line_output[];
-extern UCHAR _ux_pictbridge_xml_tag_line_input[];
-extern UCHAR _ux_pictbridge_xml_tag_line_result[];
-extern UCHAR _ux_pictbridge_xml_tag_line_configureprintservice[];
-extern UCHAR _ux_pictbridge_xml_tag_line_printserviceavailable[];
-extern UCHAR _ux_pictbridge_xml_tag_line_dpsversions[];
-extern UCHAR _ux_pictbridge_xml_tag_line_vendorname[];
-extern UCHAR _ux_pictbridge_xml_tag_line_vendorspecificversion[];
-extern UCHAR _ux_pictbridge_xml_tag_line_productname[];
-extern UCHAR _ux_pictbridge_xml_tag_line_serialno[];
-extern UCHAR _ux_pictbridge_xml_tag_line_capability[];
-extern UCHAR _ux_pictbridge_xml_tag_line_getcapability[];
-extern UCHAR _ux_pictbridge_xml_tag_line_qualities[];
-extern UCHAR _ux_pictbridge_xml_tag_line_papersizes[];
-extern UCHAR _ux_pictbridge_xml_tag_line_papertypes[];
-extern UCHAR _ux_pictbridge_xml_tag_line_filetypes[];
-extern UCHAR _ux_pictbridge_xml_tag_line_dateprints[];
-extern UCHAR _ux_pictbridge_xml_tag_line_filenameprints[];
-extern UCHAR _ux_pictbridge_xml_tag_line_imageoptimizes[];
-extern UCHAR _ux_pictbridge_xml_tag_line_layouts[];
-extern UCHAR _ux_pictbridge_xml_tag_line_fixedsizes[];
-extern UCHAR _ux_pictbridge_xml_tag_line_croppings[];
-extern UCHAR _ux_pictbridge_xml_tag_line_charrepertoires[];
+extern UCHAR _ux_pictbridge_xml_tag_line_xmlversion[];
+extern UCHAR _ux_pictbridge_xml_tag_line_dpsxmlns[];
+extern UCHAR _ux_pictbridge_xml_tag_line_dps[];
+extern UCHAR _ux_pictbridge_xml_tag_line_output[];
+extern UCHAR _ux_pictbridge_xml_tag_line_input[];
+extern UCHAR _ux_pictbridge_xml_tag_line_result[];
+extern UCHAR _ux_pictbridge_xml_tag_line_configureprintservice[];
+extern UCHAR _ux_pictbridge_xml_tag_line_printserviceavailable[];
+extern UCHAR _ux_pictbridge_xml_tag_line_dpsversions[];
+extern UCHAR _ux_pictbridge_xml_tag_line_vendorname[];
+extern UCHAR _ux_pictbridge_xml_tag_line_vendorspecificversion[];
+extern UCHAR _ux_pictbridge_xml_tag_line_productname[];
+extern UCHAR _ux_pictbridge_xml_tag_line_serialno[];
+extern UCHAR _ux_pictbridge_xml_tag_line_capability[];
+extern UCHAR _ux_pictbridge_xml_tag_line_getcapability[];
+extern UCHAR _ux_pictbridge_xml_tag_line_qualities[];
+extern UCHAR _ux_pictbridge_xml_tag_line_papersizes[];
+extern UCHAR _ux_pictbridge_xml_tag_line_papertypes[];
+extern UCHAR _ux_pictbridge_xml_tag_line_filetypes[];
+extern UCHAR _ux_pictbridge_xml_tag_line_dateprints[];
+extern UCHAR _ux_pictbridge_xml_tag_line_filenameprints[];
+extern UCHAR _ux_pictbridge_xml_tag_line_imageoptimizes[];
+extern UCHAR _ux_pictbridge_xml_tag_line_layouts[];
+extern UCHAR _ux_pictbridge_xml_tag_line_fixedsizes[];
+extern UCHAR _ux_pictbridge_xml_tag_line_croppings[];
+extern UCHAR _ux_pictbridge_xml_tag_line_charrepertoires[];
extern UCHAR _ux_pictbridge_xml_variable_papersize[];
extern UCHAR _ux_pictbridge_xml_variable_version[];
extern UCHAR _ux_pictbridge_xml_variable_xmlns[];
extern UCHAR _ux_pictbridge_xml_string_xmlns[];
-extern UCHAR _ux_pictbridge_xml_tag_line_getdevicestatus[];
-extern UCHAR _ux_pictbridge_xml_tag_line_dpsprintservicestatus[];
-extern UCHAR _ux_pictbridge_xml_tag_line_jobendreason[];
-extern UCHAR _ux_pictbridge_xml_tag_line_errorstatus[];
-extern UCHAR _ux_pictbridge_xml_tag_line_errorreason[];
-extern UCHAR _ux_pictbridge_xml_tag_line_disconnectenable[];
-extern UCHAR _ux_pictbridge_xml_tag_line_capabilitychanged[];
-extern UCHAR _ux_pictbridge_xml_tag_line_newjobok[];
+extern UCHAR _ux_pictbridge_xml_tag_line_getdevicestatus[];
+extern UCHAR _ux_pictbridge_xml_tag_line_dpsprintservicestatus[];
+extern UCHAR _ux_pictbridge_xml_tag_line_jobendreason[];
+extern UCHAR _ux_pictbridge_xml_tag_line_errorstatus[];
+extern UCHAR _ux_pictbridge_xml_tag_line_errorreason[];
+extern UCHAR _ux_pictbridge_xml_tag_line_disconnectenable[];
+extern UCHAR _ux_pictbridge_xml_tag_line_capabilitychanged[];
+extern UCHAR _ux_pictbridge_xml_tag_line_newjobok[];
extern UCHAR _ux_pictbridge_xml_tag_line_notifydevicestatus[];
extern UCHAR _ux_pictbridge_xml_tag_line_notifyjobstatus[];
extern UCHAR _ux_pictbridge_xml_tag_line_progress[];
@@ -1040,27 +1023,27 @@ extern UCHAR _ux_pictbridge_xml_tag_line_abortjob[];
extern UCHAR _ux_pictbridge_xml_tag_line_abortstyle[];
extern UCHAR _ux_pictbridge_xml_tag_line_continuejob[];
-extern UCHAR _ux_pictbridge_xml_tag_line_quality[];
-extern UCHAR _ux_pictbridge_xml_tag_line_papersize[];
-extern UCHAR _ux_pictbridge_xml_tag_line_papertype[];
-extern UCHAR _ux_pictbridge_xml_tag_line_filetype[];
-extern UCHAR _ux_pictbridge_xml_tag_line_dateprint[];
-extern UCHAR _ux_pictbridge_xml_tag_line_filenameprint[];
-extern UCHAR _ux_pictbridge_xml_tag_line_imageoptimize[];
-extern UCHAR _ux_pictbridge_xml_tag_line_layout[];
-extern UCHAR _ux_pictbridge_xml_tag_line_fixedsize[];
-extern UCHAR _ux_pictbridge_xml_tag_line_cropping[];
+extern UCHAR _ux_pictbridge_xml_tag_line_quality[];
+extern UCHAR _ux_pictbridge_xml_tag_line_papersize[];
+extern UCHAR _ux_pictbridge_xml_tag_line_papertype[];
+extern UCHAR _ux_pictbridge_xml_tag_line_filetype[];
+extern UCHAR _ux_pictbridge_xml_tag_line_dateprint[];
+extern UCHAR _ux_pictbridge_xml_tag_line_filenameprint[];
+extern UCHAR _ux_pictbridge_xml_tag_line_imageoptimize[];
+extern UCHAR _ux_pictbridge_xml_tag_line_layout[];
+extern UCHAR _ux_pictbridge_xml_tag_line_fixedsize[];
+extern UCHAR _ux_pictbridge_xml_tag_line_cropping[];
extern UCHAR _ux_pictbridge_xml_tag_line_jobconfig[];
extern UCHAR _ux_pictbridge_xml_tag_line_printinfo[];
extern UCHAR _ux_pictbridge_xml_tag_line_fileid[];
extern UCHAR _ux_pictbridge_xml_tag_line_filename[];
extern UCHAR _ux_pictbridge_xml_tag_line_date[];
-/* Determine if a C++ compiler is being used. If so, complete the standard
- C conditional started above. */
+/* Determine if a C++ compiler is being used. If so, complete the standard
+ C conditional started above. */
#ifdef __cplusplus
-}
-#endif
+}
+#endif
#endif
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 08953902..26a2c752 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
@@ -1,18 +1,19 @@
/***************************************************************************
- * Copyright (c) 2024 Microsoft Corporation
- *
+ * Copyright (c) 2024 Microsoft Corporation
+ * Copyright (c) 2026-present Eclipse ThreadX contributors
+ *
* This program and the accompanying materials are made available under the
* terms of the MIT License which is available at
* https://opensource.org/licenses/MIT.
- *
+ *
* SPDX-License-Identifier: MIT
**************************************************************************/
/**************************************************************************/
/**************************************************************************/
-/** */
-/** USBX Component */
+/** */
+/** USBX Component */
/** */
/** Pictbridge Application */
/** */
@@ -28,49 +29,35 @@
#include "ux_pictbridge.h"
-/**************************************************************************/
-/* */
-/* FUNCTION RELEASE */
-/* */
-/* _ux_pictbridge_array_element_to_array_hexa PORTABLE C */
+/**************************************************************************/
+/* */
+/* FUNCTION RELEASE */
+/* */
+/* _ux_pictbridge_array_element_to_array_hexa PORTABLE C */
/* 6.3.0 */
/* AUTHOR */
/* */
/* Chaoqiong Xiao, Microsoft Corporation */
/* */
/* DESCRIPTION */
-/* */
-/* This function translates an array of elements into an hexa array */
-/* */
-/* INPUT */
-/* */
-/* element Address of the element */
-/* hexa_array address of array */
-/* */
-/* OUTPUT */
-/* */
-/* Completion Status */
-/* */
-/* CALLS */
-/* */
-/* */
-/* CALLED BY */
-/* */
-/* _ux_pictbridge_object_parse */
-/* */
-/* RELEASE HISTORY */
-/* */
-/* DATE NAME DESCRIPTION */
-/* */
-/* 05-19-2020 Chaoqiong Xiao Initial Version 6.0 */
-/* 09-30-2020 Chaoqiong Xiao Modified comment(s), */
-/* resulting in version 6.1 */
-/* 04-25-2022 Yajun Xia Modified comment(s), */
-/* internal clean up, */
-/* resulting in version 6.1.11 */
-/* 10-31-2023 Chaoqiong Xiao Modified comment(s), */
-/* limited output array size, */
-/* resulting in version 6.3.0 */
+/* */
+/* This function translates an array of elements into an hexa array */
+/* */
+/* INPUT */
+/* */
+/* element Address of the element */
+/* hexa_array address of array */
+/* */
+/* OUTPUT */
+/* */
+/* Completion Status */
+/* */
+/* CALLS */
+/* */
+/* */
+/* CALLED BY */
+/* */
+/* _ux_pictbridge_object_parse */
/* */
/**************************************************************************/
UINT _ux_pictbridge_array_element_to_array_hexa(UCHAR *element, ULONG *hexa_array)
@@ -96,17 +83,17 @@ ULONG *hexa_array_end = hexa_array + UX_PICTBRIDGE_MAX_DEVINFO
/* Get the element length. */
element_array_length = string_length + 1;
-
+
/* Parse the entire element array. */
while(element_array_length != 0)
{
-
+
/* Search for the space if delimiter or the terminating 0. */
element_position = element;
-
+
/* The length must be saved. */
remaining_length = element_array_length;
-
+
/* Parse this element. */
while(remaining_length !=0)
{
@@ -117,7 +104,7 @@ ULONG *hexa_array_end = hexa_array + UX_PICTBRIDGE_MAX_DEVINFO
/* We found an element. Mark its end. */
*element_position = 0;
-
+
/* Get the string length, max length 8 for 32-bit hex value. */
status = _ux_utility_string_length_check(element, &string_length, 8);
if (status != UX_SUCCESS)
@@ -125,111 +112,111 @@ ULONG *hexa_array_end = hexa_array + UX_PICTBRIDGE_MAX_DEVINFO
/* Get the element length. */
element_length = string_length;
-
+
/* Save it. */
saved_element_length = element_length + 1;
-
+
/* Reset the local hexa value. */
local_hexa_value = 0;
-
+
/* We parse the element and build the hexa value one byte at a type. */
while(element_length)
{
-
+
/* Shift the previous content by 1 nibble. */
local_hexa_value = (local_hexa_value << 4) & 0xFFFFFFFFu;
-
+
/* Get the element content. */
element_content = *element;
-
+
/* Check for the element content. Should be >0 <9 or 'A' to 'F'. */
- if ((element_content >= '0' && element_content <= '9') ||
+ if ((element_content >= '0' && element_content <= '9') ||
(element_content >= 'a' && element_content <= 'f') ||
(element_content >= 'A' && element_content <= 'F'))
{
-
+
/* We have a valid element content. Turn it into a hexa decimal value. */
if (element_content >= '0' && element_content <= '9')
-
+
/* We have a digit. */
element_hexa = (UCHAR)(element_content - '0');
-
+
else
- {
+ {
/* We have a 'A' to 'F' or 'a' to 'f' value. */
- if (element_content >= 'a' && element_content <= 'f')
-
+ if (element_content >= 'a' && element_content <= 'f')
+
/* We have a 'a' to 'f' char. */
element_hexa = (UCHAR)(element_content - 'a' + 10);
-
- else
-
+
+ else
+
/* We have a 'A' to 'F' char. */
element_hexa = (UCHAR)(element_content - 'A' + 10);
-
- }
+
+ }
}
- else
+ else
{
-
+
/* Reset the last position in the array. */
*hexa_array = 0;
/* We have a syntax violation. */
- return(UX_ERROR);
- }
-
+ return(UX_ERROR);
+ }
+
/* Add the found value to the current cumulated hexa value. */
local_hexa_value |= element_hexa;
/* Next position. */
element++;
-
+
/* Update length. */
element_length--;
-
- }
-
+
+ }
+
/* We have finished building the 32 bit hexa value. Save it in the array. */
- *hexa_array = local_hexa_value;
-
+ *hexa_array = local_hexa_value;
+
/* Next element in the array. */
hexa_array++;
-
+
/* We are done with this element. */
break;
-
+
}
else
/* Next element position. */
- element_position++;
+ element_position++;
/* Adjust the remaining length. */
remaining_length--;
- }
-
+ }
+
/* Check if the array is Full. */
if (hexa_array == hexa_array_end)
break;
-
+
/* Increment the element position to the next one if there. */
element++;
-
+
/* Adjust the length of the array. */
- element_array_length -= saved_element_length;
-
+ element_array_length -= saved_element_length;
+
}
-
+
/* Reset the remaining positions in the array. */
while(hexa_array != hexa_array_end)
{
*hexa_array = 0;
hexa_array++;
}
-
+
/* Operation was successful. */
- return(UX_SUCCESS);
+ return(UX_SUCCESS);
}
diff --git a/common/usbx_pictbridge/src/ux_pictbridge_data.c b/common/usbx_pictbridge/src/ux_pictbridge_data.c
index eb04fb55..1a072863 100644
--- a/common/usbx_pictbridge/src/ux_pictbridge_data.c
+++ b/common/usbx_pictbridge/src/ux_pictbridge_data.c
@@ -1,18 +1,19 @@
/***************************************************************************
- * Copyright (c) 2024 Microsoft Corporation
- *
+ * Copyright (c) 2024 Microsoft Corporation
+ * Copyright (c) 2026-present Eclipse ThreadX contributors
+ *
* This program and the accompanying materials are made available under the
* terms of the MIT License which is available at
* https://opensource.org/licenses/MIT.
- *
+ *
* SPDX-License-Identifier: MIT
**************************************************************************/
/**************************************************************************/
/**************************************************************************/
-/** */
-/** USBX Component */
+/** */
+/** USBX Component */
/** */
/** PictBridge Host Class */
/** */
@@ -26,32 +27,24 @@
#include "ux_api.h"
#include "ux_pictbridge.h"
-/**************************************************************************/
-/* */
-/* COMPONENT DEFINITION RELEASE */
-/* */
-/* ux_pictbridge_data.c PORTABLE C */
+/**************************************************************************/
+/* */
+/* COMPONENT DEFINITION RELEASE */
+/* */
+/* ux_pictbridge_data.c PORTABLE C */
/* 6.1 */
/* AUTHOR */
/* */
/* Chaoqiong Xiao, Microsoft Corporation */
/* */
/* DESCRIPTION */
-/* */
+/* */
/* This file contains all the data items for the pictbridge class */
-/* */
-/* RELEASE HISTORY */
-/* */
-/* DATE NAME DESCRIPTION */
-/* */
-/* 05-19-2020 Chaoqiong Xiao Initial Version 6.0 */
-/* 09-30-2020 Chaoqiong Xiao Modified comment(s), */
-/* resulting in version 6.1 */
/* */
/**************************************************************************/
/* Prototypes for all XML items. */
-UX_PICTBRIDGE_XML_ITEM _ux_pictbridge_xml_item_input[];
+UX_PICTBRIDGE_XML_ITEM _ux_pictbridge_xml_item_input[];
UX_PICTBRIDGE_XML_ITEM _ux_pictbridge_xml_item_root[];
UX_PICTBRIDGE_XML_ITEM _ux_pictbridge_xml_item_output[];
UX_PICTBRIDGE_XML_ITEM _ux_pictbridge_xml_item_input_configureprintservice[];
@@ -83,26 +76,26 @@ UX_PICTBRIDGE_XML_ITEM _ux_pictbridge_xml_item_input_getfilelist[];
/* Define Pictbridge XML input get File List. */
-UX_PICTBRIDGE_XML_ITEM _ux_pictbridge_xml_item_input_getfilelist[] =
+UX_PICTBRIDGE_XML_ITEM _ux_pictbridge_xml_item_input_getfilelist[] =
{
- {
- "fileType",
+ {
+ "fileType",
0,
UX_PICTBRIDGE_XML_LEAF,
_ux_pictbridge_xml_item_input,
_ux_pictbridge_xml_function_input_getfilelist_filetype,
},
- {
- "parentFileID",
+ {
+ "parentFileID",
0,
UX_PICTBRIDGE_XML_LEAF,
_ux_pictbridge_xml_item_input,
_ux_pictbridge_xml_function_input_getfilelist_parentfileid,
},
- {
- "maxNumIDs",
+ {
+ "maxNumIDs",
0,
UX_PICTBRIDGE_XML_LEAF,
_ux_pictbridge_xml_item_input,
@@ -113,17 +106,17 @@ UX_PICTBRIDGE_XML_ITEM _ux_pictbridge_xml_item_input_getfilelist[] =
};
/* Define Pictbridge XML output get File List. */
-UX_PICTBRIDGE_XML_ITEM _ux_pictbridge_xml_item_output_getfilelist[] =
+UX_PICTBRIDGE_XML_ITEM _ux_pictbridge_xml_item_output_getfilelist[] =
{
- {
- "fileIDs",
+ {
+ "fileIDs",
0,
UX_PICTBRIDGE_XML_LEAF,
_ux_pictbridge_xml_item_output,
_ux_pictbridge_xml_function_output_getfilelist_fileids,
},
- {
- "numIDs",
+ {
+ "numIDs",
0,
UX_PICTBRIDGE_XML_LEAF,
_ux_pictbridge_xml_item_output,
@@ -134,26 +127,26 @@ UX_PICTBRIDGE_XML_ITEM _ux_pictbridge_xml_item_output_getfilelist[] =
};
/* Define Pictbridge XML input get partial File. */
-UX_PICTBRIDGE_XML_ITEM _ux_pictbridge_xml_item_input_getpartialfile[] =
+UX_PICTBRIDGE_XML_ITEM _ux_pictbridge_xml_item_input_getpartialfile[] =
{
- {
- "fileID",
+ {
+ "fileID",
0,
UX_PICTBRIDGE_XML_LEAF,
_ux_pictbridge_xml_item_input,
_ux_pictbridge_xml_function_input_getpartialfile_fileid,
},
- {
- "offset",
+ {
+ "offset",
0,
UX_PICTBRIDGE_XML_LEAF,
_ux_pictbridge_xml_item_input,
_ux_pictbridge_xml_function_input_getpartialfile_offset,
},
- {
- "maxSize",
+ {
+ "maxSize",
0,
UX_PICTBRIDGE_XML_LEAF,
_ux_pictbridge_xml_item_input,
@@ -164,10 +157,10 @@ UX_PICTBRIDGE_XML_ITEM _ux_pictbridge_xml_item_input_getpartialfile[] =
};
/* Define Pictbridge XML output get Partial File. */
-UX_PICTBRIDGE_XML_ITEM _ux_pictbridge_xml_item_output_getpartialfile[] =
+UX_PICTBRIDGE_XML_ITEM _ux_pictbridge_xml_item_output_getpartialfile[] =
{
- {
- "bytesRead",
+ {
+ "bytesRead",
0,
UX_PICTBRIDGE_XML_LEAF,
_ux_pictbridge_xml_item_output,
@@ -178,10 +171,10 @@ UX_PICTBRIDGE_XML_ITEM _ux_pictbridge_xml_item_output_getpartialfile[] =
};
/* Define Pictbridge XML input get File. */
-UX_PICTBRIDGE_XML_ITEM _ux_pictbridge_xml_item_input_getfile[] =
+UX_PICTBRIDGE_XML_ITEM _ux_pictbridge_xml_item_input_getfile[] =
{
- {
- "fileID",
+ {
+ "fileID",
0,
UX_PICTBRIDGE_XML_LEAF,
_ux_pictbridge_xml_item_input,
@@ -192,10 +185,10 @@ UX_PICTBRIDGE_XML_ITEM _ux_pictbridge_xml_item_input_getfile[] =
};
/* Define Pictbridge XML output get File. */
-UX_PICTBRIDGE_XML_ITEM _ux_pictbridge_xml_item_output_getfile[] =
+UX_PICTBRIDGE_XML_ITEM _ux_pictbridge_xml_item_output_getfile[] =
{
- {
- "bytesRead",
+ {
+ "bytesRead",
0,
UX_PICTBRIDGE_XML_LEAF,
_ux_pictbridge_xml_item_output,
@@ -206,10 +199,10 @@ UX_PICTBRIDGE_XML_ITEM _ux_pictbridge_xml_item_output_getfile[] =
};
/* Define Pictbridge XML input get Thumb. */
-UX_PICTBRIDGE_XML_ITEM _ux_pictbridge_xml_item_input_getthumb[] =
+UX_PICTBRIDGE_XML_ITEM _ux_pictbridge_xml_item_input_getthumb[] =
{
- {
- "fileID",
+ {
+ "fileID",
0,
UX_PICTBRIDGE_XML_LEAF,
_ux_pictbridge_xml_item_input,
@@ -220,10 +213,10 @@ UX_PICTBRIDGE_XML_ITEM _ux_pictbridge_xml_item_input_getthumb[] =
};
/* Define Pictbridge XML output get Thumb. */
-UX_PICTBRIDGE_XML_ITEM _ux_pictbridge_xml_item_output_getthumb[] =
+UX_PICTBRIDGE_XML_ITEM _ux_pictbridge_xml_item_output_getthumb[] =
{
- {
- "bytesRead",
+ {
+ "bytesRead",
0,
UX_PICTBRIDGE_XML_LEAF,
_ux_pictbridge_xml_item_output,
@@ -233,10 +226,10 @@ UX_PICTBRIDGE_XML_ITEM _ux_pictbridge_xml_item_output_getthumb[] =
{ "\0", 0, UX_NULL, UX_NULL, UX_NULL }
};
/* Define Pictbridge XML input get File Info. */
-UX_PICTBRIDGE_XML_ITEM _ux_pictbridge_xml_item_input_getfileinfo[] =
+UX_PICTBRIDGE_XML_ITEM _ux_pictbridge_xml_item_input_getfileinfo[] =
{
- {
- "fileID",
+ {
+ "fileID",
0,
UX_PICTBRIDGE_XML_LEAF,
_ux_pictbridge_xml_item_input,
@@ -247,34 +240,34 @@ UX_PICTBRIDGE_XML_ITEM _ux_pictbridge_xml_item_input_getfileinfo[] =
};
/* Define Pictbridge XML output get File ID. */
-UX_PICTBRIDGE_XML_ITEM _ux_pictbridge_xml_item_output_getfileinfo[] =
+UX_PICTBRIDGE_XML_ITEM _ux_pictbridge_xml_item_output_getfileinfo[] =
{
- {
- "fileType",
+ {
+ "fileType",
0,
UX_PICTBRIDGE_XML_LEAF,
_ux_pictbridge_xml_item_output,
_ux_pictbridge_xml_function_output_getfileinfo_filetype,
},
- {
- "fileSize",
+ {
+ "fileSize",
0,
UX_PICTBRIDGE_XML_LEAF,
_ux_pictbridge_xml_item_output,
_ux_pictbridge_xml_function_output_getfileinfo_filesize,
},
- {
- "thumbFormat",
+ {
+ "thumbFormat",
0,
UX_PICTBRIDGE_XML_LEAF,
_ux_pictbridge_xml_item_output,
_ux_pictbridge_xml_function_output_getfileinfo_thumbformat,
},
- {
- "thumbsize",
+ {
+ "thumbsize",
0,
UX_PICTBRIDGE_XML_LEAF,
_ux_pictbridge_xml_item_output,
@@ -285,18 +278,18 @@ UX_PICTBRIDGE_XML_ITEM _ux_pictbridge_xml_item_output_getfileinfo[] =
};
/* Define Pictbridge XML input get File ID. */
-UX_PICTBRIDGE_XML_ITEM _ux_pictbridge_xml_item_input_getfileid[] =
+UX_PICTBRIDGE_XML_ITEM _ux_pictbridge_xml_item_input_getfileid[] =
{
- {
- "basePathID",
+ {
+ "basePathID",
0,
UX_PICTBRIDGE_XML_LEAF,
_ux_pictbridge_xml_item_input,
_ux_pictbridge_xml_function_input_getfileid_basepathid,
},
- {
- "filePath",
+ {
+ "filePath",
0,
UX_PICTBRIDGE_XML_LEAF,
_ux_pictbridge_xml_item_input,
@@ -308,18 +301,18 @@ UX_PICTBRIDGE_XML_ITEM _ux_pictbridge_xml_item_input_getfileid[] =
/* Define Pictbridge XML output get File ID. */
-UX_PICTBRIDGE_XML_ITEM _ux_pictbridge_xml_item_output_getfileid[] =
+UX_PICTBRIDGE_XML_ITEM _ux_pictbridge_xml_item_output_getfileid[] =
{
- {
- "basePathID",
+ {
+ "basePathID",
0,
UX_PICTBRIDGE_XML_LEAF,
_ux_pictbridge_xml_item_output,
_ux_pictbridge_xml_function_output_getfileid_basepathid,
},
- {
- "filePath",
+ {
+ "filePath",
0,
UX_PICTBRIDGE_XML_LEAF,
_ux_pictbridge_xml_item_output,
@@ -330,56 +323,56 @@ UX_PICTBRIDGE_XML_ITEM _ux_pictbridge_xml_item_output_getfileid[] =
};
/* Define Pictbridge XML output get device status. */
-UX_PICTBRIDGE_XML_ITEM _ux_pictbridge_xml_item_input_notifydevicestatus[] =
+UX_PICTBRIDGE_XML_ITEM _ux_pictbridge_xml_item_input_notifydevicestatus[] =
{
- {
- "dpsPrintServiceStatus",
+ {
+ "dpsPrintServiceStatus",
0,
UX_PICTBRIDGE_XML_LEAF,
_ux_pictbridge_xml_item_input,
_ux_pictbridge_xml_function_input_notifydevicestatus_dpsprintservicestatus,
},
- {
- "jobEndReason",
+ {
+ "jobEndReason",
0,
- UX_PICTBRIDGE_XML_LEAF,
+ UX_PICTBRIDGE_XML_LEAF,
_ux_pictbridge_xml_item_input,
_ux_pictbridge_xml_function_input_notifydevicestatus_jobendreason,
},
- {
- "errorStatus",
+ {
+ "errorStatus",
0,
UX_PICTBRIDGE_XML_LEAF,
_ux_pictbridge_xml_item_input,
_ux_pictbridge_xml_function_input_notifydevicestatus_errorstatus,
},
- {
- "errorReason",
+ {
+ "errorReason",
0,
UX_PICTBRIDGE_XML_LEAF,
_ux_pictbridge_xml_item_input,
_ux_pictbridge_xml_function_input_notifydevicestatus_errorreason,
},
- {
- "disconnectEnable",
+ {
+ "disconnectEnable",
0,
UX_PICTBRIDGE_XML_LEAF,
_ux_pictbridge_xml_item_input,
_ux_pictbridge_xml_function_input_notifydevicestatus_disconnectenable,
},
- {
- "capabilityChanged",
+ {
+ "capabilityChanged",
0,
UX_PICTBRIDGE_XML_LEAF,
_ux_pictbridge_xml_item_input,
_ux_pictbridge_xml_function_input_notifydevicestatus_capabilitychanged,
},
- {
- "newJobOK",
+ {
+ "newJobOK",
0,
UX_PICTBRIDGE_XML_LEAF,
_ux_pictbridge_xml_item_input,
@@ -391,38 +384,38 @@ UX_PICTBRIDGE_XML_ITEM _ux_pictbridge_xml_item_input_notifydevicestatus[] =
/* Define Pictbridge XML input notify job. */
-UX_PICTBRIDGE_XML_ITEM _ux_pictbridge_xml_item_input_notifyjobstatus[] =
+UX_PICTBRIDGE_XML_ITEM _ux_pictbridge_xml_item_input_notifyjobstatus[] =
{
- {
- "prtPID",
+ {
+ "prtPID",
0,
UX_PICTBRIDGE_XML_LEAF,
_ux_pictbridge_xml_item_input,
_ux_pictbridge_xml_function_input_notifyjobstatus_prtpid,
},
- {
- "filepath",
+ {
+ "filepath",
0,
UX_PICTBRIDGE_XML_LEAF,
_ux_pictbridge_xml_item_input,
_ux_pictbridge_xml_function_input_notifyjobstatus_filepath,
},
- {
- "copyID",
+ {
+ "copyID",
0,
UX_PICTBRIDGE_XML_LEAF,
_ux_pictbridge_xml_item_input,
_ux_pictbridge_xml_function_input_notifyjobstatus_copyid,
},
- {
- "progress",
+ {
+ "progress",
0,
UX_PICTBRIDGE_XML_LEAF,
_ux_pictbridge_xml_item_input,
_ux_pictbridge_xml_function_input_notifyjobstatus_progress,
},
- {
- "imagesPrinted",
+ {
+ "imagesPrinted",
0,
UX_PICTBRIDGE_XML_LEAF,
_ux_pictbridge_xml_item_input,
@@ -433,10 +426,10 @@ UX_PICTBRIDGE_XML_ITEM _ux_pictbridge_xml_item_input_notifyjobstatus[] =
};
/* Define Pictbridge XML input abort job. */
-UX_PICTBRIDGE_XML_ITEM _ux_pictbridge_xml_item_input_abortjob[] =
+UX_PICTBRIDGE_XML_ITEM _ux_pictbridge_xml_item_input_abortjob[] =
{
- {
- "abortStyle",
+ {
+ "abortStyle",
0,
UX_PICTBRIDGE_XML_LEAF,
_ux_pictbridge_xml_item_input,
@@ -447,73 +440,73 @@ UX_PICTBRIDGE_XML_ITEM _ux_pictbridge_xml_item_input_abortjob[] =
};
/* Define Pictbridge XML input start job job config. */
-UX_PICTBRIDGE_XML_ITEM _ux_pictbridge_xml_item_input_startjob_jobconfig[] =
+UX_PICTBRIDGE_XML_ITEM _ux_pictbridge_xml_item_input_startjob_jobconfig[] =
{
- {
- "quality",
+ {
+ "quality",
0,
UX_PICTBRIDGE_XML_LEAF,
_ux_pictbridge_xml_item_input_startjob,
_ux_pictbridge_xml_function_input_startjob_jobconfig_quality,
},
- {
- "paperSize",
+ {
+ "paperSize",
0,
UX_PICTBRIDGE_XML_LEAF,
_ux_pictbridge_xml_item_input_startjob,
_ux_pictbridge_xml_function_input_startjob_jobconfig_papersize,
},
- {
- "paperType",
+ {
+ "paperType",
0,
UX_PICTBRIDGE_XML_LEAF,
_ux_pictbridge_xml_item_input_startjob,
_ux_pictbridge_xml_function_input_startjob_jobconfig_papertype,
},
- {
- "fileType",
+ {
+ "fileType",
0,
UX_PICTBRIDGE_XML_LEAF,
_ux_pictbridge_xml_item_input_startjob,
_ux_pictbridge_xml_function_input_startjob_jobconfig_filetype,
},
- {
- "datePrint",
+ {
+ "datePrint",
0,
UX_PICTBRIDGE_XML_LEAF,
_ux_pictbridge_xml_item_input_startjob,
_ux_pictbridge_xml_function_input_startjob_jobconfig_dateprint,
},
- {
- "fileNamePrint",
+ {
+ "fileNamePrint",
0,
- UX_PICTBRIDGE_XML_LEAF,
+ UX_PICTBRIDGE_XML_LEAF,
_ux_pictbridge_xml_item_input_startjob,
_ux_pictbridge_xml_function_input_startjob_jobconfig_filenameprint,
},
- {
- "imageOptimize",
+ {
+ "imageOptimize",
0,
UX_PICTBRIDGE_XML_LEAF,
_ux_pictbridge_xml_item_input_startjob,
_ux_pictbridge_xml_function_input_startjob_jobconfig_imageoptimize,
},
- {
- "layout",
+ {
+ "layout",
0,
UX_PICTBRIDGE_XML_LEAF,
_ux_pictbridge_xml_item_input_startjob,
_ux_pictbridge_xml_function_input_startjob_jobconfig_layout,
},
- {
- "fixedSize",
+ {
+ "fixedSize",
0,
UX_PICTBRIDGE_XML_LEAF,
_ux_pictbridge_xml_item_input_startjob,
_ux_pictbridge_xml_function_input_startjob_jobconfig_fixedsize,
},
- {
- "cropping",
+ {
+ "cropping",
0,
UX_PICTBRIDGE_XML_LEAF,
_ux_pictbridge_xml_item_input_startjob,
@@ -525,59 +518,59 @@ UX_PICTBRIDGE_XML_ITEM _ux_pictbridge_xml_item_input_startjob_jobconfig[] =
/* Define Pictbridge XML input print info. */
-UX_PICTBRIDGE_XML_ITEM _ux_pictbridge_xml_item_input_startjob_printinfo[] =
+UX_PICTBRIDGE_XML_ITEM _ux_pictbridge_xml_item_input_startjob_printinfo[] =
{
- {
- "croppingArea",
+ {
+ "croppingArea",
0,
UX_PICTBRIDGE_XML_LEAF,
_ux_pictbridge_xml_item_input_startjob,
_ux_pictbridge_xml_function_input_startjob_printinfo_croppingarea,
},
- {
- "fileID",
+ {
+ "fileID",
0,
UX_PICTBRIDGE_XML_LEAF,
_ux_pictbridge_xml_item_input_startjob,
_ux_pictbridge_xml_function_input_startjob_printinfo_fileid,
},
- {
- "fileName",
+ {
+ "fileName",
0,
UX_PICTBRIDGE_XML_LEAF,
_ux_pictbridge_xml_item_input_startjob,
_ux_pictbridge_xml_function_input_startjob_printinfo_filename,
},
- {
- "date",
+ {
+ "date",
0,
UX_PICTBRIDGE_XML_LEAF,
_ux_pictbridge_xml_item_input_startjob,
_ux_pictbridge_xml_function_input_startjob_printinfo_date,
},
- {
- "copies",
+ {
+ "copies",
0,
UX_PICTBRIDGE_XML_LEAF,
_ux_pictbridge_xml_item_input_startjob,
_ux_pictbridge_xml_function_input_startjob_printinfo_copies,
},
- {
- "prtPID",
+ {
+ "prtPID",
0,
UX_PICTBRIDGE_XML_LEAF,
_ux_pictbridge_xml_item_input_startjob,
_ux_pictbridge_xml_function_input_startjob_printinfo_prtpid,
},
- {
- "filepath",
+ {
+ "filepath",
0,
UX_PICTBRIDGE_XML_LEAF,
_ux_pictbridge_xml_item_input_startjob,
_ux_pictbridge_xml_function_input_startjob_printinfo_filepath,
},
- {
- "copyID",
+ {
+ "copyID",
0,
UX_PICTBRIDGE_XML_LEAF,
_ux_pictbridge_xml_item_input_startjob,
@@ -589,17 +582,17 @@ UX_PICTBRIDGE_XML_ITEM _ux_pictbridge_xml_item_input_startjob_printinfo[] =
/* Define Pictbridge XML input start job. */
-UX_PICTBRIDGE_XML_ITEM _ux_pictbridge_xml_item_input_startjob[] =
+UX_PICTBRIDGE_XML_ITEM _ux_pictbridge_xml_item_input_startjob[] =
{
- {
- "jobConfig",
+ {
+ "jobConfig",
0,
_ux_pictbridge_xml_item_input_startjob_jobconfig,
_ux_pictbridge_xml_item_input,
UX_NULL,
},
- {
- "printInfo",
+ {
+ "printInfo",
0,
_ux_pictbridge_xml_item_input_startjob_printinfo,
_ux_pictbridge_xml_item_input,
@@ -611,56 +604,56 @@ UX_PICTBRIDGE_XML_ITEM _ux_pictbridge_xml_item_input_startjob[] =
/* Define Pictbridge XML output get device status. */
-UX_PICTBRIDGE_XML_ITEM _ux_pictbridge_xml_item_output_getdevicestatus[] =
+UX_PICTBRIDGE_XML_ITEM _ux_pictbridge_xml_item_output_getdevicestatus[] =
{
- {
- "dpsPrintServiceStatus",
+ {
+ "dpsPrintServiceStatus",
0,
UX_PICTBRIDGE_XML_LEAF,
_ux_pictbridge_xml_item_output,
_ux_pictbridge_xml_function_output_getdevicestatus_dpsprintservicestatus,
},
- {
- "jobEndReason",
+ {
+ "jobEndReason",
0,
UX_PICTBRIDGE_XML_LEAF,
_ux_pictbridge_xml_item_output,
_ux_pictbridge_xml_function_output_getdevicestatus_jobendreason,
},
- {
- "errorStatus",
+ {
+ "errorStatus",
0,
UX_PICTBRIDGE_XML_LEAF,
_ux_pictbridge_xml_item_output,
_ux_pictbridge_xml_function_output_getdevicestatus_errorstatus,
},
- {
- "errorReason",
+ {
+ "errorReason",
0,
UX_PICTBRIDGE_XML_LEAF,
_ux_pictbridge_xml_item_output,
_ux_pictbridge_xml_function_output_getdevicestatus_errorreason,
},
- {
- "disconnectEnable",
+ {
+ "disconnectEnable",
0,
UX_PICTBRIDGE_XML_LEAF,
_ux_pictbridge_xml_item_output,
_ux_pictbridge_xml_function_output_getdevicestatus_disconnectenable,
},
- {
- "capabilityChanged",
+ {
+ "capabilityChanged",
0,
UX_PICTBRIDGE_XML_LEAF,
_ux_pictbridge_xml_item_output,
_ux_pictbridge_xml_function_output_getdevicestatus_capabilitychanged,
},
- {
- "newJobOK",
+ {
+ "newJobOK",
0,
UX_PICTBRIDGE_XML_LEAF,
_ux_pictbridge_xml_item_output,
@@ -672,40 +665,40 @@ UX_PICTBRIDGE_XML_ITEM _ux_pictbridge_xml_item_output_getdevicestatus[] =
/* Define Pictbridge XML output get job status. */
-UX_PICTBRIDGE_XML_ITEM _ux_pictbridge_xml_item_output_getjobstatus[] =
+UX_PICTBRIDGE_XML_ITEM _ux_pictbridge_xml_item_output_getjobstatus[] =
{
- {
- "prtPID",
+ {
+ "prtPID",
0,
UX_PICTBRIDGE_XML_LEAF,
_ux_pictbridge_xml_item_output,
_ux_pictbridge_xml_function_output_getjobstatus_prtpid,
},
- {
- "filePath",
+ {
+ "filePath",
0,
UX_PICTBRIDGE_XML_LEAF,
_ux_pictbridge_xml_item_output,
_ux_pictbridge_xml_function_output_getjobstatus_filepath,
},
- {
- "copyID",
+ {
+ "copyID",
0,
UX_PICTBRIDGE_XML_LEAF,
_ux_pictbridge_xml_item_output,
_ux_pictbridge_xml_function_output_getjobstatus_copyid,
},
- {
- "progress",
+ {
+ "progress",
0,
UX_PICTBRIDGE_XML_LEAF,
_ux_pictbridge_xml_item_output,
_ux_pictbridge_xml_function_output_getjobstatus_progress,
},
- {
- "imagesPrinted",
+ {
+ "imagesPrinted",
0,
UX_PICTBRIDGE_XML_LEAF,
_ux_pictbridge_xml_item_output,
@@ -717,80 +710,80 @@ UX_PICTBRIDGE_XML_ITEM _ux_pictbridge_xml_item_output_getjobstatus[] =
/* Define Pictbridge XML input get capability elements. */
-UX_PICTBRIDGE_XML_ITEM _ux_pictbridge_xml_item_input_getcapability_capability[] =
+UX_PICTBRIDGE_XML_ITEM _ux_pictbridge_xml_item_input_getcapability_capability[] =
{
- {
- "qualities",
+ {
+ "qualities",
UX_PICTBRIDGE_IR_GC_QUALITIES,
UX_PICTBRIDGE_XML_LEAF,
_ux_pictbridge_xml_item_input_getcapability,
_ux_pictbridge_xml_function_input_getcapability_capability_qualities,
},
- {
- "paperSizes",
+ {
+ "paperSizes",
UX_PICTBRIDGE_IR_GC_PAPER_SIZES,
UX_PICTBRIDGE_XML_LEAF,
_ux_pictbridge_xml_item_input_getcapability,
_ux_pictbridge_xml_function_input_getcapability_capability_papersizes,
},
- {
- "paperTypes",
+ {
+ "paperTypes",
UX_PICTBRIDGE_IR_GC_PAPER_TYPES,
UX_PICTBRIDGE_XML_LEAF,
_ux_pictbridge_xml_item_input_getcapability,
_ux_pictbridge_xml_function_input_getcapability_capability_papertypes,
},
- {
- "fileTypes",
+ {
+ "fileTypes",
UX_PICTBRIDGE_IR_GC_FILE_TYPES,
UX_PICTBRIDGE_XML_LEAF,
_ux_pictbridge_xml_item_input_getcapability,
_ux_pictbridge_xml_function_input_getcapability_capability_filetypes,
},
- {
- "datePrints",
+ {
+ "datePrints",
UX_PICTBRIDGE_IR_GC_DATE_PRINTS,
UX_PICTBRIDGE_XML_LEAF,
_ux_pictbridge_xml_item_input_getcapability,
_ux_pictbridge_xml_function_input_getcapability_capability_dateprints,
},
- {
- "fileNamePrints",
+ {
+ "fileNamePrints",
UX_PICTBRIDGE_IR_GC_FILE_NAME_PRINTS,
UX_PICTBRIDGE_XML_LEAF,
_ux_pictbridge_xml_item_input_getcapability,
_ux_pictbridge_xml_function_input_getcapability_capability_filenameprints,
},
- {
- "imageOptimizes",
+ {
+ "imageOptimizes",
UX_PICTBRIDGE_IR_GC_IMAGE_OPTIMIZES,
UX_PICTBRIDGE_XML_LEAF,
_ux_pictbridge_xml_item_input_getcapability,
_ux_pictbridge_xml_function_input_getcapability_capability_imageoptimizes,
},
- {
- "layouts",
+ {
+ "layouts",
UX_PICTBRIDGE_IR_GC_LAYOUTS,
UX_PICTBRIDGE_XML_LEAF,
_ux_pictbridge_xml_item_input_getcapability,
_ux_pictbridge_xml_function_input_getcapability_capability_layouts,
},
- {
- "fixedSizes",
+ {
+ "fixedSizes",
UX_PICTBRIDGE_IR_GC_FIXED_SIZES,
UX_PICTBRIDGE_XML_LEAF,
_ux_pictbridge_xml_item_input_getcapability,
_ux_pictbridge_xml_function_input_getcapability_capability_fixedsizes,
},
- {
- "croppings",
+ {
+ "croppings",
UX_PICTBRIDGE_IR_GC_CROPPINGS,
UX_PICTBRIDGE_XML_LEAF,
_ux_pictbridge_xml_item_input_getcapability,
_ux_pictbridge_xml_function_input_getcapability_capability_croppings,
},
- {
- "charRepertoires",
+ {
+ "charRepertoires",
UX_PICTBRIDGE_IR_GC_CHAR_REPERTOIRES,
UX_PICTBRIDGE_XML_LEAF,
_ux_pictbridge_xml_item_input_getcapability,
@@ -802,10 +795,10 @@ UX_PICTBRIDGE_XML_ITEM _ux_pictbridge_xml_item_input_getcapability_capability[]
/* Define Pictbridge XML get capability elements. */
-UX_PICTBRIDGE_XML_ITEM _ux_pictbridge_xml_item_input_getcapability[] =
+UX_PICTBRIDGE_XML_ITEM _ux_pictbridge_xml_item_input_getcapability[] =
{
- {
- "capability",
+ {
+ "capability",
0,
_ux_pictbridge_xml_item_input_getcapability_capability,
_ux_pictbridge_xml_item_input,
@@ -817,80 +810,80 @@ UX_PICTBRIDGE_XML_ITEM _ux_pictbridge_xml_item_input_getcapability[] =
};
/* Define Pictbridge XML output get capability elements. */
-UX_PICTBRIDGE_XML_ITEM _ux_pictbridge_xml_item_output_getcapability_capability[] =
+UX_PICTBRIDGE_XML_ITEM _ux_pictbridge_xml_item_output_getcapability_capability[] =
{
- {
- "qualities",
+ {
+ "qualities",
UX_PICTBRIDGE_IR_GC_QUALITIES,
UX_PICTBRIDGE_XML_LEAF,
_ux_pictbridge_xml_item_output_getcapability,
_ux_pictbridge_xml_function_output_getcapability_capability_qualities,
},
- {
- "paperSizes",
+ {
+ "paperSizes",
UX_PICTBRIDGE_IR_GC_PAPER_SIZES,
UX_PICTBRIDGE_XML_LEAF,
_ux_pictbridge_xml_item_output_getcapability,
_ux_pictbridge_xml_function_output_getcapability_capability_papersizes,
},
- {
- "paperTypes",
+ {
+ "paperTypes",
UX_PICTBRIDGE_IR_GC_PAPER_TYPES,
UX_PICTBRIDGE_XML_LEAF,
_ux_pictbridge_xml_item_output_getcapability,
_ux_pictbridge_xml_function_output_getcapability_capability_papertypes,
},
- {
- "fileTypes",
+ {
+ "fileTypes",
UX_PICTBRIDGE_IR_GC_FILE_TYPES,
UX_PICTBRIDGE_XML_LEAF,
_ux_pictbridge_xml_item_output_getcapability,
_ux_pictbridge_xml_function_output_getcapability_capability_filetypes,
},
- {
- "datePrints",
+ {
+ "datePrints",
UX_PICTBRIDGE_IR_GC_DATE_PRINTS,
UX_PICTBRIDGE_XML_LEAF,
_ux_pictbridge_xml_item_output_getcapability,
_ux_pictbridge_xml_function_output_getcapability_capability_dateprints,
},
- {
- "fileNamePrints",
+ {
+ "fileNamePrints",
UX_PICTBRIDGE_IR_GC_FILE_NAME_PRINTS,
UX_PICTBRIDGE_XML_LEAF,
_ux_pictbridge_xml_item_output_getcapability,
_ux_pictbridge_xml_function_output_getcapability_capability_filenameprints,
},
- {
- "imageOptimizes",
+ {
+ "imageOptimizes",
UX_PICTBRIDGE_IR_GC_IMAGE_OPTIMIZES,
UX_PICTBRIDGE_XML_LEAF,
_ux_pictbridge_xml_item_output_getcapability,
_ux_pictbridge_xml_function_output_getcapability_capability_imageoptimizes,
},
- {
- "layouts",
+ {
+ "layouts",
UX_PICTBRIDGE_IR_GC_LAYOUTS,
UX_PICTBRIDGE_XML_LEAF,
_ux_pictbridge_xml_item_output_getcapability,
_ux_pictbridge_xml_function_output_getcapability_capability_layouts,
},
- {
- "fixedSizes",
+ {
+ "fixedSizes",
UX_PICTBRIDGE_IR_GC_FIXED_SIZES,
UX_PICTBRIDGE_XML_LEAF,
_ux_pictbridge_xml_item_output_getcapability,
_ux_pictbridge_xml_function_output_getcapability_capability_fixedsizes,
},
- {
- "croppings",
+ {
+ "croppings",
UX_PICTBRIDGE_IR_GC_CROPPINGS,
UX_PICTBRIDGE_XML_LEAF,
_ux_pictbridge_xml_item_output_getcapability,
_ux_pictbridge_xml_function_output_getcapability_capability_croppings,
},
- {
- "charRepertoires",
+ {
+ "charRepertoires",
UX_PICTBRIDGE_IR_GC_CHAR_REPERTOIRES,
UX_PICTBRIDGE_XML_LEAF,
_ux_pictbridge_xml_item_output_getcapability,
@@ -901,10 +894,10 @@ UX_PICTBRIDGE_XML_ITEM _ux_pictbridge_xml_item_output_getcapability_capability[
};
/* Define Pictbridge XML get capability elements. */
-UX_PICTBRIDGE_XML_ITEM _ux_pictbridge_xml_item_output_getcapability[] =
+UX_PICTBRIDGE_XML_ITEM _ux_pictbridge_xml_item_output_getcapability[] =
{
- {
- "capability",
+ {
+ "capability",
0,
_ux_pictbridge_xml_item_output_getcapability_capability,
_ux_pictbridge_xml_item_output,
@@ -917,38 +910,38 @@ UX_PICTBRIDGE_XML_ITEM _ux_pictbridge_xml_item_output_getcapability[] =
/* Define Pictbridge XML configure print service elements. */
-UX_PICTBRIDGE_XML_ITEM _ux_pictbridge_xml_item_input_configureprintservice[] =
+UX_PICTBRIDGE_XML_ITEM _ux_pictbridge_xml_item_input_configureprintservice[] =
{
- {
- "dpsVersions",
+ {
+ "dpsVersions",
UX_PICTBRIDGE_IR_CPS_DPS_VERSIONS,
- UX_PICTBRIDGE_XML_LEAF,
+ UX_PICTBRIDGE_XML_LEAF,
_ux_pictbridge_xml_item_input,
- _ux_pictbridge_xml_function_input_dpsversion,
+ _ux_pictbridge_xml_function_input_dpsversion,
},
- {
- "vendorName",
+ {
+ "vendorName",
UX_PICTBRIDGE_IR_CPS_VENDOR_NAME,
UX_PICTBRIDGE_XML_LEAF,
_ux_pictbridge_xml_item_input,
_ux_pictbridge_xml_function_input_vendorname,
},
- {
- "vendorSpecificVersion",
+ {
+ "vendorSpecificVersion",
UX_PICTBRIDGE_IR_CPS_VENDOR_SPECIFIC_VERSION,
UX_PICTBRIDGE_XML_LEAF,
_ux_pictbridge_xml_item_input,
_ux_pictbridge_xml_function_input_vendorspecificversion,
},
- {
- "productName",
+ {
+ "productName",
UX_PICTBRIDGE_IR_CPS_PRODUCT_NAME,
UX_PICTBRIDGE_XML_LEAF,
_ux_pictbridge_xml_item_input,
_ux_pictbridge_xml_function_input_productname,
},
- {
- "serialNo",
+ {
+ "serialNo",
UX_PICTBRIDGE_IR_CPS_SERIAL_NO,
UX_PICTBRIDGE_XML_LEAF,
_ux_pictbridge_xml_item_input,
@@ -960,45 +953,45 @@ UX_PICTBRIDGE_XML_ITEM _ux_pictbridge_xml_item_input_configureprintservice[] =
/* Define Pictbridge XML configure print service elements. */
-UX_PICTBRIDGE_XML_ITEM _ux_pictbridge_xml_item_output_configureprintservice[] =
+UX_PICTBRIDGE_XML_ITEM _ux_pictbridge_xml_item_output_configureprintservice[] =
{
- {
- "printServiceAvailable",
+ {
+ "printServiceAvailable",
0,
- UX_NULL,
+ UX_NULL,
_ux_pictbridge_xml_item_output,
- _ux_pictbridge_xml_function_output_printserviceavailable,
+ _ux_pictbridge_xml_function_output_printserviceavailable,
},
- {
- "dpsVersions",
+ {
+ "dpsVersions",
0,
- UX_NULL,
+ UX_NULL,
_ux_pictbridge_xml_item_output,
- _ux_pictbridge_xml_function_output_dpsversion,
+ _ux_pictbridge_xml_function_output_dpsversion,
},
- {
- "vendorName",
+ {
+ "vendorName",
0,
UX_NULL,
_ux_pictbridge_xml_item_output,
_ux_pictbridge_xml_function_output_vendorname,
},
- {
- "vendorSpecificVersion",
+ {
+ "vendorSpecificVersion",
0,
UX_NULL,
_ux_pictbridge_xml_item_output,
_ux_pictbridge_xml_function_output_vendorspecificversion,
},
- {
- "productName",
+ {
+ "productName",
0,
UX_NULL,
_ux_pictbridge_xml_item_output,
_ux_pictbridge_xml_function_output_productname,
},
- {
- "serialNo",
+ {
+ "serialNo",
0,
UX_NULL,
_ux_pictbridge_xml_item_output,
@@ -1010,112 +1003,112 @@ UX_PICTBRIDGE_XML_ITEM _ux_pictbridge_xml_item_output_configureprintservice[] =
/* Define Pictbridge XML input elements. */
-UX_PICTBRIDGE_XML_ITEM _ux_pictbridge_xml_item_input[] =
+UX_PICTBRIDGE_XML_ITEM _ux_pictbridge_xml_item_input[] =
{
- {
- "configurePrintService",
+ {
+ "configurePrintService",
UX_PICTBRIDGE_IR_CONFIGURE_PRINT_SERVICE,
- _ux_pictbridge_xml_item_input_configureprintservice,
+ _ux_pictbridge_xml_item_input_configureprintservice,
_ux_pictbridge_xml_item_root,
- UX_NULL,
+ UX_NULL,
},
- {
- "getCapability",
+ {
+ "getCapability",
UX_PICTBRIDGE_IR_GET_CAPABILITY,
- _ux_pictbridge_xml_item_input_getcapability,
+ _ux_pictbridge_xml_item_input_getcapability,
_ux_pictbridge_xml_item_root,
- UX_NULL,
+ UX_NULL,
},
- {
- "getDeviceStatus",
+ {
+ "getDeviceStatus",
UX_PICTBRIDGE_IR_GET_DEVICE_STATUS,
- UX_NULL,
+ UX_NULL,
_ux_pictbridge_xml_item_root,
- UX_NULL,
+ UX_NULL,
},
- {
- "getJobStatus",
+ {
+ "getJobStatus",
UX_PICTBRIDGE_IR_GET_JOB_STATUS,
- UX_NULL,
+ UX_NULL,
_ux_pictbridge_xml_item_root,
- _ux_pictbridge_xml_function_input_getjobstatus,
+ _ux_pictbridge_xml_function_input_getjobstatus,
},
- {
- "startJob",
+ {
+ "startJob",
UX_PICTBRIDGE_IR_START_JOB,
- _ux_pictbridge_xml_item_input_startjob,
+ _ux_pictbridge_xml_item_input_startjob,
_ux_pictbridge_xml_item_root,
- _ux_pictbridge_xml_function_input_startjob,
+ _ux_pictbridge_xml_function_input_startjob,
},
- {
- "abortJob",
+ {
+ "abortJob",
UX_PICTBRIDGE_IR_ABORT_JOB,
- _ux_pictbridge_xml_item_input_abortjob,
+ _ux_pictbridge_xml_item_input_abortjob,
_ux_pictbridge_xml_item_root,
- UX_NULL,
+ UX_NULL,
},
- {
- "continueJob",
+ {
+ "continueJob",
UX_PICTBRIDGE_IR_CONTINUE_JOB,
UX_NULL,
_ux_pictbridge_xml_item_root,
- _ux_pictbridge_xml_function_input_continuejob,
+ _ux_pictbridge_xml_function_input_continuejob,
},
- {
- "notifyJobStatus",
+ {
+ "notifyJobStatus",
UX_PICTBRIDGE_IR_NOTIFY_JOB_STATUS,
- _ux_pictbridge_xml_item_input_notifyjobstatus,
+ _ux_pictbridge_xml_item_input_notifyjobstatus,
_ux_pictbridge_xml_item_root,
- _ux_pictbridge_xml_function_input_notifyjobstatus,
+ _ux_pictbridge_xml_function_input_notifyjobstatus,
},
- {
- "notifyDeviceStatus",
+ {
+ "notifyDeviceStatus",
UX_PICTBRIDGE_IR_NOTIFY_DEVICE_STATUS,
- _ux_pictbridge_xml_item_input_notifydevicestatus,
+ _ux_pictbridge_xml_item_input_notifydevicestatus,
_ux_pictbridge_xml_item_root,
- _ux_pictbridge_xml_function_input_notifydevicestatus,
+ _ux_pictbridge_xml_function_input_notifydevicestatus,
},
- {
- "getFileID",
+ {
+ "getFileID",
0,
- _ux_pictbridge_xml_item_input_getfileid,
+ _ux_pictbridge_xml_item_input_getfileid,
_ux_pictbridge_xml_item_root,
- UX_NULL,
+ UX_NULL,
},
- {
- "getFileInfo",
+ {
+ "getFileInfo",
0,
- _ux_pictbridge_xml_item_input_getfileinfo,
+ _ux_pictbridge_xml_item_input_getfileinfo,
_ux_pictbridge_xml_item_root,
- UX_NULL,
+ UX_NULL,
},
- {
- "getFile",
+ {
+ "getFile",
0,
- _ux_pictbridge_xml_item_input_getfile,
+ _ux_pictbridge_xml_item_input_getfile,
_ux_pictbridge_xml_item_root,
- UX_NULL,
+ UX_NULL,
},
- {
- "getPartialFile",
+ {
+ "getPartialFile",
0,
- _ux_pictbridge_xml_item_input_getpartialfile,
+ _ux_pictbridge_xml_item_input_getpartialfile,
_ux_pictbridge_xml_item_root,
- UX_NULL,
+ UX_NULL,
},
- {
- "getFileList",
+ {
+ "getFileList",
0,
- _ux_pictbridge_xml_item_input_getfilelist,
+ _ux_pictbridge_xml_item_input_getfilelist,
_ux_pictbridge_xml_item_root,
- UX_NULL,
+ UX_NULL,
},
- {
- "getThumb",
+ {
+ "getThumb",
0,
- _ux_pictbridge_xml_item_input_getthumb,
+ _ux_pictbridge_xml_item_input_getthumb,
_ux_pictbridge_xml_item_root,
- UX_NULL,
+ UX_NULL,
},
{ "\0", 0, UX_NULL, UX_NULL, UX_NULL }
@@ -1123,119 +1116,119 @@ UX_PICTBRIDGE_XML_ITEM _ux_pictbridge_xml_item_input[] =
};
/* Define Pictbridge XML output elements. */
-UX_PICTBRIDGE_XML_ITEM _ux_pictbridge_xml_item_output[] =
+UX_PICTBRIDGE_XML_ITEM _ux_pictbridge_xml_item_output[] =
{
- {
- "result",
+ {
+ "result",
0,
UX_NULL,
_ux_pictbridge_xml_item_root,
- _ux_pictbridge_xml_function_output_result,
+ _ux_pictbridge_xml_function_output_result,
},
- {
- "configurePrintService",
+ {
+ "configurePrintService",
UX_PICTBRIDGE_IR_CONFIGURE_PRINT_SERVICE,
- _ux_pictbridge_xml_item_output_configureprintservice,
+ _ux_pictbridge_xml_item_output_configureprintservice,
_ux_pictbridge_xml_item_root,
- UX_NULL,
+ UX_NULL,
},
- {
- "getCapability",
+ {
+ "getCapability",
UX_PICTBRIDGE_IR_GET_CAPABILITY,
- _ux_pictbridge_xml_item_output_getcapability,
+ _ux_pictbridge_xml_item_output_getcapability,
_ux_pictbridge_xml_item_root,
- UX_NULL,
+ UX_NULL,
},
- {
- "getDeviceStatus",
+ {
+ "getDeviceStatus",
UX_PICTBRIDGE_IR_GET_DEVICE_STATUS,
- _ux_pictbridge_xml_item_output_getdevicestatus,
+ _ux_pictbridge_xml_item_output_getdevicestatus,
_ux_pictbridge_xml_item_root,
- UX_NULL,
+ UX_NULL,
},
- {
- "getJobStatus",
+ {
+ "getJobStatus",
UX_PICTBRIDGE_IR_GET_JOB_STATUS,
- _ux_pictbridge_xml_item_output_getjobstatus,
+ _ux_pictbridge_xml_item_output_getjobstatus,
_ux_pictbridge_xml_item_root,
- UX_NULL,
+ UX_NULL,
},
- {
- "startJob",
+ {
+ "startJob",
UX_PICTBRIDGE_IR_START_JOB,
- UX_NULL,
+ UX_NULL,
_ux_pictbridge_xml_item_root,
- _ux_pictbridge_xml_function_output_startjob,
+ _ux_pictbridge_xml_function_output_startjob,
},
- {
- "abortJob",
+ {
+ "abortJob",
UX_PICTBRIDGE_IR_ABORT_JOB,
UX_NULL,
_ux_pictbridge_xml_item_root,
- _ux_pictbridge_xml_function_output_abortjob,
+ _ux_pictbridge_xml_function_output_abortjob,
},
- {
- "continueJob",
+ {
+ "continueJob",
UX_PICTBRIDGE_IR_CONTINUE_JOB,
- UX_NULL,
+ UX_NULL,
_ux_pictbridge_xml_item_root,
- _ux_pictbridge_xml_function_output_continuejob,
+ _ux_pictbridge_xml_function_output_continuejob,
},
- {
- "notifyJobStatus",
+ {
+ "notifyJobStatus",
0,
- UX_NULL,
+ UX_NULL,
_ux_pictbridge_xml_item_root,
- _ux_pictbridge_xml_function_output_notifyjobstatus,
+ _ux_pictbridge_xml_function_output_notifyjobstatus,
},
- {
- "notifyDeviceStatus",
+ {
+ "notifyDeviceStatus",
0,
- UX_NULL,
+ UX_NULL,
_ux_pictbridge_xml_item_root,
- _ux_pictbridge_xml_function_output_notifydevicestatus,
+ _ux_pictbridge_xml_function_output_notifydevicestatus,
},
- {
- "getFileID",
+ {
+ "getFileID",
0,
- _ux_pictbridge_xml_item_output_getfileid,
+ _ux_pictbridge_xml_item_output_getfileid,
_ux_pictbridge_xml_item_root,
- UX_NULL,
+ UX_NULL,
},
- {
- "getFileInfo",
+ {
+ "getFileInfo",
0,
- _ux_pictbridge_xml_item_output_getfileinfo,
+ _ux_pictbridge_xml_item_output_getfileinfo,
_ux_pictbridge_xml_item_root,
- UX_NULL,
+ UX_NULL,
},
- {
- "getFile",
+ {
+ "getFile",
0,
- _ux_pictbridge_xml_item_output_getfile,
+ _ux_pictbridge_xml_item_output_getfile,
_ux_pictbridge_xml_item_root,
- UX_NULL,
+ UX_NULL,
},
- {
- "getPartialFile",
+ {
+ "getPartialFile",
0,
- _ux_pictbridge_xml_item_output_getpartialfile,
+ _ux_pictbridge_xml_item_output_getpartialfile,
_ux_pictbridge_xml_item_root,
- UX_NULL,
+ UX_NULL,
},
- {
- "getFileList",
+ {
+ "getFileList",
0,
- _ux_pictbridge_xml_item_output_getfilelist,
+ _ux_pictbridge_xml_item_output_getfilelist,
_ux_pictbridge_xml_item_root,
- UX_NULL,
+ UX_NULL,
},
- {
- "getThumb",
+ {
+ "getThumb",
0,
- _ux_pictbridge_xml_item_output_getthumb,
+ _ux_pictbridge_xml_item_output_getthumb,
_ux_pictbridge_xml_item_root,
- UX_NULL,
+ UX_NULL,
},
{ "\0", 0, UX_NULL, UX_NULL, UX_NULL }
@@ -1244,36 +1237,36 @@ UX_PICTBRIDGE_XML_ITEM _ux_pictbridge_xml_item_output[] =
/* Define Pictbridge XML Root elements. */
-UX_PICTBRIDGE_XML_ITEM _ux_pictbridge_xml_item_root[] =
+UX_PICTBRIDGE_XML_ITEM _ux_pictbridge_xml_item_root[] =
{
- {
- "xml",
+ {
+ "xml",
0,
- UX_NULL,
- UX_NULL,
- _ux_pictbridge_xml_function_root_xml,
+ UX_NULL,
+ UX_NULL,
+ _ux_pictbridge_xml_function_root_xml,
},
-
- {
- "dps",
+
+ {
+ "dps",
0,
- UX_NULL,
- UX_NULL,
- _ux_pictbridge_xml_function_root_dps,
+ UX_NULL,
+ UX_NULL,
+ _ux_pictbridge_xml_function_root_dps,
},
- {
- "input",
+ {
+ "input",
0,
- _ux_pictbridge_xml_item_input,
- UX_NULL,
- _ux_pictbridge_xml_function_root_input,
+ _ux_pictbridge_xml_item_input,
+ UX_NULL,
+ _ux_pictbridge_xml_function_root_input,
},
- {
- "output",
+ {
+ "output",
0,
- _ux_pictbridge_xml_item_output,
- UX_NULL,
- _ux_pictbridge_xml_function_root_output,
+ _ux_pictbridge_xml_item_output,
+ UX_NULL,
+ _ux_pictbridge_xml_function_root_output,
},
{ "\0", 0, UX_NULL, UX_NULL, UX_NULL }
@@ -1290,73 +1283,73 @@ UCHAR _ux_pictbridge_drequest_name[] = "DREQUES
UCHAR _ux_pictbridge_drsponse_name[] = "DRSPONSE.DPS";
/* Define Pictbridge client volume strings. */
-UCHAR _ux_pictbridge_volume_description[] = "PIMA Client Storage Volume";
-UCHAR _ux_pictbridge_volume_label[] = "PIMA Client Storage Label";
+UCHAR _ux_pictbridge_volume_description[] = "PIMA Client Storage Volume";
+UCHAR _ux_pictbridge_volume_label[] = "PIMA Client Storage Label";
/* Define Pictbridge XML tag lines or tag names. */
UCHAR _ux_pictbridge_xml_tag_line_xmlversion[] = "?xml version=\"1.0\"?" ;
-UCHAR _ux_pictbridge_xml_tag_line_dpsxmlns[] = "dps xmlns=\"http://www.cipa.jp/dps/schema/\"";
+UCHAR _ux_pictbridge_xml_tag_line_dpsxmlns[] = "dps xmlns=\"http://www.cipa.jp/dps/schema/\"";
UCHAR _ux_pictbridge_xml_tag_line_dps[] = "dps";
UCHAR _ux_pictbridge_xml_tag_line_output[] = "output";
UCHAR _ux_pictbridge_xml_tag_line_input[] = "input";
UCHAR _ux_pictbridge_xml_tag_line_result[] = "result";
-UCHAR _ux_pictbridge_xml_tag_line_configureprintservice[] = "configurePrintService";
+UCHAR _ux_pictbridge_xml_tag_line_configureprintservice[] = "configurePrintService";
UCHAR _ux_pictbridge_xml_tag_line_printserviceavailable[] = "printServiceAvailable";
UCHAR _ux_pictbridge_xml_tag_line_dpsversions[] = "dpsVersions";
UCHAR _ux_pictbridge_xml_tag_line_vendorname[] = "vendorName";
-UCHAR _ux_pictbridge_xml_tag_line_vendorspecificversion[] = "vendorSpecificVersion";
+UCHAR _ux_pictbridge_xml_tag_line_vendorspecificversion[] = "vendorSpecificVersion";
UCHAR _ux_pictbridge_xml_tag_line_productname[] = "productName";
UCHAR _ux_pictbridge_xml_tag_line_serialno[] = "serialNo";
UCHAR _ux_pictbridge_xml_tag_line_capability[] = "capability";
UCHAR _ux_pictbridge_xml_tag_line_getcapability[] = "getCapability";
UCHAR _ux_pictbridge_xml_tag_line_qualities[] = "qualities";
-UCHAR _ux_pictbridge_xml_tag_line_papersizes[] = "paperSizes";
-UCHAR _ux_pictbridge_xml_tag_line_papertypes[] = "paperTypes";
-UCHAR _ux_pictbridge_xml_tag_line_filetypes[] = "fileTypes";
-UCHAR _ux_pictbridge_xml_tag_line_dateprints[] = "datePrints";
-UCHAR _ux_pictbridge_xml_tag_line_filenameprints[] = "fileNamePrints";
-UCHAR _ux_pictbridge_xml_tag_line_imageoptimizes[] = "imageOptimizes";
-UCHAR _ux_pictbridge_xml_tag_line_layouts[] = "layouts";
-UCHAR _ux_pictbridge_xml_tag_line_fixedsizes[] = "fixedSizes";
-UCHAR _ux_pictbridge_xml_tag_line_croppings[] = "croppings";
-UCHAR _ux_pictbridge_xml_tag_line_charrepertoires[] = "charRepertoires";
-UCHAR _ux_pictbridge_xml_tag_line_getdevicestatus[] = "getDeviceStatus";
-UCHAR _ux_pictbridge_xml_tag_line_dpsprintservicestatus[] = "dpsPrintServiceStatus";
-UCHAR _ux_pictbridge_xml_tag_line_jobendreason[] = "jobEndReason";
-UCHAR _ux_pictbridge_xml_tag_line_errorstatus[] = "errorStatus";
-UCHAR _ux_pictbridge_xml_tag_line_errorreason[] = "errorReason";
-UCHAR _ux_pictbridge_xml_tag_line_disconnectenable[] = "disconnectEnable";
-UCHAR _ux_pictbridge_xml_tag_line_capabilitychanged[] = "capabilityChanged";
-UCHAR _ux_pictbridge_xml_tag_line_newjobok[] = "newJobOK";
-UCHAR _ux_pictbridge_xml_tag_line_notifydevicestatus[] = "notifyDeviceStatus";
-UCHAR _ux_pictbridge_xml_tag_line_notifyjobstatus[] = "notifyJobStatus";
-UCHAR _ux_pictbridge_xml_tag_line_progress[] = "progress";
-UCHAR _ux_pictbridge_xml_tag_line_imagesprinted[] = "imagesPrinted";
+UCHAR _ux_pictbridge_xml_tag_line_papersizes[] = "paperSizes";
+UCHAR _ux_pictbridge_xml_tag_line_papertypes[] = "paperTypes";
+UCHAR _ux_pictbridge_xml_tag_line_filetypes[] = "fileTypes";
+UCHAR _ux_pictbridge_xml_tag_line_dateprints[] = "datePrints";
+UCHAR _ux_pictbridge_xml_tag_line_filenameprints[] = "fileNamePrints";
+UCHAR _ux_pictbridge_xml_tag_line_imageoptimizes[] = "imageOptimizes";
+UCHAR _ux_pictbridge_xml_tag_line_layouts[] = "layouts";
+UCHAR _ux_pictbridge_xml_tag_line_fixedsizes[] = "fixedSizes";
+UCHAR _ux_pictbridge_xml_tag_line_croppings[] = "croppings";
+UCHAR _ux_pictbridge_xml_tag_line_charrepertoires[] = "charRepertoires";
+UCHAR _ux_pictbridge_xml_tag_line_getdevicestatus[] = "getDeviceStatus";
+UCHAR _ux_pictbridge_xml_tag_line_dpsprintservicestatus[] = "dpsPrintServiceStatus";
+UCHAR _ux_pictbridge_xml_tag_line_jobendreason[] = "jobEndReason";
+UCHAR _ux_pictbridge_xml_tag_line_errorstatus[] = "errorStatus";
+UCHAR _ux_pictbridge_xml_tag_line_errorreason[] = "errorReason";
+UCHAR _ux_pictbridge_xml_tag_line_disconnectenable[] = "disconnectEnable";
+UCHAR _ux_pictbridge_xml_tag_line_capabilitychanged[] = "capabilityChanged";
+UCHAR _ux_pictbridge_xml_tag_line_newjobok[] = "newJobOK";
+UCHAR _ux_pictbridge_xml_tag_line_notifydevicestatus[] = "notifyDeviceStatus";
+UCHAR _ux_pictbridge_xml_tag_line_notifyjobstatus[] = "notifyJobStatus";
+UCHAR _ux_pictbridge_xml_tag_line_progress[] = "progress";
+UCHAR _ux_pictbridge_xml_tag_line_imagesprinted[] = "imagesPrinted";
UCHAR _ux_pictbridge_xml_tag_line_startjob[] = "startJob";
UCHAR _ux_pictbridge_xml_tag_line_abortjob[] = "abortJob";
UCHAR _ux_pictbridge_xml_tag_line_abortstyle[] = "abortStyle";
UCHAR _ux_pictbridge_xml_tag_line_continuejob[] = "continueJob";
UCHAR _ux_pictbridge_xml_tag_line_quality[] = "quality";
-UCHAR _ux_pictbridge_xml_tag_line_papersize[] = "paperSize";
-UCHAR _ux_pictbridge_xml_tag_line_papertype[] = "paperType";
-UCHAR _ux_pictbridge_xml_tag_line_filetype[] = "fileType";
-UCHAR _ux_pictbridge_xml_tag_line_dateprint[] = "datePrint";
-UCHAR _ux_pictbridge_xml_tag_line_filenameprint[] = "fileNamePrint";
-UCHAR _ux_pictbridge_xml_tag_line_imageoptimize[] = "imageOptimize";
-UCHAR _ux_pictbridge_xml_tag_line_layout[] = "layout";
-UCHAR _ux_pictbridge_xml_tag_line_fixedsize[] = "fixedSize";
-UCHAR _ux_pictbridge_xml_tag_line_cropping[] = "cropping";
-UCHAR _ux_pictbridge_xml_tag_line_jobconfig[] = "jobConfig";
-UCHAR _ux_pictbridge_xml_tag_line_printinfo[] = "printInfo";
-UCHAR _ux_pictbridge_xml_tag_line_fileid[] = "fileID";
-UCHAR _ux_pictbridge_xml_tag_line_filename[] = "fileName";
-UCHAR _ux_pictbridge_xml_tag_line_date[] = "date";
+UCHAR _ux_pictbridge_xml_tag_line_papersize[] = "paperSize";
+UCHAR _ux_pictbridge_xml_tag_line_papertype[] = "paperType";
+UCHAR _ux_pictbridge_xml_tag_line_filetype[] = "fileType";
+UCHAR _ux_pictbridge_xml_tag_line_dateprint[] = "datePrint";
+UCHAR _ux_pictbridge_xml_tag_line_filenameprint[] = "fileNamePrint";
+UCHAR _ux_pictbridge_xml_tag_line_imageoptimize[] = "imageOptimize";
+UCHAR _ux_pictbridge_xml_tag_line_layout[] = "layout";
+UCHAR _ux_pictbridge_xml_tag_line_fixedsize[] = "fixedSize";
+UCHAR _ux_pictbridge_xml_tag_line_cropping[] = "cropping";
+UCHAR _ux_pictbridge_xml_tag_line_jobconfig[] = "jobConfig";
+UCHAR _ux_pictbridge_xml_tag_line_printinfo[] = "printInfo";
+UCHAR _ux_pictbridge_xml_tag_line_fileid[] = "fileID";
+UCHAR _ux_pictbridge_xml_tag_line_filename[] = "fileName";
+UCHAR _ux_pictbridge_xml_tag_line_date[] = "date";
/* Define Pictbridge XML variable names. */
-UCHAR _ux_pictbridge_xml_variable_papersize[] = "paperSize";
-UCHAR _ux_pictbridge_xml_variable_version[] = "version";
-UCHAR _ux_pictbridge_xml_variable_xmlns[] = "xmlns";
+UCHAR _ux_pictbridge_xml_variable_papersize[] = "paperSize";
+UCHAR _ux_pictbridge_xml_variable_version[] = "version";
+UCHAR _ux_pictbridge_xml_variable_xmlns[] = "xmlns";
/* Define Pictbridge XML string names. */
-UCHAR _ux_pictbridge_xml_string_xmlns[] = "http://www.cipa.jp/dps/schema/";
+UCHAR _ux_pictbridge_xml_string_xmlns[] = "http://www.cipa.jp/dps/schema/";
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 837a6219..1e749cc8 100644
--- a/common/usbx_pictbridge/src/ux_pictbridge_dpsclient_api_abortjob.c
+++ b/common/usbx_pictbridge/src/ux_pictbridge_dpsclient_api_abortjob.c
@@ -1,18 +1,19 @@
/***************************************************************************
- * Copyright (c) 2024 Microsoft Corporation
- *
+ * Copyright (c) 2024 Microsoft Corporation
+ * Copyright (c) 2026-present Eclipse ThreadX contributors
+ *
* This program and the accompanying materials are made available under the
* terms of the MIT License which is available at
* https://opensource.org/licenses/MIT.
- *
+ *
* SPDX-License-Identifier: MIT
**************************************************************************/
/**************************************************************************/
/**************************************************************************/
-/** */
-/** USBX Component */
+/** */
+/** USBX Component */
/** */
/** Pictbridge Application */
/** */
@@ -29,49 +30,35 @@
#include "ux_device_class_pima.h"
-/**************************************************************************/
-/* */
-/* FUNCTION RELEASE */
-/* */
-/* _ux_pictbridge_dpsclient_api_abort_job PORTABLE C */
+/**************************************************************************/
+/* */
+/* FUNCTION RELEASE */
+/* */
+/* _ux_pictbridge_dpsclient_api_abort_job PORTABLE C */
/* 6.1.12 */
-/* */
+/* */
/* AUTHOR */
/* */
/* Chaoqiong Xiao, Microsoft Corporation */
/* */
/* DESCRIPTION */
-/* */
-/* This function creates the tag lines of the start job function */
-/* */
-/* INPUT */
-/* */
-/* pictbridge Pictbridge instance */
-/* */
-/* OUTPUT */
-/* */
-/* Completion Status */
-/* */
-/* CALLS */
-/* */
-/* */
-/* 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), */
-/* used UX prefix to refer to */
-/* TX symbols instead of using */
-/* them directly, */
-/* resulting in version 6.1 */
-/* 07-29-2022 Chaoqiong Xiao Modified comment(s), */
-/* used macros for RTOS calls, */
-/* resulting in version 6.1.12 */
+/* */
+/* This function creates the tag lines of the start job function */
+/* */
+/* INPUT */
+/* */
+/* pictbridge Pictbridge instance */
+/* */
+/* OUTPUT */
+/* */
+/* Completion Status */
+/* */
+/* CALLS */
+/* */
+/* */
+/* CALLED BY */
+/* */
+/* application */
/* */
/**************************************************************************/
UINT _ux_pictbridge_dpsclient_api_abort_job(UX_PICTBRIDGE *pictbridge)
@@ -81,13 +68,13 @@ ULONG actual_flags;
/* Prepare the object for capability. */
status = _ux_pictbridge_dpsclient_input_object_prepare(pictbridge, UX_PICTBRIDGE_OR_ABORT_JOB, 0, 0);
-
+
/* Check status. */
if (status != UX_SUCCESS)
return(status);
/* We should wait for the host to send a script with the response. */
- status = _ux_system_event_flags_get(&pictbridge -> ux_pictbridge_event_flags_group, UX_PICTBRIDGE_EVENT_FLAG_ABORT_JOB,
+ status = _ux_system_event_flags_get(&pictbridge -> ux_pictbridge_event_flags_group, UX_PICTBRIDGE_EVENT_FLAG_ABORT_JOB,
UX_AND_CLEAR, &actual_flags, UX_PICTBRIDGE_EVENT_TIMEOUT);
/* Check status. */
@@ -96,13 +83,13 @@ ULONG actual_flags;
/* Ensure the flag was set. */
if (actual_flags & UX_PICTBRIDGE_EVENT_FLAG_ABORT_JOB)
-
+
/* Return completion status. */
- return(UX_SUCCESS);
+ return(UX_SUCCESS);
else
-
+
/* Return completion status. */
- return(UX_ERROR);
+ return(UX_ERROR);
}
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 28aaceec..a70a959f 100644
--- a/common/usbx_pictbridge/src/ux_pictbridge_dpsclient_api_capability.c
+++ b/common/usbx_pictbridge/src/ux_pictbridge_dpsclient_api_capability.c
@@ -1,18 +1,19 @@
/***************************************************************************
- * Copyright (c) 2024 Microsoft Corporation
- *
+ * Copyright (c) 2024 Microsoft Corporation
+ * Copyright (c) 2026-present Eclipse ThreadX contributors
+ *
* This program and the accompanying materials are made available under the
* terms of the MIT License which is available at
* https://opensource.org/licenses/MIT.
- *
+ *
* SPDX-License-Identifier: MIT
**************************************************************************/
/**************************************************************************/
/**************************************************************************/
-/** */
-/** USBX Component */
+/** */
+/** USBX Component */
/** */
/** Pictbridge Application */
/** */
@@ -29,58 +30,44 @@
#include "ux_device_class_pima.h"
-/**************************************************************************/
-/* */
-/* FUNCTION RELEASE */
-/* */
-/* _ux_pictbridge_dpsclient_api_capability PORTABLE C */
+/**************************************************************************/
+/* */
+/* FUNCTION RELEASE */
+/* */
+/* _ux_pictbridge_dpsclient_api_capability PORTABLE C */
/* 6.1.12 */
/* AUTHOR */
/* */
/* Chaoqiong Xiao, Microsoft Corporation */
/* */
/* DESCRIPTION */
-/* */
-/* This function creates the tag lines of the configure_print_service */
-/* request and then output the request to the printer. */
-/* */
-/* INPUT */
-/* */
-/* pictbridge Pictbridge instance */
-/* capability_code What capability to get */
-/* capability_parameter Optional parameter */
-/* */
-/* OUTPUT */
-/* */
-/* Completion Status */
-/* */
-/* CALLS */
-/* */
-/* _ux_utility_delay_ms Delay ms */
+/* */
+/* This function creates the tag lines of the configure_print_service */
+/* request and then output the request to the printer. */
+/* */
+/* INPUT */
+/* */
+/* pictbridge Pictbridge instance */
+/* capability_code What capability to get */
+/* capability_parameter Optional parameter */
+/* */
+/* OUTPUT */
+/* */
+/* Completion Status */
+/* */
+/* CALLS */
+/* */
+/* _ux_utility_delay_ms Delay ms */
/* _ux_pictbridge_dps_client_input_object_prepare */
/* _ux_system_event_flags_get */
-/* */
-/* CALLED BY */
-/* */
-/* _ux_pictbridge_dpshost_object_get */
-/* */
-/* RELEASE HISTORY */
-/* */
-/* 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 */
-/* 07-29-2022 Chaoqiong Xiao Modified comment(s), */
-/* used macros for RTOS calls, */
-/* resulting in version 6.1.12 */
+/* */
+/* CALLED BY */
+/* */
+/* _ux_pictbridge_dpshost_object_get */
/* */
/**************************************************************************/
-UINT _ux_pictbridge_dpsclient_api_capability(UX_PICTBRIDGE *pictbridge, ULONG capability_code,
- ULONG capability_parameter)
+UINT _ux_pictbridge_dpsclient_api_capability(UX_PICTBRIDGE *pictbridge, ULONG capability_code,
+ ULONG capability_parameter)
{
UINT status;
ULONG actual_flags;
@@ -89,15 +76,15 @@ ULONG actual_flags;
_ux_utility_delay_ms(100);
/* Prepare the object for capability. */
- status = _ux_pictbridge_dpsclient_input_object_prepare(pictbridge, UX_PICTBRIDGE_OR_GET_CAPABILITY,
+ status = _ux_pictbridge_dpsclient_input_object_prepare(pictbridge, UX_PICTBRIDGE_OR_GET_CAPABILITY,
capability_code, capability_parameter);
-
+
/* Check status. */
if (status != UX_SUCCESS)
return(status);
/* We should wait for the host to send a script with the response. */
- status = _ux_system_event_flags_get(&pictbridge -> ux_pictbridge_event_flags_group, UX_PICTBRIDGE_EVENT_FLAG_CAPABILITY,
+ status = _ux_system_event_flags_get(&pictbridge -> ux_pictbridge_event_flags_group, UX_PICTBRIDGE_EVENT_FLAG_CAPABILITY,
UX_AND_CLEAR, &actual_flags, UX_PICTBRIDGE_EVENT_TIMEOUT);
/* Check status. */
@@ -106,13 +93,13 @@ ULONG actual_flags;
/* Ensure the flag was set. */
if (actual_flags & UX_PICTBRIDGE_EVENT_FLAG_CAPABILITY)
-
+
/* Return completion status. */
- return(UX_SUCCESS);
+ return(UX_SUCCESS);
else
-
+
/* Return completion status. */
- return(UX_ERROR);
+ return(UX_ERROR);
}
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 57c38ecd..811f9b95 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
@@ -1,18 +1,19 @@
/***************************************************************************
- * Copyright (c) 2024 Microsoft Corporation
- *
+ * Copyright (c) 2024 Microsoft Corporation
+ * Copyright (c) 2026-present Eclipse ThreadX contributors
+ *
* This program and the accompanying materials are made available under the
* terms of the MIT License which is available at
* https://opensource.org/licenses/MIT.
- *
+ *
* SPDX-License-Identifier: MIT
**************************************************************************/
/**************************************************************************/
/**************************************************************************/
-/** */
-/** USBX Component */
+/** */
+/** USBX Component */
/** */
/** Pictbridge Application */
/** */
@@ -29,55 +30,41 @@
#include "ux_device_class_pima.h"
-/**************************************************************************/
-/* */
-/* FUNCTION RELEASE */
-/* */
+/**************************************************************************/
+/* */
+/* FUNCTION RELEASE */
+/* */
/* _ux_pictbridge_dpsclient_api_configure_print_service */
-/* PORTABLE C */
+/* PORTABLE C */
/* 6.1.12 */
-/* */
+/* */
/* AUTHOR */
/* */
/* Chaoqiong Xiao, Microsoft Corporation */
/* */
/* DESCRIPTION */
-/* */
-/* This function creates the tag lines of the configure_print_service */
-/* request and then output the request to the printer. */
-/* */
-/* INPUT */
-/* */
-/* pictbridge Pictbridge instance */
-/* */
-/* OUTPUT */
-/* */
-/* Completion Status */
-/* */
-/* CALLS */
-/* */
-/* _ux_utility_delay_ms Delay ms */
-/* */
-/* CALLED BY */
-/* */
-/* _ux_pictbridge_dpshost_object_get */
-/* */
-/* RELEASE HISTORY */
-/* */
-/* 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 */
-/* 07-29-2022 Chaoqiong Xiao Modified comment(s), */
-/* used macros for RTOS calls, */
-/* resulting in version 6.1.12 */
+/* */
+/* This function creates the tag lines of the configure_print_service */
+/* request and then output the request to the printer. */
+/* */
+/* INPUT */
+/* */
+/* pictbridge Pictbridge instance */
+/* */
+/* OUTPUT */
+/* */
+/* Completion Status */
+/* */
+/* CALLS */
+/* */
+/* _ux_utility_delay_ms Delay ms */
+/* */
+/* CALLED BY */
+/* */
+/* _ux_pictbridge_dpshost_object_get */
/* */
/**************************************************************************/
-UINT _ux_pictbridge_dpsclient_api_configure_print_service(UX_PICTBRIDGE *pictbridge)
+UINT _ux_pictbridge_dpsclient_api_configure_print_service(UX_PICTBRIDGE *pictbridge)
{
UINT status;
ULONG actual_flags;
@@ -87,13 +74,13 @@ ULONG actual_flags;
/* Prepare the object for configure print service. */
status = _ux_pictbridge_dpsclient_input_object_prepare(pictbridge, UX_PICTBRIDGE_OR_CONFIGURE_PRINT_SERVICE, 0, 0);
-
+
/* Check status. */
if (status != UX_SUCCESS)
return(status);
/* We should wait for the host to send a script with the response. */
- status = _ux_system_event_flags_get(&pictbridge -> ux_pictbridge_event_flags_group, UX_PICTBRIDGE_EVENT_FLAG_CONFIGURE_PRINT_SERVICE,
+ status = _ux_system_event_flags_get(&pictbridge -> ux_pictbridge_event_flags_group, UX_PICTBRIDGE_EVENT_FLAG_CONFIGURE_PRINT_SERVICE,
UX_AND_CLEAR, &actual_flags, UX_PICTBRIDGE_EVENT_TIMEOUT);
/* Check status. */
@@ -102,13 +89,13 @@ ULONG actual_flags;
/* Ensure the flag was set. */
if (actual_flags & UX_PICTBRIDGE_EVENT_FLAG_CONFIGURE_PRINT_SERVICE)
-
+
/* Return completion status. */
- return(UX_SUCCESS);
+ return(UX_SUCCESS);
else
-
+
/* Return completion status. */
- return(UX_ERROR);
+ return(UX_ERROR);
}
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 f6f56084..ad51576c 100644
--- a/common/usbx_pictbridge/src/ux_pictbridge_dpsclient_api_continuejob.c
+++ b/common/usbx_pictbridge/src/ux_pictbridge_dpsclient_api_continuejob.c
@@ -1,18 +1,19 @@
/***************************************************************************
- * Copyright (c) 2024 Microsoft Corporation
- *
+ * Copyright (c) 2024 Microsoft Corporation
+ * Copyright (c) 2026-present Eclipse ThreadX contributors
+ *
* This program and the accompanying materials are made available under the
* terms of the MIT License which is available at
* https://opensource.org/licenses/MIT.
- *
+ *
* SPDX-License-Identifier: MIT
**************************************************************************/
/**************************************************************************/
/**************************************************************************/
-/** */
-/** USBX Component */
+/** */
+/** USBX Component */
/** */
/** Pictbridge Application */
/** */
@@ -29,48 +30,34 @@
#include "ux_device_class_pima.h"
-/**************************************************************************/
-/* */
-/* FUNCTION RELEASE */
-/* */
-/* _ux_pictbridge_dpsclient_api_continue_job PORTABLE C */
+/**************************************************************************/
+/* */
+/* FUNCTION RELEASE */
+/* */
+/* _ux_pictbridge_dpsclient_api_continue_job PORTABLE C */
/* 6.1.12 */
/* AUTHOR */
/* */
/* Chaoqiong Xiao, Microsoft Corporation */
/* */
/* DESCRIPTION */
-/* */
-/* This function creates the tag lines of the start job function */
-/* */
-/* INPUT */
-/* */
-/* pictbridge Pictbridge instance */
-/* */
-/* OUTPUT */
-/* */
-/* Completion Status */
-/* */
-/* CALLS */
-/* */
-/* */
-/* 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), */
-/* used UX prefix to refer to */
-/* TX symbols instead of using */
-/* them directly, */
-/* resulting in version 6.1 */
-/* 07-29-2022 Chaoqiong Xiao Modified comment(s), */
-/* used macros for RTOS calls, */
-/* resulting in version 6.1.12 */
+/* */
+/* This function creates the tag lines of the start job function */
+/* */
+/* INPUT */
+/* */
+/* pictbridge Pictbridge instance */
+/* */
+/* OUTPUT */
+/* */
+/* Completion Status */
+/* */
+/* CALLS */
+/* */
+/* */
+/* CALLED BY */
+/* */
+/* application */
/* */
/**************************************************************************/
UINT _ux_pictbridge_dpsclient_api_continue_job(UX_PICTBRIDGE *pictbridge)
@@ -80,13 +67,13 @@ ULONG actual_flags;
/* Prepare the object for capability. */
status = _ux_pictbridge_dpsclient_input_object_prepare(pictbridge, UX_PICTBRIDGE_OR_CONTINUE_JOB, 0, 0);
-
+
/* Check status. */
if (status != UX_SUCCESS)
return(status);
/* We should wait for the host to send a script with the response. */
- status = _ux_system_event_flags_get(&pictbridge -> ux_pictbridge_event_flags_group, UX_PICTBRIDGE_EVENT_FLAG_CONTINUE_JOB,
+ status = _ux_system_event_flags_get(&pictbridge -> ux_pictbridge_event_flags_group, UX_PICTBRIDGE_EVENT_FLAG_CONTINUE_JOB,
UX_AND_CLEAR, &actual_flags, UX_PICTBRIDGE_EVENT_TIMEOUT);
/* Check status. */
@@ -95,13 +82,13 @@ ULONG actual_flags;
/* Ensure the flag was set. */
if (actual_flags & UX_PICTBRIDGE_EVENT_FLAG_CONTINUE_JOB)
-
+
/* Return completion status. */
- return(UX_SUCCESS);
+ return(UX_SUCCESS);
else
-
+
/* Return completion status. */
- return(UX_ERROR);
+ return(UX_ERROR);
}
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 a56862dc..790e0c35 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
@@ -1,18 +1,19 @@
/***************************************************************************
- * Copyright (c) 2024 Microsoft Corporation
- *
+ * Copyright (c) 2024 Microsoft Corporation
+ * Copyright (c) 2026-present Eclipse ThreadX contributors
+ *
* This program and the accompanying materials are made available under the
* terms of the MIT License which is available at
* https://opensource.org/licenses/MIT.
- *
+ *
* SPDX-License-Identifier: MIT
**************************************************************************/
/**************************************************************************/
/**************************************************************************/
-/** */
-/** USBX Component */
+/** */
+/** USBX Component */
/** */
/** Pictbridge Application */
/** */
@@ -29,50 +30,36 @@
#include "ux_device_class_pima.h"
-/**************************************************************************/
-/* */
-/* FUNCTION RELEASE */
-/* */
-/* _ux_pictbridge_dpsclient_api_device_status PORTABLE C */
+/**************************************************************************/
+/* */
+/* FUNCTION RELEASE */
+/* */
+/* _ux_pictbridge_dpsclient_api_device_status PORTABLE C */
/* 6.1.12 */
-/* */
+/* */
/* AUTHOR */
/* */
/* Chaoqiong Xiao, Microsoft Corporation */
/* */
/* DESCRIPTION */
-/* */
-/* This function creates the tag lines of the device status function */
-/* */
-/* INPUT */
-/* */
-/* pictbridge Pictbridge instance */
-/* */
-/* OUTPUT */
-/* */
-/* Completion Status */
-/* */
-/* CALLS */
-/* */
-/* _ux_utility_delay_ms Delay ms */
-/* */
-/* 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), */
-/* used UX prefix to refer to */
-/* TX symbols instead of using */
-/* them directly, */
-/* resulting in version 6.1 */
-/* 07-29-2022 Chaoqiong Xiao Modified comment(s), */
-/* used macros for RTOS calls, */
-/* resulting in version 6.1.12 */
+/* */
+/* This function creates the tag lines of the device status function */
+/* */
+/* INPUT */
+/* */
+/* pictbridge Pictbridge instance */
+/* */
+/* OUTPUT */
+/* */
+/* Completion Status */
+/* */
+/* CALLS */
+/* */
+/* _ux_utility_delay_ms Delay ms */
+/* */
+/* CALLED BY */
+/* */
+/* application */
/* */
/**************************************************************************/
UINT _ux_pictbridge_dpsclient_api_device_status(UX_PICTBRIDGE *pictbridge)
@@ -85,13 +72,13 @@ ULONG actual_flags;
/* Prepare the object for capability. */
status = _ux_pictbridge_dpsclient_input_object_prepare(pictbridge, UX_PICTBRIDGE_OR_GET_DEVICE_STATUS, 0, 0);
-
+
/* Check status. */
if (status != UX_SUCCESS)
return(status);
/* We should wait for the host to send a script with the response. */
- status = _ux_system_event_flags_get(&pictbridge -> ux_pictbridge_event_flags_group, UX_PICTBRIDGE_EVENT_FLAG_DEVICE_STATUS,
+ status = _ux_system_event_flags_get(&pictbridge -> ux_pictbridge_event_flags_group, UX_PICTBRIDGE_EVENT_FLAG_DEVICE_STATUS,
UX_AND_CLEAR, &actual_flags, UX_PICTBRIDGE_EVENT_TIMEOUT);
/* Check status. */
@@ -100,13 +87,13 @@ ULONG actual_flags;
/* Ensure the flag was set. */
if (actual_flags & UX_PICTBRIDGE_EVENT_FLAG_DEVICE_STATUS)
-
+
/* Return completion status. */
- return(UX_SUCCESS);
+ return(UX_SUCCESS);
else
-
+
/* Return completion status. */
- return(UX_ERROR);
+ return(UX_ERROR);
}
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 d17a7e2a..b840a2de 100644
--- a/common/usbx_pictbridge/src/ux_pictbridge_dpsclient_api_startjob.c
+++ b/common/usbx_pictbridge/src/ux_pictbridge_dpsclient_api_startjob.c
@@ -1,18 +1,19 @@
/***************************************************************************
- * Copyright (c) 2024 Microsoft Corporation
- *
+ * Copyright (c) 2024 Microsoft Corporation
+ * Copyright (c) 2026-present Eclipse ThreadX contributors
+ *
* This program and the accompanying materials are made available under the
* terms of the MIT License which is available at
* https://opensource.org/licenses/MIT.
- *
+ *
* SPDX-License-Identifier: MIT
**************************************************************************/
/**************************************************************************/
/**************************************************************************/
-/** */
-/** USBX Component */
+/** */
+/** USBX Component */
/** */
/** Pictbridge Application */
/** */
@@ -29,49 +30,35 @@
#include "ux_device_class_pima.h"
-/**************************************************************************/
-/* */
-/* FUNCTION RELEASE */
-/* */
-/* _ux_pictbridge_dpsclient_api_start_job PORTABLE C */
+/**************************************************************************/
+/* */
+/* FUNCTION RELEASE */
+/* */
+/* _ux_pictbridge_dpsclient_api_start_job PORTABLE C */
/* 6.1.12 */
-/* */
+/* */
/* AUTHOR */
/* */
/* Chaoqiong Xiao, Microsoft Corporation */
/* */
/* DESCRIPTION */
-/* */
-/* This function creates the tag lines of the start job function */
-/* */
-/* INPUT */
-/* */
-/* pictbridge Pictbridge instance */
-/* */
-/* OUTPUT */
-/* */
-/* Completion Status */
-/* */
-/* CALLS */
-/* */
-/* */
-/* 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), */
-/* used UX prefix to refer to */
-/* TX symbols instead of using */
-/* them directly, */
-/* resulting in version 6.1 */
-/* 07-29-2022 Chaoqiong Xiao Modified comment(s), */
-/* used macros for RTOS calls, */
-/* resulting in version 6.1.12 */
+/* */
+/* This function creates the tag lines of the start job function */
+/* */
+/* INPUT */
+/* */
+/* pictbridge Pictbridge instance */
+/* */
+/* OUTPUT */
+/* */
+/* Completion Status */
+/* */
+/* CALLS */
+/* */
+/* */
+/* CALLED BY */
+/* */
+/* application */
/* */
/**************************************************************************/
UINT _ux_pictbridge_dpsclient_api_start_job(UX_PICTBRIDGE *pictbridge)
@@ -81,13 +68,13 @@ ULONG actual_flags;
/* Prepare the object for capability. */
status = _ux_pictbridge_dpsclient_input_object_prepare(pictbridge, UX_PICTBRIDGE_OR_START_JOB, 0, 0);
-
+
/* Check status. */
if (status != UX_SUCCESS)
return(status);
/* We should wait for the host to send a script with the response. */
- status = _ux_system_event_flags_get(&pictbridge -> ux_pictbridge_event_flags_group, UX_PICTBRIDGE_EVENT_FLAG_START_JOB,
+ status = _ux_system_event_flags_get(&pictbridge -> ux_pictbridge_event_flags_group, UX_PICTBRIDGE_EVENT_FLAG_START_JOB,
UX_AND_CLEAR, &actual_flags, UX_PICTBRIDGE_EVENT_TIMEOUT);
/* Check status. */
@@ -96,13 +83,13 @@ ULONG actual_flags;
/* Ensure the flag was set. */
if (actual_flags & UX_PICTBRIDGE_EVENT_FLAG_START_JOB)
-
+
/* Return completion status. */
- return(UX_SUCCESS);
+ return(UX_SUCCESS);
else
-
+
/* Return completion status. */
- return(UX_ERROR);
+ return(UX_ERROR);
}
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 34e28733..f4294cbd 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
@@ -1,18 +1,19 @@
/***************************************************************************
- * Copyright (c) 2024 Microsoft Corporation
- *
+ * Copyright (c) 2024 Microsoft Corporation
+ * Copyright (c) 2026-present Eclipse ThreadX contributors
+ *
* This program and the accompanying materials are made available under the
* terms of the MIT License which is available at
* https://opensource.org/licenses/MIT.
- *
+ *
* SPDX-License-Identifier: MIT
**************************************************************************/
/**************************************************************************/
/**************************************************************************/
-/** */
-/** USBX Component */
+/** */
+/** USBX Component */
/** */
/** Pictbridge Application */
/** */
@@ -29,86 +30,78 @@
#include "ux_device_class_pima.h"
-/**************************************************************************/
-/* */
-/* FUNCTION RELEASE */
-/* */
-/* _ux_pictbridge_dpsclient_input_abortjob */
-/* PORTABLE C */
+/**************************************************************************/
+/* */
+/* FUNCTION RELEASE */
+/* */
+/* _ux_pictbridge_dpsclient_input_abortjob */
+/* PORTABLE C */
/* 6.1 */
/* AUTHOR */
/* */
/* Chaoqiong Xiao, Microsoft Corporation */
/* */
/* DESCRIPTION */
-/* */
-/* This function creates the tag lines of the abort job */
-/* request. */
-/* */
-/* INPUT */
-/* */
-/* pictbridge Pictbridge instance */
+/* */
+/* This function creates the tag lines of the abort job */
+/* request. */
+/* */
+/* INPUT */
+/* */
+/* pictbridge Pictbridge instance */
/* pima_object_buffer Pointer to object buffer */
/* object_length Length of the object */
/* pima_object_buffer_updated Updated Address of the object */
/* object_length_updated Updated length */
/* */
-/* */
-/* OUTPUT */
-/* */
-/* Completion Status */
-/* */
-/* CALLS */
-/* */
-/* */
-/* CALLED BY */
-/* */
-/* _ux_pictbridge_dpsclient_input_object_prepare */
-/* */
-/* RELEASE HISTORY */
-/* */
-/* DATE NAME DESCRIPTION */
-/* */
-/* 05-19-2020 Chaoqiong Xiao Initial Version 6.0 */
-/* 09-30-2020 Chaoqiong Xiao Modified comment(s), */
-/* resulting in version 6.1 */
+/* */
+/* OUTPUT */
+/* */
+/* Completion Status */
+/* */
+/* CALLS */
+/* */
+/* */
+/* CALLED BY */
+/* */
+/* _ux_pictbridge_dpsclient_input_object_prepare */
/* */
/**************************************************************************/
-UINT _ux_pictbridge_dpsclient_input_object_abortjob(UX_PICTBRIDGE *pictbridge,
+UINT _ux_pictbridge_dpsclient_input_object_abortjob(UX_PICTBRIDGE *pictbridge,
ULONG input_subcode,
ULONG input_parameter,
- UCHAR *pima_object_buffer,
- ULONG object_length,
- UCHAR **pima_object_buffer_updated,
+ UCHAR *pima_object_buffer,
+ ULONG object_length,
+ UCHAR **pima_object_buffer_updated,
ULONG *object_length_updated)
{
-
+
UINT status;
UX_PICTBRIDGE_JOBINFO *jobinfo;
UX_PARAMETER_NOT_USED(input_subcode);
UX_PARAMETER_NOT_USED(input_parameter);
-
+
/* We can start a new job. Fill in the JobConfig and PrintInfo structures. */
jobinfo = &pictbridge -> ux_pictbridge_jobinfo;
/* Add the line */
- status = _ux_pictbridge_object_tag_line_add(pima_object_buffer, object_length, _ux_pictbridge_xml_tag_line_abortjob,
+ status = _ux_pictbridge_object_tag_line_add(pima_object_buffer, object_length, _ux_pictbridge_xml_tag_line_abortjob,
UX_PICTBRIDGE_TAG_FLAG_BEGIN | UX_PICTBRIDGE_TAG_FLAG_FORCE_LF,
UX_NULL, 0, UX_NULL, &pima_object_buffer, &object_length);
if (status != UX_SUCCESS)
return(status);
/* Add the line xxxxxxxx */
- status = _ux_pictbridge_object_tag_line_add(pima_object_buffer, object_length, _ux_pictbridge_xml_tag_line_abortstyle,
+ status = _ux_pictbridge_object_tag_line_add(pima_object_buffer, object_length, _ux_pictbridge_xml_tag_line_abortstyle,
UX_PICTBRIDGE_TAG_FLAG_BEGIN | UX_PICTBRIDGE_TAG_FLAG_END | UX_PICTBRIDGE_TAG_FLAG_VARIABLE_HEXA,
UX_NULL, 0, (VOID *)(ALIGN_TYPE) jobinfo -> ux_pictbridge_jobinfo_abort_style, &pima_object_buffer, &object_length);
if (status != UX_SUCCESS)
return(status);
/* Add the line */
- status = _ux_pictbridge_object_tag_line_add(pima_object_buffer, object_length, _ux_pictbridge_xml_tag_line_abortjob,
+ status = _ux_pictbridge_object_tag_line_add(pima_object_buffer, object_length, _ux_pictbridge_xml_tag_line_abortjob,
UX_PICTBRIDGE_TAG_FLAG_END,
UX_NULL, 0, UX_NULL, &pima_object_buffer, &object_length);
if (status != UX_SUCCESS)
@@ -116,11 +109,11 @@ UX_PICTBRIDGE_JOBINFO *jobinfo;
/* Update the caller's object position. */
*pima_object_buffer_updated = pima_object_buffer;
-
+
/* Update the caller's object length . */
*object_length_updated = object_length;
-
+
/* Return completion status. */
- return(UX_SUCCESS);
+ return(UX_SUCCESS);
}
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 cf0272ed..01d8e08a 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
@@ -1,18 +1,19 @@
/***************************************************************************
- * Copyright (c) 2024 Microsoft Corporation
- *
+ * Copyright (c) 2024 Microsoft Corporation
+ * Copyright (c) 2026-present Eclipse ThreadX contributors
+ *
* This program and the accompanying materials are made available under the
* terms of the MIT License which is available at
* https://opensource.org/licenses/MIT.
- *
+ *
* SPDX-License-Identifier: MIT
**************************************************************************/
/**************************************************************************/
/**************************************************************************/
-/** */
-/** USBX Component */
+/** */
+/** USBX Component */
/** */
/** Pictbridge Application */
/** */
@@ -29,105 +30,97 @@
#include "ux_device_class_pima.h"
-/**************************************************************************/
-/* */
-/* FUNCTION RELEASE */
-/* */
-/* _ux_pictbridge_dpsclient_input_object_configure_print_service */
-/* PORTABLE C */
+/**************************************************************************/
+/* */
+/* FUNCTION RELEASE */
+/* */
+/* _ux_pictbridge_dpsclient_input_object_configure_print_service */
+/* PORTABLE C */
/* 6.1 */
-/* */
+/* */
/* AUTHOR */
/* */
/* Chaoqiong Xiao, Microsoft Corporation */
/* */
/* DESCRIPTION */
-/* */
-/* This function creates the tag lines of the configure_print_service */
-/* request. */
-/* */
-/* INPUT */
-/* */
-/* pictbridge Pictbridge instance */
+/* */
+/* This function creates the tag lines of the configure_print_service */
+/* request. */
+/* */
+/* INPUT */
+/* */
+/* pictbridge Pictbridge instance */
/* pima_object_buffer Pointer to object buffer */
/* object_length Length of the object */
/* pima_object_buffer_updated Updated Address of the object */
/* object_length_updated Updated length */
/* */
-/* */
-/* OUTPUT */
-/* */
-/* Completion Status */
-/* */
-/* CALLS */
-/* */
-/* */
-/* CALLED BY */
-/* */
-/* _ux_pictbridge_dpsclient_input_object_prepare */
-/* */
-/* RELEASE HISTORY */
-/* */
-/* DATE NAME DESCRIPTION */
-/* */
-/* 05-19-2020 Chaoqiong Xiao Initial Version 6.0 */
-/* 09-30-2020 Chaoqiong Xiao Modified comment(s), */
-/* resulting in version 6.1 */
+/* */
+/* OUTPUT */
+/* */
+/* Completion Status */
+/* */
+/* CALLS */
+/* */
+/* */
+/* CALLED BY */
+/* */
+/* _ux_pictbridge_dpsclient_input_object_prepare */
/* */
/**************************************************************************/
-UINT _ux_pictbridge_dpsclient_input_object_configure_print_service(UX_PICTBRIDGE *pictbridge,
- UCHAR *pima_object_buffer,
- ULONG object_length,
- UCHAR **pima_object_buffer_updated,
+UINT _ux_pictbridge_dpsclient_input_object_configure_print_service(UX_PICTBRIDGE *pictbridge,
+ UCHAR *pima_object_buffer,
+ ULONG object_length,
+ UCHAR **pima_object_buffer_updated,
ULONG *object_length_updated)
{
UINT status;
/* Add the line */
- status = _ux_pictbridge_object_tag_line_add(pima_object_buffer, object_length, _ux_pictbridge_xml_tag_line_configureprintservice,
+ status = _ux_pictbridge_object_tag_line_add(pima_object_buffer, object_length, _ux_pictbridge_xml_tag_line_configureprintservice,
UX_PICTBRIDGE_TAG_FLAG_BEGIN | UX_PICTBRIDGE_TAG_FLAG_FORCE_LF,
UX_NULL, 0, UX_NULL, &pima_object_buffer, &object_length);
if (status != UX_SUCCESS)
return(status);
/* Add the line major_minor major_minor */
- status = _ux_pictbridge_object_tag_line_add(pima_object_buffer, object_length, _ux_pictbridge_xml_tag_line_dpsversions,
+ status = _ux_pictbridge_object_tag_line_add(pima_object_buffer, object_length, _ux_pictbridge_xml_tag_line_dpsversions,
UX_PICTBRIDGE_TAG_FLAG_BEGIN | UX_PICTBRIDGE_TAG_FLAG_END | UX_PICTBRIDGE_TAG_FLAG_VARIABLE_STRING,
UX_NULL, 0, (VOID *) pictbridge -> ux_pictbridge_dpslocal.ux_pictbridge_devinfo_dpsversions, &pima_object_buffer, &object_length);
if (status != UX_SUCCESS)
return(status);
/* Add the line ascii_string */
- status = _ux_pictbridge_object_tag_line_add(pima_object_buffer, object_length, _ux_pictbridge_xml_tag_line_vendorname,
+ status = _ux_pictbridge_object_tag_line_add(pima_object_buffer, object_length, _ux_pictbridge_xml_tag_line_vendorname,
UX_PICTBRIDGE_TAG_FLAG_BEGIN | UX_PICTBRIDGE_TAG_FLAG_END | UX_PICTBRIDGE_TAG_FLAG_VARIABLE_STRING,
UX_NULL, 0, (VOID *) pictbridge -> ux_pictbridge_dpslocal.ux_pictbridge_devinfo_product_name, &pima_object_buffer, &object_length);
if (status != UX_SUCCESS)
return(status);
/* Add the line major_minor */
- status = _ux_pictbridge_object_tag_line_add(pima_object_buffer, object_length, _ux_pictbridge_xml_tag_line_vendorspecificversion,
+ status = _ux_pictbridge_object_tag_line_add(pima_object_buffer, object_length, _ux_pictbridge_xml_tag_line_vendorspecificversion,
UX_PICTBRIDGE_TAG_FLAG_BEGIN | UX_PICTBRIDGE_TAG_FLAG_END | UX_PICTBRIDGE_TAG_FLAG_VARIABLE_MAJOR_MINOR,
UX_NULL, 0, (VOID *)(ALIGN_TYPE) pictbridge -> ux_pictbridge_dpslocal.ux_pictbridge_devinfo_vendor_specific_version, &pima_object_buffer, &object_length);
if (status != UX_SUCCESS)
return(status);
-
+
/* Add the line ascii_string */
- status = _ux_pictbridge_object_tag_line_add(pima_object_buffer, object_length, _ux_pictbridge_xml_tag_line_productname,
+ status = _ux_pictbridge_object_tag_line_add(pima_object_buffer, object_length, _ux_pictbridge_xml_tag_line_productname,
UX_PICTBRIDGE_TAG_FLAG_BEGIN | UX_PICTBRIDGE_TAG_FLAG_END | UX_PICTBRIDGE_TAG_FLAG_VARIABLE_STRING,
UX_NULL, 0, (VOID *)(ALIGN_TYPE) pictbridge -> ux_pictbridge_dpslocal.ux_pictbridge_devinfo_product_name, &pima_object_buffer, &object_length);
if (status != UX_SUCCESS)
return(status);
/* Add the line ascii_string */
- status = _ux_pictbridge_object_tag_line_add(pima_object_buffer, object_length, _ux_pictbridge_xml_tag_line_serialno,
+ status = _ux_pictbridge_object_tag_line_add(pima_object_buffer, object_length, _ux_pictbridge_xml_tag_line_serialno,
UX_PICTBRIDGE_TAG_FLAG_BEGIN | UX_PICTBRIDGE_TAG_FLAG_END | UX_PICTBRIDGE_TAG_FLAG_VARIABLE_STRING,
UX_NULL, 0, (VOID *)(ALIGN_TYPE) pictbridge -> ux_pictbridge_dpslocal.ux_pictbridge_devinfo_serial_no, &pima_object_buffer, &object_length);
if (status != UX_SUCCESS)
return(status);
/* Add the line */
- status = _ux_pictbridge_object_tag_line_add(pima_object_buffer, object_length, _ux_pictbridge_xml_tag_line_configureprintservice,
+ status = _ux_pictbridge_object_tag_line_add(pima_object_buffer, object_length, _ux_pictbridge_xml_tag_line_configureprintservice,
UX_PICTBRIDGE_TAG_FLAG_END,
UX_NULL, 0, UX_NULL, &pima_object_buffer, &object_length);
if (status != UX_SUCCESS)
@@ -135,11 +128,11 @@ UINT status;
/* Update the caller's object position. */
*pima_object_buffer_updated = pima_object_buffer;
-
+
/* Update the caller's object length . */
*object_length_updated = object_length;
-
+
/* Return completion status. */
- return(UX_SUCCESS);
+ return(UX_SUCCESS);
}
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 e9792c22..48cbb720 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
@@ -1,18 +1,19 @@
/***************************************************************************
- * Copyright (c) 2024 Microsoft Corporation
- *
+ * Copyright (c) 2024 Microsoft Corporation
+ * Copyright (c) 2026-present Eclipse ThreadX contributors
+ *
* This program and the accompanying materials are made available under the
* terms of the MIT License which is available at
* https://opensource.org/licenses/MIT.
- *
+ *
* SPDX-License-Identifier: MIT
**************************************************************************/
/**************************************************************************/
/**************************************************************************/
-/** */
-/** USBX Component */
+/** */
+/** USBX Component */
/** */
/** Pictbridge Application */
/** */
@@ -29,57 +30,49 @@
#include "ux_device_class_pima.h"
-/**************************************************************************/
-/* */
-/* FUNCTION RELEASE */
-/* */
-/* _ux_pictbridge_dpsclient_input_continuejob */
-/* PORTABLE C */
+/**************************************************************************/
+/* */
+/* FUNCTION RELEASE */
+/* */
+/* _ux_pictbridge_dpsclient_input_continuejob */
+/* PORTABLE C */
/* 6.1 */
/* AUTHOR */
/* */
/* Chaoqiong Xiao, Microsoft Corporation */
/* */
/* DESCRIPTION */
-/* */
-/* This function creates the tag lines of the continue job */
-/* request. */
-/* */
-/* INPUT */
-/* */
-/* pictbridge Pictbridge instance */
+/* */
+/* This function creates the tag lines of the continue job */
+/* request. */
+/* */
+/* INPUT */
+/* */
+/* pictbridge Pictbridge instance */
/* pima_object_buffer Pointer to object buffer */
/* object_length Length of the object */
/* pima_object_buffer_updated Updated Address of the object */
/* object_length_updated Updated length */
/* */
-/* */
-/* OUTPUT */
-/* */
-/* Completion Status */
-/* */
-/* CALLS */
-/* */
-/* */
-/* CALLED BY */
-/* */
-/* _ux_pictbridge_dpsclient_input_object_prepare */
-/* */
-/* RELEASE HISTORY */
-/* */
-/* DATE NAME DESCRIPTION */
-/* */
-/* 05-19-2020 Chaoqiong Xiao Initial Version 6.0 */
-/* 09-30-2020 Chaoqiong Xiao Modified comment(s), */
-/* resulting in version 6.1 */
+/* */
+/* OUTPUT */
+/* */
+/* Completion Status */
+/* */
+/* CALLS */
+/* */
+/* */
+/* CALLED BY */
+/* */
+/* _ux_pictbridge_dpsclient_input_object_prepare */
/* */
/**************************************************************************/
-UINT _ux_pictbridge_dpsclient_input_object_continuejob(UX_PICTBRIDGE *pictbridge,
+UINT _ux_pictbridge_dpsclient_input_object_continuejob(UX_PICTBRIDGE *pictbridge,
ULONG input_subcode,
ULONG input_parameter,
- UCHAR *pima_object_buffer,
- ULONG object_length,
- UCHAR **pima_object_buffer_updated,
+ UCHAR *pima_object_buffer,
+ ULONG object_length,
+ UCHAR **pima_object_buffer_updated,
ULONG *object_length_updated)
{
@@ -91,7 +84,7 @@ UINT status;
UX_PARAMETER_NOT_USED(input_parameter);
/* Add the line */
- status = _ux_pictbridge_object_tag_line_add(pima_object_buffer, object_length, _ux_pictbridge_xml_tag_line_continuejob,
+ status = _ux_pictbridge_object_tag_line_add(pima_object_buffer, object_length, _ux_pictbridge_xml_tag_line_continuejob,
UX_PICTBRIDGE_TAG_FLAG_BEGIN | UX_PICTBRIDGE_TAG_FLAG_FORCE_SLASH_AT_END | UX_PICTBRIDGE_TAG_FLAG_FORCE_LF,
UX_NULL, 0, UX_NULL, &pima_object_buffer, &object_length);
if (status != UX_SUCCESS)
@@ -99,11 +92,11 @@ UINT status;
/* Update the caller's object position. */
*pima_object_buffer_updated = pima_object_buffer;
-
+
/* Update the caller's object length . */
*object_length_updated = object_length;
-
+
/* Return completion status. */
- return(UX_SUCCESS);
+ return(UX_SUCCESS);
}
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 985ea52f..01bb7664 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
@@ -1,18 +1,19 @@
/***************************************************************************
- * Copyright (c) 2024 Microsoft Corporation
- *
+ * Copyright (c) 2024 Microsoft Corporation
+ * Copyright (c) 2026-present Eclipse ThreadX contributors
+ *
* This program and the accompanying materials are made available under the
* terms of the MIT License which is available at
* https://opensource.org/licenses/MIT.
- *
+ *
* SPDX-License-Identifier: MIT
**************************************************************************/
/**************************************************************************/
/**************************************************************************/
-/** */
-/** USBX Component */
+/** */
+/** USBX Component */
/** */
/** Pictbridge Application */
/** */
@@ -29,58 +30,50 @@
#include "ux_device_class_pima.h"
-/**************************************************************************/
-/* */
-/* FUNCTION RELEASE */
-/* */
-/* _ux_pictbridge_dpsclient_input_get_capability */
-/* PORTABLE C */
+/**************************************************************************/
+/* */
+/* FUNCTION RELEASE */
+/* */
+/* _ux_pictbridge_dpsclient_input_get_capability */
+/* PORTABLE C */
/* 6.1 */
-/* */
+/* */
/* AUTHOR */
/* */
/* Chaoqiong Xiao, Microsoft Corporation */
/* */
/* DESCRIPTION */
-/* */
-/* This function creates the tag lines of the capability */
-/* request. */
-/* */
-/* INPUT */
-/* */
-/* pictbridge Pictbridge instance */
+/* */
+/* This function creates the tag lines of the capability */
+/* request. */
+/* */
+/* INPUT */
+/* */
+/* pictbridge Pictbridge instance */
/* pima_object_buffer Pointer to object buffer */
/* object_length Length of the object */
/* pima_object_buffer_updated Updated Address of the object */
/* object_length_updated Updated length */
/* */
-/* */
-/* OUTPUT */
-/* */
-/* Completion Status */
-/* */
-/* CALLS */
-/* */
-/* */
-/* CALLED BY */
-/* */
-/* _ux_pictbridge_dpsclient_input_object_prepare */
-/* */
-/* RELEASE HISTORY */
-/* */
-/* DATE NAME DESCRIPTION */
-/* */
-/* 05-19-2020 Chaoqiong Xiao Initial Version 6.0 */
-/* 09-30-2020 Chaoqiong Xiao Modified comment(s), */
-/* resulting in version 6.1 */
+/* */
+/* OUTPUT */
+/* */
+/* Completion Status */
+/* */
+/* CALLS */
+/* */
+/* */
+/* CALLED BY */
+/* */
+/* _ux_pictbridge_dpsclient_input_object_prepare */
/* */
/**************************************************************************/
-UINT _ux_pictbridge_dpsclient_input_object_get_capability(UX_PICTBRIDGE *pictbridge,
+UINT _ux_pictbridge_dpsclient_input_object_get_capability(UX_PICTBRIDGE *pictbridge,
ULONG input_subcode,
ULONG input_parameter,
- UCHAR *pima_object_buffer,
- ULONG object_length,
- UCHAR **pima_object_buffer_updated,
+ UCHAR *pima_object_buffer,
+ ULONG object_length,
+ UCHAR **pima_object_buffer_updated,
ULONG *object_length_updated)
{
@@ -88,14 +81,14 @@ UINT status;
/* Add the line */
- status = _ux_pictbridge_object_tag_line_add(pima_object_buffer, object_length, _ux_pictbridge_xml_tag_line_getcapability,
+ status = _ux_pictbridge_object_tag_line_add(pima_object_buffer, object_length, _ux_pictbridge_xml_tag_line_getcapability,
UX_PICTBRIDGE_TAG_FLAG_BEGIN | UX_PICTBRIDGE_TAG_FLAG_FORCE_LF,
UX_NULL, 0, UX_NULL, &pima_object_buffer, &object_length);
if (status != UX_SUCCESS)
return(status);
/* Add the line */
- status = _ux_pictbridge_object_tag_line_add(pima_object_buffer, object_length, _ux_pictbridge_xml_tag_line_capability,
+ status = _ux_pictbridge_object_tag_line_add(pima_object_buffer, object_length, _ux_pictbridge_xml_tag_line_capability,
UX_PICTBRIDGE_TAG_FLAG_BEGIN | UX_PICTBRIDGE_TAG_FLAG_FORCE_LF,
UX_NULL, 0, UX_NULL, &pima_object_buffer, &object_length);
if (status != UX_SUCCESS)
@@ -105,7 +98,7 @@ UINT status;
if (input_subcode & UX_PICTBRIDGE_API_QUALITIES)
{
/* Add the line */
- status = _ux_pictbridge_object_tag_line_add(pima_object_buffer, object_length, _ux_pictbridge_xml_tag_line_qualities,
+ status = _ux_pictbridge_object_tag_line_add(pima_object_buffer, object_length, _ux_pictbridge_xml_tag_line_qualities,
UX_PICTBRIDGE_TAG_FLAG_BEGIN | UX_PICTBRIDGE_TAG_FLAG_FORCE_SLASH_AT_END,
UX_NULL, 0, UX_NULL, &pima_object_buffer, &object_length);
if (status != UX_SUCCESS)
@@ -116,7 +109,7 @@ UINT status;
if (input_subcode & UX_PICTBRIDGE_API_PAPER_SIZES)
{
/* Add the line */
- status = _ux_pictbridge_object_tag_line_add(pima_object_buffer, object_length, _ux_pictbridge_xml_tag_line_papersizes,
+ status = _ux_pictbridge_object_tag_line_add(pima_object_buffer, object_length, _ux_pictbridge_xml_tag_line_papersizes,
UX_PICTBRIDGE_TAG_FLAG_BEGIN | UX_PICTBRIDGE_TAG_FLAG_FORCE_SLASH_AT_END,
UX_NULL, 0, UX_NULL, &pima_object_buffer, &object_length);
if (status != UX_SUCCESS)
@@ -131,10 +124,10 @@ UINT status;
if (input_parameter != 0)
{
/* Add the line */
- status = _ux_pictbridge_object_tag_line_add(pima_object_buffer, object_length, _ux_pictbridge_xml_tag_line_papertypes,
+ status = _ux_pictbridge_object_tag_line_add(pima_object_buffer, object_length, _ux_pictbridge_xml_tag_line_papertypes,
UX_PICTBRIDGE_TAG_FLAG_BEGIN | UX_PICTBRIDGE_TAG_FLAG_FORCE_SLASH_AT_END | UX_PICTBRIDGE_TAG_FLAG_VARIABLE_HEXA,
_ux_pictbridge_xml_variable_papersize,
- input_parameter,
+ input_parameter,
UX_NULL, &pima_object_buffer, &object_length);
if (status != UX_SUCCESS)
return(status);
@@ -142,20 +135,20 @@ UINT status;
else
{
/* Add the line */
- status = _ux_pictbridge_object_tag_line_add(pima_object_buffer, object_length, _ux_pictbridge_xml_tag_line_papertypes,
+ status = _ux_pictbridge_object_tag_line_add(pima_object_buffer, object_length, _ux_pictbridge_xml_tag_line_papertypes,
UX_PICTBRIDGE_TAG_FLAG_BEGIN | UX_PICTBRIDGE_TAG_FLAG_FORCE_SLASH_AT_END,
- UX_NULL, 0,
+ UX_NULL, 0,
(VOID *) &pictbridge -> ux_pictbridge_dpslocal.ux_pictbridge_devinfo_papertypes, &pima_object_buffer, &object_length);
if (status != UX_SUCCESS)
return(status);
}
}
-
+
/* Parse the tag code that was memorized during the input. */
if (input_subcode & UX_PICTBRIDGE_API_FILE_TYPES)
{
/* Add the line */
- _ux_pictbridge_object_tag_line_add(pima_object_buffer, object_length, _ux_pictbridge_xml_tag_line_filetypes,
+ _ux_pictbridge_object_tag_line_add(pima_object_buffer, object_length, _ux_pictbridge_xml_tag_line_filetypes,
UX_PICTBRIDGE_TAG_FLAG_BEGIN | UX_PICTBRIDGE_TAG_FLAG_FORCE_SLASH_AT_END,
UX_NULL, 0, UX_NULL , &pima_object_buffer, &object_length);
if (status != UX_SUCCESS)
@@ -166,7 +159,7 @@ UINT status;
if (input_subcode & UX_PICTBRIDGE_API_DATE_PRINTS)
{
/* Add the line */
- _ux_pictbridge_object_tag_line_add(pima_object_buffer, object_length, _ux_pictbridge_xml_tag_line_dateprints,
+ _ux_pictbridge_object_tag_line_add(pima_object_buffer, object_length, _ux_pictbridge_xml_tag_line_dateprints,
UX_PICTBRIDGE_TAG_FLAG_BEGIN | UX_PICTBRIDGE_TAG_FLAG_FORCE_SLASH_AT_END,
UX_NULL, 0, UX_NULL , &pima_object_buffer, &object_length);
if (status != UX_SUCCESS)
@@ -177,7 +170,7 @@ UINT status;
if (input_subcode & UX_PICTBRIDGE_API_FILE_NAME_PRINTS)
{
/* Add the line */
- status = _ux_pictbridge_object_tag_line_add(pima_object_buffer, object_length, _ux_pictbridge_xml_tag_line_filenameprints,
+ status = _ux_pictbridge_object_tag_line_add(pima_object_buffer, object_length, _ux_pictbridge_xml_tag_line_filenameprints,
UX_PICTBRIDGE_TAG_FLAG_BEGIN | UX_PICTBRIDGE_TAG_FLAG_FORCE_SLASH_AT_END,
UX_NULL, 0, UX_NULL, &pima_object_buffer, &object_length);
if (status != UX_SUCCESS)
@@ -188,7 +181,7 @@ UINT status;
if (input_subcode & UX_PICTBRIDGE_API_IMAGE_OPTIMIZES)
{
/* Add the line */
- status = _ux_pictbridge_object_tag_line_add(pima_object_buffer, object_length, _ux_pictbridge_xml_tag_line_imageoptimizes,
+ status = _ux_pictbridge_object_tag_line_add(pima_object_buffer, object_length, _ux_pictbridge_xml_tag_line_imageoptimizes,
UX_PICTBRIDGE_TAG_FLAG_BEGIN | UX_PICTBRIDGE_TAG_FLAG_FORCE_SLASH_AT_END,
UX_NULL, 0, UX_NULL, &pima_object_buffer, &object_length);
if (status != UX_SUCCESS)
@@ -203,10 +196,10 @@ UINT status;
if (input_parameter != 0)
{
/* Add the line */
- status = _ux_pictbridge_object_tag_line_add(pima_object_buffer, object_length, _ux_pictbridge_xml_tag_line_layouts,
+ status = _ux_pictbridge_object_tag_line_add(pima_object_buffer, object_length, _ux_pictbridge_xml_tag_line_layouts,
UX_PICTBRIDGE_TAG_FLAG_BEGIN | UX_PICTBRIDGE_TAG_FLAG_FORCE_SLASH_AT_END | UX_PICTBRIDGE_TAG_FLAG_VARIABLE_HEXA,
_ux_pictbridge_xml_variable_papersize,
- input_parameter,
+ input_parameter,
UX_NULL, &pima_object_buffer, &object_length);
if (status != UX_SUCCESS)
return(status);
@@ -214,9 +207,9 @@ UINT status;
else
{
/* Add the line */
- status = _ux_pictbridge_object_tag_line_add(pima_object_buffer, object_length, _ux_pictbridge_xml_tag_line_layouts,
+ status = _ux_pictbridge_object_tag_line_add(pima_object_buffer, object_length, _ux_pictbridge_xml_tag_line_layouts,
UX_PICTBRIDGE_TAG_FLAG_BEGIN | UX_PICTBRIDGE_TAG_FLAG_FORCE_SLASH_AT_END,
- UX_NULL, 0,
+ UX_NULL, 0,
UX_NULL, &pima_object_buffer, &object_length);
if (status != UX_SUCCESS)
return(status);
@@ -227,9 +220,9 @@ UINT status;
if (input_subcode & UX_PICTBRIDGE_API_FIXED_SIZES)
{
/* Add the line */
- status = _ux_pictbridge_object_tag_line_add(pima_object_buffer, object_length, _ux_pictbridge_xml_tag_line_fixedsizes,
+ status = _ux_pictbridge_object_tag_line_add(pima_object_buffer, object_length, _ux_pictbridge_xml_tag_line_fixedsizes,
UX_PICTBRIDGE_TAG_FLAG_BEGIN | UX_PICTBRIDGE_TAG_FLAG_FORCE_SLASH_AT_END,
- UX_NULL, 0,
+ UX_NULL, 0,
UX_NULL, &pima_object_buffer, &object_length);
if (status != UX_SUCCESS)
return(status);
@@ -239,7 +232,7 @@ UINT status;
if (input_subcode & UX_PICTBRIDGE_API_CROPPINGS)
{
/* Add the line */
- status = _ux_pictbridge_object_tag_line_add(pima_object_buffer, object_length, _ux_pictbridge_xml_tag_line_croppings,
+ status = _ux_pictbridge_object_tag_line_add(pima_object_buffer, object_length, _ux_pictbridge_xml_tag_line_croppings,
UX_PICTBRIDGE_TAG_FLAG_BEGIN | UX_PICTBRIDGE_TAG_FLAG_FORCE_SLASH_AT_END,
UX_NULL, 0, UX_NULL, &pima_object_buffer, &object_length);
if (status != UX_SUCCESS)
@@ -250,23 +243,23 @@ UINT status;
if (input_subcode & UX_PICTBRIDGE_API_CHAR_REPERTOIRES)
{
/* Add the line */
- status = _ux_pictbridge_object_tag_line_add(pima_object_buffer, object_length, _ux_pictbridge_xml_tag_line_charrepertoires,
+ status = _ux_pictbridge_object_tag_line_add(pima_object_buffer, object_length, _ux_pictbridge_xml_tag_line_charrepertoires,
UX_PICTBRIDGE_TAG_FLAG_BEGIN | UX_PICTBRIDGE_TAG_FLAG_FORCE_SLASH_AT_END,
- UX_NULL, 0,
+ UX_NULL, 0,
UX_NULL, &pima_object_buffer, &object_length);
if (status != UX_SUCCESS)
return(status);
}
/* Add the line */
- status = _ux_pictbridge_object_tag_line_add(pima_object_buffer, object_length, _ux_pictbridge_xml_tag_line_capability,
+ status = _ux_pictbridge_object_tag_line_add(pima_object_buffer, object_length, _ux_pictbridge_xml_tag_line_capability,
UX_PICTBRIDGE_TAG_FLAG_END,
UX_NULL, 0, UX_NULL, &pima_object_buffer, &object_length);
if (status != UX_SUCCESS)
return(status);
/* Add the line */
- status = _ux_pictbridge_object_tag_line_add(pima_object_buffer, object_length, _ux_pictbridge_xml_tag_line_getcapability,
+ status = _ux_pictbridge_object_tag_line_add(pima_object_buffer, object_length, _ux_pictbridge_xml_tag_line_getcapability,
UX_PICTBRIDGE_TAG_FLAG_END,
UX_NULL, 0, UX_NULL, &pima_object_buffer, &object_length);
if (status != UX_SUCCESS)
@@ -274,11 +267,11 @@ UINT status;
/* Update the caller's object position. */
*pima_object_buffer_updated = pima_object_buffer;
-
+
/* Update the caller's object length . */
*object_length_updated = object_length;
-
+
/* Return completion status. */
- return(UX_SUCCESS);
+ return(UX_SUCCESS);
}
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 e3e0ffb4..311caed8 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
@@ -1,18 +1,19 @@
/***************************************************************************
- * Copyright (c) 2024 Microsoft Corporation
- *
+ * Copyright (c) 2024 Microsoft Corporation
+ * Copyright (c) 2026-present Eclipse ThreadX contributors
+ *
* This program and the accompanying materials are made available under the
* terms of the MIT License which is available at
* https://opensource.org/licenses/MIT.
- *
+ *
* SPDX-License-Identifier: MIT
**************************************************************************/
/**************************************************************************/
/**************************************************************************/
-/** */
-/** USBX Component */
+/** */
+/** USBX Component */
/** */
/** Pictbridge Application */
/** */
@@ -29,57 +30,41 @@
#include "ux_device_class_pima.h"
-/**************************************************************************/
-/* */
-/* FUNCTION RELEASE */
-/* */
-/* _ux_pictbridge_dpsclient_input_object_prepare PORTABLE C */
+/**************************************************************************/
+/* */
+/* FUNCTION RELEASE */
+/* */
+/* _ux_pictbridge_dpsclient_input_object_prepare PORTABLE C */
/* 6.1.12 */
/* AUTHOR */
/* */
/* Chaoqiong Xiao, Microsoft Corporation */
/* */
/* DESCRIPTION */
-/* */
-/* This function prepares a client input object to be sent. */
-/* This function puts a interrupt notification for the host to issue */
-/* a get object request. */
-/* */
-/* INPUT */
-/* */
-/* pictbridge Pictbridge instance */
-/* input_function input function */
-/* */
-/* OUTPUT */
-/* */
-/* Completion Status */
-/* */
-/* CALLS */
-/* */
-/* */
-/* CALLED BY */
-/* */
-/* */
-/* */
-/* RELEASE HISTORY */
-/* */
-/* DATE NAME DESCRIPTION */
-/* */
-/* 05-19-2020 Chaoqiong Xiao Initial Version 6.0 */
-/* 09-30-2020 Chaoqiong Xiao Modified comment(s), */
-/* verified memset and memcpy */
-/* cases, used UX prefix to */
-/* refer to TX symbols instead */
-/* of using them directly, */
-/* resulting in version 6.1 */
-/* 07-29-2022 Chaoqiong Xiao Modified comment(s), */
-/* cleared compile warning, */
-/* used macros for RTOS calls, */
-/* resulting in version 6.1.12 */
+/* */
+/* This function prepares a client input object to be sent. */
+/* This function puts a interrupt notification for the host to issue */
+/* a get object request. */
+/* */
+/* INPUT */
+/* */
+/* pictbridge Pictbridge instance */
+/* input_function input function */
+/* */
+/* OUTPUT */
+/* */
+/* Completion Status */
+/* */
+/* CALLS */
+/* */
+/* */
+/* CALLED BY */
+/* */
+/* */
/* */
/**************************************************************************/
-UINT _ux_pictbridge_dpsclient_input_object_prepare(UX_PICTBRIDGE *pictbridge,
- ULONG input_function,
+UINT _ux_pictbridge_dpsclient_input_object_prepare(UX_PICTBRIDGE *pictbridge,
+ ULONG input_function,
ULONG input_subfunction,
ULONG input_parameter)
{
@@ -94,12 +79,12 @@ ULONG actual_flags;
/* Check the status of pictbridge, if we are in a host request cycle, cannot add object now. */
if (pictbridge -> ux_pictbridge_host_client_state_machine & UX_PICTBRIDGE_STATE_MACHINE_HOST_REQUEST)
{
-
+
/* Add to the state machine the client pending request. */
pictbridge -> ux_pictbridge_host_client_state_machine |= UX_PICTBRIDGE_STATE_MACHINE_CLIENT_REQUEST_PENDING;
-
+
/* We should wait for the state machine to allow our operation. */
- status = _ux_system_event_flags_get(&pictbridge -> ux_pictbridge_event_flags_group, UX_PICTBRIDGE_EVENT_FLAG_STATE_MACHINE_READY,
+ status = _ux_system_event_flags_get(&pictbridge -> ux_pictbridge_event_flags_group, UX_PICTBRIDGE_EVENT_FLAG_STATE_MACHINE_READY,
UX_AND_CLEAR, &actual_flags, UX_PICTBRIDGE_EVENT_TIMEOUT);
/* Check status. */
@@ -115,113 +100,113 @@ ULONG actual_flags;
/* Get the pima instance from the pictbridge container. */
pima = (UX_SLAVE_CLASS_PIMA *) pictbridge -> ux_pictbridge_pima;
-
+
/* Get the address of the object container. We choose the client container. */
pima_object = pictbridge -> ux_pictbridge_object_client;
/* Get the object buffer address. */
pima_object_buffer = pima_object -> ux_device_class_pima_object_buffer;
-
+
/* Reset the object length. */
object_length = 0;
-
+
/* Clear the object memory buffer. */
_ux_utility_memory_set(pima_object_buffer, 0, UX_PICTBRIDGE_MAX_PIMA_OBJECT_BUFFER); /* Use case of memset is verified. */
/* Add the line */
- status = _ux_pictbridge_object_tag_line_add(pima_object_buffer, object_length, _ux_pictbridge_xml_tag_line_xmlversion,
+ status = _ux_pictbridge_object_tag_line_add(pima_object_buffer, object_length, _ux_pictbridge_xml_tag_line_xmlversion,
UX_PICTBRIDGE_TAG_FLAG_BEGIN | UX_PICTBRIDGE_TAG_FLAG_FORCE_LF,
UX_NULL, 0, UX_NULL, &pima_object_buffer, &object_length);
if (status != UX_SUCCESS)
return(status);
/* Add the line */
- status = _ux_pictbridge_object_tag_line_add(pima_object_buffer, object_length, _ux_pictbridge_xml_tag_line_dpsxmlns,
+ status = _ux_pictbridge_object_tag_line_add(pima_object_buffer, object_length, _ux_pictbridge_xml_tag_line_dpsxmlns,
UX_PICTBRIDGE_TAG_FLAG_BEGIN | UX_PICTBRIDGE_TAG_FLAG_FORCE_LF,
UX_NULL, 0, UX_NULL, &pima_object_buffer, &object_length);
if (status != UX_SUCCESS)
return(status);
/* Add the line */
- status = _ux_pictbridge_object_tag_line_add(pima_object_buffer, object_length, _ux_pictbridge_xml_tag_line_input,
+ status = _ux_pictbridge_object_tag_line_add(pima_object_buffer, object_length, _ux_pictbridge_xml_tag_line_input,
UX_PICTBRIDGE_TAG_FLAG_BEGIN | UX_PICTBRIDGE_TAG_FLAG_FORCE_LF,
UX_NULL, 0, UX_NULL, &pima_object_buffer, &object_length);
if (status != UX_SUCCESS)
return(status);
/* Look into the tag code from the input object and proceed to individual functions. */
- switch (input_function)
+ switch (input_function)
{
-
+
case UX_PICTBRIDGE_OR_CONFIGURE_PRINT_SERVICE :
- status = _ux_pictbridge_dpsclient_input_object_configure_print_service(pictbridge, pima_object_buffer, object_length,
+ status = _ux_pictbridge_dpsclient_input_object_configure_print_service(pictbridge, pima_object_buffer, object_length,
&pima_object_buffer, &object_length);
break;
-
+
case UX_PICTBRIDGE_OR_GET_CAPABILITY :
- status = _ux_pictbridge_dpsclient_input_object_get_capability(pictbridge, input_subfunction, input_parameter, pima_object_buffer, object_length,
+ status = _ux_pictbridge_dpsclient_input_object_get_capability(pictbridge, input_subfunction, input_parameter, pima_object_buffer, object_length,
&pima_object_buffer, &object_length);
break;
case UX_PICTBRIDGE_OR_START_JOB :
- status = _ux_pictbridge_dpsclient_input_object_startjob(pictbridge, input_subfunction, input_parameter, pima_object_buffer, object_length,
+ status = _ux_pictbridge_dpsclient_input_object_startjob(pictbridge, input_subfunction, input_parameter, pima_object_buffer, object_length,
&pima_object_buffer, &object_length);
break;
case UX_PICTBRIDGE_OR_ABORT_JOB :
- status = _ux_pictbridge_dpsclient_input_object_abortjob(pictbridge, input_subfunction, input_parameter, pima_object_buffer, object_length,
+ status = _ux_pictbridge_dpsclient_input_object_abortjob(pictbridge, input_subfunction, input_parameter, pima_object_buffer, object_length,
&pima_object_buffer, &object_length);
break;
case UX_PICTBRIDGE_OR_CONTINUE_JOB :
- status = _ux_pictbridge_dpsclient_input_object_continuejob(pictbridge, input_subfunction, input_parameter, pima_object_buffer, object_length,
+ status = _ux_pictbridge_dpsclient_input_object_continuejob(pictbridge, input_subfunction, input_parameter, pima_object_buffer, object_length,
&pima_object_buffer, &object_length);
break;
case UX_PICTBRIDGE_OR_GET_DEVICE_STATUS :
/* Add the line */
- status = _ux_pictbridge_object_tag_line_add(pima_object_buffer, object_length, _ux_pictbridge_xml_tag_line_getdevicestatus,
+ status = _ux_pictbridge_object_tag_line_add(pima_object_buffer, object_length, _ux_pictbridge_xml_tag_line_getdevicestatus,
UX_PICTBRIDGE_TAG_FLAG_BEGIN | UX_PICTBRIDGE_TAG_FLAG_FORCE_SLASH_AT_END,
UX_NULL, 0, UX_NULL, &pima_object_buffer, &object_length);
-
+
break;
default :
- /* Function not yet supported. We should never come here anyway. */
- status = (UX_ERROR);
- }
+ /* Function not yet supported. We should never come here anyway. */
+ status = (UX_ERROR);
+ }
if (status != UX_SUCCESS)
return(status);
/* Add the line */
- status = _ux_pictbridge_object_tag_line_add(pima_object_buffer, object_length, _ux_pictbridge_xml_tag_line_input,
+ status = _ux_pictbridge_object_tag_line_add(pima_object_buffer, object_length, _ux_pictbridge_xml_tag_line_input,
UX_PICTBRIDGE_TAG_FLAG_END,
UX_NULL, 0, UX_NULL, &pima_object_buffer, &object_length);
if (status != UX_SUCCESS)
return(status);
/* Add the line */
- status = _ux_pictbridge_object_tag_line_add(pima_object_buffer, object_length, _ux_pictbridge_xml_tag_line_dps,
+ status = _ux_pictbridge_object_tag_line_add(pima_object_buffer, object_length, _ux_pictbridge_xml_tag_line_dps,
UX_PICTBRIDGE_TAG_FLAG_END,
UX_NULL, 0, UX_NULL, &pima_object_buffer, &object_length);
if (status != UX_SUCCESS)
return(status);
/* Get the length of the object and store it into the object data set. */
- pima_object -> ux_device_class_pima_object_length = object_length;
- pima_object -> ux_device_class_pima_object_compressed_size = object_length;
-
+ pima_object -> ux_device_class_pima_object_length = object_length;
+ pima_object -> ux_device_class_pima_object_compressed_size = object_length;
+
/* Save the handle for this object. */
- pima_object -> ux_device_class_pima_object_handle_id = UX_PICTBRIDGE_OBJECT_HANDLE_CLIENT_REQUEST;
-
+ pima_object -> ux_device_class_pima_object_handle_id = UX_PICTBRIDGE_OBJECT_HANDLE_CLIENT_REQUEST;
+
/* We need to change the file name to DREQUEST.DPS. Encode the file name from ascii format into Unicode. */
_ux_utility_string_to_unicode(_ux_pictbridge_drequest_name, pima_object -> ux_device_class_pima_object_filename);
@@ -229,6 +214,6 @@ ULONG actual_flags;
status = _ux_device_class_pima_object_add(pima, UX_PICTBRIDGE_OBJECT_HANDLE_CLIENT_REQUEST);
/* Return completion status. */
- return(status);
+ return(status);
}
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 37d6ad83..f9c36821 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
@@ -1,18 +1,19 @@
/***************************************************************************
- * Copyright (c) 2024 Microsoft Corporation
- *
+ * Copyright (c) 2024 Microsoft Corporation
+ * Copyright (c) 2026-present Eclipse ThreadX contributors
+ *
* This program and the accompanying materials are made available under the
* terms of the MIT License which is available at
* https://opensource.org/licenses/MIT.
- *
+ *
* SPDX-License-Identifier: MIT
**************************************************************************/
/**************************************************************************/
/**************************************************************************/
-/** */
-/** USBX Component */
+/** */
+/** USBX Component */
/** */
/** Pictbridge Application */
/** */
@@ -29,63 +30,55 @@
#include "ux_device_class_pima.h"
-/**************************************************************************/
-/* */
-/* FUNCTION RELEASE */
-/* */
-/* _ux_pictbridge_dpsclient_input_start_job */
-/* PORTABLE C */
+/**************************************************************************/
+/* */
+/* FUNCTION RELEASE */
+/* */
+/* _ux_pictbridge_dpsclient_input_start_job */
+/* PORTABLE C */
/* 6.1 */
/* AUTHOR */
/* */
/* Chaoqiong Xiao, Microsoft Corporation */
/* */
/* DESCRIPTION */
-/* */
-/* This function creates the tag lines of the start job */
-/* request. */
-/* */
-/* INPUT */
-/* */
-/* pictbridge Pictbridge instance */
+/* */
+/* This function creates the tag lines of the start job */
+/* request. */
+/* */
+/* INPUT */
+/* */
+/* pictbridge Pictbridge instance */
/* pima_object_buffer Pointer to object buffer */
/* object_length Length of the object */
/* pima_object_buffer_updated Updated Address of the object */
/* object_length_updated Updated length */
/* */
-/* */
-/* OUTPUT */
-/* */
-/* Completion Status */
-/* */
-/* CALLS */
-/* */
-/* */
-/* CALLED BY */
-/* */
-/* _ux_pictbridge_dpsclient_input_object_prepare */
-/* */
-/* RELEASE HISTORY */
-/* */
-/* DATE NAME DESCRIPTION */
-/* */
-/* 05-19-2020 Chaoqiong Xiao Initial Version 6.0 */
-/* 09-30-2020 Chaoqiong Xiao Modified comment(s), */
-/* resulting in version 6.1 */
+/* */
+/* OUTPUT */
+/* */
+/* Completion Status */
+/* */
+/* CALLS */
+/* */
+/* */
+/* CALLED BY */
+/* */
+/* _ux_pictbridge_dpsclient_input_object_prepare */
/* */
/**************************************************************************/
-UINT _ux_pictbridge_dpsclient_input_object_startjob(UX_PICTBRIDGE *pictbridge,
+UINT _ux_pictbridge_dpsclient_input_object_startjob(UX_PICTBRIDGE *pictbridge,
ULONG input_subcode,
ULONG input_parameter,
- UCHAR *pima_object_buffer,
- ULONG object_length,
- UCHAR **pima_object_buffer_updated,
+ UCHAR *pima_object_buffer,
+ ULONG object_length,
+ UCHAR **pima_object_buffer_updated,
ULONG *object_length_updated)
{
UINT status;
UX_PICTBRIDGE_JOBINFO *jobinfo;
-UX_PICTBRIDGE_PRINTINFO *printinfo;
+UX_PICTBRIDGE_PRINTINFO *printinfo;
UX_PARAMETER_NOT_USED(input_subcode);
UX_PARAMETER_NOT_USED(input_parameter);
@@ -95,77 +88,77 @@ UX_PICTBRIDGE_PRINTINFO *printinfo;
printinfo = jobinfo -> ux_pictbridge_jobinfo_printinfo_start;
/* Add the line */
- status = _ux_pictbridge_object_tag_line_add(pima_object_buffer, object_length, _ux_pictbridge_xml_tag_line_startjob,
+ status = _ux_pictbridge_object_tag_line_add(pima_object_buffer, object_length, _ux_pictbridge_xml_tag_line_startjob,
UX_PICTBRIDGE_TAG_FLAG_BEGIN | UX_PICTBRIDGE_TAG_FLAG_FORCE_LF,
UX_NULL, 0, UX_NULL, &pima_object_buffer, &object_length);
if (status != UX_SUCCESS)
return(status);
/* Add the line */
- status = _ux_pictbridge_object_tag_line_add(pima_object_buffer, object_length, _ux_pictbridge_xml_tag_line_jobconfig,
+ status = _ux_pictbridge_object_tag_line_add(pima_object_buffer, object_length, _ux_pictbridge_xml_tag_line_jobconfig,
UX_PICTBRIDGE_TAG_FLAG_BEGIN | UX_PICTBRIDGE_TAG_FLAG_FORCE_LF,
UX_NULL, 0, UX_NULL, &pima_object_buffer, &object_length);
if (status != UX_SUCCESS)
return(status);
/* Add the line xxxxxxxx */
- status = _ux_pictbridge_object_tag_line_add(pima_object_buffer, object_length, _ux_pictbridge_xml_tag_line_quality,
+ status = _ux_pictbridge_object_tag_line_add(pima_object_buffer, object_length, _ux_pictbridge_xml_tag_line_quality,
UX_PICTBRIDGE_TAG_FLAG_BEGIN | UX_PICTBRIDGE_TAG_FLAG_END | UX_PICTBRIDGE_TAG_FLAG_VARIABLE_HEXA,
UX_NULL, 0, (VOID *)(ALIGN_TYPE) jobinfo -> ux_pictbridge_jobinfo_quality, &pima_object_buffer, &object_length);
if (status != UX_SUCCESS)
return(status);
/* Add the line xxxxxxxx */
- status = _ux_pictbridge_object_tag_line_add(pima_object_buffer, object_length, _ux_pictbridge_xml_tag_line_papertype,
+ status = _ux_pictbridge_object_tag_line_add(pima_object_buffer, object_length, _ux_pictbridge_xml_tag_line_papertype,
UX_PICTBRIDGE_TAG_FLAG_BEGIN | UX_PICTBRIDGE_TAG_FLAG_END | UX_PICTBRIDGE_TAG_FLAG_VARIABLE_HEXA,
UX_NULL, 0, (VOID *)(ALIGN_TYPE) jobinfo -> ux_pictbridge_jobinfo_papertype, &pima_object_buffer, &object_length);
if (status != UX_SUCCESS)
return(status);
/* Add the line xxxxxxxx */
- status = _ux_pictbridge_object_tag_line_add(pima_object_buffer, object_length, _ux_pictbridge_xml_tag_line_papersize,
+ status = _ux_pictbridge_object_tag_line_add(pima_object_buffer, object_length, _ux_pictbridge_xml_tag_line_papersize,
UX_PICTBRIDGE_TAG_FLAG_BEGIN | UX_PICTBRIDGE_TAG_FLAG_END | UX_PICTBRIDGE_TAG_FLAG_VARIABLE_HEXA,
UX_NULL, 0, (VOID *)(ALIGN_TYPE) jobinfo -> ux_pictbridge_jobinfo_papersize, &pima_object_buffer, &object_length);
if (status != UX_SUCCESS)
return(status);
/* Add the line xxxxxxxx */
- status = _ux_pictbridge_object_tag_line_add(pima_object_buffer, object_length, _ux_pictbridge_xml_tag_line_filetype,
+ status = _ux_pictbridge_object_tag_line_add(pima_object_buffer, object_length, _ux_pictbridge_xml_tag_line_filetype,
UX_PICTBRIDGE_TAG_FLAG_BEGIN | UX_PICTBRIDGE_TAG_FLAG_END | UX_PICTBRIDGE_TAG_FLAG_VARIABLE_HEXA,
UX_NULL, 0, (VOID *)(ALIGN_TYPE) jobinfo -> ux_pictbridge_jobinfo_filetype, &pima_object_buffer, &object_length);
if (status != UX_SUCCESS)
return(status);
/* Add the line xxxxxxxx */
- status = _ux_pictbridge_object_tag_line_add(pima_object_buffer, object_length, _ux_pictbridge_xml_tag_line_dateprint,
+ status = _ux_pictbridge_object_tag_line_add(pima_object_buffer, object_length, _ux_pictbridge_xml_tag_line_dateprint,
UX_PICTBRIDGE_TAG_FLAG_BEGIN | UX_PICTBRIDGE_TAG_FLAG_END | UX_PICTBRIDGE_TAG_FLAG_VARIABLE_HEXA,
UX_NULL, 0, (VOID *)(ALIGN_TYPE) jobinfo -> ux_pictbridge_jobinfo_dateprint, &pima_object_buffer, &object_length);
if (status != UX_SUCCESS)
return(status);
/* Add the line xxxxxxxx */
- status = _ux_pictbridge_object_tag_line_add(pima_object_buffer, object_length, _ux_pictbridge_xml_tag_line_filenameprint,
+ status = _ux_pictbridge_object_tag_line_add(pima_object_buffer, object_length, _ux_pictbridge_xml_tag_line_filenameprint,
UX_PICTBRIDGE_TAG_FLAG_BEGIN | UX_PICTBRIDGE_TAG_FLAG_END | UX_PICTBRIDGE_TAG_FLAG_VARIABLE_HEXA,
UX_NULL, 0, (VOID *)(ALIGN_TYPE) jobinfo -> ux_pictbridge_jobinfo_filenameprint, &pima_object_buffer, &object_length);
if (status != UX_SUCCESS)
return(status);
/* Add the line xxxxxxxx */
- status = _ux_pictbridge_object_tag_line_add(pima_object_buffer, object_length, _ux_pictbridge_xml_tag_line_imageoptimize,
+ status = _ux_pictbridge_object_tag_line_add(pima_object_buffer, object_length, _ux_pictbridge_xml_tag_line_imageoptimize,
UX_PICTBRIDGE_TAG_FLAG_BEGIN | UX_PICTBRIDGE_TAG_FLAG_END | UX_PICTBRIDGE_TAG_FLAG_VARIABLE_HEXA,
UX_NULL, 0, (VOID *)(ALIGN_TYPE) jobinfo -> ux_pictbridge_jobinfo_imageoptimize, &pima_object_buffer, &object_length);
if (status != UX_SUCCESS)
return(status);
/* Add the line xxxxxxxx */
- status = _ux_pictbridge_object_tag_line_add(pima_object_buffer, object_length, _ux_pictbridge_xml_tag_line_layout,
+ status = _ux_pictbridge_object_tag_line_add(pima_object_buffer, object_length, _ux_pictbridge_xml_tag_line_layout,
UX_PICTBRIDGE_TAG_FLAG_BEGIN | UX_PICTBRIDGE_TAG_FLAG_END | UX_PICTBRIDGE_TAG_FLAG_VARIABLE_HEXA,
UX_NULL, 0, (VOID *)(ALIGN_TYPE) jobinfo -> ux_pictbridge_jobinfo_layout, &pima_object_buffer, &object_length);
if (status != UX_SUCCESS)
return(status);
/* Add the line */
- status = _ux_pictbridge_object_tag_line_add(pima_object_buffer, object_length, _ux_pictbridge_xml_tag_line_jobconfig,
+ status = _ux_pictbridge_object_tag_line_add(pima_object_buffer, object_length, _ux_pictbridge_xml_tag_line_jobconfig,
UX_PICTBRIDGE_TAG_FLAG_END,
UX_NULL, 0, UX_NULL, &pima_object_buffer, &object_length);
if (status != UX_SUCCESS)
@@ -174,18 +167,18 @@ UX_PICTBRIDGE_PRINTINFO *printinfo;
/* Add all the printInfo. */
while (printinfo != UX_NULL)
{
-
+
/* Add the line */
- status = _ux_pictbridge_object_tag_line_add(pima_object_buffer, object_length, _ux_pictbridge_xml_tag_line_printinfo,
+ status = _ux_pictbridge_object_tag_line_add(pima_object_buffer, object_length, _ux_pictbridge_xml_tag_line_printinfo,
UX_PICTBRIDGE_TAG_FLAG_BEGIN | UX_PICTBRIDGE_TAG_FLAG_FORCE_LF,
UX_NULL, 0, UX_NULL, &pima_object_buffer, &object_length);
if (status != UX_SUCCESS)
return(status);
/* Add the line xxxxxxxx */
- status = _ux_pictbridge_object_tag_line_add(pima_object_buffer, object_length, _ux_pictbridge_xml_tag_line_fileid,
+ status = _ux_pictbridge_object_tag_line_add(pima_object_buffer, object_length, _ux_pictbridge_xml_tag_line_fileid,
UX_PICTBRIDGE_TAG_FLAG_BEGIN | UX_PICTBRIDGE_TAG_FLAG_END | UX_PICTBRIDGE_TAG_FLAG_VARIABLE_HEXA,
- UX_NULL, 0, (VOID *)(ALIGN_TYPE) printinfo -> ux_pictbridge_printinfo_fileid,
+ UX_NULL, 0, (VOID *)(ALIGN_TYPE) printinfo -> ux_pictbridge_printinfo_fileid,
&pima_object_buffer, &object_length);
if (status != UX_SUCCESS)
return(status);
@@ -195,9 +188,9 @@ UX_PICTBRIDGE_PRINTINFO *printinfo;
{
/* Add the line xxxxxxxx */
- status = _ux_pictbridge_object_tag_line_add(pima_object_buffer, object_length, _ux_pictbridge_xml_tag_line_filename,
+ status = _ux_pictbridge_object_tag_line_add(pima_object_buffer, object_length, _ux_pictbridge_xml_tag_line_filename,
UX_PICTBRIDGE_TAG_FLAG_BEGIN | UX_PICTBRIDGE_TAG_FLAG_END | UX_PICTBRIDGE_TAG_FLAG_VARIABLE_STRING,
- UX_NULL, 0, (VOID *) printinfo -> ux_pictbridge_printinfo_filename,
+ UX_NULL, 0, (VOID *) printinfo -> ux_pictbridge_printinfo_filename,
&pima_object_buffer, &object_length);
if (status != UX_SUCCESS)
return(status);
@@ -208,16 +201,16 @@ UX_PICTBRIDGE_PRINTINFO *printinfo;
{
/* Add the line xxxxxxxx */
- status = _ux_pictbridge_object_tag_line_add(pima_object_buffer, object_length, _ux_pictbridge_xml_tag_line_date,
+ status = _ux_pictbridge_object_tag_line_add(pima_object_buffer, object_length, _ux_pictbridge_xml_tag_line_date,
UX_PICTBRIDGE_TAG_FLAG_BEGIN | UX_PICTBRIDGE_TAG_FLAG_END | UX_PICTBRIDGE_TAG_FLAG_VARIABLE_STRING,
- UX_NULL, 0, (VOID *) printinfo -> ux_pictbridge_printinfo_date,
+ UX_NULL, 0, (VOID *) printinfo -> ux_pictbridge_printinfo_date,
&pima_object_buffer, &object_length);
if (status != UX_SUCCESS)
return(status);
}
/* Add the line */
- status = _ux_pictbridge_object_tag_line_add(pima_object_buffer, object_length, _ux_pictbridge_xml_tag_line_printinfo,
+ status = _ux_pictbridge_object_tag_line_add(pima_object_buffer, object_length, _ux_pictbridge_xml_tag_line_printinfo,
UX_PICTBRIDGE_TAG_FLAG_END,
UX_NULL, 0, UX_NULL, &pima_object_buffer, &object_length);
if (status != UX_SUCCESS)
@@ -228,7 +221,7 @@ UX_PICTBRIDGE_PRINTINFO *printinfo;
}
/* Add the line */
- status = _ux_pictbridge_object_tag_line_add(pima_object_buffer, object_length, _ux_pictbridge_xml_tag_line_startjob,
+ status = _ux_pictbridge_object_tag_line_add(pima_object_buffer, object_length, _ux_pictbridge_xml_tag_line_startjob,
UX_PICTBRIDGE_TAG_FLAG_END,
UX_NULL, 0, UX_NULL, &pima_object_buffer, &object_length);
if (status != UX_SUCCESS)
@@ -241,6 +234,6 @@ UX_PICTBRIDGE_PRINTINFO *printinfo;
*object_length_updated = object_length;
/* Return completion status. */
- return(UX_SUCCESS);
+ return(UX_SUCCESS);
}
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 8f04b660..93a261d3 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
@@ -1,18 +1,19 @@
/***************************************************************************
- * Copyright (c) 2024 Microsoft Corporation
- *
+ * Copyright (c) 2024 Microsoft Corporation
+ * Copyright (c) 2026-present Eclipse ThreadX contributors
+ *
* This program and the accompanying materials are made available under the
* terms of the MIT License which is available at
* https://opensource.org/licenses/MIT.
- *
+ *
* SPDX-License-Identifier: MIT
**************************************************************************/
/**************************************************************************/
/**************************************************************************/
-/** */
-/** USBX Component */
+/** */
+/** USBX Component */
/** */
/** Pictbridge Application */
/** */
@@ -29,52 +30,34 @@
#include "ux_device_class_pima.h"
-/**************************************************************************/
-/* */
-/* FUNCTION RELEASE */
-/* */
-/* _ux_pictbridge_dpsclient_object_data_get PORTABLE C */
+/**************************************************************************/
+/* */
+/* FUNCTION RELEASE */
+/* */
+/* _ux_pictbridge_dpsclient_object_data_get PORTABLE C */
/* 6.1.12 */
/* AUTHOR */
/* */
/* Chaoqiong Xiao, Microsoft Corporation */
/* */
/* DESCRIPTION */
-/* */
-/* This function returns the data of the object. */
-/* */
-/* INPUT */
-/* */
-/* pima Pima instance associated */
-/* */
-/* OUTPUT */
-/* */
-/* Completion Status */
-/* */
-/* CALLS */
-/* */
-/* */
-/* CALLED BY */
-/* */
-/* user application */
-/* */
-/* RELEASE HISTORY */
-/* */
-/* DATE NAME DESCRIPTION */
-/* */
-/* 05-19-2020 Chaoqiong Xiao Initial Version 6.0 */
-/* 09-30-2020 Chaoqiong Xiao Modified comment(s), */
-/* verified memset and memcpy */
-/* cases, used UX prefix to */
-/* refer to TX symbols instead */
-/* of using them directly, */
-/* resulting in version 6.1 */
-/* 04-25-2022 Yajun Xia Modified comment(s), */
-/* internal clean up, */
-/* resulting in version 6.1.11 */
-/* 07-29-2022 Chaoqiong Xiao Modified comment(s), */
-/* used macros for RTOS calls, */
-/* resulting in version 6.1.12 */
+/* */
+/* This function returns the data of the object. */
+/* */
+/* INPUT */
+/* */
+/* pima Pima instance associated */
+/* */
+/* OUTPUT */
+/* */
+/* Completion Status */
+/* */
+/* CALLS */
+/* */
+/* */
+/* CALLED BY */
+/* */
+/* user application */
/* */
/**************************************************************************/
UINT _ux_pictbridge_dpsclient_object_data_get(UX_SLAVE_CLASS_PIMA *pima, ULONG object_handle, UCHAR *object_buffer, ULONG object_offset,
@@ -93,47 +76,47 @@ UINT status;
If the handle is not 1 or 2, this is a JPEG picture or other object to be printed. */
if ((object_handle == UX_PICTBRIDGE_OBJECT_HANDLE_HOST_RESPONSE) || (object_handle == UX_PICTBRIDGE_OBJECT_HANDLE_CLIENT_REQUEST))
{
-
+
/* Check what XML object is requested. It is either a request script or a response. */
- if (object_handle == UX_PICTBRIDGE_OBJECT_HANDLE_HOST_RESPONSE)
+ if (object_handle == UX_PICTBRIDGE_OBJECT_HANDLE_HOST_RESPONSE)
object_info = (UX_SLAVE_CLASS_PIMA_OBJECT *) pictbridge -> ux_pictbridge_object_host;
- else
+ else
object_info = (UX_SLAVE_CLASS_PIMA_OBJECT *) pictbridge -> ux_pictbridge_object_client;
-
+
/* Is this the correct handle ? */
if (object_info -> ux_device_class_pima_object_handle_id == object_handle)
{
-
+
/* Get the pointer to the object buffer. */
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); /* 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;
-
+
/* What cycle are we in ? */
if (pictbridge -> ux_pictbridge_host_client_state_machine & UX_PICTBRIDGE_STATE_MACHINE_HOST_REQUEST)
{
/* Check if we are blocking for a client request. */
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_system_event_flags_set(&pictbridge -> ux_pictbridge_event_flags_group, UX_PICTBRIDGE_EVENT_FLAG_STATE_MACHINE_READY, UX_OR);
+ _ux_system_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;
-
- }
-
+
+ }
+
/* We have copied the requested data. Return OK. */
return(UX_SUCCESS);
- }
+ }
}
else
{
-
+
/* Obtain the data from the application jobinfo callback. */
status = pictbridge -> ux_pictbridge_jobinfo.ux_pictbridge_jobinfo_object_data_read(pictbridge, object_handle, object_buffer, object_offset,
object_length_requested, &actual_length);
@@ -144,7 +127,7 @@ UINT status;
/* Return the application status. */
return(status);
- }
+ }
/* Could not find the handle. */
return(UX_DEVICE_CLASS_PIMA_RC_INVALID_OBJECT_HANDLE);
}
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 03875213..301fc301 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
@@ -1,18 +1,19 @@
/***************************************************************************
- * Copyright (c) 2024 Microsoft Corporation
- *
+ * Copyright (c) 2024 Microsoft Corporation
+ * Copyright (c) 2026-present Eclipse ThreadX contributors
+ *
* This program and the accompanying materials are made available under the
* terms of the MIT License which is available at
* https://opensource.org/licenses/MIT.
- *
+ *
* SPDX-License-Identifier: MIT
**************************************************************************/
/**************************************************************************/
/**************************************************************************/
-/** */
-/** USBX Component */
+/** */
+/** USBX Component */
/** */
/** Pictbridge Application */
/** */
@@ -29,54 +30,39 @@
#include "ux_device_class_pima.h"
-/**************************************************************************/
-/* */
-/* FUNCTION RELEASE */
-/* */
-/* _ux_pictbridge_dpsclient_object_data_send PORTABLE C */
+/**************************************************************************/
+/* */
+/* FUNCTION RELEASE */
+/* */
+/* _ux_pictbridge_dpsclient_object_data_send PORTABLE C */
/* 6.1.12 */
/* AUTHOR */
/* */
/* Chaoqiong Xiao, Microsoft Corporation */
/* */
/* DESCRIPTION */
-/* */
-/* This function accepts the data of the object. */
-/* */
-/* INPUT */
-/* */
-/* pima Pima instance associated */
-/* */
-/* OUTPUT */
-/* */
-/* Completion Status */
-/* */
-/* CALLS */
-/* */
-/* */
-/* CALLED BY */
-/* */
-/* user application */
-/* */
-/* RELEASE HISTORY */
-/* */
-/* DATE NAME DESCRIPTION */
-/* */
-/* 05-19-2020 Chaoqiong Xiao Initial Version 6.0 */
-/* 09-30-2020 Chaoqiong Xiao Modified comment(s), */
-/* verified memset and memcpy */
-/* cases, used UX prefix to */
-/* refer to TX symbols instead */
-/* of using them directly, */
-/* resulting in version 6.1 */
-/* 07-29-2022 Chaoqiong Xiao Modified comment(s), */
-/* used macros for RTOS calls, */
-/* resulting in version 6.1.12 */
+/* */
+/* This function accepts the data of the object. */
+/* */
+/* INPUT */
+/* */
+/* pima Pima instance associated */
+/* */
+/* OUTPUT */
+/* */
+/* Completion Status */
+/* */
+/* CALLS */
+/* */
+/* */
+/* CALLED BY */
+/* */
+/* user application */
/* */
/**************************************************************************/
-UINT _ux_pictbridge_dpsclient_object_data_send(UX_SLAVE_CLASS_PIMA *pima, ULONG object_handle,
- ULONG phase,
- UCHAR *object_buffer,
+UINT _ux_pictbridge_dpsclient_object_data_send(UX_SLAVE_CLASS_PIMA *pima, ULONG object_handle,
+ ULONG phase,
+ UCHAR *object_buffer,
ULONG object_offset,
ULONG object_length)
{
@@ -89,17 +75,17 @@ UCHAR *pima_object_buffer;
/* Get the pointer to the Pictbridge instance. */
pictbridge = (UX_PICTBRIDGE *)pima -> ux_device_class_pima_application;
-
+
/* Get the pointer to the pima object. */
object_info = (UX_SLAVE_CLASS_PIMA_OBJECT *) pictbridge -> ux_pictbridge_object_host;
/* Is this the correct handle ? */
if (object_info -> ux_device_class_pima_object_handle_id == object_handle)
{
-
+
/* Get the pointer to the object buffer. */
pima_object_buffer = object_info -> ux_device_class_pima_object_buffer;
-
+
/* Check the phase. We should wait for the object to be completed and the response sent back
before parsing the object. */
if (phase == UX_DEVICE_CLASS_PIMA_OBJECT_TRANSFER_PHASE_ACTIVE)
@@ -111,68 +97,68 @@ UCHAR *pima_object_buffer;
/* Copy the demanded object data portion. */
_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;
-
+
/* We are not done yet. */
return(UX_SUCCESS);
}
-
+
/* We now have the entire script into memory. Parse the object and execute the script. */
status = _ux_pictbridge_object_parse(pictbridge, pima_object_buffer,
object_info -> ux_device_class_pima_object_compressed_size);
-
+
/* Analyze the status from the parsing and determine the result code to be sent back. */
switch (status)
- {
+ {
case UX_SUCCESS :
-
+
/* Set the result code to OK. */
pictbridge -> ux_pictbridge_operation_result = UX_PICTBRIDGE_ACTION_RESULT_OK;
break;
-
+
case UX_PICTBRIDGE_ERROR_SCRIPT_SYNTAX_ERROR :
-
+
/* Set the result code to Error. */
pictbridge -> ux_pictbridge_operation_result = UX_PICTBRIDGE_ACTION_RESULT_NOT_SUPPORTED_IP;
break;
-
+
case UX_PICTBRIDGE_ERROR_PARAMETER_UNKNOWN :
-
+
/* Set the result code to Error. */
pictbridge -> ux_pictbridge_operation_result = UX_PICTBRIDGE_ACTION_RESULT_NOT_SUPPORTED_UP;
break;
-
+
case UX_PICTBRIDGE_ERROR_PARAMETER_MISSING :
-
+
/* Set the result code to Error. */
pictbridge -> ux_pictbridge_operation_result = UX_PICTBRIDGE_ACTION_RESULT_NOT_SUPPORTED_MP;
break;
-
+
default :
-
+
/* Set the result code to Error. */
pictbridge -> ux_pictbridge_operation_result = UX_PICTBRIDGE_ACTION_RESULT_NOT_SUPPORTED_DEFAULT;
break;
- }
-
+ }
+
/* We may have a complete event. We only raise the event flag if the completion was successful. */
if (pictbridge -> ux_pictbridge_operation_result == UX_PICTBRIDGE_ACTION_RESULT_OK)
{
/* Check what command we got back from the host. */
- switch (pictbridge -> ux_pictbridge_input_request)
+ switch (pictbridge -> ux_pictbridge_input_request)
{
-
+
case UX_PICTBRIDGE_IR_CONFIGURE_PRINT_SERVICE :
-
+
/* Set event to configure print service. */
event_flag = UX_PICTBRIDGE_EVENT_FLAG_CONFIGURE_PRINT_SERVICE;
break;
-
+
case UX_PICTBRIDGE_IR_GET_CAPABILITY :
-
+
/* Set event to capability. */
event_flag = UX_PICTBRIDGE_EVENT_FLAG_CAPABILITY;
break;
@@ -182,52 +168,52 @@ UCHAR *pima_object_buffer;
/* Set event to capability. */
event_flag = UX_PICTBRIDGE_EVENT_FLAG_JOB_STATUS;
break;
-
+
case UX_PICTBRIDGE_IR_GET_DEVICE_STATUS :
-
+
/* Set event to device status. */
event_flag = UX_PICTBRIDGE_EVENT_FLAG_DEVICE_STATUS;
break;
case UX_PICTBRIDGE_IR_START_JOB :
-
+
/* Set event to start job . */
event_flag = UX_PICTBRIDGE_EVENT_FLAG_START_JOB;
break;
-
+
case UX_PICTBRIDGE_IR_ABORT_JOB :
-
+
/* Set event to abort job. */
event_flag = UX_PICTBRIDGE_EVENT_FLAG_ABORT_JOB;
break;
-
+
case UX_PICTBRIDGE_IR_CONTINUE_JOB :
-
+
/* Set event to continue job. */
event_flag = UX_PICTBRIDGE_EVENT_FLAG_CONTINUE_JOB;
break;
-
+
case UX_PICTBRIDGE_IR_NOTIFY_JOB_STATUS :
/* Set event to notify job status. */
event_flag = UX_PICTBRIDGE_EVENT_FLAG_NOTIFY_JOB_STATUS;
break;
-
+
case UX_PICTBRIDGE_IR_NOTIFY_DEVICE_STATUS :
/* Set event to notify device status. */
event_flag = UX_PICTBRIDGE_EVENT_FLAG_NOTIFY_DEVICE_STATUS;
break;
-
-
+
+
default :
- /* Function not yet supported. */
+ /* Function not yet supported. */
break;
- }
-
+ }
+
/* Send event to the application. */
_ux_system_event_flags_set(&pictbridge -> ux_pictbridge_event_flags_group, event_flag, UX_OR);
-
+
}
else
@@ -235,17 +221,17 @@ UCHAR *pima_object_buffer;
/* We have an error of some kind. Wake up the application with error event. */
_ux_system_event_flags_set(&pictbridge -> ux_pictbridge_event_flags_group, UX_PICTBRIDGE_EVENT_FLAG_ERROR, UX_OR);
-
+
}
-
+
/* What cycle are we in ? */
if (pictbridge -> ux_pictbridge_host_client_state_machine & UX_PICTBRIDGE_STATE_MACHINE_CLIENT_REQUEST)
{
/* Since we are in client request, this indicates we are done with the cycle. */
pictbridge -> ux_pictbridge_host_client_state_machine = UX_PICTBRIDGE_STATE_MACHINE_IDLE;
-
- }
+
+ }
/* We have executed the script. */
return(UX_SUCCESS);
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 ba9744a7..df9e574e 100644
--- a/common/usbx_pictbridge/src/ux_pictbridge_dpsclient_object_delete.c
+++ b/common/usbx_pictbridge/src/ux_pictbridge_dpsclient_object_delete.c
@@ -1,18 +1,19 @@
/***************************************************************************
- * Copyright (c) 2024 Microsoft Corporation
- *
+ * Copyright (c) 2024 Microsoft Corporation
+ * Copyright (c) 2026-present Eclipse ThreadX contributors
+ *
* This program and the accompanying materials are made available under the
* terms of the MIT License which is available at
* https://opensource.org/licenses/MIT.
- *
+ *
* SPDX-License-Identifier: MIT
**************************************************************************/
/**************************************************************************/
/**************************************************************************/
-/** */
-/** USBX Component */
+/** */
+/** USBX Component */
/** */
/** Pictbridge Application */
/** */
@@ -29,45 +30,34 @@
#include "ux_device_class_pima.h"
-/**************************************************************************/
-/* */
-/* FUNCTION RELEASE */
-/* */
-/* _ux_pictbridge_dpsclient_object_delete PORTABLE C */
+/**************************************************************************/
+/* */
+/* FUNCTION RELEASE */
+/* */
+/* _ux_pictbridge_dpsclient_object_delete PORTABLE C */
/* 6.1.8 */
/* AUTHOR */
/* */
/* Chaoqiong Xiao, Microsoft Corporation */
/* */
/* DESCRIPTION */
-/* */
-/* This function deletes a local object. */
-/* */
-/* INPUT */
-/* */
-/* pima Pima instance associated */
-/* */
-/* OUTPUT */
-/* */
-/* Completion Status */
-/* */
-/* CALLS */
-/* */
-/* */
-/* CALLED BY */
-/* */
-/* user application */
-/* */
-/* RELEASE HISTORY */
-/* */
-/* DATE NAME DESCRIPTION */
-/* */
-/* 05-19-2020 Chaoqiong Xiao Initial Version 6.0 */
-/* 09-30-2020 Chaoqiong Xiao Modified comment(s), */
-/* resulting in version 6.1 */
-/* 08-02-2021 Wen Wang Modified comment(s), */
-/* fixed spelling error, */
-/* resulting in version 6.1.8 */
+/* */
+/* This function deletes a local object. */
+/* */
+/* INPUT */
+/* */
+/* pima Pima instance associated */
+/* */
+/* OUTPUT */
+/* */
+/* Completion Status */
+/* */
+/* CALLS */
+/* */
+/* */
+/* CALLED BY */
+/* */
+/* user application */
/* */
/**************************************************************************/
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 a516c90d..2706badf 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
@@ -1,18 +1,19 @@
/***************************************************************************
- * Copyright (c) 2024 Microsoft Corporation
- *
+ * Copyright (c) 2024 Microsoft Corporation
+ * Copyright (c) 2026-present Eclipse ThreadX contributors
+ *
* This program and the accompanying materials are made available under the
* terms of the MIT License which is available at
* https://opensource.org/licenses/MIT.
- *
+ *
* SPDX-License-Identifier: MIT
**************************************************************************/
/**************************************************************************/
/**************************************************************************/
-/** */
-/** USBX Component */
+/** */
+/** USBX Component */
/** */
/** Pictbridge Application */
/** */
@@ -29,47 +30,39 @@
#include "ux_device_class_pima.h"
-/**************************************************************************/
-/* */
-/* FUNCTION RELEASE */
-/* */
-/* _ux_pictbridge_dpsclient_object_handles_get PORTABLE C */
+/**************************************************************************/
+/* */
+/* FUNCTION RELEASE */
+/* */
+/* _ux_pictbridge_dpsclient_object_handles_get PORTABLE C */
/* 6.1 */
/* AUTHOR */
/* */
/* Chaoqiong Xiao, Microsoft Corporation */
/* */
/* DESCRIPTION */
-/* */
-/* This function returns the handles array. */
-/* */
-/* INPUT */
-/* */
-/* pima Pima instance associated */
-/* */
-/* OUTPUT */
-/* */
-/* Completion Status */
-/* */
-/* CALLS */
-/* */
-/* */
-/* CALLED BY */
-/* */
-/* user application */
-/* */
-/* RELEASE HISTORY */
-/* */
-/* DATE NAME DESCRIPTION */
-/* */
-/* 05-19-2020 Chaoqiong Xiao Initial Version 6.0 */
-/* 09-30-2020 Chaoqiong Xiao Modified comment(s), */
-/* resulting in version 6.1 */
+/* */
+/* This function returns the handles array. */
+/* */
+/* INPUT */
+/* */
+/* pima Pima instance associated */
+/* */
+/* OUTPUT */
+/* */
+/* Completion Status */
+/* */
+/* CALLS */
+/* */
+/* */
+/* CALLED BY */
+/* */
+/* user application */
/* */
/**************************************************************************/
-UINT _ux_pictbridge_dpsclient_object_handles_get(UX_SLAVE_CLASS_PIMA *pima,
- ULONG object_handles_format_code,
- ULONG object_handles_association,
+UINT _ux_pictbridge_dpsclient_object_handles_get(UX_SLAVE_CLASS_PIMA *pima,
+ ULONG object_handles_format_code,
+ ULONG object_handles_association,
ULONG *object_handles_array,
ULONG object_handles_max_number)
{
@@ -84,15 +77,15 @@ UX_SLAVE_CLASS_PIMA_OBJECT *object_info;
/* Set the pima pointe to the pictbridge instance. */
pictbridge -> ux_pictbridge_pima = (VOID *) pima;
-
+
/* We say we have one object but the caller might specify different format code and associations. */
object_info = pictbridge -> ux_pictbridge_object_client;
-
+
/* Insert in the array the number of found handles so far : 0. */
_ux_utility_long_put((UCHAR *)object_handles_array, 0);
-
+
/* Check the type demanded. */
- if (object_handles_format_code == 0 || object_handles_format_code == 0xFFFFFFFF ||
+ if (object_handles_format_code == 0 || object_handles_format_code == 0xFFFFFFFF ||
object_info -> ux_device_class_pima_object_format == object_handles_format_code)
{
@@ -100,13 +93,13 @@ UX_SLAVE_CLASS_PIMA_OBJECT *object_info;
_ux_utility_long_put((UCHAR *)object_handles_array, 1);
/* Adjust the array to point after the number of elements. */
- object_handles_array++;
+ object_handles_array++;
/* We have a candidate. Store the handle. */
_ux_utility_long_put((UCHAR *)object_handles_array, object_info -> ux_device_class_pima_object_handle_id);
}
-
+
return(UX_SUCCESS);
}
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 705b797d..557af555 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
@@ -1,18 +1,19 @@
/***************************************************************************
- * Copyright (c) 2024 Microsoft Corporation
- *
+ * Copyright (c) 2024 Microsoft Corporation
+ * Copyright (c) 2026-present Eclipse ThreadX contributors
+ *
* This program and the accompanying materials are made available under the
* terms of the MIT License which is available at
* https://opensource.org/licenses/MIT.
- *
+ *
* SPDX-License-Identifier: MIT
**************************************************************************/
/**************************************************************************/
/**************************************************************************/
-/** */
-/** USBX Component */
+/** */
+/** USBX Component */
/** */
/** Pictbridge Application */
/** */
@@ -29,48 +30,37 @@
#include "ux_device_class_pima.h"
-/**************************************************************************/
-/* */
-/* FUNCTION RELEASE */
-/* */
-/* _ux_pictbridge_dpsclient_object_info_get PORTABLE C */
+/**************************************************************************/
+/* */
+/* FUNCTION RELEASE */
+/* */
+/* _ux_pictbridge_dpsclient_object_info_get PORTABLE C */
/* 6.1.12 */
/* AUTHOR */
/* */
/* Chaoqiong Xiao, Microsoft Corporation */
/* */
/* DESCRIPTION */
-/* */
-/* This function returns the information of the object. */
-/* */
-/* INPUT */
-/* */
-/* pima Pima instance associated */
-/* */
-/* OUTPUT */
-/* */
-/* Completion Status */
-/* */
-/* CALLS */
-/* */
-/* */
-/* CALLED BY */
-/* */
-/* user application */
-/* */
-/* RELEASE HISTORY */
-/* */
-/* DATE NAME DESCRIPTION */
-/* */
-/* 05-19-2020 Chaoqiong Xiao Initial Version 6.0 */
-/* 09-30-2020 Chaoqiong Xiao Modified comment(s), */
-/* resulting in version 6.1 */
-/* 07-29-2022 Chaoqiong Xiao Modified comment(s), */
-/* added no-callback handling, */
-/* resulting in version 6.1.12 */
+/* */
+/* This function returns the information of the object. */
+/* */
+/* INPUT */
+/* */
+/* pima Pima instance associated */
+/* */
+/* OUTPUT */
+/* */
+/* Completion Status */
+/* */
+/* CALLS */
+/* */
+/* */
+/* CALLED BY */
+/* */
+/* user application */
/* */
/**************************************************************************/
-UINT _ux_pictbridge_dpsclient_object_info_get(UX_SLAVE_CLASS_PIMA *pima, ULONG object_handle,
+UINT _ux_pictbridge_dpsclient_object_info_get(UX_SLAVE_CLASS_PIMA *pima, ULONG object_handle,
UX_SLAVE_CLASS_PIMA_OBJECT **object)
{
@@ -79,17 +69,17 @@ UX_SLAVE_CLASS_PIMA_OBJECT *object_info;
/* Get the pointer to the Pictbridge instance. */
pictbridge = (UX_PICTBRIDGE *)pima -> ux_device_class_pima_application;
-
+
/* Check the object handle. If this is handle 1 or 2 , we need to return the XML script object.
If the handle is not 1 or 2, this is a JPEG picture or other object to be printed. */
if ((object_handle == UX_PICTBRIDGE_OBJECT_HANDLE_HOST_RESPONSE) || (object_handle == UX_PICTBRIDGE_OBJECT_HANDLE_CLIENT_REQUEST))
{
/* Check what XML object is requested. It is either a request script or a response. */
- if (object_handle == UX_PICTBRIDGE_OBJECT_HANDLE_HOST_RESPONSE)
+ if (object_handle == UX_PICTBRIDGE_OBJECT_HANDLE_HOST_RESPONSE)
object_info = (UX_SLAVE_CLASS_PIMA_OBJECT *) pictbridge -> ux_pictbridge_object_host;
- else
+ else
object_info = (UX_SLAVE_CLASS_PIMA_OBJECT *) pictbridge -> ux_pictbridge_object_client;
- }
+ }
else
{
@@ -116,7 +106,7 @@ UX_SLAVE_CLASS_PIMA_OBJECT *object_info;
/* Return the pointer to this object. */
*object = object_info;
- /* We are done. */
+ /* We are done. */
return(UX_SUCCESS);
}
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 750ffecc..45a67f16 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
@@ -1,18 +1,19 @@
/***************************************************************************
- * Copyright (c) 2024 Microsoft Corporation
- *
+ * Copyright (c) 2024 Microsoft Corporation
+ * Copyright (c) 2026-present Eclipse ThreadX contributors
+ *
* This program and the accompanying materials are made available under the
* terms of the MIT License which is available at
* https://opensource.org/licenses/MIT.
- *
+ *
* SPDX-License-Identifier: MIT
**************************************************************************/
/**************************************************************************/
/**************************************************************************/
-/** */
-/** USBX Component */
+/** */
+/** USBX Component */
/** */
/** Pictbridge Application */
/** */
@@ -29,53 +30,37 @@
#include "ux_device_class_pima.h"
-/**************************************************************************/
-/* */
-/* FUNCTION RELEASE */
-/* */
-/* _ux_pictbridge_dpsclient_object_info_send PORTABLE C */
+/**************************************************************************/
+/* */
+/* FUNCTION RELEASE */
+/* */
+/* _ux_pictbridge_dpsclient_object_info_send PORTABLE C */
/* 6.1.12 */
/* AUTHOR */
/* */
/* Chaoqiong Xiao, Microsoft Corporation */
/* */
/* DESCRIPTION */
-/* */
-/* Receive the info data set of a new object to be stored. */
-/* */
-/* INPUT */
-/* */
-/* pima Pima instance associated */
-/* */
-/* OUTPUT */
-/* */
-/* Completion Status */
-/* */
-/* CALLS */
-/* */
-/* */
-/* CALLED BY */
-/* */
-/* user application */
-/* */
-/* RELEASE HISTORY */
-/* */
-/* DATE NAME DESCRIPTION */
-/* */
-/* 05-19-2020 Chaoqiong Xiao Initial Version 6.0 */
-/* 09-30-2020 Chaoqiong Xiao Modified comment(s), */
-/* verified memset and memcpy */
-/* cases, used UX prefix to */
-/* refer to TX symbols instead */
-/* of using them directly, */
-/* resulting in version 6.1 */
-/* 07-29-2022 Chaoqiong Xiao Modified comment(s), */
-/* fixed string length check, */
-/* used macros for RTOS calls, */
-/* resulting in version 6.1.12 */
+/* */
+/* Receive the info data set of a new object to be stored. */
+/* */
+/* INPUT */
+/* */
+/* pima Pima instance associated */
+/* */
+/* OUTPUT */
+/* */
+/* Completion Status */
+/* */
+/* CALLS */
+/* */
+/* */
+/* CALLED BY */
+/* */
+/* user application */
/* */
/**************************************************************************/
-UINT _ux_pictbridge_dpsclient_object_info_send(UX_SLAVE_CLASS_PIMA *pima, UX_SLAVE_CLASS_PIMA_OBJECT *object,
+UINT _ux_pictbridge_dpsclient_object_info_send(UX_SLAVE_CLASS_PIMA *pima, UX_SLAVE_CLASS_PIMA_OBJECT *object,
ULONG storage_id,
ULONG parent_object_handle,
ULONG *object_handle)
@@ -93,7 +78,7 @@ UINT length, length1;
/* We only have one object. */
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); /* Use case of memcpy is verified. */
@@ -106,7 +91,7 @@ UINT length, length1;
{
/* We are in the discovery mode. Check for file name. It must match HDISCVRY.DPS in Unicode mode. */
- /* Check if this is a script. */
+ /* Check if this is a script. */
if (object_info -> ux_device_class_pima_object_format == UX_DEVICE_CLASS_PIMA_OFC_SCRIPT)
{
@@ -126,33 +111,33 @@ UINT length, length1;
/* Get the file name in a ascii format (with null-terminator). */
_ux_utility_unicode_to_string(object_info -> ux_device_class_pima_object_filename, string_discovery_name);
-
+
/* So far, the length of name of the files are the same.
Compare names now (since length is same just compare without null-terminator). */
if (_ux_utility_memory_compare(_ux_pictbridge_hdiscovery_name, string_discovery_name,
length) == UX_SUCCESS)
{
-
- /* We are done with discovery of the printer. We can now send notifications when the camera wants to print an object. */
+
+ /* We are done with discovery of the printer. We can now send notifications when the camera wants to print an object. */
pictbridge -> ux_pictbridge_discovery_state = UX_PICTBRIDGE_DPSCLIENT_DISCOVERY_COMPLETE;
-
+
/* Set an event flag if the application is listening. */
_ux_system_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);
}
}
}
- }
+ }
}
/* What cycle are we in ? */
if (pictbridge -> ux_pictbridge_host_client_state_machine == UX_PICTBRIDGE_STATE_MACHINE_IDLE)
-
+
/* Since we are in idle state, we must have received a request from the host. */
pictbridge -> ux_pictbridge_host_client_state_machine = UX_PICTBRIDGE_STATE_MACHINE_HOST_REQUEST;
-
+
/* We have copied the requested data. Return OK. */
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 a977e319..5f29530b 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
@@ -1,18 +1,19 @@
/***************************************************************************
- * Copyright (c) 2024 Microsoft Corporation
- *
+ * Copyright (c) 2024 Microsoft Corporation
+ * Copyright (c) 2026-present Eclipse ThreadX contributors
+ *
* This program and the accompanying materials are made available under the
* terms of the MIT License which is available at
* https://opensource.org/licenses/MIT.
- *
+ *
* SPDX-License-Identifier: MIT
**************************************************************************/
/**************************************************************************/
/**************************************************************************/
-/** */
-/** USBX Component */
+/** */
+/** USBX Component */
/** */
/** Pictbridge Application */
/** */
@@ -29,45 +30,37 @@
#include "ux_device_class_pima.h"
-/**************************************************************************/
-/* */
-/* FUNCTION RELEASE */
-/* */
-/* _ux_pictbridge_dpsclient_object_number_get PORTABLE C */
+/**************************************************************************/
+/* */
+/* FUNCTION RELEASE */
+/* */
+/* _ux_pictbridge_dpsclient_object_number_get PORTABLE C */
/* 6.1 */
/* AUTHOR */
/* */
/* Chaoqiong Xiao, Microsoft Corporation */
/* */
/* DESCRIPTION */
-/* */
-/* This function returns the number of objects. */
-/* */
-/* INPUT */
-/* */
-/* pima Pima instance associated */
-/* */
-/* OUTPUT */
-/* */
-/* Completion Status */
-/* */
-/* CALLS */
-/* */
-/* */
-/* CALLED BY */
-/* */
-/* user application */
-/* */
-/* RELEASE HISTORY */
-/* */
-/* DATE NAME DESCRIPTION */
-/* */
-/* 05-19-2020 Chaoqiong Xiao Initial Version 6.0 */
-/* 09-30-2020 Chaoqiong Xiao Modified comment(s), */
-/* resulting in version 6.1 */
+/* */
+/* This function returns the number of objects. */
+/* */
+/* INPUT */
+/* */
+/* pima Pima instance associated */
+/* */
+/* OUTPUT */
+/* */
+/* Completion Status */
+/* */
+/* CALLS */
+/* */
+/* */
+/* CALLED BY */
+/* */
+/* user application */
/* */
/**************************************************************************/
-UINT _ux_pictbridge_dpsclient_object_number_get(UX_SLAVE_CLASS_PIMA *pima,
+UINT _ux_pictbridge_dpsclient_object_number_get(UX_SLAVE_CLASS_PIMA *pima,
ULONG object_format_code,
ULONG object_association,
ULONG *number_objects)
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 5ffe51db..5f5b807e 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
@@ -1,18 +1,19 @@
/***************************************************************************
- * Copyright (c) 2024 Microsoft Corporation
- *
+ * Copyright (c) 2024 Microsoft Corporation
+ * Copyright (c) 2026-present Eclipse ThreadX contributors
+ *
* This program and the accompanying materials are made available under the
* terms of the MIT License which is available at
* https://opensource.org/licenses/MIT.
- *
+ *
* SPDX-License-Identifier: MIT
**************************************************************************/
/**************************************************************************/
/**************************************************************************/
-/** */
-/** USBX Component */
+/** */
+/** USBX Component */
/** */
/** Pictbridge Application */
/** */
@@ -30,45 +31,37 @@
#include "ux_device_class_pima.h"
-/**************************************************************************/
-/* */
-/* FUNCTION RELEASE */
-/* */
-/* _ux_pictbridge_dpsclient_register_event_callback_function */
-/* PORTABLE C */
+/**************************************************************************/
+/* */
+/* FUNCTION RELEASE */
+/* */
+/* _ux_pictbridge_dpsclient_register_event_callback_function */
+/* PORTABLE C */
/* 6.1 */
-/* */
+/* */
/* AUTHOR */
/* */
/* Chaoqiong Xiao, Microsoft Corporation */
/* */
/* DESCRIPTION */
-/* */
-/* This function register user callback function */
-/* */
-/* INPUT */
-/* */
-/* pictbridge Pictbridge instance */
+/* */
+/* This function register user callback function */
+/* */
+/* INPUT */
+/* */
+/* pictbridge Pictbridge instance */
/* event_callback_function Pointer to callback function */
-/* */
-/* OUTPUT */
-/* */
-/* Completion Status */
-/* */
-/* CALLS */
-/* */
-/* */
-/* CALLED BY */
-/* */
-/* user application */
-/* */
-/* RELEASE HISTORY */
-/* */
-/* DATE NAME DESCRIPTION */
-/* */
-/* 05-19-2020 Chaoqiong Xiao Initial Version 6.0 */
-/* 09-30-2020 Chaoqiong Xiao Modified comment(s), */
-/* resulting in version 6.1 */
+/* */
+/* OUTPUT */
+/* */
+/* Completion Status */
+/* */
+/* CALLS */
+/* */
+/* */
+/* CALLED BY */
+/* */
+/* user application */
/* */
/**************************************************************************/
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 53c71b72..6617fa1e 100644
--- a/common/usbx_pictbridge/src/ux_pictbridge_dpsclient_start.c
+++ b/common/usbx_pictbridge/src/ux_pictbridge_dpsclient_start.c
@@ -1,18 +1,19 @@
/***************************************************************************
- * Copyright (c) 2024 Microsoft Corporation
- *
+ * Copyright (c) 2024 Microsoft Corporation
+ * Copyright (c) 2026-present Eclipse ThreadX contributors
+ *
* This program and the accompanying materials are made available under the
* terms of the MIT License which is available at
* https://opensource.org/licenses/MIT.
- *
+ *
* SPDX-License-Identifier: MIT
**************************************************************************/
/**************************************************************************/
/**************************************************************************/
-/** */
-/** USBX Component */
+/** */
+/** USBX Component */
/** */
/** Pictbridge Application */
/** */
@@ -142,51 +143,34 @@ static UINT _dpsclient_storage_format(struct UX_SLAVE_CLASS_PIMA_STRUCT *pima,
}
-/**************************************************************************/
-/* */
-/* FUNCTION RELEASE */
-/* */
-/* _ux_pictbridge_dpsclient_start PORTABLE C */
+/**************************************************************************/
+/* */
+/* FUNCTION RELEASE */
+/* */
+/* _ux_pictbridge_dpsclient_start PORTABLE C */
/* 6.3.0 */
/* AUTHOR */
/* */
/* Chaoqiong Xiao, Microsoft Corporation */
/* */
/* DESCRIPTION */
-/* */
-/* This function starts the DPS client (usually a camera or phone) */
-/* */
-/* INPUT */
-/* */
-/* pima Pima instance associated */
-/* */
-/* OUTPUT */
-/* */
-/* Completion Status */
-/* */
-/* CALLS */
-/* */
-/* */
-/* CALLED BY */
-/* */
-/* user application */
-/* */
-/* RELEASE HISTORY */
-/* */
-/* 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 */
-/* 07-29-2022 Chaoqiong Xiao Modified comment(s), */
-/* used macros for RTOS calls, */
-/* resulting in version 6.1.12 */
-/* 10-31-2023 Chaoqiong Xiao Modified comment(s), */
-/* initialized PIMA callbacks, */
-/* resulting in version 6.3.0 */
+/* */
+/* This function starts the DPS client (usually a camera or phone) */
+/* */
+/* INPUT */
+/* */
+/* pima Pima instance associated */
+/* */
+/* OUTPUT */
+/* */
+/* Completion Status */
+/* */
+/* CALLS */
+/* */
+/* */
+/* CALLED BY */
+/* */
+/* user application */
/* */
/**************************************************************************/
UINT _ux_pictbridge_dpsclient_start(UX_PICTBRIDGE *pictbridge)
@@ -199,7 +183,7 @@ UX_SLAVE_CLASS_PIMA_OBJECT *object_info;
/* Check status. */
if (pictbridge -> ux_pictbridge_object_host == UX_NULL)
- return(UX_MEMORY_INSUFFICIENT);
+ return(UX_MEMORY_INSUFFICIENT);
/* Initialize status to success for things going on. */
status = UX_SUCCESS;
@@ -209,7 +193,7 @@ UX_SLAVE_CLASS_PIMA_OBJECT *object_info;
/* Check status. */
if (pictbridge -> ux_pictbridge_object_client == UX_NULL)
- status = (UX_MEMORY_INSUFFICIENT);
+ status = (UX_MEMORY_INSUFFICIENT);
/* Allocate 1 object for the job. */
if (status == UX_SUCCESS)
@@ -218,7 +202,7 @@ UX_SLAVE_CLASS_PIMA_OBJECT *object_info;
/* Check status. */
if (pictbridge -> ux_pictbridge_jobinfo.ux_pictbridge_jobinfo_object == UX_NULL)
- status = (UX_MEMORY_INSUFFICIENT);
+ status = (UX_MEMORY_INSUFFICIENT);
}
/* Allocate some memory for the XML objects. For the client script. */
@@ -229,7 +213,7 @@ UX_SLAVE_CLASS_PIMA_OBJECT *object_info;
/* Check status. */
if (object_info -> ux_device_class_pima_object_buffer == UX_NULL)
- status = (UX_MEMORY_INSUFFICIENT);
+ status = (UX_MEMORY_INSUFFICIENT);
}
/* Allocate some memory for the XML objects. For the host script. */
@@ -240,9 +224,9 @@ UX_SLAVE_CLASS_PIMA_OBJECT *object_info;
/* Check status. */
if (object_info -> ux_device_class_pima_object_buffer == UX_NULL)
- return(UX_MEMORY_INSUFFICIENT);
+ return(UX_MEMORY_INSUFFICIENT);
}
-
+
/* Create a event flag group for the client to communicate with the application. */
if (status == UX_SUCCESS)
{
@@ -268,7 +252,7 @@ UX_SLAVE_CLASS_PIMA_OBJECT *object_info;
/* Allocate a Thread stack. */
if (status == UX_SUCCESS)
{
- pictbridge -> ux_pictbridge_thread_stack =
+ pictbridge -> ux_pictbridge_thread_stack =
_ux_utility_memory_allocate(UX_NO_ALIGN, UX_REGULAR_MEMORY, UX_PICTBRIDGE_THREAD_STACK_SIZE);
/* Check the completion status. */
@@ -283,13 +267,13 @@ UX_SLAVE_CLASS_PIMA_OBJECT *object_info;
{
status = _ux_system_thread_create(&pictbridge -> ux_pictbridge_thread,
"ux_pictbridge_thread", _ux_pictbridge_dpsclient_thread,
- (ULONG)(ALIGN_TYPE) pictbridge,
+ (ULONG)(ALIGN_TYPE) pictbridge,
pictbridge -> ux_pictbridge_thread_stack,
- UX_PICTBRIDGE_THREAD_STACK_SIZE,
+ UX_PICTBRIDGE_THREAD_STACK_SIZE,
UX_PICTBRIDGE_THREAD_PRIORITY_CLASS,
UX_PICTBRIDGE_THREAD_PRIORITY_CLASS,
UX_NO_TIME_SLICE, UX_AUTO_START);
-
+
/* Check the completion status. */
if (status != UX_SUCCESS)
@@ -305,10 +289,10 @@ UX_SLAVE_CLASS_PIMA_OBJECT *object_info;
/* Initialize the pictbridge request/response state to request expected. */
pictbridge -> ux_pictbridge_request_response = UX_PICTBRIDGE_REQUEST;
- /* Set the host/client cycle to idle. */
+ /* Set the host/client cycle to idle. */
pictbridge -> ux_pictbridge_host_client_state_machine = UX_PICTBRIDGE_STATE_MACHINE_IDLE;
-
- /* Initialize the first XML object valid in the pictbridge instance. Initialize the handle, type and file name.
+
+ /* Initialize the first XML object valid in the pictbridge instance. Initialize the handle, type and file name.
The storage handle and the object handle have a fixed value of 1 in our implementation. */
object_info = pictbridge -> ux_pictbridge_object_client;
object_info -> ux_device_class_pima_object_format = UX_DEVICE_CLASS_PIMA_OFC_SCRIPT;
@@ -316,7 +300,7 @@ UX_SLAVE_CLASS_PIMA_OBJECT *object_info;
object_info -> ux_device_class_pima_object_handle_id = 2;
_ux_utility_string_to_unicode(_ux_pictbridge_ddiscovery_name, object_info -> ux_device_class_pima_object_filename);
- /* Initialize the head and tail of the notification round robin buffers.
+ /* Initialize the head and tail of the notification round robin buffers.
At first, the head and tail are pointing to the beginning of the array. */
pictbridge -> ux_pictbridge_event_array_head = pictbridge -> ux_pictbridge_event_array;
pictbridge -> ux_pictbridge_event_array_tail = pictbridge -> ux_pictbridge_event_array;
@@ -340,10 +324,10 @@ UX_SLAVE_CLASS_PIMA_OBJECT *object_info;
pictbridge -> ux_pictbridge_pima_parameter.ux_device_class_pima_parameter_object_number_get = _ux_pictbridge_dpsclient_object_number_get;
pictbridge -> ux_pictbridge_pima_parameter.ux_device_class_pima_parameter_object_handles_get = _ux_pictbridge_dpsclient_object_handles_get;
- pictbridge -> ux_pictbridge_pima_parameter.ux_device_class_pima_parameter_object_info_get = _ux_pictbridge_dpsclient_object_info_get;
- pictbridge -> ux_pictbridge_pima_parameter.ux_device_class_pima_parameter_object_data_get = _ux_pictbridge_dpsclient_object_data_get;
- pictbridge -> ux_pictbridge_pima_parameter.ux_device_class_pima_parameter_object_info_send = _ux_pictbridge_dpsclient_object_info_send;
- pictbridge -> ux_pictbridge_pima_parameter.ux_device_class_pima_parameter_object_data_send = _ux_pictbridge_dpsclient_object_data_send;
+ pictbridge -> ux_pictbridge_pima_parameter.ux_device_class_pima_parameter_object_info_get = _ux_pictbridge_dpsclient_object_info_get;
+ pictbridge -> ux_pictbridge_pima_parameter.ux_device_class_pima_parameter_object_data_get = _ux_pictbridge_dpsclient_object_data_get;
+ pictbridge -> ux_pictbridge_pima_parameter.ux_device_class_pima_parameter_object_info_send = _ux_pictbridge_dpsclient_object_info_send;
+ pictbridge -> ux_pictbridge_pima_parameter.ux_device_class_pima_parameter_object_data_send = _ux_pictbridge_dpsclient_object_data_send;
pictbridge -> ux_pictbridge_pima_parameter.ux_device_class_pima_parameter_object_delete = _ux_pictbridge_dpsclient_object_delete;
#ifdef UX_PIMA_WITH_MTP_SUPPORT
@@ -363,16 +347,16 @@ UX_SLAVE_CLASS_PIMA_OBJECT *object_info;
/* Store the instance owner. */
pictbridge -> ux_pictbridge_pima_parameter.ux_device_class_pima_parameter_application = (VOID *) pictbridge;
-
+
/* Initialize the device pima class. The class is connected with interface 0 */
- status = _ux_device_stack_class_register(_ux_system_slave_class_pima_name, _ux_device_class_pima_entry,
+ status = _ux_device_stack_class_register(_ux_system_slave_class_pima_name, _ux_device_class_pima_entry,
1, 0, (VOID *)&pictbridge -> ux_pictbridge_pima_parameter);
}
/* Check status. */
if (status != UX_SUCCESS)
{
-
+
/* Free resources allocated so far. */
if (_ux_system_thread_created(&pictbridge -> ux_pictbridge_thread))
_ux_system_thread_delete(&pictbridge -> ux_pictbridge_thread);
@@ -400,7 +384,7 @@ UX_SLAVE_CLASS_PIMA_OBJECT *object_info;
/* Do not proceed if error. */
return(status);
- }
+ }
/* We are done. */
return(UX_SUCCESS);
diff --git a/common/usbx_pictbridge/src/ux_pictbridge_dpsclient_thread.c b/common/usbx_pictbridge/src/ux_pictbridge_dpsclient_thread.c
index c4f6a269..5f4521ea 100644
--- a/common/usbx_pictbridge/src/ux_pictbridge_dpsclient_thread.c
+++ b/common/usbx_pictbridge/src/ux_pictbridge_dpsclient_thread.c
@@ -1,18 +1,19 @@
/***************************************************************************
- * Copyright (c) 2024 Microsoft Corporation
- *
+ * Copyright (c) 2024 Microsoft Corporation
+ * Copyright (c) 2026-present Eclipse ThreadX contributors
+ *
* This program and the accompanying materials are made available under the
* terms of the MIT License which is available at
* https://opensource.org/licenses/MIT.
- *
+ *
* SPDX-License-Identifier: MIT
**************************************************************************/
/**************************************************************************/
/**************************************************************************/
-/** */
-/** USBX Component */
+/** */
+/** USBX Component */
/** */
/** Pictbridge Application */
/** */
@@ -29,50 +30,35 @@
#include "ux_device_class_pima.h"
-/**************************************************************************/
-/* */
-/* FUNCTION RELEASE */
-/* */
-/* _ux_pictbridge_dpsclient_thread PORTABLE C */
+/**************************************************************************/
+/* */
+/* FUNCTION RELEASE */
+/* */
+/* _ux_pictbridge_dpsclient_thread PORTABLE C */
/* 6.1.12 */
/* AUTHOR */
/* */
/* Chaoqiong Xiao, Microsoft Corporation */
/* */
/* DESCRIPTION */
-/* */
-/* This is the Pictbridge dpsclient thread that receives and execute */
-/* commands from the dpshost. */
-/* */
-/* INPUT */
-/* */
-/* pictbridge Pictbridge instance */
-/* */
-/* OUTPUT */
-/* */
-/* Completion Status */
-/* */
-/* CALLS */
-/* */
-/* */
-/* CALLED BY */
-/* */
-/* user application */
-/* */
-/* RELEASE HISTORY */
-/* */
-/* DATE NAME DESCRIPTION */
-/* */
-/* 05-19-2020 Chaoqiong Xiao Initial Version 6.0 */
-/* 09-30-2020 Chaoqiong Xiao Modified comment(s), */
-/* verified memset and memcpy */
-/* cases, used UX prefix to */
-/* refer to TX symbols instead */
-/* of using them directly, */
-/* resulting in version 6.1 */
-/* 07-29-2022 Chaoqiong Xiao Modified comment(s), */
-/* used macros for RTOS calls, */
-/* resulting in version 6.1.12 */
+/* */
+/* This is the Pictbridge dpsclient thread that receives and execute */
+/* commands from the dpshost. */
+/* */
+/* INPUT */
+/* */
+/* pictbridge Pictbridge instance */
+/* */
+/* OUTPUT */
+/* */
+/* Completion Status */
+/* */
+/* CALLS */
+/* */
+/* */
+/* CALLED BY */
+/* */
+/* user application */
/* */
/**************************************************************************/
VOID _ux_pictbridge_dpsclient_thread(ULONG parameter)
@@ -89,7 +75,7 @@ UX_SLAVE_CLASS_PIMA_OBJECT *pima_object;
/* Cast the parameter passed in the thread into the pictbridge pointer. */
UX_THREAD_EXTENSION_PTR_GET(pictbridge, UX_PICTBRIDGE, parameter)
- /* Loop forever waiting for changes signaled through the semaphore. */
+ /* Loop forever waiting for changes signaled through the semaphore. */
while (1)
{
@@ -98,8 +84,8 @@ UX_SLAVE_CLASS_PIMA_OBJECT *pima_object;
_ux_system_error_handler(UX_SYSTEM_LEVEL_THREAD, UX_SYSTEM_CONTEXT_CLASS, status);
/* We should wait for the host to send a script with a command. */
- status = _ux_system_event_flags_get(&pictbridge -> ux_pictbridge_event_flags_group, (UX_PICTBRIDGE_EVENT_FLAG_NOTIFY_JOB_STATUS |
- UX_PICTBRIDGE_EVENT_FLAG_NOTIFY_DEVICE_STATUS),
+ status = _ux_system_event_flags_get(&pictbridge -> ux_pictbridge_event_flags_group, (UX_PICTBRIDGE_EVENT_FLAG_NOTIFY_JOB_STATUS |
+ UX_PICTBRIDGE_EVENT_FLAG_NOTIFY_DEVICE_STATUS),
UX_OR_CLEAR, &actual_flags, UX_PICTBRIDGE_EVENT_TIMEOUT);
/* Check the status. */
@@ -109,46 +95,46 @@ UX_SLAVE_CLASS_PIMA_OBJECT *pima_object;
/* The event flag is meaningful. What did we get ? */
if ((actual_flags & UX_PICTBRIDGE_EVENT_FLAG_NOTIFY_JOB_STATUS) || (actual_flags & UX_PICTBRIDGE_EVENT_FLAG_NOTIFY_DEVICE_STATUS))
{
-
+
/* We need to send a response now. */
/* Get the pima instance from the pictbridge container. */
pima = (UX_SLAVE_CLASS_PIMA *) pictbridge -> ux_pictbridge_pima;
-
+
/* Get the address of the object container. We need the host container here, as it is a response for the host. */
pima_object = (UX_SLAVE_CLASS_PIMA_OBJECT *) pictbridge -> ux_pictbridge_object_host;
-
+
/* Get the object buffer address. */
pima_object_buffer = pima_object -> ux_device_class_pima_object_buffer;
-
+
/* Reset the object length. */
object_length = 0;
-
+
/* Clear the object memory buffer. */
_ux_utility_memory_set(pima_object_buffer, 0, UX_PICTBRIDGE_MAX_PIMA_OBJECT_BUFFER); /* Use case of memset is verified. */
-
+
/* Add the line */
- status = _ux_pictbridge_object_tag_line_add(pima_object_buffer, object_length, _ux_pictbridge_xml_tag_line_xmlversion,
+ status = _ux_pictbridge_object_tag_line_add(pima_object_buffer, object_length, _ux_pictbridge_xml_tag_line_xmlversion,
UX_PICTBRIDGE_TAG_FLAG_BEGIN | UX_PICTBRIDGE_TAG_FLAG_FORCE_LF,
UX_NULL, 0, UX_NULL, &pima_object_buffer, &object_length);
if (status != UX_SUCCESS)
continue;
-
+
/* Add the line */
- status = _ux_pictbridge_object_tag_line_add(pima_object_buffer, object_length, _ux_pictbridge_xml_tag_line_dpsxmlns,
+ status = _ux_pictbridge_object_tag_line_add(pima_object_buffer, object_length, _ux_pictbridge_xml_tag_line_dpsxmlns,
UX_PICTBRIDGE_TAG_FLAG_BEGIN | UX_PICTBRIDGE_TAG_FLAG_FORCE_LF,
UX_NULL, 0, UX_NULL, &pima_object_buffer, &object_length);
if (status != UX_SUCCESS)
continue;
-
+
/* Add the line */
- status = _ux_pictbridge_object_tag_line_add(pima_object_buffer, object_length, _ux_pictbridge_xml_tag_line_output,
+ status = _ux_pictbridge_object_tag_line_add(pima_object_buffer, object_length, _ux_pictbridge_xml_tag_line_output,
UX_PICTBRIDGE_TAG_FLAG_END,
UX_NULL, 0, UX_NULL, &pima_object_buffer, &object_length);
if (status != UX_SUCCESS)
continue;
/* Add the line */
- status = _ux_pictbridge_object_tag_line_add(pima_object_buffer, object_length, _ux_pictbridge_xml_tag_line_dps,
+ status = _ux_pictbridge_object_tag_line_add(pima_object_buffer, object_length, _ux_pictbridge_xml_tag_line_dps,
UX_PICTBRIDGE_TAG_FLAG_END,
UX_NULL, 0, UX_NULL, &pima_object_buffer, &object_length);
if (status != UX_SUCCESS)
continue;
/* Get the length of the object and store it into the object data set. */
- pima_object -> ux_device_class_pima_object_length = object_length;
- pima_object -> ux_device_class_pima_object_compressed_size = object_length;
-
+ pima_object -> ux_device_class_pima_object_length = object_length;
+ pima_object -> ux_device_class_pima_object_compressed_size = object_length;
+
/* Save the handle for this object. */
- pima_object -> ux_device_class_pima_object_handle_id = UX_PICTBRIDGE_OBJECT_HANDLE_HOST_RESPONSE;
-
+ pima_object -> ux_device_class_pima_object_handle_id = UX_PICTBRIDGE_OBJECT_HANDLE_HOST_RESPONSE;
+
/* We need to change the file name to DRSPONSE.DPS. Encode the file name from ascii format into Unicode. */
_ux_utility_string_to_unicode(_ux_pictbridge_drsponse_name, pima_object -> ux_device_class_pima_object_filename);
-
+
/* Send the notification to the host that an object has been added. */
status = _ux_device_class_pima_object_add(pima, UX_PICTBRIDGE_OBJECT_HANDLE_HOST_RESPONSE);
if (status != UX_SUCCESS)
@@ -211,6 +197,6 @@ UX_SLAVE_CLASS_PIMA_OBJECT *pima_object;
}
}
- }
+ }
}
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 471cc791..7102ea46 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
@@ -1,18 +1,19 @@
/***************************************************************************
- * Copyright (c) 2024 Microsoft Corporation
- *
+ * Copyright (c) 2024 Microsoft Corporation
+ * Copyright (c) 2026-present Eclipse ThreadX contributors
+ *
* This program and the accompanying materials are made available under the
* terms of the MIT License which is available at
* https://opensource.org/licenses/MIT.
- *
+ *
* SPDX-License-Identifier: MIT
**************************************************************************/
/**************************************************************************/
/**************************************************************************/
-/** */
-/** USBX Component */
+/** */
+/** USBX Component */
/** */
/** Pictbridge Application */
/** */
@@ -29,56 +30,48 @@
#include "ux_host_class_pima.h"
-/**************************************************************************/
-/* */
-/* FUNCTION RELEASE */
-/* */
+/**************************************************************************/
+/* */
+/* FUNCTION RELEASE */
+/* */
/* _ux_pictbridge_dpshost_input_object_notify_device_status */
-/* PORTABLE C */
+/* PORTABLE C */
/* 6.1 */
-/* */
+/* */
/* AUTHOR */
/* */
/* Chaoqiong Xiao, Microsoft Corporation */
/* */
/* DESCRIPTION */
-/* */
-/* This function creates the tag lines of the input object for the */
-/* notification of the device status. */
-/* */
-/* INPUT */
-/* */
-/* pictbridge Pictbridge instance */
+/* */
+/* This function creates the tag lines of the input object for the */
+/* notification of the device status. */
+/* */
+/* INPUT */
+/* */
+/* pictbridge Pictbridge instance */
/* pima_object_buffer Pointer to object buffer */
/* object_length Length of the object */
/* pima_object_buffer_updated Updated Address of the object */
/* object_length_updated Updated length */
/* */
-/* */
-/* OUTPUT */
-/* */
-/* Completion Status */
-/* */
-/* CALLS */
-/* */
-/* */
-/* CALLED BY */
-/* */
-/* */
-/* */
-/* RELEASE HISTORY */
-/* */
-/* DATE NAME DESCRIPTION */
-/* */
-/* 05-19-2020 Chaoqiong Xiao Initial Version 6.0 */
-/* 09-30-2020 Chaoqiong Xiao Modified comment(s), */
-/* resulting in version 6.1 */
+/* */
+/* OUTPUT */
+/* */
+/* Completion Status */
+/* */
+/* CALLS */
+/* */
+/* */
+/* CALLED BY */
+/* */
+/* */
/* */
/**************************************************************************/
-UINT _ux_pictbridge_dpshost_input_object_notify_device_status(UX_PICTBRIDGE *pictbridge,
- UCHAR *pima_object_buffer,
- ULONG object_length,
- UCHAR **pima_object_buffer_updated,
+UINT _ux_pictbridge_dpshost_input_object_notify_device_status(UX_PICTBRIDGE *pictbridge,
+ UCHAR *pima_object_buffer,
+ ULONG object_length,
+ UCHAR **pima_object_buffer_updated,
ULONG *object_length_updated)
{
@@ -86,63 +79,63 @@ UINT status = UX_SUCCESS;
/* Add the line */
- status = _ux_pictbridge_object_tag_line_add(pima_object_buffer, object_length, _ux_pictbridge_xml_tag_line_notifydevicestatus,
+ status = _ux_pictbridge_object_tag_line_add(pima_object_buffer, object_length, _ux_pictbridge_xml_tag_line_notifydevicestatus,
UX_PICTBRIDGE_TAG_FLAG_BEGIN | UX_PICTBRIDGE_TAG_FLAG_FORCE_LF,
UX_NULL, 0, UX_NULL, &pima_object_buffer, &object_length);
if (status != UX_SUCCESS)
return(status);
/* Add the line xxxxxxxx */
- status = _ux_pictbridge_object_tag_line_add(pima_object_buffer, object_length, _ux_pictbridge_xml_tag_line_dpsprintservicestatus,
+ status = _ux_pictbridge_object_tag_line_add(pima_object_buffer, object_length, _ux_pictbridge_xml_tag_line_dpsprintservicestatus,
UX_PICTBRIDGE_TAG_FLAG_BEGIN | UX_PICTBRIDGE_TAG_FLAG_END | UX_PICTBRIDGE_TAG_FLAG_VARIABLE_HEXA,
UX_NULL, 0, (VOID *)(ALIGN_TYPE) pictbridge -> ux_pictbridge_dpslocal.ux_pictbridge_devinfo_dpsprintservicestatus, &pima_object_buffer, &object_length);
if (status != UX_SUCCESS)
return(status);
/* Add the line xxxxxxxx */
- status = _ux_pictbridge_object_tag_line_add(pima_object_buffer, object_length, _ux_pictbridge_xml_tag_line_jobendreason,
+ status = _ux_pictbridge_object_tag_line_add(pima_object_buffer, object_length, _ux_pictbridge_xml_tag_line_jobendreason,
UX_PICTBRIDGE_TAG_FLAG_BEGIN | UX_PICTBRIDGE_TAG_FLAG_END | UX_PICTBRIDGE_TAG_FLAG_VARIABLE_HEXA,
UX_NULL, 0, (VOID *)(ALIGN_TYPE) pictbridge -> ux_pictbridge_dpslocal.ux_pictbridge_devinfo_jobendreason, &pima_object_buffer, &object_length);
if (status != UX_SUCCESS)
return(status);
/* Add the line xxxxxxxx */
- status = _ux_pictbridge_object_tag_line_add(pima_object_buffer, object_length, _ux_pictbridge_xml_tag_line_errorstatus,
+ status = _ux_pictbridge_object_tag_line_add(pima_object_buffer, object_length, _ux_pictbridge_xml_tag_line_errorstatus,
UX_PICTBRIDGE_TAG_FLAG_BEGIN | UX_PICTBRIDGE_TAG_FLAG_END | UX_PICTBRIDGE_TAG_FLAG_VARIABLE_HEXA,
UX_NULL, 0, (VOID *)(ALIGN_TYPE) pictbridge -> ux_pictbridge_dpslocal.ux_pictbridge_devinfo_errorstatus, &pima_object_buffer, &object_length);
if (status != UX_SUCCESS)
return(status);
/* Add the line xxxxxxxx */
- status = _ux_pictbridge_object_tag_line_add(pima_object_buffer, object_length, _ux_pictbridge_xml_tag_line_errorreason,
+ status = _ux_pictbridge_object_tag_line_add(pima_object_buffer, object_length, _ux_pictbridge_xml_tag_line_errorreason,
UX_PICTBRIDGE_TAG_FLAG_BEGIN | UX_PICTBRIDGE_TAG_FLAG_END | UX_PICTBRIDGE_TAG_FLAG_VARIABLE_HEXA,
UX_NULL, 0, (VOID *)(ALIGN_TYPE) pictbridge -> ux_pictbridge_dpslocal.ux_pictbridge_devinfo_errorreason, &pima_object_buffer, &object_length);
if (status != UX_SUCCESS)
return(status);
/* Add the line xxxxxxxx */
- status = _ux_pictbridge_object_tag_line_add(pima_object_buffer, object_length, _ux_pictbridge_xml_tag_line_disconnectenable,
+ status = _ux_pictbridge_object_tag_line_add(pima_object_buffer, object_length, _ux_pictbridge_xml_tag_line_disconnectenable,
UX_PICTBRIDGE_TAG_FLAG_BEGIN | UX_PICTBRIDGE_TAG_FLAG_END | UX_PICTBRIDGE_TAG_FLAG_VARIABLE_HEXA,
UX_NULL, 0, (VOID *)(ALIGN_TYPE) pictbridge -> ux_pictbridge_dpslocal.ux_pictbridge_devinfo_disconnectenable, &pima_object_buffer, &object_length);
if (status != UX_SUCCESS)
return(status);
/* Add the line xxxxxxxx */
- status = _ux_pictbridge_object_tag_line_add(pima_object_buffer, object_length, _ux_pictbridge_xml_tag_line_capabilitychanged,
+ status = _ux_pictbridge_object_tag_line_add(pima_object_buffer, object_length, _ux_pictbridge_xml_tag_line_capabilitychanged,
UX_PICTBRIDGE_TAG_FLAG_BEGIN | UX_PICTBRIDGE_TAG_FLAG_END | UX_PICTBRIDGE_TAG_FLAG_VARIABLE_HEXA,
UX_NULL, 0, (VOID *)(ALIGN_TYPE) pictbridge -> ux_pictbridge_dpslocal.ux_pictbridge_devinfo_capabilitychanged, &pima_object_buffer, &object_length);
if (status != UX_SUCCESS)
return(status);
/* Add the line xxxxxxxx */
- status = _ux_pictbridge_object_tag_line_add(pima_object_buffer, object_length, _ux_pictbridge_xml_tag_line_newjobok,
+ status = _ux_pictbridge_object_tag_line_add(pima_object_buffer, object_length, _ux_pictbridge_xml_tag_line_newjobok,
UX_PICTBRIDGE_TAG_FLAG_BEGIN | UX_PICTBRIDGE_TAG_FLAG_END | UX_PICTBRIDGE_TAG_FLAG_VARIABLE_HEXA,
UX_NULL, 0, (VOID *)(ALIGN_TYPE) pictbridge -> ux_pictbridge_dpslocal.ux_pictbridge_devinfo_newjobok, &pima_object_buffer, &object_length);
if (status != UX_SUCCESS)
return(status);
/* Add the line */
- status = _ux_pictbridge_object_tag_line_add(pima_object_buffer, object_length, _ux_pictbridge_xml_tag_line_notifydevicestatus,
+ status = _ux_pictbridge_object_tag_line_add(pima_object_buffer, object_length, _ux_pictbridge_xml_tag_line_notifydevicestatus,
UX_PICTBRIDGE_TAG_FLAG_END,
UX_NULL, 0, UX_NULL, &pima_object_buffer, &object_length);
if (status != UX_SUCCESS)
@@ -150,11 +143,11 @@ UINT status = UX_SUCCESS;
/* Update the caller's object position. */
*pima_object_buffer_updated = pima_object_buffer;
-
+
/* Update the caller's object length . */
*object_length_updated = object_length;
/* Return completion status. */
- return(status);
+ return(status);
}
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 79d66c8c..0d09e1fb 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
@@ -1,18 +1,19 @@
/***************************************************************************
- * Copyright (c) 2024 Microsoft Corporation
- *
+ * Copyright (c) 2024 Microsoft Corporation
+ * Copyright (c) 2026-present Eclipse ThreadX contributors
+ *
* This program and the accompanying materials are made available under the
* terms of the MIT License which is available at
* https://opensource.org/licenses/MIT.
- *
+ *
* SPDX-License-Identifier: MIT
**************************************************************************/
/**************************************************************************/
/**************************************************************************/
-/** */
-/** USBX Component */
+/** */
+/** USBX Component */
/** */
/** Pictbridge Application */
/** */
@@ -29,59 +30,48 @@
#include "ux_host_class_pima.h"
-/**************************************************************************/
-/* */
-/* FUNCTION RELEASE */
-/* */
+/**************************************************************************/
+/* */
+/* FUNCTION RELEASE */
+/* */
/* _ux_pictbridge_dpshost_input_object_notify_job_status */
-/* PORTABLE C */
+/* PORTABLE C */
/* 6.1.11 */
-/* */
+/* */
/* AUTHOR */
/* */
/* Chaoqiong Xiao, Microsoft Corporation */
/* */
/* DESCRIPTION */
-/* */
-/* This function creates the tag lines of the input object for the */
-/* notification of the job status. */
-/* */
-/* INPUT */
-/* */
-/* pictbridge Pictbridge instance */
+/* */
+/* This function creates the tag lines of the input object for the */
+/* notification of the job status. */
+/* */
+/* INPUT */
+/* */
+/* pictbridge Pictbridge instance */
/* pima_object_buffer Pointer to object buffer */
/* object_length Length of the object */
/* pima_object_buffer_updated Updated Address of the object */
/* object_length_updated Updated length */
/* */
-/* */
-/* OUTPUT */
-/* */
-/* Completion Status */
-/* */
-/* CALLS */
-/* _device_status */
-/* */
-/* CALLED BY */
-/* */
-/* */
-/* */
-/* RELEASE HISTORY */
-/* */
-/* DATE NAME DESCRIPTION */
-/* */
-/* 05-19-2020 Chaoqiong Xiao Initial Version 6.0 */
-/* 09-30-2020 Chaoqiong Xiao Modified comment(s), */
-/* resulting in version 6.1 */
-/* 04-25-2022 Yajun Xia Modified comment(s), */
-/* internal clean up, */
-/* resulting in version 6.1.11 */
+/* */
+/* OUTPUT */
+/* */
+/* Completion Status */
+/* */
+/* CALLS */
+/* _device_status */
+/* */
+/* CALLED BY */
+/* */
+/* */
/* */
/**************************************************************************/
-UINT _ux_pictbridge_dpshost_input_object_notify_job_status(UX_PICTBRIDGE *pictbridge,
- UCHAR *pima_object_buffer,
- ULONG object_length,
- UCHAR **pima_object_buffer_updated,
+UINT _ux_pictbridge_dpshost_input_object_notify_job_status(UX_PICTBRIDGE *pictbridge,
+ UCHAR *pima_object_buffer,
+ ULONG object_length,
+ UCHAR **pima_object_buffer_updated,
ULONG *object_length_updated)
{
UX_PICTBRIDGE_JOBINFO *jobinfo;
@@ -95,14 +85,14 @@ UINT status = UX_SUCCESS;
printinfo = jobinfo -> ux_pictbridge_jobinfo_printinfo_current;
/* Add the line */
- status = _ux_pictbridge_object_tag_line_add(pima_object_buffer, object_length, _ux_pictbridge_xml_tag_line_notifyjobstatus,
+ status = _ux_pictbridge_object_tag_line_add(pima_object_buffer, object_length, _ux_pictbridge_xml_tag_line_notifyjobstatus,
UX_PICTBRIDGE_TAG_FLAG_BEGIN | UX_PICTBRIDGE_TAG_FLAG_FORCE_LF,
UX_NULL, 0, UX_NULL, &pima_object_buffer, &object_length);
if (status != UX_SUCCESS)
return(status);
/* Add the line */
- status = _ux_pictbridge_object_tag_line_add(pima_object_buffer, object_length, _ux_pictbridge_xml_tag_line_progress,
+ status = _ux_pictbridge_object_tag_line_add(pima_object_buffer, object_length, _ux_pictbridge_xml_tag_line_progress,
UX_PICTBRIDGE_TAG_FLAG_END,
UX_NULL, 0, UX_NULL, &pima_object_buffer, &object_length);
if (status != UX_SUCCESS)
return(status);
/* Add the line xxxxxxxx */
- status = _ux_pictbridge_object_tag_line_add(pima_object_buffer, object_length, _ux_pictbridge_xml_tag_line_imagesprinted,
+ status = _ux_pictbridge_object_tag_line_add(pima_object_buffer, object_length, _ux_pictbridge_xml_tag_line_imagesprinted,
UX_PICTBRIDGE_TAG_FLAG_BEGIN | UX_PICTBRIDGE_TAG_FLAG_END | UX_PICTBRIDGE_TAG_FLAG_VARIABLE_DECIMAL_3DIGITS,
UX_NULL, 0, (VOID *)(ALIGN_TYPE) printinfo -> ux_pictbridge_printinfo_images_printed, &pima_object_buffer, &object_length);
if (status != UX_SUCCESS)
return(status);
/* Add the line */
- status = _ux_pictbridge_object_tag_line_add(pima_object_buffer, object_length, _ux_pictbridge_xml_tag_line_notifyjobstatus,
+ status = _ux_pictbridge_object_tag_line_add(pima_object_buffer, object_length, _ux_pictbridge_xml_tag_line_notifyjobstatus,
UX_PICTBRIDGE_TAG_FLAG_END,
UX_NULL, 0, UX_NULL, &pima_object_buffer, &object_length);
if (status != UX_SUCCESS)
@@ -160,11 +150,11 @@ UINT status = UX_SUCCESS;
/* Update the caller's object position. */
*pima_object_buffer_updated = pima_object_buffer;
-
+
/* Update the caller's object length . */
*object_length_updated = object_length;
-
+
/* Return completion status. */
- return(UX_SUCCESS);
+ return(UX_SUCCESS);
}
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 46fbaab4..53e2bf25 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
@@ -1,18 +1,19 @@
/***************************************************************************
- * Copyright (c) 2024 Microsoft Corporation
- *
+ * Copyright (c) 2024 Microsoft Corporation
+ * Copyright (c) 2026-present Eclipse ThreadX contributors
+ *
* This program and the accompanying materials are made available under the
* terms of the MIT License which is available at
* https://opensource.org/licenses/MIT.
- *
+ *
* SPDX-License-Identifier: MIT
**************************************************************************/
/**************************************************************************/
/**************************************************************************/
-/** */
-/** USBX Component */
+/** */
+/** USBX Component */
/** */
/** Pictbridge Application */
/** */
@@ -29,51 +30,35 @@
#include "ux_host_class_pima.h"
-/**************************************************************************/
-/* */
-/* FUNCTION RELEASE */
-/* */
-/* _ux_pictbridge_dpshost_input_object_send PORTABLE C */
+/**************************************************************************/
+/* */
+/* FUNCTION RELEASE */
+/* */
+/* _ux_pictbridge_dpshost_input_object_send PORTABLE C */
/* 6.1.12 */
/* AUTHOR */
/* */
/* Chaoqiong Xiao, Microsoft Corporation */
/* */
/* DESCRIPTION */
-/* */
-/* This function creates an input report for the dpshost */
-/* */
-/* INPUT */
-/* */
-/* pictbridge Pictbridge instance */
-/* input_function input tag */
-/* */
-/* OUTPUT */
-/* */
-/* Completion Status */
-/* */
-/* CALLS */
-/* */
-/* */
-/* CALLED BY */
-/* */
-/* */
-/* */
-/* RELEASE HISTORY */
-/* */
-/* DATE NAME DESCRIPTION */
-/* */
-/* 05-19-2020 Chaoqiong Xiao Initial Version 6.0 */
-/* 09-30-2020 Chaoqiong Xiao Modified comment(s), */
-/* verified memset and memcpy */
-/* cases, used UX prefix to */
-/* refer to TX symbols instead */
-/* of using them directly, */
-/* resulting in version 6.1 */
-/* 07-29-2022 Chaoqiong Xiao Modified comment(s), */
-/* cleared compile warning, */
-/* used macros for RTOS calls, */
-/* resulting in version 6.1.12 */
+/* */
+/* This function creates an input report for the dpshost */
+/* */
+/* INPUT */
+/* */
+/* pictbridge Pictbridge instance */
+/* input_function input tag */
+/* */
+/* OUTPUT */
+/* */
+/* Completion Status */
+/* */
+/* CALLS */
+/* */
+/* */
+/* CALLED BY */
+/* */
+/* */
/* */
/**************************************************************************/
UINT _ux_pictbridge_dpshost_input_object_send(UX_PICTBRIDGE *pictbridge, ULONG input_function)
@@ -91,13 +76,13 @@ ULONG actual_flags;
/* Check the state machine. */
if (pictbridge -> ux_pictbridge_host_client_state_machine != UX_PICTBRIDGE_STATE_MACHINE_IDLE)
{
-
+
/* Set the state machine to Host Request pending. */
pictbridge -> ux_pictbridge_host_client_state_machine |= UX_PICTBRIDGE_STATE_MACHINE_HOST_REQUEST_PENDING;
/* Wait for the client event pending request to be completed. */
- status = _ux_system_event_flags_get(&pictbridge -> ux_pictbridge_event_flags_group,
- UX_PICTBRIDGE_EVENT_FLAG_STATE_MACHINE_READY,
+ status = _ux_system_event_flags_get(&pictbridge -> ux_pictbridge_event_flags_group,
+ UX_PICTBRIDGE_EVENT_FLAG_STATE_MACHINE_READY,
UX_AND_CLEAR, &actual_flags, UX_PICTBRIDGE_EVENT_TIMEOUT);
/* Reset the state machine to not Host Request pending. */
@@ -116,7 +101,7 @@ ULONG actual_flags;
/* Get the pima instance from the pictbridge container. */
pima = (UX_HOST_CLASS_PIMA *) pictbridge -> ux_pictbridge_pima;
-
+
/* And now the session since we use it. */
pima_session = (UX_HOST_CLASS_PIMA_SESSION *)pictbridge -> ux_pictbridge_session;
@@ -125,29 +110,29 @@ ULONG actual_flags;
/* Get the object buffer address. */
pima_object_buffer = pima_object -> ux_host_class_pima_object_buffer;
-
+
/* Reset the object length. */
object_length = 0;
-
+
/* Clear the object memory buffer. */
_ux_utility_memory_set(pima_object_buffer, 0, UX_PICTBRIDGE_MAX_PIMA_OBJECT_BUFFER); /* Use case of memset is verified. */
/* Add the line */
- status = _ux_pictbridge_object_tag_line_add(pima_object_buffer, object_length, _ux_pictbridge_xml_tag_line_xmlversion,
+ status = _ux_pictbridge_object_tag_line_add(pima_object_buffer, object_length, _ux_pictbridge_xml_tag_line_xmlversion,
UX_PICTBRIDGE_TAG_FLAG_BEGIN | UX_PICTBRIDGE_TAG_FLAG_FORCE_LF,
UX_NULL, 0, UX_NULL, &pima_object_buffer, &object_length);
if (status != UX_SUCCESS)
return(status);
/* Add the line */
- status = _ux_pictbridge_object_tag_line_add(pima_object_buffer, object_length, _ux_pictbridge_xml_tag_line_dpsxmlns,
+ status = _ux_pictbridge_object_tag_line_add(pima_object_buffer, object_length, _ux_pictbridge_xml_tag_line_dpsxmlns,
UX_PICTBRIDGE_TAG_FLAG_BEGIN | UX_PICTBRIDGE_TAG_FLAG_FORCE_LF,
UX_NULL, 0, UX_NULL, &pima_object_buffer, &object_length);
/* Add the line */
if (status == UX_SUCCESS)
{
- status = _ux_pictbridge_object_tag_line_add(pima_object_buffer, object_length, _ux_pictbridge_xml_tag_line_input,
+ status = _ux_pictbridge_object_tag_line_add(pima_object_buffer, object_length, _ux_pictbridge_xml_tag_line_input,
UX_PICTBRIDGE_TAG_FLAG_BEGIN | UX_PICTBRIDGE_TAG_FLAG_FORCE_LF,
UX_NULL, 0, UX_NULL, &pima_object_buffer, &object_length);
}
@@ -155,9 +140,9 @@ ULONG actual_flags;
/* Look into the tag code from the input object and proceed to individual functions. */
if (status == UX_SUCCESS)
{
- switch (input_function)
+ switch (input_function)
{
-
+
case UX_PICTBRIDGE_IR_NOTIFY_JOB_STATUS :
/* Insert the notifyJobStatus tag lines. */
@@ -175,13 +160,13 @@ ULONG actual_flags;
/* Function not yet supported. We should never come here anyway. */
status = UX_ERROR;
- }
+ }
}
/* Add the line */
if (status == UX_SUCCESS)
{
- status = _ux_pictbridge_object_tag_line_add(pima_object_buffer, object_length, _ux_pictbridge_xml_tag_line_input,
+ status = _ux_pictbridge_object_tag_line_add(pima_object_buffer, object_length, _ux_pictbridge_xml_tag_line_input,
UX_PICTBRIDGE_TAG_FLAG_END,
UX_NULL, 0, UX_NULL, &pima_object_buffer, &object_length);
}
@@ -189,7 +174,7 @@ ULONG actual_flags;
/* Add the line */
if (status == UX_SUCCESS)
{
- status = _ux_pictbridge_object_tag_line_add(pima_object_buffer, object_length, _ux_pictbridge_xml_tag_line_dps,
+ status = _ux_pictbridge_object_tag_line_add(pima_object_buffer, object_length, _ux_pictbridge_xml_tag_line_dps,
UX_PICTBRIDGE_TAG_FLAG_END,
UX_NULL, 0, UX_NULL, &pima_object_buffer, &object_length);
}
@@ -204,17 +189,17 @@ ULONG actual_flags;
/* Yes, so we need to set the event that advertise the completion of the host request. */
_ux_system_event_flags_set(&pictbridge -> ux_pictbridge_event_flags_group,
- UX_PICTBRIDGE_EVENT_FLAG_STATE_MACHINE_READY,
+ UX_PICTBRIDGE_EVENT_FLAG_STATE_MACHINE_READY,
UX_AND);
}
/* Change state machine to idle. */
pictbridge -> ux_pictbridge_host_client_state_machine &= (UINT)~UX_PICTBRIDGE_STATE_MACHINE_HOST_REQUEST;
- return(UX_ERROR);
+ return(UX_ERROR);
}
- /* Store the length of the new object waiting to be sent out.
+ /* Store the length of the new object waiting to be sent out.
We do not store the length into the object itself since this function is
host\client agnostic. */
pima_object -> ux_host_class_pima_object_length = object_length;
@@ -227,47 +212,47 @@ ULONG actual_flags;
/* Set the object handle. */
object_handle = 1;
-
+
/* Send a script info. */
status = _ux_host_class_pima_object_info_send(pima, pima_session, 0, 0, pima_object);
if (status != UX_SUCCESS)
{
-
+
/* Do we have a pending client event ? */
if (pictbridge -> ux_pictbridge_host_client_state_machine & UX_PICTBRIDGE_STATE_MACHINE_CLIENT_REQUEST_PENDING)
{
/* Yes, so we need to set the event that advertise the completion of the host request. */
- _ux_system_event_flags_set(&pictbridge -> ux_pictbridge_event_flags_group,
- UX_PICTBRIDGE_EVENT_FLAG_STATE_MACHINE_READY,
+ _ux_system_event_flags_set(&pictbridge -> ux_pictbridge_event_flags_group,
+ UX_PICTBRIDGE_EVENT_FLAG_STATE_MACHINE_READY,
UX_AND);
}
-
+
/* Change state machine to idle. */
pictbridge -> ux_pictbridge_host_client_state_machine &= (UINT)~UX_PICTBRIDGE_STATE_MACHINE_HOST_REQUEST;
/* Return status. */
- return(status);
+ return(status);
}
-
+
/* Open the object. */
- status = _ux_host_class_pima_object_open(pima, pima_session,
+ status = _ux_host_class_pima_object_open(pima, pima_session,
object_handle,
pima_object);
if (status != UX_SUCCESS)
{
-
+
/* Do we have a pending client event ? */
if (pictbridge -> ux_pictbridge_host_client_state_machine & UX_PICTBRIDGE_STATE_MACHINE_CLIENT_REQUEST_PENDING)
{
/* Yes, so we need to set the event that advertise the completion of the host request. */
- _ux_system_event_flags_set(&pictbridge -> ux_pictbridge_event_flags_group,
- UX_PICTBRIDGE_EVENT_FLAG_STATE_MACHINE_READY,
+ _ux_system_event_flags_set(&pictbridge -> ux_pictbridge_event_flags_group,
+ UX_PICTBRIDGE_EVENT_FLAG_STATE_MACHINE_READY,
UX_AND);
}
@@ -276,37 +261,37 @@ ULONG actual_flags;
pictbridge -> ux_pictbridge_host_client_state_machine &= (UINT)~UX_PICTBRIDGE_STATE_MACHINE_HOST_REQUEST;
/* Return status. */
- return(status);
+ return(status);
}
-
+
/* Get the object length. */
object_length = pima_object -> ux_host_class_pima_object_compressed_size;
-
+
/* Recall the object buffer address. */
pima_object_buffer = pima_object -> ux_host_class_pima_object_buffer;
-
+
/* Send all the object data. */
while(object_length != 0)
- {
-
+ {
+
/* Calculate what length to request. */
if (object_length > UX_PICTBRIDGE_MAX_PIMA_OBJECT_BUFFER)
-
+
/* Request maximum length. */
requested_length = UX_PICTBRIDGE_MAX_PIMA_OBJECT_BUFFER;
-
+
else
-
+
/* Request remaining length. */
requested_length = object_length;
-
-
+
+
/* Send the object data. */
- status = _ux_host_class_pima_object_send(pima, pima_session, pima_object,
+ status = _ux_host_class_pima_object_send(pima, pima_session, pima_object,
pima_object_buffer, requested_length);
if (status != UX_SUCCESS)
{
-
+
/* Abort the transfer. */
_ux_host_class_pima_object_transfer_abort(pima, pima_session, object_handle, pima_object);
@@ -315,8 +300,8 @@ ULONG actual_flags;
{
/* Yes, so we need to set the event that advertise the completion of the host request. */
- _ux_system_event_flags_set(&pictbridge -> ux_pictbridge_event_flags_group,
- UX_PICTBRIDGE_EVENT_FLAG_STATE_MACHINE_READY,
+ _ux_system_event_flags_set(&pictbridge -> ux_pictbridge_event_flags_group,
+ UX_PICTBRIDGE_EVENT_FLAG_STATE_MACHINE_READY,
UX_AND);
}
@@ -325,28 +310,28 @@ ULONG actual_flags;
pictbridge -> ux_pictbridge_host_client_state_machine &= (UINT)~UX_PICTBRIDGE_STATE_MACHINE_HOST_REQUEST;
/* Return status. */
- return(status);
-
- }
-
+ return(status);
+
+ }
+
/* We have sent some data, update the length remaining. */
object_length -= requested_length;
- }
-
+ }
+
/* Close the object. */
status = _ux_host_class_pima_object_close(pima, pima_session, object_handle, pima_object);
-
+
/* Check the status. */
if (status != UX_SUCCESS)
{
-
+
/* Do we have a pending client event ? */
if (pictbridge -> ux_pictbridge_host_client_state_machine & UX_PICTBRIDGE_STATE_MACHINE_CLIENT_REQUEST_PENDING)
{
/* Yes, so we need to set the event that advertise the completion of the host request. */
- _ux_system_event_flags_set(&pictbridge -> ux_pictbridge_event_flags_group,
- UX_PICTBRIDGE_EVENT_FLAG_STATE_MACHINE_READY,
+ _ux_system_event_flags_set(&pictbridge -> ux_pictbridge_event_flags_group,
+ UX_PICTBRIDGE_EVENT_FLAG_STATE_MACHINE_READY,
UX_AND);
}
@@ -355,21 +340,21 @@ ULONG actual_flags;
pictbridge -> ux_pictbridge_host_client_state_machine &= (UINT)~UX_PICTBRIDGE_STATE_MACHINE_HOST_REQUEST;
/* Return status. */
- return(status);
+ return(status);
}
/* Wait for the response from the device. */
status = _ux_pictbridge_dpshost_response_get(pictbridge);
-
-
+
+
/* Do we have a pending client event ? */
if (pictbridge -> ux_pictbridge_host_client_state_machine & UX_PICTBRIDGE_STATE_MACHINE_CLIENT_REQUEST_PENDING)
{
/* Yes, so we need to set the event that advertise the completion of the host request. */
- _ux_system_event_flags_set(&pictbridge -> ux_pictbridge_event_flags_group,
- UX_PICTBRIDGE_EVENT_FLAG_STATE_MACHINE_READY,
+ _ux_system_event_flags_set(&pictbridge -> ux_pictbridge_event_flags_group,
+ UX_PICTBRIDGE_EVENT_FLAG_STATE_MACHINE_READY,
UX_AND);
}
@@ -378,7 +363,7 @@ ULONG actual_flags;
pictbridge -> ux_pictbridge_host_client_state_machine &= (UINT)~UX_PICTBRIDGE_STATE_MACHINE_HOST_REQUEST;
/* Return status. */
- return(status);
-
+ return(status);
+
}
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 a305d831..657c2349 100644
--- a/common/usbx_pictbridge/src/ux_pictbridge_dpshost_notification_callback.c
+++ b/common/usbx_pictbridge/src/ux_pictbridge_dpshost_notification_callback.c
@@ -1,18 +1,19 @@
/***************************************************************************
- * Copyright (c) 2024 Microsoft Corporation
- *
+ * Copyright (c) 2024 Microsoft Corporation
+ * Copyright (c) 2026-present Eclipse ThreadX contributors
+ *
* This program and the accompanying materials are made available under the
* terms of the MIT License which is available at
* https://opensource.org/licenses/MIT.
- *
+ *
* SPDX-License-Identifier: MIT
**************************************************************************/
/**************************************************************************/
/**************************************************************************/
-/** */
-/** USBX Component */
+/** */
+/** USBX Component */
/** */
/** Pictbridge Application */
/** */
@@ -29,46 +30,35 @@
#include "ux_host_class_pima.h"
-/**************************************************************************/
-/* */
-/* FUNCTION RELEASE */
-/* */
-/* _ux_pictbridge_dpshost_notification_callback PORTABLE C */
+/**************************************************************************/
+/* */
+/* FUNCTION RELEASE */
+/* */
+/* _ux_pictbridge_dpshost_notification_callback PORTABLE C */
/* 6.1.12 */
/* AUTHOR */
/* */
/* Chaoqiong Xiao, Microsoft Corporation */
/* */
/* DESCRIPTION */
-/* */
-/* This function gets a notification of an event and passes it to */
-/* a pictbridge thread. */
-/* */
-/* INPUT */
-/* */
-/* pima_event Event notification structure */
-/* */
-/* OUTPUT */
-/* */
-/* Completion Status */
-/* */
-/* CALLS */
-/* */
-/* */
-/* CALLED BY */
-/* */
-/* user application */
-/* */
-/* RELEASE HISTORY */
-/* */
-/* DATE NAME DESCRIPTION */
-/* */
-/* 05-19-2020 Chaoqiong Xiao Initial Version 6.0 */
-/* 09-30-2020 Chaoqiong Xiao Modified comment(s), */
-/* resulting in version 6.1 */
-/* 07-29-2022 Chaoqiong Xiao Modified comment(s), */
-/* used macros for RTOS calls, */
-/* resulting in version 6.1.12 */
+/* */
+/* This function gets a notification of an event and passes it to */
+/* a pictbridge thread. */
+/* */
+/* INPUT */
+/* */
+/* pima_event Event notification structure */
+/* */
+/* OUTPUT */
+/* */
+/* Completion Status */
+/* */
+/* CALLS */
+/* */
+/* */
+/* CALLED BY */
+/* */
+/* user application */
/* */
/**************************************************************************/
VOID _ux_pictbridge_dpshost_notification_callback(UX_HOST_CLASS_PIMA_EVENT *pima_event)
@@ -81,29 +71,29 @@ UX_PICTBRIDGE_EVENT *pictbridge_event;
/* Get the pointer to the Pima instance. */
pima = pima_event -> ux_host_class_pima_event_pima_instance;
-
+
/* Get the pointer to the Pictbridge application. */
pictbridge = (UX_PICTBRIDGE *) pima -> ux_host_class_pima_application;
/* Compute the next entry in the event array. */
if ((pictbridge -> ux_pictbridge_event_array_head + 1) == pictbridge -> ux_pictbridge_event_array_end)
-
+
/* Start at the beginning of the list. */
pictbridge_next_event = pictbridge -> ux_pictbridge_event_array;
else
/* Point to the next entry in the event array. */
- pictbridge_next_event = pictbridge -> ux_pictbridge_event_array_head + 1;
+ pictbridge_next_event = pictbridge -> ux_pictbridge_event_array_head + 1;
/* Check to see if we can store this event. */
if (pictbridge_next_event == pictbridge -> ux_pictbridge_event_array_tail)
-
+
/* No place to store this event, throw it away. */
return;
/* Current storage is in the current head. */
pictbridge_event = pictbridge -> ux_pictbridge_event_array_head;
-
+
/* Store the event in the pictbridge event queue. */
pictbridge_event -> ux_pictbridge_event_code = pima_event -> ux_host_class_pima_event_code;
pictbridge_event -> ux_pictbridge_event_parameter_1 = pima_event -> ux_host_class_pima_event_parameter_1;
@@ -115,9 +105,9 @@ UX_PICTBRIDGE_EVENT *pictbridge_event;
/* Wake up the Pictbridge notification handler thread. */
_ux_system_semaphore_put(&pictbridge -> ux_pictbridge_notification_semaphore);
-
+
/* We are done. */
return;
-
+
}
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 2cbe4b2e..e44c4e2c 100644
--- a/common/usbx_pictbridge/src/ux_pictbridge_dpshost_object_get.c
+++ b/common/usbx_pictbridge/src/ux_pictbridge_dpshost_object_get.c
@@ -1,18 +1,19 @@
/***************************************************************************
- * Copyright (c) 2024 Microsoft Corporation
- *
+ * Copyright (c) 2024 Microsoft Corporation
+ * Copyright (c) 2026-present Eclipse ThreadX contributors
+ *
* This program and the accompanying materials are made available under the
* terms of the MIT License which is available at
* https://opensource.org/licenses/MIT.
- *
+ *
* SPDX-License-Identifier: MIT
**************************************************************************/
/**************************************************************************/
/**************************************************************************/
-/** */
-/** USBX Component */
+/** */
+/** USBX Component */
/** */
/** Pictbridge Application */
/** */
@@ -29,46 +30,35 @@
#include "ux_host_class_pima.h"
-/**************************************************************************/
-/* */
-/* FUNCTION RELEASE */
-/* */
-/* _ux_pictbridge_dpshost_object_get PORTABLE C */
+/**************************************************************************/
+/* */
+/* FUNCTION RELEASE */
+/* */
+/* _ux_pictbridge_dpshost_object_get PORTABLE C */
/* 6.1.12 */
/* AUTHOR */
/* */
/* Chaoqiong Xiao, Microsoft Corporation */
/* */
/* DESCRIPTION */
-/* */
-/* This function obtains an object and execute its script. */
-/* */
-/* INPUT */
-/* */
-/* pictbridge Pictbridge instance */
-/* object_handle Object handle */
-/* */
-/* OUTPUT */
-/* */
-/* Completion Status */
-/* */
-/* CALLS */
-/* */
-/* */
-/* CALLED BY */
-/* */
-/* _ux_pictbridge_dpshost_thread */
-/* */
-/* RELEASE HISTORY */
-/* */
-/* DATE NAME DESCRIPTION */
-/* */
-/* 05-19-2020 Chaoqiong Xiao Initial Version 6.0 */
-/* 09-30-2020 Chaoqiong Xiao Modified comment(s), */
-/* resulting in version 6.1 */
-/* 07-29-2022 Chaoqiong Xiao Modified comment(s), */
-/* fixed string length check, */
-/* resulting in version 6.1.12 */
+/* */
+/* This function obtains an object and execute its script. */
+/* */
+/* INPUT */
+/* */
+/* pictbridge Pictbridge instance */
+/* object_handle Object handle */
+/* */
+/* OUTPUT */
+/* */
+/* Completion Status */
+/* */
+/* CALLS */
+/* */
+/* */
+/* CALLED BY */
+/* */
+/* _ux_pictbridge_dpshost_thread */
/* */
/**************************************************************************/
UINT _ux_pictbridge_dpshost_object_get(UX_PICTBRIDGE *pictbridge, ULONG object_handle)
@@ -86,7 +76,7 @@ UINT length, length1;
/* Get the pima instance from the pictbridge container. */
pima = (UX_HOST_CLASS_PIMA *) pictbridge -> ux_pictbridge_pima;
-
+
/* And now the session since we use it. */
pima_session = (UX_HOST_CLASS_PIMA_SESSION *) pictbridge -> ux_pictbridge_session;
@@ -94,17 +84,17 @@ UINT length, length1;
pima_object = (UX_HOST_CLASS_PIMA_OBJECT *) pictbridge -> ux_pictbridge_object_host;
/* Get the object info structure. */
- status = _ux_host_class_pima_object_info_get(pima, pima_session,
+ status = _ux_host_class_pima_object_info_get(pima, pima_session,
object_handle, pima_object);
if (status != UX_SUCCESS)
{
/* Return an error. */
return(UX_PICTBRIDGE_ERROR_INVALID_OBJECT_HANDLE);
- }
+ }
- /* Check if this is a script. If the object is not a script or does not contain the
- File Name we expect, we ignore it. */
+ /* Check if this is a script. If the object is not a script or does not contain the
+ File Name we expect, we ignore it. */
if (pima_object -> ux_host_class_pima_object_format == UX_HOST_CLASS_PIMA_OFC_SCRIPT)
{
@@ -124,7 +114,7 @@ UINT length, length1;
/* Get the file name in a ascii format (with null-terminator). */
_ux_utility_unicode_to_string(pima_object -> ux_host_class_pima_object_filename, object_file_name);
-
+
/* So far, the length of name of the files are the same.
Compare names now (since length is same just compare without null-terminator). */
if (_ux_utility_memory_compare(_ux_pictbridge_drequest_name, object_file_name,
@@ -134,107 +124,107 @@ UINT length, length1;
/* Yes this is a script. Get the entire object in memory. */
/* Get script length from the object info. */
object_length = pima_object -> ux_host_class_pima_object_compressed_size;
-
+
/* Check for overflow. */
if (object_length > UX_PICTBRIDGE_MAX_PIMA_OBJECT_BUFFER)
return(UX_PICTBRIDGE_ERROR_SCRIPT_BUFFER_OVERFLOW);
-
+
/* Open the object. */
status = _ux_host_class_pima_object_open(pima, pima_session, object_handle, pima_object);
-
+
/* Check status. */
if (status != UX_SUCCESS)
return(status);
-
+
/* Set the object buffer pointer. */
object_buffer = pima_object -> ux_host_class_pima_object_buffer;
-
+
/* Obtain all the object data. */
while(object_length != 0)
- {
-
+ {
+
/* Calculate what length to request. */
if (object_length > UX_PICTBRIDGE_MAX_PIMA_OBJECT_BUFFER)
-
+
/* Request maximum length. */
requested_length = UX_PICTBRIDGE_MAX_PIMA_OBJECT_BUFFER;
-
+
else
-
+
/* Request remaining length. */
requested_length = object_length;
-
+
/* Get the object data. */
- status = _ux_host_class_pima_object_get(pima, pima_session, object_handle, pima_object,
+ status = _ux_host_class_pima_object_get(pima, pima_session, object_handle, pima_object,
object_buffer, requested_length, &actual_length);
if (status != UX_SUCCESS)
{
-
+
/* We had a problem, abort the transfer. */
_ux_host_class_pima_object_transfer_abort(pima, pima_session, object_handle, pima_object);
-
+
/* And close the object. */
_ux_host_class_pima_object_close(pima, pima_session, object_handle, pima_object);
-
+
return(status);
- }
-
+ }
+
/* We have received some data, update the length remaining. */
object_length -= actual_length;
-
+
/* Update the buffer address. */
object_buffer += actual_length;
- }
-
+ }
+
/* Close the object. */
status = _ux_host_class_pima_object_close(pima, pima_session, object_handle, pima_object);
-
+
/* Check the error. */
if (status != UX_SUCCESS)
return(UX_PICTBRIDGE_ERROR_INVALID_OBJECT_HANDLE);
-
+
/* We now have the entire script into memory. Parse the object and execute the script. */
status = _ux_pictbridge_object_parse(pictbridge, pima_object -> ux_host_class_pima_object_buffer,
pima_object -> ux_host_class_pima_object_compressed_size);
-
+
/* Analyze the status from the parsing and determine the result code to be sent back. */
switch (status)
- {
+ {
case UX_SUCCESS :
-
+
/* Set the result code to OK. */
pictbridge -> ux_pictbridge_operation_result = UX_PICTBRIDGE_ACTION_RESULT_OK;
break;
-
+
case UX_PICTBRIDGE_ERROR_SCRIPT_SYNTAX_ERROR :
-
+
/* Set the result code to Error. */
pictbridge -> ux_pictbridge_operation_result = UX_PICTBRIDGE_ACTION_RESULT_NOT_SUPPORTED_IP;
break;
-
+
case UX_PICTBRIDGE_ERROR_PARAMETER_UNKNOWN :
-
+
/* Set the result code to Error. */
pictbridge -> ux_pictbridge_operation_result = UX_PICTBRIDGE_ACTION_RESULT_NOT_SUPPORTED_UP;
break;
-
+
case UX_PICTBRIDGE_ERROR_PARAMETER_MISSING :
-
+
/* Set the result code to Error. */
pictbridge -> ux_pictbridge_operation_result = UX_PICTBRIDGE_ACTION_RESULT_NOT_SUPPORTED_MP;
break;
-
+
default :
-
+
/* Set the result code to Error. */
pictbridge -> ux_pictbridge_operation_result = UX_PICTBRIDGE_ACTION_RESULT_NOT_SUPPORTED_DEFAULT;
break;
- }
-
- /* We have completed the parsing of the XML object. We will send an object back to the client.
+ }
+
+ /* We have completed the parsing of the XML object. We will send an object back to the client.
Generate the output report. */
status = _ux_pictbridge_dpshost_output_object_create(pictbridge);
-
+
/* Get the length of the object and store it into the object data set. */
pima_object -> ux_host_class_pima_object_compressed_size = pima_object -> ux_host_class_pima_object_length;
@@ -245,63 +235,63 @@ UINT length, length1;
status = _ux_host_class_pima_object_info_send(pima, pima_session, 0, 0, pima_object);
if (status != UX_SUCCESS)
return(status);
-
+
/* Open the object. */
- status = _ux_host_class_pima_object_open(pima, pima_session,
+ status = _ux_host_class_pima_object_open(pima, pima_session,
object_handle,
pima_object);
if (status != UX_SUCCESS)
return(status);
-
+
/* Get the object length. */
object_length = pima_object -> ux_host_class_pima_object_compressed_size;
-
+
/* Recall the object buffer address. */
object_buffer = pima_object -> ux_host_class_pima_object_buffer;
-
+
/* Send all the object data. */
while(object_length != 0)
- {
-
+ {
+
/* Calculate what length to request. */
if (object_length > UX_PICTBRIDGE_MAX_PIMA_OBJECT_BUFFER)
-
+
/* Request maximum length. */
requested_length = UX_PICTBRIDGE_MAX_PIMA_OBJECT_BUFFER;
-
+
else
-
+
/* Request remaining length. */
requested_length = object_length;
-
-
+
+
/* Send the object data. */
- status = _ux_host_class_pima_object_send(pima, pima_session, pima_object,
+ status = _ux_host_class_pima_object_send(pima, pima_session, pima_object,
object_buffer, requested_length);
if (status != UX_SUCCESS)
{
-
+
/* Abort the transfer. */
_ux_host_class_pima_object_transfer_abort(pima, pima_session, object_handle, pima_object);
-
+
return(status);
- }
-
+ }
+
/* We have sent some data, update the length remaining. */
object_length -= requested_length;
- }
-
+ }
+
/* Close the object. */
status = _ux_host_class_pima_object_close(pima, pima_session, object_handle, pima_object);
-
+
/* Check the status. */
if (status != UX_SUCCESS)
return(status);
}
- }
+ }
}
}
-
+
return(UX_SUCCESS);
}
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 d7c259df..b8bc8f28 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
@@ -1,18 +1,19 @@
/***************************************************************************
- * Copyright (c) 2024 Microsoft Corporation
- *
+ * Copyright (c) 2024 Microsoft Corporation
+ * Copyright (c) 2026-present Eclipse ThreadX contributors
+ *
* This program and the accompanying materials are made available under the
* terms of the MIT License which is available at
* https://opensource.org/licenses/MIT.
- *
+ *
* SPDX-License-Identifier: MIT
**************************************************************************/
/**************************************************************************/
/**************************************************************************/
-/** */
-/** USBX Component */
+/** */
+/** USBX Component */
/** */
/** Pictbridge Application */
/** */
@@ -29,58 +30,47 @@
#include "ux_host_class_pima.h"
-/**************************************************************************/
-/* */
-/* FUNCTION RELEASE */
+/**************************************************************************/
+/* */
+/* FUNCTION RELEASE */
/* */
/* _ux_pictbridge_dpshost_output_object_configure_print_service */
-/* PORTABLE C */
+/* PORTABLE C */
/* 6.1.11 */
/* AUTHOR */
/* */
/* Chaoqiong Xiao, Microsoft Corporation */
/* */
/* DESCRIPTION */
-/* */
-/* This function creates the tag lines of the configure_print_service */
-/* request. */
-/* */
-/* INPUT */
-/* */
-/* pictbridge Pictbridge instance */
+/* */
+/* This function creates the tag lines of the configure_print_service */
+/* request. */
+/* */
+/* INPUT */
+/* */
+/* pictbridge Pictbridge instance */
/* pima_object_buffer Pointer to object buffer */
/* object_length Length of the object */
/* pima_object_buffer_updated Updated Address of the object */
/* object_length_updated Updated length */
/* */
-/* */
-/* OUTPUT */
-/* */
-/* Completion Status */
-/* */
-/* CALLS */
-/* */
-/* */
-/* CALLED BY */
-/* */
-/* _ux_pictbridge_dpshost_object_get */
-/* */
-/* RELEASE HISTORY */
-/* */
-/* DATE NAME DESCRIPTION */
-/* */
-/* 05-19-2020 Chaoqiong Xiao Initial Version 6.0 */
-/* 09-30-2020 Chaoqiong Xiao Modified comment(s), */
-/* resulting in version 6.1 */
-/* 04-25-2022 Yajun Xia Modified comment(s), */
-/* internal clean up, */
-/* resulting in version 6.1.11 */
+/* */
+/* OUTPUT */
+/* */
+/* Completion Status */
+/* */
+/* CALLS */
+/* */
+/* */
+/* CALLED BY */
+/* */
+/* _ux_pictbridge_dpshost_object_get */
/* */
/**************************************************************************/
-UINT _ux_pictbridge_dpshost_output_object_configure_print_service(UX_PICTBRIDGE *pictbridge,
- UCHAR *pima_object_buffer,
- ULONG object_length,
- UCHAR **pima_object_buffer_updated,
+UINT _ux_pictbridge_dpshost_output_object_configure_print_service(UX_PICTBRIDGE *pictbridge,
+ UCHAR *pima_object_buffer,
+ ULONG object_length,
+ UCHAR **pima_object_buffer_updated,
ULONG *object_length_updated)
{
@@ -88,21 +78,21 @@ UINT status;
/* Add the line */
- status = _ux_pictbridge_object_tag_line_add(pima_object_buffer, object_length, _ux_pictbridge_xml_tag_line_configureprintservice,
+ status = _ux_pictbridge_object_tag_line_add(pima_object_buffer, object_length, _ux_pictbridge_xml_tag_line_configureprintservice,
UX_PICTBRIDGE_TAG_FLAG_BEGIN | UX_PICTBRIDGE_TAG_FLAG_FORCE_LF,
UX_NULL, 0, UX_NULL, &pima_object_buffer, &object_length);
if (status != UX_SUCCESS)
return(status);
/* Add the line xxxxxxxx */
- status = _ux_pictbridge_object_tag_line_add(pima_object_buffer, object_length, _ux_pictbridge_xml_tag_line_printserviceavailable,
+ status = _ux_pictbridge_object_tag_line_add(pima_object_buffer, object_length, _ux_pictbridge_xml_tag_line_printserviceavailable,
UX_PICTBRIDGE_TAG_FLAG_BEGIN | UX_PICTBRIDGE_TAG_FLAG_END | UX_PICTBRIDGE_TAG_FLAG_VARIABLE_HEXA,
UX_NULL, 0, (VOID *)(ALIGN_TYPE) pictbridge -> ux_pictbridge_dpslocal.ux_pictbridge_devinfo_print_service_available, &pima_object_buffer, &object_length);
if (status != UX_SUCCESS)
return(status);
/* Add the line major_minor major_minor */
- status = _ux_pictbridge_object_tag_line_add(pima_object_buffer, object_length, _ux_pictbridge_xml_tag_line_dpsversions,
+ status = _ux_pictbridge_object_tag_line_add(pima_object_buffer, object_length, _ux_pictbridge_xml_tag_line_dpsversions,
UX_PICTBRIDGE_TAG_FLAG_BEGIN | UX_PICTBRIDGE_TAG_FLAG_END | UX_PICTBRIDGE_TAG_FLAG_VARIABLE_ARRAY_MAJOR_MINOR,
UX_NULL, 0, (VOID *)(ALIGN_TYPE) pictbridge -> ux_pictbridge_dpslocal.ux_pictbridge_devinfo_dpsversions, &pima_object_buffer, &object_length);
if (status != UX_SUCCESS)
@@ -110,7 +100,7 @@ UINT status;
/* Add the line ascii_string */
- status = _ux_pictbridge_object_tag_line_add(pima_object_buffer, object_length, _ux_pictbridge_xml_tag_line_vendorname,
+ status = _ux_pictbridge_object_tag_line_add(pima_object_buffer, object_length, _ux_pictbridge_xml_tag_line_vendorname,
UX_PICTBRIDGE_TAG_FLAG_BEGIN | UX_PICTBRIDGE_TAG_FLAG_END | UX_PICTBRIDGE_TAG_FLAG_VARIABLE_STRING,
UX_NULL, 0, (VOID *)(ALIGN_TYPE) pictbridge -> ux_pictbridge_dpslocal.ux_pictbridge_devinfo_product_name, &pima_object_buffer, &object_length);
if (status != UX_SUCCESS)
@@ -118,15 +108,15 @@ UINT status;
/* Add the line major_minor */
- status = _ux_pictbridge_object_tag_line_add(pima_object_buffer, object_length, _ux_pictbridge_xml_tag_line_vendorspecificversion,
+ status = _ux_pictbridge_object_tag_line_add(pima_object_buffer, object_length, _ux_pictbridge_xml_tag_line_vendorspecificversion,
UX_PICTBRIDGE_TAG_FLAG_BEGIN | UX_PICTBRIDGE_TAG_FLAG_END | UX_PICTBRIDGE_TAG_FLAG_VARIABLE_MAJOR_MINOR,
UX_NULL, 0, (VOID *)(ALIGN_TYPE) pictbridge -> ux_pictbridge_dpslocal.ux_pictbridge_devinfo_vendor_specific_version, &pima_object_buffer, &object_length);
if (status != UX_SUCCESS)
return(status);
-
+
/* Add the line ascii_string */
- status = _ux_pictbridge_object_tag_line_add(pima_object_buffer, object_length, _ux_pictbridge_xml_tag_line_productname,
+ status = _ux_pictbridge_object_tag_line_add(pima_object_buffer, object_length, _ux_pictbridge_xml_tag_line_productname,
UX_PICTBRIDGE_TAG_FLAG_BEGIN | UX_PICTBRIDGE_TAG_FLAG_END | UX_PICTBRIDGE_TAG_FLAG_VARIABLE_STRING,
UX_NULL, 0, (VOID *)(ALIGN_TYPE) pictbridge -> ux_pictbridge_dpslocal.ux_pictbridge_devinfo_product_name, &pima_object_buffer, &object_length);
if (status != UX_SUCCESS)
@@ -134,7 +124,7 @@ UINT status;
/* Add the line ascii_string */
- status = _ux_pictbridge_object_tag_line_add(pima_object_buffer, object_length, _ux_pictbridge_xml_tag_line_serialno,
+ status = _ux_pictbridge_object_tag_line_add(pima_object_buffer, object_length, _ux_pictbridge_xml_tag_line_serialno,
UX_PICTBRIDGE_TAG_FLAG_BEGIN | UX_PICTBRIDGE_TAG_FLAG_END | UX_PICTBRIDGE_TAG_FLAG_VARIABLE_STRING,
UX_NULL, 0, (VOID *)(ALIGN_TYPE) pictbridge -> ux_pictbridge_dpslocal.ux_pictbridge_devinfo_serial_no, &pima_object_buffer, &object_length);
if (status != UX_SUCCESS)
@@ -142,7 +132,7 @@ UINT status;
/* Add the line */
- status = _ux_pictbridge_object_tag_line_add(pima_object_buffer, object_length, _ux_pictbridge_xml_tag_line_configureprintservice,
+ status = _ux_pictbridge_object_tag_line_add(pima_object_buffer, object_length, _ux_pictbridge_xml_tag_line_configureprintservice,
UX_PICTBRIDGE_TAG_FLAG_END,
UX_NULL, 0, UX_NULL, &pima_object_buffer, &object_length);
if (status != UX_SUCCESS)
@@ -150,11 +140,11 @@ UINT status;
/* Update the caller's object position. */
*pima_object_buffer_updated = pima_object_buffer;
-
+
/* Update the caller's object length . */
*object_length_updated = object_length;
-
+
/* Return completion status. */
- return(UX_SUCCESS);
+ return(UX_SUCCESS);
}
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 009dd76f..599394e5 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
@@ -1,18 +1,19 @@
/***************************************************************************
- * Copyright (c) 2024 Microsoft Corporation
- *
+ * Copyright (c) 2024 Microsoft Corporation
+ * Copyright (c) 2026-present Eclipse ThreadX contributors
+ *
* This program and the accompanying materials are made available under the
* terms of the MIT License which is available at
* https://opensource.org/licenses/MIT.
- *
+ *
* SPDX-License-Identifier: MIT
**************************************************************************/
/**************************************************************************/
/**************************************************************************/
-/** */
-/** USBX Component */
+/** */
+/** USBX Component */
/** */
/** Pictbridge Application */
/** */
@@ -29,45 +30,35 @@
#include "ux_host_class_pima.h"
-/**************************************************************************/
-/* */
-/* FUNCTION RELEASE */
-/* */
-/* _ux_pictbridge_dpshost_output_object_create PORTABLE C */
+/**************************************************************************/
+/* */
+/* FUNCTION RELEASE */
+/* */
+/* _ux_pictbridge_dpshost_output_object_create PORTABLE C */
/* 6.1 */
/* AUTHOR */
/* */
/* Chaoqiong Xiao, Microsoft Corporation */
/* */
/* DESCRIPTION */
-/* */
-/* This function creates an output report based on the parsing of */
-/* a previous input object. */
-/* */
-/* INPUT */
-/* */
-/* pictbridge Pictbridge instance */
-/* */
-/* OUTPUT */
-/* */
-/* Completion Status */
-/* */
-/* CALLS */
-/* */
-/* */
-/* CALLED BY */
-/* */
-/* _ux_pictbridge_dpshost_object_get */
-/* */
-/* RELEASE HISTORY */
-/* */
-/* DATE NAME DESCRIPTION */
-/* */
-/* 05-19-2020 Chaoqiong Xiao Initial Version 6.0 */
-/* 09-30-2020 Chaoqiong Xiao Modified comment(s), */
-/* verified memset and memcpy */
-/* cases, */
-/* resulting in version 6.1 */
+/* */
+/* This function creates an output report based on the parsing of */
+/* a previous input object. */
+/* */
+/* INPUT */
+/* */
+/* pictbridge Pictbridge instance */
+/* */
+/* OUTPUT */
+/* */
+/* Completion Status */
+/* */
+/* CALLS */
+/* */
+/* */
+/* CALLED BY */
+/* */
+/* _ux_pictbridge_dpshost_object_get */
/* */
/**************************************************************************/
UINT _ux_pictbridge_dpshost_output_object_create(UX_PICTBRIDGE *pictbridge)
@@ -82,52 +73,52 @@ UX_HOST_CLASS_PIMA_OBJECT *pima_object;
/* And its buffer address. */
pima_object_buffer = pima_object -> ux_host_class_pima_object_buffer;
-
+
/* Reset the object length. */
object_length = 0;
-
+
/* Clear the object memory buffer. */
_ux_utility_memory_set(pima_object_buffer, 0, UX_PICTBRIDGE_MAX_PIMA_OBJECT_BUFFER); /* Use case of memset is verified. */
/* Add the line */
- status = _ux_pictbridge_object_tag_line_add(pima_object_buffer, object_length, _ux_pictbridge_xml_tag_line_xmlversion,
+ status = _ux_pictbridge_object_tag_line_add(pima_object_buffer, object_length, _ux_pictbridge_xml_tag_line_xmlversion,
UX_PICTBRIDGE_TAG_FLAG_BEGIN | UX_PICTBRIDGE_TAG_FLAG_FORCE_LF,
UX_NULL, 0, UX_NULL, &pima_object_buffer, &object_length);
if (status != UX_SUCCESS)
return(status);
/* Add the line */
- status = _ux_pictbridge_object_tag_line_add(pima_object_buffer, object_length, _ux_pictbridge_xml_tag_line_dpsxmlns,
+ status = _ux_pictbridge_object_tag_line_add(pima_object_buffer, object_length, _ux_pictbridge_xml_tag_line_dpsxmlns,
UX_PICTBRIDGE_TAG_FLAG_BEGIN | UX_PICTBRIDGE_TAG_FLAG_FORCE_LF,
UX_NULL, 0, UX_NULL, &pima_object_buffer, &object_length);
if (status != UX_SUCCESS)
return(status);
/* Add the line */
- status = _ux_pictbridge_object_tag_line_add(pima_object_buffer, object_length, _ux_pictbridge_xml_tag_line_output,
+ status = _ux_pictbridge_object_tag_line_add(pima_object_buffer, object_length, _ux_pictbridge_xml_tag_line_output,
UX_PICTBRIDGE_TAG_FLAG_END,
UX_NULL, 0, UX_NULL, &pima_object_buffer, &object_length);
if (status != UX_SUCCESS)
return(status);
/* Add the line */
- status = _ux_pictbridge_object_tag_line_add(pima_object_buffer, object_length, _ux_pictbridge_xml_tag_line_dps,
+ status = _ux_pictbridge_object_tag_line_add(pima_object_buffer, object_length, _ux_pictbridge_xml_tag_line_dps,
UX_PICTBRIDGE_TAG_FLAG_END,
UX_NULL, 0, UX_NULL, &pima_object_buffer, &object_length);
if (status != UX_SUCCESS)
return(status);
- /* Store the length of the new object waiting to be sent out.
+ /* Store the length of the new object waiting to be sent out.
We do not store the length into the object itself since this function is
host\client agnostic. */
pima_object -> ux_host_class_pima_object_length = object_length;
-
+
/* Return completion status. */
- return(status);
+ return(status);
}
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 95027b04..f84118d5 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
@@ -1,18 +1,19 @@
/***************************************************************************
- * Copyright (c) 2024 Microsoft Corporation
- *
+ * Copyright (c) 2024 Microsoft Corporation
+ * Copyright (c) 2026-present Eclipse ThreadX contributors
+ *
* This program and the accompanying materials are made available under the
* terms of the MIT License which is available at
* https://opensource.org/licenses/MIT.
- *
+ *
* SPDX-License-Identifier: MIT
**************************************************************************/
/**************************************************************************/
/**************************************************************************/
-/** */
-/** USBX Component */
+/** */
+/** USBX Component */
/** */
/** Pictbridge Application */
/** */
@@ -29,60 +30,52 @@
#include "ux_host_class_pima.h"
-/**************************************************************************/
-/* */
-/* FUNCTION RELEASE */
-/* */
-/* _ux_pictbridge_dpshost_output_object_get_capability PORTABLE C */
+/**************************************************************************/
+/* */
+/* FUNCTION RELEASE */
+/* */
+/* _ux_pictbridge_dpshost_output_object_get_capability PORTABLE C */
/* 6.1 */
/* AUTHOR */
/* */
/* Chaoqiong Xiao, Microsoft Corporation */
/* */
/* DESCRIPTION */
-/* */
-/* This function creates the tag lines of the get_capability request */
-/* */
-/* INPUT */
-/* */
-/* pictbridge Pictbridge instance */
+/* */
+/* This function creates the tag lines of the get_capability request */
+/* */
+/* INPUT */
+/* */
+/* pictbridge Pictbridge instance */
/* pima_object_buffer Pointer to object buffer */
/* object_length Length of the object */
/* pima_object_buffer_updated Updated Address of the object */
/* object_length_updated Updated length */
/* */
-/* */
-/* OUTPUT */
-/* */
-/* Completion Status */
-/* */
-/* CALLS */
-/* */
-/* */
-/* CALLED BY */
-/* */
-/* _ux_pictbridge_dpshost_object_get */
-/* */
-/* RELEASE HISTORY */
-/* */
-/* DATE NAME DESCRIPTION */
-/* */
-/* 05-19-2020 Chaoqiong Xiao Initial Version 6.0 */
-/* 09-30-2020 Chaoqiong Xiao Modified comment(s), */
-/* resulting in version 6.1 */
+/* */
+/* OUTPUT */
+/* */
+/* Completion Status */
+/* */
+/* CALLS */
+/* */
+/* */
+/* CALLED BY */
+/* */
+/* _ux_pictbridge_dpshost_object_get */
/* */
/**************************************************************************/
-UINT _ux_pictbridge_dpshost_output_object_get_capability(UX_PICTBRIDGE *pictbridge,
- UCHAR *pima_object_buffer,
- ULONG object_length,
- UCHAR **pima_object_buffer_updated,
+UINT _ux_pictbridge_dpshost_output_object_get_capability(UX_PICTBRIDGE *pictbridge,
+ UCHAR *pima_object_buffer,
+ ULONG object_length,
+ UCHAR **pima_object_buffer_updated,
ULONG *object_length_updated)
{
UINT status;
/* Add the line */
- status = _ux_pictbridge_object_tag_line_add(pima_object_buffer, object_length, _ux_pictbridge_xml_tag_line_getcapability,
+ status = _ux_pictbridge_object_tag_line_add(pima_object_buffer, object_length, _ux_pictbridge_xml_tag_line_getcapability,
UX_PICTBRIDGE_TAG_FLAG_BEGIN | UX_PICTBRIDGE_TAG_FLAG_FORCE_LF,
UX_NULL, 0, UX_NULL, &pima_object_buffer, &object_length);
if (status != UX_SUCCESS)
@@ -90,7 +83,7 @@ UINT status;
/* Add the line */
- status = _ux_pictbridge_object_tag_line_add(pima_object_buffer, object_length, _ux_pictbridge_xml_tag_line_capability,
+ status = _ux_pictbridge_object_tag_line_add(pima_object_buffer, object_length, _ux_pictbridge_xml_tag_line_capability,
UX_PICTBRIDGE_TAG_FLAG_BEGIN | UX_PICTBRIDGE_TAG_FLAG_FORCE_LF,
UX_NULL, 0, UX_NULL, &pima_object_buffer, &object_length);
if (status != UX_SUCCESS)
@@ -100,7 +93,7 @@ UINT status;
if (pictbridge -> ux_pictbridge_input_tags & UX_PICTBRIDGE_IR_GC_QUALITIES)
{
/* Add the line xxxxxxxx */
- status = _ux_pictbridge_object_tag_line_add(pima_object_buffer, object_length, _ux_pictbridge_xml_tag_line_qualities,
+ status = _ux_pictbridge_object_tag_line_add(pima_object_buffer, object_length, _ux_pictbridge_xml_tag_line_qualities,
UX_PICTBRIDGE_TAG_FLAG_BEGIN | UX_PICTBRIDGE_TAG_FLAG_END | UX_PICTBRIDGE_TAG_FLAG_VARIABLE_ARRAY_HEXA,
UX_NULL, 0, (VOID *) &pictbridge -> ux_pictbridge_dpslocal.ux_pictbridge_devinfo_qualities, &pima_object_buffer, &object_length);
if (status != UX_SUCCESS)
@@ -111,7 +104,7 @@ UINT status;
if (pictbridge -> ux_pictbridge_input_tags & UX_PICTBRIDGE_IR_GC_PAPER_SIZES)
{
/* Add the line xxxxxxxx */
- status = _ux_pictbridge_object_tag_line_add(pima_object_buffer, object_length, _ux_pictbridge_xml_tag_line_papersizes,
+ status = _ux_pictbridge_object_tag_line_add(pima_object_buffer, object_length, _ux_pictbridge_xml_tag_line_papersizes,
UX_PICTBRIDGE_TAG_FLAG_BEGIN | UX_PICTBRIDGE_TAG_FLAG_END | UX_PICTBRIDGE_TAG_FLAG_VARIABLE_ARRAY_HEXA,
UX_NULL, 0, (VOID *) &pictbridge -> ux_pictbridge_dpslocal.ux_pictbridge_devinfo_papersizes, &pima_object_buffer, &object_length);
if (status != UX_SUCCESS)
@@ -126,28 +119,28 @@ UINT status;
if (pictbridge -> ux_pictbridge_dpsclient.ux_pictbridge_devinfo_papertypes_papersize != 0)
/* Add the line xxxxxxxx yyyyyyyy */
- status = _ux_pictbridge_object_tag_line_add(pima_object_buffer, object_length, _ux_pictbridge_xml_tag_line_papertypes,
+ status = _ux_pictbridge_object_tag_line_add(pima_object_buffer, object_length, _ux_pictbridge_xml_tag_line_papertypes,
UX_PICTBRIDGE_TAG_FLAG_BEGIN | UX_PICTBRIDGE_TAG_FLAG_END | UX_PICTBRIDGE_TAG_FLAG_VARIABLE_ARRAY_HEXA,
- _ux_pictbridge_xml_variable_papersize, pictbridge -> ux_pictbridge_dpsclient.ux_pictbridge_devinfo_papertypes_papersize,
+ _ux_pictbridge_xml_variable_papersize, pictbridge -> ux_pictbridge_dpsclient.ux_pictbridge_devinfo_papertypes_papersize,
(VOID *) &pictbridge -> ux_pictbridge_dpslocal.ux_pictbridge_devinfo_papertypes, &pima_object_buffer, &object_length);
-
+
else
-
+
/* Add the line xxxxxxxx yyyyyyyy */
- status = _ux_pictbridge_object_tag_line_add(pima_object_buffer, object_length, _ux_pictbridge_xml_tag_line_papertypes,
+ status = _ux_pictbridge_object_tag_line_add(pima_object_buffer, object_length, _ux_pictbridge_xml_tag_line_papertypes,
UX_PICTBRIDGE_TAG_FLAG_BEGIN | UX_PICTBRIDGE_TAG_FLAG_END | UX_PICTBRIDGE_TAG_FLAG_VARIABLE_ARRAY_HEXA,
- UX_NULL, 0,
+ UX_NULL, 0,
(VOID *) &pictbridge -> ux_pictbridge_dpslocal.ux_pictbridge_devinfo_papertypes, &pima_object_buffer, &object_length);
if (status != UX_SUCCESS)
return(status);
}
-
+
/* Parse the tag code that was memorized during the input. */
if (pictbridge -> ux_pictbridge_input_tags & UX_PICTBRIDGE_IR_GC_FILE_TYPES)
{
/* Add the line xxxxxxxx */
- status = _ux_pictbridge_object_tag_line_add(pima_object_buffer, object_length, _ux_pictbridge_xml_tag_line_filetypes,
+ status = _ux_pictbridge_object_tag_line_add(pima_object_buffer, object_length, _ux_pictbridge_xml_tag_line_filetypes,
UX_PICTBRIDGE_TAG_FLAG_BEGIN | UX_PICTBRIDGE_TAG_FLAG_END | UX_PICTBRIDGE_TAG_FLAG_VARIABLE_ARRAY_HEXA,
UX_NULL, 0, (VOID *) &pictbridge -> ux_pictbridge_dpslocal.ux_pictbridge_devinfo_filetypes, &pima_object_buffer, &object_length);
if (status != UX_SUCCESS)
@@ -158,7 +151,7 @@ UINT status;
if (pictbridge -> ux_pictbridge_input_tags & UX_PICTBRIDGE_IR_GC_DATE_PRINTS)
{
/* Add the line xxxxxxxx */
- status = _ux_pictbridge_object_tag_line_add(pima_object_buffer, object_length, _ux_pictbridge_xml_tag_line_dateprints,
+ status = _ux_pictbridge_object_tag_line_add(pima_object_buffer, object_length, _ux_pictbridge_xml_tag_line_dateprints,
UX_PICTBRIDGE_TAG_FLAG_BEGIN | UX_PICTBRIDGE_TAG_FLAG_END | UX_PICTBRIDGE_TAG_FLAG_VARIABLE_ARRAY_HEXA,
UX_NULL, 0, (VOID *) pictbridge -> ux_pictbridge_dpslocal.ux_pictbridge_devinfo_dateprints, &pima_object_buffer, &object_length);
if (status != UX_SUCCESS)
@@ -170,7 +163,7 @@ UINT status;
if (pictbridge -> ux_pictbridge_input_tags & UX_PICTBRIDGE_IR_GC_FILE_NAME_PRINTS)
{
/* Add the line xxxxxxxx */
- status = _ux_pictbridge_object_tag_line_add(pima_object_buffer, object_length, _ux_pictbridge_xml_tag_line_filenameprints,
+ status = _ux_pictbridge_object_tag_line_add(pima_object_buffer, object_length, _ux_pictbridge_xml_tag_line_filenameprints,
UX_PICTBRIDGE_TAG_FLAG_BEGIN | UX_PICTBRIDGE_TAG_FLAG_END | UX_PICTBRIDGE_TAG_FLAG_VARIABLE_ARRAY_HEXA,
UX_NULL, 0, (VOID *) pictbridge -> ux_pictbridge_dpslocal.ux_pictbridge_devinfo_filenameprints, &pima_object_buffer, &object_length);
if (status != UX_SUCCESS)
@@ -181,7 +174,7 @@ UINT status;
if (pictbridge -> ux_pictbridge_input_tags & UX_PICTBRIDGE_IR_GC_IMAGE_OPTIMIZES)
{
/* Add the line xxxxxxxx */
- status = _ux_pictbridge_object_tag_line_add(pima_object_buffer, object_length, _ux_pictbridge_xml_tag_line_imageoptimizes,
+ status = _ux_pictbridge_object_tag_line_add(pima_object_buffer, object_length, _ux_pictbridge_xml_tag_line_imageoptimizes,
UX_PICTBRIDGE_TAG_FLAG_BEGIN | UX_PICTBRIDGE_TAG_FLAG_END | UX_PICTBRIDGE_TAG_FLAG_VARIABLE_ARRAY_HEXA,
UX_NULL, 0, (VOID *) pictbridge -> ux_pictbridge_dpslocal.ux_pictbridge_devinfo_imageoptimizes, &pima_object_buffer, &object_length);
if (status != UX_SUCCESS)
@@ -197,17 +190,17 @@ UINT status;
/* Add the line xxxxxxxx yyyyyyyy */
- status = _ux_pictbridge_object_tag_line_add(pima_object_buffer, object_length, _ux_pictbridge_xml_tag_line_layouts,
+ status = _ux_pictbridge_object_tag_line_add(pima_object_buffer, object_length, _ux_pictbridge_xml_tag_line_layouts,
UX_PICTBRIDGE_TAG_FLAG_BEGIN | UX_PICTBRIDGE_TAG_FLAG_END | UX_PICTBRIDGE_TAG_FLAG_VARIABLE_ARRAY_HEXA,
- _ux_pictbridge_xml_variable_papersize, pictbridge -> ux_pictbridge_dpsclient.ux_pictbridge_devinfo_layouts_papersize,
+ _ux_pictbridge_xml_variable_papersize, pictbridge -> ux_pictbridge_dpsclient.ux_pictbridge_devinfo_layouts_papersize,
(VOID *) &pictbridge -> ux_pictbridge_dpslocal.ux_pictbridge_devinfo_layouts, &pima_object_buffer, &object_length);
-
+
else
-
+
/* Add the line xxxxxxxx yyyyyyyy */
- status = _ux_pictbridge_object_tag_line_add(pima_object_buffer, object_length, _ux_pictbridge_xml_tag_line_layouts,
+ status = _ux_pictbridge_object_tag_line_add(pima_object_buffer, object_length, _ux_pictbridge_xml_tag_line_layouts,
UX_PICTBRIDGE_TAG_FLAG_BEGIN | UX_PICTBRIDGE_TAG_FLAG_END | UX_PICTBRIDGE_TAG_FLAG_VARIABLE_ARRAY_HEXA,
- UX_NULL, 0,
+ UX_NULL, 0,
(VOID *) &pictbridge -> ux_pictbridge_dpslocal.ux_pictbridge_devinfo_layouts, &pima_object_buffer, &object_length);
if (status != UX_SUCCESS)
@@ -218,9 +211,9 @@ UINT status;
if (pictbridge -> ux_pictbridge_input_tags & UX_PICTBRIDGE_IR_GC_FIXED_SIZES)
{
/* Add the line xxxxxxxx yyyyyyyy */
- status = _ux_pictbridge_object_tag_line_add(pima_object_buffer, object_length, _ux_pictbridge_xml_tag_line_fixedsizes,
+ status = _ux_pictbridge_object_tag_line_add(pima_object_buffer, object_length, _ux_pictbridge_xml_tag_line_fixedsizes,
UX_PICTBRIDGE_TAG_FLAG_BEGIN | UX_PICTBRIDGE_TAG_FLAG_END | UX_PICTBRIDGE_TAG_FLAG_VARIABLE_ARRAY_HEXA,
- UX_NULL, 0,
+ UX_NULL, 0,
(VOID *) &pictbridge -> ux_pictbridge_dpslocal.ux_pictbridge_devinfo_fixedsizes, &pima_object_buffer, &object_length);
if (status != UX_SUCCESS)
return(status);
@@ -230,7 +223,7 @@ UINT status;
if (pictbridge -> ux_pictbridge_input_tags & UX_PICTBRIDGE_IR_GC_CROPPINGS)
{
/* Add the line xxxxxxxx yyyyyyyy */
- status = _ux_pictbridge_object_tag_line_add(pima_object_buffer, object_length, _ux_pictbridge_xml_tag_line_croppings,
+ status = _ux_pictbridge_object_tag_line_add(pima_object_buffer, object_length, _ux_pictbridge_xml_tag_line_croppings,
UX_PICTBRIDGE_TAG_FLAG_BEGIN | UX_PICTBRIDGE_TAG_FLAG_END | UX_PICTBRIDGE_TAG_FLAG_VARIABLE_ARRAY_HEXA,
UX_NULL, 0, (VOID *) pictbridge -> ux_pictbridge_dpslocal.ux_pictbridge_devinfo_croppings, &pima_object_buffer, &object_length);
if (status != UX_SUCCESS)
@@ -241,16 +234,16 @@ UINT status;
if (pictbridge -> ux_pictbridge_input_tags & UX_PICTBRIDGE_IR_GC_CHAR_REPERTOIRES)
{
/* Add the line xxxxxxxx yyyyyyyy */
- status = _ux_pictbridge_object_tag_line_add(pima_object_buffer, object_length, _ux_pictbridge_xml_tag_line_charrepertoires,
+ status = _ux_pictbridge_object_tag_line_add(pima_object_buffer, object_length, _ux_pictbridge_xml_tag_line_charrepertoires,
UX_PICTBRIDGE_TAG_FLAG_BEGIN | UX_PICTBRIDGE_TAG_FLAG_END | UX_PICTBRIDGE_TAG_FLAG_VARIABLE_ARRAY_HEXA,
- UX_NULL, 0,
+ UX_NULL, 0,
(VOID *) &pictbridge -> ux_pictbridge_dpslocal.ux_pictbridge_devinfo_charrepertoires, &pima_object_buffer, &object_length);
if (status != UX_SUCCESS)
return(status);
}
/* Add the line */
- status = _ux_pictbridge_object_tag_line_add(pima_object_buffer, object_length, _ux_pictbridge_xml_tag_line_capability,
+ status = _ux_pictbridge_object_tag_line_add(pima_object_buffer, object_length, _ux_pictbridge_xml_tag_line_capability,
UX_PICTBRIDGE_TAG_FLAG_END,
UX_NULL, 0, UX_NULL, &pima_object_buffer, &object_length);
if (status != UX_SUCCESS)
@@ -258,7 +251,7 @@ UINT status;
/* Add the line */
- status = _ux_pictbridge_object_tag_line_add(pima_object_buffer, object_length, _ux_pictbridge_xml_tag_line_getcapability,
+ status = _ux_pictbridge_object_tag_line_add(pima_object_buffer, object_length, _ux_pictbridge_xml_tag_line_getcapability,
UX_PICTBRIDGE_TAG_FLAG_END,
UX_NULL, 0, UX_NULL, &pima_object_buffer, &object_length);
if (status != UX_SUCCESS)
@@ -266,11 +259,11 @@ UINT status;
/* Update the caller's object position. */
*pima_object_buffer_updated = pima_object_buffer;
-
+
/* Update the caller's object length . */
*object_length_updated = object_length;
-
+
/* Return completion status. */
- return(UX_SUCCESS);
+ return(UX_SUCCESS);
}
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 2deeffb4..7103b758 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
@@ -1,18 +1,19 @@
/***************************************************************************
- * Copyright (c) 2024 Microsoft Corporation
- *
+ * Copyright (c) 2024 Microsoft Corporation
+ * Copyright (c) 2026-present Eclipse ThreadX contributors
+ *
* This program and the accompanying materials are made available under the
* terms of the MIT License which is available at
* https://opensource.org/licenses/MIT.
- *
+ *
* SPDX-License-Identifier: MIT
**************************************************************************/
/**************************************************************************/
/**************************************************************************/
-/** */
-/** USBX Component */
+/** */
+/** USBX Component */
/** */
/** Pictbridge Application */
/** */
@@ -29,54 +30,46 @@
#include "ux_host_class_pima.h"
-/**************************************************************************/
-/* */
-/* FUNCTION RELEASE */
-/* */
+/**************************************************************************/
+/* */
+/* FUNCTION RELEASE */
+/* */
/* _ux_pictbridge_dpshost_output_object_get_device_status */
-/* PORTABLE C */
+/* PORTABLE C */
/* 6.1 */
/* AUTHOR */
/* */
/* Chaoqiong Xiao, Microsoft Corporation */
/* */
/* DESCRIPTION */
-/* */
-/* This function creates the tag lines of the get_capability request */
-/* */
-/* INPUT */
-/* */
-/* pictbridge Pictbridge instance */
+/* */
+/* This function creates the tag lines of the get_capability request */
+/* */
+/* INPUT */
+/* */
+/* pictbridge Pictbridge instance */
/* pima_object_buffer Pointer to object buffer */
/* object_length Length of the object */
/* pima_object_buffer_updated Updated Address of the object */
/* object_length_updated Updated length */
/* */
-/* */
-/* OUTPUT */
-/* */
-/* Completion Status */
-/* */
-/* CALLS */
-/* */
-/* */
-/* CALLED BY */
-/* */
-/* _ux_pictbridge_dpshost_object_get */
-/* */
-/* RELEASE HISTORY */
-/* */
-/* DATE NAME DESCRIPTION */
-/* */
-/* 05-19-2020 Chaoqiong Xiao Initial Version 6.0 */
-/* 09-30-2020 Chaoqiong Xiao Modified comment(s), */
-/* resulting in version 6.1 */
+/* */
+/* OUTPUT */
+/* */
+/* Completion Status */
+/* */
+/* CALLS */
+/* */
+/* */
+/* CALLED BY */
+/* */
+/* _ux_pictbridge_dpshost_object_get */
/* */
/**************************************************************************/
-UINT _ux_pictbridge_dpshost_output_object_get_device_status(UX_PICTBRIDGE *pictbridge,
- UCHAR *pima_object_buffer,
- ULONG object_length,
- UCHAR **pima_object_buffer_updated,
+UINT _ux_pictbridge_dpshost_output_object_get_device_status(UX_PICTBRIDGE *pictbridge,
+ UCHAR *pima_object_buffer,
+ ULONG object_length,
+ UCHAR **pima_object_buffer_updated,
ULONG *object_length_updated)
{
@@ -84,63 +77,63 @@ UINT status;
/* Add the line */
- status = _ux_pictbridge_object_tag_line_add(pima_object_buffer, object_length, _ux_pictbridge_xml_tag_line_getdevicestatus,
+ status = _ux_pictbridge_object_tag_line_add(pima_object_buffer, object_length, _ux_pictbridge_xml_tag_line_getdevicestatus,
UX_PICTBRIDGE_TAG_FLAG_BEGIN | UX_PICTBRIDGE_TAG_FLAG_FORCE_LF,
UX_NULL, 0, UX_NULL, &pima_object_buffer, &object_length);
if (status != UX_SUCCESS)
return(status);
/* Add the line xxxxxxxx */
- status = _ux_pictbridge_object_tag_line_add(pima_object_buffer, object_length, _ux_pictbridge_xml_tag_line_dpsprintservicestatus,
+ status = _ux_pictbridge_object_tag_line_add(pima_object_buffer, object_length, _ux_pictbridge_xml_tag_line_dpsprintservicestatus,
UX_PICTBRIDGE_TAG_FLAG_BEGIN | UX_PICTBRIDGE_TAG_FLAG_END | UX_PICTBRIDGE_TAG_FLAG_VARIABLE_HEXA,
UX_NULL, 0, (VOID *)(ALIGN_TYPE) pictbridge -> ux_pictbridge_dpslocal.ux_pictbridge_devinfo_dpsprintservicestatus, &pima_object_buffer, &object_length);
if (status != UX_SUCCESS)
return(status);
/* Add the line xxxxxxxx */
- status = _ux_pictbridge_object_tag_line_add(pima_object_buffer, object_length, _ux_pictbridge_xml_tag_line_jobendreason,
+ status = _ux_pictbridge_object_tag_line_add(pima_object_buffer, object_length, _ux_pictbridge_xml_tag_line_jobendreason,
UX_PICTBRIDGE_TAG_FLAG_BEGIN | UX_PICTBRIDGE_TAG_FLAG_END | UX_PICTBRIDGE_TAG_FLAG_VARIABLE_HEXA,
UX_NULL, 0, (VOID *)(ALIGN_TYPE) pictbridge -> ux_pictbridge_dpslocal.ux_pictbridge_devinfo_jobendreason, &pima_object_buffer, &object_length);
if (status != UX_SUCCESS)
return(status);
/* Add the line xxxxxxxx */
- status = _ux_pictbridge_object_tag_line_add(pima_object_buffer, object_length, _ux_pictbridge_xml_tag_line_errorstatus,
+ status = _ux_pictbridge_object_tag_line_add(pima_object_buffer, object_length, _ux_pictbridge_xml_tag_line_errorstatus,
UX_PICTBRIDGE_TAG_FLAG_BEGIN | UX_PICTBRIDGE_TAG_FLAG_END | UX_PICTBRIDGE_TAG_FLAG_VARIABLE_HEXA,
UX_NULL, 0, (VOID *)(ALIGN_TYPE) pictbridge -> ux_pictbridge_dpslocal.ux_pictbridge_devinfo_errorstatus, &pima_object_buffer, &object_length);
if (status != UX_SUCCESS)
return(status);
/* Add the line xxxxxxxx */
- status = _ux_pictbridge_object_tag_line_add(pima_object_buffer, object_length, _ux_pictbridge_xml_tag_line_errorreason,
+ status = _ux_pictbridge_object_tag_line_add(pima_object_buffer, object_length, _ux_pictbridge_xml_tag_line_errorreason,
UX_PICTBRIDGE_TAG_FLAG_BEGIN | UX_PICTBRIDGE_TAG_FLAG_END | UX_PICTBRIDGE_TAG_FLAG_VARIABLE_HEXA,
UX_NULL, 0, (VOID *)(ALIGN_TYPE) pictbridge -> ux_pictbridge_dpslocal.ux_pictbridge_devinfo_errorreason, &pima_object_buffer, &object_length);
if (status != UX_SUCCESS)
return(status);
/* Add the line xxxxxxxx */
- status = _ux_pictbridge_object_tag_line_add(pima_object_buffer, object_length, _ux_pictbridge_xml_tag_line_disconnectenable,
+ status = _ux_pictbridge_object_tag_line_add(pima_object_buffer, object_length, _ux_pictbridge_xml_tag_line_disconnectenable,
UX_PICTBRIDGE_TAG_FLAG_BEGIN | UX_PICTBRIDGE_TAG_FLAG_END | UX_PICTBRIDGE_TAG_FLAG_VARIABLE_HEXA,
UX_NULL, 0, (VOID *)(ALIGN_TYPE) pictbridge -> ux_pictbridge_dpslocal.ux_pictbridge_devinfo_disconnectenable, &pima_object_buffer, &object_length);
if (status != UX_SUCCESS)
return(status);
/* Add the line xxxxxxxx */
- status = _ux_pictbridge_object_tag_line_add(pima_object_buffer, object_length, _ux_pictbridge_xml_tag_line_capabilitychanged,
+ status = _ux_pictbridge_object_tag_line_add(pima_object_buffer, object_length, _ux_pictbridge_xml_tag_line_capabilitychanged,
UX_PICTBRIDGE_TAG_FLAG_BEGIN | UX_PICTBRIDGE_TAG_FLAG_END | UX_PICTBRIDGE_TAG_FLAG_VARIABLE_HEXA,
UX_NULL, 0, (VOID *)(ALIGN_TYPE) pictbridge -> ux_pictbridge_dpslocal.ux_pictbridge_devinfo_capabilitychanged, &pima_object_buffer, &object_length);
if (status != UX_SUCCESS)
return(status);
/* Add the line xxxxxxxx */
- status = _ux_pictbridge_object_tag_line_add(pima_object_buffer, object_length, _ux_pictbridge_xml_tag_line_newjobok,
+ status = _ux_pictbridge_object_tag_line_add(pima_object_buffer, object_length, _ux_pictbridge_xml_tag_line_newjobok,
UX_PICTBRIDGE_TAG_FLAG_BEGIN | UX_PICTBRIDGE_TAG_FLAG_END | UX_PICTBRIDGE_TAG_FLAG_VARIABLE_HEXA,
UX_NULL, 0, (VOID *)(ALIGN_TYPE) pictbridge -> ux_pictbridge_dpslocal.ux_pictbridge_devinfo_newjobok, &pima_object_buffer, &object_length);
if (status != UX_SUCCESS)
return(status);
/* Add the line */
- status = _ux_pictbridge_object_tag_line_add(pima_object_buffer, object_length, _ux_pictbridge_xml_tag_line_getdevicestatus,
+ status = _ux_pictbridge_object_tag_line_add(pima_object_buffer, object_length, _ux_pictbridge_xml_tag_line_getdevicestatus,
UX_PICTBRIDGE_TAG_FLAG_END,
UX_NULL, 0, UX_NULL, &pima_object_buffer, &object_length);
if (status != UX_SUCCESS)
@@ -148,11 +141,11 @@ UINT status;
/* Update the caller's object position. */
*pima_object_buffer_updated = pima_object_buffer;
-
+
/* Update the caller's object length . */
*object_length_updated = object_length;
-
+
/* Return completion status. */
- return(UX_SUCCESS);
+ return(UX_SUCCESS);
}
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 51e031b7..acee0880 100644
--- a/common/usbx_pictbridge/src/ux_pictbridge_dpshost_response_get.c
+++ b/common/usbx_pictbridge/src/ux_pictbridge_dpshost_response_get.c
@@ -1,18 +1,19 @@
/***************************************************************************
- * Copyright (c) 2024 Microsoft Corporation
- *
+ * Copyright (c) 2024 Microsoft Corporation
+ * Copyright (c) 2026-present Eclipse ThreadX contributors
+ *
* This program and the accompanying materials are made available under the
* terms of the MIT License which is available at
* https://opensource.org/licenses/MIT.
- *
+ *
* SPDX-License-Identifier: MIT
**************************************************************************/
/**************************************************************************/
/**************************************************************************/
-/** */
-/** USBX Component */
+/** */
+/** USBX Component */
/** */
/** Pictbridge Application */
/** */
@@ -29,46 +30,34 @@
#include "ux_host_class_pima.h"
-/**************************************************************************/
-/* */
-/* FUNCTION RELEASE */
-/* */
-/* _ux_pictbridge_dpshost_response_get PORTABLE C */
+/**************************************************************************/
+/* */
+/* FUNCTION RELEASE */
+/* */
+/* _ux_pictbridge_dpshost_response_get PORTABLE C */
/* 6.1.12 */
/* AUTHOR */
/* */
/* Chaoqiong Xiao, Microsoft Corporation */
/* */
/* DESCRIPTION */
-/* */
-/* This function obtains a response. */
-/* */
-/* INPUT */
-/* */
-/* pictbridge Pictbridge instance */
-/* */
-/* OUTPUT */
-/* */
-/* Completion Status */
-/* */
-/* CALLS */
-/* */
-/* */
-/* CALLED BY */
-/* */
-/* _ux_pictbridge_dpshost_thread */
-/* */
-/* RELEASE HISTORY */
-/* */
-/* DATE NAME DESCRIPTION */
-/* */
-/* 05-19-2020 Chaoqiong Xiao Initial Version 6.0 */
-/* 09-30-2020 Chaoqiong Xiao Modified comment(s), */
-/* resulting in version 6.1 */
-/* 07-29-2022 Chaoqiong Xiao Modified comment(s), */
-/* fixed string length check, */
-/* used macros for RTOS calls, */
-/* resulting in version 6.1.12 */
+/* */
+/* This function obtains a response. */
+/* */
+/* INPUT */
+/* */
+/* pictbridge Pictbridge instance */
+/* */
+/* OUTPUT */
+/* */
+/* Completion Status */
+/* */
+/* CALLS */
+/* */
+/* */
+/* CALLED BY */
+/* */
+/* _ux_pictbridge_dpshost_thread */
/* */
/**************************************************************************/
UINT _ux_pictbridge_dpshost_response_get(UX_PICTBRIDGE *pictbridge)
@@ -88,7 +77,7 @@ UINT length, length1;
/* Get the pima instance from the pictbridge container. */
pima = (UX_HOST_CLASS_PIMA *) pictbridge -> ux_pictbridge_pima;
-
+
/* And now the session since we use it. */
pima_session = (UX_HOST_CLASS_PIMA_SESSION *) pictbridge -> ux_pictbridge_session;
@@ -101,7 +90,7 @@ UINT length, length1;
/* Check if there is an event. Normally there should be at least one since we got awaken. */
if (pictbridge -> ux_pictbridge_event_array_tail != pictbridge -> ux_pictbridge_event_array_head)
{
-
+
/* Get the current event tail. */
pictbridge_event = pictbridge -> ux_pictbridge_event_array_tail;
@@ -113,47 +102,47 @@ UINT length, length1;
/* The DSC client is informing us that an object is ready. */
case UX_PICTBRIDGE_EC_OBJECT_ADDED :
case UX_PICTBRIDGE_EC_REQUEST_OBJECT_TRANSFER :
-
+
/* Obtain the object handle. */
object_handle = pictbridge_event -> ux_pictbridge_event_parameter_1;
break;
default :
return(UX_ERROR);
- }
-
+ }
+
/* Compute the next entry in the event array. */
if ((pictbridge -> ux_pictbridge_event_array_tail + 1) == pictbridge -> ux_pictbridge_event_array_end)
-
+
/* Start at the beginning of the list. */
pictbridge_event = pictbridge -> ux_pictbridge_event_array;
else
/* Point to the next entry in the event array. */
- pictbridge_event = pictbridge -> ux_pictbridge_event_array_tail + 1;
+ pictbridge_event = pictbridge -> ux_pictbridge_event_array_tail + 1;
/* Now, store the new event tail. */
pictbridge -> ux_pictbridge_event_array_tail = pictbridge_event;
-
+
}
-
+
else
-
+
/* We have an error. Got awaken for nothing ! */
return(UX_ERROR);
/* Get the object info structure. */
- status = _ux_host_class_pima_object_info_get(pima, pima_session,
+ status = _ux_host_class_pima_object_info_get(pima, pima_session,
object_handle, pima_object);
if (status != UX_SUCCESS)
{
/* Return an error. */
return(UX_PICTBRIDGE_ERROR_INVALID_OBJECT_HANDLE);
- }
+ }
- /* Check if this is a script. If the object is not a script or does not contain the
- File Name we expect, we ignore it. */
+ /* Check if this is a script. If the object is not a script or does not contain the
+ File Name we expect, we ignore it. */
if (pima_object -> ux_host_class_pima_object_format == UX_HOST_CLASS_PIMA_OFC_SCRIPT)
{
@@ -173,7 +162,7 @@ UINT length, length1;
/* Get the file name in a ascii format (with null-terminator). */
_ux_utility_unicode_to_string(pima_object -> ux_host_class_pima_object_filename, object_file_name);
-
+
/* So far, the length of name of the files are the same.
Compare names now (since length is same just compare without null-terminator). */
if (_ux_utility_memory_compare(_ux_pictbridge_drsponse_name, object_file_name,
@@ -183,110 +172,110 @@ UINT length, length1;
/* Yes this is a script. Get the entire object in memory. */
/* Get script length from the object info. */
object_length = pima_object -> ux_host_class_pima_object_compressed_size;
-
+
/* Check for overflow. */
if (object_length > UX_PICTBRIDGE_MAX_PIMA_OBJECT_BUFFER)
return(UX_PICTBRIDGE_ERROR_SCRIPT_BUFFER_OVERFLOW);
-
+
/* Open the object. */
status = _ux_host_class_pima_object_open(pima, pima_session, object_handle, pima_object);
-
+
/* Check status. */
if (status != UX_SUCCESS)
return(status);
-
+
/* Set the object buffer pointer. */
object_buffer = pima_object -> ux_host_class_pima_object_buffer;
-
+
/* Obtain all the object data. */
while(object_length != 0)
- {
-
+ {
+
/* Calculate what length to request. */
if (object_length > UX_PICTBRIDGE_MAX_PIMA_OBJECT_BUFFER)
-
+
/* Request maximum length. */
requested_length = UX_PICTBRIDGE_MAX_PIMA_OBJECT_BUFFER;
-
+
else
-
+
/* Request remaining length. */
requested_length = object_length;
-
+
/* Get the object data. */
- status = _ux_host_class_pima_object_get(pima, pima_session, object_handle, pima_object,
+ status = _ux_host_class_pima_object_get(pima, pima_session, object_handle, pima_object,
object_buffer, requested_length, &actual_length);
if (status != UX_SUCCESS)
{
-
+
/* We had a problem, abort the transfer. */
_ux_host_class_pima_object_transfer_abort(pima, pima_session, object_handle, pima_object);
-
+
/* And close the object. */
_ux_host_class_pima_object_close(pima, pima_session, object_handle, pima_object);
-
+
return(status);
- }
-
+ }
+
/* We have received some data, update the length remaining. */
object_length -= actual_length;
-
+
/* Update the buffer address. */
object_buffer += actual_length;
- }
-
+ }
+
/* Close the object. */
status = _ux_host_class_pima_object_close(pima, pima_session, object_handle, pima_object);
-
+
/* Check the error. */
if (status != UX_SUCCESS)
return(UX_PICTBRIDGE_ERROR_INVALID_OBJECT_HANDLE);
-
+
/* We now have the entire script into memory. Parse the object and execute the script. */
status = _ux_pictbridge_object_parse(pictbridge, pima_object -> ux_host_class_pima_object_buffer,
pima_object -> ux_host_class_pima_object_compressed_size);
-
+
/* Analyze the status from the parsing and determine the result code. */
switch (status)
- {
+ {
case UX_SUCCESS :
-
+
/* Set the result code to OK. */
pictbridge -> ux_pictbridge_operation_result = UX_PICTBRIDGE_ACTION_RESULT_OK;
break;
-
+
case UX_PICTBRIDGE_ERROR_SCRIPT_SYNTAX_ERROR :
-
+
/* Set the result code to Error. */
pictbridge -> ux_pictbridge_operation_result = UX_PICTBRIDGE_ACTION_RESULT_NOT_SUPPORTED_IP;
break;
-
+
case UX_PICTBRIDGE_ERROR_PARAMETER_UNKNOWN :
-
+
/* Set the result code to Error. */
pictbridge -> ux_pictbridge_operation_result = UX_PICTBRIDGE_ACTION_RESULT_NOT_SUPPORTED_UP;
break;
-
+
case UX_PICTBRIDGE_ERROR_PARAMETER_MISSING :
-
+
/* Set the result code to Error. */
pictbridge -> ux_pictbridge_operation_result = UX_PICTBRIDGE_ACTION_RESULT_NOT_SUPPORTED_MP;
break;
-
+
default :
-
+
/* Set the result code to Error. */
pictbridge -> ux_pictbridge_operation_result = UX_PICTBRIDGE_ACTION_RESULT_NOT_SUPPORTED_DEFAULT;
break;
- }
-
+ }
+
if (status != UX_SUCCESS)
return(status);
}
- }
+ }
}
}
-
+
return(UX_SUCCESS);
}
diff --git a/common/usbx_pictbridge/src/ux_pictbridge_dpshost_start.c b/common/usbx_pictbridge/src/ux_pictbridge_dpshost_start.c
index 5420f958..6f10c4ff 100644
--- a/common/usbx_pictbridge/src/ux_pictbridge_dpshost_start.c
+++ b/common/usbx_pictbridge/src/ux_pictbridge_dpshost_start.c
@@ -1,18 +1,19 @@
/***************************************************************************
- * Copyright (c) 2024 Microsoft Corporation
- *
+ * Copyright (c) 2024 Microsoft Corporation
+ * Copyright (c) 2026-present Eclipse ThreadX contributors
+ *
* This program and the accompanying materials are made available under the
* terms of the MIT License which is available at
* https://opensource.org/licenses/MIT.
- *
+ *
* SPDX-License-Identifier: MIT
**************************************************************************/
/**************************************************************************/
/**************************************************************************/
-/** */
-/** USBX Component */
+/** */
+/** USBX Component */
/** */
/** Pictbridge Application */
/** */
@@ -29,54 +30,34 @@
#include "ux_host_class_pima.h"
-/**************************************************************************/
-/* */
-/* FUNCTION RELEASE */
-/* */
-/* _ux_pictbridge_dpshost_start PORTABLE C */
+/**************************************************************************/
+/* */
+/* FUNCTION RELEASE */
+/* */
+/* _ux_pictbridge_dpshost_start PORTABLE C */
/* 6.1.12 */
/* AUTHOR */
/* */
/* Chaoqiong Xiao, Microsoft Corporation */
/* */
/* DESCRIPTION */
-/* */
-/* This function starts the DPS host (usually a printer). */
-/* */
-/* INPUT */
-/* */
-/* pima Pima instance associated */
-/* */
-/* OUTPUT */
-/* */
-/* Completion Status */
-/* */
-/* CALLS */
-/* */
-/* */
-/* CALLED BY */
-/* */
-/* user application */
-/* */
-/* RELEASE HISTORY */
-/* */
-/* 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 */
-/* 04-25-2022 Yajun Xia Modified comment(s), */
-/* internal clean up, */
-/* resulting in version 6.1.11 */
-/* 07-29-2022 Chaoqiong Xiao Modified comment(s), */
-/* fixed string length check, */
-/* fixed possible overflow, */
-/* used define instead of num, */
-/* used macros for RTOS calls, */
-/* resulting in version 6.1.12 */
+/* */
+/* This function starts the DPS host (usually a printer). */
+/* */
+/* INPUT */
+/* */
+/* pima Pima instance associated */
+/* */
+/* OUTPUT */
+/* */
+/* Completion Status */
+/* */
+/* CALLS */
+/* */
+/* */
+/* CALLED BY */
+/* */
+/* user application */
/* */
/**************************************************************************/
UINT _ux_pictbridge_dpshost_start(UX_PICTBRIDGE *pictbridge, UX_HOST_CLASS_PIMA *pima)
@@ -148,10 +129,10 @@ UINT length, length1;
/* Store the Pictbridge instance in the pima application. This is used for the Pima callback
into the Pictbridge (or other application) layer. */
pima -> ux_host_class_pima_application = (VOID *) pictbridge;
-
+
/* State machine for the dpshost is idle. */
pictbridge -> ux_pictbridge_host_client_state_machine = UX_PICTBRIDGE_STATE_MACHINE_IDLE;
-
+
/* Create the semaphore to wake up the thread. */
status = _ux_system_semaphore_create(&pictbridge -> ux_pictbridge_notification_semaphore, "ux_pictbridge_notification_semaphore", 0);
if (status != UX_SUCCESS)
@@ -163,7 +144,7 @@ UINT length, length1;
{
/* Allocate a Thread stack. */
- pictbridge -> ux_pictbridge_thread_stack =
+ pictbridge -> ux_pictbridge_thread_stack =
_ux_utility_memory_allocate(UX_NO_ALIGN, UX_REGULAR_MEMORY, UX_PICTBRIDGE_THREAD_STACK_SIZE);
/* Check the completion status. */
@@ -178,13 +159,13 @@ UINT length, length1;
/* Create the pictbridge class thread. */
status = _ux_system_thread_create(&pictbridge -> ux_pictbridge_thread,
"ux_pictbridge_thread", _ux_pictbridge_dpshost_thread,
- (ULONG)(ALIGN_TYPE) pictbridge,
+ (ULONG)(ALIGN_TYPE) pictbridge,
pictbridge -> ux_pictbridge_thread_stack,
- UX_PICTBRIDGE_THREAD_STACK_SIZE,
+ UX_PICTBRIDGE_THREAD_STACK_SIZE,
UX_PICTBRIDGE_THREAD_PRIORITY_CLASS,
UX_PICTBRIDGE_THREAD_PRIORITY_CLASS,
UX_NO_TIME_SLICE, UX_AUTO_START);
-
+
/* Check the completion status. */
if (status != UX_SUCCESS)
status = (UX_THREAD_ERROR);
@@ -236,7 +217,7 @@ UINT length, length1;
/* Initialize the pictbridge state machine to request expected. */
pictbridge -> ux_pictbridge_request_response = UX_PICTBRIDGE_REQUEST;
- /* Initialize the head and tail of the notification round robin buffers.
+ /* Initialize the head and tail of the notification round robin buffers.
At first, the head and tail are pointing to the beginning of the array. */
pictbridge -> ux_pictbridge_event_array_head = pictbridge -> ux_pictbridge_event_array;
pictbridge -> ux_pictbridge_event_array_tail = pictbridge -> ux_pictbridge_event_array;
@@ -249,14 +230,14 @@ UINT length, length1;
/* Set a callback for the pima session notification. */
pima_session -> ux_host_class_pima_session_event_callback = _ux_pictbridge_dpshost_notification_callback;
-
+
/* Open a pima session. */
status = _ux_host_class_pima_session_open(pima, pima_session);
if (status != UX_SUCCESS)
return(UX_PICTBRIDGE_ERROR_SESSION_NOT_OPEN);
/* Get the number of storage IDs. */
- status = _ux_host_class_pima_storage_ids_get(pima, pima_session,
+ status = _ux_host_class_pima_storage_ids_get(pima, pima_session,
pictbridge -> ux_pictbridge_storage_ids,
UX_PICTBRIDGE_MAX_NUMBER_STORAGE_IDS);
if (status != UX_SUCCESS)
@@ -265,10 +246,10 @@ UINT length, length1;
_ux_host_class_pima_session_close(pima, pima_session);
return(UX_PICTBRIDGE_ERROR_STORE_NOT_AVAILABLE);
- }
+ }
/* Get the first storage ID info container. */
- status = _ux_host_class_pima_storage_info_get(pima, pima_session,
+ status = _ux_host_class_pima_storage_info_get(pima, pima_session,
pictbridge -> ux_pictbridge_storage_ids[0],
(UX_HOST_CLASS_PIMA_STORAGE *)pictbridge -> ux_pictbridge_storage);
if (status != UX_SUCCESS)
@@ -277,10 +258,10 @@ UINT length, length1;
_ux_host_class_pima_session_close(pictbridge -> ux_pictbridge_pima, pima_session);
return(UX_PICTBRIDGE_ERROR_STORE_NOT_AVAILABLE);
- }
+ }
/* Get the number of objects on the container. */
- status = _ux_host_class_pima_num_objects_get(pima, pima_session,
+ status = _ux_host_class_pima_num_objects_get(pima, pima_session,
UX_PICTBRIDGE_ALL_CONTAINERS, UX_PICTBRIDGE_OBJECT_SCRIPT);
if (status != UX_SUCCESS)
{
@@ -288,15 +269,15 @@ UINT length, length1;
_ux_host_class_pima_session_close(pima, pima_session);
return(UX_PICTBRIDGE_ERROR_STORE_NOT_AVAILABLE);
- }
+ }
/* Get the array of objects handles on the container. */
if (pima_session -> ux_host_class_pima_session_nb_objects > UX_PICTBRIDGE_MAX_NUMBER_OBJECT_HANDLES)
length = UX_PICTBRIDGE_MAX_NUMBER_OBJECT_HANDLES;
else
length = pima_session -> ux_host_class_pima_session_nb_objects;
- status = _ux_host_class_pima_object_handles_get(pima, pima_session,
- pictbridge -> ux_pictbridge_object_handles_array,
+ status = _ux_host_class_pima_object_handles_get(pima, pima_session,
+ pictbridge -> ux_pictbridge_object_handles_array,
length,
UX_PICTBRIDGE_ALL_CONTAINERS, UX_PICTBRIDGE_OBJECT_SCRIPT, 0);
if (status != UX_SUCCESS)
@@ -305,7 +286,7 @@ UINT length, length1;
_ux_host_class_pima_session_close(pima, pima_session);
return(UX_PICTBRIDGE_ERROR_STORE_NOT_AVAILABLE);
- }
+ }
/* We search for an object that is a picture or a script. */
object_index = 0;
@@ -313,7 +294,7 @@ UINT length, length1;
{
/* Get the object info structure. */
- status = _ux_host_class_pima_object_info_get(pima, pima_session,
+ status = _ux_host_class_pima_object_info_get(pima, pima_session,
pictbridge -> ux_pictbridge_object_handles_array[object_index], pima_object);
if (status != UX_SUCCESS)
{
@@ -321,9 +302,9 @@ UINT length, length1;
_ux_host_class_pima_session_close(pima, pima_session);
return(UX_PICTBRIDGE_ERROR_INVALID_OBJECT_HANDLE );
- }
+ }
- /* Check if this is a script. */
+ /* Check if this is a script. */
if (pima_object -> ux_host_class_pima_object_format == UX_HOST_CLASS_PIMA_OFC_SCRIPT)
{
@@ -350,14 +331,14 @@ UINT length, length1;
length) == UX_SUCCESS)
{
- /* We have found a script with the DDISCVRY.DPS file name. Prepare a reply with a HDISCVRY. DPS name.
+ /* We have found a script with the DDISCVRY.DPS file name. Prepare a reply with a HDISCVRY. DPS name.
We use the same object container. Just change the name of the file. */
- _ux_utility_string_to_unicode(_ux_pictbridge_hdiscovery_name, pima_object -> ux_host_class_pima_object_filename);
-
+ _ux_utility_string_to_unicode(_ux_pictbridge_hdiscovery_name, pima_object -> ux_host_class_pima_object_filename);
+
/* Send the script info. */
status = _ux_host_class_pima_object_info_send(pima, pima_session, 0,0,
pima_object);
-
+
/* Check the status of this operation. */
if (status != UX_SUCCESS)
{
@@ -366,23 +347,23 @@ UINT length, length1;
_ux_host_class_pima_session_close(pima, pima_session);
return(UX_PICTBRIDGE_ERROR_INVALID_OBJECT_HANDLE);
- }
+ }
else
-
- /* We return to the application with a success status. We leave the session opened. */
+
+ /* We return to the application with a success status. We leave the session opened. */
return(UX_SUCCESS);
-
+
}
-
+
}
}
}
/* Next object index. */
object_index++;
-
+
}
-
+
/* We come here when we have not found any script or the script does not have the DDISCVRY.DPS file. Close the pima session. */
_ux_host_class_pima_session_close(pima, pima_session);
return(UX_PICTBRIDGE_ERROR_NO_DISCOVERY_SCRIPT);
diff --git a/common/usbx_pictbridge/src/ux_pictbridge_dpshost_startjob.c b/common/usbx_pictbridge/src/ux_pictbridge_dpshost_startjob.c
index 727148ae..a98f98a8 100644
--- a/common/usbx_pictbridge/src/ux_pictbridge_dpshost_startjob.c
+++ b/common/usbx_pictbridge/src/ux_pictbridge_dpshost_startjob.c
@@ -1,18 +1,19 @@
/***************************************************************************
- * Copyright (c) 2024 Microsoft Corporation
- *
+ * Copyright (c) 2024 Microsoft Corporation
+ * Copyright (c) 2026-present Eclipse ThreadX contributors
+ *
* This program and the accompanying materials are made available under the
* terms of the MIT License which is available at
* https://opensource.org/licenses/MIT.
- *
+ *
* SPDX-License-Identifier: MIT
**************************************************************************/
/**************************************************************************/
/**************************************************************************/
-/** */
-/** USBX Component */
+/** */
+/** USBX Component */
/** */
/** Pictbridge Application */
/** */
@@ -29,46 +30,35 @@
#include "ux_host_class_pima.h"
-/**************************************************************************/
-/* */
-/* FUNCTION RELEASE */
-/* */
-/* _ux_pictbridge_dpshost_startjob PORTABLE C */
+/**************************************************************************/
+/* */
+/* FUNCTION RELEASE */
+/* */
+/* _ux_pictbridge_dpshost_startjob PORTABLE C */
/* 6.1.11 */
/* AUTHOR */
/* */
/* Chaoqiong Xiao, Microsoft Corporation */
/* */
/* DESCRIPTION */
-/* */
-/* This function requests one or more files from the camera to be */
-/* printed. */
-/* */
-/* INPUT */
-/* */
-/* pictbridge Pictbridge instance */
-/* */
-/* OUTPUT */
-/* */
-/* Completion Status */
-/* */
-/* CALLS */
-/* */
-/* */
-/* CALLED BY */
-/* */
-/* _ux_pictbridge_dpshost_thread */
-/* */
-/* RELEASE HISTORY */
-/* */
-/* DATE NAME DESCRIPTION */
-/* */
-/* 05-19-2020 Chaoqiong Xiao Initial Version 6.0 */
-/* 09-30-2020 Chaoqiong Xiao Modified comment(s), */
-/* resulting in version 6.1 */
-/* 04-25-2022 Yajun Xia Modified comment(s), */
-/* internal clean up, */
-/* resulting in version 6.1.11 */
+/* */
+/* This function requests one or more files from the camera to be */
+/* printed. */
+/* */
+/* INPUT */
+/* */
+/* pictbridge Pictbridge instance */
+/* */
+/* OUTPUT */
+/* */
+/* Completion Status */
+/* */
+/* CALLS */
+/* */
+/* */
+/* CALLED BY */
+/* */
+/* _ux_pictbridge_dpshost_thread */
/* */
/**************************************************************************/
UINT _ux_pictbridge_dpshost_startjob(UX_PICTBRIDGE *pictbridge)
@@ -90,7 +80,7 @@ UCHAR *object_buffer;
/* Get the session in a properly casted format. */
pima_session = (UX_HOST_CLASS_PIMA_SESSION *) pictbridge -> ux_pictbridge_session;
-
+
/* We have 2 structures that tell us about the job(s) to do. The jobinfo which
applies to all the jobs and one or more instances of the printinfo structure
which applies to each file\object to be printed. */
@@ -98,12 +88,12 @@ UCHAR *object_buffer;
/* Get the first printinfo structure. */
printinfo = jobinfo -> ux_pictbridge_jobinfo_printinfo_start;
-
+
/* Parse all the job info. */
while (printinfo != UX_NULL)
{
/* Set the current print job. */
- jobinfo -> ux_pictbridge_jobinfo_printinfo_current = printinfo;
+ jobinfo -> ux_pictbridge_jobinfo_printinfo_current = printinfo;
/* Change status from idle to printing. */
pictbridge -> ux_pictbridge_dpslocal.ux_pictbridge_devinfo_dpsprintservicestatus = UX_PICTBRIDGE_DPS_PRINTSERVICE_STATUS_ACTIVE;
@@ -134,7 +124,7 @@ UCHAR *object_buffer;
return(status);
/* Get the object info for this fileID to be printed. */
- status = _ux_host_class_pima_object_info_get(pima, pima_session,
+ status = _ux_host_class_pima_object_info_get(pima, pima_session,
printinfo -> ux_pictbridge_printinfo_fileid, &pima_object);
if (status != UX_SUCCESS)
{
@@ -145,14 +135,14 @@ UCHAR *object_buffer;
/* Change NewJob status to print ok. */
pictbridge -> ux_pictbridge_dpslocal.ux_pictbridge_devinfo_newjobok = UX_PICTBRIDGE_NEW_JOB_TRUE;
- return(status);
+ return(status);
}
/* Get the object length from the object info. */
object_length = pima_object.ux_host_class_pima_object_compressed_size;
-
+
/* Open the object. */
- status = _ux_host_class_pima_object_open(pima, pima_session,
+ status = _ux_host_class_pima_object_open(pima, pima_session,
printinfo -> ux_pictbridge_printinfo_fileid, &pima_object);
if (status != UX_SUCCESS)
{
@@ -162,7 +152,7 @@ UCHAR *object_buffer;
/* Change NewJob status to print ok. */
pictbridge -> ux_pictbridge_dpslocal.ux_pictbridge_devinfo_newjobok = UX_PICTBRIDGE_NEW_JOB_TRUE;
-
+
return(status);
}
@@ -173,48 +163,48 @@ UCHAR *object_buffer;
/* Check for memory error. */
if (object_buffer == UX_NULL)
{
-
+
/* Change status from printing to idle. */
pictbridge -> ux_pictbridge_dpslocal.ux_pictbridge_devinfo_dpsprintservicestatus = UX_PICTBRIDGE_DPS_PRINTSERVICE_STATUS_IDLE;
/* Change NewJob status to print ok. */
pictbridge -> ux_pictbridge_dpslocal.ux_pictbridge_devinfo_newjobok = UX_PICTBRIDGE_NEW_JOB_TRUE;
-
+
/* Close the object. */
_ux_host_class_pima_object_close(pima, pima_session,
printinfo -> ux_pictbridge_printinfo_fileid, &pima_object);
/* Return an error. */
return(UX_MEMORY_INSUFFICIENT);
-
+
}
/* Reset the current object offset. */
object_offset = 0;
-
+
/* Obtain all the object data. */
while(object_length != 0)
- {
+ {
/* Calculate what length to request. */
if (object_length > UX_PICTBRIDGE_MAX_PIMA_OBJECT_BUFFER)
-
+
/* Request maximum length. */
requested_length = UX_PICTBRIDGE_MAX_PIMA_OBJECT_BUFFER;
-
+
else
-
+
/* Request remaining length. */
requested_length = object_length;
-
-
+
+
/* Get the object data. */
- status = _ux_host_class_pima_object_get(pima, pima_session, printinfo -> ux_pictbridge_printinfo_fileid, &pima_object,
+ status = _ux_host_class_pima_object_get(pima, pima_session, printinfo -> ux_pictbridge_printinfo_fileid, &pima_object,
object_buffer, requested_length, &actual_length);
if (status != UX_SUCCESS)
{
-
- /* Abort the current transfer. */
+
+ /* Abort the current transfer. */
_ux_host_class_pima_object_transfer_abort(pima, pima_session, printinfo -> ux_pictbridge_printinfo_fileid, &pima_object);
/* Change status from printing to idle. */
@@ -226,20 +216,20 @@ UCHAR *object_buffer;
/* Free memory of the object. */
_ux_utility_memory_free(object_buffer);
-
+
/* Return error. */
return(status);
- }
-
+ }
+
/* If there is an application callback function, associated with this object, call it. */
if (pictbridge -> ux_pictbridge_application_object_data_write != UX_NULL)
{
-
+
/* Call the callback function. */
- status = pictbridge -> ux_pictbridge_application_object_data_write(pictbridge,
- object_buffer,
- object_offset,
- pima_object.ux_host_class_pima_object_compressed_size,
+ status = pictbridge -> ux_pictbridge_application_object_data_write(pictbridge,
+ object_buffer,
+ object_offset,
+ pima_object.ux_host_class_pima_object_compressed_size,
actual_length);
if (status != UX_SUCCESS)
@@ -265,11 +255,11 @@ UCHAR *object_buffer;
/* We have received some data, update the length remaining. */
object_length -= actual_length;
-
+
/* Update the offset. */
object_offset += actual_length;
- }
-
+ }
+
/* Close the object. */
status = _ux_host_class_pima_object_close(pima, pima_session,
printinfo -> ux_pictbridge_printinfo_fileid, &pima_object);
@@ -283,13 +273,13 @@ UCHAR *object_buffer;
/* Change NewJob status to print ok. */
pictbridge -> ux_pictbridge_dpslocal.ux_pictbridge_devinfo_newjobok = UX_PICTBRIDGE_NEW_JOB_TRUE;
-
+
/* Free memory of the object. */
_ux_utility_memory_free(object_buffer);
return(status);
}
-
+
/* Free resources. */
_ux_utility_memory_free(object_buffer);
@@ -322,11 +312,11 @@ UCHAR *object_buffer;
/* Next printinfo. */
printinfo = printinfo -> ux_pictbridge_printinfo_next;
-
+
}
/* Return status successful. */
return(UX_SUCCESS);
-
+
}
diff --git a/common/usbx_pictbridge/src/ux_pictbridge_dpshost_thread.c b/common/usbx_pictbridge/src/ux_pictbridge_dpshost_thread.c
index 36087542..76131a5b 100644
--- a/common/usbx_pictbridge/src/ux_pictbridge_dpshost_thread.c
+++ b/common/usbx_pictbridge/src/ux_pictbridge_dpshost_thread.c
@@ -1,18 +1,19 @@
/***************************************************************************
- * Copyright (c) 2024 Microsoft Corporation
- *
+ * Copyright (c) 2024 Microsoft Corporation
+ * Copyright (c) 2026-present Eclipse ThreadX contributors
+ *
* This program and the accompanying materials are made available under the
* terms of the MIT License which is available at
* https://opensource.org/licenses/MIT.
- *
+ *
* SPDX-License-Identifier: MIT
**************************************************************************/
/**************************************************************************/
/**************************************************************************/
-/** */
-/** USBX Component */
+/** */
+/** USBX Component */
/** */
/** Pictbridge Application */
/** */
@@ -29,53 +30,35 @@
#include "ux_host_class_pima.h"
-/**************************************************************************/
-/* */
-/* FUNCTION RELEASE */
-/* */
-/* _ux_pictbridge_dpshost_thread PORTABLE C */
+/**************************************************************************/
+/* */
+/* FUNCTION RELEASE */
+/* */
+/* _ux_pictbridge_dpshost_thread PORTABLE C */
/* 6.1.12 */
/* AUTHOR */
/* */
/* Chaoqiong Xiao, Microsoft Corporation */
/* */
/* DESCRIPTION */
-/* */
-/* This is the Pictbridge dpshost thread that receives and execute */
-/* notifications from the dpsclient. */
-/* */
-/* INPUT */
-/* */
-/* pictbridge Pictbridge instance */
-/* */
-/* OUTPUT */
-/* */
-/* Completion Status */
-/* */
-/* CALLS */
-/* */
-/* */
-/* CALLED BY */
-/* */
-/* user application */
-/* */
-/* RELEASE HISTORY */
-/* */
-/* 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 */
-/* 04-25-2022 Yajun Xia Modified comment(s), */
-/* internal clean up, */
-/* resulting in version 6.1.11 */
-/* 07-29-2022 Chaoqiong Xiao Modified comment(s), */
-/* cleared compile warning, */
-/* used macros for RTOS calls, */
-/* resulting in version 6.1.12 */
+/* */
+/* This is the Pictbridge dpshost thread that receives and execute */
+/* notifications from the dpsclient. */
+/* */
+/* INPUT */
+/* */
+/* pictbridge Pictbridge instance */
+/* */
+/* OUTPUT */
+/* */
+/* Completion Status */
+/* */
+/* CALLS */
+/* */
+/* */
+/* CALLED BY */
+/* */
+/* user application */
/* */
/**************************************************************************/
VOID _ux_pictbridge_dpshost_thread(ULONG parameter)
@@ -89,9 +72,9 @@ UINT status;
/* Cast the parameter passed in the thread into the pictbridge pointer. */
UX_THREAD_EXTENSION_PTR_GET(pictbridge, UX_PICTBRIDGE, parameter)
- /* Loop forever waiting for changes signaled through the semaphore. */
+ /* Loop forever waiting for changes signaled through the semaphore. */
while (1)
- {
+ {
/* Wait for the semaphore to be put by the root hub or a regular hub. */
_ux_system_semaphore_get_norc(&pictbridge -> ux_pictbridge_notification_semaphore, UX_WAIT_FOREVER);
@@ -99,19 +82,19 @@ UINT status;
/* Check if there is an event. Normally there should be at least one since we got awaken. */
if (pictbridge -> ux_pictbridge_event_array_tail != pictbridge -> ux_pictbridge_event_array_head)
{
-
+
/* Get the current event tail. */
pictbridge_event = pictbridge -> ux_pictbridge_event_array_tail;
-
+
/* Compute the next entry in the event array. */
if ((pictbridge -> ux_pictbridge_event_array_tail + 1) == pictbridge -> ux_pictbridge_event_array_end)
-
+
/* Start at the beginning of the list. */
pictbridge -> ux_pictbridge_event_array_tail = pictbridge -> ux_pictbridge_event_array;
else
/* Point to the next entry in the event array. */
- pictbridge -> ux_pictbridge_event_array_tail = pictbridge -> ux_pictbridge_event_array_tail + 1;
+ pictbridge -> ux_pictbridge_event_array_tail = pictbridge -> ux_pictbridge_event_array_tail + 1;
/* Analyze the event type. */
switch (pictbridge_event -> ux_pictbridge_event_code)
@@ -129,8 +112,8 @@ UINT status;
pictbridge -> ux_pictbridge_host_client_state_machine |= UX_PICTBRIDGE_STATE_MACHINE_CLIENT_REQUEST_PENDING;
/* Wait for the host pending request to be completed. */
- status = _ux_system_event_flags_get(&pictbridge -> ux_pictbridge_event_flags_group,
- UX_PICTBRIDGE_EVENT_FLAG_STATE_MACHINE_READY,
+ status = _ux_system_event_flags_get(&pictbridge -> ux_pictbridge_event_flags_group,
+ UX_PICTBRIDGE_EVENT_FLAG_STATE_MACHINE_READY,
UX_AND_CLEAR, &actual_flags, UX_PICTBRIDGE_EVENT_TIMEOUT);
/* Reset the state machine to not Host Request pending. */
@@ -143,7 +126,7 @@ UINT status;
/* Status good means flag match, no need to check variable again, mark it unused. */
(void)actual_flags;
}
-
+
/* Change the state machine to client request being executed. */
pictbridge -> ux_pictbridge_host_client_state_machine |= UX_PICTBRIDGE_STATE_MACHINE_CLIENT_REQUEST;
@@ -155,8 +138,8 @@ UINT status;
{
/* Yes, so we need to set the event that advertise the completion of the host request. */
- status = _ux_system_event_flags_set_rc(&pictbridge -> ux_pictbridge_event_flags_group,
- UX_PICTBRIDGE_EVENT_FLAG_STATE_MACHINE_READY,
+ status = _ux_system_event_flags_set_rc(&pictbridge -> ux_pictbridge_event_flags_group,
+ UX_PICTBRIDGE_EVENT_FLAG_STATE_MACHINE_READY,
UX_AND);
/* Check status. */
if (status != UX_SUCCESS)
@@ -171,26 +154,26 @@ UINT status;
/* Check to see if we had a configureprint service request. */
if (pictbridge -> ux_pictbridge_input_request == UX_PICTBRIDGE_IR_GET_CAPABILITY)
{
-
+
/* Parse the tag code that was memorized during the input. */
if (pictbridge -> ux_pictbridge_input_tags & UX_PICTBRIDGE_IR_GC_CROPPINGS)
/* We did have a request, notify the camera of our status. */
_ux_pictbridge_dpshost_input_object_send(pictbridge, UX_PICTBRIDGE_IR_NOTIFY_DEVICE_STATUS);
-
+
}
break;
case UX_PICTBRIDGE_EC_START_JOB :
-
+
/* We have received an order to print one or more picture. */
_ux_pictbridge_dpshost_startjob(pictbridge);
break;
default :
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 c85371b6..64172299 100644
--- a/common/usbx_pictbridge/src/ux_pictbridge_element_to_decimal.c
+++ b/common/usbx_pictbridge/src/ux_pictbridge_element_to_decimal.c
@@ -1,18 +1,19 @@
/***************************************************************************
- * Copyright (c) 2024 Microsoft Corporation
- *
+ * Copyright (c) 2024 Microsoft Corporation
+ * Copyright (c) 2026-present Eclipse ThreadX contributors
+ *
* This program and the accompanying materials are made available under the
* terms of the MIT License which is available at
* https://opensource.org/licenses/MIT.
- *
+ *
* SPDX-License-Identifier: MIT
**************************************************************************/
/**************************************************************************/
/**************************************************************************/
-/** */
-/** USBX Component */
+/** */
+/** USBX Component */
/** */
/** Pictbridge Application */
/** */
@@ -28,43 +29,35 @@
#include "ux_pictbridge.h"
-/**************************************************************************/
-/* */
-/* FUNCTION RELEASE */
-/* */
-/* _ux_pictbridge_element_to_decimal PORTABLE C */
+/**************************************************************************/
+/* */
+/* FUNCTION RELEASE */
+/* */
+/* _ux_pictbridge_element_to_decimal PORTABLE C */
/* 6.1 */
/* AUTHOR */
/* */
/* Chaoqiong Xiao, Microsoft Corporation */
/* */
/* DESCRIPTION */
-/* */
-/* This function translates an element into a decimal value. */
-/* */
-/* INPUT */
-/* */
-/* element Where to store the element */
-/* decimal_value Value to be returned */
-/* */
-/* OUTPUT */
-/* */
-/* Completion Status */
-/* */
-/* CALLS */
-/* */
-/* */
-/* CALLED BY */
-/* */
-/* _ux_pictbridge_object_parse */
-/* */
-/* RELEASE HISTORY */
-/* */
-/* DATE NAME DESCRIPTION */
-/* */
-/* 05-19-2020 Chaoqiong Xiao Initial Version 6.0 */
-/* 09-30-2020 Chaoqiong Xiao Modified comment(s), */
-/* resulting in version 6.1 */
+/* */
+/* This function translates an element into a decimal value. */
+/* */
+/* INPUT */
+/* */
+/* element Where to store the element */
+/* decimal_value Value to be returned */
+/* */
+/* OUTPUT */
+/* */
+/* Completion Status */
+/* */
+/* CALLS */
+/* */
+/* */
+/* CALLED BY */
+/* */
+/* _ux_pictbridge_object_parse */
/* */
/**************************************************************************/
UINT _ux_pictbridge_element_to_decimal(UCHAR *element, ULONG *decimal_value)
@@ -87,63 +80,63 @@ UINT status;
/* Get the element length. Should not be more than 8 characters. */
element_length = string_length;
-
+
/* Check the length. Error if 0. */
if (element_length == 0)
-
+
/* We have a syntax violation. */
- return(UX_ERROR);
+ return(UX_ERROR);
/* Reset the local decimal value. */
local_decimal_value = 0;
-
+
/* Calculate the multiplier value. First reset it. */
multiplier = 1;
-
+
/* Set the length of the string. */
multiplier_length = element_length;
-
+
/* Build the multiplier : 10 square length. */
while (multiplier_length-- > 1)
-
+
/* Add another decimal. */
multiplier = multiplier * 10;
-
+
/* We parse the element and build the decimal value one byte at a type. */
while(element_length)
{
-
+
/* Get the element content. */
element_content = *element;
-
+
/* Check for the element content. Should be >0 <9. */
if (element_content >= '0' && element_content <= '9')
-
+
/* We have a digit. */
element_decimal = (UCHAR)(element_content - '0');
- else
+ else
/* We have a syntax violation. */
- return(UX_ERROR);
+ return(UX_ERROR);
/* Add the found value to the current cumulated decimal value. */
local_decimal_value += (ULONG) element_decimal * multiplier;
/* Next position. */
element++;
-
+
/* Update length. */
element_length--;
/* Reduce the multiplier by one decimal. */
multiplier = multiplier / 10;
-
- }
+
+ }
/* We have finished building the 32 bit decimal value. */
- *decimal_value = local_decimal_value;
+ *decimal_value = local_decimal_value;
/* Operation was successful. */
- return(UX_SUCCESS);
+ return(UX_SUCCESS);
}
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 6458c081..2f1ada9a 100644
--- a/common/usbx_pictbridge/src/ux_pictbridge_element_to_hexa.c
+++ b/common/usbx_pictbridge/src/ux_pictbridge_element_to_hexa.c
@@ -1,18 +1,19 @@
/***************************************************************************
- * Copyright (c) 2024 Microsoft Corporation
- *
+ * Copyright (c) 2024 Microsoft Corporation
+ * Copyright (c) 2026-present Eclipse ThreadX contributors
+ *
* This program and the accompanying materials are made available under the
* terms of the MIT License which is available at
* https://opensource.org/licenses/MIT.
- *
+ *
* SPDX-License-Identifier: MIT
**************************************************************************/
/**************************************************************************/
/**************************************************************************/
-/** */
-/** USBX Component */
+/** */
+/** USBX Component */
/** */
/** Pictbridge Application */
/** */
@@ -28,46 +29,35 @@
#include "ux_pictbridge.h"
-/**************************************************************************/
-/* */
-/* FUNCTION RELEASE */
-/* */
-/* _ux_pictbridge_element_to_hexa PORTABLE C */
+/**************************************************************************/
+/* */
+/* FUNCTION RELEASE */
+/* */
+/* _ux_pictbridge_element_to_hexa PORTABLE C */
/* 6.1.11 */
/* AUTHOR */
/* */
/* Chaoqiong Xiao, Microsoft Corporation */
/* */
/* DESCRIPTION */
-/* */
-/* This function translates an element into an hexa value. */
-/* */
-/* INPUT */
-/* */
-/* element Where to store the element */
-/* hexa_value Value to be returned */
-/* */
-/* OUTPUT */
-/* */
-/* Completion Status */
-/* */
-/* CALLS */
-/* */
-/* */
-/* CALLED BY */
-/* */
-/* _ux_pictbridge_object_parse */
-/* */
-/* RELEASE HISTORY */
-/* */
-/* DATE NAME DESCRIPTION */
-/* */
-/* 05-19-2020 Chaoqiong Xiao Initial Version 6.0 */
-/* 09-30-2020 Chaoqiong Xiao Modified comment(s), */
-/* resulting in version 6.1 */
-/* 04-25-2022 Yajun Xia Modified comment(s), */
-/* internal clean up, */
-/* resulting in version 6.1.11 */
+/* */
+/* This function translates an element into an hexa value. */
+/* */
+/* INPUT */
+/* */
+/* element Where to store the element */
+/* hexa_value Value to be returned */
+/* */
+/* OUTPUT */
+/* */
+/* Completion Status */
+/* */
+/* CALLS */
+/* */
+/* */
+/* CALLED BY */
+/* */
+/* _ux_pictbridge_object_parse */
/* */
/**************************************************************************/
UINT _ux_pictbridge_element_to_hexa(UCHAR *element, ULONG *hexa_value)
@@ -88,74 +78,74 @@ UINT status;
/* Get the element length. Should not be more than 8 characters. */
element_length = string_length;
-
+
/* Check the length. Error if 0. */
if (element_length == 0)
-
+
/* We have a syntax violation. */
- return(UX_ERROR);
+ return(UX_ERROR);
/* Reset the local hexa value. */
local_hexa_value = 0;
-
+
/* We parse the element and build the hexa value one byte at a type. */
while(element_length)
{
-
+
/* Shift the previous content by 1 nibble. */
local_hexa_value = (local_hexa_value << 4) & 0xFFFFFFFFu;
-
+
/* Get the element content. */
element_content = *element;
-
+
/* Check for the element content. Should be >0 <9 or 'A' to 'F'. */
- if ((element_content >= '0' && element_content <= '9') ||
+ if ((element_content >= '0' && element_content <= '9') ||
(element_content >= 'a' && element_content <= 'f') ||
(element_content >= 'A' && element_content <= 'F'))
{
-
+
/* We have a valid element content. Turn it into a hexa decimal value. */
if (element_content >= '0' && element_content <= '9')
-
+
/* We have a digit. */
element_hexa = (UCHAR)(element_content - '0');
-
+
else
- {
+ {
/* We have a 'A' to 'F' or 'a' to 'f' value. */
- if (element_content >= 'a' && element_content <= 'f')
+ if (element_content >= 'a' && element_content <= 'f')
/* We have a 'a' to 'f' char. */
element_hexa = (UCHAR)(element_content - 'a' + 10);
-
- else
-
+
+ else
+
/* We have a 'A' to 'F' char. */
element_hexa = (UCHAR)(element_content - 'A' + 10);
-
-
- }
+
+
+ }
}
- else
+ else
/* We have a syntax violation. */
- return(UX_ERROR);
+ return(UX_ERROR);
/* Add the found value to the current cumulated hexa value. */
local_hexa_value |= element_hexa;
/* Next position. */
element++;
-
+
/* Update length. */
element_length--;
-
- }
+
+ }
/* We have finished building the 32 bit hexa value. */
- *hexa_value = local_hexa_value;
+ *hexa_value = local_hexa_value;
/* Operation was successful. */
- return(UX_SUCCESS);
+ return(UX_SUCCESS);
}
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 ed56cb7a..c26539dd 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
@@ -1,18 +1,19 @@
/***************************************************************************
- * Copyright (c) 2024 Microsoft Corporation
- *
+ * Copyright (c) 2024 Microsoft Corporation
+ * Copyright (c) 2026-present Eclipse ThreadX contributors
+ *
* This program and the accompanying materials are made available under the
* terms of the MIT License which is available at
* https://opensource.org/licenses/MIT.
- *
+ *
* SPDX-License-Identifier: MIT
**************************************************************************/
/**************************************************************************/
/**************************************************************************/
-/** */
-/** USBX Component */
+/** */
+/** USBX Component */
/** */
/** Pictbridge Application */
/** */
@@ -28,19 +29,19 @@
#include "ux_pictbridge.h"
-/**************************************************************************/
-/* */
-/* FUNCTION RELEASE */
-/* */
-/* _ux_pictbridge_hexa_to_decimal_string PORTABLE C */
+/**************************************************************************/
+/* */
+/* FUNCTION RELEASE */
+/* */
+/* _ux_pictbridge_hexa_to_decimal_string PORTABLE C */
/* 6.1.11 */
/* AUTHOR */
/* */
/* Chaoqiong Xiao, Microsoft Corporation */
/* */
/* DESCRIPTION */
-/* */
-/* This function translates an hexa value into a decimal string. */
+/* */
+/* This function translates an hexa value into a decimal string. */
/* */
/* Note: */
/* Number of max_digit_string_size must be large enough to fit digits */
@@ -49,41 +50,27 @@
/* than max_digit_string_size to accept converted characters. */
/* When leading zeros are off, the converted string ends before */
/* reaching buffer end and zeros are padded. */
-/* */
-/* INPUT */
-/* */
-/* hexa_value Value to be translated */
-/* decimal_string Where to store the element */
+/* */
+/* INPUT */
+/* */
+/* hexa_value Value to be translated */
+/* decimal_string Where to store the element */
/* leading_zero_flag If leading zeroes are OK */
/* max_digit_string_size Max number of digits (<=8) */
-/* */
-/* OUTPUT */
-/* */
-/* Completion Status */
-/* */
-/* CALLS */
-/* */
-/* */
-/* CALLED BY */
-/* */
-/* _ux_pictbridge_object_parse */
-/* */
-/* RELEASE HISTORY */
-/* */
-/* DATE NAME DESCRIPTION */
-/* */
-/* 05-19-2020 Chaoqiong Xiao Initial Version 6.0 */
-/* 09-30-2020 Chaoqiong Xiao Modified comment(s), */
-/* verified memset and memcpy */
-/* cases, */
-/* resulting in version 6.1 */
-/* 04-25-2022 Yajun Xia Modified comment(s), */
-/* fixed maximum decimal */
-/* calculation issue, */
-/* resulting in version 6.1.11 */
+/* */
+/* OUTPUT */
+/* */
+/* Completion Status */
+/* */
+/* CALLS */
+/* */
+/* */
+/* CALLED BY */
+/* */
+/* _ux_pictbridge_object_parse */
/* */
/**************************************************************************/
-UINT _ux_pictbridge_hexa_to_decimal_string(ULONG hexa_value, UCHAR *decimal_string,
+UINT _ux_pictbridge_hexa_to_decimal_string(ULONG hexa_value, UCHAR *decimal_string,
ULONG leading_zero_flag, ULONG max_digit_string_size)
{
@@ -130,9 +117,9 @@ ULONG decimal_max[8] = {9, 99, 999, 9999, 99999, 999999, 99999
/* Set the leading zero flag. */
if (leading_zero_flag == UX_PICTBRIDGE_LEADING_ZERO_ON)
leading_flag = UX_FALSE;
- else
+ else
leading_flag = UX_TRUE;
-
+
/* Reset the decimal_string buffer. */
_ux_utility_memory_set(decimal_string, 0, max_digit_string_size); /* Use case of memset is verified. */
@@ -142,23 +129,23 @@ ULONG decimal_max[8] = {9, 99, 999, 9999, 99999, 999999, 99999
/* Divide the hexa value by the shift and decode the leading digital. */
decimal_value = hexa_value / decimal_string_shift;
- /* If the result is non zero, we can insert that decimal in the string.
+ /* If the result is non zero, we can insert that decimal in the string.
There is a special case if the value is the last decimal or if the leading flag is off. */
if (decimal_value != 0 || decimal_string_shift == 1 || leading_flag == UX_FALSE)
{
/* Insert the value. */
*decimal_string++ = (UCHAR)(decimal_value + '0');
-
+
/* Reset the leading flag. */
leading_flag = UX_FALSE;
}
/* Reduce the shift value to the next decimal. */
- decimal_string_shift = decimal_string_shift / 10;
-
- }
+ decimal_string_shift = decimal_string_shift / 10;
+
+ }
/* Operation was successful. */
- return(UX_SUCCESS);
+ return(UX_SUCCESS);
}
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 196f251b..5433681f 100644
--- a/common/usbx_pictbridge/src/ux_pictbridge_hexa_to_element.c
+++ b/common/usbx_pictbridge/src/ux_pictbridge_hexa_to_element.c
@@ -1,18 +1,19 @@
/***************************************************************************
- * Copyright (c) 2024 Microsoft Corporation
- *
+ * Copyright (c) 2024 Microsoft Corporation
+ * Copyright (c) 2026-present Eclipse ThreadX contributors
+ *
* This program and the accompanying materials are made available under the
* terms of the MIT License which is available at
* https://opensource.org/licenses/MIT.
- *
+ *
* SPDX-License-Identifier: MIT
**************************************************************************/
/**************************************************************************/
/**************************************************************************/
-/** */
-/** USBX Component */
+/** */
+/** USBX Component */
/** */
/** Pictbridge Application */
/** */
@@ -28,51 +29,38 @@
#include "ux_pictbridge.h"
-/**************************************************************************/
-/* */
-/* FUNCTION RELEASE */
-/* */
-/* _ux_pictbridge_hexa_to_element PORTABLE C */
+/**************************************************************************/
+/* */
+/* FUNCTION RELEASE */
+/* */
+/* _ux_pictbridge_hexa_to_element PORTABLE C */
/* 6.1.11 */
/* AUTHOR */
/* */
/* Chaoqiong Xiao, Microsoft Corporation */
/* */
/* DESCRIPTION */
-/* */
-/* This function translates an hexa value into an element. */
-/* */
+/* */
+/* This function translates an hexa value into an element. */
+/* */
/* Note: the size of the element buffer must be equal to or larger than*/
/* 8 to fill all converted characters. */
-/* */
-/* INPUT */
-/* */
-/* hexa_value Value to be translated */
-/* element Where to store the element */
-/* */
-/* OUTPUT */
-/* */
-/* Completion Status */
-/* */
-/* CALLS */
-/* */
-/* */
-/* CALLED BY */
-/* */
-/* _ux_pictbridge_object_parse */
-/* */
-/* RELEASE HISTORY */
-/* */
-/* DATE NAME DESCRIPTION */
-/* */
-/* 05-19-2020 Chaoqiong Xiao Initial Version 6.0 */
-/* 09-30-2020 Chaoqiong Xiao Modified comment(s), */
-/* verified memset and memcpy */
-/* cases, */
-/* resulting in version 6.1 */
-/* 04-25-2022 Yajun Xia Modified comment(s), */
-/* internal clean up, */
-/* resulting in version 6.1.11 */
+/* */
+/* INPUT */
+/* */
+/* hexa_value Value to be translated */
+/* element Where to store the element */
+/* */
+/* OUTPUT */
+/* */
+/* Completion Status */
+/* */
+/* CALLS */
+/* */
+/* */
+/* CALLED BY */
+/* */
+/* _ux_pictbridge_object_parse */
/* */
/**************************************************************************/
UINT _ux_pictbridge_hexa_to_element(ULONG hexa_value, UCHAR *element)
@@ -82,10 +70,10 @@ ULONG element_length;
ULONG local_hexa_value;
UCHAR element_hexa;
ULONG element_shift;
-
+
/* Reset the element buffer. */
_ux_utility_memory_set(element, 0, 8); /* Use case of memset is verified. */
-
+
/* Reset the value of the length.*/
element_length = 0;
@@ -95,27 +83,27 @@ ULONG element_shift;
/* We parse the hexa value element and build the hexa value one byte at a type. */
while(element_length < 8)
{
-
+
/* Shift the 4 bit value we are interested in. We keep the lowest nibble. */
local_hexa_value = (hexa_value >> element_shift) & 0x0f;
-
+
/* See if this value is from 0-9 or A to F. */
if (local_hexa_value <= 9)
-
+
/* We have a digit. */
element_hexa = (UCHAR)(local_hexa_value + '0');
-
+
else
/* We have 'A' to 'F' value. */
element_hexa = (UCHAR)(local_hexa_value - 10 + 'A');
-
+
/* Store the converted hexa value. */
*element = element_hexa;
/* Next position. */
element++;
-
+
/* Update length. */
element_length++;
@@ -128,9 +116,9 @@ ULONG element_shift;
{
break;
}
- }
+ }
/* Operation was successful. */
- return(UX_SUCCESS);
+ return(UX_SUCCESS);
}
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 b92f2817..7066886b 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
@@ -1,18 +1,19 @@
/***************************************************************************
- * Copyright (c) 2024 Microsoft Corporation
- *
+ * Copyright (c) 2024 Microsoft Corporation
+ * Copyright (c) 2026-present Eclipse ThreadX contributors
+ *
* This program and the accompanying materials are made available under the
* terms of the MIT License which is available at
* https://opensource.org/licenses/MIT.
- *
+ *
* SPDX-License-Identifier: MIT
**************************************************************************/
/**************************************************************************/
/**************************************************************************/
-/** */
-/** USBX Component */
+/** */
+/** USBX Component */
/** */
/** Pictbridge Application */
/** */
@@ -29,49 +30,39 @@
#include "ux_pictbridge.h"
-/**************************************************************************/
-/* */
-/* FUNCTION RELEASE */
-/* */
-/* _ux_pictbridge_hexa_to_major_minor PORTABLE C */
+/**************************************************************************/
+/* */
+/* FUNCTION RELEASE */
+/* */
+/* _ux_pictbridge_hexa_to_major_minor PORTABLE C */
/* 6.1 */
/* AUTHOR */
/* */
/* Chaoqiong Xiao, Microsoft Corporation */
/* */
/* DESCRIPTION */
-/* */
-/* This function translates an hexa value into an major.minor value */
+/* */
+/* This function translates an hexa value into an major.minor value */
/* (xx.xx). */
-/* */
+/* */
/* Note: the space of the output_buffer must be equal to or larger */
/* than 5 to fill all converted characters. */
/* */
-/* INPUT */
-/* */
-/* hexa_value Value to be translated */
-/* output_buffer Where to store the result */
-/* */
-/* OUTPUT */
-/* */
-/* Completion Status */
-/* */
-/* CALLS */
-/* */
-/* */
-/* CALLED BY */
-/* */
-/* _ux_pictbridge_object_parse */
-/* */
-/* RELEASE HISTORY */
-/* */
-/* DATE NAME DESCRIPTION */
-/* */
-/* 05-19-2020 Chaoqiong Xiao Initial Version 6.0 */
-/* 09-30-2020 Chaoqiong Xiao Modified comment(s), */
-/* verified memset and memcpy */
-/* cases, */
-/* resulting in version 6.1 */
+/* INPUT */
+/* */
+/* hexa_value Value to be translated */
+/* output_buffer Where to store the result */
+/* */
+/* OUTPUT */
+/* */
+/* Completion Status */
+/* */
+/* CALLS */
+/* */
+/* */
+/* CALLED BY */
+/* */
+/* _ux_pictbridge_object_parse */
/* */
/**************************************************************************/
UINT _ux_pictbridge_hexa_to_major_minor(ULONG hexa_value, UCHAR *output_buffer)
@@ -84,11 +75,11 @@ UINT status;
/* Reset the output buffer. */
_ux_utility_memory_set(output_buffer, 0, 5); /* Use case of memset is verified. */
-
+
/* Isolate the major. */
hexa_major = (UCHAR)(hexa_value >> 16);
- /* Isolate the minor. */
+ /* Isolate the minor. */
hexa_minor = (UCHAR)(hexa_value & 0xFFFF);
/* Insert the decimal value of the major. */
@@ -98,7 +89,7 @@ UINT status;
/* Update the address of the destination. */
output_buffer += 2;
-
+
/* Insert the '.' between major and minor. */
*output_buffer++ = '.';
@@ -108,6 +99,6 @@ UINT status;
return(status);
/* Operation was successful. */
- return(UX_SUCCESS);
+ return(UX_SUCCESS);
}
diff --git a/common/usbx_pictbridge/src/ux_pictbridge_object_parse.c b/common/usbx_pictbridge/src/ux_pictbridge_object_parse.c
index 73a2f916..565292ee 100644
--- a/common/usbx_pictbridge/src/ux_pictbridge_object_parse.c
+++ b/common/usbx_pictbridge/src/ux_pictbridge_object_parse.c
@@ -1,18 +1,19 @@
/***************************************************************************
- * Copyright (c) 2024 Microsoft Corporation
- *
+ * Copyright (c) 2024 Microsoft Corporation
+ * Copyright (c) 2026-present Eclipse ThreadX contributors
+ *
* This program and the accompanying materials are made available under the
* terms of the MIT License which is available at
* https://opensource.org/licenses/MIT.
- *
+ *
* SPDX-License-Identifier: MIT
**************************************************************************/
/**************************************************************************/
/**************************************************************************/
-/** */
-/** USBX Component */
+/** */
+/** USBX Component */
/** */
/** Pictbridge Application */
/** */
@@ -28,47 +29,36 @@
#include "ux_pictbridge.h"
-/**************************************************************************/
-/* */
-/* FUNCTION RELEASE */
-/* */
-/* _ux_pictbridge_object_parse PORTABLE C */
+/**************************************************************************/
+/* */
+/* FUNCTION RELEASE */
+/* */
+/* _ux_pictbridge_object_parse PORTABLE C */
/* 6.3.0 */
/* AUTHOR */
/* */
/* Chaoqiong Xiao, Microsoft Corporation */
/* */
/* DESCRIPTION */
-/* */
-/* This function parses a XML based pictbridge object. */
-/* */
-/* INPUT */
-/* */
-/* pictbridge Pictbridge instance */
-/* xml_object_buffer Pointer to object buffer */
-/* xml_object_length Length of the object */
-/* */
-/* OUTPUT */
-/* */
-/* Completion Status */
-/* */
-/* CALLS */
-/* */
-/* */
-/* CALLED BY */
-/* */
-/* _ux_pictbridge_object_get */
-/* */
-/* RELEASE HISTORY */
-/* */
-/* DATE NAME DESCRIPTION */
-/* */
-/* 05-19-2020 Chaoqiong Xiao Initial Version 6.0 */
-/* 09-30-2020 Chaoqiong Xiao Modified comment(s), */
-/* resulting in version 6.1 */
-/* 10-31-2023 Chaoqiong Xiao Modified comment(s), */
-/* checked tag nesting depth, */
-/* resulting in version 6.3.0 */
+/* */
+/* This function parses a XML based pictbridge object. */
+/* */
+/* INPUT */
+/* */
+/* pictbridge Pictbridge instance */
+/* xml_object_buffer Pointer to object buffer */
+/* xml_object_length Length of the object */
+/* */
+/* OUTPUT */
+/* */
+/* Completion Status */
+/* */
+/* CALLS */
+/* */
+/* */
+/* CALLED BY */
+/* */
+/* _ux_pictbridge_object_get */
/* */
/**************************************************************************/
UINT _ux_pictbridge_object_parse(UX_PICTBRIDGE *pictbridge, UCHAR *xml_object_buffer,
@@ -90,16 +80,16 @@ UINT status;
/* Set the tag position at root. */
tag_item = _ux_pictbridge_xml_item_root;
-
+
/* Clear the input tags. */
pictbridge -> ux_pictbridge_input_tags = 0;
/* Clear the input request. */
pictbridge -> ux_pictbridge_input_request = 0;
-
+
/* Tag history index is at root. */
tag_history_index = 0;
-
+
/* Closing tag count is reset. */
closing_tag_count = 0;
@@ -112,20 +102,20 @@ UINT status;
{
/* Scan the object buffer for a tag. */
- status = _ux_pictbridge_tag_name_get(xml_object_buffer, xml_object_length, tag_name,
- variable_name, variable_string, xml_parameter,
+ status = _ux_pictbridge_tag_name_get(xml_object_buffer, xml_object_length, tag_name,
+ variable_name, variable_string, xml_parameter,
&xml_object_buffer, &xml_object_length, &tag_flag);
-
+
/* We may have an error. Check if this is an empty line in which case we are done. */
if (status != UX_SUCCESS)
{
-
+
/* Check for empty line. */
if (status == UX_PICTBRIDGE_ERROR_EMPTY_LINE)
-
+
/* Yes, we have an empty line. Do not proceed but we have a successful completion. */
status = UX_SUCCESS;
-
+
/* Do not proceed. */
break;
}
@@ -133,7 +123,7 @@ UINT status;
/* Check if this is a closing tag ? */
if (tag_flag & UX_PICTBRIDGE_TAG_FLAG_CLOSING)
{
-
+
/* Assume the worst. */
status = UX_PICTBRIDGE_ERROR_SCRIPT_SYNTAX_ERROR;
@@ -174,21 +164,21 @@ UINT status;
else
/* Syntax error. */
- break;
-
+ break;
+
/* Increment the closing tag count. */
closing_tag_count++;
-
+
/* If we have more than one closing tag consecutively, look for the parent. */
if (closing_tag_count > 1)
{
-
+
/* Get the parent for this item and set it as the current tag_item. We may already be at the root. */
if (tag_entry -> ux_pictbridge_xml_item_parent != UX_NULL)
-
+
/* We have a parent, set it. */
tag_item = tag_entry -> ux_pictbridge_xml_item_parent;
- }
+ }
/* We set status to success. */
status = UX_SUCCESS;
@@ -196,10 +186,10 @@ UINT status;
}
else
{
-
+
/* The tag name is in the tag_name variable but has not been verified yet. */
status = _ux_pictbridge_tag_name_scan(tag_item, tag_name, &tag_entry);
-
+
/* We may have an error. */
if (status != UX_SUCCESS)
@@ -209,7 +199,7 @@ UINT status;
/* Check if this is a comment tag ? */
if ((tag_flag & UX_PICTBRIDGE_TAG_FLAG_COMMENT) == 0)
{
-
+
/* Reset the closing tag count. */
closing_tag_count = 0;
@@ -219,14 +209,14 @@ UINT status;
/* Syntax error. */
status = UX_BUFFER_OVERFLOW;
-
+
/* Do not proceed. */
break;
}
/* Save the current tag in the tag history. */
tag_history[tag_history_index] = tag_entry;
-
+
/* Increase the current tag index. */
tag_history_index++;
@@ -239,7 +229,7 @@ UINT status;
/* This is a variable. Add it to the other ones. */
pictbridge -> ux_pictbridge_input_tags |= tag_entry -> ux_pictbridge_xml_item_tag_code;
-
+
else
/* Yes we have a tag code, memorize it. This is a main input request. */
@@ -250,39 +240,39 @@ UINT status;
{
/* There is a function associated, so call it. */
status = tag_entry -> ux_pictbridge_xml_item_function(pictbridge, variable_name, variable_string, xml_parameter);
-
+
/* We may have an error. */
if (status != UX_SUCCESS)
-
+
/* Do not proceed. */
break;
- }
+ }
- /* Check if the tag has a child attached to it.
+ /* Check if the tag has a child attached to it.
If there is neither a child or a function, it means we do not treat this tag name. */
if (tag_entry -> ux_pictbridge_xml_item_child != UX_NULL && tag_entry -> ux_pictbridge_xml_item_child != UX_PICTBRIDGE_XML_LEAF)
- {
-
+ {
+
/* We have a child, set it. */
tag_item = tag_entry -> ux_pictbridge_xml_item_child;
-
+
/* Reset the tag codes. */
pictbridge -> ux_pictbridge_input_tags = 0;
- }
+ }
/* Check if this is a self closing tag ? */
if (tag_flag & UX_PICTBRIDGE_TAG_FLAG_SELF_CLOSING)
{
-
+
/* Assume the worst. */
status = UX_PICTBRIDGE_ERROR_SCRIPT_SYNTAX_ERROR;
-
+
/* Ensure we do not have a closing tag without a prior normal tag entry. */
if (tag_history_index == 0)
-
+
/* Syntax error. */
break;
-
+
/* One step back in the tag history. */
tag_history_index--;
@@ -303,30 +293,30 @@ UINT status;
/* If both length do not match, no need to check for a match. */
if (tag_history_length == tag_name_length)
{
-
+
/* Both length match, we may have a tag match. Check the names */
if (_ux_utility_memory_compare(tag_name, tag_history[tag_history_index] -> ux_pictbridge_xml_item_tag_name,
tag_name_length) != UX_SUCCESS)
-
+
/* Syntax error. */
break;
}
else
-
+
/* Syntax error. */
- break;
-
+ break;
+
/* Increment the closing tag count. */
closing_tag_count++;
/* We set status to success. */
status = UX_SUCCESS;
- }
+ }
}
}
- }
+ }
/* Return completion status. */
- return(status);
+ return(status);
}
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 d758b984..a99b8d9e 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
@@ -1,18 +1,19 @@
/***************************************************************************
- * Copyright (c) 2024 Microsoft Corporation
- *
+ * Copyright (c) 2024 Microsoft Corporation
+ * Copyright (c) 2026-present Eclipse ThreadX contributors
+ *
* This program and the accompanying materials are made available under the
* terms of the MIT License which is available at
* https://opensource.org/licenses/MIT.
- *
+ *
* SPDX-License-Identifier: MIT
**************************************************************************/
/**************************************************************************/
/**************************************************************************/
-/** */
-/** USBX Component */
+/** */
+/** USBX Component */
/** */
/** Pictbridge Application */
/** */
@@ -28,22 +29,22 @@
#include "ux_pictbridge.h"
-/**************************************************************************/
-/* */
-/* FUNCTION RELEASE */
-/* */
-/* _ux_pictbridge_object_tag_line_add PORTABLE C */
+/**************************************************************************/
+/* */
+/* FUNCTION RELEASE */
+/* */
+/* _ux_pictbridge_object_tag_line_add PORTABLE C */
/* 6.1 */
/* AUTHOR */
/* */
/* Chaoqiong Xiao, Microsoft Corporation */
/* */
/* DESCRIPTION */
-/* */
-/* This function adds a tag line into the target xml object */
-/* */
-/* INPUT */
-/* */
+/* */
+/* This function adds a tag line into the target xml object */
+/* */
+/* INPUT */
+/* */
/* pima_object_buffer Pointer to object buffer */
/* object_length Length of the object */
/* tag_element Tag to insert */
@@ -54,37 +55,27 @@
/* pima_object_buffer_updated Updated Address of the object */
/* object_length_updated Updated length */
/* */
-/* */
-/* OUTPUT */
-/* */
-/* Completion Status */
-/* */
-/* CALLS */
-/* */
-/* */
-/* CALLED BY */
-/* */
-/* _ux_pictbridge_dpshost_object_get */
-/* */
-/* RELEASE HISTORY */
-/* */
-/* DATE NAME DESCRIPTION */
-/* */
-/* 05-19-2020 Chaoqiong Xiao Initial Version 6.0 */
-/* 09-30-2020 Chaoqiong Xiao Modified comment(s), */
-/* verified memset and memcpy */
-/* cases, */
-/* resulting in version 6.1 */
+/* */
+/* OUTPUT */
+/* */
+/* Completion Status */
+/* */
+/* CALLS */
+/* */
+/* */
+/* CALLED BY */
+/* */
+/* _ux_pictbridge_dpshost_object_get */
/* */
/**************************************************************************/
-UINT _ux_pictbridge_object_tag_line_add(UCHAR *pima_object_buffer,
- ULONG object_length,
+UINT _ux_pictbridge_object_tag_line_add(UCHAR *pima_object_buffer,
+ ULONG object_length,
UCHAR *tag_element_string,
ULONG tag_flag,
UCHAR *tag_variable,
ULONG tag_variable_value,
VOID *tag_element,
- UCHAR **pima_object_buffer_updated,
+ UCHAR **pima_object_buffer_updated,
ULONG *object_length_updated)
{
@@ -115,13 +106,13 @@ UINT status;
/* Insert a "<". */
*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); /* Use case of memcpy is verified. */
/* Update the object pointer position. */
pima_object_buffer += element_length;
-
+
/* Do we have a variable to insert after the opening tag ? */
if (tag_variable != UX_NULL)
{
@@ -157,13 +148,13 @@ UINT status;
/* Insert a " ". */
*pima_object_buffer++ = UX_PICTBRIDGE_TAG_CHAR_SPACE;
-
+
/* Create the variable string. */
_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;
-
+
/* Insert a "=". */
*pima_object_buffer++ = UX_PICTBRIDGE_TAG_CHAR_EQUAL;
@@ -176,10 +167,10 @@ UINT status;
/* Bad element. */
return(status);
-
+
/* Update the object pointer position. */
pima_object_buffer += 8;
-
+
/* Insert a quote. */
*pima_object_buffer++ = UX_PICTBRIDGE_TAG_CHAR_QUOTE;
}
@@ -215,7 +206,7 @@ UINT status;
can be a single value or an array of values. */
if (tag_flag & UX_PICTBRIDGE_TAG_FLAG_VARIABLE)
{
-
+
/* We have a single variable. Check its nature. Is it hexa ? */
if (tag_flag & UX_PICTBRIDGE_TAG_FLAG_VARIABLE_HEXA)
{
@@ -232,7 +223,7 @@ UINT status;
return(status);
element_length = 8;
}
-
+
/* Is it decimal ? */
if (tag_flag & UX_PICTBRIDGE_TAG_FLAG_VARIABLE_DECIMAL)
{
@@ -305,14 +296,14 @@ UINT status;
/* Update the object pointer position. */
pima_object_buffer += element_length;
-
+
object_length += element_length;
}
/* Is there an array to insert ? */
if (tag_flag & UX_PICTBRIDGE_TAG_FLAG_VARIABLE_ARRAY)
{
-
+
/* We have an array to insert. First reset the value index. */
value_index = 0;
@@ -330,7 +321,7 @@ UINT status;
/* Do bounds-checking. */
if (object_length > UX_PICTBRIDGE_MAX_PIMA_OBJECT_BUFFER)
return(UX_MEMORY_INSUFFICIENT);
-
+
/* Insert a space. */
*pima_object_buffer++ = UX_PICTBRIDGE_TAG_CHAR_SPACE;
}
@@ -351,7 +342,7 @@ UINT status;
return(status);
element_length = 8;
}
-
+
/* Is it decimal ? */
if (tag_flag & UX_PICTBRIDGE_TAG_FLAG_VARIABLE_ARRAY_DECIMAL)
{
@@ -359,7 +350,7 @@ UINT status;
/* Going to insert at maximum 8 chars. Do bounds-checking. */
if (object_length + 8 > UX_PICTBRIDGE_MAX_PIMA_OBJECT_BUFFER)
return(UX_MEMORY_INSUFFICIENT);
-
+
/* We have a array of decimal value to insert. */
status = _ux_pictbridge_hexa_to_decimal_string( *((ULONG *)tag_element + value_index), pima_object_buffer, UX_PICTBRIDGE_LEADING_ZERO_OFF, 8);
if (status != UX_SUCCESS)
@@ -368,7 +359,7 @@ UINT status;
return(status);
_ux_utility_string_length_check(pima_object_buffer, &element_length, 8);
}
-
+
/* Is it in the form 00.00 ? */
if (tag_flag & UX_PICTBRIDGE_TAG_FLAG_VARIABLE_ARRAY_MAJOR_MINOR)
{
@@ -376,7 +367,7 @@ UINT status;
/* Going to insert at maximum 5 chars. Do bounds-checking. */
if (object_length + 5 > UX_PICTBRIDGE_MAX_PIMA_OBJECT_BUFFER)
return(UX_MEMORY_INSUFFICIENT);
-
+
/* We have a array of major minor value to insert. */
status = _ux_pictbridge_hexa_to_major_minor( *((ULONG *) tag_element + value_index), pima_object_buffer);
if (status != UX_SUCCESS)
@@ -404,15 +395,15 @@ UINT status;
/* We have a string to insert. */
_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. */
pima_object_buffer += element_length;
-
+
/* And update the cumulated length of the object. */
object_length += element_length;
/* Next index value. */
- value_index++;
+ value_index++;
}
}
@@ -451,7 +442,7 @@ UINT status;
/* Insert a "/". */
*pima_object_buffer++ = UX_PICTBRIDGE_TAG_CHAR_SLASH;
-
+
/* Create the element string. */
_ux_utility_memory_copy(pima_object_buffer, tag_element_string, element_length); /* Use case of memcpy is verified. */
@@ -482,10 +473,10 @@ UINT status;
/* Update the caller's object position. */
*pima_object_buffer_updated = pima_object_buffer;
-
+
/* Update the caller's object length . */
*object_length_updated = object_length;
-
+
/* Return completion status. */
- return(UX_SUCCESS);
+ return(UX_SUCCESS);
}
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 a74f6587..6c2bceca 100644
--- a/common/usbx_pictbridge/src/ux_pictbridge_tag_name_get.c
+++ b/common/usbx_pictbridge/src/ux_pictbridge_tag_name_get.c
@@ -1,18 +1,19 @@
/***************************************************************************
- * Copyright (c) 2024 Microsoft Corporation
- *
+ * Copyright (c) 2024 Microsoft Corporation
+ * Copyright (c) 2026-present Eclipse ThreadX contributors
+ *
* This program and the accompanying materials are made available under the
* terms of the MIT License which is available at
* https://opensource.org/licenses/MIT.
- *
+ *
* SPDX-License-Identifier: MIT
**************************************************************************/
/**************************************************************************/
/**************************************************************************/
-/** */
-/** USBX Component */
+/** */
+/** USBX Component */
/** */
/** Pictbridge Application */
/** */
@@ -28,60 +29,50 @@
#include "ux_pictbridge.h"
-/**************************************************************************/
-/* */
-/* FUNCTION RELEASE */
-/* */
-/* _ux_pictbridge_tag_name_get PORTABLE C */
+/**************************************************************************/
+/* */
+/* FUNCTION RELEASE */
+/* */
+/* _ux_pictbridge_tag_name_get PORTABLE C */
/* 6.1 */
/* AUTHOR */
/* */
/* Chaoqiong Xiao, Microsoft Corporation */
/* */
/* DESCRIPTION */
-/* */
-/* This function isolates a tag name from the XML script. */
+/* */
+/* This function isolates a tag name from the XML script. */
/* */
/* Note: the buffer size of tag_name, variable_name, variable_string */
/* and xml_parameter must be equal to or greater than */
/* UX_PICTBRIDGE_MAX_TAG_SIZE, UX_PICTBRIDGE_MAX_VARIABLE_SIZE, */
/* UX_PICTBRIDGE_MAX_STRING_SIZE and UX_PICTBRIDGE_MAX_STRING_SIZE. */
-/* */
-/* INPUT */
-/* */
-/* input_buffer Pointer to object buffer */
-/* input_length Length of the object */
-/* tag_name Where to store the tag */
-/* variable_name Variable name */
-/* variable_string Variable string */
-/* xml_parameter ML parameter */
-/* output_buffer Pointer after the tag */
-/* output_length Length of the object */
-/* tag_flag flag specific to this tag */
-/* */
-/* OUTPUT */
-/* */
-/* Completion Status */
-/* */
-/* CALLS */
-/* */
-/* */
-/* CALLED BY */
-/* */
-/* _ux_pictbridge_object_parse */
-/* */
-/* RELEASE HISTORY */
-/* */
-/* DATE NAME DESCRIPTION */
-/* */
-/* 05-19-2020 Chaoqiong Xiao Initial Version 6.0 */
-/* 09-30-2020 Chaoqiong Xiao Modified comment(s), */
-/* verified memset and memcpy */
-/* cases, */
-/* resulting in version 6.1 */
+/* */
+/* INPUT */
+/* */
+/* input_buffer Pointer to object buffer */
+/* input_length Length of the object */
+/* tag_name Where to store the tag */
+/* variable_name Variable name */
+/* variable_string Variable string */
+/* xml_parameter ML parameter */
+/* output_buffer Pointer after the tag */
+/* output_length Length of the object */
+/* tag_flag flag specific to this tag */
+/* */
+/* OUTPUT */
+/* */
+/* Completion Status */
+/* */
+/* CALLS */
+/* */
+/* */
+/* CALLED BY */
+/* */
+/* _ux_pictbridge_object_parse */
/* */
/**************************************************************************/
-UINT _ux_pictbridge_tag_name_get(UCHAR *input_buffer, ULONG input_length,
+UINT _ux_pictbridge_tag_name_get(UCHAR *input_buffer, ULONG input_length,
UCHAR *tag_name,
UCHAR *variable_name,
UCHAR *variable_string,
@@ -98,13 +89,13 @@ UCHAR *xml_parameter_end;
/* Reset the local flags. */
flag = 0;
-
+
/* Reset the caller's tag_flag. */
*tag_flag = 0;
-
+
/* Char count reset. */
char_count = 0;
-
+
/* Reset the tag name buffer. */
_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;
@@ -127,9 +118,9 @@ UCHAR *xml_parameter_end;
/* Get a character from the tag line. */
switch (*input_buffer)
{
-
+
case UX_PICTBRIDGE_TAG_CHAR_START_BRACKET :
-
+
/* Check to see if we are within a quote. */
if (flag & UX_PICTBRIDGE_TAG_FLAG_IN_STRING)
{
@@ -141,7 +132,7 @@ UCHAR *xml_parameter_end;
break;
}
-
+
/* Check to see if we are already in the bracket. */
if (flag & UX_PICTBRIDGE_TAG_FLAG_BEGIN)
@@ -154,8 +145,8 @@ UCHAR *xml_parameter_end;
break;
-
-
+
+
case UX_PICTBRIDGE_TAG_CHAR_CR :
case UX_PICTBRIDGE_TAG_CHAR_LF :
@@ -165,11 +156,11 @@ UCHAR *xml_parameter_end;
/* We have a XML tag violation. */
return(UX_PICTBRIDGE_ERROR_PARAMETER_MISSING);
else
- break;
-
+ break;
+
case UX_PICTBRIDGE_TAG_CHAR_SPACE :
- /* If we are within a tag already, this masks the end. If not, continue looking for
+ /* If we are within a tag already, this masks the end. If not, continue looking for
an open bracket. */
if ((flag & UX_PICTBRIDGE_TAG_FLAG_BEGIN) == 0)
break;
@@ -192,15 +183,15 @@ UCHAR *xml_parameter_end;
/* get out of tag state machine. */
flag &= (ULONG)~UX_PICTBRIDGE_TAG_FLAG_IN_TAG;
-
+
/* Change state machine to variable. */
flag |= (ULONG)UX_PICTBRIDGE_TAG_FLAG_IN_VARIABLE;
}
break;
-
+
case UX_PICTBRIDGE_TAG_CHAR_EQUAL :
-
+
/* If we are not within a bracket, this is a loose character ! */
if ((flag & UX_PICTBRIDGE_TAG_FLAG_BEGIN) == 0)
break;
@@ -228,12 +219,12 @@ UCHAR *xml_parameter_end;
/* Get out of the variable state machine. */
flag &= (ULONG)~UX_PICTBRIDGE_TAG_FLAG_IN_VARIABLE;
-
+
/* Change state machine to expecting string. */
flag |= UX_PICTBRIDGE_TAG_FLAG_EXPECTING_STRING;
- }
- break;
+ }
+ break;
case UX_PICTBRIDGE_TAG_CHAR_QUOTE :
@@ -242,7 +233,7 @@ UCHAR *xml_parameter_end;
/* Get out of the in string state machine. We are out of any state now. */
flag &= (ULONG)~UX_PICTBRIDGE_TAG_FLAG_IN_STRING;
-
+
else
{
@@ -252,88 +243,88 @@ UCHAR *xml_parameter_end;
/* Get out of the expecting string state machine. */
flag &= (ULONG)~UX_PICTBRIDGE_TAG_FLAG_EXPECTING_STRING;
-
+
/* Change state machine to in string. */
flag |= UX_PICTBRIDGE_TAG_FLAG_IN_STRING;
- }
+ }
else
/* Loose character ! */
return(UX_PICTBRIDGE_ERROR_PARAMETER_MISSING);
-
+
}
- break;
+ break;
case UX_PICTBRIDGE_TAG_CHAR_SLASH :
-
+
/* If we are in no particular state at the moment, we could have a begin slash or end slash. */
if (flag & UX_PICTBRIDGE_TAG_FLAG_IN_STRING)
- {
+ {
/* We are in the variable string state machine. Store the "/" as a normal character. */
if (variable_string > variable_string_end)
return(UX_BUFFER_OVERFLOW);
*variable_string++ = *input_buffer;
-
+
break;
}
/* Check other states. */
if (flag & UX_PICTBRIDGE_TAG_FLAG_IN_TAG)
{
-
+
/* We are in a tag. 2 scenario here. We are either at the beginning or at the end. */
- if (char_count != 0)
-
+ if (char_count != 0)
+
/* We are at the end of the tag, this is a self closing tag. */
*tag_flag |= UX_PICTBRIDGE_TAG_FLAG_SELF_CLOSING;
-
+
else
-
+
/* This is a normal closing tag. */
*tag_flag |= UX_PICTBRIDGE_TAG_FLAG_CLOSING;
-
+
/* We are done here. */
- break;
+ break;
}
else
{
-
+
/* If we are out of any state machine, it must be a self closing tag. */
if (flag & (UX_PICTBRIDGE_TAG_FLAG_IN_VARIABLE | UX_PICTBRIDGE_TAG_FLAG_EXPECTING_STRING))
/* This is a syntax error, abort. */
return(UX_PICTBRIDGE_ERROR_PARAMETER_MISSING);
-
+
else
{
/* We are at the end of the tag, this is a self closing tag. */
*tag_flag |= UX_PICTBRIDGE_TAG_FLAG_SELF_CLOSING;
/* We are done here. */
- break;
+ break;
}
}
-
-
+
+
case UX_PICTBRIDGE_TAG_CHAR_QUESTION_MARK :
-
+
/* If we are in no particular state at the moment, we could have a begin ? or end ?. */
if (flag & UX_PICTBRIDGE_TAG_FLAG_IN_STRING)
-
+
/* We are within a quoted string, do not proceed. */
break;
else
-
+
/* This is a comment line, no need for a closing tag. */
*tag_flag |= UX_PICTBRIDGE_TAG_FLAG_COMMENT;
- break;
+ break;
case UX_PICTBRIDGE_TAG_CHAR_END_BRACKET :
@@ -348,17 +339,17 @@ UCHAR *xml_parameter_end;
break;
}
-
+
/* Check if we are within a bracket. */
if (flag & UX_PICTBRIDGE_TAG_FLAG_BEGIN)
{
/* Skip the closing bracket. */
input_buffer++;
-
+
/* Update length. */
input_length--;
-
+
/* We may have a xml parameter between the current tag and its closing counterpart. */
while(input_length)
{
@@ -372,53 +363,53 @@ UCHAR *xml_parameter_end;
/* Skip potential CR/LF. */
break;
-
-
+
+
case UX_PICTBRIDGE_TAG_CHAR_START_BRACKET :
-
+
/* We have found the beginning of the next tag.
Set the output buffer position to the next "<". */
*output_buffer = input_buffer;
-
+
/* Set the length remaining. */
*output_length = input_length;
/* We are done here. */
return(UX_SUCCESS);
-
+
default :
-
+
/* Whatever we have now, we store into the XML parameter. */
if (xml_parameter > xml_parameter_end)
return(UX_BUFFER_OVERFLOW);
*xml_parameter++ = *input_buffer;
break;
-
+
}
/* Next position. */
input_buffer++;
-
+
/* Update length. */
input_length--;
-
- }
+
+ }
/* Set the output buffer position. */
*output_buffer = input_buffer;
-
+
/* Set the length remaining. */
*output_length = input_length;
/* We have reached the end of the xml object. */
return(UX_SUCCESS);
-
+
}
else
-
+
/* We have a syntax error. */
return(UX_PICTBRIDGE_ERROR_SCRIPT_SYNTAX_ERROR);
-
+
default :
/* Check if we are within a bracket. */
@@ -452,31 +443,31 @@ UCHAR *xml_parameter_end;
return(UX_BUFFER_OVERFLOW);
*variable_string++ = *input_buffer;
}
-
+
break;
}
/* Next position. */
input_buffer++;
-
+
/* Update length. */
input_length--;
-
- }
- /* We get here when we reached an unexpected end of the XML object.
+ }
+
+ /* We get here when we reached an unexpected end of the XML object.
if we had a begin bracket, there is an unexpected end. If not, we
have an empty line. */
if (flag & UX_PICTBRIDGE_TAG_FLAG_BEGIN)
/* We have an error. */
- return(UX_PICTBRIDGE_ERROR_PARAMETER_MISSING);
-
+ return(UX_PICTBRIDGE_ERROR_PARAMETER_MISSING);
+
else
/* Not really an error, but we need to inform the caller there is no tag to process. */
- return(UX_PICTBRIDGE_ERROR_EMPTY_LINE);
-
+ return(UX_PICTBRIDGE_ERROR_EMPTY_LINE);
+
}
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 aef23545..99c23df1 100644
--- a/common/usbx_pictbridge/src/ux_pictbridge_tag_name_scan.c
+++ b/common/usbx_pictbridge/src/ux_pictbridge_tag_name_scan.c
@@ -1,18 +1,19 @@
/***************************************************************************
- * Copyright (c) 2024 Microsoft Corporation
- *
+ * Copyright (c) 2024 Microsoft Corporation
+ * Copyright (c) 2026-present Eclipse ThreadX contributors
+ *
* This program and the accompanying materials are made available under the
* terms of the MIT License which is available at
* https://opensource.org/licenses/MIT.
- *
+ *
* SPDX-License-Identifier: MIT
**************************************************************************/
/**************************************************************************/
/**************************************************************************/
-/** */
-/** USBX Component */
+/** */
+/** USBX Component */
/** */
/** Pictbridge Application */
/** */
@@ -28,49 +29,41 @@
#include "ux_pictbridge.h"
-/**************************************************************************/
-/* */
-/* FUNCTION RELEASE */
-/* */
-/* _ux_pictbridge_tag_name_scan PORTABLE C */
+/**************************************************************************/
+/* */
+/* FUNCTION RELEASE */
+/* */
+/* _ux_pictbridge_tag_name_scan PORTABLE C */
/* 6.1 */
/* AUTHOR */
/* */
/* Chaoqiong Xiao, Microsoft Corporation */
/* */
/* DESCRIPTION */
-/* */
-/* This function scans the tag name from a set of allowed tags */
-/* */
-/* INPUT */
-/* */
-/* tag_item list of allowed tags */
-/* tag_name the tag name to scan */
-/* tag_entry Address of the found tag */
-/* */
-/* OUTPUT */
-/* */
-/* Completion Status */
-/* */
-/* CALLS */
-/* */
-/* */
-/* CALLED BY */
-/* */
-/* _ux_pictbridge_object_parse */
-/* */
-/* RELEASE HISTORY */
-/* */
-/* DATE NAME DESCRIPTION */
-/* */
-/* 05-19-2020 Chaoqiong Xiao Initial Version 6.0 */
-/* 09-30-2020 Chaoqiong Xiao Modified comment(s), */
-/* resulting in version 6.1 */
+/* */
+/* This function scans the tag name from a set of allowed tags */
+/* */
+/* INPUT */
+/* */
+/* tag_item list of allowed tags */
+/* tag_name the tag name to scan */
+/* tag_entry Address of the found tag */
+/* */
+/* OUTPUT */
+/* */
+/* Completion Status */
+/* */
+/* CALLS */
+/* */
+/* */
+/* CALLED BY */
+/* */
+/* _ux_pictbridge_object_parse */
/* */
/**************************************************************************/
UINT _ux_pictbridge_tag_name_scan(UX_PICTBRIDGE_XML_ITEM *tag_item,
UCHAR *tag_name,
- UX_PICTBRIDGE_XML_ITEM **tag_entry)
+ UX_PICTBRIDGE_XML_ITEM **tag_entry)
{
UINT tag_name_length = 0;
UINT tag_item_length = 0;
@@ -85,7 +78,7 @@ UINT status;
/* Parse all the tags contained in the tag_item list. */
while(tag_item -> ux_pictbridge_xml_item_tag_name[0] != 0)
{
-
+
/* There is a valid entry in the tag list. Calculate the length of the tag name from the list. */
status = _ux_utility_string_length_check(tag_item -> ux_pictbridge_xml_item_tag_name, &tag_item_length, UX_PICTBRIDGE_MAX_TAG_SIZE);
if (status != UX_SUCCESS)
@@ -96,24 +89,24 @@ UINT status;
{
/* Both length match, we may have a tag match. Check the names */
- if (_ux_utility_memory_compare(tag_name, tag_item -> ux_pictbridge_xml_item_tag_name,
+ if (_ux_utility_memory_compare(tag_name, tag_item -> ux_pictbridge_xml_item_tag_name,
tag_item_length) == UX_SUCCESS)
{
-
+
/* We have found the tag. Save the entry in the caller tag_entry field. */
*tag_entry = tag_item;
-
+
/* We are done here. */
return(UX_SUCCESS);
-
- }
+
+ }
}
/* The tags length or the tag names did not match. Proceed to the next tag. */
- tag_item++;
- }
+ tag_item++;
+ }
/* We get here when we reached the end of the tag list and no match. */
- return(UX_PICTBRIDGE_ERROR_PARAMETER_UNKNOWN);
+ return(UX_PICTBRIDGE_ERROR_PARAMETER_UNKNOWN);
}
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 7a1fa2aa..ff56a036 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
@@ -1,18 +1,19 @@
/***************************************************************************
- * Copyright (c) 2024 Microsoft Corporation
- *
+ * Copyright (c) 2024 Microsoft Corporation
+ * Copyright (c) 2026-present Eclipse ThreadX contributors
+ *
* This program and the accompanying materials are made available under the
* terms of the MIT License which is available at
* https://opensource.org/licenses/MIT.
- *
+ *
* SPDX-License-Identifier: MIT
**************************************************************************/
/**************************************************************************/
/**************************************************************************/
-/** */
-/** USBX Component */
+/** */
+/** USBX Component */
/** */
/** Pictbridge Application */
/** */
@@ -28,51 +29,43 @@
#include "ux_pictbridge.h"
-/**************************************************************************/
-/* */
-/* FUNCTION RELEASE */
-/* */
-/* _ux_pictbridge_xml_function_input_getcapability_capability_layouts */
-/* PORTABLE C */
+/**************************************************************************/
+/* */
+/* FUNCTION RELEASE */
+/* */
+/* _ux_pictbridge_xml_function_input_getcapability_capability_layouts */
+/* PORTABLE C */
/* 6.1 */
-/* */
-/* */
+/* */
+/* */
/* AUTHOR */
/* */
/* Chaoqiong Xiao, Microsoft Corporation */
/* */
/* DESCRIPTION */
-/* */
-/* This function decodes the "layouts" tag */
-/* */
-/* INPUT */
-/* */
-/* pictbridge Pictbridge instance */
-/* input_variable Pointer to variable */
-/* input_string Pointer to string */
-/* xml_parameter Pointer to xml parameter */
-/* */
-/* OUTPUT */
-/* */
-/* Completion Status */
-/* */
-/* CALLS */
-/* */
-/* */
-/* CALLED BY */
-/* */
-/* _ux_pictbridge_object_parse */
-/* */
-/* RELEASE HISTORY */
-/* */
-/* DATE NAME DESCRIPTION */
-/* */
-/* 05-19-2020 Chaoqiong Xiao Initial Version 6.0 */
-/* 09-30-2020 Chaoqiong Xiao Modified comment(s), */
-/* resulting in version 6.1 */
+/* */
+/* This function decodes the "layouts" tag */
+/* */
+/* INPUT */
+/* */
+/* pictbridge Pictbridge instance */
+/* input_variable Pointer to variable */
+/* input_string Pointer to string */
+/* xml_parameter Pointer to xml parameter */
+/* */
+/* OUTPUT */
+/* */
+/* Completion Status */
+/* */
+/* CALLS */
+/* */
+/* */
+/* CALLED BY */
+/* */
+/* _ux_pictbridge_object_parse */
/* */
/**************************************************************************/
-UINT _ux_pictbridge_xml_function_input_getcapability_capability_layouts(UX_PICTBRIDGE *pictbridge,
+UINT _ux_pictbridge_xml_function_input_getcapability_capability_layouts(UX_PICTBRIDGE *pictbridge,
UCHAR *input_variable, UCHAR *input_string, UCHAR *xml_parameter)
{
UINT input_length = 0;
@@ -86,7 +79,7 @@ UINT status;
status = _ux_utility_string_length_check(input_variable, &input_length, UX_PICTBRIDGE_MAX_VARIABLE_SIZE);
if (status != UX_SUCCESS)
return(status);
-
+
/* Check if there is a variable defined. */
if (input_length == 0)
{
@@ -97,7 +90,7 @@ UINT status;
/* Return success. */
return(UX_SUCCESS);
}
-
+
/* Get the length of the "papersize " variable. */
status = _ux_utility_string_length_check(_ux_pictbridge_xml_variable_papersize, &length, UX_PICTBRIDGE_MAX_VARIABLE_SIZE);
if (status != UX_SUCCESS)
@@ -110,10 +103,10 @@ UINT status;
/* Both length match, we may have a variable name match. Check the names */
if (_ux_utility_memory_compare(_ux_pictbridge_xml_variable_papersize,input_variable, length) == UX_SUCCESS)
{
-
+
/* Get the value for the papersize. */
status = _ux_pictbridge_element_to_hexa(input_string, &papersize);
-
+
/* Check status. If OK, save the papersize value for layout. */
if (status == UX_SUCCESS)
{
@@ -123,12 +116,12 @@ UINT status;
/* The variable name is OK. We are done. */
return(UX_SUCCESS);
- }
+ }
}
}
/* We get here when we reached an unexpected end of the XML object or a format error. */
- return(UX_PICTBRIDGE_ERROR_SCRIPT_SYNTAX_ERROR);
+ return(UX_PICTBRIDGE_ERROR_SCRIPT_SYNTAX_ERROR);
}
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 5eabec34..893b08e7 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
@@ -1,18 +1,19 @@
/***************************************************************************
- * Copyright (c) 2024 Microsoft Corporation
- *
+ * Copyright (c) 2024 Microsoft Corporation
+ * Copyright (c) 2026-present Eclipse ThreadX contributors
+ *
* This program and the accompanying materials are made available under the
* terms of the MIT License which is available at
* https://opensource.org/licenses/MIT.
- *
+ *
* SPDX-License-Identifier: MIT
**************************************************************************/
/**************************************************************************/
/**************************************************************************/
-/** */
-/** USBX Component */
+/** */
+/** USBX Component */
/** */
/** Pictbridge Application */
/** */
@@ -28,51 +29,43 @@
#include "ux_pictbridge.h"
-/**************************************************************************/
-/* */
-/* FUNCTION RELEASE */
-/* */
+/**************************************************************************/
+/* */
+/* FUNCTION RELEASE */
+/* */
/* _ux_pictbridge_xml_function_input_getcapability_ */
/* capability_papertypes */
/* PORTABLE C */
/* 6.1 */
-/* */
-/* */
+/* */
+/* */
/* AUTHOR */
/* */
/* Chaoqiong Xiao, Microsoft Corporation */
/* */
/* DESCRIPTION */
-/* */
-/* This function decodes the "layouts" tag */
-/* */
-/* INPUT */
-/* */
-/* pictbridge Pictbridge instance */
-/* input_variable Pointer to variable */
-/* input_string Pointer to string */
-/* */
-/* OUTPUT */
-/* */
-/* Completion Status */
-/* */
-/* CALLS */
-/* */
-/* */
-/* CALLED BY */
-/* */
-/* _ux_pictbridge_object_parse */
-/* */
-/* RELEASE HISTORY */
-/* */
-/* DATE NAME DESCRIPTION */
-/* */
-/* 05-19-2020 Chaoqiong Xiao Initial Version 6.0 */
-/* 09-30-2020 Chaoqiong Xiao Modified comment(s), */
-/* resulting in version 6.1 */
+/* */
+/* This function decodes the "layouts" tag */
+/* */
+/* INPUT */
+/* */
+/* pictbridge Pictbridge instance */
+/* input_variable Pointer to variable */
+/* input_string Pointer to string */
+/* */
+/* OUTPUT */
+/* */
+/* Completion Status */
+/* */
+/* CALLS */
+/* */
+/* */
+/* CALLED BY */
+/* */
+/* _ux_pictbridge_object_parse */
/* */
/**************************************************************************/
-UINT _ux_pictbridge_xml_function_input_getcapability_capability_papertypes(UX_PICTBRIDGE *pictbridge,
+UINT _ux_pictbridge_xml_function_input_getcapability_capability_papertypes(UX_PICTBRIDGE *pictbridge,
UCHAR *input_variable, UCHAR *input_string, UCHAR *xml_parameter)
{
UINT input_length = 0;
@@ -86,7 +79,7 @@ UINT status;
status = _ux_utility_string_length_check(input_variable, &input_length, UX_PICTBRIDGE_MAX_VARIABLE_SIZE);
if (status != UX_SUCCESS)
return(status);
-
+
/* Check if there is a variable defined. */
if (input_length == 0)
{
@@ -97,7 +90,7 @@ UINT status;
/* Return success. */
return(UX_SUCCESS);
}
-
+
/* Get the length of the "papersize " variable. */
status = _ux_utility_string_length_check(_ux_pictbridge_xml_variable_papersize, &length, UX_PICTBRIDGE_MAX_VARIABLE_SIZE);
if (status != UX_SUCCESS)
@@ -110,10 +103,10 @@ UINT status;
/* Both length match, we may have a variable name match. Check the names */
if (_ux_utility_memory_compare(_ux_pictbridge_xml_variable_papersize,input_variable, length) == UX_SUCCESS)
{
-
+
/* Get the value for the papersize. */
status = _ux_pictbridge_element_to_hexa(input_string, &papersize);
-
+
/* Check status. If OK, save the papersize value for layout. */
if (status == UX_SUCCESS)
{
@@ -123,12 +116,12 @@ UINT status;
/* The variable name is OK. We are done. */
return(UX_SUCCESS);
- }
+ }
}
}
/* We get here when we reached an unexpected end of the XML object or a format error. */
- return(UX_PICTBRIDGE_ERROR_SCRIPT_SYNTAX_ERROR);
+ return(UX_PICTBRIDGE_ERROR_SCRIPT_SYNTAX_ERROR);
}
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 2e8112ae..ee1b4d59 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
@@ -1,18 +1,19 @@
/***************************************************************************
- * Copyright (c) 2024 Microsoft Corporation
- *
+ * Copyright (c) 2024 Microsoft Corporation
+ * Copyright (c) 2026-present Eclipse ThreadX contributors
+ *
* This program and the accompanying materials are made available under the
* terms of the MIT License which is available at
* https://opensource.org/licenses/MIT.
- *
+ *
* SPDX-License-Identifier: MIT
**************************************************************************/
/**************************************************************************/
/**************************************************************************/
-/** */
-/** USBX Component */
+/** */
+/** USBX Component */
/** */
/** Pictbridge Application */
/** */
@@ -28,56 +29,48 @@
#include "ux_pictbridge.h"
-/**************************************************************************/
-/* */
-/* FUNCTION RELEASE */
-/* */
+/**************************************************************************/
+/* */
+/* FUNCTION RELEASE */
+/* */
/* _ux_pictbridge_xml_function_input_notifydevicestatus_ */
/* capabilitychanged */
-/* PORTABLE C */
+/* PORTABLE C */
/* 6.1 */
-/* */
-/* */
-/* */
+/* */
+/* */
+/* */
/* AUTHOR */
/* */
/* Chaoqiong Xiao, Microsoft Corporation */
/* */
/* DESCRIPTION */
-/* */
-/* This function decodes the capabilitychanged tag */
-/* */
-/* INPUT */
-/* */
-/* pictbridge Pictbridge instance */
-/* input_variable Pointer to variable */
-/* input_string Pointer to string */
-/* xml_parameter XML parameter */
-/* */
-/* OUTPUT */
-/* */
-/* Completion Status */
-/* */
-/* CALLS */
-/* */
-/* */
-/* CALLED BY */
-/* */
-/* _ux_pictbridge_object_parse */
-/* */
-/* RELEASE HISTORY */
-/* */
-/* DATE NAME DESCRIPTION */
-/* */
-/* 05-19-2020 Chaoqiong Xiao Initial Version 6.0 */
-/* 09-30-2020 Chaoqiong Xiao Modified comment(s), */
-/* resulting in version 6.1 */
+/* */
+/* This function decodes the capabilitychanged tag */
+/* */
+/* INPUT */
+/* */
+/* pictbridge Pictbridge instance */
+/* input_variable Pointer to variable */
+/* input_string Pointer to string */
+/* xml_parameter XML parameter */
+/* */
+/* OUTPUT */
+/* */
+/* Completion Status */
+/* */
+/* CALLS */
+/* */
+/* */
+/* CALLED BY */
+/* */
+/* _ux_pictbridge_object_parse */
/* */
/**************************************************************************/
-UINT _ux_pictbridge_xml_function_input_notifydevicestatus_capabilitychanged(UX_PICTBRIDGE *pictbridge,
+UINT _ux_pictbridge_xml_function_input_notifydevicestatus_capabilitychanged(UX_PICTBRIDGE *pictbridge,
UCHAR *input_variable, UCHAR *input_string, UCHAR *xml_parameter)
{
-
+
UINT status;
ULONG hexa_element;
@@ -100,7 +93,7 @@ ULONG hexa_element;
pictbridge -> ux_pictbridge_dpsclient.ux_pictbridge_devinfo_capabilitychanged = hexa_element;
/* We are done. */
- return(UX_SUCCESS);
+ return(UX_SUCCESS);
}
}
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 80282d05..388d73d3 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
@@ -1,18 +1,19 @@
/***************************************************************************
- * Copyright (c) 2024 Microsoft Corporation
- *
+ * Copyright (c) 2024 Microsoft Corporation
+ * Copyright (c) 2026-present Eclipse ThreadX contributors
+ *
* This program and the accompanying materials are made available under the
* terms of the MIT License which is available at
* https://opensource.org/licenses/MIT.
- *
+ *
* SPDX-License-Identifier: MIT
**************************************************************************/
/**************************************************************************/
/**************************************************************************/
-/** */
-/** USBX Component */
+/** */
+/** USBX Component */
/** */
/** Pictbridge Application */
/** */
@@ -28,53 +29,45 @@
#include "ux_pictbridge.h"
-/**************************************************************************/
-/* */
-/* FUNCTION RELEASE */
-/* */
+/**************************************************************************/
+/* */
+/* FUNCTION RELEASE */
+/* */
/* _ux_pictbridge_xml_function_input_notifydevicestatus_ */
-/* disconnectenable */
-/* POTABLE C */
+/* disconnectenable */
+/* POTABLE C */
/* 6.1 */
-/* */
-/* */
-/* */
+/* */
+/* */
+/* */
/* AUTHOR */
/* */
/* Chaoqiong Xiao, Microsoft Corporation */
/* */
/* DESCRIPTION */
-/* */
-/* This function decodes the disconnectenable tag */
-/* */
-/* INPUT */
-/* */
-/* pictbridge Pictbridge instance */
-/* input_variable Pointer to variable */
-/* input_string Pointer to string */
-/* xml_parameter XML parameter */
-/* */
-/* OUTPUT */
-/* */
-/* Completion Status */
-/* */
-/* CALLS */
-/* */
-/* */
-/* CALLED BY */
-/* */
-/* _ux_pictbridge_object_parse */
-/* */
-/* RELEASE HISTORY */
-/* */
-/* DATE NAME DESCRIPTION */
-/* */
-/* 05-19-2020 Chaoqiong Xiao Initial Version 6.0 */
-/* 09-30-2020 Chaoqiong Xiao Modified comment(s), */
-/* resulting in version 6.1 */
+/* */
+/* This function decodes the disconnectenable tag */
+/* */
+/* INPUT */
+/* */
+/* pictbridge Pictbridge instance */
+/* input_variable Pointer to variable */
+/* input_string Pointer to string */
+/* xml_parameter XML parameter */
+/* */
+/* OUTPUT */
+/* */
+/* Completion Status */
+/* */
+/* CALLS */
+/* */
+/* */
+/* CALLED BY */
+/* */
+/* _ux_pictbridge_object_parse */
/* */
/**************************************************************************/
-UINT _ux_pictbridge_xml_function_input_notifydevicestatus_disconnectenable(UX_PICTBRIDGE *pictbridge,
+UINT _ux_pictbridge_xml_function_input_notifydevicestatus_disconnectenable(UX_PICTBRIDGE *pictbridge,
UCHAR *input_variable, UCHAR *input_string, UCHAR *xml_parameter)
{
@@ -100,12 +93,12 @@ ULONG hexa_element;
pictbridge -> ux_pictbridge_dpsclient.ux_pictbridge_devinfo_disconnectenable = hexa_element;
/* We are done. */
- return(UX_SUCCESS);
+ return(UX_SUCCESS);
}
}
/* We get here when we reached an unexpected end of the XML object or a format error. */
- return(UX_PICTBRIDGE_ERROR_SCRIPT_SYNTAX_ERROR);
+ return(UX_PICTBRIDGE_ERROR_SCRIPT_SYNTAX_ERROR);
}
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 60b6b25f..0b4b710f 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
@@ -1,18 +1,19 @@
/***************************************************************************
- * Copyright (c) 2024 Microsoft Corporation
- *
+ * Copyright (c) 2024 Microsoft Corporation
+ * Copyright (c) 2026-present Eclipse ThreadX contributors
+ *
* This program and the accompanying materials are made available under the
* terms of the MIT License which is available at
* https://opensource.org/licenses/MIT.
- *
+ *
* SPDX-License-Identifier: MIT
**************************************************************************/
/**************************************************************************/
/**************************************************************************/
-/** */
-/** USBX Component */
+/** */
+/** USBX Component */
/** */
/** Pictbridge Application */
/** */
@@ -28,53 +29,45 @@
#include "ux_pictbridge.h"
-/**************************************************************************/
-/* */
-/* FUNCTION RELEASE */
-/* */
+/**************************************************************************/
+/* */
+/* FUNCTION RELEASE */
+/* */
/* _ux_pictbridge_xml_function_input_notifydevicestatus_ */
/* dpsprintservicestatus */
-/* PORTABLE C */
+/* PORTABLE C */
/* 6.1 */
-/* */
-/* */
+/* */
+/* */
/* AUTHOR */
/* */
/* Chaoqiong Xiao, Microsoft Corporation */
/* */
/* DESCRIPTION */
-/* */
-/* This function decodes the dpsprintservicestatus tag */
-/* object */
-/* */
-/* INPUT */
-/* */
-/* pictbridge Pictbridge instance */
-/* input_variable Pointer to variable */
-/* input_string Pointer to string */
-/* xml_parameter XML parameter */
-/* */
-/* OUTPUT */
-/* */
-/* Completion Status */
-/* */
-/* CALLS */
-/* */
-/* */
-/* CALLED BY */
-/* */
-/* _ux_pictbridge_object_parse */
-/* */
-/* RELEASE HISTORY */
-/* */
-/* DATE NAME DESCRIPTION */
-/* */
-/* 05-19-2020 Chaoqiong Xiao Initial Version 6.0 */
-/* 09-30-2020 Chaoqiong Xiao Modified comment(s), */
-/* resulting in version 6.1 */
+/* */
+/* This function decodes the dpsprintservicestatus tag */
+/* object */
+/* */
+/* INPUT */
+/* */
+/* pictbridge Pictbridge instance */
+/* input_variable Pointer to variable */
+/* input_string Pointer to string */
+/* xml_parameter XML parameter */
+/* */
+/* OUTPUT */
+/* */
+/* Completion Status */
+/* */
+/* CALLS */
+/* */
+/* */
+/* CALLED BY */
+/* */
+/* _ux_pictbridge_object_parse */
/* */
/**************************************************************************/
-UINT _ux_pictbridge_xml_function_input_notifydevicestatus_dpsprintservicestatus(UX_PICTBRIDGE *pictbridge,
+UINT _ux_pictbridge_xml_function_input_notifydevicestatus_dpsprintservicestatus(UX_PICTBRIDGE *pictbridge,
UCHAR *input_variable, UCHAR *input_string, UCHAR *xml_parameter)
{
@@ -101,7 +94,7 @@ ULONG hexa_element;
pictbridge -> ux_pictbridge_dpsclient.ux_pictbridge_devinfo_dpsprintservicestatus = hexa_element;
/* We are done. */
- return(UX_SUCCESS);
+ return(UX_SUCCESS);
}
}
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 18752b70..1074717e 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
@@ -1,18 +1,19 @@
/***************************************************************************
- * Copyright (c) 2024 Microsoft Corporation
- *
+ * Copyright (c) 2024 Microsoft Corporation
+ * Copyright (c) 2026-present Eclipse ThreadX contributors
+ *
* This program and the accompanying materials are made available under the
* terms of the MIT License which is available at
* https://opensource.org/licenses/MIT.
- *
+ *
* SPDX-License-Identifier: MIT
**************************************************************************/
/**************************************************************************/
/**************************************************************************/
-/** */
-/** USBX Component */
+/** */
+/** USBX Component */
/** */
/** Pictbridge Application */
/** */
@@ -28,55 +29,47 @@
#include "ux_pictbridge.h"
-/**************************************************************************/
-/* */
-/* FUNCTION RELEASE */
-/* */
-/* _ux_pictbridge_xml_function_input_notifydevicestatus_errorreason */
-/* PORTABLE C */
+/**************************************************************************/
+/* */
+/* FUNCTION RELEASE */
+/* */
+/* _ux_pictbridge_xml_function_input_notifydevicestatus_errorreason */
+/* PORTABLE C */
/* 6.1 */
-/* */
-/* */
+/* */
+/* */
/* AUTHOR */
/* */
/* Chaoqiong Xiao, Microsoft Corporation */
/* */
/* DESCRIPTION */
-/* */
-/* This function decodes the errorreason tag */
-/* object */
-/* */
-/* INPUT */
-/* */
-/* pictbridge Pictbridge instance */
-/* input_variable Pointer to variable */
-/* input_string Pointer to string */
-/* xml_parameter XML parameter */
-/* */
-/* OUTPUT */
-/* */
-/* Completion Status */
-/* */
-/* CALLS */
-/* */
-/* */
-/* CALLED BY */
-/* */
-/* _ux_pictbridge_object_parse */
-/* */
-/* RELEASE HISTORY */
-/* */
-/* DATE NAME DESCRIPTION */
-/* */
-/* 05-19-2020 Chaoqiong Xiao Initial Version 6.0 */
-/* 09-30-2020 Chaoqiong Xiao Modified comment(s), */
-/* resulting in version 6.1 */
+/* */
+/* This function decodes the errorreason tag */
+/* object */
+/* */
+/* INPUT */
+/* */
+/* pictbridge Pictbridge instance */
+/* input_variable Pointer to variable */
+/* input_string Pointer to string */
+/* xml_parameter XML parameter */
+/* */
+/* OUTPUT */
+/* */
+/* Completion Status */
+/* */
+/* CALLS */
+/* */
+/* */
+/* CALLED BY */
+/* */
+/* _ux_pictbridge_object_parse */
/* */
/**************************************************************************/
-UINT _ux_pictbridge_xml_function_input_notifydevicestatus_errorreason(UX_PICTBRIDGE *pictbridge,
+UINT _ux_pictbridge_xml_function_input_notifydevicestatus_errorreason(UX_PICTBRIDGE *pictbridge,
UCHAR *input_variable, UCHAR *input_string, UCHAR *xml_parameter)
{
-
+
UINT status;
ULONG hexa_element;
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 2d7fba59..ba8d7295 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
@@ -1,18 +1,19 @@
/***************************************************************************
- * Copyright (c) 2024 Microsoft Corporation
- *
+ * Copyright (c) 2024 Microsoft Corporation
+ * Copyright (c) 2026-present Eclipse ThreadX contributors
+ *
* This program and the accompanying materials are made available under the
* terms of the MIT License which is available at
* https://opensource.org/licenses/MIT.
- *
+ *
* SPDX-License-Identifier: MIT
**************************************************************************/
/**************************************************************************/
/**************************************************************************/
-/** */
-/** USBX Component */
+/** */
+/** USBX Component */
/** */
/** Pictbridge Application */
/** */
@@ -28,52 +29,44 @@
#include "ux_pictbridge.h"
-/**************************************************************************/
-/* */
-/* FUNCTION RELEASE */
-/* */
-/* _ux_pictbridge_xml_function_input_notifydevicestatus_errorstatus */
-/* PORTABLE C */
+/**************************************************************************/
+/* */
+/* FUNCTION RELEASE */
+/* */
+/* _ux_pictbridge_xml_function_input_notifydevicestatus_errorstatus */
+/* PORTABLE C */
/* 6.1 */
-/* */
-/* */
+/* */
+/* */
/* AUTHOR */
/* */
/* Chaoqiong Xiao, Microsoft Corporation */
/* */
/* DESCRIPTION */
-/* */
-/* This function decodes the errorstatus tag */
-/* object */
-/* */
-/* INPUT */
-/* */
-/* pictbridge Pictbridge instance */
-/* input_variable Pointer to variable */
-/* input_string Pointer to string */
-/* xml_parameter XML parameter */
-/* */
-/* OUTPUT */
-/* */
-/* Completion Status */
-/* */
-/* CALLS */
-/* */
-/* */
-/* CALLED BY */
-/* */
-/* _ux_pictbridge_object_parse */
-/* */
-/* RELEASE HISTORY */
-/* */
-/* DATE NAME DESCRIPTION */
-/* */
-/* 05-19-2020 Chaoqiong Xiao Initial Version 6.0 */
-/* 09-30-2020 Chaoqiong Xiao Modified comment(s), */
-/* resulting in version 6.1 */
+/* */
+/* This function decodes the errorstatus tag */
+/* object */
+/* */
+/* INPUT */
+/* */
+/* pictbridge Pictbridge instance */
+/* input_variable Pointer to variable */
+/* input_string Pointer to string */
+/* xml_parameter XML parameter */
+/* */
+/* OUTPUT */
+/* */
+/* Completion Status */
+/* */
+/* CALLS */
+/* */
+/* */
+/* CALLED BY */
+/* */
+/* _ux_pictbridge_object_parse */
/* */
/**************************************************************************/
-UINT _ux_pictbridge_xml_function_input_notifydevicestatus_errorstatus(UX_PICTBRIDGE *pictbridge,
+UINT _ux_pictbridge_xml_function_input_notifydevicestatus_errorstatus(UX_PICTBRIDGE *pictbridge,
UCHAR *input_variable, UCHAR *input_string, UCHAR *xml_parameter)
{
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 22a31a8b..9aac002f 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
@@ -1,18 +1,19 @@
/***************************************************************************
- * Copyright (c) 2024 Microsoft Corporation
- *
+ * Copyright (c) 2024 Microsoft Corporation
+ * Copyright (c) 2026-present Eclipse ThreadX contributors
+ *
* This program and the accompanying materials are made available under the
* terms of the MIT License which is available at
* https://opensource.org/licenses/MIT.
- *
+ *
* SPDX-License-Identifier: MIT
**************************************************************************/
/**************************************************************************/
/**************************************************************************/
-/** */
-/** USBX Component */
+/** */
+/** USBX Component */
/** */
/** Pictbridge Application */
/** */
@@ -28,51 +29,43 @@
#include "ux_pictbridge.h"
-/**************************************************************************/
-/* */
-/* FUNCTION RELEASE */
-/* */
-/* _ux_pictbridge_xml_function_input_notifydevicestatus_jobendreason */
-/* PORTABLE C */
+/**************************************************************************/
+/* */
+/* FUNCTION RELEASE */
+/* */
+/* _ux_pictbridge_xml_function_input_notifydevicestatus_jobendreason */
+/* PORTABLE C */
/* 6.1 */
-/* */
-/* */
+/* */
+/* */
/* AUTHOR */
/* */
/* Chaoqiong Xiao, Microsoft Corporation */
/* */
/* DESCRIPTION */
-/* */
-/* This function decodes the jobendreason tag */
-/* */
-/* INPUT */
-/* */
-/* pictbridge Pictbridge instance */
-/* input_variable Pointer to variable */
-/* input_string Pointer to string */
-/* xml_parameter XML parameter */
-/* */
-/* OUTPUT */
-/* */
-/* Completion Status */
-/* */
-/* CALLS */
-/* */
-/* */
-/* CALLED BY */
-/* */
-/* _ux_pictbridge_object_parse */
-/* */
-/* RELEASE HISTORY */
-/* */
-/* DATE NAME DESCRIPTION */
-/* */
-/* 05-19-2020 Chaoqiong Xiao Initial Version 6.0 */
-/* 09-30-2020 Chaoqiong Xiao Modified comment(s), */
-/* resulting in version 6.1 */
+/* */
+/* This function decodes the jobendreason tag */
+/* */
+/* INPUT */
+/* */
+/* pictbridge Pictbridge instance */
+/* input_variable Pointer to variable */
+/* input_string Pointer to string */
+/* xml_parameter XML parameter */
+/* */
+/* OUTPUT */
+/* */
+/* Completion Status */
+/* */
+/* CALLS */
+/* */
+/* */
+/* CALLED BY */
+/* */
+/* _ux_pictbridge_object_parse */
/* */
/**************************************************************************/
-UINT _ux_pictbridge_xml_function_input_notifydevicestatus_jobendreason(UX_PICTBRIDGE *pictbridge,
+UINT _ux_pictbridge_xml_function_input_notifydevicestatus_jobendreason(UX_PICTBRIDGE *pictbridge,
UCHAR *input_variable, UCHAR *input_string, UCHAR *xml_parameter)
{
@@ -107,7 +100,7 @@ ULONG hexa_element;
}
/* We get here when we reached an unexpected end of the XML object or a format error. */
- return(UX_PICTBRIDGE_ERROR_SCRIPT_SYNTAX_ERROR);
+ return(UX_PICTBRIDGE_ERROR_SCRIPT_SYNTAX_ERROR);
}
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 b1f69380..18371278 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
@@ -1,18 +1,19 @@
/***************************************************************************
- * Copyright (c) 2024 Microsoft Corporation
- *
+ * Copyright (c) 2024 Microsoft Corporation
+ * Copyright (c) 2026-present Eclipse ThreadX contributors
+ *
* This program and the accompanying materials are made available under the
* terms of the MIT License which is available at
* https://opensource.org/licenses/MIT.
- *
+ *
* SPDX-License-Identifier: MIT
**************************************************************************/
/**************************************************************************/
/**************************************************************************/
-/** */
-/** USBX Component */
+/** */
+/** USBX Component */
/** */
/** Pictbridge Application */
/** */
@@ -28,51 +29,43 @@
#include "ux_pictbridge.h"
-/**************************************************************************/
-/* */
-/* FUNCTION RELEASE */
-/* */
-/* _ux_pictbridge_xml_function_input_notifydevicestatus_newjobok */
-/* PORTABLE C */
+/**************************************************************************/
+/* */
+/* FUNCTION RELEASE */
+/* */
+/* _ux_pictbridge_xml_function_input_notifydevicestatus_newjobok */
+/* PORTABLE C */
/* 6.1 */
-/* */
-/* */
+/* */
+/* */
/* AUTHOR */
/* */
/* Chaoqiong Xiao, Microsoft Corporation */
/* */
/* DESCRIPTION */
-/* */
-/* This function decodes the newjobok tag */
-/* */
-/* INPUT */
-/* */
-/* pictbridge Pictbridge instance */
-/* input_variable Pointer to variable */
-/* input_string Pointer to string */
-/* xml_parameter XML parameter */
-/* */
-/* OUTPUT */
-/* */
-/* Completion Status */
-/* */
-/* CALLS */
-/* */
-/* */
-/* CALLED BY */
-/* */
-/* _ux_pictbridge_object_parse */
-/* */
-/* RELEASE HISTORY */
-/* */
-/* DATE NAME DESCRIPTION */
-/* */
-/* 05-19-2020 Chaoqiong Xiao Initial Version 6.0 */
-/* 09-30-2020 Chaoqiong Xiao Modified comment(s), */
-/* resulting in version 6.1 */
+/* */
+/* This function decodes the newjobok tag */
+/* */
+/* INPUT */
+/* */
+/* pictbridge Pictbridge instance */
+/* input_variable Pointer to variable */
+/* input_string Pointer to string */
+/* xml_parameter XML parameter */
+/* */
+/* OUTPUT */
+/* */
+/* Completion Status */
+/* */
+/* CALLS */
+/* */
+/* */
+/* CALLED BY */
+/* */
+/* _ux_pictbridge_object_parse */
/* */
/**************************************************************************/
-UINT _ux_pictbridge_xml_function_input_notifydevicestatus_newjobok(UX_PICTBRIDGE *pictbridge,
+UINT _ux_pictbridge_xml_function_input_notifydevicestatus_newjobok(UX_PICTBRIDGE *pictbridge,
UCHAR *input_variable, UCHAR *input_string, UCHAR *xml_parameter)
{
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 9fcceb80..267edacf 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
@@ -1,18 +1,19 @@
/***************************************************************************
- * Copyright (c) 2024 Microsoft Corporation
- *
+ * Copyright (c) 2024 Microsoft Corporation
+ * Copyright (c) 2026-present Eclipse ThreadX contributors
+ *
* This program and the accompanying materials are made available under the
* terms of the MIT License which is available at
* https://opensource.org/licenses/MIT.
- *
+ *
* SPDX-License-Identifier: MIT
**************************************************************************/
/**************************************************************************/
/**************************************************************************/
-/** */
-/** USBX Component */
+/** */
+/** USBX Component */
/** */
/** Pictbridge Application */
/** */
@@ -28,53 +29,42 @@
#include "ux_pictbridge.h"
-/**************************************************************************/
-/* */
-/* FUNCTION RELEASE */
-/* */
-/* _ux_pictbridge_xml_function_input_startjob PORTABLE C */
+/**************************************************************************/
+/* */
+/* FUNCTION RELEASE */
+/* */
+/* _ux_pictbridge_xml_function_input_startjob PORTABLE C */
/* 6.1.12 */
-/* */
-/* */
+/* */
+/* */
/* AUTHOR */
/* */
/* Chaoqiong Xiao, Microsoft Corporation */
/* */
/* DESCRIPTION */
-/* */
-/* This function receives an order for a new job. It issues */
-/* notification to the pictbridge thread. */
-/* */
-/* INPUT */
-/* */
-/* pictbridge Pictbridge instance */
-/* input_variable Pointer to variable */
-/* input_string Pointer to string */
-/* */
-/* OUTPUT */
-/* */
-/* Completion Status */
-/* */
-/* CALLS */
-/* */
-/* */
-/* CALLED BY */
-/* */
-/* _ux_pictbridge_object_parse */
-/* */
-/* RELEASE HISTORY */
-/* */
-/* DATE NAME DESCRIPTION */
-/* */
-/* 05-19-2020 Chaoqiong Xiao Initial Version 6.0 */
-/* 09-30-2020 Chaoqiong Xiao Modified comment(s), */
-/* resulting in version 6.1 */
-/* 07-29-2022 Chaoqiong Xiao Modified comment(s), */
-/* used macros for RTOS calls, */
-/* resulting in version 6.1.12 */
+/* */
+/* This function receives an order for a new job. It issues */
+/* notification to the pictbridge thread. */
+/* */
+/* INPUT */
+/* */
+/* pictbridge Pictbridge instance */
+/* input_variable Pointer to variable */
+/* input_string Pointer to string */
+/* */
+/* OUTPUT */
+/* */
+/* Completion Status */
+/* */
+/* CALLS */
+/* */
+/* */
+/* CALLED BY */
+/* */
+/* _ux_pictbridge_object_parse */
/* */
/**************************************************************************/
-UINT _ux_pictbridge_xml_function_input_startjob(UX_PICTBRIDGE *pictbridge,
+UINT _ux_pictbridge_xml_function_input_startjob(UX_PICTBRIDGE *pictbridge,
UCHAR *input_variable, UCHAR *input_string, UCHAR *xml_parameter)
{
UX_PICTBRIDGE_EVENT *pictbridge_next_event;
@@ -86,23 +76,23 @@ UX_PICTBRIDGE_EVENT *pictbridge_event;
/* Compute the next entry in the event array. */
if ((pictbridge -> ux_pictbridge_event_array_head + 1) == pictbridge -> ux_pictbridge_event_array_end)
-
+
/* Start at the beginning of the list. */
pictbridge_next_event = pictbridge -> ux_pictbridge_event_array;
else
/* Point to the next entry in the event array. */
- pictbridge_next_event = pictbridge -> ux_pictbridge_event_array_head + 1;
+ pictbridge_next_event = pictbridge -> ux_pictbridge_event_array_head + 1;
/* Check to see if we can store this event. */
if (pictbridge_next_event == pictbridge -> ux_pictbridge_event_array_tail)
-
+
/* No place to store this event, throw it away. */
return(UX_ERROR);
/* Current storage is in the current head. */
pictbridge_event = pictbridge -> ux_pictbridge_event_array_head;
-
+
/* Store the start job event in the pictbridge event queue. */
pictbridge_event -> ux_pictbridge_event_code = UX_PICTBRIDGE_EC_START_JOB;
pictbridge_event -> ux_pictbridge_event_parameter_1 = 0;
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 7f03eb84..ae4b561f 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
@@ -1,18 +1,19 @@
/***************************************************************************
- * Copyright (c) 2024 Microsoft Corporation
- *
+ * Copyright (c) 2024 Microsoft Corporation
+ * Copyright (c) 2026-present Eclipse ThreadX contributors
+ *
* This program and the accompanying materials are made available under the
* terms of the MIT License which is available at
* https://opensource.org/licenses/MIT.
- *
+ *
* SPDX-License-Identifier: MIT
**************************************************************************/
/**************************************************************************/
/**************************************************************************/
-/** */
-/** USBX Component */
+/** */
+/** USBX Component */
/** */
/** Pictbridge Application */
/** */
@@ -28,76 +29,68 @@
#include "ux_pictbridge.h"
-/**************************************************************************/
-/* */
-/* FUNCTION RELEASE */
-/* */
-/* _ux_pictbridge_xml_function_input_startjob_jobconfig_cropping */
-/* PORTABLE C */
+/**************************************************************************/
+/* */
+/* FUNCTION RELEASE */
+/* */
+/* _ux_pictbridge_xml_function_input_startjob_jobconfig_cropping */
+/* PORTABLE C */
/* 6.1 */
-/* */
-/* */
+/* */
+/* */
/* AUTHOR */
/* */
/* Chaoqiong Xiao, Microsoft Corporation */
/* */
/* DESCRIPTION */
-/* */
-/* This function decodes the "cropping" tag in the jobconfig */
-/* object */
-/* */
-/* INPUT */
-/* */
-/* pictbridge Pictbridge instance */
-/* input_variable Pointer to variable */
-/* input_string Pointer to string */
-/* xml_parameter XML parameter */
-/* */
-/* OUTPUT */
-/* */
-/* Completion Status */
-/* */
-/* CALLS */
-/* */
-/* */
-/* CALLED BY */
-/* */
-/* _ux_pictbridge_object_parse */
-/* */
-/* RELEASE HISTORY */
-/* */
-/* DATE NAME DESCRIPTION */
-/* */
-/* 05-19-2020 Chaoqiong Xiao Initial Version 6.0 */
-/* 09-30-2020 Chaoqiong Xiao Modified comment(s), */
-/* resulting in version 6.1 */
+/* */
+/* This function decodes the "cropping" tag in the jobconfig */
+/* object */
+/* */
+/* INPUT */
+/* */
+/* pictbridge Pictbridge instance */
+/* input_variable Pointer to variable */
+/* input_string Pointer to string */
+/* xml_parameter XML parameter */
+/* */
+/* OUTPUT */
+/* */
+/* Completion Status */
+/* */
+/* CALLS */
+/* */
+/* */
+/* CALLED BY */
+/* */
+/* _ux_pictbridge_object_parse */
/* */
/**************************************************************************/
-UINT _ux_pictbridge_xml_function_input_startjob_jobconfig_cropping(UX_PICTBRIDGE *pictbridge,
+UINT _ux_pictbridge_xml_function_input_startjob_jobconfig_cropping(UX_PICTBRIDGE *pictbridge,
UCHAR *input_variable, UCHAR *input_string, UCHAR *xml_parameter)
{
UINT status;
ULONG hexa_value;
-
+
UX_PARAMETER_NOT_USED(input_string);
UX_PARAMETER_NOT_USED(input_variable);
UX_PARAMETER_NOT_USED(xml_parameter);
/* Get the hexa value from the xml parameter. */
status = _ux_pictbridge_element_to_hexa(xml_parameter, &hexa_value);
-
+
/* Check for error. */
if (status != UX_SUCCESS)
-
+
/* We have a element syntax error. */
return(status);
-
+
/* We need to store the cropping value. */
pictbridge -> ux_pictbridge_jobinfo.ux_pictbridge_jobinfo_cropping = hexa_value;
/* Operation is successful. */
return(UX_SUCCESS);
-
+
}
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 2b33e0f1..9e5c9ab2 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
@@ -1,18 +1,19 @@
/***************************************************************************
- * Copyright (c) 2024 Microsoft Corporation
- *
+ * Copyright (c) 2024 Microsoft Corporation
+ * Copyright (c) 2026-present Eclipse ThreadX contributors
+ *
* This program and the accompanying materials are made available under the
* terms of the MIT License which is available at
* https://opensource.org/licenses/MIT.
- *
+ *
* SPDX-License-Identifier: MIT
**************************************************************************/
/**************************************************************************/
/**************************************************************************/
-/** */
-/** USBX Component */
+/** */
+/** USBX Component */
/** */
/** Pictbridge Application */
/** */
@@ -28,51 +29,43 @@
#include "ux_pictbridge.h"
-/**************************************************************************/
-/* */
-/* FUNCTION RELEASE */
-/* */
-/* _ux_pictbridge_xml_function_input_startjob_jobconfig_dateprint */
-/* PORTABLE C */
+/**************************************************************************/
+/* */
+/* FUNCTION RELEASE */
+/* */
+/* _ux_pictbridge_xml_function_input_startjob_jobconfig_dateprint */
+/* PORTABLE C */
/* 6.1 */
-/* */
-/* */
+/* */
+/* */
/* AUTHOR */
/* */
/* Chaoqiong Xiao, Microsoft Corporation */
/* */
/* DESCRIPTION */
-/* */
-/* This function decodes the "dateprint" tag in the jobconfig object */
-/* */
-/* INPUT */
-/* */
-/* pictbridge Pictbridge instance */
-/* input_variable Pointer to variable */
-/* input_string Pointer to string */
-/* xml_parameter XML parameter */
-/* */
-/* OUTPUT */
-/* */
-/* Completion Status */
-/* */
-/* CALLS */
-/* */
-/* */
-/* CALLED BY */
-/* */
-/* _ux_pictbridge_object_parse */
-/* */
-/* RELEASE HISTORY */
-/* */
-/* DATE NAME DESCRIPTION */
-/* */
-/* 05-19-2020 Chaoqiong Xiao Initial Version 6.0 */
-/* 09-30-2020 Chaoqiong Xiao Modified comment(s), */
-/* resulting in version 6.1 */
+/* */
+/* This function decodes the "dateprint" tag in the jobconfig object */
+/* */
+/* INPUT */
+/* */
+/* pictbridge Pictbridge instance */
+/* input_variable Pointer to variable */
+/* input_string Pointer to string */
+/* xml_parameter XML parameter */
+/* */
+/* OUTPUT */
+/* */
+/* Completion Status */
+/* */
+/* CALLS */
+/* */
+/* */
+/* CALLED BY */
+/* */
+/* _ux_pictbridge_object_parse */
/* */
/**************************************************************************/
-UINT _ux_pictbridge_xml_function_input_startjob_jobconfig_dateprint(UX_PICTBRIDGE *pictbridge,
+UINT _ux_pictbridge_xml_function_input_startjob_jobconfig_dateprint(UX_PICTBRIDGE *pictbridge,
UCHAR *input_variable, UCHAR *input_string, UCHAR *xml_parameter)
{
UINT status;
@@ -81,22 +74,22 @@ ULONG hexa_value;
UX_PARAMETER_NOT_USED(input_string);
UX_PARAMETER_NOT_USED(input_variable);
UX_PARAMETER_NOT_USED(xml_parameter);
-
+
/* Get the hexa value from the xml parameter. */
status = _ux_pictbridge_element_to_hexa(xml_parameter, &hexa_value);
-
+
/* Check for error. */
if (status != UX_SUCCESS)
-
+
/* We have a element syntax error. */
return(status);
-
+
/* We need to store the dateprint value. */
pictbridge -> ux_pictbridge_jobinfo.ux_pictbridge_jobinfo_dateprint = hexa_value;
/* Operation is successful. */
return(UX_SUCCESS);
-
+
}
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 bd748453..3776c400 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
@@ -1,18 +1,19 @@
/***************************************************************************
- * Copyright (c) 2024 Microsoft Corporation
- *
+ * Copyright (c) 2024 Microsoft Corporation
+ * Copyright (c) 2026-present Eclipse ThreadX contributors
+ *
* This program and the accompanying materials are made available under the
* terms of the MIT License which is available at
* https://opensource.org/licenses/MIT.
- *
+ *
* SPDX-License-Identifier: MIT
**************************************************************************/
/**************************************************************************/
/**************************************************************************/
-/** */
-/** USBX Component */
+/** */
+/** USBX Component */
/** */
/** Pictbridge Application */
/** */
@@ -28,52 +29,44 @@
#include "ux_pictbridge.h"
-/**************************************************************************/
-/* */
-/* FUNCTION RELEASE */
-/* */
-/* _ux_pictbridge_xml_function_input_startjob_jobconfig_filenameprint */
-/* PORTABLE C */
+/**************************************************************************/
+/* */
+/* FUNCTION RELEASE */
+/* */
+/* _ux_pictbridge_xml_function_input_startjob_jobconfig_filenameprint */
+/* PORTABLE C */
/* 6.1 */
-/* */
-/* */
+/* */
+/* */
/* AUTHOR */
/* */
/* Chaoqiong Xiao, Microsoft Corporation */
/* */
/* DESCRIPTION */
-/* */
-/* This function decodes the "filenameprint" tag in the jobconfig */
-/* object */
-/* */
-/* INPUT */
-/* */
-/* pictbridge Pictbridge instance */
-/* input_variable Pointer to variable */
-/* input_string Pointer to string */
-/* xml_parameter XML parameter */
-/* */
-/* OUTPUT */
-/* */
-/* Completion Status */
-/* */
-/* CALLS */
-/* */
-/* */
-/* CALLED BY */
-/* */
-/* _ux_pictbridge_object_parse */
-/* */
-/* RELEASE HISTORY */
-/* */
-/* DATE NAME DESCRIPTION */
-/* */
-/* 05-19-2020 Chaoqiong Xiao Initial Version 6.0 */
-/* 09-30-2020 Chaoqiong Xiao Modified comment(s), */
-/* resulting in version 6.1 */
+/* */
+/* This function decodes the "filenameprint" tag in the jobconfig */
+/* object */
+/* */
+/* INPUT */
+/* */
+/* pictbridge Pictbridge instance */
+/* input_variable Pointer to variable */
+/* input_string Pointer to string */
+/* xml_parameter XML parameter */
+/* */
+/* OUTPUT */
+/* */
+/* Completion Status */
+/* */
+/* CALLS */
+/* */
+/* */
+/* CALLED BY */
+/* */
+/* _ux_pictbridge_object_parse */
/* */
/**************************************************************************/
-UINT _ux_pictbridge_xml_function_input_startjob_jobconfig_filenameprint(UX_PICTBRIDGE *pictbridge,
+UINT _ux_pictbridge_xml_function_input_startjob_jobconfig_filenameprint(UX_PICTBRIDGE *pictbridge,
UCHAR *input_variable, UCHAR *input_string, UCHAR *xml_parameter)
{
UINT status;
@@ -82,22 +75,22 @@ ULONG hexa_value;
UX_PARAMETER_NOT_USED(input_string);
UX_PARAMETER_NOT_USED(input_variable);
UX_PARAMETER_NOT_USED(xml_parameter);
-
+
/* Get the hexa value from the xml parameter. */
status = _ux_pictbridge_element_to_hexa(xml_parameter, &hexa_value);
-
+
/* Check for error. */
if (status != UX_SUCCESS)
-
+
/* We have a element syntax error. */
return(status);
-
+
/* We need to store the filenameprint value. */
pictbridge -> ux_pictbridge_jobinfo.ux_pictbridge_jobinfo_filenameprint = hexa_value;
/* Operation is successful. */
return(UX_SUCCESS);
-
+
}
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 8a44631d..c1df205a 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
@@ -1,18 +1,19 @@
/***************************************************************************
- * Copyright (c) 2024 Microsoft Corporation
- *
+ * Copyright (c) 2024 Microsoft Corporation
+ * Copyright (c) 2026-present Eclipse ThreadX contributors
+ *
* This program and the accompanying materials are made available under the
* terms of the MIT License which is available at
* https://opensource.org/licenses/MIT.
- *
+ *
* SPDX-License-Identifier: MIT
**************************************************************************/
/**************************************************************************/
/**************************************************************************/
-/** */
-/** USBX Component */
+/** */
+/** USBX Component */
/** */
/** Pictbridge Application */
/** */
@@ -28,51 +29,43 @@
#include "ux_pictbridge.h"
-/**************************************************************************/
-/* */
-/* FUNCTION RELEASE */
-/* */
-/* _ux_pictbridge_xml_function_input_startjob_jobconfig_filetype */
-/* PORTABLE C */
+/**************************************************************************/
+/* */
+/* FUNCTION RELEASE */
+/* */
+/* _ux_pictbridge_xml_function_input_startjob_jobconfig_filetype */
+/* PORTABLE C */
/* 6.1 */
-/* */
-/* */
+/* */
+/* */
/* AUTHOR */
/* */
/* Chaoqiong Xiao, Microsoft Corporation */
/* */
/* DESCRIPTION */
-/* */
-/* This function decodes the "filertype" tag in the jobconfig object */
-/* */
-/* INPUT */
-/* */
-/* pictbridge Pictbridge instance */
-/* input_variable Pointer to variable */
-/* input_string Pointer to string */
-/* xml_parameter XML parameter */
-/* */
-/* OUTPUT */
-/* */
-/* Completion Status */
-/* */
-/* CALLS */
-/* */
-/* */
-/* CALLED BY */
-/* */
-/* _ux_pictbridge_object_parse */
-/* */
-/* RELEASE HISTORY */
-/* */
-/* DATE NAME DESCRIPTION */
-/* */
-/* 05-19-2020 Chaoqiong Xiao Initial Version 6.0 */
-/* 09-30-2020 Chaoqiong Xiao Modified comment(s), */
-/* resulting in version 6.1 */
+/* */
+/* This function decodes the "filertype" tag in the jobconfig object */
+/* */
+/* INPUT */
+/* */
+/* pictbridge Pictbridge instance */
+/* input_variable Pointer to variable */
+/* input_string Pointer to string */
+/* xml_parameter XML parameter */
+/* */
+/* OUTPUT */
+/* */
+/* Completion Status */
+/* */
+/* CALLS */
+/* */
+/* */
+/* CALLED BY */
+/* */
+/* _ux_pictbridge_object_parse */
/* */
/**************************************************************************/
-UINT _ux_pictbridge_xml_function_input_startjob_jobconfig_filetype(UX_PICTBRIDGE *pictbridge,
+UINT _ux_pictbridge_xml_function_input_startjob_jobconfig_filetype(UX_PICTBRIDGE *pictbridge,
UCHAR *input_variable, UCHAR *input_string, UCHAR *xml_parameter)
{
UINT status;
@@ -80,22 +73,22 @@ ULONG hexa_value;
UX_PARAMETER_NOT_USED(input_string);
UX_PARAMETER_NOT_USED(input_variable);
-
+
/* Get the hexa value from the xml parameter. */
status = _ux_pictbridge_element_to_hexa(xml_parameter, &hexa_value);
-
+
/* Check for error. */
if (status != UX_SUCCESS)
-
+
/* We have a element syntax error. */
return(status);
-
+
/* We need to store the filetype value. */
pictbridge -> ux_pictbridge_jobinfo.ux_pictbridge_jobinfo_filetype = hexa_value;
/* Operation is successful. */
return(UX_SUCCESS);
-
+
}
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 6eaa27b0..c5bb6c12 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
@@ -1,18 +1,19 @@
/***************************************************************************
- * Copyright (c) 2024 Microsoft Corporation
- *
+ * Copyright (c) 2024 Microsoft Corporation
+ * Copyright (c) 2026-present Eclipse ThreadX contributors
+ *
* This program and the accompanying materials are made available under the
* terms of the MIT License which is available at
* https://opensource.org/licenses/MIT.
- *
+ *
* SPDX-License-Identifier: MIT
**************************************************************************/
/**************************************************************************/
/**************************************************************************/
-/** */
-/** USBX Component */
+/** */
+/** USBX Component */
/** */
/** Pictbridge Application */
/** */
@@ -28,51 +29,43 @@
#include "ux_pictbridge.h"
-/**************************************************************************/
-/* */
-/* FUNCTION RELEASE */
-/* */
-/* _ux_pictbridge_xml_function_input_startjob_jobconfig_fixedsize */
-/* PORTABLE C */
+/**************************************************************************/
+/* */
+/* FUNCTION RELEASE */
+/* */
+/* _ux_pictbridge_xml_function_input_startjob_jobconfig_fixedsize */
+/* PORTABLE C */
/* 6.1 */
-/* */
-/* */
+/* */
+/* */
/* AUTHOR */
/* */
/* Chaoqiong Xiao, Microsoft Corporation */
/* */
/* DESCRIPTION */
-/* */
-/* This function decodes the "fixedsize" tag in the jobconfig object */
-/* */
-/* INPUT */
-/* */
-/* pictbridge Pictbridge instance */
-/* input_variable Pointer to variable */
-/* input_string Pointer to string */
-/* xml_parameter XML parameter */
-/* */
-/* OUTPUT */
-/* */
-/* Completion Status */
-/* */
-/* CALLS */
-/* */
-/* */
-/* CALLED BY */
-/* */
-/* _ux_pictbridge_object_parse */
-/* */
-/* RELEASE HISTORY */
-/* */
-/* DATE NAME DESCRIPTION */
-/* */
-/* 05-19-2020 Chaoqiong Xiao Initial Version 6.0 */
-/* 09-30-2020 Chaoqiong Xiao Modified comment(s), */
-/* resulting in version 6.1 */
+/* */
+/* This function decodes the "fixedsize" tag in the jobconfig object */
+/* */
+/* INPUT */
+/* */
+/* pictbridge Pictbridge instance */
+/* input_variable Pointer to variable */
+/* input_string Pointer to string */
+/* xml_parameter XML parameter */
+/* */
+/* OUTPUT */
+/* */
+/* Completion Status */
+/* */
+/* CALLS */
+/* */
+/* */
+/* CALLED BY */
+/* */
+/* _ux_pictbridge_object_parse */
/* */
/**************************************************************************/
-UINT _ux_pictbridge_xml_function_input_startjob_jobconfig_fixedsize(UX_PICTBRIDGE *pictbridge,
+UINT _ux_pictbridge_xml_function_input_startjob_jobconfig_fixedsize(UX_PICTBRIDGE *pictbridge,
UCHAR *input_variable, UCHAR *input_string, UCHAR *xml_parameter)
{
UINT status;
@@ -80,22 +73,22 @@ ULONG hexa_value;
UX_PARAMETER_NOT_USED(input_string);
UX_PARAMETER_NOT_USED(input_variable);
-
+
/* Get the hexa value from the xml parameter. */
status = _ux_pictbridge_element_to_hexa(xml_parameter, &hexa_value);
-
+
/* Check for error. */
if (status != UX_SUCCESS)
-
+
/* We have a element syntax error. */
return(status);
-
+
/* We need to store the fixedsize value. */
pictbridge -> ux_pictbridge_jobinfo.ux_pictbridge_jobinfo_fixedsize = hexa_value;
/* Operation is successful. */
return(UX_SUCCESS);
-
+
}
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 1317c565..a4baef39 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
@@ -1,18 +1,19 @@
/***************************************************************************
- * Copyright (c) 2024 Microsoft Corporation
- *
+ * Copyright (c) 2024 Microsoft Corporation
+ * Copyright (c) 2026-present Eclipse ThreadX contributors
+ *
* This program and the accompanying materials are made available under the
* terms of the MIT License which is available at
* https://opensource.org/licenses/MIT.
- *
+ *
* SPDX-License-Identifier: MIT
**************************************************************************/
/**************************************************************************/
/**************************************************************************/
-/** */
-/** USBX Component */
+/** */
+/** USBX Component */
/** */
/** Pictbridge Application */
/** */
@@ -28,75 +29,67 @@
#include "ux_pictbridge.h"
-/**************************************************************************/
-/* */
-/* FUNCTION RELEASE */
-/* */
-/* _ux_pictbridge_xml_function_input_startjob_jobconfig_imageoptimize */
-/* PORTABLE C */
+/**************************************************************************/
+/* */
+/* FUNCTION RELEASE */
+/* */
+/* _ux_pictbridge_xml_function_input_startjob_jobconfig_imageoptimize */
+/* PORTABLE C */
/* 6.1 */
-/* */
-/* */
+/* */
+/* */
/* AUTHOR */
/* */
/* Chaoqiong Xiao, Microsoft Corporation */
/* */
/* DESCRIPTION */
-/* */
-/* This function decodes the "imageoptimize" tag in the jobconfig */
-/* object */
-/* */
-/* INPUT */
-/* */
-/* pictbridge Pictbridge instance */
-/* input_variable Pointer to variable */
-/* input_string Pointer to string */
-/* xml_parameter XML parameter */
-/* */
-/* OUTPUT */
-/* */
-/* Completion Status */
-/* */
-/* CALLS */
-/* */
-/* */
-/* CALLED BY */
-/* */
-/* _ux_pictbridge_object_parse */
-/* */
-/* RELEASE HISTORY */
-/* */
-/* DATE NAME DESCRIPTION */
-/* */
-/* 05-19-2020 Chaoqiong Xiao Initial Version 6.0 */
-/* 09-30-2020 Chaoqiong Xiao Modified comment(s), */
-/* resulting in version 6.1 */
+/* */
+/* This function decodes the "imageoptimize" tag in the jobconfig */
+/* object */
+/* */
+/* INPUT */
+/* */
+/* pictbridge Pictbridge instance */
+/* input_variable Pointer to variable */
+/* input_string Pointer to string */
+/* xml_parameter XML parameter */
+/* */
+/* OUTPUT */
+/* */
+/* Completion Status */
+/* */
+/* CALLS */
+/* */
+/* */
+/* CALLED BY */
+/* */
+/* _ux_pictbridge_object_parse */
/* */
/**************************************************************************/
-UINT _ux_pictbridge_xml_function_input_startjob_jobconfig_imageoptimize(UX_PICTBRIDGE *pictbridge,
+UINT _ux_pictbridge_xml_function_input_startjob_jobconfig_imageoptimize(UX_PICTBRIDGE *pictbridge,
UCHAR *input_variable, UCHAR *input_string, UCHAR *xml_parameter)
{
UINT status;
ULONG hexa_value;
-
+
UX_PARAMETER_NOT_USED(input_string);
UX_PARAMETER_NOT_USED(input_variable);
/* Get the hexa value from the xml parameter. */
status = _ux_pictbridge_element_to_hexa(xml_parameter, &hexa_value);
-
+
/* Check for error. */
if (status != UX_SUCCESS)
-
+
/* We have a element syntax error. */
return(status);
-
+
/* We need to store the imageoptimize value. */
pictbridge -> ux_pictbridge_jobinfo.ux_pictbridge_jobinfo_imageoptimize = hexa_value;
/* Operation is successful. */
return(UX_SUCCESS);
-
+
}
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 fc1e59ef..94617425 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
@@ -1,18 +1,19 @@
/***************************************************************************
- * Copyright (c) 2024 Microsoft Corporation
- *
+ * Copyright (c) 2024 Microsoft Corporation
+ * Copyright (c) 2026-present Eclipse ThreadX contributors
+ *
* This program and the accompanying materials are made available under the
* terms of the MIT License which is available at
* https://opensource.org/licenses/MIT.
- *
+ *
* SPDX-License-Identifier: MIT
**************************************************************************/
/**************************************************************************/
/**************************************************************************/
-/** */
-/** USBX Component */
+/** */
+/** USBX Component */
/** */
/** Pictbridge Application */
/** */
@@ -28,52 +29,44 @@
#include "ux_pictbridge.h"
-/**************************************************************************/
-/* */
-/* FUNCTION RELEASE */
-/* */
-/* _ux_pictbridge_xml_function_input_startjob_jobconfig_layout */
-/* PORTABLE C */
+/**************************************************************************/
+/* */
+/* FUNCTION RELEASE */
+/* */
+/* _ux_pictbridge_xml_function_input_startjob_jobconfig_layout */
+/* PORTABLE C */
/* 6.1 */
-/* */
-/* */
+/* */
+/* */
/* AUTHOR */
/* */
/* Chaoqiong Xiao, Microsoft Corporation */
/* */
/* DESCRIPTION */
-/* */
-/* This function decodes the "layout" tag in the jobconfig */
-/* object */
-/* */
-/* INPUT */
-/* */
-/* pictbridge Pictbridge instance */
-/* input_variable Pointer to variable */
-/* input_string Pointer to string */
-/* xml_parameter XML parameter */
-/* */
-/* OUTPUT */
-/* */
-/* Completion Status */
-/* */
-/* CALLS */
-/* */
-/* */
-/* CALLED BY */
-/* */
-/* _ux_pictbridge_object_parse */
-/* */
-/* RELEASE HISTORY */
-/* */
-/* DATE NAME DESCRIPTION */
-/* */
-/* 05-19-2020 Chaoqiong Xiao Initial Version 6.0 */
-/* 09-30-2020 Chaoqiong Xiao Modified comment(s), */
-/* resulting in version 6.1 */
+/* */
+/* This function decodes the "layout" tag in the jobconfig */
+/* object */
+/* */
+/* INPUT */
+/* */
+/* pictbridge Pictbridge instance */
+/* input_variable Pointer to variable */
+/* input_string Pointer to string */
+/* xml_parameter XML parameter */
+/* */
+/* OUTPUT */
+/* */
+/* Completion Status */
+/* */
+/* CALLS */
+/* */
+/* */
+/* CALLED BY */
+/* */
+/* _ux_pictbridge_object_parse */
/* */
/**************************************************************************/
-UINT _ux_pictbridge_xml_function_input_startjob_jobconfig_layout(UX_PICTBRIDGE *pictbridge,
+UINT _ux_pictbridge_xml_function_input_startjob_jobconfig_layout(UX_PICTBRIDGE *pictbridge,
UCHAR *input_variable, UCHAR *input_string, UCHAR *xml_parameter)
{
UINT status;
@@ -81,22 +74,22 @@ ULONG hexa_value;
UX_PARAMETER_NOT_USED(input_string);
UX_PARAMETER_NOT_USED(input_variable);
-
+
/* Get the hexa value from the xml parameter. */
status = _ux_pictbridge_element_to_hexa(xml_parameter, &hexa_value);
-
+
/* Check for error. */
if (status != UX_SUCCESS)
-
+
/* We have a element syntax error. */
return(status);
-
+
/* We need to store the layout value. */
pictbridge -> ux_pictbridge_jobinfo.ux_pictbridge_jobinfo_layout = hexa_value;
/* Operation is successful. */
return(UX_SUCCESS);
-
+
}
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 f4e04d2a..0f857a8a 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
@@ -1,18 +1,19 @@
/***************************************************************************
- * Copyright (c) 2024 Microsoft Corporation
- *
+ * Copyright (c) 2024 Microsoft Corporation
+ * Copyright (c) 2026-present Eclipse ThreadX contributors
+ *
* This program and the accompanying materials are made available under the
* terms of the MIT License which is available at
* https://opensource.org/licenses/MIT.
- *
+ *
* SPDX-License-Identifier: MIT
**************************************************************************/
/**************************************************************************/
/**************************************************************************/
-/** */
-/** USBX Component */
+/** */
+/** USBX Component */
/** */
/** Pictbridge Application */
/** */
@@ -28,51 +29,43 @@
#include "ux_pictbridge.h"
-/**************************************************************************/
-/* */
-/* FUNCTION RELEASE */
-/* */
-/* _ux_pictbridge_xml_function_input_startjob_jobconfig_papersize */
-/* PORTABLE C */
+/**************************************************************************/
+/* */
+/* FUNCTION RELEASE */
+/* */
+/* _ux_pictbridge_xml_function_input_startjob_jobconfig_papersize */
+/* PORTABLE C */
/* 6.1 */
-/* */
-/* */
+/* */
+/* */
/* AUTHOR */
/* */
/* Chaoqiong Xiao, Microsoft Corporation */
/* */
/* DESCRIPTION */
-/* */
-/* This function decodes the "papersize" tag in the jobconfig object */
-/* */
-/* INPUT */
-/* */
-/* pictbridge Pictbridge instance */
-/* input_variable Pointer to variable */
-/* input_string Pointer to string */
-/* xml_parameter XML parameter */
-/* */
-/* OUTPUT */
-/* */
-/* Completion Status */
-/* */
-/* CALLS */
-/* */
-/* */
-/* CALLED BY */
-/* */
-/* _ux_pictbridge_object_parse */
-/* */
-/* RELEASE HISTORY */
-/* */
-/* DATE NAME DESCRIPTION */
-/* */
-/* 05-19-2020 Chaoqiong Xiao Initial Version 6.0 */
-/* 09-30-2020 Chaoqiong Xiao Modified comment(s), */
-/* resulting in version 6.1 */
+/* */
+/* This function decodes the "papersize" tag in the jobconfig object */
+/* */
+/* INPUT */
+/* */
+/* pictbridge Pictbridge instance */
+/* input_variable Pointer to variable */
+/* input_string Pointer to string */
+/* xml_parameter XML parameter */
+/* */
+/* OUTPUT */
+/* */
+/* Completion Status */
+/* */
+/* CALLS */
+/* */
+/* */
+/* CALLED BY */
+/* */
+/* _ux_pictbridge_object_parse */
/* */
/**************************************************************************/
-UINT _ux_pictbridge_xml_function_input_startjob_jobconfig_papersize(UX_PICTBRIDGE *pictbridge,
+UINT _ux_pictbridge_xml_function_input_startjob_jobconfig_papersize(UX_PICTBRIDGE *pictbridge,
UCHAR *input_variable, UCHAR *input_string, UCHAR *xml_parameter)
{
UINT status;
@@ -80,22 +73,22 @@ ULONG hexa_value;
UX_PARAMETER_NOT_USED(input_string);
UX_PARAMETER_NOT_USED(input_variable);
-
+
/* Get the hexa value from the xml parameter. */
status = _ux_pictbridge_element_to_hexa(xml_parameter, &hexa_value);
-
+
/* Check for error. */
if (status != UX_SUCCESS)
-
+
/* We have a element syntax error. */
return(status);
-
+
/* We need to store the papersize value. */
pictbridge -> ux_pictbridge_jobinfo.ux_pictbridge_jobinfo_papersize = hexa_value;
/* Operation is successful. */
return(UX_SUCCESS);
-
+
}
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 6118fa64..13c642a5 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
@@ -1,18 +1,19 @@
/***************************************************************************
- * Copyright (c) 2024 Microsoft Corporation
- *
+ * Copyright (c) 2024 Microsoft Corporation
+ * Copyright (c) 2026-present Eclipse ThreadX contributors
+ *
* This program and the accompanying materials are made available under the
* terms of the MIT License which is available at
* https://opensource.org/licenses/MIT.
- *
+ *
* SPDX-License-Identifier: MIT
**************************************************************************/
/**************************************************************************/
/**************************************************************************/
-/** */
-/** USBX Component */
+/** */
+/** USBX Component */
/** */
/** Pictbridge Application */
/** */
@@ -28,51 +29,43 @@
#include "ux_pictbridge.h"
-/**************************************************************************/
-/* */
-/* FUNCTION RELEASE */
-/* */
-/* _ux_pictbridge_xml_function_input_startjob_jobconfig_papertype */
-/* PORTABLE C */
+/**************************************************************************/
+/* */
+/* FUNCTION RELEASE */
+/* */
+/* _ux_pictbridge_xml_function_input_startjob_jobconfig_papertype */
+/* PORTABLE C */
/* 6.1 */
-/* */
-/* */
+/* */
+/* */
/* AUTHOR */
/* */
/* Chaoqiong Xiao, Microsoft Corporation */
/* */
/* DESCRIPTION */
-/* */
-/* This function decodes the "papertype" tag in the jobconfig object */
-/* */
-/* INPUT */
-/* */
-/* pictbridge Pictbridge instance */
-/* input_variable Pointer to variable */
-/* input_string Pointer to string */
-/* xml_parameter XML parameter */
-/* */
-/* OUTPUT */
-/* */
-/* Completion Status */
-/* */
-/* CALLS */
-/* */
-/* */
-/* CALLED BY */
-/* */
-/* _ux_pictbridge_object_parse */
-/* */
-/* RELEASE HISTORY */
-/* */
-/* DATE NAME DESCRIPTION */
-/* */
-/* 05-19-2020 Chaoqiong Xiao Initial Version 6.0 */
-/* 09-30-2020 Chaoqiong Xiao Modified comment(s), */
-/* resulting in version 6.1 */
+/* */
+/* This function decodes the "papertype" tag in the jobconfig object */
+/* */
+/* INPUT */
+/* */
+/* pictbridge Pictbridge instance */
+/* input_variable Pointer to variable */
+/* input_string Pointer to string */
+/* xml_parameter XML parameter */
+/* */
+/* OUTPUT */
+/* */
+/* Completion Status */
+/* */
+/* CALLS */
+/* */
+/* */
+/* CALLED BY */
+/* */
+/* _ux_pictbridge_object_parse */
/* */
/**************************************************************************/
-UINT _ux_pictbridge_xml_function_input_startjob_jobconfig_papertype(UX_PICTBRIDGE *pictbridge,
+UINT _ux_pictbridge_xml_function_input_startjob_jobconfig_papertype(UX_PICTBRIDGE *pictbridge,
UCHAR *input_variable, UCHAR *input_string, UCHAR *xml_parameter)
{
UINT status;
@@ -80,22 +73,22 @@ ULONG hexa_value;
UX_PARAMETER_NOT_USED(input_string);
UX_PARAMETER_NOT_USED(input_variable);
-
+
/* Get the hexa value from the xml parameter. */
status = _ux_pictbridge_element_to_hexa(xml_parameter, &hexa_value);
-
+
/* Check for error. */
if (status != UX_SUCCESS)
-
+
/* We have a element syntax error. */
return(status);
-
+
/* We need to store the papertype value. */
pictbridge -> ux_pictbridge_jobinfo.ux_pictbridge_jobinfo_papertype = hexa_value;
/* Operation is successful. */
return(UX_SUCCESS);
-
+
}
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 8505062e..da402f93 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
@@ -1,18 +1,19 @@
/***************************************************************************
- * Copyright (c) 2024 Microsoft Corporation
- *
+ * Copyright (c) 2024 Microsoft Corporation
+ * Copyright (c) 2026-present Eclipse ThreadX contributors
+ *
* This program and the accompanying materials are made available under the
* terms of the MIT License which is available at
* https://opensource.org/licenses/MIT.
- *
+ *
* SPDX-License-Identifier: MIT
**************************************************************************/
/**************************************************************************/
/**************************************************************************/
-/** */
-/** USBX Component */
+/** */
+/** USBX Component */
/** */
/** Pictbridge Application */
/** */
@@ -28,74 +29,66 @@
#include "ux_pictbridge.h"
-/**************************************************************************/
-/* */
-/* FUNCTION RELEASE */
-/* */
-/* _ux_pictbridge_xml_function_input_startjob_jobconfig_quality */
-/* PORTABLE C */
+/**************************************************************************/
+/* */
+/* FUNCTION RELEASE */
+/* */
+/* _ux_pictbridge_xml_function_input_startjob_jobconfig_quality */
+/* PORTABLE C */
/* 6.1 */
-/* */
-/* */
+/* */
+/* */
/* AUTHOR */
/* */
/* Chaoqiong Xiao, Microsoft Corporation */
/* */
/* DESCRIPTION */
-/* */
-/* This function decodes the "quality" tag in the jobconfig object */
-/* */
-/* INPUT */
-/* */
-/* pictbridge Pictbridge instance */
-/* input_variable Pointer to variable */
-/* input_string Pointer to string */
-/* xml_parameter XML parameter */
-/* */
-/* OUTPUT */
-/* */
-/* Completion Status */
-/* */
-/* CALLS */
-/* */
-/* */
-/* CALLED BY */
-/* */
-/* _ux_pictbridge_object_parse */
-/* */
-/* RELEASE HISTORY */
-/* */
-/* DATE NAME DESCRIPTION */
-/* */
-/* 05-19-2020 Chaoqiong Xiao Initial Version 6.0 */
-/* 09-30-2020 Chaoqiong Xiao Modified comment(s), */
-/* resulting in version 6.1 */
+/* */
+/* This function decodes the "quality" tag in the jobconfig object */
+/* */
+/* INPUT */
+/* */
+/* pictbridge Pictbridge instance */
+/* input_variable Pointer to variable */
+/* input_string Pointer to string */
+/* xml_parameter XML parameter */
+/* */
+/* OUTPUT */
+/* */
+/* Completion Status */
+/* */
+/* CALLS */
+/* */
+/* */
+/* CALLED BY */
+/* */
+/* _ux_pictbridge_object_parse */
/* */
/**************************************************************************/
-UINT _ux_pictbridge_xml_function_input_startjob_jobconfig_quality(UX_PICTBRIDGE *pictbridge,
+UINT _ux_pictbridge_xml_function_input_startjob_jobconfig_quality(UX_PICTBRIDGE *pictbridge,
UCHAR *input_variable, UCHAR *input_string, UCHAR *xml_parameter)
{
UINT status;
ULONG hexa_value;
-
+
UX_PARAMETER_NOT_USED(input_string);
UX_PARAMETER_NOT_USED(input_variable);
/* Get the hexa value from the xml parameter. */
status = _ux_pictbridge_element_to_hexa(xml_parameter, &hexa_value);
-
+
/* Check for error. */
if (status != UX_SUCCESS)
-
+
/* We have a element syntax error. */
return(status);
-
+
/* We need to store the quality value. */
pictbridge -> ux_pictbridge_jobinfo.ux_pictbridge_jobinfo_quality = hexa_value;
/* Operation is successful. */
return(UX_SUCCESS);
-
+
}
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 b8de3785..84605426 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
@@ -1,18 +1,19 @@
/***************************************************************************
- * Copyright (c) 2024 Microsoft Corporation
- *
+ * Copyright (c) 2024 Microsoft Corporation
+ * Copyright (c) 2026-present Eclipse ThreadX contributors
+ *
* This program and the accompanying materials are made available under the
* terms of the MIT License which is available at
* https://opensource.org/licenses/MIT.
- *
+ *
* SPDX-License-Identifier: MIT
**************************************************************************/
/**************************************************************************/
/**************************************************************************/
-/** */
-/** USBX Component */
+/** */
+/** USBX Component */
/** */
/** Pictbridge Application */
/** */
@@ -28,53 +29,45 @@
#include "ux_pictbridge.h"
-/**************************************************************************/
-/* */
-/* FUNCTION RELEASE */
-/* */
+/**************************************************************************/
+/* */
+/* FUNCTION RELEASE */
+/* */
/* _ux_pictbridge_xml_function_input_startjob_printinfo */
-/* PORTABLE C */
+/* PORTABLE C */
/* 6.1 */
-/* */
-/* */
+/* */
+/* */
/* AUTHOR */
/* */
/* Chaoqiong Xiao, Microsoft Corporation */
/* */
/* DESCRIPTION */
-/* */
-/* This function receives a printinfo data block tag. There can be */
-/* many so we should create a new printinfo block into the startjob */
-/* structure for each of them as they come. */
-/* */
-/* */
-/* INPUT */
-/* */
-/* pictbridge Pictbridge instance */
-/* input_variable Pointer to variable */
-/* input_string Pointer to string */
-/* */
-/* OUTPUT */
-/* */
-/* Completion Status */
-/* */
-/* CALLS */
-/* */
-/* */
-/* CALLED BY */
-/* */
-/* _ux_pictbridge_object_parse */
-/* */
-/* RELEASE HISTORY */
-/* */
-/* DATE NAME DESCRIPTION */
-/* */
-/* 05-19-2020 Chaoqiong Xiao Initial Version 6.0 */
-/* 09-30-2020 Chaoqiong Xiao Modified comment(s), */
-/* resulting in version 6.1 */
+/* */
+/* This function receives a printinfo data block tag. There can be */
+/* many so we should create a new printinfo block into the startjob */
+/* structure for each of them as they come. */
+/* */
+/* */
+/* INPUT */
+/* */
+/* pictbridge Pictbridge instance */
+/* input_variable Pointer to variable */
+/* input_string Pointer to string */
+/* */
+/* OUTPUT */
+/* */
+/* Completion Status */
+/* */
+/* CALLS */
+/* */
+/* */
+/* CALLED BY */
+/* */
+/* _ux_pictbridge_object_parse */
/* */
/**************************************************************************/
-UINT _ux_pictbridge_xml_function_input_startjob_printinfo(UX_PICTBRIDGE *pictbridge,
+UINT _ux_pictbridge_xml_function_input_startjob_printinfo(UX_PICTBRIDGE *pictbridge,
UCHAR *input_variable, UCHAR *input_string, UCHAR *xml_parameter)
{
UX_PICTBRIDGE_PRINTINFO *printinfo;
@@ -105,19 +98,19 @@ UX_PICTBRIDGE_PRINTINFO *printinfo;
/* This is the first instance of a printinfo block. */
pictbridge -> ux_pictbridge_jobinfo.ux_pictbridge_jobinfo_printinfo_start = printinfo;
-
+
/* Make it the current as well. */
pictbridge -> ux_pictbridge_jobinfo.ux_pictbridge_jobinfo_printinfo_current = printinfo;
-
+
}
else
{
/* Store the new instance in the next instance pointer of the current instance. */
pictbridge -> ux_pictbridge_jobinfo.ux_pictbridge_jobinfo_printinfo_current -> ux_pictbridge_printinfo_next = printinfo;
-
+
/* And the new one becomes the current. */
pictbridge -> ux_pictbridge_jobinfo.ux_pictbridge_jobinfo_printinfo_current = printinfo;
-
+
}
/* This function did not fail. */
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 3287cbde..5a9f6e76 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
@@ -1,18 +1,19 @@
/***************************************************************************
- * Copyright (c) 2024 Microsoft Corporation
- *
+ * Copyright (c) 2024 Microsoft Corporation
+ * Copyright (c) 2026-present Eclipse ThreadX contributors
+ *
* This program and the accompanying materials are made available under the
* terms of the MIT License which is available at
* https://opensource.org/licenses/MIT.
- *
+ *
* SPDX-License-Identifier: MIT
**************************************************************************/
/**************************************************************************/
/**************************************************************************/
-/** */
-/** USBX Component */
+/** */
+/** USBX Component */
/** */
/** Pictbridge Application */
/** */
@@ -28,51 +29,43 @@
#include "ux_pictbridge.h"
-/**************************************************************************/
-/* */
-/* FUNCTION RELEASE */
-/* */
-/* _ux_pictbridge_xml_function_input_startjob_printinfo_copies */
-/* PORTABLE C */
+/**************************************************************************/
+/* */
+/* FUNCTION RELEASE */
+/* */
+/* _ux_pictbridge_xml_function_input_startjob_printinfo_copies */
+/* PORTABLE C */
/* 6.1 */
-/* */
-/* */
+/* */
+/* */
/* AUTHOR */
/* */
/* Chaoqiong Xiao, Microsoft Corporation */
/* */
/* DESCRIPTION */
-/* */
-/* This function decodes the "copies" tag */
-/* */
-/* INPUT */
-/* */
-/* pictbridge Pictbridge instance */
-/* input_variable Pointer to variable */
-/* input_string Pointer to string */
-/* xml_parameter XML parameter */
-/* */
-/* OUTPUT */
-/* */
-/* Completion Status */
-/* */
-/* CALLS */
-/* */
-/* */
-/* CALLED BY */
-/* */
-/* _ux_pictbridge_object_parse */
-/* */
-/* RELEASE HISTORY */
-/* */
-/* DATE NAME DESCRIPTION */
-/* */
-/* 05-19-2020 Chaoqiong Xiao Initial Version 6.0 */
-/* 09-30-2020 Chaoqiong Xiao Modified comment(s), */
-/* resulting in version 6.1 */
+/* */
+/* This function decodes the "copies" tag */
+/* */
+/* INPUT */
+/* */
+/* pictbridge Pictbridge instance */
+/* input_variable Pointer to variable */
+/* input_string Pointer to string */
+/* xml_parameter XML parameter */
+/* */
+/* OUTPUT */
+/* */
+/* Completion Status */
+/* */
+/* CALLS */
+/* */
+/* */
+/* CALLED BY */
+/* */
+/* _ux_pictbridge_object_parse */
/* */
/**************************************************************************/
-UINT _ux_pictbridge_xml_function_input_startjob_printinfo_copies(UX_PICTBRIDGE *pictbridge,
+UINT _ux_pictbridge_xml_function_input_startjob_printinfo_copies(UX_PICTBRIDGE *pictbridge,
UCHAR *input_variable, UCHAR *input_string, UCHAR *xml_parameter)
{
UINT status;
@@ -80,22 +73,22 @@ ULONG decimal_value;
UX_PARAMETER_NOT_USED(input_string);
UX_PARAMETER_NOT_USED(input_variable);
-
+
/* Get the hexa value from the xml parameter. */
status = _ux_pictbridge_element_to_decimal(xml_parameter, &decimal_value);
-
+
/* Check for error. */
if (status != UX_SUCCESS)
-
+
/* We have a element syntax error. */
return(status);
-
+
/* We need to store the copies value. */
pictbridge -> ux_pictbridge_jobinfo.ux_pictbridge_jobinfo_printinfo_current -> ux_pictbridge_printinfo_copies = decimal_value;
/* Operation is successful. */
return(UX_SUCCESS);
-
+
}
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 bd22a24d..57c634ad 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
@@ -1,18 +1,19 @@
/***************************************************************************
- * Copyright (c) 2024 Microsoft Corporation
- *
+ * Copyright (c) 2024 Microsoft Corporation
+ * Copyright (c) 2026-present Eclipse ThreadX contributors
+ *
* This program and the accompanying materials are made available under the
* terms of the MIT License which is available at
* https://opensource.org/licenses/MIT.
- *
+ *
* SPDX-License-Identifier: MIT
**************************************************************************/
/**************************************************************************/
/**************************************************************************/
-/** */
-/** USBX Component */
+/** */
+/** USBX Component */
/** */
/** Pictbridge Application */
/** */
@@ -28,51 +29,43 @@
#include "ux_pictbridge.h"
-/**************************************************************************/
-/* */
-/* FUNCTION RELEASE */
-/* */
-/* _ux_pictbridge_xml_function_input_startjob_printinfo_copyid */
-/* PORTABLE C */
+/**************************************************************************/
+/* */
+/* FUNCTION RELEASE */
+/* */
+/* _ux_pictbridge_xml_function_input_startjob_printinfo_copyid */
+/* PORTABLE C */
/* 6.1 */
-/* */
-/* */
+/* */
+/* */
/* AUTHOR */
/* */
/* Chaoqiong Xiao, Microsoft Corporation */
/* */
/* DESCRIPTION */
-/* */
-/* This function decodes the "copyid" tag */
-/* */
-/* INPUT */
-/* */
-/* pictbridge Pictbridge instance */
-/* input_variable Pointer to variable */
-/* input_string Pointer to string */
-/* xml_parameter XML parameter */
-/* */
-/* OUTPUT */
-/* */
-/* Completion Status */
-/* */
-/* CALLS */
-/* */
-/* */
-/* CALLED BY */
-/* */
-/* _ux_pictbridge_object_parse */
-/* */
-/* RELEASE HISTORY */
-/* */
-/* DATE NAME DESCRIPTION */
-/* */
-/* 05-19-2020 Chaoqiong Xiao Initial Version 6.0 */
-/* 09-30-2020 Chaoqiong Xiao Modified comment(s), */
-/* resulting in version 6.1 */
+/* */
+/* This function decodes the "copyid" tag */
+/* */
+/* INPUT */
+/* */
+/* pictbridge Pictbridge instance */
+/* input_variable Pointer to variable */
+/* input_string Pointer to string */
+/* xml_parameter XML parameter */
+/* */
+/* OUTPUT */
+/* */
+/* Completion Status */
+/* */
+/* CALLS */
+/* */
+/* */
+/* CALLED BY */
+/* */
+/* _ux_pictbridge_object_parse */
/* */
/**************************************************************************/
-UINT _ux_pictbridge_xml_function_input_startjob_printinfo_copyid(UX_PICTBRIDGE *pictbridge,
+UINT _ux_pictbridge_xml_function_input_startjob_printinfo_copyid(UX_PICTBRIDGE *pictbridge,
UCHAR *input_variable, UCHAR *input_string, UCHAR *xml_parameter)
{
UINT status;
@@ -80,22 +73,22 @@ ULONG decimal_value;
UX_PARAMETER_NOT_USED(input_string);
UX_PARAMETER_NOT_USED(input_variable);
-
+
/* Get the hexa value from the xml parameter. */
status = _ux_pictbridge_element_to_decimal(xml_parameter, &decimal_value);
-
+
/* Check for error. */
if (status != UX_SUCCESS)
-
+
/* We have a element syntax error. */
return(status);
-
+
/* We need to store the copyid value. */
pictbridge -> ux_pictbridge_jobinfo.ux_pictbridge_jobinfo_printinfo_current -> ux_pictbridge_printinfo_copyid = decimal_value;
/* Operation is successful. */
return(UX_SUCCESS);
-
+
}
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 6af74859..fe344840 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
@@ -1,18 +1,19 @@
/***************************************************************************
- * Copyright (c) 2024 Microsoft Corporation
- *
+ * Copyright (c) 2024 Microsoft Corporation
+ * Copyright (c) 2026-present Eclipse ThreadX contributors
+ *
* This program and the accompanying materials are made available under the
* terms of the MIT License which is available at
* https://opensource.org/licenses/MIT.
- *
+ *
* SPDX-License-Identifier: MIT
**************************************************************************/
/**************************************************************************/
/**************************************************************************/
-/** */
-/** USBX Component */
+/** */
+/** USBX Component */
/** */
/** Pictbridge Application */
/** */
@@ -28,57 +29,47 @@
#include "ux_pictbridge.h"
-/**************************************************************************/
-/* */
-/* FUNCTION RELEASE */
-/* */
-/* _ux_pictbridge_xml_function_input_startjob_printinfo_croppingarea */
-/* PORTABLE C */
+/**************************************************************************/
+/* */
+/* FUNCTION RELEASE */
+/* */
+/* _ux_pictbridge_xml_function_input_startjob_printinfo_croppingarea */
+/* PORTABLE C */
/* 6.1 */
-/* */
-/* */
+/* */
+/* */
/* AUTHOR */
/* */
/* Chaoqiong Xiao, Microsoft Corporation */
/* */
/* DESCRIPTION */
-/* */
-/* This function decodes the "croppingarea" tag */
-/* It is followed by 4 coordinates in hexa form. */
-/* */
-/* INPUT */
-/* */
-/* pictbridge Pictbridge instance */
-/* input_variable Pointer to variable */
-/* input_string Pointer to string */
-/* */
-/* OUTPUT */
-/* */
-/* Completion Status */
-/* */
-/* CALLS */
-/* */
-/* */
-/* CALLED BY */
-/* */
-/* _ux_pictbridge_object_parse */
-/* */
-/* RELEASE HISTORY */
-/* */
-/* DATE NAME DESCRIPTION */
-/* */
-/* 05-19-2020 Chaoqiong Xiao Initial Version 6.0 */
-/* 09-30-2020 Chaoqiong Xiao Modified comment(s), */
-/* verified memset and memcpy */
-/* cases, */
-/* resulting in version 6.1 */
+/* */
+/* This function decodes the "croppingarea" tag */
+/* It is followed by 4 coordinates in hexa form. */
+/* */
+/* INPUT */
+/* */
+/* pictbridge Pictbridge instance */
+/* input_variable Pointer to variable */
+/* input_string Pointer to string */
+/* */
+/* OUTPUT */
+/* */
+/* Completion Status */
+/* */
+/* CALLS */
+/* */
+/* */
+/* CALLED BY */
+/* */
+/* _ux_pictbridge_object_parse */
/* */
/**************************************************************************/
-UINT _ux_pictbridge_xml_function_input_startjob_printinfo_croppingarea(UX_PICTBRIDGE *pictbridge,
+UINT _ux_pictbridge_xml_function_input_startjob_printinfo_croppingarea(UX_PICTBRIDGE *pictbridge,
UCHAR *input_variable, UCHAR *input_string, UCHAR *xml_parameter)
{
UINT length = 0;
-ULONG index;
+ULONG index;
UINT status;
UCHAR element_string[UX_PICTBRIDGE_MAX_ELEMENT_SIZE];
UCHAR *element_ptr;
@@ -94,26 +85,26 @@ ULONG hexa_value;
status = _ux_utility_string_length_check(xml_parameter, &length, UX_PICTBRIDGE_MAX_TAG_SIZE);
if (status != UX_SUCCESS)
return(status);
-
+
/* Ensure the length is non zero, otherwise that means the tag has no parameter. */
if (length == 0)
/* That's a syntax error. */
- return(UX_PICTBRIDGE_ERROR_SCRIPT_SYNTAX_ERROR);
+ return(UX_PICTBRIDGE_ERROR_SCRIPT_SYNTAX_ERROR);
/* Reset the cropping area index. */
index = 0;
/* Reset the element area. */
_ux_utility_memory_set(element_string, 0, UX_PICTBRIDGE_MAX_ELEMENT_SIZE); /* Use case of memset is verified. */
-
+
/* And its length. */
element_length = 0;
-
+
/* Set the pointer to the beginning of the element string. */
element_ptr = element_string;
-
- /* Now parse the line and isolate each component of the cropping area. */
+
+ /* Now parse the line and isolate each component of the cropping area. */
/* Get the length of the "papersize " variable. */
while(length != 0)
{
@@ -121,63 +112,63 @@ ULONG hexa_value;
/* Get a character from the xml parameter. Check for delimiter. */
if (*xml_parameter == UX_PICTBRIDGE_TAG_CHAR_SPACE)
{
-
+
/* Do we have a element ? */
if (element_length != 0)
{
/* Yes we do, get the hexa value for that element. */
status = _ux_pictbridge_element_to_hexa(element_string, &hexa_value);
-
+
/* Check for error. */
if (status != UX_SUCCESS)
-
+
/* We have a element syntax error. */
return(status);
-
+
/* Where to store this element. */
switch (index)
{
-
+
case 0 :
-
+
/* This is the X coordinate of the cropping area. */
pictbridge -> ux_pictbridge_jobinfo.ux_pictbridge_jobinfo_printinfo_current -> ux_pictbridge_printinfo_croppingarea_xcoordinate = hexa_value;
-
+
break;
-
+
case 1 :
/* This is the Y coordinate of the cropping area. */
pictbridge -> ux_pictbridge_jobinfo.ux_pictbridge_jobinfo_printinfo_current -> ux_pictbridge_printinfo_croppingarea_ycoordinate = hexa_value;
-
+
break;
case 2 :
/* This is the width of the cropping area. */
pictbridge -> ux_pictbridge_jobinfo.ux_pictbridge_jobinfo_printinfo_current -> ux_pictbridge_printinfo_croppingarea_width = hexa_value;
-
+
break;
case 3 :
/* This is the height of the cropping area. */
pictbridge -> ux_pictbridge_jobinfo.ux_pictbridge_jobinfo_printinfo_current -> ux_pictbridge_printinfo_croppingarea_height = hexa_value;
-
+
break;
- }
+ }
/* Next index now. */
index++;
/* Reset the element area. */
_ux_utility_memory_set(element_string, 0, UX_PICTBRIDGE_MAX_ELEMENT_SIZE); /* Use case of memset is verified. */
-
+
/* And its length. */
element_length = 0;
/* Set the pointer to the beginning of the element string. */
element_ptr = element_string;
-
- }
+
+ }
}
else
{
@@ -185,7 +176,7 @@ ULONG hexa_value;
/* We have a regular character. Store it in the element string buffer. No need to check
the syntax here as the string to hexa conversion will do that. */
*element_ptr++ = *xml_parameter;
-
+
/* Increase the length of the element. */
element_length++;
@@ -194,13 +185,13 @@ ULONG hexa_value;
/* Next position. */
xml_parameter++;
-
+
/* Update length. */
length--;
}
- /* We get here when we reached the end of the xml parameter. We may still have the last element of the cropping area to parse.
+ /* We get here when we reached the end of the xml parameter. We may still have the last element of the cropping area to parse.
The index value will tell us what to do. */
switch (index)
{
@@ -209,10 +200,10 @@ ULONG hexa_value;
/* Still need to parse the last element. Get the hexa value for that element. */
status = _ux_pictbridge_element_to_hexa(element_string, &hexa_value);
-
+
/* Check for error. */
if (status != UX_SUCCESS)
-
+
/* We have a element syntax error. */
return(status);
@@ -230,9 +221,9 @@ ULONG hexa_value;
default :
/* Syntax error. Missing element of the cropping area. */
- return(UX_PICTBRIDGE_ERROR_SCRIPT_SYNTAX_ERROR);
- }
-
+ return(UX_PICTBRIDGE_ERROR_SCRIPT_SYNTAX_ERROR);
+ }
+
}
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 09d3b171..473c83ab 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
@@ -1,18 +1,19 @@
/***************************************************************************
- * Copyright (c) 2024 Microsoft Corporation
- *
+ * Copyright (c) 2024 Microsoft Corporation
+ * Copyright (c) 2026-present Eclipse ThreadX contributors
+ *
* This program and the accompanying materials are made available under the
* terms of the MIT License which is available at
* https://opensource.org/licenses/MIT.
- *
+ *
* SPDX-License-Identifier: MIT
**************************************************************************/
/**************************************************************************/
/**************************************************************************/
-/** */
-/** USBX Component */
+/** */
+/** USBX Component */
/** */
/** Pictbridge Application */
/** */
@@ -28,53 +29,43 @@
#include "ux_pictbridge.h"
-/**************************************************************************/
-/* */
-/* FUNCTION RELEASE */
-/* */
-/* _ux_pictbridge_xml_function_input_startjob_printinfo_date */
-/* PORTABLE C */
+/**************************************************************************/
+/* */
+/* FUNCTION RELEASE */
+/* */
+/* _ux_pictbridge_xml_function_input_startjob_printinfo_date */
+/* PORTABLE C */
/* 6.1 */
-/* */
-/* */
+/* */
+/* */
/* AUTHOR */
/* */
/* Chaoqiong Xiao, Microsoft Corporation */
/* */
/* DESCRIPTION */
-/* */
-/* This function decodes the "date" tag */
-/* */
-/* INPUT */
-/* */
-/* pictbridge Pictbridge instance */
-/* input_variable Pointer to variable */
-/* input_string Pointer to string */
-/* xml_parameter XML parameter */
-/* */
-/* OUTPUT */
-/* */
-/* Completion Status */
-/* */
-/* CALLS */
-/* */
-/* */
-/* CALLED BY */
-/* */
-/* _ux_pictbridge_object_parse */
-/* */
-/* RELEASE HISTORY */
-/* */
-/* DATE NAME DESCRIPTION */
-/* */
-/* 05-19-2020 Chaoqiong Xiao Initial Version 6.0 */
-/* 09-30-2020 Chaoqiong Xiao Modified comment(s), */
-/* verified memset and memcpy */
-/* cases, */
-/* resulting in version 6.1 */
+/* */
+/* This function decodes the "date" tag */
+/* */
+/* INPUT */
+/* */
+/* pictbridge Pictbridge instance */
+/* input_variable Pointer to variable */
+/* input_string Pointer to string */
+/* xml_parameter XML parameter */
+/* */
+/* OUTPUT */
+/* */
+/* Completion Status */
+/* */
+/* CALLS */
+/* */
+/* */
+/* CALLED BY */
+/* */
+/* _ux_pictbridge_object_parse */
/* */
/**************************************************************************/
-UINT _ux_pictbridge_xml_function_input_startjob_printinfo_date(UX_PICTBRIDGE *pictbridge,
+UINT _ux_pictbridge_xml_function_input_startjob_printinfo_date(UX_PICTBRIDGE *pictbridge,
UCHAR *input_variable, UCHAR *input_string, UCHAR *xml_parameter)
{
UINT status;
@@ -92,15 +83,15 @@ UINT length = 0;
if (length == 0)
/* That's a syntax error. */
- return(UX_PICTBRIDGE_ERROR_SCRIPT_SYNTAX_ERROR);
-
+ return(UX_PICTBRIDGE_ERROR_SCRIPT_SYNTAX_ERROR);
+
/* 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); /* 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 b5a2dd79..5cc0ee88 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
@@ -1,18 +1,19 @@
/***************************************************************************
- * Copyright (c) 2024 Microsoft Corporation
- *
+ * Copyright (c) 2024 Microsoft Corporation
+ * Copyright (c) 2026-present Eclipse ThreadX contributors
+ *
* This program and the accompanying materials are made available under the
* terms of the MIT License which is available at
* https://opensource.org/licenses/MIT.
- *
+ *
* SPDX-License-Identifier: MIT
**************************************************************************/
/**************************************************************************/
/**************************************************************************/
-/** */
-/** USBX Component */
+/** */
+/** USBX Component */
/** */
/** Pictbridge Application */
/** */
@@ -28,51 +29,43 @@
#include "ux_pictbridge.h"
-/**************************************************************************/
-/* */
-/* FUNCTION RELEASE */
-/* */
-/* _ux_pictbridge_xml_function_input_startjob_printinfo_fileid */
-/* PORTABLE C */
+/**************************************************************************/
+/* */
+/* FUNCTION RELEASE */
+/* */
+/* _ux_pictbridge_xml_function_input_startjob_printinfo_fileid */
+/* PORTABLE C */
/* 6.1 */
-/* */
-/* */
+/* */
+/* */
/* AUTHOR */
/* */
/* Chaoqiong Xiao, Microsoft Corporation */
/* */
/* DESCRIPTION */
-/* */
-/* This function decodes the "fileid" tag */
-/* */
-/* INPUT */
-/* */
-/* pictbridge Pictbridge instance */
-/* input_variable Pointer to variable */
-/* input_string Pointer to string */
-/* xml_parameter XML parameter */
-/* */
-/* OUTPUT */
-/* */
-/* Completion Status */
-/* */
-/* CALLS */
-/* */
-/* */
-/* CALLED BY */
-/* */
-/* _ux_pictbridge_object_parse */
-/* */
-/* RELEASE HISTORY */
-/* */
-/* DATE NAME DESCRIPTION */
-/* */
-/* 05-19-2020 Chaoqiong Xiao Initial Version 6.0 */
-/* 09-30-2020 Chaoqiong Xiao Modified comment(s), */
-/* resulting in version 6.1 */
+/* */
+/* This function decodes the "fileid" tag */
+/* */
+/* INPUT */
+/* */
+/* pictbridge Pictbridge instance */
+/* input_variable Pointer to variable */
+/* input_string Pointer to string */
+/* xml_parameter XML parameter */
+/* */
+/* OUTPUT */
+/* */
+/* Completion Status */
+/* */
+/* CALLS */
+/* */
+/* */
+/* CALLED BY */
+/* */
+/* _ux_pictbridge_object_parse */
/* */
/**************************************************************************/
-UINT _ux_pictbridge_xml_function_input_startjob_printinfo_fileid(UX_PICTBRIDGE *pictbridge,
+UINT _ux_pictbridge_xml_function_input_startjob_printinfo_fileid(UX_PICTBRIDGE *pictbridge,
UCHAR *input_variable, UCHAR *input_string, UCHAR *xml_parameter)
{
UINT status;
@@ -80,23 +73,23 @@ ULONG hexa_value;
UX_PARAMETER_NOT_USED(input_string);
UX_PARAMETER_NOT_USED(input_variable);
-
+
/* Get the hexa value from the xml parameter. */
status = _ux_pictbridge_element_to_hexa(xml_parameter, &hexa_value);
-
+
/* Check for error. */
if (status != UX_SUCCESS)
-
+
/* We have a element syntax error. */
return(status);
-
+
/* We need to store the fileid value. */
pictbridge -> ux_pictbridge_jobinfo.ux_pictbridge_jobinfo_printinfo_current -> ux_pictbridge_printinfo_fileid = hexa_value;
/* Operation is successful. */
return(UX_SUCCESS);
-
+
}
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 12b3dbaa..366e6af0 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
@@ -1,18 +1,19 @@
/***************************************************************************
- * Copyright (c) 2024 Microsoft Corporation
- *
+ * Copyright (c) 2024 Microsoft Corporation
+ * Copyright (c) 2026-present Eclipse ThreadX contributors
+ *
* This program and the accompanying materials are made available under the
* terms of the MIT License which is available at
* https://opensource.org/licenses/MIT.
- *
+ *
* SPDX-License-Identifier: MIT
**************************************************************************/
/**************************************************************************/
/**************************************************************************/
-/** */
-/** USBX Component */
+/** */
+/** USBX Component */
/** */
/** Pictbridge Application */
/** */
@@ -28,53 +29,43 @@
#include "ux_pictbridge.h"
-/**************************************************************************/
-/* */
-/* FUNCTION RELEASE */
-/* */
-/* _ux_pictbridge_xml_function_input_startjob_printinfo_filename */
-/* PORTABLE C */
+/**************************************************************************/
+/* */
+/* FUNCTION RELEASE */
+/* */
+/* _ux_pictbridge_xml_function_input_startjob_printinfo_filename */
+/* PORTABLE C */
/* 6.1 */
-/* */
-/* */
+/* */
+/* */
/* AUTHOR */
/* */
/* Chaoqiong Xiao, Microsoft Corporation */
/* */
/* DESCRIPTION */
-/* */
-/* This function decodes the "filename" tag */
-/* */
-/* INPUT */
-/* */
-/* pictbridge Pictbridge instance */
-/* input_variable Pointer to variable */
-/* input_string Pointer to string */
-/* xml_parameter XML parameter */
-/* */
-/* OUTPUT */
-/* */
-/* Completion Status */
-/* */
-/* CALLS */
-/* */
-/* */
-/* CALLED BY */
-/* */
-/* _ux_pictbridge_object_parse */
-/* */
-/* RELEASE HISTORY */
-/* */
-/* DATE NAME DESCRIPTION */
-/* */
-/* 05-19-2020 Chaoqiong Xiao Initial Version 6.0 */
-/* 09-30-2020 Chaoqiong Xiao Modified comment(s), */
-/* verified memset and memcpy */
-/* cases, */
-/* resulting in version 6.1 */
+/* */
+/* This function decodes the "filename" tag */
+/* */
+/* INPUT */
+/* */
+/* pictbridge Pictbridge instance */
+/* input_variable Pointer to variable */
+/* input_string Pointer to string */
+/* xml_parameter XML parameter */
+/* */
+/* OUTPUT */
+/* */
+/* Completion Status */
+/* */
+/* CALLS */
+/* */
+/* */
+/* CALLED BY */
+/* */
+/* _ux_pictbridge_object_parse */
/* */
/**************************************************************************/
-UINT _ux_pictbridge_xml_function_input_startjob_printinfo_filename(UX_PICTBRIDGE *pictbridge,
+UINT _ux_pictbridge_xml_function_input_startjob_printinfo_filename(UX_PICTBRIDGE *pictbridge,
UCHAR *input_variable, UCHAR *input_string, UCHAR *xml_parameter)
{
UINT status;
@@ -87,20 +78,20 @@ UINT length = 0;
status = _ux_utility_string_length_check(xml_parameter, &length, UX_PICTBRIDGE_MAX_STRING_SIZE);
if (status != UX_SUCCESS)
return(status);
-
+
/* Ensure the length is non zero, otherwise that means the tag has no parameter. */
if (length == 0)
/* That's a syntax error. */
- return(UX_PICTBRIDGE_ERROR_SCRIPT_SYNTAX_ERROR);
-
+ return(UX_PICTBRIDGE_ERROR_SCRIPT_SYNTAX_ERROR);
+
/* 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); /* 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 13b6716c..8bd81032 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
@@ -1,18 +1,19 @@
/***************************************************************************
- * Copyright (c) 2024 Microsoft Corporation
- *
+ * Copyright (c) 2024 Microsoft Corporation
+ * Copyright (c) 2026-present Eclipse ThreadX contributors
+ *
* This program and the accompanying materials are made available under the
* terms of the MIT License which is available at
* https://opensource.org/licenses/MIT.
- *
+ *
* SPDX-License-Identifier: MIT
**************************************************************************/
/**************************************************************************/
/**************************************************************************/
-/** */
-/** USBX Component */
+/** */
+/** USBX Component */
/** */
/** Pictbridge Application */
/** */
@@ -28,53 +29,43 @@
#include "ux_pictbridge.h"
-/**************************************************************************/
-/* */
-/* FUNCTION RELEASE */
-/* */
-/* _ux_pictbridge_xml_function_input_startjob_printinfo_filepath */
-/* PORTABLE C */
+/**************************************************************************/
+/* */
+/* FUNCTION RELEASE */
+/* */
+/* _ux_pictbridge_xml_function_input_startjob_printinfo_filepath */
+/* PORTABLE C */
/* 6.1 */
-/* */
-/* */
+/* */
+/* */
/* AUTHOR */
/* */
/* Chaoqiong Xiao, Microsoft Corporation */
/* */
/* DESCRIPTION */
-/* */
-/* This function decodes the "filepath" tag */
-/* */
-/* INPUT */
-/* */
-/* pictbridge Pictbridge instance */
-/* input_variable Pointer to variable */
-/* input_string Pointer to string */
-/* xml_parameter XML parameter */
-/* */
-/* OUTPUT */
-/* */
-/* Completion Status */
-/* */
-/* CALLS */
-/* */
-/* */
-/* CALLED BY */
-/* */
-/* _ux_pictbridge_object_parse */
-/* */
-/* RELEASE HISTORY */
-/* */
-/* DATE NAME DESCRIPTION */
-/* */
-/* 05-19-2020 Chaoqiong Xiao Initial Version 6.0 */
-/* 09-30-2020 Chaoqiong Xiao Modified comment(s), */
-/* verified memset and memcpy */
-/* cases, */
-/* resulting in version 6.1 */
+/* */
+/* This function decodes the "filepath" tag */
+/* */
+/* INPUT */
+/* */
+/* pictbridge Pictbridge instance */
+/* input_variable Pointer to variable */
+/* input_string Pointer to string */
+/* xml_parameter XML parameter */
+/* */
+/* OUTPUT */
+/* */
+/* Completion Status */
+/* */
+/* CALLS */
+/* */
+/* */
+/* CALLED BY */
+/* */
+/* _ux_pictbridge_object_parse */
/* */
/**************************************************************************/
-UINT _ux_pictbridge_xml_function_input_startjob_printinfo_filepath(UX_PICTBRIDGE *pictbridge,
+UINT _ux_pictbridge_xml_function_input_startjob_printinfo_filepath(UX_PICTBRIDGE *pictbridge,
UCHAR *input_variable, UCHAR *input_string, UCHAR *xml_parameter)
{
UINT status;
@@ -87,20 +78,20 @@ UINT length = 0;
status = _ux_utility_string_length_check(xml_parameter, &length, UX_PICTBRIDGE_MAX_STRING_SIZE);
if (status != UX_SUCCESS)
return(status);
-
+
/* Ensure the length is non zero, otherwise that means the tag has no parameter. */
if (length == 0)
/* That's a syntax error. */
- return(UX_PICTBRIDGE_ERROR_SCRIPT_SYNTAX_ERROR);
-
+ return(UX_PICTBRIDGE_ERROR_SCRIPT_SYNTAX_ERROR);
+
/* 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); /* 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 24c4c184..1c83ee57 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
@@ -1,18 +1,19 @@
/***************************************************************************
- * Copyright (c) 2024 Microsoft Corporation
- *
+ * Copyright (c) 2024 Microsoft Corporation
+ * Copyright (c) 2026-present Eclipse ThreadX contributors
+ *
* This program and the accompanying materials are made available under the
* terms of the MIT License which is available at
* https://opensource.org/licenses/MIT.
- *
+ *
* SPDX-License-Identifier: MIT
**************************************************************************/
/**************************************************************************/
/**************************************************************************/
-/** */
-/** USBX Component */
+/** */
+/** USBX Component */
/** */
/** Pictbridge Application */
/** */
@@ -28,52 +29,44 @@
#include "ux_pictbridge.h"
-/**************************************************************************/
-/* */
-/* FUNCTION RELEASE */
-/* */
-/* _ux_pictbridge_xml_function_input_startjob_printinfo_prtpid */
-/* PORTABLE C */
+/**************************************************************************/
+/* */
+/* FUNCTION RELEASE */
+/* */
+/* _ux_pictbridge_xml_function_input_startjob_printinfo_prtpid */
+/* PORTABLE C */
/* 6.1 */
-/* */
-/* */
-/* */
+/* */
+/* */
+/* */
/* AUTHOR */
/* */
/* Chaoqiong Xiao, Microsoft Corporation */
/* */
/* DESCRIPTION */
-/* */
-/* This function decodes the "prtpid" tag */
-/* */
-/* INPUT */
-/* */
-/* pictbridge Pictbridge instance */
-/* input_variable Pointer to variable */
-/* input_string Pointer to string */
-/* xml_parameter XML parameter */
-/* */
-/* OUTPUT */
-/* */
-/* Completion Status */
-/* */
-/* CALLS */
-/* */
-/* */
-/* CALLED BY */
-/* */
-/* _ux_pictbridge_object_parse */
-/* */
-/* RELEASE HISTORY */
-/* */
-/* DATE NAME DESCRIPTION */
-/* */
-/* 05-19-2020 Chaoqiong Xiao Initial Version 6.0 */
-/* 09-30-2020 Chaoqiong Xiao Modified comment(s), */
-/* resulting in version 6.1 */
+/* */
+/* This function decodes the "prtpid" tag */
+/* */
+/* INPUT */
+/* */
+/* pictbridge Pictbridge instance */
+/* input_variable Pointer to variable */
+/* input_string Pointer to string */
+/* xml_parameter XML parameter */
+/* */
+/* OUTPUT */
+/* */
+/* Completion Status */
+/* */
+/* CALLS */
+/* */
+/* */
+/* CALLED BY */
+/* */
+/* _ux_pictbridge_object_parse */
/* */
/**************************************************************************/
-UINT _ux_pictbridge_xml_function_input_startjob_printinfo_prtpid(UX_PICTBRIDGE *pictbridge,
+UINT _ux_pictbridge_xml_function_input_startjob_printinfo_prtpid(UX_PICTBRIDGE *pictbridge,
UCHAR *input_variable, UCHAR *input_string, UCHAR *xml_parameter)
{
UINT status;
@@ -81,23 +74,23 @@ ULONG hexa_value;
UX_PARAMETER_NOT_USED(input_string);
UX_PARAMETER_NOT_USED(input_variable);
-
+
/* Get the hexa value from the xml parameter. */
status = _ux_pictbridge_element_to_hexa(xml_parameter, &hexa_value);
-
+
/* Check for error. */
if (status != UX_SUCCESS)
-
+
/* We have a element syntax error. */
return(status);
-
+
/* We need to store the prtpid value. */
pictbridge -> ux_pictbridge_jobinfo.ux_pictbridge_jobinfo_printinfo_current -> ux_pictbridge_printinfo_prtpid = hexa_value;
/* Operation is successful. */
return(UX_SUCCESS);
-
+
}
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 844bce3e..59a1c0cf 100644
--- a/common/usbx_pictbridge/src/ux_pictbridge_xml_function_null.c
+++ b/common/usbx_pictbridge/src/ux_pictbridge_xml_function_null.c
@@ -1,18 +1,19 @@
/***************************************************************************
- * Copyright (c) 2024 Microsoft Corporation
- *
+ * Copyright (c) 2024 Microsoft Corporation
+ * Copyright (c) 2026-present Eclipse ThreadX contributors
+ *
* This program and the accompanying materials are made available under the
* terms of the MIT License which is available at
* https://opensource.org/licenses/MIT.
- *
+ *
* SPDX-License-Identifier: MIT
**************************************************************************/
/**************************************************************************/
/**************************************************************************/
-/** */
-/** USBX Component */
+/** */
+/** USBX Component */
/** */
/** Pictbridge Application */
/** */
@@ -28,56 +29,48 @@
#include "ux_pictbridge.h"
-/**************************************************************************/
-/* */
-/* FUNCTION RELEASE */
-/* */
-/* _ux_pictbridge_xml_function_null PORTABLE C */
+/**************************************************************************/
+/* */
+/* FUNCTION RELEASE */
+/* */
+/* _ux_pictbridge_xml_function_null PORTABLE C */
/* 6.1 */
/* AUTHOR */
/* */
/* Chaoqiong Xiao, Microsoft Corporation */
/* */
/* DESCRIPTION */
-/* */
-/* This function is a repository when a tag is not treated. */
-/* */
-/* INPUT */
-/* */
-/* pictbridge Pictbridge instance */
-/* input_variable Pointer to variable */
-/* input_string Pointer to string */
-/* */
-/* OUTPUT */
-/* */
-/* Completion Status */
-/* */
-/* CALLS */
-/* */
-/* */
-/* CALLED BY */
-/* */
-/* _ux_pictbridge_object_parse */
-/* */
-/* RELEASE HISTORY */
-/* */
-/* DATE NAME DESCRIPTION */
-/* */
-/* 05-19-2020 Chaoqiong Xiao Initial Version 6.0 */
-/* 09-30-2020 Chaoqiong Xiao Modified comment(s), */
-/* resulting in version 6.1 */
+/* */
+/* This function is a repository when a tag is not treated. */
+/* */
+/* INPUT */
+/* */
+/* pictbridge Pictbridge instance */
+/* input_variable Pointer to variable */
+/* input_string Pointer to string */
+/* */
+/* OUTPUT */
+/* */
+/* Completion Status */
+/* */
+/* CALLS */
+/* */
+/* */
+/* CALLED BY */
+/* */
+/* _ux_pictbridge_object_parse */
/* */
/**************************************************************************/
-UINT _ux_pictbridge_xml_function_null(UX_PICTBRIDGE *pictbridge, UCHAR *input_variable, UCHAR *input_string,
+UINT _ux_pictbridge_xml_function_null(UX_PICTBRIDGE *pictbridge, UCHAR *input_variable, UCHAR *input_string,
UCHAR *xml_parameter)
{
-
+
UX_PARAMETER_NOT_USED(input_string);
UX_PARAMETER_NOT_USED(input_variable);
UX_PARAMETER_NOT_USED(pictbridge);
UX_PARAMETER_NOT_USED(xml_parameter);
/* This function never fails. */
- return(UX_SUCCESS);
+ return(UX_SUCCESS);
}
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 521ca118..2d02b887 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
@@ -1,18 +1,19 @@
/***************************************************************************
- * Copyright (c) 2024 Microsoft Corporation
- *
+ * Copyright (c) 2024 Microsoft Corporation
+ * Copyright (c) 2026-present Eclipse ThreadX contributors
+ *
* This program and the accompanying materials are made available under the
* terms of the MIT License which is available at
* https://opensource.org/licenses/MIT.
- *
+ *
* SPDX-License-Identifier: MIT
**************************************************************************/
/**************************************************************************/
/**************************************************************************/
-/** */
-/** USBX Component */
+/** */
+/** USBX Component */
/** */
/** Pictbridge Application */
/** */
@@ -28,52 +29,44 @@
#include "ux_pictbridge.h"
-/**************************************************************************/
-/* */
-/* FUNCTION RELEASE */
-/* */
+/**************************************************************************/
+/* */
+/* FUNCTION RELEASE */
+/* */
/* _ux_pictbridge_xml_function_output_getcapability_capability_ */
-/* croppings */
-/* PORTABLE C */
+/* croppings */
+/* PORTABLE C */
/* 6.1 */
-/* */
-/* */
+/* */
+/* */
/* AUTHOR */
/* */
/* Chaoqiong Xiao, Microsoft Corporation */
/* */
/* DESCRIPTION */
-/* */
-/* This function decodes the croppings tag */
-/* */
-/* INPUT */
-/* */
-/* pictbridge Pictbridge instance */
-/* input_variable Pointer to variable */
-/* input_string Pointer to string */
-/* xml_parameter Pointer to xml parameter */
-/* */
-/* OUTPUT */
-/* */
-/* Completion Status */
-/* */
-/* CALLS */
-/* */
-/* */
-/* CALLED BY */
-/* */
-/* _ux_pictbridge_object_parse */
-/* */
-/* RELEASE HISTORY */
-/* */
-/* DATE NAME DESCRIPTION */
-/* */
-/* 05-19-2020 Chaoqiong Xiao Initial Version 6.0 */
-/* 09-30-2020 Chaoqiong Xiao Modified comment(s), */
-/* resulting in version 6.1 */
+/* */
+/* This function decodes the croppings tag */
+/* */
+/* INPUT */
+/* */
+/* pictbridge Pictbridge instance */
+/* input_variable Pointer to variable */
+/* input_string Pointer to string */
+/* xml_parameter Pointer to xml parameter */
+/* */
+/* OUTPUT */
+/* */
+/* Completion Status */
+/* */
+/* CALLS */
+/* */
+/* */
+/* CALLED BY */
+/* */
+/* _ux_pictbridge_object_parse */
/* */
/**************************************************************************/
-UINT _ux_pictbridge_xml_function_output_getcapability_capability_croppings(UX_PICTBRIDGE *pictbridge,
+UINT _ux_pictbridge_xml_function_output_getcapability_capability_croppings(UX_PICTBRIDGE *pictbridge,
UCHAR *input_variable, UCHAR *input_string, UCHAR *xml_parameter)
{
UINT status;
@@ -88,12 +81,12 @@ UINT status;
if (status != UX_SUCCESS)
/* We get here when we reached an unexpected end of the XML object or a format error. */
- return(UX_PICTBRIDGE_ERROR_SCRIPT_SYNTAX_ERROR);
-
+ return(UX_PICTBRIDGE_ERROR_SCRIPT_SYNTAX_ERROR);
+
else
-
+
/* We are done. */
- return(UX_SUCCESS);
+ return(UX_SUCCESS);
}
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 0228e059..fc88db48 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
@@ -1,18 +1,19 @@
/***************************************************************************
- * Copyright (c) 2024 Microsoft Corporation
- *
+ * Copyright (c) 2024 Microsoft Corporation
+ * Copyright (c) 2026-present Eclipse ThreadX contributors
+ *
* This program and the accompanying materials are made available under the
* terms of the MIT License which is available at
* https://opensource.org/licenses/MIT.
- *
+ *
* SPDX-License-Identifier: MIT
**************************************************************************/
/**************************************************************************/
/**************************************************************************/
-/** */
-/** USBX Component */
+/** */
+/** USBX Component */
/** */
/** Pictbridge Application */
/** */
@@ -28,52 +29,44 @@
#include "ux_pictbridge.h"
-/**************************************************************************/
-/* */
-/* FUNCTION RELEASE */
-/* */
+/**************************************************************************/
+/* */
+/* FUNCTION RELEASE */
+/* */
/* _ux_pictbridge_xml_function_output_getcapability_capability_ */
-/* dateprints */
-/* PORTABLE C */
+/* dateprints */
+/* PORTABLE C */
/* 6.1 */
-/* */
-/* */
+/* */
+/* */
/* AUTHOR */
/* */
/* Chaoqiong Xiao, Microsoft Corporation */
/* */
/* DESCRIPTION */
-/* */
-/* This function decodes the papersize tag */
-/* */
-/* INPUT */
-/* */
-/* pictbridge Pictbridge instance */
-/* input_variable Pointer to variable */
-/* input_string Pointer to string */
-/* xml_parameter Pointer to xml parameter */
-/* */
-/* OUTPUT */
-/* */
-/* Completion Status */
-/* */
-/* CALLS */
-/* */
-/* */
-/* CALLED BY */
-/* */
-/* _ux_pictbridge_object_parse */
-/* */
-/* RELEASE HISTORY */
-/* */
-/* DATE NAME DESCRIPTION */
-/* */
-/* 05-19-2020 Chaoqiong Xiao Initial Version 6.0 */
-/* 09-30-2020 Chaoqiong Xiao Modified comment(s), */
-/* resulting in version 6.1 */
+/* */
+/* This function decodes the papersize tag */
+/* */
+/* INPUT */
+/* */
+/* pictbridge Pictbridge instance */
+/* input_variable Pointer to variable */
+/* input_string Pointer to string */
+/* xml_parameter Pointer to xml parameter */
+/* */
+/* OUTPUT */
+/* */
+/* Completion Status */
+/* */
+/* CALLS */
+/* */
+/* */
+/* CALLED BY */
+/* */
+/* _ux_pictbridge_object_parse */
/* */
/**************************************************************************/
-UINT _ux_pictbridge_xml_function_output_getcapability_capability_dateprints(UX_PICTBRIDGE *pictbridge,
+UINT _ux_pictbridge_xml_function_output_getcapability_capability_dateprints(UX_PICTBRIDGE *pictbridge,
UCHAR *input_variable, UCHAR *input_string, UCHAR *xml_parameter)
{
UINT status;
@@ -89,12 +82,12 @@ UINT status;
if (status != UX_SUCCESS)
/* We get here when we reached an unexpected end of the XML object or a format error. */
- return(UX_PICTBRIDGE_ERROR_SCRIPT_SYNTAX_ERROR);
-
+ return(UX_PICTBRIDGE_ERROR_SCRIPT_SYNTAX_ERROR);
+
else
-
+
/* We are done. */
- return(UX_SUCCESS);
+ return(UX_SUCCESS);
}
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 282edb20..804cfa89 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
@@ -1,18 +1,19 @@
/***************************************************************************
- * Copyright (c) 2024 Microsoft Corporation
- *
+ * Copyright (c) 2024 Microsoft Corporation
+ * Copyright (c) 2026-present Eclipse ThreadX contributors
+ *
* This program and the accompanying materials are made available under the
* terms of the MIT License which is available at
* https://opensource.org/licenses/MIT.
- *
+ *
* SPDX-License-Identifier: MIT
**************************************************************************/
/**************************************************************************/
/**************************************************************************/
-/** */
-/** USBX Component */
+/** */
+/** USBX Component */
/** */
/** Pictbridge Application */
/** */
@@ -28,52 +29,44 @@
#include "ux_pictbridge.h"
-/**************************************************************************/
-/* */
-/* FUNCTION RELEASE */
-/* */
+/**************************************************************************/
+/* */
+/* FUNCTION RELEASE */
+/* */
/* _ux_pictbridge_xml_function_output_getcapability_capability_ */
-/* filenameprints */
-/* PORTABLE C */
+/* filenameprints */
+/* PORTABLE C */
/* 6.1 */
-/* */
-/* */
+/* */
+/* */
/* AUTHOR */
/* */
/* Chaoqiong Xiao, Microsoft Corporation */
/* */
/* DESCRIPTION */
-/* */
-/* This function decodes the filenameprints tag */
-/* */
-/* INPUT */
-/* */
-/* pictbridge Pictbridge instance */
-/* input_variable Pointer to variable */
-/* input_string Pointer to string */
-/* xml_parameter Pointer to xml parameter */
-/* */
-/* OUTPUT */
-/* */
-/* Completion Status */
-/* */
-/* CALLS */
-/* */
-/* */
-/* CALLED BY */
-/* */
-/* _ux_pictbridge_object_parse */
-/* */
-/* RELEASE HISTORY */
-/* */
-/* DATE NAME DESCRIPTION */
-/* */
-/* 05-19-2020 Chaoqiong Xiao Initial Version 6.0 */
-/* 09-30-2020 Chaoqiong Xiao Modified comment(s), */
-/* resulting in version 6.1 */
+/* */
+/* This function decodes the filenameprints tag */
+/* */
+/* INPUT */
+/* */
+/* pictbridge Pictbridge instance */
+/* input_variable Pointer to variable */
+/* input_string Pointer to string */
+/* xml_parameter Pointer to xml parameter */
+/* */
+/* OUTPUT */
+/* */
+/* Completion Status */
+/* */
+/* CALLS */
+/* */
+/* */
+/* CALLED BY */
+/* */
+/* _ux_pictbridge_object_parse */
/* */
/**************************************************************************/
-UINT _ux_pictbridge_xml_function_output_getcapability_capability_filenameprints(UX_PICTBRIDGE *pictbridge,
+UINT _ux_pictbridge_xml_function_output_getcapability_capability_filenameprints(UX_PICTBRIDGE *pictbridge,
UCHAR *input_variable, UCHAR *input_string, UCHAR *xml_parameter)
{
UINT status;
@@ -88,12 +81,12 @@ UINT status;
if (status != UX_SUCCESS)
/* We get here when we reached an unexpected end of the XML object or a format error. */
- return(UX_PICTBRIDGE_ERROR_SCRIPT_SYNTAX_ERROR);
-
+ return(UX_PICTBRIDGE_ERROR_SCRIPT_SYNTAX_ERROR);
+
else
-
+
/* We are done. */
- return(UX_SUCCESS);
+ return(UX_SUCCESS);
}
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 559cefec..d7fc7773 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
@@ -1,18 +1,19 @@
/***************************************************************************
- * Copyright (c) 2024 Microsoft Corporation
- *
+ * Copyright (c) 2024 Microsoft Corporation
+ * Copyright (c) 2026-present Eclipse ThreadX contributors
+ *
* This program and the accompanying materials are made available under the
* terms of the MIT License which is available at
* https://opensource.org/licenses/MIT.
- *
+ *
* SPDX-License-Identifier: MIT
**************************************************************************/
/**************************************************************************/
/**************************************************************************/
-/** */
-/** USBX Component */
+/** */
+/** USBX Component */
/** */
/** Pictbridge Application */
/** */
@@ -28,52 +29,44 @@
#include "ux_pictbridge.h"
-/**************************************************************************/
-/* */
-/* FUNCTION RELEASE */
-/* */
+/**************************************************************************/
+/* */
+/* FUNCTION RELEASE */
+/* */
/* _ux_pictbridge_xml_function_output_getcapability_capability_ */
-/* filetypes */
-/* PORTABLE C */
+/* filetypes */
+/* PORTABLE C */
/* 6.1 */
-/* */
-/* */
+/* */
+/* */
/* AUTHOR */
/* */
/* Chaoqiong Xiao, Microsoft Corporation */
/* */
/* DESCRIPTION */
-/* */
-/* This function decodes the filetypes tag */
-/* */
-/* INPUT */
-/* */
-/* pictbridge Pictbridge instance */
-/* input_variable Pointer to variable */
-/* input_string Pointer to string */
-/* xml_parameter Pointer to xml parameter */
-/* */
-/* OUTPUT */
-/* */
-/* Completion Status */
-/* */
-/* CALLS */
-/* */
-/* */
-/* CALLED BY */
-/* */
-/* _ux_pictbridge_object_parse */
-/* */
-/* RELEASE HISTORY */
-/* */
-/* DATE NAME DESCRIPTION */
-/* */
-/* 05-19-2020 Chaoqiong Xiao Initial Version 6.0 */
-/* 09-30-2020 Chaoqiong Xiao Modified comment(s), */
-/* resulting in version 6.1 */
+/* */
+/* This function decodes the filetypes tag */
+/* */
+/* INPUT */
+/* */
+/* pictbridge Pictbridge instance */
+/* input_variable Pointer to variable */
+/* input_string Pointer to string */
+/* xml_parameter Pointer to xml parameter */
+/* */
+/* OUTPUT */
+/* */
+/* Completion Status */
+/* */
+/* CALLS */
+/* */
+/* */
+/* CALLED BY */
+/* */
+/* _ux_pictbridge_object_parse */
/* */
/**************************************************************************/
-UINT _ux_pictbridge_xml_function_output_getcapability_capability_filetypes(UX_PICTBRIDGE *pictbridge,
+UINT _ux_pictbridge_xml_function_output_getcapability_capability_filetypes(UX_PICTBRIDGE *pictbridge,
UCHAR *input_variable, UCHAR *input_string, UCHAR *xml_parameter)
{
UINT status;
@@ -88,12 +81,12 @@ UINT status;
if (status != UX_SUCCESS)
/* We get here when we reached an unexpected end of the XML object or a format error. */
- return(UX_PICTBRIDGE_ERROR_SCRIPT_SYNTAX_ERROR);
-
+ return(UX_PICTBRIDGE_ERROR_SCRIPT_SYNTAX_ERROR);
+
else
-
+
/* We are done. */
- return(UX_SUCCESS);
+ return(UX_SUCCESS);
}
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 96568773..6fa3f4b8 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
@@ -1,18 +1,19 @@
/***************************************************************************
- * Copyright (c) 2024 Microsoft Corporation
- *
+ * Copyright (c) 2024 Microsoft Corporation
+ * Copyright (c) 2026-present Eclipse ThreadX contributors
+ *
* This program and the accompanying materials are made available under the
* terms of the MIT License which is available at
* https://opensource.org/licenses/MIT.
- *
+ *
* SPDX-License-Identifier: MIT
**************************************************************************/
/**************************************************************************/
/**************************************************************************/
-/** */
-/** USBX Component */
+/** */
+/** USBX Component */
/** */
/** Pictbridge Application */
/** */
@@ -28,52 +29,44 @@
#include "ux_pictbridge.h"
-/**************************************************************************/
-/* */
-/* FUNCTION RELEASE */
-/* */
+/**************************************************************************/
+/* */
+/* FUNCTION RELEASE */
+/* */
/* _ux_pictbridge_xml_function_output_getcapability_capability_ */
-/* fixedsizes */
-/* PORTABLE C */
+/* fixedsizes */
+/* PORTABLE C */
/* 6.1 */
-/* */
-/* */
+/* */
+/* */
/* AUTHOR */
/* */
/* Chaoqiong Xiao, Microsoft Corporation */
/* */
/* DESCRIPTION */
-/* */
-/* This function decodes the fixedsizes tag */
-/* */
-/* INPUT */
-/* */
-/* pictbridge Pictbridge instance */
-/* input_variable Pointer to variable */
-/* input_string Pointer to string */
-/* xml_parameter Pointer to xml parameter */
-/* */
-/* OUTPUT */
-/* */
-/* Completion Status */
-/* */
-/* CALLS */
-/* */
-/* */
-/* CALLED BY */
-/* */
-/* _ux_pictbridge_object_parse */
-/* */
-/* RELEASE HISTORY */
-/* */
-/* DATE NAME DESCRIPTION */
-/* */
-/* 05-19-2020 Chaoqiong Xiao Initial Version 6.0 */
-/* 09-30-2020 Chaoqiong Xiao Modified comment(s), */
-/* resulting in version 6.1 */
+/* */
+/* This function decodes the fixedsizes tag */
+/* */
+/* INPUT */
+/* */
+/* pictbridge Pictbridge instance */
+/* input_variable Pointer to variable */
+/* input_string Pointer to string */
+/* xml_parameter Pointer to xml parameter */
+/* */
+/* OUTPUT */
+/* */
+/* Completion Status */
+/* */
+/* CALLS */
+/* */
+/* */
+/* CALLED BY */
+/* */
+/* _ux_pictbridge_object_parse */
/* */
/**************************************************************************/
-UINT _ux_pictbridge_xml_function_output_getcapability_capability_fixedsizes(UX_PICTBRIDGE *pictbridge,
+UINT _ux_pictbridge_xml_function_output_getcapability_capability_fixedsizes(UX_PICTBRIDGE *pictbridge,
UCHAR *input_variable, UCHAR *input_string, UCHAR *xml_parameter)
{
UINT status;
@@ -88,12 +81,12 @@ UINT status;
if (status != UX_SUCCESS)
/* We get here when we reached an unexpected end of the XML object or a format error. */
- return(UX_PICTBRIDGE_ERROR_SCRIPT_SYNTAX_ERROR);
-
+ return(UX_PICTBRIDGE_ERROR_SCRIPT_SYNTAX_ERROR);
+
else
-
+
/* We are done. */
- return(UX_SUCCESS);
+ return(UX_SUCCESS);
}
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 7ceee0c8..817f07c7 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
@@ -1,18 +1,19 @@
/***************************************************************************
- * Copyright (c) 2024 Microsoft Corporation
- *
+ * Copyright (c) 2024 Microsoft Corporation
+ * Copyright (c) 2026-present Eclipse ThreadX contributors
+ *
* This program and the accompanying materials are made available under the
* terms of the MIT License which is available at
* https://opensource.org/licenses/MIT.
- *
+ *
* SPDX-License-Identifier: MIT
**************************************************************************/
/**************************************************************************/
/**************************************************************************/
-/** */
-/** USBX Component */
+/** */
+/** USBX Component */
/** */
/** Pictbridge Application */
/** */
@@ -28,52 +29,44 @@
#include "ux_pictbridge.h"
-/**************************************************************************/
-/* */
-/* FUNCTION RELEASE */
-/* */
+/**************************************************************************/
+/* */
+/* FUNCTION RELEASE */
+/* */
/* _ux_pictbridge_xml_function_output_getcapability_capability_ */
-/* imageoptimizes */
-/* PORTABLE C */
+/* imageoptimizes */
+/* PORTABLE C */
/* 6.1 */
-/* */
-/* */
+/* */
+/* */
/* AUTHOR */
/* */
/* Chaoqiong Xiao, Microsoft Corporation */
/* */
/* DESCRIPTION */
-/* */
-/* This function decodes the imageoptimizes tag */
-/* */
-/* INPUT */
-/* */
-/* pictbridge Pictbridge instance */
-/* input_variable Pointer to variable */
-/* input_string Pointer to string */
-/* xml_parameter Pointer to xml parameter */
-/* */
-/* OUTPUT */
-/* */
-/* Completion Status */
-/* */
-/* CALLS */
-/* */
-/* */
-/* CALLED BY */
-/* */
-/* _ux_pictbridge_object_parse */
-/* */
-/* RELEASE HISTORY */
-/* */
-/* DATE NAME DESCRIPTION */
-/* */
-/* 05-19-2020 Chaoqiong Xiao Initial Version 6.0 */
-/* 09-30-2020 Chaoqiong Xiao Modified comment(s), */
-/* resulting in version 6.1 */
+/* */
+/* This function decodes the imageoptimizes tag */
+/* */
+/* INPUT */
+/* */
+/* pictbridge Pictbridge instance */
+/* input_variable Pointer to variable */
+/* input_string Pointer to string */
+/* xml_parameter Pointer to xml parameter */
+/* */
+/* OUTPUT */
+/* */
+/* Completion Status */
+/* */
+/* CALLS */
+/* */
+/* */
+/* CALLED BY */
+/* */
+/* _ux_pictbridge_object_parse */
/* */
/**************************************************************************/
-UINT _ux_pictbridge_xml_function_output_getcapability_capability_imageoptimizes(UX_PICTBRIDGE *pictbridge,
+UINT _ux_pictbridge_xml_function_output_getcapability_capability_imageoptimizes(UX_PICTBRIDGE *pictbridge,
UCHAR *input_variable, UCHAR *input_string, UCHAR *xml_parameter)
{
UINT status;
@@ -88,12 +81,12 @@ UINT status;
if (status != UX_SUCCESS)
/* We get here when we reached an unexpected end of the XML object or a format error. */
- return(UX_PICTBRIDGE_ERROR_SCRIPT_SYNTAX_ERROR);
-
+ return(UX_PICTBRIDGE_ERROR_SCRIPT_SYNTAX_ERROR);
+
else
-
+
/* We are done. */
- return(UX_SUCCESS);
+ return(UX_SUCCESS);
}
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 0e14404a..d6406b2d 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
@@ -1,18 +1,19 @@
/***************************************************************************
- * Copyright (c) 2024 Microsoft Corporation
- *
+ * Copyright (c) 2024 Microsoft Corporation
+ * Copyright (c) 2026-present Eclipse ThreadX contributors
+ *
* This program and the accompanying materials are made available under the
* terms of the MIT License which is available at
* https://opensource.org/licenses/MIT.
- *
+ *
* SPDX-License-Identifier: MIT
**************************************************************************/
/**************************************************************************/
/**************************************************************************/
-/** */
-/** USBX Component */
+/** */
+/** USBX Component */
/** */
/** Pictbridge Application */
/** */
@@ -28,52 +29,44 @@
#include "ux_pictbridge.h"
-/**************************************************************************/
-/* */
-/* FUNCTION RELEASE */
-/* */
+/**************************************************************************/
+/* */
+/* FUNCTION RELEASE */
+/* */
/* _ux_pictbridge_xml_function_output_getcapability_capability_ */
-/* layouts */
-/* PORTABLE C */
+/* layouts */
+/* PORTABLE C */
/* 6.1 */
-/* */
-/* */
+/* */
+/* */
/* AUTHOR */
/* */
/* Chaoqiong Xiao, Microsoft Corporation */
/* */
/* DESCRIPTION */
-/* */
-/* This function decodes the layouts tag */
-/* */
-/* INPUT */
-/* */
-/* pictbridge Pictbridge instance */
-/* input_variable Pointer to variable */
-/* input_string Pointer to string */
-/* xml_parameter Pointer to xml parameter */
-/* */
-/* OUTPUT */
-/* */
-/* Completion Status */
-/* */
-/* CALLS */
-/* */
-/* */
-/* CALLED BY */
-/* */
-/* _ux_pictbridge_object_parse */
-/* */
-/* RELEASE HISTORY */
-/* */
-/* DATE NAME DESCRIPTION */
-/* */
-/* 05-19-2020 Chaoqiong Xiao Initial Version 6.0 */
-/* 09-30-2020 Chaoqiong Xiao Modified comment(s), */
-/* resulting in version 6.1 */
+/* */
+/* This function decodes the layouts tag */
+/* */
+/* INPUT */
+/* */
+/* pictbridge Pictbridge instance */
+/* input_variable Pointer to variable */
+/* input_string Pointer to string */
+/* xml_parameter Pointer to xml parameter */
+/* */
+/* OUTPUT */
+/* */
+/* Completion Status */
+/* */
+/* CALLS */
+/* */
+/* */
+/* CALLED BY */
+/* */
+/* _ux_pictbridge_object_parse */
/* */
/**************************************************************************/
-UINT _ux_pictbridge_xml_function_output_getcapability_capability_layouts(UX_PICTBRIDGE *pictbridge,
+UINT _ux_pictbridge_xml_function_output_getcapability_capability_layouts(UX_PICTBRIDGE *pictbridge,
UCHAR *input_variable, UCHAR *input_string, UCHAR *xml_parameter)
{
UINT status;
@@ -88,12 +81,12 @@ UINT status;
if (status != UX_SUCCESS)
/* We get here when we reached an unexpected end of the XML object or a format error. */
- return(UX_PICTBRIDGE_ERROR_SCRIPT_SYNTAX_ERROR);
-
+ return(UX_PICTBRIDGE_ERROR_SCRIPT_SYNTAX_ERROR);
+
else
-
+
/* We are done. */
- return(UX_SUCCESS);
+ return(UX_SUCCESS);
}
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 3eb3cd3e..f25561ee 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
@@ -1,18 +1,19 @@
/***************************************************************************
- * Copyright (c) 2024 Microsoft Corporation
- *
+ * Copyright (c) 2024 Microsoft Corporation
+ * Copyright (c) 2026-present Eclipse ThreadX contributors
+ *
* This program and the accompanying materials are made available under the
* terms of the MIT License which is available at
* https://opensource.org/licenses/MIT.
- *
+ *
* SPDX-License-Identifier: MIT
**************************************************************************/
/**************************************************************************/
/**************************************************************************/
-/** */
-/** USBX Component */
+/** */
+/** USBX Component */
/** */
/** Pictbridge Application */
/** */
@@ -28,52 +29,44 @@
#include "ux_pictbridge.h"
-/**************************************************************************/
-/* */
-/* FUNCTION RELEASE */
-/* */
+/**************************************************************************/
+/* */
+/* FUNCTION RELEASE */
+/* */
/* _ux_pictbridge_xml_function_output_getcapability_capability_ */
-/* papersizes */
-/* PORTABLE C */
+/* papersizes */
+/* PORTABLE C */
/* 6.1 */
-/* */
-/* */
+/* */
+/* */
/* AUTHOR */
/* */
/* Chaoqiong Xiao, Microsoft Corporation */
/* */
/* DESCRIPTION */
-/* */
-/* This function decodes the papersize tag */
-/* */
-/* INPUT */
-/* */
-/* pictbridge Pictbridge instance */
-/* input_variable Pointer to variable */
-/* input_string Pointer to string */
-/* xml_parameter Pointer to xml parameter */
-/* */
-/* OUTPUT */
-/* */
-/* Completion Status */
-/* */
-/* CALLS */
-/* */
-/* */
-/* CALLED BY */
-/* */
-/* _ux_pictbridge_object_parse */
-/* */
-/* RELEASE HISTORY */
-/* */
-/* DATE NAME DESCRIPTION */
-/* */
-/* 05-19-2020 Chaoqiong Xiao Initial Version 6.0 */
-/* 09-30-2020 Chaoqiong Xiao Modified comment(s), */
-/* resulting in version 6.1 */
+/* */
+/* This function decodes the papersize tag */
+/* */
+/* INPUT */
+/* */
+/* pictbridge Pictbridge instance */
+/* input_variable Pointer to variable */
+/* input_string Pointer to string */
+/* xml_parameter Pointer to xml parameter */
+/* */
+/* OUTPUT */
+/* */
+/* Completion Status */
+/* */
+/* CALLS */
+/* */
+/* */
+/* CALLED BY */
+/* */
+/* _ux_pictbridge_object_parse */
/* */
/**************************************************************************/
-UINT _ux_pictbridge_xml_function_output_getcapability_capability_papersizes(UX_PICTBRIDGE *pictbridge,
+UINT _ux_pictbridge_xml_function_output_getcapability_capability_papersizes(UX_PICTBRIDGE *pictbridge,
UCHAR *input_variable, UCHAR *input_string, UCHAR *xml_parameter)
{
UINT status;
@@ -88,12 +81,12 @@ UINT status;
if (status != UX_SUCCESS)
/* We get here when we reached an unexpected end of the XML object or a format error. */
- return(UX_PICTBRIDGE_ERROR_SCRIPT_SYNTAX_ERROR);
-
+ return(UX_PICTBRIDGE_ERROR_SCRIPT_SYNTAX_ERROR);
+
else
-
+
/* We are done. */
- return(UX_SUCCESS);
+ return(UX_SUCCESS);
}
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 904f6253..f48f8667 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
@@ -1,18 +1,19 @@
/***************************************************************************
- * Copyright (c) 2024 Microsoft Corporation
- *
+ * Copyright (c) 2024 Microsoft Corporation
+ * Copyright (c) 2026-present Eclipse ThreadX contributors
+ *
* This program and the accompanying materials are made available under the
* terms of the MIT License which is available at
* https://opensource.org/licenses/MIT.
- *
+ *
* SPDX-License-Identifier: MIT
**************************************************************************/
/**************************************************************************/
/**************************************************************************/
-/** */
-/** USBX Component */
+/** */
+/** USBX Component */
/** */
/** Pictbridge Application */
/** */
@@ -28,52 +29,44 @@
#include "ux_pictbridge.h"
-/**************************************************************************/
-/* */
-/* FUNCTION RELEASE */
-/* */
+/**************************************************************************/
+/* */
+/* FUNCTION RELEASE */
+/* */
/* _ux_pictbridge_xml_function_output_getcapability_capability_ */
-/* papertypes */
-/* PORTABLE C */
+/* papertypes */
+/* PORTABLE C */
/* 6.1 */
-/* */
-/* */
+/* */
+/* */
/* AUTHOR */
/* */
/* Chaoqiong Xiao, Microsoft Corporation */
/* */
/* DESCRIPTION */
-/* */
-/* This function decodes the papersize tag */
-/* */
-/* INPUT */
-/* */
-/* pictbridge Pictbridge instance */
-/* input_variable Pointer to variable */
-/* input_string Pointer to string */
-/* xml_parameter Pointer to xml parameter */
-/* */
-/* OUTPUT */
-/* */
-/* Completion Status */
-/* */
-/* CALLS */
-/* */
-/* */
-/* CALLED BY */
-/* */
-/* _ux_pictbridge_object_parse */
-/* */
-/* RELEASE HISTORY */
-/* */
-/* DATE NAME DESCRIPTION */
-/* */
-/* 05-19-2020 Chaoqiong Xiao Initial Version 6.0 */
-/* 09-30-2020 Chaoqiong Xiao Modified comment(s), */
-/* resulting in version 6.1 */
+/* */
+/* This function decodes the papersize tag */
+/* */
+/* INPUT */
+/* */
+/* pictbridge Pictbridge instance */
+/* input_variable Pointer to variable */
+/* input_string Pointer to string */
+/* xml_parameter Pointer to xml parameter */
+/* */
+/* OUTPUT */
+/* */
+/* Completion Status */
+/* */
+/* CALLS */
+/* */
+/* */
+/* CALLED BY */
+/* */
+/* _ux_pictbridge_object_parse */
/* */
/**************************************************************************/
-UINT _ux_pictbridge_xml_function_output_getcapability_capability_papertypes(UX_PICTBRIDGE *pictbridge,
+UINT _ux_pictbridge_xml_function_output_getcapability_capability_papertypes(UX_PICTBRIDGE *pictbridge,
UCHAR *input_variable, UCHAR *input_string, UCHAR *xml_parameter)
{
UINT status;
@@ -88,12 +81,12 @@ UINT status;
if (status != UX_SUCCESS)
/* We get here when we reached an unexpected end of the XML object or a format error. */
- return(UX_PICTBRIDGE_ERROR_SCRIPT_SYNTAX_ERROR);
-
+ return(UX_PICTBRIDGE_ERROR_SCRIPT_SYNTAX_ERROR);
+
else
-
+
/* We are done. */
- return(UX_SUCCESS);
+ return(UX_SUCCESS);
}
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 805696f4..0903e306 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
@@ -1,18 +1,19 @@
/***************************************************************************
- * Copyright (c) 2024 Microsoft Corporation
- *
+ * Copyright (c) 2024 Microsoft Corporation
+ * Copyright (c) 2026-present Eclipse ThreadX contributors
+ *
* This program and the accompanying materials are made available under the
* terms of the MIT License which is available at
* https://opensource.org/licenses/MIT.
- *
+ *
* SPDX-License-Identifier: MIT
**************************************************************************/
/**************************************************************************/
/**************************************************************************/
-/** */
-/** USBX Component */
+/** */
+/** USBX Component */
/** */
/** Pictbridge Application */
/** */
@@ -28,52 +29,44 @@
#include "ux_pictbridge.h"
-/**************************************************************************/
-/* */
-/* FUNCTION RELEASE */
-/* */
+/**************************************************************************/
+/* */
+/* FUNCTION RELEASE */
+/* */
/* _ux_pictbridge_xml_function_output_getcapability_capability_ */
-/* qualities */
-/* PORTABLE C */
+/* qualities */
+/* PORTABLE C */
/* 6.1 */
-/* */
-/* */
+/* */
+/* */
/* AUTHOR */
/* */
/* Chaoqiong Xiao, Microsoft Corporation */
/* */
/* DESCRIPTION */
-/* */
-/* This function decodes the qualities tag */
-/* */
-/* INPUT */
-/* */
-/* pictbridge Pictbridge instance */
-/* input_variable Pointer to variable */
-/* input_string Pointer to string */
-/* xml_parameter Pointer to xml parameter */
-/* */
-/* OUTPUT */
-/* */
-/* Completion Status */
-/* */
-/* CALLS */
-/* */
-/* */
-/* CALLED BY */
-/* */
-/* _ux_pictbridge_object_parse */
-/* */
-/* RELEASE HISTORY */
-/* */
-/* DATE NAME DESCRIPTION */
-/* */
-/* 05-19-2020 Chaoqiong Xiao Initial Version 6.0 */
-/* 09-30-2020 Chaoqiong Xiao Modified comment(s), */
-/* resulting in version 6.1 */
+/* */
+/* This function decodes the qualities tag */
+/* */
+/* INPUT */
+/* */
+/* pictbridge Pictbridge instance */
+/* input_variable Pointer to variable */
+/* input_string Pointer to string */
+/* xml_parameter Pointer to xml parameter */
+/* */
+/* OUTPUT */
+/* */
+/* Completion Status */
+/* */
+/* CALLS */
+/* */
+/* */
+/* CALLED BY */
+/* */
+/* _ux_pictbridge_object_parse */
/* */
/**************************************************************************/
-UINT _ux_pictbridge_xml_function_output_getcapability_capability_qualities(UX_PICTBRIDGE *pictbridge,
+UINT _ux_pictbridge_xml_function_output_getcapability_capability_qualities(UX_PICTBRIDGE *pictbridge,
UCHAR *input_variable, UCHAR *input_string, UCHAR *xml_parameter)
{
UINT status;
@@ -88,12 +81,12 @@ UINT status;
if (status != UX_SUCCESS)
/* We get here when we reached an unexpected end of the XML object or a format error. */
- return(UX_PICTBRIDGE_ERROR_SCRIPT_SYNTAX_ERROR);
-
+ return(UX_PICTBRIDGE_ERROR_SCRIPT_SYNTAX_ERROR);
+
else
-
+
/* We are done. */
- return(UX_SUCCESS);
+ return(UX_SUCCESS);
}
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 caba8b78..eef0f380 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
@@ -1,18 +1,19 @@
/***************************************************************************
- * Copyright (c) 2024 Microsoft Corporation
- *
+ * Copyright (c) 2024 Microsoft Corporation
+ * Copyright (c) 2026-present Eclipse ThreadX contributors
+ *
* This program and the accompanying materials are made available under the
* terms of the MIT License which is available at
* https://opensource.org/licenses/MIT.
- *
+ *
* SPDX-License-Identifier: MIT
**************************************************************************/
/**************************************************************************/
/**************************************************************************/
-/** */
-/** USBX Component */
+/** */
+/** USBX Component */
/** */
/** Pictbridge Application */
/** */
@@ -28,52 +29,44 @@
#include "ux_pictbridge.h"
-/**************************************************************************/
-/* */
-/* FUNCTION RELEASE */
-/* */
+/**************************************************************************/
+/* */
+/* FUNCTION RELEASE */
+/* */
/* _ux_pictbridge_xml_function_output_getdevicestatus_ */
-/* capabilitychanged */
-/* PORTABLE C */
+/* capabilitychanged */
+/* PORTABLE C */
/* 6.1 */
-/* */
-/* */
+/* */
+/* */
/* AUTHOR */
/* */
/* Chaoqiong Xiao, Microsoft Corporation */
/* */
/* DESCRIPTION */
-/* */
-/* This function decodes the capabilitychanged tag */
-/* */
-/* INPUT */
-/* */
-/* pictbridge Pictbridge instance */
-/* input_variable Pointer to variable */
-/* input_string Pointer to string */
-/* xml_parameter Pointer to xml parameter */
-/* */
-/* OUTPUT */
-/* */
-/* Completion Status */
-/* */
-/* CALLS */
-/* */
-/* */
-/* CALLED BY */
-/* */
-/* _ux_pictbridge_object_parse */
-/* */
-/* RELEASE HISTORY */
-/* */
-/* DATE NAME DESCRIPTION */
-/* */
-/* 05-19-2020 Chaoqiong Xiao Initial Version 6.0 */
-/* 09-30-2020 Chaoqiong Xiao Modified comment(s), */
-/* resulting in version 6.1 */
+/* */
+/* This function decodes the capabilitychanged tag */
+/* */
+/* INPUT */
+/* */
+/* pictbridge Pictbridge instance */
+/* input_variable Pointer to variable */
+/* input_string Pointer to string */
+/* xml_parameter Pointer to xml parameter */
+/* */
+/* OUTPUT */
+/* */
+/* Completion Status */
+/* */
+/* CALLS */
+/* */
+/* */
+/* CALLED BY */
+/* */
+/* _ux_pictbridge_object_parse */
/* */
/**************************************************************************/
-UINT _ux_pictbridge_xml_function_output_getdevicestatus_capabilitychanged(UX_PICTBRIDGE *pictbridge,
+UINT _ux_pictbridge_xml_function_output_getdevicestatus_capabilitychanged(UX_PICTBRIDGE *pictbridge,
UCHAR *input_variable, UCHAR *input_string, UCHAR *xml_parameter)
{
UINT status;
@@ -97,14 +90,14 @@ ULONG hexa_element;
pictbridge -> ux_pictbridge_dpsclient.ux_pictbridge_devinfo_capabilitychanged = hexa_element;
/* We are done. */
- return(UX_SUCCESS);
- }
- }
+ return(UX_SUCCESS);
+ }
+ }
/* We get here when we reached an unexpected end of the XML object or a format error. */
- return(UX_PICTBRIDGE_ERROR_SCRIPT_SYNTAX_ERROR);
-
-
+ return(UX_PICTBRIDGE_ERROR_SCRIPT_SYNTAX_ERROR);
+
+
}
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 e04191c6..a65f80d7 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
@@ -1,18 +1,19 @@
/***************************************************************************
- * Copyright (c) 2024 Microsoft Corporation
- *
+ * Copyright (c) 2024 Microsoft Corporation
+ * Copyright (c) 2026-present Eclipse ThreadX contributors
+ *
* This program and the accompanying materials are made available under the
* terms of the MIT License which is available at
* https://opensource.org/licenses/MIT.
- *
+ *
* SPDX-License-Identifier: MIT
**************************************************************************/
/**************************************************************************/
/**************************************************************************/
-/** */
-/** USBX Component */
+/** */
+/** USBX Component */
/** */
/** Pictbridge Application */
/** */
@@ -28,52 +29,44 @@
#include "ux_pictbridge.h"
-/**************************************************************************/
-/* */
-/* FUNCTION RELEASE */
-/* */
+/**************************************************************************/
+/* */
+/* FUNCTION RELEASE */
+/* */
/* _ux_pictbridge_xml_function_output_getdevicestatus_ */
-/* disconnectenable */
-/* PORTABLE C */
+/* disconnectenable */
+/* PORTABLE C */
/* 6.1 */
-/* */
-/* */
+/* */
+/* */
/* AUTHOR */
/* */
/* Chaoqiong Xiao, Microsoft Corporation */
/* */
/* DESCRIPTION */
-/* */
-/* This function decodes the disconnectenable tag */
-/* */
-/* INPUT */
-/* */
-/* pictbridge Pictbridge instance */
-/* input_variable Pointer to variable */
-/* input_string Pointer to string */
-/* xml_parameter Pointer to xml parameter */
-/* */
-/* OUTPUT */
-/* */
-/* Completion Status */
-/* */
-/* CALLS */
-/* */
-/* */
-/* CALLED BY */
-/* */
-/* _ux_pictbridge_object_parse */
-/* */
-/* RELEASE HISTORY */
-/* */
-/* DATE NAME DESCRIPTION */
-/* */
-/* 05-19-2020 Chaoqiong Xiao Initial Version 6.0 */
-/* 09-30-2020 Chaoqiong Xiao Modified comment(s), */
-/* resulting in version 6.1 */
+/* */
+/* This function decodes the disconnectenable tag */
+/* */
+/* INPUT */
+/* */
+/* pictbridge Pictbridge instance */
+/* input_variable Pointer to variable */
+/* input_string Pointer to string */
+/* xml_parameter Pointer to xml parameter */
+/* */
+/* OUTPUT */
+/* */
+/* Completion Status */
+/* */
+/* CALLS */
+/* */
+/* */
+/* CALLED BY */
+/* */
+/* _ux_pictbridge_object_parse */
/* */
/**************************************************************************/
-UINT _ux_pictbridge_xml_function_output_getdevicestatus_disconnectenable(UX_PICTBRIDGE *pictbridge,
+UINT _ux_pictbridge_xml_function_output_getdevicestatus_disconnectenable(UX_PICTBRIDGE *pictbridge,
UCHAR *input_variable, UCHAR *input_string, UCHAR *xml_parameter)
{
UINT status;
@@ -97,14 +90,14 @@ ULONG hexa_element;
pictbridge -> ux_pictbridge_dpsclient.ux_pictbridge_devinfo_disconnectenable = hexa_element;
/* We are done. */
- return(UX_SUCCESS);
- }
- }
+ return(UX_SUCCESS);
+ }
+ }
/* We get here when we reached an unexpected end of the XML object or a format error. */
- return(UX_PICTBRIDGE_ERROR_SCRIPT_SYNTAX_ERROR);
-
-
+ return(UX_PICTBRIDGE_ERROR_SCRIPT_SYNTAX_ERROR);
+
+
}
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 daccff5a..a60cccad 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
@@ -1,18 +1,19 @@
/***************************************************************************
- * Copyright (c) 2024 Microsoft Corporation
- *
+ * Copyright (c) 2024 Microsoft Corporation
+ * Copyright (c) 2026-present Eclipse ThreadX contributors
+ *
* This program and the accompanying materials are made available under the
* terms of the MIT License which is available at
* https://opensource.org/licenses/MIT.
- *
+ *
* SPDX-License-Identifier: MIT
**************************************************************************/
/**************************************************************************/
/**************************************************************************/
-/** */
-/** USBX Component */
+/** */
+/** USBX Component */
/** */
/** Pictbridge Application */
/** */
@@ -28,52 +29,44 @@
#include "ux_pictbridge.h"
-/**************************************************************************/
-/* */
-/* FUNCTION RELEASE */
-/* */
+/**************************************************************************/
+/* */
+/* FUNCTION RELEASE */
+/* */
/* _ux_pictbridge_xml_function_output_getdevicestatus_ */
-/* dpsprintservicestatus */
-/* PORTABLE C */
+/* dpsprintservicestatus */
+/* PORTABLE C */
/* 6.1 */
-/* */
-/* */
+/* */
+/* */
/* AUTHOR */
/* */
/* Chaoqiong Xiao, Microsoft Corporation */
/* */
/* DESCRIPTION */
-/* */
-/* This function decodes the dpsprintservicestatus tag */
-/* */
-/* INPUT */
-/* */
-/* pictbridge Pictbridge instance */
-/* input_variable Pointer to variable */
-/* input_string Pointer to string */
-/* xml_parameter Pointer to xml parameter */
-/* */
-/* OUTPUT */
-/* */
-/* Completion Status */
-/* */
-/* CALLS */
-/* */
-/* */
-/* CALLED BY */
-/* */
-/* _ux_pictbridge_object_parse */
-/* */
-/* RELEASE HISTORY */
-/* */
-/* DATE NAME DESCRIPTION */
-/* */
-/* 05-19-2020 Chaoqiong Xiao Initial Version 6.0 */
-/* 09-30-2020 Chaoqiong Xiao Modified comment(s), */
-/* resulting in version 6.1 */
+/* */
+/* This function decodes the dpsprintservicestatus tag */
+/* */
+/* INPUT */
+/* */
+/* pictbridge Pictbridge instance */
+/* input_variable Pointer to variable */
+/* input_string Pointer to string */
+/* xml_parameter Pointer to xml parameter */
+/* */
+/* OUTPUT */
+/* */
+/* Completion Status */
+/* */
+/* CALLS */
+/* */
+/* */
+/* CALLED BY */
+/* */
+/* _ux_pictbridge_object_parse */
/* */
/**************************************************************************/
-UINT _ux_pictbridge_xml_function_output_getdevicestatus_dpsprintservicestatus(UX_PICTBRIDGE *pictbridge,
+UINT _ux_pictbridge_xml_function_output_getdevicestatus_dpsprintservicestatus(UX_PICTBRIDGE *pictbridge,
UCHAR *input_variable, UCHAR *input_string, UCHAR *xml_parameter)
{
UINT status;
@@ -91,21 +84,21 @@ ULONG hexa_element;
/* Check the returned value. Must be one of 3 possibilities. */
if (hexa_element == UX_PICTBRIDGE_DPS_PRINTSERVICE_STATUS_ACTIVE ||
hexa_element == UX_PICTBRIDGE_DPS_PRINTSERVICE_STATUS_IDLE ||
- hexa_element == UX_PICTBRIDGE_DPS_PRINTSERVICE_STATUS_PAUSED)
+ hexa_element == UX_PICTBRIDGE_DPS_PRINTSERVICE_STATUS_PAUSED)
{
/* Save this value. */
pictbridge -> ux_pictbridge_dpsclient.ux_pictbridge_devinfo_dpsprintservicestatus = hexa_element;
/* We are done. */
- return(UX_SUCCESS);
- }
- }
+ return(UX_SUCCESS);
+ }
+ }
/* We get here when we reached an unexpected end of the XML object or a format error. */
- return(UX_PICTBRIDGE_ERROR_SCRIPT_SYNTAX_ERROR);
-
-
+ return(UX_PICTBRIDGE_ERROR_SCRIPT_SYNTAX_ERROR);
+
+
}
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 e9839f8f..4695b8ad 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
@@ -1,18 +1,19 @@
/***************************************************************************
- * Copyright (c) 2024 Microsoft Corporation
- *
+ * Copyright (c) 2024 Microsoft Corporation
+ * Copyright (c) 2026-present Eclipse ThreadX contributors
+ *
* This program and the accompanying materials are made available under the
* terms of the MIT License which is available at
* https://opensource.org/licenses/MIT.
- *
+ *
* SPDX-License-Identifier: MIT
**************************************************************************/
/**************************************************************************/
/**************************************************************************/
-/** */
-/** USBX Component */
+/** */
+/** USBX Component */
/** */
/** Pictbridge Application */
/** */
@@ -28,52 +29,44 @@
#include "ux_pictbridge.h"
-/**************************************************************************/
-/* */
-/* FUNCTION RELEASE */
-/* */
+/**************************************************************************/
+/* */
+/* FUNCTION RELEASE */
+/* */
/* _ux_pictbridge_xml_function_output_getdevicestatus_ */
-/* errorreason */
-/* PORTABLE C */
+/* errorreason */
+/* PORTABLE C */
/* 6.1 */
-/* */
-/* */
+/* */
+/* */
/* AUTHOR */
/* */
/* Chaoqiong Xiao, Microsoft Corporation */
/* */
/* DESCRIPTION */
-/* */
-/* This function decodes the errorreason tag */
-/* */
-/* INPUT */
-/* */
-/* pictbridge Pictbridge instance */
-/* input_variable Pointer to variable */
-/* input_string Pointer to string */
-/* xml_parameter Pointer to xml parameter */
-/* */
-/* OUTPUT */
-/* */
-/* Completion Status */
-/* */
-/* CALLS */
-/* */
-/* */
-/* CALLED BY */
-/* */
-/* _ux_pictbridge_object_parse */
-/* */
-/* RELEASE HISTORY */
-/* */
-/* DATE NAME DESCRIPTION */
-/* */
-/* 05-19-2020 Chaoqiong Xiao Initial Version 6.0 */
-/* 09-30-2020 Chaoqiong Xiao Modified comment(s), */
-/* resulting in version 6.1 */
+/* */
+/* This function decodes the errorreason tag */
+/* */
+/* INPUT */
+/* */
+/* pictbridge Pictbridge instance */
+/* input_variable Pointer to variable */
+/* input_string Pointer to string */
+/* xml_parameter Pointer to xml parameter */
+/* */
+/* OUTPUT */
+/* */
+/* Completion Status */
+/* */
+/* CALLS */
+/* */
+/* */
+/* CALLED BY */
+/* */
+/* _ux_pictbridge_object_parse */
/* */
/**************************************************************************/
-UINT _ux_pictbridge_xml_function_output_getdevicestatus_errorreason(UX_PICTBRIDGE *pictbridge,
+UINT _ux_pictbridge_xml_function_output_getdevicestatus_errorreason(UX_PICTBRIDGE *pictbridge,
UCHAR *input_variable, UCHAR *input_string, UCHAR *xml_parameter)
{
UINT status;
@@ -93,21 +86,21 @@ ULONG hexa_element;
(hexa_element & UX_PICTBRIDGE_PARAMETER_MAJOR_CODE_MASK) == UX_PICTBRIDGE_ERROR_REASON_PAPER_RELATED ||
(hexa_element & UX_PICTBRIDGE_PARAMETER_MAJOR_CODE_MASK) == UX_PICTBRIDGE_ERROR_REASON_INK_RELATED ||
(hexa_element & UX_PICTBRIDGE_PARAMETER_MAJOR_CODE_MASK) == UX_PICTBRIDGE_ERROR_REASON_HARDWARE_RELATED ||
- (hexa_element & UX_PICTBRIDGE_PARAMETER_MAJOR_CODE_MASK) == UX_PICTBRIDGE_ERROR_REASON_FILE_RELATED)
+ (hexa_element & UX_PICTBRIDGE_PARAMETER_MAJOR_CODE_MASK) == UX_PICTBRIDGE_ERROR_REASON_FILE_RELATED)
{
/* Save this value. */
pictbridge -> ux_pictbridge_dpsclient.ux_pictbridge_devinfo_errorreason = hexa_element;
/* We are done. */
- return(UX_SUCCESS);
- }
- }
+ return(UX_SUCCESS);
+ }
+ }
/* We get here when we reached an unexpected end of the XML object or a format error. */
- return(UX_PICTBRIDGE_ERROR_SCRIPT_SYNTAX_ERROR);
-
-
+ return(UX_PICTBRIDGE_ERROR_SCRIPT_SYNTAX_ERROR);
+
+
}
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 f6223661..da966aa7 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
@@ -1,18 +1,19 @@
/***************************************************************************
- * Copyright (c) 2024 Microsoft Corporation
- *
+ * Copyright (c) 2024 Microsoft Corporation
+ * Copyright (c) 2026-present Eclipse ThreadX contributors
+ *
* This program and the accompanying materials are made available under the
* terms of the MIT License which is available at
* https://opensource.org/licenses/MIT.
- *
+ *
* SPDX-License-Identifier: MIT
**************************************************************************/
/**************************************************************************/
/**************************************************************************/
-/** */
-/** USBX Component */
+/** */
+/** USBX Component */
/** */
/** Pictbridge Application */
/** */
@@ -28,52 +29,44 @@
#include "ux_pictbridge.h"
-/**************************************************************************/
-/* */
-/* FUNCTION RELEASE */
-/* */
+/**************************************************************************/
+/* */
+/* FUNCTION RELEASE */
+/* */
/* _ux_pictbridge_xml_function_output_getdevicestatus_ */
-/* errorstatus */
-/* PORTABLE C */
+/* errorstatus */
+/* PORTABLE C */
/* 6.1 */
-/* */
-/* */
+/* */
+/* */
/* AUTHOR */
/* */
/* Chaoqiong Xiao, Microsoft Corporation */
/* */
/* DESCRIPTION */
-/* */
-/* This function decodes the errorstatus tag */
-/* */
-/* INPUT */
-/* */
-/* pictbridge Pictbridge instance */
-/* input_variable Pointer to variable */
-/* input_string Pointer to string */
-/* xml_parameter Pointer to xml parameter */
-/* */
-/* OUTPUT */
-/* */
-/* Completion Status */
-/* */
-/* CALLS */
-/* */
-/* */
-/* CALLED BY */
-/* */
-/* _ux_pictbridge_object_parse */
-/* */
-/* RELEASE HISTORY */
-/* */
-/* DATE NAME DESCRIPTION */
-/* */
-/* 05-19-2020 Chaoqiong Xiao Initial Version 6.0 */
-/* 09-30-2020 Chaoqiong Xiao Modified comment(s), */
-/* resulting in version 6.1 */
+/* */
+/* This function decodes the errorstatus tag */
+/* */
+/* INPUT */
+/* */
+/* pictbridge Pictbridge instance */
+/* input_variable Pointer to variable */
+/* input_string Pointer to string */
+/* xml_parameter Pointer to xml parameter */
+/* */
+/* OUTPUT */
+/* */
+/* Completion Status */
+/* */
+/* CALLS */
+/* */
+/* */
+/* CALLED BY */
+/* */
+/* _ux_pictbridge_object_parse */
/* */
/**************************************************************************/
-UINT _ux_pictbridge_xml_function_output_getdevicestatus_errorstatus(UX_PICTBRIDGE *pictbridge,
+UINT _ux_pictbridge_xml_function_output_getdevicestatus_errorstatus(UX_PICTBRIDGE *pictbridge,
UCHAR *input_variable, UCHAR *input_string, UCHAR *xml_parameter)
{
UINT status;
@@ -91,21 +84,21 @@ ULONG hexa_element;
/* Check the returned value. Must be one of 3 possibilities. */
if (hexa_element == UX_PICTBRIDGE_ERROR_STATUS_NO_ERROR ||
hexa_element == UX_PICTBRIDGE_ERROR_STATUS_WARNING ||
- hexa_element == UX_PICTBRIDGE_ERROR_STATUS_FATAL)
+ hexa_element == UX_PICTBRIDGE_ERROR_STATUS_FATAL)
{
/* Save this value. */
pictbridge -> ux_pictbridge_dpsclient.ux_pictbridge_devinfo_errorstatus = hexa_element;
/* We are done. */
- return(UX_SUCCESS);
- }
- }
+ return(UX_SUCCESS);
+ }
+ }
/* We get here when we reached an unexpected end of the XML object or a format error. */
- return(UX_PICTBRIDGE_ERROR_SCRIPT_SYNTAX_ERROR);
-
-
+ return(UX_PICTBRIDGE_ERROR_SCRIPT_SYNTAX_ERROR);
+
+
}
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 30c2976e..245ceeff 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
@@ -1,18 +1,19 @@
/***************************************************************************
- * Copyright (c) 2024 Microsoft Corporation
- *
+ * Copyright (c) 2024 Microsoft Corporation
+ * Copyright (c) 2026-present Eclipse ThreadX contributors
+ *
* This program and the accompanying materials are made available under the
* terms of the MIT License which is available at
* https://opensource.org/licenses/MIT.
- *
+ *
* SPDX-License-Identifier: MIT
**************************************************************************/
/**************************************************************************/
/**************************************************************************/
-/** */
-/** USBX Component */
+/** */
+/** USBX Component */
/** */
/** Pictbridge Application */
/** */
@@ -28,52 +29,44 @@
#include "ux_pictbridge.h"
-/**************************************************************************/
-/* */
-/* FUNCTION RELEASE */
-/* */
+/**************************************************************************/
+/* */
+/* FUNCTION RELEASE */
+/* */
/* _ux_pictbridge_xml_function_output_getdevicestatus_ */
-/* jobendreason */
-/* PORTABLE C */
+/* jobendreason */
+/* PORTABLE C */
/* 6.1 */
-/* */
-/* */
+/* */
+/* */
/* AUTHOR */
/* */
/* Chaoqiong Xiao, Microsoft Corporation */
/* */
/* DESCRIPTION */
-/* */
-/* This function decodes the jobendreason tag */
-/* */
-/* INPUT */
-/* */
-/* pictbridge Pictbridge instance */
-/* input_variable Pointer to variable */
-/* input_string Pointer to string */
-/* xml_parameter Pointer to xml parameter */
-/* */
-/* OUTPUT */
-/* */
-/* Completion Status */
-/* */
-/* CALLS */
-/* */
-/* */
-/* CALLED BY */
-/* */
-/* _ux_pictbridge_object_parse */
-/* */
-/* RELEASE HISTORY */
-/* */
-/* DATE NAME DESCRIPTION */
-/* */
-/* 05-19-2020 Chaoqiong Xiao Initial Version 6.0 */
-/* 09-30-2020 Chaoqiong Xiao Modified comment(s), */
-/* resulting in version 6.1 */
+/* */
+/* This function decodes the jobendreason tag */
+/* */
+/* INPUT */
+/* */
+/* pictbridge Pictbridge instance */
+/* input_variable Pointer to variable */
+/* input_string Pointer to string */
+/* xml_parameter Pointer to xml parameter */
+/* */
+/* OUTPUT */
+/* */
+/* Completion Status */
+/* */
+/* CALLS */
+/* */
+/* */
+/* CALLED BY */
+/* */
+/* _ux_pictbridge_object_parse */
/* */
/**************************************************************************/
-UINT _ux_pictbridge_xml_function_output_getdevicestatus_jobendreason(UX_PICTBRIDGE *pictbridge,
+UINT _ux_pictbridge_xml_function_output_getdevicestatus_jobendreason(UX_PICTBRIDGE *pictbridge,
UCHAR *input_variable, UCHAR *input_string, UCHAR *xml_parameter)
{
UINT status;
@@ -93,21 +86,21 @@ ULONG hexa_element;
hexa_element == UX_PICTBRIDGE_JOB_END_REASON_NORMAL ||
hexa_element == UX_PICTBRIDGE_JOB_END_REASON_ABORTED_9000000 ||
hexa_element == UX_PICTBRIDGE_JOB_END_REASON_ABORTED_9001000 ||
- hexa_element == UX_PICTBRIDGE_JOB_END_REASON_ABORTED_OTHER)
+ hexa_element == UX_PICTBRIDGE_JOB_END_REASON_ABORTED_OTHER)
{
/* Save this value. */
pictbridge -> ux_pictbridge_dpsclient.ux_pictbridge_devinfo_jobendreason = hexa_element;
/* We are done. */
- return(UX_SUCCESS);
- }
- }
+ return(UX_SUCCESS);
+ }
+ }
/* We get here when we reached an unexpected end of the XML object or a format error. */
- return(UX_PICTBRIDGE_ERROR_SCRIPT_SYNTAX_ERROR);
-
-
+ return(UX_PICTBRIDGE_ERROR_SCRIPT_SYNTAX_ERROR);
+
+
}
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 9222b1b5..6a4a9ec2 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
@@ -1,18 +1,19 @@
/***************************************************************************
- * Copyright (c) 2024 Microsoft Corporation
- *
+ * Copyright (c) 2024 Microsoft Corporation
+ * Copyright (c) 2026-present Eclipse ThreadX contributors
+ *
* This program and the accompanying materials are made available under the
* terms of the MIT License which is available at
* https://opensource.org/licenses/MIT.
- *
+ *
* SPDX-License-Identifier: MIT
**************************************************************************/
/**************************************************************************/
/**************************************************************************/
-/** */
-/** USBX Component */
+/** */
+/** USBX Component */
/** */
/** Pictbridge Application */
/** */
@@ -28,51 +29,43 @@
#include "ux_pictbridge.h"
-/**************************************************************************/
-/* */
-/* FUNCTION RELEASE */
-/* */
+/**************************************************************************/
+/* */
+/* FUNCTION RELEASE */
+/* */
/* _ux_pictbridge_xml_function_output_getdevicestatus_newjobok */
-/* PORTABLE C */
+/* PORTABLE C */
/* 6.1 */
-/* */
-/* */
+/* */
+/* */
/* AUTHOR */
/* */
/* Chaoqiong Xiao, Microsoft Corporation */
/* */
/* DESCRIPTION */
-/* */
-/* This function decodes the newjobok tag */
-/* */
-/* INPUT */
-/* */
-/* pictbridge Pictbridge instance */
-/* input_variable Pointer to variable */
-/* input_string Pointer to string */
-/* xml_parameter Pointer to xml parameter */
-/* */
-/* OUTPUT */
-/* */
-/* Completion Status */
-/* */
-/* CALLS */
-/* */
-/* */
-/* CALLED BY */
-/* */
-/* _ux_pictbridge_object_parse */
-/* */
-/* RELEASE HISTORY */
-/* */
-/* DATE NAME DESCRIPTION */
-/* */
-/* 05-19-2020 Chaoqiong Xiao Initial Version 6.0 */
-/* 09-30-2020 Chaoqiong Xiao Modified comment(s), */
-/* resulting in version 6.1 */
+/* */
+/* This function decodes the newjobok tag */
+/* */
+/* INPUT */
+/* */
+/* pictbridge Pictbridge instance */
+/* input_variable Pointer to variable */
+/* input_string Pointer to string */
+/* xml_parameter Pointer to xml parameter */
+/* */
+/* OUTPUT */
+/* */
+/* Completion Status */
+/* */
+/* CALLS */
+/* */
+/* */
+/* CALLED BY */
+/* */
+/* _ux_pictbridge_object_parse */
/* */
/**************************************************************************/
-UINT _ux_pictbridge_xml_function_output_getdevicestatus_newjobok(UX_PICTBRIDGE *pictbridge,
+UINT _ux_pictbridge_xml_function_output_getdevicestatus_newjobok(UX_PICTBRIDGE *pictbridge,
UCHAR *input_variable, UCHAR *input_string, UCHAR *xml_parameter)
{
UINT status;
@@ -96,14 +89,14 @@ ULONG hexa_element;
pictbridge -> ux_pictbridge_dpsclient.ux_pictbridge_devinfo_newjobok = hexa_element;
/* We are done. */
- return(UX_SUCCESS);
- }
- }
+ return(UX_SUCCESS);
+ }
+ }
/* We get here when we reached an unexpected end of the XML object or a format error. */
- return(UX_PICTBRIDGE_ERROR_SCRIPT_SYNTAX_ERROR);
-
-
+ return(UX_PICTBRIDGE_ERROR_SCRIPT_SYNTAX_ERROR);
+
+
}
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 64461ae6..93b1352a 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
@@ -1,18 +1,19 @@
/***************************************************************************
- * Copyright (c) 2024 Microsoft Corporation
- *
+ * Copyright (c) 2024 Microsoft Corporation
+ * Copyright (c) 2026-present Eclipse ThreadX contributors
+ *
* This program and the accompanying materials are made available under the
* terms of the MIT License which is available at
* https://opensource.org/licenses/MIT.
- *
+ *
* SPDX-License-Identifier: MIT
**************************************************************************/
/**************************************************************************/
/**************************************************************************/
-/** */
-/** USBX Component */
+/** */
+/** USBX Component */
/** */
/** Pictbridge Application */
/** */
@@ -28,50 +29,42 @@
#include "ux_pictbridge.h"
-/**************************************************************************/
-/* */
-/* FUNCTION RELEASE */
-/* */
-/* _ux_pictbridge_xml_function_output_result PORTABLE C */
+/**************************************************************************/
+/* */
+/* FUNCTION RELEASE */
+/* */
+/* _ux_pictbridge_xml_function_output_result PORTABLE C */
/* 6.1 */
-/* */
-/* */
+/* */
+/* */
/* AUTHOR */
/* */
/* Chaoqiong Xiao, Microsoft Corporation */
/* */
/* DESCRIPTION */
-/* */
-/* This function decodes the "result" tag in the output descriptor */
-/* */
-/* INPUT */
-/* */
-/* pictbridge Pictbridge instance */
-/* input_variable Pointer to variable */
-/* input_string Pointer to string */
-/* xml_parameter XML parameter */
-/* */
-/* OUTPUT */
-/* */
-/* Completion Status */
-/* */
-/* CALLS */
-/* */
-/* */
-/* CALLED BY */
-/* */
-/* _ux_pictbridge_object_parse */
-/* */
-/* RELEASE HISTORY */
-/* */
-/* DATE NAME DESCRIPTION */
-/* */
-/* 05-19-2020 Chaoqiong Xiao Initial Version 6.0 */
-/* 09-30-2020 Chaoqiong Xiao Modified comment(s), */
-/* resulting in version 6.1 */
+/* */
+/* This function decodes the "result" tag in the output descriptor */
+/* */
+/* INPUT */
+/* */
+/* pictbridge Pictbridge instance */
+/* input_variable Pointer to variable */
+/* input_string Pointer to string */
+/* xml_parameter XML parameter */
+/* */
+/* OUTPUT */
+/* */
+/* Completion Status */
+/* */
+/* CALLS */
+/* */
+/* */
+/* CALLED BY */
+/* */
+/* _ux_pictbridge_object_parse */
/* */
/**************************************************************************/
-UINT _ux_pictbridge_xml_function_output_result(UX_PICTBRIDGE *pictbridge,
+UINT _ux_pictbridge_xml_function_output_result(UX_PICTBRIDGE *pictbridge,
UCHAR *input_variable, UCHAR *input_string, UCHAR *xml_parameter)
{
UINT status;
@@ -79,22 +72,22 @@ ULONG hexa_value;
UX_PARAMETER_NOT_USED(input_string);
UX_PARAMETER_NOT_USED(input_variable);
-
+
/* Get the hexa value from the xml parameter. */
status = _ux_pictbridge_element_to_hexa(xml_parameter, &hexa_value);
-
+
/* Check for error. */
if (status != UX_SUCCESS)
-
+
/* We have a element syntax error. */
return(status);
-
+
/* We need to store the result value. */
pictbridge -> ux_pictbridge_output_result = hexa_value;
/* Operation is successful. */
return(UX_SUCCESS);
-
+
}
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 ee0427d7..cb7cb780 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
@@ -1,18 +1,19 @@
/***************************************************************************
- * Copyright (c) 2024 Microsoft Corporation
- *
+ * Copyright (c) 2024 Microsoft Corporation
+ * Copyright (c) 2026-present Eclipse ThreadX contributors
+ *
* This program and the accompanying materials are made available under the
* terms of the MIT License which is available at
* https://opensource.org/licenses/MIT.
- *
+ *
* SPDX-License-Identifier: MIT
**************************************************************************/
/**************************************************************************/
/**************************************************************************/
-/** */
-/** USBX Component */
+/** */
+/** USBX Component */
/** */
/** Pictbridge Application */
/** */
@@ -28,51 +29,43 @@
#include "ux_pictbridge.h"
-/**************************************************************************/
-/* */
-/* FUNCTION RELEASE */
-/* */
-/* _ux_pictbridge_xml_function_root_dps PORTABLE C */
+/**************************************************************************/
+/* */
+/* FUNCTION RELEASE */
+/* */
+/* _ux_pictbridge_xml_function_root_dps PORTABLE C */
/* 6.1 */
/* AUTHOR */
/* */
/* Chaoqiong Xiao, Microsoft Corporation */
/* */
/* DESCRIPTION */
-/* */
-/* This function decodes the "dps" tag */
-/* */
-/* INPUT */
-/* */
-/* pictbridge Pictbridge instance */
-/* input_variable Pointer to variable */
-/* input_string Pointer to string */
-/* */
-/* OUTPUT */
-/* */
-/* Completion Status */
-/* */
-/* CALLS */
-/* */
-/* */
-/* CALLED BY */
-/* */
-/* _ux_pictbridge_object_parse */
-/* */
-/* RELEASE HISTORY */
-/* */
-/* DATE NAME DESCRIPTION */
-/* */
-/* 05-19-2020 Chaoqiong Xiao Initial Version 6.0 */
-/* 09-30-2020 Chaoqiong Xiao Modified comment(s), */
-/* resulting in version 6.1 */
+/* */
+/* This function decodes the "dps" tag */
+/* */
+/* INPUT */
+/* */
+/* pictbridge Pictbridge instance */
+/* input_variable Pointer to variable */
+/* input_string Pointer to string */
+/* */
+/* OUTPUT */
+/* */
+/* Completion Status */
+/* */
+/* CALLS */
+/* */
+/* */
+/* CALLED BY */
+/* */
+/* _ux_pictbridge_object_parse */
/* */
/**************************************************************************/
-UINT _ux_pictbridge_xml_function_root_dps(UX_PICTBRIDGE *pictbridge, UCHAR *input_variable,
+UINT _ux_pictbridge_xml_function_root_dps(UX_PICTBRIDGE *pictbridge, UCHAR *input_variable,
UCHAR *input_string, UCHAR *xml_parameter)
{
UINT status;
-UINT input_length = 0;
+UINT input_length = 0;
UINT length = 0;
UX_PARAMETER_NOT_USED(xml_parameter);
@@ -82,7 +75,7 @@ UINT length = 0;
status = _ux_utility_string_length_check(input_variable, &input_length, UX_PICTBRIDGE_MAX_VARIABLE_SIZE);
if (status != UX_SUCCESS)
return(status);
-
+
/* Get the length of the "xmlns " variable. */
status = _ux_utility_string_length_check(_ux_pictbridge_xml_variable_xmlns, &length, UX_PICTBRIDGE_MAX_VARIABLE_SIZE);
if (status != UX_SUCCESS)
@@ -95,12 +88,12 @@ UINT length = 0;
/* Both length match, we may have a variable name match. Check the names */
if (_ux_utility_memory_compare(_ux_pictbridge_xml_variable_xmlns,input_variable, length) == UX_SUCCESS)
{
-
+
/* Get the length of the string. */
status = _ux_utility_string_length_check(input_string, &input_length, UX_PICTBRIDGE_MAX_STRING_SIZE);
if (status != UX_SUCCESS)
return(status);
-
+
/* Get the length of the "xmlns" string. */
status = _ux_utility_string_length_check(_ux_pictbridge_xml_string_xmlns, &length, UX_PICTBRIDGE_MAX_STRING_SIZE);
if (status != UX_SUCCESS)
@@ -115,12 +108,12 @@ UINT length = 0;
/* The variable name is OK. We are done. */
return(UX_SUCCESS);
- }
+ }
}
}
/* We get here when we reached an unexpected end of the XML object. */
- return(UX_ERROR);
+ return(UX_ERROR);
}
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 8a72786c..e2f37a95 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
@@ -1,18 +1,19 @@
/***************************************************************************
- * Copyright (c) 2024 Microsoft Corporation
- *
+ * Copyright (c) 2024 Microsoft Corporation
+ * Copyright (c) 2026-present Eclipse ThreadX contributors
+ *
* This program and the accompanying materials are made available under the
* terms of the MIT License which is available at
* https://opensource.org/licenses/MIT.
- *
+ *
* SPDX-License-Identifier: MIT
**************************************************************************/
/**************************************************************************/
/**************************************************************************/
-/** */
-/** USBX Component */
+/** */
+/** USBX Component */
/** */
/** Pictbridge Application */
/** */
@@ -28,48 +29,40 @@
#include "ux_pictbridge.h"
-/**************************************************************************/
-/* */
-/* FUNCTION RELEASE */
-/* */
-/* _ux_pictbridge_xml_function_root_input PORTABLE C */
+/**************************************************************************/
+/* */
+/* FUNCTION RELEASE */
+/* */
+/* _ux_pictbridge_xml_function_root_input PORTABLE C */
/* 6.1 */
/* AUTHOR */
/* */
/* Chaoqiong Xiao, Microsoft Corporation */
/* */
/* DESCRIPTION */
-/* */
-/* This function decodes the input tag */
-/* */
-/* INPUT */
-/* */
-/* pictbridge Pictbridge instance */
-/* input_variable Pointer to variable */
-/* input_string Pointer to string */
-/* */
-/* */
-/* OUTPUT */
-/* */
-/* Completion Status */
-/* */
-/* CALLS */
-/* */
-/* */
-/* CALLED BY */
-/* */
-/* _ux_pictbridge_object_parse */
-/* */
-/* RELEASE HISTORY */
-/* */
-/* DATE NAME DESCRIPTION */
-/* */
-/* 05-19-2020 Chaoqiong Xiao Initial Version 6.0 */
-/* 09-30-2020 Chaoqiong Xiao Modified comment(s), */
-/* resulting in version 6.1 */
+/* */
+/* This function decodes the input tag */
+/* */
+/* INPUT */
+/* */
+/* pictbridge Pictbridge instance */
+/* input_variable Pointer to variable */
+/* input_string Pointer to string */
+/* */
+/* */
+/* OUTPUT */
+/* */
+/* Completion Status */
+/* */
+/* CALLS */
+/* */
+/* */
+/* CALLED BY */
+/* */
+/* _ux_pictbridge_object_parse */
/* */
/**************************************************************************/
-UINT _ux_pictbridge_xml_function_root_input(UX_PICTBRIDGE *pictbridge, UCHAR *input_variable,
+UINT _ux_pictbridge_xml_function_root_input(UX_PICTBRIDGE *pictbridge, UCHAR *input_variable,
UCHAR *input_string, UCHAR *xml_parameter)
{
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 cd0b2902..e94fd7c2 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
@@ -1,18 +1,19 @@
/***************************************************************************
- * Copyright (c) 2024 Microsoft Corporation
- *
+ * Copyright (c) 2024 Microsoft Corporation
+ * Copyright (c) 2026-present Eclipse ThreadX contributors
+ *
* This program and the accompanying materials are made available under the
* terms of the MIT License which is available at
* https://opensource.org/licenses/MIT.
- *
+ *
* SPDX-License-Identifier: MIT
**************************************************************************/
/**************************************************************************/
/**************************************************************************/
-/** */
-/** USBX Component */
+/** */
+/** USBX Component */
/** */
/** Pictbridge Application */
/** */
@@ -28,48 +29,40 @@
#include "ux_pictbridge.h"
-/**************************************************************************/
-/* */
-/* FUNCTION RELEASE */
-/* */
-/* _ux_pictbridge_xml_function_root_output PORTABLE C */
+/**************************************************************************/
+/* */
+/* FUNCTION RELEASE */
+/* */
+/* _ux_pictbridge_xml_function_root_output PORTABLE C */
/* 6.1 */
/* AUTHOR */
/* */
/* Chaoqiong Xiao, Microsoft Corporation */
/* */
/* DESCRIPTION */
-/* */
-/* This function decodes the output flag */
-/* */
-/* INPUT */
-/* */
-/* pictbridge Pictbridge instance */
-/* input_variable Pointer to variable */
-/* input_string Pointer to string */
-/* */
-/* */
-/* OUTPUT */
-/* */
-/* Completion Status */
-/* */
-/* CALLS */
-/* */
-/* */
-/* CALLED BY */
-/* */
-/* _ux_pictbridge_object_parse */
-/* */
-/* RELEASE HISTORY */
-/* */
-/* DATE NAME DESCRIPTION */
-/* */
-/* 05-19-2020 Chaoqiong Xiao Initial Version 6.0 */
-/* 09-30-2020 Chaoqiong Xiao Modified comment(s), */
-/* resulting in version 6.1 */
+/* */
+/* This function decodes the output flag */
+/* */
+/* INPUT */
+/* */
+/* pictbridge Pictbridge instance */
+/* input_variable Pointer to variable */
+/* input_string Pointer to string */
+/* */
+/* */
+/* OUTPUT */
+/* */
+/* Completion Status */
+/* */
+/* CALLS */
+/* */
+/* */
+/* CALLED BY */
+/* */
+/* _ux_pictbridge_object_parse */
/* */
/**************************************************************************/
-UINT _ux_pictbridge_xml_function_root_output(UX_PICTBRIDGE *pictbridge, UCHAR *input_variable,
+UINT _ux_pictbridge_xml_function_root_output(UX_PICTBRIDGE *pictbridge, UCHAR *input_variable,
UCHAR *input_string, UCHAR *xml_parameter)
{
UX_PARAMETER_NOT_USED(input_string);
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 f15b4918..3fe115f6 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
@@ -1,18 +1,19 @@
/***************************************************************************
- * Copyright (c) 2024 Microsoft Corporation
- *
+ * Copyright (c) 2024 Microsoft Corporation
+ * Copyright (c) 2026-present Eclipse ThreadX contributors
+ *
* This program and the accompanying materials are made available under the
* terms of the MIT License which is available at
* https://opensource.org/licenses/MIT.
- *
+ *
* SPDX-License-Identifier: MIT
**************************************************************************/
/**************************************************************************/
/**************************************************************************/
-/** */
-/** USBX Component */
+/** */
+/** USBX Component */
/** */
/** Pictbridge Application */
/** */
@@ -28,47 +29,39 @@
#include "ux_pictbridge.h"
-/**************************************************************************/
-/* */
-/* FUNCTION RELEASE */
-/* */
-/* _ux_pictbridge_xml_function_root_xml PORTABLE C */
+/**************************************************************************/
+/* */
+/* FUNCTION RELEASE */
+/* */
+/* _ux_pictbridge_xml_function_root_xml PORTABLE C */
/* 6.1 */
/* AUTHOR */
/* */
/* Chaoqiong Xiao, Microsoft Corporation */
/* */
/* DESCRIPTION */
-/* */
-/* This function decodes the "xml" tag */
-/* */
-/* INPUT */
-/* */
-/* pictbridge Pictbridge instance */
-/* input_variable Pointer to variable */
-/* input_string Pointer to string */
-/* */
-/* OUTPUT */
-/* */
-/* Completion Status */
-/* */
-/* CALLS */
-/* */
-/* */
-/* CALLED BY */
-/* */
-/* _ux_pictbridge_object_parse */
-/* */
-/* RELEASE HISTORY */
-/* */
-/* DATE NAME DESCRIPTION */
-/* */
-/* 05-19-2020 Chaoqiong Xiao Initial Version 6.0 */
-/* 09-30-2020 Chaoqiong Xiao Modified comment(s), */
-/* resulting in version 6.1 */
+/* */
+/* This function decodes the "xml" tag */
+/* */
+/* INPUT */
+/* */
+/* pictbridge Pictbridge instance */
+/* input_variable Pointer to variable */
+/* input_string Pointer to string */
+/* */
+/* OUTPUT */
+/* */
+/* Completion Status */
+/* */
+/* CALLS */
+/* */
+/* */
+/* CALLED BY */
+/* */
+/* _ux_pictbridge_object_parse */
/* */
/**************************************************************************/
-UINT _ux_pictbridge_xml_function_root_xml(UX_PICTBRIDGE *pictbridge, UCHAR *input_variable,
+UINT _ux_pictbridge_xml_function_root_xml(UX_PICTBRIDGE *pictbridge, UCHAR *input_variable,
UCHAR *input_string, UCHAR *xml_parameter)
{
UINT status;
@@ -83,7 +76,7 @@ UINT length = 0;
status = _ux_utility_string_length_check(input_variable, &input_length, UX_PICTBRIDGE_MAX_VARIABLE_SIZE);
if (status != UX_SUCCESS)
return(status);
-
+
/* Get the length of the "version " variable. */
status = _ux_utility_string_length_check(_ux_pictbridge_xml_variable_version, &length, UX_PICTBRIDGE_MAX_VARIABLE_SIZE);
if (status != UX_SUCCESS)
@@ -96,14 +89,14 @@ UINT length = 0;
/* Both length match, we may have a variable name match. Check the names */
if (_ux_utility_memory_compare(_ux_pictbridge_xml_variable_version,input_variable, length) == UX_SUCCESS)
{
-
+
/* The variable name is OK, we do not check the xml version. */
return(UX_SUCCESS);
-
+
}
}
/* We get here when we reached an unexpected end of the XML object. */
- return(UX_ERROR);
+ return(UX_ERROR);
}
diff --git a/ports/arm9/gnu/inc/ux_port.h b/ports/arm9/gnu/inc/ux_port.h
index 7a8e2b31..967ca0ef 100644
--- a/ports/arm9/gnu/inc/ux_port.h
+++ b/ports/arm9/gnu/inc/ux_port.h
@@ -1,5 +1,6 @@
/***************************************************************************
* Copyright (c) 2024 Microsoft Corporation
+ * Copyright (c) 2026-present Eclipse ThreadX contributors
*
* This program and the accompanying materials are made available under the
* terms of the MIT License which is available at
@@ -36,20 +37,6 @@
/* This file contains data type definitions that make USBX function */
/* identically on a variety of different processor architectures. */
/* */
-/* RELEASE HISTORY */
-/* */
-/* DATE NAME DESCRIPTION */
-/* */
-/* 09-30-2020 Chaoqiong Xiao Initial Version 6.1 */
-/* 01-31-2022 Chaoqiong Xiao Modified comment(s), */
-/* moved tx_api.h include and */
-/* typedefs from ux_api.h, */
-/* resulting in version 6.1.10 */
-/* 10-31-2023 Chaoqiong Xiao Modified comment(s), */
-/* added basic types guards, */
-/* improved SLONG typedef, */
-/* resulting in version 6.3.0 */
-/* */
/**************************************************************************/
#ifndef UX_PORT_H
@@ -242,10 +229,11 @@ VOID outpl(ULONG,ULONG);
/* Define interrupt lockout constructs to protect the memory allocation/release which could happen
under ISR in the device stack. */
-
+#ifdef TX_API_H
#define UX_INT_SAVE_AREA unsigned int old_interrupt_posture;
#define UX_DISABLE_INTS old_interrupt_posture = tx_interrupt_control(TX_INT_DISABLE);
#define UX_RESTORE_INTS tx_interrupt_control(old_interrupt_posture);
+#endif /* TX_API_H */
/* Define memory barrier instruction. */
@@ -256,7 +244,7 @@ VOID outpl(ULONG,ULONG);
#ifdef UX_SYSTEM_INIT
CHAR _ux_version_id[] =
- "Copyright (c) 2024 Microsoft Corporation. * USBX ARM9/GNU Version 6.4.1 *";
+ "(c) 2024 Microsoft Corp. (c) 2026-present Eclipse ThreadX contributors. * USBX ARM9/GNU Version 6.5.0.202601 *";
#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 061cede9..565e71bd 100644
--- a/ports/arm9/iar/inc/ux_port.h
+++ b/ports/arm9/iar/inc/ux_port.h
@@ -1,18 +1,19 @@
/***************************************************************************
- * Copyright (c) 2024 Microsoft Corporation
- *
+ * Copyright (c) 2024 Microsoft Corporation
+ * Copyright (c) 2026-present Eclipse ThreadX contributors
+ *
* This program and the accompanying materials are made available under the
* terms of the MIT License which is available at
* https://opensource.org/licenses/MIT.
- *
+ *
* SPDX-License-Identifier: MIT
**************************************************************************/
/**************************************************************************/
/**************************************************************************/
-/** */
-/** USBX Component */
+/** */
+/** USBX Component */
/** */
/** Port Specific */
/** */
@@ -20,11 +21,11 @@
/**************************************************************************/
-/**************************************************************************/
-/* */
-/* PORT SPECIFIC C INFORMATION RELEASE */
-/* */
-/* ux_port.h ARM9/IAR */
+/**************************************************************************/
+/* */
+/* PORT SPECIFIC C INFORMATION RELEASE */
+/* */
+/* ux_port.h ARM9/IAR */
/* 6.3.0 */
/* */
/* AUTHOR */
@@ -32,23 +33,9 @@
/* Chaoqiong Xiao, Microsoft Corporation */
/* */
/* DESCRIPTION */
-/* */
-/* This file contains data type definitions that make USBX function */
-/* identically on a variety of different processor architectures. */
-/* */
-/* RELEASE HISTORY */
-/* */
-/* DATE NAME DESCRIPTION */
-/* */
-/* 09-30-2020 Chaoqiong Xiao Initial Version 6.1 */
-/* 01-31-2022 Chaoqiong Xiao Modified comment(s), */
-/* moved tx_api.h include and */
-/* typedefs from ux_api.h, */
-/* resulting in version 6.1.10 */
-/* 10-31-2023 Chaoqiong Xiao Modified comment(s), */
-/* added basic types guards, */
-/* improved SLONG typedef, */
-/* resulting in version 6.3.0 */
+/* */
+/* This file contains data type definitions that make USBX function */
+/* identically on a variety of different processor architectures. */
/* */
/**************************************************************************/
@@ -61,7 +48,7 @@
#ifdef UX_INCLUDE_USER_DEFINE_FILE
-/* Yes, include the user defines in ux_user.h. The defines in this file may
+/* Yes, include the user defines in ux_user.h. The defines in this file may
alternately be defined on the command line. */
#include "ux_user.h"
@@ -249,10 +236,11 @@ VOID outpl(ULONG,ULONG);
/* Define interrupt lockout constructs to protect the memory allocation/release which could happen
under ISR in the device stack. */
-
+#ifdef TX_API_H
#define UX_INT_SAVE_AREA unsigned int old_interrupt_posture;
#define UX_DISABLE_INTS old_interrupt_posture = tx_interrupt_control(TX_INT_DISABLE);
#define UX_RESTORE_INTS tx_interrupt_control(old_interrupt_posture);
+#endif /* TX_API_H */
/* Define memory barrier instruction. */
@@ -262,8 +250,8 @@ VOID outpl(ULONG,ULONG);
/* Define the version ID of USBX. This may be utilized by the application. */
#ifdef UX_SYSTEM_INIT
-CHAR _ux_version_id[] =
- "Copyright (c) 2024 Microsoft Corporation. * USBX ARM9/IAR Version 6.4.1 *";
+CHAR _ux_version_id[] =
+ "(c) 2024 Microsoft Corp. (c) 2026-present Eclipse ThreadX contributors. * USBX ARM9/IAR Version 6.5.0.202601 *";
#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 42bf33c5..0851253d 100644
--- a/ports/cortex_a15/gnu/inc/ux_port.h
+++ b/ports/cortex_a15/gnu/inc/ux_port.h
@@ -1,5 +1,6 @@
/***************************************************************************
* Copyright (c) 2024 Microsoft Corporation
+ * Copyright (c) 2026-present Eclipse ThreadX contributors
*
* This program and the accompanying materials are made available under the
* terms of the MIT License which is available at
@@ -36,20 +37,6 @@
/* This file contains data type definitions that make USBX function */
/* identically on a variety of different processor architectures. */
/* */
-/* RELEASE HISTORY */
-/* */
-/* DATE NAME DESCRIPTION */
-/* */
-/* 09-30-2020 Chaoqiong Xiao Initial Version 6.1 */
-/* 01-31-2022 Chaoqiong Xiao Modified comment(s), */
-/* moved tx_api.h include and */
-/* typedefs from ux_api.h, */
-/* resulting in version 6.1.10 */
-/* 10-31-2023 Chaoqiong Xiao Modified comment(s), */
-/* added basic types guards, */
-/* improved SLONG typedef, */
-/* resulting in version 6.3.0 */
-/* */
/**************************************************************************/
#ifndef UX_PORT_H
@@ -242,17 +229,18 @@ VOID outpl(ULONG,ULONG);
/* Define interrupt lockout constructs to protect the memory allocation/release which could happen
under ISR in the device stack. */
-
+#ifdef TX_API_H
#define UX_INT_SAVE_AREA unsigned int old_interrupt_posture;
#define UX_DISABLE_INTS old_interrupt_posture = tx_interrupt_control(TX_INT_DISABLE);
#define UX_RESTORE_INTS tx_interrupt_control(old_interrupt_posture);
+#endif /* TX_API_H */
/* Define the version ID of USBX. This may be utilized by the application. */
#ifdef UX_SYSTEM_INIT
CHAR _ux_version_id[] =
- "Copyright (c) 2024 Microsoft Corporation. * USBX Cortex-A15/GNU Version 6.4.1 *";
+ "(c) 2024 Microsoft Corp. (c) 2026-present Eclipse ThreadX contributors. * USBX Cortex-A15/GNU Version 6.5.0.202601 *";
#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 bf4435ca..70ac9ab3 100644
--- a/ports/cortex_a5/gnu/inc/ux_port.h
+++ b/ports/cortex_a5/gnu/inc/ux_port.h
@@ -1,18 +1,19 @@
/***************************************************************************
- * Copyright (c) 2024 Microsoft Corporation
- *
+ * Copyright (c) 2024 Microsoft Corporation
+ * Copyright (c) 2026-present Eclipse ThreadX contributors
+ *
* This program and the accompanying materials are made available under the
* terms of the MIT License which is available at
* https://opensource.org/licenses/MIT.
- *
+ *
* SPDX-License-Identifier: MIT
**************************************************************************/
/**************************************************************************/
/**************************************************************************/
-/** */
-/** USBX Component */
+/** */
+/** USBX Component */
/** */
/** Port Specific */
/** */
@@ -20,11 +21,11 @@
/**************************************************************************/
-/**************************************************************************/
-/* */
-/* PORT SPECIFIC C INFORMATION RELEASE */
-/* */
-/* ux_port.h Cortex-A5/GNU */
+/**************************************************************************/
+/* */
+/* PORT SPECIFIC C INFORMATION RELEASE */
+/* */
+/* ux_port.h Cortex-A5/GNU */
/* 6.3.0 */
/* */
/* AUTHOR */
@@ -32,23 +33,9 @@
/* Chaoqiong Xiao, Microsoft Corporation */
/* */
/* DESCRIPTION */
-/* */
-/* This file contains data type definitions that make USBX function */
-/* identically on a variety of different processor architectures. */
-/* */
-/* RELEASE HISTORY */
-/* */
-/* DATE NAME DESCRIPTION */
-/* */
-/* 09-30-2020 Chaoqiong Xiao Initial Version 6.1 */
-/* 01-31-2022 Chaoqiong Xiao Modified comment(s), */
-/* moved tx_api.h include and */
-/* typedefs from ux_api.h, */
-/* resulting in version 6.1.10 */
-/* 10-31-2023 Chaoqiong Xiao Modified comment(s), */
-/* added basic types guards, */
-/* improved SLONG typedef, */
-/* resulting in version 6.3.0 */
+/* */
+/* This file contains data type definitions that make USBX function */
+/* identically on a variety of different processor architectures. */
/* */
/**************************************************************************/
@@ -61,7 +48,7 @@
#ifdef UX_INCLUDE_USER_DEFINE_FILE
-/* Yes, include the user defines in ux_user.h. The defines in this file may
+/* Yes, include the user defines in ux_user.h. The defines in this file may
alternately be defined on the command line. */
#include "ux_user.h"
@@ -249,17 +236,18 @@ VOID outpl(ULONG,ULONG);
/* Define interrupt lockout constructs to protect the memory allocation/release which could happen
under ISR in the device stack. */
-
+#ifdef TX_API_H
#define UX_INT_SAVE_AREA unsigned int old_interrupt_posture;
#define UX_DISABLE_INTS old_interrupt_posture = tx_interrupt_control(TX_INT_DISABLE);
#define UX_RESTORE_INTS tx_interrupt_control(old_interrupt_posture);
+#endif /* TX_API_H */
/* Define the version ID of USBX. This may be utilized by the application. */
#ifdef UX_SYSTEM_INIT
-CHAR _ux_version_id[] =
- "Copyright (c) 2024 Microsoft Corporation. * USBX Cortex-A5/GNU Version 6.4.1 *";
+CHAR _ux_version_id[] =
+ "(c) 2024 Microsoft Corp. (c) 2026-present Eclipse ThreadX contributors. * USBX Cortex-A5/GNU Version 6.5.0.202601 *";
#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 c03566e7..c9613003 100644
--- a/ports/cortex_a5/iar/inc/ux_port.h
+++ b/ports/cortex_a5/iar/inc/ux_port.h
@@ -1,18 +1,19 @@
/***************************************************************************
- * Copyright (c) 2024 Microsoft Corporation
- *
+ * Copyright (c) 2024 Microsoft Corporation
+ * Copyright (c) 2026-present Eclipse ThreadX contributors
+ *
* This program and the accompanying materials are made available under the
* terms of the MIT License which is available at
* https://opensource.org/licenses/MIT.
- *
+ *
* SPDX-License-Identifier: MIT
**************************************************************************/
/**************************************************************************/
/**************************************************************************/
-/** */
-/** USBX Component */
+/** */
+/** USBX Component */
/** */
/** Port Specific */
/** */
@@ -20,11 +21,11 @@
/**************************************************************************/
-/**************************************************************************/
-/* */
-/* PORT SPECIFIC C INFORMATION RELEASE */
-/* */
-/* ux_port.h Cortex-A5/IAR */
+/**************************************************************************/
+/* */
+/* PORT SPECIFIC C INFORMATION RELEASE */
+/* */
+/* ux_port.h Cortex-A5/IAR */
/* 6.3.0 */
/* */
/* AUTHOR */
@@ -32,23 +33,9 @@
/* Chaoqiong Xiao, Microsoft Corporation */
/* */
/* DESCRIPTION */
-/* */
-/* This file contains data type definitions that make USBX function */
-/* identically on a variety of different processor architectures. */
-/* */
-/* RELEASE HISTORY */
-/* */
-/* DATE NAME DESCRIPTION */
-/* */
-/* 09-30-2020 Chaoqiong Xiao Initial Version 6.1 */
-/* 01-31-2022 Chaoqiong Xiao Modified comment(s), */
-/* moved tx_api.h include and */
-/* typedefs from ux_api.h, */
-/* resulting in version 6.1.10 */
-/* 10-31-2023 Chaoqiong Xiao Modified comment(s), */
-/* added basic types guards, */
-/* improved SLONG typedef, */
-/* resulting in version 6.3.0 */
+/* */
+/* This file contains data type definitions that make USBX function */
+/* identically on a variety of different processor architectures. */
/* */
/**************************************************************************/
@@ -61,7 +48,7 @@
#ifdef UX_INCLUDE_USER_DEFINE_FILE
-/* Yes, include the user defines in ux_user.h. The defines in this file may
+/* Yes, include the user defines in ux_user.h. The defines in this file may
alternately be defined on the command line. */
#include "ux_user.h"
@@ -249,17 +236,18 @@ VOID outpl(ULONG,ULONG);
/* Define interrupt lockout constructs to protect the memory allocation/release which could happen
under ISR in the device stack. */
-
+#ifdef TX_API_H
#define UX_INT_SAVE_AREA unsigned int old_interrupt_posture;
#define UX_DISABLE_INTS old_interrupt_posture = tx_interrupt_control(TX_INT_DISABLE);
#define UX_RESTORE_INTS tx_interrupt_control(old_interrupt_posture);
+#endif /* TX_API_H */
/* Define the version ID of USBX. This may be utilized by the application. */
#ifdef UX_SYSTEM_INIT
-CHAR _ux_version_id[] =
- "Copyright (c) 2024 Microsoft Corporation. * USBX Cortex-A5/IAR Version 6.4.1 *";
+CHAR _ux_version_id[] =
+ "(c) 2024 Microsoft Corp. (c) 2026-present Eclipse ThreadX contributors. * USBX Cortex-A5/IAR Version 6.5.0.202601 *";
#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 e2c65063..0499cc1f 100644
--- a/ports/cortex_a5x/ac6/inc/ux_port.h
+++ b/ports/cortex_a5x/ac6/inc/ux_port.h
@@ -1,5 +1,6 @@
/***************************************************************************
* Copyright (c) 2024 Microsoft Corporation
+ * Copyright (c) 2026-present Eclipse ThreadX contributors
*
* This program and the accompanying materials are made available under the
* terms of the MIT License which is available at
@@ -36,20 +37,6 @@
/* This file contains data type definitions that make USBX function */
/* identically on a variety of different processor architectures. */
/* */
-/* RELEASE HISTORY */
-/* */
-/* DATE NAME DESCRIPTION */
-/* */
-/* 09-30-2020 Chaoqiong Xiao Initial Version 6.1 */
-/* 01-31-2022 Chaoqiong Xiao Modified comment(s), */
-/* moved tx_api.h include and */
-/* typedefs from ux_api.h, */
-/* resulting in version 6.1.10 */
-/* 10-31-2023 Chaoqiong Xiao Modified comment(s), */
-/* added basic types guards, */
-/* improved SLONG typedef, */
-/* resulting in version 6.3.0 */
-/* */
/**************************************************************************/
#ifndef UX_PORT_H
@@ -266,17 +253,18 @@ VOID outpl(ULONG,ULONG);
/* Define interrupt lockout constructs to protect the memory allocation/release which could happen
under ISR in the device stack. */
-
+#ifdef TX_API_H
#define UX_INT_SAVE_AREA unsigned int old_interrupt_posture;
#define UX_DISABLE_INTS old_interrupt_posture = tx_interrupt_control(TX_INT_DISABLE);
#define UX_RESTORE_INTS tx_interrupt_control(old_interrupt_posture);
+#endif /* TX_API_H */
/* Define the version ID of USBX. This may be utilized by the application. */
#ifdef UX_SYSTEM_INIT
CHAR _ux_version_id[] =
- "Copyright (c) 2024 Microsoft Corporation. * USBX Cortex-A5x/AC6 Version 6.4.1 *";
+ "(c) 2024 Microsoft Corp. (c) 2026-present Eclipse ThreadX contributors. * USBX Cortex-A5x/AC6 Version 6.5.0.202601 *";
#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 53016d53..5d557e34 100644
--- a/ports/cortex_a7/gnu/inc/ux_port.h
+++ b/ports/cortex_a7/gnu/inc/ux_port.h
@@ -1,18 +1,19 @@
/***************************************************************************
- * Copyright (c) 2024 Microsoft Corporation
- *
+ * Copyright (c) 2024 Microsoft Corporation
+ * Copyright (c) 2026-present Eclipse ThreadX contributors
+ *
* This program and the accompanying materials are made available under the
* terms of the MIT License which is available at
* https://opensource.org/licenses/MIT.
- *
+ *
* SPDX-License-Identifier: MIT
**************************************************************************/
/**************************************************************************/
/**************************************************************************/
-/** */
-/** USBX Component */
+/** */
+/** USBX Component */
/** */
/** Port Specific */
/** */
@@ -20,11 +21,11 @@
/**************************************************************************/
-/**************************************************************************/
-/* */
-/* PORT SPECIFIC C INFORMATION RELEASE */
-/* */
-/* ux_port.h Cortex-A7/GNU */
+/**************************************************************************/
+/* */
+/* PORT SPECIFIC C INFORMATION RELEASE */
+/* */
+/* ux_port.h Cortex-A7/GNU */
/* 6.3.0 */
/* */
/* AUTHOR */
@@ -32,23 +33,9 @@
/* Chaoqiong Xiao, Microsoft Corporation */
/* */
/* DESCRIPTION */
-/* */
-/* This file contains data type definitions that make USBX function */
-/* identically on a variety of different processor architectures. */
-/* */
-/* RELEASE HISTORY */
-/* */
-/* DATE NAME DESCRIPTION */
-/* */
-/* 09-30-2020 Chaoqiong Xiao Initial Version 6.1 */
-/* 01-31-2022 Chaoqiong Xiao Modified comment(s), */
-/* moved tx_api.h include and */
-/* typedefs from ux_api.h, */
-/* resulting in version 6.1.10 */
-/* 10-31-2023 Chaoqiong Xiao Modified comment(s), */
-/* added basic types guards, */
-/* improved SLONG typedef, */
-/* resulting in version 6.3.0 */
+/* */
+/* This file contains data type definitions that make USBX function */
+/* identically on a variety of different processor architectures. */
/* */
/**************************************************************************/
@@ -61,7 +48,7 @@
#ifdef UX_INCLUDE_USER_DEFINE_FILE
-/* Yes, include the user defines in ux_user.h. The defines in this file may
+/* Yes, include the user defines in ux_user.h. The defines in this file may
alternately be defined on the command line. */
#include "ux_user.h"
@@ -249,10 +236,11 @@ VOID outpl(ULONG,ULONG);
/* Define interrupt lockout constructs to protect the memory allocation/release which could happen
under ISR in the device stack. */
-
+#ifdef TX_API_H
#define UX_INT_SAVE_AREA unsigned int old_interrupt_posture;
#define UX_DISABLE_INTS old_interrupt_posture = tx_interrupt_control(TX_INT_DISABLE);
#define UX_RESTORE_INTS tx_interrupt_control(old_interrupt_posture);
+#endif /* TX_API_H */
/* Define memory barrier instruction. */
@@ -262,8 +250,8 @@ VOID outpl(ULONG,ULONG);
/* Define the version ID of USBX. This may be utilized by the application. */
#ifdef UX_SYSTEM_INIT
-CHAR _ux_version_id[] =
- "Copyright (c) 2024 Microsoft Corporation. * USBX Cortex-A7/GNU Version 6.4.1 *";
+CHAR _ux_version_id[] =
+ "(c) 2024 Microsoft Corp. (c) 2026-present Eclipse ThreadX contributors. * USBX Cortex-A7/GNU Version 6.5.0.202601 *";
#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 98d90893..6192f414 100644
--- a/ports/cortex_a7/iar/inc/ux_port.h
+++ b/ports/cortex_a7/iar/inc/ux_port.h
@@ -1,18 +1,19 @@
/***************************************************************************
- * Copyright (c) 2024 Microsoft Corporation
- *
+ * Copyright (c) 2024 Microsoft Corporation
+ * Copyright (c) 2026-present Eclipse ThreadX contributors
+ *
* This program and the accompanying materials are made available under the
* terms of the MIT License which is available at
* https://opensource.org/licenses/MIT.
- *
+ *
* SPDX-License-Identifier: MIT
**************************************************************************/
/**************************************************************************/
/**************************************************************************/
-/** */
-/** USBX Component */
+/** */
+/** USBX Component */
/** */
/** Port Specific */
/** */
@@ -20,11 +21,11 @@
/**************************************************************************/
-/**************************************************************************/
-/* */
-/* PORT SPECIFIC C INFORMATION RELEASE */
-/* */
-/* ux_port.h Cortex-A7/IAR */
+/**************************************************************************/
+/* */
+/* PORT SPECIFIC C INFORMATION RELEASE */
+/* */
+/* ux_port.h Cortex-A7/IAR */
/* 6.3.0 */
/* */
/* AUTHOR */
@@ -32,23 +33,9 @@
/* Chaoqiong Xiao, Microsoft Corporation */
/* */
/* DESCRIPTION */
-/* */
-/* This file contains data type definitions that make USBX function */
-/* identically on a variety of different processor architectures. */
-/* */
-/* RELEASE HISTORY */
-/* */
-/* DATE NAME DESCRIPTION */
-/* */
-/* 09-30-2020 Chaoqiong Xiao Initial Version 6.1 */
-/* 01-31-2022 Chaoqiong Xiao Modified comment(s), */
-/* moved tx_api.h include and */
-/* typedefs from ux_api.h, */
-/* resulting in version 6.1.10 */
-/* 10-31-2023 Chaoqiong Xiao Modified comment(s), */
-/* added basic types guards, */
-/* improved SLONG typedef, */
-/* resulting in version 6.3.0 */
+/* */
+/* This file contains data type definitions that make USBX function */
+/* identically on a variety of different processor architectures. */
/* */
/**************************************************************************/
@@ -61,7 +48,7 @@
#ifdef UX_INCLUDE_USER_DEFINE_FILE
-/* Yes, include the user defines in ux_user.h. The defines in this file may
+/* Yes, include the user defines in ux_user.h. The defines in this file may
alternately be defined on the command line. */
#include "ux_user.h"
@@ -249,10 +236,11 @@ VOID outpl(ULONG,ULONG);
/* Define interrupt lockout constructs to protect the memory allocation/release which could happen
under ISR in the device stack. */
-
+#ifdef TX_API_H
#define UX_INT_SAVE_AREA unsigned int old_interrupt_posture;
#define UX_DISABLE_INTS old_interrupt_posture = tx_interrupt_control(TX_INT_DISABLE);
#define UX_RESTORE_INTS tx_interrupt_control(old_interrupt_posture);
+#endif /* TX_API_H */
/* Define memory barrier instruction. */
@@ -262,8 +250,8 @@ VOID outpl(ULONG,ULONG);
/* Define the version ID of USBX. This may be utilized by the application. */
#ifdef UX_SYSTEM_INIT
-CHAR _ux_version_id[] =
- "Copyright (c) 2024 Microsoft Corporation. * USBX Cortex-A7/IAR Version 6.4.1 *";
+CHAR _ux_version_id[] =
+ "(c) 2024 Microsoft Corp. (c) 2026-present Eclipse ThreadX contributors. * USBX Cortex-A7/IAR Version 6.5.0.202601 *";
#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 de0b53f7..b331d133 100644
--- a/ports/cortex_a8/gnu/inc/ux_port.h
+++ b/ports/cortex_a8/gnu/inc/ux_port.h
@@ -1,18 +1,19 @@
/***************************************************************************
- * Copyright (c) 2024 Microsoft Corporation
- *
+ * Copyright (c) 2024 Microsoft Corporation
+ * Copyright (c) 2026-present Eclipse ThreadX contributors
+ *
* This program and the accompanying materials are made available under the
* terms of the MIT License which is available at
* https://opensource.org/licenses/MIT.
- *
+ *
* SPDX-License-Identifier: MIT
**************************************************************************/
/**************************************************************************/
/**************************************************************************/
-/** */
-/** USBX Component */
+/** */
+/** USBX Component */
/** */
/** Port Specific */
/** */
@@ -20,11 +21,11 @@
/**************************************************************************/
-/**************************************************************************/
-/* */
-/* PORT SPECIFIC C INFORMATION RELEASE */
-/* */
-/* ux_port.h Cortex-A8/GNU */
+/**************************************************************************/
+/* */
+/* PORT SPECIFIC C INFORMATION RELEASE */
+/* */
+/* ux_port.h Cortex-A8/GNU */
/* 6.3.0 */
/* */
/* AUTHOR */
@@ -32,23 +33,9 @@
/* Chaoqiong Xiao, Microsoft Corporation */
/* */
/* DESCRIPTION */
-/* */
-/* This file contains data type definitions that make USBX function */
-/* identically on a variety of different processor architectures. */
-/* */
-/* RELEASE HISTORY */
-/* */
-/* DATE NAME DESCRIPTION */
-/* */
-/* 09-30-2020 Chaoqiong Xiao Initial Version 6.1 */
-/* 01-31-2022 Chaoqiong Xiao Modified comment(s), */
-/* moved tx_api.h include and */
-/* typedefs from ux_api.h, */
-/* resulting in version 6.1.10 */
-/* 10-31-2023 Chaoqiong Xiao Modified comment(s), */
-/* added basic types guards, */
-/* improved SLONG typedef, */
-/* resulting in version 6.3.0 */
+/* */
+/* This file contains data type definitions that make USBX function */
+/* identically on a variety of different processor architectures. */
/* */
/**************************************************************************/
@@ -61,7 +48,7 @@
#ifdef UX_INCLUDE_USER_DEFINE_FILE
-/* Yes, include the user defines in ux_user.h. The defines in this file may
+/* Yes, include the user defines in ux_user.h. The defines in this file may
alternately be defined on the command line. */
#include "ux_user.h"
@@ -249,17 +236,18 @@ VOID outpl(ULONG,ULONG);
/* Define interrupt lockout constructs to protect the memory allocation/release which could happen
under ISR in the device stack. */
-
+#ifdef TX_API_H
#define UX_INT_SAVE_AREA unsigned int old_interrupt_posture;
#define UX_DISABLE_INTS old_interrupt_posture = tx_interrupt_control(TX_INT_DISABLE);
#define UX_RESTORE_INTS tx_interrupt_control(old_interrupt_posture);
+#endif /* TX_API_H */
/* Define the version ID of USBX. This may be utilized by the application. */
#ifdef UX_SYSTEM_INIT
-CHAR _ux_version_id[] =
- "Copyright (c) 2024 Microsoft Corporation. * USBX Cortex-A8/GNU Version 6.4.1 *";
+CHAR _ux_version_id[] =
+ "(c) 2024 Microsoft Corp. (c) 2026-present Eclipse ThreadX contributors. * USBX Cortex-A8/GNU Version 6.5.0.202601 *";
#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 c7def078..0eae9a85 100644
--- a/ports/cortex_a8/iar/inc/ux_port.h
+++ b/ports/cortex_a8/iar/inc/ux_port.h
@@ -1,5 +1,6 @@
/***************************************************************************
* Copyright (c) 2024 Microsoft Corporation
+ * Copyright (c) 2026-present Eclipse ThreadX contributors
*
* This program and the accompanying materials are made available under the
* terms of the MIT License which is available at
@@ -36,20 +37,6 @@
/* This file contains data type definitions that make USBX function */
/* identically on a variety of different processor architectures. */
/* */
-/* RELEASE HISTORY */
-/* */
-/* DATE NAME DESCRIPTION */
-/* */
-/* 09-30-2020 Chaoqiong Xiao Initial Version 6.1 */
-/* 01-31-2022 Chaoqiong Xiao Modified comment(s), */
-/* moved tx_api.h include and */
-/* typedefs from ux_api.h, */
-/* resulting in version 6.1.10 */
-/* 10-31-2023 Chaoqiong Xiao Modified comment(s), */
-/* added basic types guards, */
-/* improved SLONG typedef, */
-/* resulting in version 6.3.0 */
-/* */
/**************************************************************************/
#ifndef UX_PORT_H
@@ -249,17 +236,18 @@ VOID outpl(ULONG,ULONG);
/* Define interrupt lockout constructs to protect the memory allocation/release which could happen
under ISR in the device stack. */
-
+#ifdef TX_API_H
#define UX_INT_SAVE_AREA unsigned int old_interrupt_posture;
#define UX_DISABLE_INTS old_interrupt_posture = tx_interrupt_control(TX_INT_DISABLE);
#define UX_RESTORE_INTS tx_interrupt_control(old_interrupt_posture);
+#endif /* TX_API_H */
/* Define the version ID of USBX. This may be utilized by the application. */
#ifdef UX_SYSTEM_INIT
CHAR _ux_version_id[] =
- "Copyright (c) 2024 Microsoft Corporation. * USBX Cortex-A8/IAR Version 6.4.1 *";
+ "(c) 2024 Microsoft Corp. (c) 2026-present Eclipse ThreadX contributors. * USBX Cortex-A8/IAR Version 6.5.0.202601 *";
#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 382cefa0..ba2b7f92 100644
--- a/ports/cortex_a9/gnu/inc/ux_port.h
+++ b/ports/cortex_a9/gnu/inc/ux_port.h
@@ -1,5 +1,6 @@
/***************************************************************************
* Copyright (c) 2024 Microsoft Corporation
+ * Copyright (c) 2026-present Eclipse ThreadX contributors
*
* This program and the accompanying materials are made available under the
* terms of the MIT License which is available at
@@ -36,20 +37,6 @@
/* This file contains data type definitions that make USBX function */
/* identically on a variety of different processor architectures. */
/* */
-/* RELEASE HISTORY */
-/* */
-/* DATE NAME DESCRIPTION */
-/* */
-/* 09-30-2020 Chaoqiong Xiao Initial Version 6.1 */
-/* 01-31-2022 Chaoqiong Xiao Modified comment(s), */
-/* moved tx_api.h include and */
-/* typedefs from ux_api.h, */
-/* resulting in version 6.1.10 */
-/* 10-31-2023 Chaoqiong Xiao Modified comment(s), */
-/* added basic types guards, */
-/* improved SLONG typedef, */
-/* resulting in version 6.3.0 */
-/* */
/**************************************************************************/
#ifndef UX_PORT_H
@@ -249,17 +236,18 @@ VOID outpl(ULONG,ULONG);
/* Define interrupt lockout constructs to protect the memory allocation/release which could happen
under ISR in the device stack. */
-
+#ifdef TX_API_H
#define UX_INT_SAVE_AREA unsigned int old_interrupt_posture;
#define UX_DISABLE_INTS old_interrupt_posture = tx_interrupt_control(TX_INT_DISABLE);
#define UX_RESTORE_INTS tx_interrupt_control(old_interrupt_posture);
+#endif /* TX_API_H */
/* Define the version ID of USBX. This may be utilized by the application. */
#ifdef UX_SYSTEM_INIT
CHAR _ux_version_id[] =
- "Copyright (c) 2024 Microsoft Corporation. * USBX ARM9/GNU Version 6.4.1 *";
+ "(c) 2024 Microsoft Corp. (c) 2026-present Eclipse ThreadX contributors. * USBX ARM9/GNU Version 6.5.0.202601 *";
#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 bd423fdc..32d8caa0 100644
--- a/ports/cortex_a9/iar/inc/ux_port.h
+++ b/ports/cortex_a9/iar/inc/ux_port.h
@@ -1,5 +1,6 @@
/***************************************************************************
* Copyright (c) 2024 Microsoft Corporation
+ * Copyright (c) 2026-present Eclipse ThreadX contributors
*
* This program and the accompanying materials are made available under the
* terms of the MIT License which is available at
@@ -36,20 +37,6 @@
/* This file contains data type definitions that make USBX function */
/* identically on a variety of different processor architectures. */
/* */
-/* RELEASE HISTORY */
-/* */
-/* DATE NAME DESCRIPTION */
-/* */
-/* 09-30-2020 Chaoqiong Xiao Initial Version 6.1 */
-/* 01-31-2022 Chaoqiong Xiao Modified comment(s), */
-/* moved tx_api.h include and */
-/* typedefs from ux_api.h, */
-/* resulting in version 6.1.10 */
-/* 10-31-2023 Chaoqiong Xiao Modified comment(s), */
-/* added basic types guards, */
-/* improved SLONG typedef, */
-/* resulting in version 6.3.0 */
-/* */
/**************************************************************************/
#ifndef UX_PORT_H
@@ -249,17 +236,18 @@ VOID outpl(ULONG,ULONG);
/* Define interrupt lockout constructs to protect the memory allocation/release which could happen
under ISR in the device stack. */
-
+#ifdef TX_API_H
#define UX_INT_SAVE_AREA unsigned int old_interrupt_posture;
#define UX_DISABLE_INTS old_interrupt_posture = tx_interrupt_control(TX_INT_DISABLE);
#define UX_RESTORE_INTS tx_interrupt_control(old_interrupt_posture);
+#endif /* TX_API_H */
/* Define the version ID of USBX. This may be utilized by the application. */
#ifdef UX_SYSTEM_INIT
CHAR _ux_version_id[] =
- "Copyright (c) 2024 Microsoft Corporation. * USBX ARM9/IAR Version 6.4.1 *";
+ "(c) 2024 Microsoft Corp. (c) 2026-present Eclipse ThreadX contributors. * USBX ARM9/IAR Version 6.5.0.202601 *";
#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 01aaf74c..b39c2e87 100644
--- a/ports/cortex_m0/gnu/inc/ux_port.h
+++ b/ports/cortex_m0/gnu/inc/ux_port.h
@@ -1,5 +1,6 @@
/***************************************************************************
* Copyright (c) 2024 Microsoft Corporation
+ * Copyright (c) 2026-present Eclipse ThreadX contributors
*
* This program and the accompanying materials are made available under the
* terms of the MIT License which is available at
@@ -36,22 +37,6 @@
/* This file contains data type definitions that make USBX function */
/* identically on a variety of different processor architectures. */
/* */
-/* RELEASE HISTORY */
-/* */
-/* DATE NAME DESCRIPTION */
-/* */
-/* 05-19-2020 Chaoqiong Xiao Initial Version 6.0 */
-/* 09-30-2020 Chaoqiong Xiao Modified comment(s), */
-/* resulting in version 6.1 */
-/* 01-31-2022 Chaoqiong Xiao Modified comment(s), */
-/* moved tx_api.h include and */
-/* typedefs from ux_api.h, */
-/* resulting in version 6.1.10 */
-/* 10-31-2023 Chaoqiong Xiao Modified comment(s), */
-/* added basic types guards, */
-/* improved SLONG typedef, */
-/* resulting in version 6.3.0 */
-/* */
/**************************************************************************/
#ifndef UX_PORT_H
@@ -247,17 +232,18 @@ VOID outpl(ULONG,ULONG);
/* Define interrupt lockout constructs to protect the memory allocation/release which could happen
under ISR in the device stack. */
-
+#ifdef TX_API_H
#define UX_INT_SAVE_AREA unsigned int old_interrupt_posture;
#define UX_DISABLE_INTS old_interrupt_posture = tx_interrupt_control(TX_INT_DISABLE);
#define UX_RESTORE_INTS tx_interrupt_control(old_interrupt_posture);
+#endif /* TX_API_H */
/* Define the version ID of USBX. This may be utilized by the application. */
#ifdef UX_SYSTEM_INIT
CHAR _ux_version_id[] =
- "Copyright (c) 2024 Microsoft Corporation. * USBX Cortex-M0/GNU Version 6.4.1 *";
+ "(c) 2024 Microsoft Corp. (c) 2026-present Eclipse ThreadX contributors. * USBX Cortex-M0/GNU Version 6.5.0.202601 *";
#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 08d87b10..ce466cdc 100644
--- a/ports/cortex_m0/iar/inc/ux_port.h
+++ b/ports/cortex_m0/iar/inc/ux_port.h
@@ -1,5 +1,6 @@
/***************************************************************************
* Copyright (c) 2024 Microsoft Corporation
+ * Copyright (c) 2026-present Eclipse ThreadX contributors
*
* This program and the accompanying materials are made available under the
* terms of the MIT License which is available at
@@ -36,20 +37,6 @@
/* This file contains data type definitions that make USBX function */
/* identically on a variety of different processor architectures. */
/* */
-/* RELEASE HISTORY */
-/* */
-/* DATE NAME DESCRIPTION */
-/* */
-/* 09-30-2020 Chaoqiong Xiao Initial Version 6.1 */
-/* 01-31-2022 Chaoqiong Xiao Modified comment(s), */
-/* moved tx_api.h include and */
-/* typedefs from ux_api.h, */
-/* resulting in version 6.1.10 */
-/* 10-31-2023 Chaoqiong Xiao Modified comment(s), */
-/* added basic types guards, */
-/* improved SLONG typedef, */
-/* resulting in version 6.3.0 */
-/* */
/**************************************************************************/
#ifndef UX_PORT_H
@@ -249,17 +236,18 @@ VOID outpl(ULONG,ULONG);
/* Define interrupt lockout constructs to protect the memory allocation/release which could happen
under ISR in the device stack. */
-
+#ifdef TX_API_H
#define UX_INT_SAVE_AREA unsigned int old_interrupt_posture;
#define UX_DISABLE_INTS old_interrupt_posture = tx_interrupt_control(TX_INT_DISABLE);
#define UX_RESTORE_INTS tx_interrupt_control(old_interrupt_posture);
+#endif /* TX_API_H */
/* Define the version ID of USBX. This may be utilized by the application. */
#ifdef UX_SYSTEM_INIT
CHAR _ux_version_id[] =
- "Copyright (c) 2024 Microsoft Corporation. * USBX Cortex-M0/IAR Version 6.4.1 *";
+ "(c) 2024 Microsoft Corp. (c) 2026-present Eclipse ThreadX contributors. * USBX Cortex-M0/IAR Version 6.5.0.202601 *";
#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 42983ea4..0361f981 100644
--- a/ports/cortex_m3/gnu/inc/ux_port.h
+++ b/ports/cortex_m3/gnu/inc/ux_port.h
@@ -1,5 +1,6 @@
/***************************************************************************
* Copyright (c) 2024 Microsoft Corporation
+ * Copyright (c) 2026-present Eclipse ThreadX contributors
*
* This program and the accompanying materials are made available under the
* terms of the MIT License which is available at
@@ -36,22 +37,6 @@
/* This file contains data type definitions that make USBX function */
/* identically on a variety of different processor architectures. */
/* */
-/* RELEASE HISTORY */
-/* */
-/* DATE NAME DESCRIPTION */
-/* */
-/* 05-19-2020 Chaoqiong Xiao Initial Version 6.0 */
-/* 09-30-2020 Chaoqiong Xiao Modified comment(s), */
-/* resulting in version 6.1 */
-/* 01-31-2022 Chaoqiong Xiao Modified comment(s), */
-/* moved tx_api.h include and */
-/* typedefs from ux_api.h, */
-/* resulting in version 6.1.10 */
-/* 10-31-2023 Chaoqiong Xiao Modified comment(s), */
-/* added basic types guards, */
-/* improved SLONG typedef, */
-/* resulting in version 6.3.0 */
-/* */
/**************************************************************************/
#ifndef UX_PORT_H
@@ -247,17 +232,18 @@ VOID outpl(ULONG,ULONG);
/* Define interrupt lockout constructs to protect the memory allocation/release which could happen
under ISR in the device stack. */
-
+#ifdef TX_API_H
#define UX_INT_SAVE_AREA unsigned int old_interrupt_posture;
#define UX_DISABLE_INTS old_interrupt_posture = tx_interrupt_control(TX_INT_DISABLE);
#define UX_RESTORE_INTS tx_interrupt_control(old_interrupt_posture);
+#endif /* TX_API_H */
/* Define the version ID of USBX. This may be utilized by the application. */
#ifdef UX_SYSTEM_INIT
CHAR _ux_version_id[] =
- "Copyright (c) 2024 Microsoft Corporation. * USBX Cortex-M3/GNU Version 6.4.1 *";
+ "(c) 2024 Microsoft Corp. (c) 2026-present Eclipse ThreadX contributors. * USBX Cortex-M3/GNU Version 6.5.0.202601 *";
#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 2f63f25d..ae7ef19f 100644
--- a/ports/cortex_m3/iar/inc/ux_port.h
+++ b/ports/cortex_m3/iar/inc/ux_port.h
@@ -1,5 +1,6 @@
/***************************************************************************
* Copyright (c) 2024 Microsoft Corporation
+ * Copyright (c) 2026-present Eclipse ThreadX contributors
*
* This program and the accompanying materials are made available under the
* terms of the MIT License which is available at
@@ -36,20 +37,6 @@
/* This file contains data type definitions that make USBX function */
/* identically on a variety of different processor architectures. */
/* */
-/* RELEASE HISTORY */
-/* */
-/* DATE NAME DESCRIPTION */
-/* */
-/* 09-30-2020 Chaoqiong Xiao Initial Version 6.1 */
-/* 01-31-2022 Chaoqiong Xiao Modified comment(s), */
-/* moved tx_api.h include and */
-/* typedefs from ux_api.h, */
-/* resulting in version 6.1.10 */
-/* 10-31-2023 Chaoqiong Xiao Modified comment(s), */
-/* added basic types guards, */
-/* improved SLONG typedef, */
-/* resulting in version 6.3.0 */
-/* */
/**************************************************************************/
#ifndef UX_PORT_H
@@ -258,7 +245,7 @@ VOID outpl(ULONG,ULONG);
#ifdef UX_SYSTEM_INIT
CHAR _ux_version_id[] =
- "Copyright (c) 2024 Microsoft Corporation. * USBX Cortex-M3/IAR Version 6.4.1 *";
+ "(c) 2024 Microsoft Corp. (c) 2026-present Eclipse ThreadX contributors. * USBX Cortex-M3/IAR Version 6.5.0.202601 *";
#else
extern CHAR _ux_version_id[];
#endif
diff --git a/ports/cortex_m33/gnu/inc/ux_port.h b/ports/cortex_m33/gnu/inc/ux_port.h
index 06f73b0b..53ccf090 100644
--- a/ports/cortex_m33/gnu/inc/ux_port.h
+++ b/ports/cortex_m33/gnu/inc/ux_port.h
@@ -1,5 +1,6 @@
/***************************************************************************
* Copyright (c) 2024 Microsoft Corporation
+ * Copyright (c) 2026-present Eclipse ThreadX contributors
*
* This program and the accompanying materials are made available under the
* terms of the MIT License which is available at
@@ -36,22 +37,6 @@
/* This file contains data type definitions that make USBX function */
/* identically on a variety of different processor architectures. */
/* */
-/* RELEASE HISTORY */
-/* */
-/* DATE NAME DESCRIPTION */
-/* */
-/* 05-19-2020 Chaoqiong Xiao Initial Version 6.0 */
-/* 09-30-2020 Chaoqiong Xiao Modified comment(s), */
-/* resulting in version 6.1 */
-/* 01-31-2022 Chaoqiong Xiao Modified comment(s), */
-/* moved tx_api.h include and */
-/* typedefs from ux_api.h, */
-/* resulting in version 6.1.10 */
-/* 10-31-2023 Chaoqiong Xiao Modified comment(s), */
-/* added basic types guards, */
-/* improved SLONG typedef, */
-/* resulting in version 6.3.0 */
-/* */
/**************************************************************************/
#ifndef UX_PORT_H
@@ -247,17 +232,18 @@ VOID outpl(ULONG,ULONG);
/* Define interrupt lockout constructs to protect the memory allocation/release which could happen
under ISR in the device stack. */
-
+#ifdef TX_API_H
#define UX_INT_SAVE_AREA unsigned int old_interrupt_posture;
#define UX_DISABLE_INTS old_interrupt_posture = tx_interrupt_control(TX_INT_DISABLE);
#define UX_RESTORE_INTS tx_interrupt_control(old_interrupt_posture);
+#endif /* TX_API_H */
/* Define the version ID of USBX. This may be utilized by the application. */
#ifdef UX_SYSTEM_INIT
CHAR _ux_version_id[] =
- "Copyright (c) 2024 Microsoft Corporation. * USBX Cortex-M33/GNU Version 6.4.1 *";
+ "(c) 2024 Microsoft Corp. (c) 2026-present Eclipse ThreadX contributors. * USBX Cortex-M33/GNU Version 6.5.0.202601 *";
#else
extern CHAR _ux_version_id[];
#endif
diff --git a/ports/cortex_m33/iar/inc/ux_port.h b/ports/cortex_m33/iar/inc/ux_port.h
index 92134747..f5055d9d 100644
--- a/ports/cortex_m33/iar/inc/ux_port.h
+++ b/ports/cortex_m33/iar/inc/ux_port.h
@@ -1,5 +1,6 @@
/***************************************************************************
* Copyright (c) 2024 Microsoft Corporation
+ * Copyright (c) 2026-present Eclipse ThreadX contributors
*
* This program and the accompanying materials are made available under the
* terms of the MIT License which is available at
@@ -36,20 +37,6 @@
/* This file contains data type definitions that make USBX function */
/* identically on a variety of different processor architectures. */
/* */
-/* RELEASE HISTORY */
-/* */
-/* DATE NAME DESCRIPTION */
-/* */
-/* 09-30-2020 Chaoqiong Xiao Initial Version 6.1 */
-/* 01-31-2022 Chaoqiong Xiao Modified comment(s), */
-/* moved tx_api.h include and */
-/* typedefs from ux_api.h, */
-/* resulting in version 6.1.10 */
-/* 10-31-2023 Chaoqiong Xiao Modified comment(s), */
-/* added basic types guards, */
-/* improved SLONG typedef, */
-/* resulting in version 6.3.0 */
-/* */
/**************************************************************************/
#ifndef UX_PORT_H
@@ -249,17 +236,18 @@ VOID outpl(ULONG,ULONG);
/* Define interrupt lockout constructs to protect the memory allocation/release which could happen
under ISR in the device stack. */
-
+#ifdef TX_API_H
#define UX_INT_SAVE_AREA unsigned int old_interrupt_posture;
#define UX_DISABLE_INTS old_interrupt_posture = tx_interrupt_control(TX_INT_DISABLE);
#define UX_RESTORE_INTS tx_interrupt_control(old_interrupt_posture);
+#endif /* TX_API_H */
/* Define the version ID of USBX. This may be utilized by the application. */
#ifdef UX_SYSTEM_INIT
CHAR _ux_version_id[] =
- "Copyright (c) 2024 Microsoft Corporation. * USBX Cortex-M33/IAR Version 6.4.1 *";
+ "(c) 2024 Microsoft Corp. (c) 2026-present Eclipse ThreadX contributors. * USBX Cortex-M33/IAR Version 6.5.0.202601 *";
#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 199f01db..41b692aa 100644
--- a/ports/cortex_m4/gnu/inc/ux_port.h
+++ b/ports/cortex_m4/gnu/inc/ux_port.h
@@ -1,18 +1,19 @@
/***************************************************************************
- * Copyright (c) 2024 Microsoft Corporation
- *
+ * Copyright (c) 2024 Microsoft Corporation
+ * Copyright (c) 2026-present Eclipse ThreadX contributors
+ *
* This program and the accompanying materials are made available under the
* terms of the MIT License which is available at
* https://opensource.org/licenses/MIT.
- *
+ *
* SPDX-License-Identifier: MIT
**************************************************************************/
/**************************************************************************/
/**************************************************************************/
-/** */
-/** USBX Component */
+/** */
+/** USBX Component */
/** */
/** Port Specific */
/** */
@@ -20,11 +21,11 @@
/**************************************************************************/
-/**************************************************************************/
-/* */
-/* PORT SPECIFIC C INFORMATION RELEASE */
-/* */
-/* ux_port.h Cortex-M4/GNU */
+/**************************************************************************/
+/* */
+/* PORT SPECIFIC C INFORMATION RELEASE */
+/* */
+/* ux_port.h Cortex-M4/GNU */
/* 6.3.0 */
/* */
/* AUTHOR */
@@ -32,25 +33,9 @@
/* Chaoqiong Xiao, Microsoft Corporation */
/* */
/* DESCRIPTION */
-/* */
-/* This file contains data type definitions that make USBX function */
-/* identically on a variety of different processor architectures. */
-/* */
-/* RELEASE HISTORY */
-/* */
-/* DATE NAME DESCRIPTION */
-/* */
-/* 05-19-2020 Chaoqiong Xiao Initial Version 6.0 */
-/* 09-30-2020 Chaoqiong Xiao Modified comment(s), */
-/* resulting in version 6.1 */
-/* 01-31-2022 Chaoqiong Xiao Modified comment(s), */
-/* moved tx_api.h include and */
-/* typedefs from ux_api.h, */
-/* resulting in version 6.1.10 */
-/* 10-31-2023 Chaoqiong Xiao Modified comment(s), */
-/* added basic types guards, */
-/* improved SLONG typedef, */
-/* resulting in version 6.3.0 */
+/* */
+/* This file contains data type definitions that make USBX function */
+/* identically on a variety of different processor architectures. */
/* */
/**************************************************************************/
@@ -63,7 +48,7 @@
#ifdef UX_INCLUDE_USER_DEFINE_FILE
-/* Yes, include the user defines in ux_user.h. The defines in this file may
+/* Yes, include the user defines in ux_user.h. The defines in this file may
alternately be defined on the command line. */
#include "ux_user.h"
@@ -247,17 +232,18 @@ VOID outpl(ULONG,ULONG);
/* Define interrupt lockout constructs to protect the memory allocation/release which could happen
under ISR in the device stack. */
-
+#ifdef TX_API_H
#define UX_INT_SAVE_AREA unsigned int old_interrupt_posture;
#define UX_DISABLE_INTS old_interrupt_posture = tx_interrupt_control(TX_INT_DISABLE);
#define UX_RESTORE_INTS tx_interrupt_control(old_interrupt_posture);
+#endif /* TX_API_H */
/* Define the version ID of USBX. This may be utilized by the application. */
#ifdef UX_SYSTEM_INIT
-CHAR _ux_version_id[] =
- "Copyright (c) 2024 Microsoft Corporation. * USBX Cortex-M4/GNU Version 6.4.1 *";
+CHAR _ux_version_id[] =
+ "(c) 2024 Microsoft Corp. (c) 2026-present Eclipse ThreadX contributors. * USBX Cortex-M4/GNU Version 6.5.0.202601 *";
#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 4554a1b3..0eb9db3d 100644
--- a/ports/cortex_m4/iar/inc/ux_port.h
+++ b/ports/cortex_m4/iar/inc/ux_port.h
@@ -1,18 +1,19 @@
/***************************************************************************
- * Copyright (c) 2024 Microsoft Corporation
- *
+ * Copyright (c) 2024 Microsoft Corporation
+ * Copyright (c) 2026-present Eclipse ThreadX contributors
+ *
* This program and the accompanying materials are made available under the
* terms of the MIT License which is available at
* https://opensource.org/licenses/MIT.
- *
+ *
* SPDX-License-Identifier: MIT
**************************************************************************/
/**************************************************************************/
/**************************************************************************/
-/** */
-/** USBX Component */
+/** */
+/** USBX Component */
/** */
/** Port Specific */
/** */
@@ -20,11 +21,11 @@
/**************************************************************************/
-/**************************************************************************/
-/* */
-/* PORT SPECIFIC C INFORMATION RELEASE */
-/* */
-/* ux_port.h Cortex-M4/IAR */
+/**************************************************************************/
+/* */
+/* PORT SPECIFIC C INFORMATION RELEASE */
+/* */
+/* ux_port.h Cortex-M4/IAR */
/* 6.3.0 */
/* */
/* AUTHOR */
@@ -32,23 +33,9 @@
/* Chaoqiong Xiao, Microsoft Corporation */
/* */
/* DESCRIPTION */
-/* */
-/* This file contains data type definitions that make USBX function */
-/* identically on a variety of different processor architectures. */
-/* */
-/* RELEASE HISTORY */
-/* */
-/* DATE NAME DESCRIPTION */
-/* */
-/* 09-30-2020 Chaoqiong Xiao Initial Version 6.1 */
-/* 01-31-2022 Chaoqiong Xiao Modified comment(s), */
-/* moved tx_api.h include and */
-/* typedefs from ux_api.h, */
-/* resulting in version 6.1.10 */
-/* 10-31-2023 Chaoqiong Xiao Modified comment(s), */
-/* added basic types guards, */
-/* improved SLONG typedef, */
-/* resulting in version 6.3.0 */
+/* */
+/* This file contains data type definitions that make USBX function */
+/* identically on a variety of different processor architectures. */
/* */
/**************************************************************************/
@@ -61,7 +48,7 @@
#ifdef UX_INCLUDE_USER_DEFINE_FILE
-/* Yes, include the user defines in ux_user.h. The defines in this file may
+/* Yes, include the user defines in ux_user.h. The defines in this file may
alternately be defined on the command line. */
#include "ux_user.h"
@@ -249,17 +236,18 @@ VOID outpl(ULONG,ULONG);
/* Define interrupt lockout constructs to protect the memory allocation/release which could happen
under ISR in the device stack. */
-
+#ifdef TX_API_H
#define UX_INT_SAVE_AREA unsigned int old_interrupt_posture;
#define UX_DISABLE_INTS old_interrupt_posture = tx_interrupt_control(TX_INT_DISABLE);
#define UX_RESTORE_INTS tx_interrupt_control(old_interrupt_posture);
+#endif /* TX_API_H */
/* Define the version ID of USBX. This may be utilized by the application. */
#ifdef UX_SYSTEM_INIT
-CHAR _ux_version_id[] =
- "Copyright (c) 2024 Microsoft Corporation. * USBX Cortex-M4/IAR Version 6.4.1 *";
+CHAR _ux_version_id[] =
+ "(c) 2024 Microsoft Corp. (c) 2026-present Eclipse ThreadX contributors. * USBX Cortex-M4/IAR Version 6.5.0.202601 *";
#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 badf4446..d5a08fc3 100644
--- a/ports/cortex_m7/gnu/inc/ux_port.h
+++ b/ports/cortex_m7/gnu/inc/ux_port.h
@@ -1,18 +1,19 @@
/***************************************************************************
- * Copyright (c) 2024 Microsoft Corporation
- *
+ * Copyright (c) 2024 Microsoft Corporation
+ * Copyright (c) 2026-present Eclipse ThreadX contributors
+ *
* This program and the accompanying materials are made available under the
* terms of the MIT License which is available at
* https://opensource.org/licenses/MIT.
- *
+ *
* SPDX-License-Identifier: MIT
**************************************************************************/
/**************************************************************************/
/**************************************************************************/
-/** */
-/** USBX Component */
+/** */
+/** USBX Component */
/** */
/** Port Specific */
/** */
@@ -20,11 +21,11 @@
/**************************************************************************/
-/**************************************************************************/
-/* */
-/* PORT SPECIFIC C INFORMATION RELEASE */
-/* */
-/* ux_port.h Cortex-M7/GNU */
+/**************************************************************************/
+/* */
+/* PORT SPECIFIC C INFORMATION RELEASE */
+/* */
+/* ux_port.h Cortex-M7/GNU */
/* 6.3.0 */
/* */
/* AUTHOR */
@@ -32,25 +33,9 @@
/* Chaoqiong Xiao, Microsoft Corporation */
/* */
/* DESCRIPTION */
-/* */
-/* This file contains data type definitions that make USBX function */
-/* identically on a variety of different processor architectures. */
-/* */
-/* RELEASE HISTORY */
-/* */
-/* DATE NAME DESCRIPTION */
-/* */
-/* 05-19-2020 Chaoqiong Xiao Initial Version 6.0 */
-/* 09-30-2020 Chaoqiong Xiao Modified comment(s), */
-/* resulting in version 6.1 */
-/* 01-31-2022 Chaoqiong Xiao Modified comment(s), */
-/* moved tx_api.h include and */
-/* typedefs from ux_api.h, */
-/* resulting in version 6.1.10 */
-/* 10-31-2023 Chaoqiong Xiao Modified comment(s), */
-/* added basic types guards, */
-/* improved SLONG typedef, */
-/* resulting in version 6.3.0 */
+/* */
+/* This file contains data type definitions that make USBX function */
+/* identically on a variety of different processor architectures. */
/* */
/**************************************************************************/
@@ -63,7 +48,7 @@
#ifdef UX_INCLUDE_USER_DEFINE_FILE
-/* Yes, include the user defines in ux_user.h. The defines in this file may
+/* Yes, include the user defines in ux_user.h. The defines in this file may
alternately be defined on the command line. */
#include "ux_user.h"
@@ -247,17 +232,18 @@ VOID outpl(ULONG,ULONG);
/* Define interrupt lockout constructs to protect the memory allocation/release which could happen
under ISR in the device stack. */
-
+#ifdef TX_API_H
#define UX_INT_SAVE_AREA unsigned int old_interrupt_posture;
#define UX_DISABLE_INTS old_interrupt_posture = tx_interrupt_control(TX_INT_DISABLE);
#define UX_RESTORE_INTS tx_interrupt_control(old_interrupt_posture);
+#endif /* TX_API_H */
/* Define the version ID of USBX. This may be utilized by the application. */
#ifdef UX_SYSTEM_INIT
-CHAR _ux_version_id[] =
- "Copyright (c) 2024 Microsoft Corporation. * USBX Cortex-M7/GNU Version 6.4.1 *";
+CHAR _ux_version_id[] =
+ "(c) 2024 Microsoft Corp. (c) 2026-present Eclipse ThreadX contributors. * USBX Cortex-M7/GNU Version 6.5.0.202601 *";
#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 6c36c827..5843ceb1 100644
--- a/ports/cortex_m7/iar/inc/ux_port.h
+++ b/ports/cortex_m7/iar/inc/ux_port.h
@@ -1,18 +1,19 @@
/***************************************************************************
- * Copyright (c) 2024 Microsoft Corporation
- *
+ * Copyright (c) 2024 Microsoft Corporation
+ * Copyright (c) 2026-present Eclipse ThreadX contributors
+ *
* This program and the accompanying materials are made available under the
* terms of the MIT License which is available at
* https://opensource.org/licenses/MIT.
- *
+ *
* SPDX-License-Identifier: MIT
**************************************************************************/
/**************************************************************************/
/**************************************************************************/
-/** */
-/** USBX Component */
+/** */
+/** USBX Component */
/** */
/** Port Specific */
/** */
@@ -20,11 +21,11 @@
/**************************************************************************/
-/**************************************************************************/
-/* */
-/* PORT SPECIFIC C INFORMATION RELEASE */
-/* */
-/* ux_port.h Cortex-M7/IAR */
+/**************************************************************************/
+/* */
+/* PORT SPECIFIC C INFORMATION RELEASE */
+/* */
+/* ux_port.h Cortex-M7/IAR */
/* 6.3.0 */
/* */
/* AUTHOR */
@@ -32,23 +33,9 @@
/* Chaoqiong Xiao, Microsoft Corporation */
/* */
/* DESCRIPTION */
-/* */
-/* This file contains data type definitions that make USBX function */
-/* identically on a variety of different processor architectures. */
-/* */
-/* RELEASE HISTORY */
-/* */
-/* DATE NAME DESCRIPTION */
-/* */
-/* 09-30-2020 Chaoqiong Xiao Initial Version 6.1 */
-/* 01-31-2022 Chaoqiong Xiao Modified comment(s), */
-/* moved tx_api.h include and */
-/* typedefs from ux_api.h, */
-/* resulting in version 6.1.10 */
-/* 10-31-2023 Chaoqiong Xiao Modified comment(s), */
-/* added basic types guards, */
-/* improved SLONG typedef, */
-/* resulting in version 6.3.0 */
+/* */
+/* This file contains data type definitions that make USBX function */
+/* identically on a variety of different processor architectures. */
/* */
/**************************************************************************/
@@ -61,7 +48,7 @@
#ifdef UX_INCLUDE_USER_DEFINE_FILE
-/* Yes, include the user defines in ux_user.h. The defines in this file may
+/* Yes, include the user defines in ux_user.h. The defines in this file may
alternately be defined on the command line. */
#include "ux_user.h"
@@ -249,17 +236,18 @@ VOID outpl(ULONG,ULONG);
/* Define interrupt lockout constructs to protect the memory allocation/release which could happen
under ISR in the device stack. */
-
+#ifdef TX_API_H
#define UX_INT_SAVE_AREA unsigned int old_interrupt_posture;
#define UX_DISABLE_INTS old_interrupt_posture = tx_interrupt_control(TX_INT_DISABLE);
#define UX_RESTORE_INTS tx_interrupt_control(old_interrupt_posture);
+#endif /* TX_API_H */
/* Define the version ID of USBX. This may be utilized by the application. */
#ifdef UX_SYSTEM_INIT
-CHAR _ux_version_id[] =
- "Copyright (c) 2024 Microsoft Corporation. * USBX Cortex-M7/IAR Version 6.4.1 *";
+CHAR _ux_version_id[] =
+ "(c) 2024 Microsoft Corp. (c) 2026-present Eclipse ThreadX contributors. * USBX Cortex-M7/IAR Version 6.5.0.202601 *";
#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 f5657ae8..af7083c1 100644
--- a/ports/cortex_r4/gnu/inc/ux_port.h
+++ b/ports/cortex_r4/gnu/inc/ux_port.h
@@ -1,5 +1,6 @@
/***************************************************************************
* Copyright (c) 2024 Microsoft Corporation
+ * Copyright (c) 2026-present Eclipse ThreadX contributors
*
* This program and the accompanying materials are made available under the
* terms of the MIT License which is available at
@@ -36,20 +37,6 @@
/* This file contains data type definitions that make USBX function */
/* identically on a variety of different processor architectures. */
/* */
-/* RELEASE HISTORY */
-/* */
-/* DATE NAME DESCRIPTION */
-/* */
-/* 09-30-2020 Chaoqiong Xiao Initial Version 6.1 */
-/* 01-31-2022 Chaoqiong Xiao Modified comment(s), */
-/* moved tx_api.h include and */
-/* typedefs from ux_api.h, */
-/* resulting in version 6.1.10 */
-/* 10-31-2023 Chaoqiong Xiao Modified comment(s), */
-/* added basic types guards, */
-/* improved SLONG typedef, */
-/* resulting in version 6.3.0 */
-/* */
/**************************************************************************/
#ifndef UX_PORT_H
@@ -217,9 +204,6 @@ typedef LONG SLONG;
#define UX_SLAVE_REQUEST_DATA_MAX_LENGTH 4096
#endif
-#ifndef UX_HOST_CLASS_STORAGE_MAX_PARTITIONS_COUNT
-#define UX_HOST_CLASS_STORAGE_MAX_PARTITIONS_COUNT 8
-#endif
#ifndef UX_USE_IO_INSTRUCTIONS
@@ -249,17 +233,18 @@ VOID outpl(ULONG,ULONG);
/* Define interrupt lockout constructs to protect the memory allocation/release which could happen
under ISR in the device stack. */
-
+#ifdef TX_API_H
#define UX_INT_SAVE_AREA unsigned int old_interrupt_posture;
#define UX_DISABLE_INTS old_interrupt_posture = tx_interrupt_control(TX_INT_DISABLE);
#define UX_RESTORE_INTS tx_interrupt_control(old_interrupt_posture);
+#endif /* TX_API_H */
/* Define the version ID of USBX. This may be utilized by the application. */
#ifdef UX_SYSTEM_INIT
CHAR _ux_version_id[] =
- "Copyright (c) 2024 Microsoft Corporation. * USBX Cortex-R4/GNU Version 6.4.1 *";
+ "(c) 2024 Microsoft Corp. (c) 2026-present Eclipse ThreadX contributors. * USBX Cortex-R4/GNU Version 6.5.0.202601 *";
#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 ecefdd79..458b8fdb 100644
--- a/ports/cortex_r4/iar/inc/ux_port.h
+++ b/ports/cortex_r4/iar/inc/ux_port.h
@@ -1,5 +1,6 @@
/***************************************************************************
* Copyright (c) 2024 Microsoft Corporation
+ * Copyright (c) 2026-present Eclipse ThreadX contributors
*
* This program and the accompanying materials are made available under the
* terms of the MIT License which is available at
@@ -36,20 +37,6 @@
/* This file contains data type definitions that make USBX function */
/* identically on a variety of different processor architectures. */
/* */
-/* RELEASE HISTORY */
-/* */
-/* DATE NAME DESCRIPTION */
-/* */
-/* 09-30-2020 Chaoqiong Xiao Initial Version 6.1 */
-/* 01-31-2022 Chaoqiong Xiao Modified comment(s), */
-/* moved tx_api.h include and */
-/* typedefs from ux_api.h, */
-/* resulting in version 6.1.10 */
-/* 10-31-2023 Chaoqiong Xiao Modified comment(s), */
-/* added basic types guards, */
-/* improved SLONG typedef, */
-/* resulting in version 6.3.0 */
-/* */
/**************************************************************************/
#ifndef UX_PORT_H
@@ -217,10 +204,6 @@ typedef LONG SLONG;
#define UX_SLAVE_REQUEST_DATA_MAX_LENGTH 4096
#endif
-#ifndef UX_HOST_CLASS_STORAGE_MAX_PARTITIONS_COUNT
-#define UX_HOST_CLASS_STORAGE_MAX_PARTITIONS_COUNT 8
-#endif
-
#ifndef UX_USE_IO_INSTRUCTIONS
/* Don't use IO instructions if this define is not set. Default to memory mapped. */
@@ -253,17 +236,18 @@ VOID outpl(ULONG,ULONG);
/* Define interrupt lockout constructs to protect the memory allocation/release which could happen
under ISR in the device stack. */
-
+#ifdef TX_API_H
#define UX_INT_SAVE_AREA unsigned int old_interrupt_posture;
#define UX_DISABLE_INTS old_interrupt_posture = tx_interrupt_control(TX_INT_DISABLE);
#define UX_RESTORE_INTS tx_interrupt_control(old_interrupt_posture);
+#endif /* TX_API_H */
/* Define the version ID of USBX. This may be utilized by the application. */
#ifdef UX_SYSTEM_INIT
CHAR _ux_version_id[] =
- "Copyright (c) 2024 Microsoft Corporation. * USBX Cortex-R4/IAR Version 6.4.1 *";
+ "(c) 2024 Microsoft Corp. (c) 2026-present Eclipse ThreadX contributors. * USBX Cortex-R4/IAR Version 6.5.0.202601 *";
#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 b72baa3f..6ac4c670 100644
--- a/ports/cortex_r5/gnu/inc/ux_port.h
+++ b/ports/cortex_r5/gnu/inc/ux_port.h
@@ -1,5 +1,6 @@
/***************************************************************************
* Copyright (c) 2024 Microsoft Corporation
+ * Copyright (c) 2026-present Eclipse ThreadX contributors
*
* This program and the accompanying materials are made available under the
* terms of the MIT License which is available at
@@ -36,20 +37,6 @@
/* This file contains data type definitions that make USBX function */
/* identically on a variety of different processor architectures. */
/* */
-/* RELEASE HISTORY */
-/* */
-/* DATE NAME DESCRIPTION */
-/* */
-/* 09-30-2020 Chaoqiong Xiao Initial Version 6.1 */
-/* 01-31-2022 Chaoqiong Xiao Modified comment(s), */
-/* moved tx_api.h include and */
-/* typedefs from ux_api.h, */
-/* resulting in version 6.1.10 */
-/* 10-31-2023 Chaoqiong Xiao Modified comment(s), */
-/* added basic types guards, */
-/* improved SLONG typedef, */
-/* resulting in version 6.3.0 */
-/* */
/**************************************************************************/
#ifndef UX_PORT_H
@@ -217,10 +204,6 @@ typedef LONG SLONG;
#define UX_SLAVE_REQUEST_DATA_MAX_LENGTH 4096
#endif
-#ifndef UX_HOST_CLASS_STORAGE_MAX_PARTITIONS_COUNT
-#define UX_HOST_CLASS_STORAGE_MAX_PARTITIONS_COUNT 8
-#endif
-
#ifndef UX_USE_IO_INSTRUCTIONS
/* Don't use IO instructions if this define is not set. Default to memory mapped. */
@@ -253,17 +236,17 @@ VOID outpl(ULONG,ULONG);
/* Define interrupt lockout constructs to protect the memory allocation/release which could happen
under ISR in the device stack. */
-
+#ifdef TX_API_H
#define UX_INT_SAVE_AREA unsigned int old_interrupt_posture;
#define UX_DISABLE_INTS old_interrupt_posture = tx_interrupt_control(TX_INT_DISABLE);
#define UX_RESTORE_INTS tx_interrupt_control(old_interrupt_posture);
-
+#endif /* TX_API_H */
/* Define the version ID of USBX. This may be utilized by the application. */
#ifdef UX_SYSTEM_INIT
CHAR _ux_version_id[] =
- "Copyright (c) 2024 Microsoft Corporation. * USBX Cortex-R5/GNU Version 6.4.1 *";
+ "(c) 2024 Microsoft Corp. (c) 2026-present Eclipse ThreadX contributors. * USBX Cortex-R5/GNU Version 6.5.0.202601 *";
#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 42a50226..2b71cf97 100644
--- a/ports/cortex_r5/iar/inc/ux_port.h
+++ b/ports/cortex_r5/iar/inc/ux_port.h
@@ -1,5 +1,6 @@
/***************************************************************************
* Copyright (c) 2024 Microsoft Corporation
+ * Copyright (c) 2026-present Eclipse ThreadX contributors
*
* This program and the accompanying materials are made available under the
* terms of the MIT License which is available at
@@ -36,20 +37,6 @@
/* This file contains data type definitions that make USBX function */
/* identically on a variety of different processor architectures. */
/* */
-/* RELEASE HISTORY */
-/* */
-/* DATE NAME DESCRIPTION */
-/* */
-/* 09-30-2020 Chaoqiong Xiao Initial Version 6.1 */
-/* 01-31-2022 Chaoqiong Xiao Modified comment(s), */
-/* moved tx_api.h include and */
-/* typedefs from ux_api.h, */
-/* resulting in version 6.1.10 */
-/* 10-31-2023 Chaoqiong Xiao Modified comment(s), */
-/* added basic types guards, */
-/* improved SLONG typedef, */
-/* resulting in version 6.3.0 */
-/* */
/**************************************************************************/
#ifndef UX_PORT_H
@@ -217,10 +204,6 @@ typedef LONG SLONG;
#define UX_SLAVE_REQUEST_DATA_MAX_LENGTH 4096
#endif
-#ifndef UX_HOST_CLASS_STORAGE_MAX_PARTITIONS_COUNT
-#define UX_HOST_CLASS_STORAGE_MAX_PARTITIONS_COUNT 8
-#endif
-
#ifndef UX_USE_IO_INSTRUCTIONS
/* Don't use IO instructions if this define is not set. Default to memory mapped. */
@@ -254,16 +237,18 @@ VOID outpl(ULONG,ULONG);
/* Define interrupt lockout constructs to protect the memory allocation/release which could happen
under ISR in the device stack. */
+#ifdef TX_API_H
#define UX_INT_SAVE_AREA unsigned int old_interrupt_posture;
#define UX_DISABLE_INTS old_interrupt_posture = tx_interrupt_control(TX_INT_DISABLE);
#define UX_RESTORE_INTS tx_interrupt_control(old_interrupt_posture);
+#endif /* TX_API_H */
/* Define the version ID of USBX. This may be utilized by the application. */
#ifdef UX_SYSTEM_INIT
CHAR _ux_version_id[] =
- "Copyright (c) 2024 Microsoft Corporation. * USBX Cortex-R5/IAR Version 6.4.1 *";
+ "(c) 2024 Microsoft Corp. (c) 2026-present Eclipse ThreadX contributors. * USBX Cortex-R5/IAR Version 6.5.0.202601 *";
#else
extern CHAR _ux_version_id[];
#endif
diff --git a/ports/generic/inc/ux_port.h b/ports/generic/inc/ux_port.h
index c95dfcdd..cb271d23 100644
--- a/ports/generic/inc/ux_port.h
+++ b/ports/generic/inc/ux_port.h
@@ -1,5 +1,6 @@
/***************************************************************************
* Copyright (c) 2024 Microsoft Corporation
+ * Copyright (c) 2026-present Eclipse ThreadX contributors
*
* This program and the accompanying materials are made available under the
* terms of the MIT License which is available at
@@ -36,20 +37,6 @@
/* This file contains data type definitions that make USBX function */
/* identically on a variety of different processor architectures. */
/* */
-/* RELEASE HISTORY */
-/* */
-/* DATE NAME DESCRIPTION */
-/* */
-/* 12-31-2020 Chaoqiong Xiao Initial Version 6.1.3 */
-/* 01-31-2022 Chaoqiong Xiao Modified comment(s), */
-/* moved tx_api.h include and */
-/* typedefs from ux_api.h, */
-/* resulting in version 6.1.10 */
-/* 10-31-2023 Chaoqiong Xiao Modified comment(s), */
-/* added basic types guards, */
-/* improved SLONG typedef, */
-/* resulting in version 6.3.0 */
-/* */
/**************************************************************************/
#ifndef UX_PORT_H
@@ -250,17 +237,17 @@ VOID outpl(ULONG,ULONG);
/* Define interrupt lockout constructs to protect the memory allocation/release which could happen
under ISR in the device stack. */
-
+#ifdef TX_API_H
#define UX_INT_SAVE_AREA unsigned int old_interrupt_posture;
#define UX_DISABLE_INTS old_interrupt_posture = tx_interrupt_control(TX_INT_DISABLE);
#define UX_RESTORE_INTS tx_interrupt_control(old_interrupt_posture);
-
+#endif /* TX_API_H */
/* Define the version ID of USBX. This may be utilized by the application. */
#ifdef UX_SYSTEM_INIT
CHAR _ux_version_id[] =
- "Copyright (c) 2024 Microsoft Corporation. * USBX Generic Version 6.4.1 *";
+ "(c) 2024 Microsoft Corp. (c) 2026-present Eclipse ThreadX contributors. * USBX Generic Version 6.5.0.202601 *";
#else
extern CHAR _ux_version_id[];
#endif
diff --git a/ports/linux/gnu/inc/ux_port.h b/ports/linux/gnu/inc/ux_port.h
index a2405068..369b85b3 100644
--- a/ports/linux/gnu/inc/ux_port.h
+++ b/ports/linux/gnu/inc/ux_port.h
@@ -1,5 +1,6 @@
/***************************************************************************
* Copyright (c) 2024 Microsoft Corporation
+ * Copyright (c) 2026-present Eclipse ThreadX contributors
*
* This program and the accompanying materials are made available under the
* terms of the MIT License which is available at
@@ -36,20 +37,6 @@
/* This file contains data type definitions that make USBX function */
/* identically on a variety of different processor architectures. */
/* */
-/* RELEASE HISTORY */
-/* */
-/* DATE NAME DESCRIPTION */
-/* */
-/* 10-15-2021 Chaoqiong Xiao Initial Version 6.1.9 */
-/* 01-31-2022 Chaoqiong Xiao Modified comment(s), */
-/* moved tx_api.h include and */
-/* typedefs from ux_api.h, */
-/* resulting in version 6.1.10 */
-/* 10-31-2023 Chaoqiong Xiao Modified comment(s), */
-/* added basic types guards, */
-/* improved SLONG typedef, */
-/* resulting in version 6.3.0 */
-/* */
/**************************************************************************/
#ifndef UX_PORT_H
@@ -223,10 +210,6 @@ typedef LONG SLONG;
#define UX_SLAVE_REQUEST_DATA_MAX_LENGTH 4096
#endif
-#ifndef UX_HOST_CLASS_STORAGE_MAX_PARTITIONS_COUNT
-#define UX_HOST_CLASS_STORAGE_MAX_PARTITIONS_COUNT 8
-#endif
-
#ifndef UX_USE_IO_INSTRUCTIONS
/* Don't use IO instructions if this define is not set. Default to memory mapped. */
@@ -255,17 +238,18 @@ ULONG outpl(ULONG,ULONG);
/* Define interrupt lockout constructs to protect the memory allocation/release which could happen
under ISR in the device stack. */
-
+#ifdef TX_API_H
#define UX_INT_SAVE_AREA unsigned int old_interrupt_posture;
#define UX_DISABLE_INTS old_interrupt_posture = tx_interrupt_control(TX_INT_DISABLE);
#define UX_RESTORE_INTS tx_interrupt_control(old_interrupt_posture);
+#endif /* TX_API_H */
/* Define the version ID of USBX. This may be utilized by the application. */
#ifdef UX_SYSTEM_INIT
CHAR _ux_version_id[] =
- "Copyright (c) 2024 Microsoft Corporation. * USBX Linux/GNU Version 6.4.1 *";
+ "(c) 2024 Microsoft Corp. (c) 2026-present Eclipse ThreadX contributors. * USBX Linux/GNU Version 6.5.0.202601 *";
#else
extern CHAR _ux_version_id[];
#endif
diff --git a/ports/rxv1/gnu/CMakeLists.txt b/ports/rxv1/gnu/CMakeLists.txt
new file mode 100644
index 00000000..75c79531
--- /dev/null
+++ b/ports/rxv1/gnu/CMakeLists.txt
@@ -0,0 +1,9 @@
+target_sources(${PROJECT_NAME} PRIVATE
+ # {{BEGIN_TARGET_SOURCES}}
+
+ # {{END_TARGET_SOURCES}}
+)
+
+target_include_directories(${PROJECT_NAME} PUBLIC
+ ${CMAKE_CURRENT_LIST_DIR}/inc
+)
diff --git a/ports/rxv1/gnu/inc/ux_port.h b/ports/rxv1/gnu/inc/ux_port.h
new file mode 100644
index 00000000..a7de8c38
--- /dev/null
+++ b/ports/rxv1/gnu/inc/ux_port.h
@@ -0,0 +1,248 @@
+/***************************************************************************
+ * Copyright (c) 2024 Microsoft Corporation
+ * Copyright (c) 2026-present Eclipse ThreadX contributors
+ *
+ * This program and the accompanying materials are made available under the
+ * terms of the MIT License which is available at
+ * https://opensource.org/licenses/MIT.
+ *
+ * SPDX-License-Identifier: MIT
+ **************************************************************************/
+
+
+/**************************************************************************/
+/**************************************************************************/
+/** */
+/** USBX Component */
+/** */
+/** Port Specific */
+/** */
+/**************************************************************************/
+/**************************************************************************/
+
+
+/**************************************************************************/
+/* */
+/* PORT SPECIFIC C INFORMATION RELEASE */
+/* */
+/* ux_port.h RXv1/GNU */
+/* 6.3.0 */
+/* */
+/* AUTHOR */
+/* */
+/* Chaoqiong Xiao, Microsoft Corporation */
+/* */
+/* DESCRIPTION */
+/* */
+/* This file contains data type definitions that make USBX function */
+/* identically on a variety of different processor architectures. */
+/* */
+/**************************************************************************/
+
+#ifndef UX_PORT_H
+#define UX_PORT_H
+
+
+/* Determine if the optional USBX user define file should be used. */
+
+#ifdef UX_INCLUDE_USER_DEFINE_FILE
+
+
+/* Yes, include the user defines in ux_user.h. The defines in this file may
+ alternately be defined on the command line. */
+
+#include "ux_user.h"
+#endif
+
+
+/* Include library header files. */
+
+#include
+#include
+
+
+#if !defined(UX_STANDALONE)
+#include "tx_api.h"
+#else
+
+/* VAR types used in UX,
+ if TX still used, expects tx_api.h included before include this. */
+#if !defined(TX_API_H) && !defined(TX_PORT_H)
+
+#include
+
+#ifndef VOID
+#define VOID void
+typedef char CHAR;
+typedef unsigned char UCHAR;
+typedef int INT;
+typedef unsigned int UINT;
+typedef long LONG;
+typedef unsigned long ULONG;
+typedef short SHORT;
+typedef unsigned short USHORT;
+#endif
+
+#ifndef ULONG64_DEFINED
+typedef uint64_t ULONG64;
+#define ULONG64_DEFINED
+#endif
+
+#ifndef ALIGN_TYPE_DEFINED
+#define ALIGN_TYPE ULONG
+#define ALIGN_TYPE_DEFINED
+#endif
+
+#endif
+#endif
+
+
+/* CPU definition for X86 systems without preemptive timer function.
+ This will make USBX uses the controller for the timer. */
+
+#undef THREADX_X86_NO_PTIMER
+
+
+/* For X86 systems, the define #define UX_USE_IO_INSTRUCTIONS should be used. */
+
+
+/* Define additional generic USBX types. */
+
+#ifndef SLONG_DEFINED
+typedef LONG SLONG;
+#define SLONG_DEFINED
+#endif
+
+
+/* Generic USBX Project constants follow. */
+
+#ifndef UX_PERIODIC_RATE
+#define UX_PERIODIC_RATE 100
+#endif
+
+#ifndef UX_MAX_CLASS_DRIVER
+#define UX_MAX_CLASS_DRIVER 2
+#endif
+
+#ifndef UX_MAX_SLAVE_CLASS_DRIVER
+#define UX_MAX_SLAVE_CLASS_DRIVER 2
+#endif
+
+#ifndef UX_MAX_HCD
+#define UX_MAX_HCD 1
+#endif
+
+#ifndef UX_MAX_DEVICES
+#define UX_MAX_DEVICES 2
+#endif
+
+#ifndef UX_MAX_ED
+#define UX_MAX_ED 16
+#endif
+
+#ifndef UX_MAX_TD
+#define UX_MAX_TD 20
+#endif
+
+#ifndef UX_MAX_ISO_TD
+#define UX_MAX_ISO_TD 2
+#endif
+
+#ifndef UX_HOST_ENUM_THREAD_STACK_SIZE
+#define UX_HOST_ENUM_THREAD_STACK_SIZE (2*1024)
+#endif
+
+#ifndef UX_THREAD_STACK_SIZE
+#define UX_THREAD_STACK_SIZE (1*1024)
+#endif
+
+#ifndef UX_THREAD_PRIORITY_ENUM
+#define UX_THREAD_PRIORITY_ENUM 20
+#endif
+
+#ifndef UX_THREAD_PRIORITY_CLASS
+#define UX_THREAD_PRIORITY_CLASS 20
+#endif
+
+#ifndef UX_THREAD_PRIORITY_KEYBOARD
+#define UX_THREAD_PRIORITY_KEYBOARD 20
+#endif
+
+#ifndef UX_THREAD_PRIORITY_HCD
+#define UX_THREAD_PRIORITY_HCD 2
+#endif
+
+#ifndef UX_THREAD_PRIORITY_DCD
+#define UX_THREAD_PRIORITY_DCD 2
+#endif
+
+#ifndef UX_NO_TIME_SLICE
+#define UX_NO_TIME_SLICE 0
+#endif
+
+#ifndef UX_MAX_SLAVE_LUN
+#define UX_MAX_SLAVE_LUN 1
+#endif
+
+#ifndef UX_MAX_HOST_LUN
+#define UX_MAX_HOST_LUN 1
+#endif
+
+#ifndef UX_HOST_CLASS_STORAGE_MAX_MEDIA
+#define UX_HOST_CLASS_STORAGE_MAX_MEDIA 1
+#endif
+
+#ifndef UX_SLAVE_REQUEST_CONTROL_MAX_LENGTH
+#define UX_SLAVE_REQUEST_CONTROL_MAX_LENGTH 256
+#endif
+
+
+#ifndef UX_SLAVE_REQUEST_DATA_MAX_LENGTH
+#define UX_SLAVE_REQUEST_DATA_MAX_LENGTH 1024
+#endif
+
+#ifndef UX_USE_IO_INSTRUCTIONS
+
+/* Don't use IO instructions if this define is not set. Default to memory mapped. */
+
+#define inpb(a) *((UCHAR *) (a))
+#define inpw(a) *((USHORT *) (a))
+#define inpl(a) *((ULONG *) (a))
+#define outpb(a, b) *((UCHAR *) (a)) = ((UCHAR) (b))
+#define outpw(a, b) *((USHORT *) (a)) = ((USHORT) (b))
+#define outpl(a, b) *((ULONG *) (a)) = ((ULONG) (b))
+#else
+
+
+/* Define simple prototypes for non-memory mapped hardware access. */
+
+UCHAR inpb(ULONG);
+USHORT inpw(ULONG);
+ULONG inpl(ULONG);
+
+VOID outpb(ULONG,UCHAR);
+VOID outpw(ULONG,USHORT);
+VOID outpl(ULONG,ULONG);
+
+#endif
+
+
+/* Define interrupt lockout constructs to protect the memory allocation/release which could happen
+ under ISR in the device stack. */
+
+#define UX_INT_SAVE_AREA unsigned int old_interrupt_posture;
+#define UX_DISABLE_INTS old_interrupt_posture = tx_interrupt_control(TX_INT_DISABLE);
+#define UX_RESTORE_INTS tx_interrupt_control(old_interrupt_posture);
+
+
+/* Define the version ID of USBX. This may be utilized by the application. */
+
+#ifdef UX_SYSTEM_INIT
+CHAR _ux_version_id[] =
+ "(c) 2024 Microsoft Corp. (c) 2026-present Eclipse ThreadX contributors. * USBX RXv1/GNU Version 6.5.0.202601 *";
+#else
+extern CHAR _ux_version_id[];
+#endif
+
+#endif
+
diff --git a/ports/rxv2/gnu/CMakeLists.txt b/ports/rxv2/gnu/CMakeLists.txt
new file mode 100644
index 00000000..75c79531
--- /dev/null
+++ b/ports/rxv2/gnu/CMakeLists.txt
@@ -0,0 +1,9 @@
+target_sources(${PROJECT_NAME} PRIVATE
+ # {{BEGIN_TARGET_SOURCES}}
+
+ # {{END_TARGET_SOURCES}}
+)
+
+target_include_directories(${PROJECT_NAME} PUBLIC
+ ${CMAKE_CURRENT_LIST_DIR}/inc
+)
diff --git a/ports/rxv2/gnu/inc/ux_port.h b/ports/rxv2/gnu/inc/ux_port.h
new file mode 100644
index 00000000..7b069380
--- /dev/null
+++ b/ports/rxv2/gnu/inc/ux_port.h
@@ -0,0 +1,248 @@
+/***************************************************************************
+ * Copyright (c) 2024 Microsoft Corporation
+ * Copyright (c) 2026-present Eclipse ThreadX contributors
+ *
+ * This program and the accompanying materials are made available under the
+ * terms of the MIT License which is available at
+ * https://opensource.org/licenses/MIT.
+ *
+ * SPDX-License-Identifier: MIT
+ **************************************************************************/
+
+
+/**************************************************************************/
+/**************************************************************************/
+/** */
+/** USBX Component */
+/** */
+/** Port Specific */
+/** */
+/**************************************************************************/
+/**************************************************************************/
+
+
+/**************************************************************************/
+/* */
+/* PORT SPECIFIC C INFORMATION RELEASE */
+/* */
+/* ux_port.h RXv2/GNU */
+/* 6.3.0 */
+/* */
+/* AUTHOR */
+/* */
+/* Chaoqiong Xiao, Microsoft Corporation */
+/* */
+/* DESCRIPTION */
+/* */
+/* This file contains data type definitions that make USBX function */
+/* identically on a variety of different processor architectures. */
+/* */
+/**************************************************************************/
+
+#ifndef UX_PORT_H
+#define UX_PORT_H
+
+
+/* Determine if the optional USBX user define file should be used. */
+
+#ifdef UX_INCLUDE_USER_DEFINE_FILE
+
+
+/* Yes, include the user defines in ux_user.h. The defines in this file may
+ alternately be defined on the command line. */
+
+#include "ux_user.h"
+#endif
+
+
+/* Include library header files. */
+
+#include
+#include
+
+
+#if !defined(UX_STANDALONE)
+#include "tx_api.h"
+#else
+
+/* VAR types used in UX,
+ if TX still used, expects tx_api.h included before include this. */
+#if !defined(TX_API_H) && !defined(TX_PORT_H)
+
+#include
+
+#ifndef VOID
+#define VOID void
+typedef char CHAR;
+typedef unsigned char UCHAR;
+typedef int INT;
+typedef unsigned int UINT;
+typedef long LONG;
+typedef unsigned long ULONG;
+typedef short SHORT;
+typedef unsigned short USHORT;
+#endif
+
+#ifndef ULONG64_DEFINED
+typedef uint64_t ULONG64;
+#define ULONG64_DEFINED
+#endif
+
+#ifndef ALIGN_TYPE_DEFINED
+#define ALIGN_TYPE ULONG
+#define ALIGN_TYPE_DEFINED
+#endif
+
+#endif
+#endif
+
+
+/* CPU definition for X86 systems without preemptive timer function.
+ This will make USBX uses the controller for the timer. */
+
+#undef THREADX_X86_NO_PTIMER
+
+
+/* For X86 systems, the define #define UX_USE_IO_INSTRUCTIONS should be used. */
+
+
+/* Define additional generic USBX types. */
+
+#ifndef SLONG_DEFINED
+typedef LONG SLONG;
+#define SLONG_DEFINED
+#endif
+
+
+/* Generic USBX Project constants follow. */
+
+#ifndef UX_PERIODIC_RATE
+#define UX_PERIODIC_RATE 100
+#endif
+
+#ifndef UX_MAX_CLASS_DRIVER
+#define UX_MAX_CLASS_DRIVER 2
+#endif
+
+#ifndef UX_MAX_SLAVE_CLASS_DRIVER
+#define UX_MAX_SLAVE_CLASS_DRIVER 2
+#endif
+
+#ifndef UX_MAX_HCD
+#define UX_MAX_HCD 1
+#endif
+
+#ifndef UX_MAX_DEVICES
+#define UX_MAX_DEVICES 2
+#endif
+
+#ifndef UX_MAX_ED
+#define UX_MAX_ED 16
+#endif
+
+#ifndef UX_MAX_TD
+#define UX_MAX_TD 20
+#endif
+
+#ifndef UX_MAX_ISO_TD
+#define UX_MAX_ISO_TD 2
+#endif
+
+#ifndef UX_HOST_ENUM_THREAD_STACK_SIZE
+#define UX_HOST_ENUM_THREAD_STACK_SIZE (2*1024)
+#endif
+
+#ifndef UX_THREAD_STACK_SIZE
+#define UX_THREAD_STACK_SIZE (1*1024)
+#endif
+
+#ifndef UX_THREAD_PRIORITY_ENUM
+#define UX_THREAD_PRIORITY_ENUM 20
+#endif
+
+#ifndef UX_THREAD_PRIORITY_CLASS
+#define UX_THREAD_PRIORITY_CLASS 20
+#endif
+
+#ifndef UX_THREAD_PRIORITY_KEYBOARD
+#define UX_THREAD_PRIORITY_KEYBOARD 20
+#endif
+
+#ifndef UX_THREAD_PRIORITY_HCD
+#define UX_THREAD_PRIORITY_HCD 2
+#endif
+
+#ifndef UX_THREAD_PRIORITY_DCD
+#define UX_THREAD_PRIORITY_DCD 2
+#endif
+
+#ifndef UX_NO_TIME_SLICE
+#define UX_NO_TIME_SLICE 0
+#endif
+
+#ifndef UX_MAX_SLAVE_LUN
+#define UX_MAX_SLAVE_LUN 1
+#endif
+
+#ifndef UX_MAX_HOST_LUN
+#define UX_MAX_HOST_LUN 1
+#endif
+
+#ifndef UX_HOST_CLASS_STORAGE_MAX_MEDIA
+#define UX_HOST_CLASS_STORAGE_MAX_MEDIA 1
+#endif
+
+#ifndef UX_SLAVE_REQUEST_CONTROL_MAX_LENGTH
+#define UX_SLAVE_REQUEST_CONTROL_MAX_LENGTH 256
+#endif
+
+
+#ifndef UX_SLAVE_REQUEST_DATA_MAX_LENGTH
+#define UX_SLAVE_REQUEST_DATA_MAX_LENGTH 1024
+#endif
+
+#ifndef UX_USE_IO_INSTRUCTIONS
+
+/* Don't use IO instructions if this define is not set. Default to memory mapped. */
+
+#define inpb(a) *((UCHAR *) (a))
+#define inpw(a) *((USHORT *) (a))
+#define inpl(a) *((ULONG *) (a))
+#define outpb(a, b) *((UCHAR *) (a)) = ((UCHAR) (b))
+#define outpw(a, b) *((USHORT *) (a)) = ((USHORT) (b))
+#define outpl(a, b) *((ULONG *) (a)) = ((ULONG) (b))
+#else
+
+
+/* Define simple prototypes for non-memory mapped hardware access. */
+
+UCHAR inpb(ULONG);
+USHORT inpw(ULONG);
+ULONG inpl(ULONG);
+
+VOID outpb(ULONG,UCHAR);
+VOID outpw(ULONG,USHORT);
+VOID outpl(ULONG,ULONG);
+
+#endif
+
+
+/* Define interrupt lockout constructs to protect the memory allocation/release which could happen
+ under ISR in the device stack. */
+
+#define UX_INT_SAVE_AREA unsigned int old_interrupt_posture;
+#define UX_DISABLE_INTS old_interrupt_posture = tx_interrupt_control(TX_INT_DISABLE);
+#define UX_RESTORE_INTS tx_interrupt_control(old_interrupt_posture);
+
+
+/* Define the version ID of USBX. This may be utilized by the application. */
+
+#ifdef UX_SYSTEM_INIT
+CHAR _ux_version_id[] =
+ "(c) 2024 Microsoft Corp. (c) 2026-present Eclipse ThreadX contributors. * USBX RXv2/GNU Version 6.5.0.202601 *";
+#else
+extern CHAR _ux_version_id[];
+#endif
+
+#endif
+
diff --git a/ports/rxv3/gnu/CMakeLists.txt b/ports/rxv3/gnu/CMakeLists.txt
new file mode 100644
index 00000000..75c79531
--- /dev/null
+++ b/ports/rxv3/gnu/CMakeLists.txt
@@ -0,0 +1,9 @@
+target_sources(${PROJECT_NAME} PRIVATE
+ # {{BEGIN_TARGET_SOURCES}}
+
+ # {{END_TARGET_SOURCES}}
+)
+
+target_include_directories(${PROJECT_NAME} PUBLIC
+ ${CMAKE_CURRENT_LIST_DIR}/inc
+)
diff --git a/ports/rxv3/gnu/inc/ux_port.h b/ports/rxv3/gnu/inc/ux_port.h
new file mode 100644
index 00000000..9ec48848
--- /dev/null
+++ b/ports/rxv3/gnu/inc/ux_port.h
@@ -0,0 +1,248 @@
+/***************************************************************************
+ * Copyright (c) 2024 Microsoft Corporation
+ * Copyright (c) 2026-present Eclipse ThreadX contributors
+ *
+ * This program and the accompanying materials are made available under the
+ * terms of the MIT License which is available at
+ * https://opensource.org/licenses/MIT.
+ *
+ * SPDX-License-Identifier: MIT
+ **************************************************************************/
+
+
+/**************************************************************************/
+/**************************************************************************/
+/** */
+/** USBX Component */
+/** */
+/** Port Specific */
+/** */
+/**************************************************************************/
+/**************************************************************************/
+
+
+/**************************************************************************/
+/* */
+/* PORT SPECIFIC C INFORMATION RELEASE */
+/* */
+/* ux_port.h RXv3/GNU */
+/* 6.3.0 */
+/* */
+/* AUTHOR */
+/* */
+/* Chaoqiong Xiao, Microsoft Corporation */
+/* */
+/* DESCRIPTION */
+/* */
+/* This file contains data type definitions that make USBX function */
+/* identically on a variety of different processor architectures. */
+/* */
+/**************************************************************************/
+
+#ifndef UX_PORT_H
+#define UX_PORT_H
+
+
+/* Determine if the optional USBX user define file should be used. */
+
+#ifdef UX_INCLUDE_USER_DEFINE_FILE
+
+
+/* Yes, include the user defines in ux_user.h. The defines in this file may
+ alternately be defined on the command line. */
+
+#include "ux_user.h"
+#endif
+
+
+/* Include library header files. */
+
+#include
+#include
+
+
+#if !defined(UX_STANDALONE)
+#include "tx_api.h"
+#else
+
+/* VAR types used in UX,
+ if TX still used, expects tx_api.h included before include this. */
+#if !defined(TX_API_H) && !defined(TX_PORT_H)
+
+#include
+
+#ifndef VOID
+#define VOID void
+typedef char CHAR;
+typedef unsigned char UCHAR;
+typedef int INT;
+typedef unsigned int UINT;
+typedef long LONG;
+typedef unsigned long ULONG;
+typedef short SHORT;
+typedef unsigned short USHORT;
+#endif
+
+#ifndef ULONG64_DEFINED
+typedef uint64_t ULONG64;
+#define ULONG64_DEFINED
+#endif
+
+#ifndef ALIGN_TYPE_DEFINED
+#define ALIGN_TYPE ULONG
+#define ALIGN_TYPE_DEFINED
+#endif
+
+#endif
+#endif
+
+
+/* CPU definition for X86 systems without preemptive timer function.
+ This will make USBX uses the controller for the timer. */
+
+#undef THREADX_X86_NO_PTIMER
+
+
+/* For X86 systems, the define #define UX_USE_IO_INSTRUCTIONS should be used. */
+
+
+/* Define additional generic USBX types. */
+
+#ifndef SLONG_DEFINED
+typedef LONG SLONG;
+#define SLONG_DEFINED
+#endif
+
+
+/* Generic USBX Project constants follow. */
+
+#ifndef UX_PERIODIC_RATE
+#define UX_PERIODIC_RATE 100
+#endif
+
+#ifndef UX_MAX_CLASS_DRIVER
+#define UX_MAX_CLASS_DRIVER 2
+#endif
+
+#ifndef UX_MAX_SLAVE_CLASS_DRIVER
+#define UX_MAX_SLAVE_CLASS_DRIVER 2
+#endif
+
+#ifndef UX_MAX_HCD
+#define UX_MAX_HCD 1
+#endif
+
+#ifndef UX_MAX_DEVICES
+#define UX_MAX_DEVICES 2
+#endif
+
+#ifndef UX_MAX_ED
+#define UX_MAX_ED 16
+#endif
+
+#ifndef UX_MAX_TD
+#define UX_MAX_TD 20
+#endif
+
+#ifndef UX_MAX_ISO_TD
+#define UX_MAX_ISO_TD 2
+#endif
+
+#ifndef UX_HOST_ENUM_THREAD_STACK_SIZE
+#define UX_HOST_ENUM_THREAD_STACK_SIZE (2*1024)
+#endif
+
+#ifndef UX_THREAD_STACK_SIZE
+#define UX_THREAD_STACK_SIZE (1*1024)
+#endif
+
+#ifndef UX_THREAD_PRIORITY_ENUM
+#define UX_THREAD_PRIORITY_ENUM 20
+#endif
+
+#ifndef UX_THREAD_PRIORITY_CLASS
+#define UX_THREAD_PRIORITY_CLASS 20
+#endif
+
+#ifndef UX_THREAD_PRIORITY_KEYBOARD
+#define UX_THREAD_PRIORITY_KEYBOARD 20
+#endif
+
+#ifndef UX_THREAD_PRIORITY_HCD
+#define UX_THREAD_PRIORITY_HCD 2
+#endif
+
+#ifndef UX_THREAD_PRIORITY_DCD
+#define UX_THREAD_PRIORITY_DCD 2
+#endif
+
+#ifndef UX_NO_TIME_SLICE
+#define UX_NO_TIME_SLICE 0
+#endif
+
+#ifndef UX_MAX_SLAVE_LUN
+#define UX_MAX_SLAVE_LUN 1
+#endif
+
+#ifndef UX_MAX_HOST_LUN
+#define UX_MAX_HOST_LUN 1
+#endif
+
+#ifndef UX_HOST_CLASS_STORAGE_MAX_MEDIA
+#define UX_HOST_CLASS_STORAGE_MAX_MEDIA 1
+#endif
+
+#ifndef UX_SLAVE_REQUEST_CONTROL_MAX_LENGTH
+#define UX_SLAVE_REQUEST_CONTROL_MAX_LENGTH 256
+#endif
+
+
+#ifndef UX_SLAVE_REQUEST_DATA_MAX_LENGTH
+#define UX_SLAVE_REQUEST_DATA_MAX_LENGTH 1024
+#endif
+
+#ifndef UX_USE_IO_INSTRUCTIONS
+
+/* Don't use IO instructions if this define is not set. Default to memory mapped. */
+
+#define inpb(a) *((UCHAR *) (a))
+#define inpw(a) *((USHORT *) (a))
+#define inpl(a) *((ULONG *) (a))
+#define outpb(a, b) *((UCHAR *) (a)) = ((UCHAR) (b))
+#define outpw(a, b) *((USHORT *) (a)) = ((USHORT) (b))
+#define outpl(a, b) *((ULONG *) (a)) = ((ULONG) (b))
+#else
+
+
+/* Define simple prototypes for non-memory mapped hardware access. */
+
+UCHAR inpb(ULONG);
+USHORT inpw(ULONG);
+ULONG inpl(ULONG);
+
+VOID outpb(ULONG,UCHAR);
+VOID outpw(ULONG,USHORT);
+VOID outpl(ULONG,ULONG);
+
+#endif
+
+
+/* Define interrupt lockout constructs to protect the memory allocation/release which could happen
+ under ISR in the device stack. */
+
+#define UX_INT_SAVE_AREA unsigned int old_interrupt_posture;
+#define UX_DISABLE_INTS old_interrupt_posture = tx_interrupt_control(TX_INT_DISABLE);
+#define UX_RESTORE_INTS tx_interrupt_control(old_interrupt_posture);
+
+
+/* Define the version ID of USBX. This may be utilized by the application. */
+
+#ifdef UX_SYSTEM_INIT
+CHAR _ux_version_id[] =
+ "(c) 2024 Microsoft Corp. (c) 2026-present Eclipse ThreadX contributors. * USBX RXv3/GNU Version 6.5.0.202601 *";
+#else
+extern CHAR _ux_version_id[];
+#endif
+
+#endif
+
diff --git a/samples/demo_usbx.c b/samples/demo_usbx.c
index bc4e6e2c..9e73af42 100644
--- a/samples/demo_usbx.c
+++ b/samples/demo_usbx.c
@@ -34,16 +34,16 @@ UX_SLAVE_CLASS_DPUMP *dpump_device;
#define DEVICE_FRAMEWORK_LENGTH_FULL_SPEED 50
-UCHAR device_framework_full_speed[] = {
+UCHAR device_framework_full_speed[] = {
/* Device descriptor */
0x12, 0x01, 0x10, 0x01, 0x00, 0x00, 0x00, 0x08,
0xec, 0x08, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x01,
+ 0x00, 0x01,
/* Configuration descriptor */
0x09, 0x02, 0x20, 0x00, 0x01, 0x01, 0x00, 0xc0,
- 0x32,
+ 0x32,
/* Interface descriptor */
0x09, 0x04, 0x00, 0x00, 0x02, 0x99, 0x99, 0x99,
@@ -53,17 +53,17 @@ UCHAR device_framework_full_speed[] = {
0x07, 0x05, 0x01, 0x02, 0x40, 0x00, 0x00,
/* Endpoint descriptor (Bulk In) */
- 0x07, 0x05, 0x82, 0x02, 0x40, 0x00, 0x00
+ 0x07, 0x05, 0x82, 0x02, 0x40, 0x00, 0x00
};
-
-
+
+
#define DEVICE_FRAMEWORK_LENGTH_HIGH_SPEED 60
-UCHAR device_framework_high_speed[] = {
+UCHAR device_framework_high_speed[] = {
/* Device descriptor */
0x12, 0x01, 0x00, 0x02, 0x00, 0x00, 0x00, 0x40,
0x0a, 0x07, 0x25, 0x40, 0x01, 0x00, 0x01, 0x02,
- 0x03, 0x01,
+ 0x03, 0x01,
/* Device qualifier descriptor */
0x0a, 0x06, 0x00, 0x02, 0x00, 0x00, 0x00, 0x40,
@@ -71,7 +71,7 @@ UCHAR device_framework_high_speed[] = {
/* Configuration descriptor */
0x09, 0x02, 0x20, 0x00, 0x01, 0x01, 0x00, 0xc0,
- 0x32,
+ 0x32,
/* Interface descriptor */
0x09, 0x04, 0x00, 0x00, 0x02, 0x99, 0x99, 0x99,
@@ -81,30 +81,30 @@ UCHAR device_framework_high_speed[] = {
0x07, 0x05, 0x01, 0x02, 0x00, 0x02, 0x00,
/* Endpoint descriptor (Bulk In) */
- 0x07, 0x05, 0x82, 0x02, 0x00, 0x02, 0x00
+ 0x07, 0x05, 0x82, 0x02, 0x00, 0x02, 0x00
};
-
+
/* String Device Framework :
Byte 0 and 1 : Word containing the language ID : 0x0904 for US
Byte 2 : Byte containing the index of the descriptor
Byte 3 : Byte containing the length of the descriptor string
*/
-
+
#define STRING_FRAMEWORK_LENGTH 38
-UCHAR string_framework[] = {
+UCHAR string_framework[] = {
/* Manufacturer string descriptor : Index 1 */
- 0x09, 0x04, 0x01, 0x0c,
- 0x45, 0x78, 0x70, 0x72,0x65, 0x73, 0x20, 0x4c,
+ 0x09, 0x04, 0x01, 0x0c,
+ 0x45, 0x78, 0x70, 0x72,0x65, 0x73, 0x20, 0x4c,
0x6f, 0x67, 0x69, 0x63,
/* Product string descriptor : Index 2 */
- 0x09, 0x04, 0x02, 0x0c,
- 0x44, 0x61, 0x74, 0x61, 0x50, 0x75, 0x6d, 0x70,
- 0x44, 0x65, 0x6d, 0x6f,
+ 0x09, 0x04, 0x02, 0x0c,
+ 0x44, 0x61, 0x74, 0x61, 0x50, 0x75, 0x6d, 0x70,
+ 0x44, 0x65, 0x6d, 0x6f,
/* Serial Number string descriptor : Index 3 */
- 0x09, 0x04, 0x03, 0x04,
+ 0x09, 0x04, 0x03, 0x04,
0x30, 0x30, 0x30, 0x31
};
@@ -114,7 +114,7 @@ UCHAR string_framework[] = {
be appended to the language_id_framework array and the length
adjusted accordingly. */
#define LANGUAGE_ID_FRAMEWORK_LENGTH 2
-UCHAR language_id_framework[] = {
+UCHAR language_id_framework[] = {
/* English. */
0x09, 0x04
@@ -123,14 +123,14 @@ UCHAR language_id_framework[] = {
/* Define prototypes for external Host Controller's (HCDs), classes and clients. */
-VOID tx_demo_instance_activate(VOID *dpump_instance);
+VOID tx_demo_instance_activate(VOID *dpump_instance);
VOID tx_demo_instance_deactivate(VOID *dpump_instance);
UINT _ux_host_class_dpump_entry(UX_HOST_CLASS_COMMAND *command);
UINT ux_hcd_sim_initialize(UX_HCD *hcd);
-UINT _ux_host_class_dpump_write(UX_HOST_CLASS_DPUMP *dpump, UCHAR * data_pointer,
+UINT _ux_host_class_dpump_write(UX_HOST_CLASS_DPUMP *dpump, UCHAR * data_pointer,
ULONG requested_length, ULONG *actual_length);
-UINT _ux_host_class_dpump_read (UX_HOST_CLASS_DPUMP *dpump, UCHAR *data_pointer,
+UINT _ux_host_class_dpump_read (UX_HOST_CLASS_DPUMP *dpump, UCHAR *data_pointer,
ULONG requested_length, ULONG *actual_length);
TX_THREAD tx_demo_thread_host_simulation;
@@ -168,7 +168,7 @@ UX_SLAVE_CLASS_DPUMP_PARAMETER parameter;
/* Initialize the free memory pointer. */
stack_pointer = (CHAR *) ux_demo_memory_buffer;
memory_pointer = stack_pointer + (UX_DEMO_STACK_SIZE * 2);
-
+
/* Initialize USBX Memory. */
status = ux_system_initialize(memory_pointer, UX_DEMO_MEMORY_SIZE, UX_NULL, 0);
@@ -212,7 +212,7 @@ UX_SLAVE_CLASS_DPUMP_PARAMETER parameter;
parameter.ux_slave_class_dpump_instance_deactivate = tx_demo_instance_deactivate;
/* Initialize the device dpump class. The class is connected with interface 0 */
- status = _ux_device_stack_class_register(_ux_system_slave_class_dpump_name, _ux_device_class_dpump_entry,
+ status = _ux_device_stack_class_register(_ux_system_slave_class_dpump_name, _ux_device_class_dpump_entry,
1, 0, ¶meter);
/* Check for error. */
@@ -225,21 +225,21 @@ UX_SLAVE_CLASS_DPUMP_PARAMETER parameter;
/* Check for error. */
if (status != UX_SUCCESS)
error_handler();
-
+
/* Create the main host simulation thread. */
- status = tx_thread_create(&tx_demo_thread_host_simulation, "tx demo host simulation", tx_demo_thread_host_simulation_entry, 0,
- stack_pointer, UX_DEMO_STACK_SIZE,
+ status = tx_thread_create(&tx_demo_thread_host_simulation, "tx demo host simulation", tx_demo_thread_host_simulation_entry, 0,
+ stack_pointer, UX_DEMO_STACK_SIZE,
20, 20, 1, TX_AUTO_START);
/* Check for error. */
if (status != TX_SUCCESS)
error_handler();
-
+
/* Create the main demo thread. */
- status = tx_thread_create(&tx_demo_thread_device_simulation, "tx demo slave simulation", tx_demo_thread_device_simulation_entry, 0,
- stack_pointer + UX_DEMO_STACK_SIZE, UX_DEMO_STACK_SIZE,
+ status = tx_thread_create(&tx_demo_thread_device_simulation, "tx demo slave simulation", tx_demo_thread_device_simulation_entry, 0,
+ stack_pointer + UX_DEMO_STACK_SIZE, UX_DEMO_STACK_SIZE,
20, 20, 1, TX_AUTO_START);
-
+
/* Check for error. */
if (status != TX_SUCCESS)
error_handler();
@@ -279,9 +279,9 @@ UX_HOST_CLASS *class;
tx_thread_relinquish();
}
- /* At this point, the data pump class has been found. Now use the
- data pump to send and receive data between the host and device. */
-
+ /* At this point, the data pump class has been found. Now use the
+ data pump to send and receive data between the host and device. */
+
/* We start with a 'A' in buffer. */
current_char = 'A';
@@ -296,11 +296,11 @@ UX_HOST_CLASS *class;
/* Increment the character in buffer. */
current_char++;
-
+
/* Check for upper alphabet limit. */
- if (current_char > 'Z')
+ if (current_char > 'Z')
current_char = 'A';
-
+
/* Write to the host Data Pump Bulk out endpoint. */
status = _ux_host_class_dpump_write (dpump, host_out_buffer, UX_HOST_CLASS_DPUMP_PACKET_SIZE, &actual_length);
@@ -311,17 +311,17 @@ UX_HOST_CLASS *class;
/* Verify that the status and the amount of data is correct. */
if ((status != UX_SUCCESS) || actual_length != UX_HOST_CLASS_DPUMP_PACKET_SIZE)
return;
-
+
/* Read to the Data Pump Bulk out endpoint. */
status = _ux_host_class_dpump_read (dpump, host_in_buffer, UX_HOST_CLASS_DPUMP_PACKET_SIZE, &actual_length);
/* Verify that the status and the amount of data is correct. */
if ((status != UX_SUCCESS) || actual_length != UX_HOST_CLASS_DPUMP_PACKET_SIZE)
error_handler();
-
+
/* Relinquish to other thread. */
tx_thread_relinquish();
- }
+ }
}
@@ -345,14 +345,14 @@ ULONG actual_length;
thread_1_counter++;
/* Read from the device data pump. */
- status = _ux_device_class_dpump_read(dpump_device, device_buffer, UX_HOST_CLASS_DPUMP_PACKET_SIZE, &actual_length);
+ status = _ux_device_class_dpump_read(dpump_device, device_buffer, UX_HOST_CLASS_DPUMP_PACKET_SIZE, &actual_length);
/* Verify that the status and the amount of data is correct. */
if ((status != UX_SUCCESS) || actual_length != UX_HOST_CLASS_DPUMP_PACKET_SIZE)
error_handler();
/* Now write to the device data pump. */
- status = _ux_device_class_dpump_write(dpump_device, device_buffer, UX_HOST_CLASS_DPUMP_PACKET_SIZE, &actual_length);
+ status = _ux_device_class_dpump_write(dpump_device, device_buffer, UX_HOST_CLASS_DPUMP_PACKET_SIZE, &actual_length);
/* Verify that the status and the amount of data is correct. */
if ((status != UX_SUCCESS) || actual_length != UX_HOST_CLASS_DPUMP_PACKET_SIZE)
@@ -362,14 +362,14 @@ ULONG actual_length;
/* Relinquish to other thread. */
tx_thread_relinquish();
}
-}
+}
-VOID tx_demo_instance_activate(VOID *dpump_instance)
+VOID tx_demo_instance_activate(VOID *dpump_instance)
{
/* Save the DPUMP instance. */
dpump_device = (UX_SLAVE_CLASS_DPUMP *) dpump_instance;
-}
+}
VOID tx_demo_instance_deactivate(VOID *dpump_instance)
{
@@ -389,8 +389,8 @@ VOID error_handler(void)
while(1)
{
-
- /* Error - just spin here! Look at call tree in debugger
+
+ /* Error - just spin here! Look at call tree in debugger
to see where the error occurred. */
}
}
diff --git a/test/cmake/libs/nx_user.h b/test/cmake/libs/nx_user.h
index 5edea86a..3cca9406 100644
--- a/test/cmake/libs/nx_user.h
+++ b/test/cmake/libs/nx_user.h
@@ -1,10 +1,11 @@
/***************************************************************************
- * Copyright (c) 2024 Microsoft Corporation
- *
+ * Copyright (c) 2024 Microsoft Corporation
+ * Copyright (c) 2026-present Eclipse ThreadX contributors
+ *
* This program and the accompanying materials are made available under the
* terms of the MIT License which is available at
* https://opensource.org/licenses/MIT.
- *
+ *
* SPDX-License-Identifier: MIT
**************************************************************************/
@@ -39,12 +40,6 @@
/* Note that all the defines in this file may also be made on the */
/* command line when building NetX library and application objects. */
/* */
-/* RELEASE HISTORY */
-/* */
-/* DATE NAME DESCRIPTION */
-/* */
-/* 05-19-2020 Yuxin Zhou Initial Version 6.0 */
-/* */
/**************************************************************************/
#ifndef NX_USER_H
diff --git a/test/cmake/usbx/regression/CMakeLists.txt b/test/cmake/usbx/regression/CMakeLists.txt
index 8d29d436..729559c4 100644
--- a/test/cmake/usbx/regression/CMakeLists.txt
+++ b/test/cmake/usbx/regression/CMakeLists.txt
@@ -139,6 +139,7 @@ set(ux_class_hid_test_cases
${SOURCE_DIR}/usbx_ux_device_class_hid_activate_test2.c
${SOURCE_DIR}/usbx_ux_device_class_hid_activate_test3.c
${SOURCE_DIR}/usbx_ux_device_class_hid_control_request_test.c
+ ${SOURCE_DIR}/usbx_ux_device_class_hid_set_protocol_callback_test.c
${SOURCE_DIR}/usbx_ux_device_class_hid_initialize_test.c
${SOURCE_DIR}/usbx_ux_device_class_hid_interrupt_thread_test2.c
${SOURCE_DIR}/usbx_ux_device_class_hid_read_test.c
@@ -347,6 +348,7 @@ set(ux_class_storage_test_cases
${SOURCE_DIR}/usbx_ux_device_class_storage_read_test.c
${SOURCE_DIR}/usbx_ux_device_class_storage_request_sense_test.c
${SOURCE_DIR}/usbx_ux_device_class_storage_start_stop_test.c
+ ${SOURCE_DIR}/usbx_ux_device_class_storage_media_start_stop_test.c
${SOURCE_DIR}/usbx_ux_device_class_storage_synchronize_cache_test.c
${SOURCE_DIR}/usbx_ux_device_class_storage_test_ready_test.c
${SOURCE_DIR}/usbx_ux_device_class_storage_thread_test.c
diff --git a/test/cmake/usbx/ux_user.h b/test/cmake/usbx/ux_user.h
index 433b9dc0..091e51ad 100644
--- a/test/cmake/usbx/ux_user.h
+++ b/test/cmake/usbx/ux_user.h
@@ -1,17 +1,18 @@
/***************************************************************************
- * Copyright (c) 2024 Microsoft Corporation
- *
+ * Copyright (c) 2024 Microsoft Corporation
+ * Copyright (c) 2026-present Eclipse ThreadX contributors
+ *
* This program and the accompanying materials are made available under the
* terms of the MIT License which is available at
* https://opensource.org/licenses/MIT.
- *
+ *
* SPDX-License-Identifier: MIT
**************************************************************************/
/**************************************************************************/
/**************************************************************************/
-/** */
+/** */
/** USBX Component */
/** */
/** User Specific */
@@ -20,11 +21,11 @@
/**************************************************************************/
-/**************************************************************************/
-/* */
-/* PORT SPECIFIC C INFORMATION RELEASE */
-/* */
-/* ux_user.h PORTABLE C */
+/**************************************************************************/
+/* */
+/* PORT SPECIFIC C INFORMATION RELEASE */
+/* */
+/* ux_user.h PORTABLE C */
/* 6.x */
/* */
/* AUTHOR */
@@ -32,23 +33,12 @@
/* Chaoqiong Xiao, Microsoft Corporation */
/* */
/* DESCRIPTION */
-/* */
-/* This file contains user defines for configuring USBX in specific */
-/* ways. This file will have an effect only if the application and */
-/* USBX library are built with UX_INCLUDE_USER_DEFINE_FILE defined. */
-/* Note that all the defines in this file may also be made on the */
-/* command line when building USBX library and application objects. */
-/* */
-/* RELEASE HISTORY */
-/* */
-/* DATE NAME DESCRIPTION */
-/* */
-/* 05-19-2020 Chaoqiong Xiao Initial Version 6.0 */
-/* 09-30-2020 Chaoqiong Xiao Modified comment(s), */
-/* resulting in version 6.1 */
-/* xx-xx-xxxx Chaoqiong Xiao Modified comment(s), */
-/* added standalone supoort, */
-/* resulting in version 6.x */
+/* */
+/* This file contains user defines for configuring USBX in specific */
+/* ways. This file will have an effect only if the application and */
+/* USBX library are built with UX_INCLUDE_USER_DEFINE_FILE defined. */
+/* Note that all the defines in this file may also be made on the */
+/* command line when building USBX library and application objects. */
/* */
/**************************************************************************/
@@ -57,13 +47,13 @@
/* Define various build options for the USBX port. The application should either make changes
- here by commenting or un-commenting the conditional compilation defined OR supply the defines
+ here by commenting or un-commenting the conditional compilation defined OR supply the defines
though the compiler's equivalent of the -D option. */
/* #define UX_THREAD_STACK_SIZE (2 * 1024) */
/* Define USBX Host Enum Thread Stack Size. The default is to use UX_THREAD_STACK_SIZE */
-/*
-#define UX_HOST_ENUM_THREAD_STACK_SIZE UX_THREAD_STACK_SIZE
+/*
+#define UX_HOST_ENUM_THREAD_STACK_SIZE UX_THREAD_STACK_SIZE
*/
@@ -77,10 +67,10 @@
#define UX_HOST_HNP_POLLING_THREAD_STACK UX_THREAD_STACK_SIZE
*/
-/* Override various options with default values already assigned in ux_api.h or ux_port.h. Please
+/* Override various options with default values already assigned in ux_api.h or ux_port.h. Please
also refer to ux_port.h for descriptions on each of these options. */
-/* Defined, this value represents how many ticks per seconds for a specific hardware platform.
+/* Defined, this value represents how many ticks per seconds for a specific hardware platform.
The default is 1000 indicating 1 tick per millisecond. */
/* #define UX_PERIODIC_RATE 1000
@@ -94,7 +84,7 @@
/* Defined, this value is the maximum number of classes that can be loaded by USBX. This value
represents the class container and not the number of instances of a class. For instance, if a
particular implementation of USBX needs the hub class, the printer class, and the storage
- class, then the UX_MAX_CLASSES value can be set to 3 regardless of the number of devices
+ class, then the UX_MAX_CLASSES value can be set to 3 regardless of the number of devices
that belong to these classes. */
/* #define UX_MAX_CLASSES 3
@@ -112,9 +102,9 @@
/* #define UX_MAX_SLAVE_INTERFACES 16
*/
-/* Defined, this value represents the number of different host controllers available in the system.
- For USB 1.1 support, this value will usually be 1. For USB 2.0 support, this value can be more
- than 1. This value represents the number of concurrent host controllers running at the same time.
+/* Defined, this value represents the number of different host controllers available in the system.
+ For USB 1.1 support, this value will usually be 1. For USB 2.0 support, this value can be more
+ than 1. This value represents the number of concurrent host controllers running at the same time.
If for instance there are two instances of OHCI running, or one EHCI and one OHCI controller
running, the UX_MAX_HCD should be set to 2. */
@@ -123,8 +113,8 @@
/* Defined, this value represents the maximum number of devices that can be attached to the USB.
- Normally, the theoretical maximum number on a single USB is 127 devices. This value can be
- scaled down to conserve memory. Note that this value represents the total number of devices
+ Normally, the theoretical maximum number on a single USB is 127 devices. This value can be
+ scaled down to conserve memory. Note that this value represents the total number of devices
regardless of the number of USB buses in the system. */
/* #define UX_MAX_DEVICES 127
@@ -155,8 +145,8 @@
/* Defined, this value represents the maximum number of bytes that can be received or transmitted
- on any endpoint. This value cannot be less than the maximum packet size of any endpoint. The default
- is 4096 bytes but can be reduced in memory constraint environments. For cd-rom support in the storage
+ on any endpoint. This value cannot be less than the maximum packet size of any endpoint. The default
+ is 4096 bytes but can be reduced in memory constraint environments. For cd-rom support in the storage
class, this value cannot be less than 2048. */
/* #define UX_SLAVE_REQUEST_DATA_MAX_LENGTH (1024 * 2) */
@@ -175,7 +165,7 @@
/* Define USBX Mass Storage Thread Stack Size. The default is to use UX_THREAD_STACK_SIZE. */
-/* #define UX_HOST_CLASS_STORAGE_THREAD_STACK_SIZE UX_THREAD_STACK_SIZE
+/* #define UX_HOST_CLASS_STORAGE_THREAD_STACK_SIZE UX_THREAD_STACK_SIZE
*/
/* Defined, this value represents the maximum number of Ed, regular TDs and Isochronous TDs. These values
@@ -197,13 +187,13 @@
/* #define UX_HOST_CLASS_HID_DECOMPRESSION_BUFFER 4096 */
-/* Defined, this value represents the maximum number of HID usages for a HID device.
+/* Defined, this value represents the maximum number of HID usages for a HID device.
Default is 2048 but for simple HID devices like keyboard and mouse it can be reduced a lot. */
/* #define UX_HOST_CLASS_HID_USAGES 2048 */
-/* By default, each key in each HID report from the device is reported by ux_host_class_hid_keyboard_key_get
+/* By default, each key in each HID report from the device is reported by ux_host_class_hid_keyboard_key_get
(a HID report from the device is received whenever there is a change in a key state i.e. when a key is pressed
or released. The report contains every key that is down). There are limitations to this method such as not being
able to determine when a key has been released.
@@ -236,7 +226,7 @@
/* #define UX_HOST_CLASS_HID_KEYBOARD_EVENTS_KEY_CHANGES_MODE_REPORT_MODIFIER_KEYS */
-/* Defined, this value represents the maximum number of media for the host storage class.
+/* Defined, this value represents the maximum number of media for the host storage class.
Default is 8 but for memory contrained resource systems this can ne reduced to 1. */
#ifndef UX_HOST_CLASS_STORAGE_MAX_MEDIA
@@ -244,7 +234,7 @@
#endif
/* Defined, this value includes code to handle storage devices that use the CB
- or CBI protocol (such as floppy disks). It is off by default because these
+ or CBI protocol (such as floppy disks). It is off by default because these
protocols are obsolete, being superseded by the Bulk Only Transport (BOT) protocol
which virtually all modern storage devices use.
*/
@@ -288,8 +278,8 @@
/* #define UX_DEVICE_CLASS_HID_EVENT_BUFFER_LENGTH 64 */
-/* Defined, this value represents the the maximum number of HID events/reports
- that can be queued at once.
+/* Defined, this value represents the the maximum number of HID events/reports
+ that can be queued at once.
*/
/* #define UX_DEVICE_CLASS_HID_MAX_EVENTS_QUEUE 8 */
@@ -303,13 +293,13 @@
/* Defined, this value will include the OTG polling thread. OTG can only be active if both host/device are present.
*/
-#ifndef UX_HOST_SIDE_ONLY
-#ifndef UX_DEVICE_SIDE_ONLY
+#ifndef UX_HOST_SIDE_ONLY
+#ifndef UX_DEVICE_SIDE_ONLY
/* #define UX_OTG_SUPPORT */
-#endif
-#endif
+#endif
+#endif
/* Defined, this value represents the maximum size of single tansfers for the SCSI data phase.
*/
@@ -338,7 +328,7 @@ void ux_test_assert_hit(char* file, int line);
#include "usbh_hcs.h"
#include "usbh_stdreq.h"
#include "usbh_core.h"
-#endif
+#endif
-#endif
+#endif
diff --git a/test/regression/usbx_cdc_acm_device_dtr_rts_reset_on_disconnect_test.c b/test/regression/usbx_cdc_acm_device_dtr_rts_reset_on_disconnect_test.c
index 20ebbbe4..e31128e5 100644
--- a/test/regression/usbx_cdc_acm_device_dtr_rts_reset_on_disconnect_test.c
+++ b/test/regression/usbx_cdc_acm_device_dtr_rts_reset_on_disconnect_test.c
@@ -33,7 +33,7 @@ static TX_THREAD tx_demo_thread_slave_simulation;
static void tx_demo_thread_host_simulation_entry(ULONG);
static void tx_demo_thread_slave_simulation_entry(ULONG);
static void demo_thread_host_reception_callback(UX_HOST_CLASS_CDC_ACM *cdc_acm, UINT status, UCHAR *reception_buffer, ULONG reception_size);
-static VOID demo_cdc_instance_activate(VOID *cdc_instance);
+static VOID demo_cdc_instance_activate(VOID *cdc_instance);
static VOID demo_cdc_instance_deactivate(VOID *cdc_instance);
static UINT demo_usbx_simulator_cdc_acm_host_send_at_command(UCHAR *string, ULONG length);
static UINT tx_demo_thread_slave_simulation_response(UCHAR *string, ULONG length);
@@ -61,7 +61,7 @@ static ULONG error_counter;
/* Define device framework. */
-#define DEVICE_FRAMEWORK_LENGTH_FULL_SPEED 93
+#define DEVICE_FRAMEWORK_LENGTH_FULL_SPEED 93
#define DEVICE_FRAMEWORK_LENGTH_HIGH_SPEED 103
#define STRING_FRAMEWORK_LENGTH 47
#define LANGUAGE_ID_FRAMEWORK_LENGTH 2
@@ -72,173 +72,173 @@ static unsigned char device_framework_full_speed[] = {
0x02 bDeviceClass: CDC class code
0x00 bDeviceSubclass: CDC class sub code
0x00 bDeviceProtocol: CDC Device protocol
-
+
idVendor & idProduct - http://www.linux-usb.org/usb.ids
*/
- 0x12, 0x01, 0x10, 0x01,
- 0xEF, 0x02, 0x01,
- 0x08,
- 0x84, 0x84, 0x00, 0x00,
- 0x00, 0x01,
- 0x01, 0x02, 03,
- 0x01,
+ 0x12, 0x01, 0x10, 0x01,
+ 0xEF, 0x02, 0x01,
+ 0x08,
+ 0x84, 0x84, 0x00, 0x00,
+ 0x00, 0x01,
+ 0x01, 0x02, 03,
+ 0x01,
/* Configuration 1 descriptor 9 bytes */
- 0x09, 0x02, 0x4b, 0x00,
- 0x02, 0x01, 0x00,
- 0x40, 0x00,
+ 0x09, 0x02, 0x4b, 0x00,
+ 0x02, 0x01, 0x00,
+ 0x40, 0x00,
/* Interface association descriptor. 8 bytes. */
0x08, 0x0b, 0x00, 0x02, 0x02, 0x02, 0x00, 0x00,
/* Communication Class Interface Descriptor Requirement. 9 bytes. */
- 0x09, 0x04, 0x00,
- 0x00,
- 0x01,
- 0x02, 0x02, 0x01,
- 0x00,
+ 0x09, 0x04, 0x00,
+ 0x00,
+ 0x01,
+ 0x02, 0x02, 0x01,
+ 0x00,
/* Header Functional Descriptor 5 bytes */
- 0x05, 0x24, 0x00,
- 0x10, 0x01,
+ 0x05, 0x24, 0x00,
+ 0x10, 0x01,
/* ACM Functional Descriptor 4 bytes */
- 0x04, 0x24, 0x02,
- 0x0f,
+ 0x04, 0x24, 0x02,
+ 0x0f,
/* Union Functional Descriptor 5 bytes */
- 0x05, 0x24, 0x06,
+ 0x05, 0x24, 0x06,
0x00, /* Master interface */
0x01, /* Slave interface */
/* Call Management Functional Descriptor 5 bytes */
- 0x05, 0x24, 0x01,
- 0x03,
+ 0x05, 0x24, 0x01,
+ 0x03,
0x01, /* Data interface */
/* Endpoint 1 descriptor 7 bytes */
- 0x07, 0x05, 0x83,
- 0x03,
- 0x08, 0x00,
- 0xFF,
+ 0x07, 0x05, 0x83,
+ 0x03,
+ 0x08, 0x00,
+ 0xFF,
/* Data Class Interface Descriptor Requirement 9 bytes */
- 0x09, 0x04, 0x01,
- 0x00,
- 0x02,
- 0x0A, 0x00, 0x00,
- 0x00,
+ 0x09, 0x04, 0x01,
+ 0x00,
+ 0x02,
+ 0x0A, 0x00, 0x00,
+ 0x00,
/* First alternate setting Endpoint 1 descriptor 7 bytes*/
- 0x07, 0x05, 0x02,
- 0x02,
- 0x40, 0x00,
- 0x00,
+ 0x07, 0x05, 0x02,
+ 0x02,
+ 0x40, 0x00,
+ 0x00,
/* Endpoint 2 descriptor 7 bytes */
- 0x07, 0x05, 0x81,
- 0x02,
- 0x40, 0x00,
- 0x00,
+ 0x07, 0x05, 0x81,
+ 0x02,
+ 0x40, 0x00,
+ 0x00,
};
static unsigned char device_framework_high_speed[] = {
- /* Device descriptor
+ /* Device descriptor
0x02 bDeviceClass: CDC class code
0x00 bDeviceSubclass: CDC class sub code
0x00 bDeviceProtocol: CDC Device protocol
-
+
idVendor & idProduct - http://www.linux-usb.org/usb.ids
*/
- 0x12, 0x01, 0x00, 0x02,
- 0xEF, 0x02, 0x01,
- 0x40,
- 0x84, 0x84, 0x00, 0x00,
- 0x00, 0x01,
- 0x01, 0x02, 03,
- 0x01,
+ 0x12, 0x01, 0x00, 0x02,
+ 0xEF, 0x02, 0x01,
+ 0x40,
+ 0x84, 0x84, 0x00, 0x00,
+ 0x00, 0x01,
+ 0x01, 0x02, 03,
+ 0x01,
/* Device qualifier descriptor */
- 0x0a, 0x06, 0x00, 0x02,
- 0x02, 0x00, 0x00,
- 0x40,
- 0x01,
- 0x00,
+ 0x0a, 0x06, 0x00, 0x02,
+ 0x02, 0x00, 0x00,
+ 0x40,
+ 0x01,
+ 0x00,
/* Configuration 1 descriptor */
- 0x09, 0x02, 0x4b, 0x00,
- 0x02, 0x01, 0x00,
- 0x40, 0x00,
+ 0x09, 0x02, 0x4b, 0x00,
+ 0x02, 0x01, 0x00,
+ 0x40, 0x00,
/* Interface association descriptor. */
0x08, 0x0b, 0x00, 0x02, 0x02, 0x02, 0x00, 0x00,
/* Communication Class Interface Descriptor Requirement */
- 0x09, 0x04, 0x01,
- 0x00,
- 0x01,
- 0x02, 0x02, 0x01,
- 0x00,
+ 0x09, 0x04, 0x01,
+ 0x00,
+ 0x01,
+ 0x02, 0x02, 0x01,
+ 0x00,
/* Header Functional Descriptor */
- 0x05, 0x24, 0x00,
- 0x10, 0x01,
+ 0x05, 0x24, 0x00,
+ 0x10, 0x01,
/* ACM Functional Descriptor */
- 0x04, 0x24, 0x02,
- 0x0f,
+ 0x04, 0x24, 0x02,
+ 0x0f,
/* Union Functional Descriptor */
- 0x05, 0x24, 0x06,
- 0x00,
- 0x01,
+ 0x05, 0x24, 0x06,
+ 0x00,
+ 0x01,
/* Call Management Functional Descriptor */
- 0x05, 0x24, 0x01,
- 0x00,
- 0x01,
+ 0x05, 0x24, 0x01,
+ 0x00,
+ 0x01,
/* Endpoint 1 descriptor */
- 0x07, 0x05, 0x83,
- 0x03,
- 0x08, 0x00,
- 0xFF,
+ 0x07, 0x05, 0x83,
+ 0x03,
+ 0x08, 0x00,
+ 0xFF,
/* Data Class Interface Descriptor Requirement */
- 0x09, 0x04, 0x01,
- 0x00,
- 0x02,
- 0x0A, 0x00, 0x00,
- 0x00,
+ 0x09, 0x04, 0x01,
+ 0x00,
+ 0x02,
+ 0x0A, 0x00, 0x00,
+ 0x00,
/* First alternate setting Endpoint 1 descriptor */
- 0x07, 0x05, 0x02,
- 0x02,
- 0x40, 0x00,
- 0x00,
+ 0x07, 0x05, 0x02,
+ 0x02,
+ 0x40, 0x00,
+ 0x00,
/* Endpoint 2 descriptor */
- 0x07, 0x05, 0x81,
- 0x02,
- 0x40, 0x00,
- 0x00,
+ 0x07, 0x05, 0x81,
+ 0x02,
+ 0x40, 0x00,
+ 0x00,
};
static unsigned char string_framework[] = {
/* Manufacturer string descriptor : Index 1 - "Express Logic" */
- 0x09, 0x04, 0x01, 0x0c,
- 0x45, 0x78, 0x70, 0x72,0x65, 0x73, 0x20, 0x4c,
+ 0x09, 0x04, 0x01, 0x0c,
+ 0x45, 0x78, 0x70, 0x72,0x65, 0x73, 0x20, 0x4c,
0x6f, 0x67, 0x69, 0x63,
/* Product string descriptor : Index 2 - "EL Composite device" */
0x09, 0x04, 0x02, 0x13,
0x45, 0x4c, 0x20, 0x43, 0x6f, 0x6d, 0x70, 0x6f,
- 0x73, 0x69, 0x74, 0x65, 0x20, 0x64, 0x65, 0x76,
- 0x69, 0x63, 0x65,
+ 0x73, 0x69, 0x74, 0x65, 0x20, 0x64, 0x65, 0x76,
+ 0x69, 0x63, 0x65,
/* Serial Number string descriptor : Index 3 - "0001" */
0x09, 0x04, 0x03, 0x04,
@@ -276,7 +276,7 @@ static void test_isr(void)
/* For further expansion of interrupt-level testing. */
}
-
+
static UINT demo_class_cdc_acm_get(void)
{
@@ -292,7 +292,7 @@ UX_HOST_CLASS_CDC_ACM *cdc_acm_host;
return(status);
/* We get the first instance of the cdc_acm device */
- do
+ do
{
status = ux_host_stack_class_instance_get(class, 0, (void **) &cdc_acm_host);
@@ -305,17 +305,17 @@ UX_HOST_CLASS_CDC_ACM *cdc_acm_host;
/* Isolate both the control and data interfaces. */
if (cdc_acm_host -> ux_host_class_cdc_acm_interface -> ux_interface_descriptor.bInterfaceClass == UX_HOST_CLASS_CDC_DATA_CLASS)
- {
+ {
/* This is the data interface. */
cdc_acm_host_data = cdc_acm_host;
-
+
/* In that case, the second one should be the control interface. */
status = ux_host_stack_class_instance_get(class, 1, (void **) &cdc_acm_host);
/* Check error. */
if (status != UX_SUCCESS)
return(status);
-
+
/* Check for the control interfaces. */
if (cdc_acm_host -> ux_host_class_cdc_acm_interface -> ux_interface_descriptor.bInterfaceClass == UX_HOST_CLASS_CDC_CONTROL_CLASS)
{
@@ -324,7 +324,7 @@ UX_HOST_CLASS_CDC_ACM *cdc_acm_host;
cdc_acm_host_control = cdc_acm_host;
return(UX_SUCCESS);
-
+
}
}
else
@@ -342,30 +342,30 @@ UX_HOST_CLASS_CDC_ACM *cdc_acm_host;
/* Check error. */
if (status != UX_SUCCESS)
return(status);
-
+
/* Check for the data interface. */
if (cdc_acm_host -> ux_host_class_cdc_acm_interface -> ux_interface_descriptor.bInterfaceClass == UX_HOST_CLASS_CDC_DATA_CLASS)
{
/* This is the data interface. */
cdc_acm_host_data = cdc_acm_host;
-
+
return(UX_SUCCESS);
-
+
}
}
}
-
+
/* Return ERROR. */
return(UX_ERROR);
}
-static VOID demo_cdc_instance_activate(VOID *cdc_instance)
+static VOID demo_cdc_instance_activate(VOID *cdc_instance)
{
/* Save the CDC instance. */
cdc_acm_slave = (UX_SLAVE_CLASS_CDC_ACM *) cdc_instance;
-}
+}
static VOID demo_cdc_instance_deactivate(VOID *cdc_instance)
{
@@ -385,7 +385,7 @@ void usbx_cdc_acm_device_dtr_rts_reset_on_disconnect_test_application_define(
CHAR * stack_pointer;
CHAR * memory_pointer;
UINT status;
-
+
/* Initialize the free memory pointer */
stack_pointer = (CHAR *) usbx_memory;
memory_pointer = stack_pointer + (UX_DEMO_STACK_SIZE * 2);
@@ -409,7 +409,7 @@ UINT status;
printf("Running CDC ACM Basic Functionality Test............................ ERROR #2\n");
test_control_return(1);
}
-
+
/* Register CDC-ACM class. */
status = ux_host_stack_class_register(_ux_system_host_class_cdc_acm_name, ux_host_class_cdc_acm_entry);
if (status != UX_SUCCESS)
@@ -446,7 +446,7 @@ UINT status;
parameter.ux_slave_class_cdc_acm_instance_deactivate = demo_cdc_instance_deactivate;
/* Initialize the device cdc class. This class owns both interfaces starting with 0. */
- status = ux_device_stack_class_register(_ux_system_slave_class_cdc_acm_name, ux_device_class_cdc_acm_entry,
+ status = ux_device_stack_class_register(_ux_system_slave_class_cdc_acm_name, ux_device_class_cdc_acm_entry,
1,0, ¶meter);
if(status!=UX_SUCCESS)
@@ -466,12 +466,12 @@ UINT status;
printf("Running CDC ACM Basic Functionality Test............................ ERROR #7\n");
test_control_return(1);
}
-
+
/* Create the main host simulation thread. */
- status = tx_thread_create(&tx_demo_thread_host_simulation, "tx demo host simulation", tx_demo_thread_host_simulation_entry, 0,
- stack_pointer, UX_DEMO_STACK_SIZE,
+ status = tx_thread_create(&tx_demo_thread_host_simulation, "tx demo host simulation", tx_demo_thread_host_simulation_entry, 0,
+ stack_pointer, UX_DEMO_STACK_SIZE,
20, 20, 1, TX_AUTO_START);
-
+
/* Check for error. */
if (status != TX_SUCCESS)
{
diff --git a/test/regression/usbx_cdc_ecm_basic_ipv6_test.c b/test/regression/usbx_cdc_ecm_basic_ipv6_test.c
index 3f920ddd..9c7ea65e 100644
--- a/test/regression/usbx_cdc_ecm_basic_ipv6_test.c
+++ b/test/regression/usbx_cdc_ecm_basic_ipv6_test.c
@@ -253,8 +253,8 @@ static unsigned char language_id_framework[] = {
0x09, 0x04
};
-static DEVICE_INIT_DATA default_device_init_data = {
- .framework = default_device_framework,
+static DEVICE_INIT_DATA default_device_init_data = {
+ .framework = default_device_framework,
.framework_length = sizeof(default_device_framework),
.dont_register_hcd = 0,
.string_framework = default_string_framework,
@@ -375,9 +375,9 @@ static void ux_test_device_class_cdc_ecm_set_link_state(UX_SLAVE_CLASS_CDC_ECM *
/* Declare the link to be down. */
cdc_ecm_device -> ux_slave_class_cdc_ecm_link_state = new_link_state;
- /* We have a thread waiting for an event, we wake it up with a NETWORK NOTIFICATION CHANGE event.
+ /* We have a thread waiting for an event, we wake it up with a NETWORK NOTIFICATION CHANGE event.
In turn they will release the NetX resources used and suspend. */
- UX_TEST_CHECK_SUCCESS(_ux_utility_event_flags_set(&cdc_ecm_device -> ux_slave_class_cdc_ecm_event_flags_group, UX_DEVICE_CLASS_CDC_ECM_NETWORK_NOTIFICATION_EVENT, TX_OR));
+ UX_TEST_CHECK_SUCCESS(_ux_utility_event_flags_set(&cdc_ecm_device -> ux_slave_class_cdc_ecm_event_flags_group, UX_DEVICE_CLASS_CDC_ECM_NETWORK_NOTIFICATION_EVENT, TX_OR));
}
static void read_packet_tcp(NX_TCP_SOCKET *tcp_socket, ULONG num_reads, CHAR *name)
@@ -556,7 +556,7 @@ DEVICE_INIT_DATA *device_init_data;
UX_TEST_CHECK_SUCCESS(nx_packet_pool_create(&packet_pool_device, "NetX Device Packet Pool", PACKET_PAYLOAD, packet_pool_memory_device, PACKET_POOL_SIZE));
- UX_TEST_CHECK_SUCCESS(nx_ip_create(&nx_ip_device, "NetX Device Thread", DEVICE_IP_ADDRESS, 0xFF000000L, &packet_pool_device,
+ UX_TEST_CHECK_SUCCESS(nx_ip_create(&nx_ip_device, "NetX Device Thread", DEVICE_IP_ADDRESS, 0xFF000000L, &packet_pool_device,
_ux_network_driver_entry, ip_thread_stack_device, DEMO_IP_THREAD_STACK_SIZE, 1));
@@ -670,7 +670,7 @@ static void post_init_host()
UINT status;
NX_PACKET *my_packet;
ULONG value;
-
+
/* Print out test information banner. */
printf("\nNetX Test: IPv6 Raw Packet Test......................................");
@@ -683,7 +683,7 @@ ULONG value;
test_control_return(1);
}
- UX_TEST_CHECK_SUCCESS(nx_packet_release(my_packet));
+ UX_TEST_CHECK_SUCCESS(nx_packet_release(my_packet));
/* Wait for device to finish. */
UX_TEST_CHECK_SUCCESS(ux_test_wait_for_value_uchar(&device_is_finished, UX_TRUE));
@@ -717,7 +717,7 @@ ULONG value;
/* Send the raw IP packet. */
UX_TEST_CHECK_SUCCESS(nxd_ip_raw_packet_send(&nx_ip_device, my_packet, &ipv6_addr_host, NX_IP_RAW >> 16, 0x80, NX_IP_NORMAL));
-
+
device_is_finished = UX_TRUE;
}
diff --git a/test/regression/usbx_cdc_ecm_control_interface_no_interrupt_endpoint_test.c b/test/regression/usbx_cdc_ecm_control_interface_no_interrupt_endpoint_test.c
index ef2d87fc..44a53ecf 100644
--- a/test/regression/usbx_cdc_ecm_control_interface_no_interrupt_endpoint_test.c
+++ b/test/regression/usbx_cdc_ecm_control_interface_no_interrupt_endpoint_test.c
@@ -134,8 +134,8 @@ static unsigned char no_interrupt_endpoint_configuration_descriptor[] = {
};
static DEVICE_INIT_DATA device_init_data = {
- .framework = no_interrupt_endpoint_configuration_descriptor,
- .framework_length = sizeof(no_interrupt_endpoint_configuration_descriptor),
+ .framework = no_interrupt_endpoint_configuration_descriptor,
+ .framework_length = sizeof(no_interrupt_endpoint_configuration_descriptor),
.dont_register_hcd = 1,
};
diff --git a/test/regression/usbx_cdc_ecm_data_iface_non_bulko_and_non_bulki_endpt_test.c b/test/regression/usbx_cdc_ecm_data_iface_non_bulko_and_non_bulki_endpt_test.c
index ac2cf237..d973c22f 100644
--- a/test/regression/usbx_cdc_ecm_data_iface_non_bulko_and_non_bulki_endpt_test.c
+++ b/test/regression/usbx_cdc_ecm_data_iface_non_bulko_and_non_bulki_endpt_test.c
@@ -141,8 +141,8 @@ static unsigned char non_bulk_out_endpoint[] = {
};
static DEVICE_INIT_DATA device_init_data = {
- .framework = non_bulk_out_endpoint,
- .framework_length = sizeof(non_bulk_out_endpoint),
+ .framework = non_bulk_out_endpoint,
+ .framework_length = sizeof(non_bulk_out_endpoint),
.dont_register_hcd = 1,
};
diff --git a/test/regression/usbx_cdc_ecm_data_interface_no_bulk_in_endpoint_test.c b/test/regression/usbx_cdc_ecm_data_interface_no_bulk_in_endpoint_test.c
index 94082fcd..308f0d30 100644
--- a/test/regression/usbx_cdc_ecm_data_interface_no_bulk_in_endpoint_test.c
+++ b/test/regression/usbx_cdc_ecm_data_interface_no_bulk_in_endpoint_test.c
@@ -1,6 +1,6 @@
/* This tests the case where there is no bulk in endpoint in the CDC-ECM data
interface. Host should report an error.
-
+
Unfortunately, the device fails during activation if we use the 'no bulk-in
endpoint' descriptor, so we have the device use a correct descriptor, then
force the host to receive the invalid descriptor when it sends the GetDescriptor
@@ -115,8 +115,8 @@ static unsigned char no_bulk_in_endpoint_framework[] = {
};
static DEVICE_INIT_DATA device_init_data = {
- .framework = default_device_framework,
- .framework_length = sizeof(default_device_framework),
+ .framework = default_device_framework,
+ .framework_length = sizeof(default_device_framework),
.dont_register_hcd = 1,
};
diff --git a/test/regression/usbx_cdc_ecm_data_interface_no_bulk_out_endpoint_test.c b/test/regression/usbx_cdc_ecm_data_interface_no_bulk_out_endpoint_test.c
index 62e44475..e6a06627 100644
--- a/test/regression/usbx_cdc_ecm_data_interface_no_bulk_out_endpoint_test.c
+++ b/test/regression/usbx_cdc_ecm_data_interface_no_bulk_out_endpoint_test.c
@@ -1,6 +1,6 @@
/* This tests the case where there is no bulk out endpoint in the CDC-ECM data
interface. Host should report an error.
-
+
Unfortunately, the device fails during activation if we use the 'no bulk-out
endpoint' descriptor, so we have the device use a correct descriptor, then
force the host to receive the invalid descriptor when it sends the GetDescriptor
@@ -115,8 +115,8 @@ static unsigned char no_bulk_out_endpoint_framework[] = {
};
static DEVICE_INIT_DATA device_init_data = {
- .framework = default_device_framework,
- .framework_length = sizeof(default_device_framework),
+ .framework = default_device_framework,
+ .framework_length = sizeof(default_device_framework),
.dont_register_hcd = 1,
};
diff --git a/test/regression/usbx_cdc_ecm_default_data_interface_setting_with_endpoints_test.c b/test/regression/usbx_cdc_ecm_default_data_interface_setting_with_endpoints_test.c
index 2c2edea1..71369764 100644
--- a/test/regression/usbx_cdc_ecm_default_data_interface_setting_with_endpoints_test.c
+++ b/test/regression/usbx_cdc_ecm_default_data_interface_setting_with_endpoints_test.c
@@ -1,4 +1,4 @@
-/* This tests the case where the default data interface has endpoints - note that
+/* This tests the case where the default data interface has endpoints - note that
this is a violation of the specification since according to it, the default
data interface should have 0 endpoints, however, our host supports it since
so many devices violate the spec! */
@@ -114,9 +114,9 @@ static unsigned char device_framework_high_speed_default_data_interface_with_end
};
-static DEVICE_INIT_DATA device_init_data = {
- .framework = device_framework_high_speed_default_data_interface_with_endpoints,
- .framework_length = sizeof(device_framework_high_speed_default_data_interface_with_endpoints),
+static DEVICE_INIT_DATA device_init_data = {
+ .framework = device_framework_high_speed_default_data_interface_with_endpoints,
+ .framework_length = sizeof(device_framework_high_speed_default_data_interface_with_endpoints),
.dont_register_hcd = 0,
};
diff --git a/test/regression/usbx_cdc_ecm_host_bulk_in_semaphore_create_fail_test.c b/test/regression/usbx_cdc_ecm_host_bulk_in_semaphore_create_fail_test.c
index e5f2ff60..1b325313 100644
--- a/test/regression/usbx_cdc_ecm_host_bulk_in_semaphore_create_fail_test.c
+++ b/test/regression/usbx_cdc_ecm_host_bulk_in_semaphore_create_fail_test.c
@@ -4,8 +4,8 @@
#include "usbx_ux_test_cdc_ecm.h"
static DEVICE_INIT_DATA device_init_data = {
- .framework = default_device_framework,
- .framework_length = sizeof(default_device_framework),
+ .framework = default_device_framework,
+ .framework_length = sizeof(default_device_framework),
.dont_register_hcd = 1,
};
diff --git a/test/regression/usbx_cdc_ecm_host_bulk_in_transfer_arming_during_deactivate_test.c b/test/regression/usbx_cdc_ecm_host_bulk_in_transfer_arming_during_deactivate_test.c
index 43bfb79b..8e6bce3f 100644
--- a/test/regression/usbx_cdc_ecm_host_bulk_in_transfer_arming_during_deactivate_test.c
+++ b/test/regression/usbx_cdc_ecm_host_bulk_in_transfer_arming_during_deactivate_test.c
@@ -1,6 +1,6 @@
/* This tests the case where there is an ongoing transfer on the bulk in endpoint
- during deactivation. The deactivate routine should wait for it to finish.
-
+ during deactivation. The deactivate routine should wait for it to finish.
+
We do this by having the CDC-ECM thread suspend during the transfer arm,
and then begin deactivation. We resume the CDC-ECM thread later! */
diff --git a/test/regression/usbx_cdc_ecm_host_bulk_in_transfer_arming_during_link_down_test.c b/test/regression/usbx_cdc_ecm_host_bulk_in_transfer_arming_during_link_down_test.c
index a74824c1..223d709b 100644
--- a/test/regression/usbx_cdc_ecm_host_bulk_in_transfer_arming_during_link_down_test.c
+++ b/test/regression/usbx_cdc_ecm_host_bulk_in_transfer_arming_during_link_down_test.c
@@ -1,6 +1,6 @@
/* This tests the case where there is an ongoing transfer on the bulk in endpoint
- during link down. The interrupt notification function should wait for it to finish.
-
+ during link down. The interrupt notification function should wait for it to finish.
+
We do this by having the CDC-ECM thread suspend during the transfer arm,
and then begin link down event. We resume the HCD thread later! */
diff --git a/test/regression/usbx_cdc_ecm_host_bulk_out_semaphore_create_fail_test.c b/test/regression/usbx_cdc_ecm_host_bulk_out_semaphore_create_fail_test.c
index f3797455..6d9d0b69 100644
--- a/test/regression/usbx_cdc_ecm_host_bulk_out_semaphore_create_fail_test.c
+++ b/test/regression/usbx_cdc_ecm_host_bulk_out_semaphore_create_fail_test.c
@@ -4,8 +4,8 @@
#include "usbx_ux_test_cdc_ecm.h"
static DEVICE_INIT_DATA device_init_data = {
- .framework = default_device_framework,
- .framework_length = sizeof(default_device_framework),
+ .framework = default_device_framework,
+ .framework_length = sizeof(default_device_framework),
.dont_register_hcd = 1,
};
diff --git a/test/regression/usbx_cdc_ecm_host_bulko_transfer_arming_during_link_dn_test.c b/test/regression/usbx_cdc_ecm_host_bulko_transfer_arming_during_link_dn_test.c
index 9d80ff7c..0ab4c067 100644
--- a/test/regression/usbx_cdc_ecm_host_bulko_transfer_arming_during_link_dn_test.c
+++ b/test/regression/usbx_cdc_ecm_host_bulko_transfer_arming_during_link_dn_test.c
@@ -1,6 +1,6 @@
/* This tests the case where there is an ongoing transfer on the bulk out endpoint
- during link down. The interrupt notification function should wait for it to finish.
-
+ during link down. The interrupt notification function should wait for it to finish.
+
We do this by having the CDC-ECM thread suspend during the transfer arm,
and then begin link down event. We resume the HCD thread later! */
diff --git a/test/regression/usbx_cdc_ecm_host_first_interrupt_transfer_fail_test.c b/test/regression/usbx_cdc_ecm_host_first_interrupt_transfer_fail_test.c
index f540bae2..9b35635e 100644
--- a/test/regression/usbx_cdc_ecm_host_first_interrupt_transfer_fail_test.c
+++ b/test/regression/usbx_cdc_ecm_host_first_interrupt_transfer_fail_test.c
@@ -3,8 +3,8 @@
#include "usbx_ux_test_cdc_ecm.h"
static DEVICE_INIT_DATA device_init_data = {
- .framework = default_device_framework,
- .framework_length = sizeof(default_device_framework),
+ .framework = default_device_framework,
+ .framework_length = sizeof(default_device_framework),
.dont_register_hcd = 1,
};
diff --git a/test/regression/usbx_cdc_ecm_host_int_notification_semaphore_create_fail_test.c b/test/regression/usbx_cdc_ecm_host_int_notification_semaphore_create_fail_test.c
index 38db9a60..c2fc73c2 100644
--- a/test/regression/usbx_cdc_ecm_host_int_notification_semaphore_create_fail_test.c
+++ b/test/regression/usbx_cdc_ecm_host_int_notification_semaphore_create_fail_test.c
@@ -3,8 +3,8 @@
#include "usbx_ux_test_cdc_ecm.h"
static DEVICE_INIT_DATA device_init_data = {
- .framework = default_device_framework,
- .framework_length = sizeof(default_device_framework),
+ .framework = default_device_framework,
+ .framework_length = sizeof(default_device_framework),
.dont_register_hcd = 1,
};
diff --git a/test/regression/usbx_cdc_ecm_host_packet_pool_create_fail_test.c b/test/regression/usbx_cdc_ecm_host_packet_pool_create_fail_test.c
index 3a23314b..c48c4b17 100644
--- a/test/regression/usbx_cdc_ecm_host_packet_pool_create_fail_test.c
+++ b/test/regression/usbx_cdc_ecm_host_packet_pool_create_fail_test.c
@@ -3,8 +3,8 @@
#include "usbx_ux_test_cdc_ecm.h"
static DEVICE_INIT_DATA device_init_data = {
- .framework = default_device_framework,
- .framework_length = sizeof(default_device_framework),
+ .framework = default_device_framework,
+ .framework_length = sizeof(default_device_framework),
.dont_register_hcd = 1,
};
diff --git a/test/regression/usbx_cdc_ecm_host_thread_create_fail_test.c b/test/regression/usbx_cdc_ecm_host_thread_create_fail_test.c
index fb993a2d..39a268cd 100644
--- a/test/regression/usbx_cdc_ecm_host_thread_create_fail_test.c
+++ b/test/regression/usbx_cdc_ecm_host_thread_create_fail_test.c
@@ -3,8 +3,8 @@
#include "usbx_ux_test_cdc_ecm.h"
static DEVICE_INIT_DATA device_init_data = {
- .framework = default_device_framework,
- .framework_length = sizeof(default_device_framework),
+ .framework = default_device_framework,
+ .framework_length = sizeof(default_device_framework),
.dont_register_hcd = 1,
};
diff --git a/test/regression/usbx_cdc_ecm_invalid_alt_setting_after_zero_endpt_data_iface_test.c b/test/regression/usbx_cdc_ecm_invalid_alt_setting_after_zero_endpt_data_iface_test.c
index 791efb18..3598df8a 100644
--- a/test/regression/usbx_cdc_ecm_invalid_alt_setting_after_zero_endpt_data_iface_test.c
+++ b/test/regression/usbx_cdc_ecm_invalid_alt_setting_after_zero_endpt_data_iface_test.c
@@ -126,8 +126,8 @@ static unsigned char non_data_interface_after_zero_endpoint_data_interface_frame
};
static DEVICE_INIT_DATA device_init_data = {
- .framework = non_data_interface_after_zero_endpoint_data_interface_framework,
- .framework_length = sizeof(non_data_interface_after_zero_endpoint_data_interface_framework),
+ .framework = non_data_interface_after_zero_endpoint_data_interface_framework,
+ .framework_length = sizeof(non_data_interface_after_zero_endpoint_data_interface_framework),
.dont_register_hcd = 1,
};
diff --git a/test/regression/usbx_cdc_ecm_link_down_while_ongoing_transfers_test.c b/test/regression/usbx_cdc_ecm_link_down_while_ongoing_transfers_test.c
index 9aec09e0..90f6da7b 100644
--- a/test/regression/usbx_cdc_ecm_link_down_while_ongoing_transfers_test.c
+++ b/test/regression/usbx_cdc_ecm_link_down_while_ongoing_transfers_test.c
@@ -138,7 +138,7 @@ UINT num_writes = 0;
process the link down while we're still writing packets. This
should be improved in the future. I don't want to be the poor
SOB that has to do it!
-
+
We cheat here by calling a device API from the host. */
ux_test_device_class_cdc_ecm_set_link_state(cdc_ecm_device, UX_DEVICE_CLASS_CDC_ECM_LINK_STATE_DOWN);
diff --git a/test/regression/usbx_cdc_ecm_mac_address_invalid_length_test.c b/test/regression/usbx_cdc_ecm_mac_address_invalid_length_test.c
index 1b2f14d1..e92737b7 100644
--- a/test/regression/usbx_cdc_ecm_mac_address_invalid_length_test.c
+++ b/test/regression/usbx_cdc_ecm_mac_address_invalid_length_test.c
@@ -20,7 +20,7 @@ static unsigned char invalid_mac_address_string_length[] = {
0x30, 0x30, 0x30, 0x31,
/* MAC Address string descriptor : Index 4 - "001E5841B878" */
- 0x09, 0x04, 0x04,
+ 0x09, 0x04, 0x04,
0x1b, /* This byte is the length of the string. It just needs to be greater than 26 (look in mac_address_get.c). */
0x30, 0x30, 0x31, 0x45, 0x35, 0x38,
0x34, 0x31, 0x42, 0x38, 0x37, 0x38,
diff --git a/test/regression/usbx_cdc_ecm_mac_address_test.c b/test/regression/usbx_cdc_ecm_mac_address_test.c
index a2746ec4..6b38abd9 100644
--- a/test/regression/usbx_cdc_ecm_mac_address_test.c
+++ b/test/regression/usbx_cdc_ecm_mac_address_test.c
@@ -21,11 +21,11 @@ static unsigned char mac_address_test_string_framework[] = {
/* MAC Address string descriptor : Index 4 - "001E5841B878" */
0x09, 0x04, 0x04, 0x0C,
'A', 'A', /* Test capital upper and lower element. */
- '0', '1',
- '2', '3',
- '4', 'b',
- 'c', 'D',
- 'e', 'f',
+ '0', '1',
+ '2', '3',
+ '4', 'b',
+ 'c', 'D',
+ 'e', 'f',
};
diff --git a/test/regression/usbx_cdc_ecm_no_functional_descriptor_test.c b/test/regression/usbx_cdc_ecm_no_functional_descriptor_test.c
index 3e394d64..4ef59bc8 100644
--- a/test/regression/usbx_cdc_ecm_no_functional_descriptor_test.c
+++ b/test/regression/usbx_cdc_ecm_no_functional_descriptor_test.c
@@ -114,8 +114,8 @@ static unsigned char no_function_descriptor_framework[] = {
};
static DEVICE_INIT_DATA device_init_data = {
- .framework = no_function_descriptor_framework,
- .framework_length = sizeof(no_function_descriptor_framework),
+ .framework = no_function_descriptor_framework,
+ .framework_length = sizeof(no_function_descriptor_framework),
.dont_register_hcd = 1,
};
diff --git a/test/regression/usbx_cdc_ecm_non_data_iface_after_zero_endpt_data_iface_test.c b/test/regression/usbx_cdc_ecm_non_data_iface_after_zero_endpt_data_iface_test.c
index 177a2b0b..e84df6a8 100644
--- a/test/regression/usbx_cdc_ecm_non_data_iface_after_zero_endpt_data_iface_test.c
+++ b/test/regression/usbx_cdc_ecm_non_data_iface_after_zero_endpt_data_iface_test.c
@@ -132,8 +132,8 @@ static unsigned char non_data_interface_after_zero_endpoint_data_interface_frame
};
static DEVICE_INIT_DATA device_init_data = {
- .framework = non_data_interface_after_zero_endpoint_data_interface_framework,
- .framework_length = sizeof(non_data_interface_after_zero_endpoint_data_interface_framework),
+ .framework = non_data_interface_after_zero_endpoint_data_interface_framework,
+ .framework_length = sizeof(non_data_interface_after_zero_endpoint_data_interface_framework),
.dont_register_hcd = 1,
};
diff --git a/test/regression/usbx_cdc_ecm_one_data_interface_with_no_endpoints_test.c b/test/regression/usbx_cdc_ecm_one_data_interface_with_no_endpoints_test.c
index ae6bbd34..f0e9f8ed 100644
--- a/test/regression/usbx_cdc_ecm_one_data_interface_with_no_endpoints_test.c
+++ b/test/regression/usbx_cdc_ecm_one_data_interface_with_no_endpoints_test.c
@@ -97,8 +97,8 @@ static unsigned char one_data_interface_with_no_endpoints_framework[] = {
};
static DEVICE_INIT_DATA device_init_data = {
- .framework = one_data_interface_with_no_endpoints_framework,
- .framework_length = sizeof(one_data_interface_with_no_endpoints_framework),
+ .framework = one_data_interface_with_no_endpoints_framework,
+ .framework_length = sizeof(one_data_interface_with_no_endpoints_framework),
.dont_register_hcd = 1,
};
diff --git a/test/regression/usbx_device_dfu_basic_test.c b/test/regression/usbx_device_dfu_basic_test.c
index b73afa62..37663989 100644
--- a/test/regression/usbx_device_dfu_basic_test.c
+++ b/test/regression/usbx_device_dfu_basic_test.c
@@ -101,16 +101,16 @@ static UCHAR dfu_device_buffer[UX_DEMO_REQUEST_MAX
0x00, \
#define DEVICE_FRAMEWORK_LENGTH_FULL_SPEED sizeof(device_framework_full_speed)
-static UCHAR device_framework_full_speed[] = {
+static UCHAR device_framework_full_speed[] = {
/* Device descriptor */
0x12, 0x01, 0x10, 0x01, 0x00, 0x00, 0x00, 0x40,
0x99, 0x99, 0x00, 0x00, 0x00, 0x00, 0x01, 0x02,
- 0x03, 0x01,
+ 0x03, 0x01,
/* Configuration descriptor */
0x09, 0x02, 0x1b, 0x00, 0x01, 0x01, 0x00, 0xc0,
- 0x32,
+ 0x32,
/* Interface descriptor for DFU (bInterfaceProtocol = 1). */
DFU_INTERFACE_DESCRIPTOR(0x00, 0x01)
@@ -118,12 +118,12 @@ static UCHAR device_framework_full_speed[] = {
};
#define DEVICE_FRAMEWORK_LENGTH_HIGH_SPEED sizeof(device_framework_high_speed)
-static UCHAR device_framework_high_speed[] = {
+static UCHAR device_framework_high_speed[] = {
/* Device descriptor */
0x12, 0x01, 0x00, 0x02, 0x00, 0x00, 0x00, 0x40,
0x99, 0x99, 0x00, 0x00, 0x01, 0x00, 0x01, 0x02,
- 0x03, 0x01,
+ 0x03, 0x01,
/* Device qualifier descriptor */
0x0a, 0x06, 0x00, 0x02, 0x00, 0x00, 0x00, 0x40,
@@ -131,7 +131,7 @@ static UCHAR device_framework_high_speed[] = {
/* Configuration descriptor */
0x09, 0x02, 0x1b, 0x00, 0x01, 0x01, 0x00, 0xc0,
- 0x32,
+ 0x32,
/* Interface descriptor for DFU (bInterfaceProtocol = 1). */
DFU_INTERFACE_DESCRIPTOR(0x00, 0x01)
@@ -175,16 +175,16 @@ static UCHAR language_id_framework[] = {
#define DEVICE_FRAMEWORK_LENGTH_DFU sizeof(device_framework_dfu)
-static UCHAR device_framework_dfu[] = {
+static UCHAR device_framework_dfu[] = {
/* Device descriptor */
0x12, 0x01, 0x10, 0x01, 0x00, 0x00, 0x00, 0x40,
0x99, 0x99, 0x00, 0x00, 0x00, 0x00, 0x01, 0x02,
- 0x03, 0x01,
+ 0x03, 0x01,
/* Configuration descriptor */
0x09, 0x02, 0x1B, 0x00, 0x01, 0x01, 0x00, 0xc0,
- 0x32,
+ 0x32,
/* Interface descriptor for DFU (bInterfaceProtocol = 2). */
DFU_INTERFACE_DESCRIPTOR(0x00, 0x02)
@@ -312,7 +312,7 @@ ULONG test_n;
dfu_parameter.ux_slave_class_dfu_parameter_instance_activate = demo_thread_dfu_activate;
dfu_parameter.ux_slave_class_dfu_parameter_instance_deactivate = demo_thread_dfu_deactivate;
dfu_parameter.ux_slave_class_dfu_parameter_read = demo_thread_dfu_read;
- dfu_parameter.ux_slave_class_dfu_parameter_write = demo_thread_dfu_write;
+ dfu_parameter.ux_slave_class_dfu_parameter_write = demo_thread_dfu_write;
dfu_parameter.ux_slave_class_dfu_parameter_get_status = demo_thread_dfu_get_status;
dfu_parameter.ux_slave_class_dfu_parameter_notify = demo_thread_dfu_notify;
#ifdef UX_DEVICE_CLASS_DFU_CUSTOM_REQUEST_ENABLE
@@ -322,7 +322,7 @@ ULONG test_n;
dfu_parameter.ux_slave_class_dfu_parameter_framework_length = DEVICE_FRAMEWORK_LENGTH_DFU;
/* Initilize the device dfu class. The class is connected with interface 1 on configuration 1. */
- status = ux_device_stack_class_register(_ux_system_slave_class_dfu_name, ux_device_class_dfu_entry,
+ status = ux_device_stack_class_register(_ux_system_slave_class_dfu_name, ux_device_class_dfu_entry,
1, 0, (VOID *)&dfu_parameter);
if(status!=UX_SUCCESS)
{
@@ -798,7 +798,7 @@ static UINT demo_thread_dfu_get_status(VOID *dfu, ULONG *media_status)
/* Return media status ok. */
*media_status = UX_SLAVE_CLASS_DFU_MEDIA_STATUS_OK ;
-
+
return(UX_SUCCESS);
}
@@ -813,12 +813,12 @@ static UINT demo_thread_dfu_notify(VOID *dfu, ULONG notification)
/* Begin of Download. */
break;
-
+
case UX_SLAVE_CLASS_DFU_NOTIFICATION_END_DOWNLOAD :
/* Completion of Download. */
break;
-
+
case UX_SLAVE_CLASS_DFU_NOTIFICATION_ABORT_DOWNLOAD :
/* Download was aborted. */
@@ -828,17 +828,17 @@ static UINT demo_thread_dfu_notify(VOID *dfu, ULONG notification)
/* Begin of UPLOAD. */
break;
-
+
case UX_SLAVE_CLASS_DFU_NOTIFICATION_END_UPLOAD :
/* Completion of UPLOAD. */
break;
-
+
case UX_SLAVE_CLASS_DFU_NOTIFICATION_ABORT_UPLOAD :
/* Download was aborted. */
break;
-
+
default :
/* Bad notification signal. Should never get here. */
diff --git a/test/regression/usbx_dpump_basic_test.c b/test/regression/usbx_dpump_basic_test.c
index 25152f3d..cc881c00 100644
--- a/test/regression/usbx_dpump_basic_test.c
+++ b/test/regression/usbx_dpump_basic_test.c
@@ -570,7 +570,7 @@ UINT dpump_device_state = UX_STATE_RESET;
if (status == UX_STATE_NEXT)
dpump_device_state = DPUMP_DEVICE_STATE_READ;
break;
-
+
default:
dpump_device_state = UX_STATE_RESET;
}
diff --git a/test/regression/usbx_hid_keyboard_key_test.c b/test/regression/usbx_hid_keyboard_key_test.c
index 64d93ed0..6f43cd4f 100644
--- a/test/regression/usbx_hid_keyboard_key_test.c
+++ b/test/regression/usbx_hid_keyboard_key_test.c
@@ -14,16 +14,16 @@
static UCHAR ux_host_class_hid_keyboard_regular_array[] =
{
- 0,0,0,0,
- 'a','b','c','d','e','f','g','h','i','j','k','l','m','n',
- 'o','p','q','r','s','t','u','v','w','x','y','z',
- '1','2','3','4','5','6','7','8','9','0',
- 0x0d,0x1b,0x08,0x07,0x20,'-','=','[',']',
- '\\','#',';',0x27,'`',',','.','/',0xf0,
- 0xbb,0xbc,0xbd,0xbe,0xbf,0xc0,0xc1,0xc2,0xc3,0xc4,0xc5,0xc6,
- 0x00,0xf1,0x00,0xd2,0xc7,0xc9,0xd3,0xcf,0xd1,0xcd,0xcb,0xd0,0xc8,0xf2,
- '/','*','-','+',
- 0x0d,'1','2','3','4','5','6','7','8','9','0','.','\\',0x00,0x00,'=',
+ 0,0,0,0,
+ 'a','b','c','d','e','f','g','h','i','j','k','l','m','n',
+ 'o','p','q','r','s','t','u','v','w','x','y','z',
+ '1','2','3','4','5','6','7','8','9','0',
+ 0x0d,0x1b,0x08,0x07,0x20,'-','=','[',']',
+ '\\','#',';',0x27,'`',',','.','/',0xf0,
+ 0xbb,0xbc,0xbd,0xbe,0xbf,0xc0,0xc1,0xc2,0xc3,0xc4,0xc5,0xc6,
+ 0x00,0xf1,0x00,0xd2,0xc7,0xc9,0xd3,0xcf,0xd1,0xcd,0xcb,0xd0,0xc8,0xf2,
+ '/','*','-','+',
+ 0x0d,'1','2','3','4','5','6','7','8','9','0','.','\\',0x00,0x00,'=',
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
};
@@ -43,16 +43,16 @@ static UCHAR ux_host_class_hid_keyboard_capslock_array[] =
static UCHAR ux_host_class_hid_keyboard_shift_array[] =
{
- 0,0,0,0,
- 'A','B','C','D','E','F','G','H','I','J','K','L','M','N',
- 'O','P','Q','R','S','T','U','V','W','X','Y','Z',
- '!','@','#','$','%','^','&','*','(',')',
- 0x0d,0x1b,0x08,0x07,0x20,'_','+','{','}',
- '|','~',':','"','~','<','>','?',0xf0,
- 0xbb,0xbc,0xbd,0xbe,0xbf,0xc0,0xc1,0xc2,0xc3,0xc4,0xc5,0xc6,
- 0x00,0xf1,0x00,0xd2,0xc7,0xc9,0xd3,0xcf,0xd1,0xcd,0xcb,0xd0,0xc8,0xf2,
- '/','*','-','+',
- 0x0d,'1','2','3','4','5','6','7','8','9','0','.','\\',0x00,0x00,'=',
+ 0,0,0,0,
+ 'A','B','C','D','E','F','G','H','I','J','K','L','M','N',
+ 'O','P','Q','R','S','T','U','V','W','X','Y','Z',
+ '!','@','#','$','%','^','&','*','(',')',
+ 0x0d,0x1b,0x08,0x07,0x20,'_','+','{','}',
+ '|','~',':','"','~','<','>','?',0xf0,
+ 0xbb,0xbc,0xbd,0xbe,0xbf,0xc0,0xc1,0xc2,0xc3,0xc4,0xc5,0xc6,
+ 0x00,0xf1,0x00,0xd2,0xc7,0xc9,0xd3,0xcf,0xd1,0xcd,0xcb,0xd0,0xc8,0xf2,
+ '/','*','-','+',
+ 0x0d,'1','2','3','4','5','6','7','8','9','0','.','\\',0x00,0x00,'=',
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
};
diff --git a/test/regression/usbx_hid_mouse_basic_test.c b/test/regression/usbx_hid_mouse_basic_test.c
index 2650b1af..c956ca15 100644
--- a/test/regression/usbx_hid_mouse_basic_test.c
+++ b/test/regression/usbx_hid_mouse_basic_test.c
@@ -12,7 +12,7 @@ static UX_HOST_CLASS_HID_MOUSE *mouse;
static UCHAR has_host_received;
-static UCHAR hid_mouse_report[] = {
+static UCHAR hid_mouse_report[] = {
0x05, 0x01, // USAGE_PAGE (Generic Desktop)
0x09, 0x02, // USAGE (Mouse)
@@ -51,16 +51,16 @@ static UCHAR hid_mouse_report[] = {
#define DEVICE_FRAMEWORK_LENGTH_FULL_SPEED 52
-static UCHAR device_framework_full_speed[] = {
+static UCHAR device_framework_full_speed[] = {
/* Device descriptor */
0x12, 0x01, 0x10, 0x01, 0x00, 0x00, 0x00, 0x08,
0x81, 0x0A, 0x01, 0x01, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x01,
+ 0x00, 0x01,
/* Configuration descriptor */
0x09, 0x02, 0x22, 0x00, 0x01, 0x01, 0x00, 0xc0,
- 0x32,
+ 0x32,
/* Interface descriptor */
0x09, 0x04, 0x02, 0x00, 0x01, 0x03, 0x00, 0x00,
@@ -74,15 +74,15 @@ static UCHAR device_framework_full_speed[] = {
0x07, 0x05, 0x82, 0x03, 0x08, 0x00, 0x08
};
-
-
+
+
#define DEVICE_FRAMEWORK_LENGTH_HIGH_SPEED 62
-static UCHAR device_framework_high_speed[] = {
+static UCHAR device_framework_high_speed[] = {
/* Device descriptor */
0x12, 0x01, 0x00, 0x02, 0x00, 0x00, 0x00, 0x40,
0x0a, 0x07, 0x25, 0x40, 0x01, 0x00, 0x01, 0x02,
- 0x03, 0x01,
+ 0x03, 0x01,
/* Device qualifier descriptor */
0x0a, 0x06, 0x00, 0x02, 0x00, 0x00, 0x00, 0x40,
@@ -90,7 +90,7 @@ static UCHAR device_framework_high_speed[] = {
/* Configuration descriptor */
0x09, 0x02, 0x22, 0x00, 0x01, 0x01, 0x00, 0xc0,
- 0x32,
+ 0x32,
/* Interface descriptor */
0x09, 0x04, 0x02, 0x00, 0x01, 0x03, 0x00, 0x00,
@@ -101,32 +101,32 @@ static UCHAR device_framework_high_speed[] = {
MSB(HID_MOUSE_REPORT_LENGTH),
/* Endpoint descriptor (Interrupt) */
- 0x07, 0x05, 0x82, 0x03, 0x08, 0x00, 0x08
+ 0x07, 0x05, 0x82, 0x03, 0x08, 0x00, 0x08
};
-
+
/* String Device Framework :
Byte 0 and 1 : Word containing the language ID : 0x0904 for US
Byte 2 : Byte containing the index of the descriptor
Byte 3 : Byte containing the length of the descriptor string
*/
-
+
#define STRING_FRAMEWORK_LENGTH 40
-static UCHAR string_framework[] = {
+static UCHAR string_framework[] = {
/* Manufacturer string descriptor : Index 1 */
- 0x09, 0x04, 0x01, 0x0c,
- 0x45, 0x78, 0x70, 0x72,0x65, 0x73, 0x20, 0x4c,
+ 0x09, 0x04, 0x01, 0x0c,
+ 0x45, 0x78, 0x70, 0x72,0x65, 0x73, 0x20, 0x4c,
0x6f, 0x67, 0x69, 0x63,
/* Product string descriptor : Index 2 */
- 0x09, 0x04, 0x02, 0x0c,
- 0x55, 0x53, 0x42, 0x20, 0x4b, 0x65, 0x79, 0x62,
- 0x6f, 0x61, 0x72, 0x64,
+ 0x09, 0x04, 0x02, 0x0c,
+ 0x55, 0x53, 0x42, 0x20, 0x4b, 0x65, 0x79, 0x62,
+ 0x6f, 0x61, 0x72, 0x64,
/* Serial Number string descriptor : Index 3 */
- 0x09, 0x04, 0x03, 0x04,
+ 0x09, 0x04, 0x03, 0x04,
0x30, 0x30, 0x30, 0x31
};
@@ -136,7 +136,7 @@ static UCHAR string_framework[] = {
be appended to the language_id_framework array and the length
adjusted accordingly. */
#define LANGUAGE_ID_FRAMEWORK_LENGTH 2
-static UCHAR language_id_framework[] = {
+static UCHAR language_id_framework[] = {
/* English. */
0x09, 0x04
@@ -159,14 +159,14 @@ void test_application_define(void *first_unused_memory)
void usbx_hid_mouse_basic_test_application_define(void *first_unused_memory)
#endif
{
-
+
UINT status;
CHAR *stack_pointer;
CHAR *memory_pointer;
/* Inform user. */
printf("Running HID Mouse Basic Functionality Test.......................... ");
-
+
/* Initialize the free memory pointer */
stack_pointer = (CHAR *) usbx_memory;
memory_pointer = stack_pointer + (UX_DEMO_STACK_SIZE * 2);
@@ -193,7 +193,7 @@ CHAR *memory_pointer;
printf("Error on line %d\n", __LINE__);
test_control_return(1);
}
-
+
status = ux_host_stack_class_register(_ux_system_host_class_hid_name, ux_host_class_hid_entry);
if (status != UX_SUCCESS)
{
@@ -230,7 +230,7 @@ CHAR *memory_pointer;
hid_parameter.ux_device_class_hid_parameter_callback = demo_thread_hid_callback;
/* Initilize the device hid class. The class is connected with interface 2 */
- status = ux_device_stack_class_register(_ux_system_slave_class_hid_name, ux_device_class_hid_entry,
+ status = ux_device_stack_class_register(_ux_system_slave_class_hid_name, ux_device_class_hid_entry,
1,2, (VOID *)&hid_parameter);
if(status!=UX_SUCCESS)
{
@@ -250,7 +250,7 @@ CHAR *memory_pointer;
printf("Error on line %d\n", __LINE__);
test_control_return(1);
}
-
+
/* Register all the USB host controllers available in this system */
status = ux_host_stack_hcd_register(_ux_system_host_hcd_simulator_name, ux_hcd_sim_host_initialize,0,0);
@@ -263,8 +263,8 @@ CHAR *memory_pointer;
}
/* Create the main host simulation thread. */
- status = tx_thread_create(&tx_demo_thread_host_simulation, "tx demo host simulation", tx_demo_thread_host_simulation_entry, 0,
- stack_pointer, UX_DEMO_STACK_SIZE,
+ status = tx_thread_create(&tx_demo_thread_host_simulation, "tx demo host simulation", tx_demo_thread_host_simulation_entry, 0,
+ stack_pointer, UX_DEMO_STACK_SIZE,
20, 20, 1, TX_AUTO_START);
/* Check for error. */
@@ -274,12 +274,12 @@ CHAR *memory_pointer;
printf("Error on line %d\n", __LINE__);
test_control_return(1);
}
-
+
/* Create the main demo thread. */
- status = tx_thread_create(&tx_demo_thread_slave_simulation, "tx demo slave simulation", tx_demo_thread_slave_simulation_entry, 0,
- stack_pointer + UX_DEMO_STACK_SIZE, UX_DEMO_STACK_SIZE,
+ status = tx_thread_create(&tx_demo_thread_slave_simulation, "tx demo slave simulation", tx_demo_thread_slave_simulation_entry, 0,
+ stack_pointer + UX_DEMO_STACK_SIZE, UX_DEMO_STACK_SIZE,
20, 20, 1, TX_AUTO_START);
-
+
/* Check for error. */
if (status != TX_SUCCESS)
{
@@ -331,7 +331,7 @@ UCHAR next_mouse_buttons;
/* Initilize max loop value. */
max_num_loops = 16;
-
+
/* Find the HID class */
status = demo_class_hid_get();
if (status != UX_SUCCESS)
@@ -402,16 +402,16 @@ UCHAR next_mouse_buttons;
/* Simulate detach. */
ux_test_hcd_sim_host_disconnect();
ux_test_breakable_sleep(50, sleep_break_on_removed);
-
+
/* Now disconnect the device. */
_ux_device_stack_disconnect();
-
+
/* And deinitialize the class. */
- status = ux_device_stack_class_unregister(_ux_system_slave_class_hid_name, ux_device_class_hid_entry);
-
+ status = ux_device_stack_class_unregister(_ux_system_slave_class_hid_name, ux_device_class_hid_entry);
+
/* Deinitialize the device side of usbx. */
_ux_device_stack_uninitialize();
-
+
/* And finally the usbx system resources. */
_ux_system_uninitialize();
@@ -432,13 +432,13 @@ UX_SLAVE_DEVICE *device;
UX_SLAVE_INTERFACE *interface;
UX_SLAVE_CLASS_HID *hid;
UX_SLAVE_CLASS_HID_EVENT hid_event;
-
+
/* Get the pointer to the device. */
device = &_ux_system_slave -> ux_system_slave_device;
-
+
/* reset the HID event structure. */
ux_utility_memory_set(&hid_event, 0, sizeof(UX_SLAVE_CLASS_HID_EVENT));
-
+
/* Set length of event. */
hid_event.ux_device_class_hid_event_length = 4;
@@ -451,7 +451,7 @@ UX_SLAVE_CLASS_HID_EVENT hid_event;
/* Set initial value for mouse wheel. */
hid_event.ux_device_class_hid_event_buffer[3] = -8;
-
+
while (1)
{
@@ -478,7 +478,7 @@ UX_SLAVE_CLASS_HID_EVENT hid_event;
/* Get the interface. We use the first interface, this is a simple device. */
interface = device -> ux_slave_device_first_interface;
-
+
/* From that interface, derive the HID owner. */
hid = interface -> ux_slave_interface_class_instance;
diff --git a/test/regression/usbx_hid_remote_control_tests.c b/test/regression/usbx_hid_remote_control_tests.c
index 03da1fda..0a1293ef 100644
--- a/test/regression/usbx_hid_remote_control_tests.c
+++ b/test/regression/usbx_hid_remote_control_tests.c
@@ -347,7 +347,7 @@ CHAR *memory_pointer;
printf("Error on line %d\n", __LINE__);
test_control_return(1);
}
-
+
global_hcd = &_ux_system_host->ux_system_host_hcd_array[0];
/* Create the main host simulation thread. */
@@ -472,7 +472,7 @@ ULONG expected_volume_value;
if (usage != (0x00090000 | expected_keypad_value) || value != expected_keypad_value)
{
- printf("Error on line %d. usage: 0x%lx, expected usage: 0x%lx, value: 0x%lx, expected_keypad_value: 0x%lx\n",
+ printf("Error on line %d. usage: 0x%lx, expected usage: 0x%lx, value: 0x%lx, expected_keypad_value: 0x%lx\n",
__LINE__, usage, 0x00090000 | expected_keypad_value, value, expected_keypad_value);
test_control_return(1);
}
@@ -646,7 +646,7 @@ static void test_main_thread_entry(ULONG arg)
UINT status;
UINT i;
-void (*tests[])() =
+void (*tests[])() =
{
basic_test,
host_event_buffer_test,
diff --git a/test/regression/usbx_hid_report_descriptor_collection_overflow_test.c b/test/regression/usbx_hid_report_descriptor_collection_overflow_test.c
index 295f47f5..bb761393 100644
--- a/test/regression/usbx_hid_report_descriptor_collection_overflow_test.c
+++ b/test/regression/usbx_hid_report_descriptor_collection_overflow_test.c
@@ -138,7 +138,7 @@ static VOID error_callback(UINT system_level, UINT system_context, UINT error_co
{
if (error_code != UX_HOST_CLASS_HID_COLLECTION_OVERFLOW &&
- error_code != UX_DESCRIPTOR_CORRUPTED &&
+ error_code != UX_DESCRIPTOR_CORRUPTED &&
error_code != UX_DEVICE_ENUMERATION_FAILURE)
{
diff --git a/test/regression/usbx_hid_report_descriptor_delimiter_nested_close_test.c b/test/regression/usbx_hid_report_descriptor_delimiter_nested_close_test.c
index e3110d30..76e147fa 100644
--- a/test/regression/usbx_hid_report_descriptor_delimiter_nested_close_test.c
+++ b/test/regression/usbx_hid_report_descriptor_delimiter_nested_close_test.c
@@ -38,11 +38,11 @@ static UCHAR device_framework_full_speed[DEVICE_FRAMEWORK_LENGTH_FULL_SPEED] = {
/* Device descriptor */
0x12, 0x01, 0x10, 0x01, 0x00, 0x00, 0x00, 0x08,
0x81, 0x0A, 0x01, 0x01, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x01,
+ 0x00, 0x01,
/* Configuration descriptor */
0x09, 0x02, 0x22, 0x00, 0x01, 0x01, 0x00, 0xc0,
- 0x32,
+ 0x32,
/* Interface descriptor */
0x09, 0x04, 0x02, 0x00, 0x01, 0x03, 0x00, 0x00,
@@ -56,15 +56,15 @@ static UCHAR device_framework_full_speed[DEVICE_FRAMEWORK_LENGTH_FULL_SPEED] = {
0x07, 0x05, 0x82, 0x03, 0x08, 0x00, 0x08
};
-
-
+
+
#define DEVICE_FRAMEWORK_LENGTH_HIGH_SPEED 62
static UCHAR device_framework_high_speed[DEVICE_FRAMEWORK_LENGTH_HIGH_SPEED] = {
/* Device descriptor */
0x12, 0x01, 0x00, 0x02, 0x00, 0x00, 0x00, 0x40,
0x0a, 0x07, 0x25, 0x40, 0x01, 0x00, 0x01, 0x02,
- 0x03, 0x01,
+ 0x03, 0x01,
/* Device qualifier descriptor */
0x0a, 0x06, 0x00, 0x02, 0x00, 0x00, 0x00, 0x40,
@@ -72,7 +72,7 @@ static UCHAR device_framework_high_speed[DEVICE_FRAMEWORK_LENGTH_HIGH_SPEED] = {
/* Configuration descriptor */
0x09, 0x02, 0x22, 0x00, 0x01, 0x01, 0x00, 0xc0,
- 0x32,
+ 0x32,
/* Interface descriptor */
0x09, 0x04, 0x02, 0x00, 0x01, 0x03, 0x00, 0x00,
@@ -83,32 +83,32 @@ static UCHAR device_framework_high_speed[DEVICE_FRAMEWORK_LENGTH_HIGH_SPEED] = {
MSB(HID_REPORT_LENGTH),
/* Endpoint descriptor (Interrupt) */
- 0x07, 0x05, 0x82, 0x03, 0x08, 0x00, 0x08
+ 0x07, 0x05, 0x82, 0x03, 0x08, 0x00, 0x08
};
-
+
/* String Device Framework :
Byte 0 and 1 : Word containing the language ID : 0x0904 for US
Byte 2 : Byte containing the index of the descriptor
Byte 3 : Byte containing the length of the descriptor string
*/
-
+
#define STRING_FRAMEWORK_LENGTH 40
-static UCHAR string_framework[] = {
+static UCHAR string_framework[] = {
/* Manufacturer string descriptor : Index 1 */
- 0x09, 0x04, 0x01, 0x0c,
- 0x45, 0x78, 0x70, 0x72,0x65, 0x73, 0x20, 0x4c,
+ 0x09, 0x04, 0x01, 0x0c,
+ 0x45, 0x78, 0x70, 0x72,0x65, 0x73, 0x20, 0x4c,
0x6f, 0x67, 0x69, 0x63,
/* Product string descriptor : Index 2 */
- 0x09, 0x04, 0x02, 0x0c,
- 0x55, 0x53, 0x42, 0x20, 0x4b, 0x65, 0x79, 0x62,
- 0x6f, 0x61, 0x72, 0x64,
+ 0x09, 0x04, 0x02, 0x0c,
+ 0x55, 0x53, 0x42, 0x20, 0x4b, 0x65, 0x79, 0x62,
+ 0x6f, 0x61, 0x72, 0x64,
/* Serial Number string descriptor : Index 3 */
- 0x09, 0x04, 0x03, 0x04,
+ 0x09, 0x04, 0x03, 0x04,
0x30, 0x30, 0x30, 0x31
};
@@ -118,7 +118,7 @@ static UCHAR string_framework[] = {
be appended to the language_id_framework array and the length
adjusted accordingly. */
#define LANGUAGE_ID_FRAMEWORK_LENGTH 2
-static UCHAR language_id_framework[] = {
+static UCHAR language_id_framework[] = {
/* English. */
0x09, 0x04
@@ -130,7 +130,7 @@ static VOID error_callback(UINT system_level, UINT system_context, UINT error_co
{
if (error_code != UX_HOST_CLASS_HID_DELIMITER_ERROR &&
- error_code != UX_DESCRIPTOR_CORRUPTED &&
+ error_code != UX_DESCRIPTOR_CORRUPTED &&
error_code != UX_DEVICE_ENUMERATION_FAILURE)
{
@@ -148,7 +148,7 @@ void test_application_define(void *first_unused_memory)
void usbx_hid_report_descriptor_delimiter_nested_close_test_application_define(void *first_unused_memory)
#endif
{
-
+
UINT status;
CHAR * stack_pointer;
CHAR * memory_pointer;
@@ -183,7 +183,7 @@ UINT descriptor_size = HID_REPORT_LENGTH;
printf("Error on line %d\n", __LINE__);
test_control_return(1);
}
-
+
status = ux_host_stack_class_register(_ux_system_host_class_hid_name, ux_host_class_hid_entry);
if (status != UX_SUCCESS)
{
@@ -220,7 +220,7 @@ UINT descriptor_size = HID_REPORT_LENGTH;
hid_parameter.ux_device_class_hid_parameter_callback = demo_thread_hid_callback;
/* Initilize the device hid class. The class is connected with interface 2 */
- status = ux_device_stack_class_register(_ux_system_slave_class_hid_name, ux_device_class_hid_entry,
+ status = ux_device_stack_class_register(_ux_system_slave_class_hid_name, ux_device_class_hid_entry,
1,2, (VOID *)&hid_parameter);
if(status!=UX_SUCCESS)
{
@@ -240,7 +240,7 @@ UINT descriptor_size = HID_REPORT_LENGTH;
printf("Error on line %d\n", __LINE__);
test_control_return(1);
}
-
+
/* Register all the USB host controllers available in this system */
status = ux_host_stack_hcd_register(_ux_system_host_hcd_simulator_name, ux_hcd_sim_host_initialize,0,0);
@@ -253,8 +253,8 @@ UINT descriptor_size = HID_REPORT_LENGTH;
}
/* Create the main host simulation thread. */
- status = tx_thread_create(&tx_demo_thread_host_simulation, "tx demo host simulation", tx_demo_thread_host_simulation_entry, 0,
- stack_pointer, UX_DEMO_STACK_SIZE,
+ status = tx_thread_create(&tx_demo_thread_host_simulation, "tx demo host simulation", tx_demo_thread_host_simulation_entry, 0,
+ stack_pointer, UX_DEMO_STACK_SIZE,
20, 20, 1, TX_AUTO_START);
/* Check for error. */
@@ -284,7 +284,7 @@ UINT status;
_ux_device_stack_disconnect();
/* And deinitialize the class. */
- status = ux_device_stack_class_unregister(_ux_system_slave_class_hid_name, ux_device_class_hid_entry);
+ status = ux_device_stack_class_unregister(_ux_system_slave_class_hid_name, ux_device_class_hid_entry);
/* Deinitialize the device side of usbx. */
_ux_device_stack_uninitialize();
diff --git a/test/regression/usbx_hid_report_descriptor_delimiter_nested_open_test.c b/test/regression/usbx_hid_report_descriptor_delimiter_nested_open_test.c
index cce8d21b..7829e2ce 100644
--- a/test/regression/usbx_hid_report_descriptor_delimiter_nested_open_test.c
+++ b/test/regression/usbx_hid_report_descriptor_delimiter_nested_open_test.c
@@ -130,7 +130,7 @@ static VOID error_callback(UINT system_level, UINT system_context, UINT error_co
{
if (error_code != UX_HOST_CLASS_HID_DELIMITER_ERROR &&
- error_code != UX_DESCRIPTOR_CORRUPTED &&
+ error_code != UX_DESCRIPTOR_CORRUPTED &&
error_code != UX_DEVICE_ENUMERATION_FAILURE)
{
diff --git a/test/regression/usbx_hid_report_descriptor_delimiter_unknown_test.c b/test/regression/usbx_hid_report_descriptor_delimiter_unknown_test.c
index 0e0382bd..97b867e8 100644
--- a/test/regression/usbx_hid_report_descriptor_delimiter_unknown_test.c
+++ b/test/regression/usbx_hid_report_descriptor_delimiter_unknown_test.c
@@ -130,7 +130,7 @@ static VOID error_callback(UINT system_level, UINT system_context, UINT error_co
{
if (error_code != UX_HOST_CLASS_HID_DELIMITER_ERROR &&
- error_code != UX_DESCRIPTOR_CORRUPTED &&
+ error_code != UX_DESCRIPTOR_CORRUPTED &&
error_code != UX_DEVICE_ENUMERATION_FAILURE)
{
diff --git a/test/regression/usbx_hid_report_descriptor_end_collection_error_test.c b/test/regression/usbx_hid_report_descriptor_end_collection_error_test.c
index 76b4b3d5..77f92470 100644
--- a/test/regression/usbx_hid_report_descriptor_end_collection_error_test.c
+++ b/test/regression/usbx_hid_report_descriptor_end_collection_error_test.c
@@ -118,7 +118,7 @@ static VOID error_callback(UINT system_level, UINT system_context, UINT error_co
{
if (error_code != UX_HOST_CLASS_HID_COLLECTION_OVERFLOW &&
- error_code != UX_DESCRIPTOR_CORRUPTED &&
+ error_code != UX_DESCRIPTOR_CORRUPTED &&
error_code != UX_DEVICE_ENUMERATION_FAILURE)
{
diff --git a/test/regression/usbx_hid_report_descriptor_example_remote_test.c b/test/regression/usbx_hid_report_descriptor_example_remote_test.c
index 901328b0..dc69fee5 100644
--- a/test/regression/usbx_hid_report_descriptor_example_remote_test.c
+++ b/test/regression/usbx_hid_report_descriptor_example_remote_test.c
@@ -64,11 +64,11 @@ static UCHAR device_framework_full_speed[DEVICE_FRAMEWORK_LENGTH_FULL_SPEED] = {
/* Device descriptor */
0x12, 0x01, 0x10, 0x01, 0x00, 0x00, 0x00, 0x08,
0x81, 0x0A, 0x01, 0x01, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x01,
+ 0x00, 0x01,
/* Configuration descriptor */
0x09, 0x02, 0x22, 0x00, 0x01, 0x01, 0x00, 0xc0,
- 0x32,
+ 0x32,
/* Interface descriptor */
0x09, 0x04, 0x02, 0x00, 0x01, 0x03, 0x00, 0x00,
@@ -82,15 +82,15 @@ static UCHAR device_framework_full_speed[DEVICE_FRAMEWORK_LENGTH_FULL_SPEED] = {
0x07, 0x05, 0x82, 0x03, 0x08, 0x00, 0x08
};
-
-
+
+
#define DEVICE_FRAMEWORK_LENGTH_HIGH_SPEED 62
static UCHAR device_framework_high_speed[DEVICE_FRAMEWORK_LENGTH_HIGH_SPEED] = {
/* Device descriptor */
0x12, 0x01, 0x00, 0x02, 0x00, 0x00, 0x00, 0x40,
0x0a, 0x07, 0x25, 0x40, 0x01, 0x00, 0x01, 0x02,
- 0x03, 0x01,
+ 0x03, 0x01,
/* Device qualifier descriptor */
0x0a, 0x06, 0x00, 0x02, 0x00, 0x00, 0x00, 0x40,
@@ -98,7 +98,7 @@ static UCHAR device_framework_high_speed[DEVICE_FRAMEWORK_LENGTH_HIGH_SPEED] = {
/* Configuration descriptor */
0x09, 0x02, 0x22, 0x00, 0x01, 0x01, 0x00, 0xc0,
- 0x32,
+ 0x32,
/* Interface descriptor */
0x09, 0x04, 0x02, 0x00, 0x01, 0x03, 0x00, 0x00,
@@ -109,32 +109,32 @@ static UCHAR device_framework_high_speed[DEVICE_FRAMEWORK_LENGTH_HIGH_SPEED] = {
MSB(HID_REPORT_LENGTH),
/* Endpoint descriptor (Interrupt) */
- 0x07, 0x05, 0x82, 0x03, 0x08, 0x00, 0x08
+ 0x07, 0x05, 0x82, 0x03, 0x08, 0x00, 0x08
};
-
+
/* String Device Framework :
Byte 0 and 1 : Word containing the language ID : 0x0904 for US
Byte 2 : Byte containing the index of the descriptor
Byte 3 : Byte containing the length of the descriptor string
*/
-
+
#define STRING_FRAMEWORK_LENGTH 40
-static UCHAR string_framework[] = {
+static UCHAR string_framework[] = {
/* Manufacturer string descriptor : Index 1 */
- 0x09, 0x04, 0x01, 0x0c,
- 0x45, 0x78, 0x70, 0x72,0x65, 0x73, 0x20, 0x4c,
+ 0x09, 0x04, 0x01, 0x0c,
+ 0x45, 0x78, 0x70, 0x72,0x65, 0x73, 0x20, 0x4c,
0x6f, 0x67, 0x69, 0x63,
/* Product string descriptor : Index 2 */
- 0x09, 0x04, 0x02, 0x0c,
- 0x55, 0x53, 0x42, 0x20, 0x4b, 0x65, 0x79, 0x62,
- 0x6f, 0x61, 0x72, 0x64,
+ 0x09, 0x04, 0x02, 0x0c,
+ 0x55, 0x53, 0x42, 0x20, 0x4b, 0x65, 0x79, 0x62,
+ 0x6f, 0x61, 0x72, 0x64,
/* Serial Number string descriptor : Index 3 */
- 0x09, 0x04, 0x03, 0x04,
+ 0x09, 0x04, 0x03, 0x04,
0x30, 0x30, 0x30, 0x31
};
@@ -144,7 +144,7 @@ static UCHAR string_framework[] = {
be appended to the language_id_framework array and the length
adjusted accordingly. */
#define LANGUAGE_ID_FRAMEWORK_LENGTH 2
-static UCHAR language_id_framework[] = {
+static UCHAR language_id_framework[] = {
/* English. */
0x09, 0x04
@@ -167,7 +167,7 @@ void test_application_define(void *first_unused_memory)
void usbx_hid_report_descriptor_example_remote_test_application_define(void *first_unused_memory)
#endif
{
-
+
UINT status;
CHAR * stack_pointer;
CHAR * memory_pointer;
@@ -203,7 +203,7 @@ UINT descriptor_size = HID_REPORT_LENGTH;
printf("Error on line %d\n", __LINE__);
test_control_return(1);
}
-
+
status = ux_host_stack_class_register(_ux_system_host_class_hid_name, ux_host_class_hid_entry);
if (status != UX_SUCCESS)
{
@@ -240,7 +240,7 @@ UINT descriptor_size = HID_REPORT_LENGTH;
hid_parameter.ux_device_class_hid_parameter_callback = demo_thread_hid_callback;
/* Initilize the device hid class. The class is connected with interface 2 */
- status = ux_device_stack_class_register(_ux_system_slave_class_hid_name, ux_device_class_hid_entry,
+ status = ux_device_stack_class_register(_ux_system_slave_class_hid_name, ux_device_class_hid_entry,
1,2, (VOID *)&hid_parameter);
if(status!=UX_SUCCESS)
{
@@ -260,7 +260,7 @@ UINT descriptor_size = HID_REPORT_LENGTH;
printf("Error on line %d\n", __LINE__);
test_control_return(1);
}
-
+
/* Register all the USB host controllers available in this system */
status = ux_host_stack_hcd_register(_ux_system_host_hcd_simulator_name, ux_hcd_sim_host_initialize,0,0);
@@ -273,8 +273,8 @@ UINT descriptor_size = HID_REPORT_LENGTH;
}
/* Create the main host simulation thread. */
- status = tx_thread_create(&tx_demo_thread_host_simulation, "tx demo host simulation", tx_demo_thread_host_simulation_entry, 0,
- stack_pointer, UX_DEMO_STACK_SIZE,
+ status = tx_thread_create(&tx_demo_thread_host_simulation, "tx demo host simulation", tx_demo_thread_host_simulation_entry, 0,
+ stack_pointer, UX_DEMO_STACK_SIZE,
20, 20, 1, TX_AUTO_START);
/* Check for error. */
@@ -292,7 +292,7 @@ static void tx_demo_thread_host_simulation_entry(ULONG arg)
UINT status;
UX_HOST_CLASS_HID_REPORT_GET_ID report_id;
-
+
/* Find the HID class */
status = demo_class_hid_get();
@@ -324,13 +324,13 @@ UX_HOST_CLASS_HID_REPORT_GET_ID report_id;
/* Now disconnect the device. */
_ux_device_stack_disconnect();
-
+
/* And deinitialize the class. */
- status = ux_device_stack_class_unregister(_ux_system_slave_class_hid_name, ux_device_class_hid_entry);
-
+ status = ux_device_stack_class_unregister(_ux_system_slave_class_hid_name, ux_device_class_hid_entry);
+
/* Deinitialize the device side of usbx. */
_ux_device_stack_uninitialize();
-
+
/* And finally the usbx system resources. */
_ux_system_uninitialize();
diff --git a/test/regression/usbx_hid_report_descriptor_incoherent_usage_min_max_test.c b/test/regression/usbx_hid_report_descriptor_incoherent_usage_min_max_test.c
index e2d25079..1eba2e11 100644
--- a/test/regression/usbx_hid_report_descriptor_incoherent_usage_min_max_test.c
+++ b/test/regression/usbx_hid_report_descriptor_incoherent_usage_min_max_test.c
@@ -120,7 +120,7 @@ static VOID error_callback(UINT system_level, UINT system_context, UINT error_co
{
if (error_code != UX_HOST_CLASS_HID_MIN_MAX_ERROR &&
- error_code != UX_DESCRIPTOR_CORRUPTED &&
+ error_code != UX_DESCRIPTOR_CORRUPTED &&
error_code != UX_DEVICE_ENUMERATION_FAILURE)
{
diff --git a/test/regression/usbx_hid_report_descriptor_invalid_length_test.c b/test/regression/usbx_hid_report_descriptor_invalid_length_test.c
index 83f03aee..031e4f9f 100644
--- a/test/regression/usbx_hid_report_descriptor_invalid_length_test.c
+++ b/test/regression/usbx_hid_report_descriptor_invalid_length_test.c
@@ -116,7 +116,7 @@ static UCHAR language_id_framework[] = {
static VOID error_callback(UINT system_level, UINT system_context, UINT error_code)
{
- if (error_code != UX_DESCRIPTOR_CORRUPTED &&
+ if (error_code != UX_DESCRIPTOR_CORRUPTED &&
error_code != UX_DEVICE_ENUMERATION_FAILURE)
{
diff --git a/test/regression/usbx_hid_report_descriptor_pop_underflow_test.c b/test/regression/usbx_hid_report_descriptor_pop_underflow_test.c
index bc5f1962..10fea958 100644
--- a/test/regression/usbx_hid_report_descriptor_pop_underflow_test.c
+++ b/test/regression/usbx_hid_report_descriptor_pop_underflow_test.c
@@ -116,7 +116,7 @@ static VOID error_callback(UINT system_level, UINT system_context, UINT error_co
{
if (error_code != UX_HOST_CLASS_HID_POP_UNDERFLOW &&
- error_code != UX_DESCRIPTOR_CORRUPTED &&
+ error_code != UX_DESCRIPTOR_CORRUPTED &&
error_code != UX_DEVICE_ENUMERATION_FAILURE)
{
diff --git a/test/regression/usbx_hid_report_descriptor_push_overflow_test.c b/test/regression/usbx_hid_report_descriptor_push_overflow_test.c
index 71f3aa2b..3be98798 100644
--- a/test/regression/usbx_hid_report_descriptor_push_overflow_test.c
+++ b/test/regression/usbx_hid_report_descriptor_push_overflow_test.c
@@ -118,7 +118,7 @@ static VOID error_callback(UINT system_level, UINT system_context, UINT error_co
{
if (error_code != UX_HOST_CLASS_HID_PUSH_OVERFLOW &&
- error_code != UX_DESCRIPTOR_CORRUPTED &&
+ error_code != UX_DESCRIPTOR_CORRUPTED &&
error_code != UX_DEVICE_ENUMERATION_FAILURE)
{
diff --git a/test/regression/usbx_hid_report_descriptor_report_count_overflow_test.c b/test/regression/usbx_hid_report_descriptor_report_count_overflow_test.c
index 4eb98bbc..0b0d95a7 100644
--- a/test/regression/usbx_hid_report_descriptor_report_count_overflow_test.c
+++ b/test/regression/usbx_hid_report_descriptor_report_count_overflow_test.c
@@ -120,7 +120,7 @@ static VOID error_callback(UINT system_level, UINT system_context, UINT error_co
{
if (error_code != UX_HOST_CLASS_HID_USAGE_OVERFLOW &&
- error_code != UX_DESCRIPTOR_CORRUPTED &&
+ error_code != UX_DESCRIPTOR_CORRUPTED &&
error_code != UX_DEVICE_ENUMERATION_FAILURE)
{
diff --git a/test/regression/usbx_hid_report_descriptor_unknown_global_tag_test.c b/test/regression/usbx_hid_report_descriptor_unknown_global_tag_test.c
index f67975e7..a5c45b94 100644
--- a/test/regression/usbx_hid_report_descriptor_unknown_global_tag_test.c
+++ b/test/regression/usbx_hid_report_descriptor_unknown_global_tag_test.c
@@ -119,7 +119,7 @@ static VOID error_callback(UINT system_level, UINT system_context, UINT error_co
{
if (error_code != UX_HOST_CLASS_HID_TAG_UNSUPPORTED &&
- error_code != UX_DESCRIPTOR_CORRUPTED &&
+ error_code != UX_DESCRIPTOR_CORRUPTED &&
error_code != UX_DEVICE_ENUMERATION_FAILURE)
{
diff --git a/test/regression/usbx_hid_report_descriptor_unknown_local_tag_test.c b/test/regression/usbx_hid_report_descriptor_unknown_local_tag_test.c
index c7bbb5ed..fa88ab1a 100644
--- a/test/regression/usbx_hid_report_descriptor_unknown_local_tag_test.c
+++ b/test/regression/usbx_hid_report_descriptor_unknown_local_tag_test.c
@@ -119,7 +119,7 @@ static VOID error_callback(UINT system_level, UINT system_context, UINT error_co
{
if (error_code != UX_HOST_CLASS_HID_TAG_UNSUPPORTED &&
- error_code != UX_DESCRIPTOR_CORRUPTED &&
+ error_code != UX_DESCRIPTOR_CORRUPTED &&
error_code != UX_DEVICE_ENUMERATION_FAILURE)
{
diff --git a/test/regression/usbx_host_class_hub_port_change_connection_process_coverage_test.c b/test/regression/usbx_host_class_hub_port_change_connection_process_coverage_test.c
index 51288b59..4f4221f3 100644
--- a/test/regression/usbx_host_class_hub_port_change_connection_process_coverage_test.c
+++ b/test/regression/usbx_host_class_hub_port_change_connection_process_coverage_test.c
@@ -68,8 +68,8 @@ UX_TRANSFER *transfer_request;
/* Inform user. */
printf("Running USB host Class Hub Port Change Coverage Test ............... ");
-
- ux_system_initialize(usb_memory_pool_area, USB_MEMORY_POOL_SIZE,
+
+ ux_system_initialize(usb_memory_pool_area, USB_MEMORY_POOL_SIZE,
usb_cache_safe_memory_pool_area, USB_CACHE_SAFE_MEMORY_POOL_SIZE);
diff --git a/test/regression/usbx_host_stack_new_endpoint_create_coverage_test.c b/test/regression/usbx_host_stack_new_endpoint_create_coverage_test.c
index 0ec5f3ea..42e388e6 100644
--- a/test/regression/usbx_host_stack_new_endpoint_create_coverage_test.c
+++ b/test/regression/usbx_host_stack_new_endpoint_create_coverage_test.c
@@ -15,9 +15,9 @@ static UX_INTERFACE test_interface;
static struct UX_CONFIGURATION_STRUCT test_configuration;
static UCHAR test_interface_data[] = {
/* --------------------------------- Endpoint Descriptor */
- /* 0 bLength, bDescriptorType */ 0x04, 0x01,
- /* 2 bEndpintAddress, bmAttributes */ 0x00, 0x03,
- /* 4 wMaxPacketSize, */ 0x00, 0x04,
+ /* 0 bLength, bDescriptorType */ 0x04, 0x01,
+ /* 2 bEndpintAddress, bmAttributes */ 0x00, 0x03,
+ /* 4 wMaxPacketSize, */ 0x00, 0x04,
/* 6 bInterval */ 0x00};
#ifdef CTEST
void test_application_define(void *first_unused_memory)
@@ -35,10 +35,10 @@ UX_INTERFACE *usbx_interface = &test_interface;
printf("Running USB host Stack New Endpoint Create Coverage Test ........... ");
memory_pointer = first_unused_memory;
-
+
/* Initialize USBX Memory. */
status = ux_system_initialize(memory_pointer, UX_TEST_MEMORY_SIZE, UX_NULL, 0);
-
+
test_interface.ux_interface_configuration = &test_configuration;
status = _ux_host_stack_new_endpoint_create(usbx_interface, interface_endpoint);
diff --git a/test/regression/usbx_hub_full_speed_hub_device_test.c b/test/regression/usbx_hub_full_speed_hub_device_test.c
index 9012911a..a0f25e42 100644
--- a/test/regression/usbx_hub_full_speed_hub_device_test.c
+++ b/test/regression/usbx_hub_full_speed_hub_device_test.c
@@ -1,4 +1,4 @@
-/* This tests the case where the hub device is full speed. The specific test case
+/* This tests the case where the hub device is full speed. The specific test case
is in ux_host_class_hub_port_change_connection_process.c. */
#include "usbx_ux_test_hub.h"
diff --git a/test/regression/usbx_hub_get_hub_status_fails_during_hub_device_enum_test.c b/test/regression/usbx_hub_get_hub_status_fails_during_hub_device_enum_test.c
index e4a09fc8..44a221bc 100644
--- a/test/regression/usbx_hub_get_hub_status_fails_during_hub_device_enum_test.c
+++ b/test/regression/usbx_hub_get_hub_status_fails_during_hub_device_enum_test.c
@@ -1,5 +1,5 @@
-/* This tests the case where the get hub status commmand fails
- when a device connected to the hub is being enumerated. The specific test case
+/* This tests the case where the get hub status commmand fails
+ when a device connected to the hub is being enumerated. The specific test case
is in ux_host_class_hub_port_change_process.c. */
#include "usbx_ux_test_hub.h"
diff --git a/test/regression/usbx_hub_get_hub_status_fails_during_port_reset_test.c b/test/regression/usbx_hub_get_hub_status_fails_during_port_reset_test.c
index fb3529c8..53f3f2c5 100644
--- a/test/regression/usbx_hub_get_hub_status_fails_during_port_reset_test.c
+++ b/test/regression/usbx_hub_get_hub_status_fails_during_port_reset_test.c
@@ -1,4 +1,4 @@
-/* This tests the case where the get hub status commmand fails when a port is being reset.
+/* This tests the case where the get hub status commmand fails when a port is being reset.
The specific test case is in ux_host_class_hub_port_reset.c. */
#include "usbx_ux_test_hub.h"
@@ -38,7 +38,7 @@ static void post_init_host()
get_port_status_fail_action.status = UX_ERROR;
/* The host actually gets the port status three times - first is initial
- port status check, second is during port reset (the one we want to fail), third is necessary since
+ port status check, second is during port reset (the one we want to fail), third is necessary since
we retry enumeration. */
UX_TEST_ACTION get_port_status_match_action = {0};
get_port_status_match_action.usbx_function = UX_TEST_OVERRIDE_UX_HCD_SIM_HOST_ENTRY;
diff --git a/test/regression/usbx_hub_get_port_status_fails_during_hub_device_enum_test.c b/test/regression/usbx_hub_get_port_status_fails_during_hub_device_enum_test.c
index 0e99c1e9..0725cdf5 100644
--- a/test/regression/usbx_hub_get_port_status_fails_during_hub_device_enum_test.c
+++ b/test/regression/usbx_hub_get_port_status_fails_during_hub_device_enum_test.c
@@ -1,5 +1,5 @@
-/* This tests the case where the get port status commmand fails
- when a device connected to the hub is being enumerated. The specific test case
+/* This tests the case where the get port status commmand fails
+ when a device connected to the hub is being enumerated. The specific test case
is in ux_host_class_hub_port_change_connection_process.c. */
#include "usbx_ux_test_hub.h"
@@ -39,7 +39,7 @@ static void post_init_host()
get_port_status_fail_action.status = UX_ERROR;
/* The host actually gets the port status three times - first is initial
- port status check, second is during port reset, third is necessary since
+ port status check, second is during port reset, third is necessary since
we retry enumeration. */
UX_TEST_ACTION get_port_status_match_action = {0};
get_port_status_match_action.usbx_function = UX_TEST_OVERRIDE_UX_HCD_SIM_HOST_ENTRY;
diff --git a/test/regression/usbx_hub_hub_device_connect_test.c b/test/regression/usbx_hub_hub_device_connect_test.c
index 9658ed09..9f6ac0e3 100644
--- a/test/regression/usbx_hub_hub_device_connect_test.c
+++ b/test/regression/usbx_hub_hub_device_connect_test.c
@@ -1,4 +1,4 @@
-/* This tests the case where the device connected to the hub is disconnected.
+/* This tests the case where the device connected to the hub is disconnected.
The specific test case is in ux_host_class_hub_port_change_connection_process.c. */
#include "usbx_ux_test_hub.h"
diff --git a/test/regression/usbx_hub_hub_device_disconnect_test.c b/test/regression/usbx_hub_hub_device_disconnect_test.c
index 66b80033..1854c58f 100644
--- a/test/regression/usbx_hub_hub_device_disconnect_test.c
+++ b/test/regression/usbx_hub_hub_device_disconnect_test.c
@@ -1,4 +1,4 @@
-/* This tests the case where the device connected to the hub is disconnected.
+/* This tests the case where the device connected to the hub is disconnected.
The specific test case is in ux_host_class_hub_port_change_connection_process.c. */
#include "usbx_ux_test_hub.h"
diff --git a/test/regression/usbx_hub_hub_device_enumeration_keeps_failing_test.c b/test/regression/usbx_hub_hub_device_enumeration_keeps_failing_test.c
index 01e2348c..2c175cee 100644
--- a/test/regression/usbx_hub_hub_device_enumeration_keeps_failing_test.c
+++ b/test/regression/usbx_hub_hub_device_enumeration_keeps_failing_test.c
@@ -1,4 +1,4 @@
-/* This tests the case where the hub device's enumeration keeps failing. The
+/* This tests the case where the hub device's enumeration keeps failing. The
specific test case is in ux_host_class_hub_port_change_connection_process.c. */
#include "usbx_ux_test_hub.h"
diff --git a/test/regression/usbx_hub_invalid_device_protocol_test.c b/test/regression/usbx_hub_invalid_device_protocol_test.c
index 80e65747..e1f31299 100644
--- a/test/regression/usbx_hub_invalid_device_protocol_test.c
+++ b/test/regression/usbx_hub_invalid_device_protocol_test.c
@@ -1,4 +1,4 @@
-/* This tests the case where the hub reports an invalid device protocol. Specific
+/* This tests the case where the hub reports an invalid device protocol. Specific
test case is in ux_host_class_hub_descriptor_get.c. */
#include "usbx_ux_test_hub.h"
diff --git a/test/regression/usbx_hub_low_speed_hub_device_test.c b/test/regression/usbx_hub_low_speed_hub_device_test.c
index bdf3882b..a1484963 100644
--- a/test/regression/usbx_hub_low_speed_hub_device_test.c
+++ b/test/regression/usbx_hub_low_speed_hub_device_test.c
@@ -1,4 +1,4 @@
-/* This tests the case where the hub device is low speed. The specific test case
+/* This tests the case where the hub device is low speed. The specific test case
is in ux_host_class_hub_port_change_connection_process.c. */
#include "usbx_ux_test_hub.h"
diff --git a/test/regression/usbx_hub_multiple_tt_too_many_hub_ports_test.c b/test/regression/usbx_hub_multiple_tt_too_many_hub_ports_test.c
index d591887b..3c235df3 100644
--- a/test/regression/usbx_hub_multiple_tt_too_many_hub_ports_test.c
+++ b/test/regression/usbx_hub_multiple_tt_too_many_hub_ports_test.c
@@ -1,4 +1,4 @@
-/* This tests the case where the hub reports an invalid device protocol. Specific
+/* This tests the case where the hub reports an invalid device protocol. Specific
test case is in ux_host_class_hub_descriptor_get.c. */
#include "usbx_ux_test_hub.h"
diff --git a/test/regression/usbx_hub_port_change_enable_test.c b/test/regression/usbx_hub_port_change_enable_test.c
index 561a232d..ed073721 100644
--- a/test/regression/usbx_hub_port_change_enable_test.c
+++ b/test/regression/usbx_hub_port_change_enable_test.c
@@ -1,4 +1,4 @@
-/* This tests the case where the hub reports a port ENABLE change. The specific
+/* This tests the case where the hub reports a port ENABLE change. The specific
test case is in ux_host_class_hub_port_change_process.c. */
#include "usbx_ux_test_hub.h"
@@ -24,7 +24,7 @@ static void post_init_host()
{
#if UX_MAX_DEVICES > 1
/* Send port change enable to host. */
- set_and_send_port_event(0,
+ set_and_send_port_event(0,
UX_HOST_CLASS_HUB_PORT_CHANGE_ENABLE);
/* Wait for enum thread to complete. */
diff --git a/test/regression/usbx_hub_port_change_over_current_test.c b/test/regression/usbx_hub_port_change_over_current_test.c
index 6097fd02..80dcefb3 100644
--- a/test/regression/usbx_hub_port_change_over_current_test.c
+++ b/test/regression/usbx_hub_port_change_over_current_test.c
@@ -1,4 +1,4 @@
-/* This tests the case where the hub reports a port OVER_CURRENT change. The specific
+/* This tests the case where the hub reports a port OVER_CURRENT change. The specific
test case is in ux_host_class_hub_port_change_process.c. */
#include "usbx_ux_test_hub.h"
@@ -27,7 +27,7 @@ static void post_init_host()
ux_test_add_action_to_main_list(create_error_match_action(UX_SYSTEM_LEVEL_THREAD, UX_SYSTEM_CONTEXT_HUB, UX_OVER_CURRENT_CONDITION));
/* Send port change enable to host. */
- set_and_send_port_event(0,
+ set_and_send_port_event(0,
UX_HOST_CLASS_HUB_PORT_CHANGE_OVER_CURRENT);
/* Wait for enum thread to complete. */
diff --git a/test/regression/usbx_hub_port_change_reset_test.c b/test/regression/usbx_hub_port_change_reset_test.c
index 9d345f73..f057e627 100644
--- a/test/regression/usbx_hub_port_change_reset_test.c
+++ b/test/regression/usbx_hub_port_change_reset_test.c
@@ -1,4 +1,4 @@
-/* This tests the case where the hub reports a port RESET change. The specific
+/* This tests the case where the hub reports a port RESET change. The specific
test case is in ux_host_class_hub_port_change_process.c. */
#include "usbx_ux_test_hub.h"
@@ -24,7 +24,7 @@ static void post_init_host()
{
#if UX_MAX_DEVICES > 1
/* Send port change enable to host. */
- set_and_send_port_event(0,
+ set_and_send_port_event(0,
UX_HOST_CLASS_HUB_PORT_CHANGE_RESET);
/* Wait for enum thread to complete. */
diff --git a/test/regression/usbx_hub_port_change_suspend_test.c b/test/regression/usbx_hub_port_change_suspend_test.c
index 3cedad62..d2e12674 100644
--- a/test/regression/usbx_hub_port_change_suspend_test.c
+++ b/test/regression/usbx_hub_port_change_suspend_test.c
@@ -1,4 +1,4 @@
-/* This tests the case where the hub reports a port SUSPEND change. The specific
+/* This tests the case where the hub reports a port SUSPEND change. The specific
test case is in ux_host_class_hub_port_change_process.c. */
#include "usbx_ux_test_hub.h"
@@ -24,7 +24,7 @@ static void post_init_host()
{
#if UX_MAX_DEVICES > 1
/* Send port change enable to host. */
- set_and_send_port_event(0,
+ set_and_send_port_event(0,
UX_HOST_CLASS_HUB_PORT_CHANGE_SUSPEND);
/* Wait for enum thread to complete. */
diff --git a/test/regression/usbx_hub_port_never_reset_test.c b/test/regression/usbx_hub_port_never_reset_test.c
index 6bdd4ef3..1047ac7a 100644
--- a/test/regression/usbx_hub_port_never_reset_test.c
+++ b/test/regression/usbx_hub_port_never_reset_test.c
@@ -1,4 +1,4 @@
-/* This tests the case where the port reset fails because the hub never reports that the port was RESET.
+/* This tests the case where the port reset fails because the hub never reports that the port was RESET.
The specific test case is in ux_host_class_hub_port_reset.c. */
#include "usbx_ux_test_hub.h"
diff --git a/test/regression/usbx_hub_port_reset_fails_during_hub_device_enum_test.c b/test/regression/usbx_hub_port_reset_fails_during_hub_device_enum_test.c
index 8546c314..86585a64 100644
--- a/test/regression/usbx_hub_port_reset_fails_during_hub_device_enum_test.c
+++ b/test/regression/usbx_hub_port_reset_fails_during_hub_device_enum_test.c
@@ -1,5 +1,5 @@
-/* This tests the case where the port reset commmand fails
- when a device connected to the hub is being enumerated. The specific test case
+/* This tests the case where the port reset commmand fails
+ when a device connected to the hub is being enumerated. The specific test case
is in ux_host_class_hub_port_change_connection_process.c. */
#include "usbx_ux_test_hub.h"
diff --git a/test/regression/usbx_hub_quick_hub_device_disconnection_test.c b/test/regression/usbx_hub_quick_hub_device_disconnection_test.c
index b8f32d78..35da4606 100644
--- a/test/regression/usbx_hub_quick_hub_device_disconnection_test.c
+++ b/test/regression/usbx_hub_quick_hub_device_disconnection_test.c
@@ -1,6 +1,6 @@
/* This tests the case where the hub reports a device disconnection even though
no device was previously on that port. This can happen if the device is connected
- then quickly disconnected, before USBX processes the connection. The specific
+ then quickly disconnected, before USBX processes the connection. The specific
test case is in ux_host_class_hub_port_change_connection_process.c. */
#include "usbx_ux_test_hub.h"
diff --git a/test/regression/usbx_hub_single_tt_too_many_hub_ports_test.c b/test/regression/usbx_hub_single_tt_too_many_hub_ports_test.c
index 6c0ecc38..a6cd4314 100644
--- a/test/regression/usbx_hub_single_tt_too_many_hub_ports_test.c
+++ b/test/regression/usbx_hub_single_tt_too_many_hub_ports_test.c
@@ -1,4 +1,4 @@
-/* This tests the case where the hub reports an invalid device protocol. Specific
+/* This tests the case where the hub reports an invalid device protocol. Specific
test case is in ux_host_class_hub_descriptor_get.c. */
#include "usbx_ux_test_hub.h"
diff --git a/test/regression/usbx_msrc_69702_dfu_dnload_test.c b/test/regression/usbx_msrc_69702_dfu_dnload_test.c
index 72694881..46edce1a 100644
--- a/test/regression/usbx_msrc_69702_dfu_dnload_test.c
+++ b/test/regression/usbx_msrc_69702_dfu_dnload_test.c
@@ -101,16 +101,16 @@ static UCHAR dfu_device_buffer[UX_DEMO_REQUEST_MAX
0x00, \
#define DEVICE_FRAMEWORK_LENGTH_FULL_SPEED sizeof(device_framework_full_speed)
-static UCHAR device_framework_full_speed[] = {
+static UCHAR device_framework_full_speed[] = {
/* Device descriptor */
0x12, 0x01, 0x10, 0x01, 0x00, 0x00, 0x00, 0x40,
0x99, 0x99, 0x00, 0x00, 0x00, 0x00, 0x01, 0x02,
- 0x03, 0x01,
+ 0x03, 0x01,
/* Configuration descriptor */
0x09, 0x02, 0x1b, 0x00, 0x01, 0x01, 0x00, 0xc0,
- 0x32,
+ 0x32,
/* Interface descriptor for DFU (bInterfaceProtocol = 1). */
DFU_INTERFACE_DESCRIPTOR(0x00, 0x01)
@@ -118,12 +118,12 @@ static UCHAR device_framework_full_speed[] = {
};
#define DEVICE_FRAMEWORK_LENGTH_HIGH_SPEED sizeof(device_framework_high_speed)
-static UCHAR device_framework_high_speed[] = {
+static UCHAR device_framework_high_speed[] = {
/* Device descriptor */
0x12, 0x01, 0x00, 0x02, 0x00, 0x00, 0x00, 0x40,
0x99, 0x99, 0x00, 0x00, 0x01, 0x00, 0x01, 0x02,
- 0x03, 0x01,
+ 0x03, 0x01,
/* Device qualifier descriptor */
0x0a, 0x06, 0x00, 0x02, 0x00, 0x00, 0x00, 0x40,
@@ -131,7 +131,7 @@ static UCHAR device_framework_high_speed[] = {
/* Configuration descriptor */
0x09, 0x02, 0x1b, 0x00, 0x01, 0x01, 0x00, 0xc0,
- 0x32,
+ 0x32,
/* Interface descriptor for DFU (bInterfaceProtocol = 1). */
DFU_INTERFACE_DESCRIPTOR(0x00, 0x01)
@@ -175,16 +175,16 @@ static UCHAR language_id_framework[] = {
#define DEVICE_FRAMEWORK_LENGTH_DFU sizeof(device_framework_dfu)
-static UCHAR device_framework_dfu[] = {
+static UCHAR device_framework_dfu[] = {
/* Device descriptor */
0x12, 0x01, 0x10, 0x01, 0x00, 0x00, 0x00, 0x40,
0x99, 0x99, 0x00, 0x00, 0x00, 0x00, 0x01, 0x02,
- 0x03, 0x01,
+ 0x03, 0x01,
/* Configuration descriptor */
0x09, 0x02, 0x1B, 0x00, 0x01, 0x01, 0x00, 0xc0,
- 0x32,
+ 0x32,
/* Interface descriptor for DFU (bInterfaceProtocol = 2). */
DFU_INTERFACE_DESCRIPTOR(0x00, 0x02)
@@ -312,7 +312,7 @@ ULONG test_n;
dfu_parameter.ux_slave_class_dfu_parameter_instance_activate = demo_thread_dfu_activate;
dfu_parameter.ux_slave_class_dfu_parameter_instance_deactivate = demo_thread_dfu_deactivate;
dfu_parameter.ux_slave_class_dfu_parameter_read = demo_thread_dfu_read;
- dfu_parameter.ux_slave_class_dfu_parameter_write = demo_thread_dfu_write;
+ dfu_parameter.ux_slave_class_dfu_parameter_write = demo_thread_dfu_write;
dfu_parameter.ux_slave_class_dfu_parameter_get_status = demo_thread_dfu_get_status;
dfu_parameter.ux_slave_class_dfu_parameter_notify = demo_thread_dfu_notify;
#ifdef UX_DEVICE_CLASS_DFU_CUSTOM_REQUEST_ENABLE
@@ -322,7 +322,7 @@ ULONG test_n;
dfu_parameter.ux_slave_class_dfu_parameter_framework_length = DEVICE_FRAMEWORK_LENGTH_DFU;
/* Initilize the device dfu class. The class is connected with interface 1 on configuration 1. */
- status = ux_device_stack_class_register(_ux_system_slave_class_dfu_name, ux_device_class_dfu_entry,
+ status = ux_device_stack_class_register(_ux_system_slave_class_dfu_name, ux_device_class_dfu_entry,
1, 0, (VOID *)&dfu_parameter);
if(status!=UX_SUCCESS)
{
@@ -745,7 +745,7 @@ static UINT demo_thread_dfu_get_status(VOID *dfu, ULONG *media_status)
/* Return media status ok. */
*media_status = UX_SLAVE_CLASS_DFU_MEDIA_STATUS_OK ;
-
+
return(UX_SUCCESS);
}
@@ -760,12 +760,12 @@ static UINT demo_thread_dfu_notify(VOID *dfu, ULONG notification)
/* Begin of Download. */
break;
-
+
case UX_SLAVE_CLASS_DFU_NOTIFICATION_END_DOWNLOAD :
/* Completion of Download. */
break;
-
+
case UX_SLAVE_CLASS_DFU_NOTIFICATION_ABORT_DOWNLOAD :
/* Download was aborted. */
@@ -775,17 +775,17 @@ static UINT demo_thread_dfu_notify(VOID *dfu, ULONG notification)
/* Begin of UPLOAD. */
break;
-
+
case UX_SLAVE_CLASS_DFU_NOTIFICATION_END_UPLOAD :
/* Completion of UPLOAD. */
break;
-
+
case UX_SLAVE_CLASS_DFU_NOTIFICATION_ABORT_UPLOAD :
/* Download was aborted. */
break;
-
+
default :
/* Bad notification signal. Should never get here. */
diff --git a/test/regression/usbx_msrc_71934_dfu_upload_test.c b/test/regression/usbx_msrc_71934_dfu_upload_test.c
index 5e4ec48a..b3a5dcc7 100644
--- a/test/regression/usbx_msrc_71934_dfu_upload_test.c
+++ b/test/regression/usbx_msrc_71934_dfu_upload_test.c
@@ -101,16 +101,16 @@ static UCHAR dfu_device_buffer[UX_DEMO_REQUEST_MAX
0x00, \
#define DEVICE_FRAMEWORK_LENGTH_FULL_SPEED sizeof(device_framework_full_speed)
-static UCHAR device_framework_full_speed[] = {
+static UCHAR device_framework_full_speed[] = {
/* Device descriptor */
0x12, 0x01, 0x10, 0x01, 0x00, 0x00, 0x00, 0x40,
0x99, 0x99, 0x00, 0x00, 0x00, 0x00, 0x01, 0x02,
- 0x03, 0x01,
+ 0x03, 0x01,
/* Configuration descriptor */
0x09, 0x02, 0x1b, 0x00, 0x01, 0x01, 0x00, 0xc0,
- 0x32,
+ 0x32,
/* Interface descriptor for DFU (bInterfaceProtocol = 1). */
DFU_INTERFACE_DESCRIPTOR(0x00, 0x01)
@@ -118,12 +118,12 @@ static UCHAR device_framework_full_speed[] = {
};
#define DEVICE_FRAMEWORK_LENGTH_HIGH_SPEED sizeof(device_framework_high_speed)
-static UCHAR device_framework_high_speed[] = {
+static UCHAR device_framework_high_speed[] = {
/* Device descriptor */
0x12, 0x01, 0x00, 0x02, 0x00, 0x00, 0x00, 0x40,
0x99, 0x99, 0x00, 0x00, 0x01, 0x00, 0x01, 0x02,
- 0x03, 0x01,
+ 0x03, 0x01,
/* Device qualifier descriptor */
0x0a, 0x06, 0x00, 0x02, 0x00, 0x00, 0x00, 0x40,
@@ -131,7 +131,7 @@ static UCHAR device_framework_high_speed[] = {
/* Configuration descriptor */
0x09, 0x02, 0x1b, 0x00, 0x01, 0x01, 0x00, 0xc0,
- 0x32,
+ 0x32,
/* Interface descriptor for DFU (bInterfaceProtocol = 1). */
DFU_INTERFACE_DESCRIPTOR(0x00, 0x01)
@@ -175,16 +175,16 @@ static UCHAR language_id_framework[] = {
#define DEVICE_FRAMEWORK_LENGTH_DFU sizeof(device_framework_dfu)
-static UCHAR device_framework_dfu[] = {
+static UCHAR device_framework_dfu[] = {
/* Device descriptor */
0x12, 0x01, 0x10, 0x01, 0x00, 0x00, 0x00, 0x40,
0x99, 0x99, 0x00, 0x00, 0x00, 0x00, 0x01, 0x02,
- 0x03, 0x01,
+ 0x03, 0x01,
/* Configuration descriptor */
0x09, 0x02, 0x1B, 0x00, 0x01, 0x01, 0x00, 0xc0,
- 0x32,
+ 0x32,
/* Interface descriptor for DFU (bInterfaceProtocol = 2). */
DFU_INTERFACE_DESCRIPTOR(0x00, 0x02)
@@ -312,7 +312,7 @@ ULONG test_n;
dfu_parameter.ux_slave_class_dfu_parameter_instance_activate = demo_thread_dfu_activate;
dfu_parameter.ux_slave_class_dfu_parameter_instance_deactivate = demo_thread_dfu_deactivate;
dfu_parameter.ux_slave_class_dfu_parameter_read = demo_thread_dfu_read;
- dfu_parameter.ux_slave_class_dfu_parameter_write = demo_thread_dfu_write;
+ dfu_parameter.ux_slave_class_dfu_parameter_write = demo_thread_dfu_write;
dfu_parameter.ux_slave_class_dfu_parameter_get_status = demo_thread_dfu_get_status;
dfu_parameter.ux_slave_class_dfu_parameter_notify = demo_thread_dfu_notify;
#ifdef UX_DEVICE_CLASS_DFU_CUSTOM_REQUEST_ENABLE
@@ -322,7 +322,7 @@ ULONG test_n;
dfu_parameter.ux_slave_class_dfu_parameter_framework_length = DEVICE_FRAMEWORK_LENGTH_DFU;
/* Initilize the device dfu class. The class is connected with interface 1 on configuration 1. */
- status = ux_device_stack_class_register(_ux_system_slave_class_dfu_name, ux_device_class_dfu_entry,
+ status = ux_device_stack_class_register(_ux_system_slave_class_dfu_name, ux_device_class_dfu_entry,
1, 0, (VOID *)&dfu_parameter);
if(status!=UX_SUCCESS)
{
@@ -705,7 +705,7 @@ static UINT demo_thread_dfu_get_status(VOID *dfu, ULONG *media_status)
/* Return media status ok. */
*media_status = UX_SLAVE_CLASS_DFU_MEDIA_STATUS_OK ;
-
+
return(UX_SUCCESS);
}
@@ -720,12 +720,12 @@ static UINT demo_thread_dfu_notify(VOID *dfu, ULONG notification)
/* Begin of Download. */
break;
-
+
case UX_SLAVE_CLASS_DFU_NOTIFICATION_END_DOWNLOAD :
/* Completion of Download. */
break;
-
+
case UX_SLAVE_CLASS_DFU_NOTIFICATION_ABORT_DOWNLOAD :
/* Download was aborted. */
@@ -735,17 +735,17 @@ static UINT demo_thread_dfu_notify(VOID *dfu, ULONG notification)
/* Begin of UPLOAD. */
break;
-
+
case UX_SLAVE_CLASS_DFU_NOTIFICATION_END_UPLOAD :
/* Completion of UPLOAD. */
break;
-
+
case UX_SLAVE_CLASS_DFU_NOTIFICATION_ABORT_UPLOAD :
/* Download was aborted. */
break;
-
+
default :
/* Bad notification signal. Should never get here. */
diff --git a/test/regression/usbx_msrc_72227_host_pima_read_test.c b/test/regression/usbx_msrc_72227_host_pima_read_test.c
index 8b783f5a..ad09aa59 100644
--- a/test/regression/usbx_msrc_72227_host_pima_read_test.c
+++ b/test/regression/usbx_msrc_72227_host_pima_read_test.c
@@ -993,7 +993,7 @@ UINT status;
_ux_utility_short_put(buffer + UX_DEVICE_CLASS_PIMA_DATA_HEADER_CODE,
UX_DEVICE_CLASS_PIMA_OC_GET_STORAGE_IDS);
/* Fill in the Transaction ID. */
- _ux_utility_long_put(buffer + UX_DEVICE_CLASS_PIMA_DATA_HEADER_TRANSACTION_ID,
+ _ux_utility_long_put(buffer + UX_DEVICE_CLASS_PIMA_DATA_HEADER_TRANSACTION_ID,
pima -> ux_device_class_pima_transaction_id);
/* Fill array. */
array = (ULONG*)(buffer + UX_DEVICE_CLASS_PIMA_DATA_HEADER_SIZE);
@@ -1005,7 +1005,7 @@ UINT status;
for (i = 0; i < array_length; i ++)
array[i] = i;
/* Fill in the size of the response header. */
- _ux_utility_long_put(buffer + UX_DEVICE_CLASS_PIMA_DATA_HEADER_LENGTH,
+ _ux_utility_long_put(buffer + UX_DEVICE_CLASS_PIMA_DATA_HEADER_LENGTH,
container_length);
status = _ux_device_stack_transfer_request(transfer, trans_length, 0);
status = _ux_device_class_pima_response_send(pima, UX_DEVICE_CLASS_PIMA_RC_OK, 0, 0, 0, 0);
diff --git a/test/regression/usbx_msrc_72427_ecm_host_mac_test.c b/test/regression/usbx_msrc_72427_ecm_host_mac_test.c
index 8248d133..84e20455 100644
--- a/test/regression/usbx_msrc_72427_ecm_host_mac_test.c
+++ b/test/regression/usbx_msrc_72427_ecm_host_mac_test.c
@@ -20,7 +20,7 @@ static unsigned char invalid_mac_address_string_length[] = {
0x30, 0x30, 0x30, 0x31,
/* MAC Address string descriptor : Index 4 - "001E5841B878" */
- 0x09, 0x04, 0x04,
+ 0x09, 0x04, 0x04,
0x1, /* This byte is the length of the string. It just needs to be small (look in mac_address_get.c). */
0x30, 0x30,
diff --git a/test/regression/usbx_msrc_72525_host_pima_obj_handles_get_test.c b/test/regression/usbx_msrc_72525_host_pima_obj_handles_get_test.c
index 8625d242..27589032 100644
--- a/test/regression/usbx_msrc_72525_host_pima_obj_handles_get_test.c
+++ b/test/regression/usbx_msrc_72525_host_pima_obj_handles_get_test.c
@@ -993,7 +993,7 @@ UINT status;
_ux_utility_short_put(buffer + UX_DEVICE_CLASS_PIMA_DATA_HEADER_CODE,
UX_DEVICE_CLASS_PIMA_OC_GET_OBJECT_HANDLES);
/* Fill in the Transaction ID. */
- _ux_utility_long_put(buffer + UX_DEVICE_CLASS_PIMA_DATA_HEADER_TRANSACTION_ID,
+ _ux_utility_long_put(buffer + UX_DEVICE_CLASS_PIMA_DATA_HEADER_TRANSACTION_ID,
pima -> ux_device_class_pima_transaction_id);
/* Fill array. */
array = (ULONG*)(buffer + UX_DEVICE_CLASS_PIMA_DATA_HEADER_SIZE);
@@ -1005,7 +1005,7 @@ UINT status;
for (i = 0; i < array_length; i ++)
array[i] = i;
/* Fill in the size of the response header. */
- _ux_utility_long_put(buffer + UX_DEVICE_CLASS_PIMA_DATA_HEADER_LENGTH,
+ _ux_utility_long_put(buffer + UX_DEVICE_CLASS_PIMA_DATA_HEADER_LENGTH,
container_length);
status = _ux_device_stack_transfer_request(transfer, container_length, 0);
status = _ux_device_class_pima_response_send(pima, UX_DEVICE_CLASS_PIMA_RC_OK, 0, 0, 0, 0);
diff --git a/test/regression/usbx_msrc_72619_host_pima_stor_ids_get_test.c b/test/regression/usbx_msrc_72619_host_pima_stor_ids_get_test.c
index 0e339ce1..8935c98a 100644
--- a/test/regression/usbx_msrc_72619_host_pima_stor_ids_get_test.c
+++ b/test/regression/usbx_msrc_72619_host_pima_stor_ids_get_test.c
@@ -993,7 +993,7 @@ UINT status;
_ux_utility_short_put(buffer + UX_DEVICE_CLASS_PIMA_DATA_HEADER_CODE,
UX_DEVICE_CLASS_PIMA_OC_GET_STORAGE_IDS);
/* Fill in the Transaction ID. */
- _ux_utility_long_put(buffer + UX_DEVICE_CLASS_PIMA_DATA_HEADER_TRANSACTION_ID,
+ _ux_utility_long_put(buffer + UX_DEVICE_CLASS_PIMA_DATA_HEADER_TRANSACTION_ID,
pima -> ux_device_class_pima_transaction_id);
/* Fill array. */
array = (ULONG*)(buffer + UX_DEVICE_CLASS_PIMA_DATA_HEADER_SIZE);
@@ -1005,7 +1005,7 @@ UINT status;
for (i = 0; i < array_length; i ++)
array[i] = i;
/* Fill in the size of the response header. */
- _ux_utility_long_put(buffer + UX_DEVICE_CLASS_PIMA_DATA_HEADER_LENGTH,
+ _ux_utility_long_put(buffer + UX_DEVICE_CLASS_PIMA_DATA_HEADER_LENGTH,
container_length);
status = _ux_device_stack_transfer_request(transfer, container_length, 0);
status = _ux_device_class_pima_response_send(pima, UX_DEVICE_CLASS_PIMA_RC_OK, 0, 0, 0, 0);
diff --git a/test/regression/usbx_msrc_73386_host_storage_media_open_buffer_test.c b/test/regression/usbx_msrc_73386_host_storage_media_open_buffer_test.c
index 4f775464..e7d60248 100644
--- a/test/regression/usbx_msrc_73386_host_storage_media_open_buffer_test.c
+++ b/test/regression/usbx_msrc_73386_host_storage_media_open_buffer_test.c
@@ -542,7 +542,7 @@ static UINT demo_thread_media_read(VOID *storage, ULONG lun, UCHAR * data_poi
if (lun > 1)
return UX_ERROR;
-
+
ram_disk_read_sent = UX_TRUE;
if (ram_disk_read_status != UX_SUCCESS)
diff --git a/test/regression/usbx_msrc_80991_device_rndis_rx_length_less_than_14_test.c b/test/regression/usbx_msrc_80991_device_rndis_rx_length_less_than_14_test.c
index b38eb961..a5d015c3 100644
--- a/test/regression/usbx_msrc_80991_device_rndis_rx_length_less_than_14_test.c
+++ b/test/regression/usbx_msrc_80991_device_rndis_rx_length_less_than_14_test.c
@@ -91,7 +91,7 @@ static unsigned char device_framework_high_speed[] = {
/* Configuration Descriptor */
0x09, /* bLength */
0x02, /* bDescriptorType */
-
+
#ifdef USE_ZERO_ENDPOINT_SETTING
0x58, 0x00, /* wTotalLength */
#else
@@ -398,21 +398,21 @@ UX_ENDPOINT *endpoint;
/* Fix it, now! - we need to add the RNDIS header. */
/* Copy that packet payload. */
- memcpy(host_bulk_endpoint_transfer_data + UX_DEVICE_CLASS_RNDIS_PACKET_HEADER_LENGTH,
- transfer_request->ux_transfer_request_data_pointer,
+ memcpy(host_bulk_endpoint_transfer_data + UX_DEVICE_CLASS_RNDIS_PACKET_HEADER_LENGTH,
+ transfer_request->ux_transfer_request_data_pointer,
transfer_request->ux_transfer_request_requested_length);
/* Add the RNDIS header to this packet. */
_ux_utility_long_put(host_bulk_endpoint_transfer_data + UX_DEVICE_CLASS_RNDIS_PACKET_MESSAGE_TYPE, UX_DEVICE_CLASS_RNDIS_PACKET_HEADER_MSG);
- _ux_utility_long_put(host_bulk_endpoint_transfer_data + UX_DEVICE_CLASS_RNDIS_PACKET_MESSAGE_LENGTH,
+ _ux_utility_long_put(host_bulk_endpoint_transfer_data + UX_DEVICE_CLASS_RNDIS_PACKET_MESSAGE_LENGTH,
transfer_request->ux_transfer_request_requested_length + UX_DEVICE_CLASS_RNDIS_PACKET_HEADER_LENGTH);
_ux_utility_long_put(host_bulk_endpoint_transfer_data + UX_DEVICE_CLASS_RNDIS_PACKET_DATA_OFFSET,
UX_DEVICE_CLASS_RNDIS_PACKET_HEADER_LENGTH - UX_DEVICE_CLASS_RNDIS_PACKET_DATA_OFFSET);
- _ux_utility_long_put(host_bulk_endpoint_transfer_data + UX_DEVICE_CLASS_RNDIS_PACKET_DATA_LENGTH,
+ _ux_utility_long_put(host_bulk_endpoint_transfer_data + UX_DEVICE_CLASS_RNDIS_PACKET_DATA_LENGTH,
transfer_request->ux_transfer_request_requested_length);
/* The original data pointer points to the packet, so no leak. We also
@@ -576,7 +576,7 @@ UX_SLAVE_TRANSFER *interrupt_transfer;
UX_TEST_CHECK_SUCCESS(nx_packet_pool_create(&packet_pool_device, "NetX Device Packet Pool", PACKET_PAYLOAD, packet_pool_memory_device, PACKET_POOL_SIZE));
- UX_TEST_CHECK_SUCCESS(nx_ip_create(&nx_ip_device, "NetX Device Thread", DEVICE_IP_ADDRESS, 0xFF000000L, &packet_pool_device,
+ UX_TEST_CHECK_SUCCESS(nx_ip_create(&nx_ip_device, "NetX Device Thread", DEVICE_IP_ADDRESS, 0xFF000000L, &packet_pool_device,
_ux_network_driver_entry, ip_thread_stack_device, DEMO_IP_THREAD_STACK_SIZE, 1));
/* Setup ARP. */
@@ -602,7 +602,7 @@ UX_SLAVE_TRANSFER *interrupt_transfer;
/* Set the parameters for callback when insertion/extraction of a CDC device. */
rndis_parameter.ux_slave_class_rndis_instance_activate = demo_rndis_instance_activate;
rndis_parameter.ux_slave_class_rndis_instance_deactivate = demo_rndis_instance_deactivate;
-
+
/* Define a local NODE ID. */
rndis_parameter.ux_slave_class_rndis_parameter_local_node_id[0] = 0x00;
rndis_parameter.ux_slave_class_rndis_parameter_local_node_id[1] = 0x1e;
@@ -657,7 +657,7 @@ UX_SLAVE_TRANSFER *interrupt_transfer;
/* Set the request itself. */
*(notification_buffer + UX_SETUP_REQUEST) = 0;
-
+
/* Set the value. It is the network link. */
_ux_utility_short_put(notification_buffer + UX_SETUP_VALUE, (USHORT)(rndis_device->ux_slave_class_rndis_link_state));
diff --git a/test/regression/usbx_msrc_81206_81225_ecm_multiple_data_reject_test.c b/test/regression/usbx_msrc_81206_81225_ecm_multiple_data_reject_test.c
index f3642d78..2ca59c58 100644
--- a/test/regression/usbx_msrc_81206_81225_ecm_multiple_data_reject_test.c
+++ b/test/regression/usbx_msrc_81206_81225_ecm_multiple_data_reject_test.c
@@ -399,7 +399,7 @@ UINT i;
ux_test_hcd_sim_host_set_actions(replace_configuration_descriptor);
ux_test_connect_slave_and_host_wait_for_enum_completion();
UX_TEST_ASSERT(ux_test_check_actions_empty());
-
+
for (i = 0; i < 5; i ++)
{
diff --git a/test/regression/usbx_msrc_81325_host_hid_remote_control_free_callback_test.c b/test/regression/usbx_msrc_81325_host_hid_remote_control_free_callback_test.c
index 42f898d6..6bf877b4 100644
--- a/test/regression/usbx_msrc_81325_host_hid_remote_control_free_callback_test.c
+++ b/test/regression/usbx_msrc_81325_host_hid_remote_control_free_callback_test.c
@@ -51,11 +51,11 @@ static UCHAR device_framework_full_speed[DEVICE_FRAMEWORK_LENGTH_FULL_SPEED] = {
/* Device descriptor */
0x12, 0x01, 0x10, 0x01, 0x00, 0x00, 0x00, 0x08,
0x81, 0x0A, 0x01, 0x01, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x01,
+ 0x00, 0x01,
/* Configuration descriptor */
0x09, 0x02, 0x22, 0x00, 0x01, 0x01, 0x00, 0xc0,
- 0x32,
+ 0x32,
/* Interface descriptor */
0x09, 0x04, 0x02, 0x00, 0x01, 0x03, 0x00, 0x00,
@@ -69,15 +69,15 @@ static UCHAR device_framework_full_speed[DEVICE_FRAMEWORK_LENGTH_FULL_SPEED] = {
0x07, 0x05, 0x82, 0x03, 0x08, 0x00, 0x08
};
-
-
+
+
#define DEVICE_FRAMEWORK_LENGTH_HIGH_SPEED 62
static UCHAR device_framework_high_speed[DEVICE_FRAMEWORK_LENGTH_HIGH_SPEED] = {
/* Device descriptor */
0x12, 0x01, 0x00, 0x02, 0x00, 0x00, 0x00, 0x40,
0x0a, 0x07, 0x25, 0x40, 0x01, 0x00, 0x01, 0x02,
- 0x03, 0x01,
+ 0x03, 0x01,
/* Device qualifier descriptor */
0x0a, 0x06, 0x00, 0x02, 0x00, 0x00, 0x00, 0x40,
@@ -85,7 +85,7 @@ static UCHAR device_framework_high_speed[DEVICE_FRAMEWORK_LENGTH_HIGH_SPEED] = {
/* Configuration descriptor */
0x09, 0x02, 0x22, 0x00, 0x01, 0x01, 0x00, 0xc0,
- 0x32,
+ 0x32,
/* Interface descriptor */
0x09, 0x04, 0x02, 0x00, 0x01, 0x03, 0x00, 0x00,
@@ -96,32 +96,32 @@ static UCHAR device_framework_high_speed[DEVICE_FRAMEWORK_LENGTH_HIGH_SPEED] = {
MSB(HID_REPORT_LENGTH),
/* Endpoint descriptor (Interrupt) */
- 0x07, 0x05, 0x82, 0x03, 0x08, 0x00, 0x08
+ 0x07, 0x05, 0x82, 0x03, 0x08, 0x00, 0x08
};
-
+
/* String Device Framework :
Byte 0 and 1 : Word containing the language ID : 0x0904 for US
Byte 2 : Byte containing the index of the descriptor
Byte 3 : Byte containing the length of the descriptor string
*/
-
+
#define STRING_FRAMEWORK_LENGTH 40
-static UCHAR string_framework[] = {
+static UCHAR string_framework[] = {
/* Manufacturer string descriptor : Index 1 */
- 0x09, 0x04, 0x01, 0x0c,
- 0x45, 0x78, 0x70, 0x72,0x65, 0x73, 0x20, 0x4c,
+ 0x09, 0x04, 0x01, 0x0c,
+ 0x45, 0x78, 0x70, 0x72,0x65, 0x73, 0x20, 0x4c,
0x6f, 0x67, 0x69, 0x63,
/* Product string descriptor : Index 2 */
- 0x09, 0x04, 0x02, 0x0c,
- 0x55, 0x53, 0x42, 0x20, 0x4b, 0x65, 0x79, 0x62,
- 0x6f, 0x61, 0x72, 0x64,
+ 0x09, 0x04, 0x02, 0x0c,
+ 0x55, 0x53, 0x42, 0x20, 0x4b, 0x65, 0x79, 0x62,
+ 0x6f, 0x61, 0x72, 0x64,
/* Serial Number string descriptor : Index 3 */
- 0x09, 0x04, 0x03, 0x04,
+ 0x09, 0x04, 0x03, 0x04,
0x30, 0x30, 0x30, 0x31
};
@@ -131,7 +131,7 @@ static UCHAR string_framework[] = {
be appended to the language_id_framework array and the length
adjusted accordingly. */
#define LANGUAGE_ID_FRAMEWORK_LENGTH 2
-static UCHAR language_id_framework[] = {
+static UCHAR language_id_framework[] = {
/* English. */
0x09, 0x04
@@ -176,7 +176,7 @@ void test_application_define(void *first_unused_memory)
void usbx_msrc_81325_host_hid_remote_control_free_callback_test_application_define(void *first_unused_memory)
#endif
{
-
+
UINT status;
CHAR * stack_pointer;
CHAR * memory_pointer;
@@ -211,7 +211,7 @@ CHAR * memory_pointer;
printf("Error on line %d, error code: %d\n", __LINE__, status);
test_control_return(1);
}
-
+
status = ux_host_stack_class_register(_ux_system_host_class_hid_name, ux_host_class_hid_entry);
if (status != UX_SUCCESS)
{
@@ -248,7 +248,7 @@ CHAR * memory_pointer;
hid_parameter.ux_device_class_hid_parameter_callback = demo_thread_hid_callback;
/* Initilize the device hid class. The class is connected with interface 2 */
- status = ux_device_stack_class_register(_ux_system_slave_class_hid_name, ux_device_class_hid_entry,
+ status = ux_device_stack_class_register(_ux_system_slave_class_hid_name, ux_device_class_hid_entry,
1,2, (VOID *)&hid_parameter);
if(status!=UX_SUCCESS)
{
@@ -267,7 +267,7 @@ CHAR * memory_pointer;
printf("Error on line %d, error code: %d\n", __LINE__, status);
test_control_return(1);
}
-
+
/* Register all the USB host controllers available in this system */
status = ux_host_stack_hcd_register(_ux_system_host_hcd_simulator_name, ux_hcd_sim_host_initialize,0,0);
@@ -280,8 +280,8 @@ CHAR * memory_pointer;
}
/* Create the main host simulation thread. */
- status = tx_thread_create(&tx_demo_thread_host_simulation, "tx demo host simulation", tx_demo_thread_host_simulation_entry, 0,
- stack_pointer, UX_DEMO_STACK_SIZE,
+ status = tx_thread_create(&tx_demo_thread_host_simulation, "tx demo host simulation", tx_demo_thread_host_simulation_entry, 0,
+ stack_pointer, UX_DEMO_STACK_SIZE,
20, 20, 1, TX_AUTO_START);
/* Check for error. */
@@ -319,11 +319,11 @@ UINT i;
UX_TEST_ASSERT(hid_client == UX_NULL);
/* And deinitialize the class. */
- status = ux_device_stack_class_unregister(_ux_system_slave_class_hid_name, ux_device_class_hid_entry);
-
+ status = ux_device_stack_class_unregister(_ux_system_slave_class_hid_name, ux_device_class_hid_entry);
+
/* Deinitialize the device side of usbx. */
_ux_device_stack_uninitialize();
-
+
/* And finally the usbx system resources. */
_ux_system_uninitialize();
diff --git a/test/regression/usbx_msrc_81326_host_hid_keyboard_free_callback_test.c b/test/regression/usbx_msrc_81326_host_hid_keyboard_free_callback_test.c
index f31a92de..849f60dc 100644
--- a/test/regression/usbx_msrc_81326_host_hid_keyboard_free_callback_test.c
+++ b/test/regression/usbx_msrc_81326_host_hid_keyboard_free_callback_test.c
@@ -51,11 +51,11 @@ static UCHAR device_framework_full_speed[DEVICE_FRAMEWORK_LENGTH_FULL_SPEED] = {
/* Device descriptor */
0x12, 0x01, 0x10, 0x01, 0x00, 0x00, 0x00, 0x08,
0x81, 0x0A, 0x01, 0x01, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x01,
+ 0x00, 0x01,
/* Configuration descriptor */
0x09, 0x02, 0x22, 0x00, 0x01, 0x01, 0x00, 0xc0,
- 0x32,
+ 0x32,
/* Interface descriptor */
0x09, 0x04, 0x02, 0x00, 0x01, 0x03, 0x00, 0x00,
@@ -69,15 +69,15 @@ static UCHAR device_framework_full_speed[DEVICE_FRAMEWORK_LENGTH_FULL_SPEED] = {
0x07, 0x05, 0x82, 0x03, 0x08, 0x00, 0x08
};
-
-
+
+
#define DEVICE_FRAMEWORK_LENGTH_HIGH_SPEED 62
static UCHAR device_framework_high_speed[DEVICE_FRAMEWORK_LENGTH_HIGH_SPEED] = {
/* Device descriptor */
0x12, 0x01, 0x00, 0x02, 0x00, 0x00, 0x00, 0x40,
0x0a, 0x07, 0x25, 0x40, 0x01, 0x00, 0x01, 0x02,
- 0x03, 0x01,
+ 0x03, 0x01,
/* Device qualifier descriptor */
0x0a, 0x06, 0x00, 0x02, 0x00, 0x00, 0x00, 0x40,
@@ -85,7 +85,7 @@ static UCHAR device_framework_high_speed[DEVICE_FRAMEWORK_LENGTH_HIGH_SPEED] = {
/* Configuration descriptor */
0x09, 0x02, 0x22, 0x00, 0x01, 0x01, 0x00, 0xc0,
- 0x32,
+ 0x32,
/* Interface descriptor */
0x09, 0x04, 0x02, 0x00, 0x01, 0x03, 0x00, 0x00,
@@ -96,32 +96,32 @@ static UCHAR device_framework_high_speed[DEVICE_FRAMEWORK_LENGTH_HIGH_SPEED] = {
MSB(HID_REPORT_LENGTH),
/* Endpoint descriptor (Interrupt) */
- 0x07, 0x05, 0x82, 0x03, 0x08, 0x00, 0x08
+ 0x07, 0x05, 0x82, 0x03, 0x08, 0x00, 0x08
};
-
+
/* String Device Framework :
Byte 0 and 1 : Word containing the language ID : 0x0904 for US
Byte 2 : Byte containing the index of the descriptor
Byte 3 : Byte containing the length of the descriptor string
*/
-
+
#define STRING_FRAMEWORK_LENGTH 40
-static UCHAR string_framework[] = {
+static UCHAR string_framework[] = {
/* Manufacturer string descriptor : Index 1 */
- 0x09, 0x04, 0x01, 0x0c,
- 0x45, 0x78, 0x70, 0x72,0x65, 0x73, 0x20, 0x4c,
+ 0x09, 0x04, 0x01, 0x0c,
+ 0x45, 0x78, 0x70, 0x72,0x65, 0x73, 0x20, 0x4c,
0x6f, 0x67, 0x69, 0x63,
/* Product string descriptor : Index 2 */
- 0x09, 0x04, 0x02, 0x0c,
- 0x55, 0x53, 0x42, 0x20, 0x4b, 0x65, 0x79, 0x62,
- 0x6f, 0x61, 0x72, 0x64,
+ 0x09, 0x04, 0x02, 0x0c,
+ 0x55, 0x53, 0x42, 0x20, 0x4b, 0x65, 0x79, 0x62,
+ 0x6f, 0x61, 0x72, 0x64,
/* Serial Number string descriptor : Index 3 */
- 0x09, 0x04, 0x03, 0x04,
+ 0x09, 0x04, 0x03, 0x04,
0x30, 0x30, 0x30, 0x31
};
@@ -131,7 +131,7 @@ static UCHAR string_framework[] = {
be appended to the language_id_framework array and the length
adjusted accordingly. */
#define LANGUAGE_ID_FRAMEWORK_LENGTH 2
-static UCHAR language_id_framework[] = {
+static UCHAR language_id_framework[] = {
/* English. */
0x09, 0x04
@@ -176,7 +176,7 @@ void test_application_define(void *first_unused_memory)
void usbx_msrc_81326_host_hid_keyboard_free_callback_test_application_define(void *first_unused_memory)
#endif
{
-
+
UINT status;
CHAR * stack_pointer;
CHAR * memory_pointer;
@@ -211,7 +211,7 @@ CHAR * memory_pointer;
printf("Error on line %d, error code: %d\n", __LINE__, status);
test_control_return(1);
}
-
+
status = ux_host_stack_class_register(_ux_system_host_class_hid_name, ux_host_class_hid_entry);
if (status != UX_SUCCESS)
{
@@ -248,7 +248,7 @@ CHAR * memory_pointer;
hid_parameter.ux_device_class_hid_parameter_callback = demo_thread_hid_callback;
/* Initilize the device hid class. The class is connected with interface 2 */
- status = ux_device_stack_class_register(_ux_system_slave_class_hid_name, ux_device_class_hid_entry,
+ status = ux_device_stack_class_register(_ux_system_slave_class_hid_name, ux_device_class_hid_entry,
1,2, (VOID *)&hid_parameter);
if(status!=UX_SUCCESS)
{
@@ -267,7 +267,7 @@ CHAR * memory_pointer;
printf("Error on line %d, error code: %d\n", __LINE__, status);
test_control_return(1);
}
-
+
/* Register all the USB host controllers available in this system */
status = ux_host_stack_hcd_register(_ux_system_host_hcd_simulator_name, ux_hcd_sim_host_initialize,0,0);
@@ -280,8 +280,8 @@ CHAR * memory_pointer;
}
/* Create the main host simulation thread. */
- status = tx_thread_create(&tx_demo_thread_host_simulation, "tx demo host simulation", tx_demo_thread_host_simulation_entry, 0,
- stack_pointer, UX_DEMO_STACK_SIZE,
+ status = tx_thread_create(&tx_demo_thread_host_simulation, "tx demo host simulation", tx_demo_thread_host_simulation_entry, 0,
+ stack_pointer, UX_DEMO_STACK_SIZE,
20, 20, 1, TX_AUTO_START);
/* Check for error. */
@@ -319,11 +319,11 @@ UINT i;
UX_TEST_ASSERT(hid_client == UX_NULL);
/* And deinitialize the class. */
- status = ux_device_stack_class_unregister(_ux_system_slave_class_hid_name, ux_device_class_hid_entry);
-
+ status = ux_device_stack_class_unregister(_ux_system_slave_class_hid_name, ux_device_class_hid_entry);
+
/* Deinitialize the device side of usbx. */
_ux_device_stack_uninitialize();
-
+
/* And finally the usbx system resources. */
_ux_system_uninitialize();
diff --git a/test/regression/usbx_msrc_81327_host_hid_mouse_free_callback_test.c b/test/regression/usbx_msrc_81327_host_hid_mouse_free_callback_test.c
index e58d147c..d9568fc7 100644
--- a/test/regression/usbx_msrc_81327_host_hid_mouse_free_callback_test.c
+++ b/test/regression/usbx_msrc_81327_host_hid_mouse_free_callback_test.c
@@ -7,7 +7,7 @@
#define DUMMY_USBX_MEMORY_SIZE (64*1024)
static UCHAR dummy_usbx_memory[DUMMY_USBX_MEMORY_SIZE];
-static UCHAR hid_report_descriptor[] = {
+static UCHAR hid_report_descriptor[] = {
0x05, 0x01, // USAGE_PAGE (Generic Desktop)
0x09, 0x02, // USAGE (Mouse)
@@ -51,11 +51,11 @@ static UCHAR device_framework_full_speed[DEVICE_FRAMEWORK_LENGTH_FULL_SPEED] = {
/* Device descriptor */
0x12, 0x01, 0x10, 0x01, 0x00, 0x00, 0x00, 0x08,
0x81, 0x0A, 0x01, 0x01, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x01,
+ 0x00, 0x01,
/* Configuration descriptor */
0x09, 0x02, 0x22, 0x00, 0x01, 0x01, 0x00, 0xc0,
- 0x32,
+ 0x32,
/* Interface descriptor */
0x09, 0x04, 0x02, 0x00, 0x01, 0x03, 0x00, 0x00,
@@ -69,15 +69,15 @@ static UCHAR device_framework_full_speed[DEVICE_FRAMEWORK_LENGTH_FULL_SPEED] = {
0x07, 0x05, 0x82, 0x03, 0x08, 0x00, 0x08
};
-
-
+
+
#define DEVICE_FRAMEWORK_LENGTH_HIGH_SPEED 62
static UCHAR device_framework_high_speed[DEVICE_FRAMEWORK_LENGTH_HIGH_SPEED] = {
/* Device descriptor */
0x12, 0x01, 0x00, 0x02, 0x00, 0x00, 0x00, 0x40,
0x0a, 0x07, 0x25, 0x40, 0x01, 0x00, 0x01, 0x02,
- 0x03, 0x01,
+ 0x03, 0x01,
/* Device qualifier descriptor */
0x0a, 0x06, 0x00, 0x02, 0x00, 0x00, 0x00, 0x40,
@@ -85,7 +85,7 @@ static UCHAR device_framework_high_speed[DEVICE_FRAMEWORK_LENGTH_HIGH_SPEED] = {
/* Configuration descriptor */
0x09, 0x02, 0x22, 0x00, 0x01, 0x01, 0x00, 0xc0,
- 0x32,
+ 0x32,
/* Interface descriptor */
0x09, 0x04, 0x02, 0x00, 0x01, 0x03, 0x00, 0x00,
@@ -96,32 +96,32 @@ static UCHAR device_framework_high_speed[DEVICE_FRAMEWORK_LENGTH_HIGH_SPEED] = {
MSB(HID_REPORT_LENGTH),
/* Endpoint descriptor (Interrupt) */
- 0x07, 0x05, 0x82, 0x03, 0x08, 0x00, 0x08
+ 0x07, 0x05, 0x82, 0x03, 0x08, 0x00, 0x08
};
-
+
/* String Device Framework :
Byte 0 and 1 : Word containing the language ID : 0x0904 for US
Byte 2 : Byte containing the index of the descriptor
Byte 3 : Byte containing the length of the descriptor string
*/
-
+
#define STRING_FRAMEWORK_LENGTH 40
-static UCHAR string_framework[] = {
+static UCHAR string_framework[] = {
/* Manufacturer string descriptor : Index 1 */
- 0x09, 0x04, 0x01, 0x0c,
- 0x45, 0x78, 0x70, 0x72,0x65, 0x73, 0x20, 0x4c,
+ 0x09, 0x04, 0x01, 0x0c,
+ 0x45, 0x78, 0x70, 0x72,0x65, 0x73, 0x20, 0x4c,
0x6f, 0x67, 0x69, 0x63,
/* Product string descriptor : Index 2 */
- 0x09, 0x04, 0x02, 0x0c,
- 0x55, 0x53, 0x42, 0x20, 0x4b, 0x65, 0x79, 0x62,
- 0x6f, 0x61, 0x72, 0x64,
+ 0x09, 0x04, 0x02, 0x0c,
+ 0x55, 0x53, 0x42, 0x20, 0x4b, 0x65, 0x79, 0x62,
+ 0x6f, 0x61, 0x72, 0x64,
/* Serial Number string descriptor : Index 3 */
- 0x09, 0x04, 0x03, 0x04,
+ 0x09, 0x04, 0x03, 0x04,
0x30, 0x30, 0x30, 0x31
};
@@ -131,7 +131,7 @@ static UCHAR string_framework[] = {
be appended to the language_id_framework array and the length
adjusted accordingly. */
#define LANGUAGE_ID_FRAMEWORK_LENGTH 2
-static UCHAR language_id_framework[] = {
+static UCHAR language_id_framework[] = {
/* English. */
0x09, 0x04
@@ -176,7 +176,7 @@ void test_application_define(void *first_unused_memory)
void usbx_msrc_81327_host_hid_mouse_free_callback_test_application_define(void *first_unused_memory)
#endif
{
-
+
UINT status;
CHAR * stack_pointer;
CHAR * memory_pointer;
@@ -211,7 +211,7 @@ CHAR * memory_pointer;
printf("Error on line %d, error code: %d\n", __LINE__, status);
test_control_return(1);
}
-
+
status = ux_host_stack_class_register(_ux_system_host_class_hid_name, ux_host_class_hid_entry);
if (status != UX_SUCCESS)
{
@@ -248,7 +248,7 @@ CHAR * memory_pointer;
hid_parameter.ux_device_class_hid_parameter_callback = demo_thread_hid_callback;
/* Initilize the device hid class. The class is connected with interface 2 */
- status = ux_device_stack_class_register(_ux_system_slave_class_hid_name, ux_device_class_hid_entry,
+ status = ux_device_stack_class_register(_ux_system_slave_class_hid_name, ux_device_class_hid_entry,
1,2, (VOID *)&hid_parameter);
if(status!=UX_SUCCESS)
{
@@ -267,7 +267,7 @@ CHAR * memory_pointer;
printf("Error on line %d, error code: %d\n", __LINE__, status);
test_control_return(1);
}
-
+
/* Register all the USB host controllers available in this system */
status = ux_host_stack_hcd_register(_ux_system_host_hcd_simulator_name, ux_hcd_sim_host_initialize,0,0);
@@ -280,8 +280,8 @@ CHAR * memory_pointer;
}
/* Create the main host simulation thread. */
- status = tx_thread_create(&tx_demo_thread_host_simulation, "tx demo host simulation", tx_demo_thread_host_simulation_entry, 0,
- stack_pointer, UX_DEMO_STACK_SIZE,
+ status = tx_thread_create(&tx_demo_thread_host_simulation, "tx demo host simulation", tx_demo_thread_host_simulation_entry, 0,
+ stack_pointer, UX_DEMO_STACK_SIZE,
20, 20, 1, TX_AUTO_START);
/* Check for error. */
@@ -319,11 +319,11 @@ UINT i;
UX_TEST_ASSERT(hid_client == UX_NULL);
/* And deinitialize the class. */
- status = ux_device_stack_class_unregister(_ux_system_slave_class_hid_name, ux_device_class_hid_entry);
-
+ status = ux_device_stack_class_unregister(_ux_system_slave_class_hid_name, ux_device_class_hid_entry);
+
/* Deinitialize the device side of usbx. */
_ux_device_stack_uninitialize();
-
+
/* And finally the usbx system resources. */
_ux_system_uninitialize();
diff --git a/test/regression/usbx_rndis_basic_test.c b/test/regression/usbx_rndis_basic_test.c
index c81bbaea..55fb187a 100644
--- a/test/regression/usbx_rndis_basic_test.c
+++ b/test/regression/usbx_rndis_basic_test.c
@@ -90,7 +90,7 @@ static unsigned char device_framework_high_speed[] = {
/* Configuration Descriptor */
0x09, /* bLength */
0x02, /* bDescriptorType */
-
+
#ifdef USE_ZERO_ENDPOINT_SETTING
0x58, 0x00, /* wTotalLength */
#else
@@ -397,21 +397,21 @@ UX_ENDPOINT *endpoint;
/* Fix it, now! - we need to add the RNDIS header. */
/* Copy that packet payload. */
- memcpy(host_bulk_endpoint_transfer_data + UX_DEVICE_CLASS_RNDIS_PACKET_HEADER_LENGTH,
- transfer_request->ux_transfer_request_data_pointer,
+ memcpy(host_bulk_endpoint_transfer_data + UX_DEVICE_CLASS_RNDIS_PACKET_HEADER_LENGTH,
+ transfer_request->ux_transfer_request_data_pointer,
transfer_request->ux_transfer_request_requested_length);
/* Add the RNDIS header to this packet. */
_ux_utility_long_put(host_bulk_endpoint_transfer_data + UX_DEVICE_CLASS_RNDIS_PACKET_MESSAGE_TYPE, UX_DEVICE_CLASS_RNDIS_PACKET_HEADER_MSG);
- _ux_utility_long_put(host_bulk_endpoint_transfer_data + UX_DEVICE_CLASS_RNDIS_PACKET_MESSAGE_LENGTH,
+ _ux_utility_long_put(host_bulk_endpoint_transfer_data + UX_DEVICE_CLASS_RNDIS_PACKET_MESSAGE_LENGTH,
transfer_request->ux_transfer_request_requested_length + UX_DEVICE_CLASS_RNDIS_PACKET_HEADER_LENGTH);
_ux_utility_long_put(host_bulk_endpoint_transfer_data + UX_DEVICE_CLASS_RNDIS_PACKET_DATA_OFFSET,
UX_DEVICE_CLASS_RNDIS_PACKET_HEADER_LENGTH - UX_DEVICE_CLASS_RNDIS_PACKET_DATA_OFFSET);
- _ux_utility_long_put(host_bulk_endpoint_transfer_data + UX_DEVICE_CLASS_RNDIS_PACKET_DATA_LENGTH,
+ _ux_utility_long_put(host_bulk_endpoint_transfer_data + UX_DEVICE_CLASS_RNDIS_PACKET_DATA_LENGTH,
transfer_request->ux_transfer_request_requested_length);
/* The original data pointer points to the packet, so no leak. We also
@@ -551,7 +551,7 @@ UX_SLAVE_TRANSFER *interrupt_transfer;
UX_TEST_CHECK_SUCCESS(nx_packet_pool_create(&packet_pool_device, "NetX Device Packet Pool", PACKET_PAYLOAD, packet_pool_memory_device, PACKET_POOL_SIZE));
- UX_TEST_CHECK_SUCCESS(nx_ip_create(&nx_ip_device, "NetX Device Thread", DEVICE_IP_ADDRESS, 0xFF000000L, &packet_pool_device,
+ UX_TEST_CHECK_SUCCESS(nx_ip_create(&nx_ip_device, "NetX Device Thread", DEVICE_IP_ADDRESS, 0xFF000000L, &packet_pool_device,
_ux_network_driver_entry, ip_thread_stack_device, DEMO_IP_THREAD_STACK_SIZE, 1));
/* Setup ARP. */
@@ -577,7 +577,7 @@ UX_SLAVE_TRANSFER *interrupt_transfer;
/* Set the parameters for callback when insertion/extraction of a CDC device. */
rndis_parameter.ux_slave_class_rndis_instance_activate = demo_rndis_instance_activate;
rndis_parameter.ux_slave_class_rndis_instance_deactivate = demo_rndis_instance_deactivate;
-
+
/* Define a local NODE ID. */
rndis_parameter.ux_slave_class_rndis_parameter_local_node_id[0] = 0x00;
rndis_parameter.ux_slave_class_rndis_parameter_local_node_id[1] = 0x1e;
@@ -632,7 +632,7 @@ UX_SLAVE_TRANSFER *interrupt_transfer;
/* Set the request itself. */
*(notification_buffer + UX_SETUP_REQUEST) = 0;
-
+
/* Set the value. It is the network link. */
_ux_utility_short_put(notification_buffer + UX_SETUP_VALUE, (USHORT)(rndis_device->ux_slave_class_rndis_link_state));
diff --git a/test/regression/usbx_standalone_cdc_acm_basic_test.c b/test/regression/usbx_standalone_cdc_acm_basic_test.c
index ecc0b02f..e2105b7b 100644
--- a/test/regression/usbx_standalone_cdc_acm_basic_test.c
+++ b/test/regression/usbx_standalone_cdc_acm_basic_test.c
@@ -920,7 +920,7 @@ static VOID test_cdc_acm_host_write_callback(UX_HOST_CLASS_CDC_ACM *cdc_acm,
/* Uses _write_with_callback. */
static UINT test_cdc_acm_host_write(UX_HOST_CLASS_CDC_ACM *cdc_acm,
- UCHAR *data_pointer,
+ UCHAR *data_pointer,
ULONG requested_length,
ULONG *actual_length)
{
diff --git a/test/regression/usbx_storage_multi_lun_test.c b/test/regression/usbx_storage_multi_lun_test.c
index 87acbe08..39b5a76e 100644
--- a/test/regression/usbx_storage_multi_lun_test.c
+++ b/test/regression/usbx_storage_multi_lun_test.c
@@ -99,37 +99,37 @@ static UINT ux_test_system_host_change_function(ULONG event, UX_HOST_CLASS *cls,
#define DEVICE_FRAMEWORK_LENGTH_FULL_SPEED 50
-static UCHAR device_framework_full_speed[] = {
+static UCHAR device_framework_full_speed[] = {
/* Device descriptor */
0x12, 0x01, 0x10, 0x01, 0x00, 0x00, 0x00, 0x08,
0x81, 0x07, 0x00, 0x00, 0x00, 0x00, 0x01, 0x02,
- 0x03, 0x01,
+ 0x03, 0x01,
/* Configuration descriptor */
0x09, 0x02, 0x20, 0x00, 0x01, 0x01, 0x00, 0xc0,
- 0x32,
+ 0x32,
/* Interface descriptor */
0x09, 0x04, 0x00, 0x00, 0x02, 0x08, 0x06, 0x50,
0x00,
/* Endpoint descriptor (Bulk In) */
- 0x07, 0x05, 0x81, 0x02, 0x40, 0x00, 0x00,
+ 0x07, 0x05, 0x81, 0x02, 0x40, 0x00, 0x00,
/* Endpoint descriptor (Bulk Out) */
0x07, 0x05, 0x02, 0x02, 0x40, 0x00, 0x00
};
-
-
+
+
#define DEVICE_FRAMEWORK_LENGTH_HIGH_SPEED 60
-static UCHAR device_framework_high_speed[] = {
+static UCHAR device_framework_high_speed[] = {
/* Device descriptor */
0x12, 0x01, 0x00, 0x02, 0x00, 0x00, 0x00, 0x40,
0x81, 0x07, 0x00, 0x00, 0x01, 0x00, 0x01, 0x02,
- 0x03, 0x01,
+ 0x03, 0x01,
/* Device qualifier descriptor */
0x0a, 0x06, 0x00, 0x02, 0x00, 0x00, 0x00, 0x40,
@@ -137,42 +137,42 @@ static UCHAR device_framework_high_speed[] = {
/* Configuration descriptor */
0x09, 0x02, 0x20, 0x00, 0x01, 0x01, 0x00, 0xc0,
- 0x32,
+ 0x32,
/* Interface descriptor */
0x09, 0x04, 0x00, 0x00, 0x02, 0x08, 0x06, 0x50,
0x00,
/* Endpoint descriptor (Bulk In) */
- 0x07, 0x05, 0x81, 0x02, 0x00, 0x01, 0x00,
+ 0x07, 0x05, 0x81, 0x02, 0x00, 0x01, 0x00,
/* Endpoint descriptor (Bulk Out) */
0x07, 0x05, 0x02, 0x02, 0x00, 0x01, 0x00
};
-
+
/* String Device Framework :
Byte 0 and 1 : Word containing the language ID : 0x0904 for US
Byte 2 : Byte containing the index of the descriptor
Byte 3 : Byte containing the length of the descriptor string
*/
-
+
#define STRING_FRAMEWORK_LENGTH 38
-static UCHAR string_framework[] = {
+static UCHAR string_framework[] = {
/* Manufacturer string descriptor : Index 1 */
- 0x09, 0x04, 0x01, 0x0c,
- 0x45, 0x78, 0x70, 0x72,0x65, 0x73, 0x20, 0x4c,
+ 0x09, 0x04, 0x01, 0x0c,
+ 0x45, 0x78, 0x70, 0x72,0x65, 0x73, 0x20, 0x4c,
0x6f, 0x67, 0x69, 0x63,
/* Product string descriptor : Index 2 */
- 0x09, 0x04, 0x02, 0x0a,
- 0x46, 0x6c, 0x61, 0x73, 0x68, 0x20, 0x44, 0x69,
- 0x73, 0x6b,
+ 0x09, 0x04, 0x02, 0x0a,
+ 0x46, 0x6c, 0x61, 0x73, 0x68, 0x20, 0x44, 0x69,
+ 0x73, 0x6b,
/* Serial Number string descriptor : Index 3 */
- 0x09, 0x04, 0x03, 0x04,
+ 0x09, 0x04, 0x03, 0x04,
0x30, 0x30, 0x30, 0x31
};
@@ -182,7 +182,7 @@ static UCHAR string_framework[] = {
be appended to the language_id_framework array and the length
adjusted accordingly. */
#define LANGUAGE_ID_FRAMEWORK_LENGTH 2
-static UCHAR language_id_framework[] = {
+static UCHAR language_id_framework[] = {
/* English. */
0x09, 0x04
@@ -209,7 +209,7 @@ static void test_isr(void)
/* For further expansion of interrupt-level testing. */
}
-
+
static VOID error_callback(UINT system_level, UINT system_context, UINT error_code)
{
@@ -227,7 +227,7 @@ void test_application_define(void *first_unused_memory)
void usbx_storage_multi_lun_test_application_define(void *first_unused_memory)
#endif
{
-
+
UINT status;
CHAR * stack_pointer;
CHAR * memory_pointer;
@@ -258,7 +258,7 @@ CHAR * memory_pointer;
ux_utility_memory_set(ram_disk_memory1, 0, UX_RAM_DISK_SIZE);
ux_utility_memory_set(ram_disk_memory2, 0, UX_RAM_DISK_SIZE);
- /* The code below is required for installing the device portion of USBX.
+ /* The code below is required for installing the device portion of USBX.
In this demo, DFU is possible and we have a call back for state change. */
status = ux_device_stack_initialize(device_framework_high_speed, DEVICE_FRAMEWORK_LENGTH_HIGH_SPEED,
device_framework_full_speed, DEVICE_FRAMEWORK_LENGTH_FULL_SPEED,
@@ -280,7 +280,7 @@ CHAR * memory_pointer;
global_storage_parameter.ux_slave_class_storage_parameter_lun[0].ux_slave_class_storage_media_type = 0;
global_storage_parameter.ux_slave_class_storage_parameter_lun[0].ux_slave_class_storage_media_removable_flag = 0x80;
global_storage_parameter.ux_slave_class_storage_parameter_lun[0].ux_slave_class_storage_media_read = demo_thread_media_read1;
- global_storage_parameter.ux_slave_class_storage_parameter_lun[0].ux_slave_class_storage_media_write = demo_thread_media_write1;
+ global_storage_parameter.ux_slave_class_storage_parameter_lun[0].ux_slave_class_storage_media_write = demo_thread_media_write1;
global_storage_parameter.ux_slave_class_storage_parameter_lun[0].ux_slave_class_storage_media_status = demo_thread_media_status1;
/* Initialize the storage class parameters for reading/writing to the second Flash Disk. */
@@ -289,11 +289,11 @@ CHAR * memory_pointer;
global_storage_parameter.ux_slave_class_storage_parameter_lun[1].ux_slave_class_storage_media_type = 0;
global_storage_parameter.ux_slave_class_storage_parameter_lun[1].ux_slave_class_storage_media_removable_flag = 0x80;
global_storage_parameter.ux_slave_class_storage_parameter_lun[1].ux_slave_class_storage_media_read = demo_thread_media_read2;
- global_storage_parameter.ux_slave_class_storage_parameter_lun[1].ux_slave_class_storage_media_write = demo_thread_media_write2;
+ global_storage_parameter.ux_slave_class_storage_parameter_lun[1].ux_slave_class_storage_media_write = demo_thread_media_write2;
global_storage_parameter.ux_slave_class_storage_parameter_lun[1].ux_slave_class_storage_media_status = demo_thread_media_status2;
/* Initilize the device storage class. The class is connected with interface 0 on configuration 1. */
- status = ux_device_stack_class_register(_ux_system_slave_class_storage_name, ux_device_class_storage_entry,
+ status = ux_device_stack_class_register(_ux_system_slave_class_storage_name, ux_device_class_storage_entry,
1, 0, (VOID *)&global_storage_parameter);
if(status!=UX_SUCCESS)
{
@@ -321,7 +321,7 @@ CHAR * memory_pointer;
printf("Running Multiple LUN Storage Test................................... ERROR #2\n");
test_control_return(1);
}
-
+
/* Register storage class. */
status = ux_host_stack_class_register(_ux_system_host_class_storage_name, ux_host_class_storage_entry);
if (status != UX_SUCCESS)
@@ -341,10 +341,10 @@ CHAR * memory_pointer;
printf("Running Multiple LUN Storage Test................................... ERROR #4\n");
test_control_return(1);
}
-
+
/* Create the main host simulation thread. */
- status = tx_thread_create(&tx_demo_thread_host_simulation, "tx demo host simulation", tx_demo_thread_host_simulation_entry, 0,
- stack_pointer, UX_DEMO_STACK_SIZE,
+ status = tx_thread_create(&tx_demo_thread_host_simulation, "tx demo host simulation", tx_demo_thread_host_simulation_entry, 0,
+ stack_pointer, UX_DEMO_STACK_SIZE,
20, 20, 1, TX_AUTO_START);
/* Check for error. */
@@ -354,7 +354,7 @@ CHAR * memory_pointer;
printf("Running Multiple LUN Storage Test................................... ERROR #8\n");
test_control_return(1);
}
-
+
}
static UINT host_storage_instance_get(void)
@@ -370,7 +370,7 @@ UX_HOST_CLASS *class;
return(status);
/* We get the first instance of the storage device */
- do
+ do
{
status = ux_host_stack_class_instance_get(class, 0, (void **) &storage);
@@ -427,7 +427,7 @@ UCHAR buffer_pattern;
printf("ERROR #9\n");
test_control_return(1);
}
-
+
/* Format the ram drive 2. */
status = fx_media_format(&ram_disk2, _fx_ram_driver, ram_disk_memory2, buffer, 512, "RAM DISK", 2, 512, 0, UX_RAM_DISK_SIZE/512, 512, 4, 1, 1);
@@ -439,7 +439,7 @@ UCHAR buffer_pattern;
printf("ERROR #10\n");
test_control_return(1);
}
-
+
/* Open the ram_disk1 . */
status = fx_media_open(&ram_disk1, "RAM DISK", _fx_ram_driver, ram_disk_memory1, buffer, 512);
@@ -452,7 +452,7 @@ UCHAR buffer_pattern;
printf("ERROR #11\n");
test_control_return(1);
}
-
+
/* Open the ram_disk2 . */
status = fx_media_open(&ram_disk2, "RAM DISK", _fx_ram_driver, ram_disk_memory2, buffer, 512);
@@ -464,7 +464,7 @@ UCHAR buffer_pattern;
printf("ERROR #12\n");
test_control_return(1);
}
-
+
/* Find the storage class */
status = host_storage_instance_get();
@@ -475,8 +475,8 @@ UCHAR buffer_pattern;
printf("ERROR #13\n");
test_control_return(1);
}
-
- /* Medfia 1. */
+
+ /* Medfia 1. */
/* Delete the target file. */
status = fx_file_delete(media1, "FILE.CPY");
@@ -504,18 +504,18 @@ UCHAR buffer_pattern;
/* Seek to the beginning to copy over an existing file. */
fx_file_seek(&my_file, 0);
-
+
/* Set the file length. */
total_length = UX_DEMO_FILE_SIZE;
-
+
/* Set pattern first letter. */
buffer_pattern = 'a';
-
+
while(total_length !=0)
{
-
+
/* Set the buffer with pattern. */
- ux_utility_memory_set(global_buffer, buffer_pattern, UX_DEMO_FILE_BUFFER_SIZE);
+ ux_utility_memory_set(global_buffer, buffer_pattern, UX_DEMO_FILE_BUFFER_SIZE);
/* Copy the file in blocks */
status = fx_file_write(&my_file, global_buffer, UX_DEMO_FILE_BUFFER_SIZE);
@@ -531,21 +531,21 @@ UCHAR buffer_pattern;
/* Decrement the length remaining. */
total_length -= UX_DEMO_FILE_BUFFER_SIZE;
-
+
/* Next pattern. */
buffer_pattern++;
-
+
/* Check pattern end. */
if (buffer_pattern > 'z')
-
+
/* Back to beginning. */
buffer_pattern = 'a';
-
+
}
/* Finished reading file either at the end or because of error. */
fx_file_close(&my_file);
-
- /* Media 2. */
+
+ /* Media 2. */
/* Delete the target file. */
status = fx_file_delete(media2, "FILE.CPY");
@@ -571,18 +571,18 @@ UCHAR buffer_pattern;
/* Seek to the beginning to copy over an existing file. */
fx_file_seek(&my_file, 0);
-
+
/* Set the file length. */
total_length = UX_DEMO_FILE_SIZE;
-
+
/* Set pattern first letter. */
buffer_pattern = 'a';
-
+
while(total_length !=0)
{
-
+
/* Set the buffer with pattern. */
- ux_utility_memory_set(global_buffer, buffer_pattern, UX_DEMO_FILE_BUFFER_SIZE);
+ ux_utility_memory_set(global_buffer, buffer_pattern, UX_DEMO_FILE_BUFFER_SIZE);
/* Copy the file in blocks */
status = fx_file_write(&my_file, global_buffer, UX_DEMO_FILE_BUFFER_SIZE);
@@ -598,16 +598,16 @@ UCHAR buffer_pattern;
/* Decrement the length remaining. */
total_length -= UX_DEMO_FILE_BUFFER_SIZE;
-
+
/* Next pattern. */
buffer_pattern++;
-
+
/* Check pattern end. */
if (buffer_pattern > 'z')
-
+
/* Back to beginning. */
buffer_pattern = 'a';
-
+
}
/* Finished reading file either at the end or because of error. */
fx_file_close(&my_file);
@@ -652,16 +652,16 @@ UINT status;
status = ram_disk1.fx_media_driver_status;
- }
+ }
else
- {
+ {
while(number_blocks--)
{
status = fx_media_read(&ram_disk1,lba,data_pointer);
data_pointer+=512;
lba++;
}
- }
+ }
return(status);
}
@@ -680,7 +680,7 @@ UINT status;
status = ram_disk1.fx_media_driver_status;
- }
+ }
else
{
@@ -689,7 +689,7 @@ UINT status;
status = fx_media_write(&ram_disk1,lba,data_pointer);
data_pointer+=512;
lba++;
- }
+ }
return(status);
}
return(1);
@@ -732,16 +732,16 @@ UINT status;
status = ram_disk2.fx_media_driver_status;
- }
+ }
else
- {
+ {
while(number_blocks--)
{
status = fx_media_read(&ram_disk2,lba,data_pointer);
data_pointer+=512;
lba++;
}
- }
+ }
return(status);
}
@@ -760,7 +760,7 @@ UINT status;
status = ram_disk2.fx_media_driver_status;
- }
+ }
else
{
@@ -769,7 +769,7 @@ UINT status;
status = fx_media_write(&ram_disk2,lba,data_pointer);
data_pointer+=512;
lba++;
- }
+ }
return(status);
}
return(1);
diff --git a/test/regression/usbx_test_common_storage.h b/test/regression/usbx_test_common_storage.h
index bad19115..5d24ab31 100644
--- a/test/regression/usbx_test_common_storage.h
+++ b/test/regression/usbx_test_common_storage.h
@@ -121,6 +121,6 @@ UX_HOST_CLASS *host_class;
printf("Error on line %d, error code: %d\n", __LINE__, status);
test_control_return(1);
}
-
+
return(UX_SUCCESS);
}
diff --git a/test/regression/usbx_ux_api_tracex_id_test.c b/test/regression/usbx_ux_api_tracex_id_test.c
index a182557b..1854fae3 100644
--- a/test/regression/usbx_ux_api_tracex_id_test.c
+++ b/test/regression/usbx_ux_api_tracex_id_test.c
@@ -149,10 +149,10 @@ UINT tracex_id = 0;
switch(tracex_id){
case UX_TRACE_DEVICE_STACK_CONFIGURATION_GET:
case UX_TRACE_DEVICE_STACK_CONFIGURATION_SET:
- case UX_TRACE_DEVICE_CLASS_DPUMP_WRITE:
+ case UX_TRACE_DEVICE_CLASS_DPUMP_WRITE:
case UX_TRACE_DEVICE_CLASS_DPUMP_CHANGE:
default:
- break;
+ break;
}
#endif
/* Successful test. */
diff --git a/test/regression/usbx_ux_device_class_cdc_acm_activate_test.c b/test/regression/usbx_ux_device_class_cdc_acm_activate_test.c
index 7cf032f8..89308b14 100644
--- a/test/regression/usbx_ux_device_class_cdc_acm_activate_test.c
+++ b/test/regression/usbx_ux_device_class_cdc_acm_activate_test.c
@@ -230,11 +230,11 @@ UX_HOST_CLASS_CDC_ACM *cdc_acm;
case UX_HOST_CLASS_CDC_CONTROL_CLASS:
cdc_acm_host_control = cdc_acm;
break;
-
+
case UX_HOST_CLASS_CDC_DATA_CLASS:
cdc_acm_host_data = cdc_acm;
break;
-
+
default:
break;
}
diff --git a/test/regression/usbx_ux_device_class_cdc_acm_write_test.c b/test/regression/usbx_ux_device_class_cdc_acm_write_test.c
index 802175b9..67314983 100644
--- a/test/regression/usbx_ux_device_class_cdc_acm_write_test.c
+++ b/test/regression/usbx_ux_device_class_cdc_acm_write_test.c
@@ -245,11 +245,11 @@ UX_HOST_CLASS_CDC_ACM *cdc_acm;
case UX_HOST_CLASS_CDC_CONTROL_CLASS:
cdc_acm_host_control = cdc_acm;
break;
-
+
case UX_HOST_CLASS_CDC_DATA_CLASS:
cdc_acm_host_data = cdc_acm;
break;
-
+
default:
break;
}
diff --git a/test/regression/usbx_ux_device_class_hid_deactivate_test.c b/test/regression/usbx_ux_device_class_hid_deactivate_test.c
index 10f601f6..16737e46 100644
--- a/test/regression/usbx_ux_device_class_hid_deactivate_test.c
+++ b/test/regression/usbx_ux_device_class_hid_deactivate_test.c
@@ -54,11 +54,11 @@ static UCHAR device_framework_full_speed[DEVICE_FRAMEWORK_LENGTH_FULL_SPEED] = {
/* Device descriptor */
0x12, 0x01, 0x10, 0x01, 0x00, 0x00, 0x00, 0x08,
0x81, 0x0A, 0x01, 0x01, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x01,
+ 0x00, 0x01,
/* Configuration descriptor */
0x09, 0x02, 0x22, 0x00, 0x01, 0x01, 0x00, 0xc0,
- 0x32,
+ 0x32,
/* Interface descriptor */
0x09, 0x04, 0x02, 0x00, 0x01, 0x03, 0x00, 0x00,
@@ -72,15 +72,15 @@ static UCHAR device_framework_full_speed[DEVICE_FRAMEWORK_LENGTH_FULL_SPEED] = {
0x07, 0x05, 0x82, 0x03, 0x08, 0x00, 0x08
};
-
-
+
+
#define DEVICE_FRAMEWORK_LENGTH_HIGH_SPEED 62
static UCHAR device_framework_high_speed[DEVICE_FRAMEWORK_LENGTH_HIGH_SPEED] = {
/* Device descriptor */
0x12, 0x01, 0x00, 0x02, 0x00, 0x00, 0x00, 0x40,
0x0a, 0x07, 0x25, 0x40, 0x01, 0x00, 0x01, 0x02,
- 0x03, 0x01,
+ 0x03, 0x01,
/* Device qualifier descriptor */
0x0a, 0x06, 0x00, 0x02, 0x00, 0x00, 0x00, 0x40,
@@ -88,7 +88,7 @@ static UCHAR device_framework_high_speed[DEVICE_FRAMEWORK_LENGTH_HIGH_SPEED] = {
/* Configuration descriptor */
0x09, 0x02, 0x22, 0x00, 0x01, 0x01, 0x00, 0xc0,
- 0x32,
+ 0x32,
/* Interface descriptor */
0x09, 0x04, 0x02, 0x00, 0x01, 0x03, 0x00, 0x00,
@@ -99,32 +99,32 @@ static UCHAR device_framework_high_speed[DEVICE_FRAMEWORK_LENGTH_HIGH_SPEED] = {
MSB(HID_REPORT_LENGTH),
/* Endpoint descriptor (Interrupt) */
- 0x07, 0x05, 0x82, 0x03, 0x08, 0x00, 0x08
+ 0x07, 0x05, 0x82, 0x03, 0x08, 0x00, 0x08
};
-
+
/* String Device Framework :
Byte 0 and 1 : Word containing the language ID : 0x0904 for US
Byte 2 : Byte containing the index of the descriptor
Byte 3 : Byte containing the length of the descriptor string
*/
-
+
#define STRING_FRAMEWORK_LENGTH 40
-static UCHAR string_framework[] = {
+static UCHAR string_framework[] = {
/* Manufacturer string descriptor : Index 1 */
- 0x09, 0x04, 0x01, 0x0c,
- 0x45, 0x78, 0x70, 0x72,0x65, 0x73, 0x20, 0x4c,
+ 0x09, 0x04, 0x01, 0x0c,
+ 0x45, 0x78, 0x70, 0x72,0x65, 0x73, 0x20, 0x4c,
0x6f, 0x67, 0x69, 0x63,
/* Product string descriptor : Index 2 */
- 0x09, 0x04, 0x02, 0x0c,
- 0x55, 0x53, 0x42, 0x20, 0x4b, 0x65, 0x79, 0x62,
- 0x6f, 0x61, 0x72, 0x64,
+ 0x09, 0x04, 0x02, 0x0c,
+ 0x55, 0x53, 0x42, 0x20, 0x4b, 0x65, 0x79, 0x62,
+ 0x6f, 0x61, 0x72, 0x64,
/* Serial Number string descriptor : Index 3 */
- 0x09, 0x04, 0x03, 0x04,
+ 0x09, 0x04, 0x03, 0x04,
0x30, 0x30, 0x30, 0x31
};
@@ -134,7 +134,7 @@ static UCHAR string_framework[] = {
be appended to the language_id_framework array and the length
adjusted accordingly. */
#define LANGUAGE_ID_FRAMEWORK_LENGTH 2
-static UCHAR language_id_framework[] = {
+static UCHAR language_id_framework[] = {
/* English. */
0x09, 0x04
@@ -176,7 +176,7 @@ void test_application_define(void *first_unused_memory)
void usbx_ux_device_class_hid_deactivate_test_application_define(void *first_unused_memory)
#endif
{
-
+
UINT status;
CHAR * stack_pointer;
CHAR * memory_pointer;
@@ -211,7 +211,7 @@ CHAR * memory_pointer;
printf("Error on line %d, error code: %d\n", __LINE__, status);
test_control_return(1);
}
-
+
status = ux_host_stack_class_register(_ux_system_host_class_hid_name, ux_host_class_hid_entry);
if (status != UX_SUCCESS)
{
@@ -249,7 +249,7 @@ CHAR * memory_pointer;
hid_parameter.ux_slave_class_hid_instance_deactivate = instance_deactivate_callback;
/* Initilize the device hid class. The class is connected with interface 2 */
- status = ux_device_stack_class_register(_ux_system_slave_class_hid_name, ux_device_class_hid_entry,
+ status = ux_device_stack_class_register(_ux_system_slave_class_hid_name, ux_device_class_hid_entry,
1,2, (VOID *)&hid_parameter);
if(status!=UX_SUCCESS)
{
@@ -268,7 +268,7 @@ CHAR * memory_pointer;
printf("Error on line %d, error code: %d\n", __LINE__, status);
test_control_return(1);
}
-
+
/* Register all the USB host controllers available in this system */
status = ux_host_stack_hcd_register(_ux_system_host_hcd_simulator_name, ux_hcd_sim_host_initialize,0,0);
@@ -281,8 +281,8 @@ CHAR * memory_pointer;
}
/* Create the main host simulation thread. */
- status = tx_thread_create(&tx_demo_thread_host_simulation, "tx demo host simulation", tx_demo_thread_host_simulation_entry, 0,
- stack_pointer, UX_DEMO_STACK_SIZE,
+ status = tx_thread_create(&tx_demo_thread_host_simulation, "tx demo host simulation", tx_demo_thread_host_simulation_entry, 0,
+ stack_pointer, UX_DEMO_STACK_SIZE,
20, 20, 1, TX_AUTO_START);
/* Check for error. */
@@ -309,9 +309,9 @@ UINT status;
/* Now disconnect the device. */
_ux_device_stack_disconnect();
-
+
/* And deinitialize the class. */
- status = ux_device_stack_class_unregister(_ux_system_slave_class_hid_name, ux_device_class_hid_entry);
+ status = ux_device_stack_class_unregister(_ux_system_slave_class_hid_name, ux_device_class_hid_entry);
/**************************************************/
/** Test case: callback was invoked. **/
@@ -326,10 +326,10 @@ UINT status;
/**************************************************/
/** Test case end. **/
/**************************************************/
-
+
/* Deinitialize the device side of usbx. */
_ux_device_stack_uninitialize();
-
+
/* And finally the usbx system resources. */
_ux_system_uninitialize();
diff --git a/test/regression/usbx_ux_device_class_hid_descriptor_send_test.c b/test/regression/usbx_ux_device_class_hid_descriptor_send_test.c
index 46235ab2..52f2a47e 100644
--- a/test/regression/usbx_ux_device_class_hid_descriptor_send_test.c
+++ b/test/regression/usbx_ux_device_class_hid_descriptor_send_test.c
@@ -272,7 +272,7 @@ UX_SLAVE_CLASS_HID *hid_class;
hid_class = (UX_SLAVE_CLASS_HID*)class->ux_slave_class_instance;
hid_class->ux_device_class_hid_report_address = descriptor;
- hid_class->ux_device_class_hid_report_length = length;
+ hid_class->ux_device_class_hid_report_length = length;
}
/* Define what the initial system looks like. */
diff --git a/test/regression/usbx_ux_device_class_hid_set_protocol_callback_test.c b/test/regression/usbx_ux_device_class_hid_set_protocol_callback_test.c
new file mode 100644
index 00000000..b1c0e710
--- /dev/null
+++ b/test/regression/usbx_ux_device_class_hid_set_protocol_callback_test.c
@@ -0,0 +1,465 @@
+/* This test focuses on HID device class protocol set/get functionality and related callbacks. */
+
+#include
+#include "tx_api.h"
+#include "ux_api.h"
+#include "ux_system.h"
+#include "ux_utility.h"
+#include "ux_host_class_hid.h"
+#include "ux_host_class_hid_keyboard.h"
+#include "ux_device_class_hid.h"
+#include "ux_device_stack.h"
+#include "usbx_test_common_hid.h"
+
+/* Define constants. */
+#define UX_DEMO_DEBUG_SIZE (4096*8)
+#define UX_DEMO_STACK_SIZE 1024
+
+/* Define local/extern function prototypes. */
+static void demo_thread_entry(ULONG);
+static UINT demo_thread_hid_callback(UX_SLAVE_CLASS_HID *, UX_SLAVE_CLASS_HID_EVENT *);
+static VOID demo_set_protocol_callback(UX_SLAVE_CLASS_HID *hid, ULONG protocol);
+static TX_THREAD tx_demo_thread_host_simulation;
+static void tx_demo_thread_host_simulation_entry(ULONG);
+
+/* Define global data structures. */
+static UX_HOST_CLASS_HID *hid;
+static UINT status;
+
+static UX_SLAVE_CLASS_HID_PARAMETER hid_parameter;
+
+static volatile UINT g_set_protocol_callback_calls = 0;
+static volatile ULONG g_set_protocol_last_value = 0xFFFFFFFFu;
+
+USHORT host_protocol;
+
+static UCHAR hid_keyboard_report[] = {
+
+ 0x05, 0x01, // USAGE_PAGE (Generic Desktop)
+ 0x09, 0x06, // USAGE (Keyboard)
+ 0xa1, 0x01, // COLLECTION (Application)
+ 0x05, 0x07, // USAGE_PAGE (Keyboard)
+ 0x19, 0xe0, // USAGE_MINIMUM (Keyboard LeftControl)
+ 0x29, 0xe7, // USAGE_MAXIMUM (Keyboard Right GUI)
+ 0x15, 0x00, // LOGICAL_MINIMUM (0)
+ 0x25, 0x01, // LOGICAL_MAXIMUM (1)
+ 0x75, 0x01, // REPORT_SIZE (1)
+ 0x95, 0x08, // REPORT_COUNT (8)
+ 0x81, 0x02, // INPUT (Data,Var,Abs)
+ 0x09, 0x39, // USAGE (Caps Lock)
+ 0x09, 0x53, // USAGE (Num Lock)
+ 0x09, 0x47, // USAGE (Scroll Lock)
+ 0x75, 0x01, // REPORT_SIZE (1)
+ 0x95, 0x03, // REPORT_COUNT (3)
+ 0x81, 0x02, // INPUT (Data,Var,Abs)
+ 0x95, 0x01, // REPORT_COUNT (1)
+ 0x75, 0x05, // REPORT_SIZE (5)
+ 0x81, 0x03, // INPUT (Cnst,Var,Abs)
+ 0x95, 0x05, // REPORT_COUNT (5)
+ 0x75, 0x01, // REPORT_SIZE (1)
+ 0x05, 0x08, // USAGE_PAGE (LEDs)
+ 0x19, 0x01, // USAGE_MINIMUM (Num Lock)
+ 0x29, 0x05, // USAGE_MAXIMUM (Kana)
+ 0x91, 0x02, // OUTPUT (Data,Var,Abs)
+ 0x95, 0x01, // REPORT_COUNT (1)
+ 0x75, 0x03, // REPORT_SIZE (3)
+ 0x91, 0x03, // OUTPUT (Cnst,Var,Abs)
+ 0x95, 0x06, // REPORT_COUNT (6)
+ 0x75, 0x08, // REPORT_SIZE (8)
+ 0x15, 0x00, // LOGICAL_MINIMUM (0)
+ 0x25, 0x65, // LOGICAL_MAXIMUM (101)
+ 0x05, 0x07, // USAGE_PAGE (Keyboard)
+ 0x19, 0x00, // USAGE_MINIMUM (Reserved (no event indicated))
+ 0x29, 0x65, // USAGE_MAXIMUM (Keyboard Application)
+ 0x81, 0x00, // INPUT (Data,Ary,Abs)
+ 0xc0 // END_COLLECTION
+};
+#define HID_KEYBOARD_REPORT_LENGTH (sizeof(hid_keyboard_report) / sizeof(hid_keyboard_report[0]))
+
+
+#define DEVICE_FRAMEWORK_LENGTH_FULL_SPEED 52
+static UCHAR device_framework_full_speed[] = {
+
+ /* Device descriptor */
+ 0x12, 0x01, 0x10, 0x01, 0x00, 0x00, 0x00, 0x08,
+ 0x81, 0x0A, 0x01, 0x01, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x01,
+
+ /* Configuration descriptor */
+ 0x09, 0x02, 0x22, 0x00, 0x01, 0x01, 0x00, 0xc0,
+ 0x32,
+
+ /* Interface descriptor */
+ 0x09, 0x04, 0x00, 0x00, 0x01, 0x03, 0x01, 0x02,
+ 0x00,
+
+ /* HID descriptor */
+ 0x09, 0x21, 0x10, 0x01, 0x21, 0x01, 0x22, LSB(HID_KEYBOARD_REPORT_LENGTH),
+ MSB(HID_KEYBOARD_REPORT_LENGTH),
+
+ /* Endpoint descriptor (Interrupt) */
+ 0x07, 0x05, 0x82, 0x03, 0x08, 0x00, 0x08
+
+ };
+
+
+#define DEVICE_FRAMEWORK_LENGTH_HIGH_SPEED 62
+static UCHAR device_framework_high_speed[] = {
+
+ /* Device descriptor */
+ 0x12, 0x01, 0x00, 0x02, 0x00, 0x00, 0x00, 0x40,
+ 0x0a, 0x07, 0x25, 0x40, 0x01, 0x00, 0x01, 0x02,
+ 0x03, 0x01,
+
+ /* Device qualifier descriptor */
+ 0x0a, 0x06, 0x00, 0x02, 0x00, 0x00, 0x00, 0x40,
+ 0x01, 0x00,
+
+ /* Configuration descriptor */
+ 0x09, 0x02, 0x22, 0x00, 0x01, 0x01, 0x00, 0xc0,
+ 0x32,
+
+ /* Interface descriptor */
+ 0x09, 0x04, 0x00, 0x00, 0x01, 0x03, 0x01, 0x02,
+ 0x00,
+
+ /* HID descriptor */
+ 0x09, 0x21, 0x10, 0x01, 0x21, 0x01, 0x22, LSB(HID_KEYBOARD_REPORT_LENGTH),
+ MSB(HID_KEYBOARD_REPORT_LENGTH),
+
+ /* Endpoint descriptor (Interrupt) */
+ 0x07, 0x05, 0x82, 0x03, 0x08, 0x00, 0x08
+
+ };
+
+
+ /* String Device Framework :
+ Byte 0 and 1 : Word containing the language ID : 0x0904 for US
+ Byte 2 : Byte containing the index of the descriptor
+ Byte 3 : Byte containing the length of the descriptor string
+ */
+
+#define STRING_FRAMEWORK_LENGTH 40
+static UCHAR string_framework[] = {
+
+ /* Manufacturer string descriptor : Index 1 */
+ 0x09, 0x04, 0x01, 0x0c,
+ 0x45, 0x78, 0x70, 0x72,0x65, 0x73, 0x20, 0x4c,
+ 0x6f, 0x67, 0x69, 0x63,
+
+ /* Product string descriptor : Index 2 */
+ 0x09, 0x04, 0x02, 0x0c,
+ 0x55, 0x53, 0x42, 0x20, 0x4b, 0x65, 0x79, 0x62,
+ 0x6f, 0x61, 0x72, 0x64,
+
+ /* Serial Number string descriptor : Index 3 */
+ 0x09, 0x04, 0x03, 0x04,
+ 0x30, 0x30, 0x30, 0x31
+ };
+
+
+ /* Multiple languages are supported on the device, to add
+ a language besides english, the unicode language code must
+ be appended to the language_id_framework array and the length
+ adjusted accordingly. */
+#define LANGUAGE_ID_FRAMEWORK_LENGTH 2
+static UCHAR language_id_framework[] = {
+
+ /* English. */
+ 0x09, 0x04
+ };
+
+
+
+/* Define the ISR dispatch. */
+
+extern VOID (*test_isr_dispatch)(void);
+
+
+/* Prototype for test control return. */
+
+void test_control_return(UINT status);
+
+
+/* Define the ISR dispatch routine. */
+
+static void test_isr(void)
+{
+
+ /* For further expansion of interrupt-level testing. */
+}
+
+
+
+static VOID error_callback(UINT system_level, UINT system_context, UINT error_code)
+{
+
+ /* @BUG_FIX_PENDING: ux_dcd_sim_slave_function.c doesn't support transfer aborts, which happen during device unregistration of a class. */
+ if (error_code != UX_FUNCTION_NOT_SUPPORTED)
+ {
+
+ /* Failed test. */
+ printf("Error on line %d, system_level: %d, system_context: %d, error code: %d\n", __LINE__, system_level, system_context, error_code);
+ test_control_return(1);
+ }
+}
+
+/* Define what the initial system looks like. */
+
+#ifdef CTEST
+void test_application_define(void *first_unused_memory)
+#else
+void usbx_ux_device_class_hid_set_protocol_callback_test_application_define(void *first_unused_memory)
+#endif
+{
+
+UINT status;
+CHAR * stack_pointer;
+CHAR * memory_pointer;
+UINT descriptor_size = HID_KEYBOARD_REPORT_LENGTH;
+
+ /* Inform user. */
+ printf("Running HID Set/Get Protocol Callback Test......................... ");
+
+ /* Initialize the free memory pointer */
+ stack_pointer = (CHAR *) usbx_memory;
+ memory_pointer = stack_pointer + (UX_DEMO_STACK_SIZE * 2);
+
+ /* Initialize USBX. Memory */
+ status = ux_system_initialize(memory_pointer, UX_DEMO_MEMORY_SIZE, UX_NULL,0);
+
+ /* Check for error. */
+ if (status != UX_SUCCESS)
+ {
+
+ printf("Error on line %d, error code: %d\n", __LINE__, status);
+ test_control_return(1);
+ }
+
+ /* Register the error callback. */
+ _ux_utility_error_callback_register(error_callback);
+
+ /* The code below is required for installing the host portion of USBX */
+ status = ux_host_stack_initialize(UX_NULL);
+ if (status != UX_SUCCESS)
+ {
+
+ printf("Error on line %d, error code: %d\n", __LINE__, status);
+ test_control_return(1);
+ }
+
+ status = ux_host_stack_class_register(_ux_system_host_class_hid_name, ux_host_class_hid_entry);
+ if (status != UX_SUCCESS)
+ {
+
+ printf("Error on line %d, error code: %d\n", __LINE__, status);
+ test_control_return(1);
+ }
+
+ /* Register the HID client(s). */
+ status = ux_host_class_hid_client_register(_ux_system_host_class_hid_client_keyboard_name, ux_host_class_hid_keyboard_entry);
+ if (status != UX_SUCCESS)
+ {
+
+ printf("Error on line %d, error code: %d\n", __LINE__, status);
+ test_control_return(1);
+ }
+
+ /* The code below is required for installing the device portion of USBX. No call back for
+ device status change in this example. */
+ status = ux_device_stack_initialize(device_framework_high_speed, DEVICE_FRAMEWORK_LENGTH_HIGH_SPEED,
+ device_framework_full_speed, DEVICE_FRAMEWORK_LENGTH_FULL_SPEED,
+ string_framework, STRING_FRAMEWORK_LENGTH,
+ language_id_framework, LANGUAGE_ID_FRAMEWORK_LENGTH, UX_NULL);
+ if(status != UX_SUCCESS)
+ {
+
+ printf("Error on line %d, error code: %d\n", __LINE__, status);
+ test_control_return(1);
+ }
+
+ /* Initialize the hid class parameters for a keyboard. */
+ hid_parameter.ux_device_class_hid_parameter_report_address = hid_keyboard_report;
+ hid_parameter.ux_device_class_hid_parameter_report_length = HID_KEYBOARD_REPORT_LENGTH;
+ hid_parameter.ux_device_class_hid_parameter_callback = demo_thread_hid_callback;
+ hid_parameter.ux_device_class_hid_parameter_set_protocol_callback = demo_set_protocol_callback;
+
+ /* Initialize the device hid class. The class is connected with interface 2 */
+ status = ux_device_stack_class_register(_ux_system_slave_class_hid_name, ux_device_class_hid_entry,
+ 1, 0, (VOID *)&hid_parameter);
+ if(status != UX_SUCCESS)
+ {
+
+ printf("Error on line %d, error code: %d\n", __LINE__, status);
+ test_control_return(1);
+ }
+
+
+ /* Initialize the simulated device controller. */
+ status = _ux_dcd_sim_slave_initialize();
+
+ /* Check for error. */
+ if (status != UX_SUCCESS)
+ {
+
+ printf("Error on line %d, error code: %d\n", __LINE__, status);
+ test_control_return(1);
+ }
+
+ /* Register all the USB host controllers available in this system */
+ status = ux_host_stack_hcd_register(_ux_system_host_hcd_simulator_name, ux_hcd_sim_host_initialize,0,0);
+
+ /* Check for error. */
+ if (status != UX_SUCCESS)
+ {
+
+ printf("Error on line %d, error code: %d\n", __LINE__, status);
+ test_control_return(1);
+ }
+
+ /* Create the main host simulation thread. */
+ status = tx_thread_create(&tx_demo_thread_host_simulation, "tx demo host simulation", tx_demo_thread_host_simulation_entry, 0,
+ stack_pointer, UX_DEMO_STACK_SIZE,
+ 20, 20, 1, TX_AUTO_START);
+
+ /* Check for error. */
+ if (status != TX_SUCCESS)
+ {
+
+ printf("Error on line %d, error code: %d\n", __LINE__, status);
+ test_control_return(1);
+ }
+}
+
+
+static void tx_demo_thread_host_simulation_entry(ULONG arg)
+{
+UX_SLAVE_DEVICE *device;
+UX_SLAVE_INTERFACE *interface;
+UX_SLAVE_CLASS_HID *slave_hid;
+UINT status;
+
+ device = &_ux_system_slave -> ux_system_slave_device;
+
+ /* Ensure device is configured before accessing interfaces. */
+ while (device -> ux_slave_device_state != UX_DEVICE_CONFIGURED)
+ tx_thread_sleep(10);
+
+ /* Retrieve the HID class instance from the configured interface. */
+ interface = device -> ux_slave_device_first_interface;
+ if (interface == UX_NULL || interface -> ux_slave_interface_class_instance == UX_NULL)
+ {
+ printf("Error on line %d, device interface/class not ready\n", __LINE__);
+ test_control_return(1);
+ }
+ slave_hid = interface -> ux_slave_interface_class_instance;
+
+ /* Find the HID class */
+ status = demo_class_hid_get();
+ if (status != UX_SUCCESS)
+ {
+
+ printf("Error on line %d, error code: %d\n", __LINE__, status);
+ test_control_return(1);
+ }
+
+ /* Sanity: default protocol is report (1). */
+ if (ux_device_class_hid_protocol_get(slave_hid) != UX_DEVICE_CLASS_HID_PROTOCOL_REPORT)
+ {
+ printf("Error on line %d, protocol not default report\n", __LINE__);
+ test_control_return(1);
+ }
+
+
+ status = ux_host_class_hid_protocol_get(hid, &host_protocol);
+ if (status != UX_SUCCESS && status != UX_TRANSFER_STALLED)
+ {
+ printf("Error on line %d, error code: 0x%x\n", __LINE__, status);
+ test_control_return(1);
+ }
+
+ /* Default protocol is report 1. */
+ if (status == UX_SUCCESS && host_protocol != UX_HOST_CLASS_HID_PROTOCOL_REPORT)
+ {
+ printf("Error on line %d, host get protocol not report\n", __LINE__);
+ test_control_return(1);
+ }
+
+ /* Issue SET_PROTOCOL to BOOT (0). */
+ status = ux_host_class_hid_protocol_set(hid, UX_HOST_CLASS_HID_PROTOCOL_BOOT);
+ if (status != UX_SUCCESS && status != UX_TRANSFER_STALLED)
+ {
+ printf("Error on line %d, error code: 0x%x\n", __LINE__, status);
+ test_control_return(1);
+ }
+
+ status = ux_host_class_hid_protocol_get(hid, &host_protocol);
+
+ if (g_set_protocol_callback_calls < 1 ||
+ g_set_protocol_last_value != 0 ||
+ host_protocol != UX_HOST_CLASS_HID_PROTOCOL_BOOT)
+ {
+ printf("Error on line %d, callback verification failed (calls=%u, val=%lu)\n",
+ __LINE__, g_set_protocol_callback_calls, g_set_protocol_last_value);
+ test_control_return(1);
+ }
+
+ if (ux_device_class_hid_protocol_get(slave_hid) != UX_DEVICE_CLASS_HID_PROTOCOL_BOOT)
+ {
+ printf("Error on line %d, protocol not set to boot\n", __LINE__);
+ test_control_return(1);
+ }
+
+ /* Issue SET_PROTOCOL to REPORT (1). */
+ status = ux_host_class_hid_protocol_set(hid, UX_HOST_CLASS_HID_PROTOCOL_REPORT);
+ if (status != UX_SUCCESS && status != UX_TRANSFER_STALLED)
+ {
+ printf("Error on line %d, error code: 0x%x\n", __LINE__, status);
+ test_control_return(1);
+ }
+
+ status = ux_host_class_hid_protocol_get(hid, &host_protocol);
+
+ if (g_set_protocol_callback_calls < 2 ||
+ g_set_protocol_last_value != 1 ||
+ host_protocol != UX_HOST_CLASS_HID_PROTOCOL_REPORT)
+ {
+ printf("Error on line %d, callback verification failed (calls=%u, val=%lu)\n",
+ __LINE__, g_set_protocol_callback_calls, g_set_protocol_last_value);
+ test_control_return(1);
+ }
+
+ if (ux_device_class_hid_protocol_get(slave_hid) != UX_DEVICE_CLASS_HID_PROTOCOL_REPORT)
+ {
+ printf("Error on line %d, protocol not set to report\n", __LINE__);
+ test_control_return(1);
+ }
+
+
+ /* Now disconnect the device. */
+ _ux_device_stack_disconnect();
+
+ /* And deinitialize the class. */
+ status = ux_device_stack_class_unregister(_ux_system_slave_class_hid_name, ux_device_class_hid_entry);
+
+ /* Deinitialize the device side of usbx. */
+ _ux_device_stack_uninitialize();
+
+ /* And finally the usbx system resources. */
+ _ux_system_uninitialize();
+
+ /* Successful test. */
+ printf("SUCCESS!\n");
+ test_control_return(0);
+}
+
+static UINT demo_thread_hid_callback(UX_SLAVE_CLASS_HID *class, UX_SLAVE_CLASS_HID_EVENT *event)
+{
+ return(UX_SUCCESS);
+}
+
+static VOID demo_set_protocol_callback(UX_SLAVE_CLASS_HID *hid, ULONG protocol)
+{
+ g_set_protocol_callback_calls++;
+ g_set_protocol_last_value = protocol;
+}
diff --git a/test/regression/usbx_ux_device_class_storage_control_request_test.c b/test/regression/usbx_ux_device_class_storage_control_request_test.c
index 5e7e0753..483f691f 100644
--- a/test/regression/usbx_ux_device_class_storage_control_request_test.c
+++ b/test/regression/usbx_ux_device_class_storage_control_request_test.c
@@ -27,7 +27,7 @@
/* Define local/extern function prototypes. */
VOID _fx_ram_driver(FX_MEDIA *media_ptr);
-void _fx_ram_drive_format(ULONG disk_size, UINT sector_size, UINT sectors_per_cluster,
+void _fx_ram_drive_format(ULONG disk_size, UINT sector_size, UINT sectors_per_cluster,
UINT fat_entries, UINT root_directory_entries);
static void demo_thread_entry(ULONG);
@@ -467,10 +467,10 @@ UCHAR *cbw;
/* All transfers pending need to abort. There may have been a partial transfer. */
ux_host_stack_transfer_request_abort(transfer_request);
-
+
/* Set the completion code. */
transfer_request -> ux_transfer_request_completion_code = UX_TRANSFER_TIMEOUT;
-
+
/* There was an error, return to the caller. */
return(UX_TRANSFER_TIMEOUT);
}
@@ -503,10 +503,10 @@ UINT status;
/* All transfers pending need to abort. There may have been a partial transfer. */
ux_host_stack_transfer_request_abort(transfer_request);
-
+
/* Set the completion code. */
transfer_request -> ux_transfer_request_completion_code = UX_TRANSFER_TIMEOUT;
-
+
/* There was an error, return to the caller. */
return(UX_TRANSFER_TIMEOUT);
}
diff --git a/test/regression/usbx_ux_device_class_storage_entry_test.c b/test/regression/usbx_ux_device_class_storage_entry_test.c
index d4297cb0..4758b97a 100644
--- a/test/regression/usbx_ux_device_class_storage_entry_test.c
+++ b/test/regression/usbx_ux_device_class_storage_entry_test.c
@@ -27,7 +27,7 @@
/* Define local/extern function prototypes. */
VOID _fx_ram_driver(FX_MEDIA *media_ptr);
-void _fx_ram_drive_format(ULONG disk_size, UINT sector_size, UINT sectors_per_cluster,
+void _fx_ram_drive_format(ULONG disk_size, UINT sector_size, UINT sectors_per_cluster,
UINT fat_entries, UINT root_directory_entries);
static void demo_thread_entry(ULONG);
@@ -467,10 +467,10 @@ UCHAR *cbw;
/* All transfers pending need to abort. There may have been a partial transfer. */
ux_host_stack_transfer_request_abort(transfer_request);
-
+
/* Set the completion code. */
transfer_request -> ux_transfer_request_completion_code = UX_TRANSFER_TIMEOUT;
-
+
/* There was an error, return to the caller. */
return(UX_TRANSFER_TIMEOUT);
}
@@ -503,10 +503,10 @@ UINT status;
/* All transfers pending need to abort. There may have been a partial transfer. */
ux_host_stack_transfer_request_abort(transfer_request);
-
+
/* Set the completion code. */
transfer_request -> ux_transfer_request_completion_code = UX_TRANSFER_TIMEOUT;
-
+
/* There was an error, return to the caller. */
return(UX_TRANSFER_TIMEOUT);
}
diff --git a/test/regression/usbx_ux_device_class_storage_initialize_test.c b/test/regression/usbx_ux_device_class_storage_initialize_test.c
index 9e096f2b..80581074 100644
--- a/test/regression/usbx_ux_device_class_storage_initialize_test.c
+++ b/test/regression/usbx_ux_device_class_storage_initialize_test.c
@@ -442,13 +442,13 @@ UINT command_length;
/* Initialize the CBW for this command. */
_ux_host_class_storage_cbw_initialize(storage, UX_HOST_CLASS_STORAGE_DATA_IN, UX_HOST_CLASS_STORAGE_INQUIRY_RESPONSE_LENGTH, command_length);
-
+
/* Prepare the INQUIRY command block. */
*(cbw + UX_HOST_CLASS_STORAGE_CBW_CB + UX_HOST_CLASS_STORAGE_INQUIRY_OPERATION) = UX_HOST_CLASS_STORAGE_SCSI_INQUIRY;
/* Store the page code. */
*(cbw + UX_HOST_CLASS_STORAGE_CBW_CB + UX_HOST_CLASS_STORAGE_INQUIRY_PAGE_CODE) = page_code;
-
+
/* Store the length of the Inquiry Response. */
*(cbw + UX_HOST_CLASS_STORAGE_CBW_CB + UX_HOST_CLASS_STORAGE_INQUIRY_ALLOCATION_LENGTH) = (UCHAR)response_length;
@@ -456,7 +456,7 @@ UINT command_length;
status = _ux_host_class_storage_transport(storage, response);
/* Return completion status. */
- return(status);
+ return(status);
}
static void _test_init_cbw_MODE_SENSE(UCHAR op6, UCHAR page_code, ULONG buffer_length)
diff --git a/test/regression/usbx_ux_device_class_storage_inquiry_test.c b/test/regression/usbx_ux_device_class_storage_inquiry_test.c
index 2e9d668b..03c64dac 100644
--- a/test/regression/usbx_ux_device_class_storage_inquiry_test.c
+++ b/test/regression/usbx_ux_device_class_storage_inquiry_test.c
@@ -207,7 +207,7 @@ static void line190_coverage(void)
UX_SLAVE_TRANSFER *transfer_request;
cbwcb_data[UX_SLAVE_CLASS_STORAGE_INQUIRY_PAGE_CODE] = UX_SLAVE_CLASS_STORAGE_INQUIRY_PAGE_CODE_SERIAL;
-
+
slave_storage.ux_slave_class_storage_host_length = 23;
slave_storage.ux_slave_class_storage_cbw_flags = 0x80;
endpoint_in.ux_slave_endpoint_transfer_request.ux_slave_transfer_request_data_pointer = data_pointer;
@@ -460,13 +460,13 @@ UINT command_length;
/* Initialize the CBW for this command. */
_ux_host_class_storage_cbw_initialize(storage, flags, data_length, cb_length);
-
+
/* Prepare the INQUIRY command block. */
*(cbw + UX_HOST_CLASS_STORAGE_CBW_CB + UX_HOST_CLASS_STORAGE_INQUIRY_OPERATION) = UX_HOST_CLASS_STORAGE_SCSI_INQUIRY;
/* Store the page code. */
*(cbw + UX_HOST_CLASS_STORAGE_CBW_CB + UX_HOST_CLASS_STORAGE_INQUIRY_PAGE_CODE) = page_code;
-
+
/* Store the length of the Inquiry Response. */
*(cbw + UX_HOST_CLASS_STORAGE_CBW_CB + UX_HOST_CLASS_STORAGE_INQUIRY_ALLOCATION_LENGTH) = (UCHAR)response_length;
@@ -474,7 +474,7 @@ UINT command_length;
status = _ux_host_class_storage_transport(storage, response);
/* Return completion status. */
- return(status);
+ return(status);
}
static UINT test_host_class_storage_inquiry(UX_HOST_CLASS_STORAGE *storage, UCHAR page_code, UCHAR *response, ULONG response_length)
diff --git a/test/regression/usbx_ux_device_class_storage_invalid_lun_test.c b/test/regression/usbx_ux_device_class_storage_invalid_lun_test.c
index 98b9a8e2..b691bb3e 100644
--- a/test/regression/usbx_ux_device_class_storage_invalid_lun_test.c
+++ b/test/regression/usbx_ux_device_class_storage_invalid_lun_test.c
@@ -441,13 +441,13 @@ UINT command_length;
/* Initialize the CBW for this command. */
_ux_host_class_storage_cbw_initialize(storage, flags, data_length, cb_length);
-
+
/* Prepare the INQUIRY command block. */
*(cbw + UX_HOST_CLASS_STORAGE_CBW_CB + UX_HOST_CLASS_STORAGE_INQUIRY_OPERATION) = UX_HOST_CLASS_STORAGE_SCSI_INQUIRY;
/* Store the page code. */
*(cbw + UX_HOST_CLASS_STORAGE_CBW_CB + UX_HOST_CLASS_STORAGE_INQUIRY_PAGE_CODE) = page_code;
-
+
/* Store the length of the Inquiry Response. */
*(cbw + UX_HOST_CLASS_STORAGE_CBW_CB + UX_HOST_CLASS_STORAGE_INQUIRY_ALLOCATION_LENGTH) = (UCHAR)response_length;
@@ -455,7 +455,7 @@ UINT command_length;
status = _ux_host_class_storage_transport(storage, response);
/* Return completion status. */
- return(status);
+ return(status);
}
static UINT test_host_class_storage_inquiry(UX_HOST_CLASS_STORAGE *storage, UCHAR page_code, UCHAR *response, ULONG response_length)
diff --git a/test/regression/usbx_ux_device_class_storage_media_start_stop_test.c b/test/regression/usbx_ux_device_class_storage_media_start_stop_test.c
new file mode 100644
index 00000000..4dc96211
--- /dev/null
+++ b/test/regression/usbx_ux_device_class_storage_media_start_stop_test.c
@@ -0,0 +1,600 @@
+/* This test is designed to cover ux_slave_class_storage_media_start_stop callback handling. */
+
+#include
+#include "tx_api.h"
+#include "ux_api.h"
+#include "ux_system.h"
+#include "ux_utility.h"
+
+#include "fx_api.h"
+
+#include "ux_device_class_storage.h"
+#include "ux_device_stack.h"
+#include "ux_host_stack.h"
+#include "ux_host_class_storage.h"
+
+#include "ux_test_dcd_sim_slave.h"
+#include "ux_test_hcd_sim_host.h"
+#include "ux_test_utility_sim.h"
+
+/* Define constants. */
+#define UX_DEMO_STACK_SIZE 2048
+#define UX_DEMO_MEMORY_SIZE (256*1024)
+#define UX_DEMO_BUFFER_SIZE 2048
+
+#define UX_RAM_DISK_SIZE (200 * 1024)
+#define UX_RAM_DISK_LAST_LBA ((UX_RAM_DISK_SIZE / 512) -1)
+
+/* Define local/extern function prototypes. */
+
+VOID _fx_ram_driver(FX_MEDIA *media_ptr);
+void _fx_ram_drive_format(ULONG disk_size, UINT sector_size, UINT sectors_per_cluster,
+ UINT fat_entries, UINT root_directory_entries);
+
+static TX_THREAD tx_demo_thread_host_simulation;
+static void tx_demo_thread_host_simulation_entry(ULONG);
+
+static UINT demo_thread_media_read(VOID *storage, ULONG lun, UCHAR * data_pointer, ULONG number_blocks, ULONG lba, ULONG *media_status);
+static UINT demo_thread_media_write(VOID *storage, ULONG lun, UCHAR * data_pointer, ULONG number_blocks, ULONG lba, ULONG *media_status);
+static UINT demo_thread_media_status(VOID *storage, ULONG lun, ULONG media_id, ULONG *media_status);
+static UINT demo_thread_media_start_stop(VOID *storage, ULONG lun, ULONG power_condition, ULONG start, ULONG load_eject);
+
+/* Define global data structures. */
+
+static UCHAR usbx_memory[UX_DEMO_MEMORY_SIZE + (UX_DEMO_STACK_SIZE * 2)];
+static UCHAR buffer[UX_DEMO_BUFFER_SIZE];
+
+static UX_HOST_CLASS_STORAGE *storage;
+static UX_SLAVE_CLASS_STORAGE_PARAMETER global_storage_parameter;
+
+static FX_MEDIA ram_disk_media1;
+static CHAR ram_disk_buffer1[512];
+static CHAR ram_disk_memory1[UX_RAM_DISK_SIZE];
+
+static UINT ram_disk_status = UX_SUCCESS;
+static ULONG ram_disk_media_status = 0;
+
+static UCHAR error_callback_ignore = UX_TRUE;
+static ULONG error_callback_counter;
+
+static volatile ULONG start_stop_call_count;
+static volatile VOID *start_stop_last_storage;
+static volatile ULONG start_stop_last_lun;
+static volatile ULONG start_stop_last_power_condition;
+static volatile ULONG start_stop_last_start;
+static volatile ULONG start_stop_last_load_eject;
+
+#define DEVICE_FRAMEWORK_LENGTH_FULL_SPEED 50
+static UCHAR device_framework_full_speed[] = {
+
+ /* Device descriptor */
+ 0x12, 0x01, 0x10, 0x01, 0x00, 0x00, 0x00, 0x08,
+ 0x81, 0x07, 0x00, 0x00, 0x00, 0x00, 0x01, 0x02,
+ 0x03, 0x01,
+
+ /* Configuration descriptor */
+ 0x09, 0x02, 0x20, 0x00, 0x01, 0x01, 0x00, 0xc0,
+ 0x32,
+
+ /* Interface descriptor */
+ 0x09, 0x04, 0x00, 0x00, 0x02, 0x08, 0x06, 0x50,
+ 0x00,
+
+ /* Endpoint descriptor (Bulk In) */
+ 0x07, 0x05, 0x81, 0x02, 0x40, 0x00, 0x00,
+
+ /* Endpoint descriptor (Bulk Out) */
+ 0x07, 0x05, 0x02, 0x02, 0x40, 0x00, 0x00
+
+ };
+
+
+#define DEVICE_FRAMEWORK_LENGTH_HIGH_SPEED 60
+static UCHAR device_framework_high_speed[] = {
+
+ /* Device descriptor */
+ 0x12, 0x01, 0x00, 0x02, 0x00, 0x00, 0x00, 0x40,
+ 0x81, 0x07, 0x00, 0x00, 0x01, 0x00, 0x01, 0x02,
+ 0x03, 0x01,
+
+ /* Device qualifier descriptor */
+ 0x0a, 0x06, 0x00, 0x02, 0x00, 0x00, 0x00, 0x40,
+ 0x01, 0x00,
+
+ /* Configuration descriptor */
+ 0x09, 0x02, 0x20, 0x00, 0x01, 0x01, 0x00, 0xc0,
+ 0x32,
+
+ /* Interface descriptor */
+ 0x09, 0x04, 0x00, 0x00, 0x02, 0x08, 0x06, 0x50,
+ 0x00,
+
+ /* Endpoint descriptor (Bulk In) */
+ 0x07, 0x05, 0x81, 0x02, 0x00, 0x01, 0x00,
+
+ /* Endpoint descriptor (Bulk Out) */
+ 0x07, 0x05, 0x02, 0x02, 0x00, 0x01, 0x00
+
+ };
+
+
+#define STRING_FRAMEWORK_LENGTH 38
+static UCHAR string_framework[] = {
+
+ /* Manufacturer string descriptor : Index 1 */
+ 0x09, 0x04, 0x01, 0x0c,
+ 0x45, 0x78, 0x70, 0x72,0x65, 0x73, 0x20, 0x4c,
+ 0x6f, 0x67, 0x69, 0x63,
+
+ /* Product string descriptor : Index 2 */
+ 0x09, 0x04, 0x02, 0x0a,
+ 0x46, 0x6c, 0x61, 0x73, 0x68, 0x20, 0x44, 0x69,
+ 0x73, 0x6b,
+
+ /* Serial Number string descriptor : Index 3 */
+ 0x09, 0x04, 0x03, 0x04,
+ 0x30, 0x30, 0x30, 0x31
+ };
+
+
+#define LANGUAGE_ID_FRAMEWORK_LENGTH 2
+static UCHAR language_id_framework[] = {
+
+ /* English. */
+ 0x09, 0x04
+ };
+
+
+/* Define the ISR dispatch. */
+
+extern VOID (*test_isr_dispatch)(void);
+
+
+/* Prototype for test control return. */
+
+void test_control_return(UINT status);
+
+
+static VOID error_callback(UINT system_level, UINT system_context, UINT error_code)
+{
+
+ error_callback_counter ++;
+
+ if (!error_callback_ignore)
+ {
+ /* Failed test. */
+ printf("Error #%d, system_level: %d, system_context: %d, error_code: 0x%x\n", __LINE__, system_level, system_context, error_code);
+ test_control_return(1);
+ }
+}
+
+static UINT host_storage_instance_get(ULONG timeout_x10ms)
+{
+
+UINT status;
+UX_HOST_CLASS *class;
+
+
+ /* Find the main storage container */
+ status = ux_host_stack_class_get(_ux_system_host_class_storage_name, &class);
+ if (status != UX_SUCCESS)
+ return(status);
+
+ /* Get storage instance, wait it to be live and media attached. */
+ do
+ {
+ if (timeout_x10ms)
+ {
+ ux_utility_delay_ms(10);
+ if (timeout_x10ms != 0xFFFFFFFF)
+ timeout_x10ms --;
+ }
+
+ status = ux_host_stack_class_instance_get(class, 0, (void **) &storage);
+ if (status == UX_SUCCESS)
+ {
+ if (storage -> ux_host_class_storage_state == UX_HOST_CLASS_INSTANCE_LIVE &&
+ class -> ux_host_class_media != UX_NULL)
+ return(UX_SUCCESS);
+ }
+
+ } while(timeout_x10ms > 0);
+
+ return(UX_ERROR);
+}
+
+/* Define what the initial system looks like. */
+
+#ifdef CTEST
+void test_application_define(void *first_unused_memory)
+#else
+void usbx_ux_device_class_storage_media_start_stop_test_application_define(void *first_unused_memory)
+#endif
+{
+
+UINT status;
+CHAR * stack_pointer;
+CHAR * memory_pointer;
+
+
+ /* Inform user. */
+ printf("Running ux_device_class_storage_media_start_stop Test.............. ");
+ stepinfo("\n");
+
+ /* Initialize the free memory pointer */
+ stack_pointer = (CHAR *) usbx_memory;
+ memory_pointer = stack_pointer + (UX_DEMO_STACK_SIZE * 2);
+
+ /* Initialize USBX. Memory */
+ status = ux_system_initialize(memory_pointer, UX_DEMO_MEMORY_SIZE, UX_NULL,0);
+
+ /* Check for error. */
+ if (status != UX_SUCCESS)
+ {
+ printf("ERROR #%d\n", __LINE__);
+ test_control_return(1);
+ }
+
+ /* Register the error callback. */
+ _ux_utility_error_callback_register(error_callback);
+
+ /* Reset ram disk memory. */
+ ux_utility_memory_set(ram_disk_memory1, 0, UX_RAM_DISK_SIZE);
+
+ /* Initialize FileX. */
+ fx_system_initialize();
+
+ /* Format the ram drive. */
+ fx_media_format(&ram_disk_media1, _fx_ram_driver, ram_disk_memory1, ram_disk_buffer1, 512, "RAM DISK", 2, 512, 0, UX_RAM_DISK_SIZE/512, 512, 4, 1, 1);
+
+ /* Initialize the device portion of USBX. */
+ status = ux_device_stack_initialize(device_framework_high_speed, DEVICE_FRAMEWORK_LENGTH_HIGH_SPEED,
+ device_framework_full_speed, DEVICE_FRAMEWORK_LENGTH_FULL_SPEED,
+ string_framework, STRING_FRAMEWORK_LENGTH,
+ language_id_framework, LANGUAGE_ID_FRAMEWORK_LENGTH,UX_NULL);
+ if(status!=UX_SUCCESS)
+ {
+ printf("ERROR #%d\n", __LINE__);
+ test_control_return(1);
+ }
+
+ /* Store the number of LUN in this device storage instance. */
+ global_storage_parameter.ux_slave_class_storage_parameter_number_lun = 1;
+
+ /* Initialize the storage class parameters for reading/writing. */
+ global_storage_parameter.ux_slave_class_storage_parameter_lun[0].ux_slave_class_storage_media_last_lba = UX_RAM_DISK_LAST_LBA;
+ global_storage_parameter.ux_slave_class_storage_parameter_lun[0].ux_slave_class_storage_media_block_length = 512;
+ global_storage_parameter.ux_slave_class_storage_parameter_lun[0].ux_slave_class_storage_media_type = 0;
+ global_storage_parameter.ux_slave_class_storage_parameter_lun[0].ux_slave_class_storage_media_removable_flag = 0x80;
+ global_storage_parameter.ux_slave_class_storage_parameter_lun[0].ux_slave_class_storage_media_read = demo_thread_media_read;
+ global_storage_parameter.ux_slave_class_storage_parameter_lun[0].ux_slave_class_storage_media_write = demo_thread_media_write;
+ global_storage_parameter.ux_slave_class_storage_parameter_lun[0].ux_slave_class_storage_media_status = demo_thread_media_status;
+ global_storage_parameter.ux_slave_class_storage_parameter_lun[0].ux_slave_class_storage_media_start_stop = demo_thread_media_start_stop;
+
+ /* Initialize the device storage class. The class is connected with interface 0 on configuration 1. */
+ status = ux_device_stack_class_register(_ux_system_slave_class_storage_name, ux_device_class_storage_entry,
+ 1, 0, (VOID *)&global_storage_parameter);
+ if(status!=UX_SUCCESS)
+ {
+ printf("ERROR #%d\n", __LINE__);
+ test_control_return(1);
+ }
+
+ /* Initialize the simulated device controller. */
+ status = _ux_dcd_sim_slave_initialize();
+
+ /* Check for error. */
+ if (status != UX_SUCCESS)
+ {
+ printf("ERROR #%d\n", __LINE__);
+ test_control_return(1);
+ }
+
+ /* The code below is required for installing the host portion of USBX */
+ status = ux_host_stack_initialize(UX_NULL);
+ if (status != UX_SUCCESS)
+ {
+ printf("ERROR #%d\n", __LINE__);
+ test_control_return(1);
+ }
+
+ /* Register storage class. */
+ status = ux_host_stack_class_register(_ux_system_host_class_storage_name, ux_host_class_storage_entry);
+ if (status != UX_SUCCESS)
+ {
+ printf("ERROR #%d\n", __LINE__);
+ test_control_return(1);
+ }
+
+ /* Register all the USB host controllers available in this system */
+ status = ux_host_stack_hcd_register(_ux_system_host_hcd_simulator_name, _ux_test_hcd_sim_host_initialize,0,0);
+
+ /* Check for error. */
+ if (status != UX_SUCCESS)
+ {
+ printf("ERROR #%d\n", __LINE__);
+ test_control_return(1);
+ }
+
+ /* Create the main host simulation thread. */
+ status = tx_thread_create(&tx_demo_thread_host_simulation, "tx demo host simulation", tx_demo_thread_host_simulation_entry, 0,
+ stack_pointer, UX_DEMO_STACK_SIZE,
+ 20, 20, 1, TX_AUTO_START);
+
+ /* Check for error. */
+ if (status != TX_SUCCESS)
+ {
+ printf("ERROR #%d\n", __LINE__);
+ test_control_return(1);
+ }
+}
+
+static UINT storage_media_status_wait(UX_HOST_CLASS_STORAGE_MEDIA *storage_media, ULONG status, ULONG timeout)
+{
+
+ while(1)
+ {
+#if !defined(UX_HOST_CLASS_STORAGE_NO_FILEX)
+ if (storage_media->ux_host_class_storage_media_status == status)
+ return UX_SUCCESS;
+#else
+ if ((status == UX_HOST_CLASS_STORAGE_MEDIA_MOUNTED &&
+ storage_media->ux_host_class_storage_media_storage != UX_NULL) ||
+ (status == UX_HOST_CLASS_STORAGE_MEDIA_UNMOUNTED &&
+ storage_media->ux_host_class_storage_media_storage == UX_NULL))
+ return(UX_SUCCESS);
+#endif
+ if (timeout == 0)
+ break;
+ if (timeout != 0xFFFFFFFF)
+ timeout --;
+ _ux_utility_delay_ms(10);
+ }
+ return UX_ERROR;
+}
+
+static void _test_init_cbw_START_STOP(UCHAR byte4)
+{
+
+UCHAR *cbw;
+UINT command_length;
+
+
+ cbw = (UCHAR *) storage -> ux_host_class_storage_cbw;
+ command_length = UX_HOST_CLASS_STORAGE_TEST_READY_COMMAND_LENGTH_SBC;
+ _ux_host_class_storage_cbw_initialize(storage, 0, 0, command_length);
+ *(cbw + UX_HOST_CLASS_STORAGE_CBW_CB + 0) = UX_SLAVE_CLASS_STORAGE_SCSI_START_STOP;
+ *(cbw + UX_HOST_CLASS_STORAGE_CBW_CB + 4) = byte4;
+}
+
+static UINT _test_send_cbw(void)
+{
+
+UX_TRANSFER *transfer_request;
+UINT status;
+UCHAR *cbw;
+
+
+ transfer_request = &storage -> ux_host_class_storage_bulk_out_endpoint -> ux_endpoint_transfer_request;
+ cbw = (UCHAR *) storage -> ux_host_class_storage_cbw;
+
+ transfer_request -> ux_transfer_request_data_pointer = cbw;
+ transfer_request -> ux_transfer_request_requested_length = UX_HOST_CLASS_STORAGE_CBW_LENGTH;
+ status = ux_host_stack_transfer_request(transfer_request);
+
+ /* There is error, return the error code. */
+ if (status != UX_SUCCESS)
+ return(status);
+
+ /* Wait transfer done. */
+ status = _ux_utility_semaphore_get(&transfer_request -> ux_transfer_request_semaphore, MS_TO_TICK(UX_HOST_CLASS_STORAGE_TRANSFER_TIMEOUT));
+
+ /* No error, it's done. */
+ if (status == UX_SUCCESS)
+ return(transfer_request->ux_transfer_request_completion_code);
+
+ /* All transfers pending need to abort. There may have been a partial transfer. */
+ ux_host_stack_transfer_request_abort(transfer_request);
+
+ /* Set the completion code. */
+ transfer_request -> ux_transfer_request_completion_code = UX_TRANSFER_TIMEOUT;
+
+ /* There was an error, return to the caller. */
+ return(UX_TRANSFER_TIMEOUT);
+}
+
+static UINT _test_wait_csw(void)
+{
+
+UX_TRANSFER *transfer_request;
+UINT status;
+
+
+ /* Get the pointer to the transfer request, on the bulk in endpoint. */
+ transfer_request = &storage -> ux_host_class_storage_bulk_in_endpoint -> ux_endpoint_transfer_request;
+
+ /* Fill in the transfer_request parameters. */
+ transfer_request -> ux_transfer_request_data_pointer = (UCHAR *) &storage -> ux_host_class_storage_csw;
+ transfer_request -> ux_transfer_request_requested_length = UX_HOST_CLASS_STORAGE_CSW_LENGTH;
+
+ /* Get the CSW on the bulk in endpoint. */
+ status = ux_host_stack_transfer_request(transfer_request);
+ if (status != UX_SUCCESS)
+ 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));
+
+ /* If OK, we are done. */
+ if (status == UX_SUCCESS)
+ return(transfer_request->ux_transfer_request_completion_code);
+
+ /* All transfers pending need to abort. There may have been a partial transfer. */
+ ux_host_stack_transfer_request_abort(transfer_request);
+
+ /* Set the completion code. */
+ transfer_request -> ux_transfer_request_completion_code = UX_TRANSFER_TIMEOUT;
+
+ /* There was an error, return to the caller. */
+ return(UX_TRANSFER_TIMEOUT);
+}
+
+static void tx_demo_thread_host_simulation_entry(ULONG arg)
+{
+
+UINT status;
+UX_HOST_CLASS *class;
+UX_HOST_CLASS_STORAGE_MEDIA *storage_media;
+UX_DEVICE *device;
+
+
+ /* Find the storage class. */
+ status = host_storage_instance_get(100);
+ if (status != UX_SUCCESS)
+ {
+ printf("ERROR #%d\n", __LINE__);
+ test_control_return(1);
+ }
+
+ status = ux_host_stack_device_get(0, &device);
+ if (status != UX_SUCCESS)
+ {
+ printf("ERROR #%d: device_get fail\n", __LINE__);
+ test_control_return(1);
+ }
+
+ /* Wait enough time for media mounting. */
+ _ux_utility_delay_ms(UX_HOST_CLASS_STORAGE_DEVICE_INIT_DELAY);
+
+ class = storage->ux_host_class_storage_class;
+ storage_media = (UX_HOST_CLASS_STORAGE_MEDIA *)class->ux_host_class_media;
+
+ /* Confirm media enum done. */
+ status = storage_media_status_wait(storage_media, UX_HOST_CLASS_STORAGE_MEDIA_MOUNTED, 100);
+ if (status != UX_SUCCESS)
+ {
+ printf("ERROR #%d\n", __LINE__);
+ test_control_return(1);
+ }
+
+ /* Pause the class driver thread. */
+ _ux_utility_thread_suspend(&((UX_HOST_CLASS_STORAGE_EXT*)class->ux_host_class_ext)->ux_host_class_thread);
+
+ start_stop_call_count = 0;
+ start_stop_last_storage = UX_NULL;
+ start_stop_last_lun = 0;
+ start_stop_last_power_condition = 0;
+ start_stop_last_start = 0;
+ start_stop_last_load_eject = 0;
+
+ /* START STOP UNIT: POWER CONDITION=0, LOEJ=1, START=0 (eject). */
+ _test_init_cbw_START_STOP(0x02);
+ status = _test_send_cbw();
+ if (status != UX_SUCCESS)
+ {
+ printf("ERROR #%d: code 0x%x\n", __LINE__, status);
+ test_control_return(1);
+ }
+ status = _test_wait_csw();
+ if (status != UX_SUCCESS)
+ {
+ printf("ERROR #%d: code 0x%x\n", __LINE__, status);
+ test_control_return(1);
+ }
+
+ /* START STOP UNIT: POWER CONDITION=0, LOEJ=1, START=1 (load). */
+ _test_init_cbw_START_STOP(0x03);
+ status = _test_send_cbw();
+ if (status != UX_SUCCESS)
+ {
+ printf("ERROR #%d: code 0x%x\n", __LINE__, status);
+ test_control_return(1);
+ }
+ status = _test_wait_csw();
+ if (status != UX_SUCCESS)
+ {
+ printf("ERROR #%d: code 0x%x\n", __LINE__, status);
+ test_control_return(1);
+ }
+
+ if (start_stop_call_count != 2 ||
+ start_stop_last_storage == UX_NULL ||
+ start_stop_last_lun != 0 ||
+ start_stop_last_power_condition != 0 ||
+ start_stop_last_start != 1 ||
+ start_stop_last_load_eject != 1)
+ {
+ printf("ERROR #%d: media_start_stop args: cnt=%lu storage=%p lun=%lu pc=%lu start=%lu loej=%lu\n",
+ __LINE__, (ULONG)start_stop_call_count, (VOID *)start_stop_last_storage,
+ (ULONG)start_stop_last_lun, (ULONG)start_stop_last_power_condition,
+ (ULONG)start_stop_last_start, (ULONG)start_stop_last_load_eject);
+ test_control_return(1);
+ }
+
+ /* Finally disconnect the device. */
+ ux_device_stack_disconnect();
+
+ /* And deinitialize the class. */
+ status = ux_device_stack_class_unregister(_ux_system_slave_class_storage_name, ux_device_class_storage_entry);
+
+ /* Deinitialize the device side of usbx. */
+ _ux_device_stack_uninitialize();
+
+ /* And finally the usbx system resources. */
+ _ux_system_uninitialize();
+
+ /* Successful test. */
+ printf("SUCCESS!\n");
+ test_control_return(0);
+}
+
+static UINT demo_thread_media_status(VOID *storage, ULONG lun, ULONG media_id, ULONG *media_status)
+{
+
+UINT status = ram_disk_status;
+
+
+ (void)storage;
+ (void)lun;
+ (void)media_id;
+
+ if (media_status)
+ *media_status = ram_disk_media_status;
+
+ return status;
+}
+
+static UINT demo_thread_media_read(VOID *storage, ULONG lun, UCHAR * data_pointer, ULONG number_blocks, ULONG lba, ULONG *media_status)
+{
+ (void)storage;
+ (void)lun;
+ (void)media_status;
+
+ ux_utility_memory_copy(data_pointer, &ram_disk_memory1[lba * 512], number_blocks * 512);
+
+ return UX_SUCCESS;
+}
+
+static UINT demo_thread_media_write(VOID *storage, ULONG lun, UCHAR * data_pointer, ULONG number_blocks, ULONG lba, ULONG *media_status)
+{
+ (void)storage;
+ (void)lun;
+ (void)media_status;
+
+ ux_utility_memory_copy(&ram_disk_memory1[lba * 512], data_pointer, number_blocks * 512);
+
+ return UX_SUCCESS;
+}
+
+static UINT demo_thread_media_start_stop(VOID *storage, ULONG lun, ULONG power_condition, ULONG start, ULONG load_eject)
+{
+
+ start_stop_call_count++;
+ start_stop_last_storage = storage;
+ start_stop_last_lun = lun;
+ start_stop_last_power_condition = power_condition;
+ start_stop_last_start = start;
+ start_stop_last_load_eject = load_eject;
+
+ return(UX_SUCCESS);
+}
diff --git a/test/regression/usbx_ux_device_class_storage_read_test.c b/test/regression/usbx_ux_device_class_storage_read_test.c
index 8e61630e..57d94250 100644
--- a/test/regression/usbx_ux_device_class_storage_read_test.c
+++ b/test/regression/usbx_ux_device_class_storage_read_test.c
@@ -464,13 +464,13 @@ UINT command_length;
/* Initialize the CBW for this command. */
_ux_host_class_storage_cbw_initialize(storage, UX_HOST_CLASS_STORAGE_DATA_IN, UX_HOST_CLASS_STORAGE_INQUIRY_RESPONSE_LENGTH, command_length);
-
+
/* Prepare the INQUIRY command block. */
*(cbw + UX_HOST_CLASS_STORAGE_CBW_CB + UX_HOST_CLASS_STORAGE_INQUIRY_OPERATION) = UX_HOST_CLASS_STORAGE_SCSI_INQUIRY;
/* Store the page code. */
*(cbw + UX_HOST_CLASS_STORAGE_CBW_CB + UX_HOST_CLASS_STORAGE_INQUIRY_PAGE_CODE) = page_code;
-
+
/* Store the length of the Inquiry Response. */
*(cbw + UX_HOST_CLASS_STORAGE_CBW_CB + UX_HOST_CLASS_STORAGE_INQUIRY_ALLOCATION_LENGTH) = (UCHAR)response_length;
@@ -478,7 +478,7 @@ UINT command_length;
status = _ux_host_class_storage_transport(storage, response);
/* Return completion status. */
- return(status);
+ return(status);
}
typedef struct cbw_read_struct {
diff --git a/test/regression/usbx_ux_device_class_storage_request_sense_coverage_test.c b/test/regression/usbx_ux_device_class_storage_request_sense_coverage_test.c
index ce3d1398..869f0f66 100644
--- a/test/regression/usbx_ux_device_class_storage_request_sense_coverage_test.c
+++ b/test/regression/usbx_ux_device_class_storage_request_sense_coverage_test.c
@@ -30,7 +30,7 @@ void usbx_device_class_storage_request_sense_coverage_test_application_define
_ux_system_slave = &system_slave;
cbwcb_data[UX_SLAVE_CLASS_STORAGE_INQUIRY_PAGE_CODE] = UX_SLAVE_CLASS_STORAGE_INQUIRY_PAGE_CODE_SERIAL;
-
+
slave_storage.ux_slave_class_storage_host_length = 0;
endpoint_in.ux_slave_endpoint_transfer_request.ux_slave_transfer_request_data_pointer = data_pointer;
diff --git a/test/regression/usbx_ux_device_class_storage_synchronize_cache_test.c b/test/regression/usbx_ux_device_class_storage_synchronize_cache_test.c
index 4f376728..6a5eb0f9 100644
--- a/test/regression/usbx_ux_device_class_storage_synchronize_cache_test.c
+++ b/test/regression/usbx_ux_device_class_storage_synchronize_cache_test.c
@@ -448,13 +448,13 @@ UINT command_length;
/* Initialize the CBW for this command. */
_ux_host_class_storage_cbw_initialize(storage, UX_HOST_CLASS_STORAGE_DATA_IN, UX_HOST_CLASS_STORAGE_INQUIRY_RESPONSE_LENGTH, command_length);
-
+
/* Prepare the INQUIRY command block. */
*(cbw + UX_HOST_CLASS_STORAGE_CBW_CB + UX_HOST_CLASS_STORAGE_INQUIRY_OPERATION) = UX_HOST_CLASS_STORAGE_SCSI_INQUIRY;
/* Store the page code. */
*(cbw + UX_HOST_CLASS_STORAGE_CBW_CB + UX_HOST_CLASS_STORAGE_INQUIRY_PAGE_CODE) = page_code;
-
+
/* Store the length of the Inquiry Response. */
*(cbw + UX_HOST_CLASS_STORAGE_CBW_CB + UX_HOST_CLASS_STORAGE_INQUIRY_ALLOCATION_LENGTH) = (UCHAR)response_length;
@@ -462,7 +462,7 @@ UINT command_length;
status = _ux_host_class_storage_transport(storage, response);
/* Return completion status. */
- return(status);
+ return(status);
}
static void _test_init_cbw_SYNCHRONIZE_CACHE(UCHAR op16, UCHAR immed, ULONG lba, ULONG nb_blocks)
diff --git a/test/regression/usbx_ux_device_class_storage_test_ready_test.c b/test/regression/usbx_ux_device_class_storage_test_ready_test.c
index 84e895cd..014cb16f 100644
--- a/test/regression/usbx_ux_device_class_storage_test_ready_test.c
+++ b/test/regression/usbx_ux_device_class_storage_test_ready_test.c
@@ -28,7 +28,7 @@
/* Define local/extern function prototypes. */
VOID _fx_ram_driver(FX_MEDIA *media_ptr);
-void _fx_ram_drive_format(ULONG disk_size, UINT sector_size, UINT sectors_per_cluster,
+void _fx_ram_drive_format(ULONG disk_size, UINT sector_size, UINT sectors_per_cluster,
UINT fat_entries, UINT root_directory_entries);
static void demo_thread_entry(ULONG);
diff --git a/test/regression/usbx_ux_device_class_storage_thread_test.c b/test/regression/usbx_ux_device_class_storage_thread_test.c
index 723fcdfb..dfd33d8e 100644
--- a/test/regression/usbx_ux_device_class_storage_thread_test.c
+++ b/test/regression/usbx_ux_device_class_storage_thread_test.c
@@ -488,13 +488,13 @@ UINT command_length;
/* Initialize the CBW for this command. */
_ux_host_class_storage_cbw_initialize(storage, UX_HOST_CLASS_STORAGE_DATA_IN, UX_HOST_CLASS_STORAGE_INQUIRY_RESPONSE_LENGTH, command_length);
-
+
/* Prepare the INQUIRY command block. */
*(cbw + UX_HOST_CLASS_STORAGE_CBW_CB + UX_HOST_CLASS_STORAGE_INQUIRY_OPERATION) = UX_HOST_CLASS_STORAGE_SCSI_INQUIRY;
/* Store the page code. */
*(cbw + UX_HOST_CLASS_STORAGE_CBW_CB + UX_HOST_CLASS_STORAGE_INQUIRY_PAGE_CODE) = page_code;
-
+
/* Store the length of the Inquiry Response. */
*(cbw + UX_HOST_CLASS_STORAGE_CBW_CB + UX_HOST_CLASS_STORAGE_INQUIRY_ALLOCATION_LENGTH) = (UCHAR)response_length;
@@ -502,7 +502,7 @@ UINT command_length;
status = _ux_host_class_storage_transport(storage, response);
/* Return completion status. */
- return(status);
+ return(status);
}
static void _test_init_cbw(UCHAR dCBWSignature_error,
diff --git a/test/regression/usbx_ux_device_class_storage_vendor_strings_test.c b/test/regression/usbx_ux_device_class_storage_vendor_strings_test.c
index e36037c4..cccc6edf 100644
--- a/test/regression/usbx_ux_device_class_storage_vendor_strings_test.c
+++ b/test/regression/usbx_ux_device_class_storage_vendor_strings_test.c
@@ -43,7 +43,7 @@ UCHAR test_ux_system_slave_class_storage_product_serial[] = "0123456789012345678
/* HID reports. */
-static UCHAR hid_mouse_report[] = {
+static UCHAR hid_mouse_report[] = {
0x05, 0x01, // USAGE_PAGE (Generic Desktop)
0x09, 0x02, // USAGE (Mouse)
@@ -84,7 +84,7 @@ static UCHAR hid_mouse_report[] = {
};
#define HID_MOUSE_REPORT_LENGTH sizeof(hid_mouse_report)
-static UCHAR hid_keyboard_report[] = {
+static UCHAR hid_keyboard_report[] = {
0x05, 0x01, // USAGE_PAGE (Generic Desktop)
0x09, 0x06, // USAGE (Keyboard)
@@ -479,7 +479,7 @@ UINT status;
return status;
}
- /* The code below is required for installing the device portion of USBX.
+ /* The code below is required for installing the device portion of USBX.
In this demo, DFU is possible and we have a call back for state change. */
status = ux_device_stack_initialize(device_framework_high_speed, DEVICE_FRAMEWORK_LENGTH_HIGH_SPEED,
device_framework_full_speed, DEVICE_FRAMEWORK_LENGTH_FULL_SPEED,
@@ -493,7 +493,7 @@ UINT status;
}
/* Initilize the device storage class. The class is connected with interface 0 on configuration 1. */
- status = ux_device_stack_class_register(_ux_system_slave_class_storage_name, ux_device_class_storage_entry,
+ status = ux_device_stack_class_register(_ux_system_slave_class_storage_name, ux_device_class_storage_entry,
1, 0, (VOID *)&storage_parameter);
if(status!=UX_SUCCESS)
{
@@ -532,13 +532,13 @@ UINT command_length;
/* Initialize the CBW for this command. */
_ux_host_class_storage_cbw_initialize(storage, UX_HOST_CLASS_STORAGE_DATA_IN, UX_HOST_CLASS_STORAGE_INQUIRY_RESPONSE_LENGTH, command_length);
-
+
/* Prepare the INQUIRY command block. */
*(cbw + UX_HOST_CLASS_STORAGE_CBW_CB + UX_HOST_CLASS_STORAGE_INQUIRY_OPERATION) = UX_HOST_CLASS_STORAGE_SCSI_INQUIRY;
/* Store the page code. */
*(cbw + UX_HOST_CLASS_STORAGE_CBW_CB + UX_HOST_CLASS_STORAGE_INQUIRY_PAGE_CODE) = page_code;
-
+
/* Store the length of the Inquiry Response. */
*(cbw + UX_HOST_CLASS_STORAGE_CBW_CB + UX_HOST_CLASS_STORAGE_INQUIRY_ALLOCATION_LENGTH) = (UCHAR)response_length;
@@ -546,7 +546,7 @@ UINT command_length;
status = _ux_host_class_storage_transport(storage, response);
/* Return completion status. */
- return(status);
+ return(status);
}
/* Define what the initial system looks like. */
@@ -599,7 +599,7 @@ CHAR * memory_pointer;
storage_parameter.ux_slave_class_storage_parameter_lun[0].ux_slave_class_storage_media_type = 0;
storage_parameter.ux_slave_class_storage_parameter_lun[0].ux_slave_class_storage_media_removable_flag = 0x80;
storage_parameter.ux_slave_class_storage_parameter_lun[0].ux_slave_class_storage_media_read = default_device_media_read;
- storage_parameter.ux_slave_class_storage_parameter_lun[0].ux_slave_class_storage_media_write = default_device_media_write;
+ storage_parameter.ux_slave_class_storage_parameter_lun[0].ux_slave_class_storage_media_write = default_device_media_write;
storage_parameter.ux_slave_class_storage_parameter_lun[0].ux_slave_class_storage_media_status = default_device_media_status;
/* Initialize callbacks. */
@@ -896,16 +896,16 @@ UINT status = UX_SUCCESS;
status = ram_disk.fx_media_driver_status;
- }
+ }
else
- {
+ {
while(number_blocks--)
{
status = fx_media_read(&ram_disk,lba,data_pointer);
data_pointer+=512;
lba++;
}
- }
+ }
return(status);
}
@@ -924,7 +924,7 @@ UINT status = UX_SUCCESS;
status = ram_disk.fx_media_driver_status;
- }
+ }
else
{
@@ -933,7 +933,7 @@ UINT status = UX_SUCCESS;
status = fx_media_write(&ram_disk,lba,data_pointer);
data_pointer+=512;
lba++;
- }
+ }
return(status);
}
return(status);
diff --git a/test/regression/usbx_ux_device_class_storage_write_test.c b/test/regression/usbx_ux_device_class_storage_write_test.c
index 61ea67d2..7d2aa061 100644
--- a/test/regression/usbx_ux_device_class_storage_write_test.c
+++ b/test/regression/usbx_ux_device_class_storage_write_test.c
@@ -464,13 +464,13 @@ UINT command_length;
/* Initialize the CBW for this command. */
_ux_host_class_storage_cbw_initialize(storage, UX_HOST_CLASS_STORAGE_DATA_IN, UX_HOST_CLASS_STORAGE_INQUIRY_RESPONSE_LENGTH, command_length);
-
+
/* Prepare the INQUIRY command block. */
*(cbw + UX_HOST_CLASS_STORAGE_CBW_CB + UX_HOST_CLASS_STORAGE_INQUIRY_OPERATION) = UX_HOST_CLASS_STORAGE_SCSI_INQUIRY;
/* Store the page code. */
*(cbw + UX_HOST_CLASS_STORAGE_CBW_CB + UX_HOST_CLASS_STORAGE_INQUIRY_PAGE_CODE) = page_code;
-
+
/* Store the length of the Inquiry Response. */
*(cbw + UX_HOST_CLASS_STORAGE_CBW_CB + UX_HOST_CLASS_STORAGE_INQUIRY_ALLOCATION_LENGTH) = (UCHAR)response_length;
@@ -478,7 +478,7 @@ UINT command_length;
status = _ux_host_class_storage_transport(storage, response);
/* Return completion status. */
- return(status);
+ return(status);
}
typedef struct cbw_write_struct {
diff --git a/test/regression/usbx_ux_device_stack_class_control_request_test.c b/test/regression/usbx_ux_device_stack_class_control_request_test.c
index cbd27da2..d2e27100 100644
--- a/test/regression/usbx_ux_device_stack_class_control_request_test.c
+++ b/test/regression/usbx_ux_device_stack_class_control_request_test.c
@@ -219,7 +219,7 @@ struct _test_struct {
return;
}
}
-
+
printf("SUCCESS!\n");
test_control_return(0);
diff --git a/test/regression/usbx_ux_device_stack_control_request_process_coverage_test.c b/test/regression/usbx_ux_device_stack_control_request_process_coverage_test.c
index 75ee1900..18fe33f8 100644
--- a/test/regression/usbx_ux_device_stack_control_request_process_coverage_test.c
+++ b/test/regression/usbx_ux_device_stack_control_request_process_coverage_test.c
@@ -48,7 +48,7 @@ UCHAR request = 0;
slave_class1.ux_slave_class_entry_function = _test_class_entry;
slave_interface.ux_slave_interface_descriptor.bInterfaceClass = 0x7;
_ux_device_stack_control_request_process(&transfer_request);
-
+
printf("SUCCESS!\n");
test_control_return(0);
diff --git a/test/regression/usbx_ux_device_stack_descriptor_send_test.c b/test/regression/usbx_ux_device_stack_descriptor_send_test.c
index b04da6ff..3cafba58 100644
--- a/test/regression/usbx_ux_device_stack_descriptor_send_test.c
+++ b/test/regression/usbx_ux_device_stack_descriptor_send_test.c
@@ -110,7 +110,7 @@ static UCHAR device_framework_high_speed[DEVICE_FRAMEWORK_LENGTH_HIGH_SPEED] = {
static UCHAR string_framework[] = {
/* Manufacturer string descriptor : Index 1 */
- 0x09, 0x04, 0x01,
+ 0x09, 0x04, 0x01,
0xff, /* Set the length to something very large. */
0x45, 0x78, 0x70, 0x72,0x65, 0x73, 0x20, 0x4c,
0x6f, 0x67, 0x69, 0x63,
@@ -306,7 +306,7 @@ UCHAR *hid_class_descriptor = device_framework_high_spe
/* Get the HID client */
hid_client = hid -> ux_host_class_hid_client;
-
+
/* Check if the instance of the keyboard is live */
if (hid_client && hid_client -> ux_host_class_hid_client_local_instance != UX_NULL)
break;
diff --git a/test/regression/usbx_ux_device_stack_initialize_test.c b/test/regression/usbx_ux_device_stack_initialize_test.c
index 3ee634cc..4e215ba4 100644
--- a/test/regression/usbx_ux_device_stack_initialize_test.c
+++ b/test/regression/usbx_ux_device_stack_initialize_test.c
@@ -257,7 +257,7 @@ UX_SLAVE_CLASS_HID_PARAMETER hid_parameter;
test_control_return(1);
}
#else
- /* Successful test. */
+ /* Successful test. */
printf("SUCCESS!\n");
test_control_return(0);
#endif
diff --git a/test/regression/usbx_ux_device_stack_remote_wakeup_test.c b/test/regression/usbx_ux_device_stack_remote_wakeup_test.c
index a9391674..98b0524e 100644
--- a/test/regression/usbx_ux_device_stack_remote_wakeup_test.c
+++ b/test/regression/usbx_ux_device_stack_remote_wakeup_test.c
@@ -250,11 +250,11 @@ UX_HOST_CLASS_CDC_ACM *cdc_acm;
case UX_HOST_CLASS_CDC_CONTROL_CLASS:
cdc_acm_host_control = cdc_acm;
break;
-
+
case UX_HOST_CLASS_CDC_DATA_CLASS:
cdc_acm_host_data = cdc_acm;
break;
-
+
default:
break;
}
diff --git a/test/regression/usbx_ux_device_stack_standard_request_tests.c b/test/regression/usbx_ux_device_stack_standard_request_tests.c
index 18ce0311..c7eafe62 100644
--- a/test/regression/usbx_ux_device_stack_standard_request_tests.c
+++ b/test/regression/usbx_ux_device_stack_standard_request_tests.c
@@ -1433,8 +1433,8 @@ UX_SLAVE_TRANSFER *slave_transfer_request;
UCHAR string_descriptor_manufacturer_length = *(string_framework + 3);
UCHAR get_string_descriptor_manufacturer_expected[] = {
- /* bLength. '2 +' is for bLength and bDescriptorType, '0x0c' is the length of
- the string, and '*2' is because it's 16-bit unicode, where each character
+ /* bLength. '2 +' is for bLength and bDescriptorType, '0x0c' is the length of
+ the string, and '*2' is because it's 16-bit unicode, where each character
is 2 bytes, the LSB is the value, and MSB is 0 (for ascii anyways). */
(UCHAR)(2 + string_descriptor_manufacturer_length*2),
@@ -1446,7 +1446,7 @@ UX_SLAVE_TRANSFER *slave_transfer_request;
0x78, 0x00,
0x70, 0x00,
0x72, 0x00,
- 0x65, 0x00,
+ 0x65, 0x00,
0x73, 0x00,
0x20, 0x00,
0x4c, 0x00,
diff --git a/test/regression/usbx_ux_host_class_cdc_acm_read_test.c b/test/regression/usbx_ux_host_class_cdc_acm_read_test.c
index 7c1a854b..13adb011 100644
--- a/test/regression/usbx_ux_host_class_cdc_acm_read_test.c
+++ b/test/regression/usbx_ux_host_class_cdc_acm_read_test.c
@@ -245,11 +245,11 @@ UX_HOST_CLASS_CDC_ACM *cdc_acm;
case UX_HOST_CLASS_CDC_CONTROL_CLASS:
cdc_acm_host_control = cdc_acm;
break;
-
+
case UX_HOST_CLASS_CDC_DATA_CLASS:
cdc_acm_host_data = cdc_acm;
break;
-
+
default:
break;
}
diff --git a/test/regression/usbx_ux_host_class_cdc_acm_write_test.c b/test/regression/usbx_ux_host_class_cdc_acm_write_test.c
index 0f0c125e..e4c42f54 100644
--- a/test/regression/usbx_ux_host_class_cdc_acm_write_test.c
+++ b/test/regression/usbx_ux_host_class_cdc_acm_write_test.c
@@ -250,11 +250,11 @@ UX_HOST_CLASS_CDC_ACM *cdc_acm;
case UX_HOST_CLASS_CDC_CONTROL_CLASS:
cdc_acm_host_control = cdc_acm;
break;
-
+
case UX_HOST_CLASS_CDC_DATA_CLASS:
cdc_acm_host_data = cdc_acm;
break;
-
+
default:
break;
}
diff --git a/test/regression/usbx_ux_host_class_cdc_ecm_interrupt_notification_test.c b/test/regression/usbx_ux_host_class_cdc_ecm_interrupt_notification_test.c
index cb97ee6f..c6928ede 100644
--- a/test/regression/usbx_ux_host_class_cdc_ecm_interrupt_notification_test.c
+++ b/test/regression/usbx_ux_host_class_cdc_ecm_interrupt_notification_test.c
@@ -24,8 +24,8 @@ static void post_init_host()
UX_HOST_CLASS_CDC_ECM my_cdc_ecm;
UX_TRANSFER transfer_request;
UCHAR transfer_request_data[16];
-UX_ENDPOINT endpoint;
-ULONG notification_count;
+UX_ENDPOINT endpoint;
+ULONG notification_count;
/** Test the class in shutdown mode. **/
diff --git a/test/regression/usbx_ux_host_class_hid_entry_test.c b/test/regression/usbx_ux_host_class_hid_entry_test.c
index 087eaeb7..2aa2b56c 100644
--- a/test/regression/usbx_ux_host_class_hid_entry_test.c
+++ b/test/regression/usbx_ux_host_class_hid_entry_test.c
@@ -325,7 +325,7 @@ UX_HOST_CLASS_COMMAND command;
host_class.ux_host_class_client = UX_NULL;
_ux_host_class_hid_entry(&command);
-
+
test_control_return(0);
}
diff --git a/test/regression/usbx_ux_host_class_hid_local_item_parse_test.c b/test/regression/usbx_ux_host_class_hid_local_item_parse_test.c
index f76bfaf9..de52b3ca 100644
--- a/test/regression/usbx_ux_host_class_hid_local_item_parse_test.c
+++ b/test/regression/usbx_ux_host_class_hid_local_item_parse_test.c
@@ -172,7 +172,7 @@ UINT nb_min_max0, nb_min_max1, nb_usage;
nb_min_max1 = 2;
nb_usage = 0;
break;
-
+
default:
nb_min_max0 = 0;
nb_min_max1 = 0;
@@ -222,11 +222,11 @@ static UCHAR device_framework_full_speed[DEVICE_FRAMEWORK_LENGTH_FULL_SPEED] = {
/* Device descriptor */
0x12, 0x01, 0x10, 0x01, 0x00, 0x00, 0x00, 0x08,
0x81, 0x0A, 0x01, 0x01, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x01,
+ 0x00, 0x01,
/* Configuration descriptor */
0x09, 0x02, 0x22, 0x00, 0x01, 0x01, 0x00, 0xc0,
- 0x32,
+ 0x32,
/* Interface descriptor */
0x09, 0x04, 0x02, 0x00, 0x01, 0x03, 0x00, 0x00,
@@ -240,15 +240,15 @@ static UCHAR device_framework_full_speed[DEVICE_FRAMEWORK_LENGTH_FULL_SPEED] = {
0x07, 0x05, 0x82, 0x03, 0x08, 0x00, 0x08
};
-
-
+
+
#define DEVICE_FRAMEWORK_LENGTH_HIGH_SPEED 62
static UCHAR device_framework_high_speed[DEVICE_FRAMEWORK_LENGTH_HIGH_SPEED] = {
/* Device descriptor */
0x12, 0x01, 0x00, 0x02, 0x00, 0x00, 0x00, 0x40,
0x0a, 0x07, 0x25, 0x40, 0x01, 0x00, 0x01, 0x02,
- 0x03, 0x01,
+ 0x03, 0x01,
/* Device qualifier descriptor */
0x0a, 0x06, 0x00, 0x02, 0x00, 0x00, 0x00, 0x40,
@@ -256,7 +256,7 @@ static UCHAR device_framework_high_speed[DEVICE_FRAMEWORK_LENGTH_HIGH_SPEED] = {
/* Configuration descriptor */
0x09, 0x02, 0x22, 0x00, 0x01, 0x01, 0x00, 0xc0,
- 0x32,
+ 0x32,
/* Interface descriptor */
0x09, 0x04, 0x02, 0x00, 0x01, 0x03, 0x00, 0x00,
@@ -267,32 +267,32 @@ static UCHAR device_framework_high_speed[DEVICE_FRAMEWORK_LENGTH_HIGH_SPEED] = {
MSB(HID_REPORT_LENGTH),
/* Endpoint descriptor (Interrupt) */
- 0x07, 0x05, 0x82, 0x03, 0x08, 0x00, 0x08
+ 0x07, 0x05, 0x82, 0x03, 0x08, 0x00, 0x08
};
-
+
/* String Device Framework :
Byte 0 and 1 : Word containing the language ID : 0x0904 for US
Byte 2 : Byte containing the index of the descriptor
Byte 3 : Byte containing the length of the descriptor string
*/
-
+
#define STRING_FRAMEWORK_LENGTH 40
-static UCHAR string_framework[] = {
+static UCHAR string_framework[] = {
/* Manufacturer string descriptor : Index 1 */
- 0x09, 0x04, 0x01, 0x0c,
- 0x45, 0x78, 0x70, 0x72,0x65, 0x73, 0x20, 0x4c,
+ 0x09, 0x04, 0x01, 0x0c,
+ 0x45, 0x78, 0x70, 0x72,0x65, 0x73, 0x20, 0x4c,
0x6f, 0x67, 0x69, 0x63,
/* Product string descriptor : Index 2 */
- 0x09, 0x04, 0x02, 0x0c,
- 0x55, 0x53, 0x42, 0x20, 0x4b, 0x65, 0x79, 0x62,
- 0x6f, 0x61, 0x72, 0x64,
+ 0x09, 0x04, 0x02, 0x0c,
+ 0x55, 0x53, 0x42, 0x20, 0x4b, 0x65, 0x79, 0x62,
+ 0x6f, 0x61, 0x72, 0x64,
/* Serial Number string descriptor : Index 3 */
- 0x09, 0x04, 0x03, 0x04,
+ 0x09, 0x04, 0x03, 0x04,
0x30, 0x30, 0x30, 0x31
};
@@ -302,7 +302,7 @@ static UCHAR string_framework[] = {
be appended to the language_id_framework array and the length
adjusted accordingly. */
#define LANGUAGE_ID_FRAMEWORK_LENGTH 2
-static UCHAR language_id_framework[] = {
+static UCHAR language_id_framework[] = {
/* English. */
0x09, 0x04
@@ -341,7 +341,7 @@ UX_SLAVE_CLASS_HID *hid_class;
hid_class = (UX_SLAVE_CLASS_HID*)class->ux_slave_class_instance;
hid_class->ux_device_class_hid_report_address = descriptor;
- hid_class->ux_device_class_hid_report_length = length;
+ hid_class->ux_device_class_hid_report_length = length;
#if UX_HOST_CLASS_HID_USAGES != 1024
hid_report_descriptor_generate(length);
@@ -356,7 +356,7 @@ void test_application_define(void *first_unused_memory)
void usbx_ux_host_class_hid_local_item_parse_test_application_define(void *first_unused_memory)
#endif
{
-
+
UINT status;
CHAR * stack_pointer;
CHAR * memory_pointer;
@@ -392,7 +392,7 @@ UINT descriptor_size = HID_REPORT_LENGTH;
printf("Error on line %d\n", __LINE__);
test_control_return(1);
}
-
+
status = ux_host_stack_class_register(_ux_system_host_class_hid_name, ux_host_class_hid_entry);
if (status != UX_SUCCESS)
{
@@ -429,7 +429,7 @@ UINT descriptor_size = HID_REPORT_LENGTH;
hid_parameter.ux_device_class_hid_parameter_callback = demo_thread_hid_callback;
/* Initilize the device hid class. The class is connected with interface 2 */
- status = ux_device_stack_class_register(_ux_system_slave_class_hid_name, ux_device_class_hid_entry,
+ status = ux_device_stack_class_register(_ux_system_slave_class_hid_name, ux_device_class_hid_entry,
1,2, (VOID *)&hid_parameter);
if(status!=UX_SUCCESS)
{
@@ -448,7 +448,7 @@ UINT descriptor_size = HID_REPORT_LENGTH;
printf("Error on line %d\n", __LINE__);
test_control_return(1);
}
-
+
/* Register all the USB host controllers available in this system */
status = ux_host_stack_hcd_register(_ux_system_host_hcd_simulator_name, ux_hcd_sim_host_initialize,0,0);
@@ -461,8 +461,8 @@ UINT descriptor_size = HID_REPORT_LENGTH;
}
/* Create the main host simulation thread. */
- status = tx_thread_create(&tx_demo_thread_host_simulation, "tx demo host simulation", tx_demo_thread_host_simulation_entry, 0,
- stack_pointer, UX_DEMO_STACK_SIZE,
+ status = tx_thread_create(&tx_demo_thread_host_simulation, "tx demo host simulation", tx_demo_thread_host_simulation_entry, 0,
+ stack_pointer, UX_DEMO_STACK_SIZE,
20, 20, 1, TX_AUTO_START);
/* Check for error. */
@@ -518,7 +518,7 @@ UINT status;
_ux_device_stack_disconnect();
/* And deinitialize the class. */
- status = ux_device_stack_class_unregister(_ux_system_slave_class_hid_name, ux_device_class_hid_entry);
+ status = ux_device_stack_class_unregister(_ux_system_slave_class_hid_name, ux_device_class_hid_entry);
/* Deinitialize the device side of usbx. */
_ux_device_stack_uninitialize();
diff --git a/test/regression/usbx_ux_host_class_hid_logitech_pro_x_superlight_test.c b/test/regression/usbx_ux_host_class_hid_logitech_pro_x_superlight_test.c
index b7b6dc6c..b83af564 100644
--- a/test/regression/usbx_ux_host_class_hid_logitech_pro_x_superlight_test.c
+++ b/test/regression/usbx_ux_host_class_hid_logitech_pro_x_superlight_test.c
@@ -435,13 +435,13 @@ DEMO_HID_REPORT *device_report = (DEMO_HID_REPORT*)hid_event.ux_
{
/* Wait for 2s. */
tx_thread_sleep(2 * TX_TIMER_TICKS_PER_SECOND);
-
+
/* Report ID set to 0. */
hid_event.ux_device_class_hid_event_report_id = 0;
-
+
/* Report type set to OUTPUT. */
hid_event.ux_device_class_hid_event_report_type = UX_DEVICE_CLASS_HID_REPORT_TYPE_INPUT;
-
+
/* Length is fixed to 1. */
hid_event.ux_device_class_hid_event_length = sizeof(DEMO_HID_REPORT);
diff --git a/test/regression/usbx_ux_host_class_hid_mouse_wheel_get_test.c b/test/regression/usbx_ux_host_class_hid_mouse_wheel_get_test.c
index c931a3da..ac452fc1 100644
--- a/test/regression/usbx_ux_host_class_hid_mouse_wheel_get_test.c
+++ b/test/regression/usbx_ux_host_class_hid_mouse_wheel_get_test.c
@@ -53,11 +53,11 @@ static UCHAR device_framework_full_speed[DEVICE_FRAMEWORK_LENGTH_FULL_SPEED] = {
/* Device descriptor */
0x12, 0x01, 0x10, 0x01, 0x00, 0x00, 0x00, 0x08,
0x81, 0x0A, 0x01, 0x01, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x01,
+ 0x00, 0x01,
/* Configuration descriptor */
0x09, 0x02, 0x22, 0x00, 0x01, 0x01, 0x00, 0xc0,
- 0x32,
+ 0x32,
/* Interface descriptor */
0x09, 0x04, 0x02, 0x00, 0x01, 0x03, 0x00, 0x00,
@@ -71,15 +71,15 @@ static UCHAR device_framework_full_speed[DEVICE_FRAMEWORK_LENGTH_FULL_SPEED] = {
0x07, 0x05, 0x82, 0x03, 0x08, 0x00, 0x08
};
-
-
+
+
#define DEVICE_FRAMEWORK_LENGTH_HIGH_SPEED 62
static UCHAR device_framework_high_speed[DEVICE_FRAMEWORK_LENGTH_HIGH_SPEED] = {
/* Device descriptor */
0x12, 0x01, 0x00, 0x02, 0x00, 0x00, 0x00, 0x40,
0x0a, 0x07, 0x25, 0x40, 0x01, 0x00, 0x01, 0x02,
- 0x03, 0x01,
+ 0x03, 0x01,
/* Device qualifier descriptor */
0x0a, 0x06, 0x00, 0x02, 0x00, 0x00, 0x00, 0x40,
@@ -87,7 +87,7 @@ static UCHAR device_framework_high_speed[DEVICE_FRAMEWORK_LENGTH_HIGH_SPEED] = {
/* Configuration descriptor */
0x09, 0x02, 0x22, 0x00, 0x01, 0x01, 0x00, 0xc0,
- 0x32,
+ 0x32,
/* Interface descriptor */
0x09, 0x04, 0x02, 0x00, 0x01, 0x03, 0x00, 0x00,
@@ -98,32 +98,32 @@ static UCHAR device_framework_high_speed[DEVICE_FRAMEWORK_LENGTH_HIGH_SPEED] = {
MSB(HID_REPORT_LENGTH),
/* Endpoint descriptor (Interrupt) */
- 0x07, 0x05, 0x82, 0x03, 0x08, 0x00, 0x08
+ 0x07, 0x05, 0x82, 0x03, 0x08, 0x00, 0x08
};
-
+
/* String Device Framework :
Byte 0 and 1 : Word containing the language ID : 0x0904 for US
Byte 2 : Byte containing the index of the descriptor
Byte 3 : Byte containing the length of the descriptor string
*/
-
+
#define STRING_FRAMEWORK_LENGTH 40
-static UCHAR string_framework[] = {
+static UCHAR string_framework[] = {
/* Manufacturer string descriptor : Index 1 */
- 0x09, 0x04, 0x01, 0x0c,
- 0x45, 0x78, 0x70, 0x72,0x65, 0x73, 0x20, 0x4c,
+ 0x09, 0x04, 0x01, 0x0c,
+ 0x45, 0x78, 0x70, 0x72,0x65, 0x73, 0x20, 0x4c,
0x6f, 0x67, 0x69, 0x63,
/* Product string descriptor : Index 2 */
- 0x09, 0x04, 0x02, 0x0c,
- 0x55, 0x53, 0x42, 0x20, 0x4b, 0x65, 0x79, 0x62,
- 0x6f, 0x61, 0x72, 0x64,
+ 0x09, 0x04, 0x02, 0x0c,
+ 0x55, 0x53, 0x42, 0x20, 0x4b, 0x65, 0x79, 0x62,
+ 0x6f, 0x61, 0x72, 0x64,
/* Serial Number string descriptor : Index 3 */
- 0x09, 0x04, 0x03, 0x04,
+ 0x09, 0x04, 0x03, 0x04,
0x30, 0x30, 0x30, 0x31
};
@@ -133,7 +133,7 @@ static UCHAR string_framework[] = {
be appended to the language_id_framework array and the length
adjusted accordingly. */
#define LANGUAGE_ID_FRAMEWORK_LENGTH 2
-static UCHAR language_id_framework[] = {
+static UCHAR language_id_framework[] = {
/* English. */
0x09, 0x04
@@ -160,7 +160,7 @@ void test_application_define(void *first_unused_memory)
void usbx_ux_host_class_hid_mouse_wheel_get_test_application_define(void *first_unused_memory)
#endif
{
-
+
UINT status;
CHAR * stack_pointer;
CHAR * memory_pointer;
@@ -195,7 +195,7 @@ CHAR * memory_pointer;
printf("Error on line %d, error code: %d\n", __LINE__, status);
test_control_return(1);
}
-
+
status = ux_host_stack_class_register(_ux_system_host_class_hid_name, ux_host_class_hid_entry);
if (status != UX_SUCCESS)
{
@@ -232,7 +232,7 @@ CHAR * memory_pointer;
hid_parameter.ux_device_class_hid_parameter_callback = demo_thread_hid_callback;
/* Initilize the device hid class. The class is connected with interface 2 */
- status = ux_device_stack_class_register(_ux_system_slave_class_hid_name, ux_device_class_hid_entry,
+ status = ux_device_stack_class_register(_ux_system_slave_class_hid_name, ux_device_class_hid_entry,
1,2, (VOID *)&hid_parameter);
if(status!=UX_SUCCESS)
{
@@ -251,7 +251,7 @@ CHAR * memory_pointer;
printf("Error on line %d, error code: %d\n", __LINE__, status);
test_control_return(1);
}
-
+
/* Register all the USB host controllers available in this system */
status = ux_host_stack_hcd_register(_ux_system_host_hcd_simulator_name, ux_hcd_sim_host_initialize,0,0);
@@ -264,8 +264,8 @@ CHAR * memory_pointer;
}
/* Create the main host simulation thread. */
- status = tx_thread_create(&tx_demo_thread_host_simulation, "tx demo host simulation", tx_demo_thread_host_simulation_entry, 0,
- stack_pointer, UX_DEMO_STACK_SIZE,
+ status = tx_thread_create(&tx_demo_thread_host_simulation, "tx demo host simulation", tx_demo_thread_host_simulation_entry, 0,
+ stack_pointer, UX_DEMO_STACK_SIZE,
20, 20, 1, TX_AUTO_START);
/* Check for error. */
@@ -311,13 +311,13 @@ SLONG mouse_wheel_movement;
/* Now disconnect the device. */
_ux_device_stack_disconnect();
-
+
/* And deinitialize the class. */
- status = ux_device_stack_class_unregister(_ux_system_slave_class_hid_name, ux_device_class_hid_entry);
-
+ status = ux_device_stack_class_unregister(_ux_system_slave_class_hid_name, ux_device_class_hid_entry);
+
/* Deinitialize the device side of usbx. */
_ux_device_stack_uninitialize();
-
+
/* And finally the usbx system resources. */
_ux_system_uninitialize();
diff --git a/test/regression/usbx_ux_host_class_hid_report_get_test.c b/test/regression/usbx_ux_host_class_hid_report_get_test.c
index 7c7f8c84..e711e857 100644
--- a/test/regression/usbx_ux_host_class_hid_report_get_test.c
+++ b/test/regression/usbx_ux_host_class_hid_report_get_test.c
@@ -4,7 +4,7 @@
#include "ux_host_class_hid_keyboard.h"
-static UCHAR hid_report_descriptor[] = {
+static UCHAR hid_report_descriptor[] = {
0x05, 0x01, // USAGE_PAGE (Generic Desktop)
0x09, 0x06, // USAGE (Keyboard)
@@ -48,11 +48,11 @@ static UCHAR device_framework_full_speed[DEVICE_FRAMEWORK_LENGTH_FULL_SPEED] = {
/* Device descriptor */
0x12, 0x01, 0x10, 0x01, 0x00, 0x00, 0x00, 0x08,
0x81, 0x0A, 0x01, 0x01, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x01,
+ 0x00, 0x01,
/* Configuration descriptor */
0x09, 0x02, 0x22, 0x00, 0x01, 0x01, 0x00, 0xc0,
- 0x32,
+ 0x32,
/* Interface descriptor */
0x09, 0x04, 0x02, 0x00, 0x01, 0x03, 0x00, 0x00,
@@ -66,15 +66,15 @@ static UCHAR device_framework_full_speed[DEVICE_FRAMEWORK_LENGTH_FULL_SPEED] = {
0x07, 0x05, 0x82, 0x03, 0x08, 0x00, 0x08
};
-
-
+
+
#define DEVICE_FRAMEWORK_LENGTH_HIGH_SPEED 62
static UCHAR device_framework_high_speed[DEVICE_FRAMEWORK_LENGTH_HIGH_SPEED] = {
/* Device descriptor */
0x12, 0x01, 0x00, 0x02, 0x00, 0x00, 0x00, 0x40,
0x0a, 0x07, 0x25, 0x40, 0x01, 0x00, 0x01, 0x02,
- 0x03, 0x01,
+ 0x03, 0x01,
/* Device qualifier descriptor */
0x0a, 0x06, 0x00, 0x02, 0x00, 0x00, 0x00, 0x40,
@@ -82,7 +82,7 @@ static UCHAR device_framework_high_speed[DEVICE_FRAMEWORK_LENGTH_HIGH_SPEED] = {
/* Configuration descriptor */
0x09, 0x02, 0x22, 0x00, 0x01, 0x01, 0x00, 0xc0,
- 0x32,
+ 0x32,
/* Interface descriptor */
0x09, 0x04, 0x02, 0x00, 0x01, 0x03, 0x00, 0x00,
@@ -93,32 +93,32 @@ static UCHAR device_framework_high_speed[DEVICE_FRAMEWORK_LENGTH_HIGH_SPEED] = {
MSB(HID_REPORT_LENGTH),
/* Endpoint descriptor (Interrupt) */
- 0x07, 0x05, 0x82, 0x03, 0x08, 0x00, 0x08
+ 0x07, 0x05, 0x82, 0x03, 0x08, 0x00, 0x08
};
-
+
/* String Device Framework :
Byte 0 and 1 : Word containing the language ID : 0x0904 for US
Byte 2 : Byte containing the index of the descriptor
Byte 3 : Byte containing the length of the descriptor string
*/
-
+
#define STRING_FRAMEWORK_LENGTH 40
-static UCHAR string_framework[] = {
+static UCHAR string_framework[] = {
/* Manufacturer string descriptor : Index 1 */
- 0x09, 0x04, 0x01, 0x0c,
- 0x45, 0x78, 0x70, 0x72,0x65, 0x73, 0x20, 0x4c,
+ 0x09, 0x04, 0x01, 0x0c,
+ 0x45, 0x78, 0x70, 0x72,0x65, 0x73, 0x20, 0x4c,
0x6f, 0x67, 0x69, 0x63,
/* Product string descriptor : Index 2 */
- 0x09, 0x04, 0x02, 0x0c,
- 0x55, 0x53, 0x42, 0x20, 0x4b, 0x65, 0x79, 0x62,
- 0x6f, 0x61, 0x72, 0x64,
+ 0x09, 0x04, 0x02, 0x0c,
+ 0x55, 0x53, 0x42, 0x20, 0x4b, 0x65, 0x79, 0x62,
+ 0x6f, 0x61, 0x72, 0x64,
/* Serial Number string descriptor : Index 3 */
- 0x09, 0x04, 0x03, 0x04,
+ 0x09, 0x04, 0x03, 0x04,
0x30, 0x30, 0x30, 0x31
};
@@ -128,7 +128,7 @@ static UCHAR string_framework[] = {
be appended to the language_id_framework array and the length
adjusted accordingly. */
#define LANGUAGE_ID_FRAMEWORK_LENGTH 2
-static UCHAR language_id_framework[] = {
+static UCHAR language_id_framework[] = {
/* English. */
0x09, 0x04
@@ -167,7 +167,7 @@ void test_application_define(void *first_unused_memory)
void usbx_ux_host_class_hid_report_get_test_application_define(void *first_unused_memory)
#endif
{
-
+
UINT status;
CHAR * stack_pointer;
CHAR * memory_pointer;
@@ -175,7 +175,7 @@ CHAR * memory_pointer;
/* Inform user. */
printf("Running ux_host_class_hid_report_get Test........................... ");
-
+
/* Initialize the free memory pointer */
stack_pointer = (CHAR *) usbx_memory;
memory_pointer = stack_pointer + (UX_DEMO_STACK_SIZE * 2);
@@ -202,7 +202,7 @@ CHAR * memory_pointer;
printf("Error on line %d\n", __LINE__);
test_control_return(1);
}
-
+
status = ux_host_stack_class_register(_ux_system_host_class_hid_name, ux_host_class_hid_entry);
if (status != UX_SUCCESS)
{
@@ -239,7 +239,7 @@ CHAR * memory_pointer;
hid_parameter.ux_device_class_hid_parameter_callback = demo_thread_hid_callback;
/* Initilize the device hid class. The class is connected with interface 2 */
- status = ux_device_stack_class_register(_ux_system_slave_class_hid_name, ux_device_class_hid_entry,
+ status = ux_device_stack_class_register(_ux_system_slave_class_hid_name, ux_device_class_hid_entry,
1,2, (VOID *)&hid_parameter);
if(status!=UX_SUCCESS)
{
@@ -259,7 +259,7 @@ CHAR * memory_pointer;
printf("Error on line %d\n", __LINE__);
test_control_return(1);
}
-
+
/* Register all the USB host controllers available in this system */
status = ux_host_stack_hcd_register(_ux_system_host_hcd_simulator_name, ux_hcd_sim_host_initialize,0,0);
@@ -272,8 +272,8 @@ CHAR * memory_pointer;
}
/* Create the main host simulation thread. */
- status = tx_thread_create(&tx_demo_thread_host_simulation, "tx demo host simulation", tx_demo_thread_host_simulation_entry, 0,
- stack_pointer, UX_DEMO_STACK_SIZE,
+ status = tx_thread_create(&tx_demo_thread_host_simulation, "tx demo host simulation", tx_demo_thread_host_simulation_entry, 0,
+ stack_pointer, UX_DEMO_STACK_SIZE,
20, 20, 1, TX_AUTO_START);
/* Check for error. */
@@ -283,12 +283,12 @@ CHAR * memory_pointer;
printf("Error on line %d\n", __LINE__);
test_control_return(1);
}
-
+
/* Create the main demo thread. */
- status = tx_thread_create(&tx_demo_thread_slave_simulation, "tx demo slave simulation", tx_demo_thread_slave_simulation_entry, 0,
- stack_pointer + UX_DEMO_STACK_SIZE, UX_DEMO_STACK_SIZE,
+ status = tx_thread_create(&tx_demo_thread_slave_simulation, "tx demo slave simulation", tx_demo_thread_slave_simulation_entry, 0,
+ stack_pointer + UX_DEMO_STACK_SIZE, UX_DEMO_STACK_SIZE,
20, 20, 1, TX_AUTO_START);
-
+
/* Check for error. */
if (status != TX_SUCCESS)
{
@@ -385,7 +385,7 @@ ULONG *input_report_buffer_long = (ULONG *)input_r
input_report_request.ux_host_class_hid_client_report_length = input_report_descriptor -> ux_host_class_hid_report_byte_length;
/* For the first part of this test, we request the raw report. */
-
+
input_report_request.ux_host_class_hid_client_report_flags = UX_HOST_CLASS_HID_REPORT_RAW;
/* Poll until we've received an input report with actual data. */
@@ -436,7 +436,7 @@ ULONG *input_report_buffer_long = (ULONG *)input_r
/* We just tested getting the report raw; this second part is getting it decompressed.
Note that the decompressed version is interleaved as 'Usage Value Usage Value...' */
-
+
input_report_request.ux_host_class_hid_client_report_flags = UX_HOST_CLASS_HID_REPORT_DECOMPRESSED;
/* Poll until we've received an input report with actual data. */
@@ -508,13 +508,13 @@ ULONG *input_report_buffer_long = (ULONG *)input_r
/* Now disconnect the device. */
_ux_device_stack_disconnect();
-
+
/* And deinitialize the class. */
- status = ux_device_stack_class_unregister(_ux_system_slave_class_hid_name, ux_device_class_hid_entry);
-
+ status = ux_device_stack_class_unregister(_ux_system_slave_class_hid_name, ux_device_class_hid_entry);
+
/* Deinitialize the device side of usbx. */
_ux_device_stack_uninitialize();
-
+
/* And finally the usbx system resources. */
_ux_system_uninitialize();
@@ -535,13 +535,13 @@ UX_SLAVE_DEVICE *device;
UX_SLAVE_INTERFACE *interface;
UX_SLAVE_CLASS_HID *hid;
UX_SLAVE_CLASS_HID_EVENT hid_event;
-
+
/* Get the pointer to the device. */
device = &_ux_system_slave -> ux_system_slave_device;
-
+
/* reset the HID event structure. */
ux_utility_memory_set(&hid_event, 0, sizeof(UX_SLAVE_CLASS_HID_EVENT));
-
+
while(1)
{
@@ -557,13 +557,13 @@ UX_SLAVE_CLASS_HID_EVENT hid_event;
/* Get the interface. We use the first interface, this is a simple device. */
interface = device -> ux_slave_device_first_interface;
-
+
/* Form that interface, derive the HID owner. */
hid = interface -> ux_slave_interface_class_instance;
-
+
/* Wait for 2 seconds. */
ux_utility_thread_sleep(20);
-
+
/* Then insert a key into the keyboard event. Length is fixed to 8. */
hid_event.ux_device_class_hid_event_length = 8;
@@ -572,7 +572,7 @@ UX_SLAVE_CLASS_HID_EVENT hid_event;
/* Second byte is reserved. */
hid_event.ux_device_class_hid_event_buffer[1] = 0;
-
+
/* The 6 next bytes are keys. */
hid_event.ux_device_class_hid_event_buffer[2] = 0x04;
hid_event.ux_device_class_hid_event_buffer[3] = 0x05;
diff --git a/test/regression/usbx_ux_host_class_hub_descriptor_get_coverage_test.c b/test/regression/usbx_ux_host_class_hub_descriptor_get_coverage_test.c
index 6cfc93b4..91171082 100644
--- a/test/regression/usbx_ux_host_class_hub_descriptor_get_coverage_test.c
+++ b/test/regression/usbx_ux_host_class_hub_descriptor_get_coverage_test.c
@@ -23,7 +23,7 @@ static UINT entry_function(struct UX_HCD_STRUCT *parm1, UINT parm2, VOID *parm3)
UX_TRANSFER *t_request;
UCHAR *data;
-
+
t_request = (UX_TRANSFER*)parm3;
data = t_request -> ux_transfer_request_data_pointer;
if(count == 0)
@@ -82,7 +82,7 @@ UX_ENDPOINT *control_endpoint;
/* Test again to cover line 181 */
_ux_host_class_hub_descriptor_get(&hub);
-
+
printf(" Passed\n");
test_control_return(0);
diff --git a/test/regression/usbx_ux_host_class_storage_configure_coverage_test.c b/test/regression/usbx_ux_host_class_storage_configure_coverage_test.c
index 7c57b30f..9707b3ce 100644
--- a/test/regression/usbx_ux_host_class_storage_configure_coverage_test.c
+++ b/test/regression/usbx_ux_host_class_storage_configure_coverage_test.c
@@ -30,7 +30,7 @@ void usbx_ux_host_class_storage_configure_overage_test_application_define(voi
device.ux_device_first_configuration = &storage_configuration;
device.ux_device_power_source = UX_DEVICE_SELF_POWERED;
storage_configuration.ux_configuration_handle = 0;
-
+
_ux_host_class_storage_configure(&storage);
printf(" Passed\n");
diff --git a/test/regression/usbx_ux_host_class_storage_driver_entry_test.c b/test/regression/usbx_ux_host_class_storage_driver_entry_test.c
index 3d681129..bd454d3b 100644
--- a/test/regression/usbx_ux_host_class_storage_driver_entry_test.c
+++ b/test/regression/usbx_ux_host_class_storage_driver_entry_test.c
@@ -738,7 +738,7 @@ static UINT demo_thread_media_read(VOID *storage, ULONG lun, UCHAR * data_poi
if (lun > 1)
return UX_ERROR;
-
+
ram_disk_read_sent = UX_TRUE;
if (ram_disk_read_status != UX_SUCCESS)
{
diff --git a/test/regression/usbx_ux_host_class_storage_fats_exfat_test.c b/test/regression/usbx_ux_host_class_storage_fats_exfat_test.c
index 86034e83..7ea56730 100644
--- a/test/regression/usbx_ux_host_class_storage_fats_exfat_test.c
+++ b/test/regression/usbx_ux_host_class_storage_fats_exfat_test.c
@@ -409,32 +409,32 @@ static UINT _test_format_exFAT(void)
UINT status;
/* Format the media. This needs to be done before opening it! */
- status = fx_media_exFAT_format(&ram_disk1,
+ status = fx_media_exFAT_format(&ram_disk1,
_fx_ram_driver, // Driver entry
ram_disk_memory1, // RAM disk memory pointer
buffer1, // Media buffer pointer
- 512, // Media buffer size
+ 512, // Media buffer size
"RAM_DISK1", // Volume Name
1, // Number of FATs
0, // Hidden sectors
- UX_RAM_DISK_SIZE/512, // Total sectors
- 512, // Sector size
+ UX_RAM_DISK_SIZE/512, // Total sectors
+ 512, // Sector size
1, // exFAT Sectors per cluster
11111, // Volume ID
0); // Boundary unit
if (status != FX_SUCCESS)
return(status);
- status = fx_media_exFAT_format(&ram_disk2,
+ status = fx_media_exFAT_format(&ram_disk2,
_fx_ram_driver, // Driver entry
ram_disk_memory2, // RAM disk memory pointer
buffer1, // Media buffer pointer
- 512, // Media buffer size
+ 512, // Media buffer size
"RAM_DISK1", // Volume Name
1, // Number of FATs
0, // Hidden sectors
- UX_RAM_DISK_SIZE/512, // Total sectors
- 512, // Sector size
+ UX_RAM_DISK_SIZE/512, // Total sectors
+ 512, // Sector size
1, // exFAT Sectors per cluster
22222, // Volume ID
0); // Boundary unit
@@ -472,7 +472,7 @@ UCHAR local_buffer[32];
if (status != FX_SUCCESS)
{
- /* Check for an already created status. This is not fatal, just
+ /* Check for an already created status. This is not fatal, just
let the user know. */
if (status != FX_ALREADY_CREATED)
{
@@ -705,16 +705,16 @@ UINT status = 0;
ram_disks[lun]->fx_media_driver_buffer = data_pointer;
_fx_ram_driver(ram_disks[lun]);
status = ram_disks[lun]->fx_media_driver_status;
- }
+ }
else
- {
+ {
while(number_blocks--)
{
status = fx_media_read(ram_disks[lun],lba,data_pointer);
data_pointer+=512;
lba++;
}
- }
+ }
return(status);
}
@@ -733,7 +733,7 @@ UINT status = 0;
status = ram_disks[lun]->fx_media_driver_status;
- }
+ }
else
{
@@ -742,7 +742,7 @@ UINT status = 0;
status = fx_media_write(ram_disks[lun],lba,data_pointer);
data_pointer+=512;
lba++;
- }
+ }
return(status);
}
return(1);
diff --git a/test/regression/usbx_ux_host_class_storage_fx_driver.c b/test/regression/usbx_ux_host_class_storage_fx_driver.c
index 9940ad0e..2dfea3b3 100644
--- a/test/regression/usbx_ux_host_class_storage_fx_driver.c
+++ b/test/regression/usbx_ux_host_class_storage_fx_driver.c
@@ -183,7 +183,7 @@ VOID _ux_host_class_storage_driver_entry(FX_MEDIA *media)
UINT status;
UX_HOST_CLASS_STORAGE *storage;
UX_HOST_CLASS_STORAGE_MEDIA *storage_media;
-
+
/* Get the pointer to the storage media instance. */
storage_media = (UX_HOST_CLASS_STORAGE_MEDIA *) media -> fx_media_driver_info;
@@ -268,10 +268,10 @@ UX_HOST_CLASS_STORAGE_MEDIA *storage_media;
case FX_DRIVER_INIT:
- /* Check for media protection. We must do this operation here because FileX clears all the
+ /* Check for media protection. We must do this operation here because FileX clears all the
media fields before init. */
if (storage -> ux_host_class_storage_write_protected_media == UX_TRUE)
-
+
/* The media is Write Protected. We tell FileX. */
media -> fx_media_driver_write_protect = UX_TRUE;
diff --git a/test/regression/usbx_ux_host_class_storage_media_get_test.c b/test/regression/usbx_ux_host_class_storage_media_get_test.c
index 3f844ade..13de5c8f 100644
--- a/test/regression/usbx_ux_host_class_storage_media_get_test.c
+++ b/test/regression/usbx_ux_host_class_storage_media_get_test.c
@@ -646,7 +646,7 @@ static UINT demo_thread_media_read(VOID *storage, ULONG lun, UCHAR * data_poi
if (lun > 1)
return UX_ERROR;
-
+
ram_disk_read_sent = UX_TRUE;
if (ram_disk_read_status != UX_SUCCESS)
diff --git a/test/regression/usbx_ux_host_class_storage_media_read_test.c b/test/regression/usbx_ux_host_class_storage_media_read_test.c
index 22f51a98..f32c04b4 100644
--- a/test/regression/usbx_ux_host_class_storage_media_read_test.c
+++ b/test/regression/usbx_ux_host_class_storage_media_read_test.c
@@ -694,7 +694,7 @@ static UINT demo_thread_media_read(VOID *storage, ULONG lun, UCHAR * data_poi
if (lun > 1)
return UX_ERROR;
-
+
ram_disk_read_sent = UX_TRUE;
if (ram_disk_read_status != UX_SUCCESS)
diff --git a/test/regression/usbx_ux_host_class_storage_media_write_test.c b/test/regression/usbx_ux_host_class_storage_media_write_test.c
index 0e1bd62b..eff5b2e3 100644
--- a/test/regression/usbx_ux_host_class_storage_media_write_test.c
+++ b/test/regression/usbx_ux_host_class_storage_media_write_test.c
@@ -699,7 +699,7 @@ static UINT demo_thread_media_read(VOID *storage, ULONG lun, UCHAR * data_poi
if (lun > 1)
return UX_ERROR;
-
+
ram_disk_read_sent = UX_TRUE;
if (ram_disk_read_status != UX_SUCCESS)
{
diff --git a/test/regression/usbx_ux_host_class_storage_start_stop_test.c b/test/regression/usbx_ux_host_class_storage_start_stop_test.c
index b216e638..89a2ff9a 100644
--- a/test/regression/usbx_ux_host_class_storage_start_stop_test.c
+++ b/test/regression/usbx_ux_host_class_storage_start_stop_test.c
@@ -818,7 +818,7 @@ static UINT demo_thread_media_read(VOID *storage, ULONG lun, UCHAR * data_poi
if (lun > 1)
return UX_ERROR;
-
+
ram_disk_read_sent = UX_TRUE;
if (ram_disk_read_status != UX_SUCCESS)
{
diff --git a/test/regression/usbx_ux_host_class_storage_transport_bo_test.c b/test/regression/usbx_ux_host_class_storage_transport_bo_test.c
index 2b3b0863..4c564b4b 100644
--- a/test/regression/usbx_ux_host_class_storage_transport_bo_test.c
+++ b/test/regression/usbx_ux_host_class_storage_transport_bo_test.c
@@ -968,7 +968,7 @@ static UINT demo_thread_media_read(VOID *storage, ULONG lun, UCHAR * data_poi
if (lun > 1)
return UX_ERROR;
-
+
ram_disk_read_sent = UX_TRUE;
if (ram_disk_read_status != UX_SUCCESS)
{
diff --git a/test/regression/usbx_ux_host_stack_device_configuration_reset_coverage_test.c b/test/regression/usbx_ux_host_stack_device_configuration_reset_coverage_test.c
index bf9fcf8b..4724ddd0 100644
--- a/test/regression/usbx_ux_host_stack_device_configuration_reset_coverage_test.c
+++ b/test/regression/usbx_ux_host_stack_device_configuration_reset_coverage_test.c
@@ -29,15 +29,15 @@ void usbx_ux_host_class_stack_device_configuration_reset_coverage_test_applic
{
UINT status = 0;
-UX_TRANSFER *transfer_request;
+UX_TRANSFER *transfer_request;
/* Inform user. */
printf("Running USB host stack device configuration Reset Coverage Test .... ");
ux_system_initialize(memory_buffer, 4096, UX_NULL, 0);
-
+
device.ux_device_state = UX_DEVICE_SELF_POWERED_STATE;
-
+
device.ux_device_packed_configuration = (UCHAR*)_ux_utility_memory_allocate(UX_NO_ALIGN, UX_REGULAR_MEMORY, 16);
transfer_request = &device.ux_device_control_endpoint.ux_endpoint_transfer_request;
diff --git a/test/regression/usbx_ux_host_stack_new_device_get_test.c b/test/regression/usbx_ux_host_stack_new_device_get_test.c
index ec4a1e52..7dbe059b 100644
--- a/test/regression/usbx_ux_host_stack_new_device_get_test.c
+++ b/test/regression/usbx_ux_host_stack_new_device_get_test.c
@@ -33,7 +33,7 @@ static unsigned char slave_buffer[UX_HOST_CLASS_DPUMP_PACKET_S
/* Define prototypes for external Host Controller's (HCDs), classes and clients. */
-static VOID ux_test_instance_activate(VOID *dpump_instance);
+static VOID ux_test_instance_activate(VOID *dpump_instance);
static VOID ux_test_instance_deactivate(VOID *dpump_instance);
@@ -83,7 +83,7 @@ CHAR *memory_pointer;
/* Initialize the free memory pointer. */
stack_pointer = (CHAR *) first_unused_memory;
memory_pointer = stack_pointer + (UX_TEST_STACK_SIZE * 2);
-
+
/* Initialize USBX Memory. */
status = ux_system_initialize(memory_pointer, UX_TEST_MEMORY_SIZE, UX_NULL, 0);
@@ -107,8 +107,8 @@ CHAR *memory_pointer;
}
/* Create the main host simulation thread. */
- status = tx_thread_create(&ux_test_thread_host_simulation, "test host simulation", ux_test_thread_host_simulation_entry, 0,
- stack_pointer, UX_TEST_STACK_SIZE,
+ status = tx_thread_create(&ux_test_thread_host_simulation, "test host simulation", ux_test_thread_host_simulation_entry, 0,
+ stack_pointer, UX_TEST_STACK_SIZE,
20, 20, 1, TX_AUTO_START);
/* Check for error. */
@@ -136,7 +136,7 @@ UINT i;
new_device = _ux_host_stack_new_device_get();
if (new_device == UX_NULL)
{
-
+
printf("ERROR #4\n");
test_control_return(1);
}
diff --git a/test/regression/usbx_ux_test_cdc_ecm.h b/test/regression/usbx_ux_test_cdc_ecm.h
index 60dedc68..75297e03 100644
--- a/test/regression/usbx_ux_test_cdc_ecm.h
+++ b/test/regression/usbx_ux_test_cdc_ecm.h
@@ -271,8 +271,8 @@ static unsigned char language_id_framework[] = {
0x09, 0x04
};
-static DEVICE_INIT_DATA default_device_init_data = {
- .framework = default_device_framework,
+static DEVICE_INIT_DATA default_device_init_data = {
+ .framework = default_device_framework,
.framework_length = sizeof(default_device_framework),
.string_framework = default_string_framework,
.string_framework_length = sizeof(default_string_framework)
@@ -392,9 +392,9 @@ static void ux_test_device_class_cdc_ecm_set_link_state(UX_SLAVE_CLASS_CDC_ECM *
/* Declare the link to be down. */
cdc_ecm_device -> ux_slave_class_cdc_ecm_link_state = new_link_state;
- /* We have a thread waiting for an event, we wake it up with a NETWORK NOTIFICATION CHANGE event.
+ /* We have a thread waiting for an event, we wake it up with a NETWORK NOTIFICATION CHANGE event.
In turn they will release the NetX resources used and suspend. */
- UX_TEST_CHECK_SUCCESS(_ux_utility_event_flags_set(&cdc_ecm_device -> ux_slave_class_cdc_ecm_event_flags_group, UX_DEVICE_CLASS_CDC_ECM_NETWORK_NOTIFICATION_EVENT, TX_OR));
+ UX_TEST_CHECK_SUCCESS(_ux_utility_event_flags_set(&cdc_ecm_device -> ux_slave_class_cdc_ecm_event_flags_group, UX_DEVICE_CLASS_CDC_ECM_NETWORK_NOTIFICATION_EVENT, TX_OR));
}
static void read_packet_tcp(NX_TCP_SOCKET *tcp_socket, ULONG num_reads, CHAR *name)
@@ -692,7 +692,7 @@ DEVICE_INIT_DATA *device_init_data;
UX_TEST_CHECK_SUCCESS(nx_packet_pool_create(&packet_pool_device, "NetX Device Packet Pool", PACKET_PAYLOAD, packet_pool_memory_device, PACKET_POOL_SIZE));
UX_TEST_CHECK_SUCCESS(nx_packet_pool_create(&ip_pool_device, "NetX Device IP Pool", PACKET_PAYLOAD, packet_pool_memory_device+PACKET_POOL_SIZE, DEVICE_IP_POOL_SIZE));
- UX_TEST_CHECK_SUCCESS(nx_ip_create(&nx_ip_device, "NetX Device Thread", DEVICE_IP_ADDRESS, 0xFF000000L, &ip_pool_device,
+ UX_TEST_CHECK_SUCCESS(nx_ip_create(&nx_ip_device, "NetX Device Thread", DEVICE_IP_ADDRESS, 0xFF000000L, &ip_pool_device,
_ux_network_driver_entry, ip_thread_stack_device, DEMO_IP_THREAD_STACK_SIZE, 1));
/* Setup ARP. */
diff --git a/test/regression/usbx_ux_test_hub.h b/test/regression/usbx_ux_test_hub.h
index 2e674fcc..d9c05f0b 100644
--- a/test/regression/usbx_ux_test_hub.h
+++ b/test/regression/usbx_ux_test_hub.h
@@ -143,15 +143,15 @@ static unsigned char default_hub_descriptor[] = {
static unsigned char string_framework[] = {
/* Manufacturer string descriptor : Index 1 - "Express Logic" */
- 0x09, 0x04, 0x01, 0x0c,
- 0x45, 0x78, 0x70, 0x72,0x65, 0x73, 0x20, 0x4c,
+ 0x09, 0x04, 0x01, 0x0c,
+ 0x45, 0x78, 0x70, 0x72,0x65, 0x73, 0x20, 0x4c,
0x6f, 0x67, 0x69, 0x63,
/* Product string descriptor : Index 2 - "EL Composite device" */
0x09, 0x04, 0x02, 0x13,
0x45, 0x4c, 0x20, 0x43, 0x6f, 0x6d, 0x70, 0x6f,
- 0x73, 0x69, 0x74, 0x65, 0x20, 0x64, 0x65, 0x76,
- 0x69, 0x63, 0x65,
+ 0x73, 0x69, 0x74, 0x65, 0x20, 0x64, 0x65, 0x76,
+ 0x69, 0x63, 0x65,
/* Serial Number string descriptor : Index 3 - "0001" */
0x09, 0x04, 0x03, 0x04,
@@ -232,12 +232,12 @@ ULONG original_framework_length;
/* Filter for GET_DESCRIPTOR/SET_DESCRIPTOR commands. If the descriptor to be returned is not a standard descriptor,
treat the command as a CLASS command. */
if ((request == UX_GET_DESCRIPTOR || request == UX_SET_DESCRIPTOR) && (((request_value >> 8) & UX_REQUEST_TYPE) != UX_REQUEST_TYPE_STANDARD))
- {
+ {
/* This request is to be handled by the class layer. */
request_type &= (UINT)~UX_REQUEST_TYPE;
request_type |= UX_REQUEST_TYPE_CLASS;
- }
+ }
/* Ensure it's not vendor. */
UX_TEST_ASSERT((request_type & UX_REQUEST_TYPE) != UX_REQUEST_TYPE_VENDOR);
@@ -346,7 +346,7 @@ UX_HOST_CLASS *class;
/* In virtually all cases, we want the enumeration thread to be finished. */
ux_test_wait_for_enum_thread_completion();
-
+
/* Return success. */
return(UX_SUCCESS);
}
@@ -422,7 +422,7 @@ UX_HOST_CLASS *class;
/* We still need to wait for the dpump status to be live. */
UX_TEST_CHECK_SUCCESS(ux_test_wait_for_value_uint(&g_hub_host -> ux_host_class_hub_state, UX_HOST_CLASS_INSTANCE_LIVE));
-
+
/* Return success. */
return(UX_SUCCESS);
}
@@ -514,7 +514,7 @@ static VOID set_and_send_port_event(UINT port_status, UINT port_change)
static VOID connect_device_to_hub_speed(UINT speed)
{
- set_and_send_port_event(speed | UX_HOST_CLASS_HUB_PORT_STATUS_CONNECTION | UX_HOST_CLASS_HUB_PORT_STATUS_POWER,
+ set_and_send_port_event(speed | UX_HOST_CLASS_HUB_PORT_STATUS_CONNECTION | UX_HOST_CLASS_HUB_PORT_STATUS_POWER,
UX_HOST_CLASS_HUB_PORT_CHANGE_CONNECTION);
}
diff --git a/test/regression/usbx_uxe_device_audio_test.c b/test/regression/usbx_uxe_device_audio_test.c
index b581240e..2f14708b 100644
--- a/test/regression/usbx_uxe_device_audio_test.c
+++ b/test/regression/usbx_uxe_device_audio_test.c
@@ -497,7 +497,7 @@ UX_DEVICE_CLASS_AUDIO_STREAM dummy_stream_inst;
UX_DEVICE_CLASS_AUDIO_STREAM *dummy_stream = &dummy_stream_inst;
UCHAR *dummy_buffer;
ULONG dummy_dw;
-UX_SLAVE_TRANSFER dummy_transfer;
+UX_SLAVE_TRANSFER dummy_transfer;
UX_DEVICE_CLASS_AUDIO10_CONTROL_GROUP dummy_group10;
UX_DEVICE_CLASS_AUDIO20_CONTROL_GROUP dummy_group20;
diff --git a/test/regression/usbx_uxe_device_dfu_test.c b/test/regression/usbx_uxe_device_dfu_test.c
index 0be15ff1..f553008e 100644
--- a/test/regression/usbx_uxe_device_dfu_test.c
+++ b/test/regression/usbx_uxe_device_dfu_test.c
@@ -98,16 +98,16 @@ static TX_THREAD ux_test_thread_simulation_0;
0x00, \
#define DEVICE_FRAMEWORK_LENGTH_FULL_SPEED sizeof(device_framework_full_speed)
-static UCHAR device_framework_full_speed[] = {
+static UCHAR device_framework_full_speed[] = {
/* Device descriptor */
0x12, 0x01, 0x10, 0x01, 0x00, 0x00, 0x00, 0x40,
0x99, 0x99, 0x00, 0x00, 0x00, 0x00, 0x01, 0x02,
- 0x03, 0x01,
+ 0x03, 0x01,
/* Configuration descriptor */
0x09, 0x02, 0x1b, 0x00, 0x01, 0x01, 0x00, 0xc0,
- 0x32,
+ 0x32,
/* Interface descriptor for DFU (bInterfaceProtocol = 1). */
DFU_INTERFACE_DESCRIPTOR(0x00, 0x01)
@@ -115,12 +115,12 @@ static UCHAR device_framework_full_speed[] = {
};
#define DEVICE_FRAMEWORK_LENGTH_HIGH_SPEED sizeof(device_framework_high_speed)
-static UCHAR device_framework_high_speed[] = {
+static UCHAR device_framework_high_speed[] = {
/* Device descriptor */
0x12, 0x01, 0x00, 0x02, 0x00, 0x00, 0x00, 0x40,
0x99, 0x99, 0x00, 0x00, 0x01, 0x00, 0x01, 0x02,
- 0x03, 0x01,
+ 0x03, 0x01,
/* Device qualifier descriptor */
0x0a, 0x06, 0x00, 0x02, 0x00, 0x00, 0x00, 0x40,
@@ -128,7 +128,7 @@ static UCHAR device_framework_high_speed[] = {
/* Configuration descriptor */
0x09, 0x02, 0x1b, 0x00, 0x01, 0x01, 0x00, 0xc0,
- 0x32,
+ 0x32,
/* Interface descriptor for DFU (bInterfaceProtocol = 1). */
DFU_INTERFACE_DESCRIPTOR(0x00, 0x01)
@@ -172,16 +172,16 @@ static UCHAR language_id_framework[] = {
#define DEVICE_FRAMEWORK_LENGTH_DFU sizeof(device_framework_dfu)
-static UCHAR device_framework_dfu[] = {
+static UCHAR device_framework_dfu[] = {
/* Device descriptor */
0x12, 0x01, 0x10, 0x01, 0x00, 0x00, 0x00, 0x40,
0x99, 0x99, 0x00, 0x00, 0x00, 0x00, 0x01, 0x02,
- 0x03, 0x01,
+ 0x03, 0x01,
/* Configuration descriptor */
0x09, 0x02, 0x1B, 0x00, 0x01, 0x01, 0x00, 0xc0,
- 0x32,
+ 0x32,
/* Interface descriptor for DFU (bInterfaceProtocol = 2). */
DFU_INTERFACE_DESCRIPTOR(0x00, 0x02)
@@ -316,7 +316,7 @@ ULONG test_n;
dfu_parameter.ux_slave_class_dfu_parameter_instance_activate = demo_thread_dfu_activate;
dfu_parameter.ux_slave_class_dfu_parameter_instance_deactivate = demo_thread_dfu_deactivate;
dfu_parameter.ux_slave_class_dfu_parameter_read = demo_thread_dfu_read;
- dfu_parameter.ux_slave_class_dfu_parameter_write = demo_thread_dfu_write;
+ dfu_parameter.ux_slave_class_dfu_parameter_write = demo_thread_dfu_write;
dfu_parameter.ux_slave_class_dfu_parameter_get_status = demo_thread_dfu_get_status;
dfu_parameter.ux_slave_class_dfu_parameter_notify = demo_thread_dfu_notify;
#ifdef UX_DEVICE_CLASS_DFU_CUSTOM_REQUEST_ENABLE
@@ -326,9 +326,9 @@ ULONG test_n;
dfu_parameter.ux_slave_class_dfu_parameter_framework_length = DEVICE_FRAMEWORK_LENGTH_DFU;
/* Initilize the device dfu class. The class is connected with interface 1 on configuration 1. */
- // status = ux_device_stack_class_register(_ux_system_slave_class_dfu_name, ux_device_class_dfu_entry,
+ // status = ux_device_stack_class_register(_ux_system_slave_class_dfu_name, ux_device_class_dfu_entry,
// 1, 0, (VOID *)&dfu_parameter);
- status = ux_device_stack_class_register(_ux_system_slave_class_dfu_name, ux_device_class_dfu_entry,
+ status = ux_device_stack_class_register(_ux_system_slave_class_dfu_name, ux_device_class_dfu_entry,
1, 0, UX_NULL);
if(status != UX_INVALID_PARAMETER)
{
@@ -337,7 +337,7 @@ ULONG test_n;
test_control_return(1);
}
- status = ux_device_stack_class_register(_ux_system_slave_class_dfu_name, ux_device_class_dfu_entry,
+ status = ux_device_stack_class_register(_ux_system_slave_class_dfu_name, ux_device_class_dfu_entry,
1, 0, (VOID *)&dfu_parameter);
if(status != UX_INVALID_PARAMETER)
{
@@ -347,7 +347,7 @@ ULONG test_n;
}
dfu_parameter.ux_slave_class_dfu_parameter_framework = device_framework_dfu;
- status = ux_device_stack_class_register(_ux_system_slave_class_dfu_name, ux_device_class_dfu_entry,
+ status = ux_device_stack_class_register(_ux_system_slave_class_dfu_name, ux_device_class_dfu_entry,
1, 0, (VOID *)&dfu_parameter);
if(status != UX_SUCCESS)
{
@@ -355,7 +355,7 @@ ULONG test_n;
printf("ERROR #%d\n", __LINE__);
test_control_return(1);
}
-
+
/* Create the simulation thread. */
status = tx_thread_create(&ux_test_thread_simulation_0, "test simulation", ux_test_thread_simulation_0_entry, 0,
stack_pointer, UX_DEMO_STACK_SIZE,
@@ -563,7 +563,7 @@ static UINT demo_thread_dfu_get_status(VOID *dfu, ULONG *media_status)
/* Return media status ok. */
*media_status = UX_SLAVE_CLASS_DFU_MEDIA_STATUS_OK ;
-
+
return(UX_SUCCESS);
}
@@ -578,12 +578,12 @@ static UINT demo_thread_dfu_notify(VOID *dfu, ULONG notification)
/* Begin of Download. */
break;
-
+
case UX_SLAVE_CLASS_DFU_NOTIFICATION_END_DOWNLOAD :
/* Completion of Download. */
break;
-
+
case UX_SLAVE_CLASS_DFU_NOTIFICATION_ABORT_DOWNLOAD :
/* Download was aborted. */
@@ -593,17 +593,17 @@ static UINT demo_thread_dfu_notify(VOID *dfu, ULONG notification)
/* Begin of UPLOAD. */
break;
-
+
case UX_SLAVE_CLASS_DFU_NOTIFICATION_END_UPLOAD :
/* Completion of UPLOAD. */
break;
-
+
case UX_SLAVE_CLASS_DFU_NOTIFICATION_ABORT_UPLOAD :
/* Download was aborted. */
break;
-
+
default :
/* Bad notification signal. Should never get here. */
diff --git a/test/regression/usbx_uxe_device_video_test.c b/test/regression/usbx_uxe_device_video_test.c
index fa72ba25..7e7ff7cc 100644
--- a/test/regression/usbx_uxe_device_video_test.c
+++ b/test/regression/usbx_uxe_device_video_test.c
@@ -226,7 +226,7 @@ static ULONG callback_invoke_count = 0;
9, 0x24, 0x03, \
0x04, /* bTerminalID */ \
W(0x0301), /* wTerminalType, OTT_DISPLAY */ \
- 0x00, 0x03/* bSourceID */, 0x00,
+ 0x00, 0x03/* bSourceID */, 0x00,
#if 0
/*--------------------------------- Processing Unit (VC_PROCESSING_UNIT) */ \
diff --git a/test/regression/usbx_uxe_host_pima_test.c b/test/regression/usbx_uxe_host_pima_test.c
index e8651008..11d757c0 100644
--- a/test/regression/usbx_uxe_host_pima_test.c
+++ b/test/regression/usbx_uxe_host_pima_test.c
@@ -127,7 +127,7 @@ ULONG object_handles_array[32];
UX_TEST_CHECK_CODE(UX_MEMORY_INSUFFICIENT ,status);
/* Unit test for function ux_host_class_pima_object_info_get() */
- status = ux_host_class_pima_object_info_get(NX_NULL, &pima_session, 0, &object);
+ status = ux_host_class_pima_object_info_get(NX_NULL, &pima_session, 0, &object);
UX_TEST_CHECK_CODE(UX_INVALID_PARAMETER ,status);
status = ux_host_class_pima_object_info_get(dummy_pima, NX_NULL, 0, &object);
@@ -292,7 +292,7 @@ ULONG object_handles_array[32];
/* Unit test for function ux_host_class_pima_num_objects_get() */
status = ux_host_class_pima_num_objects_get(NX_NULL, &pima_session, 0, 0);
UX_TEST_CHECK_CODE(UX_INVALID_PARAMETER ,status);
-
+
status = ux_host_class_pima_num_objects_get(dummy_pima, NX_NULL, 0, 0);
UX_TEST_CHECK_CODE(UX_INVALID_PARAMETER ,status);
diff --git a/test/regression/usbxtestcontrol.c b/test/regression/usbxtestcontrol.c
index 5ffc6871..fa6bba6f 100644
--- a/test/regression/usbxtestcontrol.c
+++ b/test/regression/usbxtestcontrol.c
@@ -238,6 +238,7 @@ void usbx_ux_host_class_hid_descriptor_parse_test5_application_define(void *)
void usbx_ux_host_class_hid_descriptor_parse_test6_application_define(void *);
void usbx_ux_host_class_hid_descriptor_parse_test7_application_define(void *);
void usbx_ux_host_class_hid_report_descriptor_get_test_application_define(void *);
+void usbx_ux_device_class_hid_set_protocol_callback_test_application_define(void *);
void usbx_ux_host_class_hid_remote_control_callback_test_application_define(void *);
void usbx_ux_host_class_hid_interrupt_endpoint_search_test2_application_define(void *);
void usbx_ux_host_class_hid_periodic_report_start_test2_application_define(void *);
@@ -285,6 +286,7 @@ void usbx_ux_device_class_storage_mode_select_test_application_define(void *)
void usbx_ux_device_class_storage_mode_sense_test_application_define(void *);
void usbx_ux_device_class_storage_request_sense_test_application_define(void *);
void usbx_ux_device_class_storage_start_stop_test_application_define(void *);
+void usbx_ux_device_class_storage_media_start_stop_test_application_define(void *);
void usbx_ux_device_class_storage_prevent_allow_media_removal_test_application_define(void *);
void usbx_ux_device_class_storage_verify_test_application_define(void *);
void usbx_ux_device_class_storage_uninitialize_test_application_define(void *);
@@ -508,7 +510,7 @@ TEST_ENTRY test_control_tests[] =
usbx_host_class_storage_max_lun_get_coverage_test_application_define,
usbx_host_stack_new_endpoint_create_overage_test_application_define,
- usbx_host_stack_class_unregister_coverage_test_application_define,
+ usbx_host_stack_class_unregister_coverage_test_application_define,
usbx_storage_basic_memory_test_application_define,
usbx_storage_multi_lun_test_application_define,
usbx_ux_device_class_storage_request_sense_coverage_test_application_define,
@@ -521,6 +523,7 @@ TEST_ENTRY test_control_tests[] =
usbx_ux_device_class_storage_mode_sense_test_application_define,
usbx_ux_device_class_storage_request_sense_test_application_define,
usbx_ux_device_class_storage_start_stop_test_application_define,
+ usbx_ux_device_class_storage_media_start_stop_test_application_define,
usbx_ux_device_class_storage_prevent_allow_media_removal_test_application_define,
usbx_ux_device_class_storage_verify_test_application_define,
usbx_ux_device_class_storage_uninitialize_test_application_define,
@@ -531,7 +534,7 @@ TEST_ENTRY test_control_tests[] =
usbx_ux_device_class_storage_write_test_application_define,
usbx_ux_device_class_storage_thread_test_application_define,
- usbx_ux_host_class_storage_configure_overage_test_application_define,
+ usbx_ux_host_class_storage_configure_overage_test_application_define,
usbx_ux_host_class_storage_request_sense_test_application_define,
usbx_ux_host_class_storage_media_capacity_get_test_application_define,
usbx_ux_host_class_storage_max_lun_get_test_application_define,
@@ -799,6 +802,7 @@ TEST_ENTRY test_control_tests[] =
usbx_ux_device_class_hid_descriptor_send_test_application_define,
usbx_ux_device_class_hid_entry_test_application_define,
usbx_ux_device_class_hid_event_get_AND_set_test_application_define,
+ usbx_ux_device_class_hid_set_protocol_callback_test_application_define,
usbx_ux_device_class_hid_initialize_test_application_define,
usbx_ux_device_class_hid_interrupt_thread_test_application_define,
usbx_ux_device_class_hid_interrupt_thread_test2_application_define,
diff --git a/test/regression/ux_host_class_dummy.c b/test/regression/ux_host_class_dummy.c
index c4e963e0..fd7ea6e9 100644
--- a/test/regression/ux_host_class_dummy.c
+++ b/test/regression/ux_host_class_dummy.c
@@ -206,7 +206,7 @@ UX_ENDPOINT *endpoint;
}
/* If the class instance was busy, let it finish properly and not return. */
- _ux_host_thread_sleep(UX_ENUMERATION_THREAD_WAIT);
+ _ux_host_thread_sleep(UX_ENUMERATION_THREAD_WAIT);
/* Destroy the instance. */
_ux_host_stack_class_instance_destroy(dummy -> ux_host_class_dummy_class, (VOID *) dummy);
@@ -336,7 +336,7 @@ UX_ENDPOINT *endpoint;
}
/* If the class instance was busy, let it finish properly and not return. */
- _ux_host_thread_sleep(UX_ENUMERATION_THREAD_WAIT);
+ _ux_host_thread_sleep(UX_ENUMERATION_THREAD_WAIT);
/* Destroy the instance. */
_ux_host_stack_class_instance_destroy(dummy -> ux_host_class_dummy_class, (VOID *) dummy);
diff --git a/test/regression/ux_host_class_dummy.h b/test/regression/ux_host_class_dummy.h
index 1fff3560..5be18326 100644
--- a/test/regression/ux_host_class_dummy.h
+++ b/test/regression/ux_host_class_dummy.h
@@ -7,7 +7,7 @@
typedef struct UX_HOST_CLASS_DUMMY_STRUCT
{
- struct UX_HOST_CLASS_DUMMY_STRUCT
+ struct UX_HOST_CLASS_DUMMY_STRUCT
*ux_host_class_dummy_next_instance;
UX_HOST_CLASS *ux_host_class_dummy_class;
diff --git a/test/regression/ux_test_dcd_sim_slave.c b/test/regression/ux_test_dcd_sim_slave.c
index ffda484e..21da6cbe 100644
--- a/test/regression/ux_test_dcd_sim_slave.c
+++ b/test/regression/ux_test_dcd_sim_slave.c
@@ -194,7 +194,7 @@ UINT _ux_test_dcd_sim_slave_function(UX_SLAVE_DCD *dcd, UINT function, VOID *p
UINT status;
UX_TEST_OVERRIDE_UX_DCD_SIM_SLAVE_FUNCTION_PARAMS params = { dcd, function, parameter };
UX_TEST_ACTION action;
-
+
/* Perform hooked callbacks. */
ux_test_do_hooks_before(UX_TEST_OVERRIDE_UX_DCD_SIM_SLAVE_FUNCTION, ¶ms);
diff --git a/test/regression/ux_test_hcd_sim_host.c b/test/regression/ux_test_hcd_sim_host.c
index 147b8d7a..c58db657 100644
--- a/test/regression/ux_test_hcd_sim_host.c
+++ b/test/regression/ux_test_hcd_sim_host.c
@@ -258,7 +258,7 @@ ULONG action_taken;
/* Perform hooked callbacks. */
ux_test_do_hooks_after(UX_TEST_OVERRIDE_UX_HCD_SIM_HOST_ENTRY, ¶ms);
-
+
/* Return completion status. */
return(status);
}
diff --git a/test/regression/ux_test_race_condition_overrides.c b/test/regression/ux_test_race_condition_overrides.c
index 21d7fbe7..340a1659 100644
--- a/test/regression/ux_test_race_condition_overrides.c
+++ b/test/regression/ux_test_race_condition_overrides.c
@@ -9,8 +9,8 @@
UINT _ux_host_stack_transfer_request(UX_TRANSFER *transfer_request)
{
-UX_ENDPOINT *endpoint;
-UX_DEVICE *device;
+UX_ENDPOINT *endpoint;
+UX_DEVICE *device;
UX_HCD *hcd;
UINT status;
#ifdef BUGFIX /* USBX_162 */
@@ -29,7 +29,7 @@ UX_TEST_ACTION action;
/* Get the device container from the endpoint. */
device = endpoint -> ux_endpoint_device;
-
+
#ifdef BUGFIX /* USBX_162 */
/* Get the pointer to this thread. */
this_thread = tx_thread_identify();
@@ -41,7 +41,7 @@ UX_TEST_ACTION action;
if ((device -> ux_device_state == UX_DEVICE_ATTACHED) || (device -> ux_device_state == UX_DEVICE_ADDRESSED)
|| (device -> ux_device_state == UX_DEVICE_CONFIGURED))
{
-
+
/* Set the pending transfer request. */
transfer_request -> ux_transfer_request_completion_code = UX_TRANSFER_STATUS_PENDING;
@@ -58,7 +58,7 @@ UX_TEST_ACTION action;
/* 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 = UX_DEVICE_HCD_GET(device);
@@ -67,23 +67,23 @@ UX_TEST_ACTION action;
{
/* Check if the class has already protected it. */
- if (device -> ux_device_protection_semaphore.tx_semaphore_count != 0)
+ if (device -> ux_device_protection_semaphore.tx_semaphore_count != 0)
{
/* We are using endpoint 0. Protect with semaphore. */
status = _ux_utility_semaphore_get(&device -> ux_device_protection_semaphore, UX_WAIT_FOREVER);
-
+
/* Check for status. */
if (status != UX_SUCCESS)
-
+
/* Something went wrong. */
return(status);
- }
- }
-
- /* Send the command to the controller. */
+ }
+ }
+
+ /* Send the command to the controller. */
status = hcd -> ux_hcd_entry_function(hcd, UX_HCD_TRANSFER_REQUEST, transfer_request);
-
+
/* Check result from transfer request preparation. */
if (status == UX_SUCCESS)
{
@@ -93,58 +93,58 @@ UX_TEST_ACTION action;
/* We are using endpoint 0. Unprotect with semaphore. */
_ux_utility_semaphore_put(&device -> ux_device_protection_semaphore);
- }
+ }
#else
/* 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)
|| (device -> ux_device_state == UX_DEVICE_CONFIGURED))
- {
-
+ {
+
/* 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 = 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)
{
/* Check if the class has already protected it. */
- if (device -> ux_device_protection_semaphore.tx_semaphore_count != 0)
+ if (device -> ux_device_protection_semaphore.tx_semaphore_count != 0)
{
-
+
/* We are using endpoint 0. Protect with semaphore. */
status = _ux_utility_semaphore_get(&device -> ux_device_protection_semaphore, UX_WAIT_FOREVER);
-
+
/* Check for status. */
if (status != UX_SUCCESS)
-
+
/* Something went wrong. */
return(status);
- }
- }
-
+ }
+ }
+
/* Set the pending transfer request. */
transfer_request -> ux_transfer_request_completion_code = UX_TRANSFER_STATUS_PENDING;
-
- /* Send the command to the controller. */
+
+ /* Send the command to the controller. */
status = hcd -> ux_hcd_entry_function(hcd, UX_HCD_TRANSFER_REQUEST, transfer_request);
-
+
/* Check result from transfer request preparation. */
if (status == UX_SUCCESS)
{
-
+
/* If this is endpoint 0, we unprotect the endpoint. */
if ((endpoint -> ux_endpoint_descriptor.bEndpointAddress & (UINT)~UX_ENDPOINT_DIRECTION) == 0)
-
+
/* We are using endpoint 0. Unprotect with semaphore. */
_ux_utility_semaphore_put(&device -> ux_device_protection_semaphore);
- }
+ }
}
else
-
+
/* We come here when the device is not in a state which allows transmission. */
status = UX_TRANSFER_NOT_READY;
#endif
diff --git a/test/regression/ux_test_utility_sim.c b/test/regression/ux_test_utility_sim.c
index 84c57b51..a1f951c0 100644
--- a/test/regression/ux_test_utility_sim.c
+++ b/test/regression/ux_test_utility_sim.c
@@ -242,7 +242,7 @@ UX_TEST_ACTION action;
/* Setup the basic semaphore fields. */
semaphore_ptr -> tx_semaphore_name = name_ptr;
semaphore_ptr -> tx_semaphore_count = initial_count;
-
+
/* Disable interrupts to place the semaphore on the created list. */
TX_DISABLE
@@ -272,9 +272,9 @@ UX_TEST_ACTION action;
/* Setup this semaphore's next and previous created links. */
semaphore_ptr -> tx_semaphore_created_previous = previous_semaphore;
- semaphore_ptr -> tx_semaphore_created_next = next_semaphore;
+ semaphore_ptr -> tx_semaphore_created_next = next_semaphore;
}
-
+
/* Increment the created count. */
_tx_semaphore_created_count++;
@@ -372,8 +372,8 @@ UINT _tx_semaphore_get(TX_SEMAPHORE *semaphore_ptr, ULONG wait_option)
{
TX_INTERRUPT_SAVE_AREA
-
-TX_THREAD *thread_ptr;
+
+TX_THREAD *thread_ptr;
TX_THREAD *next_thread;
TX_THREAD *previous_thread;
UINT status;
@@ -446,7 +446,7 @@ UX_TEST_ACTION action;
/* Increment the number of suspensions on this semaphore. */
semaphore_ptr -> tx_semaphore_performance_suspension_count++;
#endif
-
+
/* Pickup thread pointer. */
TX_THREAD_GET_CURRENT(thread_ptr)
@@ -598,7 +598,7 @@ UX_TEST_ACTION action;
/* Setup the basic mutex fields. */
mutex_ptr -> tx_mutex_name = name_ptr;
mutex_ptr -> tx_mutex_inherit = inherit;
-
+
/* Disable interrupts to place the mutex on the created list. */
TX_DISABLE
@@ -631,12 +631,12 @@ UX_TEST_ACTION action;
/* Setup this mutex's next and previous created links. */
mutex_ptr -> tx_mutex_created_previous = previous_mutex;
- mutex_ptr -> tx_mutex_created_next = next_mutex;
+ mutex_ptr -> tx_mutex_created_next = next_mutex;
}
/* Increment the ownership count. */
_tx_mutex_created_count++;
-
+
/* Optional mutex create extended processing. */
TX_MUTEX_CREATE_EXTENSION(mutex_ptr)
@@ -772,7 +772,7 @@ ULONG updated_stack_start;
#ifdef TX_ENABLE_STACK_CHECKING
- /* Ensure that there are two ULONG of 0xEF patterns at the top and
+ /* Ensure that there are two ULONG of 0xEF patterns at the top and
bottom of the thread's stack. This will be used to check for stack
overflow conditions during run-time. */
stack_size = ((stack_size/(sizeof(ULONG))) * (sizeof(ULONG))) - (sizeof(ULONG));
@@ -784,7 +784,7 @@ ULONG updated_stack_start;
/* Determine if the starting stack address is different. */
if (new_stack_start != updated_stack_start)
{
-
+
/* Yes, subtract another ULONG from the size to avoid going past the stack area. */
stack_size = stack_size - (sizeof(ULONG));
}
@@ -832,7 +832,7 @@ ULONG updated_stack_start;
disable all preemption. */
thread_ptr -> tx_thread_preempt_threshold = ((UINT) 0);
thread_ptr -> tx_thread_user_preempt_threshold = ((UINT) 0);
- }
+ }
else
{
@@ -849,9 +849,9 @@ ULONG updated_stack_start;
TX_THREAD_CREATE_TIMEOUT_SETUP(thread_ptr)
/* Perform any additional thread setup activities for tool or user purpose. */
- TX_THREAD_CREATE_INTERNAL_EXTENSION(thread_ptr)
+ TX_THREAD_CREATE_INTERNAL_EXTENSION(thread_ptr)
- /* Call the target specific stack frame building routine to build the
+ /* Call the target specific stack frame building routine to build the
thread's initial stack and to setup the actual stack pointer in the
control block. */
_tx_thread_stack_build(thread_ptr, _tx_thread_shell_entry);
@@ -891,9 +891,9 @@ ULONG updated_stack_start;
/* Setup this thread's created links. */
thread_ptr -> tx_thread_created_previous = previous_thread;
- thread_ptr -> tx_thread_created_next = next_thread;
+ thread_ptr -> tx_thread_created_next = next_thread;
}
-
+
/* Increment the thread created count. */
_tx_thread_created_count++;
@@ -927,26 +927,26 @@ ULONG updated_stack_start;
/* Yes, this create call was made from initialization. */
/* Pickup the current thread execute pointer, which corresponds to the
- highest priority thread ready to execute. Interrupt lockout is
- not required, since interrupts are assumed to be disabled during
+ highest priority thread ready to execute. Interrupt lockout is
+ not required, since interrupts are assumed to be disabled during
initialization. */
saved_thread_ptr = _tx_thread_execute_ptr;
/* Determine if there is thread ready for execution. */
if (saved_thread_ptr != TX_NULL)
{
-
+
/* Yes, a thread is ready for execution when initialization completes. */
/* Save the current preemption-threshold. */
saved_threshold = saved_thread_ptr -> tx_thread_preempt_threshold;
- /* For initialization, temporarily set the preemption-threshold to the
- priority level to make sure the highest-priority thread runs once
+ /* For initialization, temporarily set the preemption-threshold to the
+ priority level to make sure the highest-priority thread runs once
initialization is complete. */
saved_thread_ptr -> tx_thread_preempt_threshold = saved_thread_ptr -> tx_thread_priority;
}
- }
+ }
else
{
@@ -972,10 +972,10 @@ ULONG updated_stack_start;
/* Perform any additional activities for tool or user purpose. */
TX_THREAD_CREATE_EXTENSION(thread_ptr)
- /* Call the resume thread function to make this thread ready. */
+ /* Call the resume thread function to make this thread ready. */
_tx_thread_system_resume(thread_ptr);
#endif
-
+
/* Determine if the thread's preemption-threshold needs to be restored. */
if (saved_thread_ptr != TX_NULL)
{
@@ -983,7 +983,7 @@ ULONG updated_stack_start;
/* Yes, restore the previous highest-priority thread's preemption-threshold. This
can only happen if this routine is called from initialization. */
saved_thread_ptr -> tx_thread_preempt_threshold = saved_threshold;
- }
+ }
}
else
{
@@ -1026,7 +1026,7 @@ UINT _tx_mutex_get(TX_MUTEX *mutex_ptr, ULONG wait_option)
TX_INTERRUPT_SAVE_AREA
-TX_THREAD *thread_ptr;
+TX_THREAD *thread_ptr;
TX_MUTEX *next_mutex;
TX_MUTEX *previous_mutex;
TX_THREAD *mutex_owner;
@@ -1081,7 +1081,7 @@ UX_TEST_ACTION action;
/* Determine if priority inheritance is required. */
if (mutex_ptr -> tx_mutex_inherit == TX_TRUE)
{
-
+
/* Remember the current priority of thread. */
mutex_ptr -> tx_mutex_original_priority = thread_ptr -> tx_thread_priority;
@@ -1133,7 +1133,7 @@ UX_TEST_ACTION action;
else if (mutex_ptr -> tx_mutex_owner == thread_ptr)
{
- /* The owning thread is requesting the mutex again, just
+ /* The owning thread is requesting the mutex again, just
increment the ownership count. */
mutex_ptr -> tx_mutex_ownership_count++;
@@ -1214,7 +1214,7 @@ UX_TEST_ACTION action;
previous_thread -> tx_thread_suspended_next = thread_ptr;
next_thread -> tx_thread_suspended_previous = thread_ptr;
}
-
+
/* Increment the suspension count. */
mutex_ptr -> tx_mutex_suspended_count++;
@@ -1223,7 +1223,7 @@ UX_TEST_ACTION action;
#ifdef TX_NOT_INTERRUPTABLE
- /* Determine if we need to raise the priority of the thread
+ /* Determine if we need to raise the priority of the thread
owning the mutex. */
if (mutex_ptr -> tx_mutex_inherit == TX_TRUE)
{
@@ -1274,7 +1274,7 @@ UX_TEST_ACTION action;
/* Restore interrupts. */
TX_RESTORE
- /* Determine if we need to raise the priority of the thread
+ /* Determine if we need to raise the priority of the thread
owning the mutex. */
if (mutex_ptr -> tx_mutex_inherit == TX_TRUE)
{
@@ -1316,7 +1316,7 @@ UX_TEST_ACTION action;
{
/* Restore interrupts. */
- TX_RESTORE
+ TX_RESTORE
/* Immediate return, return error completion. */
status = TX_NOT_AVAILABLE;
@@ -1448,16 +1448,16 @@ UX_TEST_ACTION action;
#ifdef TX_DISABLE_PREEMPTION_THRESHOLD
- /* Only allow 0 (disable all preemption) and returning preemption-threshold to the
+ /* Only allow 0 (disable all preemption) and returning preemption-threshold to the
current thread priority if preemption-threshold is disabled. All other threshold
values are converted to 0. */
if (thread_ptr -> tx_thread_user_priority != new_threshold)
{
-
+
/* Is the new threshold zero? */
if (new_threshold != ((UINT) 0))
{
-
+
/* Convert the new threshold to disable all preemption, since preemption-threshold is
not supported. */
new_threshold = ((UINT) 0);
@@ -1477,7 +1477,7 @@ UX_TEST_ACTION action;
/* Determine if the new threshold is greater than the current user priority. */
if (new_threshold > thread_ptr -> tx_thread_user_priority)
{
-
+
/* Return error. */
status = TX_THRESH_ERROR;
}
@@ -1529,13 +1529,13 @@ UX_TEST_ACTION action;
/* Determine if the new threshold represents a higher priority than the priority inheritance threshold. */
if (new_threshold < thread_ptr -> tx_thread_inherit_priority)
{
-
+
/* Update the actual preemption-threshold with the new threshold. */
thread_ptr -> tx_thread_preempt_threshold = new_threshold;
}
else
{
-
+
/* Update the actual preemption-threshold with the priority inheritance. */
thread_ptr -> tx_thread_preempt_threshold = thread_ptr -> tx_thread_inherit_priority;
}
@@ -1549,7 +1549,7 @@ UX_TEST_ACTION action;
{
/* If the current execute pointer is the same at this thread, preemption needs to take place. */
- if (_tx_thread_execute_ptr == thread_ptr)
+ if (_tx_thread_execute_ptr == thread_ptr)
{
/* Preemption needs to take place. */
@@ -1595,18 +1595,18 @@ UX_TEST_ACTION action;
/* Is the execute pointer different? */
if (_tx_thread_performance_execute_log[_tx_thread_performance__execute_log_index] != _tx_thread_execute_ptr)
{
-
+
/* Move to next entry. */
_tx_thread_performance__execute_log_index++;
-
+
/* Check for wrap condition. */
if (_tx_thread_performance__execute_log_index >= TX_THREAD_EXECUTE_LOG_SIZE)
{
-
- /* Set the index to the beginning. */
+
+ /* Set the index to the beginning. */
_tx_thread_performance__execute_log_index = ((UINT) 0);
}
-
+
/* Log the new execute pointer. */
_tx_thread_performance_execute_log[_tx_thread_performance__execute_log_index] = _tx_thread_execute_ptr;
}
@@ -1620,7 +1620,7 @@ UX_TEST_ACTION action;
/* Check for preemption. */
_tx_thread_system_preempt_check();
-
+
/* Disable interrupts. */
TX_DISABLE
}
@@ -1632,7 +1632,7 @@ UX_TEST_ACTION action;
TX_RESTORE
ux_test_do_action_after(&action, ¶ms);
-
+
/* Return completion status. */
return(status);
}
@@ -1763,11 +1763,11 @@ UINT _tx_mutex_put(TX_MUTEX *mutex_ptr)
TX_INTERRUPT_SAVE_AREA
-TX_THREAD *thread_ptr;
-TX_THREAD *old_owner;
-UINT old_priority;
+TX_THREAD *thread_ptr;
+TX_THREAD *old_owner;
+UINT old_priority;
UINT status;
-TX_MUTEX *next_mutex;
+TX_MUTEX *next_mutex;
TX_MUTEX *previous_mutex;
UINT owned_count;
UINT suspended_count;
@@ -1814,8 +1814,8 @@ UX_TEST_OVERRIDE_TX_MUTEX_PUT_PARAMS action_params = {mutex_ptr};
/* Check to see if the mutex is owned by the calling thread. */
if (mutex_ptr -> tx_mutex_owner != current_thread)
{
-
- /* Determine if the preempt disable flag is set, indicating that
+
+ /* Determine if the preempt disable flag is set, indicating that
the caller is not the application but from ThreadX. In such
cases, the thread mutex owner does not need to match. */
if (_tx_thread_preempt_disable == ((UINT) 0))
@@ -1830,11 +1830,11 @@ UX_TEST_OVERRIDE_TX_MUTEX_PUT_PARAMS action_params = {mutex_ptr};
status = TX_NOT_OWNED;
}
}
-
+
/* Determine if we should continue. */
if (status == TX_NOT_DONE)
{
-
+
/* Decrement the mutex ownership count. */
mutex_ptr -> tx_mutex_ownership_count--;
@@ -1849,7 +1849,7 @@ UX_TEST_OVERRIDE_TX_MUTEX_PUT_PARAMS action_params = {mutex_ptr};
status = TX_SUCCESS;
}
else
- {
+ {
/* Check for a NULL thread pointer, which can only happen during initialization. */
if (thread_ptr == TX_NULL)
@@ -1865,9 +1865,9 @@ UX_TEST_OVERRIDE_TX_MUTEX_PUT_PARAMS action_params = {mutex_ptr};
{
/* The mutex is now available. */
-
+
/* Remove this mutex from the owned mutex list. */
-
+
/* Decrement the ownership count. */
thread_ptr -> tx_thread_owned_mutex_count--;
@@ -1894,21 +1894,21 @@ UX_TEST_OVERRIDE_TX_MUTEX_PUT_PARAMS action_params = {mutex_ptr};
{
/* Yes, move the head pointer to the next link. */
- thread_ptr -> tx_thread_owned_mutex_list = next_mutex;
+ thread_ptr -> tx_thread_owned_mutex_list = next_mutex;
}
}
- /* Determine if the simple, non-suspension, non-priority inheritance case is present. */
+ /* Determine if the simple, non-suspension, non-priority inheritance case is present. */
if (mutex_ptr -> tx_mutex_suspension_list == TX_NULL)
{
-
+
/* Is this a priority inheritance mutex? */
if (mutex_ptr -> tx_mutex_inherit == TX_FALSE)
{
/* Yes, we are done - set the mutex owner to NULL. */
mutex_ptr -> tx_mutex_owner = TX_NULL;
-
+
/* Restore interrupts. */
TX_RESTORE
@@ -1916,11 +1916,11 @@ UX_TEST_OVERRIDE_TX_MUTEX_PUT_PARAMS action_params = {mutex_ptr};
status = TX_SUCCESS;
}
}
-
+
/* Determine if the processing is complete. */
if (status == TX_NOT_DONE)
{
-
+
/* Initialize original owner and thread priority. */
old_owner = TX_NULL;
old_priority = thread_ptr -> tx_thread_user_priority;
@@ -1938,7 +1938,7 @@ UX_TEST_OVERRIDE_TX_MUTEX_PUT_PARAMS action_params = {mutex_ptr};
TX_RESTORE
#endif
- /* Search the owned mutexes for this thread to determine the highest priority for this
+ /* Search the owned mutexes for this thread to determine the highest priority for this
former mutex owner to return to. */
next_mutex = thread_ptr -> tx_thread_owned_mutex_list;
while (next_mutex != TX_NULL)
@@ -1947,8 +1947,8 @@ UX_TEST_OVERRIDE_TX_MUTEX_PUT_PARAMS action_params = {mutex_ptr};
/* Does this mutex support priority inheritance? */
if (next_mutex -> tx_mutex_inherit == TX_TRUE)
{
-
- /* Determine if highest priority field of the mutex is higher than the priority to
+
+ /* Determine if highest priority field of the mutex is higher than the priority to
restore. */
if (next_mutex -> tx_mutex_highest_priority_waiting < old_priority)
{
@@ -1964,7 +1964,7 @@ UX_TEST_OVERRIDE_TX_MUTEX_PUT_PARAMS action_params = {mutex_ptr};
/* Are we at the end of the list? */
if (next_mutex == thread_ptr -> tx_thread_owned_mutex_list)
{
-
+
/* Yes, set the next mutex to NULL. */
next_mutex = TX_NULL;
}
@@ -2001,7 +2001,7 @@ UX_TEST_OVERRIDE_TX_MUTEX_PUT_PARAMS action_params = {mutex_ptr};
TX_RESTORE
#endif
- /* Call the mutex prioritize processing to ensure the
+ /* Call the mutex prioritize processing to ensure the
highest priority thread is resumed. */
#ifdef TX_MISRA_ENABLE
do
@@ -2028,7 +2028,7 @@ UX_TEST_OVERRIDE_TX_MUTEX_PUT_PARAMS action_params = {mutex_ptr};
/* Now determine if there are any threads still waiting on the mutex. */
if (mutex_ptr -> tx_mutex_suspension_list == TX_NULL)
- {
+ {
/* No, there are no longer any threads waiting on the mutex. */
@@ -2036,24 +2036,24 @@ UX_TEST_OVERRIDE_TX_MUTEX_PUT_PARAMS action_params = {mutex_ptr};
/* Temporarily disable preemption. */
_tx_thread_preempt_disable++;
-
+
/* Restore interrupts. */
TX_RESTORE
#endif
- /* Mutex is not owned, but it is possible that a thread that
+ /* Mutex is not owned, but it is possible that a thread that
caused a priority inheritance to occur is no longer waiting
on the mutex. */
- if (mutex_ptr -> tx_mutex_inherit == TX_TRUE)
+ if (mutex_ptr -> tx_mutex_inherit == TX_TRUE)
{
/* Setup the highest priority waiting thread. */
mutex_ptr -> tx_mutex_highest_priority_waiting = (UINT) TX_MAX_PRIORITIES;
-
+
/* Determine if we need to restore priority. */
if ((mutex_ptr -> tx_mutex_owner) -> tx_thread_priority != old_priority)
{
-
+
/* Yes, restore the priority of thread. */
_tx_mutex_priority_change(mutex_ptr -> tx_mutex_owner, old_priority);
}
@@ -2098,14 +2098,14 @@ UX_TEST_OVERRIDE_TX_MUTEX_PUT_PARAMS action_params = {mutex_ptr};
/* Remember the old mutex owner. */
old_owner = mutex_ptr -> tx_mutex_owner;
-
+
/* Setup owner thread priority information. */
mutex_ptr -> tx_mutex_original_priority = thread_ptr -> tx_thread_priority;
/* Setup the highest priority waiting thread. */
mutex_ptr -> tx_mutex_highest_priority_waiting = (UINT) TX_MAX_PRIORITIES;
}
-
+
/* Determine how many mutexes are owned by this thread. */
owned_count = thread_ptr -> tx_thread_owned_mutex_count;
@@ -2147,7 +2147,7 @@ UX_TEST_OVERRIDE_TX_MUTEX_PUT_PARAMS action_params = {mutex_ptr};
/* Decrement the suspension count. */
mutex_ptr -> tx_mutex_suspended_count--;
-
+
/* Pickup the suspended count. */
suspended_count = mutex_ptr -> tx_mutex_suspended_count;
@@ -2156,7 +2156,7 @@ UX_TEST_OVERRIDE_TX_MUTEX_PUT_PARAMS action_params = {mutex_ptr};
{
/* Yes, the only suspended thread. */
-
+
/* Update the head pointer. */
mutex_ptr -> tx_mutex_suspension_list = TX_NULL;
}
@@ -2173,15 +2173,15 @@ UX_TEST_OVERRIDE_TX_MUTEX_PUT_PARAMS action_params = {mutex_ptr};
previous_thread = thread_ptr -> tx_thread_suspended_previous;
next_thread -> tx_thread_suspended_previous = previous_thread;
previous_thread -> tx_thread_suspended_next = next_thread;
- }
-
+ }
+
/* Prepare for resumption of the first thread. */
/* Clear cleanup routine to avoid timeout. */
thread_ptr -> tx_thread_suspend_cleanup = TX_NULL;
/* Put return status into the thread control block. */
- thread_ptr -> tx_thread_suspend_status = TX_SUCCESS;
+ thread_ptr -> tx_thread_suspend_status = TX_SUCCESS;
#ifdef TX_NOT_INTERRUPTABLE
@@ -2210,7 +2210,7 @@ UX_TEST_OVERRIDE_TX_MUTEX_PUT_PARAMS action_params = {mutex_ptr};
_tx_mutex_prioritize(mutex_ptr);
#endif
}
-
+
/* Now, pickup the list head and set the priority. */
/* Determine if there still are threads suspended for this mutex. */
@@ -2227,11 +2227,11 @@ UX_TEST_OVERRIDE_TX_MUTEX_PUT_PARAMS action_params = {mutex_ptr};
inheritance. */
if (old_owner != TX_NULL)
{
-
+
/* Determine if we need to restore priority. */
if (old_owner -> tx_thread_priority != old_priority)
{
-
+
/* Restore priority of thread. */
_tx_mutex_priority_change(old_owner, old_priority);
}
@@ -2256,7 +2256,7 @@ UX_TEST_OVERRIDE_TX_MUTEX_PUT_PARAMS action_params = {mutex_ptr};
{
/* Yes, priority inheritance is requested. */
-
+
/* Determine if there are any more threads still suspended on the mutex. */
if (mutex_ptr -> tx_mutex_suspended_count != TX_NO_SUSPENSIONS)
{
@@ -2271,7 +2271,7 @@ UX_TEST_OVERRIDE_TX_MUTEX_PUT_PARAMS action_params = {mutex_ptr};
#else
_tx_mutex_prioritize(mutex_ptr);
#endif
-
+
/* Now, pickup the list head and set the priority. */
/* Disable interrupts. */
@@ -2294,11 +2294,11 @@ UX_TEST_OVERRIDE_TX_MUTEX_PUT_PARAMS action_params = {mutex_ptr};
inheritance. */
if (old_owner != TX_NULL)
{
-
+
/* Is the priority different? */
if (old_owner -> tx_thread_priority != old_priority)
{
-
+
/* Restore the priority of thread. */
_tx_mutex_priority_change(old_owner, old_priority);
}
@@ -2308,7 +2308,7 @@ UX_TEST_OVERRIDE_TX_MUTEX_PUT_PARAMS action_params = {mutex_ptr};
/* Resume thread. */
_tx_thread_system_resume(thread_ptr);
#endif
-
+
/* Return a successful status. */
status = TX_SUCCESS;
}
@@ -2322,9 +2322,9 @@ UX_TEST_OVERRIDE_TX_MUTEX_PUT_PARAMS action_params = {mutex_ptr};
/* Restore interrupts. */
TX_RESTORE
-
+
/* Caller does not own the mutex. */
- status = TX_NOT_OWNED;
+ status = TX_NOT_OWNED;
}
/* Perform hooked callbacks. */
@@ -2792,7 +2792,7 @@ TX_EVENT_FLAGS_GROUP *previous_group;
/* Setup the basic event flags group fields. */
group_ptr -> tx_event_flags_group_name = name_ptr;
-
+
/* Disable interrupts to put the event flags group on the created list. */
TX_DISABLE
@@ -2822,12 +2822,12 @@ TX_EVENT_FLAGS_GROUP *previous_group;
/* Setup this group's created links. */
group_ptr -> tx_event_flags_group_created_previous = previous_group;
- group_ptr -> tx_event_flags_group_created_next = next_group;
+ group_ptr -> tx_event_flags_group_created_next = next_group;
}
/* Increment the number of created event flag groups. */
_tx_event_flags_created_count++;
-
+
/* Optional event flag group create extended processing. */
TX_EVENT_FLAGS_GROUP_CREATE_EXTENSION(group_ptr)
@@ -2865,7 +2865,7 @@ static ULONG _ux_test_sim_inp_seq_value(VOID)
{
return 0;
}
-
+
}
static VOID _ux_test_sim_inp_seq_inc(VOID)
{