Skip to content

Commit 3af3626

Browse files
committed
Update on 19 Apr 2023. Expand to see details.
f6854286 USBX host video error checking support. 909e7523 Onboard to Central Feed Services 863cc0c9 Add optional error check for host storage (no FileX). 0e88a565 Added new test case for HID descriptor get. 03944f4e Add error checking to device/host stack and system. 5bec9ee8 Device PIMA error check improvement. Fixing pictbridge issues (client callbacks initialize, host device info buffer length increase). f8c89ae9 Added host printer error checking.
1 parent 5f758e0 commit 3af3626

87 files changed

Lines changed: 5836 additions & 1907 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

common/core/inc/ux_api.h

Lines changed: 77 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@
2626
/* APPLICATION INTERFACE DEFINITION RELEASE */
2727
/* */
2828
/* ux_api.h PORTABLE C */
29-
/* 6.2.1 */
29+
/* 6.x */
3030
/* AUTHOR */
3131
/* */
3232
/* Chaoqiong Xiao, Microsoft Corporation */
@@ -133,6 +133,9 @@
133133
/* max class driver configure, */
134134
/* added a new error code, */
135135
/* resulting in version 6.2.1 */
136+
/* xx-xx-xxxx Chaoqiong Xiao Modified comment(s), */
137+
/* added error checks support, */
138+
/* resulting in version 6.x */
136139
/* */
137140
/**************************************************************************/
138141

@@ -186,6 +189,24 @@ extern "C" {
186189
#endif
187190
#endif
188191

192+
/* Internal option: enable the basic USBX error checking. This define is typically used
193+
while debugging application. */
194+
#if defined(UX_ENABLE_ERROR_CHECKING) && !defined(UX_SYSTEM_ENABLE_ERROR_CHECKING)
195+
#define UX_SYSTEM_ENABLE_ERROR_CHECKING
196+
#endif
197+
198+
/* Internal option: enable the basic USBX error checking. This define is typically used
199+
while debugging application. */
200+
#if defined(UX_ENABLE_ERROR_CHECKING) && !defined(UX_DEVICE_STACK_ENABLE_ERROR_CHECKING)
201+
#define UX_DEVICE_STACK_ENABLE_ERROR_CHECKING
202+
#endif
203+
204+
/* Internal option: enable the basic USBX error checking. This define is typically used
205+
while debugging application. */
206+
#if defined(UX_ENABLE_ERROR_CHECKING) && !defined(UX_HOST_STACK_ENABLE_ERROR_CHECKING)
207+
#define UX_HOST_STACK_ENABLE_ERROR_CHECKING
208+
#endif
209+
189210

190211
/* Define the maximum length for class names (exclude string null-terminator). */
191212
#define UX_MAX_CLASS_NAME_LENGTH 63
@@ -2658,39 +2679,67 @@ typedef struct UX_HOST_CLASS_DPUMP_STRUCT
26582679

26592680
/* Define USBX Services. */
26602681

2682+
#if defined(UX_SYSTEM_ENABLE_ERROR_CHECKING)
26612683
#define ux_system_initialize _ux_system_initialize
2684+
#else
2685+
#define ux_system_initialize _uxe_system_initialize
2686+
#endif
2687+
26622688
#define ux_system_uninitialize _ux_system_uninitialize
26632689
#define ux_system_tasks_run _ux_system_tasks_run
26642690

26652691
#define ux_host_class_hub_entry _ux_host_class_hub_entry
26662692

26672693
#define ux_host_class_storage_entry _ux_host_class_storage_entry
26682694

2695+
#if defined(UX_HOST_STACK_ENABLE_ERROR_CHECKING)
2696+
2697+
#define ux_host_stack_class_get _uxe_host_stack_class_get
2698+
#define ux_host_stack_class_instance_get _uxe_host_stack_class_instance_get
2699+
#define ux_host_stack_class_register _uxe_host_stack_class_register
2700+
#define ux_host_stack_device_configuration_activate _uxe_host_stack_device_configuration_activate
2701+
#define ux_host_stack_device_configuration_deactivate _uxe_host_stack_device_configuration_deactivate
2702+
#define ux_host_stack_device_configuration_get _uxe_host_stack_device_configuration_get
2703+
#define ux_host_stack_device_get _uxe_host_stack_device_get
2704+
#define ux_host_stack_device_string_get _uxe_host_stack_device_string_get
2705+
#define ux_host_stack_endpoint_transfer_abort _uxe_host_stack_endpoint_transfer_abort
2706+
#define ux_host_stack_hcd_register _uxe_host_stack_hcd_register
2707+
#define ux_host_stack_hcd_unregister _uxe_host_stack_hcd_unregister
2708+
#define ux_host_stack_interface_endpoint_get _uxe_host_stack_interface_endpoint_get
2709+
#define ux_host_stack_interface_setting_select _uxe_host_stack_interface_setting_select
2710+
#define ux_host_stack_transfer_request _uxe_host_stack_transfer_request
2711+
#define ux_host_stack_transfer_request_abort _uxe_host_stack_transfer_request_abort
2712+
2713+
#else
2714+
26692715
#define ux_host_stack_class_get _ux_host_stack_class_get
2670-
#define ux_host_stack_class_instance_create _ux_host_stack_class_instance_create
2671-
#define ux_host_stack_class_instance_destroy _ux_host_stack_class_instance_destroy
26722716
#define ux_host_stack_class_instance_get _ux_host_stack_class_instance_get
26732717
#define ux_host_stack_class_register _ux_host_stack_class_register
2674-
#define ux_host_stack_class_unregister _ux_host_stack_class_unregister
2675-
#define ux_host_stack_configuration_interface_get _ux_host_stack_configuration_interface_get
26762718
#define ux_host_stack_device_configuration_activate _ux_host_stack_device_configuration_activate
26772719
#define ux_host_stack_device_configuration_deactivate _ux_host_stack_device_configuration_deactivate
26782720
#define ux_host_stack_device_configuration_get _ux_host_stack_device_configuration_get
2679-
#define ux_host_stack_device_configuration_select _ux_host_stack_device_configuration_select
26802721
#define ux_host_stack_device_get _ux_host_stack_device_get
26812722
#define ux_host_stack_device_string_get _ux_host_stack_device_string_get
26822723
#define ux_host_stack_endpoint_transfer_abort _ux_host_stack_endpoint_transfer_abort
26832724
#define ux_host_stack_hcd_register _ux_host_stack_hcd_register
26842725
#define ux_host_stack_hcd_unregister _ux_host_stack_hcd_unregister
2685-
#define ux_host_stack_initialize _ux_host_stack_initialize
2686-
#define ux_host_stack_uninitialize _ux_host_stack_uninitialize
26872726
#define ux_host_stack_interface_endpoint_get _ux_host_stack_interface_endpoint_get
26882727
#define ux_host_stack_interface_setting_select _ux_host_stack_interface_setting_select
26892728
#define ux_host_stack_transfer_request _ux_host_stack_transfer_request
26902729
#define ux_host_stack_transfer_request_abort _ux_host_stack_transfer_request_abort
2730+
2731+
#endif
2732+
2733+
#define ux_host_stack_class_instance_create _ux_host_stack_class_instance_create
2734+
#define ux_host_stack_class_instance_destroy _ux_host_stack_class_instance_destroy
2735+
#define ux_host_stack_class_unregister _ux_host_stack_class_unregister
2736+
#define ux_host_stack_configuration_interface_get _ux_host_stack_configuration_interface_get
2737+
#define ux_host_stack_device_configuration_reset _ux_host_stack_device_configuration_reset
2738+
#define ux_host_stack_device_configuration_select _ux_host_stack_device_configuration_select
2739+
#define ux_host_stack_initialize _ux_host_stack_initialize
2740+
#define ux_host_stack_uninitialize _ux_host_stack_uninitialize
26912741
#define ux_host_stack_hnp_polling_thread_entry _ux_host_stack_hnp_polling_thread_entry
26922742
#define ux_host_stack_role_swap _ux_host_stack_role_swap
2693-
#define ux_host_stack_device_configuration_reset _ux_host_stack_device_configuration_reset
26942743

26952744
#define ux_host_stack_tasks_run _ux_host_stack_tasks_run
26962745
#define ux_host_stack_transfer_run _ux_host_stack_transfer_run
@@ -2699,19 +2748,30 @@ typedef struct UX_HOST_CLASS_DPUMP_STRUCT
26992748
#define ux_utility_pci_read _ux_utility_pci_read
27002749
#define ux_utility_pci_write _ux_utility_pci_write
27012750

2702-
#define ux_device_stack_alternate_setting_get _ux_device_stack_alternate_setting_get
2703-
#define ux_device_stack_alternate_setting_set _ux_device_stack_alternate_setting_set
2751+
#if defined(UX_DEVICE_STACK_ENABLE_ERROR_CHECKING)
2752+
2753+
#define ux_device_stack_class_register _uxe_device_stack_class_register
2754+
#define ux_device_stack_class_unregister _uxe_device_stack_class_unregister
2755+
#define ux_device_stack_initialize _uxe_device_stack_initialize
2756+
2757+
#else
2758+
27042759
#define ux_device_stack_class_register _ux_device_stack_class_register
27052760
#define ux_device_stack_class_unregister _ux_device_stack_class_unregister
2761+
#define ux_device_stack_initialize _ux_device_stack_initialize
2762+
2763+
#endif
2764+
#define ux_device_stack_uninitialize _ux_device_stack_uninitialize
2765+
2766+
#define ux_device_stack_alternate_setting_get _ux_device_stack_alternate_setting_get
2767+
#define ux_device_stack_alternate_setting_set _ux_device_stack_alternate_setting_set
27062768
#define ux_device_stack_configuration_get _ux_device_stack_configuration_get
27072769
#define ux_device_stack_configuration_set _ux_device_stack_configuration_set
27082770
#define ux_device_stack_descriptor_send _ux_device_stack_descriptor_send
27092771
#define ux_device_stack_connect _ux_device_stack_connect
27102772
#define ux_device_stack_disconnect _ux_device_stack_disconnect
27112773
#define ux_device_stack_endpoint_stall _ux_device_stack_endpoint_stall
27122774
#define ux_device_stack_host_wakeup _ux_device_stack_host_wakeup
2713-
#define ux_device_stack_initialize _ux_device_stack_initialize
2714-
#define ux_device_stack_uninitialize _ux_device_stack_uninitialize
27152775
#define ux_device_stack_interface_delete _ux_device_stack_interface_delete
27162776
#define ux_device_stack_interface_get _ux_device_stack_interface_get
27172777
#define ux_device_stack_interface_set _ux_device_stack_interface_set
@@ -2740,6 +2800,10 @@ UINT ux_system_initialize(VOID *non_cached_memory_pool_start, ULONG non_cache
27402800
UINT ux_system_uninitialize(VOID);
27412801
UINT ux_system_tasks_run(VOID);
27422802

2803+
UINT uxe_system_initialize(VOID *non_cached_memory_pool_start, ULONG non_cached_memory_size,
2804+
VOID *cached_memory_pool_start, ULONG cached_memory_size);
2805+
2806+
27432807
/* Define USBX Host API prototypes. */
27442808

27452809
UINT ux_hcd_ehci_initialize(UX_HCD *hcd);

common/core/inc/ux_device_stack.h

Lines changed: 19 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@
2525
/* COMPONENT DEFINITION RELEASE */
2626
/* */
2727
/* ux_device_stack.h PORTABLE C */
28-
/* 6.1.12 */
28+
/* 6.x */
2929
/* AUTHOR */
3030
/* */
3131
/* Chaoqiong Xiao, Microsoft Corporation */
@@ -53,6 +53,9 @@
5353
/* fixed parameter/variable */
5454
/* names conflict C++ keyword, */
5555
/* resulting in version 6.1.12 */
56+
/* xx-xx-xxxx Chaoqiong Xiao Modified comment(s), */
57+
/* added error checks support, */
58+
/* resulting in version 6.x */
5659
/* */
5760
/**************************************************************************/
5861

@@ -109,6 +112,21 @@ UINT _ux_device_stack_uninitialize(VOID);
109112
UINT _ux_device_stack_tasks_run(VOID);
110113
UINT _ux_device_stack_transfer_run(UX_SLAVE_TRANSFER *transfer_request, ULONG slave_length, ULONG host_length);
111114

115+
UINT _uxe_device_stack_class_register(UCHAR *class_name,
116+
UINT (*class_entry_function)(struct UX_SLAVE_CLASS_COMMAND_STRUCT *),
117+
ULONG configuration_number,
118+
ULONG interface_number,
119+
VOID *parameter);
120+
UINT _uxe_device_stack_class_unregister(UCHAR *class_name,
121+
UINT (*class_entry_function)(struct UX_SLAVE_CLASS_COMMAND_STRUCT *));
122+
123+
UINT _uxe_device_stack_initialize(UCHAR * device_framework_high_speed, ULONG device_framework_length_high_speed,
124+
UCHAR * device_framework_full_speed, ULONG device_framework_length_full_speed,
125+
UCHAR * string_framework, ULONG string_framework_length,
126+
UCHAR * language_id_framework, ULONG language_id_framework_length,
127+
UINT (*ux_system_slave_change_function)(ULONG));
128+
129+
112130
/* Determine if a C++ compiler is being used. If so, complete the standard
113131
C conditional started above. */
114132
#ifdef __cplusplus

common/core/inc/ux_host_stack.h

Lines changed: 36 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@
2626
/* COMPONENT DEFINITION RELEASE */
2727
/* */
2828
/* ux_host_stack.h PORTABLE C */
29-
/* 6.1.12 */
29+
/* 6.x */
3030
/* AUTHOR */
3131
/* */
3232
/* Chaoqiong Xiao, Microsoft Corporation */
@@ -65,6 +65,9 @@
6565
/* names conflict C++ keyword, */
6666
/* added standalone HUB, */
6767
/* resulting in version 6.1.12 */
68+
/* xx-xx-xxxx Chaoqiong Xiao Modified comment(s), */
69+
/* added error checks support, */
70+
/* resulting in version 6.x */
6871
/* */
6972
/**************************************************************************/
7073

@@ -82,6 +85,13 @@ extern "C" {
8285
#endif
8386

8487

88+
/* Internal option: enable the basic USBX error checking. This define is typically used
89+
while debugging application. */
90+
#if defined(UX_ENABLE_ERROR_CHECKING) && !defined(UX_HOST_STACK_ENABLE_ERROR_CHECKING)
91+
#define UX_HOST_STACK_ENABLE_ERROR_CHECKING
92+
#endif
93+
94+
8595
/* Define Host Stack enumeration state machine states. */
8696

8797
#define UX_HOST_STACK_ENUM_PORT_ENABLE (UX_STATE_STEP + 0)
@@ -194,6 +204,31 @@ VOID _ux_host_stack_hnp_polling_thread_entry(ULONG id);
194204
UINT _ux_host_stack_tasks_run(VOID);
195205
UINT _ux_host_stack_transfer_run(UX_TRANSFER *transfer_request);
196206

207+
208+
UINT _uxe_host_stack_class_get(UCHAR *class_name, UX_HOST_CLASS **ux_class);
209+
UINT _uxe_host_stack_class_instance_get(UX_HOST_CLASS *class, UINT class_index, VOID **class_instance);
210+
UINT _uxe_host_stack_class_register(UCHAR *class_name,
211+
UINT (*class_entry_function)(struct UX_HOST_CLASS_COMMAND_STRUCT *));
212+
UINT _uxe_host_stack_configuration_interface_get(UX_CONFIGURATION *configuration,
213+
UINT interface_index, UINT alternate_setting_index,
214+
UX_INTERFACE **ux_interface);
215+
UINT _uxe_host_stack_device_configuration_activate(UX_CONFIGURATION *configuration);
216+
UINT _uxe_host_stack_device_configuration_deactivate(UX_DEVICE *device);
217+
UINT _uxe_host_stack_device_configuration_get(UX_DEVICE *device, UINT configuration_index,
218+
UX_CONFIGURATION **configuration);
219+
UINT _uxe_host_stack_device_get(ULONG device_index, UX_DEVICE **device);
220+
UINT _uxe_host_stack_device_string_get(UX_DEVICE *device, UCHAR *descriptor_buffer, ULONG length, ULONG language_id, ULONG string_index);
221+
UINT _uxe_host_stack_endpoint_transfer_abort(UX_ENDPOINT *endpoint);
222+
UINT _uxe_host_stack_hcd_register(UCHAR *hcd_name,
223+
UINT (*hcd_init_function)(struct UX_HCD_STRUCT *), ULONG hcd_param1, ULONG hcd_param2);
224+
UINT _uxe_host_stack_hcd_unregister(UCHAR *hcd_name, ULONG hcd_param1, ULONG hcd_param2);
225+
UINT _uxe_host_stack_interface_endpoint_get(UX_INTERFACE *ux_interface, UINT endpoint_index, UX_ENDPOINT **endpoint);
226+
UINT _uxe_host_stack_interface_setting_select(UX_INTERFACE *ux_interface);
227+
UINT _uxe_host_stack_transfer_request(UX_TRANSFER *transfer_request);
228+
UINT _uxe_host_stack_transfer_request_abort(UX_TRANSFER *transfer_request);
229+
UINT _uxe_host_stack_transfer_run(UX_TRANSFER *transfer_request);
230+
231+
197232
/* Determine if a C++ compiler is being used. If so, complete the standard
198233
C conditional started above. */
199234
#ifdef __cplusplus

common/core/inc/ux_system.h

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@
2626
/* COMPONENT DEFINITION RELEASE */
2727
/* */
2828
/* ux_system.h PORTABLE C */
29-
/* 6.1.11 */
29+
/* 6.x */
3030
/* AUTHOR */
3131
/* */
3232
/* Chaoqiong Xiao, Microsoft Corporation */
@@ -53,6 +53,9 @@
5353
/* 04-25-2022 Chaoqiong Xiao Modified comment(s), */
5454
/* added device CCID name, */
5555
/* resulting in version 6.1.11 */
56+
/* xx-xx-xxxx Chaoqiong Xiao Modified comment(s), */
57+
/* added error checks support, */
58+
/* resulting in version 6.x */
5659
/* */
5760
/**************************************************************************/
5861

@@ -70,6 +73,9 @@ UINT _ux_system_initialize(VOID *regular_memory_pool_start, ULONG regular_memor
7073
VOID *cache_safe_memory_pool_start, ULONG cache_safe_memory_size);
7174
UINT _ux_system_uninitialize(VOID);
7275
UINT _ux_system_tasks_run(VOID);
76+
77+
UINT _uxe_system_initialize(VOID *regular_memory_pool_start, ULONG regular_memory_size,
78+
VOID *cache_safe_memory_pool_start, ULONG cache_safe_memory_size);
7379
#endif
7480

7581
/* Define System component external data references. */

0 commit comments

Comments
 (0)