diff --git a/common/core/inc/ux_api.h b/common/core/inc/ux_api.h index 02201d39..bc8b40cc 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.8 */ +/* 6.1.9 */ /* AUTHOR */ /* */ /* Chaoqiong Xiao, Microsoft Corporation */ @@ -96,6 +96,11 @@ /* 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 */ /* */ /**************************************************************************/ @@ -149,7 +154,11 @@ typedef signed char SCHAR; /* This defines the ASSERT and process on ASSERT fail. */ #ifdef UX_ENABLE_ASSERT #ifndef UX_ASSERT_FAIL +#ifdef TX_API_H #define UX_ASSERT_FAIL for (;;) {tx_thread_sleep(UX_WAIT_FOREVER); } +#else +#define UX_ASSERT_FAIL for (;;) {} +#endif #endif #define UX_ASSERT(s) if (!(s)) {UX_ASSERT_FAIL} #else @@ -230,7 +239,7 @@ typedef signed char SCHAR; #define AZURE_RTOS_USBX #define USBX_MAJOR_VERSION 6 #define USBX_MINOR_VERSION 1 -#define USBX_PATCH_VERSION 8 +#define USBX_PATCH_VERSION 9 /* Macros for concatenating tokens, where UX_CONCATn concatenates n tokens. */ @@ -339,9 +348,6 @@ VOID _ux_utility_debug_log(UCHAR *debug_location, UCHAR *debug_message, ULONG de /* Determine if tracing is enabled. */ #ifdef TX_ENABLE_EVENT_TRACE -#ifndef UX_TRACE_INSERT_MACROS -#error UX_TRACE_INSERT_MACROS must be defined to support TX_ENABLE_EVENT_TRACE -#endif /* Trace is enabled. Remap calls so that interrupts can be disabled around the actual event logging. */ @@ -1912,6 +1918,7 @@ typedef struct UX_SLAVE_TRANSFER_STRUCT ULONG ux_slave_transfer_request_requested_length; ULONG ux_slave_transfer_request_actual_length; ULONG ux_slave_transfer_request_in_transfer_length; + ULONG ux_slave_transfer_request_transfer_length; ULONG ux_slave_transfer_request_completion_code; ULONG ux_slave_transfer_request_phase; VOID (*ux_slave_transfer_request_completion_function) (struct UX_SLAVE_TRANSFER_STRUCT *); diff --git a/common/core/inc/ux_user_sample.h b/common/core/inc/ux_user_sample.h index 89c0e7bc..d144b0df 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.8 */ +/* 6.1.9 */ /* */ /* AUTHOR */ /* */ @@ -65,6 +65,9 @@ /* 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 */ /* */ /**************************************************************************/ @@ -387,6 +390,14 @@ #define UX_DEBUG_LOG_SIZE (1024 * 16) +/* Defined, this enables the assert checks inside usbx. */ +#define UX_ENABLE_ASSERT + +/* Defined, this defines the assert action taken when failure detected. By default + it halts without any output. */ +/* #define UX_ASSERT_FAIL for (;;) {tx_thread_sleep(UX_WAIT_FOREVER); } */ + + /* DEBUG includes and macros for a specific platform go here. */ #ifdef UX_INCLUDE_USER_DEFINE_BSP #include "usb_bsp.h" 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 f2d0dca4..02072d07 100644 --- a/common/core/src/ux_dcd_sim_slave_initialize_complete.c +++ b/common/core/src/ux_dcd_sim_slave_initialize_complete.c @@ -34,7 +34,7 @@ /* FUNCTION RELEASE */ /* */ /* _ux_dcd_sim_slave_initialize_complete PORTABLE C */ -/* 6.1.6 */ +/* 6.1.9 */ /* AUTHOR */ /* */ /* Chaoqiong Xiao, Microsoft Corporation */ @@ -72,6 +72,9 @@ /* 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) @@ -137,6 +140,8 @@ UX_SLAVE_TRANSFER *transfer_request; /* On the control endpoint, always expect the maximum. */ 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; /* Attach the control endpoint to the transfer request. */ transfer_request -> ux_slave_transfer_request_endpoint = &device -> ux_slave_device_control_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 d48d506a..e4ad4439 100644 --- a/common/core/src/ux_device_stack_alternate_setting_set.c +++ b/common/core/src/ux_device_stack_alternate_setting_set.c @@ -34,7 +34,7 @@ /* FUNCTION RELEASE */ /* */ /* _ux_device_stack_alternate_setting_set PORTABLE C */ -/* 6.1 */ +/* 6.1.9 */ /* AUTHOR */ /* */ /* Chaoqiong Xiao, Microsoft Corporation */ @@ -78,6 +78,9 @@ /* 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 */ /* */ /**************************************************************************/ UINT _ux_device_stack_alternate_setting_set(ULONG interface_value, ULONG alternate_setting_value) @@ -101,6 +104,7 @@ ULONG endpoints_pool_number; UX_SLAVE_CLASS_COMMAND class_command; UX_SLAVE_CLASS *class; UINT status; +ULONG max_transfer_length, n_trans; #endif /* If trace is enabled, insert this event into the trace buffer. */ @@ -305,10 +309,34 @@ UINT status; _ux_system_endpoint_descriptor_structure, UX_ENDPOINT_DESCRIPTOR_ENTRIES, (UCHAR *) &endpoint -> ux_slave_endpoint_descriptor); - + /* 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); + + /* Calculate endpoint transfer payload max size. */ + max_transfer_length = + endpoint -> ux_slave_endpoint_descriptor.wMaxPacketSize & + UX_MAX_PACKET_SIZE_MASK; + if ((_ux_system_slave -> ux_system_slave_speed == UX_HIGH_SPEED_DEVICE) && + (endpoint -> ux_slave_endpoint_descriptor.bmAttributes & 0x1u)) + { + n_trans = endpoint -> ux_slave_endpoint_descriptor.wMaxPacketSize & + UX_MAX_NUMBER_OF_TRANSACTIONS_MASK; + if (n_trans) + { + n_trans >>= UX_MAX_NUMBER_OF_TRANSACTIONS_SHIFT; + n_trans ++; + max_transfer_length *= n_trans; + } + } + + /* Validate max transfer size and save it. */ + UX_ASSERT(max_transfer_length <= UX_SLAVE_REQUEST_DATA_MAX_LENGTH); + transfer_request -> ux_slave_transfer_request_transfer_length = max_transfer_length; + /* We store the endpoint in the transfer request as well. */ transfer_request -> ux_slave_transfer_request_endpoint = endpoint; 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 3386dfde..2ae50bef 100644 --- a/common/core/src/ux_device_stack_control_request_process.c +++ b/common/core/src/ux_device_stack_control_request_process.c @@ -33,7 +33,7 @@ /* FUNCTION RELEASE */ /* */ /* _ux_device_stack_control_request_process PORTABLE C */ -/* 6.1 */ +/* 6.1.9 */ /* AUTHOR */ /* */ /* Chaoqiong Xiao, Microsoft Corporation */ @@ -80,6 +80,10 @@ /* 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 */ /* */ /**************************************************************************/ UINT _ux_device_stack_control_request_process(UX_SLAVE_TRANSFER *transfer_request) @@ -138,6 +142,7 @@ ULONG application_data_length; /* 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, transfer_request -> ux_slave_transfer_request_data_pointer, @@ -155,9 +160,9 @@ ULONG application_data_length; /* Set the direction to OUT. */ transfer_request -> ux_slave_transfer_request_phase = UX_TRANSFER_PHASE_DATA_OUT; - + /* Perform the data transfer. */ - _ux_device_stack_transfer_request(transfer_request, request_length, application_data_length); + _ux_device_stack_transfer_request(transfer_request, application_data_length, request_length); /* We are done here. */ return(UX_SUCCESS); diff --git a/common/core/src/ux_device_stack_interface_set.c b/common/core/src/ux_device_stack_interface_set.c index 86708615..45b2e295 100644 --- a/common/core/src/ux_device_stack_interface_set.c +++ b/common/core/src/ux_device_stack_interface_set.c @@ -34,7 +34,7 @@ /* FUNCTION RELEASE */ /* */ /* _ux_device_stack_interface_set PORTABLE C */ -/* 6.1 */ +/* 6.1.9 */ /* AUTHOR */ /* */ /* Chaoqiong Xiao, Microsoft Corporation */ @@ -76,6 +76,9 @@ /* 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 */ /* */ /**************************************************************************/ UINT _ux_device_stack_interface_set(UCHAR * device_framework, ULONG device_framework_length, @@ -96,6 +99,7 @@ ULONG descriptor_length; UCHAR descriptor_type; ULONG endpoints_pool_number; UINT status; +ULONG max_transfer_length, n_trans; UX_PARAMETER_NOT_USED(alternate_setting_value); @@ -226,6 +230,30 @@ UINT status; /* 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); + + /* Calculate endpoint transfer payload max size. */ + max_transfer_length = + endpoint -> ux_slave_endpoint_descriptor.wMaxPacketSize & + UX_MAX_PACKET_SIZE_MASK; + if ((_ux_system_slave -> ux_system_slave_speed == UX_HIGH_SPEED_DEVICE) && + (endpoint -> ux_slave_endpoint_descriptor.bmAttributes & 0x1u)) + { + n_trans = endpoint -> ux_slave_endpoint_descriptor.wMaxPacketSize & + UX_MAX_NUMBER_OF_TRANSACTIONS_MASK; + if (n_trans) + { + n_trans >>= UX_MAX_NUMBER_OF_TRANSACTIONS_SHIFT; + n_trans ++; + max_transfer_length *= n_trans; + } + } + + /* Validate max transfer size and save it. */ + UX_ASSERT(max_transfer_length <= UX_SLAVE_REQUEST_DATA_MAX_LENGTH); + transfer_request -> ux_slave_transfer_request_transfer_length = max_transfer_length; + /* We store the endpoint in the transfer request as well. */ transfer_request -> ux_slave_transfer_request_endpoint = endpoint; 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 d48b0d74..0c961f1f 100644 --- a/common/core/src/ux_hcd_sim_host_request_isochronous_transfer.c +++ b/common/core/src/ux_hcd_sim_host_request_isochronous_transfer.c @@ -34,7 +34,7 @@ /* FUNCTION RELEASE */ /* */ /* _ux_hcd_sim_host_request_isochronous_transfer PORTABLE C */ -/* 6.1 */ +/* 6.1.9 */ /* AUTHOR */ /* */ /* Chaoqiong Xiao, Microsoft Corporation */ @@ -68,6 +68,9 @@ /* 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 */ /* */ /**************************************************************************/ UINT _ux_hcd_sim_host_request_isochronous_transfer(UX_HCD_SIM_HOST *hcd_sim_host, UX_TRANSFER *transfer_request) @@ -84,6 +87,7 @@ ULONG transfer_request_payload_length; ULONG isoch_packet_payload_length; UCHAR * data_pointer; ULONG current_frame_number; +ULONG n_trans, packet_size; /* Get the pointer to the Endpoint. */ @@ -95,7 +99,23 @@ ULONG current_frame_number; /* 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) - transfer_request -> ux_transfer_request_packet_length = (ULONG) endpoint -> ux_endpoint_descriptor.wMaxPacketSize; + { + + /* For wMaxPacketSize, bits 10..0 specify the maximum packet size (max 1024), + bits 12..11 specify the number of additional transactions (max 2), + the calculation below will not cause overflow using 32-bit operation. + Note wMaxPacketSize validation has been done in ux_host_stack_new_endpoint_create.c, + before endpoint creation, so the value can be directly used here. */ + packet_size = endpoint -> ux_endpoint_descriptor.wMaxPacketSize & UX_MAX_PACKET_SIZE_MASK; + n_trans = endpoint -> ux_endpoint_descriptor.wMaxPacketSize & UX_MAX_NUMBER_OF_TRANSACTIONS_MASK; + if (n_trans) + { + n_trans >>= UX_MAX_NUMBER_OF_TRANSACTIONS_SHIFT; + n_trans ++; + packet_size *= n_trans; + } + transfer_request -> ux_transfer_request_packet_length = packet_size; + } /* Remember the packet length. */ isoch_packet_payload_length = transfer_request -> ux_transfer_request_packet_length; 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 023de418..0a4562fa 100644 --- a/common/core/src/ux_hcd_sim_host_transaction_schedule.c +++ b/common/core/src/ux_hcd_sim_host_transaction_schedule.c @@ -36,7 +36,7 @@ /* FUNCTION RELEASE */ /* */ /* _ux_hcd_sim_host_transaction_schedule PORTABLE C */ -/* 6.1.6 */ +/* 6.1.9 */ /* AUTHOR */ /* */ /* Chaoqiong Xiao, Microsoft Corporation */ @@ -81,6 +81,10 @@ /* 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 */ /* */ /**************************************************************************/ UINT _ux_hcd_sim_host_transaction_schedule(UX_HCD_SIM_HOST *hcd_sim_host, UX_HCD_SIM_HOST_ED *ed) @@ -188,12 +192,16 @@ UX_SLAVE_DCD *dcd; the data needs to be copied into the device buffer first before invoking the control dispatcher. */ - /* Get the length we expect from the SETUP packet. */ + /* Get the length we expect from the SETUP packet (target the entire available control buffer). */ slave_transfer_request -> ux_slave_transfer_request_requested_length = _ux_utility_short_get(slave_transfer_request -> ux_slave_transfer_request_setup + 6); /* Avoid buffer overflow. */ if (slave_transfer_request -> ux_slave_transfer_request_requested_length > UX_SLAVE_REQUEST_CONTROL_MAX_LENGTH) + { + /* Error trap. */ + _ux_system_error_handler(UX_SYSTEM_LEVEL_THREAD, UX_SYSTEM_CONTEXT_DCD, UX_TRANSFER_BUFFER_OVERFLOW); slave_transfer_request -> ux_slave_transfer_request_requested_length = UX_SLAVE_REQUEST_CONTROL_MAX_LENGTH; + } /* Reset what we have received so far. */ slave_transfer_request -> ux_slave_transfer_request_actual_length = 0; @@ -424,7 +432,16 @@ UX_SLAVE_DCD *dcd; wake_slave = UX_FALSE; /* Does the slave have absolutely no more data to send? */ - if ((slave_transfer_request -> ux_slave_transfer_request_actual_length == slave_transfer_request -> ux_slave_transfer_request_requested_length && + if (slave_endpoint -> ux_slave_endpoint_descriptor.wMaxPacketSize == 0) /* Special for tests (avoid DIV0/MOD0) */ + { + + /* This happens only if device descriptor bMaxPacketSize0 is zero, assume it's OK for the first control + requests to let host check the descriptor. + If wMaxPacketSize is zero, host reject the device and transfer never started to get here. */ + wake_host = UX_TRUE; + wake_slave = UX_TRUE; + } + else if ((slave_transfer_request -> ux_slave_transfer_request_actual_length == slave_transfer_request -> ux_slave_transfer_request_requested_length && slave_transfer_request -> ux_slave_transfer_request_force_zlp == UX_TRUE) || (transaction_length == 0) || (transaction_length % slave_endpoint -> ux_slave_endpoint_descriptor.wMaxPacketSize)) 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 61ac87be..7cadf7c0 100644 --- a/common/core/src/ux_host_stack_device_descriptor_read.c +++ b/common/core/src/ux_host_stack_device_descriptor_read.c @@ -34,7 +34,7 @@ /* FUNCTION RELEASE */ /* */ /* _ux_host_stack_device_descriptor_read PORTABLE C */ -/* 6.1 */ +/* 6.1.9 */ /* AUTHOR */ /* */ /* Chaoqiong Xiao, Microsoft Corporation */ @@ -69,6 +69,9 @@ /* 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 */ /* */ /**************************************************************************/ UINT _ux_host_stack_device_descriptor_read(UX_DEVICE *device) @@ -122,8 +125,18 @@ UX_ENDPOINT *control_endpoint; return(status); } + /* Validate the bMaxPacketSize0. */ + if (device -> ux_device_descriptor.bMaxPacketSize0 != 8 && + device -> ux_device_descriptor.bMaxPacketSize0 != 16 && + device -> ux_device_descriptor.bMaxPacketSize0 != 32 && + device -> ux_device_descriptor.bMaxPacketSize0 != 64) + { + _ux_utility_memory_free(descriptor); + return(UX_DESCRIPTOR_CORRUPTED); + } + /* Update the max packet size value for the endpoint. */ - control_endpoint -> ux_endpoint_descriptor.wMaxPacketSize = device -> ux_device_descriptor.bMaxPacketSize0; + control_endpoint -> ux_endpoint_descriptor.wMaxPacketSize = device -> ux_device_descriptor.bMaxPacketSize0; /* Create a transfer_request for the GET_DESCRIPTOR request. This time, we have the complete length */ transfer_request -> ux_transfer_request_data_pointer = descriptor; @@ -132,6 +145,7 @@ UX_ENDPOINT *control_endpoint; transfer_request -> ux_transfer_request_type = UX_REQUEST_IN | UX_REQUEST_TYPE_STANDARD | UX_REQUEST_TARGET_DEVICE; transfer_request -> ux_transfer_request_value = UX_DEVICE_DESCRIPTOR_ITEM << 8; transfer_request -> ux_transfer_request_index = 0; + transfer_request -> ux_transfer_request_packet_length = device -> ux_device_descriptor.bMaxPacketSize0; /* Send request to HCD layer. */ status = _ux_host_stack_transfer_request(transfer_request); 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 d1ef9ee6..83ff8527 100644 --- a/common/core/src/ux_host_stack_new_endpoint_create.c +++ b/common/core/src/ux_host_stack_new_endpoint_create.c @@ -34,7 +34,7 @@ /* FUNCTION RELEASE */ /* */ /* _ux_host_stack_new_endpoint_create PORTABLE C */ -/* 6.1 */ +/* 6.1.9 */ /* AUTHOR */ /* */ /* Chaoqiong Xiao, Microsoft Corporation */ @@ -74,6 +74,9 @@ /* 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 */ /* */ /**************************************************************************/ UINT _ux_host_stack_new_endpoint_create(UX_INTERFACE *interface, @@ -82,6 +85,9 @@ UINT _ux_host_stack_new_endpoint_create(UX_INTERFACE *interface, UX_ENDPOINT *endpoint; UX_ENDPOINT *list_endpoint; +ULONG endpoint_type; +ULONG packet_size; +ULONG n_tran; /* Obtain memory for storing this new endpoint. */ endpoint = (UX_ENDPOINT *) _ux_utility_memory_allocate(UX_NO_ALIGN, UX_REGULAR_MEMORY, sizeof(UX_ENDPOINT)); @@ -108,6 +114,79 @@ UX_ENDPOINT *list_endpoint; UX_ENDPOINT_DESCRIPTOR_ENTRIES, (UCHAR *) &endpoint -> ux_endpoint_descriptor); + /* Check endpoint size and interval to see if they are valid. */ + endpoint_type = endpoint -> ux_endpoint_descriptor.bmAttributes & UX_MASK_ENDPOINT_TYPE; + + /* Endpoint size should not be zero. */ + if (endpoint -> ux_endpoint_descriptor.wMaxPacketSize == 0) + { + _ux_utility_memory_free(endpoint); + return(UX_DESCRIPTOR_CORRUPTED); + } + + /* Control/bulk endpoint, 8, 16, 32, 64, ... 512 can be accepted. + Note non-standard size in 2^N is accepted since they really works. */ + if (endpoint_type == UX_CONTROL_ENDPOINT || endpoint_type == UX_BULK_ENDPOINT) + { + for (packet_size = 8; packet_size <= 512; packet_size <<= 1) + { + if (packet_size == endpoint -> ux_endpoint_descriptor.wMaxPacketSize) + break; + } + + /* If endpoint size not valid, return error. */ + if (packet_size > 512) + { + _ux_utility_memory_free(endpoint); + return(UX_DESCRIPTOR_CORRUPTED); + } + } + + /* Interrupt/isochronous endpoint, max 1024 and 3 transactions can be accepted. */ + if (endpoint_type == UX_INTERRUPT_ENDPOINT || endpoint_type == UX_ISOCHRONOUS_ENDPOINT) + { + + /* Max size over 1024 is not allowed. */ + packet_size = endpoint -> ux_endpoint_descriptor.wMaxPacketSize & UX_MAX_PACKET_SIZE_MASK; + if (packet_size > 1024) + { + _ux_utility_memory_free(endpoint); + return(UX_DESCRIPTOR_CORRUPTED); + } + + /* Number transaction over 2 additional is not allowed. */ + n_tran = endpoint -> ux_endpoint_descriptor.wMaxPacketSize & UX_MAX_NUMBER_OF_TRANSACTIONS_MASK; + if (n_tran >= UX_MAX_NUMBER_OF_TRANSACTIONS_MASK) + { + _ux_utility_memory_free(endpoint); + return(UX_DESCRIPTOR_CORRUPTED); + } + + /* Isochronous/high speed interrupt interval should be 1~16. */ + if (endpoint -> ux_endpoint_descriptor.bInterval < 1) + { + _ux_utility_memory_free(endpoint); + return(UX_DESCRIPTOR_CORRUPTED); + } + if ((endpoint_type == UX_ISOCHRONOUS_ENDPOINT) || + (interface -> ux_interface_configuration -> ux_configuration_device + -> ux_device_speed == UX_HIGH_SPEED_DEVICE) + ) + { + if (endpoint -> ux_endpoint_descriptor.bInterval > 16) + { + _ux_utility_memory_free(endpoint); + return(UX_DESCRIPTOR_CORRUPTED); + } + } + + /* Save final packet size. */ + packet_size *= (n_tran + 1); + } + + /* 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 endpoint container itself, easier for back chaining. */ endpoint -> ux_endpoint_interface = interface; diff --git a/common/core/src/ux_trace_event_insert.c b/common/core/src/ux_trace_event_insert.c index 0cd38f81..305d477c 100644 --- a/common/core/src/ux_trace_event_insert.c +++ b/common/core/src/ux_trace_event_insert.c @@ -35,7 +35,7 @@ /* FUNCTION RELEASE */ /* */ /* _ux_trace_event_insert PORTABLE C */ -/* 6.1 */ +/* 6.1.9 */ /* AUTHOR */ /* */ /* Chaoqiong Xiao, Microsoft Corporation */ @@ -78,9 +78,12 @@ /* 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 */ /* */ /**************************************************************************/ -#ifdef UX_TRACE_INSERT_MACROS +#ifdef TX_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, ULONG filter, TX_TRACE_BUFFER_ENTRY **current_event, ULONG *current_timestamp) { diff --git a/common/core/src/ux_trace_event_update.c b/common/core/src/ux_trace_event_update.c index 06e8be20..76ce1f54 100644 --- a/common/core/src/ux_trace_event_update.c +++ b/common/core/src/ux_trace_event_update.c @@ -35,7 +35,7 @@ /* FUNCTION RELEASE */ /* */ /* _ux_trace_event_update PORTABLE C */ -/* 6.1 */ +/* 6.1.9 */ /* AUTHOR */ /* */ /* Chaoqiong Xiao, Microsoft Corporation */ @@ -76,9 +76,12 @@ /* 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 */ /* */ /**************************************************************************/ -#ifdef UX_TRACE_INSERT_MACROS +#ifdef TX_ENABLE_EVENT_TRACE VOID _ux_trace_event_update(TX_TRACE_BUFFER_ENTRY *event, ULONG timestamp, ULONG event_id, ULONG info_field_1, ULONG info_field_2, ULONG info_field_3, ULONG info_field_4) { diff --git a/common/core/src/ux_trace_object_register.c b/common/core/src/ux_trace_object_register.c index 04f86e36..473b1ae8 100644 --- a/common/core/src/ux_trace_object_register.c +++ b/common/core/src/ux_trace_object_register.c @@ -29,14 +29,14 @@ #include "ux_api.h" -#ifdef UX_TRACE_INSERT_MACROS +#ifdef TX_ENABLE_EVENT_TRACE extern VOID _tx_trace_object_register(UCHAR , VOID *, CHAR *, ULONG , ULONG ); /**************************************************************************/ /* */ /* FUNCTION RELEASE */ /* */ /* _ux_trace_object_register PORTABLE C */ -/* 6.1 */ +/* 6.1.9 */ /* AUTHOR */ /* */ /* Chaoqiong Xiao, Microsoft Corporation */ @@ -75,6 +75,9 @@ extern VOID _tx_trace_object_register(UCHAR , VOID *, CHAR *, ULONG , ULONG ); /* 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 */ /* */ /**************************************************************************/ 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 8e553b0c..a5085cc9 100644 --- a/common/core/src/ux_trace_object_unregister.c +++ b/common/core/src/ux_trace_object_unregister.c @@ -29,14 +29,14 @@ #include "ux_api.h" -#ifdef UX_TRACE_INSERT_MACROS +#ifdef TX_ENABLE_EVENT_TRACE extern VOID _tx_trace_object_unregister(VOID *); /**************************************************************************/ /* */ /* FUNCTION RELEASE */ /* */ /* _ux_trace_object_unregister PORTABLE C */ -/* 6.1 */ +/* 6.1.9 */ /* AUTHOR */ /* */ /* Chaoqiong Xiao, Microsoft Corporation */ @@ -71,6 +71,9 @@ extern VOID _tx_trace_object_unregister(VOID *); /* 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 */ /* */ /**************************************************************************/ VOID _ux_trace_object_unregister(VOID *object_ptr) 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 2db4d6ef..db366199 100644 --- a/common/usbx_device_classes/inc/ux_device_class_storage.h +++ b/common/usbx_device_classes/inc/ux_device_class_storage.h @@ -26,7 +26,7 @@ /* COMPONENT DEFINITION RELEASE */ /* */ /* ux_device_class_storage.h PORTABLE C */ -/* 6.1.8 */ +/* 6.1.9 */ /* AUTHOR */ /* */ /* Chaoqiong Xiao, Microsoft Corporation */ @@ -51,6 +51,9 @@ /* 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 */ /* */ /**************************************************************************/ @@ -441,7 +444,6 @@ typedef struct UX_SLAVE_CLASS_STORAGE_LUN_STRUCT ULONG ux_slave_class_storage_media_removable_flag; ULONG ux_slave_class_storage_media_read_only_flag; ULONG ux_slave_class_storage_media_id; - ULONG ux_slave_class_storage_scsi_tag; ULONG ux_slave_class_storage_request_sense_status; ULONG ux_slave_class_storage_disk_status; ULONG ux_slave_class_storage_last_session_state; @@ -471,6 +473,7 @@ typedef struct UX_SLAVE_CLASS_STORAGE_STRUCT UCHAR ux_slave_class_storage_cbw_flags; UCHAR ux_slave_class_storage_cbw_lun; UCHAR ux_slave_class_storage_reserved[2]; + ULONG ux_slave_class_storage_scsi_tag; ULONG ux_slave_class_storage_csw_residue; ULONG ux_slave_class_storage_csw_status; VOID (*ux_slave_class_storage_instance_activate)(VOID *); 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 827ee2ae..8b5e6b9f 100644 --- a/common/usbx_device_classes/src/ux_device_class_audio_change.c +++ b/common/usbx_device_classes/src/ux_device_class_audio_change.c @@ -33,7 +33,7 @@ /* FUNCTION RELEASE */ /* */ /* _ux_device_class_audio_change PORTABLE C */ -/* 6.1 */ +/* 6.1.9 */ /* AUTHOR */ /* */ /* Chaoqiong Xiao, Microsoft Corporation */ @@ -65,6 +65,10 @@ /* 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 */ /* */ /**************************************************************************/ UINT _ux_device_class_audio_change(UX_SLAVE_CLASS_COMMAND *command) @@ -128,7 +132,7 @@ ULONG stream_index; { /* We found the endpoint, check its size. */ - if (endpoint -> ux_slave_endpoint_descriptor.wMaxPacketSize > stream -> ux_device_class_audio_stream_frame_buffer_size - 8) + if (endpoint -> ux_slave_endpoint_transfer_request.ux_slave_transfer_request_transfer_length > stream -> ux_device_class_audio_stream_frame_buffer_size - 8) { /* Error trap! */ 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 b48a0dbb..72702856 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 @@ -34,7 +34,7 @@ /* FUNCTION RELEASE */ /* */ /* _ux_device_class_audio_read_thread_entry PORTABLE C */ -/* 6.1 */ +/* 6.1.9 */ /* AUTHOR */ /* */ /* Chaoqiong Xiao, Microsoft Corporation */ @@ -72,6 +72,10 @@ /* 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 */ /* */ /**************************************************************************/ VOID _ux_device_class_audio_read_thread_entry(ULONG audio_stream) @@ -85,7 +89,6 @@ UX_SLAVE_TRANSFER *transfer; UCHAR *next_pos; UX_DEVICE_CLASS_AUDIO_FRAME *next_frame; ULONG max_packet_size; -ULONG transactions; ULONG actual_length; @@ -111,12 +114,7 @@ ULONG actual_length; /* Calculate transfer size based on packet size and number transactions once endpoint is available. */ if (max_packet_size == 0) - { - max_packet_size = endpoint -> ux_slave_endpoint_descriptor.wMaxPacketSize & 0x7FF; - transactions = (endpoint -> ux_slave_endpoint_descriptor.wMaxPacketSize >> 11) & 0x3; - if (transactions) - max_packet_size *= (transactions + 1); - } + max_packet_size = endpoint -> ux_slave_endpoint_transfer_request.ux_slave_transfer_request_transfer_length; /* Get transfer instance. */ transfer = &endpoint -> ux_slave_endpoint_transfer_request; 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 2d8dd0a6..3e447340 100644 --- a/common/usbx_device_classes/src/ux_device_class_cdc_acm_ioctl.c +++ b/common/usbx_device_classes/src/ux_device_class_cdc_acm_ioctl.c @@ -34,7 +34,7 @@ /* FUNCTION RELEASE */ /* */ /* _ux_device_class_cdc_acm_ioctl PORTABLE C */ -/* 6.1.5 */ +/* 6.1.9 */ /* AUTHOR */ /* */ /* Chaoqiong Xiao, Microsoft Corporation */ @@ -85,6 +85,9 @@ /* 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 */ /* */ /**************************************************************************/ UINT _ux_device_class_cdc_acm_ioctl(UX_SLAVE_CLASS_CDC_ACM *cdc_acm, ULONG ioctl_function, @@ -94,7 +97,9 @@ UINT _ux_device_class_cdc_acm_ioctl(UX_SLAVE_CLASS_CDC_ACM *cdc_acm, ULONG ioctl UINT status; UX_SLAVE_CLASS_CDC_ACM_LINE_CODING_PARAMETER *line_coding; UX_SLAVE_CLASS_CDC_ACM_LINE_STATE_PARAMETER *line_state; +#ifndef UX_DEVICE_CLASS_CDC_ACM_TRANSMISSION_DISABLE UX_SLAVE_CLASS_CDC_ACM_CALLBACK_PARAMETER *callback; +#endif UX_SLAVE_ENDPOINT *endpoint; UX_SLAVE_INTERFACE *interface; UX_SLAVE_TRANSFER *transfer_request; 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 56caacdf..7efb7496 100644 --- a/common/usbx_device_classes/src/ux_device_class_cdc_acm_read.c +++ b/common/usbx_device_classes/src/ux_device_class_cdc_acm_read.c @@ -34,7 +34,7 @@ /* FUNCTION RELEASE */ /* */ /* _ux_device_class_cdc_acm_read PORTABLE C */ -/* 6.1 */ +/* 6.1.9 */ /* AUTHOR */ /* */ /* Chaoqiong Xiao, Microsoft Corporation */ @@ -76,6 +76,9 @@ /* 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 */ /* */ /**************************************************************************/ UINT _ux_device_class_cdc_acm_read(UX_SLAVE_CLASS_CDC_ACM *cdc_acm, UCHAR *buffer, @@ -91,13 +94,16 @@ ULONG local_requested_length; /* If trace is enabled, insert this event into the trace buffer. */ UX_TRACE_IN_LINE_INSERT(UX_TRACE_DEVICE_CLASS_CDC_ACM_READ, cdc_acm, buffer, requested_length, 0, UX_TRACE_DEVICE_CLASS_EVENTS, 0, 0) - + +#ifndef UX_DEVICE_CLASS_CDC_ACM_TRANSMISSION_DISABLE + /* 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; 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 461855bf..a14927c7 100644 --- a/common/usbx_device_classes/src/ux_device_class_cdc_acm_write.c +++ b/common/usbx_device_classes/src/ux_device_class_cdc_acm_write.c @@ -34,7 +34,7 @@ /* FUNCTION RELEASE */ /* */ /* _ux_device_class_cdc_acm_write PORTABLE C */ -/* 6.1 */ +/* 6.1.9 */ /* AUTHOR */ /* */ /* Chaoqiong Xiao, Microsoft Corporation */ @@ -76,6 +76,9 @@ /* 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 */ /* */ /**************************************************************************/ UINT _ux_device_class_cdc_acm_write(UX_SLAVE_CLASS_CDC_ACM *cdc_acm, UCHAR *buffer, @@ -91,13 +94,15 @@ UINT status = 0; /* If trace is enabled, insert this event into the trace buffer. */ UX_TRACE_IN_LINE_INSERT(UX_TRACE_DEVICE_CLASS_CDC_ACM_WRITE, cdc_acm, buffer, requested_length, 0, UX_TRACE_DEVICE_CLASS_EVENTS, 0, 0) - + +#ifndef UX_DEVICE_CLASS_CDC_ACM_TRANSMISSION_DISABLE /* 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; 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 89927d7e..3daa42c8 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 @@ -40,7 +40,7 @@ static inline VOID _ux_device_class_dfu_status_get(UX_SLAVE_CLASS_DFU *, /* FUNCTION RELEASE */ /* */ /* _ux_device_class_dfu_control_request PORTABLE C */ -/* 6.1.6 */ +/* 6.1.9 */ /* AUTHOR */ /* */ /* Chaoqiong Xiao, Microsoft Corporation */ @@ -82,6 +82,9 @@ static inline VOID _ux_device_class_dfu_status_get(UX_SLAVE_CLASS_DFU *, /* 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 */ /* */ /**************************************************************************/ UINT _ux_device_class_dfu_control_request(UX_SLAVE_CLASS_COMMAND *command) @@ -96,7 +99,9 @@ ULONG request; ULONG request_value; ULONG request_length; ULONG actual_length; +#if defined(UX_DEVICE_CLASS_DFU_CUSTOM_REQUEST_ENABLE) || (UX_DEVICE_CLASS_DFU_STATUS_MODE != 1) ULONG media_status; +#endif /* Get the pointer to the device. */ 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 0d3b12c6..c4682930 100644 --- a/common/usbx_device_classes/src/ux_device_class_hid_activate.c +++ b/common/usbx_device_classes/src/ux_device_class_hid_activate.c @@ -33,7 +33,7 @@ /* FUNCTION RELEASE */ /* */ /* _ux_device_class_hid_activate PORTABLE C */ -/* 6.1.3 */ +/* 6.1.9 */ /* AUTHOR */ /* */ /* Chaoqiong Xiao, Microsoft Corporation */ @@ -69,6 +69,9 @@ /* 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 */ /* */ /**************************************************************************/ UINT _ux_device_class_hid_activate(UX_SLAVE_CLASS_COMMAND *command) @@ -117,6 +120,11 @@ UX_SLAVE_ENDPOINT *endpoint_interrupt; if (endpoint_interrupt == UX_NULL) return (UX_ERROR); + /* Validate event buffer size (fits largest transfer payload size). */ + UX_ASSERT(UX_DEVICE_CLASS_HID_EVENT_BUFFER_LENGTH >= + endpoint_interrupt -> ux_slave_endpoint_transfer_request. + ux_slave_transfer_request_transfer_length); + /* Default HID protocol is report protocol. */ hid -> ux_device_class_hid_protocol = UX_DEVICE_CLASS_HID_PROTOCOL_REPORT; 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 cfc792d2..813c4afb 100644 --- a/common/usbx_device_classes/src/ux_device_class_hid_interrupt_thread.c +++ b/common/usbx_device_classes/src/ux_device_class_hid_interrupt_thread.c @@ -34,7 +34,7 @@ /* FUNCTION RELEASE */ /* */ /* _ux_device_class_hid_interrupt_thread PORTABLE C */ -/* 6.1 */ +/* 6.1.9 */ /* AUTHOR */ /* */ /* Chaoqiong Xiao, Microsoft Corporation */ @@ -75,6 +75,9 @@ /* 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 */ /* */ /**************************************************************************/ VOID _ux_device_class_hid_interrupt_thread(ULONG hid_class) @@ -122,25 +125,34 @@ ULONG actual_flags; /* There is no event exists on timeout, insert last. */ - /* If last request is sent, repeat it, else fill zeros. */ - if (transfer_request_in -> ux_slave_transfer_request_requested_length) - { - hid_event.ux_device_class_hid_event_length = transfer_request_in -> ux_slave_transfer_request_requested_length; - _ux_utility_memory_copy(hid_event.ux_device_class_hid_event_buffer, - transfer_request_in -> ux_slave_transfer_request_data_pointer, - hid_event.ux_device_class_hid_event_length); /* Use case of memcpy is verified. */ - } - else + /* Check if no request been ready. */ + if (transfer_request_in -> ux_slave_transfer_request_requested_length == 0) { - hid_event.ux_device_class_hid_event_report_id = 0; - hid_event.ux_device_class_hid_event_length = transfer_request_in -> ux_slave_transfer_request_endpoint -> ux_slave_endpoint_descriptor.wMaxPacketSize & 0x7FF; - _ux_utility_memory_set(hid_event.ux_device_class_hid_event_buffer, 0, - hid_event.ux_device_class_hid_event_length); /* Use case of memset is verified. */ + + /* Assume the request use whole interrupt transfer payload. */ + transfer_request_in -> ux_slave_transfer_request_requested_length = + transfer_request_in -> ux_slave_transfer_request_transfer_length; + + /* Set the data to zeros. */ + _ux_utility_memory_set( + transfer_request_in -> ux_slave_transfer_request_data_pointer, 0, + transfer_request_in -> ux_slave_transfer_request_requested_length); /* Use case of memset is verified. */ } - _ux_device_class_hid_event_set(hid, &hid_event); - /* Continue to process queue. */ - status = UX_SUCCESS; + /* Send the request to the device controller. */ + status = _ux_device_stack_transfer_request(transfer_request_in, + transfer_request_in -> ux_slave_transfer_request_requested_length, + transfer_request_in -> ux_slave_transfer_request_requested_length); + + /* Check error code. We don't want to invoke the error callback + if the device was disconnected, since that's expected. */ + if (status != UX_SUCCESS && status != UX_TRANSFER_BUS_RESET) + + /* Error trap. */ + _ux_system_error_handler(UX_SYSTEM_LEVEL_THREAD, UX_SYSTEM_CONTEXT_CLASS, status); + + /* Next: check events. */ + continue; } /* Check the completion code. */ 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 2eb57092..2ad7ba34 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 @@ -38,7 +38,7 @@ /* FUNCTION RELEASE */ /* */ /* _ux_device_class_storage_csw_send PORTABLE C */ -/* 6.1.3 */ +/* 6.1.9 */ /* AUTHOR */ /* */ /* Chaoqiong Xiao, Microsoft Corporation */ @@ -83,6 +83,9 @@ /* 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 */ /* */ /**************************************************************************/ UINT _ux_device_class_storage_csw_send(UX_SLAVE_CLASS_STORAGE *storage, ULONG lun, @@ -95,6 +98,7 @@ UCHAR *csw_buffer; UX_PARAMETER_NOT_USED(csw_status); + UX_PARAMETER_NOT_USED(lun); /* If CSW skipped, just return. */ if (UX_DEVICE_CLASS_STORAGE_CSW_SKIP(&storage -> ux_slave_class_storage_csw_status)) @@ -113,7 +117,7 @@ UCHAR *csw_buffer; _ux_utility_long_put(&csw_buffer[UX_SLAVE_CLASS_STORAGE_CSW_SIGNATURE], UX_SLAVE_CLASS_STORAGE_CSW_SIGNATURE_MASK); /* Store the SCSI tag from the CBW. */ - _ux_utility_long_put(&csw_buffer[UX_SLAVE_CLASS_STORAGE_CSW_TAG], storage -> ux_slave_class_storage_lun[lun].ux_slave_class_storage_scsi_tag); + _ux_utility_long_put(&csw_buffer[UX_SLAVE_CLASS_STORAGE_CSW_TAG], storage -> ux_slave_class_storage_scsi_tag); /* Store the dCSWDataResidue. */ _ux_utility_long_put(&csw_buffer[UX_SLAVE_CLASS_STORAGE_CSW_DATA_RESIDUE], storage -> ux_slave_class_storage_csw_residue); 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 da174e00..f275b056 100644 --- a/common/usbx_device_classes/src/ux_device_class_storage_thread.c +++ b/common/usbx_device_classes/src/ux_device_class_storage_thread.c @@ -35,7 +35,7 @@ /* FUNCTION RELEASE */ /* */ /* _ux_device_class_storage_thread PORTABLE C */ -/* 6.1.7 */ +/* 6.1.9 */ /* AUTHOR */ /* */ /* Chaoqiong Xiao, Microsoft Corporation */ @@ -111,6 +111,9 @@ /* 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 */ /* */ /**************************************************************************/ VOID _ux_device_class_storage_thread(ULONG storage_class) @@ -203,7 +206,7 @@ UCHAR *cbw_cb; 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_lun[lun].ux_slave_class_storage_scsi_tag = _ux_utility_long_get(scsi_command + UX_SLAVE_CLASS_STORAGE_CBW_TAG); + storage -> ux_slave_class_storage_scsi_tag = _ux_utility_long_get(scsi_command + UX_SLAVE_CLASS_STORAGE_CBW_TAG); /* Get dCBWDataTransferLength: number of bytes to transfer. */ storage -> ux_slave_class_storage_host_length = _ux_utility_long_get(scsi_command + UX_SLAVE_CLASS_STORAGE_CBW_DATA_LENGTH); 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 0a53f229..4f080114 100644 --- a/common/usbx_host_classes/inc/ux_host_class_printer.h +++ b/common/usbx_host_classes/inc/ux_host_class_printer.h @@ -26,7 +26,7 @@ /* COMPONENT DEFINITION RELEASE */ /* */ /* ux_host_class_printer.h PORTABLE C */ -/* 6.1.8 */ +/* 6.1.9 */ /* AUTHOR */ /* */ /* Chaoqiong Xiao, Microsoft Corporation */ @@ -50,6 +50,9 @@ /* 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 */ /* */ /**************************************************************************/ @@ -127,6 +130,7 @@ UINT _ux_host_class_printer_write(UX_HOST_CLASS_PRINTER *printer, UCHAR * dat /* Define Printer Class API prototypes. */ +#define ux_host_class_printer_entry _ux_host_class_printer_entry #define ux_host_class_printer_activate _ux_host_class_printer_activate #define ux_host_class_printer_name_get _ux_host_class_printer_name_get #define ux_host_class_printer_device_id_get _ux_host_class_printer_device_id_get 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 959c0079..0fae599e 100644 --- a/common/usbx_host_classes/src/ux_host_class_asix_endpoints_get.c +++ b/common/usbx_host_classes/src/ux_host_class_asix_endpoints_get.c @@ -35,7 +35,7 @@ /* FUNCTION RELEASE */ /* */ /* _ux_host_class_asix_endpoints_get PORTABLE C */ -/* 6.1 */ +/* 6.1.9 */ /* AUTHOR */ /* */ /* Chaoqiong Xiao, Microsoft Corporation */ @@ -71,6 +71,10 @@ /* 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 */ /* */ /**************************************************************************/ UINT _ux_host_class_asix_endpoints_get(UX_HOST_CLASS_ASIX *asix) @@ -200,7 +204,7 @@ UX_TRANSFER *transfer_request; /* The endpoint is correct, Fill in the transfer request with the length requested for this endpoint. */ transfer_request = &asix -> ux_host_class_asix_interrupt_endpoint -> ux_endpoint_transfer_request; - transfer_request -> ux_transfer_request_requested_length = asix -> ux_host_class_asix_interrupt_endpoint -> ux_endpoint_descriptor.wMaxPacketSize; + transfer_request -> ux_transfer_request_requested_length = transfer_request -> ux_transfer_request_packet_length; transfer_request -> ux_transfer_request_actual_length = 0; /* The direction is always IN for the CDC interrupt endpoint. */ 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 077552c5..13e8d97c 100644 --- a/common/usbx_host_classes/src/ux_host_class_asix_interrupt_notification.c +++ b/common/usbx_host_classes/src/ux_host_class_asix_interrupt_notification.c @@ -35,7 +35,7 @@ /* FUNCTION RELEASE */ /* */ /* _ux_host_class_asix_interrupt_notification PORTABLE C */ -/* 6.1 */ +/* 6.1.9 */ /* AUTHOR */ /* */ /* Chaoqiong Xiao, Microsoft Corporation */ @@ -69,6 +69,10 @@ /* 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 */ /* */ /**************************************************************************/ VOID _ux_host_class_asix_interrupt_notification(UX_TRANSFER *transfer_request) @@ -96,7 +100,7 @@ UX_HOST_CLASS_ASIX *asix; /* Ensure the length of our interrupt pipe data is correct. */ if (transfer_request -> ux_transfer_request_actual_length == - asix -> ux_host_class_asix_interrupt_endpoint -> ux_endpoint_descriptor.wMaxPacketSize) + transfer_request -> ux_transfer_request_requested_length) { /* Check if the first byte is a interrupt packet signature. */ 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 0e110563..783edef9 100644 --- a/common/usbx_host_classes/src/ux_host_class_audio_read.c +++ b/common/usbx_host_classes/src/ux_host_class_audio_read.c @@ -35,7 +35,7 @@ /* FUNCTION RELEASE */ /* */ /* _ux_host_class_audio_read PORTABLE C */ -/* 6.1 */ +/* 6.1.9 */ /* AUTHOR */ /* */ /* Chaoqiong Xiao, Microsoft Corporation */ @@ -72,6 +72,10 @@ /* 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 */ /* */ /**************************************************************************/ UINT _ux_host_class_audio_read(UX_HOST_CLASS_AUDIO *audio, UX_HOST_CLASS_AUDIO_TRANSFER_REQUEST *audio_transfer_request) @@ -129,7 +133,8 @@ UINT status; /* For audio in, we read packets at a time, so the transfer request size is the size of the endpoint. */ audio_transfer_request -> ux_host_class_audio_transfer_request_requested_length = - audio -> ux_host_class_audio_isochronous_endpoint -> ux_endpoint_descriptor.wMaxPacketSize; + audio -> ux_host_class_audio_isochronous_endpoint -> + ux_endpoint_transfer_request.ux_transfer_request_packet_length; /* Ask the stack to hook this transfer request to the iso ED. */ status = _ux_host_class_audio_transfer_request(audio, audio_transfer_request); 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 720ada13..f252320a 100644 --- a/common/usbx_host_classes/src/ux_host_class_cdc_acm_endpoints_get.c +++ b/common/usbx_host_classes/src/ux_host_class_cdc_acm_endpoints_get.c @@ -35,7 +35,7 @@ /* FUNCTION RELEASE */ /* */ /* _ux_host_class_cdc_acm_endpoints_get PORTABLE C */ -/* 6.1 */ +/* 6.1.9 */ /* AUTHOR */ /* */ /* Chaoqiong Xiao, Microsoft Corporation */ @@ -69,6 +69,10 @@ /* 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 */ /* */ /**************************************************************************/ UINT _ux_host_class_cdc_acm_endpoints_get(UX_HOST_CLASS_CDC_ACM *cdc_acm) @@ -162,7 +166,7 @@ UX_TRANSFER *transfer_request; /* The endpoint is correct, Fill in the transfer request with the length requested for this endpoint. */ transfer_request = &cdc_acm -> ux_host_class_cdc_acm_interrupt_endpoint -> ux_endpoint_transfer_request; - transfer_request -> ux_transfer_request_requested_length = cdc_acm -> ux_host_class_cdc_acm_interrupt_endpoint -> ux_endpoint_descriptor.wMaxPacketSize; + transfer_request -> ux_transfer_request_requested_length = transfer_request -> ux_transfer_request_packet_length; transfer_request -> ux_transfer_request_actual_length = 0; /* The direction is always IN for the CDC interrupt endpoint. */ 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 05ab7075..81ece899 100644 --- a/common/usbx_host_classes/src/ux_host_class_cdc_ecm_endpoints_get.c +++ b/common/usbx_host_classes/src/ux_host_class_cdc_ecm_endpoints_get.c @@ -35,7 +35,7 @@ /* FUNCTION RELEASE */ /* */ /* _ux_host_class_cdc_ecm_endpoints_get PORTABLE C */ -/* 6.1 */ +/* 6.1.9 */ /* AUTHOR */ /* */ /* Chaoqiong Xiao, Microsoft Corporation */ @@ -69,6 +69,10 @@ /* 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 */ /* */ /**************************************************************************/ UINT _ux_host_class_cdc_ecm_endpoints_get(UX_HOST_CLASS_CDC_ECM *cdc_ecm) @@ -228,7 +232,7 @@ UX_INTERFACE *data_interface; /* The endpoint is correct, Fill in the transfer request with the length requested for this endpoint. */ transfer_request = &cdc_ecm -> ux_host_class_cdc_ecm_interrupt_endpoint -> ux_endpoint_transfer_request; - transfer_request -> ux_transfer_request_requested_length = cdc_ecm -> ux_host_class_cdc_ecm_interrupt_endpoint -> ux_endpoint_descriptor.wMaxPacketSize; + transfer_request -> ux_transfer_request_requested_length = transfer_request -> ux_transfer_request_packet_length; transfer_request -> ux_transfer_request_actual_length = 0; /* The direction is always IN for the CDC interrupt endpoint. */ 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 d088f00f..6b66580a 100644 --- a/common/usbx_host_classes/src/ux_host_class_cdc_ecm_transmission_callback.c +++ b/common/usbx_host_classes/src/ux_host_class_cdc_ecm_transmission_callback.c @@ -35,7 +35,7 @@ /* FUNCTION RELEASE */ /* */ /* _ux_host_class_cdc_ecm_transmission_callback PORTABLE C */ -/* 6.1.4 */ +/* 6.1.9 */ /* AUTHOR */ /* */ /* Chaoqiong Xiao, Microsoft Corporation */ @@ -73,6 +73,10 @@ /* 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 */ /* */ /**************************************************************************/ VOID _ux_host_class_cdc_ecm_transmission_callback(UX_TRANSFER *transfer_request) @@ -115,9 +119,9 @@ UCHAR *packet_header; if (transfer_request -> ux_transfer_request_completion_code == UX_SUCCESS) { - /* Check if the transfer length is not zero and it is multiple of MPS. */ + /* Check if the transfer length is not zero and it is multiple of MPS (validated on device enum). */ if ((transfer_request -> ux_transfer_request_requested_length != 0) && - (transfer_request -> ux_transfer_request_requested_length % (transfer_request -> ux_transfer_request_endpoint -> ux_endpoint_descriptor.wMaxPacketSize & UX_MAX_PACKET_SIZE_MASK)) == 0) + (transfer_request -> ux_transfer_request_requested_length % transfer_request -> ux_transfer_request_packet_length) == 0) { /* Set transfer request length to zero. */ 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 4e5a076f..fd08cfa8 100644 --- a/common/usbx_host_classes/src/ux_host_class_hub_interrupt_endpoint_start.c +++ b/common/usbx_host_classes/src/ux_host_class_hub_interrupt_endpoint_start.c @@ -35,7 +35,7 @@ /* FUNCTION RELEASE */ /* */ /* _ux_host_class_hub_interrupt_endpoint_start PORTABLE C */ -/* 6.1 */ +/* 6.1.9 */ /* AUTHOR */ /* */ /* Chaoqiong Xiao, Microsoft Corporation */ @@ -73,6 +73,10 @@ /* 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 */ /* */ /**************************************************************************/ UINT _ux_host_class_hub_interrupt_endpoint_start(UX_HOST_CLASS_HUB *hub) @@ -96,7 +100,7 @@ UX_TRANSFER *transfer_request; /* The endpoint is correct, fill in the transfer_request with the length requested for this endpoint. */ transfer_request = &hub -> ux_host_class_hub_interrupt_endpoint -> ux_endpoint_transfer_request; - transfer_request -> ux_transfer_request_requested_length = hub -> ux_host_class_hub_interrupt_endpoint -> ux_endpoint_descriptor.wMaxPacketSize; + transfer_request -> ux_transfer_request_requested_length = transfer_request -> ux_transfer_request_packet_length; transfer_request -> ux_transfer_request_actual_length = 0; /* Since this transfer_request has a callback, we need the HUB instance to be stored in the transfer request. */ 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 0a8c499e..a4861f89 100644 --- a/common/usbx_host_classes/src/ux_host_class_pima_endpoints_get.c +++ b/common/usbx_host_classes/src/ux_host_class_pima_endpoints_get.c @@ -35,7 +35,7 @@ /* FUNCTION RELEASE */ /* */ /* _ux_host_class_pima_endpoints_get PORTABLE C */ -/* 6.1 */ +/* 6.1.9 */ /* AUTHOR */ /* */ /* Chaoqiong Xiao, Microsoft Corporation */ @@ -68,6 +68,10 @@ /* 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 */ /* */ /**************************************************************************/ UINT _ux_host_class_pima_endpoints_get(UX_HOST_CLASS_PIMA *pima) @@ -185,7 +189,7 @@ UX_TRANSFER *transfer_request; /* The endpoint is correct, Fill in the transfer request with the length requested for this endpoint. */ transfer_request = &pima -> ux_host_class_pima_interrupt_endpoint -> ux_endpoint_transfer_request; - transfer_request -> ux_transfer_request_requested_length = pima -> ux_host_class_pima_interrupt_endpoint -> ux_endpoint_descriptor.wMaxPacketSize; + transfer_request -> ux_transfer_request_requested_length = transfer_request -> ux_transfer_request_packet_length; transfer_request -> ux_transfer_request_actual_length = 0; /* The direction is always IN for the Pima interrupt endpoint. */ 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 52f4c73d..06cbb056 100644 --- a/common/usbx_host_classes/src/ux_host_class_printer_write.c +++ b/common/usbx_host_classes/src/ux_host_class_printer_write.c @@ -35,7 +35,7 @@ /* FUNCTION RELEASE */ /* */ /* _ux_host_class_printer_write PORTABLE C */ -/* 6.1 */ +/* 6.1.9 */ /* AUTHOR */ /* */ /* Chaoqiong Xiao, Microsoft Corporation */ @@ -76,6 +76,9 @@ /* 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 */ /* */ /**************************************************************************/ UINT _ux_host_class_printer_write(UX_HOST_CLASS_PRINTER *printer, UCHAR * data_pointer, @@ -117,7 +120,7 @@ ULONG transfer_request_length; /* Perform a transfer on the bulk out endpoint until either the transfer is completed or when there is an error. */ - while (requested_length) + do { /* Program the maximum authorized length for this transfer_request. */ @@ -198,7 +201,7 @@ ULONG transfer_request_length; /* Update what is left to send out. */ requested_length -= transfer_request_length; - } + } while (requested_length); /* Unprotect thread reentry to this instance. */ status = _ux_utility_semaphore_put(&printer -> ux_host_class_printer_semaphore); 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 584f90df..373e07b6 100644 --- a/common/usbx_host_classes/src/ux_host_class_prolific_endpoints_get.c +++ b/common/usbx_host_classes/src/ux_host_class_prolific_endpoints_get.c @@ -35,7 +35,7 @@ /* FUNCTION RELEASE */ /* */ /* _ux_host_class_prolific_endpoints_get PORTABLE C */ -/* 6.1 */ +/* 6.1.9 */ /* AUTHOR */ /* */ /* Chaoqiong Xiao, Microsoft Corporation */ @@ -71,6 +71,10 @@ /* 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 */ /* */ /**************************************************************************/ UINT _ux_host_class_prolific_endpoints_get(UX_HOST_CLASS_PROLIFIC *prolific) @@ -187,7 +191,7 @@ UX_TRANSFER *transfer_request; /* The endpoint is correct, Fill in the transfer request with the length requested for this endpoint. */ transfer_request = &prolific -> ux_host_class_prolific_interrupt_endpoint -> ux_endpoint_transfer_request; - transfer_request -> ux_transfer_request_requested_length = prolific -> ux_host_class_prolific_interrupt_endpoint -> ux_endpoint_descriptor.wMaxPacketSize; + transfer_request -> ux_transfer_request_requested_length = transfer_request -> ux_transfer_request_packet_length; transfer_request -> ux_transfer_request_actual_length = 0; /* The direction is always IN for the CDC interrupt endpoint. */ 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 8c3a8cbc..61001d1a 100644 --- a/common/usbx_host_classes/src/ux_host_class_prolific_transfer_request_completed.c +++ b/common/usbx_host_classes/src/ux_host_class_prolific_transfer_request_completed.c @@ -35,7 +35,7 @@ /* FUNCTION RELEASE */ /* */ /* _ux_host_class_prolific_transfer_request_completed PORTABLE C */ -/* 6.1 */ +/* 6.1.9 */ /* AUTHOR */ /* */ /* Chaoqiong Xiao, Microsoft Corporation */ @@ -69,6 +69,10 @@ /* 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 */ /* */ /**************************************************************************/ VOID _ux_host_class_prolific_transfer_request_completed(UX_TRANSFER *transfer_request) @@ -97,7 +101,7 @@ UX_HOST_CLASS_PROLIFIC *prolific; /* 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 == - prolific -> ux_host_class_prolific_interrupt_endpoint -> ux_endpoint_descriptor.wMaxPacketSize) + transfer_request -> ux_transfer_request_requested_length) { /* Check if device is present. */ 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 616edb3d..d0a45482 100644 --- a/common/usbx_host_classes/src/ux_host_class_storage_endpoints_get.c +++ b/common/usbx_host_classes/src/ux_host_class_storage_endpoints_get.c @@ -35,7 +35,7 @@ /* FUNCTION RELEASE */ /* */ /* _ux_host_class_storage_endpoints_get PORTABLE C */ -/* 6.1 */ +/* 6.1.9 */ /* AUTHOR */ /* */ /* Chaoqiong Xiao, Microsoft Corporation */ @@ -69,6 +69,10 @@ /* 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 */ /* */ /**************************************************************************/ UINT _ux_host_class_storage_endpoints_get(UX_HOST_CLASS_STORAGE *storage) @@ -177,7 +181,7 @@ UX_ENDPOINT *endpoint; /* The size of the transfer is fixed to the endpoint size. */ endpoint -> ux_endpoint_transfer_request.ux_transfer_request_requested_length = - endpoint -> ux_endpoint_descriptor.wMaxPacketSize; + endpoint -> ux_endpoint_transfer_request.ux_transfer_request_packet_length; /* Get some memory for this data transfer. */ endpoint -> ux_endpoint_transfer_request.ux_transfer_request_data_pointer = 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 3719eaea..eee1effb 100644 --- a/common/usbx_host_classes/src/ux_host_class_storage_media_mount.c +++ b/common/usbx_host_classes/src/ux_host_class_storage_media_mount.c @@ -35,7 +35,7 @@ /* FUNCTION RELEASE */ /* */ /* _ux_host_class_storage_media_mount PORTABLE C */ -/* 6.1 */ +/* 6.1.9 */ /* AUTHOR */ /* */ /* Chaoqiong Xiao, Microsoft Corporation */ @@ -88,6 +88,9 @@ /* 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) @@ -163,13 +166,16 @@ UINT status; couple of bytes. BUT !!! The first boot sector of an iPod is actually a partition, so we need to look further and see if the number of sector per FAT and the first partition are - set to 0. This will indicate a partition sector. + set to 0. This will indicate a partition sector. Though exFAT has no BIOS parameters + block and should be excluded in this case. */ if ((*sector_memory == 0xe9) || ((*sector_memory == 0xeb) && *(sector_memory + 2) == 0x90)) { /* Check for fake boot sector. */ - if (_ux_utility_short_get(sector_memory + 0x16) != 0x0 || _ux_utility_long_get(sector_memory + 0x24) != 0x0) + if (_ux_utility_short_get(sector_memory + 0x16) != 0x0 || + _ux_utility_long_get(sector_memory + 0x24) != 0x0 || + (*(sector_memory + 1) == 0x76) /* exFAT volume */) { /* This is a boot sector signature. */ 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 9deb87ed..8d67b008 100644 --- a/common/usbx_host_classes/src/ux_host_class_video_alternate_setting_locate.c +++ b/common/usbx_host_classes/src/ux_host_class_video_alternate_setting_locate.c @@ -35,7 +35,7 @@ /* FUNCTION RELEASE */ /* */ /* _ux_host_class_video_alternate_setting_locate PORTABLE C */ -/* 6.1 */ +/* 6.1.9 */ /* AUTHOR */ /* */ /* Chaoqiong Xiao, Microsoft Corporation */ @@ -69,6 +69,10 @@ /* 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 */ /* */ /**************************************************************************/ UINT _ux_host_class_video_alternate_setting_locate(UX_HOST_CLASS_VIDEO *video, UINT max_payload_size, UINT *alternate_setting) @@ -100,9 +104,7 @@ UINT alternate_setting_found; /* Get the max packet size of the endpoint. */ endpoint = interface -> ux_interface_first_endpoint; - payload_size = (endpoint -> ux_endpoint_descriptor.wMaxPacketSize & UX_MAX_PACKET_SIZE_MASK) * - (((endpoint -> ux_endpoint_descriptor.wMaxPacketSize & UX_MAX_NUMBER_OF_TRANSACTIONS_MASK) >> - UX_MAX_NUMBER_OF_TRANSACTIONS_SHIFT) + 1); + payload_size = endpoint -> ux_endpoint_transfer_request.ux_transfer_request_packet_length; /* Check if the payload size is equal or greater than the required payload size. */ if (payload_size >= max_payload_size) 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 8595e379..90f10562 100644 --- a/common/usbx_host_classes/src/ux_host_class_video_channel_start.c +++ b/common/usbx_host_classes/src/ux_host_class_video_channel_start.c @@ -35,7 +35,7 @@ /* FUNCTION RELEASE */ /* */ /* _ux_host_class_video_channel_start PORTABLE C */ -/* 6.1 */ +/* 6.1.9 */ /* AUTHOR */ /* */ /* Chaoqiong Xiao, Microsoft Corporation */ @@ -78,6 +78,10 @@ /* 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 */ /* */ /**************************************************************************/ UINT _ux_host_class_video_channel_start(UX_HOST_CLASS_VIDEO *video, UX_HOST_CLASS_VIDEO_PARAMETER_CHANNEL *video_parameter) @@ -191,68 +195,76 @@ UINT max_payload_size; /* Search for the non zero alternate setting of the video stream. */ status = _ux_host_class_video_alternate_setting_locate(video, max_payload_size, &alternate_setting); - /* 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 - to search its container. */ - configuration = video -> ux_host_class_video_streaming_interface -> ux_interface_configuration; - interface = configuration -> ux_configuration_first_interface; - - - /* Scan all interfaces. */ - while (interface != UX_NULL) + if (status == UX_SUCCESS) { - - /* We search for both the right interface and alternate setting. */ - if ((interface -> ux_interface_descriptor.bInterfaceNumber == streaming_interface) && - (interface -> ux_interface_descriptor.bAlternateSetting == alternate_setting)) + + /* 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 + to search its container. */ + configuration = video -> ux_host_class_video_streaming_interface -> ux_interface_configuration; + interface = configuration -> ux_configuration_first_interface; + + /* Scan all interfaces. */ + while (interface != UX_NULL) { - - /* We have found the right interface/alternate setting combination - The stack will select it for us. */ - status = _ux_host_stack_interface_setting_select(interface); - - /* If the alternate setting for the streaming interface could be selected, we memorize it. */ - if (status == UX_SUCCESS) + + /* We search for both the right interface and alternate setting. */ + if ((interface -> ux_interface_descriptor.bInterfaceNumber == streaming_interface) && + (interface -> ux_interface_descriptor.bAlternateSetting == alternate_setting)) { - - /* Memorize the interface. */ - video -> ux_host_class_video_streaming_interface = interface; - - /* We need to research the isoch endpoint now. */ - for (endpoint_index = 0; endpoint_index < interface -> 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 right interface/alternate setting combination + The stack will select it for us. */ + status = _ux_host_stack_interface_setting_select(interface); + + /* 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; + + /* We need to research the isoch endpoint now. */ + for (endpoint_index = 0; endpoint_index < interface -> 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) { - - /* We have found the isoch endpoint, save it. */ - video -> ux_host_class_video_isochronous_endpoint = endpoint; - - /* Free all used resources. */ - _ux_utility_memory_free(control_buffer); + + /* 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. */ - status = _ux_utility_semaphore_put(&video -> ux_host_class_video_semaphore); - - /* Return successful completion. */ - return(UX_SUCCESS); - } - } - } + /* Unprotect thread reentry to this instance. */ + status = _ux_utility_semaphore_put(&video -> ux_host_class_video_semaphore); + + /* Return successful completion. */ + return(UX_SUCCESS); + } + } + } + } } + + /* Move to next interface. */ + interface = interface -> ux_interface_next_interface; } - - /* Move to next interface. */ - interface = interface -> ux_interface_next_interface; } } } 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 13f5b199..ceb5c680 100644 --- a/common/usbx_host_classes/src/ux_host_class_video_frame_parameters_set.c +++ b/common/usbx_host_classes/src/ux_host_class_video_frame_parameters_set.c @@ -35,7 +35,7 @@ /* FUNCTION RELEASE */ /* */ /* _ux_host_class_video_frame_parameters_set PORTABLE C */ -/* 6.1 */ +/* 6.1.9 */ /* AUTHOR */ /* */ /* Chaoqiong Xiao, Microsoft Corporation */ @@ -79,6 +79,9 @@ /* 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 */ /* */ /**************************************************************************/ UINT _ux_host_class_video_frame_parameters_set(UX_HOST_CLASS_VIDEO *video, ULONG frame_format, ULONG width, ULONG height, ULONG frame_interval) @@ -268,6 +271,23 @@ ULONG max_payload_size; /* Get the max payload transfer size returned from video device. */ max_payload_size = _ux_utility_long_get(control_buffer + UX_HOST_CLASS_VIDEO_PROBE_COMMIT_MAX_PAYLOAD_TRANSFER_SIZE); + /* Validate if the payload size is inside isochronouse packet payload. */ + if (max_payload_size == 0) + status = UX_HOST_CLASS_VIDEO_PARAMETER_ERROR; + else + { + if (video -> ux_host_class_video_device -> ux_device_speed != UX_HIGH_SPEED_DEVICE) + { + if (max_payload_size > 1023) + status = UX_HOST_CLASS_VIDEO_PARAMETER_ERROR; + } + else + { + if (max_payload_size > (1024 * 3)) + status = UX_HOST_CLASS_VIDEO_PARAMETER_ERROR; + } + } + /* Free all used resources. */ _ux_utility_memory_free(control_buffer); 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 728d9e11..5375dc81 100644 --- a/common/usbx_host_classes/src/ux_host_class_video_read.c +++ b/common/usbx_host_classes/src/ux_host_class_video_read.c @@ -35,7 +35,7 @@ /* FUNCTION RELEASE */ /* */ /* _ux_host_class_video_read PORTABLE C */ -/* 6.1 */ +/* 6.1.9 */ /* AUTHOR */ /* */ /* Chaoqiong Xiao, Microsoft Corporation */ @@ -47,6 +47,9 @@ /* Note if the transfer request is not linked (next pointer is NULL), */ /* a single request is performed. If the transfer request links into a */ /* list, the whole list is added. */ +/* */ +/* Note check ux_host_class_video_max_payload_get to see request */ +/* length limitation. */ /* */ /* INPUT */ /* */ @@ -77,13 +80,16 @@ /* 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 */ /* */ /**************************************************************************/ UINT _ux_host_class_video_read(UX_HOST_CLASS_VIDEO *video, UX_HOST_CLASS_VIDEO_TRANSFER_REQUEST *video_transfer_request) { UINT status; -ULONG packet_size; UX_HOST_CLASS_VIDEO_TRANSFER_REQUEST *transfer_list; @@ -120,27 +126,9 @@ UX_HOST_CLASS_VIDEO_TRANSFER_REQUEST *transfer_list; return(UX_HOST_CLASS_VIDEO_WRONG_INTERFACE); } - /* Calculate max transfer size on the endpoint. */ - packet_size = video -> ux_host_class_video_isochronous_endpoint -> ux_endpoint_descriptor.wMaxPacketSize; - if (packet_size & UX_MAX_NUMBER_OF_TRANSACTIONS_MASK) - packet_size = (packet_size & UX_MAX_PACKET_SIZE_MASK) * (((packet_size & UX_MAX_NUMBER_OF_TRANSACTIONS_MASK) >> UX_MAX_NUMBER_OF_TRANSACTIONS_SHIFT) + 1); - /* Save list head. */ transfer_list = video_transfer_request; - /* Handle the request (list). */ - while(video_transfer_request) - { - - /* For video in, we read packets at a time, so the transfer request size is the size of the - endpoint. */ - video_transfer_request -> ux_host_class_video_transfer_request_requested_length = packet_size; - - /* Next request. */ - video_transfer_request = video_transfer_request -> ux_host_class_video_transfer_request_next_video_transfer_request; - - } - /* Ask the stack to hook this transfer request to the iso ED. */ status = _ux_host_class_video_transfer_request(video, transfer_list); 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 1908c291..eeda6676 100644 --- a/common/usbx_host_classes/src/ux_host_class_video_transfer_buffer_add.c +++ b/common/usbx_host_classes/src/ux_host_class_video_transfer_buffer_add.c @@ -35,7 +35,7 @@ /* FUNCTION RELEASE */ /* */ /* _ux_host_class_video_transfer_buffer_add PORTABLE C */ -/* 6.1 */ +/* 6.1.9 */ /* AUTHOR */ /* */ /* Chaoqiong Xiao, Microsoft Corporation */ @@ -44,6 +44,9 @@ /* */ /* This function adds a buffer for video transfer requests. */ /* */ +/* Note check ux_host_class_video_max_payload_get to see minimum */ +/* recommended buffer size. */ +/* */ /* INPUT */ /* */ /* video Pointer to video class */ @@ -72,6 +75,10 @@ /* 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 */ /* */ /**************************************************************************/ UINT _ux_host_class_video_transfer_buffer_add(UX_HOST_CLASS_VIDEO *video, UCHAR* buffer) @@ -137,9 +144,7 @@ ULONG packet_size; ux_endpoint_descriptor.bEndpointAddress & UX_REQUEST_DIRECTION; /* Calculate packet size. */ - packet_size = video -> ux_host_class_video_isochronous_endpoint -> ux_endpoint_descriptor.wMaxPacketSize; - if (packet_size & UX_MAX_NUMBER_OF_TRANSACTIONS_MASK) - packet_size = (packet_size & UX_MAX_PACKET_SIZE_MASK) * (((packet_size & UX_MAX_NUMBER_OF_TRANSACTIONS_MASK) >> UX_MAX_NUMBER_OF_TRANSACTIONS_SHIFT) + 1); + packet_size = video -> ux_host_class_video_current_max_payload_size; /* Fill the transfer request with all the required fields. */ transfer_request -> ux_transfer_request_endpoint = video -> ux_host_class_video_isochronous_endpoint; 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 c27114b4..8c9de87f 100644 --- a/common/usbx_host_classes/src/ux_host_class_video_transfer_buffers_add.c +++ b/common/usbx_host_classes/src/ux_host_class_video_transfer_buffers_add.c @@ -35,7 +35,7 @@ /* FUNCTION RELEASE */ /* */ /* _ux_host_class_video_transfer_buffers_add PORTABLE C */ -/* 6.1 */ +/* 6.1.9 */ /* AUTHOR */ /* */ /* Chaoqiong Xiao, Microsoft Corporation */ @@ -51,6 +51,9 @@ /* Note the maximum number of transfers could be buffered is */ /* UX_HOST_CLASS_VIDEO_TRANSFER_REQUEST_COUNT - 1. */ /* */ +/* Note check ux_host_class_video_max_payload_get to see minimum */ +/* recommended buffer size. */ +/* */ /* INPUT */ /* */ /* video Pointer to video class */ @@ -81,6 +84,10 @@ /* 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 */ /* */ /**************************************************************************/ UINT _ux_host_class_video_transfer_buffers_add(UX_HOST_CLASS_VIDEO *video, UCHAR** buffers, ULONG num_buffers) @@ -152,9 +159,7 @@ UINT i; } /* Calculate packet size. */ - packet_size = video -> ux_host_class_video_isochronous_endpoint -> ux_endpoint_descriptor.wMaxPacketSize; - if (packet_size & UX_MAX_NUMBER_OF_TRANSACTIONS_MASK) - packet_size = (packet_size & UX_MAX_PACKET_SIZE_MASK) * (((packet_size & UX_MAX_NUMBER_OF_TRANSACTIONS_MASK) >> UX_MAX_NUMBER_OF_TRANSACTIONS_SHIFT) + 1); + packet_size = video -> ux_host_class_video_current_max_payload_size; /* Add buffers one by one. */ for (i = 0, diff --git a/ports/arm9/gnu/inc/ux_port.h b/ports/arm9/gnu/inc/ux_port.h index 7eb4e870..79da3cfd 100644 --- a/ports/arm9/gnu/inc/ux_port.h +++ b/ports/arm9/gnu/inc/ux_port.h @@ -207,7 +207,7 @@ VOID outpl(ULONG,ULONG); #ifdef UX_SYSTEM_INIT CHAR _ux_version_id[] = - "Copyright (c) Microsoft Corporation. All rights reserved. * USBX ARM9/GNU Version 6.1 *"; + "Copyright (c) Microsoft Corporation. All rights reserved. * USBX ARM9/GNU Version 6.1.9 *"; #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 30eeec41..069003ff 100644 --- a/ports/arm9/iar/inc/ux_port.h +++ b/ports/arm9/iar/inc/ux_port.h @@ -214,7 +214,7 @@ VOID outpl(ULONG,ULONG); #ifdef UX_SYSTEM_INIT CHAR _ux_version_id[] = - "Copyright (c) Microsoft Corporation. All rights reserved. * USBX ARM9/IAR Version 6.1 *"; + "Copyright (c) Microsoft Corporation. All rights reserved. * USBX ARM9/IAR Version 6.1.9 *"; #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 4a16f0b3..09075c7c 100644 --- a/ports/cortex_a15/gnu/inc/ux_port.h +++ b/ports/cortex_a15/gnu/inc/ux_port.h @@ -203,7 +203,7 @@ VOID outpl(ULONG,ULONG); #ifdef UX_SYSTEM_INIT CHAR _ux_version_id[] = - "Copyright (c) Microsoft Corporation. All rights reserved. * USBX Cortex-A15/GNU Version 6.1 *"; + "Copyright (c) Microsoft Corporation. All rights reserved. * USBX Cortex-A15/GNU Version 6.1.9 *"; #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 88097c29..d3244dac 100644 --- a/ports/cortex_a5/gnu/inc/ux_port.h +++ b/ports/cortex_a5/gnu/inc/ux_port.h @@ -210,7 +210,7 @@ VOID outpl(ULONG,ULONG); #ifdef UX_SYSTEM_INIT CHAR _ux_version_id[] = - "Copyright (c) Microsoft Corporation. All rights reserved. * USBX Cortex-A5/GNU Version 6.1 *"; + "Copyright (c) Microsoft Corporation. All rights reserved. * USBX Cortex-A5/GNU Version 6.1.9 *"; #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 f248f5a9..bdc9d03a 100644 --- a/ports/cortex_a5/iar/inc/ux_port.h +++ b/ports/cortex_a5/iar/inc/ux_port.h @@ -210,7 +210,7 @@ VOID outpl(ULONG,ULONG); #ifdef UX_SYSTEM_INIT CHAR _ux_version_id[] = - "Copyright (c) Microsoft Corporation. All rights reserved. * USBX Cortex-A5/IAR Version 6.1 *"; + "Copyright (c) Microsoft Corporation. All rights reserved. * USBX Cortex-A5/IAR Version 6.1.9 *"; #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 6e6e8256..4c628fd5 100644 --- a/ports/cortex_a5x/ac6/inc/ux_port.h +++ b/ports/cortex_a5x/ac6/inc/ux_port.h @@ -227,7 +227,7 @@ VOID outpl(ULONG,ULONG); #ifdef UX_SYSTEM_INIT CHAR _ux_version_id[] = - "Copyright (c) Microsoft Corporation. All rights reserved. * USBX Cortex-A5x/AC6 Version 6.1 *"; + "Copyright (c) Microsoft Corporation. All rights reserved. * USBX Cortex-A5x/AC6 Version 6.1.9 *"; #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 60218380..4fb1c283 100644 --- a/ports/cortex_a7/gnu/inc/ux_port.h +++ b/ports/cortex_a7/gnu/inc/ux_port.h @@ -214,7 +214,7 @@ VOID outpl(ULONG,ULONG); #ifdef UX_SYSTEM_INIT CHAR _ux_version_id[] = - "Copyright (c) Microsoft Corporation. All rights reserved. * USBX Cortex-A7/GNU Version 6.1 *"; + "Copyright (c) Microsoft Corporation. All rights reserved. * USBX Cortex-A7/GNU Version 6.1.9 *"; #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 c05bee31..329817d0 100644 --- a/ports/cortex_a7/iar/inc/ux_port.h +++ b/ports/cortex_a7/iar/inc/ux_port.h @@ -214,7 +214,7 @@ VOID outpl(ULONG,ULONG); #ifdef UX_SYSTEM_INIT CHAR _ux_version_id[] = - "Copyright (c) Microsoft Corporation. All rights reserved. * USBX Cortex-A7/IAR Version 6.1 *"; + "Copyright (c) Microsoft Corporation. All rights reserved. * USBX Cortex-A7/IAR Version 6.1.9 *"; #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 ac74a32a..7a29ae17 100644 --- a/ports/cortex_a8/gnu/inc/ux_port.h +++ b/ports/cortex_a8/gnu/inc/ux_port.h @@ -210,7 +210,7 @@ VOID outpl(ULONG,ULONG); #ifdef UX_SYSTEM_INIT CHAR _ux_version_id[] = - "Copyright (c) Microsoft Corporation. All rights reserved. * USBX Cortex-A8/GNU Version 6.1 *"; + "Copyright (c) Microsoft Corporation. All rights reserved. * USBX Cortex-A8/GNU Version 6.1.9 *"; #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 b60258d8..db0a48bd 100644 --- a/ports/cortex_a8/iar/inc/ux_port.h +++ b/ports/cortex_a8/iar/inc/ux_port.h @@ -210,7 +210,7 @@ VOID outpl(ULONG,ULONG); #ifdef UX_SYSTEM_INIT CHAR _ux_version_id[] = - "Copyright (c) Microsoft Corporation. All rights reserved. * USBX Cortex-A8/IAR Version 6.1 *"; + "Copyright (c) Microsoft Corporation. All rights reserved. * USBX Cortex-A8/IAR Version 6.1.9 *"; #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 d7e4f407..900c5358 100644 --- a/ports/cortex_a9/gnu/inc/ux_port.h +++ b/ports/cortex_a9/gnu/inc/ux_port.h @@ -210,7 +210,7 @@ VOID outpl(ULONG,ULONG); #ifdef UX_SYSTEM_INIT CHAR _ux_version_id[] = - "Copyright (c) Microsoft Corporation. All rights reserved. * USBX ARM9/GNU Version 6.1 *"; + "Copyright (c) Microsoft Corporation. All rights reserved. * USBX ARM9/GNU Version 6.1.9 *"; #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 7d273183..5d9c6066 100644 --- a/ports/cortex_a9/iar/inc/ux_port.h +++ b/ports/cortex_a9/iar/inc/ux_port.h @@ -210,7 +210,7 @@ VOID outpl(ULONG,ULONG); #ifdef UX_SYSTEM_INIT CHAR _ux_version_id[] = - "Copyright (c) Microsoft Corporation. All rights reserved. * USBX ARM9/IAR Version 6.1 *"; + "Copyright (c) Microsoft Corporation. All rights reserved. * USBX ARM9/IAR Version 6.1.9 *"; #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 0e6a70b6..b535aa28 100644 --- a/ports/cortex_m0/gnu/inc/ux_port.h +++ b/ports/cortex_m0/gnu/inc/ux_port.h @@ -208,7 +208,7 @@ VOID outpl(ULONG,ULONG); #ifdef UX_SYSTEM_INIT CHAR _ux_version_id[] = - "Copyright (c) Microsoft Corporation. All rights reserved. * USBX Cortex-M0/GNU Version 6.1 *"; + "Copyright (c) Microsoft Corporation. All rights reserved. * USBX Cortex-M0/GNU Version 6.1.9 *"; #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 70b3a516..b975f1c1 100644 --- a/ports/cortex_m0/iar/inc/ux_port.h +++ b/ports/cortex_m0/iar/inc/ux_port.h @@ -210,7 +210,7 @@ VOID outpl(ULONG,ULONG); #ifdef UX_SYSTEM_INIT CHAR _ux_version_id[] = - "Copyright (c) Microsoft Corporation. All rights reserved. * USBX Cortex-M0/IAR Version 6.1 *"; + "Copyright (c) Microsoft Corporation. All rights reserved. * USBX Cortex-M0/IAR Version 6.1.9 *"; #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 6b24b358..673ac752 100644 --- a/ports/cortex_m3/gnu/inc/ux_port.h +++ b/ports/cortex_m3/gnu/inc/ux_port.h @@ -208,7 +208,7 @@ VOID outpl(ULONG,ULONG); #ifdef UX_SYSTEM_INIT CHAR _ux_version_id[] = - "Copyright (c) Microsoft Corporation. All rights reserved. * USBX Cortex-M3/GNU Version 6.1 *"; + "Copyright (c) Microsoft Corporation. All rights reserved. * USBX Cortex-M3/GNU Version 6.1.9 *"; #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 178ed9ea..066d9077 100644 --- a/ports/cortex_m3/iar/inc/ux_port.h +++ b/ports/cortex_m3/iar/inc/ux_port.h @@ -210,7 +210,7 @@ VOID outpl(ULONG,ULONG); #ifdef UX_SYSTEM_INIT CHAR _ux_version_id[] = - "Copyright (c) Microsoft Corporation. All rights reserved. * USBX Cortex-M3/IAR Version 6.1 *"; + "Copyright (c) Microsoft Corporation. All rights reserved. * USBX Cortex-M3/IAR Version 6.1.9 *"; #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 68f04636..e83bd632 100644 --- a/ports/cortex_m4/gnu/inc/ux_port.h +++ b/ports/cortex_m4/gnu/inc/ux_port.h @@ -208,7 +208,7 @@ VOID outpl(ULONG,ULONG); #ifdef UX_SYSTEM_INIT CHAR _ux_version_id[] = - "Copyright (c) Microsoft Corporation. All rights reserved. * USBX Cortex-M4/GNU Version 6.1 *"; + "Copyright (c) Microsoft Corporation. All rights reserved. * USBX Cortex-M4/GNU Version 6.1.9 *"; #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 9aa69dce..7f4ee999 100644 --- a/ports/cortex_m4/iar/inc/ux_port.h +++ b/ports/cortex_m4/iar/inc/ux_port.h @@ -210,7 +210,7 @@ VOID outpl(ULONG,ULONG); #ifdef UX_SYSTEM_INIT CHAR _ux_version_id[] = - "Copyright (c) Microsoft Corporation. All rights reserved. * USBX Cortex-M4/IAR Version 6.1 *"; + "Copyright (c) Microsoft Corporation. All rights reserved. * USBX Cortex-M4/IAR Version 6.1.9 *"; #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 7c3ec454..475e77f4 100644 --- a/ports/cortex_m7/gnu/inc/ux_port.h +++ b/ports/cortex_m7/gnu/inc/ux_port.h @@ -208,7 +208,7 @@ VOID outpl(ULONG,ULONG); #ifdef UX_SYSTEM_INIT CHAR _ux_version_id[] = - "Copyright (c) Microsoft Corporation. All rights reserved. * USBX Cortex-M7/GNU Version 6.1 *"; + "Copyright (c) Microsoft Corporation. All rights reserved. * USBX Cortex-M7/GNU Version 6.1.9 *"; #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 0d59ebf4..69fed1f1 100644 --- a/ports/cortex_m7/iar/inc/ux_port.h +++ b/ports/cortex_m7/iar/inc/ux_port.h @@ -210,7 +210,7 @@ VOID outpl(ULONG,ULONG); #ifdef UX_SYSTEM_INIT CHAR _ux_version_id[] = - "Copyright (c) Microsoft Corporation. All rights reserved. * USBX Cortex-M7/IAR Version 6.1 *"; + "Copyright (c) Microsoft Corporation. All rights reserved. * USBX Cortex-M7/IAR Version 6.1.9 *"; #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 54c16d96..ef28c910 100644 --- a/ports/cortex_r4/gnu/inc/ux_port.h +++ b/ports/cortex_r4/gnu/inc/ux_port.h @@ -206,7 +206,7 @@ VOID outpl(ULONG,ULONG); #ifdef UX_SYSTEM_INIT CHAR _ux_version_id[] = - "Copyright (c) Microsoft Corporation. All rights reserved. * USBX Cortex-R4/GNU Version 6.1 *"; + "Copyright (c) Microsoft Corporation. All rights reserved. * USBX Cortex-R4/GNU Version 6.1.9 *"; #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 5b81484e..bd39c334 100644 --- a/ports/cortex_r4/iar/inc/ux_port.h +++ b/ports/cortex_r4/iar/inc/ux_port.h @@ -210,7 +210,7 @@ VOID outpl(ULONG,ULONG); #ifdef UX_SYSTEM_INIT CHAR _ux_version_id[] = - "Copyright (c) Microsoft Corporation. All rights reserved. * USBX Cortex-R4/IAR Version 6.1 *"; + "Copyright (c) Microsoft Corporation. All rights reserved. * USBX Cortex-R4/IAR Version 6.1.9 *"; #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 9cd84005..3705f1b5 100644 --- a/ports/cortex_r5/gnu/inc/ux_port.h +++ b/ports/cortex_r5/gnu/inc/ux_port.h @@ -210,7 +210,7 @@ VOID outpl(ULONG,ULONG); #ifdef UX_SYSTEM_INIT CHAR _ux_version_id[] = - "Copyright (c) Microsoft Corporation. All rights reserved. * USBX Cortex-R5/GNU Version 6.1 *"; + "Copyright (c) Microsoft Corporation. All rights reserved. * USBX Cortex-R5/GNU Version 6.1.9 *"; #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 5d0a8dea..d188cbcf 100644 --- a/ports/cortex_r5/iar/inc/ux_port.h +++ b/ports/cortex_r5/iar/inc/ux_port.h @@ -210,7 +210,7 @@ VOID outpl(ULONG,ULONG); #ifdef UX_SYSTEM_INIT CHAR _ux_version_id[] = - "Copyright (c) Microsoft Corporation. All rights reserved. * USBX Cortex-R5/IAR Version 6.1 *"; + "Copyright (c) Microsoft Corporation. All rights reserved. * USBX Cortex-R5/IAR Version 6.1.9 *"; #else extern CHAR _ux_version_id[]; #endif diff --git a/ports/generic/inc/ux_port.h b/ports/generic/inc/ux_port.h index daee5822..ea117860 100644 --- a/ports/generic/inc/ux_port.h +++ b/ports/generic/inc/ux_port.h @@ -210,7 +210,7 @@ VOID outpl(ULONG,ULONG); #ifdef UX_SYSTEM_INIT CHAR _ux_version_id[] = - "Copyright (c) Microsoft Corporation. All rights reserved. * USBX Generic Version 6.1.3 *"; + "Copyright (c) Microsoft Corporation. All rights reserved. * USBX Generic Version 6.1.9 *"; #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 b7eeb779..36593b5a 100644 --- a/ports/linux/gnu/inc/ux_port.h +++ b/ports/linux/gnu/inc/ux_port.h @@ -26,7 +26,7 @@ /* PORT SPECIFIC C INFORMATION RELEASE */ /* */ /* ux_port.h Linux/GNU */ -/* 6.x */ +/* 6.1.9 */ /* */ /* AUTHOR */ /* */ @@ -41,7 +41,7 @@ /* */ /* DATE NAME DESCRIPTION */ /* */ -/* xx-xx-xxxx Chaoqiong Xiao Initial Version 6.x */ +/* 10-15-2021 Chaoqiong Xiao Initial Version 6.1.9 */ /* */ /**************************************************************************/ @@ -212,7 +212,7 @@ ULONG outpl(ULONG,ULONG); #ifdef UX_SYSTEM_INIT CHAR _ux_version_id[] = - "Copyright (c) Microsoft Corporation. All rights reserved. * USBX Linux/GNU Version 6.x *"; + "Copyright (c) Microsoft Corporation. All rights reserved. * USBX Linux/GNU Version 6.1.9 *"; #else extern CHAR _ux_version_id[]; #endif