Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
31 commits
Select commit Hold shift + click to select a range
2a1acfd
Terminate the hid interrupt out endpoint on deactivate
Nictrla Feb 4, 2025
c49990d
Fix copy paste errors
Apr 16, 2025
0f32d34
_ux_device_class_pima_object_references_set and _ux_device_class_pima…
Apr 16, 2025
ec41ddf
Remove unused time elapsed define, ensure tests still pass
hnguyenHWI May 12, 2025
1f66e3c
Create failing test for time elapsed utility
hnguyenHWI May 12, 2025
ca06d34
Fix _ux_utility_time_elapsed define and pass tests
hnguyenHWI May 12, 2025
dbef39c
Merge pull request #198 from hnguyenHWI/fix/time-elapsed
fdesbiens May 13, 2025
9eab296
Merge pull request #194 from Christer-Ekholm/Pima_thread_parids
fdesbiens May 27, 2025
be18a17
Fix host cdc ecm packet pool instance wait
ayedm1 May 29, 2025
13e773f
Add check length for inquiry page code
ayedm1 Jun 4, 2025
6d351e0
update vendor id from "AzureRTO" to "Eclipse "
ayedm1 Jun 4, 2025
ba88b31
Update ux_device_class_storage_initialize.c
fdesbiens Jun 5, 2025
a562898
Merge pull request #203 from ayedm1/update_vendor_id
fdesbiens Jun 5, 2025
cce1744
Merge pull request #202 from ayedm1/add-check-length-for-inquiry-page…
fdesbiens Jun 10, 2025
2bbf1fa
Merge pull request #196 from Christer-Ekholm/Pima_some_functions_retu…
fdesbiens Jun 10, 2025
655f117
Reversed change to _ux_system_slave_class_storage_vendor_id
fdesbiens Jun 10, 2025
a528582
Merge pull request #201 from ayedm1/fix_host_cdc_ecm_packet_pool_time
rahmanih Aug 26, 2025
e9ef405
add bounds check for frequency array in audio streaming interface des…
rahmanih Sep 2, 2025
28ca9dd
add bounds checks for sampling frequency type to identify the right a…
rahmanih Sep 2, 2025
c2d4362
fix ux_system_initialize error checking flag
ayedm1 Sep 11, 2025
0b246ac
Add bounds check for HID report item parsing
rahmanih Sep 15, 2025
50882b4
Add bounds check for sampling frequency in audio descriptor parsing
rahmanih Sep 15, 2025
52d25b5
Merge commit from fork
fdesbiens Sep 29, 2025
b1145c2
Merge commit from fork
fdesbiens Sep 29, 2025
a769f11
Merge commit from fork
fdesbiens Sep 29, 2025
652c294
Merge commit from fork
fdesbiens Sep 29, 2025
6feddf9
Updated version number and added build number and hotfix.
fdesbiens Sep 29, 2025
597aeb0
Merge pull request #205 from ayedm1/fix_ux_system_initialize_error_ch…
fdesbiens Sep 29, 2025
0330117
Merge pull request #178 from Nictrla/terminate-hid-endpoint
fdesbiens Sep 29, 2025
3770e71
Fixed integer comparisons of different signedness.
fdesbiens Sep 29, 2025
d7dc572
add an additional safeguard for optional out endpoint
ayedm1 Sep 30, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 5 additions & 3 deletions common/core/inc/ux_api.h
Original file line number Diff line number Diff line change
Expand Up @@ -348,7 +348,9 @@ typedef signed char SCHAR;
#define AZURE_RTOS_USBX
#define USBX_MAJOR_VERSION 6
#define USBX_MINOR_VERSION 4
#define USBX_PATCH_VERSION 2
#define USBX_PATCH_VERSION 3
#define USBX_BUILD_VERSION 202503
#define USBX_HOTFIX_VERSION ''

/* Macros for concatenating tokens, where UX_CONCATn concatenates n tokens. */

Expand Down Expand Up @@ -2747,9 +2749,9 @@ typedef struct UX_HOST_CLASS_DPUMP_STRUCT
/* Define USBX Services. */

#if defined(UX_SYSTEM_ENABLE_ERROR_CHECKING)
#define ux_system_initialize _ux_system_initialize
#else
#define ux_system_initialize _uxe_system_initialize
#else
#define ux_system_initialize _ux_system_initialize
#endif

#define ux_system_uninitialize _ux_system_uninitialize
Expand Down
2 changes: 1 addition & 1 deletion common/core/inc/ux_utility.h
Original file line number Diff line number Diff line change
Expand Up @@ -172,7 +172,7 @@ extern ULONG _ux_utility_time_get(VOID);
#endif

#ifndef _ux_utility_time_elapsed
#define _ux_utility_time_elapsed(a,b) (((b)>=(a)) ? ((b)-(a)) : (0xFFFFFFFFul-(b)+(a)+1))
#define _ux_utility_time_elapsed(a,b) (((b)>=(a)) ? ((b)-(a)) : (0xFFFFFFFFul-(a)+(b)+1))
#else
extern ALIGN_TYPE _ux_utility_time_elapsed(ALIGN_TYPE, ALIGN_TYPE);
#endif
Expand Down
85 changes: 50 additions & 35 deletions common/usbx_device_classes/src/ux_device_class_hid_deactivate.c
Original file line number Diff line number Diff line change
@@ -1,17 +1,17 @@
/***************************************************************************
* Copyright (c) 2024 Microsoft Corporation
*
* Copyright (c) 2024 Microsoft Corporation
*
* This program and the accompanying materials are made available under the
* terms of the MIT License which is available at
* https://opensource.org/licenses/MIT.
*
*
* SPDX-License-Identifier: MIT
**************************************************************************/

/**************************************************************************/
/**************************************************************************/
/** */
/** USBX Component */
/** */
/** USBX Component */
/** */
/** Device HID Class */
/** */
Expand All @@ -28,40 +28,40 @@
#include "ux_device_stack.h"


/**************************************************************************/
/* */
/* FUNCTION RELEASE */
/* */
/* _ux_device_class_hid_deactivate PORTABLE C */
/**************************************************************************/
/* */
/* FUNCTION RELEASE */
/* */
/* _ux_device_class_hid_deactivate PORTABLE C */
/* 6.1.12 */
/* AUTHOR */
/* */
/* Chaoqiong Xiao, Microsoft Corporation */
/* */
/* DESCRIPTION */
/* */
/* This function deactivate an instance of the hid class. */
/* */
/* INPUT */
/* */
/* command Pointer to a class command */
/* */
/* OUTPUT */
/* */
/* Completion Status */
/* */
/* CALLS */
/* */
/* _ux_device_stack_transfer_all_request_abort Abort all transfers */
/* */
/* CALLED BY */
/* */
/* */
/* This function deactivate an instance of the hid class. */
/* */
/* INPUT */
/* */
/* command Pointer to a class command */
/* */
/* OUTPUT */
/* */
/* Completion Status */
/* */
/* CALLS */
/* */
/* _ux_device_stack_transfer_all_request_abort Abort all transfers */
/* */
/* CALLED BY */
/* */
/* HID Class */
/* */
/* RELEASE HISTORY */
/* */
/* DATE NAME DESCRIPTION */
/* */
/* */
/* 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 */
Expand All @@ -73,18 +73,33 @@
/**************************************************************************/
UINT _ux_device_class_hid_deactivate(UX_SLAVE_CLASS_COMMAND *command)
{

UX_SLAVE_CLASS_HID *hid;
UX_SLAVE_CLASS *class_ptr;
UX_SLAVE_ENDPOINT *endpoint;

/* Get the class container. */
class_ptr = command -> ux_slave_class_command_class_ptr;

/* Get the class instance in the container. */
hid = (UX_SLAVE_CLASS_HID *) class_ptr -> ux_slave_class_instance;

/* Terminate the transactions pending on the endpoints. */
_ux_device_stack_transfer_all_request_abort(hid -> ux_device_class_hid_interrupt_endpoint, UX_TRANSFER_BUS_RESET);
/* Locate the interrupt in endpoint. */
endpoint = hid -> ux_device_class_hid_interrupt_endpoint;

/* Terminate the transactions pending on the endpoint. */
if (endpoint)
_ux_device_stack_transfer_all_request_abort(endpoint, UX_TRANSFER_BUS_RESET);

#if defined(UX_DEVICE_CLASS_HID_INTERRUPT_OUT_SUPPORT)

/* Locate the interrupt out endpoint. */
endpoint = hid -> ux_device_class_hid_interrupt_endpoint;

/* Terminate the transactions pending on the endpoint. */
if (endpoint)
_ux_device_stack_transfer_all_request_abort(endpoint, UX_TRANSFER_BUS_RESET);
#endif

/* If there is a deactivate function call it. */
if (hid -> ux_slave_class_hid_instance_deactivate != UX_NULL)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -169,10 +169,10 @@ UCHAR *buffer;
_ux_utility_long_put(buffer + UX_DEVICE_CLASS_PIMA_AEI_PARAMETER_1, pima_event.ux_device_class_pima_event_parameter_1);

/* Put the value of parameter 2. */
_ux_utility_long_put(buffer + UX_DEVICE_CLASS_PIMA_AEI_PARAMETER_2, pima_event.ux_device_class_pima_event_parameter_3);
_ux_utility_long_put(buffer + UX_DEVICE_CLASS_PIMA_AEI_PARAMETER_2, pima_event.ux_device_class_pima_event_parameter_2);

/* Put the value of parameter 3. */
_ux_utility_long_put(buffer + UX_DEVICE_CLASS_PIMA_AEI_PARAMETER_2, pima_event.ux_device_class_pima_event_parameter_3);
_ux_utility_long_put(buffer + UX_DEVICE_CLASS_PIMA_AEI_PARAMETER_3, pima_event.ux_device_class_pima_event_parameter_3);

/* Send the request to the device controller. */
status = _ux_device_stack_transfer_request(transfer_request_in, UX_DEVICE_CLASS_PIMA_AEI_MAX_LENGTH, UX_DEVICE_CLASS_PIMA_AEI_MAX_LENGTH);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -223,10 +223,18 @@ ULONG object_handle;
/* Send the object to the application. */
status = pima -> ux_device_class_pima_object_info_send(pima, object, storage_id, parent_object_handle, &object_handle);

/* Now we return a response with success. */
status = (status == UX_SUCCESS) ? UX_DEVICE_CLASS_PIMA_RC_OK : status;
_ux_device_class_pima_response_send(pima, status, 3, pima -> ux_device_class_pima_storage_id,
if (status != UX_SUCCESS)
{
/* Now we return a response with error. */
_ux_device_class_pima_response_send(pima, status, 3, pima -> ux_device_class_pima_storage_id,
object -> ux_device_class_pima_object_parent_object, object_handle);
}
else
{
/* Now we return a response with success. */
_ux_device_class_pima_response_send(pima, UX_DEVICE_CLASS_PIMA_RC_OK, 3, pima -> ux_device_class_pima_storage_id,
object -> ux_device_class_pima_object_parent_object, object_handle);
}

/* Store the object handle. It will be used for the OBJECT_SEND command. */
pima -> ux_device_class_pima_current_object_handle = object_handle;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -128,10 +128,16 @@ ULONG object_references_length;

/* Send the object references to the application. */
status = pima -> ux_device_class_pima_object_references_set(pima, object_handle, object_references, object_references_length);

/* Now we return a response with success. */
status = (status == UX_SUCCESS) ? UX_DEVICE_CLASS_PIMA_RC_OK : status;
_ux_device_class_pima_response_send(pima, status, 0, 0, 0, 0);

/* Check error code from application. */
if (status == UX_SUCCESS)

/* Now we return a response with success. */
_ux_device_class_pima_response_send(pima, UX_DEVICE_CLASS_PIMA_RC_OK, 0, 0, 0, 0);
else

/* We return an error. The code is passed by the application. */
_ux_device_class_pima_response_send(pima, status, 0, 0, 0, 0);

}
else
Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
/***************************************************************************
* Copyright (c) 2024 Microsoft Corporation
*
* Copyright (c) 2024 Microsoft Corporation
*
* This program and the accompanying materials are made available under the
* terms of the MIT License which is available at
* https://opensource.org/licenses/MIT.
*
*
* SPDX-License-Identifier: MIT
**************************************************************************/

Expand All @@ -30,7 +30,7 @@

/* Define the Slave Storage Class Inquiry data : DO NOT CHANGE THE LENGTH OF THESE ITEMS */

UCHAR _ux_system_slave_class_storage_vendor_id[] = "AzureRTO";
UCHAR _ux_system_slave_class_storage_vendor_id[] = "Eclipse ";
UCHAR _ux_system_slave_class_storage_product_id[] = "USBX storage dev";
UCHAR _ux_system_slave_class_storage_product_rev[] = "2000";
UCHAR _ux_system_slave_class_storage_product_serial[] = "12345678901234567890";
Expand Down Expand Up @@ -290,8 +290,17 @@ UINT i;
storage_parameter = command -> ux_slave_class_command_parameter;

/* Sanity checks. */
if (storage_parameter -> ux_slave_class_storage_parameter_number_lun > UX_MAX_SLAVE_LUN)
if ((storage_parameter -> ux_slave_class_storage_parameter_number_lun > UX_MAX_SLAVE_LUN) ||
((storage_parameter -> ux_slave_class_storage_parameter_vendor_id != UX_NULL) &&
( _ux_utility_string_length_get(storage_parameter -> ux_slave_class_storage_parameter_vendor_id) != 8)) ||
((storage_parameter -> ux_slave_class_storage_parameter_product_id != UX_NULL) &&
( _ux_utility_string_length_get(storage_parameter -> ux_slave_class_storage_parameter_product_id) != 16)) ||
((storage_parameter -> ux_slave_class_storage_parameter_product_rev != UX_NULL) &&
( _ux_utility_string_length_get(storage_parameter -> ux_slave_class_storage_parameter_product_rev) != 4)) ||
((storage_parameter -> ux_slave_class_storage_parameter_product_serial != UX_NULL) &&
( _ux_utility_string_length_get(storage_parameter -> ux_slave_class_storage_parameter_product_serial) != 20)))
return(UX_INVALID_PARAMETER);

for (i = 0; i < storage_parameter -> ux_slave_class_storage_parameter_number_lun; i ++)
{
if ((storage_parameter -> ux_slave_class_storage_parameter_lun[i].
Expand Down
Loading
Loading