diff options
| author | Yuxin Zhou <[email protected]> | 2021-07-28 07:25:46 +0000 |
|---|---|---|
| committer | Yuxin Zhou <[email protected]> | 2021-07-28 07:25:46 +0000 |
| commit | 3574b6bc518553adefe70d82db907ae801786d6f (patch) | |
| tree | eadc713a8c532d2519bff2b6da93d31c8a98995b /common/usbx_device_classes | |
| parent | 756899739082fd013048ae6a39dab556fddc8a11 (diff) | |
Release 6.1.8v6.1.8_rel
Diffstat (limited to 'common/usbx_device_classes')
13 files changed, 239 insertions, 21 deletions
diff --git a/common/usbx_device_classes/inc/ux_device_class_audio.h b/common/usbx_device_classes/inc/ux_device_class_audio.h index 38acd0d..402a171 100644 --- a/common/usbx_device_classes/inc/ux_device_class_audio.h +++ b/common/usbx_device_classes/inc/ux_device_class_audio.h @@ -26,7 +26,7 @@ /* COMPONENT DEFINITION RELEASE */ /* */ /* ux_device_class_audio.h PORTABLE C */ -/* 6.1 */ +/* 6.1.8 */ /* AUTHOR */ /* */ /* Chaoqiong Xiao, Microsoft Corporation */ @@ -46,11 +46,25 @@ /* TX symbols instead of using */ /* them directly, */ /* resulting in version 6.1 */ +/* 08-02-2021 Wen Wang Modified comment(s), */ +/* added extern "C" keyword */ +/* for compatibility with C++, */ +/* resulting in version 6.1.8 */ /* */ /**************************************************************************/ #ifndef UX_DEVICE_CLASS_AUDIO_H -#define UX_DEVICE_CLASS_AUDIO_H +#define UX_DEVICE_CLASS_AUDIO_H + +/* Determine if a C++ compiler is being used. If so, ensure that standard + C is used to process the API information. */ + +#ifdef __cplusplus + +/* Yes, C++ compiler is present. Use standard C. */ +extern "C" { + +#endif /* Define Audio Class function (AF) constants. */ @@ -423,4 +437,10 @@ UINT _ux_device_class_audio_write_frame_commit(UX_DEVICE_CLASS_AUDIO_STREAM * #define ux_device_class_audio_ioctl _ux_device_class_audio_ioctl +/* Determine if a C++ compiler is being used. If so, complete the standard + C conditional started above. */ +#ifdef __cplusplus +} +#endif + #endif /* ifndef UX_DEVICE_CLASS_AUDIO_H */ 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 e03003f..6e6c000 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.1.6 */ +/* 6.1.8 */ /* AUTHOR */ /* */ /* Chaoqiong Xiao, Microsoft Corporation */ @@ -46,12 +46,26 @@ /* 04-02-2021 Chaoqiong Xiao Modified comment(s), */ /* added volume RES support, */ /* resulting in version 6.1.6 */ +/* 08-02-2021 Chaoqiong Xiao Modified comment(s), */ +/* added extern "C" keyword */ +/* for compatibility with C++, */ +/* resulting in version 6.1.8 */ /* */ /**************************************************************************/ #ifndef UX_DEVICE_CLASS_AUDIO10_H #define UX_DEVICE_CLASS_AUDIO10_H +/* Determine if a C++ compiler is being used. If so, ensure that standard + C is used to process the API information. */ + +#ifdef __cplusplus + +/* Yes, C++ compiler is present. Use standard C. */ +extern "C" { + +#endif + /* Define Audio Class specific AC interface descriptor subclasses. */ @@ -363,4 +377,10 @@ UINT _ux_device_class_audio10_control_process(UX_DEVICE_CLASS_AUDIO *audio, #define ux_device_class_audio10_control_process _ux_device_class_audio10_control_process +/* Determine if a C++ compiler is being used. If so, complete the standard + C conditional started above. */ +#ifdef __cplusplus +} +#endif + #endif /* ifndef UX_DEVICE_CLASS_AUDIO10_H */ 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 058657d..0f44445 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.1.6 */ +/* 6.1.8 */ /* AUTHOR */ /* */ /* Chaoqiong Xiao, Microsoft Corporation */ @@ -46,12 +46,26 @@ /* 04-02-2021 Chaoqiong Xiao Modified comment(s), */ /* added volume RES support, */ /* resulting in version 6.1.6 */ +/* 08-02-2021 Chaoqiong Xiao Modified comment(s), */ +/* added extern "C" keyword */ +/* for compatibility with C++, */ +/* resulting in version 6.1.8 */ /* */ /**************************************************************************/ #ifndef UX_DEVICE_CLASS_AUDIO20_H #define UX_DEVICE_CLASS_AUDIO20_H +/* Determine if a C++ compiler is being used. If so, ensure that standard + C is used to process the API information. */ + +#ifdef __cplusplus + +/* Yes, C++ compiler is present. Use standard C. */ +extern "C" { + +#endif + /* Define Audio Class function category codes. */ @@ -421,4 +435,10 @@ UINT _ux_device_class_audio20_control_process(UX_DEVICE_CLASS_AUDIO *audio, #define ux_device_class_audio20_control_process _ux_device_class_audio20_control_process +/* Determine if a C++ compiler is being used. If so, complete the standard + C conditional started above. */ +#ifdef __cplusplus +} +#endif + #endif /* ifndef UX_DEVICE_CLASS_AUDIO20_H */ diff --git a/common/usbx_device_classes/inc/ux_device_class_cdc_acm.h b/common/usbx_device_classes/inc/ux_device_class_cdc_acm.h index eb8840c..93deb6d 100644 --- a/common/usbx_device_classes/inc/ux_device_class_cdc_acm.h +++ b/common/usbx_device_classes/inc/ux_device_class_cdc_acm.h @@ -24,7 +24,7 @@ /* COMPONENT DEFINITION RELEASE */ /* */ /* ux_device_class_cdc_acm.h PORTABLE C */ -/* 6.1.6 */ +/* 6.1.8 */ /* AUTHOR */ /* */ /* Chaoqiong Xiao, Microsoft Corporation */ @@ -48,12 +48,26 @@ /* added macro to disable */ /* transmission support, */ /* resulting in version 6.1.6 */ +/* 08-02-2021 Chaoqiong Xiao Modified comment(s), */ +/* added extern "C" keyword */ +/* for compatibility with C++, */ +/* resulting in version 6.1.8 */ /* */ /**************************************************************************/ #ifndef UX_DEVICE_CLASS_CDC_ACM_H #define UX_DEVICE_CLASS_CDC_ACM_H +/* Determine if a C++ compiler is being used. If so, ensure that standard + C is used to process the API information. */ + +#ifdef __cplusplus + +/* Yes, C++ compiler is present. Use standard C. */ +extern "C" { + +#endif + /* Define CDC Class USB Class constants. */ #define UX_SLAVE_CLASS_CDC_ACM_CLASS 10 @@ -266,4 +280,10 @@ UINT _ux_device_class_cdc_acm_write_with_callback(UX_SLAVE_CLASS_CDC_ACM *cdc_a #define ux_device_class_cdc_acm_ioctl _ux_device_class_cdc_acm_ioctl #define ux_device_class_cdc_acm_write_with_callback _ux_device_class_cdc_acm_write_with_callback +/* Determine if a C++ compiler is being used. If so, complete the standard + C conditional started above. */ +#ifdef __cplusplus +} +#endif + #endif /* UX_DEVICE_CLASS_CDC_ACM_H */ diff --git a/common/usbx_device_classes/inc/ux_device_class_cdc_ecm.h b/common/usbx_device_classes/inc/ux_device_class_cdc_ecm.h index fac6c1c..6f787e4 100644 --- a/common/usbx_device_classes/inc/ux_device_class_cdc_ecm.h +++ b/common/usbx_device_classes/inc/ux_device_class_cdc_ecm.h @@ -24,7 +24,7 @@ /* COMPONENT DEFINITION RELEASE */ /* */ /* ux_device_class_cdc_ecm.h PORTABLE C */ -/* 6.1 */ +/* 6.1.8 */ /* AUTHOR */ /* */ /* Chaoqiong Xiao, Microsoft Corporation */ @@ -44,12 +44,27 @@ /* TX symbols instead of using */ /* them directly, */ /* resulting in version 6.1 */ +/* 08-02-2021 Wen Wang Modified comment(s), */ +/* fixed spelling error, */ +/* added extern "C" keyword */ +/* for compatibility with C++, */ +/* resulting in version 6.1.8 */ /* */ /**************************************************************************/ #ifndef UX_DEVICE_CLASS_CDC_ECM_H #define UX_DEVICE_CLASS_CDC_ECM_H +/* Determine if a C++ compiler is being used. If so, ensure that standard + C is used to process the API information. */ + +#ifdef __cplusplus + +/* Yes, C++ compiler is present. Use standard C. */ +extern "C" { + +#endif + #include "nx_api.h" #include "ux_network_driver.h" @@ -120,7 +135,7 @@ #define UX_DEVICE_CLASS_CDC_ECM_VERSION_MAJOR 0x00000001 #define UX_DEVICE_CLASS_CDC_ECM_VERSION_MINOR 0x00000000 -/* Define CDC_ECM Conection type supported. Set to conectionless. */ +/* Define CDC_ECM Connection type supported. Set to conectionless. */ #define UX_DEVICE_CLASS_CDC_ECM_DF_CONNECTIONLESS 0x00000001 #define UX_DEVICE_CLASS_CDC_ECM_DF_CONNECTION_ORIENTED 0x00000002 #define UX_DEVICE_CLASS_CDC_ECM_DF_CONNECTION_SUPPORTED UX_DEVICE_CLASS_CDC_ECM_DF_CONNECTIONLESS @@ -339,4 +354,10 @@ VOID _ux_device_class_cdc_ecm_interrupt_thread(ULONG cdc_ecm_class); #define ux_device_class_cdc_ecm_read _ux_device_class_cdc_ecm_read #define ux_device_class_cdc_ecm_write _ux_device_class_cdc_ecm_write +/* Determine if a C++ compiler is being used. If so, complete the standard + C conditional started above. */ +#ifdef __cplusplus +} +#endif + #endif /* UX_DEVICE_CLASS_CDC_ECM_H */ diff --git a/common/usbx_device_classes/inc/ux_device_class_dfu.h b/common/usbx_device_classes/inc/ux_device_class_dfu.h index 16ffde8..da31b1f 100644 --- a/common/usbx_device_classes/inc/ux_device_class_dfu.h +++ b/common/usbx_device_classes/inc/ux_device_class_dfu.h @@ -24,7 +24,7 @@ /* COMPONENT DEFINITION RELEASE */ /* */ /* ux_device_class_dfu.h PORTABLE C */ -/* 6.1.6 */ +/* 6.1.8 */ /* AUTHOR */ /* */ /* Chaoqiong Xiao, Microsoft Corporation */ @@ -50,12 +50,26 @@ /* removed block count (it's */ /* from host request wValue), */ /* resulting in version 6.1.6 */ +/* 08-02-2021 Chaoqiong Xiao Modified comment(s), */ +/* added extern "C" keyword */ +/* for compatibility with C++, */ +/* resulting in version 6.1.8 */ /* */ /**************************************************************************/ #ifndef UX_DEVICE_CLASS_DFU_H #define UX_DEVICE_CLASS_DFU_H +/* Determine if a C++ compiler is being used. If so, ensure that standard + C is used to process the API information. */ + +#ifdef __cplusplus + +/* Yes, C++ compiler is present. Use standard C. */ +extern "C" { + +#endif + /* Define DFU class descriptor capabilities. */ #define UX_SLAVE_CLASS_DFU_CAPABILITY_WILL_DETACH 0x08 #define UX_SLAVE_CLASS_DFU_CAPABILITY_MANIFESTATION_TOLERANT 0x04 @@ -222,4 +236,10 @@ VOID _ux_device_class_dfu_state_sync(UX_SLAVE_CLASS_DFU *dfu); #define ux_device_class_dfu_state_get _ux_device_class_dfu_state_get #define ux_device_class_dfu_state_sync _ux_device_class_dfu_state_sync +/* Determine if a C++ compiler is being used. If so, complete the standard + C conditional started above. */ +#ifdef __cplusplus +} +#endif + #endif /* UX_DEVICE_CLASS_DFU_H */ diff --git a/common/usbx_device_classes/inc/ux_device_class_hid.h b/common/usbx_device_classes/inc/ux_device_class_hid.h index fc86bdd..48eac98 100644 --- a/common/usbx_device_classes/inc/ux_device_class_hid.h +++ b/common/usbx_device_classes/inc/ux_device_class_hid.h @@ -26,7 +26,7 @@ /* COMPONENT DEFINITION RELEASE */ /* */ /* ux_device_class_hid.h PORTABLE C */ -/* 6.1.3 */ +/* 6.1.8 */ /* AUTHOR */ /* */ /* Chaoqiong Xiao, Microsoft Corporation */ @@ -50,12 +50,26 @@ /* added Get/Set Protocol */ /* request support, */ /* resulting in version 6.1.3 */ +/* 08-02-2021 Chaoqiong Xiao Modified comment(s), */ +/* added extern "C" keyword */ +/* for compatibility with C++, */ +/* resulting in version 6.1.8 */ /* */ /**************************************************************************/ #ifndef UX_DEVICE_CLASS_HID_H #define UX_DEVICE_CLASS_HID_H +/* Determine if a C++ compiler is being used. If so, ensure that standard + C is used to process the API information. */ + +#ifdef __cplusplus + +/* Yes, C++ compiler is present. Use standard C. */ +extern "C" { + +#endif + /* Define HID Class constants. */ #define UX_DEVICE_CLASS_HID_CLASS 0x03 @@ -193,4 +207,10 @@ UINT _ux_device_class_hid_report_get(UX_SLAVE_CLASS_HID *hid, ULONG descriptor_ #define ux_device_class_hid_protocol_get(hid) (hid -> ux_device_class_hid_protocol) +/* Determine if a C++ compiler is being used. If so, complete the standard + C conditional started above. */ +#ifdef __cplusplus +} +#endif + #endif diff --git a/common/usbx_device_classes/inc/ux_device_class_pima.h b/common/usbx_device_classes/inc/ux_device_class_pima.h index 36558ba..93dbfab 100644 --- a/common/usbx_device_classes/inc/ux_device_class_pima.h +++ b/common/usbx_device_classes/inc/ux_device_class_pima.h @@ -26,7 +26,7 @@ /* COMPONENT DEFINITION RELEASE */ /* */ /* ux_device_class_pima.h PORTABLE C */ -/* 6.1 */ +/* 6.1.8 */ /* AUTHOR */ /* */ /* Chaoqiong Xiao, Microsoft Corporation */ @@ -46,12 +46,26 @@ /* TX symbols instead of using */ /* them directly, */ /* resulting in version 6.1 */ +/* 08-02-2021 Wen Wang Modified comment(s), */ +/* added extern "C" keyword */ +/* for compatibility with C++, */ +/* resulting in version 6.1.8 */ /* */ /**************************************************************************/ #ifndef UX_DEVICE_CLASS_PIMA_H #define UX_DEVICE_CLASS_PIMA_H +/* Determine if a C++ compiler is being used. If so, ensure that standard + C is used to process the API information. */ + +#ifdef __cplusplus + +/* Yes, C++ compiler is present. Use standard C. */ +extern "C" { + +#endif + /* Define PIMA Class constants. */ #define UX_DEVICE_CLASS_PIMA_CLASS_TRANSFER_TIMEOUT 300000 @@ -998,4 +1012,10 @@ extern USHORT _ux_device_class_pima_device_prop_supported[]; +/* Determine if a C++ compiler is being used. If so, complete the standard + C conditional started above. */ +#ifdef __cplusplus +} +#endif + #endif diff --git a/common/usbx_device_classes/inc/ux_device_class_rndis.h b/common/usbx_device_classes/inc/ux_device_class_rndis.h index 7142cf3..b5ff974 100644 --- a/common/usbx_device_classes/inc/ux_device_class_rndis.h +++ b/common/usbx_device_classes/inc/ux_device_class_rndis.h @@ -24,7 +24,7 @@ /* COMPONENT DEFINITION RELEASE */ /* */ /* ux_device_class_rndis.h PORTABLE C */ -/* 6.1 */ +/* 6.1.8 */ /* AUTHOR */ /* */ /* Chaoqiong Xiao, Microsoft Corporation */ @@ -44,12 +44,27 @@ /* TX symbols instead of using */ /* them directly, */ /* resulting in version 6.1 */ +/* 08-02-2021 Wen Wang Modified comment(s), */ +/* fixed spelling error, */ +/* added extern "C" keyword */ +/* for compatibility with C++, */ +/* resulting in version 6.1.8 */ /* */ /**************************************************************************/ #ifndef UX_DEVICE_CLASS_RNDIS_H #define UX_DEVICE_CLASS_RNDIS_H +/* Determine if a C++ compiler is being used. If so, ensure that standard + C is used to process the API information. */ + +#ifdef __cplusplus + +/* Yes, C++ compiler is present. Use standard C. */ +extern "C" { + +#endif + #include "nx_api.h" #include "ux_network_driver.h" @@ -113,7 +128,7 @@ #define UX_DEVICE_CLASS_RNDIS_VERSION_MAJOR 0x00000001 #define UX_DEVICE_CLASS_RNDIS_VERSION_MINOR 0x00000000 -/* Define RNDIS Conection type supported. Set to conectionless. */ +/* Define RNDIS Connection type supported. Set to conectionless. */ #define UX_DEVICE_CLASS_RNDIS_DF_CONNECTIONLESS 0x00000001 #define UX_DEVICE_CLASS_RNDIS_DF_CONNECTION_ORIENTED 0x00000002 #define UX_DEVICE_CLASS_RNDIS_DF_CONNECTION_SUPPORTED UX_DEVICE_CLASS_RNDIS_DF_CONNECTIONLESS @@ -444,7 +459,7 @@ #define UX_DEVICE_CLASS_RNDIS_VENDOR_DESCRIPTION_MAX_RESPONSE_LENGTH (UX_DEVICE_CLASS_RNDIS_CMPLT_QUERY_INFO_BUFFER + UX_DEVICE_CLASS_RNDIS_VENDOR_DESCRIPTION_MAX_LENGTH) #define UX_DEVICE_CLASS_RNDIS_NODE_ID_RESPONSE_LENGTH (UX_DEVICE_CLASS_RNDIS_CMPLT_QUERY_INFO_BUFFER + UX_DEVICE_CLASS_RNDIS_NODE_ID_LENGTH) -/* Decide maximun size of RNDIS response buffer (with 1 ~ 4 bytes as padding and aligned to 4 bytes). */ +/* Decide maximum size of RNDIS response buffer (with 1 ~ 4 bytes as padding and aligned to 4 bytes). */ #define UX_DEVICE_CLASS_RNDIS_MAX(a, b) (((a) > (b)) ? (a) : (b)) #define UX_DEVICE_CLASS_RNDIS_MAX_CONTROL_RESPONSE_LENGTH ((( \ UX_DEVICE_CLASS_RNDIS_MAX(UX_DEVICE_CLASS_RNDIS_CMPLT_INITIALIZE_RESPONSE_LENGTH, \ @@ -572,4 +587,10 @@ VOID _ux_device_class_rndis_bulkout_thread(ULONG rndis_class); /* Define OID supported List. */ extern ULONG ux_device_class_rndis_oid_supported_list[]; +/* Determine if a C++ compiler is being used. If so, complete the standard + C conditional started above. */ +#ifdef __cplusplus +} +#endif + #endif /* UX_DEVICE_CLASS_RNDIS_H */ diff --git a/common/usbx_device_classes/inc/ux_device_class_storage.h b/common/usbx_device_classes/inc/ux_device_class_storage.h index c55bbec..2db4d6e 100644 --- a/common/usbx_device_classes/inc/ux_device_class_storage.h +++ b/common/usbx_device_classes/inc/ux_device_class_storage.h @@ -26,7 +26,7 @@ /* COMPONENT DEFINITION RELEASE */ /* */ /* ux_device_class_storage.h PORTABLE C */ -/* 6.1.3 */ +/* 6.1.8 */ /* AUTHOR */ /* */ /* Chaoqiong Xiao, Microsoft Corporation */ @@ -47,12 +47,26 @@ /* 12-31-2020 Chaoqiong Xiao Modified comment(s), */ /* fixed USB CV test issues, */ /* resulting in version 6.1.3 */ +/* 08-02-2021 Chaoqiong Xiao Modified comment(s), */ +/* added extern "C" keyword */ +/* for compatibility with C++, */ +/* resulting in version 6.1.8 */ /* */ /**************************************************************************/ #ifndef UX_DEVICE_CLASS_STORAGE_H #define UX_DEVICE_CLASS_STORAGE_H +/* Determine if a C++ compiler is being used. If so, ensure that standard + C is used to process the API information. */ + +#ifdef __cplusplus + +/* Yes, C++ compiler is present. Use standard C. */ +extern "C" { + +#endif + /* Define User configurable Storage Class constants. */ #ifndef UX_MAX_SLAVE_LUN @@ -555,4 +569,10 @@ UINT _ux_device_class_storage_read_dvd_structure(UX_SLAVE_CLASS_STORAGE *stor #define ux_device_class_storage_entry _ux_device_class_storage_entry +/* Determine if a C++ compiler is being used. If so, complete the standard + C conditional started above. */ +#ifdef __cplusplus +} +#endif + #endif diff --git a/common/usbx_device_classes/src/ux_device_class_cdc_ecm_activate.c b/common/usbx_device_classes/src/ux_device_class_cdc_ecm_activate.c index 1ccac6e..343818b 100644 --- a/common/usbx_device_classes/src/ux_device_class_cdc_ecm_activate.c +++ b/common/usbx_device_classes/src/ux_device_class_cdc_ecm_activate.c @@ -33,7 +33,7 @@ /* FUNCTION RELEASE */ /* */ /* _ux_device_class_cdc_ecm_activate PORTABLE C */ -/* 6.1 */ +/* 6.1.8 */ /* AUTHOR */ /* */ /* Chaoqiong Xiao, Microsoft Corporation */ @@ -69,6 +69,9 @@ /* refer to TX symbols instead */ /* of using them directly, */ /* resulting in version 6.1 */ +/* 08-02-2021 Wen Wang Modified comment(s), */ +/* fixed spelling error, */ +/* resulting in version 6.1.8 */ /* */ /**************************************************************************/ UINT _ux_device_class_cdc_ecm_activate(UX_SLAVE_CLASS_COMMAND *command) @@ -193,7 +196,7 @@ ULONG physical_address_lsw; /* Not all endpoints have been found. Major error, do not proceed. */ return(UX_ERROR); - /* Declare the link to be up. That may need to change later to make it dependant on the + /* Declare the link to be up. That may need to change later to make it dependent on the WAN/Wireless modem. */ cdc_ecm -> ux_slave_class_cdc_ecm_link_state = UX_DEVICE_CLASS_CDC_ECM_LINK_STATE_UP; diff --git a/common/usbx_device_classes/src/ux_device_class_hid_descriptor_send.c b/common/usbx_device_classes/src/ux_device_class_hid_descriptor_send.c index c7fcc32..ca48a5d 100644 --- a/common/usbx_device_classes/src/ux_device_class_hid_descriptor_send.c +++ b/common/usbx_device_classes/src/ux_device_class_hid_descriptor_send.c @@ -35,7 +35,7 @@ /* FUNCTION RELEASE */ /* */ /* _ux_device_class_hid_descriptor_send PORTABLE C */ -/* 6.1 */ +/* 6.1.8 */ /* AUTHOR */ /* */ /* Chaoqiong Xiao, Microsoft Corporation */ @@ -74,6 +74,9 @@ /* verified memset and memcpy */ /* cases, */ /* resulting in version 6.1 */ +/* 08-02-2021 Chaoqiong Xiao Modified comment(s), */ +/* fixed HID descriptor search,*/ +/* resulting in version 6.1.8 */ /* */ /**************************************************************************/ UINT _ux_device_class_hid_descriptor_send(UX_SLAVE_CLASS_HID *hid, ULONG descriptor_type, @@ -89,6 +92,7 @@ UCHAR * device_framework_end; ULONG descriptor_length; UINT status = UX_ERROR; ULONG length; +UCHAR interface_number = 0xFF; UX_PARAMETER_NOT_USED(request_index); @@ -133,10 +137,16 @@ ULONG length; /* And its length. */ descriptor_length = (ULONG) *device_framework; - + + /* Save interface number for later check. */ + if (descriptor_type == UX_INTERFACE_DESCRIPTOR_ITEM) + interface_number = *(device_framework + 2); + /* Check if this is a HID report descriptor. */ - if (descriptor_type == UX_DEVICE_CLASS_HID_DESCRIPTOR_HID) + if ((descriptor_type == UX_DEVICE_CLASS_HID_DESCRIPTOR_HID) && + (interface_number == (UCHAR)request_index)) { + /* Ensure the host does not demand a length beyond our descriptor (Windows does that) and do not return more than what is allowed. */ if (descriptor_length < host_length) diff --git a/common/usbx_device_classes/src/ux_device_class_rndis_deactivate.c b/common/usbx_device_classes/src/ux_device_class_rndis_deactivate.c index 2956aec..eabb8fa 100644 --- a/common/usbx_device_classes/src/ux_device_class_rndis_deactivate.c +++ b/common/usbx_device_classes/src/ux_device_class_rndis_deactivate.c @@ -34,7 +34,7 @@ /* FUNCTION RELEASE */ /* */ /* _ux_device_class_rndis_deactivate PORTABLE C */ -/* 6.1 */ +/* 6.1.8 */ /* AUTHOR */ /* */ /* Chaoqiong Xiao, Microsoft Corporation */ @@ -72,6 +72,9 @@ /* TX symbols instead of using */ /* them directly, */ /* resulting in version 6.1 */ +/* 08-02-2021 Wen Wang Modified comment(s), */ +/* fixed spelling error, */ +/* resulting in version 6.1.8 */ /* */ /**************************************************************************/ UINT _ux_device_class_rndis_deactivate(UX_SLAVE_CLASS_COMMAND *command) @@ -98,7 +101,7 @@ UX_SLAVE_CLASS *class; if (interface -> ux_slave_interface_descriptor.bInterfaceClass == UX_DEVICE_CLASS_RNDIS_CLASS_COMMUNICATION_CONTROL) { - /* Declare the link to be down. That may nd to change later to make it dependant on the + /* Declare the link to be down. That may need to change later to make it dependant on the WAN/Wireless modem. */ rndis -> ux_slave_class_rndis_link_state = UX_DEVICE_CLASS_RNDIS_LINK_STATE_DOWN; |
