diff options
Diffstat (limited to 'common/core/inc')
| -rwxr-xr-x[-rw-r--r--] | common/core/inc/ux_api.h | 48 | ||||
| -rw-r--r-- | common/core/inc/ux_host_stack.h | 16 | ||||
| -rw-r--r-- | common/core/inc/ux_user_sample.h | 17 |
3 files changed, 69 insertions, 12 deletions
diff --git a/common/core/inc/ux_api.h b/common/core/inc/ux_api.h index 872f6cc..7932d79 100644..100755 --- 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.1.3 */ +/* 6.1.4 */ /* AUTHOR */ /* */ /* Chaoqiong Xiao, Microsoft Corporation */ @@ -71,6 +71,16 @@ /* 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 */ /* */ /**************************************************************************/ @@ -205,7 +215,7 @@ typedef signed char SCHAR; #define AZURE_RTOS_USBX #define USBX_MAJOR_VERSION 6 #define USBX_MINOR_VERSION 1 -#define USBX_PATCH_VERSION 3 +#define USBX_PATCH_VERSION 4 /* Macros for concatenating tokens, where UX_CONCATn concatenates n tokens. */ @@ -395,6 +405,9 @@ VOID _ux_trace_event_update(TX_TRACE_BUFFER_ENTRY *event, ULONG timestamp, UL #define UX_TRACE_HOST_STACK_HCD_UNREGISTER (UX_TRACE_HOST_STACK_EVENTS_BASE + 35) /* I1 = hcd name , I2 = parameter 1 , I3 = parameter 2 */ #define UX_TRACE_HOST_STACK_CLASS_REGISTER (UX_TRACE_HOST_STACK_EVENTS_BASE + 36) /* I1 = class name , I2 = entry function */ #define UX_TRACE_HOST_STACK_CLASS_UNREGISTER (UX_TRACE_HOST_STACK_EVENTS_BASE + 37) /* I1 = class entry */ +#define UX_TRACE_HOST_STACK_DEVICE_STRING_GET (UX_TRACE_HOST_STACK_EVENTS_BASE + 38) /* I1 = device , I2 = buffer , I3 = length , I4 = (langID<<16) | index */ +#define UX_TRACE_HOST_STACK_DEVICE_CONFIGURATION_ACTIVATE (UX_TRACE_HOST_STACK_EVENTS_BASE + 39) /* I1 = device , I2 = configuration */ +#define UX_TRACE_HOST_STACK_DEVICE_CONFIGURATION_DEACTIVATE (UX_TRACE_HOST_STACK_EVENTS_BASE + 40) /* I1 = device , I2 = configuration */ /* Define the USBX host class events. */ @@ -490,6 +503,7 @@ VOID _ux_trace_event_update(TX_TRACE_BUFFER_ENTRY *event, ULONG timestamp, UL #define UX_TRACE_HOST_CLASS_PRINTER_WRITE (UX_TRACE_HOST_CLASS_EVENTS_BASE + 104) /* I1 = class instance , I2 = data pointer , I3 = requested length */ #define UX_TRACE_HOST_CLASS_PRINTER_SOFT_RESET (UX_TRACE_HOST_CLASS_EVENTS_BASE + 105) /* I1 = class instance */ #define UX_TRACE_HOST_CLASS_PRINTER_STATUS_GET (UX_TRACE_HOST_CLASS_EVENTS_BASE + 106) /* I1 = class instance , I2 = printer status */ +#define UX_TRACE_HOST_CLASS_PRINTER_DEVICE_ID_GET (UX_TRACE_HOST_CLASS_EVENTS_BASE + 107) /* I1 = class instance , I2 = printer , I3 = data pointer , I4 = buffer length */ #define UX_TRACE_HOST_CLASS_PROLIFIC_ACTIVATE (UX_TRACE_HOST_CLASS_EVENTS_BASE + 110) /* I1 = class instance */ #define UX_TRACE_HOST_CLASS_PROLIFIC_DEACTIVATE (UX_TRACE_HOST_CLASS_EVENTS_BASE + 111) /* I1 = class instance */ @@ -1019,12 +1033,20 @@ VOID _ux_trace_event_update(TX_TRACE_BUFFER_ENTRY *event, ULONG timestamp, UL #define UX_TRANSFER_PHASE_STATUS_IN 4 #define UX_TRANSFER_PHASE_STATUS_OUT 5 -#define UX_DEVICE_INSERTION 1 -#define UX_DEVICE_REMOVAL 2 -#define UX_HID_CLIENT_INSERTION 3 -#define UX_HID_CLIENT_REMOVAL 4 -#define UX_STORAGE_MEDIA_INSERTION 5 -#define UX_STORAGE_MEDIA_REMOVAL 6 + +/* Host change callback events : _callback(event, *class, *instance) */ + +#define UX_DEVICE_INSERTION 0x01u +#define UX_DEVICE_REMOVAL 0x02u +#define UX_HID_CLIENT_INSERTION 0x03u +#define UX_HID_CLIENT_REMOVAL 0x04u +#define UX_STORAGE_MEDIA_INSERTION 0x05u +#define UX_STORAGE_MEDIA_REMOVAL 0x06u + +/* Host change callback events : _callback(event, NULL, *device_instance) */ + +#define UX_DEVICE_CONNECTION 0x81u +#define UX_DEVICE_DISCONNECTION 0x82u /* Define USBX transfer request status constants. */ @@ -1135,6 +1157,7 @@ VOID _ux_trace_event_update(TX_TRACE_BUFFER_ENTRY *event, ULONG timestamp, UL #define UX_MEMORY_CORRUPTED 0x19 #define UX_MEMORY_ARRAY_FULL 0x1a #define UX_FATAL_ERROR 0x1b +#define UX_ALREADY_ACTIVATED 0x1c #define UX_TRANSFER_STALLED 0x21 #define UX_TRANSFER_NO_ANSWER 0x22 @@ -1588,7 +1611,8 @@ typedef struct UX_DEVICE_STRUCT ULONG ux_device_address; ULONG ux_device_speed; ULONG ux_device_power_source; - UINT ux_device_current_configuration; + struct UX_CONFIGURATION_STRUCT + *ux_device_current_configuration; UX_SEMAPHORE ux_device_protection_semaphore; struct UX_HOST_CLASS_STRUCT *ux_device_class; @@ -2232,9 +2256,12 @@ typedef struct UX_HOST_CLASS_DPUMP_STRUCT #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 @@ -2303,9 +2330,12 @@ UINT ux_host_stack_class_register(UCHAR *class_name, UINT (*class_entry_funct UINT ux_host_stack_class_unregister(UINT (*class_entry_function)(struct UX_HOST_CLASS_COMMAND_STRUCT *)); UINT ux_host_stack_configuration_interface_get(UX_CONFIGURATION *configuration, UINT interface_index, UINT alternate_setting_index, UX_INTERFACE **interface); +UINT ux_host_stack_device_configuration_activate(UX_CONFIGURATION *configuration); +UINT ux_host_stack_device_configuration_deactivate(UX_DEVICE *device); UINT ux_host_stack_device_configuration_get(UX_DEVICE *device, UINT configuration_index, UX_CONFIGURATION **configuration); UINT ux_host_stack_device_configuration_select(UX_CONFIGURATION *configuration); UINT ux_host_stack_device_get(ULONG device_index, UX_DEVICE **device); +UINT ux_host_stack_device_string_get(UX_DEVICE *device, UCHAR *descriptor_buffer, ULONG length, ULONG language_id, ULONG string_index); UINT ux_host_stack_endpoint_transfer_abort(UX_ENDPOINT *endpoint); UINT ux_host_stack_hcd_register(UCHAR *hcd_name, UINT (*hcd_initialize_function)(struct UX_HCD_STRUCT *), ULONG hcd_param1, ULONG hcd_param2); UINT ux_host_stack_hcd_unregister(UCHAR *hcd_name, ULONG hcd_param1, ULONG hcd_param2); diff --git a/common/core/inc/ux_host_stack.h b/common/core/inc/ux_host_stack.h index e17f9f1..a8bc131 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 */ +/* 6.1.4 */ /* AUTHOR */ /* */ /* Chaoqiong Xiao, Microsoft Corporation */ @@ -46,6 +46,13 @@ /* 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 */ /* */ /**************************************************************************/ @@ -83,15 +90,19 @@ VOID _ux_host_stack_configuration_instance_delete(UX_CONFIGURATION *configura UINT _ux_host_stack_configuration_interface_get(UX_CONFIGURATION *configuration, UINT interface_index, UINT alternate_setting_index, UX_INTERFACE **interface); +UINT _ux_host_stack_configuration_interface_scan(UX_CONFIGURATION *configuration); UINT _ux_host_stack_configuration_set(UX_CONFIGURATION *configuration); VOID _ux_host_stack_delay_ms(ULONG time); UINT _ux_host_stack_device_address_set(UX_DEVICE *device); +UINT _ux_host_stack_device_configuration_activate(UX_CONFIGURATION *configuration); +UINT _ux_host_stack_device_configuration_deactivate(UX_DEVICE *device); UINT _ux_host_stack_device_configuration_get(UX_DEVICE *device, UINT configuration_index, UX_CONFIGURATION **configuration); UINT _ux_host_stack_device_configuration_select(UX_CONFIGURATION *configuration); UINT _ux_host_stack_device_configuration_reset(UX_DEVICE *device); UINT _ux_host_stack_device_descriptor_read(UX_DEVICE *device); UINT _ux_host_stack_device_get(ULONG device_index, UX_DEVICE **device); +UINT _ux_host_stack_device_string_get(UX_DEVICE *device, UCHAR *descriptor_buffer, ULONG length, ULONG language_id, ULONG string_index); UINT _ux_host_stack_device_remove(UX_HCD *hcd, UX_DEVICE *parent, UINT port_index); UINT _ux_host_stack_device_resources_free(UX_DEVICE *device); UINT _ux_host_stack_endpoint_instance_create(UX_ENDPOINT *endpoint); @@ -116,7 +127,8 @@ VOID _ux_host_stack_new_configuration_create(UX_DEVICE *device, UX_CONFIGURAT UX_DEVICE *_ux_host_stack_new_device_get(VOID); UINT _ux_host_stack_new_device_create(UX_HCD *hcd, UX_DEVICE *device_owner, UINT port_index, UINT device_speed, - UINT port_max_power); + UINT port_max_power, + UX_DEVICE **created_device); UINT _ux_host_stack_new_endpoint_create(UX_INTERFACE *interface, UCHAR * interface_endpoint); UINT _ux_host_stack_new_interface_create(UX_CONFIGURATION *configuration, UCHAR * descriptor, ULONG length); VOID _ux_host_stack_rh_change_process(VOID); diff --git a/common/core/inc/ux_user_sample.h b/common/core/inc/ux_user_sample.h index 7f046fb..ea139cf 100644 --- a/common/core/inc/ux_user_sample.h +++ b/common/core/inc/ux_user_sample.h @@ -26,7 +26,7 @@ /* PORT SPECIFIC C INFORMATION RELEASE */ /* */ /* ux_user.h PORTABLE C */ -/* 6.1 */ +/* 6.1.4 */ /* */ /* AUTHOR */ /* */ @@ -47,6 +47,10 @@ /* 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 */ /* */ /**************************************************************************/ @@ -260,6 +264,17 @@ /* #define UX_HOST_CLASS_CDC_ECM_PACKET_POOL_WAIT 10 */ /* Defined, this value represents the number of milliseconds to wait for packet + pool availability checking loop. + The default is 100 milliseconds. +*/ + +/* #define UX_HOST_CLASS_CDC_ECM_PACKET_POOL_INSTANCE_WAIT 10 */ + +/* Defined, this enables CDC ECM class to use the packet pool from NetX instance. */ + +/* #define UX_HOST_CLASS_CDC_ECM_USE_PACKET_POOL_FROM_NETX */ + +/* Defined, this value represents the number of milliseconds to wait for packet allocation until invoking the application's error callback and retrying. */ |
