diff options
| author | Chaoqiong Xiao <[email protected]> | 2023-05-12 07:01:07 +0000 |
|---|---|---|
| committer | Chaoqiong Xiao <[email protected]> | 2023-05-12 07:01:07 +0000 |
| commit | ef2fa7717be8ab751fdfb5d3f91e24fbbaea8dd6 (patch) | |
| tree | e252f4e5e52617043c6d6ed59a6891a173d07781 | |
| parent | 3af3626c9b4b5fefbe4016582b896ad79287df62 (diff) | |
Update on 12 May 2023. Expand to see details.
8b59a1d4 Add support for Get String requests with 0 wIndex
106c1b06 Update cfs usage
2d45d315 Optimize SRAM for extracted USB descriptors
cf97e6e9 Fixed allocated buffer pointer checking issue.
6468c588 Guard basic types.
60b3a232 Update CFS usage
55 files changed, 1299 insertions, 646 deletions
diff --git a/LICENSE.txt b/LICENSE.txt index f7f32e2..6929d7e 100644 --- a/LICENSE.txt +++ b/LICENSE.txt @@ -2,7 +2,6 @@ MICROSOFT SOFTWARE LICENSE TERMS MICROSOFT AZURE RTOS -Shape These license terms are an agreement between you and Microsoft Corporation (or one of its affiliates). They apply to the software named above and any Microsoft @@ -14,10 +13,11 @@ HAVE THE RIGHTS BELOW. BY USING THE SOFTWARE, YOU ACCEPT THESE TERMS. 1. INSTALLATION AND USE RIGHTS. -a) General. You may install and use the software and the included Microsoft -applications solely for internal development, testing and evaluation purposes. -Any distribution or production use requires a separate license as set forth in -Section 2. +a) General. You may (I) install, use and modify the software and (ii) install and use the included Microsoft +Applications (if any), each solely for internal development, testing and evaluation purposes. +Distribution or production use is governed by the license terms set forth in +Section 2. You may also obtain distribution or production use rights through a separate agreement with +Microsoft. b) Contributions. Microsoft welcomes contributions to this software. In the event that you make a contribution to this software you will be required to agree to a @@ -25,7 +25,7 @@ Contributor License Agreement (CLA) declaring that you have the right to, and actually do, grant Microsoft the rights to use your contribution. For details, visit https://cla.microsoft.com. -c) Included Microsoft Applications. The software includes other Microsoft +c) Included Microsoft Applications. The software may include other Microsoft applications which are governed by the licenses embedded in or made available with those applications. @@ -57,7 +57,6 @@ i. You may use the software in production (e.g. program the modified or unmodifi software to devices you own or control) and distribute (i.e. make available to third parties) the modified or unmodified binary image produced from this code. - ii. You may permit your device distributors or developers to copy and distribute the binary image as programmed or to be programmed to your devices. @@ -70,17 +69,12 @@ b) Requirements. For any code you distribute, you must: i. when distributed in binary form, except as embedded in a device, include with such distribution the terms of this agreement; - ii. when distributed in source code form to distributors or developers of your devices, include with such distribution the terms of this agreement; and - -iii. indemnify, defend and hold harmless Microsoft from any claims, including -attorneys’ fees, related to the distribution or use of your devices, except to -the extent that any claim is based solely on the unmodified software. +iii. indemnify, defend and hold harmless Microsoft from any claims, including claims arising from any High Risk Uses, and inclusive of attorneys’ fees, related to the distribution or use of your devices that include the software, except to the extent that any intellectual property claim is based solely on the unmodified software. c) Restrictions. You may not: - -i. use or modify the software to create a competing real time operating system +i. use or modify the software to create competing real time operating system software; ii. remove any copyright notices or licenses contained in the software; @@ -179,12 +173,13 @@ breach of which would endanger the purpose of this agreement and the compliance with which a party may constantly trust in (so-called "cardinal obligations"). In other cases of slight negligence, Microsoft will not be liable for slight negligence. - -12. DISCLAIMER OF WARRANTY. THE SOFTWARE IS LICENSED “AS IS.” YOU BEAR THE RISK OF +12. DISCLAIMER OF WARRANTY. +a) THE SOFTWARE IS LICENSED “AS IS.” YOU BEAR THE RISK OF USING IT. MICROSOFT GIVES NO EXPRESS WARRANTIES, GUARANTEES, OR CONDITIONS. TO THE EXTENT PERMITTED UNDER APPLICABLE LAWS, MICROSOFT EXCLUDES ALL IMPLIED WARRANTIES, INCLUDING MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, AND NON-INFRINGEMENT. +b) HIGH RISK USE DISCLAIMER. WARNING: THE SOFTWARE IS NOT DESIGNED OR INTENDED FOR USE WHERE FAILURE OR FAULT OF ANY KIND OF THE SOFTWARE COULD RESULT IN DEATH OR SERIOUS BODILY INJURY, OR IN PHYSICAL OR ENVIRONMENTAL DAMAGE (“collectively High Risk Use”). Accordingly, You must design and implement your hardware and software such that, in the event of any interruption, defect, error, or other failure of the software, the safety of people, property, and the environment are not reduced below a level that is reasonable, appropriate, and legal, whether in general or for a specific industry. Your High Risk Use of the software is at Your own risk. 13. LIMITATION ON AND EXCLUSION OF DAMAGES. IF YOU HAVE ANY BASIS FOR RECOVERING DAMAGES DESPITE THE PRECEDING DISCLAIMER OF WARRANTY, YOU CAN RECOVER FROM @@ -203,21 +198,29 @@ possibility of the damages. The above limitation or exclusion may not apply to you because your state, province, or country may not allow the exclusion or limitation of incidental, consequential, or other damages. - - -Please note: As this software is distributed in Canada, some of the clauses in + Please note: As this software is distributed in Canada, some of the clauses in this agreement are provided below in French. Remarque: Ce logiciel étant distribué au Canada, certaines des clauses dans ce contrat sont fournies ci-dessous en français. -EXONÉRATION DE GARANTIE. Le logiciel visé par une licence est offert « tel quel +EXONÉRATION DE GARANTIE. +a) Le logiciel visé par une licence est offert « tel quel ». Toute utilisation de ce logiciel est à votre seule risque et péril. Microsoft n’accorde aucune autre garantie expresse. Vous pouvez bénéficier de droits additionnels en vertu du droit local sur la protection des consommateurs, que ce contrat ne peut modifier. La ou elles sont permises par le droit locale, les garanties implicites de qualité marchande, d’adéquation à un usage particulier et d’absence de contrefaçon sont exclues. +b) CLAUSE D’EXCLUSION DE RESPONSABILITÉ RELATIVE À L’UTILISATION À HAUT RISQUE. +AVERTISSEMENT: LE LOGICIEL N’EST PAS CONÇU OU DESTINÉ À ÊTRE UTILISÉ LORSQU’UNE +DÉFAILLANCE OU UN DÉFAUT DE QUELQUE NATURE QUE CE SOIT POURRAIT ENTRAÎNER LA +MORT OU DES BLESSURES CORPORELLES GRAVES, OU DES DOMMAGES PHYSIQUES OU +ENVIRONNEMENTAUX (« Utilisation à haut risque »). Par conséquent, vous devez concevoir et mettre en +œuvre votre équipement et votre logiciel de manière à ce que, en cas d’interruption, de défaut, d’erreur +ou de toute autre défaillance du logiciel, la sécurité des personnes, des biens et de l’environnement ne +soit pas réduite en dessous d’un niveau raisonnable, approprié et légal, que ce soit en général ou pour +un secteur spécifique. Votre utilisation à haut risque du logiciel est à vos propres risques. LIMITATION DES DOMMAGES-INTÉRÊTS ET EXCLUSION DE RESPONSABILITÉ POUR LES DOMMAGES. Vous pouvez obtenir de Microsoft et de ses fournisseurs une @@ -243,4 +246,4 @@ ci-dessus ne s’appliquera pas à votre égard. EFFET JURIDIQUE. Le présent contrat décrit certains droits juridiques. Vous pourriez avoir d’autres droits prévus par les lois de votre pays. Le présent contrat ne modifie pas les droits que vous confèrent les lois de votre pays si -celles-ci ne le permettent pas.
\ No newline at end of file +celles-ci ne le permettent pas. diff --git a/common/core/inc/ux_api.h b/common/core/inc/ux_api.h index e8b54d6..51c98db 100644 --- a/common/core/inc/ux_api.h +++ b/common/core/inc/ux_api.h @@ -134,6 +134,7 @@ /* added a new error code, */ /* resulting in version 6.2.1 */ /* xx-xx-xxxx Chaoqiong Xiao Modified comment(s), */ +/* optimized USB descriptors, */ /* added error checks support, */ /* resulting in version 6.x */ /* */ @@ -1814,12 +1815,13 @@ typedef struct UX_TRANSFER_STRUCT typedef struct UX_ENDPOINT_DESCRIPTOR_STRUCT { - ULONG bLength; - ULONG bDescriptorType; - ULONG bEndpointAddress; - ULONG bmAttributes; - ULONG wMaxPacketSize; - ULONG bInterval; + UCHAR bLength; + UCHAR bDescriptorType; + UCHAR bEndpointAddress; + UCHAR bmAttributes; + USHORT wMaxPacketSize; + UCHAR bInterval; + UCHAR _align_size[1]; } UX_ENDPOINT_DESCRIPTOR; #define UX_ENDPOINT_DESCRIPTOR_ENTRIES 6 @@ -1852,39 +1854,42 @@ typedef struct UX_ENDPOINT_STRUCT typedef struct UX_DEVICE_DESCRIPTOR_STRUCT { - ULONG bLength; - ULONG bDescriptorType; - ULONG bcdUSB; - ULONG bDeviceClass; - ULONG bDeviceSubClass; - ULONG bDeviceProtocol; - ULONG bMaxPacketSize0; - ULONG idVendor; - ULONG idProduct; - ULONG bcdDevice; - ULONG iManufacturer; - ULONG iProduct; - ULONG iSerialNumber; - ULONG bNumConfigurations; + UCHAR bLength; + UCHAR bDescriptorType; + USHORT bcdUSB; + UCHAR bDeviceClass; + UCHAR bDeviceSubClass; + UCHAR bDeviceProtocol; + UCHAR bMaxPacketSize0; + USHORT idVendor; + USHORT idProduct; + USHORT bcdDevice; + UCHAR iManufacturer; + UCHAR iProduct; + UCHAR iSerialNumber; + UCHAR bNumConfigurations; + UCHAR _align_size[2]; } UX_DEVICE_DESCRIPTOR; #define UX_DEVICE_DESCRIPTOR_ENTRIES 14 #define UX_DEVICE_DESCRIPTOR_LENGTH 18 + /* Define USBX Device Qualifier Descriptor structure. */ typedef struct UX_DEVICE_QUALIFIER_DESCRIPTOR_STRUCT { - ULONG bLength; - ULONG bDescriptorType; - ULONG bcdUSB; - ULONG bDeviceClass; - ULONG bDeviceSubClass; - ULONG bDeviceProtocol; - ULONG bMaxPacketSize0; - ULONG bNumConfigurations; - ULONG bReserved; + UCHAR bLength; + UCHAR bDescriptorType; + USHORT bcdUSB; + UCHAR bDeviceClass; + UCHAR bDeviceSubClass; + UCHAR bDeviceProtocol; + UCHAR bMaxPacketSize0; + UCHAR bNumConfigurations; + UCHAR bReserved; + UCHAR _align_size[2]; } UX_DEVICE_QUALIFIER_DESCRIPTOR; #define UX_DEVICE_QUALIFIER_DESCRIPTOR_ENTRIES 9 @@ -1896,47 +1901,50 @@ typedef struct UX_DEVICE_QUALIFIER_DESCRIPTOR_STRUCT typedef struct UX_OTHER_SPEED_DESCRIPTOR_STRUCT { - ULONG bLength; - ULONG bDescriptorType; - ULONG wTotalLength; - ULONG bNumInterfaces; - ULONG bConfigurationValue; - ULONG iConfiguration; - ULONG bmAttributes; + UCHAR bLength; + UCHAR bDescriptorType; + USHORT wTotalLength; + UCHAR bNumInterfaces; + UCHAR bConfigurationValue; + UCHAR iConfiguration; + UCHAR bmAttributes; ULONG MaxPower; } UX_OTHER_SPEED_DESCRIPTOR; #define UX_OTHER_SPEED_DESCRIPTOR_ENTRIES 8 #define UX_OTHER_SPEED_DESCRIPTOR_LENGTH 9 + /* Define USBX OTG Descriptor structure. */ typedef struct UX_OTG_DESCRIPTOR_STRUCT { - ULONG bLength; - ULONG bDescriptorType; - ULONG bmAttributes; - ULONG bcdOTG; + UCHAR bLength; + UCHAR bDescriptorType; + UCHAR bmAttributes; + UCHAR _align_bcdOTG[1]; + USHORT bcdOTG; + UCHAR _algin_size[2]; } UX_OTG_DESCRIPTOR; #define UX_OTG_DESCRIPTOR_ENTRIES 4 #define UX_OTG_DESCRIPTOR_LENGTH 5 + /* Define USBX Interface Association Descriptor structure. */ typedef struct UX_INTERFACE_ASSOCIATION_DESCRIPTOR_STRUCT { - ULONG bLength; - ULONG bDescriptorType; - ULONG bFirstInterface; - ULONG bInterfaceCount; - ULONG bFunctionClass; - ULONG bFunctionSubClass; - ULONG bFunctionProtocol; - ULONG iFunction; - + UCHAR bLength; + UCHAR bDescriptorType; + UCHAR bFirstInterface; + UCHAR bInterfaceCount; + UCHAR bFunctionClass; + UCHAR bFunctionSubClass; + UCHAR bFunctionProtocol; + UCHAR iFunction; } UX_INTERFACE_ASSOCIATION_DESCRIPTOR; #define UX_INTERFACE_ASSOCIATION_DESCRIPTOR_ENTRIES 8 @@ -2060,16 +2068,17 @@ typedef struct UX_DEVICE_STRUCT typedef struct UX_CONFIGURATION_DESCRIPTOR_STRUCT { - ULONG bLength; - ULONG bDescriptorType; - ULONG wTotalLength; - ULONG bNumInterfaces; - ULONG bConfigurationValue; - ULONG iConfiguration; - ULONG bmAttributes; + UCHAR bLength; + UCHAR bDescriptorType; + USHORT wTotalLength; + UCHAR bNumInterfaces; + UCHAR bConfigurationValue; + UCHAR iConfiguration; + UCHAR bmAttributes; ULONG MaxPower; } UX_CONFIGURATION_DESCRIPTOR; + #define UX_CONFIGURATION_DESCRIPTOR_ENTRIES 8 #define UX_CONFIGURATION_DESCRIPTOR_LENGTH 9 @@ -2107,15 +2116,16 @@ typedef struct UX_CONFIGURATION_STRUCT typedef struct UX_INTERFACE_DESCRIPTOR_STRUCT { - ULONG bLength; - ULONG bDescriptorType; - ULONG bInterfaceNumber; - ULONG bAlternateSetting; - ULONG bNumEndpoints; - ULONG bInterfaceClass; - ULONG bInterfaceSubClass; - ULONG bInterfaceProtocol; - ULONG iInterface; + UCHAR bLength; + UCHAR bDescriptorType; + UCHAR bInterfaceNumber; + UCHAR bAlternateSetting; + UCHAR bNumEndpoints; + UCHAR bInterfaceClass; + UCHAR bInterfaceSubClass; + UCHAR bInterfaceProtocol; + UCHAR iInterface; + UCHAR _align_size[3]; } UX_INTERFACE_DESCRIPTOR; #define UX_INTERFACE_DESCRIPTOR_ENTRIES 9 @@ -2153,9 +2163,9 @@ typedef struct UX_INTERFACE_STRUCT typedef struct UX_STRING_DESCRIPTOR_STRUCT { - ULONG bLength; - ULONG bDescriptorType; - ULONG bString[1]; + UCHAR bLength; + UCHAR bDescriptorType; + UCHAR bString[2]; } UX_STRING_DESCRIPTOR; #define UX_STRING_DESCRIPTOR_ENTRIES 3 @@ -2166,10 +2176,11 @@ typedef struct UX_STRING_DESCRIPTOR_STRUCT typedef struct UX_BOS_DESCRIPTOR_STRUCT { - ULONG bLength; - ULONG bDescriptorType; - ULONG wTotalLength; - ULONG bNumDeviceCaps; + UCHAR bLength; + UCHAR bDescriptorType; + USHORT wTotalLength; + UCHAR bNumDeviceCaps; + UCHAR _align_size[3]; } UX_BOS_DESCRIPTOR; #define UX_BOS_DESCRIPTOR_ENTRIES 4 @@ -2180,9 +2191,10 @@ typedef struct UX_BOS_DESCRIPTOR_STRUCT typedef struct UX_USB_2_0_EXTENSION_DESCRIPTOR_STRUCT { - ULONG bLength; - ULONG bDescriptorType; - ULONG bDevCapabilityType; + UCHAR bLength; + UCHAR bDescriptorType; + UCHAR bDevCapabilityType; + UCHAR _align_bmAttributes[1]; ULONG bmAttributes; } UX_USB_2_0_EXTENSION_DESCRIPTOR; @@ -2194,14 +2206,14 @@ typedef struct UX_USB_2_0_EXTENSION_DESCRIPTOR_STRUCT typedef struct UX_CONTAINER_ID_DESCRIPTOR_STRUCT { - ULONG bLength; - ULONG bDescriptorType; - ULONG bDevCapabilityType; - ULONG bReserved; + UCHAR bLength; + UCHAR bDescriptorType; + UCHAR bDevCapabilityType; + UCHAR bReserved; ULONG ContainerID[4]; } UX_CONTAINER_ID_DESCRIPTOR; -#define UX_CONTAINER_ID_DESCRIPTOR_ENTRIES 5 +#define UX_CONTAINER_ID_DESCRIPTOR_ENTRIES 8 #define UX_CONTAINER_ID_DESCRIPTOR_LENGTH 20 @@ -2210,17 +2222,20 @@ typedef struct UX_CONTAINER_ID_DESCRIPTOR_STRUCT typedef struct UX_DFU_FUNCTIONAL_DESCRIPTOR_STRUCT { - ULONG bLength; - ULONG bDescriptorType; - ULONG bmAttributes; - ULONG wDetachTimeOut; - ULONG wTransferSize; - ULONG bcdDFUVersion; + UCHAR bLength; + UCHAR bDescriptorType; + UCHAR bmAttributes; + UCHAR _align_wDetachTimeOut[1]; + USHORT wDetachTimeOut; + USHORT wTransferSize; + USHORT bcdDFUVersion; + UCHAR _align_size[2]; } UX_DFU_FUNCTIONAL_DESCRIPTOR; #define UX_DFU_FUNCTIONAL_DESCRIPTOR_ENTRIES 6 #define UX_DFU_FUNCTIONAL_DESCRIPTOR_LENGTH 9 + /* Define USBX Host Controller structure. */ typedef struct UX_HCD_STRUCT diff --git a/common/core/inc/ux_user_sample.h b/common/core/inc/ux_user_sample.h index f974505..216f3ec 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.2.1 */ +/* 6.x */ /* */ /* AUTHOR */ /* */ @@ -99,6 +99,10 @@ /* added option to enable */ /* basic USBX error checking, */ /* resulting in version 6.2.1 */ +/* xx-xx-xxxx Xiuwen Cai Modified comment(s), */ +/* added option for get string */ +/* requests with zero wIndex, */ +/* resulting in version 6.x */ /* */ /**************************************************************************/ @@ -224,6 +228,10 @@ #define UX_SLAVE_REQUEST_DATA_MAX_LENGTH (1024 * 2) +/* Defined, this enables processing of Get String Descriptor requests with zero Language ID. + The first language ID in the language ID framwork will be used if the request has a zero + Language ID. */ +/* #define UX_DEVICE_ENABLE_GET_STRING_WITH_ZERO_LANGUAGE_ID */ /* Defined, this value includes code to handle storage Multi-Media Commands (MMC). E.g., DVD-ROM. */ diff --git a/common/core/inc/ux_utility.h b/common/core/inc/ux_utility.h index 39bd50d..8b42fae 100644 --- a/common/core/inc/ux_utility.h +++ b/common/core/inc/ux_utility.h @@ -26,7 +26,7 @@ /* COMPONENT DEFINITION RELEASE */ /* */ /* ux_utility.h PORTABLE C */ -/* 6.1.12 */ +/* 6.x */ /* AUTHOR */ /* */ /* Chaoqiong Xiao, Microsoft Corporation */ @@ -57,6 +57,10 @@ /* added macros for RTOS calls,*/ /* fixed OHCI PRSC issue, */ /* resulting in version 6.1.12 */ +/* xx-xx-xxxx Chaoqiong Xiao Modified comment(s), */ +/* added new function to check */ +/* parsed size of descriptor, */ +/* resulting in version 6.x */ /* */ /**************************************************************************/ @@ -70,6 +74,8 @@ VOID _ux_utility_descriptor_parse(UCHAR * raw_descriptor, UCHAR * de UINT descriptor_entries, UCHAR * descriptor); VOID _ux_utility_descriptor_pack(UCHAR * descriptor, UCHAR * descriptor_structure, UINT descriptor_entries, UCHAR * raw_descriptor); +ULONG _ux_utility_descriptor_parse_size(UCHAR * descriptor_structure, UINT descriptor_entries, UINT size_align_mask); + ULONG _ux_utility_long_get(UCHAR * address); VOID _ux_utility_long_put(UCHAR * address, ULONG value); VOID _ux_utility_long_put_big_endian(UCHAR * address, ULONG value); diff --git a/common/core/src/ux_device_stack_descriptor_send.c b/common/core/src/ux_device_stack_descriptor_send.c index f8dae5a..4ce10a8 100644 --- a/common/core/src/ux_device_stack_descriptor_send.c +++ b/common/core/src/ux_device_stack_descriptor_send.c @@ -91,6 +91,8 @@ /* resulting in version 6.1.11 */ /* xx-xx-xxxx Chaoqiong Xiao Modified comment(s), */ /* moved compile option check, */ +/* added support for get string*/ +/* requests with zero wIndex, */ /* resulting in version 6.x */ /* */ /**************************************************************************/ @@ -399,6 +401,16 @@ ULONG string_length; } else { +#ifdef UX_DEVICE_ENABLE_GET_STRING_WITH_ZERO_LANGUAGE_ID + + /* Check if the language ID is zero. */ + if (request_index == 0) + { + + /* Get the first language ID in the language ID framework. */ + request_index = _ux_utility_short_get(_ux_system_slave -> ux_system_slave_language_id_framework); + } +#endif /* The host wants a specific string index returned. Get the string framework pointer and length. */ diff --git a/common/core/src/ux_system_initialize.c b/common/core/src/ux_system_initialize.c index f6f7202..06fc65e 100644 --- a/common/core/src/ux_system_initialize.c +++ b/common/core/src/ux_system_initialize.c @@ -69,7 +69,7 @@ UCHAR _ux_system_container_id_descriptor_structure[] = {1,1 /* FUNCTION RELEASE */ /* */ /* _ux_system_initialize PORTABLE C */ -/* 6.1.10 */ +/* 6.x */ /* AUTHOR */ /* */ /* Chaoqiong Xiao, Microsoft Corporation */ @@ -115,6 +115,10 @@ UCHAR _ux_system_container_id_descriptor_structure[] = {1,1 /* 01-31-2022 Chaoqiong Xiao Modified comment(s), */ /* added standalone support, */ /* resulting in version 6.1.10 */ +/* xx-xx-xxxx Chaoqiong Xiao Modified comment(s), */ +/* added UX_ASSERT check for */ +/* STD descriptor parse size, */ +/* resulting in version 6.x */ /* */ /**************************************************************************/ UINT _ux_system_initialize(VOID *regular_memory_pool_start, ULONG regular_memory_size, @@ -313,6 +317,19 @@ UINT _uxe_system_initialize(VOID *regular_memory_pool_start, ULONG regular_memo VOID *cache_safe_memory_pool_start, ULONG cache_safe_memory_size) { + /* Compiling option check of descriptors structs. */ + UX_ASSERT((_ux_utility_descriptor_parse_size(_ux_system_endpoint_descriptor_structure, UX_ENDPOINT_DESCRIPTOR_ENTRIES, 0x3u)) == sizeof(UX_ENDPOINT_DESCRIPTOR)); + UX_ASSERT((_ux_utility_descriptor_parse_size(_ux_system_device_descriptor_structure, UX_DEVICE_DESCRIPTOR_ENTRIES, 0x3u)) == sizeof(UX_DEVICE_DESCRIPTOR)); + UX_ASSERT((_ux_utility_descriptor_parse_size(_ux_system_configuration_descriptor_structure, UX_CONFIGURATION_DESCRIPTOR_ENTRIES, 0x3u)) == sizeof(UX_CONFIGURATION_DESCRIPTOR)); + UX_ASSERT((_ux_utility_descriptor_parse_size(_ux_system_interface_descriptor_structure, UX_INTERFACE_DESCRIPTOR_ENTRIES, 0x3u)) == sizeof(UX_INTERFACE_DESCRIPTOR)); + UX_ASSERT((_ux_utility_descriptor_parse_size(_ux_system_interface_association_descriptor_structure, UX_INTERFACE_ASSOCIATION_DESCRIPTOR_ENTRIES, 0x3u)) == sizeof(UX_INTERFACE_ASSOCIATION_DESCRIPTOR)); + UX_ASSERT((_ux_utility_descriptor_parse_size(_ux_system_string_descriptor_structure, UX_STRING_DESCRIPTOR_ENTRIES, 0x3u)) == sizeof(UX_STRING_DESCRIPTOR)); + UX_ASSERT((_ux_utility_descriptor_parse_size(_ux_system_dfu_functional_descriptor_structure, UX_DFU_FUNCTIONAL_DESCRIPTOR_ENTRIES, 0x3u)) == sizeof(UX_DFU_FUNCTIONAL_DESCRIPTOR)); + UX_ASSERT((_ux_utility_descriptor_parse_size(_ux_system_bos_descriptor_structure, UX_BOS_DESCRIPTOR_ENTRIES, 0x3u)) == sizeof(UX_BOS_DESCRIPTOR)); + UX_ASSERT((_ux_utility_descriptor_parse_size(_ux_system_usb_2_0_extension_descriptor_structure, UX_USB_2_0_EXTENSION_DESCRIPTOR_ENTRIES, 0x3u)) == sizeof(UX_USB_2_0_EXTENSION_DESCRIPTOR)); + UX_ASSERT((_ux_utility_descriptor_parse_size(_ux_system_container_id_descriptor_structure, UX_CONTAINER_ID_DESCRIPTOR_ENTRIES, 0x3u)) == sizeof(UX_CONTAINER_ID_DESCRIPTOR)); + + /* Sanity check. */ if ((regular_memory_pool_start == UX_NULL) || (regular_memory_size == 0)) return(UX_INVALID_PARAMETER); diff --git a/common/core/src/ux_utility_descriptor_pack.c b/common/core/src/ux_utility_descriptor_pack.c index 574c56c..bc85c55 100644 --- a/common/core/src/ux_utility_descriptor_pack.c +++ b/common/core/src/ux_utility_descriptor_pack.c @@ -12,8 +12,8 @@ /**************************************************************************/ /**************************************************************************/ -/** */ -/** USBX Component */ +/** */ +/** USBX Component */ /** */ /** Utility */ /** */ @@ -28,50 +28,53 @@ #include "ux_api.h" -/**************************************************************************/ -/* */ -/* FUNCTION RELEASE */ -/* */ -/* _ux_utility_descriptor_pack PORTABLE C */ -/* 6.1 */ +/**************************************************************************/ +/* */ +/* FUNCTION RELEASE */ +/* */ +/* _ux_utility_descriptor_pack PORTABLE C */ +/* 6.x */ /* AUTHOR */ /* */ /* Chaoqiong Xiao, Microsoft Corporation */ /* */ /* DESCRIPTION */ -/* */ +/* */ /* This function will pack an application structure into a USB */ -/* descriptor. */ -/* */ -/* INPUT */ -/* */ -/* descriptor Pointer to the unpacked */ +/* descriptor. */ +/* */ +/* INPUT */ +/* */ +/* descriptor Pointer to the unpacked */ /* descriptor */ /* descriptor_structure Components of the descriptor */ -/* descriptor_entries Number of entries in the */ +/* descriptor_entries Number of entries in the */ /* descriptor */ /* raw_descriptor Pointer to packed descriptor */ -/* */ -/* OUTPUT */ -/* */ +/* */ +/* OUTPUT */ +/* */ /* None */ -/* */ -/* CALLS */ -/* */ +/* */ +/* CALLS */ +/* */ /* _ux_utility_long_put Put 32-bit value */ /* _ux_utility_short_put Put 16-bit value */ -/* */ -/* CALLED BY */ -/* */ -/* USBX Components */ -/* */ -/* RELEASE HISTORY */ -/* */ -/* DATE NAME DESCRIPTION */ -/* */ +/* */ +/* CALLED BY */ +/* */ +/* USBX Components */ +/* */ +/* RELEASE HISTORY */ +/* */ +/* DATE NAME DESCRIPTION */ +/* */ /* 05-19-2020 Chaoqiong Xiao Initial Version 6.0 */ /* 09-30-2020 Chaoqiong Xiao Modified comment(s), */ /* resulting in version 6.1 */ +/* xx-xx-xxxx Chaoqiong Xiao Modified comment(s), */ +/* optimized USB descriptors, */ +/* resulting in version 6.x */ /* */ /**************************************************************************/ VOID _ux_utility_descriptor_pack(UCHAR * descriptor, UCHAR * descriptor_structure, @@ -90,27 +93,37 @@ VOID _ux_utility_descriptor_pack(UCHAR * descriptor, UCHAR * descriptor_structu insert it into the target descriptor. */ case 4: + /* Increase address so it's aligned. */ + while((ALIGN_TYPE)descriptor & 3u) + descriptor++; + + /* Put the DW. */ _ux_utility_long_put(raw_descriptor, *((ULONG *) descriptor)); raw_descriptor += 4; - break; + descriptor += 4; + break; case 2: - _ux_utility_short_put(raw_descriptor, (USHORT)*((ULONG *) descriptor)); + /* Increase address so it's aligned. */ + while((ALIGN_TYPE)descriptor & 1u) + descriptor++; + + /* Put the Word. */ + _ux_utility_short_put(raw_descriptor, (USHORT)*((USHORT *) descriptor)); raw_descriptor += 2; - break; + descriptor += 2; + break; default: - *raw_descriptor = (UCHAR) *((ULONG *) descriptor); + /* Put the byte. */ + *raw_descriptor = (UCHAR) *((UCHAR *) descriptor); raw_descriptor++; + descriptor++; } - - /* Add the size of the component to the destination. */ - descriptor += 4; } /* Return to caller. */ return; } - diff --git a/common/core/src/ux_utility_descriptor_parse.c b/common/core/src/ux_utility_descriptor_parse.c index ff23559..86bbd85 100644 --- a/common/core/src/ux_utility_descriptor_parse.c +++ b/common/core/src/ux_utility_descriptor_parse.c @@ -12,8 +12,8 @@ /**************************************************************************/ /**************************************************************************/ -/** */ -/** USBX Component */ +/** */ +/** USBX Component */ /** */ /** Utility */ /** */ @@ -28,50 +28,53 @@ #include "ux_api.h" -/**************************************************************************/ -/* */ -/* FUNCTION RELEASE */ -/* */ -/* _ux_utility_descriptor_parse PORTABLE C */ -/* 6.1 */ +/**************************************************************************/ +/* */ +/* FUNCTION RELEASE */ +/* */ +/* _ux_utility_descriptor_parse PORTABLE C */ +/* 6.x */ /* AUTHOR */ /* */ /* Chaoqiong Xiao, Microsoft Corporation */ /* */ /* DESCRIPTION */ -/* */ +/* */ /* This function will unpack a USB descriptor from the bus into a */ -/* memory aligned structure. */ -/* */ -/* INPUT */ -/* */ +/* memory aligned structure. */ +/* */ +/* INPUT */ +/* */ /* raw_descriptor Pointer to packed descriptor */ /* descriptor_structure Components of the descriptor */ -/* descriptor_entries Number of entries in the */ +/* descriptor_entries Number of entries in the */ /* descriptor */ -/* descriptor Pointer to the unpacked */ +/* descriptor Pointer to the unpacked */ /* descriptor */ -/* */ -/* OUTPUT */ -/* */ +/* */ +/* OUTPUT */ +/* */ /* None */ -/* */ -/* CALLS */ -/* */ +/* */ +/* CALLS */ +/* */ /* _ux_utility_long_get Get 32-bit value */ /* _ux_utility_short_get Get 16-bit value */ -/* */ -/* CALLED BY */ -/* */ -/* USBX Components */ -/* */ -/* RELEASE HISTORY */ -/* */ -/* DATE NAME DESCRIPTION */ -/* */ +/* */ +/* CALLED BY */ +/* */ +/* USBX Components */ +/* */ +/* RELEASE HISTORY */ +/* */ +/* DATE NAME DESCRIPTION */ +/* */ /* 05-19-2020 Chaoqiong Xiao Initial Version 6.0 */ /* 09-30-2020 Chaoqiong Xiao Modified comment(s), */ /* resulting in version 6.1 */ +/* xx-xx-xxxx Chaoqiong Xiao Modified comment(s), */ +/* optimized USB descriptors, */ +/* resulting in version 6.x */ /* */ /**************************************************************************/ VOID _ux_utility_descriptor_parse(UCHAR * raw_descriptor, UCHAR * descriptor_structure, @@ -90,27 +93,126 @@ VOID _ux_utility_descriptor_parse(UCHAR * raw_descriptor, UCHAR * descriptor_st insert it into the target descriptor. */ case 4: + /* Padding zeros so address is aligned. */ + while((ALIGN_TYPE) descriptor & 3u) + *descriptor++ = 0; + + /* Save the DW. */ *((ULONG *) descriptor) = _ux_utility_long_get(raw_descriptor); raw_descriptor += 4; - break; + descriptor += 4; + break; case 2: - *((ULONG *) descriptor) = (ULONG) _ux_utility_short_get(raw_descriptor); + /* Padding zeros so address is aligned. */ + while((ALIGN_TYPE) descriptor & 1u) + *descriptor++ = 0; + + /* Save the word. */ + *((USHORT *) descriptor) = (USHORT) _ux_utility_short_get(raw_descriptor); raw_descriptor += 2; - break; + descriptor += 2; + break; default: - *((ULONG *) descriptor) = (ULONG) *raw_descriptor; + /* Save the byte. */ + *((UCHAR *) descriptor) = (UCHAR) *raw_descriptor; raw_descriptor++; + descriptor ++; } - - /* Add the size of the component to the destination. */ - descriptor += 4; } /* Return to caller. */ return; } +/**************************************************************************/ +/* */ +/* FUNCTION RELEASE */ +/* */ +/* _ux_utility_descriptor_parse_size PORTABLE C */ +/* 6.x */ +/* AUTHOR */ +/* */ +/* Chaoqiong Xiao, Microsoft Corporation */ +/* */ +/* DESCRIPTION */ +/* */ +/* This function will calculate the size of a parsed USB descriptor. */ +/* */ +/* INPUT */ +/* */ +/* descriptor_structure Components of the descriptor */ +/* descriptor_entries Number of entries in the */ +/* descriptor */ +/* size_align_mask Size alignment mask */ +/* */ +/* OUTPUT */ +/* */ +/* size Size of the parsed descriptor */ +/* */ +/* CALLS */ +/* */ +/* None */ +/* */ +/* CALLED BY */ +/* */ +/* USBX Components */ +/* */ +/* RELEASE HISTORY */ +/* */ +/* DATE NAME DESCRIPTION */ +/* */ +/* xx-xx-xxxx Chaoqiong Xiao Initial Version 6.x */ +/* */ +/**************************************************************************/ +ULONG _ux_utility_descriptor_parse_size(UCHAR * descriptor_structure, UINT descriptor_entries, UINT size_align_mask) +{ + +ULONG size = 0; +ULONG entry_size; + + /* Loop on all the entries in this descriptor. */ + while(descriptor_entries--) + { + + /* Get entry size. */ + entry_size = (ULONG)*descriptor_structure ++; + + /* Check the size then build the component from the source and + insert it into the target descriptor. */ + switch(entry_size) + { + + case 4: /* Fall through. */ + case 2: + + /* Padding zeros so address is aligned. */ + while(size & (entry_size - 1)) + size++; + + /* Add to the size. */ + size += entry_size; + break; + + case 1: + + /* Add to the size. */ + size += 1; + break; + + default: + + /* Invalid entry size. */ + return(0); + } + } + + /* Align the size. */ + size = (size + size_align_mask) & (~size_align_mask); + + /* Return the size. */ + return(size); +} diff --git a/common/core/src/ux_utility_memory_allocate.c b/common/core/src/ux_utility_memory_allocate.c index 48d8620..547b03d 100644 --- a/common/core/src/ux_utility_memory_allocate.c +++ b/common/core/src/ux_utility_memory_allocate.c @@ -33,7 +33,7 @@ /* FUNCTION RELEASE */ /* */ /* _ux_utility_memory_allocate PORTABLE C */ -/* 6.1.11 */ +/* 6.x */ /* AUTHOR */ /* */ /* Chaoqiong Xiao, Microsoft Corporation */ @@ -77,6 +77,9 @@ /* 04-25-2022 Chaoqiong Xiao Modified comment(s), */ /* internal clean up, */ /* resulting in version 6.1.11 */ +/* xx-xx-xxxx Chaoqiong Xiao Modified comment(s), */ +/* fixed issue in 64-bit env, */ +/* resulting in version 6.x */ /* */ /**************************************************************************/ VOID *_ux_utility_memory_allocate(ULONG memory_alignment, ULONG memory_cache_flag, @@ -306,7 +309,7 @@ ALIGN_TYPE int_memory_buffer; { /* Setup the leftover memory block. */ - leftover_memory_block = (UX_MEMORY_BLOCK *) (((ALIGN_TYPE) new_memory_block + sizeof(UX_MEMORY_BLOCK) + memory_size_requested) & 0xFFFFFFFFu); + leftover_memory_block = (UX_MEMORY_BLOCK *) (((ALIGN_TYPE) new_memory_block + sizeof(UX_MEMORY_BLOCK) + memory_size_requested)); leftover_memory_block -> ux_memory_block_next = new_memory_block -> ux_memory_block_next; leftover_memory_block -> ux_memory_block_previous = new_memory_block; leftover_memory_block -> ux_memory_block_size = leftover - (ULONG)sizeof(UX_MEMORY_BLOCK); diff --git a/common/usbx_device_classes/inc/ux_device_class_audio10.h b/common/usbx_device_classes/inc/ux_device_class_audio10.h index 355821d..f0080dd 100644 --- a/common/usbx_device_classes/inc/ux_device_class_audio10.h +++ b/common/usbx_device_classes/inc/ux_device_class_audio10.h @@ -26,7 +26,7 @@ /* COMPONENT DEFINITION RELEASE */ /* */ /* ux_device_class_audio10.h PORTABLE C */ -/* 6.2.1 */ +/* 6.x */ /* AUTHOR */ /* */ /* Chaoqiong Xiao, Microsoft Corporation */ @@ -57,6 +57,9 @@ /* added error checks support, */ /* fixed a macro name, */ /* resulting in version 6.2.1 */ +/* xx-xx-xxxx Chaoqiong Xiao Modified comment(s), */ +/* optimized USB descriptors, */ +/* resulting in version 6.x */ /* */ /**************************************************************************/ @@ -166,94 +169,105 @@ extern "C" { typedef struct UX_DEVICE_CLASS_AUDIO10_AC_HEADER1_DESCRIPTOR_STRUCT { - ULONG bLength; - ULONG bDescriptorType; - ULONG bDescriptorSubtype; - ULONG bcdADC; - ULONG wTotalLength; - ULONG bInCollection; - ULONG baInterfaceNr1; + UCHAR bLength; + UCHAR bDescriptorType; + UCHAR bDescriptorSubtype; + UCHAR _align_bcdADC[1]; + USHORT bcdADC; + USHORT wTotalLength; + UCHAR bInCollection; + UCHAR baInterfaceNr1; + UCHAR _align_size[2]; } UX_DEVICE_CLASS_AUDIO10_AC_HEADER1_DESCRIPTOR; typedef struct UX_DEVICE_CLASS_AUDIO10_AC_HEADER2_DESCRIPTOR_STRUCT { - ULONG bLength; - ULONG bDescriptorType; - ULONG bDescriptorSubtype; - ULONG bcdADC; - ULONG wTotalLength; - ULONG bInCollection; - ULONG baInterfaceNr1; - ULONG baInterfaceNr2; + UCHAR bLength; + UCHAR bDescriptorType; + UCHAR bDescriptorSubtype; + UCHAR _align_bcdADC[1]; + USHORT bcdADC; + USHORT wTotalLength; + UCHAR bInCollection; + UCHAR baInterfaceNr1; + UCHAR baInterfaceNr2; + UCHAR _align_size[1]; } UX_DEVICE_CLASS_AUDIO10_AC_HEADER2_DESCRIPTOR; typedef struct UX_DEVICE_CLASS_AUDIO10_AC_HEADER3_DESCRIPTOR_STRUCT { - ULONG bLength; - ULONG bDescriptorType; - ULONG bDescriptorSubtype; - ULONG bcdADC; - ULONG wTotalLength; - ULONG bInCollection; - ULONG baInterfaceNr1; - ULONG baInterfaceNr2; - ULONG baInterfaceNr3; + UCHAR bLength; + UCHAR bDescriptorType; + UCHAR bDescriptorSubtype; + UCHAR _align_bcdADC[1]; + USHORT bcdADC; + USHORT wTotalLength; + UCHAR bInCollection; + UCHAR baInterfaceNr1; + UCHAR baInterfaceNr2; + UCHAR baInterfaceNr3; + UCHAR _align_size[2]; } UX_DEVICE_CLASS_AUDIO10_AC_HEADER3_DESCRIPTOR; typedef struct UX_DEVICE_CLASS_AUDIO10_AC_HEADER6_DESCRIPTOR_STRUCT { - ULONG bLength; - ULONG bDescriptorType; - ULONG bDescriptorSubtype; - ULONG bcdADC; - ULONG wTotalLength; - ULONG bInCollection; - ULONG baInterfaceNr1; - ULONG baInterfaceNr2; - ULONG baInterfaceNr3; - ULONG baInterfaceNr4; - ULONG baInterfaceNr5; - ULONG baInterfaceNr6; + UCHAR bLength; + UCHAR bDescriptorType; + UCHAR bDescriptorSubtype; + UCHAR _align_bcdADC[1]; + USHORT bcdADC; + USHORT wTotalLength; + UCHAR bInCollection; + UCHAR baInterfaceNr1; + UCHAR baInterfaceNr2; + UCHAR baInterfaceNr3; + UCHAR baInterfaceNr4; + UCHAR baInterfaceNr5; + UCHAR baInterfaceNr6; + UCHAR _align_size[1]; } UX_DEVICE_CLASS_AUDIO10_AC_HEADER6_DESCRIPTOR; typedef struct UX_DEVICE_CLASS_AUDIO10_AC_HEADER7_DESCRIPTOR_STRUCT { - ULONG bLength; - ULONG bDescriptorType; - ULONG bDescriptorSubtype; - ULONG bcdADC; - ULONG wTotalLength; - ULONG bInCollection; - ULONG baInterfaceNr1; - ULONG baInterfaceNr2; - ULONG baInterfaceNr3; - ULONG baInterfaceNr4; - ULONG baInterfaceNr5; - ULONG baInterfaceNr6; - ULONG baInterfaceNr7; + UCHAR bLength; + UCHAR bDescriptorType; + UCHAR bDescriptorSubtype; + UCHAR _align_bcdADC[1]; + USHORT bcdADC; + USHORT wTotalLength; + UCHAR bInCollection; + UCHAR baInterfaceNr1; + UCHAR baInterfaceNr2; + UCHAR baInterfaceNr3; + UCHAR baInterfaceNr4; + UCHAR baInterfaceNr5; + UCHAR baInterfaceNr6; + UCHAR baInterfaceNr7; } UX_DEVICE_CLASS_AUDIO10_AC_HEADER7_DESCRIPTOR; typedef struct UX_DEVICE_CLASS_AUDIO10_AC_HEADER8_DESCRIPTOR_STRUCT { - ULONG bLength; - ULONG bDescriptorType; - ULONG bDescriptorSubtype; - ULONG bcdADC; - ULONG wTotalLength; - ULONG bInCollection; - ULONG baInterfaceNr1; - ULONG baInterfaceNr2; - ULONG baInterfaceNr3; - ULONG baInterfaceNr4; - ULONG baInterfaceNr5; - ULONG baInterfaceNr6; - ULONG baInterfaceNr7; - ULONG baInterfaceNr8; + UCHAR bLength; + UCHAR bDescriptorType; + UCHAR bDescriptorSubtype; + UCHAR _align_bcdADC[1]; + USHORT bcdADC; + USHORT wTotalLength; + UCHAR bInCollection; + UCHAR baInterfaceNr1; + UCHAR baInterfaceNr2; + UCHAR baInterfaceNr3; + UCHAR baInterfaceNr4; + UCHAR baInterfaceNr5; + UCHAR baInterfaceNr6; + UCHAR baInterfaceNr7; + UCHAR baInterfaceNr8; + UCHAR _align_size[3]; } UX_DEVICE_CLASS_AUDIO10_AC_HEADER8_DESCRIPTOR; @@ -262,16 +276,16 @@ typedef struct UX_DEVICE_CLASS_AUDIO10_AC_HEADER8_DESCRIPTOR_STRUCT typedef struct UX_DEVICE_CLASS_AUDIO10_AC_INPUT_TERMINAL_DESCRIPTOR_STRUCT { - ULONG bLength; - ULONG bDescriptorType; - ULONG bDescriptorSubType; - ULONG bTerminalID; - ULONG wTerminalType; - ULONG bAssocTerminal; - ULONG bNrChannels; - ULONG wChannelConfig; - ULONG iChannelNames; - ULONG iTerminal; + UCHAR bLength; + UCHAR bDescriptorType; + UCHAR bDescriptorSubType; + UCHAR bTerminalID; + USHORT wTerminalType; + UCHAR bAssocTerminal; + UCHAR bNrChannels; + USHORT wChannelConfig; + UCHAR iChannelNames; + UCHAR iTerminal; } UX_DEVICE_CLASS_AUDIO10_AC_INPUT_TERMINAL_DESCRIPTOR; @@ -280,14 +294,15 @@ typedef struct UX_DEVICE_CLASS_AUDIO10_AC_INPUT_TERMINAL_DESCRIPTOR_STRUCT typedef struct UX_DEVICE_CLASS_AUDIO10_AC_OUTPUT_TERMINAL_DESCRIPTOR_STRUCT { - ULONG bLength; - ULONG bDescriptorType; - ULONG bDescriptorSubType; - ULONG bTerminalID; - ULONG wTerminalType; - ULONG bAssocTerminal; - ULONG bSourceID; - ULONG iTerminal; + UCHAR bLength; + UCHAR bDescriptorType; + UCHAR bDescriptorSubType; + UCHAR bTerminalID; + USHORT wTerminalType; + UCHAR bAssocTerminal; + UCHAR bSourceID; + UCHAR iTerminal; + UCHAR _align_size[3]; } UX_DEVICE_CLASS_AUDIO10_AC_OUTPUT_TERMINAL_DESCRIPTOR; @@ -296,12 +311,13 @@ typedef struct UX_DEVICE_CLASS_AUDIO10_AC_OUTPUT_TERMINAL_DESCRIPTOR_STRUCT typedef struct UX_DEVICE_CLASS_AUDIO10_AC_FEATURE_UNIT_DESCRIPTOR_STRUCT { - ULONG bLength; - ULONG bDescriptorType; - ULONG bDescriptorSubType; - ULONG bUnitID; - ULONG bSourceID; - ULONG bControlSize; + UCHAR bLength; + UCHAR bDescriptorType; + UCHAR bDescriptorSubType; + UCHAR bUnitID; + UCHAR bSourceID; + UCHAR bControlSize; + UCHAR _align_bmaControls[2]; ULONG bmaControls; } UX_DEVICE_CLASS_AUDIO10_AC_FEATURE_UNIT_DESCRIPTOR; @@ -311,12 +327,13 @@ typedef struct UX_DEVICE_CLASS_AUDIO10_AC_FEATURE_UNIT_DESCRIPTOR_STRUCT typedef struct UX_DEVICE_CLASS_AUDIO10_AS_INTERFACE_DESCRIPTOR_STRUCT { - ULONG bLength; - ULONG bDescriptorType; - ULONG bDescriptorSubtype; - ULONG bTerminalLink; - ULONG bDelay; - ULONG wFormatTag; + UCHAR bLength; + UCHAR bDescriptorType; + UCHAR bDescriptorSubtype; + UCHAR bTerminalLink; + UCHAR bDelay; + UCHAR _align_wFormatTag[1]; + USHORT wFormatTag; } UX_DEVICE_CLASS_AUDIO10_AS_INTERFACE_DESCRIPTOR; @@ -325,14 +342,14 @@ typedef struct UX_DEVICE_CLASS_AUDIO10_AS_INTERFACE_DESCRIPTOR_STRUCT typedef struct UX_DEVICE_CLASS_AUDIO10_AS_TYPE_I_FORMAT_TYPE_DESCRIPTOR_STRUCT { - ULONG bLength; - ULONG bDescriptorType; - ULONG bDescriptorSubtype; - ULONG bFormatType; - ULONG bNrChannels; - ULONG bSubframeSize; - ULONG bBitResolution; - ULONG bSamFreqType; + UCHAR bLength; + UCHAR bDescriptorType; + UCHAR bDescriptorSubtype; + UCHAR bFormatType; + UCHAR bNrChannels; + UCHAR bSubframeSize; + UCHAR bBitResolution; + UCHAR bSamFreqType; ULONG SamplingFrequency; } UX_DEVICE_CLASS_AUDIO10_AS_TYPE_I_FORMAT_TYPE_DESCRIPTOR; @@ -349,25 +366,27 @@ typedef struct UX_DEVICE_CLASS_AUDIO10_AS_TYPE_I_FORMAT_TYPE_DESCRIPTOR_STRUCT typedef struct UX_DEVICE_CLASS_AUDIO10_AS_ENDPOINT_DESCRIPTOR_STRUCT { - ULONG bLength; - ULONG bDescriptorType; - ULONG bDescriptorSubtype; - ULONG bmAttributes; - ULONG wMaxPacketSize; - ULONG bInterval; - ULONG bRefresh; - ULONG bSynchAddress; + UCHAR bLength; + UCHAR bDescriptorType; + UCHAR bDescriptorSubtype; + UCHAR bmAttributes; + USHORT wMaxPacketSize; + UCHAR bInterval; + UCHAR bRefresh; + UCHAR bSynchAddress; + UCHAR _align_size[3]; } UX_DEVICE_CLASS_AUDIO10_AS_ENDPOINT_DESCRIPTOR; typedef struct UX_DEVICE_CLASS_AUDIO10_AS_DATA_ENDPOINT_DESCRIPTOR_STRUCT { - ULONG bLength; - ULONG bDescriptorType; - ULONG bDescriptorSubtype; - ULONG bmAttributes; - ULONG bLockDelayUnits; - ULONG wLockDelay; + UCHAR bLength; + UCHAR bDescriptorType; + UCHAR bDescriptorSubtype; + UCHAR bmAttributes; + UCHAR bLockDelayUnits; + UCHAR _align_wLockDelay[1]; + USHORT wLockDelay; } UX_DEVICE_CLASS_AUDIO10_AS_DATA_ENDPOINT_DESCRIPTOR; typedef struct UX_DEVICE_CLASS_AUDIO10_CONTROL_STRUCT diff --git a/common/usbx_device_classes/inc/ux_device_class_audio20.h b/common/usbx_device_classes/inc/ux_device_class_audio20.h index 7c2da21..1a1c075 100644 --- a/common/usbx_device_classes/inc/ux_device_class_audio20.h +++ b/common/usbx_device_classes/inc/ux_device_class_audio20.h @@ -26,7 +26,7 @@ /* COMPONENT DEFINITION RELEASE */ /* */ /* ux_device_class_audio20.h PORTABLE C */ -/* 6.2.1 */ +/* 6.x */ /* AUTHOR */ /* */ /* Chaoqiong Xiao, Microsoft Corporation */ @@ -58,6 +58,9 @@ /* 03-08-2023 Chaoqiong Xiao Modified comment(s), */ /* added error checks support, */ /* resulting in version 6.2.1 */ +/* xx-xx-xxxx Chaoqiong Xiao Modified comment(s), */ +/* optimized USB descriptors, */ +/* resulting in version 6.x */ /* */ /**************************************************************************/ @@ -210,12 +213,15 @@ extern "C" { typedef struct UX_DEVICE_CLASS_AUDIO20_AC_HEADER_DESCRIPTOR_STRUCT { - ULONG bLength; - ULONG bDescriptorType; - ULONG bDescriptorSubtype; - ULONG bcdADC; - ULONG bCategory; - ULONG wTotalLength; + UCHAR bLength; + UCHAR bDescriptorType; + UCHAR bDescriptorSubtype; + UCHAR _align_bcdADC[1]; + USHORT bcdADC; + UCHAR bCategory; + UCHAR _align_wTotalLength[1]; + USHORT wTotalLength; + UCHAR _align_bmControls[2]; ULONG bmControls; } UX_DEVICE_CLASS_AUDIO20_AC_HEADER_DESCRIPTOR; @@ -225,14 +231,14 @@ typedef struct UX_DEVICE_CLASS_AUDIO20_AC_HEADER_DESCRIPTOR_STRUCT typedef struct UX_DEVICE_CLASS_AUDIO20_AC_CLOCK_SOURCE_DESCRIPTOR_STRUCT { - ULONG bLength; - ULONG bDescriptorType; - ULONG bDescriptorSubType; - ULONG bClockID; - ULONG bmAttributes; - ULONG bmControls; - ULONG bAssocTerminal; - ULONG iClockSource; + UCHAR bLength; + UCHAR bDescriptorType; + UCHAR bDescriptorSubType; + UCHAR bClockID; + UCHAR bmAttributes; + UCHAR bmControls; + UCHAR bAssocTerminal; + UCHAR iClockSource; } UX_DEVICE_CLASS_AUDIO20_AC_CLOCK_SOURCE_DESCRIPTOR; @@ -241,18 +247,21 @@ typedef struct UX_DEVICE_CLASS_AUDIO20_AC_CLOCK_SOURCE_DESCRIPTOR_STRUCT typedef struct UX_DEVICE_CLASS_AUDIO20_AC_INPUT_TERMINAL_DESCRIPTOR_STRUCT { - ULONG bLength; - ULONG bDescriptorType; - ULONG bDescriptorSubType; - ULONG bTerminalID; - ULONG wTerminalType; - ULONG bAssocTerminal; - ULONG bCSourceID; - ULONG bNrChannels; + UCHAR bLength; + UCHAR bDescriptorType; + UCHAR bDescriptorSubType; + UCHAR bTerminalID; + USHORT wTerminalType; + UCHAR bAssocTerminal; + UCHAR bCSourceID; + UCHAR bNrChannels; + UCHAR _align_bmChannelConfig[3]; ULONG bmChannelConfig; - ULONG iChannelNames; - ULONG bmControls; - ULONG iTerminal; + UCHAR iChannelNames; + UCHAR _align_bmControls[1]; + USHORT bmControls; + UCHAR iTerminal; + UCHAR _align_size[3]; } UX_DEVICE_CLASS_AUDIO20_AC_INPUT_TERMINAL_DESCRIPTOR; @@ -261,16 +270,18 @@ typedef struct UX_DEVICE_CLASS_AUDIO20_AC_INPUT_TERMINAL_DESCRIPTOR_STRUCT typedef struct UX_DEVICE_CLASS_AUDIO20_AC_OUTPUT_TERMINAL_DESCRIPTOR_STRUCT { - ULONG bLength; - ULONG bDescriptorType; - ULONG bDescriptorSubType; - ULONG bTerminalID; - ULONG wTerminalType; - ULONG bAssocTerminal; - ULONG bSourceID; - ULONG bCSourceID; - ULONG bmControls; - ULONG iTerminal; + UCHAR bLength; + UCHAR bDescriptorType; + UCHAR bDescriptorSubType; + UCHAR bTerminalID; + USHORT wTerminalType; + UCHAR bAssocTerminal; + UCHAR bSourceID; + UCHAR bCSourceID; + UCHAR _align_bmControls[1]; + USHORT bmControls; + UCHAR iTerminal; + UCHAR _align_size[3]; } UX_DEVICE_CLASS_AUDIO20_AC_OUTPUT_TERMINAL_DESCRIPTOR; @@ -279,22 +290,24 @@ typedef struct UX_DEVICE_CLASS_AUDIO20_AC_OUTPUT_TERMINAL_DESCRIPTOR_STRUCT typedef struct UX_DEVICE_CLASS_AUDIO20_AC_FEATURE_UNIT_DESCRIPTOR_STRUCT { - ULONG bLength; - ULONG bDescriptorType; - ULONG bDescriptorSubType; - ULONG bUnitID; - ULONG bSourceID; + UCHAR bLength; + UCHAR bDescriptorType; + UCHAR bDescriptorSubType; + UCHAR bUnitID; + UCHAR bSourceID; + UCHAR _align_bmaControls[3]; ULONG bmaControls; } UX_DEVICE_CLASS_AUDIO20_AC_FEATURE_UNIT_DESCRIPTOR; typedef struct UX_DEVICE_CLASS_AUDIO20_AC_FEATURE_UNIT1_DESCRIPTOR_STRUCT { - ULONG bLength; - ULONG bDescriptorType; - ULONG bDescriptorSubType; - ULONG bUnitID; - ULONG bSourceID; + UCHAR bLength; + UCHAR bDescriptorType; + UCHAR bDescriptorSubType; + UCHAR bUnitID; + UCHAR bSourceID; + UCHAR _align_bmaControls[3]; ULONG bmaControls0; ULONG bmaControls1; } UX_DEVICE_CLASS_AUDIO20_AC_FEATURE_UNIT1_DESCRIPTOR; @@ -302,11 +315,12 @@ typedef struct UX_DEVICE_CLASS_AUDIO20_AC_FEATURE_UNIT1_DESCRIPTOR_STRUCT typedef struct UX_DEVICE_CLASS_AUDIO20_AC_FEATURE_UNIT2_DESCRIPTOR_STRUCT { - ULONG bLength; - ULONG bDescriptorType; - ULONG bDescriptorSubType; - ULONG bUnitID; - ULONG bSourceID; + UCHAR bLength; + UCHAR bDescriptorType; + UCHAR bDescriptorSubType; + UCHAR bUnitID; + UCHAR bSourceID; + UCHAR _align_bmaControls[3]; ULONG bmaControls0; ULONG bmaControls1; ULONG bmaControls2; @@ -315,11 +329,12 @@ typedef struct UX_DEVICE_CLASS_AUDIO20_AC_FEATURE_UNIT2_DESCRIPTOR_STRUCT typedef struct UX_DEVICE_CLASS_AUDIO20_AC_FEATURE_UNIT3_DESCRIPTOR_STRUCT { - ULONG bLength; - ULONG bDescriptorType; - ULONG bDescriptorSubType; - ULONG bUnitID; - ULONG bSourceID; + UCHAR bLength; + UCHAR bDescriptorType; + UCHAR bDescriptorSubType; + UCHAR bUnitID; + UCHAR bSourceID; + UCHAR _align_bmaControls[3]; ULONG bmaControls0; ULONG bmaControls1; ULONG bmaControls2; @@ -329,11 +344,12 @@ typedef struct UX_DEVICE_CLASS_AUDIO20_AC_FEATURE_UNIT3_DESCRIPTOR_STRUCT typedef struct UX_DEVICE_CLASS_AUDIO20_AC_FEATURE_UNIT6_DESCRIPTOR_STRUCT { - ULONG bLength; - ULONG bDescriptorType; - ULONG bDescriptorSubType; - ULONG bUnitID; - ULONG bSourceID; + UCHAR bLength; + UCHAR bDescriptorType; + UCHAR bDescriptorSubType; + UCHAR bUnitID; + UCHAR bSourceID; + UCHAR _align_bmaControls[3]; ULONG bmaControls0; ULONG bmaControls1; ULONG bmaControls2; @@ -346,11 +362,12 @@ typedef struct UX_DEVICE_CLASS_AUDIO20_AC_FEATURE_UNIT6_DESCRIPTOR_STRUCT typedef struct UX_DEVICE_CLASS_AUDIO20_AC_FEATURE_UNIT7_DESCRIPTOR_STRUCT { - ULONG bLength; - ULONG bDescriptorType; - ULONG bDescriptorSubType; - ULONG bUnitID; - ULONG bSourceID; + UCHAR bLength; + UCHAR bDescriptorType; + UCHAR bDescriptorSubType; + UCHAR bUnitID; + UCHAR bSourceID; + UCHAR _align_bmaControls[3]; ULONG bmaControls0; ULONG bmaControls1; ULONG bmaControls2; @@ -364,11 +381,12 @@ typedef struct UX_DEVICE_CLASS_AUDIO20_AC_FEATURE_UNIT7_DESCRIPTOR_STRUCT typedef struct UX_DEVICE_CLASS_AUDIO20_AC_FEATURE_UNIT8_DESCRIPTOR_STRUCT { - ULONG bLength; - ULONG bDescriptorType; - ULONG bDescriptorSubType; - ULONG bUnitID; - ULONG bSourceID; + UCHAR bLength; + UCHAR bDescriptorType; + UCHAR bDescriptorSubType; + UCHAR bUnitID; + UCHAR bSourceID; + UCHAR _align_bmaControls[3]; ULONG bmaControls0; ULONG bmaControls1; ULONG bmaControls2; @@ -386,16 +404,19 @@ typedef struct UX_DEVICE_CLASS_AUDIO20_AC_FEATURE_UNIT8_DESCRIPTOR_STRUCT typedef struct UX_DEVICE_CLASS_AUDIO20_AS_INTERFACE_DESCRIPTOR_STRUCT { - ULONG bLength; - ULONG bDescriptorType; - ULONG bDescriptorSubtype; - ULONG bTerminalLink; - ULONG bmControls; - ULONG bFormatType; + UCHAR bLength; + UCHAR bDescriptorType; + UCHAR bDescriptorSubtype; + UCHAR bTerminalLink; + UCHAR bmControls; + UCHAR bFormatType; + UCHAR _align_bmFormats[2]; ULONG bmFormats; - ULONG bNrChannels; + UCHAR bNrChannels; + UCHAR _align_bmChannelConfig[3]; ULONG bmChannelConfig; - ULONG iChannelNames; + UCHAR iChannelNames; + UCHAR _align_size[3]; } UX_DEVICE_CLASS_AUDIO20_AS_INTERFACE_DESCRIPTOR; @@ -404,12 +425,13 @@ typedef struct UX_DEVICE_CLASS_AUDIO20_AS_INTERFACE_DESCRIPTOR_STRUCT typedef struct UX_DEVICE_CLASS_AUDIO20_AS_TYPE_I_FORMAT_TYPE_DESCRIPTOR_STRUCT { - ULONG bLength; - ULONG bDescriptorType; - ULONG bDescriptorSubtype; - ULONG bFormatType; - ULONG bSubslotSize; - ULONG bBitResolution; + UCHAR bLength; + UCHAR bDescriptorType; + UCHAR bDescriptorSubtype; + UCHAR bFormatType; + UCHAR bSubslotSize; + UCHAR bBitResolution; + UCHAR _align_size[2]; } UX_DEVICE_CLASS_AUDIO20_AS_TYPE_I_FORMAT_TYPE_DESCRIPTOR; @@ -418,13 +440,13 @@ typedef struct UX_DEVICE_CLASS_AUDIO20_AS_TYPE_I_FORMAT_TYPE_DESCRIPTOR_STRUCT typedef struct UX_DEVICE_CLASS_AUDIO20_AS_DATA_ENDPOINT_DESCRIPTOR_STRUCT { - ULONG bLength; - ULONG bDescriptorType; - ULONG bDescriptorSubtype; - ULONG bmAttributes; - ULONG bmControls; - ULONG bLockDelayUnits; - ULONG wLockDelay; + UCHAR bLength; + UCHAR bDescriptorType; + UCHAR bDescriptorSubtype; + UCHAR bmAttributes; + UCHAR bmControls; + UCHAR bLockDelayUnits; + USHORT wLockDelay; } UX_DEVICE_CLASS_AUDIO20_AS_DATA_ENDPOINT_DESCRIPTOR; typedef struct UX_DEVICE_CLASS_AUDIO20_CONTROL_STRUCT diff --git a/common/usbx_host_classes/inc/ux_host_class_audio.h b/common/usbx_host_classes/inc/ux_host_class_audio.h index c29b7c8..2405ab3 100644 --- a/common/usbx_host_classes/inc/ux_host_class_audio.h +++ b/common/usbx_host_classes/inc/ux_host_class_audio.h @@ -26,7 +26,7 @@ /* COMPONENT DEFINITION RELEASE */ /* */ /* ux_host_class_audio.h PORTABLE C */ -/* 6.1.12 */ +/* 6.x */ /* AUTHOR */ /* */ /* Chaoqiong Xiao, Microsoft Corporation */ @@ -57,6 +57,9 @@ /* added feedback support, */ /* added Audio 2.0 support, */ /* resulting in version 6.1.12 */ +/* xx-xx-xxxx Chaoqiong Xiao Modified comment(s), */ +/* optimized USB descriptors, */ +/* resulting in version 6.x */ /* */ /**************************************************************************/ @@ -308,14 +311,14 @@ extern "C" { typedef struct UX_HOST_CLASS_AUDIO_INTERFACE_DESCRIPTOR_STRUCT { - ULONG bLength; - ULONG bDescriptorType; - ULONG bDescriptorSubType; - ULONG bFormatType; - ULONG bNrChannels; - ULONG bSubframeSize; - ULONG bBitResolution; - ULONG bSamFreqType; + UCHAR bLength; + UCHAR bDescriptorType; + UCHAR bDescriptorSubType; + UCHAR bFormatType; + UCHAR bNrChannels; + UCHAR bSubframeSize; + UCHAR bBitResolution; + UCHAR bSamFreqType; } UX_HOST_CLASS_AUDIO_INTERFACE_DESCRIPTOR; @@ -324,16 +327,16 @@ typedef struct UX_HOST_CLASS_AUDIO_INTERFACE_DESCRIPTOR_STRUCT typedef struct UX_HOST_CLASS_AUDIO_INPUT_TERMINAL_DESCRIPTOR_STRUCT { - ULONG bLength; - ULONG bDescriptorType; - ULONG bDescriptorSubType; - ULONG bTerminalID; - ULONG wTerminalType; - ULONG bAssocTerminal; - ULONG bNrChannels; - ULONG wChannelConfig; - ULONG iChannelNames; - ULONG iTerminal; + UCHAR bLength; + UCHAR bDescriptorType; + UCHAR bDescriptorSubType; + UCHAR bTerminalID; + USHORT wTerminalType; + UCHAR bAssocTerminal; + UCHAR bNrChannels; + USHORT wChannelConfig; + UCHAR iChannelNames; + UCHAR iTerminal; } UX_HOST_CLASS_AUDIO_INPUT_TERMINAL_DESCRIPTOR; @@ -342,14 +345,15 @@ typedef struct UX_HOST_CLASS_AUDIO_INPUT_TERMINAL_DESCRIPTOR_STRUCT typedef struct UX_HOST_CLASS_AUDIO_OUTPUT_TERMINAL_DESCRIPTOR_STRUCT { - ULONG bLength; - ULONG bDescriptorType; - ULONG bDescriptorSubType; - ULONG bTerminalID; - ULONG wTerminalType; - ULONG bAssocTerminal; - ULONG bSourceID; - ULONG iTerminal; + UCHAR bLength; + UCHAR bDescriptorType; + UCHAR bDescriptorSubType; + UCHAR bTerminalID; + USHORT wTerminalType; + UCHAR bAssocTerminal; + UCHAR bSourceID; + UCHAR iTerminal; + UCHAR _align_size[3]; } UX_HOST_CLASS_AUDIO_OUTPUT_TERMINAL_DESCRIPTOR; @@ -358,13 +362,14 @@ typedef struct UX_HOST_CLASS_AUDIO_OUTPUT_TERMINAL_DESCRIPTOR_STRUCT typedef struct UX_HOST_CLASS_AUDIO_FEATURE_UNIT_DESCRIPTOR_STRUCT { - ULONG bLength; - ULONG bDescriptorType; - ULONG bDescriptorSubType; - ULONG bUnitID; - ULONG bSourceID; - ULONG bControlSize; - ULONG bmaControls; + UCHAR bLength; + UCHAR bDescriptorType; + UCHAR bDescriptorSubType; + UCHAR bUnitID; + UCHAR bSourceID; + UCHAR bControlSize; + UCHAR bmaControls; + UCHAR _align_size[1]; } UX_HOST_CLASS_AUDIO_FEATURE_UNIT_DESCRIPTOR; @@ -373,12 +378,13 @@ typedef struct UX_HOST_CLASS_AUDIO_FEATURE_UNIT_DESCRIPTOR_STRUCT typedef struct UX_HOST_CLASS_AUDIO_STREAMING_INTERFACE_DESCRIPTOR_STRUCT { - ULONG bLength; - ULONG bDescriptorType; - ULONG bDescriptorSubtype; - ULONG bTerminalLink; - ULONG bDelay; - ULONG wFormatTag; + UCHAR bLength; + UCHAR bDescriptorType; + UCHAR bDescriptorSubtype; + UCHAR bTerminalLink; + UCHAR bDelay; + UCHAR _align_wFormatTag[1]; + USHORT wFormatTag; } UX_HOST_CLASS_AUDIO_STREAMING_INTERFACE_DESCRIPTOR; @@ -387,12 +393,13 @@ typedef struct UX_HOST_CLASS_AUDIO_STREAMING_INTERFACE_DESCRIPTOR_STRUCT typedef struct UX_HOST_CLASS_AUDIO_STREAMING_ENDPOINT_DESCRIPTOR_STRUCT { - ULONG bLength; - ULONG bDescriptorType; - ULONG bDescriptorSubtype; - ULONG bmAttributes; - ULONG bLockDelayUnits; - ULONG wLockDelay; + UCHAR bLength; + UCHAR bDescriptorType; + UCHAR bDescriptorSubtype; + UCHAR bmAttributes; + UCHAR bLockDelayUnits; + UCHAR _align_wLockDelay[1]; + USHORT wLockDelay; } UX_HOST_CLASS_AUDIO_STREAMING_ENDPOINT_DESCRIPTOR; diff --git a/common/usbx_host_classes/inc/ux_host_class_cdc_ecm.h b/common/usbx_host_classes/inc/ux_host_class_cdc_ecm.h index 9a8b388..f5332d0 100644 --- a/common/usbx_host_classes/inc/ux_host_class_cdc_ecm.h +++ b/common/usbx_host_classes/inc/ux_host_class_cdc_ecm.h @@ -26,7 +26,7 @@ /* COMPONENT DEFINITION RELEASE */ /* */ /* ux_host_class_cdc_ecm.h PORTABLE C */ -/* 6.2.0 */ +/* 6.x */ /* AUTHOR */ /* */ /* Chaoqiong Xiao, Microsoft Corporation */ @@ -60,6 +60,9 @@ /* 10-31-2022 Chaoqiong Xiao Modified comment(s), */ /* supported NX packet chain, */ /* resulting in version 6.2.0 */ +/* xx-xx-xxxx Chaoqiong Xiao Modified comment(s), */ +/* optimized USB descriptors, */ +/* resulting in version 6.x */ /* */ /**************************************************************************/ @@ -311,14 +314,15 @@ typedef struct UX_HOST_CLASS_CDC_ECM_STRUCT typedef struct UX_HOST_CLASS_ECM_INTERFACE_DESCRIPTOR_STRUCT { - ULONG bFunctionLength; - ULONG bDescriptorType; - ULONG bDescriptorSubtype; - ULONG iMACAddress; + UCHAR bFunctionLength; + UCHAR bDescriptorType; + UCHAR bDescriptorSubtype; + UCHAR iMACAddress; ULONG bmEthernetStatistics; - ULONG wMaxSegmentSize; - ULONG wNumberMCFilters; - ULONG bNumberPowerFilters; + USHORT wMaxSegmentSize; + USHORT wNumberMCFilters; + UCHAR bNumberPowerFilters; + UCHAR _align_size[3]; } UX_HOST_CLASS_ECM_INTERFACE_DESCRIPTOR; /* Define CDC ECM Class function prototypes. */ diff --git a/common/usbx_host_classes/inc/ux_host_class_hid.h b/common/usbx_host_classes/inc/ux_host_class_hid.h index 5d0e76f..81074b4 100644 --- a/common/usbx_host_classes/inc/ux_host_class_hid.h +++ b/common/usbx_host_classes/inc/ux_host_class_hid.h @@ -26,7 +26,7 @@ /* COMPONENT DEFINITION RELEASE */ /* */ /* ux_host_class_hid.h PORTABLE C */ -/* 6.1.10 */ +/* 6.x */ /* AUTHOR */ /* */ /* Chaoqiong Xiao, Microsoft Corporation */ @@ -55,6 +55,9 @@ /* added interrupt OUT support,*/ /* added standalone mode, */ /* resulting in version 6.1.10 */ +/* xx-xx-xxxx Chaoqiong Xiao Modified comment(s), */ +/* optimized USB descriptors, */ +/* resulting in version 6.x */ /* */ /**************************************************************************/ @@ -789,13 +792,15 @@ extern "C" { typedef struct UX_HID_DESCRIPTOR_STRUCT { - ULONG bLength; - ULONG bDescriptorType; - ULONG bcdHID; - ULONG bCountryCode; - ULONG bNumDescriptor; - ULONG bReportDescriptorType; - ULONG wItemLength; + UCHAR bLength; + UCHAR bDescriptorType; + USHORT bcdHID; + UCHAR bCountryCode; + UCHAR bNumDescriptor; + UCHAR bReportDescriptorType; + UCHAR _align_wItemLength[1]; + USHORT wItemLength; + UCHAR _align_size[2]; } UX_HID_DESCRIPTOR; diff --git a/common/usbx_host_classes/inc/ux_host_class_hub.h b/common/usbx_host_classes/inc/ux_host_class_hub.h index 20f3b9f..d008672 100644 --- a/common/usbx_host_classes/inc/ux_host_class_hub.h +++ b/common/usbx_host_classes/inc/ux_host_class_hub.h @@ -26,7 +26,7 @@ /* COMPONENT DEFINITION RELEASE */ /* */ /* ux_host_class_hub.h PORTABLE C */ -/* 6.1.12 */ +/* 6.x */ /* AUTHOR */ /* */ /* Chaoqiong Xiao, Microsoft Corporation */ @@ -50,6 +50,9 @@ /* 07-29-2022 Chaoqiong Xiao Modified comment(s), */ /* added standalone support, */ /* resulting in version 6.1.12 */ +/* xx-xx-xxxx Chaoqiong Xiao Modified comment(s), */ +/* optimized USB descriptors, */ +/* resulting in version 6.x */ /* */ /**************************************************************************/ @@ -188,14 +191,16 @@ extern "C" { typedef struct UX_HUB_DESCRIPTOR_STRUCT { - ULONG bLength; - ULONG bDescriptorType; - ULONG bNbPorts; - ULONG wHubCharacteristics; - ULONG bPwrOn2PwrGood; - ULONG bHubContrCurrent; - ULONG bDeviceRemovable; - ULONG bPortPwrCtrlMask; + UCHAR bLength; + UCHAR bDescriptorType; + UCHAR bNbPorts; + UCHAR _align_wHubCharacteristics[1]; + USHORT wHubCharacteristics; + UCHAR bPwrOn2PwrGood; + UCHAR bHubContrCurrent; + UCHAR bDeviceRemovable; + UCHAR bPortPwrCtrlMask; + UCHAR _align_size[2]; } UX_HUB_DESCRIPTOR; diff --git a/common/usbx_host_classes/inc/ux_host_class_video.h b/common/usbx_host_classes/inc/ux_host_class_video.h index d63f152..60164e7 100644 --- a/common/usbx_host_classes/inc/ux_host_class_video.h +++ b/common/usbx_host_classes/inc/ux_host_class_video.h @@ -56,7 +56,8 @@ /* according to UVC 1.5 Class */ /* specification, */ /* resulting in version 6.1.8 */ -/* xx-xx-xxxx Yajun xia Modified comment(s), */ +/* xx-xx-xxxx Chaoqiong Xiao Modified comment(s), */ +/* optimized USB descriptors, */ /* added error checks support, */ /* resulting in version 6.x */ /* */ @@ -389,14 +390,15 @@ extern UCHAR _ux_system_host_class_video_name[]; typedef struct UX_HOST_CLASS_VIDEO_INTERFACE_HEADER_DESCRIPTOR_STRUCT { - ULONG bLength; - ULONG bDescriptorType; - ULONG bDescriptorSubType; - ULONG bcdUVC; - ULONG wTotalLength; + UCHAR bLength; + UCHAR bDescriptorType; + UCHAR bDescriptorSubType; + UCHAR _align_bcdUVC[1]; + USHORT bcdUVC; + USHORT wTotalLength; ULONG dwClockFrequency; - ULONG bInCollection; - ULONG baInterfaceNr; + UCHAR bInCollection; + UCHAR baInterfaceNr; } UX_HOST_CLASS_VIDEO_INTERFACE_HEADER_DESCRIPTOR; /* Define Video Class specific input header interface descriptor. */ @@ -404,13 +406,13 @@ typedef struct UX_HOST_CLASS_VIDEO_INTERFACE_HEADER_DESCRIPTOR_STRUCT typedef struct UX_HOST_CLASS_VIDEO_INPUT_TERMINAL_DESCRIPTOR_STRUCT { - ULONG bLength; - ULONG bDescriptorType; - ULONG bDescriptorSubType; - ULONG bTerminalID; - ULONG wTerminalType; - ULONG bAssocTerminal; - ULONG iTerminal; + UCHAR bLength; + UCHAR bDescriptorType; + UCHAR bDescriptorSubType; + UCHAR bTerminalID; + USHORT wTerminalType; + UCHAR bAssocTerminal; + UCHAR iTerminal; } UX_HOST_CLASS_VIDEO_INPUT_TERMINAL_DESCRIPTOR; /* Define Video Class specific input header interface descriptor. */ @@ -418,19 +420,19 @@ typedef struct UX_HOST_CLASS_VIDEO_INPUT_TERMINAL_DESCRIPTOR_STRUCT typedef struct UX_HOST_CLASS_VIDEO_INPUT_HEADER_DESCRIPTOR_STRUCT { - ULONG bLength; - ULONG bDescriptorType; - ULONG bDescriptorSubType; - ULONG bNumFormats; - ULONG wTotalLength; - ULONG bEndpointAddress; - ULONG bmInfo; - ULONG bTerminalLink; - ULONG bStillCaptureMethod; - ULONG bTriggerSupport; - ULONG bTriggerUsage; - ULONG bControlSize; - ULONG bmaControls; + UCHAR bLength; + UCHAR bDescriptorType; + UCHAR bDescriptorSubType; + UCHAR bNumFormats; + USHORT wTotalLength; + UCHAR bEndpointAddress; + UCHAR bmInfo; + UCHAR bTerminalLink; + UCHAR bStillCaptureMethod; + UCHAR bTriggerSupport; + UCHAR bTriggerUsage; + UCHAR bControlSize; + UCHAR bmaControls; } UX_HOST_CLASS_VIDEO_INPUT_HEADER_DESCRIPTOR; /* Define Video Class Selector descriptor. */ @@ -438,12 +440,12 @@ typedef struct UX_HOST_CLASS_VIDEO_INPUT_HEADER_DESCRIPTOR_STRUCT typedef struct UX_HOST_CLASS_VIDEO_SELECTOR_UNIT_DESCRIPTOR_STRUCT { - ULONG bLength; - ULONG bDescriptorType; - ULONG bDescriptorSubtype; - ULONG bUnitID; - ULONG bNrInPins; - ULONG baSourceID; + UCHAR bLength; + UCHAR bDescriptorType; + UCHAR bDescriptorSubtype; + UCHAR bUnitID; + UCHAR bNrInPins; + UCHAR baSourceID; } UX_HOST_CLASS_VIDEO_SELECTOR_UNIT_DESCRIPTOR; /* Define Video Class Camera Terminal descriptor. */ @@ -451,17 +453,18 @@ typedef struct UX_HOST_CLASS_VIDEO_SELECTOR_UNIT_DESCRIPTOR_STRUCT typedef struct UX_HOST_CLASS_VIDEO_CAMERA_TERMINAL_DESCRIPTOR_STRUCT { - ULONG bLength; - ULONG bDescriptorType; - ULONG bDescriptorSubtype; - ULONG bTerminalID; - ULONG wTerminalType; - ULONG bAssocTerminal; - ULONG iTerminal; - ULONG wObjectiveFocalLengthMin; - ULONG wObjectiveFocalLengthMax; - ULONG wOcularFocalLength; - ULONG bControlSize; + UCHAR bLength; + UCHAR bDescriptorType; + UCHAR bDescriptorSubtype; + UCHAR bTerminalID; + USHORT wTerminalType; + UCHAR bAssocTerminal; + UCHAR iTerminal; + USHORT wObjectiveFocalLengthMin; + USHORT wObjectiveFocalLengthMax; + USHORT wOcularFocalLength; + UCHAR bControlSize; + UCHAR _align_bmControls[1]; ULONG bmControls; } UX_HOST_CLASS_VIDEO_CAMERA_TERMINAL_DESCRIPTOR; @@ -470,18 +473,21 @@ typedef struct UX_HOST_CLASS_VIDEO_CAMERA_TERMINAL_DESCRIPTOR_STRUCT typedef struct UX_HOST_CLASS_VIDEO_FRAME_DESCRIPTOR_STRUCT { - ULONG bLength; - ULONG bDescriptorType; - ULONG bDescriptorSubtype; - ULONG bFrameIndex; - ULONG bmCapabilities; - ULONG wWidth; - ULONG wHeight; + UCHAR bLength; + UCHAR bDescriptorType; + UCHAR bDescriptorSubtype; + UCHAR bFrameIndex; + UCHAR bmCapabilities; + UCHAR _align_wWidth[1]; + USHORT wWidth; + USHORT wHeight; + UCHAR _align_dwMinBitRate[2]; ULONG dwMinBitRate; ULONG dwMaxBitRate; ULONG dwMaxVideoFrameBufferSize; ULONG dwDefaultFrameInterval; - ULONG bFrameIntervalType; + UCHAR bFrameIntervalType; + UCHAR _align_size[3]; } UX_HOST_CLASS_VIDEO_FRAME_DESCRIPTOR; @@ -491,16 +497,17 @@ typedef struct UX_HOST_CLASS_VIDEO_FRAME_DESCRIPTOR_STRUCT typedef struct UX_HOST_CLASS_VIDEO_PROCESSING_UNIT_DESCRIPTOR_STRUCT { - ULONG bLength; - ULONG bDescriptorType; - ULONG bDescriptorSubtype; - ULONG bUnitID; - ULONG bSourceID; - ULONG wMaxMultiplier; - ULONG bControlSize; - ULONG bmControls; - ULONG iProcessing; - ULONG bmVideoStandards; + UCHAR bLength; + UCHAR bDescriptorType; + UCHAR bDescriptorSubtype; + UCHAR bUnitID; + UCHAR bSourceID; + UCHAR _align_wMaxMultiplier[1]; + USHORT wMaxMultiplier; + UCHAR bControlSize; + UCHAR bmControls; + UCHAR iProcessing; + UCHAR bmVideoStandards; } UX_HOST_CLASS_VIDEO_PROCESSING_UNIT_DESCRIPTOR; diff --git a/common/usbx_host_classes/src/ux_host_class_asix_transmission_callback.c b/common/usbx_host_classes/src/ux_host_class_asix_transmission_callback.c index 13f2967..8054e95 100644 --- a/common/usbx_host_classes/src/ux_host_class_asix_transmission_callback.c +++ b/common/usbx_host_classes/src/ux_host_class_asix_transmission_callback.c @@ -35,7 +35,7 @@ /* FUNCTION RELEASE */ /* */ /* _ux_host_class_asix_transmission_callback PORTABLE C */ -/* 6.2.0 */ +/* 6.x */ /* AUTHOR */ /* */ /* Chaoqiong Xiao, Microsoft Corporation */ @@ -81,6 +81,10 @@ /* supported NX packet chain, */ /* fixed empty queue handling, */ /* resulting in version 6.2.0 */ +/* xx-xx-xxxx Chaoqiong Xiao Modified comment(s), */ +/* fixed compile warnings, */ +/* improved 64-bit support, */ +/* resulting in version 6.x */ /* */ /**************************************************************************/ VOID _ux_host_class_asix_transmission_callback (UX_TRANSFER *transfer_request) @@ -158,7 +162,7 @@ ULONG copied; if (next_packet -> nx_packet_next) { - next_packet -> nx_packet_length += sizeof(USHORT) * 2; + next_packet -> nx_packet_length += (ULONG)sizeof(USHORT) * 2; next_packet -> nx_packet_prepend_ptr -= sizeof(USHORT) * 2; nx_packet_data_extract_offset(next_packet, 0, asix -> ux_host_class_asix_xmit_buffer, next_packet -> nx_packet_length, &copied); @@ -167,7 +171,7 @@ ULONG copied; transfer_request -> ux_transfer_request_data_pointer = asix -> ux_host_class_asix_xmit_buffer; /* Restore packet status. */ - next_packet -> nx_packet_length -= sizeof(USHORT) * 2; + next_packet -> nx_packet_length -= (ULONG)sizeof(USHORT) * 2; next_packet -> nx_packet_prepend_ptr += sizeof(USHORT) * 2; } else diff --git a/common/usbx_host_classes/src/ux_host_class_asix_write.c b/common/usbx_host_classes/src/ux_host_class_asix_write.c index 175e9b6..5ca7a60 100644 --- a/common/usbx_host_classes/src/ux_host_class_asix_write.c +++ b/common/usbx_host_classes/src/ux_host_class_asix_write.c @@ -35,7 +35,7 @@ /* FUNCTION RELEASE */ /* */ /* _ux_host_class_asix_write PORTABLE C */ -/* 6.2.0 */ +/* 6.x */ /* AUTHOR */ /* */ /* Chaoqiong Xiao, Microsoft Corporation */ @@ -82,6 +82,10 @@ /* added queue modify protect, */ /* improved error check, */ /* resulting in version 6.2.0 */ +/* xx-xx-xxxx Chaoqiong Xiao Modified comment(s), */ +/* fixed compile warnings, */ +/* improved 64-bit support, */ +/* resulting in version 6.x */ /* */ /**************************************************************************/ UINT _ux_host_class_asix_write(VOID *asix_class, NX_PACKET *packet) @@ -174,7 +178,7 @@ ULONG copied; UX_RESTORE return(UX_MATH_OVERFLOW); } - adjusted_length = packet -> nx_packet_length + sizeof(USHORT) * 2; + adjusted_length = packet -> nx_packet_length + (ULONG)sizeof(USHORT) * 2; if (adjusted_length > UX_HOST_CLASS_ASIX_TRANSMIT_BUFFER_SIZE) { @@ -233,7 +237,7 @@ ULONG copied; transfer_request -> ux_transfer_request_data_pointer = asix -> ux_host_class_asix_xmit_buffer; /* Restore packet status. */ - packet -> nx_packet_length -= sizeof(USHORT) * 2; + packet -> nx_packet_length -= (ULONG)sizeof(USHORT) * 2; packet -> nx_packet_prepend_ptr += sizeof(USHORT) * 2; } else diff --git a/common/usbx_host_classes/src/ux_host_class_cdc_ecm_mac_address_get.c b/common/usbx_host_classes/src/ux_host_class_cdc_ecm_mac_address_get.c index ea9f968..d19555b 100644 --- a/common/usbx_host_classes/src/ux_host_class_cdc_ecm_mac_address_get.c +++ b/common/usbx_host_classes/src/ux_host_class_cdc_ecm_mac_address_get.c @@ -103,7 +103,7 @@ UCHAR element_hexa_lower; /* We now need to retrieve the MAC address of the node which is embedded in the ECM descriptor. We will parse the entire configuration descriptor of the device and look for the ECM Ethernet Networking Functional Descriptor. */ - configuration_index = cdc_ecm -> ux_host_class_cdc_ecm_interface_data -> ux_interface_configuration -> ux_configuration_descriptor.bConfigurationValue -1; + configuration_index = (ULONG)cdc_ecm -> ux_host_class_cdc_ecm_interface_data -> ux_interface_configuration -> ux_configuration_descriptor.bConfigurationValue -1; /* We need to get the default control endpoint transfer request pointer. */ control_endpoint = &cdc_ecm -> ux_host_class_cdc_ecm_device -> ux_device_control_endpoint; diff --git a/common/usbx_host_classes/src/ux_host_class_hub_descriptor_get.c b/common/usbx_host_classes/src/ux_host_class_hub_descriptor_get.c index d158454..041f26b 100644 --- a/common/usbx_host_classes/src/ux_host_class_hub_descriptor_get.c +++ b/common/usbx_host_classes/src/ux_host_class_hub_descriptor_get.c @@ -49,7 +49,7 @@ ULONG port_index; (UCHAR *) &hub -> ux_host_class_hub_descriptor); /* Check the protocol used by the HUB. This will indicate if the HUB supports multiple TTs in high speed mode. */ - tt_protocols = (hub -> ux_host_class_hub_device -> ux_device_descriptor.bDeviceProtocol << 8) | + tt_protocols = ((ULONG)hub -> ux_host_class_hub_device -> ux_device_descriptor.bDeviceProtocol << 8) | hub -> ux_host_class_hub_interface -> ux_interface_descriptor.bInterfaceProtocol; switch(tt_protocols) { @@ -129,7 +129,7 @@ ULONG port_index; /* FUNCTION RELEASE */ /* */ /* _ux_host_class_hub_descriptor_get PORTABLE C */ -/* 6.1.12 */ +/* 6.x */ /* AUTHOR */ /* */ /* Chaoqiong Xiao, Microsoft Corporation */ @@ -174,6 +174,9 @@ ULONG port_index; /* 07-29-2022 Chaoqiong Xiao Modified comment(s), */ /* added standalone support, */ /* resulting in version 6.1.12 */ +/* xx-xx-xxxx Chaoqiong Xiao Modified comment(s), */ +/* fixed compile warnings, */ +/* resulting in version 6.x */ /* */ /**************************************************************************/ UINT _ux_host_class_hub_descriptor_get(UX_HOST_CLASS_HUB *hub) diff --git a/common/usbx_host_classes/src/ux_host_class_hub_entry.c b/common/usbx_host_classes/src/ux_host_class_hub_entry.c index 9a968d8..e73c2e1 100644 --- a/common/usbx_host_classes/src/ux_host_class_hub_entry.c +++ b/common/usbx_host_classes/src/ux_host_class_hub_entry.c @@ -41,7 +41,7 @@ static inline UINT _ux_host_class_hub_activate_wait(UX_HOST_CLASS_COMMAND *comma /* FUNCTION RELEASE */ /* */ /* _ux_host_class_hub_entry PORTABLE C */ -/* 6.2.0 */ +/* 6.x */ /* AUTHOR */ /* */ /* Chaoqiong Xiao, Microsoft Corporation */ @@ -84,6 +84,9 @@ static inline UINT _ux_host_class_hub_activate_wait(UX_HOST_CLASS_COMMAND *comma /* 10-31-2022 Chaoqiong Xiao Modified comment(s), */ /* fixed power on delay calc, */ /* resulting in version 6.2.0 */ +/* xx-xx-xxxx Chaoqiong Xiao Modified comment(s), */ +/* fixed compile warnings, */ +/* resulting in version 6.x */ /* */ /**************************************************************************/ UINT _ux_host_class_hub_entry(UX_HOST_CLASS_COMMAND *command) @@ -359,7 +362,7 @@ ULONG current_ms, elapsed_ms; /* Delay a while (as described by hub descriptor). */ hub -> ux_host_class_hub_wait_start = _ux_utility_time_get(); - hub -> ux_host_class_hub_wait_ms = UX_MS_TO_TICK_NON_ZERO(hub -> ux_host_class_hub_descriptor.bPwrOn2PwrGood << 1); + hub -> ux_host_class_hub_wait_ms = UX_MS_TO_TICK_NON_ZERO((ULONG)hub -> ux_host_class_hub_descriptor.bPwrOn2PwrGood << 1); hub -> ux_host_class_hub_enum_state = UX_HOST_CLASS_HUB_ENUM_TRANS_WAIT; hub -> ux_host_class_hub_next_state = UX_HOST_CLASS_HUB_ENUM_PORT_POWER_ON; diff --git a/common/usbx_host_classes/src/ux_host_class_pima_device_info_get.c b/common/usbx_host_classes/src/ux_host_class_pima_device_info_get.c index ae432d7..5d5ca49 100644 --- a/common/usbx_host_classes/src/ux_host_class_pima_device_info_get.c +++ b/common/usbx_host_classes/src/ux_host_class_pima_device_info_get.c @@ -35,7 +35,7 @@ /* FUNCTION RELEASE */ /* */ /* _ux_host_class_pima_device_info_get PORTABLE C */ -/* 6.1.12 */ +/* 6.x */ /* AUTHOR */ /* */ /* Chaoqiong Xiao, Microsoft Corporation */ @@ -79,6 +79,9 @@ /* 07-29-2022 Chaoqiong Xiao Modified comment(s), */ /* fixed DeviceInfo extract, */ /* resulting in version 6.1.12 */ +/* xx-xx-xxxx Chaoqiong Xiao Modified comment(s), */ +/* fixed compile warnings, */ +/* resulting in version 6.x */ /* */ /**************************************************************************/ UINT _ux_host_class_pima_device_info_get(UX_HOST_CLASS_PIMA *pima, @@ -169,7 +172,7 @@ UINT status; else { array_length <<= 1; - array_length += sizeof(ULONG); + array_length += (ULONG)sizeof(ULONG); } } @@ -190,7 +193,7 @@ UINT status; else { array_length <<= 1; - array_length += sizeof(ULONG); + array_length += (ULONG)sizeof(ULONG); } } @@ -211,7 +214,7 @@ UINT status; else { array_length <<= 1; - array_length += sizeof(ULONG); + array_length += (ULONG)sizeof(ULONG); } } @@ -232,7 +235,7 @@ UINT status; else { array_length <<= 1; - array_length += sizeof(ULONG); + array_length += (ULONG)sizeof(ULONG); } } @@ -253,7 +256,7 @@ UINT status; else { array_length <<= 1; - array_length += sizeof(ULONG); + array_length += (ULONG)sizeof(ULONG); } } diff --git a/common/usbx_host_classes/src/ux_host_class_pima_object_info_get.c b/common/usbx_host_classes/src/ux_host_class_pima_object_info_get.c index a95015f..970446f 100644 --- a/common/usbx_host_classes/src/ux_host_class_pima_object_info_get.c +++ b/common/usbx_host_classes/src/ux_host_class_pima_object_info_get.c @@ -35,7 +35,7 @@ /* FUNCTION RELEASE */ /* */ /* _ux_host_class_pima_object_info_get PORTABLE C */ -/* 6.1 */ +/* 6.x */ /* AUTHOR */ /* */ /* Chaoqiong Xiao, Microsoft Corporation */ @@ -76,6 +76,10 @@ /* verified memset and memcpy */ /* cases, */ /* resulting in version 6.1 */ +/* xx-xx-xxxx Yajun Xia Modified comment(s), */ +/* fixed allocated buffer */ +/* pointer checking issue, */ +/* resulting in version 6.x */ /* */ /**************************************************************************/ UINT _ux_host_class_pima_object_info_get(UX_HOST_CLASS_PIMA *pima, @@ -117,7 +121,7 @@ UINT status; /* Allocate some DMA safe memory for receiving the object info block. */ object_buffer = _ux_utility_memory_allocate(UX_SAFE_ALIGN, UX_CACHE_SAFE_MEMORY, UX_HOST_CLASS_PIMA_OBJECT_MAX_LENGTH); - if (object == UX_NULL) + if (object_buffer == UX_NULL) return(UX_MEMORY_INSUFFICIENT); /* Issue the command. */ diff --git a/common/usbx_host_classes/src/ux_host_class_pima_object_info_send.c b/common/usbx_host_classes/src/ux_host_class_pima_object_info_send.c index f5f569f..1f9f8e6 100644 --- a/common/usbx_host_classes/src/ux_host_class_pima_object_info_send.c +++ b/common/usbx_host_classes/src/ux_host_class_pima_object_info_send.c @@ -35,7 +35,7 @@ /* FUNCTION RELEASE */ /* */ /* _ux_host_class_pima_object_info_send PORTABLE C */ -/* 6.1 */ +/* 6.x */ /* AUTHOR */ /* */ /* Chaoqiong Xiao, Microsoft Corporation */ @@ -78,6 +78,10 @@ /* verified memset and memcpy */ /* cases, */ /* resulting in version 6.1 */ +/* xx-xx-xxxx Yajun Xia Modified comment(s), */ +/* fixed allocated buffer */ +/* pointer checking issue, */ +/* resulting in version 6.x */ /* */ /**************************************************************************/ UINT _ux_host_class_pima_object_info_send(UX_HOST_CLASS_PIMA *pima, @@ -125,7 +129,7 @@ UINT status; /* Allocate some DMA safe memory for sending the object info block. */ object_buffer = _ux_utility_memory_allocate(UX_SAFE_ALIGN, UX_CACHE_SAFE_MEMORY, UX_HOST_CLASS_PIMA_OBJECT_MAX_LENGTH); - if (object == UX_NULL) + if (object_buffer == UX_NULL) return(UX_MEMORY_INSUFFICIENT); /* Get the end of the object buffer. */ diff --git a/common/usbx_host_classes/src/ux_host_class_printer_device_id_get.c b/common/usbx_host_classes/src/ux_host_class_printer_device_id_get.c index ee0cc5a..9963117 100644 --- a/common/usbx_host_classes/src/ux_host_class_printer_device_id_get.c +++ b/common/usbx_host_classes/src/ux_host_class_printer_device_id_get.c @@ -35,7 +35,7 @@ /* FUNCTION RELEASE */ /* */ /* _ux_host_class_printer_device_id_get PORTABLE C */ -/* 6.1.12 */ +/* 6.x */ /* AUTHOR */ /* */ /* Chaoqiong Xiao, Microsoft Corporation */ @@ -83,6 +83,9 @@ /* fixed parameter/variable */ /* names conflict C++ keyword, */ /* resulting in version 6.1.12 */ +/* xx-xx-xxxx Chaoqiong Xiao Modified comment(s), */ +/* fixed compile warnings, */ +/* resulting in version 6.x */ /* */ /**************************************************************************/ UINT _ux_host_class_printer_device_id_get(UX_HOST_CLASS_PRINTER *printer, UCHAR *descriptor_buffer, ULONG length) @@ -142,7 +145,7 @@ UINT status; transfer_request -> ux_transfer_request_function = UX_HOST_CLASS_PRINTER_GET_DEVICE_ID; transfer_request -> ux_transfer_request_type = UX_REQUEST_IN | UX_REQUEST_TYPE_CLASS | UX_REQUEST_TARGET_INTERFACE; transfer_request -> ux_transfer_request_value = 0; /* Do not support multiple configuration for now. */ - transfer_request -> ux_transfer_request_index = (interface_ptr -> ux_interface_descriptor.bInterfaceNumber << 8) | + transfer_request -> ux_transfer_request_index = ((UINT)interface_ptr -> ux_interface_descriptor.bInterfaceNumber << 8) | (interface_ptr -> ux_interface_descriptor.bAlternateSetting ); #if defined(UX_HOST_STANDALONE) diff --git a/common/usbx_host_classes/src/ux_host_class_printer_name_get.c b/common/usbx_host_classes/src/ux_host_class_printer_name_get.c index 3640aad..a008656 100644 --- a/common/usbx_host_classes/src/ux_host_class_printer_name_get.c +++ b/common/usbx_host_classes/src/ux_host_class_printer_name_get.c @@ -125,7 +125,7 @@ UINT printer_name_length; /* FUNCTION RELEASE */ /* */ /* _ux_host_class_printer_name_get PORTABLE C */ -/* 6.1.12 */ +/* 6.x */ /* AUTHOR */ /* */ /* Chaoqiong Xiao, Microsoft Corporation */ @@ -176,6 +176,9 @@ UINT printer_name_length; /* fixed parameter/variable */ /* names conflict C++ keyword, */ /* resulting in version 6.1.12 */ +/* xx-xx-xxxx Chaoqiong Xiao Modified comment(s), */ +/* fixed compile warnings, */ +/* resulting in version 6.x */ /* */ /**************************************************************************/ UINT _ux_host_class_printer_name_get(UX_HOST_CLASS_PRINTER *printer) @@ -210,7 +213,7 @@ UINT status; transfer_request -> ux_transfer_request_function = UX_HOST_CLASS_PRINTER_GET_DEVICE_ID; transfer_request -> ux_transfer_request_type = UX_REQUEST_IN | UX_REQUEST_TYPE_CLASS | UX_REQUEST_TARGET_INTERFACE; transfer_request -> ux_transfer_request_value = 0; /* Do not support multiple configuration for now. */ - transfer_request -> ux_transfer_request_index = (interface_ptr -> ux_interface_descriptor.bInterfaceNumber << 8) | + transfer_request -> ux_transfer_request_index = ((UINT)interface_ptr -> ux_interface_descriptor.bInterfaceNumber << 8) | (interface_ptr -> ux_interface_descriptor.bAlternateSetting ); #if defined(UX_HOST_STANDALONE) diff --git a/common/usbx_host_controllers/src/ux_hcd_ehci_asynchronous_endpoint_create.c b/common/usbx_host_controllers/src/ux_hcd_ehci_asynchronous_endpoint_create.c index 0d03bbd..7aa4cfa 100644 --- a/common/usbx_host_controllers/src/ux_hcd_ehci_asynchronous_endpoint_create.c +++ b/common/usbx_host_controllers/src/ux_hcd_ehci_asynchronous_endpoint_create.c @@ -35,7 +35,7 @@ /* FUNCTION RELEASE */ /* */ /* _ux_hcd_ehci_asynchronous_endpoint_create PORTABLE C */ -/* 6.1.2 */ +/* 6.x */ /* AUTHOR */ /* */ /* Chaoqiong Xiao, Microsoft Corporation */ @@ -75,6 +75,9 @@ /* 11-09-2020 Chaoqiong Xiao Modified comment(s), */ /* fixed compile warnings, */ /* resulting in version 6.1.2 */ +/* xx-xx-xxxx Chaoqiong Xiao Modified comment(s), */ +/* fixed compile warnings, */ +/* resulting in version 6.x */ /* */ /**************************************************************************/ UINT _ux_hcd_ehci_asynchronous_endpoint_create(UX_HCD_EHCI *hcd_ehci, UX_ENDPOINT *endpoint) @@ -102,7 +105,7 @@ UX_EHCI_LINK_POINTER queue_head; ed -> REF_AS.INTR.ux_ehci_ed_endpoint = endpoint; /* Set the default MPS Capability info in the ED. */ - ed -> ux_ehci_ed_cap0 = endpoint -> ux_endpoint_descriptor.wMaxPacketSize << UX_EHCI_QH_MPS_LOC; + ed -> ux_ehci_ed_cap0 = (ULONG)endpoint -> ux_endpoint_descriptor.wMaxPacketSize << UX_EHCI_QH_MPS_LOC; /* Set the default NAK reload count. */ ed -> ux_ehci_ed_cap0 |= UX_EHCI_QH_NCR; diff --git a/common/usbx_host_controllers/src/ux_hcd_ehci_isochronous_endpoint_create.c b/common/usbx_host_controllers/src/ux_hcd_ehci_isochronous_endpoint_create.c index ef068a0..c5b4a67 100644 --- a/common/usbx_host_controllers/src/ux_hcd_ehci_isochronous_endpoint_create.c +++ b/common/usbx_host_controllers/src/ux_hcd_ehci_isochronous_endpoint_create.c @@ -35,7 +35,7 @@ /* FUNCTION RELEASE */ /* */ /* _ux_hcd_ehci_isochronous_endpoint_create PORTABLE C */ -/* 6.1.11 */ +/* 6.x */ /* AUTHOR */ /* */ /* Chaoqiong Xiao, Microsoft Corporation */ @@ -87,6 +87,9 @@ /* 04-25-2022 Chaoqiong Xiao Modified comment(s), */ /* fixed standalone compile, */ /* resulting in version 6.1.11 */ +/* xx-xx-xxxx Chaoqiong Xiao Modified comment(s), */ +/* fixed compile warnings, */ +/* resulting in version 6.x */ /* */ /**************************************************************************/ UINT _ux_hcd_ehci_isochronous_endpoint_create(UX_HCD_EHCI *hcd_ehci, UX_ENDPOINT *endpoint) @@ -171,7 +174,7 @@ UINT status; endpoint -> ux_endpoint_transfer_request.ux_transfer_request_maximum_length = max_trans_size; /* Get the Endpt, Device Address, I/O, Maximum Packet Size, Mult. */ - endpt = (endpoint -> ux_endpoint_descriptor.bEndpointAddress << UX_EHCI_HSISO_ENDPT_SHIFT) & UX_EHCI_HSISO_ENDPT_MASK; + endpt = ((ULONG)endpoint -> ux_endpoint_descriptor.bEndpointAddress << UX_EHCI_HSISO_ENDPT_SHIFT) & UX_EHCI_HSISO_ENDPT_MASK; device_address = device -> ux_device_address & UX_EHCI_HSISO_DEVICE_ADDRESS_MASK; io = (endpoint -> ux_endpoint_descriptor.bEndpointAddress & UX_ENDPOINT_DIRECTION) ? UX_EHCI_HSISO_DIRECTION_IN : UX_EHCI_HSISO_DIRECTION_OUT; diff --git a/common/usbx_host_controllers/src/ux_hcd_ehci_request_control_transfer.c b/common/usbx_host_controllers/src/ux_hcd_ehci_request_control_transfer.c index 8277267..278715d 100644 --- a/common/usbx_host_controllers/src/ux_hcd_ehci_request_control_transfer.c +++ b/common/usbx_host_controllers/src/ux_hcd_ehci_request_control_transfer.c @@ -35,7 +35,7 @@ /* FUNCTION RELEASE */ /* */ /* _ux_hcd_ehci_request_control_transfer PORTABLE C */ -/* 6.1.10 */ +/* 6.x */ /* AUTHOR */ /* */ /* Chaoqiong Xiao, Microsoft Corporation */ @@ -86,6 +86,9 @@ /* refined macros names, */ /* fixed compile warnings, */ /* resulting in version 6.1.2 */ +/* xx-xx-xxxx Chaoqiong Xiao Modified comment(s), */ +/* fixed compile warnings, */ +/* resulting in version 6.x */ /* */ /**************************************************************************/ UINT _ux_hcd_ehci_request_control_transfer(UX_HCD_EHCI *hcd_ehci, UX_TRANSFER *transfer_request) @@ -131,7 +134,7 @@ UINT pid; /* Set the default MPS Capability info in the ED. */ ed -> ux_ehci_ed_cap0 &= ~UX_EHCI_QH_MPS_MASK; - ed -> ux_ehci_ed_cap0 |= endpoint -> ux_endpoint_descriptor.wMaxPacketSize << UX_EHCI_QH_MPS_LOC; + ed -> ux_ehci_ed_cap0 |= (ULONG)endpoint -> ux_endpoint_descriptor.wMaxPacketSize << UX_EHCI_QH_MPS_LOC; /* On Control transfers, the toggle is set in the TD, not the QH. */ ed -> ux_ehci_ed_cap0 |= UX_EHCI_QH_DTC; diff --git a/ports/arm9/gnu/inc/ux_port.h b/ports/arm9/gnu/inc/ux_port.h index 180adbf..27af64f 100644 --- a/ports/arm9/gnu/inc/ux_port.h +++ b/ports/arm9/gnu/inc/ux_port.h @@ -26,7 +26,7 @@ /* PORT SPECIFIC C INFORMATION RELEASE */ /* */ /* ux_port.h ARM9/GNU */ -/* 6.1.10 */ +/* 6.x */ /* */ /* AUTHOR */ /* */ @@ -46,6 +46,10 @@ /* moved tx_api.h include and */ /* typedefs from ux_api.h, */ /* resulting in version 6.1.10 */ +/* xx-xx-xxxx Chaoqiong Xiao Modified comment(s), */ +/* added basic types guards, */ +/* improved SLONG typedef, */ +/* resulting in version 6.x */ /* */ /**************************************************************************/ @@ -80,7 +84,8 @@ #if !defined(TX_API_H) && !defined(TX_PORT_H) #include <stdint.h> -typedef void VOID; +#ifndef VOID +#define VOID void typedef char CHAR; typedef unsigned char UCHAR; typedef int INT; @@ -89,10 +94,16 @@ typedef long LONG; typedef unsigned long ULONG; typedef short SHORT; typedef unsigned short USHORT; +#endif + +#ifndef ULONG64_DEFINED typedef uint64_t ULONG64; +#define ULONG64_DEFINED +#endif #ifndef ALIGN_TYPE_DEFINED #define ALIGN_TYPE ULONG +#define ALIGN_TYPE_DEFINED #endif #endif @@ -110,7 +121,10 @@ typedef uint64_t ULONG64; /* Define additional generic USBX types. */ -typedef long SLONG; +#ifndef SLONG_DEFINED +typedef LONG SLONG; +#define SLONG_DEFINED +#endif /* Generic USBX Project constants follow. */ diff --git a/ports/arm9/iar/inc/ux_port.h b/ports/arm9/iar/inc/ux_port.h index b9fd63f..28c16ee 100644 --- a/ports/arm9/iar/inc/ux_port.h +++ b/ports/arm9/iar/inc/ux_port.h @@ -26,7 +26,7 @@ /* PORT SPECIFIC C INFORMATION RELEASE */ /* */ /* ux_port.h ARM9/IAR */ -/* 6.1.10 */ +/* 6.x */ /* */ /* AUTHOR */ /* */ @@ -46,6 +46,10 @@ /* moved tx_api.h include and */ /* typedefs from ux_api.h, */ /* resulting in version 6.1.10 */ +/* xx-xx-xxxx Chaoqiong Xiao Modified comment(s), */ +/* added basic types guards, */ +/* improved SLONG typedef, */ +/* resulting in version 6.x */ /* */ /**************************************************************************/ @@ -80,7 +84,8 @@ #if !defined(TX_API_H) && !defined(TX_PORT_H) #include <stdint.h> -typedef void VOID; +#ifndef VOID +#define VOID void typedef char CHAR; typedef unsigned char UCHAR; typedef int INT; @@ -89,10 +94,16 @@ typedef long LONG; typedef unsigned long ULONG; typedef short SHORT; typedef unsigned short USHORT; +#endif + +#ifndef ULONG64_DEFINED typedef uint64_t ULONG64; +#define ULONG64_DEFINED +#endif #ifndef ALIGN_TYPE_DEFINED #define ALIGN_TYPE ULONG +#define ALIGN_TYPE_DEFINED #endif #endif @@ -110,7 +121,10 @@ typedef uint64_t ULONG64; /* Define additional generic USBX types. */ -typedef long SLONG; +#ifndef SLONG_DEFINED +typedef LONG SLONG; +#define SLONG_DEFINED +#endif /* Generic USBX Project constants follow. */ diff --git a/ports/cortex_a15/gnu/inc/ux_port.h b/ports/cortex_a15/gnu/inc/ux_port.h index 058f509..84ea8df 100644 --- a/ports/cortex_a15/gnu/inc/ux_port.h +++ b/ports/cortex_a15/gnu/inc/ux_port.h @@ -26,7 +26,7 @@ /* PORT SPECIFIC C INFORMATION RELEASE */ /* */ /* ux_port.h Cortex-A15/GNU */ -/* 6.1.10 */ +/* 6.x */ /* */ /* AUTHOR */ /* */ @@ -46,6 +46,10 @@ /* moved tx_api.h include and */ /* typedefs from ux_api.h, */ /* resulting in version 6.1.10 */ +/* xx-xx-xxxx Chaoqiong Xiao Modified comment(s), */ +/* added basic types guards, */ +/* improved SLONG typedef, */ +/* resulting in version 6.x */ /* */ /**************************************************************************/ @@ -80,7 +84,8 @@ #if !defined(TX_API_H) && !defined(TX_PORT_H) #include <stdint.h> -typedef void VOID; +#ifndef VOID +#define VOID void typedef char CHAR; typedef unsigned char UCHAR; typedef int INT; @@ -89,10 +94,16 @@ typedef long LONG; typedef unsigned long ULONG; typedef short SHORT; typedef unsigned short USHORT; +#endif + +#ifndef ULONG64_DEFINED typedef uint64_t ULONG64; +#define ULONG64_DEFINED +#endif #ifndef ALIGN_TYPE_DEFINED #define ALIGN_TYPE ULONG +#define ALIGN_TYPE_DEFINED #endif #endif @@ -110,7 +121,10 @@ typedef uint64_t ULONG64; /* Define additional generic USBX types. */ -typedef long SLONG; +#ifndef SLONG_DEFINED +typedef LONG SLONG; +#define SLONG_DEFINED +#endif /* Generic USBX Project constants follow. */ diff --git a/ports/cortex_a5/gnu/inc/ux_port.h b/ports/cortex_a5/gnu/inc/ux_port.h index 46babf4..1a44c1b 100644 --- a/ports/cortex_a5/gnu/inc/ux_port.h +++ b/ports/cortex_a5/gnu/inc/ux_port.h @@ -26,7 +26,7 @@ /* PORT SPECIFIC C INFORMATION RELEASE */ /* */ /* ux_port.h Cortex-A5/GNU */ -/* 6.1.10 */ +/* 6.x */ /* */ /* AUTHOR */ /* */ @@ -46,6 +46,10 @@ /* moved tx_api.h include and */ /* typedefs from ux_api.h, */ /* resulting in version 6.1.10 */ +/* xx-xx-xxxx Chaoqiong Xiao Modified comment(s), */ +/* added basic types guards, */ +/* improved SLONG typedef, */ +/* resulting in version 6.x */ /* */ /**************************************************************************/ @@ -80,7 +84,8 @@ #if !defined(TX_API_H) && !defined(TX_PORT_H) #include <stdint.h> -typedef void VOID; +#ifndef VOID +#define VOID void typedef char CHAR; typedef unsigned char UCHAR; typedef int INT; @@ -89,10 +94,16 @@ typedef long LONG; typedef unsigned long ULONG; typedef short SHORT; typedef unsigned short USHORT; +#endif + +#ifndef ULONG64_DEFINED typedef uint64_t ULONG64; +#define ULONG64_DEFINED +#endif #ifndef ALIGN_TYPE_DEFINED #define ALIGN_TYPE ULONG +#define ALIGN_TYPE_DEFINED #endif #endif @@ -110,7 +121,10 @@ typedef uint64_t ULONG64; /* Define additional generic USBX types. */ -typedef long SLONG; +#ifndef SLONG_DEFINED +typedef LONG SLONG; +#define SLONG_DEFINED +#endif /* Generic USBX Project constants follow. */ diff --git a/ports/cortex_a5/iar/inc/ux_port.h b/ports/cortex_a5/iar/inc/ux_port.h index d1b6118..047417e 100644 --- a/ports/cortex_a5/iar/inc/ux_port.h +++ b/ports/cortex_a5/iar/inc/ux_port.h @@ -26,7 +26,7 @@ /* PORT SPECIFIC C INFORMATION RELEASE */ /* */ /* ux_port.h Cortex-A5/IAR */ -/* 6.1.10 */ +/* 6.x */ /* */ /* AUTHOR */ /* */ @@ -46,6 +46,10 @@ /* moved tx_api.h include and */ /* typedefs from ux_api.h, */ /* resulting in version 6.1.10 */ +/* xx-xx-xxxx Chaoqiong Xiao Modified comment(s), */ +/* added basic types guards, */ +/* improved SLONG typedef, */ +/* resulting in version 6.x */ /* */ /**************************************************************************/ @@ -80,7 +84,8 @@ #if !defined(TX_API_H) && !defined(TX_PORT_H) #include <stdint.h> -typedef void VOID; +#ifndef VOID +#define VOID void typedef char CHAR; typedef unsigned char UCHAR; typedef int INT; @@ -89,10 +94,16 @@ typedef long LONG; typedef unsigned long ULONG; typedef short SHORT; typedef unsigned short USHORT; +#endif + +#ifndef ULONG64_DEFINED typedef uint64_t ULONG64; +#define ULONG64_DEFINED +#endif #ifndef ALIGN_TYPE_DEFINED #define ALIGN_TYPE ULONG +#define ALIGN_TYPE_DEFINED #endif #endif @@ -110,7 +121,10 @@ typedef uint64_t ULONG64; /* Define additional generic USBX types. */ -typedef long SLONG; +#ifndef SLONG_DEFINED +typedef LONG SLONG; +#define SLONG_DEFINED +#endif /* Generic USBX Project constants follow. */ diff --git a/ports/cortex_a5x/ac6/inc/ux_port.h b/ports/cortex_a5x/ac6/inc/ux_port.h index 887c2b0..e92bc87 100644 --- a/ports/cortex_a5x/ac6/inc/ux_port.h +++ b/ports/cortex_a5x/ac6/inc/ux_port.h @@ -26,7 +26,7 @@ /* PORT SPECIFIC C INFORMATION RELEASE */ /* */ /* ux_port.h Cortex-A5x/AC6 */ -/* 6.1.10 */ +/* 6.x */ /* */ /* AUTHOR */ /* */ @@ -46,6 +46,10 @@ /* moved tx_api.h include and */ /* typedefs from ux_api.h, */ /* resulting in version 6.1.10 */ +/* xx-xx-xxxx Chaoqiong Xiao Modified comment(s), */ +/* added basic types guards, */ +/* improved SLONG typedef, */ +/* resulting in version 6.x */ /* */ /**************************************************************************/ @@ -80,7 +84,8 @@ #if !defined(TX_API_H) && !defined(TX_PORT_H) #include <stdint.h> -typedef void VOID; +#ifndef VOID +#define VOID void typedef char CHAR; typedef unsigned char UCHAR; typedef int INT; @@ -89,10 +94,16 @@ typedef long LONG; typedef unsigned long ULONG; typedef short SHORT; typedef unsigned short USHORT; +#endif + +#ifndef ULONG64_DEFINED typedef uint64_t ULONG64; +#define ULONG64_DEFINED +#endif #ifndef ALIGN_TYPE_DEFINED #define ALIGN_TYPE ULONG +#define ALIGN_TYPE_DEFINED #endif #endif @@ -110,7 +121,10 @@ typedef uint64_t ULONG64; /* Define additional generic USBX types. */ -typedef long SLONG; +#ifndef SLONG_DEFINED +typedef LONG SLONG; +#define SLONG_DEFINED +#endif /* Generic USBX Project constants follow. */ diff --git a/ports/cortex_a7/gnu/inc/ux_port.h b/ports/cortex_a7/gnu/inc/ux_port.h index 86edca6..2576246 100644 --- a/ports/cortex_a7/gnu/inc/ux_port.h +++ b/ports/cortex_a7/gnu/inc/ux_port.h @@ -26,7 +26,7 @@ /* PORT SPECIFIC C INFORMATION RELEASE */ /* */ /* ux_port.h Cortex-A7/GNU */ -/* 6.1.10 */ +/* 6.x */ /* */ /* AUTHOR */ /* */ @@ -46,6 +46,10 @@ /* moved tx_api.h include and */ /* typedefs from ux_api.h, */ /* resulting in version 6.1.10 */ +/* xx-xx-xxxx Chaoqiong Xiao Modified comment(s), */ +/* added basic types guards, */ +/* improved SLONG typedef, */ +/* resulting in version 6.x */ /* */ /**************************************************************************/ @@ -80,7 +84,8 @@ #if !defined(TX_API_H) && !defined(TX_PORT_H) #include <stdint.h> -typedef void VOID; +#ifndef VOID +#define VOID void typedef char CHAR; typedef unsigned char UCHAR; typedef int INT; @@ -89,10 +94,16 @@ typedef long LONG; typedef unsigned long ULONG; typedef short SHORT; typedef unsigned short USHORT; +#endif + +#ifndef ULONG64_DEFINED typedef uint64_t ULONG64; +#define ULONG64_DEFINED +#endif #ifndef ALIGN_TYPE_DEFINED #define ALIGN_TYPE ULONG +#define ALIGN_TYPE_DEFINED #endif #endif @@ -110,7 +121,10 @@ typedef uint64_t ULONG64; /* Define additional generic USBX types. */ -typedef long SLONG; +#ifndef SLONG_DEFINED +typedef LONG SLONG; +#define SLONG_DEFINED +#endif /* Generic USBX Project constants follow. */ diff --git a/ports/cortex_a7/iar/inc/ux_port.h b/ports/cortex_a7/iar/inc/ux_port.h index dd01a95..a8f5662 100644 --- a/ports/cortex_a7/iar/inc/ux_port.h +++ b/ports/cortex_a7/iar/inc/ux_port.h @@ -26,7 +26,7 @@ /* PORT SPECIFIC C INFORMATION RELEASE */ /* */ /* ux_port.h Cortex-A7/IAR */ -/* 6.1.10 */ +/* 6.x */ /* */ /* AUTHOR */ /* */ @@ -46,6 +46,10 @@ /* moved tx_api.h include and */ /* typedefs from ux_api.h, */ /* resulting in version 6.1.10 */ +/* xx-xx-xxxx Chaoqiong Xiao Modified comment(s), */ +/* added basic types guards, */ +/* improved SLONG typedef, */ +/* resulting in version 6.x */ /* */ /**************************************************************************/ @@ -80,7 +84,8 @@ #if !defined(TX_API_H) && !defined(TX_PORT_H) #include <stdint.h> -typedef void VOID; +#ifndef VOID +#define VOID void typedef char CHAR; typedef unsigned char UCHAR; typedef int INT; @@ -89,10 +94,16 @@ typedef long LONG; typedef unsigned long ULONG; typedef short SHORT; typedef unsigned short USHORT; +#endif + +#ifndef ULONG64_DEFINED typedef uint64_t ULONG64; +#define ULONG64_DEFINED +#endif #ifndef ALIGN_TYPE_DEFINED #define ALIGN_TYPE ULONG +#define ALIGN_TYPE_DEFINED #endif #endif @@ -110,7 +121,10 @@ typedef uint64_t ULONG64; /* Define additional generic USBX types. */ -typedef long SLONG; +#ifndef SLONG_DEFINED +typedef LONG SLONG; +#define SLONG_DEFINED +#endif /* Generic USBX Project constants follow. */ diff --git a/ports/cortex_a8/gnu/inc/ux_port.h b/ports/cortex_a8/gnu/inc/ux_port.h index 5cda0b8..18a534b 100644 --- a/ports/cortex_a8/gnu/inc/ux_port.h +++ b/ports/cortex_a8/gnu/inc/ux_port.h @@ -26,7 +26,7 @@ /* PORT SPECIFIC C INFORMATION RELEASE */ /* */ /* ux_port.h Cortex-A8/GNU */ -/* 6.1.10 */ +/* 6.x */ /* */ /* AUTHOR */ /* */ @@ -46,6 +46,10 @@ /* moved tx_api.h include and */ /* typedefs from ux_api.h, */ /* resulting in version 6.1.10 */ +/* xx-xx-xxxx Chaoqiong Xiao Modified comment(s), */ +/* added basic types guards, */ +/* improved SLONG typedef, */ +/* resulting in version 6.x */ /* */ /**************************************************************************/ @@ -80,7 +84,8 @@ #if !defined(TX_API_H) && !defined(TX_PORT_H) #include <stdint.h> -typedef void VOID; +#ifndef VOID +#define VOID void typedef char CHAR; typedef unsigned char UCHAR; typedef int INT; @@ -89,10 +94,16 @@ typedef long LONG; typedef unsigned long ULONG; typedef short SHORT; typedef unsigned short USHORT; +#endif + +#ifndef ULONG64_DEFINED typedef uint64_t ULONG64; +#define ULONG64_DEFINED +#endif #ifndef ALIGN_TYPE_DEFINED #define ALIGN_TYPE ULONG +#define ALIGN_TYPE_DEFINED #endif #endif @@ -110,7 +121,10 @@ typedef uint64_t ULONG64; /* Define additional generic USBX types. */ -typedef long SLONG; +#ifndef SLONG_DEFINED +typedef LONG SLONG; +#define SLONG_DEFINED +#endif /* Generic USBX Project constants follow. */ diff --git a/ports/cortex_a8/iar/inc/ux_port.h b/ports/cortex_a8/iar/inc/ux_port.h index 30249c4..ee31762 100644 --- a/ports/cortex_a8/iar/inc/ux_port.h +++ b/ports/cortex_a8/iar/inc/ux_port.h @@ -26,7 +26,7 @@ /* PORT SPECIFIC C INFORMATION RELEASE */ /* */ /* ux_port.h Cortex-A8/IAR */ -/* 6.1.10 */ +/* 6.x */ /* */ /* AUTHOR */ /* */ @@ -46,6 +46,10 @@ /* moved tx_api.h include and */ /* typedefs from ux_api.h, */ /* resulting in version 6.1.10 */ +/* xx-xx-xxxx Chaoqiong Xiao Modified comment(s), */ +/* added basic types guards, */ +/* improved SLONG typedef, */ +/* resulting in version 6.x */ /* */ /**************************************************************************/ @@ -80,7 +84,8 @@ #if !defined(TX_API_H) && !defined(TX_PORT_H) #include <stdint.h> -typedef void VOID; +#ifndef VOID +#define VOID void typedef char CHAR; typedef unsigned char UCHAR; typedef int INT; @@ -89,10 +94,16 @@ typedef long LONG; typedef unsigned long ULONG; typedef short SHORT; typedef unsigned short USHORT; +#endif + +#ifndef ULONG64_DEFINED typedef uint64_t ULONG64; +#define ULONG64_DEFINED +#endif #ifndef ALIGN_TYPE_DEFINED #define ALIGN_TYPE ULONG +#define ALIGN_TYPE_DEFINED #endif #endif @@ -110,7 +121,10 @@ typedef uint64_t ULONG64; /* Define additional generic USBX types. */ -typedef long SLONG; +#ifndef SLONG_DEFINED +typedef LONG SLONG; +#define SLONG_DEFINED +#endif /* Generic USBX Project constants follow. */ diff --git a/ports/cortex_a9/gnu/inc/ux_port.h b/ports/cortex_a9/gnu/inc/ux_port.h index e2c45f7..0c2e760 100644 --- a/ports/cortex_a9/gnu/inc/ux_port.h +++ b/ports/cortex_a9/gnu/inc/ux_port.h @@ -26,7 +26,7 @@ /* PORT SPECIFIC C INFORMATION RELEASE */ /* */ /* ux_port.h ARM9/GNU */ -/* 6.1.10 */ +/* 6.x */ /* */ /* AUTHOR */ /* */ @@ -46,6 +46,10 @@ /* moved tx_api.h include and */ /* typedefs from ux_api.h, */ /* resulting in version 6.1.10 */ +/* xx-xx-xxxx Chaoqiong Xiao Modified comment(s), */ +/* added basic types guards, */ +/* improved SLONG typedef, */ +/* resulting in version 6.x */ /* */ /**************************************************************************/ @@ -80,7 +84,8 @@ #if !defined(TX_API_H) && !defined(TX_PORT_H) #include <stdint.h> -typedef void VOID; +#ifndef VOID +#define VOID void typedef char CHAR; typedef unsigned char UCHAR; typedef int INT; @@ -89,10 +94,16 @@ typedef long LONG; typedef unsigned long ULONG; typedef short SHORT; typedef unsigned short USHORT; +#endif + +#ifndef ULONG64_DEFINED typedef uint64_t ULONG64; +#define ULONG64_DEFINED +#endif #ifndef ALIGN_TYPE_DEFINED #define ALIGN_TYPE ULONG +#define ALIGN_TYPE_DEFINED #endif #endif @@ -110,7 +121,10 @@ typedef uint64_t ULONG64; /* Define additional generic USBX types. */ -typedef long SLONG; +#ifndef SLONG_DEFINED +typedef LONG SLONG; +#define SLONG_DEFINED +#endif /* Generic USBX Project constants follow. */ diff --git a/ports/cortex_a9/iar/inc/ux_port.h b/ports/cortex_a9/iar/inc/ux_port.h index 7cbff01..9a511f0 100644 --- a/ports/cortex_a9/iar/inc/ux_port.h +++ b/ports/cortex_a9/iar/inc/ux_port.h @@ -26,7 +26,7 @@ /* PORT SPECIFIC C INFORMATION RELEASE */ /* */ /* ux_port.h ARM9/IAR */ -/* 6.1.10 */ +/* 6.x */ /* */ /* AUTHOR */ /* */ @@ -46,6 +46,10 @@ /* moved tx_api.h include and */ /* typedefs from ux_api.h, */ /* resulting in version 6.1.10 */ +/* xx-xx-xxxx Chaoqiong Xiao Modified comment(s), */ +/* added basic types guards, */ +/* improved SLONG typedef, */ +/* resulting in version 6.x */ /* */ /**************************************************************************/ @@ -80,7 +84,8 @@ #if !defined(TX_API_H) && !defined(TX_PORT_H) #include <stdint.h> -typedef void VOID; +#ifndef VOID +#define VOID void typedef char CHAR; typedef unsigned char UCHAR; typedef int INT; @@ -89,10 +94,16 @@ typedef long LONG; typedef unsigned long ULONG; typedef short SHORT; typedef unsigned short USHORT; +#endif + +#ifndef ULONG64_DEFINED typedef uint64_t ULONG64; +#define ULONG64_DEFINED +#endif #ifndef ALIGN_TYPE_DEFINED #define ALIGN_TYPE ULONG +#define ALIGN_TYPE_DEFINED #endif #endif @@ -110,7 +121,10 @@ typedef uint64_t ULONG64; /* Define additional generic USBX types. */ -typedef long SLONG; +#ifndef SLONG_DEFINED +typedef LONG SLONG; +#define SLONG_DEFINED +#endif /* Generic USBX Project constants follow. */ diff --git a/ports/cortex_m0/gnu/inc/ux_port.h b/ports/cortex_m0/gnu/inc/ux_port.h index a015ba1..6eba5b5 100644 --- a/ports/cortex_m0/gnu/inc/ux_port.h +++ b/ports/cortex_m0/gnu/inc/ux_port.h @@ -26,7 +26,7 @@ /* PORT SPECIFIC C INFORMATION RELEASE */ /* */ /* ux_port.h Cortex-M0/GNU */ -/* 6.1.10 */ +/* 6.x */ /* */ /* AUTHOR */ /* */ @@ -48,6 +48,10 @@ /* moved tx_api.h include and */ /* typedefs from ux_api.h, */ /* resulting in version 6.1.10 */ +/* xx-xx-xxxx Chaoqiong Xiao Modified comment(s), */ +/* added basic types guards, */ +/* improved SLONG typedef, */ +/* resulting in version 6.x */ /* */ /**************************************************************************/ @@ -82,7 +86,8 @@ #if !defined(TX_API_H) && !defined(TX_PORT_H) #include <stdint.h> -typedef void VOID; +#ifndef VOID +#define VOID void typedef char CHAR; typedef unsigned char UCHAR; typedef int INT; @@ -91,10 +96,16 @@ typedef long LONG; typedef unsigned long ULONG; typedef short SHORT; typedef unsigned short USHORT; +#endif + +#ifndef ULONG64_DEFINED typedef uint64_t ULONG64; +#define ULONG64_DEFINED +#endif #ifndef ALIGN_TYPE_DEFINED #define ALIGN_TYPE ULONG +#define ALIGN_TYPE_DEFINED #endif #endif @@ -112,7 +123,10 @@ typedef uint64_t ULONG64; /* Define additional generic USBX types. */ -typedef long SLONG; +#ifndef SLONG_DEFINED +typedef LONG SLONG; +#define SLONG_DEFINED +#endif /* Generic USBX Project constants follow. */ diff --git a/ports/cortex_m0/iar/inc/ux_port.h b/ports/cortex_m0/iar/inc/ux_port.h index 8c6241a..5435b53 100644 --- a/ports/cortex_m0/iar/inc/ux_port.h +++ b/ports/cortex_m0/iar/inc/ux_port.h @@ -26,7 +26,7 @@ /* PORT SPECIFIC C INFORMATION RELEASE */ /* */ /* ux_port.h Cortex-M0/IAR */ -/* 6.1.10 */ +/* 6.x */ /* */ /* AUTHOR */ /* */ @@ -46,6 +46,10 @@ /* moved tx_api.h include and */ /* typedefs from ux_api.h, */ /* resulting in version 6.1.10 */ +/* xx-xx-xxxx Chaoqiong Xiao Modified comment(s), */ +/* added basic types guards, */ +/* improved SLONG typedef, */ +/* resulting in version 6.x */ /* */ /**************************************************************************/ @@ -80,7 +84,8 @@ #if !defined(TX_API_H) && !defined(TX_PORT_H) #include <stdint.h> -typedef void VOID; +#ifndef VOID +#define VOID void typedef char CHAR; typedef unsigned char UCHAR; typedef int INT; @@ -89,10 +94,16 @@ typedef long LONG; typedef unsigned long ULONG; typedef short SHORT; typedef unsigned short USHORT; +#endif + +#ifndef ULONG64_DEFINED typedef uint64_t ULONG64; +#define ULONG64_DEFINED +#endif #ifndef ALIGN_TYPE_DEFINED #define ALIGN_TYPE ULONG +#define ALIGN_TYPE_DEFINED #endif #endif @@ -110,7 +121,10 @@ typedef uint64_t ULONG64; /* Define additional generic USBX types. */ -typedef long SLONG; +#ifndef SLONG_DEFINED +typedef LONG SLONG; +#define SLONG_DEFINED +#endif /* Generic USBX Project constants follow. */ diff --git a/ports/cortex_m3/gnu/inc/ux_port.h b/ports/cortex_m3/gnu/inc/ux_port.h index a26b679..484312b 100644 --- a/ports/cortex_m3/gnu/inc/ux_port.h +++ b/ports/cortex_m3/gnu/inc/ux_port.h @@ -26,7 +26,7 @@ /* PORT SPECIFIC C INFORMATION RELEASE */ /* */ /* ux_port.h Cortex-M3/GNU */ -/* 6.1.10 */ +/* 6.x */ /* */ /* AUTHOR */ /* */ @@ -48,6 +48,10 @@ /* moved tx_api.h include and */ /* typedefs from ux_api.h, */ /* resulting in version 6.1.10 */ +/* xx-xx-xxxx Chaoqiong Xiao Modified comment(s), */ +/* added basic types guards, */ +/* improved SLONG typedef, */ +/* resulting in version 6.x */ /* */ /**************************************************************************/ @@ -82,7 +86,8 @@ #if !defined(TX_API_H) && !defined(TX_PORT_H) #include <stdint.h> -typedef void VOID; +#ifndef VOID +#define VOID void typedef char CHAR; typedef unsigned char UCHAR; typedef int INT; @@ -91,10 +96,16 @@ typedef long LONG; typedef unsigned long ULONG; typedef short SHORT; typedef unsigned short USHORT; +#endif + +#ifndef ULONG64_DEFINED typedef uint64_t ULONG64; +#define ULONG64_DEFINED +#endif #ifndef ALIGN_TYPE_DEFINED #define ALIGN_TYPE ULONG +#define ALIGN_TYPE_DEFINED #endif #endif @@ -112,7 +123,10 @@ typedef uint64_t ULONG64; /* Define additional generic USBX types. */ -typedef long SLONG; +#ifndef SLONG_DEFINED +typedef LONG SLONG; +#define SLONG_DEFINED +#endif /* Generic USBX Project constants follow. */ diff --git a/ports/cortex_m3/iar/inc/ux_port.h b/ports/cortex_m3/iar/inc/ux_port.h index a32cb28..3ba9256 100644 --- a/ports/cortex_m3/iar/inc/ux_port.h +++ b/ports/cortex_m3/iar/inc/ux_port.h @@ -26,7 +26,7 @@ /* PORT SPECIFIC C INFORMATION RELEASE */ /* */ /* ux_port.h Cortex-M3/IAR */ -/* 6.1.10 */ +/* 6.x */ /* */ /* AUTHOR */ /* */ @@ -46,6 +46,10 @@ /* moved tx_api.h include and */ /* typedefs from ux_api.h, */ /* resulting in version 6.1.10 */ +/* xx-xx-xxxx Chaoqiong Xiao Modified comment(s), */ +/* added basic types guards, */ +/* improved SLONG typedef, */ +/* resulting in version 6.x */ /* */ /**************************************************************************/ @@ -80,7 +84,8 @@ #if !defined(TX_API_H) && !defined(TX_PORT_H) #include <stdint.h> -typedef void VOID; +#ifndef VOID +#define VOID void typedef char CHAR; typedef unsigned char UCHAR; typedef int INT; @@ -89,10 +94,16 @@ typedef long LONG; typedef unsigned long ULONG; typedef short SHORT; typedef unsigned short USHORT; +#endif + +#ifndef ULONG64_DEFINED typedef uint64_t ULONG64; +#define ULONG64_DEFINED +#endif #ifndef ALIGN_TYPE_DEFINED #define ALIGN_TYPE ULONG +#define ALIGN_TYPE_DEFINED #endif #endif @@ -110,7 +121,10 @@ typedef uint64_t ULONG64; /* Define additional generic USBX types. */ -typedef long SLONG; +#ifndef SLONG_DEFINED +typedef LONG SLONG; +#define SLONG_DEFINED +#endif /* Generic USBX Project constants follow. */ diff --git a/ports/cortex_m4/gnu/inc/ux_port.h b/ports/cortex_m4/gnu/inc/ux_port.h index c1eb4ac..4ac9f89 100644 --- a/ports/cortex_m4/gnu/inc/ux_port.h +++ b/ports/cortex_m4/gnu/inc/ux_port.h @@ -26,7 +26,7 @@ /* PORT SPECIFIC C INFORMATION RELEASE */ /* */ /* ux_port.h Cortex-M4/GNU */ -/* 6.1.10 */ +/* 6.x */ /* */ /* AUTHOR */ /* */ @@ -48,6 +48,10 @@ /* moved tx_api.h include and */ /* typedefs from ux_api.h, */ /* resulting in version 6.1.10 */ +/* xx-xx-xxxx Chaoqiong Xiao Modified comment(s), */ +/* added basic types guards, */ +/* improved SLONG typedef, */ +/* resulting in version 6.x */ /* */ /**************************************************************************/ @@ -82,7 +86,8 @@ #if !defined(TX_API_H) && !defined(TX_PORT_H) #include <stdint.h> -typedef void VOID; +#ifndef VOID +#define VOID void typedef char CHAR; typedef unsigned char UCHAR; typedef int INT; @@ -91,10 +96,16 @@ typedef long LONG; typedef unsigned long ULONG; typedef short SHORT; typedef unsigned short USHORT; +#endif + +#ifndef ULONG64_DEFINED typedef uint64_t ULONG64; +#define ULONG64_DEFINED +#endif #ifndef ALIGN_TYPE_DEFINED #define ALIGN_TYPE ULONG +#define ALIGN_TYPE_DEFINED #endif #endif @@ -112,7 +123,10 @@ typedef uint64_t ULONG64; /* Define additional generic USBX types. */ -typedef long SLONG; +#ifndef SLONG_DEFINED +typedef LONG SLONG; +#define SLONG_DEFINED +#endif /* Generic USBX Project constants follow. */ diff --git a/ports/cortex_m4/iar/inc/ux_port.h b/ports/cortex_m4/iar/inc/ux_port.h index 22f4250..65d4e15 100644 --- a/ports/cortex_m4/iar/inc/ux_port.h +++ b/ports/cortex_m4/iar/inc/ux_port.h @@ -26,7 +26,7 @@ /* PORT SPECIFIC C INFORMATION RELEASE */ /* */ /* ux_port.h Cortex-M4/IAR */ -/* 6.1.10 */ +/* 6.x */ /* */ /* AUTHOR */ /* */ @@ -46,6 +46,10 @@ /* moved tx_api.h include and */ /* typedefs from ux_api.h, */ /* resulting in version 6.1.10 */ +/* xx-xx-xxxx Chaoqiong Xiao Modified comment(s), */ +/* added basic types guards, */ +/* improved SLONG typedef, */ +/* resulting in version 6.x */ /* */ /**************************************************************************/ @@ -80,7 +84,8 @@ #if !defined(TX_API_H) && !defined(TX_PORT_H) #include <stdint.h> -typedef void VOID; +#ifndef VOID +#define VOID void typedef char CHAR; typedef unsigned char UCHAR; typedef int INT; @@ -89,10 +94,16 @@ typedef long LONG; typedef unsigned long ULONG; typedef short SHORT; typedef unsigned short USHORT; +#endif + +#ifndef ULONG64_DEFINED typedef uint64_t ULONG64; +#define ULONG64_DEFINED +#endif #ifndef ALIGN_TYPE_DEFINED #define ALIGN_TYPE ULONG +#define ALIGN_TYPE_DEFINED #endif #endif @@ -110,7 +121,10 @@ typedef uint64_t ULONG64; /* Define additional generic USBX types. */ -typedef long SLONG; +#ifndef SLONG_DEFINED +typedef LONG SLONG; +#define SLONG_DEFINED +#endif /* Generic USBX Project constants follow. */ diff --git a/ports/cortex_m7/gnu/inc/ux_port.h b/ports/cortex_m7/gnu/inc/ux_port.h index a8e50f6..9e077ae 100644 --- a/ports/cortex_m7/gnu/inc/ux_port.h +++ b/ports/cortex_m7/gnu/inc/ux_port.h @@ -26,7 +26,7 @@ /* PORT SPECIFIC C INFORMATION RELEASE */ /* */ /* ux_port.h Cortex-M7/GNU */ -/* 6.1.10 */ +/* 6.x */ /* */ /* AUTHOR */ /* */ @@ -48,6 +48,10 @@ /* moved tx_api.h include and */ /* typedefs from ux_api.h, */ /* resulting in version 6.1.10 */ +/* xx-xx-xxxx Chaoqiong Xiao Modified comment(s), */ +/* added basic types guards, */ +/* improved SLONG typedef, */ +/* resulting in version 6.x */ /* */ /**************************************************************************/ @@ -82,7 +86,8 @@ #if !defined(TX_API_H) && !defined(TX_PORT_H) #include <stdint.h> -typedef void VOID; +#ifndef VOID +#define VOID void typedef char CHAR; typedef unsigned char UCHAR; typedef int INT; @@ -91,10 +96,16 @@ typedef long LONG; typedef unsigned long ULONG; typedef short SHORT; typedef unsigned short USHORT; +#endif + +#ifndef ULONG64_DEFINED typedef uint64_t ULONG64; +#define ULONG64_DEFINED +#endif #ifndef ALIGN_TYPE_DEFINED #define ALIGN_TYPE ULONG +#define ALIGN_TYPE_DEFINED #endif #endif @@ -112,7 +123,10 @@ typedef uint64_t ULONG64; /* Define additional generic USBX types. */ -typedef long SLONG; +#ifndef SLONG_DEFINED +typedef LONG SLONG; +#define SLONG_DEFINED +#endif /* Generic USBX Project constants follow. */ diff --git a/ports/cortex_m7/iar/inc/ux_port.h b/ports/cortex_m7/iar/inc/ux_port.h index 813bd4e..4337c06 100644 --- a/ports/cortex_m7/iar/inc/ux_port.h +++ b/ports/cortex_m7/iar/inc/ux_port.h @@ -26,7 +26,7 @@ /* PORT SPECIFIC C INFORMATION RELEASE */ /* */ /* ux_port.h Cortex-M7/IAR */ -/* 6.1.10 */ +/* 6.x */ /* */ /* AUTHOR */ /* */ @@ -46,6 +46,10 @@ /* moved tx_api.h include and */ /* typedefs from ux_api.h, */ /* resulting in version 6.1.10 */ +/* xx-xx-xxxx Chaoqiong Xiao Modified comment(s), */ +/* added basic types guards, */ +/* improved SLONG typedef, */ +/* resulting in version 6.x */ /* */ /**************************************************************************/ @@ -80,7 +84,8 @@ #if !defined(TX_API_H) && !defined(TX_PORT_H) #include <stdint.h> -typedef void VOID; +#ifndef VOID +#define VOID void typedef char CHAR; typedef unsigned char UCHAR; typedef int INT; @@ -89,10 +94,16 @@ typedef long LONG; typedef unsigned long ULONG; typedef short SHORT; typedef unsigned short USHORT; +#endif + +#ifndef ULONG64_DEFINED typedef uint64_t ULONG64; +#define ULONG64_DEFINED +#endif #ifndef ALIGN_TYPE_DEFINED #define ALIGN_TYPE ULONG +#define ALIGN_TYPE_DEFINED #endif #endif @@ -110,7 +121,10 @@ typedef uint64_t ULONG64; /* Define additional generic USBX types. */ -typedef long SLONG; +#ifndef SLONG_DEFINED +typedef LONG SLONG; +#define SLONG_DEFINED +#endif /* Generic USBX Project constants follow. */ diff --git a/ports/cortex_r4/gnu/inc/ux_port.h b/ports/cortex_r4/gnu/inc/ux_port.h index ba0a5cf..2008bc4 100644 --- a/ports/cortex_r4/gnu/inc/ux_port.h +++ b/ports/cortex_r4/gnu/inc/ux_port.h @@ -26,7 +26,7 @@ /* PORT SPECIFIC C INFORMATION RELEASE */ /* */ /* ux_port.h Cortex-R4/GNU */ -/* 6.1.10 */ +/* 6.x */ /* */ /* AUTHOR */ /* */ @@ -46,6 +46,10 @@ /* moved tx_api.h include and */ /* typedefs from ux_api.h, */ /* resulting in version 6.1.10 */ +/* xx-xx-xxxx Chaoqiong Xiao Modified comment(s), */ +/* added basic types guards, */ +/* improved SLONG typedef, */ +/* resulting in version 6.x */ /* */ /**************************************************************************/ @@ -80,7 +84,8 @@ #if !defined(TX_API_H) && !defined(TX_PORT_H) #include <stdint.h> -typedef void VOID; +#ifndef VOID +#define VOID void typedef char CHAR; typedef unsigned char UCHAR; typedef int INT; @@ -89,10 +94,16 @@ typedef long LONG; typedef unsigned long ULONG; typedef short SHORT; typedef unsigned short USHORT; +#endif + +#ifndef ULONG64_DEFINED typedef uint64_t ULONG64; +#define ULONG64_DEFINED +#endif #ifndef ALIGN_TYPE_DEFINED #define ALIGN_TYPE ULONG +#define ALIGN_TYPE_DEFINED #endif #endif @@ -110,7 +121,10 @@ typedef uint64_t ULONG64; /* Define additional generic USBX types. */ -typedef long SLONG; +#ifndef SLONG_DEFINED +typedef LONG SLONG; +#define SLONG_DEFINED +#endif /* Generic USBX Project constants follow. */ diff --git a/ports/cortex_r4/iar/inc/ux_port.h b/ports/cortex_r4/iar/inc/ux_port.h index 2d5dc12..23b0c2c 100644 --- a/ports/cortex_r4/iar/inc/ux_port.h +++ b/ports/cortex_r4/iar/inc/ux_port.h @@ -26,7 +26,7 @@ /* PORT SPECIFIC C INFORMATION RELEASE */ /* */ /* ux_port.h Cortex-R4/IAR */ -/* 6.1.10 */ +/* 6.x */ /* */ /* AUTHOR */ /* */ @@ -46,6 +46,10 @@ /* moved tx_api.h include and */ /* typedefs from ux_api.h, */ /* resulting in version 6.1.10 */ +/* xx-xx-xxxx Chaoqiong Xiao Modified comment(s), */ +/* added basic types guards, */ +/* improved SLONG typedef, */ +/* resulting in version 6.x */ /* */ /**************************************************************************/ @@ -80,7 +84,8 @@ #if !defined(TX_API_H) && !defined(TX_PORT_H) #include <stdint.h> -typedef void VOID; +#ifndef VOID +#define VOID void typedef char CHAR; typedef unsigned char UCHAR; typedef int INT; @@ -89,10 +94,16 @@ typedef long LONG; typedef unsigned long ULONG; typedef short SHORT; typedef unsigned short USHORT; +#endif + +#ifndef ULONG64_DEFINED typedef uint64_t ULONG64; +#define ULONG64_DEFINED +#endif #ifndef ALIGN_TYPE_DEFINED #define ALIGN_TYPE ULONG +#define ALIGN_TYPE_DEFINED #endif #endif @@ -110,7 +121,10 @@ typedef uint64_t ULONG64; /* Define additional generic USBX types. */ -typedef long SLONG; +#ifndef SLONG_DEFINED +typedef LONG SLONG; +#define SLONG_DEFINED +#endif /* Generic USBX Project constants follow. */ diff --git a/ports/cortex_r5/gnu/inc/ux_port.h b/ports/cortex_r5/gnu/inc/ux_port.h index 940d729..7858ffa 100644 --- a/ports/cortex_r5/gnu/inc/ux_port.h +++ b/ports/cortex_r5/gnu/inc/ux_port.h @@ -26,7 +26,7 @@ /* PORT SPECIFIC C INFORMATION RELEASE */ /* */ /* ux_port.h Cortex-R5/GNU */ -/* 6.1.10 */ +/* 6.x */ /* */ /* AUTHOR */ /* */ @@ -46,6 +46,10 @@ /* moved tx_api.h include and */ /* typedefs from ux_api.h, */ /* resulting in version 6.1.10 */ +/* xx-xx-xxxx Chaoqiong Xiao Modified comment(s), */ +/* added basic types guards, */ +/* improved SLONG typedef, */ +/* resulting in version 6.x */ /* */ /**************************************************************************/ @@ -80,7 +84,8 @@ #if !defined(TX_API_H) && !defined(TX_PORT_H) #include <stdint.h> -typedef void VOID; +#ifndef VOID +#define VOID void typedef char CHAR; typedef unsigned char UCHAR; typedef int INT; @@ -89,10 +94,16 @@ typedef long LONG; typedef unsigned long ULONG; typedef short SHORT; typedef unsigned short USHORT; +#endif + +#ifndef ULONG64_DEFINED typedef uint64_t ULONG64; +#define ULONG64_DEFINED +#endif #ifndef ALIGN_TYPE_DEFINED #define ALIGN_TYPE ULONG +#define ALIGN_TYPE_DEFINED #endif #endif @@ -110,7 +121,10 @@ typedef uint64_t ULONG64; /* Define additional generic USBX types. */ -typedef long SLONG; +#ifndef SLONG_DEFINED +typedef LONG SLONG; +#define SLONG_DEFINED +#endif /* Generic USBX Project constants follow. */ diff --git a/ports/cortex_r5/iar/inc/ux_port.h b/ports/cortex_r5/iar/inc/ux_port.h index c8a1bbf..5e65de2 100644 --- a/ports/cortex_r5/iar/inc/ux_port.h +++ b/ports/cortex_r5/iar/inc/ux_port.h @@ -26,7 +26,7 @@ /* PORT SPECIFIC C INFORMATION RELEASE */ /* */ /* ux_port.h Cortex-R5/IAR */ -/* 6.1.10 */ +/* 6.x */ /* */ /* AUTHOR */ /* */ @@ -46,6 +46,10 @@ /* moved tx_api.h include and */ /* typedefs from ux_api.h, */ /* resulting in version 6.1.10 */ +/* xx-xx-xxxx Chaoqiong Xiao Modified comment(s), */ +/* added basic types guards, */ +/* improved SLONG typedef, */ +/* resulting in version 6.x */ /* */ /**************************************************************************/ @@ -80,7 +84,8 @@ #if !defined(TX_API_H) && !defined(TX_PORT_H) #include <stdint.h> -typedef void VOID; +#ifndef VOID +#define VOID void typedef char CHAR; typedef unsigned char UCHAR; typedef int INT; @@ -89,10 +94,16 @@ typedef long LONG; typedef unsigned long ULONG; typedef short SHORT; typedef unsigned short USHORT; +#endif + +#ifndef ULONG64_DEFINED typedef uint64_t ULONG64; +#define ULONG64_DEFINED +#endif #ifndef ALIGN_TYPE_DEFINED #define ALIGN_TYPE ULONG +#define ALIGN_TYPE_DEFINED #endif #endif @@ -110,7 +121,10 @@ typedef uint64_t ULONG64; /* Define additional generic USBX types. */ -typedef long SLONG; +#ifndef SLONG_DEFINED +typedef LONG SLONG; +#define SLONG_DEFINED +#endif /* Generic USBX Project constants follow. */ diff --git a/ports/generic/inc/ux_port.h b/ports/generic/inc/ux_port.h index 8ac0137..dcd93a6 100644 --- a/ports/generic/inc/ux_port.h +++ b/ports/generic/inc/ux_port.h @@ -26,7 +26,7 @@ /* PORT SPECIFIC C INFORMATION RELEASE */ /* */ /* ux_port.h Generic */ -/* 6.1.10 */ +/* 6.x */ /* */ /* AUTHOR */ /* */ @@ -46,6 +46,10 @@ /* moved tx_api.h include and */ /* typedefs from ux_api.h, */ /* resulting in version 6.1.10 */ +/* xx-xx-xxxx Chaoqiong Xiao Modified comment(s), */ +/* added basic types guards, */ +/* improved SLONG typedef, */ +/* resulting in version 6.x */ /* */ /**************************************************************************/ @@ -80,19 +84,27 @@ #if !defined(TX_API_H) && !defined(TX_PORT_H) #include <stdint.h> -typedef void VOID; -typedef char CHAR; -typedef unsigned char UCHAR; -typedef int INT; -typedef unsigned int UINT; -typedef long LONG; -typedef unsigned long ULONG; -typedef short SHORT; -typedef unsigned short USHORT; + +#ifndef VOID +#define VOID void +typedef char CHAR; +typedef unsigned char UCHAR; +typedef int INT; +typedef unsigned int UINT; +typedef long LONG; +typedef unsigned long ULONG; +typedef short SHORT; +typedef unsigned short USHORT; +#endif + +#ifndef ULONG64_DEFINED typedef uint64_t ULONG64; +#define ULONG64_DEFINED +#endif #ifndef ALIGN_TYPE_DEFINED #define ALIGN_TYPE ULONG +#define ALIGN_TYPE_DEFINED #endif #endif @@ -110,7 +122,10 @@ typedef uint64_t ULONG64; /* Define additional generic USBX types. */ -typedef long SLONG; +#ifndef SLONG_DEFINED +typedef LONG SLONG; +#define SLONG_DEFINED +#endif /* Generic USBX Project constants follow. */ diff --git a/ports/linux/gnu/inc/ux_port.h b/ports/linux/gnu/inc/ux_port.h index 5795435..89800c7 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.1.10 */ +/* 6.x */ /* */ /* AUTHOR */ /* */ @@ -46,6 +46,10 @@ /* moved tx_api.h include and */ /* typedefs from ux_api.h, */ /* resulting in version 6.1.10 */ +/* xx-xx-xxxx Chaoqiong Xiao Modified comment(s), */ +/* added basic types guards, */ +/* improved SLONG typedef, */ +/* resulting in version 6.x */ /* */ /**************************************************************************/ @@ -86,7 +90,8 @@ #if !defined(TX_API_H) && !defined(TX_PORT_H) #include <stdint.h> -typedef void VOID; +#ifndef VOID +#define VOID void typedef char CHAR; typedef unsigned char UCHAR; typedef int INT; @@ -95,10 +100,16 @@ typedef long LONG; typedef unsigned long ULONG; typedef short SHORT; typedef unsigned short USHORT; +#endif + +#ifndef ULONG64_DEFINED typedef uint64_t ULONG64; +#define ULONG64_DEFINED +#endif #ifndef ALIGN_TYPE_DEFINED #define ALIGN_TYPE ULONG +#define ALIGN_TYPE_DEFINED #endif #endif @@ -116,7 +127,10 @@ typedef uint64_t ULONG64; /* Define additional generic USBX types. */ -typedef long SLONG; +#ifndef SLONG_DEFINED +typedef LONG SLONG; +#define SLONG_DEFINED +#endif /* Generic USBX Project constants follow. */ |
