summaryrefslogtreecommitdiff
path: root/common/usbx_host_classes/src
diff options
context:
space:
mode:
Diffstat (limited to 'common/usbx_host_classes/src')
-rw-r--r--common/usbx_host_classes/src/ux_host_class_cdc_acm_write.c10
-rw-r--r--common/usbx_host_classes/src/ux_host_class_storage_cbw_initialize.c12
2 files changed, 14 insertions, 8 deletions
diff --git a/common/usbx_host_classes/src/ux_host_class_cdc_acm_write.c b/common/usbx_host_classes/src/ux_host_class_cdc_acm_write.c
index 2c6e34e..91ef76f 100644
--- a/common/usbx_host_classes/src/ux_host_class_cdc_acm_write.c
+++ b/common/usbx_host_classes/src/ux_host_class_cdc_acm_write.c
@@ -35,7 +35,7 @@
/* FUNCTION RELEASE */
/* */
/* _ux_host_class_cdc_acm_write PORTABLE C */
-/* 6.1 */
+/* 6.1.3 */
/* AUTHOR */
/* */
/* Chaoqiong Xiao, Microsoft Corporation */
@@ -74,6 +74,9 @@
/* 05-19-2020 Chaoqiong Xiao Initial Version 6.0 */
/* 09-30-2020 Chaoqiong Xiao Modified comment(s), */
/* resulting in version 6.1 */
+/* 12-31-2020 Chaoqiong Xiao Modified comment(s), */
+/* fixed ZLP sending, */
+/* resulting in version 6.1.3 */
/* */
/**************************************************************************/
UINT _ux_host_class_cdc_acm_write(UX_HOST_CLASS_CDC_ACM *cdc_acm, UCHAR *data_pointer,
@@ -122,7 +125,7 @@ ULONG transfer_request_length;
/* Perform a transfer on the bulk out endpoint until either the transfer is
completed or when there is an error. */
- while (requested_length)
+ do
{
/* Program the maximum authorized length for this transfer_request. */
@@ -194,7 +197,8 @@ ULONG transfer_request_length;
/* Update what is left to send out. */
requested_length -= transfer_request_length;
- }
+
+ } while (requested_length);
/* We get here when all the transfers went through without errors. */
return(UX_SUCCESS);
diff --git a/common/usbx_host_classes/src/ux_host_class_storage_cbw_initialize.c b/common/usbx_host_classes/src/ux_host_class_storage_cbw_initialize.c
index c056a17..564ec69 100644
--- a/common/usbx_host_classes/src/ux_host_class_storage_cbw_initialize.c
+++ b/common/usbx_host_classes/src/ux_host_class_storage_cbw_initialize.c
@@ -35,7 +35,7 @@
/* FUNCTION RELEASE */
/* */
/* _ux_host_class_storage_cbw_initialize PORTABLE C */
-/* 6.1 */
+/* 6.1.3 */
/* AUTHOR */
/* */
/* Chaoqiong Xiao, Microsoft Corporation */
@@ -49,7 +49,7 @@
/* INPUT */
/* */
/* storage Pointer to storage class */
-/* direction Direction of transfer */
+/* flags Flags for transfer */
/* data_transfer_length Length of data transfer */
/* command_length Length of command */
/* */
@@ -75,9 +75,11 @@
/* verified memset and memcpy */
/* cases, */
/* resulting in version 6.1 */
+/* 12-31-2020 Chaoqiong Xiao Modified comment(s), */
+/* resulting in version 6.1.3 */
/* */
/**************************************************************************/
-VOID _ux_host_class_storage_cbw_initialize(UX_HOST_CLASS_STORAGE *storage, UINT direction,
+VOID _ux_host_class_storage_cbw_initialize(UX_HOST_CLASS_STORAGE *storage, UINT flags,
ULONG data_transfer_length, UINT command_length)
{
@@ -97,8 +99,8 @@ UCHAR *cbw;
/* Store the Data Transfer Length expected for the data payload. */
_ux_utility_long_put(cbw + UX_HOST_CLASS_STORAGE_CBW_DATA_LENGTH, data_transfer_length);
- /* Store the CBW Flag field that contains the transfer direction. */
- *(cbw + UX_HOST_CLASS_STORAGE_CBW_FLAGS) = (UCHAR)direction;
+ /* Store the CBW Flag field that contains the transfer flags. */
+ *(cbw + UX_HOST_CLASS_STORAGE_CBW_FLAGS) = (UCHAR)flags;
/* Store the LUN value. */
*(cbw + UX_HOST_CLASS_STORAGE_CBW_LUN) = (UCHAR)storage -> ux_host_class_storage_lun;