Release 6.1.7

This commit is contained in:
Bo Chen 2021-06-02 06:46:57 +00:00
parent adfe9b989a
commit 6280260805
10 changed files with 131 additions and 51 deletions

View File

@ -26,7 +26,7 @@
/* APPLICATION INTERFACE DEFINITION RELEASE */
/* */
/* ux_api.h PORTABLE C */
/* 6.1.6 */
/* 6.1.7 */
/* AUTHOR */
/* */
/* Chaoqiong Xiao, Microsoft Corporation */
@ -87,6 +87,11 @@
/* added macros for Word/DWord */
/* to bytes extraction, */
/* resulting in version 6.1.6 */
/* 06-02-2021 Chaoqiong Xiao Modified comment(s), */
/* added trace dependency test,*/
/* changed transfer timeout */
/* value, */
/* resulting in version 6.1.7 */
/* */
/**************************************************************************/
@ -221,7 +226,7 @@ typedef signed char SCHAR;
#define AZURE_RTOS_USBX
#define USBX_MAJOR_VERSION 6
#define USBX_MINOR_VERSION 1
#define USBX_PATCH_VERSION 6
#define USBX_PATCH_VERSION 7
/* Macros for concatenating tokens, where UX_CONCATn concatenates n tokens. */
@ -330,6 +335,9 @@ 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. */
@ -999,8 +1007,13 @@ VOID _ux_trace_event_update(TX_TRACE_BUFFER_ENTRY *event, ULONG timestamp, UL
#define UX_CAPABILITY_CONFIGURATION_SUMMARY 0x10u
#define UX_CONTROL_TRANSFER_TIMEOUT 1000
#define UX_NON_CONTROL_TRANSFER_TIMEOUT 5000
#ifndef UX_CONTROL_TRANSFER_TIMEOUT
#define UX_CONTROL_TRANSFER_TIMEOUT 10000
#endif
#ifndef UX_NON_CONTROL_TRANSFER_TIMEOUT
#define UX_NON_CONTROL_TRANSFER_TIMEOUT 50000
#endif
#define UX_PORT_ENABLE_WAIT 50
#define UX_DEVICE_ADDRESS_SET_WAIT 50
#define UX_HIGH_SPEED_DETECTION_HANDSHAKE_SUSPEND_WAIT 200

View File

@ -26,7 +26,7 @@
/* PORT SPECIFIC C INFORMATION RELEASE */
/* */
/* ux_user.h PORTABLE C */
/* 6.1.6 */
/* 6.1.7 */
/* */
/* AUTHOR */
/* */
@ -58,6 +58,10 @@
/* added macro to disable CDC- */
/* ACM transmission support, */
/* resulting in version 6.1.6 */
/* 06-02-2021 Xiuwen Cai Modified comment(s), added */
/* transfer timeout value */
/* options, */
/* resulting in version 6.1.7 */
/* */
/**************************************************************************/
@ -96,6 +100,19 @@
*/
#define UX_PERIODIC_RATE (TX_TIMER_TICKS_PER_SECOND)
/* Define control transfer timeout value in millisecond.
The default is 10000 milliseconds. */
/*
#define UX_CONTROL_TRANSFER_TIMEOUT 10000
*/
/* Define non control transfer timeout value in millisecond.
The default is 50000 milliseconds. */
/*
#define UX_NON_CONTROL_TRANSFER_TIMEOUT 50000
*/
/* Defined, this value is the maximum number of classes that can be loaded by USBX. This value
represents the class container and not the number of instances of a class. For instance, if a
particular implementation of USBX needs the hub class, the printer class, and the storage

View File

@ -34,7 +34,7 @@
/* FUNCTION RELEASE */
/* */
/* _ux_dcd_sim_slave_endpoint_reset PORTABLE C */
/* 6.1 */
/* 6.1.7 */
/* AUTHOR */
/* */
/* Chaoqiong Xiao, Microsoft Corporation */
@ -67,20 +67,44 @@
/* 05-19-2020 Chaoqiong Xiao Initial Version 6.0 */
/* 09-30-2020 Chaoqiong Xiao Modified comment(s), */
/* resulting in version 6.1 */
/* 06-02-2021 Chaoqiong Xiao Modified comment(s), */
/* cleared transfer flag and */
/* waked up suspended thread, */
/* resulting in version 6.1.7 */
/* */
/**************************************************************************/
UINT _ux_dcd_sim_slave_endpoint_reset(UX_DCD_SIM_SLAVE *dcd_sim_slave, UX_SLAVE_ENDPOINT *endpoint)
{
UX_DCD_SIM_SLAVE_ED *ed;
ULONG transfer_waiting;
UX_SLAVE_TRANSFER *transfer;
UX_PARAMETER_NOT_USED(dcd_sim_slave);
/* Get the physical endpoint address in the endpoint container. */
ed = (UX_DCD_SIM_SLAVE_ED *) endpoint -> ux_slave_endpoint_ed;
/* Save waiting status for non-zero endpoints. */
if (ed -> ux_sim_slave_ed_index)
{
transfer_waiting = ed -> ux_sim_slave_ed_status;
transfer_waiting &= UX_DCD_SIM_SLAVE_ED_STATUS_TRANSFER;
}
else
transfer_waiting = 0;
/* Set the state of the endpoint to not stalled. */
ed -> ux_sim_slave_ed_status &= ~(ULONG)UX_DCD_SIM_SLAVE_ED_STATUS_STALLED;
ed -> ux_sim_slave_ed_status &= ~(ULONG)(UX_DCD_SIM_SLAVE_ED_STATUS_STALLED |
transfer_waiting);
/* If some thread is pending, signal wakeup. */
if (transfer_waiting)
{
transfer = &endpoint -> ux_slave_endpoint_transfer_request;
transfer -> ux_slave_transfer_request_completion_code = UX_TRANSFER_BUS_RESET;
_ux_utility_semaphore_put(&transfer -> ux_slave_transfer_request_semaphore);
}
/* This function never fails. */
return(UX_SUCCESS);

View File

@ -41,7 +41,7 @@
/* FUNCTION RELEASE */
/* */
/* _ux_host_stack_class_device_scan PORTABLE C */
/* 6.1 */
/* 6.1.7 */
/* AUTHOR */
/* */
/* Chaoqiong Xiao, Microsoft Corporation */
@ -78,6 +78,9 @@
/* used query usage of device */
/* ClassSubclassProtocol, */
/* resulting in version 6.1 */
/* 06-02-2021 Bhupendra Naphade Modified comment(s), */
/* removed duplicate line, */
/* resulting in version 6.1.7 */
/* */
/**************************************************************************/
UINT _ux_host_stack_class_device_scan(UX_DEVICE *device)
@ -95,7 +98,6 @@ UX_HOST_CLASS_COMMAND class_command;
class_command.ux_host_class_command_pid = device -> ux_device_descriptor.idProduct;
class_command.ux_host_class_command_class = device -> ux_device_descriptor.bDeviceClass;
class_command.ux_host_class_command_subclass = device -> ux_device_descriptor.bDeviceSubClass;
class_command.ux_host_class_command_subclass = device -> ux_device_descriptor.bDeviceSubClass;
class_command.ux_host_class_command_protocol = device -> ux_device_descriptor.bDeviceProtocol;
class_command.ux_host_class_command_iad_class = 0;
class_command.ux_host_class_command_iad_subclass = 0;

View File

@ -34,7 +34,7 @@
/* FUNCTION RELEASE */
/* */
/* _ux_host_stack_device_configuration_activate PORTABLE C */
/* 6.1.4 */
/* 6.1.7 */
/* AUTHOR */
/* */
/* Chaoqiong Xiao, Microsoft Corporation */
@ -71,6 +71,9 @@
/* DATE NAME DESCRIPTION */
/* */
/* 02-02-2021 Chaoqiong Xiao Initial Version 6.1.4 */
/* 06-02-2021 Chaoqiong Xiao Modified comment(s), */
/* fixed trace enabled error, */
/* resulting in version 6.1.7 */
/* */
/**************************************************************************/
UINT _ux_host_stack_device_configuration_activate(UX_CONFIGURATION *configuration)
@ -93,12 +96,12 @@ UINT status;
return(UX_CONFIGURATION_HANDLE_UNKNOWN);
}
/* If trace is enabled, insert this event into the trace buffer. */
UX_TRACE_IN_LINE_INSERT(UX_TRACE_HOST_STACK_DEVICE_CONFIGURATION_ACTIVATE, device, configuration, 0, 0, UX_TRACE_HOST_STACK_EVENTS, 0, 0)
/* Get the device container for this configuration. */
device = configuration -> ux_configuration_device;
/* If trace is enabled, insert this event into the trace buffer. */
UX_TRACE_IN_LINE_INSERT(UX_TRACE_HOST_STACK_DEVICE_CONFIGURATION_ACTIVATE, device, configuration, 0, 0, UX_TRACE_HOST_STACK_EVENTS, 0, 0)
/* Protect the control endpoint semaphore here. It will be unprotected in the
transfer request function. */
status = _ux_utility_semaphore_get(&device -> ux_device_protection_semaphore, UX_WAIT_FOREVER);

View File

@ -34,7 +34,7 @@
/* FUNCTION RELEASE */
/* */
/* _ux_host_stack_device_configuration_deactivate PORTABLE C */
/* 6.1.4 */
/* 6.1.7 */
/* AUTHOR */
/* */
/* Chaoqiong Xiao, Microsoft Corporation */
@ -68,6 +68,9 @@
/* DATE NAME DESCRIPTION */
/* */
/* 02-02-2021 Chaoqiong Xiao Initial Version 6.1.4 */
/* 06-02-2021 Chaoqiong Xiao Modified comment(s), */
/* fixed trace enabled error, */
/* resulting in version 6.1.7 */
/* */
/**************************************************************************/
UINT _ux_host_stack_device_configuration_deactivate(UX_DEVICE *device)
@ -92,6 +95,9 @@ UINT status;
return(UX_DEVICE_HANDLE_UNKNOWN);
}
/* Get the configuration. */
configuration = device -> ux_device_current_configuration;
/* If trace is enabled, insert this event into the trace buffer. */
UX_TRACE_IN_LINE_INSERT(UX_TRACE_HOST_STACK_DEVICE_CONFIGURATION_DEACTIVATE, device, configuration, 0, 0, UX_TRACE_HOST_STACK_EVENTS, 0, 0)
@ -112,9 +118,6 @@ UINT status;
return(UX_SEMAPHORE_ERROR);
}
/* Get the configuration. */
configuration = device -> ux_device_current_configuration;
/* Check for the state of the device, if not configured, we are done. */
if (device -> ux_device_state != UX_DEVICE_CONFIGURED)
{

View File

@ -34,7 +34,7 @@
/* FUNCTION RELEASE */
/* */
/* _ux_host_stack_endpoint_instance_create PORTABLE C */
/* 6.1 */
/* 6.1.7 */
/* AUTHOR */
/* */
/* Chaoqiong Xiao, Microsoft Corporation */
@ -73,6 +73,11 @@
/* optimized based on compile */
/* definitions, */
/* resulting in version 6.1 */
/* 06-02-2021 Chaoqiong Xiao Modified comment(s), */
/* fixed trace enabled error, */
/* filled default endpoint */
/* request endpoint pointer, */
/* resulting in version 6.1.7 */
/* */
/**************************************************************************/
UINT _ux_host_stack_endpoint_instance_create(UX_ENDPOINT *endpoint)
@ -87,7 +92,7 @@ UCHAR endpoint_type;
hcd = UX_DEVICE_HCD_GET(endpoint -> ux_endpoint_device);
/* If trace is enabled, insert this event into the trace buffer. */
UX_TRACE_IN_LINE_INSERT(UX_TRACE_HOST_STACK_ENDPOINT_INSTANCE_CREATE, device, endpoint, 0, 0, UX_TRACE_HOST_STACK_EVENTS, 0, 0)
UX_TRACE_IN_LINE_INSERT(UX_TRACE_HOST_STACK_ENDPOINT_INSTANCE_CREATE, endpoint -> ux_endpoint_device, endpoint, 0, 0, UX_TRACE_HOST_STACK_EVENTS, 0, 0)
/* If the endpoint needs guaranteed bandwidth, check if we have enough */

View File

@ -34,7 +34,7 @@
/* FUNCTION RELEASE */
/* */
/* _ux_host_stack_endpoint_instance_delete PORTABLE C */
/* 6.1 */
/* 6.1.7 */
/* AUTHOR */
/* */
/* Chaoqiong Xiao, Microsoft Corporation */
@ -72,6 +72,9 @@
/* optimized based on compile */
/* definitions, */
/* resulting in version 6.1 */
/* 06-02-2021 Chaoqiong Xiao Modified comment(s), */
/* fixed trace enabled error, */
/* resulting in version 6.1.7 */
/* */
/**************************************************************************/
VOID _ux_host_stack_endpoint_instance_delete(UX_ENDPOINT *endpoint)
@ -84,7 +87,7 @@ UX_HCD *hcd;
hcd = UX_DEVICE_HCD_GET(endpoint -> ux_endpoint_device);
/* If trace is enabled, insert this event into the trace buffer. */
UX_TRACE_IN_LINE_INSERT(UX_TRACE_HOST_STACK_ENDPOINT_INSTANCE_DELETE, device, endpoint, 0, 0, UX_TRACE_HOST_STACK_EVENTS, 0, 0)
UX_TRACE_IN_LINE_INSERT(UX_TRACE_HOST_STACK_ENDPOINT_INSTANCE_DELETE, endpoint -> ux_endpoint_device, endpoint, 0, 0, UX_TRACE_HOST_STACK_EVENTS, 0, 0)
/* Ensure the endpoint had its physical ED allocated. */
if (endpoint -> ux_endpoint_ed != UX_NULL)

View File

@ -34,7 +34,7 @@
/* FUNCTION RELEASE */
/* */
/* _ux_host_stack_transfer_request_abort PORTABLE C */
/* 6.1 */
/* 6.1.7 */
/* AUTHOR */
/* */
/* Chaoqiong Xiao, Microsoft Corporation */
@ -77,6 +77,9 @@
/* optimized based on compile */
/* definitions, */
/* resulting in version 6.1 */
/* 06-02-2021 Chaoqiong Xiao Modified comment(s), */
/* fixed trace enabled error, */
/* resulting in version 6.1.7 */
/* */
/**************************************************************************/
UINT _ux_host_stack_transfer_request_abort(UX_TRANSFER *transfer_request)
@ -87,7 +90,10 @@ ULONG completion_code;
/* If trace is enabled, insert this event into the trace buffer. */
UX_TRACE_IN_LINE_INSERT(UX_TRACE_HOST_STACK_TRANSFER_REQUEST_ABORT, device, endpoint, transfer_request, 0, UX_TRACE_HOST_STACK_EVENTS, 0, 0)
UX_TRACE_IN_LINE_INSERT(UX_TRACE_HOST_STACK_TRANSFER_REQUEST_ABORT,
transfer_request -> ux_transfer_request_endpoint -> ux_endpoint_device,
transfer_request -> ux_transfer_request_endpoint,
transfer_request, 0, UX_TRACE_HOST_STACK_EVENTS, 0, 0)
/* With the device we have the pointer to the HCD. */
hcd = UX_DEVICE_HCD_GET(transfer_request -> ux_transfer_request_endpoint -> ux_endpoint_device);

View File

@ -35,7 +35,7 @@
/* FUNCTION RELEASE */
/* */
/* _ux_device_class_storage_thread PORTABLE C */
/* 6.1.6 */
/* 6.1.7 */
/* AUTHOR */
/* */
/* Chaoqiong Xiao, Microsoft Corporation */
@ -107,6 +107,10 @@
/* fixed compile issues with */
/* some macro options, */
/* resulting in version 6.1.6 */
/* 06-02-2021 Chaoqiong Xiao Modified comment(s), */
/* get interface and endpoints */
/* from configured device, */
/* resulting in version 6.1.7 */
/* */
/**************************************************************************/
VOID _ux_device_class_storage_thread(ULONG storage_class)
@ -140,6 +144,13 @@ UCHAR *cbw_cb;
/* Get the pointer to the device. */
device = &_ux_system_slave -> ux_system_slave_device;
/* As long as the device is in the CONFIGURED state. */
while (device -> ux_slave_device_state == UX_DEVICE_CONFIGURED)
{
/* We assume the worst situation. */
status = UX_ERROR;
/* This is the first time we are activated. We need the interface to the class. */
interface = storage -> ux_slave_class_storage_interface;
@ -166,13 +177,6 @@ UCHAR *cbw_cb;
/* All SCSI commands are on the endpoint OUT, from the host. */
transfer_request = &endpoint_out -> ux_slave_endpoint_transfer_request;
/* As long as the device is in the CONFIGURED state. */
while (device -> ux_slave_device_state == UX_DEVICE_CONFIGURED)
{
/* We assume the worst situation. */
status = UX_ERROR;
/* Check state, they must be both RESET. */
if (endpoint_out -> ux_slave_endpoint_state == UX_ENDPOINT_RESET &&
(UCHAR)storage -> ux_slave_class_storage_csw_status != UX_SLAVE_CLASS_STORAGE_CSW_PHASE_ERROR)