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/src | |
| parent | 756899739082fd013048ae6a39dab556fddc8a11 (diff) | |
Release 6.1.8v6.1.8_rel
Diffstat (limited to 'common/usbx_device_classes/src')
3 files changed, 23 insertions, 7 deletions
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; |
