Skip to content

Commit 6280260

Browse files
author
Bo Chen
committed
Release 6.1.7
1 parent adfe9b9 commit 6280260

10 files changed

+131
-51
lines changed

common/core/inc/ux_api.h

Lines changed: 17 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@
2626
/* APPLICATION INTERFACE DEFINITION RELEASE */
2727
/* */
2828
/* ux_api.h PORTABLE C */
29-
/* 6.1.6 */
29+
/* 6.1.7 */
3030
/* AUTHOR */
3131
/* */
3232
/* Chaoqiong Xiao, Microsoft Corporation */
@@ -87,6 +87,11 @@
8787
/* added macros for Word/DWord */
8888
/* to bytes extraction, */
8989
/* resulting in version 6.1.6 */
90+
/* 06-02-2021 Chaoqiong Xiao Modified comment(s), */
91+
/* added trace dependency test,*/
92+
/* changed transfer timeout */
93+
/* value, */
94+
/* resulting in version 6.1.7 */
9095
/* */
9196
/**************************************************************************/
9297

@@ -221,7 +226,7 @@ typedef signed char SCHAR;
221226
#define AZURE_RTOS_USBX
222227
#define USBX_MAJOR_VERSION 6
223228
#define USBX_MINOR_VERSION 1
224-
#define USBX_PATCH_VERSION 6
229+
#define USBX_PATCH_VERSION 7
225230

226231
/* Macros for concatenating tokens, where UX_CONCATn concatenates n tokens. */
227232

@@ -330,6 +335,9 @@ VOID _ux_utility_debug_log(UCHAR *debug_location, UCHAR *debug_message, ULONG de
330335
/* Determine if tracing is enabled. */
331336

332337
#ifdef TX_ENABLE_EVENT_TRACE
338+
#ifndef UX_TRACE_INSERT_MACROS
339+
#error UX_TRACE_INSERT_MACROS must be defined to support TX_ENABLE_EVENT_TRACE
340+
#endif
333341

334342
/* Trace is enabled. Remap calls so that interrupts can be disabled around the actual event logging. */
335343

@@ -999,8 +1007,13 @@ VOID _ux_trace_event_update(TX_TRACE_BUFFER_ENTRY *event, ULONG timestamp, UL
9991007
#define UX_CAPABILITY_CONFIGURATION_SUMMARY 0x10u
10001008

10011009

1002-
#define UX_CONTROL_TRANSFER_TIMEOUT 1000
1003-
#define UX_NON_CONTROL_TRANSFER_TIMEOUT 5000
1010+
#ifndef UX_CONTROL_TRANSFER_TIMEOUT
1011+
#define UX_CONTROL_TRANSFER_TIMEOUT 10000
1012+
#endif
1013+
1014+
#ifndef UX_NON_CONTROL_TRANSFER_TIMEOUT
1015+
#define UX_NON_CONTROL_TRANSFER_TIMEOUT 50000
1016+
#endif
10041017
#define UX_PORT_ENABLE_WAIT 50
10051018
#define UX_DEVICE_ADDRESS_SET_WAIT 50
10061019
#define UX_HIGH_SPEED_DETECTION_HANDSHAKE_SUSPEND_WAIT 200

common/core/inc/ux_user_sample.h

Lines changed: 18 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@
2626
/* PORT SPECIFIC C INFORMATION RELEASE */
2727
/* */
2828
/* ux_user.h PORTABLE C */
29-
/* 6.1.6 */
29+
/* 6.1.7 */
3030
/* */
3131
/* AUTHOR */
3232
/* */
@@ -58,6 +58,10 @@
5858
/* added macro to disable CDC- */
5959
/* ACM transmission support, */
6060
/* resulting in version 6.1.6 */
61+
/* 06-02-2021 Xiuwen Cai Modified comment(s), added */
62+
/* transfer timeout value */
63+
/* options, */
64+
/* resulting in version 6.1.7 */
6165
/* */
6266
/**************************************************************************/
6367

@@ -96,6 +100,19 @@
96100
*/
97101
#define UX_PERIODIC_RATE (TX_TIMER_TICKS_PER_SECOND)
98102

103+
/* Define control transfer timeout value in millisecond.
104+
The default is 10000 milliseconds. */
105+
/*
106+
#define UX_CONTROL_TRANSFER_TIMEOUT 10000
107+
*/
108+
109+
/* Define non control transfer timeout value in millisecond.
110+
The default is 50000 milliseconds. */
111+
/*
112+
#define UX_NON_CONTROL_TRANSFER_TIMEOUT 50000
113+
*/
114+
115+
99116
/* Defined, this value is the maximum number of classes that can be loaded by USBX. This value
100117
represents the class container and not the number of instances of a class. For instance, if a
101118
particular implementation of USBX needs the hub class, the printer class, and the storage

common/core/src/ux_dcd_sim_slave_endpoint_reset.c

Lines changed: 26 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@
3434
/* FUNCTION RELEASE */
3535
/* */
3636
/* _ux_dcd_sim_slave_endpoint_reset PORTABLE C */
37-
/* 6.1 */
37+
/* 6.1.7 */
3838
/* AUTHOR */
3939
/* */
4040
/* Chaoqiong Xiao, Microsoft Corporation */
@@ -67,20 +67,44 @@
6767
/* 05-19-2020 Chaoqiong Xiao Initial Version 6.0 */
6868
/* 09-30-2020 Chaoqiong Xiao Modified comment(s), */
6969
/* resulting in version 6.1 */
70+
/* 06-02-2021 Chaoqiong Xiao Modified comment(s), */
71+
/* cleared transfer flag and */
72+
/* waked up suspended thread, */
73+
/* resulting in version 6.1.7 */
7074
/* */
7175
/**************************************************************************/
7276
UINT _ux_dcd_sim_slave_endpoint_reset(UX_DCD_SIM_SLAVE *dcd_sim_slave, UX_SLAVE_ENDPOINT *endpoint)
7377
{
7478

7579
UX_DCD_SIM_SLAVE_ED *ed;
80+
ULONG transfer_waiting;
81+
UX_SLAVE_TRANSFER *transfer;
7682

7783
UX_PARAMETER_NOT_USED(dcd_sim_slave);
7884

7985
/* Get the physical endpoint address in the endpoint container. */
8086
ed = (UX_DCD_SIM_SLAVE_ED *) endpoint -> ux_slave_endpoint_ed;
8187

88+
/* Save waiting status for non-zero endpoints. */
89+
if (ed -> ux_sim_slave_ed_index)
90+
{
91+
transfer_waiting = ed -> ux_sim_slave_ed_status;
92+
transfer_waiting &= UX_DCD_SIM_SLAVE_ED_STATUS_TRANSFER;
93+
}
94+
else
95+
transfer_waiting = 0;
96+
8297
/* Set the state of the endpoint to not stalled. */
83-
ed -> ux_sim_slave_ed_status &= ~(ULONG)UX_DCD_SIM_SLAVE_ED_STATUS_STALLED;
98+
ed -> ux_sim_slave_ed_status &= ~(ULONG)(UX_DCD_SIM_SLAVE_ED_STATUS_STALLED |
99+
transfer_waiting);
100+
101+
/* If some thread is pending, signal wakeup. */
102+
if (transfer_waiting)
103+
{
104+
transfer = &endpoint -> ux_slave_endpoint_transfer_request;
105+
transfer -> ux_slave_transfer_request_completion_code = UX_TRANSFER_BUS_RESET;
106+
_ux_utility_semaphore_put(&transfer -> ux_slave_transfer_request_semaphore);
107+
}
84108

85109
/* This function never fails. */
86110
return(UX_SUCCESS);

common/core/src/ux_host_stack_class_device_scan.c

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@
4141
/* FUNCTION RELEASE */
4242
/* */
4343
/* _ux_host_stack_class_device_scan PORTABLE C */
44-
/* 6.1 */
44+
/* 6.1.7 */
4545
/* AUTHOR */
4646
/* */
4747
/* Chaoqiong Xiao, Microsoft Corporation */
@@ -78,6 +78,9 @@
7878
/* used query usage of device */
7979
/* ClassSubclassProtocol, */
8080
/* resulting in version 6.1 */
81+
/* 06-02-2021 Bhupendra Naphade Modified comment(s), */
82+
/* removed duplicate line, */
83+
/* resulting in version 6.1.7 */
8184
/* */
8285
/**************************************************************************/
8386
UINT _ux_host_stack_class_device_scan(UX_DEVICE *device)
@@ -95,7 +98,6 @@ UX_HOST_CLASS_COMMAND class_command;
9598
class_command.ux_host_class_command_pid = device -> ux_device_descriptor.idProduct;
9699
class_command.ux_host_class_command_class = device -> ux_device_descriptor.bDeviceClass;
97100
class_command.ux_host_class_command_subclass = device -> ux_device_descriptor.bDeviceSubClass;
98-
class_command.ux_host_class_command_subclass = device -> ux_device_descriptor.bDeviceSubClass;
99101
class_command.ux_host_class_command_protocol = device -> ux_device_descriptor.bDeviceProtocol;
100102
class_command.ux_host_class_command_iad_class = 0;
101103
class_command.ux_host_class_command_iad_subclass = 0;

common/core/src/ux_host_stack_device_configuration_activate.c

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@
3434
/* FUNCTION RELEASE */
3535
/* */
3636
/* _ux_host_stack_device_configuration_activate PORTABLE C */
37-
/* 6.1.4 */
37+
/* 6.1.7 */
3838
/* AUTHOR */
3939
/* */
4040
/* Chaoqiong Xiao, Microsoft Corporation */
@@ -71,6 +71,9 @@
7171
/* DATE NAME DESCRIPTION */
7272
/* */
7373
/* 02-02-2021 Chaoqiong Xiao Initial Version 6.1.4 */
74+
/* 06-02-2021 Chaoqiong Xiao Modified comment(s), */
75+
/* fixed trace enabled error, */
76+
/* resulting in version 6.1.7 */
7477
/* */
7578
/**************************************************************************/
7679
UINT _ux_host_stack_device_configuration_activate(UX_CONFIGURATION *configuration)
@@ -93,12 +96,12 @@ UINT status;
9396
return(UX_CONFIGURATION_HANDLE_UNKNOWN);
9497
}
9598

96-
/* If trace is enabled, insert this event into the trace buffer. */
97-
UX_TRACE_IN_LINE_INSERT(UX_TRACE_HOST_STACK_DEVICE_CONFIGURATION_ACTIVATE, device, configuration, 0, 0, UX_TRACE_HOST_STACK_EVENTS, 0, 0)
98-
9999
/* Get the device container for this configuration. */
100100
device = configuration -> ux_configuration_device;
101101

102+
/* If trace is enabled, insert this event into the trace buffer. */
103+
UX_TRACE_IN_LINE_INSERT(UX_TRACE_HOST_STACK_DEVICE_CONFIGURATION_ACTIVATE, device, configuration, 0, 0, UX_TRACE_HOST_STACK_EVENTS, 0, 0)
104+
102105
/* Protect the control endpoint semaphore here. It will be unprotected in the
103106
transfer request function. */
104107
status = _ux_utility_semaphore_get(&device -> ux_device_protection_semaphore, UX_WAIT_FOREVER);

common/core/src/ux_host_stack_device_configuration_deactivate.c

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@
3434
/* FUNCTION RELEASE */
3535
/* */
3636
/* _ux_host_stack_device_configuration_deactivate PORTABLE C */
37-
/* 6.1.4 */
37+
/* 6.1.7 */
3838
/* AUTHOR */
3939
/* */
4040
/* Chaoqiong Xiao, Microsoft Corporation */
@@ -68,6 +68,9 @@
6868
/* DATE NAME DESCRIPTION */
6969
/* */
7070
/* 02-02-2021 Chaoqiong Xiao Initial Version 6.1.4 */
71+
/* 06-02-2021 Chaoqiong Xiao Modified comment(s), */
72+
/* fixed trace enabled error, */
73+
/* resulting in version 6.1.7 */
7174
/* */
7275
/**************************************************************************/
7376
UINT _ux_host_stack_device_configuration_deactivate(UX_DEVICE *device)
@@ -92,6 +95,9 @@ UINT status;
9295
return(UX_DEVICE_HANDLE_UNKNOWN);
9396
}
9497

98+
/* Get the configuration. */
99+
configuration = device -> ux_device_current_configuration;
100+
95101
/* If trace is enabled, insert this event into the trace buffer. */
96102
UX_TRACE_IN_LINE_INSERT(UX_TRACE_HOST_STACK_DEVICE_CONFIGURATION_DEACTIVATE, device, configuration, 0, 0, UX_TRACE_HOST_STACK_EVENTS, 0, 0)
97103

@@ -112,9 +118,6 @@ UINT status;
112118
return(UX_SEMAPHORE_ERROR);
113119
}
114120

115-
/* Get the configuration. */
116-
configuration = device -> ux_device_current_configuration;
117-
118121
/* Check for the state of the device, if not configured, we are done. */
119122
if (device -> ux_device_state != UX_DEVICE_CONFIGURED)
120123
{

common/core/src/ux_host_stack_endpoint_instance_create.c

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@
3434
/* FUNCTION RELEASE */
3535
/* */
3636
/* _ux_host_stack_endpoint_instance_create PORTABLE C */
37-
/* 6.1 */
37+
/* 6.1.7 */
3838
/* AUTHOR */
3939
/* */
4040
/* Chaoqiong Xiao, Microsoft Corporation */
@@ -73,6 +73,11 @@
7373
/* optimized based on compile */
7474
/* definitions, */
7575
/* resulting in version 6.1 */
76+
/* 06-02-2021 Chaoqiong Xiao Modified comment(s), */
77+
/* fixed trace enabled error, */
78+
/* filled default endpoint */
79+
/* request endpoint pointer, */
80+
/* resulting in version 6.1.7 */
7681
/* */
7782
/**************************************************************************/
7883
UINT _ux_host_stack_endpoint_instance_create(UX_ENDPOINT *endpoint)
@@ -87,7 +92,7 @@ UCHAR endpoint_type;
8792
hcd = UX_DEVICE_HCD_GET(endpoint -> ux_endpoint_device);
8893

8994
/* If trace is enabled, insert this event into the trace buffer. */
90-
UX_TRACE_IN_LINE_INSERT(UX_TRACE_HOST_STACK_ENDPOINT_INSTANCE_CREATE, device, endpoint, 0, 0, UX_TRACE_HOST_STACK_EVENTS, 0, 0)
95+
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)
9196

9297

9398
/* If the endpoint needs guaranteed bandwidth, check if we have enough */

common/core/src/ux_host_stack_endpoint_instance_delete.c

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@
3434
/* FUNCTION RELEASE */
3535
/* */
3636
/* _ux_host_stack_endpoint_instance_delete PORTABLE C */
37-
/* 6.1 */
37+
/* 6.1.7 */
3838
/* AUTHOR */
3939
/* */
4040
/* Chaoqiong Xiao, Microsoft Corporation */
@@ -72,6 +72,9 @@
7272
/* optimized based on compile */
7373
/* definitions, */
7474
/* resulting in version 6.1 */
75+
/* 06-02-2021 Chaoqiong Xiao Modified comment(s), */
76+
/* fixed trace enabled error, */
77+
/* resulting in version 6.1.7 */
7578
/* */
7679
/**************************************************************************/
7780
VOID _ux_host_stack_endpoint_instance_delete(UX_ENDPOINT *endpoint)
@@ -84,7 +87,7 @@ UX_HCD *hcd;
8487
hcd = UX_DEVICE_HCD_GET(endpoint -> ux_endpoint_device);
8588

8689
/* If trace is enabled, insert this event into the trace buffer. */
87-
UX_TRACE_IN_LINE_INSERT(UX_TRACE_HOST_STACK_ENDPOINT_INSTANCE_DELETE, device, endpoint, 0, 0, UX_TRACE_HOST_STACK_EVENTS, 0, 0)
90+
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)
8891

8992
/* Ensure the endpoint had its physical ED allocated. */
9093
if (endpoint -> ux_endpoint_ed != UX_NULL)

common/core/src/ux_host_stack_transfer_request_abort.c

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@
3434
/* FUNCTION RELEASE */
3535
/* */
3636
/* _ux_host_stack_transfer_request_abort PORTABLE C */
37-
/* 6.1 */
37+
/* 6.1.7 */
3838
/* AUTHOR */
3939
/* */
4040
/* Chaoqiong Xiao, Microsoft Corporation */
@@ -77,6 +77,9 @@
7777
/* optimized based on compile */
7878
/* definitions, */
7979
/* resulting in version 6.1 */
80+
/* 06-02-2021 Chaoqiong Xiao Modified comment(s), */
81+
/* fixed trace enabled error, */
82+
/* resulting in version 6.1.7 */
8083
/* */
8184
/**************************************************************************/
8285
UINT _ux_host_stack_transfer_request_abort(UX_TRANSFER *transfer_request)
@@ -87,7 +90,10 @@ ULONG completion_code;
8790

8891

8992
/* If trace is enabled, insert this event into the trace buffer. */
90-
UX_TRACE_IN_LINE_INSERT(UX_TRACE_HOST_STACK_TRANSFER_REQUEST_ABORT, device, endpoint, transfer_request, 0, UX_TRACE_HOST_STACK_EVENTS, 0, 0)
93+
UX_TRACE_IN_LINE_INSERT(UX_TRACE_HOST_STACK_TRANSFER_REQUEST_ABORT,
94+
transfer_request -> ux_transfer_request_endpoint -> ux_endpoint_device,
95+
transfer_request -> ux_transfer_request_endpoint,
96+
transfer_request, 0, UX_TRACE_HOST_STACK_EVENTS, 0, 0)
9197

9298
/* With the device we have the pointer to the HCD. */
9399
hcd = UX_DEVICE_HCD_GET(transfer_request -> ux_transfer_request_endpoint -> ux_endpoint_device);

0 commit comments

Comments
 (0)