Skip to content

Commit 26585e4

Browse files
committed
Update on 23 Oct 2023. Expand to see details.
52c60057 Update headers and readme for 6.3.0 release. 5360ad52 Host H264 frame support. 4b097e80 Add javascript to codeql detection 70278ae3 Fixed use after free issues. 5560620e Improved standalone enum transfer flow. Turn off ASIX in standalone build. Im... 39a01206 Improved host HID clients (mouse/keyboard/remote control) deactivation sequence. be2c7fd5 Improved standalone host CDC ACM control and data instance link management (MSRC 81489,81570) c2368eb2 Improved AC AS management and error handing. b9c23b38 PIMA Host/device optional interrupt endpoint support and host unused semaphore removal. 34ca3af9 Removed interface link in class linked to device. 5d3c9dd0 Improved endpoints get error handling (host CDC-ECM/ACM, storage). Moved stor... 71b08ad1 Improved host audio descriptors validation 4717e3f1 Enable weekly pipeline build to avoid CodeQL expiration ca408b54 Checked XML tag nesting depth in Pictbridge object parsing c300a00c Limited pictbridge array element to hexa output array size. 0e644aaa Reject fake CDC-ECM data interface not located next to its control interface. 911007a9 Improved host HID usage handling. d0576877 Enable dummy check of python for CodeQL 2761e105 Fixed some split transfer issue. db0dbeda Added packet length validation for received nx packet. f5007249 Fix PIMA issues on data set extraction 3ec66399 Fixing device RNDIS bugs with zero copy 1ec77d6b Fix device HID issue when adding class memory man and zero copy. d52e55c0 Add zero copy support in device printer a5cb883f Added zero copy support in device CDC_ECM and RNDIS 1f967ae2 Enable codeql in onebranch pipeline de265dbc Enable zero copy for device audio and video 53aee275 Refined memory management to reduce overhead.
1 parent 7c928b4 commit 26585e4

File tree

347 files changed

+3847
-2588
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

347 files changed

+3847
-2588
lines changed

common/core/CMakeLists.txt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -185,6 +185,8 @@ target_sources(${PROJECT_NAME} PRIVATE
185185
${CMAKE_CURRENT_LIST_DIR}/src/ux_utility_memory_copy.c
186186
${CMAKE_CURRENT_LIST_DIR}/src/ux_utility_memory_free.c
187187
${CMAKE_CURRENT_LIST_DIR}/src/ux_utility_memory_free_block_best_get.c
188+
${CMAKE_CURRENT_LIST_DIR}/src/ux_utility_memory_byte_pool_create.c
189+
${CMAKE_CURRENT_LIST_DIR}/src/ux_utility_memory_byte_pool_search.c
188190
${CMAKE_CURRENT_LIST_DIR}/src/ux_utility_memory_set.c
189191
${CMAKE_CURRENT_LIST_DIR}/src/ux_utility_mutex_create.c
190192
${CMAKE_CURRENT_LIST_DIR}/src/ux_utility_mutex_delete.c

common/core/inc/ux_api.h

Lines changed: 549 additions & 519 deletions
Large diffs are not rendered by default.

common/core/inc/ux_device_class_dpump.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@
2626
/* COMPONENT DEFINITION RELEASE */
2727
/* */
2828
/* ux_device_class_dpump.h PORTABLE C */
29-
/* 6.x */
29+
/* 6.3.0 */
3030
/* AUTHOR */
3131
/* */
3232
/* Chaoqiong Xiao, Microsoft Corporation */
@@ -50,10 +50,10 @@
5050
/* 01-31-2022 Chaoqiong Xiao Modified comment(s), */
5151
/* added standalone support, */
5252
/* resulting in version 6.1.10 */
53-
/* xx-xx-xxxx Chaoqiong Xiao Modified comment(s), */
53+
/* 10-31-2023 Chaoqiong Xiao Modified comment(s), */
5454
/* added a new mode to manage */
5555
/* endpoint buffer in classes, */
56-
/* resulting in version 6.x */
56+
/* resulting in version 6.3.0 */
5757
/* */
5858
/**************************************************************************/
5959

common/core/inc/ux_device_stack.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@
2525
/* COMPONENT DEFINITION RELEASE */
2626
/* */
2727
/* ux_device_stack.h PORTABLE C */
28-
/* 6.x */
28+
/* 6.3.0 */
2929
/* AUTHOR */
3030
/* */
3131
/* Chaoqiong Xiao, Microsoft Corporation */
@@ -53,9 +53,9 @@
5353
/* fixed parameter/variable */
5454
/* names conflict C++ keyword, */
5555
/* resulting in version 6.1.12 */
56-
/* xx-xx-xxxx Chaoqiong Xiao Modified comment(s), */
56+
/* 10-31-2023 Chaoqiong Xiao Modified comment(s), */
5757
/* added error checks support, */
58-
/* resulting in version 6.x */
58+
/* resulting in version 6.3.0 */
5959
/* */
6060
/**************************************************************************/
6161

common/core/inc/ux_host_stack.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@
2626
/* COMPONENT DEFINITION RELEASE */
2727
/* */
2828
/* ux_host_stack.h PORTABLE C */
29-
/* 6.x */
29+
/* 6.3.0 */
3030
/* AUTHOR */
3131
/* */
3232
/* Chaoqiong Xiao, Microsoft Corporation */
@@ -65,9 +65,9 @@
6565
/* names conflict C++ keyword, */
6666
/* added standalone HUB, */
6767
/* resulting in version 6.1.12 */
68-
/* xx-xx-xxxx Chaoqiong Xiao Modified comment(s), */
68+
/* 10-31-2023 Chaoqiong Xiao Modified comment(s), */
6969
/* added error checks support, */
70-
/* resulting in version 6.x */
70+
/* resulting in version 6.3.0 */
7171
/* */
7272
/**************************************************************************/
7373

common/core/inc/ux_system.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@
2626
/* COMPONENT DEFINITION RELEASE */
2727
/* */
2828
/* ux_system.h PORTABLE C */
29-
/* 6.x */
29+
/* 6.3.0 */
3030
/* AUTHOR */
3131
/* */
3232
/* Chaoqiong Xiao, Microsoft Corporation */
@@ -53,9 +53,9 @@
5353
/* 04-25-2022 Chaoqiong Xiao Modified comment(s), */
5454
/* added device CCID name, */
5555
/* resulting in version 6.1.11 */
56-
/* xx-xx-xxxx Chaoqiong Xiao Modified comment(s), */
56+
/* 10-31-2023 Chaoqiong Xiao Modified comment(s), */
5757
/* added error checks support, */
58-
/* resulting in version 6.x */
58+
/* resulting in version 6.3.0 */
5959
/* */
6060
/**************************************************************************/
6161

common/core/inc/ux_user_sample.h

Lines changed: 28 additions & 6 deletions
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.x */
29+
/* 6.3.0 */
3030
/* */
3131
/* AUTHOR */
3232
/* */
@@ -99,14 +99,15 @@
9999
/* added option to enable */
100100
/* basic USBX error checking, */
101101
/* resulting in version 6.2.1 */
102-
/* xx-xx-xxxx Xiuwen Cai, CQ Xiao Modified comment(s), */
102+
/* 10-31-2023 Xiuwen Cai, CQ Xiao Modified comment(s), */
103+
/* refined memory management, */
103104
/* added zero copy support */
104105
/* in many device classes, */
105106
/* added a new mode to manage */
106107
/* endpoint buffer in classes, */
107108
/* added option for get string */
108109
/* requests with zero wIndex, */
109-
/* resulting in version 6.x */
110+
/* resulting in version 6.3.0 */
110111
/* */
111112
/**************************************************************************/
112113

@@ -141,8 +142,8 @@
141142
also refer to ux_port.h for descriptions on each of these options. */
142143

143144
/* Defined, this value represents minimal allocated memory alignment in number of bytes.
144-
The default is UX_ALIGN_16 (0x0f) to align allocated memory to 16 bytes. */
145-
/* #define UX_ALIGN_MIN UX_ALIGN_16 */
145+
The default is UX_ALIGN_8 (0x07) to align allocated memory to 8 bytes. */
146+
/* #define UX_ALIGN_MIN UX_ALIGN_8 */
146147

147148
/* Defined, this value represents how many ticks per seconds for a specific hardware platform.
148149
The default is 1000 indicating 1 tick per millisecond. */
@@ -239,7 +240,7 @@
239240
*/
240241
/* #define UX_DEVICE_CLASS_CDC_ACM_ZERO_COPY */
241242

242-
/* Defined, it enables zero copy and flexible queue support (works if HID owns endpoint buffer).
243+
/* Defined, it enables device HID zero copy and flexible queue support (works if HID owns endpoint buffer).
243244
Enabled, the internal queue buffer is directly used for transfer, the APIs are kept to keep
244245
backword compatibility, to AVOID KEEPING BUFFERS IN APPLICATION.
245246
Flexible queue introduces initialization parameter _event_max_number and _event_max_length,
@@ -252,6 +253,27 @@
252253
*/
253254
/* #define UX_DEVICE_CLASS_HID_ZERO_COPY */
254255

256+
/* Defined, it enables device CDC_ECM zero copy support (works if CDC_ECM owns endpoint buffer).
257+
Enabled, it requires that the NX IP default packet pool is in cache safe area, and buffer max
258+
size is larger than UX_DEVICE_CLASS_CDC_ECM_ETHERNET_PACKET_SIZE (1536).
259+
*/
260+
/* #define UX_DEVICE_CLASS_CDC_ECM_ZERO_COPY */
261+
262+
/* Defined, it enables device RNDIS zero copy support (works if RNDIS owns endpoint buffer).
263+
Enabled, it requires that the NX IP default packet pool is in cache safe area, and buffer max
264+
size is larger than UX_DEVICE_CLASS_RNDIS_MAX_PACKET_TRANSFER_SIZE (1600).
265+
*/
266+
/* #define UX_DEVICE_CLASS_RNDIS_ZERO_COPY */
267+
268+
/* Defined, it enables zero copy support (works if PRINTER owns endpoint buffer).
269+
Defined, it enables zero copy for bulk in/out endpoints (write/read). In this case, the endpoint
270+
buffer is not allocated in class, application must provide the buffer for read/write, and the
271+
buffer must meet device controller driver (DCD) buffer requirements (e.g., aligned and cache
272+
safe if buffer is for DMA).
273+
*/
274+
/* #define UX_DEVICE_CLASS_PRINTER_ZERO_COPY */
275+
276+
255277
/* Defined, this value represents the maximum number of bytes that can be received or transmitted
256278
on any endpoint. This value cannot be less than the maximum packet size of any endpoint. The default
257279
is 4096 bytes but can be reduced in memory constrained environments. For cd-rom support in the storage

common/core/inc/ux_utility.h

Lines changed: 23 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,8 @@
1212

1313
/**************************************************************************/
1414
/**************************************************************************/
15-
/** */
16-
/** USBX Component */
15+
/** */
16+
/** USBX Component */
1717
/** */
1818
/** Utility */
1919
/** */
@@ -26,20 +26,20 @@
2626
/* COMPONENT DEFINITION RELEASE */
2727
/* */
2828
/* ux_utility.h PORTABLE C */
29-
/* 6.x */
29+
/* 6.3.0 */
3030
/* AUTHOR */
3131
/* */
3232
/* Chaoqiong Xiao, Microsoft Corporation */
3333
/* */
3434
/* DESCRIPTION */
35-
/* */
35+
/* */
3636
/* This file contains all the header and extern functions used by the */
37-
/* USBX components that utilize utility functions. */
38-
/* */
39-
/* RELEASE HISTORY */
40-
/* */
41-
/* DATE NAME DESCRIPTION */
42-
/* */
37+
/* USBX components that utilize utility functions. */
38+
/* */
39+
/* RELEASE HISTORY */
40+
/* */
41+
/* DATE NAME DESCRIPTION */
42+
/* */
4343
/* 05-19-2020 Chaoqiong Xiao Initial Version 6.0 */
4444
/* 09-30-2020 Chaoqiong Xiao Modified comment(s), */
4545
/* added timer delete, used UX */
@@ -57,10 +57,11 @@
5757
/* added macros for RTOS calls,*/
5858
/* fixed OHCI PRSC issue, */
5959
/* resulting in version 6.1.12 */
60-
/* xx-xx-xxxx Chaoqiong Xiao Modified comment(s), */
60+
/* 10-31-2023 Chaoqiong Xiao Modified comment(s), */
61+
/* refined memory management, */
6162
/* added new function to check */
6263
/* parsed size of descriptor, */
63-
/* resulting in version 6.x */
64+
/* resulting in version 6.3.0 */
6465
/* */
6566
/**************************************************************************/
6667

@@ -86,9 +87,10 @@ VOID _ux_utility_memory_copy(VOID *memory_destination, VOID *memory_
8687
VOID _ux_utility_memory_free(VOID *memory);
8788
ULONG _ux_utility_string_length_get(UCHAR *string);
8889
UINT _ux_utility_string_length_check(UCHAR *input_string, UINT *string_length_ptr, UINT max_string_length);
89-
UX_MEMORY_BLOCK *_ux_utility_memory_free_block_best_get(ULONG memory_cache_flag, ULONG memory_size_requested);
90+
UCHAR *_ux_utility_memory_byte_pool_search(UX_MEMORY_BYTE_POOL *pool_ptr, ULONG memory_size);
91+
UINT _ux_utility_memory_byte_pool_create(UX_MEMORY_BYTE_POOL *pool_ptr, VOID *pool_start, ULONG pool_size);
9092
VOID _ux_utility_memory_set(VOID *destination, UCHAR value, ULONG length);
91-
ULONG _ux_utility_pci_class_scan(ULONG pci_class, ULONG bus_number, ULONG device_number,
93+
ULONG _ux_utility_pci_class_scan(ULONG pci_class, ULONG bus_number, ULONG device_number,
9294
ULONG function_number, ULONG *current_bus_number,
9395
ULONG *current_device_number, ULONG *current_function_number);
9496
ULONG _ux_utility_pci_read(ULONG bus_number, ULONG device_number, ULONG function_number,
@@ -116,9 +118,9 @@ UINT _ux_utility_semaphore_create(UX_SEMAPHORE *semaphore, CHAR *sem
116118
UINT _ux_utility_semaphore_delete(UX_SEMAPHORE *semaphore);
117119
UINT _ux_utility_semaphore_get(UX_SEMAPHORE *semaphore, ULONG semaphore_signal);
118120
UINT _ux_utility_semaphore_put(UX_SEMAPHORE *semaphore);
119-
UINT _ux_utility_thread_create(UX_THREAD *thread_ptr, CHAR *name,
121+
UINT _ux_utility_thread_create(UX_THREAD *thread_ptr, CHAR *name,
120122
VOID (*entry_function)(ULONG), ULONG entry_input,
121-
VOID *stack_start, ULONG stack_size,
123+
VOID *stack_start, ULONG stack_size,
122124
UINT priority, UINT preempt_threshold,
123125
ULONG time_slice, UINT auto_start);
124126
UINT _ux_utility_thread_delete(UX_THREAD *thread_ptr);
@@ -129,12 +131,12 @@ UINT _ux_utility_thread_sleep(ULONG ticks);
129131
UINT _ux_utility_thread_suspend(UX_THREAD *thread_ptr);
130132
UX_THREAD *_ux_utility_thread_identify(VOID);
131133
UINT _ux_utility_timer_create(UX_TIMER *timer, CHAR *timer_name, VOID (*expiration_function) (ULONG),
132-
ULONG expiration_input, ULONG initial_ticks, ULONG reschedule_ticks,
134+
ULONG expiration_input, ULONG initial_ticks, ULONG reschedule_ticks,
133135
UINT activation_flag);
134136
UINT _ux_utility_timer_delete(UX_TIMER *timer);
135137
UINT _ux_utility_event_flags_create(UX_EVENT_FLAGS_GROUP*group_ptr, CHAR *name);
136138
UINT _ux_utility_event_flags_delete(UX_EVENT_FLAGS_GROUP*group_ptr);
137-
UINT _ux_utility_event_flags_get(UX_EVENT_FLAGS_GROUP*group_ptr, ULONG requested_flags,
139+
UINT _ux_utility_event_flags_get(UX_EVENT_FLAGS_GROUP*group_ptr, ULONG requested_flags,
138140
UINT get_option, ULONG *actual_flags_ptr, ULONG wait_option);
139141
UINT _ux_utility_event_flags_set(UX_EVENT_FLAGS_GROUP*group_ptr, ULONG flags_to_set,
140142
UINT set_option);
@@ -399,7 +401,7 @@ VOID* _ux_utility_memory_allocate_add_safe(ULONG align,ULONG cache,UL
399401

400402

401403
/* Define the system API mappings.
402-
Note: this section is only applicable to
404+
Note: this section is only applicable to
403405
application source code, hence the conditional that turns off this
404406
stuff when the include file is processed by the ThreadX source. */
405407

@@ -450,8 +452,8 @@ VOID* _ux_utility_memory_allocate_add_safe(ULONG align,ULONG cache,UL
450452
#define ux_utility_event_flags_set _ux_utility_event_flags_set
451453
#define ux_utility_unicode_to_string _ux_utility_unicode_to_string
452454
#define ux_utility_string_to_unicode _ux_utility_string_to_unicode
453-
#define ux_utility_delay_ms _ux_utility_delay_ms
454-
#define ux_utility_error_callback_register _ux_utility_error_callback_register
455+
#define ux_utility_delay_ms _ux_utility_delay_ms
456+
#define ux_utility_error_callback_register _ux_utility_error_callback_register
455457
#define ux_system_error_handler _ux_system_error_handler
456458

457459
#define ux_utility_time_get _ux_utility_time_get

0 commit comments

Comments
 (0)