diff options
| author | Chaoqiong Xiao <[email protected]> | 2023-04-19 00:56:30 +0000 |
|---|---|---|
| committer | Chaoqiong Xiao <[email protected]> | 2023-04-19 00:56:30 +0000 |
| commit | 3af3626c9b4b5fefbe4016582b896ad79287df62 (patch) | |
| tree | e5c58c0fa0e108f9b6994273ce67319edab4fe6b /common/core | |
| parent | 5f758e08fe6661ee5330a764abdf6b3c5a55938f (diff) | |
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.
Diffstat (limited to 'common/core')
26 files changed, 1266 insertions, 20 deletions
diff --git a/common/core/inc/ux_api.h b/common/core/inc/ux_api.h index ec661a7..e8b54d6 100644 --- a/common/core/inc/ux_api.h +++ b/common/core/inc/ux_api.h @@ -26,7 +26,7 @@ /* APPLICATION INTERFACE DEFINITION RELEASE */ /* */ /* ux_api.h PORTABLE C */ -/* 6.2.1 */ +/* 6.x */ /* AUTHOR */ /* */ /* Chaoqiong Xiao, Microsoft Corporation */ @@ -133,6 +133,9 @@ /* max class driver configure, */ /* added a new error code, */ /* resulting in version 6.2.1 */ +/* xx-xx-xxxx Chaoqiong Xiao Modified comment(s), */ +/* added error checks support, */ +/* resulting in version 6.x */ /* */ /**************************************************************************/ @@ -186,6 +189,24 @@ extern "C" { #endif #endif +/* Internal option: enable the basic USBX error checking. This define is typically used + while debugging application. */ +#if defined(UX_ENABLE_ERROR_CHECKING) && !defined(UX_SYSTEM_ENABLE_ERROR_CHECKING) +#define UX_SYSTEM_ENABLE_ERROR_CHECKING +#endif + +/* Internal option: enable the basic USBX error checking. This define is typically used + while debugging application. */ +#if defined(UX_ENABLE_ERROR_CHECKING) && !defined(UX_DEVICE_STACK_ENABLE_ERROR_CHECKING) +#define UX_DEVICE_STACK_ENABLE_ERROR_CHECKING +#endif + +/* Internal option: enable the basic USBX error checking. This define is typically used + while debugging application. */ +#if defined(UX_ENABLE_ERROR_CHECKING) && !defined(UX_HOST_STACK_ENABLE_ERROR_CHECKING) +#define UX_HOST_STACK_ENABLE_ERROR_CHECKING +#endif + /* Define the maximum length for class names (exclude string null-terminator). */ #define UX_MAX_CLASS_NAME_LENGTH 63 @@ -2658,7 +2679,12 @@ typedef struct UX_HOST_CLASS_DPUMP_STRUCT /* Define USBX Services. */ +#if defined(UX_SYSTEM_ENABLE_ERROR_CHECKING) #define ux_system_initialize _ux_system_initialize +#else +#define ux_system_initialize _uxe_system_initialize +#endif + #define ux_system_uninitialize _ux_system_uninitialize #define ux_system_tasks_run _ux_system_tasks_run @@ -2666,31 +2692,54 @@ typedef struct UX_HOST_CLASS_DPUMP_STRUCT #define ux_host_class_storage_entry _ux_host_class_storage_entry +#if defined(UX_HOST_STACK_ENABLE_ERROR_CHECKING) + +#define ux_host_stack_class_get _uxe_host_stack_class_get +#define ux_host_stack_class_instance_get _uxe_host_stack_class_instance_get +#define ux_host_stack_class_register _uxe_host_stack_class_register +#define ux_host_stack_device_configuration_activate _uxe_host_stack_device_configuration_activate +#define ux_host_stack_device_configuration_deactivate _uxe_host_stack_device_configuration_deactivate +#define ux_host_stack_device_configuration_get _uxe_host_stack_device_configuration_get +#define ux_host_stack_device_get _uxe_host_stack_device_get +#define ux_host_stack_device_string_get _uxe_host_stack_device_string_get +#define ux_host_stack_endpoint_transfer_abort _uxe_host_stack_endpoint_transfer_abort +#define ux_host_stack_hcd_register _uxe_host_stack_hcd_register +#define ux_host_stack_hcd_unregister _uxe_host_stack_hcd_unregister +#define ux_host_stack_interface_endpoint_get _uxe_host_stack_interface_endpoint_get +#define ux_host_stack_interface_setting_select _uxe_host_stack_interface_setting_select +#define ux_host_stack_transfer_request _uxe_host_stack_transfer_request +#define ux_host_stack_transfer_request_abort _uxe_host_stack_transfer_request_abort + +#else + #define ux_host_stack_class_get _ux_host_stack_class_get -#define ux_host_stack_class_instance_create _ux_host_stack_class_instance_create -#define ux_host_stack_class_instance_destroy _ux_host_stack_class_instance_destroy #define ux_host_stack_class_instance_get _ux_host_stack_class_instance_get #define ux_host_stack_class_register _ux_host_stack_class_register -#define ux_host_stack_class_unregister _ux_host_stack_class_unregister -#define ux_host_stack_configuration_interface_get _ux_host_stack_configuration_interface_get #define ux_host_stack_device_configuration_activate _ux_host_stack_device_configuration_activate #define ux_host_stack_device_configuration_deactivate _ux_host_stack_device_configuration_deactivate #define ux_host_stack_device_configuration_get _ux_host_stack_device_configuration_get -#define ux_host_stack_device_configuration_select _ux_host_stack_device_configuration_select #define ux_host_stack_device_get _ux_host_stack_device_get #define ux_host_stack_device_string_get _ux_host_stack_device_string_get #define ux_host_stack_endpoint_transfer_abort _ux_host_stack_endpoint_transfer_abort #define ux_host_stack_hcd_register _ux_host_stack_hcd_register #define ux_host_stack_hcd_unregister _ux_host_stack_hcd_unregister -#define ux_host_stack_initialize _ux_host_stack_initialize -#define ux_host_stack_uninitialize _ux_host_stack_uninitialize #define ux_host_stack_interface_endpoint_get _ux_host_stack_interface_endpoint_get #define ux_host_stack_interface_setting_select _ux_host_stack_interface_setting_select #define ux_host_stack_transfer_request _ux_host_stack_transfer_request #define ux_host_stack_transfer_request_abort _ux_host_stack_transfer_request_abort + +#endif + +#define ux_host_stack_class_instance_create _ux_host_stack_class_instance_create +#define ux_host_stack_class_instance_destroy _ux_host_stack_class_instance_destroy +#define ux_host_stack_class_unregister _ux_host_stack_class_unregister +#define ux_host_stack_configuration_interface_get _ux_host_stack_configuration_interface_get +#define ux_host_stack_device_configuration_reset _ux_host_stack_device_configuration_reset +#define ux_host_stack_device_configuration_select _ux_host_stack_device_configuration_select +#define ux_host_stack_initialize _ux_host_stack_initialize +#define ux_host_stack_uninitialize _ux_host_stack_uninitialize #define ux_host_stack_hnp_polling_thread_entry _ux_host_stack_hnp_polling_thread_entry #define ux_host_stack_role_swap _ux_host_stack_role_swap -#define ux_host_stack_device_configuration_reset _ux_host_stack_device_configuration_reset #define ux_host_stack_tasks_run _ux_host_stack_tasks_run #define ux_host_stack_transfer_run _ux_host_stack_transfer_run @@ -2699,10 +2748,23 @@ typedef struct UX_HOST_CLASS_DPUMP_STRUCT #define ux_utility_pci_read _ux_utility_pci_read #define ux_utility_pci_write _ux_utility_pci_write -#define ux_device_stack_alternate_setting_get _ux_device_stack_alternate_setting_get -#define ux_device_stack_alternate_setting_set _ux_device_stack_alternate_setting_set +#if defined(UX_DEVICE_STACK_ENABLE_ERROR_CHECKING) + +#define ux_device_stack_class_register _uxe_device_stack_class_register +#define ux_device_stack_class_unregister _uxe_device_stack_class_unregister +#define ux_device_stack_initialize _uxe_device_stack_initialize + +#else + #define ux_device_stack_class_register _ux_device_stack_class_register #define ux_device_stack_class_unregister _ux_device_stack_class_unregister +#define ux_device_stack_initialize _ux_device_stack_initialize + +#endif +#define ux_device_stack_uninitialize _ux_device_stack_uninitialize + +#define ux_device_stack_alternate_setting_get _ux_device_stack_alternate_setting_get +#define ux_device_stack_alternate_setting_set _ux_device_stack_alternate_setting_set #define ux_device_stack_configuration_get _ux_device_stack_configuration_get #define ux_device_stack_configuration_set _ux_device_stack_configuration_set #define ux_device_stack_descriptor_send _ux_device_stack_descriptor_send @@ -2710,8 +2772,6 @@ typedef struct UX_HOST_CLASS_DPUMP_STRUCT #define ux_device_stack_disconnect _ux_device_stack_disconnect #define ux_device_stack_endpoint_stall _ux_device_stack_endpoint_stall #define ux_device_stack_host_wakeup _ux_device_stack_host_wakeup -#define ux_device_stack_initialize _ux_device_stack_initialize -#define ux_device_stack_uninitialize _ux_device_stack_uninitialize #define ux_device_stack_interface_delete _ux_device_stack_interface_delete #define ux_device_stack_interface_get _ux_device_stack_interface_get #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 UINT ux_system_uninitialize(VOID); UINT ux_system_tasks_run(VOID); +UINT uxe_system_initialize(VOID *non_cached_memory_pool_start, ULONG non_cached_memory_size, + VOID *cached_memory_pool_start, ULONG cached_memory_size); + + /* Define USBX Host API prototypes. */ UINT ux_hcd_ehci_initialize(UX_HCD *hcd); diff --git a/common/core/inc/ux_device_stack.h b/common/core/inc/ux_device_stack.h index a81ab9e..cafe533 100644 --- a/common/core/inc/ux_device_stack.h +++ b/common/core/inc/ux_device_stack.h @@ -25,7 +25,7 @@ /* COMPONENT DEFINITION RELEASE */ /* */ /* ux_device_stack.h PORTABLE C */ -/* 6.1.12 */ +/* 6.x */ /* AUTHOR */ /* */ /* Chaoqiong Xiao, Microsoft Corporation */ @@ -53,6 +53,9 @@ /* fixed parameter/variable */ /* names conflict C++ keyword, */ /* resulting in version 6.1.12 */ +/* xx-xx-xxxx Chaoqiong Xiao Modified comment(s), */ +/* added error checks support, */ +/* resulting in version 6.x */ /* */ /**************************************************************************/ @@ -109,6 +112,21 @@ UINT _ux_device_stack_uninitialize(VOID); UINT _ux_device_stack_tasks_run(VOID); UINT _ux_device_stack_transfer_run(UX_SLAVE_TRANSFER *transfer_request, ULONG slave_length, ULONG host_length); +UINT _uxe_device_stack_class_register(UCHAR *class_name, + UINT (*class_entry_function)(struct UX_SLAVE_CLASS_COMMAND_STRUCT *), + ULONG configuration_number, + ULONG interface_number, + VOID *parameter); +UINT _uxe_device_stack_class_unregister(UCHAR *class_name, + UINT (*class_entry_function)(struct UX_SLAVE_CLASS_COMMAND_STRUCT *)); + +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, + UCHAR * string_framework, ULONG string_framework_length, + UCHAR * language_id_framework, ULONG language_id_framework_length, + UINT (*ux_system_slave_change_function)(ULONG)); + + /* Determine if a C++ compiler is being used. If so, complete the standard C conditional started above. */ #ifdef __cplusplus diff --git a/common/core/inc/ux_host_stack.h b/common/core/inc/ux_host_stack.h index 6bb9891..b4a6ac0 100644 --- a/common/core/inc/ux_host_stack.h +++ b/common/core/inc/ux_host_stack.h @@ -26,7 +26,7 @@ /* COMPONENT DEFINITION RELEASE */ /* */ /* ux_host_stack.h PORTABLE C */ -/* 6.1.12 */ +/* 6.x */ /* AUTHOR */ /* */ /* Chaoqiong Xiao, Microsoft Corporation */ @@ -65,6 +65,9 @@ /* names conflict C++ keyword, */ /* added standalone HUB, */ /* resulting in version 6.1.12 */ +/* xx-xx-xxxx Chaoqiong Xiao Modified comment(s), */ +/* added error checks support, */ +/* resulting in version 6.x */ /* */ /**************************************************************************/ @@ -82,6 +85,13 @@ extern "C" { #endif +/* Internal option: enable the basic USBX error checking. This define is typically used + while debugging application. */ +#if defined(UX_ENABLE_ERROR_CHECKING) && !defined(UX_HOST_STACK_ENABLE_ERROR_CHECKING) +#define UX_HOST_STACK_ENABLE_ERROR_CHECKING +#endif + + /* Define Host Stack enumeration state machine states. */ #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); UINT _ux_host_stack_tasks_run(VOID); UINT _ux_host_stack_transfer_run(UX_TRANSFER *transfer_request); + +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 interface_index, UINT alternate_setting_index, + UX_INTERFACE **ux_interface); +UINT _uxe_host_stack_device_configuration_activate(UX_CONFIGURATION *configuration); +UINT _uxe_host_stack_device_configuration_deactivate(UX_DEVICE *device); +UINT _uxe_host_stack_device_configuration_get(UX_DEVICE *device, UINT configuration_index, + UX_CONFIGURATION **configuration); +UINT _uxe_host_stack_device_get(ULONG device_index, UX_DEVICE **device); +UINT _uxe_host_stack_device_string_get(UX_DEVICE *device, UCHAR *descriptor_buffer, ULONG length, ULONG language_id, ULONG string_index); +UINT _uxe_host_stack_endpoint_transfer_abort(UX_ENDPOINT *endpoint); +UINT _uxe_host_stack_hcd_register(UCHAR *hcd_name, + UINT (*hcd_init_function)(struct UX_HCD_STRUCT *), ULONG hcd_param1, ULONG hcd_param2); +UINT _uxe_host_stack_hcd_unregister(UCHAR *hcd_name, ULONG hcd_param1, ULONG hcd_param2); +UINT _uxe_host_stack_interface_endpoint_get(UX_INTERFACE *ux_interface, UINT endpoint_index, UX_ENDPOINT **endpoint); +UINT _uxe_host_stack_interface_setting_select(UX_INTERFACE *ux_interface); +UINT _uxe_host_stack_transfer_request(UX_TRANSFER *transfer_request); +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. */ #ifdef __cplusplus diff --git a/common/core/inc/ux_system.h b/common/core/inc/ux_system.h index 012da6b..9734f1d 100644 --- a/common/core/inc/ux_system.h +++ b/common/core/inc/ux_system.h @@ -26,7 +26,7 @@ /* COMPONENT DEFINITION RELEASE */ /* */ /* ux_system.h PORTABLE C */ -/* 6.1.11 */ +/* 6.x */ /* AUTHOR */ /* */ /* Chaoqiong Xiao, Microsoft Corporation */ @@ -53,6 +53,9 @@ /* 04-25-2022 Chaoqiong Xiao Modified comment(s), */ /* added device CCID name, */ /* resulting in version 6.1.11 */ +/* xx-xx-xxxx Chaoqiong Xiao Modified comment(s), */ +/* added error checks support, */ +/* resulting in version 6.x */ /* */ /**************************************************************************/ @@ -70,6 +73,9 @@ UINT _ux_system_initialize(VOID *regular_memory_pool_start, ULONG regular_memor 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, + VOID *cache_safe_memory_pool_start, ULONG cache_safe_memory_size); #endif /* Define System component external data references. */ diff --git a/common/core/src/ux_device_stack_class_register.c b/common/core/src/ux_device_stack_class_register.c index 9895699..ad61647 100644 --- a/common/core/src/ux_device_stack_class_register.c +++ b/common/core/src/ux_device_stack_class_register.c @@ -166,3 +166,61 @@ ULONG class_index; return(UX_MEMORY_INSUFFICIENT); } + +/**************************************************************************/ +/* */ +/* FUNCTION RELEASE */ +/* */ +/* _uxe_device_stack_class_register PORTABLE C */ +/* 6.x */ +/* AUTHOR */ +/* */ +/* Chaoqiong Xiao, Microsoft Corporation */ +/* */ +/* DESCRIPTION */ +/* */ +/* This function checks errors in device stack class register function */ +/* call. */ +/* */ +/* INPUT */ +/* */ +/* class_name Name of class */ +/* class_function_entry Class entry function */ +/* configuration_number Configuration # for this class*/ +/* interface_number Interface # for this class */ +/* parameter Parameter specific for class */ +/* */ +/* OUTPUT */ +/* */ +/* None */ +/* */ +/* CALLS */ +/* */ +/* _ux_device_stack_class_register Class register */ +/* */ +/* CALLED BY */ +/* */ +/* Application */ +/* */ +/* RELEASE HISTORY */ +/* */ +/* DATE NAME DESCRIPTION */ +/* */ +/* xx-xx-xxxx Chaoqiong Xiao Initial Version 6.x */ +/* */ +/**************************************************************************/ +UINT _uxe_device_stack_class_register(UCHAR *class_name, + UINT (*class_entry_function)(struct UX_SLAVE_CLASS_COMMAND_STRUCT *), + ULONG configuration_number, + ULONG interface_number, + VOID *parameter) +{ + + /* Sanity checks. */ + if ((class_name == UX_NULL) || (class_entry_function == UX_NULL)) + return(UX_INVALID_PARAMETER); + + /* Invoke class register function. */ + return(_ux_device_stack_class_register(class_name, class_entry_function, + configuration_number, interface_number, parameter)); +} diff --git a/common/core/src/ux_device_stack_class_unregister.c b/common/core/src/ux_device_stack_class_unregister.c index 8e89d9c..8d1bde0 100644 --- a/common/core/src/ux_device_stack_class_unregister.c +++ b/common/core/src/ux_device_stack_class_unregister.c @@ -150,3 +150,54 @@ ULONG class_index; return(UX_NO_CLASS_MATCH); } + +/**************************************************************************/ +/* */ +/* FUNCTION RELEASE */ +/* */ +/* _uxe_device_stack_class_unregister PORTABLE C */ +/* 6.x */ +/* AUTHOR */ +/* */ +/* Chaoqiong Xiao, Microsoft Corporation */ +/* */ +/* DESCRIPTION */ +/* */ +/* This function checks errors in device stack class unregister */ +/* function call. */ +/* */ +/* INPUT */ +/* */ +/* class_name Name of class */ +/* class_function_entry Class entry function */ +/* */ +/* OUTPUT */ +/* */ +/* None */ +/* */ +/* CALLS */ +/* */ +/* _ux_device_stack_class_unregister Class unregister */ +/* */ +/* CALLED BY */ +/* */ +/* Application */ +/* */ +/* RELEASE HISTORY */ +/* */ +/* DATE NAME DESCRIPTION */ +/* */ +/* xx-xx-xxxx Chaoqiong Xiao Initial Version 6.x */ +/* */ +/**************************************************************************/ +UINT _uxe_device_stack_class_unregister(UCHAR *class_name, + UINT (*class_entry_function)(struct UX_SLAVE_CLASS_COMMAND_STRUCT *)) +{ + + /* Sanity checks. */ + if ((class_name == UX_NULL) || (class_entry_function == UX_NULL)) + return(UX_INVALID_PARAMETER); + + /* Invoke unregister function. */ + return(_ux_device_stack_class_unregister(class_name, class_entry_function)); +} diff --git a/common/core/src/ux_device_stack_descriptor_send.c b/common/core/src/ux_device_stack_descriptor_send.c index f6ad0cf..f8dae5a 100644 --- a/common/core/src/ux_device_stack_descriptor_send.c +++ b/common/core/src/ux_device_stack_descriptor_send.c @@ -32,7 +32,8 @@ #if (UX_SLAVE_REQUEST_CONTROL_MAX_LENGTH < UX_DEVICE_DESCRIPTOR_LENGTH) || \ (UX_SLAVE_REQUEST_CONTROL_MAX_LENGTH < UX_DEVICE_QUALIFIER_DESCRIPTOR_LENGTH) || \ (UX_SLAVE_REQUEST_CONTROL_MAX_LENGTH < UX_OTG_DESCRIPTOR_LENGTH) -#error UX_SLAVE_REQUEST_CONTROL_MAX_LENGTH too small, please check +/* #error UX_SLAVE_REQUEST_CONTROL_MAX_LENGTH too small, please check */ +/* Build option checked runtime by UX_ASSERT */ #endif /**************************************************************************/ @@ -40,7 +41,7 @@ /* FUNCTION RELEASE */ /* */ /* _ux_device_stack_descriptor_send PORTABLE C */ -/* 6.1.11 */ +/* 6.x */ /* AUTHOR */ /* */ /* Chaoqiong Xiao, Microsoft Corporation */ @@ -88,6 +89,9 @@ /* 04-25-2022 Chaoqiong Xiao Modified comment(s), */ /* internal clean up, */ /* resulting in version 6.1.11 */ +/* xx-xx-xxxx Chaoqiong Xiao Modified comment(s), */ +/* moved compile option check, */ +/* resulting in version 6.x */ /* */ /**************************************************************************/ UINT _ux_device_stack_descriptor_send(ULONG descriptor_type, ULONG request_index, ULONG host_length) @@ -115,6 +119,12 @@ UCHAR *string_framework; ULONG string_framework_length; ULONG string_length; + + /* Build option check. */ + UX_ASSERT((UX_SLAVE_REQUEST_CONTROL_MAX_LENGTH >= UX_DEVICE_DESCRIPTOR_LENGTH) && + (UX_SLAVE_REQUEST_CONTROL_MAX_LENGTH >= UX_DEVICE_QUALIFIER_DESCRIPTOR_LENGTH) && + (UX_SLAVE_REQUEST_CONTROL_MAX_LENGTH >= UX_OTG_DESCRIPTOR_LENGTH)); + /* If trace is enabled, insert this event into the trace buffer. */ UX_TRACE_IN_LINE_INSERT(UX_TRACE_DEVICE_STACK_DESCRIPTOR_SEND, descriptor_type, request_index, 0, 0, UX_TRACE_DEVICE_STACK_EVENTS, 0, 0) diff --git a/common/core/src/ux_device_stack_initialize.c b/common/core/src/ux_device_stack_initialize.c index 728c293..e5e07e7 100644 --- a/common/core/src/ux_device_stack_initialize.c +++ b/common/core/src/ux_device_stack_initialize.c @@ -458,3 +458,64 @@ UCHAR *memory; return(status); } + +/**************************************************************************/ +/* */ +/* FUNCTION RELEASE */ +/* */ +/* _uxe_device_stack_initialize PORTABLE C */ +/* 6.x */ +/* AUTHOR */ +/* */ +/* Chaoqiong Xiao, Microsoft Corporation */ +/* */ +/* DESCRIPTION */ +/* */ +/* This function checks errors in device stack initialization */ +/* function call. */ +/* */ +/* INPUT */ +/* */ +/* class_name Name of class */ +/* class_function_entry Class entry function */ +/* */ +/* OUTPUT */ +/* */ +/* None */ +/* */ +/* CALLS */ +/* */ +/* _ux_device_stack_initialize Device Stack Initialize */ +/* */ +/* CALLED BY */ +/* */ +/* Application */ +/* */ +/* RELEASE HISTORY */ +/* */ +/* DATE NAME DESCRIPTION */ +/* */ +/* xx-xx-xxxx Chaoqiong Xiao Initial Version 6.x */ +/* */ +/**************************************************************************/ +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, + UCHAR * string_framework, ULONG string_framework_length, + UCHAR * language_id_framework, ULONG language_id_framework_length, + UINT (*ux_system_slave_change_function)(ULONG)) +{ + + /* Sanity checks. */ + if (((device_framework_high_speed == UX_NULL) && (device_framework_length_high_speed != 0)) || + (device_framework_full_speed == UX_NULL) || (device_framework_length_full_speed == 0) || + ((string_framework == UX_NULL) && (string_framework_length != 0)) || + (language_id_framework == UX_NULL) || (language_id_framework_length == 0)) + return(UX_INVALID_PARAMETER); + + /* Invoke stack initialize function. */ + return(_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_system_slave_change_function)); +} diff --git a/common/core/src/ux_host_stack_class_get.c b/common/core/src/ux_host_stack_class_get.c index bb57f3e..9f52c22 100644 --- a/common/core/src/ux_host_stack_class_get.c +++ b/common/core/src/ux_host_stack_class_get.c @@ -34,7 +34,7 @@ /* FUNCTION RELEASE */ /* */ /* _ux_host_stack_class_get PORTABLE C */ -/* 6.1 */ +/* 6.x */ /* AUTHOR */ /* */ /* Chaoqiong Xiao, Microsoft Corporation */ @@ -52,7 +52,7 @@ /* INPUT */ /* */ /* class_name Name of class */ -/* class Class pointer */ +/* host_class Class pointer */ /* */ /* OUTPUT */ /* */ @@ -78,6 +78,8 @@ /* optimized based on compile */ /* definitions, */ /* resulting in version 6.1 */ +/* xx-xx-xxxx Chaoqiong Xiao Modified comment(s), */ +/* resulting in version 6.x */ /* */ /**************************************************************************/ UINT _ux_host_stack_class_get(UCHAR *class_name, UX_HOST_CLASS **host_class) @@ -137,3 +139,52 @@ ULONG class_index; return(UX_HOST_CLASS_UNKNOWN); } + +/**************************************************************************/ +/* */ +/* FUNCTION RELEASE */ +/* */ +/* _uxe_host_stack_class_get PORTABLE C */ +/* 6.x */ +/* AUTHOR */ +/* */ +/* Chaoqiong Xiao, Microsoft Corporation */ +/* */ +/* DESCRIPTION */ +/* */ +/* This function checks errors in host stack class get function call. */ +/* */ +/* INPUT */ +/* */ +/* class_name Name of class */ +/* host_class Class pointer */ +/* */ +/* OUTPUT */ +/* */ +/* None */ +/* */ +/* CALLS */ +/* */ +/* _ux_host_stack_class_get Host stack class get */ +/* */ +/* CALLED BY */ +/* */ +/* Application */ +/* */ +/* RELEASE HISTORY */ +/* */ +/* DATE NAME DESCRIPTION */ +/* */ +/* xx-xx-xxxx Chaoqiong Xiao Initial Version 6.x */ +/* */ +/**************************************************************************/ +UINT _uxe_host_stack_class_get(UCHAR *class_name, UX_HOST_CLASS **host_class) +{ + + /* Sanity checks. */ + if ((class_name == UX_NULL) || (host_class == UX_NULL)) + return(UX_INVALID_PARAMETER); + + /* Invoke class get function. */ + return(_ux_host_stack_class_get(class_name, host_class)); +} diff --git a/common/core/src/ux_host_stack_class_instance_get.c b/common/core/src/ux_host_stack_class_instance_get.c index 63b63f0..fbdf2a0 100644 --- a/common/core/src/ux_host_stack_class_instance_get.c +++ b/common/core/src/ux_host_stack_class_instance_get.c @@ -113,3 +113,54 @@ VOID **current_class_instance; return(UX_SUCCESS); } + +/**************************************************************************/ +/* */ +/* FUNCTION RELEASE */ +/* */ +/* _uxe_host_stack_class_instance_get PORTABLE C */ +/* 6.x */ +/* AUTHOR */ +/* */ +/* Chaoqiong Xiao, Microsoft Corporation */ +/* */ +/* DESCRIPTION */ +/* */ +/* This function checks errors in host stack class get function call. */ +/* */ +/* INPUT */ +/* */ +/* class Pointer to class */ +/* class_index Index of class */ +/* class_instance Destination of class instance */ +/* pointer */ +/* */ +/* OUTPUT */ +/* */ +/* None */ +/* */ +/* CALLS */ +/* */ +/* _ux_host_stack_class_instance_get Host stack class instance get */ +/* */ +/* CALLED BY */ +/* */ +/* Application */ +/* */ +/* RELEASE HISTORY */ +/* */ +/* DATE NAME DESCRIPTION */ +/* */ +/* xx-xx-xxxx Chaoqiong Xiao Initial Version 6.x */ +/* */ +/**************************************************************************/ +UINT _uxe_host_stack_class_instance_get(UX_HOST_CLASS *host_class, UINT class_index, VOID **class_instance) +{ + + /* Sanity check. */ + if ((host_class == UX_NULL) || (class_instance == UX_NULL)) + return(UX_INVALID_PARAMETER); + + /* Invoke class instance get function. */ + return(_ux_host_stack_class_instance_get(host_class, class_index, class_instance)); +} diff --git a/common/core/src/ux_host_stack_class_register.c b/common/core/src/ux_host_stack_class_register.c index d8570db..fdbb034 100644 --- a/common/core/src/ux_host_stack_class_register.c +++ b/common/core/src/ux_host_stack_class_register.c @@ -173,3 +173,55 @@ ULONG class_index; /* No more entries in the class table. */ return(UX_MEMORY_ARRAY_FULL); } + + +/**************************************************************************/ +/* */ +/* FUNCTION RELEASE */ +/* */ +/* _uxe_host_stack_class_register PORTABLE C */ +/* 6.x */ +/* AUTHOR */ +/* */ +/* Chaoqiong Xiao, Microsoft Corporation */ +/* */ +/* DESCRIPTION */ +/* */ +/* This function checks errors in host stack class register function */ +/* call. */ +/* */ +/* INPUT */ +/* */ +/* class_name Name of class */ +/* class_entry_function Entry function of the class */ +/* */ +/* OUTPUT */ +/* */ +/* None */ +/* */ +/* CALLS */ +/* */ +/* _ux_host_stack_class_instance_get Host stack class instance get */ +/* */ +/* CALLED BY */ +/* */ +/* Application */ +/* */ +/* RELEASE HISTORY */ +/* */ +/* DATE NAME DESCRIPTION */ +/* */ +/* xx-xx-xxxx Chaoqiong Xiao Initial Version 6.x */ +/* */ +/**************************************************************************/ +UINT _uxe_host_stack_class_register(UCHAR *class_name, + UINT (*class_entry_function)(struct UX_HOST_CLASS_COMMAND_STRUCT *)) +{ + + /* Sanity checks. */ + if ((class_name == UX_NULL) || (class_entry_function == UX_NULL)) + return(UX_INVALID_PARAMETER); + + /* Invoke class register function. */ + return(_ux_host_stack_class_register(class_name, class_entry_function)); +} 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 90b41e4..b18444e 100644 --- a/common/core/src/ux_host_stack_configuration_interface_get.c +++ b/common/core/src/ux_host_stack_configuration_interface_get.c @@ -187,3 +187,59 @@ UX_INTERFACE *current_interface; return(UX_INTERFACE_HANDLE_UNKNOWN); } + +/**************************************************************************/ +/* */ +/* FUNCTION RELEASE */ +/* */ +/* _uxe_host_stack_configuration_interface_get PORTABLE C */ +/* 6.x */ +/* AUTHOR */ +/* */ +/* Chaoqiong Xiao, Microsoft Corporation */ +/* */ +/* DESCRIPTION */ +/* */ +/* This function checks errors in host stack interface get function */ +/* call. */ +/* */ +/* INPUT */ +/* */ +/* configuration Pointer to configuration */ +/* interface_index Index of interface */ +/* alternate_setting_index Index of alternate setting */ +/* interface Destination of interface */ +/* */ +/* OUTPUT */ +/* */ +/* None */ +/* */ +/* CALLS */ +/* */ +/* _ux_host_stack_configuration_interface_get */ +/* Host stack interface get */ +/* */ +/* CALLED BY */ +/* */ +/* Application */ +/* */ +/* RELEASE HISTORY */ +/* */ +/* DATE NAME DESCRIPTION */ +/* */ +/* xx-xx-xxxx Chaoqiong Xiao Initial Version 6.x */ +/* */ +/**************************************************************************/ +UINT _uxe_host_stack_configuration_interface_get(UX_CONFIGURATION *configuration, + UINT interface_index, UINT alternate_setting_index, + UX_INTERFACE **ux_interface) +{ + + /* Sanity checks. */ + if ((configuration == UX_NULL) || (ux_interface == UX_NULL)) + return(UX_INVALID_PARAMETER); + + /* Invoke interface get function. */ + return(_ux_host_stack_configuration_interface_get(configuration, + interface_index, alternate_setting_index, ux_interface)); +} 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 fc7b8ee..06b4fd8 100644 --- a/common/core/src/ux_host_stack_device_configuration_activate.c +++ b/common/core/src/ux_host_stack_device_configuration_activate.c @@ -184,3 +184,54 @@ UINT status; /* Return completion status. */ return(status); } + + +/**************************************************************************/ +/* */ +/* FUNCTION RELEASE */ +/* */ +/* _uxe_host_stack_device_configuration_activate PORTABLE C */ +/* 6.x */ +/* AUTHOR */ +/* */ +/* Chaoqiong Xiao, Microsoft Corporation */ +/* */ +/* DESCRIPTION */ +/* */ +/* This function checks errors in host stack configuration activate */ +/* function call. */ +/* */ +/* INPUT */ +/* */ +/* configuration Pointer to configuration */ +/* */ +/* OUTPUT */ +/* */ +/* None */ +/* */ +/* CALLS */ +/* */ +/* _ux_host_stack_device_configuration_activate */ +/* Host stack config activate */ +/* */ +/* CALLED BY */ +/* */ +/* Application */ +/* */ +/* RELEASE HISTORY */ +/* */ +/* DATE NAME DESCRIPTION */ +/* */ +/* xx-xx-xxxx Chaoqiong Xiao Initial Version 6.x */ +/* */ +/**************************************************************************/ +UINT _uxe_host_stack_device_configuration_activate(UX_CONFIGURATION *configuration) +{ + + /* Sanity check. */ + if (configuration == UX_NULL) + return(UX_INVALID_PARAMETER); + + /* Invoke configuration activate function. */ + return(_ux_host_stack_device_configuration_activate(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 ca25fcc..69198bd 100644 --- a/common/core/src/ux_host_stack_device_configuration_deactivate.c +++ b/common/core/src/ux_host_stack_device_configuration_deactivate.c @@ -193,3 +193,54 @@ UINT status; /* Return completion status. */ return(status); } + + +/**************************************************************************/ +/* */ +/* FUNCTION RELEASE */ +/* */ +/* _uxe_host_stack_device_configuration_deactivate PORTABLE C */ +/* 6.x */ +/* AUTHOR */ +/* */ +/* Chaoqiong Xiao, Microsoft Corporation */ +/* */ +/* DESCRIPTION */ +/* */ +/* This function checks errors in host stack configuration deactivate */ +/* function call. */ +/* */ +/* INPUT */ +/* */ +/* device Pointer to device */ +/* */ +/* OUTPUT */ +/* */ +/* None */ +/* */ +/* CALLS */ +/* */ +/* _ux_host_stack_device_configuration_deactivate */ +/* Host stack config deactivate */ +/* */ +/* CALLED BY */ +/* */ +/* Application */ +/* */ +/* RELEASE HISTORY */ +/* */ +/* DATE NAME DESCRIPTION */ +/* */ +/* xx-xx-xxxx Chaoqiong Xiao Initial Version 6.x */ +/* */ +/**************************************************************************/ +UINT _uxe_host_stack_device_configuration_deactivate(UX_DEVICE *device) +{ + + /* Sanity check. */ + if (device == UX_NULL) + return(UX_INVALID_PARAMETER); + + /* Invoke configuration deactivate function. */ + return(_ux_host_stack_device_configuration_deactivate(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 7b8d952..cb47600 100644 --- a/common/core/src/ux_host_stack_device_configuration_get.c +++ b/common/core/src/ux_host_stack_device_configuration_get.c @@ -134,3 +134,56 @@ UX_CONFIGURATION *current_configuration; return(UX_CONFIGURATION_HANDLE_UNKNOWN); } + +/**************************************************************************/ +/* */ +/* FUNCTION RELEASE */ +/* */ +/* _uxe_host_stack_device_configuration_get PORTABLE C */ +/* 6.x */ +/* AUTHOR */ +/* */ +/* Chaoqiong Xiao, Microsoft Corporation */ +/* */ +/* DESCRIPTION */ +/* */ +/* This function checks errors in host stack config get function call. */ +/* */ +/* INPUT */ +/* */ +/* device Pointer to device */ +/* configuration_index Index of configuration */ +/* configuration Pointer to configuration */ +/* destination */ +/* */ +/* OUTPUT */ +/* */ +/* None */ +/* */ +/* CALLS */ +/* */ +/* _ux_host_stack_device_configuration_get */ +/* Host configuration get */ +/* */ +/* CALLED BY */ +/* */ +/* Application */ +/* */ +/* RELEASE HISTORY */ +/* */ +/* DATE NAME DESCRIPTION */ +/* */ +/* xx-xx-xxxx Chaoqiong Xiao Initial Version 6.x */ +/* */ +/**************************************************************************/ +UINT _uxe_host_stack_device_configuration_get(UX_DEVICE *device, UINT configuration_index, + UX_CONFIGURATION **configuration) +{ + + /* Sanity checks. */ + if ((device == UX_NULL) || (configuration == UX_NULL)) + return(UX_INVALID_PARAMETER); + + /* Invoke configuration get function. */ + return(_ux_host_stack_device_configuration_get(device, configuration_index, configuration)); +} diff --git a/common/core/src/ux_host_stack_device_get.c b/common/core/src/ux_host_stack_device_get.c index 82dd9c4..de20f99 100644 --- a/common/core/src/ux_host_stack_device_get.c +++ b/common/core/src/ux_host_stack_device_get.c @@ -148,3 +148,53 @@ ULONG current_device_index; /* Return error. */ return(UX_DEVICE_HANDLE_UNKNOWN); } + + +/**************************************************************************/ +/* */ +/* FUNCTION RELEASE */ +/* */ +/* _uxe_host_stack_device_get PORTABLE C */ +/* 6.x */ +/* AUTHOR */ +/* */ +/* Chaoqiong Xiao, Microsoft Corporation */ +/* */ +/* DESCRIPTION */ +/* */ +/* This function checks errors in host stack device get function call. */ +/* */ +/* INPUT */ +/* */ +/* device_index Index of device */ +/* device Destination for device pointer*/ +/* */ +/* OUTPUT */ +/* */ +/* None */ +/* */ +/* CALLS */ +/* */ +/* _ux_host_stack_device_get Host stack device get */ +/* */ +/* CALLED BY */ +/* */ +/* Application */ +/* */ +/* RELEASE HISTORY */ +/* */ +/* DATE NAME DESCRIPTION */ +/* */ +/* xx-xx-xxxx Chaoqiong Xiao Initial Version 6.x */ +/* */ +/**************************************************************************/ +UINT _uxe_host_stack_device_get(ULONG device_index, UX_DEVICE **device) +{ + + /* Sanity check. */ + if (device == UX_NULL) + return(UX_INVALID_PARAMETER); + + /* Invoke device get function. */ + return(_ux_host_stack_device_get(device_index, device)); +} diff --git a/common/core/src/ux_host_stack_device_string_get.c b/common/core/src/ux_host_stack_device_string_get.c index 6389cb2..2c44a31 100644 --- a/common/core/src/ux_host_stack_device_string_get.c +++ b/common/core/src/ux_host_stack_device_string_get.c @@ -147,3 +147,59 @@ UINT status; /* Return completion status. */ return(status); } + + +/**************************************************************************/ +/* */ +/* FUNCTION RELEASE */ +/* */ +/* _uxe_host_stack_device_string_get PORTABLE C */ +/* 6.x */ +/* AUTHOR */ +/* */ +/* Chaoqiong Xiao, Microsoft Corporation */ +/* */ +/* DESCRIPTION */ +/* */ +/* This function checks errors in host stack device get function call. */ +/* */ +/* INPUT */ +/* */ +/* device Pointer to device instance */ +/* descriptor_buffer Pointer to a buffer to fill */ +/* LANGID or STRING descriptor */ +/* length Length of buffer */ +/* language_id 0 to obtain LANGID descriptor */ +/* valid language ID to obtain */ +/* string descriptor */ +/* string_index Index of the string */ +/* */ +/* OUTPUT */ +/* */ +/* None */ +/* */ +/* CALLS */ +/* */ +/* _ux_host_stack_device_string_get String descriptor get */ +/* */ +/* CALLED BY */ +/* */ +/* Application */ +/* */ +/* RELEASE HISTORY */ +/* */ +/* DATE NAME DESCRIPTION */ +/* */ +/* xx-xx-xxxx Chaoqiong Xiao Initial Version 6.x */ +/* */ +/**************************************************************************/ +UINT _uxe_host_stack_device_string_get(UX_DEVICE *device, UCHAR *descriptor_buffer, ULONG length, ULONG language_id, ULONG string_index) +{ + + /* Sanity check. */ + if ((device == UX_NULL) || (descriptor_buffer == UX_NULL) || (length == 0)) + return(UX_INVALID_PARAMETER); + + /* Invoke string descriptor get function. */ + return(_ux_host_stack_device_string_get(device, descriptor_buffer, length, language_id, string_index)); +} diff --git a/common/core/src/ux_host_stack_endpoint_transfer_abort.c b/common/core/src/ux_host_stack_endpoint_transfer_abort.c index ba6edc2..fdef80b 100644 --- a/common/core/src/ux_host_stack_endpoint_transfer_abort.c +++ b/common/core/src/ux_host_stack_endpoint_transfer_abort.c @@ -92,3 +92,53 @@ UINT status; return(status); } + +/**************************************************************************/ +/* */ +/* FUNCTION RELEASE */ +/* */ +/* _uxe_host_stack_endpoint_transfer_abort PORTABLE C */ +/* 6.x */ +/* AUTHOR */ +/* */ +/* Chaoqiong Xiao, Microsoft Corporation */ +/* */ +/* DESCRIPTION */ +/* */ +/* This function checks errors in host stack endpoint transfer abort */ +/* function call. */ +/* */ +/* INPUT */ +/* */ +/* endpoint Endpoint to abort transfer */ +/* */ +/* OUTPUT */ +/* */ +/* None */ +/* */ +/* CALLS */ +/* */ +/* _ux_host_stack_endpoint_transfer_abort */ +/* Endpoint transfer abort */ +/* */ +/* CALLED BY */ +/* */ +/* Application */ +/* */ +/* RELEASE HISTORY */ +/* */ +/* DATE NAME DESCRIPTION */ +/* */ +/* xx-xx-xxxx Chaoqiong Xiao Initial Version 6.x */ +/* */ +/**************************************************************************/ +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_hcd_register.c b/common/core/src/ux_host_stack_hcd_register.c index 5894b6a..cd9f868 100644 --- a/common/core/src/ux_host_stack_hcd_register.c +++ b/common/core/src/ux_host_stack_hcd_register.c @@ -157,3 +157,53 @@ ULONG hcd_index; return(UX_MEMORY_INSUFFICIENT); } + +/**************************************************************************/ +/* */ +/* FUNCTION RELEASE */ +/* */ +/* _uxe_host_stack_hcd_register PORTABLE C */ +/* 6.x */ +/* AUTHOR */ +/* */ +/* Chaoqiong Xiao, Microsoft Corporation */ +/* */ +/* DESCRIPTION */ +/* */ +/* This function checks errors in host stack HCD register function */ +/* call. */ +/* */ +/* INPUT */ +/* */ +/* endpoint Endpoint to abort transfer */ +/* */ +/* OUTPUT */ +/* */ +/* None */ +/* */ +/* CALLS */ +/* */ +/* _ux_host_stack_hcd_register HCD register */ +/* */ +/* CALLED BY */ +/* */ +/* Application */ +/* */ +/* RELEASE HISTORY */ +/* */ +/* DATE NAME DESCRIPTION */ +/* */ +/* xx-xx-xxxx Chaoqiong Xiao Initial Version 6.x */ +/* */ +/**************************************************************************/ +UINT _uxe_host_stack_hcd_register(UCHAR *hcd_name, + UINT (*hcd_init_function)(struct UX_HCD_STRUCT *), ULONG hcd_param1, ULONG hcd_param2) +{ + + /* Sanity check. */ + if ((hcd_name == UX_NULL) || (hcd_init_function == UX_NULL)) + return(UX_INVALID_PARAMETER); + + /* Invoke HCD register function. */ + return(_ux_host_stack_hcd_register(hcd_name, hcd_init_function, hcd_param1, hcd_param2)); +} diff --git a/common/core/src/ux_host_stack_hcd_unregister.c b/common/core/src/ux_host_stack_hcd_unregister.c index 277cf1a..9baed92 100644 --- a/common/core/src/ux_host_stack_hcd_unregister.c +++ b/common/core/src/ux_host_stack_hcd_unregister.c @@ -195,3 +195,56 @@ UINT hcd_name_length = 0; return(UX_SUCCESS); } + + +/**************************************************************************/ +/* */ +/* FUNCTION RELEASE */ +/* */ +/* _uxe_host_stack_hcd_unregister PORTABLE C */ +/* 6.x */ +/* AUTHOR */ +/* */ +/* Chaoqiong Xiao, Microsoft Corporation */ +/* */ +/* DESCRIPTION */ +/* */ +/* This function checks errors in host stack HCD unregister function */ +/* call. */ +/* */ +/* INPUT */ +/* */ +/* hcd_name Name of HCD to unregister */ +/* hcd_param1 Parameter 1 of HCD */ +/* hcd_param2 Parameter 2 of HCD */ +/* */ +/* OUTPUT */ +/* */ +/* None */ +/* */ +/* CALLS */ +/* */ +/* _ux_host_stack_hcd_unregister HCD unregister */ +/* */ +/* CALLED BY */ +/* */ +/* Application */ +/* */ +/* RELEASE HISTORY */ +/* */ +/* DATE NAME DESCRIPTION */ +/* */ +/* xx-xx-xxxx Chaoqiong Xiao Initial Version 6.x */ +/* */ +/**************************************************************************/ +UINT _uxe_host_stack_hcd_unregister(UCHAR *hcd_name, + ULONG hcd_param1, ULONG hcd_param2) +{ + + /* Sanity check. */ + if (hcd_name == UX_NULL) + return(UX_INVALID_PARAMETER); + + /* Invoke HCD unregister function. */ + return(_ux_host_stack_hcd_unregister(hcd_name, hcd_param1, hcd_param2)); +} 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 c039073..9bec702 100644 --- a/common/core/src/ux_host_stack_interface_endpoint_get.c +++ b/common/core/src/ux_host_stack_interface_endpoint_get.c @@ -136,3 +136,54 @@ UX_ENDPOINT *current_endpoint; return(UX_ENDPOINT_HANDLE_UNKNOWN); } + +/**************************************************************************/ +/* */ +/* FUNCTION RELEASE */ +/* */ +/* _uxe_host_stack_interface_endpoint_get PORTABLE C */ +/* 6.x */ +/* AUTHOR */ +/* */ +/* Chaoqiong Xiao, Microsoft Corporation */ +/* */ +/* DESCRIPTION */ +/* */ +/* This function checks errors in host stack endpoint get function */ +/* call. */ +/* */ +/* INPUT */ +/* */ +/* interface_ptr Pointer to interface */ +/* endpoint_index Index of endpoint to get */ +/* endpoint Destination for endpoint */ +/* */ +/* OUTPUT */ +/* */ +/* None */ +/* */ +/* CALLS */ +/* */ +/* _ux_host_stack_interface_endpoint_get Endpoint get */ +/* */ +/* CALLED BY */ +/* */ +/* Application */ +/* */ +/* RELEASE HISTORY */ +/* */ +/* DATE NAME DESCRIPTION */ +/* */ +/* xx-xx-xxxx Chaoqiong Xiao Initial Version 6.x */ +/* */ +/**************************************************************************/ +UINT _uxe_host_stack_interface_endpoint_get(UX_INTERFACE *interface_ptr, UINT endpoint_index, UX_ENDPOINT **endpoint) +{ + + /* Sanity checks. */ + if ((interface_ptr == UX_NULL) || (endpoint == UX_NULL)) + return(UX_INVALID_PARAMETER); + + /* Invoke endpoint get function. */ + return(_ux_host_stack_interface_endpoint_get(interface_ptr, endpoint_index, endpoint)); +} diff --git a/common/core/src/ux_host_stack_interface_setting_select.c b/common/core/src/ux_host_stack_interface_setting_select.c index 663cacd..fd96be9 100644 --- a/common/core/src/ux_host_stack_interface_setting_select.c +++ b/common/core/src/ux_host_stack_interface_setting_select.c @@ -215,3 +215,53 @@ UINT status; return(status); } + +/**************************************************************************/ +/* */ +/* FUNCTION RELEASE */ +/* */ +/* _uxe_host_stack_interface_setting_select PORTABLE C */ +/* 6.x */ +/* AUTHOR */ +/* */ +/* Chaoqiong Xiao, Microsoft Corporation */ +/* */ +/* DESCRIPTION */ +/* */ +/* This function checks errors in host stack interface select function */ +/* call. */ +/* */ +/* INPUT */ +/* */ +/* interface_ptr Pointer to interface */ +/* */ +/* OUTPUT */ +/* */ +/* None */ +/* */ +/* CALLS */ +/* */ +/* _ux_host_stack_interface_setting_select */ +/* Interface setting select */ +/* */ +/* CALLED BY */ +/* */ +/* Application */ +/* */ +/* RELEASE HISTORY */ +/* */ +/* DATE NAME DESCRIPTION */ +/* */ +/* xx-xx-xxxx Chaoqiong Xiao Initial Version 6.x */ +/* */ +/**************************************************************************/ +UINT _uxe_host_stack_interface_setting_select(UX_INTERFACE *interface_ptr) +{ + + /* Sanity check. */ + if (interface_ptr == UX_NULL) + return(UX_INVALID_PARAMETER); + + /* Invoke interface setting select function. */ + return(_ux_host_stack_interface_setting_select(interface_ptr)); +} diff --git a/common/core/src/ux_host_stack_transfer_request.c b/common/core/src/ux_host_stack_transfer_request.c index a93f532..876f528 100644 --- a/common/core/src/ux_host_stack_transfer_request.c +++ b/common/core/src/ux_host_stack_transfer_request.c @@ -217,3 +217,58 @@ UINT status; return(status); #endif } + + +/**************************************************************************/ +/* */ +/* FUNCTION RELEASE */ +/* */ +/* _uxe_host_stack_transfer_request PORTABLE C */ +/* 6.x */ +/* AUTHOR */ +/* */ +/* Chaoqiong Xiao, Microsoft Corporation */ +/* */ +/* DESCRIPTION */ +/* */ +/* This function checks errors in host stack transfer function call. */ +/* */ +/* INPUT */ +/* */ +/* transfer_request Pointer to transfer */ +/* */ +/* OUTPUT */ +/* */ +/* None */ +/* */ +/* CALLS */ +/* */ +/* _ux_host_stack_transfer_request Issue a transfer request */ +/* */ +/* CALLED BY */ +/* */ +/* Application */ +/* */ +/* RELEASE HISTORY */ +/* */ +/* DATE NAME DESCRIPTION */ +/* */ +/* xx-xx-xxxx Chaoqiong Xiao Initial Version 6.x */ +/* */ +/**************************************************************************/ +UINT _uxe_host_stack_transfer_request(UX_TRANSFER *transfer_request) +{ + + /* Sanity checks. */ + if (transfer_request == UX_NULL) + return(UX_INVALID_PARAMETER); + if (transfer_request -> ux_transfer_request_endpoint == UX_NULL) + return(UX_ENDPOINT_HANDLE_UNKNOWN); + if (transfer_request -> ux_transfer_request_endpoint -> ux_endpoint_device == UX_NULL) + return(UX_DEVICE_HANDLE_UNKNOWN); + if (UX_DEVICE_HCD_GET(transfer_request -> ux_transfer_request_endpoint -> ux_endpoint_device) == UX_NULL) + return(UX_INVALID_PARAMETER); + + /* Invoke transfer request function. */ + return(_ux_host_stack_transfer_request(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 ad1c5f7..ea84afd 100644 --- a/common/core/src/ux_host_stack_transfer_request_abort.c +++ b/common/core/src/ux_host_stack_transfer_request_abort.c @@ -147,3 +147,58 @@ ULONG completion_code; return(UX_SUCCESS); } + +/**************************************************************************/ +/* */ +/* FUNCTION RELEASE */ +/* */ +/* _uxe_host_stack_transfer_request_abort PORTABLE C */ +/* 6.x */ +/* AUTHOR */ +/* */ +/* Chaoqiong Xiao, Microsoft Corporation */ +/* */ +/* DESCRIPTION */ +/* */ +/* This function checks errors in host stack transfer abort function */ +/* call. */ +/* */ +/* INPUT */ +/* */ +/* transfer_request Pointer to transfer */ +/* */ +/* OUTPUT */ +/* */ +/* None */ +/* */ +/* CALLS */ +/* */ +/* _ux_host_stack_transfer_request_abort Transfer abort */ +/* */ +/* CALLED BY */ +/* */ +/* Application */ +/* */ +/* RELEASE HISTORY */ +/* */ +/* DATE NAME DESCRIPTION */ +/* */ +/* xx-xx-xxxx Chaoqiong Xiao Initial Version 6.x */ +/* */ +/**************************************************************************/ +UINT _uxe_host_stack_transfer_request_abort(UX_TRANSFER *transfer_request) +{ + + /* Sanity checks. */ + if (transfer_request == UX_NULL) + return(UX_INVALID_PARAMETER); + if (transfer_request -> ux_transfer_request_endpoint == UX_NULL) + return(UX_ENDPOINT_HANDLE_UNKNOWN); + if (transfer_request -> ux_transfer_request_endpoint -> ux_endpoint_device == UX_NULL) + return(UX_DEVICE_HANDLE_UNKNOWN); + if (UX_DEVICE_HCD_GET(transfer_request -> ux_transfer_request_endpoint -> ux_endpoint_device) == UX_NULL) + return(UX_INVALID_PARAMETER); + + /* Invoke transfer abort function. */ + return(_ux_host_stack_transfer_request_abort(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 0acf14a..c9478db 100644 --- a/common/core/src/ux_host_stack_transfer_run.c +++ b/common/core/src/ux_host_stack_transfer_run.c @@ -293,4 +293,59 @@ UX_TRANSFER *previous; ux_endpoint_device -> ux_device_flags &= ~UX_DEVICE_FLAG_LOCK; } } + + +/**************************************************************************/ +/* */ +/* FUNCTION RELEASE */ +/* */ +/* _uxe_host_stack_transfer_run PORTABLE C */ +/* 6.x */ +/* AUTHOR */ +/* */ +/* Chaoqiong Xiao, Microsoft Corporation */ +/* */ +/* DESCRIPTION */ +/* */ +/* This function checks errors in host stack transfer function call. */ +/* */ +/* INPUT */ +/* */ +/* transfer_request Pointer to transfer */ +/* */ +/* OUTPUT */ +/* */ +/* None */ +/* */ +/* CALLS */ +/* */ +/* _ux_host_stack_transfer_run Run a transfer request */ +/* */ +/* CALLED BY */ +/* */ +/* Application */ +/* */ +/* RELEASE HISTORY */ +/* */ +/* DATE NAME DESCRIPTION */ +/* */ +/* xx-xx-xxxx Chaoqiong Xiao Initial Version 6.x */ +/* */ +/**************************************************************************/ +UINT _uxe_host_stack_transfer_run(UX_TRANSFER *transfer_request) +{ + + /* Sanity checks. */ + if (transfer_request == UX_NULL) + return(UX_INVALID_PARAMETER); + if (transfer_request -> ux_transfer_request_endpoint == UX_NULL) + return(UX_ENDPOINT_HANDLE_UNKNOWN); + if (transfer_request -> ux_transfer_request_endpoint -> ux_endpoint_device == UX_NULL) + return(UX_DEVICE_HANDLE_UNKNOWN); + if (UX_DEVICE_HCD_GET(transfer_request -> ux_transfer_request_endpoint -> ux_endpoint_device) == UX_NULL) + return(UX_INVALID_PARAMETER); + + /* Invoke transfer request function. */ + return(_ux_host_stack_transfer_run(transfer_request)); +} #endif diff --git a/common/core/src/ux_system_initialize.c b/common/core/src/ux_system_initialize.c index 7d86290..f6f7202 100644 --- a/common/core/src/ux_system_initialize.c +++ b/common/core/src/ux_system_initialize.c @@ -268,3 +268,56 @@ UINT status; return(UX_SUCCESS); } + +/**************************************************************************/ +/* */ +/* FUNCTION RELEASE */ +/* */ +/* _uxe_system_initialize PORTABLE C */ +/* 6.x */ +/* AUTHOR */ +/* */ +/* Chaoqiong Xiao, Microsoft Corporation */ +/* */ +/* DESCRIPTION */ +/* */ +/* This function checks errors in system initialization function call. */ +/* */ +/* INPUT */ +/* */ +/* regular_memory_pool_start Start of non cached memory pool */ +/* regular_memory_size Size of non cached memory pool */ +/* cache_safe_memory_pool_start Start of cached memory pool */ +/* cache_safe_memory_size Size of cached memory pool */ +/* */ +/* OUTPUT */ +/* */ +/* None */ +/* */ +/* CALLS */ +/* */ +/* _ux_system_initialize Get encoded feedback */ +/* */ +/* CALLED BY */ +/* */ +/* Application */ +/* */ +/* RELEASE HISTORY */ +/* */ +/* DATE NAME DESCRIPTION */ +/* */ +/* xx-xx-xxxx Chaoqiong Xiao Initial Version 6.x */ +/* */ +/**************************************************************************/ +UINT _uxe_system_initialize(VOID *regular_memory_pool_start, ULONG regular_memory_size, + VOID *cache_safe_memory_pool_start, ULONG cache_safe_memory_size) +{ + + /* Sanity check. */ + if ((regular_memory_pool_start == UX_NULL) || (regular_memory_size == 0)) + return(UX_INVALID_PARAMETER); + + /* Invoke system initialization function. */ + return(_ux_system_initialize(regular_memory_pool_start, regular_memory_size, + cache_safe_memory_pool_start, cache_safe_memory_size)); +} |
