diff options
| author | Chaoqiong Xiao <[email protected]> | 2023-03-31 07:39:33 +0000 |
|---|---|---|
| committer | Chaoqiong Xiao <[email protected]> | 2023-03-31 07:39:33 +0000 |
| commit | 5f758e08fe6661ee5330a764abdf6b3c5a55938f (patch) | |
| tree | 659b99999c6062aab86517df6962b17ad7f663c3 | |
| parent | 0acda9e66f877ad801389bb413f55367546825df (diff) | |
Update on 31 Mar 2023. Expand to see details.
35e477cd Fixed error checking issues on device printer class.
7bc1a9b5 USBX device video error checking support.
fb766837 Moved build option check to runtime (device HID, storage).
3af71cf8 Add optional error checking to host HIDs
e6d938ad generate usbx cmsis-pack
62c0c282 Add error checking to host serial classes (CDC ACM, GSER, PROLIFIC and SWAR)
89b8890b USBX device DFU error checking support.
4c3c3922 USBX device CCID error checking support.
1411aab4 Add error checks for device HID and RNDIS.
2f83bd01 Added host audio error checking.
18973298 USBX device CDC ACM error checking support.
128 files changed, 5685 insertions, 176 deletions
diff --git a/common/usbx_device_classes/inc/ux_device_class_ccid.h b/common/usbx_device_classes/inc/ux_device_class_ccid.h index 4cf51bd..801ff5a 100644 --- a/common/usbx_device_classes/inc/ux_device_class_ccid.h +++ b/common/usbx_device_classes/inc/ux_device_class_ccid.h @@ -24,7 +24,7 @@ /* COMPONENT DEFINITION RELEASE */ /* */ /* ux_device_class_ccid.h PORTABLE C */ -/* 6.2.1 */ +/* 6.x */ /* AUTHOR */ /* */ /* Chaoqiong Xiao, Microsoft Corporation */ @@ -42,6 +42,9 @@ /* 03-08-2023 Chaoqiong Xiao Modified comment(s), */ /* added standalone support, */ /* resulting in version 6.2.1 */ +/* xx-xx-xxxx Yajun xia Modified comment(s), */ +/* added error checks support, */ +/* resulting in version 6.x */ /* */ /**************************************************************************/ @@ -57,6 +60,12 @@ extern "C" { #endif +/* Internal option: enable the basic USBX error checking. This define is typically used + while debugging application. */ +#if defined(UX_ENABLE_ERROR_CHECKING) && !defined(UX_DEVICE_CLASS_CCID_ENABLE_ERROR_CHECKING) +#define UX_DEVICE_CLASS_CCID_ENABLE_ERROR_CHECKING +#endif + #if !defined(UX_DEVICE_STANDALONE) /* Define CCID max number of slots, 32 for 32 bit data width. */ @@ -1161,16 +1170,33 @@ UINT _ux_device_class_ccid_auto_seq_done(UX_DEVICE_CLASS_CCID *ccid, ULONG slot UINT _ux_device_class_ccid_time_extension(UX_DEVICE_CLASS_CCID *ccid, ULONG slot, ULONG wt); UINT _ux_device_class_ccid_hardware_error(UX_DEVICE_CLASS_CCID *ccid, ULONG slot, ULONG error); +UINT _uxe_device_class_ccid_icc_insert(UX_DEVICE_CLASS_CCID *ccid, ULONG slot, ULONG seq_start); +UINT _uxe_device_class_ccid_icc_remove(UX_DEVICE_CLASS_CCID *ccid, ULONG slot); +UINT _uxe_device_class_ccid_auto_seq_done(UX_DEVICE_CLASS_CCID *ccid, ULONG slot, ULONG icc_status); +UINT _uxe_device_class_ccid_time_extension(UX_DEVICE_CLASS_CCID *ccid, ULONG slot, ULONG wt); +UINT _uxe_device_class_ccid_hardware_error(UX_DEVICE_CLASS_CCID *ccid, ULONG slot, ULONG error); + /* Define Device CCID Class API prototypes. */ #define ux_device_class_ccid_entry _ux_device_class_ccid_entry +#if defined(UX_DEVICE_CLASS_CCID_ENABLE_ERROR_CHECKING) + +#define ux_device_class_ccid_icc_insert _uxe_device_class_ccid_icc_insert +#define ux_device_class_ccid_icc_remove _uxe_device_class_ccid_icc_remove +#define ux_device_class_ccid_auto_seq_done _uxe_device_class_ccid_auto_seq_done +#define ux_device_class_ccid_time_extension _uxe_device_class_ccid_time_extension +#define ux_device_class_ccid_hardware_error _uxe_device_class_ccid_hardware_error + +#else + #define ux_device_class_ccid_icc_insert _ux_device_class_ccid_icc_insert #define ux_device_class_ccid_icc_remove _ux_device_class_ccid_icc_remove #define ux_device_class_ccid_auto_seq_done _ux_device_class_ccid_auto_seq_done #define ux_device_class_ccid_time_extension _ux_device_class_ccid_time_extension #define ux_device_class_ccid_hardware_error _ux_device_class_ccid_hardware_error +#endif /* Determine if a C++ compiler is being used. If so, complete the standard C conditional started above. */ 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 8d50cf2..bce70bb 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.12 */ +/* 6.x */ /* AUTHOR */ /* */ /* Chaoqiong Xiao, Microsoft Corporation */ @@ -58,6 +58,9 @@ /* 07-29-2022 Chaoqiong Xiao Modified comment(s), */ /* added write auto ZLP, */ /* resulting in version 6.1.12 */ +/* xx-xx-xxxx Yajun xia Modified comment(s), */ +/* added error checks support, */ +/* resulting in version 6.x */ /* */ /**************************************************************************/ @@ -74,6 +77,12 @@ extern "C" { #endif +/* Internal option: enable the basic USBX error checking. This define is typically used + while debugging application. */ +#if defined(UX_ENABLE_ERROR_CHECKING) && !defined(UX_DEVICE_CLASS_CDC_ACM_ENABLE_ERROR_CHECKING) +#define UX_DEVICE_CLASS_CDC_ACM_ENABLE_ERROR_CHECKING +#endif + /* Defined, _write is pending ZLP automatically (complete transfer) after buffer is sent. */ /* #define UX_DEVICE_CLASS_CDC_ACM_WRITE_AUTO_ZLP */ @@ -322,9 +331,34 @@ UINT _ux_device_class_cdc_acm_read_run(UX_SLAVE_CLASS_CDC_ACM *cdc_acm, UCHAR * UINT _ux_device_class_cdc_acm_tasks_run(VOID *instance); -/* Define Device CDC Class API prototypes. */ +UINT _uxe_device_class_cdc_acm_read(UX_SLAVE_CLASS_CDC_ACM *cdc_acm, UCHAR *buffer, + ULONG requested_length, ULONG *actual_length); +UINT _uxe_device_class_cdc_acm_write(UX_SLAVE_CLASS_CDC_ACM *cdc_acm, UCHAR *buffer, + ULONG requested_length, ULONG *actual_length); +UINT _uxe_device_class_cdc_acm_ioctl(UX_SLAVE_CLASS_CDC_ACM *cdc_acm, ULONG ioctl_function, + VOID *parameter); +UINT _uxe_device_class_cdc_acm_write_with_callback(UX_SLAVE_CLASS_CDC_ACM *cdc_acm, UCHAR *buffer, + ULONG requested_length); +UINT _uxe_device_class_cdc_acm_write_run(UX_SLAVE_CLASS_CDC_ACM *cdc_acm, UCHAR *buffer, + ULONG requested_length, ULONG *actual_length); +UINT _uxe_device_class_cdc_acm_read_run(UX_SLAVE_CLASS_CDC_ACM *cdc_acm, UCHAR *buffer, + ULONG requested_length, ULONG *actual_length); +/* Define Device CDC Class API prototypes. */ #define ux_device_class_cdc_acm_entry _ux_device_class_cdc_acm_entry + +#if defined(UX_DEVICE_CLASS_CDC_ACM_ENABLE_ERROR_CHECKING) + +#define ux_device_class_cdc_acm_read _uxe_device_class_cdc_acm_read +#define ux_device_class_cdc_acm_write _uxe_device_class_cdc_acm_write +#define ux_device_class_cdc_acm_ioctl _uxe_device_class_cdc_acm_ioctl +#define ux_device_class_cdc_acm_write_with_callback _uxe_device_class_cdc_acm_write_with_callback + +#define ux_device_class_cdc_acm_read_run _uxe_device_class_cdc_acm_read_run +#define ux_device_class_cdc_acm_write_run _uxe_device_class_cdc_acm_write_run + +#else + #define ux_device_class_cdc_acm_read _ux_device_class_cdc_acm_read #define ux_device_class_cdc_acm_write _ux_device_class_cdc_acm_write #define ux_device_class_cdc_acm_ioctl _ux_device_class_cdc_acm_ioctl @@ -333,6 +367,8 @@ UINT _ux_device_class_cdc_acm_tasks_run(VOID *instance); #define ux_device_class_cdc_acm_read_run _ux_device_class_cdc_acm_read_run #define ux_device_class_cdc_acm_write_run _ux_device_class_cdc_acm_write_run +#endif + /* Determine if a C++ compiler is being used. If so, complete the standard C conditional started above. */ #ifdef __cplusplus 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 20b307e..ee4770d 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.12 */ +/* 6.x */ /* AUTHOR */ /* */ /* Chaoqiong Xiao, Microsoft Corporation */ @@ -60,6 +60,9 @@ /* 07-29-2022 Chaoqiong Xiao Modified comment(s), */ /* added macros for req types, */ /* resulting in version 6.1.12 */ +/* xx-xx-xxxx Yajun xia Modified comment(s), */ +/* added error checks support, */ +/* resulting in version 6.x */ /* */ /**************************************************************************/ @@ -76,6 +79,12 @@ extern "C" { #endif +/* Internal option: enable the basic USBX error checking. This define is typically used + while debugging application. */ +#if defined(UX_ENABLE_ERROR_CHECKING) && !defined(UX_DEVICE_CLASS_DFU_ENABLE_ERROR_CHECKING) +#define UX_DEVICE_CLASS_DFU_ENABLE_ERROR_CHECKING +#endif + /* Define DFU class descriptor capabilities. */ #define UX_SLAVE_CLASS_DFU_CAPABILITY_WILL_DETACH 0x08 #define UX_SLAVE_CLASS_DFU_CAPABILITY_MANIFESTATION_TOLERANT 0x04 @@ -255,9 +264,10 @@ VOID _ux_device_class_dfu_state_sync(UX_SLAVE_CLASS_DFU *dfu); UINT _ux_device_class_dfu_tasks_run(VOID *class_instance); -/* Define Device DFU Class API prototypes. */ +UINT _uxe_device_class_dfu_initialize(UX_SLAVE_CLASS_COMMAND *command); -#define ux_device_class_dfu_entry _ux_device_class_dfu_entry +/* Define Device DFU Class API prototypes. */ +#define ux_device_class_dfu_entry _ux_device_class_dfu_entry #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 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 c171db6..7a119df 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.12 */ +/* 6.X */ /* AUTHOR */ /* */ /* Chaoqiong Xiao, Microsoft Corporation */ @@ -64,6 +64,9 @@ /* 07-29-2022 Chaoqiong Xiao Modified comment(s), */ /* added standalone int out, */ /* resulting in version 6.1.12 */ +/* XX-XX-XXXX Chaoqiong Xiao Modified comment(s), */ +/* moved build option check, */ +/* resulting in version 6.x */ /* */ /**************************************************************************/ @@ -85,6 +88,14 @@ extern "C" { /* If defined, interrupt OUT transfer is supported. */ /* #define UX_DEVICE_CLASS_HID_INTERRUPT_OUT_SUPPORT */ + +/* Internal option: enable the basic USBX error checking. This define is typically used + while debugging application. */ +#if defined(UX_ENABLE_ERROR_CHECKING) && !defined(UX_DEVICE_CLASS_HID_ENABLE_ERROR_CHECKING) +#define UX_DEVICE_CLASS_HID_ENABLE_ERROR_CHECKING +#endif + + /* Use UX general thread stack size for receiver thread. */ #define UX_DEVICE_CLASS_HID_RECEIVER_THREAD_STACK_SIZE UX_THREAD_STACK_SIZE @@ -142,12 +153,14 @@ extern "C" { /* Ensure the event buffer can fit inside the control endpoint's data buffer. */ #if UX_DEVICE_CLASS_HID_EVENT_BUFFER_LENGTH > UX_SLAVE_REQUEST_CONTROL_MAX_LENGTH -#error "Error: the event buffer cannot fit inside the control endpoint's data buffer. Reduce UX_DEVICE_CLASS_HID_EVENT_BUFFER_LENGTH such that it is less than or equal to UX_SLAVE_REQUEST_CONTROL_MAX_LENGTH." +/* #error "Error: the event buffer cannot fit inside the control endpoint's data buffer. Reduce UX_DEVICE_CLASS_HID_EVENT_BUFFER_LENGTH such that it is less than or equal to UX_SLAVE_REQUEST_CONTROL_MAX_LENGTH." */ +/* Build option checked runtime by UX_ASSERT */ #endif /* Ensure the event buffer can fit inside the interrupt endpoint's data buffer. */ #if UX_DEVICE_CLASS_HID_EVENT_BUFFER_LENGTH > UX_SLAVE_REQUEST_DATA_MAX_LENGTH -#error "Error: the event buffer cannot fit inside the interrupt endpoint's data buffer. Reduce UX_DEVICE_CLASS_HID_EVENT_BUFFER_LENGTH such that it is less than or equal to UX_SLAVE_REQUEST_DATA_MAX_LENGTH." +/* #error "Error: the event buffer cannot fit inside the interrupt endpoint's data buffer. Reduce UX_DEVICE_CLASS_HID_EVENT_BUFFER_LENGTH such that it is less than or equal to UX_SLAVE_REQUEST_DATA_MAX_LENGTH." */ +/* Build option checked runtime by UX_ASSERT */ #endif #ifndef UX_DEVICE_CLASS_HID_MAX_EVENTS_QUEUE @@ -313,15 +326,54 @@ UINT _ux_device_class_hid_read_run(UX_SLAVE_CLASS_HID *hid, ULONG *actual_length); UINT _ux_device_class_hid_receiver_tasks_run(UX_SLAVE_CLASS_HID *hid); + +UINT _uxe_device_class_hid_initialize(UX_SLAVE_CLASS_COMMAND *command); +UINT _uxe_device_class_hid_event_set(UX_SLAVE_CLASS_HID *hid, + UX_SLAVE_CLASS_HID_EVENT *hid_event); +UINT _uxe_device_class_hid_event_get(UX_SLAVE_CLASS_HID *hid, + UX_SLAVE_CLASS_HID_EVENT *hid_event); +UINT _uxe_device_class_hid_read(UX_SLAVE_CLASS_HID *hid, + UCHAR *buffer, ULONG requested_length, + ULONG *actual_length); +UINT _uxe_device_class_hid_read_run(UX_SLAVE_CLASS_HID *hid, + UCHAR *buffer, ULONG requested_length, + ULONG *actual_length); +UINT _uxe_device_class_hid_receiver_initialize(UX_SLAVE_CLASS_HID *hid, + UX_SLAVE_CLASS_HID_PARAMETER *parameter, + UX_DEVICE_CLASS_HID_RECEIVER **receiver); +UINT _uxe_device_class_hid_receiver_event_get(UX_SLAVE_CLASS_HID *hid, + UX_DEVICE_CLASS_HID_RECEIVED_EVENT *event); +UINT _uxe_device_class_hid_receiver_event_free(UX_SLAVE_CLASS_HID *hid); + + /* Define Device HID Class API prototypes. */ +#if defined(UX_DEVICE_CLASS_HID_ENABLE_ERROR_CHECKING) + +#define ux_device_class_hid_entry _ux_device_class_hid_entry +#define ux_device_class_hid_event_set _uxe_device_class_hid_event_set +#define ux_device_class_hid_event_get _uxe_device_class_hid_event_get +#define ux_device_class_hid_report_set _ux_device_class_hid_report_set +#define ux_device_class_hid_report_get _ux_device_class_hid_report_get + +#define ux_device_class_hid_protocol_get(hid) (((hid) == UX_NULL) ? UX_ERROR : (hid) -> ux_device_class_hid_protocol) + +#define ux_device_class_hid_read _uxe_device_class_hid_read +#define ux_device_class_hid_read_run _uxe_device_class_hid_read_run + +#define ux_device_class_hid_receiver_initialize _ux_device_class_hid_receiver_initialize +#define ux_device_class_hid_receiver_event_get _uxe_device_class_hid_receiver_event_get +#define ux_device_class_hid_receiver_event_free _uxe_device_class_hid_receiver_event_free + +#else + #define ux_device_class_hid_entry _ux_device_class_hid_entry #define ux_device_class_hid_event_set _ux_device_class_hid_event_set #define ux_device_class_hid_event_get _ux_device_class_hid_event_get #define ux_device_class_hid_report_set _ux_device_class_hid_report_set #define ux_device_class_hid_report_get _ux_device_class_hid_report_get -#define ux_device_class_hid_protocol_get(hid) (hid -> ux_device_class_hid_protocol) +#define ux_device_class_hid_protocol_get(hid) ((hid) -> ux_device_class_hid_protocol) #define ux_device_class_hid_read _ux_device_class_hid_read #define ux_device_class_hid_read_run _ux_device_class_hid_read_run @@ -330,6 +382,8 @@ UINT _ux_device_class_hid_receiver_tasks_run(UX_SLAVE_CLASS_HID *hid); #define ux_device_class_hid_receiver_event_get _ux_device_class_hid_receiver_event_get #define ux_device_class_hid_receiver_event_free _ux_device_class_hid_receiver_event_free +#endif + /* Determine if a C++ compiler is being used. If so, complete the standard C conditional started above. */ #ifdef __cplusplus diff --git a/common/usbx_device_classes/inc/ux_device_class_printer.h b/common/usbx_device_classes/inc/ux_device_class_printer.h index 80d79dc..1aa787b 100644 --- a/common/usbx_device_classes/inc/ux_device_class_printer.h +++ b/common/usbx_device_classes/inc/ux_device_class_printer.h @@ -24,7 +24,7 @@ /* COMPONENT DEFINITION RELEASE */ /* */ /* ux_device_class_printer.h PORTABLE C */ -/* 6.2.1 */ +/* 6.x */ /* AUTHOR */ /* */ /* Chaoqiong Xiao, Microsoft Corporation */ @@ -50,6 +50,9 @@ /* 03-08-2023 Yajun xia Modified comment(s), */ /* added error checks support, */ /* resulting in version 6.2.1 */ +/* xx-xx-xxxx Yajun Xia Modified comment(s), */ +/* fixed error checking issue, */ +/* resulting in version 6.x */ /* */ /**************************************************************************/ @@ -176,12 +179,11 @@ UINT _ux_device_class_printer_read(UX_DEVICE_CLASS_PRINTER *printer, UCHAR *buf UINT _ux_device_class_printer_ioctl(UX_DEVICE_CLASS_PRINTER *printer, ULONG ioctl_function, VOID *parameter); -#if defined(UX_DEVICE_STANDALONE) + UINT _ux_device_class_printer_write_run(UX_DEVICE_CLASS_PRINTER *printer, UCHAR *buffer, ULONG requested_length, ULONG *actual_length); UINT _ux_device_class_printer_read_run(UX_DEVICE_CLASS_PRINTER *printer, UCHAR *buffer, ULONG requested_length, ULONG *actual_length); -#endif UINT _uxe_device_class_printer_initialize(UX_SLAVE_CLASS_COMMAND *command); UINT _uxe_device_class_printer_read(UX_DEVICE_CLASS_PRINTER *printer, UCHAR *buffer, @@ -190,6 +192,10 @@ UINT _uxe_device_class_printer_write(UX_DEVICE_CLASS_PRINTER *printer, UCHAR *b ULONG requested_length, ULONG *actual_length); UINT _uxe_device_class_printer_ioctl(UX_DEVICE_CLASS_PRINTER *printer, ULONG ioctl_function, VOID *parameter); +UINT _uxe_device_class_printer_write_run(UX_DEVICE_CLASS_PRINTER *printer, UCHAR *buffer, + ULONG requested_length, ULONG *actual_length); +UINT _uxe_device_class_printer_read_run(UX_DEVICE_CLASS_PRINTER *printer, UCHAR *buffer, + ULONG requested_length, ULONG *actual_length); /* Define Device Printer Class API prototypes. */ #if defined(UX_DEVICE_CLASS_PRINTER_ENABLE_ERROR_CHECKING) @@ -198,6 +204,8 @@ UINT _uxe_device_class_printer_ioctl(UX_DEVICE_CLASS_PRINTER *printer, ULONG io #define ux_device_class_printer_read _uxe_device_class_printer_read #define ux_device_class_printer_write _uxe_device_class_printer_write #define ux_device_class_printer_ioctl _uxe_device_class_printer_ioctl +#define ux_device_class_printer_read_run _uxe_device_class_printer_read_run +#define ux_device_class_printer_write_run _uxe_device_class_printer_write_run #else @@ -205,12 +213,9 @@ UINT _uxe_device_class_printer_ioctl(UX_DEVICE_CLASS_PRINTER *printer, ULONG io #define ux_device_class_printer_read _ux_device_class_printer_read #define ux_device_class_printer_write _ux_device_class_printer_write #define ux_device_class_printer_ioctl _ux_device_class_printer_ioctl - -#endif - -#if defined(UX_DEVICE_STANDALONE) #define ux_device_class_printer_read_run _ux_device_class_printer_read_run #define ux_device_class_printer_write_run _ux_device_class_printer_write_run + #endif /* Determine if a C++ compiler is being used. If so, complete the standard 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 abcd833..72b15e1 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.2.0 */ +/* 6.x */ /* AUTHOR */ /* */ /* Chaoqiong Xiao, Microsoft Corporation */ @@ -55,6 +55,9 @@ /* 10-31-2022 Chaoqiong Xiao Modified comment(s), */ /* added wait and length DEFs, */ /* resulting in version 6.2.0 */ +/* xx-xx-xxxx Chaoqiong Xiao Modified comment(s), */ +/* improved error checking, */ +/* resulting in version 6.x */ /* */ /**************************************************************************/ @@ -488,7 +491,7 @@ VOID _ux_network_driver_link_down(VOID *ux_network_handle); /* Calculate message buffer length (not overflow). */ #define UX_DEVICE_CLASS_RNDIS_MAX_MSG_LENGTH (UX_DEVICE_CLASS_RNDIS_MAX_PACKET_LENGTH + UX_DEVICE_CLASS_RNDIS_PACKET_HEADER_LENGTH) #if UX_DEVICE_CLASS_RNDIS_MAX_MSG_LENGTH > UX_SLAVE_REQUEST_DATA_MAX_LENGTH -#error "Error: the maximum-sized RNDIS response cannot fit inside the control endpoint's data buffer. Increase UX_SLAVE_REQUEST_DATA_MAX_LENGTH." +/* Checked in _initialize(). */ #endif /* Calculate response buffer length. */ @@ -509,7 +512,7 @@ VOID _ux_network_driver_link_down(VOID *ux_network_handle); /* Ensure maximum-sized RNDIS response can fit in the control endpoint's transfer buffer. */ #if UX_DEVICE_CLASS_RNDIS_MAX_CONTROL_RESPONSE_LENGTH > UX_SLAVE_REQUEST_CONTROL_MAX_LENGTH -#error "Error: the maximum-sized RNDIS response cannot fit inside the control endpoint's data buffer. Increase UX_SLAVE_REQUEST_CONTROL_MAX_LENGTH." +/* Checked in _initialize(). */ #endif /* Define Slave RNDIS Class Calling Parameter structure */ 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 a1d34e1..9c0a1a3 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.10 */ +/* 6.x */ /* AUTHOR */ /* */ /* Chaoqiong Xiao, Microsoft Corporation */ @@ -57,6 +57,9 @@ /* 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 error checks support, */ +/* resulting in version 6.1.10 */ /* */ /**************************************************************************/ @@ -73,6 +76,14 @@ extern "C" { #endif + +/* Internal option: enable the basic USBX error checking. This define is typically used + while debugging application. */ +#if defined(UX_ENABLE_ERROR_CHECKING) && !defined(UX_DEVICE_CLASS_STORAGE_ENABLE_ERROR_CHECKING) +#define UX_DEVICE_CLASS_STORAGE_ENABLE_ERROR_CHECKING +#endif + + /* Define User configurable Storage Class constants. */ #ifndef UX_MAX_SLAVE_LUN @@ -642,6 +653,10 @@ UINT _ux_device_class_storage_read_dvd_structure(UX_SLAVE_CLASS_STORAGE *stor UINT _ux_device_class_storage_tasks_run(VOID *instance); + +UINT _uxe_device_class_storage_initialize(UX_SLAVE_CLASS_COMMAND *command); + + /* Define Device Storage Class API prototypes. */ #define ux_device_class_storage_entry _ux_device_class_storage_entry diff --git a/common/usbx_device_classes/inc/ux_device_class_video.h b/common/usbx_device_classes/inc/ux_device_class_video.h index 9851532..ea3515f 100644 --- a/common/usbx_device_classes/inc/ux_device_class_video.h +++ b/common/usbx_device_classes/inc/ux_device_class_video.h @@ -26,7 +26,7 @@ /* COMPONENT DEFINITION RELEASE */ /* */ /* ux_device_class_video.h PORTABLE C */ -/* 6.2.0 */ +/* 6.x */ /* AUTHOR */ /* */ /* Chaoqiong Xiao, Microsoft Corporation */ @@ -44,6 +44,9 @@ /* 10-31-2022 Chaoqiong Xiao Modified comment(s), */ /* added standalone support, */ /* resulting in version 6.2.0 */ +/* xx-xx-xxxx Yajun xia Modified comment(s), */ +/* added error checks support, */ +/* resulting in version 6.x */ /* */ /**************************************************************************/ @@ -60,6 +63,12 @@ extern "C" { #endif +/* Internal option: enable the basic USBX error checking. This define is typically used + while debugging application. */ +#if defined(UX_ENABLE_ERROR_CHECKING) && !defined(UX_DEVICE_CLASS_VIDEO_ENABLE_ERROR_CHECKING) +#define UX_DEVICE_CLASS_VIDEO_ENABLE_ERROR_CHECKING +#endif + /* Define options. */ #define UX_DEVICE_CLASS_VIDEO_THREAD_STACK_SIZE UX_THREAD_STACK_SIZE @@ -658,8 +667,49 @@ UINT _ux_device_class_video_tasks_run(VOID *instance); UINT _ux_device_class_video_read_task_function(UX_DEVICE_CLASS_VIDEO_STREAM *stream); UINT _ux_device_class_video_write_task_function(UX_DEVICE_CLASS_VIDEO_STREAM *stream); +UINT _uxe_device_class_video_initialize(UX_SLAVE_CLASS_COMMAND *command); +ULONG _uxe_device_class_video_max_payload_length(UX_DEVICE_CLASS_VIDEO_STREAM *video); +UINT _uxe_device_class_video_reception_start(UX_DEVICE_CLASS_VIDEO_STREAM *video); +UINT _uxe_device_class_video_read_payload_get(UX_DEVICE_CLASS_VIDEO_STREAM *video, UCHAR **payload_data, ULONG *payload_length); +UINT _uxe_device_class_video_read_payload_free(UX_DEVICE_CLASS_VIDEO_STREAM *video); +UINT _uxe_device_class_video_transmission_start(UX_DEVICE_CLASS_VIDEO_STREAM *video); +UINT _uxe_device_class_video_write_payload_get(UX_DEVICE_CLASS_VIDEO_STREAM *video, UCHAR **buffer, ULONG *max_length); +UINT _uxe_device_class_video_write_payload_commit(UX_DEVICE_CLASS_VIDEO_STREAM *video, ULONG length); +UINT _uxe_device_class_video_ioctl(UX_DEVICE_CLASS_VIDEO *video, ULONG ioctl_function, VOID *parameter); + /* Define Video Class API prototypes. */ +#if defined(UX_DEVICE_CLASS_VIDEO_ENABLE_ERROR_CHECKING) + +#define ux_device_class_video_entry _ux_device_class_video_entry + +#define ux_device_class_video_read_thread_entry _ux_device_class_video_read_thread_entry +#define ux_device_class_video_write_thread_entry _ux_device_class_video_write_thread_entry + +#define ux_device_class_video_request_error_set _ux_device_class_video_request_error_set +#define ux_device_class_video_stream_error_set _ux_device_class_video_stream_error_set + +#define ux_device_class_video_stream_get _ux_device_class_video_stream_get + +#define ux_device_class_video_max_payload_length _uxe_device_class_video_max_payload_length + +#define ux_device_class_video_reception_start _uxe_device_class_video_reception_start + +#define ux_device_class_video_read_payload_get _uxe_device_class_video_read_payload_get +#define ux_device_class_video_read_payload_free _uxe_device_class_video_read_payload_free + +#define ux_device_class_video_transmission_start _uxe_device_class_video_transmission_start + +#define ux_device_class_video_write_payload_get _uxe_device_class_video_write_payload_get +#define ux_device_class_video_write_payload_commit _uxe_device_class_video_write_payload_commit + +#define ux_device_class_video_ioctl _uxe_device_class_video_ioctl + +#define ux_device_class_video_read_task_function _ux_device_class_video_read_task_function +#define ux_device_class_video_write_task_function _ux_device_class_video_write_task_function + +#else + #define ux_device_class_video_entry _ux_device_class_video_entry #define ux_device_class_video_read_thread_entry _ux_device_class_video_read_thread_entry @@ -687,6 +737,7 @@ UINT _ux_device_class_video_write_task_function(UX_DEVICE_CLASS_VIDEO_STREAM #define ux_device_class_video_read_task_function _ux_device_class_video_read_task_function #define ux_device_class_video_write_task_function _ux_device_class_video_write_task_function +#endif /* UX_DEVICE_CLASS_VIDEO_ENABLE_ERROR_CHECKING */ /* Determine if a C++ compiler is being used. If so, complete the standard C conditional started above. */ diff --git a/common/usbx_device_classes/src/ux_device_class_audio_initialize.c b/common/usbx_device_classes/src/ux_device_class_audio_initialize.c index d2e74b5..92ab207 100644 --- a/common/usbx_device_classes/src/ux_device_class_audio_initialize.c +++ b/common/usbx_device_classes/src/ux_device_class_audio_initialize.c @@ -452,7 +452,7 @@ ULONG i; /* FUNCTION RELEASE */ /* */ /* _uxe_device_class_audio_initialize PORTABLE C */ -/* 6.2.1 */ +/* 6.x */ /* AUTHOR */ /* */ /* Chaoqiong Xiao, Microsoft Corporation */ @@ -482,23 +482,36 @@ ULONG i; /* DATE NAME DESCRIPTION */ /* */ /* 03-08-2023 Chaoqiong Xiao Initial Version 6.2.1 */ +/* xx-xx-xxxx Yajun Xia Modified comment(s), */ +/* fixed error checking issue, */ +/* resulting in version 6.x */ /* */ /**************************************************************************/ UINT _uxe_device_class_audio_initialize(UX_SLAVE_CLASS_COMMAND *command) { UX_DEVICE_CLASS_AUDIO_PARAMETER *audio_parameter; +ULONG i; /* Get the pointer to the application parameters for the audio class. */ audio_parameter = (UX_DEVICE_CLASS_AUDIO_PARAMETER *)command -> ux_slave_class_command_parameter; /* Sanity checks. */ + if (audio_parameter == UX_NULL) + return(UX_INVALID_PARAMETER); /* There must be at least one stream. */ if (audio_parameter -> ux_device_class_audio_parameter_streams == UX_NULL || audio_parameter -> ux_device_class_audio_parameter_streams_nb < 1) return(UX_INVALID_PARAMETER); + for (i = 0; i < audio_parameter -> ux_device_class_audio_parameter_streams_nb; i ++) + { + if ((audio_parameter -> ux_device_class_audio_parameter_streams[i].ux_device_class_audio_stream_parameter_max_frame_buffer_size == 0) || + (audio_parameter -> ux_device_class_audio_parameter_streams[i].ux_device_class_audio_stream_parameter_max_frame_buffer_nb == 0)) + return(UX_INVALID_PARAMETER); + } + #if defined(UX_DEVICE_CLASS_AUDIO_INTERRUPT_SUPPORT) /* There must be status setting for event queue. */ diff --git a/common/usbx_device_classes/src/ux_device_class_ccid_auto_seq_done.c b/common/usbx_device_classes/src/ux_device_class_ccid_auto_seq_done.c index 5a485eb..ce7996c 100644 --- a/common/usbx_device_classes/src/ux_device_class_ccid_auto_seq_done.c +++ b/common/usbx_device_classes/src/ux_device_class_ccid_auto_seq_done.c @@ -33,7 +33,7 @@ /* FUNCTION RELEASE */ /* */ /* _ux_device_class_ccid_auto_seq_done PORTABLE C */ -/* 6.2.1 */ +/* 6.x */ /* AUTHOR */ /* */ /* Chaoqiong Xiao, Microsoft Corporation */ @@ -60,7 +60,7 @@ /* */ /* CALLED BY */ /* */ -/* USBX Source Code */ +/* Application */ /* */ /* RELEASE HISTORY */ /* */ @@ -70,6 +70,8 @@ /* 03-08-2023 Chaoqiong Xiao Modified comment(s), */ /* added standalone support, */ /* resulting in version 6.2.1 */ +/* xx-xx-xxxx Yajun Xia Modified comment(s), */ +/* resulting in version 6.x */ /* */ /**************************************************************************/ UINT _ux_device_class_ccid_auto_seq_done(UX_DEVICE_CLASS_CCID *ccid, ULONG slot, ULONG icc_status) @@ -101,3 +103,54 @@ UX_DEVICE_CLASS_CCID_SLOT *ccid_slot; /* Return transfer status. */ return(UX_SUCCESS); } + +/**************************************************************************/ +/* */ +/* FUNCTION RELEASE */ +/* */ +/* _uxe_device_class_ccid_auto_seq_done PORTABLE C */ +/* 6.x */ +/* AUTHOR */ +/* */ +/* Yajun Xia, Microsoft Corporation */ +/* */ +/* DESCRIPTION */ +/* */ +/* This function checks errors in CCID card auto sequencing done */ +/* function. */ +/* */ +/* INPUT */ +/* */ +/* ccid Pointer to ccid instance */ +/* slot Slot inserted */ +/* icc_status Final card status */ +/* */ +/* OUTPUT */ +/* */ +/* Completion Status */ +/* */ +/* CALLS */ +/* */ +/* _ux_device_class_ccid_auto_seq_done CCID card auto sequencing */ +/* done function. */ +/* */ +/* CALLED BY */ +/* */ +/* Application */ +/* */ +/* RELEASE HISTORY */ +/* */ +/* DATE NAME DESCRIPTION */ +/* */ +/* xx-xx-xxxx Yajun Xia Initial Version 6.x */ +/* */ +/**************************************************************************/ +UINT _uxe_device_class_ccid_auto_seq_done(UX_DEVICE_CLASS_CCID *ccid, ULONG slot, ULONG icc_status) +{ + + /* Sanity check. */ + if (ccid == UX_NULL) + return(UX_INVALID_PARAMETER); + + return(_ux_device_class_ccid_auto_seq_done(ccid, slot, icc_status)); +}
\ No newline at end of file diff --git a/common/usbx_device_classes/src/ux_device_class_ccid_hardware_error.c b/common/usbx_device_classes/src/ux_device_class_ccid_hardware_error.c index d13a076..3600c2b 100644 --- a/common/usbx_device_classes/src/ux_device_class_ccid_hardware_error.c +++ b/common/usbx_device_classes/src/ux_device_class_ccid_hardware_error.c @@ -33,7 +33,7 @@ /* FUNCTION RELEASE */ /* */ /* _ux_device_class_ccid_hardware_error PORTABLE C */ -/* 6.2.1 */ +/* 6.x */ /* AUTHOR */ /* */ /* Chaoqiong Xiao, Microsoft Corporation */ @@ -57,7 +57,7 @@ /* */ /* CALLED BY */ /* */ -/* USBX Source Code */ +/* Application */ /* */ /* RELEASE HISTORY */ /* */ @@ -67,6 +67,8 @@ /* 03-08-2023 Chaoqiong Xiao Modified comment(s), */ /* added standalone support, */ /* resulting in version 6.2.1 */ +/* xx-xx-xxxx Yajun Xia Modified comment(s), */ +/* resulting in version 6.x */ /* */ /**************************************************************************/ UINT _ux_device_class_ccid_hardware_error(UX_DEVICE_CLASS_CCID *ccid, ULONG slot, ULONG error) @@ -139,3 +141,52 @@ UX_DEVICE_CLASS_CCID_RDR_TO_PC_SLOT_STATUS_HEADER *rsp; /* Return transfer status. */ return(UX_SUCCESS); } + +/**************************************************************************/ +/* */ +/* FUNCTION RELEASE */ +/* */ +/* _uxe_device_class_ccid_hardware_error PORTABLE C */ +/* 6.x */ +/* AUTHOR */ +/* */ +/* Yajun Xia, Microsoft Corporation */ +/* */ +/* DESCRIPTION */ +/* */ +/* This function checks errors in CCID card hardware error function. */ +/* */ +/* INPUT */ +/* */ +/* ccid Pointer to ccid instance */ +/* slot Slot removed */ +/* */ +/* OUTPUT */ +/* */ +/* Completion Status */ +/* */ +/* CALLS */ +/* */ +/* _ux_device_class_ccid_hardware_error CCID card hardware error */ +/* function. */ +/* */ +/* CALLED BY */ +/* */ +/* Application */ +/* */ +/* RELEASE HISTORY */ +/* */ +/* DATE NAME DESCRIPTION */ +/* */ +/* xx-xx-xxxx Yajun Xia Initial Version 6.x */ +/* */ +/**************************************************************************/ +UINT _uxe_device_class_ccid_hardware_error(UX_DEVICE_CLASS_CCID *ccid, ULONG slot, ULONG error) +{ + + /* Sanity check. */ + if (ccid == UX_NULL) + return(UX_INVALID_PARAMETER); + + return(_ux_device_class_ccid_hardware_error(ccid, slot, error)); +}
\ No newline at end of file diff --git a/common/usbx_device_classes/src/ux_device_class_ccid_icc_insert.c b/common/usbx_device_classes/src/ux_device_class_ccid_icc_insert.c index 6af4328..632222b 100644 --- a/common/usbx_device_classes/src/ux_device_class_ccid_icc_insert.c +++ b/common/usbx_device_classes/src/ux_device_class_ccid_icc_insert.c @@ -33,7 +33,7 @@ /* FUNCTION RELEASE */ /* */ /* _ux_device_class_ccid_icc_insert PORTABLE C */ -/* 6.2.1 */ +/* 6.x */ /* AUTHOR */ /* */ /* Chaoqiong Xiao, Microsoft Corporation */ @@ -60,7 +60,7 @@ /* */ /* CALLED BY */ /* */ -/* USBX Source Code */ +/* Application */ /* */ /* RELEASE HISTORY */ /* */ @@ -70,6 +70,8 @@ /* 03-08-2023 Chaoqiong Xiao Modified comment(s), */ /* added standalone support, */ /* resulting in version 6.2.1 */ +/* xx-xx-xxxx Yajun Xia Modified comment(s), */ +/* resulting in version 6.x */ /* */ /**************************************************************************/ UINT _ux_device_class_ccid_icc_insert(UX_DEVICE_CLASS_CCID *ccid, ULONG slot, ULONG seq_start) @@ -126,3 +128,52 @@ UX_DEVICE_CLASS_CCID_SLOT *ccid_slot; /* Return transfer status. */ return(UX_SUCCESS); } + +/**************************************************************************/ +/* */ +/* FUNCTION RELEASE */ +/* */ +/* _uxe_device_class_ccid_icc_insert PORTABLE C */ +/* 6.x */ +/* AUTHOR */ +/* */ +/* Yajun Xia, Microsoft Corporation */ +/* */ +/* DESCRIPTION */ +/* */ +/* This function checks errors in CCID card insertion function. */ +/* */ +/* INPUT */ +/* */ +/* ccid Pointer to ccid instance */ +/* slot Slot inserted */ +/* seq_start Auto activation sequence on */ +/* */ +/* OUTPUT */ +/* */ +/* Completion Status */ +/* */ +/* CALLS */ +/* */ +/* _ux_device_class_ccid_icc_insert CCID card insertion function. */ +/* */ +/* CALLED BY */ +/* */ +/* Application */ +/* */ +/* RELEASE HISTORY */ +/* */ +/* DATE NAME DESCRIPTION */ +/* */ +/* xx-xx-xxxx Yajun Xia Initial Version 6.x */ +/* */ +/**************************************************************************/ +UINT _uxe_device_class_ccid_icc_insert(UX_DEVICE_CLASS_CCID *ccid, ULONG slot, ULONG seq_start) +{ + + /* Sanity checks. */ + if (ccid == UX_NULL) + return(UX_INVALID_PARAMETER); + + return(_ux_device_class_ccid_icc_insert(ccid, slot, seq_start)); +}
\ No newline at end of file diff --git a/common/usbx_device_classes/src/ux_device_class_ccid_icc_remove.c b/common/usbx_device_classes/src/ux_device_class_ccid_icc_remove.c index ffefc79..6b0541b 100644 --- a/common/usbx_device_classes/src/ux_device_class_ccid_icc_remove.c +++ b/common/usbx_device_classes/src/ux_device_class_ccid_icc_remove.c @@ -33,7 +33,7 @@ /* FUNCTION RELEASE */ /* */ /* _ux_device_class_ccid_icc_remove PORTABLE C */ -/* 6.2.1 */ +/* 6.x */ /* AUTHOR */ /* */ /* Chaoqiong Xiao, Microsoft Corporation */ @@ -56,7 +56,7 @@ /* */ /* CALLED BY */ /* */ -/* USBX Source Code */ +/* Application */ /* */ /* RELEASE HISTORY */ /* */ @@ -66,6 +66,8 @@ /* 03-08-2023 Chaoqiong Xiao Modified comment(s), */ /* added standalone support, */ /* resulting in version 6.2.1 */ +/* xx-xx-xxxx Yajun Xia Modified comment(s), */ +/* resulting in version 6.x */ /* */ /**************************************************************************/ UINT _ux_device_class_ccid_icc_remove(UX_DEVICE_CLASS_CCID *ccid, ULONG slot) @@ -119,3 +121,51 @@ UX_DEVICE_CLASS_CCID_SLOT *ccid_slot; /* Return transfer status. */ return(UX_SUCCESS); } + +/**************************************************************************/ +/* */ +/* FUNCTION RELEASE */ +/* */ +/* _uxe_device_class_ccid_icc_remove PORTABLE C */ +/* 6.x */ +/* AUTHOR */ +/* */ +/* Yajun Xia, Microsoft Corporation */ +/* */ +/* DESCRIPTION */ +/* */ +/* This function checks errors in CCID card remove function. */ +/* */ +/* INPUT */ +/* */ +/* ccid Pointer to ccid instance */ +/* slot Slot removed */ +/* */ +/* OUTPUT */ +/* */ +/* Completion Status */ +/* */ +/* CALLS */ +/* */ +/* _ux_device_class_ccid_icc_remove CCID card remove function. */ +/* */ +/* CALLED BY */ +/* */ +/* Application */ +/* */ +/* RELEASE HISTORY */ +/* */ +/* DATE NAME DESCRIPTION */ +/* */ +/* xx-xx-xxxx Yajun Xia Initial Version 6.x */ +/* */ +/**************************************************************************/ +UINT _uxe_device_class_ccid_icc_remove(UX_DEVICE_CLASS_CCID *ccid, ULONG slot) +{ + + /* Sanity check. */ + if (ccid == UX_NULL) + return(UX_INVALID_PARAMETER); + + return(_ux_device_class_ccid_icc_remove(ccid, slot)); +}
\ No newline at end of file diff --git a/common/usbx_device_classes/src/ux_device_class_ccid_time_extension.c b/common/usbx_device_classes/src/ux_device_class_ccid_time_extension.c index 22a7649..38ff23f 100644 --- a/common/usbx_device_classes/src/ux_device_class_ccid_time_extension.c +++ b/common/usbx_device_classes/src/ux_device_class_ccid_time_extension.c @@ -33,7 +33,7 @@ /* FUNCTION RELEASE */ /* */ /* _ux_device_class_ccid_time_extension PORTABLE C */ -/* 6.1.11 */ +/* 6.x */ /* AUTHOR */ /* */ /* Chaoqiong Xiao, Microsoft Corporation */ @@ -57,13 +57,15 @@ /* */ /* CALLED BY */ /* */ -/* USBX Source Code */ +/* Application */ /* */ /* RELEASE HISTORY */ /* */ /* DATE NAME DESCRIPTION */ /* */ /* 04-25-2022 Chaoqiong Xiao Initial Version 6.1.11 */ +/* xx-xx-xxxx Yajun Xia Modified comment(s), */ +/* resulting in version 6.x */ /* */ /**************************************************************************/ UINT _ux_device_class_ccid_time_extension(UX_DEVICE_CLASS_CCID *ccid, ULONG slot, ULONG wt) @@ -126,3 +128,55 @@ UINT status; /* Return transfer status. */ return(status); } + +/**************************************************************************/ +/* */ +/* FUNCTION RELEASE */ +/* */ +/* _uxe_device_class_ccid_icc_insert PORTABLE C */ +/* 6.x */ +/* AUTHOR */ +/* */ +/* Yajun Xia, Microsoft Corporation */ +/* */ +/* DESCRIPTION */ +/* */ +/* This function checks errors in CCID device bulk IN time_extension */ +/* send function. */ +/* */ +/* INPUT */ +/* */ +/* ccid Pointer to ccid instance */ +/* slot Slot to extend time */ +/* wt BWT (T=1) or WWT (T=0) */ +/* */ +/* OUTPUT */ +/* */ +/* Completion Status */ +/* */ +/* CALLS */ +/* */ +/* _ux_device_class_ccid_time_extension CCID device bulk IN */ +/* time_extension send function. */ +/* */ +/* CALLED BY */ +/* */ +/* Application */ +/* */ +/* RELEASE HISTORY */ +/* */ +/* DATE NAME DESCRIPTION */ +/* */ +/* xx-xx-xxxx Yajun Xia Initial Version 6.x */ +/* */ +/**************************************************************************/ +UINT _uxe_device_class_ccid_time_extension(UX_DEVICE_CLASS_CCID *ccid, ULONG slot, ULONG wt) +{ + + /* Sanity checks. */ + if ((ccid == UX_NULL) || (slot >= ccid -> ux_device_class_ccid_parameter.ux_device_class_ccid_max_n_slots)) + return(UX_INVALID_PARAMETER); + + /* Call actual function. */ + return(_ux_device_class_ccid_time_extension(ccid, slot, wt)); +}
\ No newline at end of file diff --git a/common/usbx_device_classes/src/ux_device_class_cdc_acm_ioctl.c b/common/usbx_device_classes/src/ux_device_class_cdc_acm_ioctl.c index e8503fe..fb0371a 100644 --- a/common/usbx_device_classes/src/ux_device_class_cdc_acm_ioctl.c +++ b/common/usbx_device_classes/src/ux_device_class_cdc_acm_ioctl.c @@ -34,7 +34,7 @@ /* FUNCTION RELEASE */ /* */ /* _ux_device_class_cdc_acm_ioctl PORTABLE C */ -/* 6.1.12 */ +/* 6.x */ /* AUTHOR */ /* */ /* Chaoqiong Xiao, Microsoft Corporation */ @@ -64,7 +64,7 @@ /* */ /* CALLED BY */ /* */ -/* ThreadX */ +/* Application */ /* */ /* RELEASE HISTORY */ /* */ @@ -96,6 +96,8 @@ /* fixed parameter/variable */ /* names conflict C++ keyword, */ /* resulting in version 6.1.12 */ +/* xx-xx-xxxx Yajun Xia Modified comment(s), */ +/* resulting in version 6.x */ /* */ /**************************************************************************/ UINT _ux_device_class_cdc_acm_ioctl(UX_SLAVE_CLASS_CDC_ACM *cdc_acm, ULONG ioctl_function, @@ -209,7 +211,7 @@ UX_SLAVE_TRANSFER *transfer_request; /* Parameter not supported. Return an error. */ status = UX_ENDPOINT_HANDLE_UNKNOWN; } - + /* Get the transfer request associated with the endpoint. */ transfer_request = &endpoint -> ux_slave_endpoint_transfer_request; @@ -351,10 +353,62 @@ UX_SLAVE_TRANSFER *transfer_request; /* Function not supported. Return an error. */ status = UX_FUNCTION_NOT_SUPPORTED; - } + } /* Return status to caller. */ return(status); - + } +/**************************************************************************/ +/* */ +/* FUNCTION RELEASE */ +/* */ +/* _uxe_device_class_cdc_acm_ioctl PORTABLE C */ +/* 6.x */ +/* AUTHOR */ +/* */ +/* Yajun Xia, Microsoft Corporation */ +/* */ +/* DESCRIPTION */ +/* */ +/* This function checks errors in CDC ACM class ioctl function. */ +/* */ +/* INPUT */ +/* */ +/* cdc_acm Address of cdc_acm class */ +/* instance */ +/* ioctl_function Ioctl function */ +/* Parameter Parameter of ioctl function */ +/* */ +/* OUTPUT */ +/* */ +/* Status */ +/* */ +/* CALLS */ +/* */ +/* _ux_device_class_cdc_acm_ioctl CDC ACM class ioctl function */ +/* */ +/* CALLED BY */ +/* */ +/* Application */ +/* */ +/* RELEASE HISTORY */ +/* */ +/* DATE NAME DESCRIPTION */ +/* */ +/* xx-xx-xxxx Yajun Xia Initial Version 6.x */ +/* */ +/**************************************************************************/ +UINT _uxe_device_class_cdc_acm_ioctl(UX_SLAVE_CLASS_CDC_ACM *cdc_acm, ULONG ioctl_function, + VOID *parameter) +{ + + /* Sanity checks. */ + if (cdc_acm == UX_NULL) + { + return (UX_INVALID_PARAMETER); + } + + return (_ux_device_class_cdc_acm_ioctl(cdc_acm, ioctl_function, parameter)); +}
\ No newline at end of file diff --git a/common/usbx_device_classes/src/ux_device_class_cdc_acm_read.c b/common/usbx_device_classes/src/ux_device_class_cdc_acm_read.c index 6b8e0cd..dc2fe46 100644 --- a/common/usbx_device_classes/src/ux_device_class_cdc_acm_read.c +++ b/common/usbx_device_classes/src/ux_device_class_cdc_acm_read.c @@ -35,7 +35,7 @@ /* FUNCTION RELEASE */ /* */ /* _ux_device_class_cdc_acm_read PORTABLE C */ -/* 6.1.12 */ +/* 6.x */ /* AUTHOR */ /* */ /* Chaoqiong Xiao, Microsoft Corporation */ @@ -68,7 +68,7 @@ /* */ /* CALLED BY */ /* */ -/* ThreadX */ +/* Application */ /* */ /* RELEASE HISTORY */ /* */ @@ -90,6 +90,8 @@ /* fixed parameter/variable */ /* names conflict C++ keyword, */ /* resulting in version 6.1.12 */ +/* xx-xx-xxxx Yajun Xia Modified comment(s), */ +/* resulting in version 6.x */ /* */ /**************************************************************************/ UINT _ux_device_class_cdc_acm_read(UX_SLAVE_CLASS_CDC_ACM *cdc_acm, UCHAR *buffer, @@ -238,4 +240,61 @@ ULONG local_requested_length; /* Simply return the last transaction result. */ return(status); } -#endif + +/**************************************************************************/ +/* */ +/* FUNCTION RELEASE */ +/* */ +/* _uxe_device_class_cdc_acm_read PORTABLE C */ +/* 6.x */ +/* AUTHOR */ +/* */ +/* Yajun Xia, Microsoft Corporation */ +/* */ +/* DESCRIPTION */ +/* */ +/* This function checks errors in CDC ACM class read function. */ +/* */ +/* INPUT */ +/* */ +/* cdc_acm Address of cdc_acm class */ +/* instance */ +/* buffer Pointer to buffer to save */ +/* received data */ +/* requested_length Length of bytes to read */ +/* actual_length Pointer to save number of */ +/* bytes read */ +/* */ +/* OUTPUT */ +/* */ +/* None */ +/* */ +/* CALLS */ +/* */ +/* _ux_device_class_cdc_acm_read CDC ACM class read function */ +/* */ +/* CALLED BY */ +/* */ +/* Application */ +/* */ +/* RELEASE HISTORY */ +/* */ +/* DATE NAME DESCRIPTION */ +/* */ +/* xx-xx-xxxx Yajun Xia Initial Version 6.x */ +/* */ +/**************************************************************************/ +UINT _uxe_device_class_cdc_acm_read(UX_SLAVE_CLASS_CDC_ACM *cdc_acm, UCHAR *buffer, + ULONG requested_length, ULONG *actual_length) +{ + + /* Sanity checks. */ + if ((cdc_acm == UX_NULL) || ((buffer == UX_NULL) && (requested_length > 0)) || (actual_length == UX_NULL)) + { + return (UX_INVALID_PARAMETER); + } + + return (_ux_device_class_cdc_acm_read(cdc_acm, buffer, requested_length, actual_length)); +} + +#endif
\ No newline at end of file diff --git a/common/usbx_device_classes/src/ux_device_class_cdc_acm_read_run.c b/common/usbx_device_classes/src/ux_device_class_cdc_acm_read_run.c index e89212a..ae7e065 100644 --- a/common/usbx_device_classes/src/ux_device_class_cdc_acm_read_run.c +++ b/common/usbx_device_classes/src/ux_device_class_cdc_acm_read_run.c @@ -37,7 +37,7 @@ /* FUNCTION RELEASE */ /* */ /* _ux_device_class_cdc_acm_read_run PORTABLE C */ -/* 6.2.0 */ +/* 6.x */ /* AUTHOR */ /* */ /* Chaoqiong Xiao, Microsoft Corporation */ @@ -63,6 +63,7 @@ /* State machine Status to check */ /* UX_STATE_NEXT Transfer done, to next state */ /* UX_STATE_EXIT Abnormal, to reset state */ +/* UX_STATE_ERROR Error occurred */ /* (others) Keep running, waiting */ /* */ /* CALLS */ @@ -82,6 +83,9 @@ /* 10-31-2022 Yajun Xia Modified comment(s), */ /* fixed return code, */ /* resulting in version 6.2.0 */ +/* xx-xx-xxxx Yajun Xia Modified comment(s), */ +/* fixed return code, */ +/* resulting in version 6.x */ /* */ /**************************************************************************/ UINT _ux_device_class_cdc_acm_read_run(UX_SLAVE_CLASS_CDC_ACM *cdc_acm, @@ -102,7 +106,7 @@ UINT status = UX_SUCCESS; if (cdc_acm -> ux_slave_class_cdc_acm_transmission_status == UX_TRUE) /* Not allowed. */ - return(UX_ERROR); + return(UX_STATE_ERROR); #endif /* Get the pointer to the device. */ @@ -256,4 +260,67 @@ UINT status = UX_SUCCESS; /* Error cases. */ return(UX_STATE_EXIT); } + +/**************************************************************************/ +/* */ +/* FUNCTION RELEASE */ +/* */ +/* _uxe_device_class_cdc_acm_read_run PORTABLE C */ +/* 6.x */ +/* AUTHOR */ +/* */ +/* Yajun Xia, Microsoft Corporation */ +/* */ +/* DESCRIPTION */ +/* */ +/* This function checks errors in CDC ACM class read process. */ +/* */ +/* It's for standalone mode. */ +/* */ +/* INPUT */ +/* */ +/* cdc_acm Address of cdc_acm class */ +/* instance */ +/* buffer Pointer to buffer to save */ +/* received data */ +/* requested_length Length of bytes to read */ +/* actual_length Pointer to save number of */ +/* bytes read */ +/* */ +/* OUTPUT */ +/* */ +/* State machine Status to check */ +/* UX_STATE_NEXT Transfer done, to next state */ +/* UX_STATE_EXIT Abnormal, to reset state */ +/* UX_STATE_ERROR Error occurred */ +/* (others) Keep running, waiting */ +/* */ +/* CALLS */ +/* */ +/* _ux_device_class_cdc_acm_read_run CDC ACM class read process */ +/* */ +/* CALLED BY */ +/* */ +/* Application */ +/* */ +/* RELEASE HISTORY */ +/* */ +/* DATE NAME DESCRIPTION */ +/* */ +/* xx-xx-xxxx Yajun Xia Initial Version 6.x */ +/* */ +/**************************************************************************/ +UINT _uxe_device_class_cdc_acm_read_run(UX_SLAVE_CLASS_CDC_ACM *cdc_acm, + UCHAR *buffer, ULONG requested_length, ULONG *actual_length) +{ + + /* Sanity checks. */ + if ((cdc_acm == UX_NULL) || ((buffer == UX_NULL) && (requested_length > 0)) || (actual_length == UX_NULL)) + { + return(UX_STATE_ERROR); + } + + return (_ux_device_class_cdc_acm_read_run(cdc_acm, buffer, requested_length, actual_length)); +} + #endif diff --git a/common/usbx_device_classes/src/ux_device_class_cdc_acm_write.c b/common/usbx_device_classes/src/ux_device_class_cdc_acm_write.c index be1c890..73ca5f9 100644 --- a/common/usbx_device_classes/src/ux_device_class_cdc_acm_write.c +++ b/common/usbx_device_classes/src/ux_device_class_cdc_acm_write.c @@ -35,7 +35,7 @@ /* FUNCTION RELEASE */ /* */ /* _ux_device_class_cdc_acm_write PORTABLE C */ -/* 6.1.12 */ +/* 6.x */ /* AUTHOR */ /* */ /* Chaoqiong Xiao, Microsoft Corporation */ @@ -69,7 +69,7 @@ /* */ /* CALLED BY */ /* */ -/* ThreadX */ +/* Application */ /* */ /* RELEASE HISTORY */ /* */ @@ -92,6 +92,8 @@ /* names conflict C++ keyword, */ /* added auto ZLP support, */ /* resulting in version 6.1.12 */ +/* xx-xx-xxxx Yajun Xia Modified comment(s), */ +/* resulting in version 6.x */ /* */ /**************************************************************************/ UINT _ux_device_class_cdc_acm_write(UX_SLAVE_CLASS_CDC_ACM *cdc_acm, UCHAR *buffer, @@ -261,4 +263,61 @@ UINT status = 0; return(status); } -#endif + +/**************************************************************************/ +/* */ +/* FUNCTION RELEASE */ +/* */ +/* _uxe_device_class_cdc_acm_write PORTABLE C */ +/* 6.x */ +/* AUTHOR */ +/* */ +/* Yajun Xia, Microsoft Corporation */ +/* */ +/* DESCRIPTION */ +/* */ +/* This function checks errors in CDC ACM class write function. */ +/* */ +/* INPUT */ +/* */ +/* cdc_acm Address of cdc_acm class */ +/* instance */ +/* buffer Pointer to data to write */ +/* requested_length Length of bytes to write, */ +/* set to 0 to issue ZLP */ +/* actual_length Pointer to save number of */ +/* bytes written */ +/* */ +/* OUTPUT */ +/* */ +/* None */ +/* */ +/* CALLS */ +/* */ +/* _ux_device_class_cdc_acm_write CDC ACM class write function */ +/* */ +/* CALLED BY */ +/* */ +/* Application */ +/* */ +/* RELEASE HISTORY */ +/* */ +/* DATE NAME DESCRIPTION */ +/* */ +/* xx-xx-xxxx Yajun Xia Initial Version 6.x */ +/* */ +/**************************************************************************/ +UINT _uxe_device_class_cdc_acm_write(UX_SLAVE_CLASS_CDC_ACM *cdc_acm, UCHAR *buffer, + ULONG requested_length, ULONG *actual_length) +{ + + /* Sanity checks. */ + if ((cdc_acm == UX_NULL) || ((buffer == UX_NULL) && (requested_length > 0)) || (actual_length == UX_NULL)) + { + return (UX_INVALID_PARAMETER); + } + + return (_ux_device_class_cdc_acm_write(cdc_acm, buffer, requested_length, actual_length)); +} + +#endif
\ No newline at end of file diff --git a/common/usbx_device_classes/src/ux_device_class_cdc_acm_write_run.c b/common/usbx_device_classes/src/ux_device_class_cdc_acm_write_run.c index 35ea2ad..b2547b1 100644 --- a/common/usbx_device_classes/src/ux_device_class_cdc_acm_write_run.c +++ b/common/usbx_device_classes/src/ux_device_class_cdc_acm_write_run.c @@ -37,7 +37,7 @@ /* FUNCTION RELEASE */ /* */ /* _ux_device_class_cdc_acm_write_run PORTABLE C */ -/* 6.2.0 */ +/* 6.x */ /* AUTHOR */ /* */ /* Chaoqiong Xiao, Microsoft Corporation */ @@ -62,6 +62,7 @@ /* State machine Status to check */ /* UX_STATE_NEXT Transfer done, to next state */ /* UX_STATE_EXIT Abnormal, to reset state */ +/* UX_STATE_ERROR Error occurred */ /* (others) Keep running, waiting */ /* */ /* CALLS */ @@ -86,6 +87,9 @@ /* 10-31-2022 Yajun Xia Modified comment(s), */ /* fixed return code, */ /* resulting in version 6.2.0 */ +/* xx-xx-xxxx Yajun Xia Modified comment(s), */ +/* fixed return code, */ +/* resulting in version 6.x */ /* */ /**************************************************************************/ UINT _ux_device_class_cdc_acm_write_run(UX_SLAVE_CLASS_CDC_ACM *cdc_acm, @@ -108,7 +112,7 @@ UINT status = 0; if (cdc_acm -> ux_slave_class_cdc_acm_transmission_status == UX_TRUE) /* Not allowed. */ - return(UX_ERROR); + return(UX_STATE_ERROR); #endif /* Get the pointer to the device. */ @@ -271,4 +275,66 @@ UINT status = 0; /* Error case. */ return(UX_STATE_EXIT); } + +/**************************************************************************/ +/* */ +/* FUNCTION RELEASE */ +/* */ +/* _uxe_device_class_cdc_acm_write_run PORTABLE C */ +/* 6.x */ +/* AUTHOR */ +/* */ +/* Yajun Xia, Microsoft Corporation */ +/* */ +/* DESCRIPTION */ +/* */ +/* This function checks errors in CDC ACM class write process. */ +/* */ +/* It's for standalone mode. */ +/* */ +/* INPUT */ +/* */ +/* cdc_acm Address of cdc_acm class */ +/* instance */ +/* buffer Pointer to data to write */ +/* requested_length Length of bytes to write */ +/* actual_length Pointer to save number of */ +/* bytes written */ +/* */ +/* OUTPUT */ +/* */ +/* State machine Status to check */ +/* UX_STATE_NEXT Transfer done, to next state */ +/* UX_STATE_EXIT Abnormal, to reset state */ +/* UX_STATE_ERROR Error occurred */ +/* (others) Keep running, waiting */ +/* */ +/* CALLS */ +/* */ +/* _ux_device_class_cdc_acm_write_run CDC ACM class write process */ +/* */ +/* CALLED BY */ +/* */ +/* Application */ +/* */ +/* RELEASE HISTORY */ +/* */ +/* DATE NAME DESCRIPTION */ +/* */ +/* xx-xx-xxxx Yajun Xia Initial Version 6.x */ +/* */ +/**************************************************************************/ +UINT _uxe_device_class_cdc_acm_write_run(UX_SLAVE_CLASS_CDC_ACM *cdc_acm, + UCHAR *buffer, ULONG requested_length, ULONG *actual_length) +{ + + /* Sanity checks. */ + if ((cdc_acm == UX_NULL) || ((buffer == UX_NULL) && (requested_length > 0)) || (actual_length == UX_NULL)) + { + return(UX_STATE_ERROR); + } + + return (_ux_device_class_cdc_acm_write_run(cdc_acm, buffer, requested_length, actual_length)); +} + #endif diff --git a/common/usbx_device_classes/src/ux_device_class_cdc_acm_write_with_callback.c b/common/usbx_device_classes/src/ux_device_class_cdc_acm_write_with_callback.c index 388c305..a8fb947 100644 --- a/common/usbx_device_classes/src/ux_device_class_cdc_acm_write_with_callback.c +++ b/common/usbx_device_classes/src/ux_device_class_cdc_acm_write_with_callback.c @@ -34,7 +34,7 @@ /* FUNCTION RELEASE */ /* */ /* _ux_device_class_cdc_acm_write_with_callback PORTABLE C */ -/* 6.1.11 */ +/* 6.x */ /* AUTHOR */ /* */ /* Chaoqiong Xiao, Microsoft Corporation */ @@ -60,7 +60,7 @@ /* */ /* CALLED BY */ /* */ -/* ThreadX */ +/* Application */ /* */ /* RELEASE HISTORY */ /* */ @@ -81,6 +81,8 @@ /* resulting in version 6.1.10 */ /* 04-25-2022 Chaoqiong Xiao Modified comment(s), */ /* resulting in version 6.1.11 */ +/* xx-xx-xxxx Yajun Xia Modified comment(s), */ +/* resulting in version 6.x */ /* */ /**************************************************************************/ UINT _ux_device_class_cdc_acm_write_with_callback(UX_SLAVE_CLASS_CDC_ACM *cdc_acm, UCHAR *buffer, @@ -165,3 +167,56 @@ UINT status; #endif } +/**************************************************************************/ +/* */ +/* FUNCTION RELEASE */ +/* */ +/* _uxe_device_class_cdc_acm_write_with_callback PORTABLE C */ +/* 6.x */ +/* AUTHOR */ +/* */ +/* Yajun Xia, Microsoft Corporation */ +/* */ +/* DESCRIPTION */ +/* */ +/* This function checks errors in CDC ACM class write with */ +/* callback function. */ +/* */ +/* INPUT */ +/* */ +/* cdc_acm Address of cdc_acm class */ +/* instance */ +/* buffer Pointer to data to write */ +/* requested_length Length of bytes to write */ +/* */ +/* OUTPUT */ +/* */ +/* None */ +/* */ +/* CALLS */ +/* */ +/* _ux_device_class_cdc_acm_write_with_callback */ +/* */ +/* CALLED BY */ +/* */ +/* Application */ +/* */ +/* RELEASE HISTORY */ +/* */ +/* DATE NAME DESCRIPTION */ +/* */ +/* xx-xx-xxxx Yajun Xia Initial Version 6.x */ +/* */ +/**************************************************************************/ +UINT _uxe_device_class_cdc_acm_write_with_callback(UX_SLAVE_CLASS_CDC_ACM *cdc_acm, UCHAR *buffer, + ULONG requested_length) +{ + + /* Sanity checks. */ + if ((cdc_acm == UX_NULL) || ((buffer == UX_NULL) && (requested_length > 0))) + { + return (UX_INVALID_PARAMETER); + } + + return (_ux_device_class_cdc_acm_write_with_callback(cdc_acm, buffer, requested_length)); +} diff --git a/common/usbx_device_classes/src/ux_device_class_dfu_entry.c b/common/usbx_device_classes/src/ux_device_class_dfu_entry.c index 2dd1333..be1f7d6 100644 --- a/common/usbx_device_classes/src/ux_device_class_dfu_entry.c +++ b/common/usbx_device_classes/src/ux_device_class_dfu_entry.c @@ -34,7 +34,7 @@ /* FUNCTION RELEASE */ /* */ /* _ux_device_class_dfu_entry PORTABLE C */ -/* 6.1 */ +/* 6.x */ /* AUTHOR */ /* */ /* Chaoqiong Xiao, Microsoft Corporation */ @@ -72,6 +72,9 @@ /* 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 Yajun Xia Modified comment(s), */ +/* added error checks support, */ +/* resulting in version 6.x */ /* */ /**************************************************************************/ UINT _ux_device_class_dfu_entry(UX_SLAVE_CLASS_COMMAND *command) @@ -86,10 +89,16 @@ UINT status; { case UX_SLAVE_CLASS_COMMAND_INITIALIZE: +#ifdef UX_DEVICE_CLASS_DFU_ENABLE_ERROR_CHECKING + + /* Call the init function of the DFU ACM class. */ + status = _uxe_device_class_dfu_initialize(command); +#else /* Call the init function of the DFU ACM class. */ status = _ux_device_class_dfu_initialize(command); - +#endif /* UX_DEVICE_CLASS_DFU_ENABLE_ERROR_CHECKING */ + /* Return the completion status. */ return(status); diff --git a/common/usbx_device_classes/src/ux_device_class_dfu_initialize.c b/common/usbx_device_classes/src/ux_device_class_dfu_initialize.c index 3de361f..31f2b2c 100644 --- a/common/usbx_device_classes/src/ux_device_class_dfu_initialize.c +++ b/common/usbx_device_classes/src/ux_device_class_dfu_initialize.c @@ -10,8 +10,8 @@ /**************************************************************************/ /**************************************************************************/ -/** */ -/** USBX Component */ +/** */ +/** USBX Component */ /** */ /** Device DFU Class */ /** */ @@ -28,45 +28,45 @@ #include "ux_device_stack.h" -/**************************************************************************/ -/* */ -/* FUNCTION RELEASE */ -/* */ -/* _ux_device_class_dfu_initialize PORTABLE C */ +/**************************************************************************/ +/* */ +/* FUNCTION RELEASE */ +/* */ +/* _ux_device_class_dfu_initialize PORTABLE C */ /* 6.1.12 */ /* AUTHOR */ /* */ /* Chaoqiong Xiao, Microsoft Corporation */ /* */ /* DESCRIPTION */ -/* */ -/* This function initializes the USB DFU device. */ -/* */ -/* INPUT */ -/* */ -/* command Pointer to dfu command */ -/* */ -/* OUTPUT */ -/* */ -/* Completion Status */ -/* */ -/* CALLS */ -/* */ +/* */ +/* This function initializes the USB DFU device. */ +/* */ +/* INPUT */ +/* */ +/* command Pointer to dfu command */ +/* */ +/* OUTPUT */ +/* */ +/* Completion Status */ +/* */ +/* CALLS */ +/* */ /* _ux_utility_memory_allocate Allocate memory */ /* _ux_utility_memory_free Free memory */ /* _ux_utility_descriptor_parse Parse a descriptor */ /* _ux_utility_event_flags_create Create event flags */ /* _ux_utility_event_flags_delete Delete event flags */ /* _ux_device_thread_create Create thread */ -/* */ -/* CALLED BY */ -/* */ -/* USBX Source Code */ -/* */ -/* RELEASE HISTORY */ -/* */ -/* DATE NAME DESCRIPTION */ -/* */ +/* */ +/* CALLED BY */ +/* */ +/* USBX Source Code */ +/* */ +/* RELEASE HISTORY */ +/* */ +/* DATE NAME DESCRIPTION */ +/* */ /* 05-19-2020 Chaoqiong Xiao Initial Version 6.0 */ /* 09-30-2020 Chaoqiong Xiao Modified comment(s), */ /* used UX prefix to refer to */ @@ -91,13 +91,13 @@ /**************************************************************************/ UINT _ux_device_class_dfu_initialize(UX_SLAVE_CLASS_COMMAND *command) { - + UX_SLAVE_CLASS_DFU *dfu; UX_SLAVE_CLASS_DFU_PARAMETER *dfu_parameter; UX_SLAVE_CLASS *class_ptr; UINT status = UX_DESCRIPTOR_CORRUPTED; UX_DFU_FUNCTIONAL_DESCRIPTOR dfu_functional_descriptor; -UCHAR *dfu_framework; +UCHAR *dfu_framework; ULONG dfu_framework_length; UCHAR descriptor_type; ULONG descriptor_length; @@ -137,7 +137,7 @@ ULONG descriptor_length; an interface descriptor and finally a functional descriptor. */ dfu_framework = _ux_system_slave -> ux_system_slave_dfu_framework; dfu_framework_length = _ux_system_slave -> ux_system_slave_dfu_framework_length; - + /* Parse the device framework and locate interfaces and endpoint descriptor(s). */ while (dfu_framework_length != 0) { @@ -169,10 +169,10 @@ ULONG descriptor_length; /* Retrieve the DFU capabilities and store them in the system. */ _ux_system_slave -> ux_system_slave_device_dfu_capabilities = dfu_functional_descriptor.bmAttributes; - + /* Retrieve the DFU timeout value. */ _ux_system_slave -> ux_system_slave_device_dfu_detach_timeout = dfu_functional_descriptor.wDetachTimeOut; - + /* Retrieve the DFU transfer size value. */ _ux_system_slave -> ux_system_slave_device_dfu_transfer_size = dfu_functional_descriptor.wTransferSize; @@ -204,9 +204,9 @@ ULONG descriptor_length; /* Allocate some memory for the dfu thread stack. */ if (status == UX_SUCCESS) { - dfu -> ux_slave_class_dfu_thread_stack = + dfu -> ux_slave_class_dfu_thread_stack = _ux_utility_memory_allocate(UX_NO_ALIGN, UX_REGULAR_MEMORY, UX_THREAD_STACK_SIZE); - + /* Check for successful allocation. */ if (dfu -> ux_slave_class_dfu_thread_stack == UX_NULL) status = UX_MEMORY_INSUFFICIENT; @@ -215,7 +215,7 @@ ULONG descriptor_length; /* dfu needs a thread to watch for disconnect and timer event for the DFU_DETACH sequence. */ if (status == UX_SUCCESS) { - status = _ux_device_thread_create(&dfu -> ux_slave_class_dfu_thread , "ux_slave_class_dfu_thread", + status = _ux_device_thread_create(&dfu -> ux_slave_class_dfu_thread , "ux_slave_class_dfu_thread", _ux_device_class_dfu_thread, (ULONG) (ALIGN_TYPE) class_ptr, (VOID *) dfu -> ux_slave_class_dfu_thread_stack, UX_THREAD_STACK_SIZE, UX_THREAD_PRIORITY_CLASS, @@ -236,7 +236,7 @@ ULONG descriptor_length; /* Return completion status. */ if (status == UX_SUCCESS) return(UX_SUCCESS); - + /* There is error, free resources. */ #if !defined(UX_DEVICE_STANDALONE) @@ -255,3 +255,59 @@ ULONG descriptor_length; return(status); } +/**************************************************************************/ +/* */ +/* FUNCTION RELEASE */ +/* */ +/* _uxe_device_class_dfu_initialize PORTABLE C */ +/* 6.x */ +/* AUTHOR */ +/* */ +/* Yajun Xia, Microsoft Corporation */ +/* */ +/* DESCRIPTION */ +/* */ +/* This function checks errors in DFU device class initialize */ +/* function. */ +/* */ +/* INPUT */ +/* */ +/* command Pointer to dfu command */ +/* */ +/* OUTPUT */ +/* */ +/* Completion Status */ +/* */ +/* CALLS */ +/* */ +/* _ux_device_class_dfu_initialize DFU device class initialize */ +/* function. */ +/* */ +/* CALLED BY */ +/* */ +/* USBX Source Code */ +/* */ +/* RELEASE HISTORY */ +/* */ +/* DATE NAME DESCRIPTION */ +/* */ +/* xx-xx-xxxx Yajun Xia Initial Version 6.x */ +/* */ +/**************************************************************************/ +UINT _uxe_device_class_dfu_initialize(UX_SLAVE_CLASS_COMMAND *command) +{ + +UX_SLAVE_CLASS_DFU_PARAMETER *dfu_parameter; + + /* Static Check */ + if (command -> ux_slave_class_command_parameter == UX_NULL) + return(UX_INVALID_PARAMETER); + + dfu_parameter = (UX_SLAVE_CLASS_DFU_PARAMETER *) command -> ux_slave_class_command_parameter; + + if ((dfu_parameter -> ux_slave_class_dfu_parameter_framework == UX_NULL) && + (dfu_parameter -> ux_slave_class_dfu_parameter_framework_length > 0)) + return(UX_INVALID_PARAMETER); + + return _ux_device_class_dfu_initialize(command); +} diff --git a/common/usbx_device_classes/src/ux_device_class_hid_entry.c b/common/usbx_device_classes/src/ux_device_class_hid_entry.c index 384b8c2..38b4afe 100644 --- a/common/usbx_device_classes/src/ux_device_class_hid_entry.c +++ b/common/usbx_device_classes/src/ux_device_class_hid_entry.c @@ -73,6 +73,9 @@ /* 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), */ +/* added error checks support, */ +/* resulting in version 6.x */ /* */ /**************************************************************************/ UINT _ux_device_class_hid_entry(UX_SLAVE_CLASS_COMMAND *command) @@ -89,8 +92,12 @@ UINT status; case UX_SLAVE_CLASS_COMMAND_INITIALIZE: /* Call the init function of the HID class. */ +#if defined(UX_DEVICE_CLASS_HID_ENABLE_ERROR_CHECKING) + status = _uxe_device_class_hid_initialize(command); +#else status = _ux_device_class_hid_initialize(command); - +#endif + /* Return the completion status. */ return(status); diff --git a/common/usbx_device_classes/src/ux_device_class_hid_event_get.c b/common/usbx_device_classes/src/ux_device_class_hid_event_get.c index 8d4308a..61a8350 100644 --- a/common/usbx_device_classes/src/ux_device_class_hid_event_get.c +++ b/common/usbx_device_classes/src/ux_device_class_hid_event_get.c @@ -121,3 +121,53 @@ UX_SLAVE_DEVICE *device; return(UX_SUCCESS); } + +/**************************************************************************/ +/* */ +/* FUNCTION RELEASE */ +/* */ +/* _uxe_device_class_hid_event_get PORTABLE C */ +/* 6.x */ +/* AUTHOR */ +/* */ +/* Chaoqiong Xiao, Microsoft Corporation */ +/* */ +/* DESCRIPTION */ +/* */ +/* This function checks errors in HID event get function call. */ +/* */ +/* INPUT */ +/* */ +/* hid Pointer to hid instance */ +/* hid_event Pointer to hid event */ +/* */ +/* OUTPUT */ +/* */ +/* None */ +/* */ +/* CALLS */ +/* */ +/* _ux_device_class_hid_event_get Get an HID event */ +/* */ +/* CALLED BY */ +/* */ +/* Application */ +/* */ +/* RELEASE HISTORY */ +/* */ +/* DATE NAME DESCRIPTION */ +/* */ +/* xx-xx-xxxx Chaoqiong Xiao Initial Version 6.x */ +/* */ +/**************************************************************************/ +UINT _uxe_device_class_hid_event_get(UX_SLAVE_CLASS_HID *hid, + UX_SLAVE_CLASS_HID_EVENT *hid_event) +{ + + /* Sanity checks. */ + if ((hid == UX_NULL) || (hid_event == UX_NULL)) + return(UX_INVALID_PARAMETER); + + /* Invoke function to get event. */ + return(_ux_device_class_hid_event_get(hid, hid_event)); +} diff --git a/common/usbx_device_classes/src/ux_device_class_hid_event_set.c b/common/usbx_device_classes/src/ux_device_class_hid_event_set.c index 690d68e..3629d25 100644 --- a/common/usbx_device_classes/src/ux_device_class_hid_event_set.c +++ b/common/usbx_device_classes/src/ux_device_class_hid_event_set.c @@ -176,3 +176,53 @@ UX_SLAVE_CLASS_HID_EVENT *next_hid_event; return(UX_SUCCESS); } + +/**************************************************************************/ +/* */ +/* FUNCTION RELEASE */ +/* */ +/* _uxe_device_class_hid_event_set PORTABLE C */ +/* 6.x */ +/* AUTHOR */ +/* */ +/* Chaoqiong Xiao, Microsoft Corporation */ +/* */ +/* DESCRIPTION */ +/* */ +/* This function checks errors in HID event set function call. */ +/* */ +/* INPUT */ +/* */ +/* hid Pointer to hid instance */ +/* hid_event Pointer to hid event */ +/* */ +/* OUTPUT */ +/* */ +/* None */ +/* */ +/* CALLS */ +/* */ +/* _ux_device_class_hid_event_set Set an HID event */ +/* */ +/* CALLED BY */ +/* */ +/* Application */ +/* */ +/* RELEASE HISTORY */ +/* */ +/* DATE NAME DESCRIPTION */ +/* */ +/* xx-xx-xxxx Chaoqiong Xiao Initial Version 6.x */ +/* */ +/**************************************************************************/ +UINT _uxe_device_class_hid_event_set(UX_SLAVE_CLASS_HID *hid, + UX_SLAVE_CLASS_HID_EVENT *hid_event) +{ + + /* Sanity checks. */ + if ((hid == UX_NULL) || (hid_event == UX_NULL)) + return(UX_INVALID_PARAMETER); + + /* Invoke function to get event. */ + return(_ux_device_class_hid_event_set(hid, hid_event)); +} diff --git a/common/usbx_device_classes/src/ux_device_class_hid_initialize.c b/common/usbx_device_classes/src/ux_device_class_hid_initialize.c index 74fc89b..d2e2ab4 100644 --- a/common/usbx_device_classes/src/ux_device_class_hid_initialize.c +++ b/common/usbx_device_classes/src/ux_device_class_hid_initialize.c @@ -33,7 +33,7 @@ /* FUNCTION RELEASE */ /* */ /* _ux_device_class_hid_initialize PORTABLE C */ -/* 6.2.0 */ +/* 6.x */ /* AUTHOR */ /* */ /* Chaoqiong Xiao, Microsoft Corporation */ @@ -88,6 +88,9 @@ /* 10-31-2022 Chaoqiong Xiao Modified comment(s), */ /* fixed compile warnings, */ /* resulting in version 6.2.0 */ +/* xx-xx-xxxx Chaoqiong Xiao Modified comment(s), */ +/* checked compile options, */ +/* resulting in version 6.x */ /* */ /**************************************************************************/ UINT _ux_device_class_hid_initialize(UX_SLAVE_CLASS_COMMAND *command) @@ -99,6 +102,11 @@ UX_SLAVE_CLASS *class_ptr; UINT status = UX_SUCCESS; + /* Compile option checks. */ + UX_ASSERT(UX_DEVICE_CLASS_HID_EVENT_BUFFER_LENGTH <= UX_SLAVE_REQUEST_CONTROL_MAX_LENGTH); + UX_ASSERT(UX_DEVICE_CLASS_HID_EVENT_BUFFER_LENGTH <= UX_SLAVE_REQUEST_DATA_MAX_LENGTH); + + /* Get the class container. */ class_ptr = command -> ux_slave_class_command_class_ptr; @@ -269,3 +277,60 @@ UINT status = UX_SUCCESS; return(status); } + +/**************************************************************************/ +/* */ +/* FUNCTION RELEASE */ +/* */ +/* _uxe_device_class_hid_initialize PORTABLE C */ +/* 6.x */ +/* AUTHOR */ +/* */ +/* Chaoqiong Xiao, Microsoft Corporation */ +/* */ +/* DESCRIPTION */ +/* */ +/* This function checks errors in HID initialize function call. */ +/* */ +/* INPUT */ +/* */ +/* command Pointer to hid command */ +/* */ +/* OUTPUT */ +/* */ +/* None */ +/* */ +/* CALLS */ +/* */ +/* _ux_device_class_hid_initialize Initialize HID instance */ +/* */ +/* CALLED BY */ +/* */ +/* Device Stack */ +/* */ +/* RELEASE HISTORY */ +/* */ +/* DATE NAME DESCRIPTION */ +/* */ +/* xx-xx-xxxx Chaoqiong Xiao Initial Version 6.x */ +/* */ +/**************************************************************************/ +UINT _uxe_device_class_hid_initialize(UX_SLAVE_CLASS_COMMAND *command) +{ + +UX_SLAVE_CLASS_HID_PARAMETER *hid_parameter; + + /* Get the pointer to the application parameters for the hid class. */ + hid_parameter = command -> ux_slave_class_command_parameter; + + /* Check input parameters. */ + if ((hid_parameter -> ux_device_class_hid_parameter_report_address == UX_NULL) || + (hid_parameter -> ux_device_class_hid_parameter_report_length == 0) || + (hid_parameter -> ux_device_class_hid_parameter_report_length > UX_SLAVE_REQUEST_CONTROL_MAX_LENGTH)) + { + return(UX_INVALID_PARAMETER); + } + + /* Invoke initialize function. */ + return(_ux_device_class_hid_initialize(command)); +} diff --git a/common/usbx_device_classes/src/ux_device_class_hid_read.c b/common/usbx_device_classes/src/ux_device_class_hid_read.c index b847a1f..80039dc 100644 --- a/common/usbx_device_classes/src/ux_device_class_hid_read.c +++ b/common/usbx_device_classes/src/ux_device_class_hid_read.c @@ -212,4 +212,61 @@ ULONG local_requested_length; return(status); #endif } + + +/**************************************************************************/ +/* */ +/* FUNCTION RELEASE */ +/* */ +/* _uxe_device_class_hid_read PORTABLE C */ +/* 6.x */ +/* AUTHOR */ +/* */ +/* Chaoqiong Xiao, Microsoft Corporation */ +/* */ +/* DESCRIPTION */ +/* */ +/* This function checks errors in HID read function call. */ +/* */ +/* INPUT */ +/* */ +/* hid Pointer to hid instance */ +/* buffer Pointer to receive buffer */ +/* requested_length Receive buffer size in bytes */ +/* actual_length Actual num bytes received */ +/* */ +/* OUTPUT */ +/* */ +/* None */ +/* */ +/* CALLS */ +/* */ +/* _ux_device_class_hid_read Read data */ +/* */ +/* CALLED BY */ +/* */ +/* Application */ +/* */ +/* RELEASE HISTORY */ +/* */ +/* DATE NAME DESCRIPTION */ +/* */ +/* xx-xx-xxxx Chaoqiong Xiao Initial Version 6.x */ +/* */ +/**************************************************************************/ +UINT _uxe_device_class_hid_read(UX_SLAVE_CLASS_HID *hid, UCHAR *buffer, + ULONG requested_length, ULONG *actual_length) +{ + + /* Sanity checks. */ + if ((hid == UX_NULL) || + (buffer == UX_NULL) || (requested_length == 0) || + (actual_length == UX_NULL)) + { + return(UX_INVALID_PARAMETER); + } + + /* Invoke function to read data. */ + return(_ux_device_class_hid_read(hid, buffer, requested_length, actual_length)); +} #endif diff --git a/common/usbx_device_classes/src/ux_device_class_hid_read_run.c b/common/usbx_device_classes/src/ux_device_class_hid_read_run.c index d0ace70..9dca780 100644 --- a/common/usbx_device_classes/src/ux_device_class_hid_read_run.c +++ b/common/usbx_device_classes/src/ux_device_class_hid_read_run.c @@ -252,4 +252,61 @@ UINT status= UX_SUCCESS; return(UX_STATE_EXIT); #endif } + + +/**************************************************************************/ +/* */ +/* FUNCTION RELEASE */ +/* */ +/* _uxe_device_class_hid_read_run PORTABLE C */ +/* 6.x */ +/* AUTHOR */ +/* */ +/* Chaoqiong Xiao, Microsoft Corporation */ +/* */ +/* DESCRIPTION */ +/* */ +/* This function checks errors in HID read function call. */ +/* */ +/* INPUT */ +/* */ +/* hid Pointer to hid instance */ +/* buffer Pointer to receive buffer */ +/* requested_length Receive buffer size in bytes */ +/* actual_length Actual num bytes received */ +/* */ +/* OUTPUT */ +/* */ +/* None */ +/* */ +/* CALLS */ +/* */ +/* _ux_device_class_hid_read_run Run read state machine once */ +/* */ +/* CALLED BY */ +/* */ +/* Application */ +/* */ +/* RELEASE HISTORY */ +/* */ +/* DATE NAME DESCRIPTION */ +/* */ +/* xx-xx-xxxx Chaoqiong Xiao Initial Version 6.x */ +/* */ +/**************************************************************************/ +UINT _uxe_device_class_hid_read_run(UX_SLAVE_CLASS_HID *hid, UCHAR *buffer, + ULONG requested_length, ULONG *actual_length) +{ + + /* Sanity checks. */ + if ((hid == UX_NULL) || + (buffer == UX_NULL) || (requested_length == 0) || + (actual_length == UX_NULL)) + { + return(UX_STATE_ERROR); + } + + /* Invoke function to run reading state machine. */ + return(_ux_device_class_hid_read_run(hid, buffer, requested_length, actual_length)); +} #endif diff --git a/common/usbx_device_classes/src/ux_device_class_hid_receiver_event_free.c b/common/usbx_device_classes/src/ux_device_class_hid_receiver_event_free.c index c2f21c9..78b8504 100644 --- a/common/usbx_device_classes/src/ux_device_class_hid_receiver_event_free.c +++ b/common/usbx_device_classes/src/ux_device_class_hid_receiver_event_free.c @@ -109,3 +109,53 @@ UCHAR *next_pos; return(UX_SUCCESS); #endif } + + +/**************************************************************************/ +/* */ +/* FUNCTION RELEASE */ +/* */ +/* _uxe_device_class_hid_receiver_event_free PORTABLE C */ +/* 6.x */ +/* AUTHOR */ +/* */ +/* Chaoqiong Xiao, Microsoft Corporation */ +/* */ +/* DESCRIPTION */ +/* */ +/* This function checks errors in HID event free function call. */ +/* */ +/* INPUT */ +/* */ +/* hid Pointer to hid instance */ +/* */ +/* OUTPUT */ +/* */ +/* None */ +/* */ +/* CALLS */ +/* */ +/* _ux_device_class_hid_receiver_event_free */ +/* Free a receiver event */ +/* */ +/* CALLED BY */ +/* */ +/* Application */ +/* */ +/* RELEASE HISTORY */ +/* */ +/* DATE NAME DESCRIPTION */ +/* */ +/* xx-xx-xxxx Chaoqiong Xiao Initial Version 6.x */ +/* */ +/**************************************************************************/ +UINT _uxe_device_class_hid_receiver_event_free(UX_SLAVE_CLASS_HID *hid) +{ + + /* Sanity check. */ + if (hid == UX_NULL) + return(UX_INVALID_PARAMETER); + + /* Invoke function to free HID event. */ + return(_ux_device_class_hid_receiver_event_free(hid)); +} diff --git a/common/usbx_device_classes/src/ux_device_class_hid_receiver_event_get.c b/common/usbx_device_classes/src/ux_device_class_hid_receiver_event_get.c index dde2a41..41334c3 100644 --- a/common/usbx_device_classes/src/ux_device_class_hid_receiver_event_get.c +++ b/common/usbx_device_classes/src/ux_device_class_hid_receiver_event_get.c @@ -109,3 +109,55 @@ UX_DEVICE_CLASS_HID_RECEIVED_EVENT *pos; return(UX_ERROR); #endif } + + +/**************************************************************************/ +/* */ +/* FUNCTION RELEASE */ +/* */ +/* _uxe_device_class_hid_receiver_event_get PORTABLE C */ +/* 6.x */ +/* AUTHOR */ +/* */ +/* Chaoqiong Xiao, Microsoft Corporation */ +/* */ +/* DESCRIPTION */ +/* */ +/* This function checks errors in HID event get function call. */ +/* */ +/* INPUT */ +/* */ +/* hid Pointer to hid instance */ +/* event Pointer of the event */ +/* */ +/* OUTPUT */ +/* */ +/* None */ +/* */ +/* CALLS */ +/* */ +/* _ux_device_class_hid_receiver_event_get */ +/* Get a receiver event */ +/* */ +/* CALLED BY */ +/* */ +/* Application */ +/* */ +/* RELEASE HISTORY */ +/* */ +/* DATE NAME DESCRIPTION */ +/* */ +/* xx-xx-xxxx Chaoqiong Xiao Initial Version 6.x */ +/* */ +/**************************************************************************/ +UINT _uxe_device_class_hid_receiver_event_get(UX_SLAVE_CLASS_HID *hid, + UX_DEVICE_CLASS_HID_RECEIVED_EVENT *event) +{ + + /* Sanity check. */ + if ((hid == UX_NULL) || (event == UX_NULL)) + return(UX_INVALID_PARAMETER); + + /* Invoke function to free HID event. */ + return(_ux_device_class_hid_receiver_event_get(hid, event)); +} diff --git a/common/usbx_device_classes/src/ux_device_class_hid_report_get.c b/common/usbx_device_classes/src/ux_device_class_hid_report_get.c index 44d9910..d08fa7a 100644 --- a/common/usbx_device_classes/src/ux_device_class_hid_report_get.c +++ b/common/usbx_device_classes/src/ux_device_class_hid_report_get.c @@ -35,7 +35,7 @@ /* FUNCTION RELEASE */ /* */ /* _ux_device_class_hid_report_get PORTABLE C */ -/* 6.1 */ +/* 6.x */ /* AUTHOR */ /* */ /* Chaoqiong Xiao, Microsoft Corporation */ @@ -46,6 +46,7 @@ /* */ /* INPUT */ /* */ +/* hid Pointer to hid instance */ /* descriptor_type Descriptor type */ /* descriptor_index Index of descriptor */ /* host_length Length requested by host */ @@ -63,8 +64,7 @@ /* */ /* CALLED BY */ /* */ -/* Application */ -/* Device Stack */ +/* Device HID */ /* */ /* RELEASE HISTORY */ /* */ @@ -75,6 +75,8 @@ /* verified memset and memcpy */ /* cases, */ /* resulting in version 6.1 */ +/* xx-xx-xxxx Chaoqiong Xiao Modified comment(s), */ +/* resulting in version 6.x */ /* */ /**************************************************************************/ UINT _ux_device_class_hid_report_get(UX_SLAVE_CLASS_HID *hid, ULONG descriptor_type, @@ -175,4 +177,3 @@ UINT status = UX_ERROR; /* Return the status to the caller. */ return(status); } - diff --git a/common/usbx_device_classes/src/ux_device_class_hid_report_set.c b/common/usbx_device_classes/src/ux_device_class_hid_report_set.c index 41b1373..10b9e44 100644 --- a/common/usbx_device_classes/src/ux_device_class_hid_report_set.c +++ b/common/usbx_device_classes/src/ux_device_class_hid_report_set.c @@ -35,7 +35,7 @@ /* FUNCTION RELEASE */ /* */ /* _ux_device_class_hid_report_set PORTABLE C */ -/* 6.1 */ +/* 6.x */ /* AUTHOR */ /* */ /* Chaoqiong Xiao, Microsoft Corporation */ @@ -47,6 +47,7 @@ /* */ /* INPUT */ /* */ +/* hid Pointer to hid instance */ /* descriptor_type Descriptor type */ /* descriptor_index Index of descriptor */ /* host_length Length requested by host */ @@ -61,8 +62,7 @@ /* */ /* CALLED BY */ /* */ -/* Application */ -/* Device Stack */ +/* Device HID */ /* */ /* RELEASE HISTORY */ /* */ @@ -73,6 +73,8 @@ /* verified memset and memcpy */ /* cases, */ /* resulting in version 6.1 */ +/* xx-xx-xxxx Chaoqiong Xiao Modified comment(s), */ +/* resulting in version 6.x */ /* */ /**************************************************************************/ UINT _ux_device_class_hid_report_set(UX_SLAVE_CLASS_HID *hid, ULONG descriptor_type, @@ -147,4 +149,3 @@ UCHAR *hid_buffer; /* Return the status to the caller. */ return(UX_SUCCESS); } - diff --git a/common/usbx_device_classes/src/ux_device_class_printer_read.c b/common/usbx_device_classes/src/ux_device_class_printer_read.c index 72297bd..2e51010 100644 --- a/common/usbx_device_classes/src/ux_device_class_printer_read.c +++ b/common/usbx_device_classes/src/ux_device_class_printer_read.c @@ -207,7 +207,7 @@ ULONG local_requested_length; /* FUNCTION RELEASE */ /* */ /* _uxe_device_class_printer_read PORTABLE C */ -/* 6.2.1 */ +/* 6.x */ /* AUTHOR */ /* */ /* Yajun Xia, Microsoft Corporation */ @@ -243,6 +243,9 @@ ULONG local_requested_length; /* DATE NAME DESCRIPTION */ /* */ /* 03-08-2023 Yajun Xia Initial Version 6.2.1 */ +/* xx-xx-xxxx Yajun Xia Modified comment(s), */ +/* fixed error checking issue, */ +/* resulting in version 6.x */ /* */ /**************************************************************************/ UINT _uxe_device_class_printer_read(UX_DEVICE_CLASS_PRINTER *printer, UCHAR *buffer, @@ -250,7 +253,7 @@ UINT _uxe_device_class_printer_read(UX_DEVICE_CLASS_PRINTER *printer, UCHAR *buf { /* Sanity checks. */ - if ((printer == UX_NULL) || (buffer == UX_NULL) || (actual_length == UX_NULL)) + if ((printer == UX_NULL) || ((buffer == UX_NULL) && (requested_length > 0)) || (actual_length == UX_NULL)) { return (UX_INVALID_PARAMETER); } diff --git a/common/usbx_device_classes/src/ux_device_class_printer_read_run.c b/common/usbx_device_classes/src/ux_device_class_printer_read_run.c index acfb390..db7499b 100644 --- a/common/usbx_device_classes/src/ux_device_class_printer_read_run.c +++ b/common/usbx_device_classes/src/ux_device_class_printer_read_run.c @@ -235,4 +235,66 @@ UINT status = UX_SUCCESS; return(UX_STATE_EXIT); } +/**************************************************************************/ +/* */ +/* FUNCTION RELEASE */ +/* */ +/* _uxe_device_class_printer_read_run PORTABLE C */ +/* 6.x */ +/* AUTHOR */ +/* */ +/* Yajun Xia, Microsoft Corporation */ +/* */ +/* DESCRIPTION */ +/* */ +/* This function checks errors in printer read function call. */ +/* */ +/* It's for standalone mode. */ +/* */ +/* INPUT */ +/* */ +/* printer Address of printer class */ +/* instance */ +/* buffer Pointer to buffer to save */ +/* received data */ +/* requested_length Length of bytes to read */ +/* actual_length Pointer to save number of */ +/* bytes read */ +/* */ +/* OUTPUT */ +/* */ +/* State machine Status to check */ +/* UX_STATE_NEXT Transfer done, to next state */ +/* UX_STATE_EXIT Abnormal, to reset state */ +/* UX_STATE_ERROR Error occurred */ +/* (others) Keep running, waiting */ +/* */ +/* CALLS */ +/* */ +/* _ux_device_class_printer_read_run Printer class read process */ +/* */ +/* CALLED BY */ +/* */ +/* Application */ +/* */ +/* RELEASE HISTORY */ +/* */ +/* DATE NAME DESCRIPTION */ +/* */ +/* xx-xx-xxxx Yajun xia Initial Version 6.x */ +/* */ +/**************************************************************************/ +UINT _uxe_device_class_printer_read_run(UX_DEVICE_CLASS_PRINTER *printer, UCHAR *buffer, + ULONG requested_length, ULONG *actual_length) +{ + + /* Sanity checks. */ + if ((printer == UX_NULL) || ((buffer == UX_NULL) && (requested_length > 0)) || (actual_length == UX_NULL)) + { + return (UX_STATE_ERROR); + } + + return(_ux_device_class_printer_read_run(printer, buffer, requested_length, actual_length)); +} + #endif diff --git a/common/usbx_device_classes/src/ux_device_class_printer_write.c b/common/usbx_device_classes/src/ux_device_class_printer_write.c index b04266e..924be2a 100644 --- a/common/usbx_device_classes/src/ux_device_class_printer_write.c +++ b/common/usbx_device_classes/src/ux_device_class_printer_write.c @@ -231,7 +231,7 @@ UINT status = 0; /* FUNCTION RELEASE */ /* */ /* _uxe_device_class_printer_write PORTABLE C */ -/* 6.2.1 */ +/* 6.x */ /* AUTHOR */ /* */ /* Yajun Xia, Microsoft Corporation */ @@ -267,6 +267,9 @@ UINT status = 0; /* DATE NAME DESCRIPTION */ /* */ /* 03-08-2023 Yajun Xia Initial Version 6.2.1 */ +/* xx-xx-xxxx Yajun Xia Modified comment(s), */ +/* fixed error checking issue, */ +/* resulting in version 6.x */ /* */ /**************************************************************************/ UINT _uxe_device_class_printer_write(UX_DEVICE_CLASS_PRINTER *printer, UCHAR *buffer, @@ -274,7 +277,7 @@ UINT _uxe_device_class_printer_write(UX_DEVICE_CLASS_PRINTER *printer, UCHAR *bu { /* Sanity checks. */ - if ((printer == UX_NULL) || (buffer == UX_NULL) || (actual_length == UX_NULL)) + if ((printer == UX_NULL) || ((buffer == UX_NULL) && (requested_length > 0)) || (actual_length == UX_NULL)) { return (UX_INVALID_PARAMETER); } diff --git a/common/usbx_device_classes/src/ux_device_class_printer_write_run.c b/common/usbx_device_classes/src/ux_device_class_printer_write_run.c index d078cd4..9e740c4 100644 --- a/common/usbx_device_classes/src/ux_device_class_printer_write_run.c +++ b/common/usbx_device_classes/src/ux_device_class_printer_write_run.c @@ -255,4 +255,66 @@ UINT status = 0; return(UX_STATE_EXIT); } +/**************************************************************************/ +/* */ +/* FUNCTION RELEASE */ +/* */ +/* _uxe_device_class_printer_write_run PORTABLE C */ +/* 6.x */ +/* AUTHOR */ +/* */ +/* Yajun Xia, Microsoft Corporation */ +/* */ +/* DESCRIPTION */ +/* */ +/* This function checks errors in printer write function call. */ +/* */ +/* It's for standalone mode. */ +/* */ +/* INPUT */ +/* */ +/* printer Address of printer class */ +/* instance */ +/* buffer Pointer to data to write */ +/* requested_length Length of bytes to write, */ +/* set to 0 to issue ZLP */ +/* actual_length Pointer to save number of */ +/* bytes written */ +/* */ +/* OUTPUT */ +/* */ +/* State machine Status to check */ +/* UX_STATE_NEXT Transfer done, to next state */ +/* UX_STATE_EXIT Abnormal, to reset state */ +/* UX_STATE_ERROR Error occurred */ +/* (others) Keep running, waiting */ +/* */ +/* CALLS */ +/* */ +/* _ux_device_class_printer_write_run Printer class write process */ +/* */ +/* CALLED BY */ +/* */ +/* Application */ +/* */ +/* RELEASE HISTORY */ +/* */ +/* DATE NAME DESCRIPTION */ +/* */ +/* xx-xx-xxxx Yajun xia Initial Version 6.x */ +/* */ +/**************************************************************************/ +UINT _uxe_device_class_printer_write_run(UX_DEVICE_CLASS_PRINTER *printer, UCHAR *buffer, + ULONG requested_length, ULONG *actual_length) +{ + + /* Sanity check. */ + if ((printer == UX_NULL) || ((buffer == UX_NULL) && (requested_length > 0)) || (actual_length == UX_NULL)) + { + return (UX_STATE_ERROR); + } + + return(_ux_device_class_printer_write_run(printer, buffer, requested_length, actual_length)); +} + #endif diff --git a/common/usbx_device_classes/src/ux_device_class_rndis_control_request.c b/common/usbx_device_classes/src/ux_device_class_rndis_control_request.c index be0a300..a358e86 100644 --- a/common/usbx_device_classes/src/ux_device_class_rndis_control_request.c +++ b/common/usbx_device_classes/src/ux_device_class_rndis_control_request.c @@ -31,7 +31,8 @@ #if UX_SLAVE_REQUEST_CONTROL_MAX_LENGTH < UX_DEVICE_CLASS_RNDIS_INTERRUPT_RESPONSE_LENGTH ||\ UX_SLAVE_REQUEST_CONTROL_MAX_LENGTH < UX_DEVICE_CLASS_RNDIS_MAX_CONTROL_RESPONSE_LENGTH -#error UX_SLAVE_REQUEST_CONTROL_MAX_LENGTH too small, please check +/* #error UX_SLAVE_REQUEST_CONTROL_MAX_LENGTH too small, please check */ +/* Build option checked runtime by UX_ASSERT */ #endif /**************************************************************************/ @@ -39,7 +40,7 @@ /* FUNCTION RELEASE */ /* */ /* _ux_device_class_rndis_control_request PORTABLE C */ -/* 6.1.12 */ +/* 6.x */ /* AUTHOR */ /* */ /* Chaoqiong Xiao, Microsoft Corporation */ @@ -93,6 +94,10 @@ /* fixed parameter/variable */ /* names conflict C++ keyword, */ /* resulting in version 6.1.12 */ +/* xx-xx-xxxx Chaoqiong Xiao Modified comment(s), */ +/* checked compiling options */ +/* by runtime UX_ASSERT, */ +/* resulting in version 6.x */ /* */ /**************************************************************************/ UINT _ux_device_class_rndis_control_request(UX_SLAVE_CLASS_COMMAND *command) @@ -107,6 +112,12 @@ ULONG rndis_command; UX_SLAVE_CLASS *class_ptr; UX_SLAVE_CLASS_RNDIS *rndis; + /* Build option check. */ + UX_ASSERT((UX_SLAVE_REQUEST_CONTROL_MAX_LENGTH >= + UX_DEVICE_CLASS_RNDIS_INTERRUPT_RESPONSE_LENGTH) && + (UX_SLAVE_REQUEST_CONTROL_MAX_LENGTH >= + UX_DEVICE_CLASS_RNDIS_MAX_CONTROL_RESPONSE_LENGTH)); + /* Get the pointer to the device. */ device = &_ux_system_slave -> ux_system_slave_device; diff --git a/common/usbx_device_classes/src/ux_device_class_rndis_initialize.c b/common/usbx_device_classes/src/ux_device_class_rndis_initialize.c index 18604e8..cd2ccff 100644 --- a/common/usbx_device_classes/src/ux_device_class_rndis_initialize.c +++ b/common/usbx_device_classes/src/ux_device_class_rndis_initialize.c @@ -78,7 +78,7 @@ ULONG ux_device_class_rndis_oid_supported_list[UX_DEVICE_CLASS_RNDIS_OID_SUPPORT /* FUNCTION RELEASE */ /* */ /* _ux_device_class_rndis_initialize PORTABLE C */ -/* 6.2.0 */ +/* 6.x */ /* AUTHOR */ /* */ /* Chaoqiong Xiao, Microsoft Corporation */ @@ -139,6 +139,9 @@ ULONG ux_device_class_rndis_oid_supported_list[UX_DEVICE_CLASS_RNDIS_OID_SUPPORT /* 10-31-2022 Chaoqiong Xiao Modified comment(s), */ /* removed internal NX pool, */ /* resulting in version 6.2.0 */ +/* xx-xx-xxxx Chaoqiong Xiao Modified comment(s), */ +/* checked compile options, */ +/* resulting in version 6.x */ /* */ /**************************************************************************/ UINT _ux_device_class_rndis_initialize(UX_SLAVE_CLASS_COMMAND *command) @@ -153,6 +156,11 @@ UX_SLAVE_CLASS_RNDIS_PARAMETER *rndis_parameter; UX_SLAVE_CLASS *class_ptr; UINT status; + + /* Compile option checks. */ + UX_ASSERT(UX_DEVICE_CLASS_RNDIS_MAX_MSG_LENGTH <= UX_SLAVE_REQUEST_DATA_MAX_LENGTH); + UX_ASSERT(UX_DEVICE_CLASS_RNDIS_MAX_CONTROL_RESPONSE_LENGTH <= UX_SLAVE_REQUEST_CONTROL_MAX_LENGTH); + /* Get the class container. */ class_ptr = command -> ux_slave_class_command_class_ptr; diff --git a/common/usbx_device_classes/src/ux_device_class_storage_csw_send.c b/common/usbx_device_classes/src/ux_device_class_storage_csw_send.c index 6e45e1b..8366314 100644 --- a/common/usbx_device_classes/src/ux_device_class_storage_csw_send.c +++ b/common/usbx_device_classes/src/ux_device_class_storage_csw_send.c @@ -30,7 +30,8 @@ #include "ux_device_stack.h" #if UX_SLAVE_REQUEST_DATA_MAX_LENGTH < UX_SLAVE_CLASS_STORAGE_CSW_LENGTH -#error UX_SLAVE_REQUEST_DATA_MAX_LENGTH too small, please check +/* #error UX_SLAVE_REQUEST_DATA_MAX_LENGTH too small, please check */ +/* Build option checked runtime by UX_ASSERT */ #endif /**************************************************************************/ @@ -38,7 +39,7 @@ /* FUNCTION RELEASE */ /* */ /* _ux_device_class_storage_csw_send PORTABLE C */ -/* 6.1.10 */ +/* 6.x */ /* AUTHOR */ /* */ /* Chaoqiong Xiao, Microsoft Corporation */ @@ -89,6 +90,10 @@ /* 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), */ +/* checked compiling options */ +/* by runtime UX_ASSERT, */ +/* resulting in version 6.x */ /* */ /**************************************************************************/ UINT _ux_device_class_storage_csw_send(UX_SLAVE_CLASS_STORAGE *storage, ULONG lun, @@ -103,6 +108,9 @@ UCHAR *csw_buffer; UX_PARAMETER_NOT_USED(csw_status); UX_PARAMETER_NOT_USED(lun); + /* Build option check. */ + UX_ASSERT(UX_SLAVE_REQUEST_DATA_MAX_LENGTH >= UX_SLAVE_CLASS_STORAGE_CSW_LENGTH); + #if defined(UX_DEVICE_STANDALONE) /* Reset transfer request buffer pointers. */ diff --git a/common/usbx_device_classes/src/ux_device_class_storage_entry.c b/common/usbx_device_classes/src/ux_device_class_storage_entry.c index c030d54..5d00a9d 100644 --- a/common/usbx_device_classes/src/ux_device_class_storage_entry.c +++ b/common/usbx_device_classes/src/ux_device_class_storage_entry.c @@ -35,7 +35,7 @@ /* FUNCTION RELEASE */ /* */ /* _ux_device_class_storage_entry PORTABLE C */ -/* 6.1 */ +/* 6.x */ /* AUTHOR */ /* */ /* Chaoqiong Xiao, Microsoft Corporation */ @@ -75,6 +75,9 @@ /* 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), */ +/* added error checks support, */ +/* resulting in version 6.x */ /* */ /**************************************************************************/ UINT _ux_device_class_storage_entry(UX_SLAVE_CLASS_COMMAND *command) @@ -91,7 +94,11 @@ UINT status; case UX_SLAVE_CLASS_COMMAND_INITIALIZE: /* Call the init function of the Storage class. */ +#if defined(UX_DEVICE_CLASS_STORAGE_ENABLE_ERROR_CHECKING) + status = _uxe_device_class_storage_initialize(command); +#else status = _ux_device_class_storage_initialize(command); +#endif /* Return the completion status. */ return(status); diff --git a/common/usbx_device_classes/src/ux_device_class_storage_get_configuration.c b/common/usbx_device_classes/src/ux_device_class_storage_get_configuration.c index 5593dcc..3ebf4fd 100644 --- a/common/usbx_device_classes/src/ux_device_class_storage_get_configuration.c +++ b/common/usbx_device_classes/src/ux_device_class_storage_get_configuration.c @@ -293,7 +293,8 @@ UCHAR usbx_device_class_storage_configuration_active_profile[] = { #if (UX_SLAVE_REQUEST_DATA_MAX_LENGTH < USBX_DEVICE_CLASS_STORAGE_CONFIGURATION_ACTIVE_PROFILE_LENGTH) ||\ (UX_SLAVE_REQUEST_DATA_MAX_LENGTH < USBX_DEVICE_CLASS_STORAGE_CONFIGURATION_PROFILE_LENGTH) -#error UX_SLAVE_REQUEST_DATA_MAX_LENGTH too small, please check +/* #error UX_SLAVE_REQUEST_DATA_MAX_LENGTH too small, please check */ +/* Build option checked runtime by UX_ASSERT */ #endif @@ -302,7 +303,7 @@ UCHAR usbx_device_class_storage_configuration_active_profile[] = { /* FUNCTION RELEASE */ /* */ /* _ux_device_class_storage_get_configuration PORTABLE C */ -/* 6.1.10 */ +/* 6.x */ /* AUTHOR */ /* */ /* Chaoqiong Xiao, Microsoft Corporation */ @@ -348,6 +349,10 @@ UCHAR usbx_device_class_storage_configuration_active_profile[] = { /* 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), */ +/* checked compiling options */ +/* by runtime UX_ASSERT, */ +/* resulting in version 6.x */ /* */ /**************************************************************************/ UINT _ux_device_class_storage_get_configuration(UX_SLAVE_CLASS_STORAGE *storage, ULONG lun, @@ -366,6 +371,12 @@ ULONG feature; UX_PARAMETER_NOT_USED(endpoint_out); + /* Build option check. */ + UX_ASSERT((UX_SLAVE_REQUEST_DATA_MAX_LENGTH >= + USBX_DEVICE_CLASS_STORAGE_CONFIGURATION_ACTIVE_PROFILE_LENGTH) && + (UX_SLAVE_REQUEST_DATA_MAX_LENGTH >= + USBX_DEVICE_CLASS_STORAGE_CONFIGURATION_PROFILE_LENGTH)); + /* If trace is enabled, insert this event into the trace buffer. */ UX_TRACE_IN_LINE_INSERT(UX_TRACE_DEVICE_CLASS_STORAGE_GET_CONFIGURATION, storage, lun, 0, 0, UX_TRACE_DEVICE_CLASS_EVENTS, 0, 0) diff --git a/common/usbx_device_classes/src/ux_device_class_storage_get_performance.c b/common/usbx_device_classes/src/ux_device_class_storage_get_performance.c index c455845..be84a58 100644 --- a/common/usbx_device_classes/src/ux_device_class_storage_get_performance.c +++ b/common/usbx_device_classes/src/ux_device_class_storage_get_performance.c @@ -31,7 +31,8 @@ #define USBX_DEVICE_CLASS_STORAGE_GET_PERFORMANCE_0_LENGTH 16 #if UX_SLAVE_REQUEST_DATA_MAX_LENGTH < (USBX_DEVICE_CLASS_STORAGE_GET_PERFORMANCE_0_LENGTH + 8) -#error UX_SLAVE_REQUEST_DATA_MAX_LENGTH too small, please check +/* #error UX_SLAVE_REQUEST_DATA_MAX_LENGTH too small, please check */ +/* Build option checked runtime by UX_ASSERT */ #endif UCHAR usbx_device_class_storage_performance[] = { @@ -44,7 +45,7 @@ UCHAR usbx_device_class_storage_performance[] = { /* FUNCTION RELEASE */ /* */ /* _ux_device_class_storage_get_performance PORTABLE C */ -/* 6.1.10 */ +/* 6.x */ /* AUTHOR */ /* */ /* Chaoqiong Xiao, Microsoft Corporation */ @@ -89,6 +90,10 @@ UCHAR usbx_device_class_storage_performance[] = { /* 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), */ +/* checked compiling options */ +/* by runtime UX_ASSERT, */ +/* resulting in version 6.x */ /* */ /**************************************************************************/ UINT _ux_device_class_storage_get_performance(UX_SLAVE_CLASS_STORAGE *storage, @@ -107,6 +112,9 @@ ULONG data_length = 0; UX_PARAMETER_NOT_USED(lun); UX_PARAMETER_NOT_USED(endpoint_out); + /* Build option check. */ + UX_ASSERT(UX_SLAVE_REQUEST_DATA_MAX_LENGTH >= (USBX_DEVICE_CLASS_STORAGE_GET_PERFORMANCE_0_LENGTH + 8)); + /* If trace is enabled, insert this event into the trace buffer. */ UX_TRACE_IN_LINE_INSERT(UX_TRACE_DEVICE_CLASS_STORAGE_OTHER, storage, lun, 0, 0, UX_TRACE_DEVICE_CLASS_EVENTS, 0, 0) diff --git a/common/usbx_device_classes/src/ux_device_class_storage_initialize.c b/common/usbx_device_classes/src/ux_device_class_storage_initialize.c index 9e4b7ae..f799089 100644 --- a/common/usbx_device_classes/src/ux_device_class_storage_initialize.c +++ b/common/usbx_device_classes/src/ux_device_class_storage_initialize.c @@ -223,3 +223,74 @@ ULONG lun_index; return(status); } + +/**************************************************************************/ +/* */ +/* FUNCTION RELEASE */ +/* */ +/* _uxe_device_class_storage_initialize PORTABLE C */ +/* 6.x */ +/* AUTHOR */ +/* */ +/* Chaoqiong Xiao, Microsoft Corporation */ +/* */ +/* DESCRIPTION */ +/* */ +/* This function checks errors in storage initialization function call.*/ +/* */ +/* INPUT */ +/* */ +/* command Pointer to storage command */ +/* */ +/* OUTPUT */ +/* */ +/* Completion Status */ +/* */ +/* CALLS */ +/* */ +/* _ux_device_class_storage_initialize Initialize storage instance */ +/* */ +/* CALLED BY */ +/* */ +/* Application */ +/* */ +/* RELEASE HISTORY */ +/* */ +/* DATE NAME DESCRIPTION */ +/* */ +/* xx-xx-xxxx Chaoqiong Xiao Initial Version 6.x */ +/* */ +/**************************************************************************/ +UINT _uxe_device_class_storage_initialize(UX_SLAVE_CLASS_COMMAND *command) +{ + +UX_SLAVE_CLASS_STORAGE_PARAMETER *storage_parameter; +UINT i; + + /* Get the pointer to the application parameters for the storage class. */ + storage_parameter = command -> ux_slave_class_command_parameter; + + /* Sanity checks. */ + if (storage_parameter -> ux_slave_class_storage_parameter_number_lun > UX_MAX_SLAVE_LUN) + 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]. + ux_slave_class_storage_media_read == UX_NULL) || + (storage_parameter -> ux_slave_class_storage_parameter_lun[i]. + ux_slave_class_storage_media_write == UX_NULL) || + (storage_parameter -> ux_slave_class_storage_parameter_lun[i]. + ux_slave_class_storage_media_status == UX_NULL) +#if defined(UX_SLAVE_CLASS_STORAGE_INCLUDE_MMC) + || (storage_parameter -> ux_slave_class_storage_parameter_lun[i]. + ux_slave_class_storage_media_notification == UX_NULL) +#endif + ) + { + return(UX_INVALID_PARAMETER); + } + } + + /* Invoke storage initialize function. */ + return(_ux_device_class_storage_initialize(command)); +} diff --git a/common/usbx_device_classes/src/ux_device_class_storage_inquiry.c b/common/usbx_device_classes/src/ux_device_class_storage_inquiry.c index d266e67..74784a6 100644 --- a/common/usbx_device_classes/src/ux_device_class_storage_inquiry.c +++ b/common/usbx_device_classes/src/ux_device_class_storage_inquiry.c @@ -31,7 +31,8 @@ #if UX_SLAVE_REQUEST_DATA_MAX_LENGTH < 24 -#error UX_SLAVE_REQUEST_DATA_MAX_LENGTH is too small, please check +/* #error UX_SLAVE_REQUEST_DATA_MAX_LENGTH is too small, please check */ +/* Build option checked runtime by UX_ASSERT */ #endif /**************************************************************************/ @@ -39,7 +40,7 @@ /* FUNCTION RELEASE */ /* */ /* _ux_device_class_storage_inquiry PORTABLE C */ -/* 6.1.12 */ +/* 6.x */ /* AUTHOR */ /* */ /* Chaoqiong Xiao, Microsoft Corporation */ @@ -91,6 +92,10 @@ /* 07-29-2022 Chaoqiong Xiao Modified comment(s), */ /* updated dCSWDataResidue, */ /* resulting in version 6.1.12 */ +/* xx-xx-xxxx Chaoqiong Xiao Modified comment(s), */ +/* checked compiling options */ +/* by runtime UX_ASSERT, */ +/* resulting in version 6.x */ /* */ /**************************************************************************/ UINT _ux_device_class_storage_inquiry(UX_SLAVE_CLASS_STORAGE *storage, ULONG lun, UX_SLAVE_ENDPOINT *endpoint_in, @@ -105,6 +110,9 @@ UCHAR *inquiry_buffer; UX_PARAMETER_NOT_USED(endpoint_out); + /* Build option check. */ + UX_ASSERT(UX_SLAVE_REQUEST_DATA_MAX_LENGTH >= 24); + /* If trace is enabled, insert this event into the trace buffer. */ UX_TRACE_IN_LINE_INSERT(UX_TRACE_DEVICE_CLASS_STORAGE_INQUIRY, storage, lun, 0, 0, UX_TRACE_DEVICE_CLASS_EVENTS, 0, 0) diff --git a/common/usbx_device_classes/src/ux_device_class_storage_mode_sense.c b/common/usbx_device_classes/src/ux_device_class_storage_mode_sense.c index 6f31b43..64ea671 100644 --- a/common/usbx_device_classes/src/ux_device_class_storage_mode_sense.c +++ b/common/usbx_device_classes/src/ux_device_class_storage_mode_sense.c @@ -57,7 +57,8 @@ UCHAR usbx_device_class_storage_mode_sense_page_cdrom[USBX_DEVICE_CLASS_STORAGE_ USBX_DEVICE_CLASS_STORAGE_MODE_SENSE_PAGE_CACHE_LENGTH + \ USBX_DEVICE_CLASS_STORAGE_MODE_SENSE_PAGE_IEC_LENGTH) #if USBX_DEVICE_CLASS_STORAGE_MODE_SENSE_PAGE_ALL_RESPONSE_LENGTH > UX_SLAVE_REQUEST_DATA_MAX_LENGTH -#error "The maximum-sized MODE_SENSE response cannot fit inside the bulk in endpoint's data buffer." +/* #error "The maximum-sized MODE_SENSE response cannot fit inside the bulk in endpoint's data buffer." */ +/* Build option checked runtime by UX_ASSERT */ #endif /**************************************************************************/ @@ -65,7 +66,7 @@ UCHAR usbx_device_class_storage_mode_sense_page_cdrom[USBX_DEVICE_CLASS_STORAGE_ /* FUNCTION RELEASE */ /* */ /* _ux_device_class_storage_mode_sense PORTABLE C */ -/* 6.1.11 */ +/* 6.x */ /* AUTHOR */ /* */ /* Chaoqiong Xiao, Microsoft Corporation */ @@ -115,6 +116,10 @@ UCHAR usbx_device_class_storage_mode_sense_page_cdrom[USBX_DEVICE_CLASS_STORAGE_ /* 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), */ +/* checked compiling options */ +/* by runtime UX_ASSERT, */ +/* resulting in version 6.x */ /* */ /**************************************************************************/ UINT _ux_device_class_storage_mode_sense(UX_SLAVE_CLASS_STORAGE *storage, @@ -139,6 +144,9 @@ ULONG page_length; UX_PARAMETER_NOT_USED(endpoint_out); + /* Build option check. */ + UX_ASSERT(USBX_DEVICE_CLASS_STORAGE_MODE_SENSE_PAGE_ALL_RESPONSE_LENGTH <= UX_SLAVE_REQUEST_DATA_MAX_LENGTH); + /* If trace is enabled, insert this event into the trace buffer. */ UX_TRACE_IN_LINE_INSERT(UX_TRACE_DEVICE_CLASS_STORAGE_MODE_SENSE, storage, lun, 0, 0, UX_TRACE_DEVICE_CLASS_EVENTS, 0, 0) diff --git a/common/usbx_device_classes/src/ux_device_class_storage_read_capacity.c b/common/usbx_device_classes/src/ux_device_class_storage_read_capacity.c index 916b64e..528e496 100644 --- a/common/usbx_device_classes/src/ux_device_class_storage_read_capacity.c +++ b/common/usbx_device_classes/src/ux_device_class_storage_read_capacity.c @@ -31,7 +31,8 @@ #if UX_SLAVE_REQUEST_DATA_MAX_LENGTH < UX_SLAVE_CLASS_STORAGE_READ_CAPACITY_RESPONSE_LENGTH -#error UX_SLAVE_REQUEST_DATA_MAX_LENGTH is too small, please check +/* #error UX_SLAVE_REQUEST_DATA_MAX_LENGTH is too small, please check */ +/* Build option checked runtime by UX_ASSERT */ #endif /**************************************************************************/ @@ -39,7 +40,7 @@ /* FUNCTION RELEASE */ /* */ /* _ux_device_class_storage_read_capacity PORTABLE C */ -/* 6.1.10 */ +/* 6.x */ /* AUTHOR */ /* */ /* Chaoqiong Xiao, Microsoft Corporation */ @@ -85,6 +86,10 @@ /* 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), */ +/* checked compiling options */ +/* by runtime UX_ASSERT, */ +/* resulting in version 6.x */ /* */ /**************************************************************************/ UINT _ux_device_class_storage_read_capacity(UX_SLAVE_CLASS_STORAGE *storage, ULONG lun, @@ -100,6 +105,9 @@ UCHAR *read_capacity_buffer; UX_PARAMETER_NOT_USED(cbwcb); UX_PARAMETER_NOT_USED(endpoint_out); + /* Build option check. */ + UX_ASSERT(UX_SLAVE_REQUEST_DATA_MAX_LENGTH >= UX_SLAVE_CLASS_STORAGE_READ_CAPACITY_RESPONSE_LENGTH); + /* If trace is enabled, insert this event into the trace buffer. */ UX_TRACE_IN_LINE_INSERT(UX_TRACE_DEVICE_CLASS_STORAGE_READ_CAPACITY, storage, lun, 0, 0, UX_TRACE_DEVICE_CLASS_EVENTS, 0, 0) diff --git a/common/usbx_device_classes/src/ux_device_class_storage_read_disk_information.c b/common/usbx_device_classes/src/ux_device_class_storage_read_disk_information.c index a34d22e..f5029c6 100644 --- a/common/usbx_device_classes/src/ux_device_class_storage_read_disk_information.c +++ b/common/usbx_device_classes/src/ux_device_class_storage_read_disk_information.c @@ -31,7 +31,8 @@ #define USBX_DEVICE_CLASS_STORAGE_DISK_INFORMATION_LENGTH 34 #if UX_SLAVE_REQUEST_DATA_MAX_LENGTH < USBX_DEVICE_CLASS_STORAGE_DISK_INFORMATION_LENGTH -#error UX_SLAVE_REQUEST_DATA_MAX_LENGTH is too small, please check +/* #error UX_SLAVE_REQUEST_DATA_MAX_LENGTH is too small, please check */ +/* Build option checked runtime by UX_ASSERT */ #endif UCHAR usbx_device_class_storage_disk_information[] = { @@ -64,7 +65,7 @@ UCHAR usbx_device_class_storage_disk_information[] = { /* FUNCTION RELEASE */ /* */ /* _ux_device_class_storage_read_disk_information PORTABLE C */ -/* 6.1.10 */ +/* 6.x */ /* AUTHOR */ /* */ /* Chaoqiong Xiao, Microsoft Corporation */ @@ -108,6 +109,10 @@ UCHAR usbx_device_class_storage_disk_information[] = { /* 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), */ +/* checked compiling options */ +/* by runtime UX_ASSERT, */ +/* resulting in version 6.x */ /* */ /**************************************************************************/ UINT _ux_device_class_storage_read_disk_information(UX_SLAVE_CLASS_STORAGE *storage, ULONG lun, @@ -121,6 +126,9 @@ ULONG allocation_length; UX_PARAMETER_NOT_USED(endpoint_out); + /* Build option check. */ + UX_ASSERT(UX_SLAVE_REQUEST_DATA_MAX_LENGTH >= USBX_DEVICE_CLASS_STORAGE_DISK_INFORMATION_LENGTH); + /* If trace is enabled, insert this event into the trace buffer. */ UX_TRACE_IN_LINE_INSERT(UX_TRACE_DEVICE_CLASS_STORAGE_GET_CONFIGURATION, storage, lun, 0, 0, UX_TRACE_DEVICE_CLASS_EVENTS, 0, 0) diff --git a/common/usbx_device_classes/src/ux_device_class_storage_read_format_capacity.c b/common/usbx_device_classes/src/ux_device_class_storage_read_format_capacity.c index 5a0d283..795778b 100644 --- a/common/usbx_device_classes/src/ux_device_class_storage_read_format_capacity.c +++ b/common/usbx_device_classes/src/ux_device_class_storage_read_format_capacity.c @@ -31,7 +31,8 @@ #if UX_SLAVE_CLASS_STORAGE_BUFFER_SIZE < UX_SLAVE_CLASS_STORAGE_READ_FORMAT_CAPACITY_RESPONSE_LENGTH -#error UX_SLAVE_CLASS_STORAGE_BUFFER_SIZE too small, please check +/* #error UX_SLAVE_CLASS_STORAGE_BUFFER_SIZE too small, please check */ +/* Build option checked runtime by UX_ASSERT */ #endif /**************************************************************************/ @@ -39,7 +40,7 @@ /* FUNCTION RELEASE */ /* */ /* _ux_device_class_storage_read_format_capacity PORTABLE C */ -/* 6.1.10 */ +/* 6.x */ /* AUTHOR */ /* */ /* Chaoqiong Xiao, Microsoft Corporation */ @@ -84,6 +85,10 @@ /* 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), */ +/* checked compiling options */ +/* by runtime UX_ASSERT, */ +/* resulting in version 6.x */ /* */ /**************************************************************************/ UINT _ux_device_class_storage_read_format_capacity(UX_SLAVE_CLASS_STORAGE *storage, ULONG lun, @@ -98,6 +103,9 @@ UCHAR *read_format_capacity_buffer; UX_PARAMETER_NOT_USED(cbwcb); UX_PARAMETER_NOT_USED(endpoint_out); + /* Build option check. */ + UX_ASSERT(UX_SLAVE_CLASS_STORAGE_BUFFER_SIZE >= UX_SLAVE_CLASS_STORAGE_READ_FORMAT_CAPACITY_RESPONSE_LENGTH); + /* If trace is enabled, insert this event into the trace buffer. */ UX_TRACE_IN_LINE_INSERT(UX_TRACE_DEVICE_CLASS_STORAGE_READ_FORMAT_CAPACITY, storage, lun, 0, 0, UX_TRACE_DEVICE_CLASS_EVENTS, 0, 0) diff --git a/common/usbx_device_classes/src/ux_device_class_storage_read_toc.c b/common/usbx_device_classes/src/ux_device_class_storage_read_toc.c index 85c7a70..5f5a390 100644 --- a/common/usbx_device_classes/src/ux_device_class_storage_read_toc.c +++ b/common/usbx_device_classes/src/ux_device_class_storage_read_toc.c @@ -31,7 +31,8 @@ #if UX_SLAVE_CLASS_STORAGE_BUFFER_SIZE < 20 -#error UX_SLAVE_CLASS_STORAGE_BUFFER_SIZE too small, please check +/* #error UX_SLAVE_CLASS_STORAGE_BUFFER_SIZE too small, please check */ +/* Build option checked runtime by UX_ASSERT */ #endif /**************************************************************************/ @@ -39,7 +40,7 @@ /* FUNCTION RELEASE */ /* */ /* _ux_device_class_storage_read_toc PORTABLE C */ -/* 6.1.10 */ +/* 6.x */ /* AUTHOR */ /* */ /* Chaoqiong Xiao, Microsoft Corporation */ @@ -85,6 +86,10 @@ /* 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), */ +/* checked compiling options */ +/* by runtime UX_ASSERT, */ +/* resulting in version 6.x */ /* */ /**************************************************************************/ UINT _ux_device_class_storage_read_toc(UX_SLAVE_CLASS_STORAGE *storage, ULONG lun, @@ -102,6 +107,9 @@ UCHAR *toc_buffer; UX_PARAMETER_NOT_USED(lun); UX_PARAMETER_NOT_USED(endpoint_out); + /* Build option check. */ + UX_ASSERT(UX_SLAVE_CLASS_STORAGE_BUFFER_SIZE >= 20); + /* If trace is enabled, insert this event into the trace buffer. */ UX_TRACE_IN_LINE_INSERT(UX_TRACE_DEVICE_CLASS_STORAGE_READ_TOC, storage, lun, 0, 0, UX_TRACE_DEVICE_CLASS_EVENTS, 0, 0) diff --git a/common/usbx_device_classes/src/ux_device_class_storage_report_key.c b/common/usbx_device_classes/src/ux_device_class_storage_report_key.c index 65b93c6..3478e6c 100644 --- a/common/usbx_device_classes/src/ux_device_class_storage_report_key.c +++ b/common/usbx_device_classes/src/ux_device_class_storage_report_key.c @@ -31,7 +31,8 @@ #if UX_SLAVE_REQUEST_DATA_MAX_LENGTH < UX_SLAVE_CLASS_STORAGE_REPORT_KEY_ANSWER_LENGTH -#error UX_SLAVE_REQUEST_DATA_MAX_LENGTH too small, please check +/* #error UX_SLAVE_REQUEST_DATA_MAX_LENGTH too small, please check */ +/* Build option checked runtime by UX_ASSERT */ #endif /**************************************************************************/ @@ -39,7 +40,7 @@ /* FUNCTION RELEASE */ /* */ /* _ux_device_class_storage_report_key PORTABLE C */ -/* 6.1.10 */ +/* 6.x */ /* AUTHOR */ /* */ /* Chaoqiong Xiao, Microsoft Corporation */ @@ -85,6 +86,10 @@ /* 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), */ +/* checked compiling options */ +/* by runtime UX_ASSERT, */ +/* resulting in version 6.x */ /* */ /**************************************************************************/ UINT _ux_device_class_storage_report_key(UX_SLAVE_CLASS_STORAGE *storage, @@ -103,6 +108,9 @@ ULONG key_format; UX_PARAMETER_NOT_USED(lun); UX_PARAMETER_NOT_USED(endpoint_out); + /* Build option check. */ + UX_ASSERT(UX_SLAVE_REQUEST_DATA_MAX_LENGTH >= UX_SLAVE_CLASS_STORAGE_REPORT_KEY_ANSWER_LENGTH); + /* If trace is enabled, insert this event into the trace buffer. */ UX_TRACE_IN_LINE_INSERT(UX_TRACE_DEVICE_CLASS_STORAGE_OTHER, storage, lun, 0, 0, UX_TRACE_DEVICE_CLASS_EVENTS, 0, 0) diff --git a/common/usbx_device_classes/src/ux_device_class_storage_request_sense.c b/common/usbx_device_classes/src/ux_device_class_storage_request_sense.c index 5411428..c1536d5 100644 --- a/common/usbx_device_classes/src/ux_device_class_storage_request_sense.c +++ b/common/usbx_device_classes/src/ux_device_class_storage_request_sense.c @@ -31,7 +31,8 @@ #if UX_SLAVE_CLASS_STORAGE_BUFFER_SIZE < UX_SLAVE_CLASS_STORAGE_REQUEST_SENSE_RESPONSE_LENGTH -#error UX_SLAVE_CLASS_STORAGE_BUFFER_SIZE too small, please check +/* #error UX_SLAVE_CLASS_STORAGE_BUFFER_SIZE too small, please check */ +/* Build option checked runtime by UX_ASSERT */ #endif /**************************************************************************/ @@ -39,7 +40,7 @@ /* FUNCTION RELEASE */ /* */ /* _ux_device_class_storage_request_sense PORTABLE C */ -/* 6.1.10 */ +/* 6.x */ /* AUTHOR */ /* */ /* Chaoqiong Xiao, Microsoft Corporation */ @@ -86,6 +87,10 @@ /* 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), */ +/* checked compiling options */ +/* by runtime UX_ASSERT, */ +/* resulting in version 6.x */ /* */ /**************************************************************************/ UINT _ux_device_class_storage_request_sense(UX_SLAVE_CLASS_STORAGE *storage, ULONG lun, UX_SLAVE_ENDPOINT *endpoint_in, @@ -102,6 +107,9 @@ ULONG sense_length; UX_PARAMETER_NOT_USED(cbwcb); UX_PARAMETER_NOT_USED(endpoint_out); + /* Build option check. */ + UX_ASSERT(UX_SLAVE_CLASS_STORAGE_BUFFER_SIZE >= UX_SLAVE_CLASS_STORAGE_REQUEST_SENSE_RESPONSE_LENGTH); + /* Obtain the pointer to the transfer request. */ transfer_request = &endpoint_in -> ux_slave_endpoint_transfer_request; diff --git a/common/usbx_device_classes/src/ux_device_class_video_entry.c b/common/usbx_device_classes/src/ux_device_class_video_entry.c index c1debee..d0c5359 100644 --- a/common/usbx_device_classes/src/ux_device_class_video_entry.c +++ b/common/usbx_device_classes/src/ux_device_class_video_entry.c @@ -34,7 +34,7 @@ /* FUNCTION RELEASE */ /* */ /* _ux_device_class_video_entry PORTABLE C */ -/* 6.1.11 */ +/* 6.x */ /* AUTHOR */ /* */ /* Chaoqiong Xiao, Microsoft Corporation */ @@ -72,6 +72,9 @@ /* DATE NAME DESCRIPTION */ /* */ /* 04-25-2022 Chaoqiong Xiao Initial Version 6.1.11 */ +/* xx-xx-xxxx Yajun xia Modified comment(s), */ +/* added error checks support, */ +/* resulting in version 6.x */ /* */ /**************************************************************************/ UINT _ux_device_class_video_entry(UX_SLAVE_CLASS_COMMAND *command) @@ -86,9 +89,15 @@ UINT status; { case UX_SLAVE_CLASS_COMMAND_INITIALIZE: +#if defined(UX_DEVICE_CLASS_VIDEO_ENABLE_ERROR_CHECKING) + + /* Call the init function of the Video class. */ + status = _uxe_device_class_video_initialize(command); +#else /* Call the init function of the Video class. */ status = _ux_device_class_video_initialize(command); +#endif /* UX_DEVICE_CLASS_VIDEO_ENABLE_ERROR_CHECKING */ /* Return the completion status. */ return(status); diff --git a/common/usbx_device_classes/src/ux_device_class_video_initialize.c b/common/usbx_device_classes/src/ux_device_class_video_initialize.c index 625bc4f..814b187 100644 --- a/common/usbx_device_classes/src/ux_device_class_video_initialize.c +++ b/common/usbx_device_classes/src/ux_device_class_video_initialize.c @@ -257,3 +257,68 @@ ULONG i; return(status); } + +/**************************************************************************/ +/* */ +/* FUNCTION RELEASE */ +/* */ +/* _uxe_device_class_video_initialize PORTABLE C */ +/* 6.x */ +/* AUTHOR */ +/* */ +/* Yajun Xia, Microsoft Corporation */ +/* */ +/* DESCRIPTION */ +/* */ +/* This function checks errors in video initialization function call. */ +/* */ +/* INPUT */ +/* */ +/* command Pointer to video command */ +/* */ +/* OUTPUT */ +/* */ +/* Completion Status */ +/* */ +/* CALLS */ +/* */ +/* _ux_device_class_video_initialize Initialize video instance */ +/* */ +/* CALLED BY */ +/* */ +/* Device Video Class */ +/* */ +/* RELEASE HISTORY */ +/* */ +/* DATE NAME DESCRIPTION */ +/* */ +/* xx-xx-xxxx Yajun Xia Initial Version 6.x */ +/* */ +/**************************************************************************/ +UINT _uxe_device_class_video_initialize(UX_SLAVE_CLASS_COMMAND *command) +{ +UX_DEVICE_CLASS_VIDEO_PARAMETER *video_parameter; +ULONG i; + + /* Get the pointer to the application parameters for the video class. */ + video_parameter = (UX_DEVICE_CLASS_VIDEO_PARAMETER *)command -> ux_slave_class_command_parameter; + + /* Sanity checks. */ + if (video_parameter == UX_NULL) + return(UX_INVALID_PARAMETER); + + /* There must be at least one stream. */ + if ((video_parameter -> ux_device_class_video_parameter_streams_nb == 0) || + (video_parameter -> ux_device_class_video_parameter_streams == UX_NULL)) + return(UX_INVALID_PARAMETER); + + for (i = 0; i < video_parameter -> ux_device_class_video_parameter_streams_nb; i ++) + { + if ((video_parameter -> ux_device_class_video_parameter_streams[i].ux_device_class_video_stream_parameter_max_payload_buffer_size == 0) || + (video_parameter -> ux_device_class_video_parameter_streams[i].ux_device_class_video_stream_parameter_max_payload_buffer_nb == 0)) + return(UX_INVALID_PARAMETER); + } + + /* Do initialize. */ + return(_ux_device_class_video_initialize(command)); +}
\ No newline at end of file diff --git a/common/usbx_device_classes/src/ux_device_class_video_ioctl.c b/common/usbx_device_classes/src/ux_device_class_video_ioctl.c index 55aa725..517fa15 100644 --- a/common/usbx_device_classes/src/ux_device_class_video_ioctl.c +++ b/common/usbx_device_classes/src/ux_device_class_video_ioctl.c @@ -34,7 +34,7 @@ /* FUNCTION RELEASE */ /* */ /* _ux_device_class_video_ioctl PORTABLE C */ -/* 6.1.11 */ +/* 6.x */ /* AUTHOR */ /* */ /* Chaoqiong Xiao, Microsoft Corporation */ @@ -45,10 +45,10 @@ /* */ /* INPUT */ /* */ -/* video Address of video class */ -/* instance */ -/* ioctl_function IOCTL function code */ -/* parameter Parameter for function */ +/* video Address of video class */ +/* instance */ +/* ioctl_function IOCTL function code */ +/* parameter Parameter for function */ /* */ /* OUTPUT */ /* */ @@ -59,13 +59,15 @@ /* */ /* CALLED BY */ /* */ -/* ThreadX */ +/* Application */ /* */ /* RELEASE HISTORY */ /* */ /* DATE NAME DESCRIPTION */ /* */ /* 04-25-2022 Chaoqiong Xiao Initial Version 6.1.11 */ +/* xx-xx-xxxx Yajun Xia Modified comment(s), */ +/* resulting in version 6.x */ /* */ /**************************************************************************/ UINT _ux_device_class_video_ioctl(UX_DEVICE_CLASS_VIDEO *video, ULONG ioctl_function, @@ -103,3 +105,55 @@ VOID **pptr_parameter; return(status); } + +/**************************************************************************/ +/* */ +/* FUNCTION RELEASE */ +/* */ +/* _uxe_device_class_video_ioctl PORTABLE C */ +/* 6.x */ +/* AUTHOR */ +/* */ +/* Yajun Xia, Microsoft Corporation */ +/* */ +/* DESCRIPTION */ +/* */ +/* This function checks errors in video IOCTL function call. */ +/* */ +/* INPUT */ +/* */ +/* video Address of video class */ +/* instance */ +/* ioctl_function IOCTL function code */ +/* parameter Parameter for function */ +/* */ +/* OUTPUT */ +/* */ +/* Status */ +/* */ +/* CALLS */ +/* */ +/* _ux_device_class_video_ioctl Video IOCTL */ +/* */ +/* CALLED BY */ +/* */ +/* Application */ +/* */ +/* RELEASE HISTORY */ +/* */ +/* DATE NAME DESCRIPTION */ +/* */ +/* xx-xx-xxxx Yajun Xia Initial Version 6.x */ +/* */ +/**************************************************************************/ +UINT _uxe_device_class_video_ioctl(UX_DEVICE_CLASS_VIDEO *video, ULONG ioctl_function, + VOID *parameter) +{ + + /* Sanity check. */ + if (video == UX_NULL) + return(UX_INVALID_PARAMETER); + + /* Call the actual video IOCTL function. */ + return(_ux_device_class_video_ioctl(video, ioctl_function, parameter)); +}
\ No newline at end of file diff --git a/common/usbx_device_classes/src/ux_device_class_video_max_payload_get.c b/common/usbx_device_classes/src/ux_device_class_video_max_payload_get.c index d7315e2..03ce518 100644 --- a/common/usbx_device_classes/src/ux_device_class_video_max_payload_get.c +++ b/common/usbx_device_classes/src/ux_device_class_video_max_payload_get.c @@ -90,3 +90,55 @@ UX_SLAVE_DEVICE *device; return(endpoint -> ux_slave_endpoint_transfer_request. ux_slave_transfer_request_transfer_length); } + +/**************************************************************************/ +/* */ +/* FUNCTION RELEASE */ +/* */ +/* _uxe_device_class_video_max_payload_length PORTABLE C */ +/* 6.x */ +/* AUTHOR */ +/* */ +/* Yajun Xia, Microsoft Corporation */ +/* */ +/* DESCRIPTION */ +/* */ +/* This function checks errors in getting video stream max payload */ +/* length function call. */ +/* */ +/* INPUT */ +/* */ +/* stream Address of video stream */ +/* instance */ +/* */ +/* OUTPUT */ +/* */ +/* None */ +/* */ +/* CALLS */ +/* */ +/* _ux_device_class_video_max_payload_length */ +/* Get max payload length in the */ +/* video stream. */ +/* */ +/* CALLED BY */ +/* */ +/* Application */ +/* */ +/* RELEASE HISTORY */ +/* */ +/* DATE NAME DESCRIPTION */ +/* */ +/* xx-xx-xxxx Yajun Xia Initial Version 6.x */ +/* */ +/**************************************************************************/ +ULONG _uxe_device_class_video_max_payload_length(UX_DEVICE_CLASS_VIDEO_STREAM *stream) +{ + + /* Sanity check. */ + if (stream == UX_NULL) + return(0); + + /* Call the actual function. */ + return(_ux_device_class_video_max_payload_length(stream)); +}
\ No newline at end of file diff --git a/common/usbx_device_classes/src/ux_device_class_video_read_payload_free.c b/common/usbx_device_classes/src/ux_device_class_video_read_payload_free.c index cdcb750..5fd4e51 100644 --- a/common/usbx_device_classes/src/ux_device_class_video_read_payload_free.c +++ b/common/usbx_device_classes/src/ux_device_class_video_read_payload_free.c @@ -34,7 +34,7 @@ /* FUNCTION RELEASE */ /* */ /* _ux_device_class_video_read_payload_free PORTABLE C */ -/* 6.1.11 */ +/* 6.x */ /* AUTHOR */ /* */ /* Chaoqiong Xiao, Microsoft Corporation */ @@ -57,13 +57,15 @@ /* */ /* CALLED BY */ /* */ -/* ThreadX */ +/* Application */ /* */ /* RELEASE HISTORY */ /* */ /* DATE NAME DESCRIPTION */ /* */ /* 04-25-2022 Chaoqiong Xiao Initial Version 6.1.11 */ +/* xx-xx-xxxx Yajun Xia Modified comment(s), */ +/* resulting in version 6.x */ /* */ /**************************************************************************/ UINT _ux_device_class_video_read_payload_free(UX_DEVICE_CLASS_VIDEO_STREAM *stream) @@ -121,3 +123,54 @@ UCHAR *next_payload; return(UX_SUCCESS); } + +/**************************************************************************/ +/* */ +/* FUNCTION RELEASE */ +/* */ +/* _uxe_device_class_video_read_payload_free PORTABLE C */ +/* 6.x */ +/* AUTHOR */ +/* */ +/* Yajun Xia, Microsoft Corporation */ +/* */ +/* DESCRIPTION */ +/* */ +/* This function checks errors in video read payload free function */ +/* call. */ +/* */ +/* INPUT */ +/* */ +/* stream Address of video stream */ +/* instance */ +/* */ +/* OUTPUT */ +/* */ +/* None */ +/* */ +/* CALLS */ +/* */ +/* _ux_device_class_video_read_payload_free */ +/* Video read payload free */ +/* */ +/* CALLED BY */ +/* */ +/* Application */ +/* */ +/* RELEASE HISTORY */ +/* */ +/* DATE NAME DESCRIPTION */ +/* */ +/* xx-xx-xxxx Yajun Xia Initial Version 6.x */ +/* */ +/**************************************************************************/ +UINT _uxe_device_class_video_read_payload_free(UX_DEVICE_CLASS_VIDEO_STREAM *stream) +{ + + /* Sanity check. */ + if (stream == UX_NULL) + return(UX_INVALID_PARAMETER); + + /* Call the actual video read payload free function. */ + return(_ux_device_class_video_read_payload_free(stream)); +}
\ No newline at end of file diff --git a/common/usbx_device_classes/src/ux_device_class_video_read_payload_get.c b/common/usbx_device_classes/src/ux_device_class_video_read_payload_get.c index b2d22b5..3244528 100644 --- a/common/usbx_device_classes/src/ux_device_class_video_read_payload_get.c +++ b/common/usbx_device_classes/src/ux_device_class_video_read_payload_get.c @@ -34,7 +34,7 @@ /* FUNCTION RELEASE */ /* */ /* _ux_device_class_video_read_payload_get PORTABLE C */ -/* 6.1.11 */ +/* 6.x */ /* AUTHOR */ /* */ /* Chaoqiong Xiao, Microsoft Corporation */ @@ -61,13 +61,15 @@ /* */ /* CALLED BY */ /* */ -/* ThreadX */ +/* Application */ /* */ /* RELEASE HISTORY */ /* */ /* DATE NAME DESCRIPTION */ /* */ /* 04-25-2022 Chaoqiong Xiao Initial Version 6.1.11 */ +/* xx-xx-xxxx Yajun Xia Modified comment(s), */ +/* resulting in version 6.x */ /* */ /**************************************************************************/ UINT _ux_device_class_video_read_payload_get(UX_DEVICE_CLASS_VIDEO_STREAM *stream, @@ -110,3 +112,59 @@ UX_SLAVE_DEVICE *device; return(UX_SUCCESS); } + +/**************************************************************************/ +/* */ +/* FUNCTION RELEASE */ +/* */ +/* _uxe_device_class_video_read_payload_get PORTABLE C */ +/* 6.x */ +/* AUTHOR */ +/* */ +/* Yajun Xia, Microsoft Corporation */ +/* */ +/* DESCRIPTION */ +/* */ +/* This function checks errors in video read payload get function */ +/* call. */ +/* */ +/* INPUT */ +/* */ +/* stream Address of video stream */ +/* instance */ +/* payload_data Pointer to buffer to save */ +/* pointer to payload data */ +/* payload_length Pointer to buffer to save */ +/* Pointer to payload length */ +/* */ +/* OUTPUT */ +/* */ +/* None */ +/* */ +/* CALLS */ +/* */ +/* _ux_device_class_video_read_payload_get */ +/* Video read payload get */ +/* */ +/* CALLED BY */ +/* */ +/* Application */ +/* */ +/* RELEASE HISTORY */ +/* */ +/* DATE NAME DESCRIPTION */ +/* */ +/* xx-xx-xxxx Yajun Xia Initial Version 6.x */ +/* */ +/**************************************************************************/ +UINT _uxe_device_class_video_read_payload_get(UX_DEVICE_CLASS_VIDEO_STREAM *stream, + UCHAR **payload_data, ULONG *payload_length) +{ + + /* Sanity check. */ + if ((stream == UX_NULL) || (payload_data == UX_NULL) || (payload_length == UX_NULL)) + return(UX_INVALID_PARAMETER); + + /* Call the actual video read payload get function. */ + return(_ux_device_class_video_read_payload_get(stream, payload_data, payload_length)); +}
\ No newline at end of file diff --git a/common/usbx_device_classes/src/ux_device_class_video_reception_start.c b/common/usbx_device_classes/src/ux_device_class_video_reception_start.c index 342b00e..3928da3 100644 --- a/common/usbx_device_classes/src/ux_device_class_video_reception_start.c +++ b/common/usbx_device_classes/src/ux_device_class_video_reception_start.c @@ -34,7 +34,7 @@ /* FUNCTION RELEASE */ /* */ /* _ux_device_class_video_reception_start PORTABLE C */ -/* 6.2.0 */ +/* 6.x */ /* AUTHOR */ /* */ /* Chaoqiong Xiao, Microsoft Corporation */ @@ -58,7 +58,7 @@ /* */ /* CALLED BY */ /* */ -/* ThreadX */ +/* Application */ /* */ /* RELEASE HISTORY */ /* */ @@ -68,6 +68,8 @@ /* 10-31-2022 Chaoqiong Xiao Modified comment(s), */ /* added standalone support, */ /* resulting in version 6.2.0 */ +/* xx-xx-xxxx Yajun Xia Modified comment(s), */ +/* resulting in version 6.x */ /* */ /**************************************************************************/ UINT _ux_device_class_video_reception_start(UX_DEVICE_CLASS_VIDEO_STREAM *stream) @@ -114,3 +116,53 @@ UX_SLAVE_DEVICE *device; return(UX_SUCCESS); } + +/**************************************************************************/ +/* */ +/* FUNCTION RELEASE */ +/* */ +/* _uxe_device_class_video_reception_start PORTABLE C */ +/* 6.x */ +/* AUTHOR */ +/* */ +/* Yajun Xia, Microsoft Corporation */ +/* */ +/* DESCRIPTION */ +/* */ +/* This function checks errors in video reception start function call. */ +/* */ +/* INPUT */ +/* */ +/* stream Address of video stream */ +/* instance */ +/* */ +/* OUTPUT */ +/* */ +/* None */ +/* */ +/* CALLS */ +/* */ +/* _ux_device_class_video_reception_start */ +/* Video reception start */ +/* */ +/* CALLED BY */ +/* */ +/* Application */ +/* */ +/* RELEASE HISTORY */ +/* */ +/* DATE NAME DESCRIPTION */ +/* */ +/* xx-xx-xxxx Yajun Xia Initial Version 6.x */ +/* */ +/**************************************************************************/ +UINT _uxe_device_class_video_reception_start(UX_DEVICE_CLASS_VIDEO_STREAM *stream) +{ + + /* Sanity check. */ + if (stream == UX_NULL) + return(UX_INVALID_PARAMETER); + + /* Call the actual video reception start function. */ + return(_ux_device_class_video_reception_start(stream)); +}
\ No newline at end of file diff --git a/common/usbx_device_classes/src/ux_device_class_video_transmission_start.c b/common/usbx_device_classes/src/ux_device_class_video_transmission_start.c index c01f117..4216ac5 100644 --- a/common/usbx_device_classes/src/ux_device_class_video_transmission_start.c +++ b/common/usbx_device_classes/src/ux_device_class_video_transmission_start.c @@ -34,14 +34,14 @@ /* FUNCTION RELEASE */ /* */ /* _ux_device_class_video_transmission_start PORTABLE C */ -/* 6.2.0 */ +/* 6.x */ /* AUTHOR */ /* */ /* Chaoqiong Xiao, Microsoft Corporation */ /* */ /* DESCRIPTION */ /* */ -/* This function start sending valid payloads in the Video class. */ +/* This function start sending valid payloads in the Video class. */ /* */ /* INPUT */ /* */ @@ -58,7 +58,7 @@ /* */ /* CALLED BY */ /* */ -/* ThreadX */ +/* Application */ /* */ /* RELEASE HISTORY */ /* */ @@ -68,6 +68,8 @@ /* 10-31-2022 Chaoqiong Xiao Modified comment(s), */ /* added standalone support, */ /* resulting in version 6.2.0 */ +/* xx-xx-xxxx Yajun Xia Modified comment(s), */ +/* resulting in version 6.x */ /* */ /**************************************************************************/ UINT _ux_device_class_video_transmission_start(UX_DEVICE_CLASS_VIDEO_STREAM *stream) @@ -115,3 +117,54 @@ UX_SLAVE_DEVICE *device; return(UX_SUCCESS); } + +/**************************************************************************/ +/* */ +/* FUNCTION RELEASE */ +/* */ +/* _uxe_device_class_video_transmission_start PORTABLE C */ +/* 6.x */ +/* AUTHOR */ +/* */ +/* Yajun Xia, Microsoft Corporation */ +/* */ +/* DESCRIPTION */ +/* */ +/* This function checks errors in video transmission start function */ +/* call. */ +/* */ +/* INPUT */ +/* */ +/* stream Address of video stream */ +/* instance */ +/* */ +/* OUTPUT */ +/* */ +/* None */ +/* */ +/* CALLS */ +/* */ +/* _ux_device_class_video_transmission_start */ +/* Video transmission start */ +/* */ +/* CALLED BY */ +/* */ +/* Application */ +/* */ +/* RELEASE HISTORY */ +/* */ +/* DATE NAME DESCRIPTION */ +/* */ +/* xx-xx-xxxx Yajun Xia Initial Version 6.x */ +/* */ +/**************************************************************************/ +UINT _uxe_device_class_video_transmission_start(UX_DEVICE_CLASS_VIDEO_STREAM *stream) +{ + + /* Sanity check. */ + if (stream == UX_NULL) + return(UX_INVALID_PARAMETER); + + /* Call the actual video transmission start function. */ + return(_ux_device_class_video_transmission_start(stream)); +}
\ No newline at end of file diff --git a/common/usbx_device_classes/src/ux_device_class_video_write_payload_commit.c b/common/usbx_device_classes/src/ux_device_class_video_write_payload_commit.c index dade35a..da182c8 100644 --- a/common/usbx_device_classes/src/ux_device_class_video_write_payload_commit.c +++ b/common/usbx_device_classes/src/ux_device_class_video_write_payload_commit.c @@ -34,7 +34,7 @@ /* FUNCTION RELEASE */ /* */ /* _ux_device_class_video_write_payload_commit PORTABLE C */ -/* 6.1.11 */ +/* 6.x */ /* AUTHOR */ /* */ /* Chaoqiong Xiao, Microsoft Corporation */ @@ -47,8 +47,6 @@ /* */ /* stream Address of video stream */ /* instance */ -/* buffer Pointer to buffer to save */ -/* payload data */ /* length Frame length in bytes */ /* */ /* OUTPUT */ @@ -60,13 +58,15 @@ /* */ /* CALLED BY */ /* */ -/* ThreadX */ +/* Application */ /* */ /* RELEASE HISTORY */ /* */ /* DATE NAME DESCRIPTION */ /* */ /* 04-25-2022 Chaoqiong Xiao Initial Version 6.1.11 */ +/* xx-xx-xxxx Yajun Xia Modified comment(s), */ +/* resulting in version 6.x */ /* */ /**************************************************************************/ UINT _ux_device_class_video_write_payload_commit(UX_DEVICE_CLASS_VIDEO_STREAM *stream, ULONG length) @@ -124,3 +124,54 @@ UCHAR *next_pos; return(UX_SUCCESS); } +/**************************************************************************/ +/* */ +/* FUNCTION RELEASE */ +/* */ +/* _uxe_device_class_video_write_payload_commit PORTABLE C */ +/* 6.x */ +/* AUTHOR */ +/* */ +/* Yajun Xia, Microsoft Corporation */ +/* */ +/* DESCRIPTION */ +/* */ +/* This function checks errors in video write payload commit function */ +/* call. */ +/* */ +/* INPUT */ +/* */ +/* stream Address of video stream */ +/* instance */ +/* length Frame length in bytes */ +/* */ +/* OUTPUT */ +/* */ +/* None */ +/* */ +/* CALLS */ +/* */ +/* _ux_device_class_video_write_payload_commit */ +/* Video write payload commit */ +/* */ +/* CALLED BY */ +/* */ +/* Application */ +/* */ +/* RELEASE HISTORY */ +/* */ +/* DATE NAME DESCRIPTION */ +/* */ +/* xx-xx-xxxx Yajun Xia Initial Version 6.x */ +/* */ +/**************************************************************************/ +UINT _uxe_device_class_video_write_payload_commit(UX_DEVICE_CLASS_VIDEO_STREAM *stream, ULONG length) +{ + + /* Sanity check. */ + if ((stream == UX_NULL) || (length == 0)) + return(UX_INVALID_PARAMETER); + + /* Call the actual video write payload commit function. */ + return (_ux_device_class_video_write_payload_commit(stream, length)); +}
\ No newline at end of file diff --git a/common/usbx_device_classes/src/ux_device_class_video_write_payload_get.c b/common/usbx_device_classes/src/ux_device_class_video_write_payload_get.c index d5b79ea..86431e7 100644 --- a/common/usbx_device_classes/src/ux_device_class_video_write_payload_get.c +++ b/common/usbx_device_classes/src/ux_device_class_video_write_payload_get.c @@ -34,7 +34,7 @@ /* FUNCTION RELEASE */ /* */ /* _ux_device_class_video_write_payload_get PORTABLE C */ -/* 6.1.11 */ +/* 6.x */ /* AUTHOR */ /* */ /* Chaoqiong Xiao, Microsoft Corporation */ @@ -61,13 +61,15 @@ /* */ /* CALLED BY */ /* */ -/* ThreadX */ +/* Application */ /* */ /* RELEASE HISTORY */ /* */ /* DATE NAME DESCRIPTION */ /* */ /* 04-25-2022 Chaoqiong Xiao Initial Version 6.1.11 */ +/* xx-xx-xxxx Yajun Xia Modified comment(s), */ +/* resulting in version 6.x */ /* */ /**************************************************************************/ UINT _ux_device_class_video_write_payload_get(UX_DEVICE_CLASS_VIDEO_STREAM *stream, UCHAR **payload, ULONG *length) @@ -111,3 +113,57 @@ UX_SLAVE_DEVICE *device; return(UX_SUCCESS); } +/**************************************************************************/ +/* */ +/* FUNCTION RELEASE */ +/* */ +/* _uxe_device_class_video_write_payload_get PORTABLE C */ +/* 6.x */ +/* AUTHOR */ +/* */ +/* Yajun Xia, Microsoft Corporation */ +/* */ +/* DESCRIPTION */ +/* */ +/* This function checks errors in video write payload get function */ +/* call. */ +/* */ +/* INPUT */ +/* */ +/* stream Address of video stream */ +/* instance */ +/* payload Pointer to buffer to save */ +/* payload buffer pointer */ +/* length Pointer to save payload */ +/* buffer length in bytes */ +/* */ +/* OUTPUT */ +/* */ +/* None */ +/* */ +/* CALLS */ +/* */ +/* _ux_device_class_video_write_payload_get */ +/* Video write payload get */ +/* */ +/* CALLED BY */ +/* */ +/* Application */ +/* */ +/* RELEASE HISTORY */ +/* */ +/* DATE NAME DESCRIPTION */ +/* */ +/* xx-xx-xxxx Yajun Xia Initial Version 6.x */ +/* */ +/**************************************************************************/ +UINT _uxe_device_class_video_write_payload_get(UX_DEVICE_CLASS_VIDEO_STREAM *stream, UCHAR **payload, ULONG *length) +{ + + /* Sanity check. */ + if ((stream == UX_NULL) || (payload == UX_NULL) || (length == UX_NULL)) + return(UX_INVALID_PARAMETER); + + /* Call the actual video write payload get function. */ + return(_ux_device_class_video_write_payload_get(stream, payload, length)); +}
\ No newline at end of file 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 a21adcd..c29b7c8 100644 --- a/common/usbx_host_classes/inc/ux_host_class_audio.h +++ b/common/usbx_host_classes/inc/ux_host_class_audio.h @@ -85,6 +85,13 @@ extern "C" { /* Defined, it disables control_get/value_get/value_set and related code (to optimize code size). */ /* #define UX_HOST_CLASS_AUDIO_DISABLE_CONTROLS */ +/* Internal option: enable the basic USBX error checking. This define is typically used + while debugging application. */ +#if defined(UX_ENABLE_ERROR_CHECKING) && !defined(UX_HOST_CLASS_AUDIO_ENABLE_ERROR_CHECKING) +#define UX_HOST_CLASS_AUDIO_ENABLE_ERROR_CHECKING +#endif + + #include "ux_class_audio10.h" #if defined(UX_HOST_CLASS_AUDIO_2_SUPPORT) #include "ux_class_audio20.h" @@ -618,17 +625,102 @@ UINT _ux_host_class_audio_interrupt_start(UX_HOST_CLASS_AUDIO_AC *audio, VOID *arg); VOID _ux_host_class_audio_interrupt_notification(UX_TRANSFER *transfer_request); +UINT _uxe_host_class_audio_control_get(UX_HOST_CLASS_AUDIO *audio, UX_HOST_CLASS_AUDIO_CONTROL *audio_control); +UINT _uxe_host_class_audio_control_value_get(UX_HOST_CLASS_AUDIO *audio, UX_HOST_CLASS_AUDIO_CONTROL *audio_control); +UINT _uxe_host_class_audio_control_value_set(UX_HOST_CLASS_AUDIO *audio, UX_HOST_CLASS_AUDIO_CONTROL *audio_control); +UINT _uxe_host_class_audio_read(UX_HOST_CLASS_AUDIO *audio, UX_HOST_CLASS_AUDIO_TRANSFER_REQUEST *audio_transfer_request); +UINT _uxe_host_class_audio_streaming_sampling_get(UX_HOST_CLASS_AUDIO *audio, UX_HOST_CLASS_AUDIO_SAMPLING_CHARACTERISTICS *audio_sampling); +UINT _uxe_host_class_audio_streaming_sampling_set(UX_HOST_CLASS_AUDIO *audio, UX_HOST_CLASS_AUDIO_SAMPLING *audio_sampling); +UINT _uxe_host_class_audio_write(UX_HOST_CLASS_AUDIO *audio, UX_HOST_CLASS_AUDIO_TRANSFER_REQUEST *audio_transfer_request); +UINT _uxe_host_class_audio_control_request(UX_HOST_CLASS_AUDIO *audio, + UINT streaming_control, + UINT request_type, UINT request, + UINT request_value, + UINT spec_id, + UCHAR *parameter, ULONG parameter_size, ULONG *actual_size); +UINT _uxe_host_class_audio_descriptors_parse(UX_HOST_CLASS_AUDIO *audio, + UINT(*parse_function)(VOID *arg, + UCHAR *packed_interface_descriptor, + UCHAR *packed_endpoint_descriptor, + UCHAR *packed_audio_descriptor), + VOID* arg); +UINT _uxe_host_class_audio_raw_sampling_parse(UX_HOST_CLASS_AUDIO *audio, + UINT(*parse_function)(VOID *arg, + UCHAR *packed_interface_descriptor, + UX_HOST_CLASS_AUDIO_SAMPLING_CHARACTERISTICS *sam_attr), + VOID* arg); +UINT _uxe_host_class_audio_stop(UX_HOST_CLASS_AUDIO *audio); +UINT _uxe_host_class_audio_feedback_get(UX_HOST_CLASS_AUDIO *audio, UCHAR *feedback); +UINT _uxe_host_class_audio_feedback_set(UX_HOST_CLASS_AUDIO *audio, UCHAR *feedback); +UINT _uxe_host_class_audio_entity_control_get(UX_HOST_CLASS_AUDIO *audio, UX_HOST_CLASS_AUDIO_CONTROL *audio_control); +UINT _uxe_host_class_audio_entity_control_value_get(UX_HOST_CLASS_AUDIO *audio, UX_HOST_CLASS_AUDIO_CONTROL *audio_control); +UINT _uxe_host_class_audio_entity_control_value_set(UX_HOST_CLASS_AUDIO *audio, UX_HOST_CLASS_AUDIO_CONTROL *audio_control); +UINT _uxe_host_class_audio_interrupt_start(UX_HOST_CLASS_AUDIO_AC *audio, + VOID(*callback_function)(UX_HOST_CLASS_AUDIO_AC *audio, + UCHAR *message, ULONG length, + VOID *arg), + VOID *arg); + + /* Define Audio Class API prototypes. */ -#define ux_host_class_audio_entry _ux_host_class_audio_entry -#define ux_host_class_audio_control_get _ux_host_class_audio_control_get -#define ux_host_class_audio_control_value_get _ux_host_class_audio_control_value_get -#define ux_host_class_audio_control_value_set _ux_host_class_audio_control_value_set -#define ux_host_class_audio_read _ux_host_class_audio_read -#define ux_host_class_audio_streaming_sampling_get _ux_host_class_audio_streaming_sampling_get -#define ux_host_class_audio_streaming_sampling_set _ux_host_class_audio_streaming_sampling_set -#define ux_host_class_audio_streaming_terminal_get _ux_host_class_audio_streaming_terminal_get -#define ux_host_class_audio_write _ux_host_class_audio_write +#if defined(UX_HOST_CLASS_AUDIO_ENABLE_ERROR_CHECKING) + +#define ux_host_class_audio_entry _ux_host_class_audio_entry + +#define ux_host_class_audio_control_get _uxe_host_class_audio_control_get +#define ux_host_class_audio_control_value_get _uxe_host_class_audio_control_value_get +#define ux_host_class_audio_control_value_set _uxe_host_class_audio_control_value_set +#define ux_host_class_audio_read _uxe_host_class_audio_read +#define ux_host_class_audio_streaming_sampling_get _uxe_host_class_audio_streaming_sampling_get +#define ux_host_class_audio_streaming_sampling_set _uxe_host_class_audio_streaming_sampling_set +#define ux_host_class_audio_write _uxe_host_class_audio_write + +#define ux_host_class_audio_type_get _ux_host_class_audio_type_get +#define ux_host_class_audio_speed_get _ux_host_class_audio_speed_get +#define ux_host_class_audio_protocol_get _ux_host_class_audio_protocol_get +#define ux_host_class_audio_subclass_get _ux_host_class_audio_subclass_get +#define ux_host_class_audio_feedback_supported _ux_host_class_audio_feedback_supported + +#define ux_host_class_audio_interface_get _ux_host_class_audio_interface_get +#define ux_host_class_audio_control_interface_get _ux_host_class_audio_control_interface_get +#define ux_host_class_audio_terminal_link_get _ux_host_class_audio_terminal_link_get + +#define ux_host_class_audio_max_packet_size_get _ux_host_class_audio_max_packet_size_get +#define ux_host_class_audio_packet_size_get _ux_host_class_audio_packet_size_get +#define ux_host_class_audio_packet_freq_get _ux_host_class_audio_packet_freq_get +#define ux_host_class_audio_packet_fraction_get _ux_host_class_audio_packet_fraction_get + +#define ux_host_class_audio_feedback_get _uxe_host_class_audio_feedback_get +#define ux_host_class_audio_feedback_set _uxe_host_class_audio_feedback_set + +#define ux_host_class_audio_control_request _uxe_host_class_audio_control_request + +#define ux_host_class_audio_descriptors_parse _uxe_host_class_audio_descriptors_parse + +#define ux_host_class_audio_entity_control_get _uxe_host_class_audio_entity_control_get +#define ux_host_class_audio_entity_control_value_get _uxe_host_class_audio_entity_control_value_get +#define ux_host_class_audio_entity_control_value_set _uxe_host_class_audio_entity_control_value_set + +#define ux_host_class_audio_raw_sampling_parse _uxe_host_class_audio_raw_sampling_parse +#define ux_host_class_audio_raw_sampling_start _uxe_host_class_audio_streaming_sampling_set + +#define ux_host_class_audio_stop _uxe_host_class_audio_stop + +#define ux_host_class_audio_interrupt_start _uxe_host_class_audio_interrupt_start + + +#else + +#define ux_host_class_audio_entry _ux_host_class_audio_entry +#define ux_host_class_audio_control_get _ux_host_class_audio_control_get +#define ux_host_class_audio_control_value_get _ux_host_class_audio_control_value_get +#define ux_host_class_audio_control_value_set _ux_host_class_audio_control_value_set +#define ux_host_class_audio_read _ux_host_class_audio_read +#define ux_host_class_audio_streaming_sampling_get _ux_host_class_audio_streaming_sampling_get +#define ux_host_class_audio_streaming_sampling_set _ux_host_class_audio_streaming_sampling_set +#define ux_host_class_audio_streaming_terminal_get _ux_host_class_audio_streaming_terminal_get +#define ux_host_class_audio_write _ux_host_class_audio_write #define ux_host_class_audio_type_get _ux_host_class_audio_type_get #define ux_host_class_audio_speed_get _ux_host_class_audio_speed_get @@ -663,6 +755,9 @@ VOID _ux_host_class_audio_interrupt_notification(UX_TRANSFER *transfer_reques #define ux_host_class_audio_interrupt_start _ux_host_class_audio_interrupt_start +#endif + + /* Determine if a C++ compiler is being used. If so, complete the standard C conditional started above. */ #ifdef __cplusplus diff --git a/common/usbx_host_classes/inc/ux_host_class_cdc_acm.h b/common/usbx_host_classes/inc/ux_host_class_cdc_acm.h index 1dc6d74..4f279d5 100644 --- a/common/usbx_host_classes/inc/ux_host_class_cdc_acm.h +++ b/common/usbx_host_classes/inc/ux_host_class_cdc_acm.h @@ -71,6 +71,14 @@ extern "C" { #endif + +/* Internal option: enable the basic USBX error checking. This define is typically used + while debugging application. */ +#if defined(UX_ENABLE_ERROR_CHECKING) && !defined(UX_HOST_CLASS_CDC_ACM_ENABLE_ERROR_CHECKING) +#define UX_HOST_CLASS_CDC_ACM_ENABLE_ERROR_CHECKING +#endif + + /* Define CDC ACM Class constants. */ #define UX_HOST_CLASS_CDC_ACM_DEVICE_INIT_DELAY 1000 @@ -368,9 +376,39 @@ UINT _ux_host_class_cdc_acm_write_with_callback(UX_HOST_CLASS_CDC_ACM *cdc_acm, ULONG requested_length); VOID _ux_host_class_cdc_acm_transmission_callback(UX_TRANSFER *transfer_request); + +UINT _uxe_host_class_cdc_acm_command(UX_HOST_CLASS_CDC_ACM *cdc_acm, ULONG command, + ULONG value, UCHAR *data_buffer, ULONG data_length); +UINT _uxe_host_class_cdc_acm_read (UX_HOST_CLASS_CDC_ACM *cdc_acm, UCHAR *data_pointer, + ULONG requested_length, ULONG *actual_length); +UINT _uxe_host_class_cdc_acm_write(UX_HOST_CLASS_CDC_ACM *cdc_acm, UCHAR *data_pointer, + ULONG requested_length, ULONG *actual_length); +UINT _uxe_host_class_cdc_acm_ioctl(UX_HOST_CLASS_CDC_ACM *cdc_acm, ULONG request, + VOID *parameter); +UINT _uxe_host_class_cdc_acm_reception_stop (UX_HOST_CLASS_CDC_ACM *cdc_acm, + UX_HOST_CLASS_CDC_ACM_RECEPTION *cdc_acm_reception); +UINT _uxe_host_class_cdc_acm_reception_start (UX_HOST_CLASS_CDC_ACM *cdc_acm, + UX_HOST_CLASS_CDC_ACM_RECEPTION *cdc_acm_reception); +UINT _uxe_host_class_cdc_acm_write_with_callback(UX_HOST_CLASS_CDC_ACM *cdc_acm, UCHAR *data_pointer, + ULONG requested_length); + + /* Define CDC ACM Class API prototypes. */ #define ux_host_class_cdc_acm_entry _ux_host_class_cdc_acm_entry + +#if defined(UX_HOST_CLASS_CDC_ACM_ENABLE_ERROR_CHECKING) + +#define ux_host_class_cdc_acm_read _uxe_host_class_cdc_acm_read +#define ux_host_class_cdc_acm_write _uxe_host_class_cdc_acm_write +#define ux_host_class_cdc_acm_ioctl _uxe_host_class_cdc_acm_ioctl +#define ux_host_class_cdc_acm_reception_start _uxe_host_class_cdc_acm_reception_start +#define ux_host_class_cdc_acm_reception_stop _uxe_host_class_cdc_acm_reception_stop + +#define ux_host_class_cdc_acm_write_with_callback _uxe_host_class_cdc_acm_write_with_callback + +#else + #define ux_host_class_cdc_acm_read _ux_host_class_cdc_acm_read #define ux_host_class_cdc_acm_write _ux_host_class_cdc_acm_write #define ux_host_class_cdc_acm_ioctl _ux_host_class_cdc_acm_ioctl @@ -379,6 +417,8 @@ VOID _ux_host_class_cdc_acm_transmission_callback(UX_TRANSFER *transfer_request #define ux_host_class_cdc_acm_write_with_callback _ux_host_class_cdc_acm_write_with_callback +#endif + /* Determine if a C++ compiler is being used. If so, complete the standard C conditional started above. */ #ifdef __cplusplus diff --git a/common/usbx_host_classes/inc/ux_host_class_gser.h b/common/usbx_host_classes/inc/ux_host_class_gser.h index b176f15..a0a94d2 100644 --- a/common/usbx_host_classes/inc/ux_host_class_gser.h +++ b/common/usbx_host_classes/inc/ux_host_class_gser.h @@ -67,6 +67,13 @@ extern "C" { #endif +/* Internal option: enable the basic USBX error checking. This define is typically used + while debugging application. */ +#if defined(UX_ENABLE_ERROR_CHECKING) && !defined(UX_HOST_CLASS_GSER_ENABLE_ERROR_CHECKING) +#define UX_HOST_CLASS_GSER_ENABLE_ERROR_CHECKING +#endif + + /* Define Sierra Wireless AR Class constants. */ #define UX_HOST_CLASS_GSER_CLASS_TRANSFER_TIMEOUT 300000 @@ -267,16 +274,44 @@ UINT _ux_host_class_gser_reception_stop (UX_HOST_CLASS_GSER *gser, UX_HOST_CLASS_GSER_RECEPTION *gser_reception); UINT _ux_host_class_gser_reception_start (UX_HOST_CLASS_GSER *gser, UX_HOST_CLASS_GSER_RECEPTION *gser_reception); - + + +UINT _uxe_host_class_gser_read (UX_HOST_CLASS_GSER *gser, ULONG interface_index,UCHAR *data_pointer, + ULONG requested_length, ULONG *actual_length); +UINT _uxe_host_class_gser_write(UX_HOST_CLASS_GSER *gser, ULONG interface_index,UCHAR *data_pointer, + ULONG requested_length, ULONG *actual_length); +UINT _uxe_host_class_gser_command(UX_HOST_CLASS_GSER *gser, ULONG interface_index, ULONG command, + ULONG value, UCHAR *data_buffer, ULONG data_length); +UINT _uxe_host_class_gser_ioctl(UX_HOST_CLASS_GSER *gser, ULONG interface_index, ULONG ioctl_function, + VOID *parameter); +UINT _uxe_host_class_gser_reception_stop (UX_HOST_CLASS_GSER *gser, + UX_HOST_CLASS_GSER_RECEPTION *gser_reception); +UINT _uxe_host_class_gser_reception_start (UX_HOST_CLASS_GSER *gser, + UX_HOST_CLASS_GSER_RECEPTION *gser_reception); + + /* Define GSER Class API prototypes. */ #define ux_host_class_gser_entry _ux_host_class_gser_entry + +#if defined(UX_HOST_CLASS_GSER_ENABLE_ERROR_CHECKING) + +#define ux_host_class_gser_read _uxe_host_class_gser_read +#define ux_host_class_gser_write _uxe_host_class_gser_write +#define ux_host_class_gser_ioctl _uxe_host_class_gser_ioctl +#define ux_host_class_gser_reception_start _uxe_host_class_gser_reception_start +#define ux_host_class_gser_reception_stop _uxe_host_class_gser_reception_stop + +#else + #define ux_host_class_gser_read _ux_host_class_gser_read #define ux_host_class_gser_write _ux_host_class_gser_write #define ux_host_class_gser_ioctl _ux_host_class_gser_ioctl #define ux_host_class_gser_reception_start _ux_host_class_gser_reception_start #define ux_host_class_gser_reception_stop _ux_host_class_gser_reception_stop +#endif + /* Determine if a C++ compiler is being used. If so, complete the standard C conditional started above. */ #ifdef __cplusplus 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 7770b37..5d0e76f 100644 --- a/common/usbx_host_classes/inc/ux_host_class_hid.h +++ b/common/usbx_host_classes/inc/ux_host_class_hid.h @@ -72,6 +72,13 @@ extern "C" { #endif +/* Internal option: enable the basic USBX error checking. This define is typically used + while debugging application. */ +#if defined(UX_ENABLE_ERROR_CHECKING) && !defined(UX_DEVICE_CLASS_HID_ENABLE_ERROR_CHECKING) +#define UX_DEVICE_CLASS_HID_ENABLE_ERROR_CHECKING +#endif + + /* Define HID Class constants. */ #define UX_HOST_CLASS_HID_CLASS 3 @@ -1089,23 +1096,69 @@ UINT _ux_host_class_hid_tasks_run(UX_HOST_CLASS *hid_class); UINT _ux_host_class_hid_idle_set_run(UX_HOST_CLASS_HID *hid, USHORT idle_time, USHORT report_id); UINT _ux_host_class_hid_report_set_run(UX_HOST_CLASS_HID *hid, UX_HOST_CLASS_HID_CLIENT_REPORT *client_report); + +UINT _uxe_host_class_hid_client_register(UCHAR *hid_client_name, + UINT (*hid_client_handler)(struct UX_HOST_CLASS_HID_CLIENT_COMMAND_STRUCT *)); + +UINT _uxe_host_class_hid_idle_get(UX_HOST_CLASS_HID *hid, USHORT *idle_time, USHORT report_id); +UINT _uxe_host_class_hid_idle_set(UX_HOST_CLASS_HID *hid, USHORT idle_time, USHORT report_id); + +UINT _uxe_host_class_hid_periodic_report_start(UX_HOST_CLASS_HID *hid); +UINT _uxe_host_class_hid_periodic_report_stop(UX_HOST_CLASS_HID *hid); + +UINT _uxe_host_class_hid_report_callback_register(UX_HOST_CLASS_HID *hid, UX_HOST_CLASS_HID_REPORT_CALLBACK *call_back); +UINT _uxe_host_class_hid_report_get(UX_HOST_CLASS_HID *hid, UX_HOST_CLASS_HID_CLIENT_REPORT *client_report); +UINT _uxe_host_class_hid_report_id_get(UX_HOST_CLASS_HID *hid, UX_HOST_CLASS_HID_REPORT_GET_ID *report_id); +UINT _uxe_host_class_hid_report_set(UX_HOST_CLASS_HID *hid, UX_HOST_CLASS_HID_CLIENT_REPORT *client_report); + +UINT _uxe_host_class_hid_idle_set_run(UX_HOST_CLASS_HID *hid, USHORT idle_time, USHORT report_id); +UINT _uxe_host_class_hid_report_set_run(UX_HOST_CLASS_HID *hid, UX_HOST_CLASS_HID_CLIENT_REPORT *client_report); + + /* Define HID Class API prototypes. */ -#define ux_host_class_hid_client_register _ux_host_class_hid_client_register #define ux_host_class_hid_client_search _ux_host_class_hid_client_search + #define ux_host_class_hid_descriptor_parse _ux_host_class_hid_descriptor_parse + #define ux_host_class_hid_entry _ux_host_class_hid_entry + +#define ux_host_class_hid_report_add _ux_host_class_hid_report_add +#define ux_host_class_hid_report_descriptor_get _ux_host_class_hid_report_descriptor_get + +#if defined(UX_DEVICE_CLASS_HID_ENABLE_ERROR_CHECKING) + +#define ux_host_class_hid_client_register _uxe_host_class_hid_client_register + +#define ux_host_class_hid_idle_get _uxe_host_class_hid_idle_get +#define ux_host_class_hid_idle_set _uxe_host_class_hid_idle_set + +#define ux_host_class_hid_periodic_report_start _uxe_host_class_hid_periodic_report_start +#define ux_host_class_hid_periodic_report_stop _uxe_host_class_hid_periodic_report_stop + +#define ux_host_class_hid_report_callback_register _uxe_host_class_hid_report_callback_register +#define ux_host_class_hid_report_id_get _uxe_host_class_hid_report_id_get +#define ux_host_class_hid_report_get _uxe_host_class_hid_report_get +#define ux_host_class_hid_report_set _uxe_host_class_hid_report_set + +#else + +#define ux_host_class_hid_client_register _ux_host_class_hid_client_register + #define ux_host_class_hid_idle_get _ux_host_class_hid_idle_get #define ux_host_class_hid_idle_set _ux_host_class_hid_idle_set + #define ux_host_class_hid_periodic_report_start _ux_host_class_hid_periodic_report_start #define ux_host_class_hid_periodic_report_stop _ux_host_class_hid_periodic_report_stop -#define ux_host_class_hid_report_add _ux_host_class_hid_report_add + #define ux_host_class_hid_report_callback_register _ux_host_class_hid_report_callback_register -#define ux_host_class_hid_report_descriptor_get _ux_host_class_hid_report_descriptor_get -#define ux_host_class_hid_report_get _ux_host_class_hid_report_get #define ux_host_class_hid_report_id_get _ux_host_class_hid_report_id_get +#define ux_host_class_hid_report_get _ux_host_class_hid_report_get #define ux_host_class_hid_report_set _ux_host_class_hid_report_set +#endif + + /* Determine if a C++ compiler is being used. If so, complete the standard C conditional started above. */ #ifdef __cplusplus diff --git a/common/usbx_host_classes/inc/ux_host_class_hid_keyboard.h b/common/usbx_host_classes/inc/ux_host_class_hid_keyboard.h index b331bf4..05ba7b0 100644 --- a/common/usbx_host_classes/inc/ux_host_class_hid_keyboard.h +++ b/common/usbx_host_classes/inc/ux_host_class_hid_keyboard.h @@ -77,6 +77,13 @@ extern "C" { #endif +/* Internal option: enable the basic USBX error checking. This define is typically used + while debugging application. */ +#if defined(UX_ENABLE_ERROR_CHECKING) && !defined(UX_DEVICE_CLASS_HID_KEYBOARD_ENABLE_ERROR_CHECKING) +#define UX_DEVICE_CLASS_HID_KEYBOARD_ENABLE_ERROR_CHECKING +#endif + + /* Define HID Keyboard Class constants. */ #define UX_HOST_CLASS_HID_KEYBOARD_BUFFER_LENGTH 128 @@ -256,12 +263,29 @@ UINT _ux_host_class_hid_keyboard_ioctl(UX_HOST_CLASS_HID_KEYBOARD *keyboard_i VOID _ux_host_class_hid_keyboard_tasks_run(UX_HOST_CLASS_HID_CLIENT *client); + +UINT _uxe_host_class_hid_keyboard_key_get(UX_HOST_CLASS_HID_KEYBOARD *keyboard_instance, + ULONG *keyboard_key, ULONG *keyboard_state); +UINT _uxe_host_class_hid_keyboard_ioctl(UX_HOST_CLASS_HID_KEYBOARD *keyboard_instance, + ULONG ioctl_function, VOID *parameter); + + /* Define HID Keyboard Class API prototypes. */ #define ux_host_class_hid_keyboard_entry _ux_host_class_hid_keyboard_entry + +#if defined(UX_DEVICE_CLASS_HID_KEYBOARD_ENABLE_ERROR_CHECKING) + +#define ux_host_class_hid_keyboard_key_get _uxe_host_class_hid_keyboard_key_get +#define ux_host_class_hid_keyboard_ioctl _uxe_host_class_hid_keyboard_ioctl + +#else + #define ux_host_class_hid_keyboard_key_get _ux_host_class_hid_keyboard_key_get #define ux_host_class_hid_keyboard_ioctl _ux_host_class_hid_keyboard_ioctl +#endif + /* Determine if a C++ compiler is being used. If so, complete the standard C conditional started above. */ #ifdef __cplusplus diff --git a/common/usbx_host_classes/inc/ux_host_class_hid_mouse.h b/common/usbx_host_classes/inc/ux_host_class_hid_mouse.h index 11ddda0..effb706 100644 --- a/common/usbx_host_classes/inc/ux_host_class_hid_mouse.h +++ b/common/usbx_host_classes/inc/ux_host_class_hid_mouse.h @@ -70,6 +70,13 @@ extern "C" { #endif +/* Internal option: enable the basic USBX error checking. This define is typically used + while debugging application. */ +#if defined(UX_ENABLE_ERROR_CHECKING) && !defined(UX_DEVICE_CLASS_HID_MOUSE_ENABLE_ERROR_CHECKING) +#define UX_DEVICE_CLASS_HID_MOUSE_ENABLE_ERROR_CHECKING +#endif + + /* Define HID Mouse Class constants. */ #define UX_HOST_CLASS_HID_MOUSE_BUFFER_LENGTH 128 @@ -125,16 +132,37 @@ UINT _ux_host_class_hid_mouse_buttons_get(UX_HOST_CLASS_HID_MOUSE *mouse_inst UINT _ux_host_class_hid_mouse_position_get(UX_HOST_CLASS_HID_MOUSE *mouse_instance, SLONG *mouse_x_position, SLONG *mouse_y_position); -UINT _ux_host_class_hid_mouse_wheel_get(UX_HOST_CLASS_HID_MOUSE *mouse_instance, +UINT _ux_host_class_hid_mouse_wheel_get(UX_HOST_CLASS_HID_MOUSE *mouse_instance, + SLONG *mouse_wheel_movement); + +UINT _uxe_host_class_hid_mouse_buttons_get(UX_HOST_CLASS_HID_MOUSE *mouse_instance, + ULONG *mouse_buttons); +UINT _uxe_host_class_hid_mouse_position_get(UX_HOST_CLASS_HID_MOUSE *mouse_instance, + SLONG *mouse_x_position, + SLONG *mouse_y_position); +UINT _uxe_host_class_hid_mouse_wheel_get(UX_HOST_CLASS_HID_MOUSE *mouse_instance, SLONG *mouse_wheel_movement); + /* Define HID Mouse Class API prototypes. */ #define ux_host_class_hid_mouse_entry _ux_host_class_hid_mouse_entry + +#if defined(UX_DEVICE_CLASS_HID_MOUSE_ENABLE_ERROR_CHECKING) + +#define ux_host_class_hid_mouse_buttons_get _uxe_host_class_hid_mouse_buttons_get +#define ux_host_class_hid_mouse_position_get _uxe_host_class_hid_mouse_position_get +#define ux_host_class_hid_mouse_wheel_get _uxe_host_class_hid_mouse_wheel_get + +#else + #define ux_host_class_hid_mouse_buttons_get _ux_host_class_hid_mouse_buttons_get #define ux_host_class_hid_mouse_position_get _ux_host_class_hid_mouse_position_get #define ux_host_class_hid_mouse_wheel_get _ux_host_class_hid_mouse_wheel_get +#endif + + /* Determine if a C++ compiler is being used. If so, complete the standard C conditional started above. */ #ifdef __cplusplus diff --git a/common/usbx_host_classes/inc/ux_host_class_hid_remote_control.h b/common/usbx_host_classes/inc/ux_host_class_hid_remote_control.h index 05a49c6..4e67b95 100644 --- a/common/usbx_host_classes/inc/ux_host_class_hid_remote_control.h +++ b/common/usbx_host_classes/inc/ux_host_class_hid_remote_control.h @@ -67,6 +67,13 @@ extern "C" { #endif +/* Internal option: enable the basic USBX error checking. This define is typically used + while debugging application. */ +#if defined(UX_ENABLE_ERROR_CHECKING) && !defined(UX_DEVICE_CLASS_HID_REMOTE_CONTROL_ENABLE_ERROR_CHECKING) +#define UX_DEVICE_CLASS_HID_REMOTE_CONTROL_ENABLE_ERROR_CHECKING +#endif + + /* Define HID Remote Control Class constants. */ #define UX_HOST_CLASS_HID_REMOTE_CONTROL_BUFFER_LENGTH 128 @@ -105,11 +112,23 @@ UINT _ux_host_class_hid_remote_control_deactivate(UX_HOST_CLASS_HID_CLIENT_CO UINT _ux_host_class_hid_remote_control_entry(UX_HOST_CLASS_HID_CLIENT_COMMAND *command); UINT _ux_host_class_hid_remote_control_usage_get(UX_HOST_CLASS_HID_REMOTE_CONTROL *remote_control_instance, ULONG *usage, ULONG *value); +UINT _uxe_host_class_hid_remote_control_usage_get(UX_HOST_CLASS_HID_REMOTE_CONTROL *remote_control_instance, ULONG *usage, ULONG *value); + + /* Define HID Keyboard Class API prototypes. */ #define ux_host_class_hid_remote_control_entry _ux_host_class_hid_remote_control_entry + +#if defined(UX_DEVICE_CLASS_HID_REMOTE_CONTROL_ENABLE_ERROR_CHECKING) + +#define ux_host_class_hid_remote_control_usage_get _uxe_host_class_hid_remote_control_usage_get + +#else + #define ux_host_class_hid_remote_control_usage_get _ux_host_class_hid_remote_control_usage_get +#endif + /* Determine if a C++ compiler is being used. If so, complete the standard C conditional started above. */ #ifdef __cplusplus diff --git a/common/usbx_host_classes/inc/ux_host_class_prolific.h b/common/usbx_host_classes/inc/ux_host_class_prolific.h index 6534f41..3262721 100644 --- a/common/usbx_host_classes/inc/ux_host_class_prolific.h +++ b/common/usbx_host_classes/inc/ux_host_class_prolific.h @@ -66,6 +66,14 @@ extern "C" { #endif + +/* Internal option: enable the basic USBX error checking. This define is typically used + while debugging application. */ +#if defined(UX_ENABLE_ERROR_CHECKING) && !defined(UX_HOST_CLASS_PROLIFIC_ENABLE_ERROR_CHECKING) +#define UX_HOST_CLASS_PROLIFIC_ENABLE_ERROR_CHECKING +#endif + + /* Define PROLIFIC Class constants. */ #define UX_HOST_CLASS_PROLIFIC_DEVICE_INIT_DELAY (1 * UX_PERIODIC_RATE) @@ -298,16 +306,45 @@ UINT _ux_host_class_prolific_reception_start (UX_HOST_CLASS_PROLIFIC *prolific, VOID _ux_host_class_prolific_reception_callback (UX_TRANSFER *transfer_request); UINT _ux_host_class_prolific_setup(UX_HOST_CLASS_PROLIFIC *prolific); + +UINT _uxe_host_class_prolific_read (UX_HOST_CLASS_PROLIFIC *prolific, UCHAR *data_pointer, + ULONG requested_length, ULONG *actual_length); +UINT _uxe_host_class_prolific_write(UX_HOST_CLASS_PROLIFIC *prolific, UCHAR *data_pointer, + ULONG requested_length, ULONG *actual_length); +UINT _uxe_host_class_prolific_ioctl(UX_HOST_CLASS_PROLIFIC *prolific, ULONG request, + VOID *parameter); +UINT _uxe_host_class_prolific_command(UX_HOST_CLASS_PROLIFIC *prolific, ULONG command, + ULONG value, UCHAR *data_buffer, ULONG data_length); +UINT _uxe_host_class_prolific_reception_stop (UX_HOST_CLASS_PROLIFIC *prolific, + UX_HOST_CLASS_PROLIFIC_RECEPTION *prolific_reception); +UINT _uxe_host_class_prolific_reception_start (UX_HOST_CLASS_PROLIFIC *prolific, + UX_HOST_CLASS_PROLIFIC_RECEPTION *prolific_reception); + + /* Define Prolific Class API prototypes. */ #define ux_host_class_prolific_entry _ux_host_class_prolific_entry +#define ux_host_class_prolific_setup _ux_host_class_prolific_setup + +#if defined(UX_HOST_CLASS_PROLIFIC_ENABLE_ERROR_CHECKING) + +#define ux_host_class_prolific_read _uxe_host_class_prolific_read +#define ux_host_class_prolific_write _uxe_host_class_prolific_write +#define ux_host_class_prolific_ioctl _uxe_host_class_prolific_ioctl +#define ux_host_class_prolific_command _uxe_host_class_prolific_command +#define ux_host_class_prolific_reception_stop _uxe_host_class_prolific_reception_stop +#define ux_host_class_prolific_reception_start _uxe_host_class_prolific_reception_start + +#else + #define ux_host_class_prolific_read _ux_host_class_prolific_read #define ux_host_class_prolific_write _ux_host_class_prolific_write #define ux_host_class_prolific_ioctl _ux_host_class_prolific_ioctl #define ux_host_class_prolific_command _ux_host_class_prolific_command #define ux_host_class_prolific_reception_stop _ux_host_class_prolific_reception_stop #define ux_host_class_prolific_reception_start _ux_host_class_prolific_reception_start -#define ux_host_class_prolific_setup _ux_host_class_prolific_setup + +#endif /* Determine if a C++ compiler is being used. If so, complete the standard C conditional started above. */ diff --git a/common/usbx_host_classes/inc/ux_host_class_swar.h b/common/usbx_host_classes/inc/ux_host_class_swar.h index e6934d7..abbf159 100644 --- a/common/usbx_host_classes/inc/ux_host_class_swar.h +++ b/common/usbx_host_classes/inc/ux_host_class_swar.h @@ -67,6 +67,13 @@ extern "C" { #endif +/* Internal option: enable the basic USBX error checking. This define is typically used + while debugging application. */ +#if defined(UX_ENABLE_ERROR_CHECKING) && !defined(UX_HOST_CLASS_SWAR_ENABLE_ERROR_CHECKING) +#define UX_HOST_CLASS_SWAR_ENABLE_ERROR_CHECKING +#endif + + /* Define Sierra Wireless AR Class constants. */ #define UX_HOST_CLASS_SWAR_CLASS_TRANSFER_TIMEOUT 300000 @@ -148,17 +155,41 @@ UINT _ux_host_class_swar_reception_stop (UX_HOST_CLASS_SWAR *swar, UX_HOST_CLASS_SWAR_RECEPTION *swar_reception); UINT _ux_host_class_swar_reception_start (UX_HOST_CLASS_SWAR *swar, UX_HOST_CLASS_SWAR_RECEPTION *swar_reception); - + + +UINT _uxe_host_class_swar_read (UX_HOST_CLASS_SWAR *swar, UCHAR *data_pointer, + ULONG requested_length, ULONG *actual_length); +UINT _uxe_host_class_swar_write(UX_HOST_CLASS_SWAR *swar, UCHAR *data_pointer, + ULONG requested_length, ULONG *actual_length); +UINT _uxe_host_class_swar_ioctl(UX_HOST_CLASS_SWAR *swar, ULONG ioctl_function, + VOID *parameter); +UINT _uxe_host_class_swar_reception_stop (UX_HOST_CLASS_SWAR *swar, + UX_HOST_CLASS_SWAR_RECEPTION *swar_reception); +UINT _uxe_host_class_swar_reception_start (UX_HOST_CLASS_SWAR *swar, + UX_HOST_CLASS_SWAR_RECEPTION *swar_reception); + /* Define SWAR Class API prototypes. */ #define ux_host_class_swar_entry _ux_host_class_swar_entry +#define ux_host_class_swar_setup _ux_host_class_swar_setup + +#if defined(UX_HOST_CLASS_SWAR_ENABLE_ERROR_CHECKING) + +#define ux_host_class_swar_read _uxe_host_class_swar_read +#define ux_host_class_swar_write _uxe_host_class_swar_write +#define ux_host_class_swar_ioctl _uxe_host_class_swar_ioctl +#define ux_host_class_swar_reception_stop _uxe_host_class_swar_reception_stop +#define ux_host_class_swar_reception_start _uxe_host_class_swar_reception_start + +#else + #define ux_host_class_swar_read _ux_host_class_swar_read #define ux_host_class_swar_write _ux_host_class_swar_write #define ux_host_class_swar_ioctl _ux_host_class_swar_ioctl -#define ux_host_class_swar_command _ux_host_class_swar_command #define ux_host_class_swar_reception_stop _ux_host_class_swar_reception_stop #define ux_host_class_swar_reception_start _ux_host_class_swar_reception_start -#define ux_host_class_swar_setup _ux_host_class_swar_setup + +#endif /* Determine if a C++ compiler is being used. If so, complete the standard C conditional started above. */ diff --git a/common/usbx_host_classes/src/ux_host_class_audio_control_get.c b/common/usbx_host_classes/src/ux_host_class_audio_control_get.c index f468d8a..64eaee7 100644 --- a/common/usbx_host_classes/src/ux_host_class_audio_control_get.c +++ b/common/usbx_host_classes/src/ux_host_class_audio_control_get.c @@ -351,3 +351,53 @@ UCHAR * control_buffer; return(status); #endif } + + +/**************************************************************************/ +/* */ +/* FUNCTION RELEASE */ +/* */ +/* _uxe_host_class_audio_control_get PORTABLE C */ +/* 6.x */ +/* AUTHOR */ +/* */ +/* Chaoqiong Xiao, Microsoft Corporation */ +/* */ +/* DESCRIPTION */ +/* */ +/* This function checks errors in audio control get function call. */ +/* */ +/* INPUT */ +/* */ +/* audio Pointer to audio class */ +/* audio_control Pointer to audio control */ +/* */ +/* OUTPUT */ +/* */ +/* Status */ +/* */ +/* CALLS */ +/* */ +/* _ux_host_class_audio_control_get Get audio control properties */ +/* */ +/* CALLED BY */ +/* */ +/* Application */ +/* */ +/* RELEASE HISTORY */ +/* */ +/* DATE NAME DESCRIPTION */ +/* */ +/* xx-xx-xxxx Chaoqiong Xiao Initial Version 6.x */ +/* */ +/**************************************************************************/ +UINT _uxe_host_class_audio_control_get(UX_HOST_CLASS_AUDIO *audio, UX_HOST_CLASS_AUDIO_CONTROL *audio_control) +{ + + /* Sanity checks. */ + if ((audio == UX_NULL) || (audio_control == UX_NULL)) + return(UX_INVALID_PARAMETER); + + /* Invoke audio control get function. */ + return(_ux_host_class_audio_control_get(audio, audio_control)); +} diff --git a/common/usbx_host_classes/src/ux_host_class_audio_control_request.c b/common/usbx_host_classes/src/ux_host_class_audio_control_request.c index 7f040f2..0f9ecf9 100644 --- a/common/usbx_host_classes/src/ux_host_class_audio_control_request.c +++ b/common/usbx_host_classes/src/ux_host_class_audio_control_request.c @@ -167,3 +167,74 @@ UINT status; /* Return completion status. */ return(status); } + + +/**************************************************************************/ +/* */ +/* FUNCTION RELEASE */ +/* */ +/* _uxe_host_class_audio_control_request PORTABLE C */ +/* 6.x */ +/* AUTHOR */ +/* */ +/* Chaoqiong Xiao, Microsoft Corporation */ +/* */ +/* DESCRIPTION */ +/* */ +/* This function checks errors in audio control request function call. */ +/* */ +/* INPUT */ +/* */ +/* audio Pointer to audio class */ +/* streaming_control 0 for control requests */ +/* 1 for streaming requests */ +/* request_type bmRequestType */ +/* request bRequest */ +/* request_value wValue can be: */ +/* (CS << 8) | CN or */ +/* (ICN << 8) | OCN or */ +/* (MU_MIXER_CONTROL << 8) | MCN */ +/* or other specific value. */ +/* spec_id Entity/Language ID (if used) */ +/* parameter Pointer to request parameters */ +/* parameter_size Request parameters length */ +/* actual_size Actual processed size */ +/* */ +/* OUTPUT */ +/* */ +/* Status */ +/* */ +/* CALLS */ +/* */ +/* _ux_host_class_audio_control_request Get audio control request */ +/* */ +/* CALLED BY */ +/* */ +/* Application */ +/* Audio Class */ +/* */ +/* RELEASE HISTORY */ +/* */ +/* DATE NAME DESCRIPTION */ +/* */ +/* xx-xx-xxxx Chaoqiong Xiao Initial Version 6.x */ +/* */ +/**************************************************************************/ +UINT _uxe_host_class_audio_control_request(UX_HOST_CLASS_AUDIO *audio, + UINT streaming_control, + UINT request_type, UINT request, + UINT request_value, + UINT spec_id, + UCHAR *parameter, ULONG parameter_size, ULONG *actual_size) +{ + + /* Sanity check. */ + if ((audio == UX_NULL)) + return(UX_INVALID_PARAMETER); + + /* Invoke audio control request function. */ + return(_ux_host_class_audio_control_request(audio, + streaming_control, + request_type, request, request_value, + spec_id, parameter, parameter_size, actual_size)); +} diff --git a/common/usbx_host_classes/src/ux_host_class_audio_control_value_get.c b/common/usbx_host_classes/src/ux_host_class_audio_control_value_get.c index 3318f3c..a2059e1 100644 --- a/common/usbx_host_classes/src/ux_host_class_audio_control_value_get.c +++ b/common/usbx_host_classes/src/ux_host_class_audio_control_value_get.c @@ -201,3 +201,54 @@ UCHAR * control_buffer; return(status); #endif } + + +/**************************************************************************/ +/* */ +/* FUNCTION RELEASE */ +/* */ +/* _uxe_host_class_audio_control_value_get PORTABLE C */ +/* 6.x */ +/* AUTHOR */ +/* */ +/* Chaoqiong Xiao, Microsoft Corporation */ +/* */ +/* DESCRIPTION */ +/* */ +/* This function checks errors in audio control value get function */ +/* call. */ +/* */ +/* INPUT */ +/* */ +/* audio Pointer to audio class */ +/* audio_control Pointer to audio control */ +/* */ +/* OUTPUT */ +/* */ +/* Status */ +/* */ +/* CALLS */ +/* */ +/* _uxe_host_class_audio_control_value_get */ +/* Get audio control value */ +/* */ +/* CALLED BY */ +/* */ +/* Application */ +/* */ +/* RELEASE HISTORY */ +/* */ +/* DATE NAME DESCRIPTION */ +/* */ +/* xx-xx-xxxx Chaoqiong Xiao Initial Version 6.x */ +/* */ +/**************************************************************************/ +UINT _uxe_host_class_audio_control_value_get(UX_HOST_CLASS_AUDIO *audio, UX_HOST_CLASS_AUDIO_CONTROL *audio_control) +{ + + if ((audio == UX_NULL) || (audio_control == UX_NULL)) + return(UX_INVALID_PARAMETER); + + /* Invoke audio control get function. */ + return(_ux_host_class_audio_control_value_get(audio, audio_control)); +} diff --git a/common/usbx_host_classes/src/ux_host_class_audio_control_value_set.c b/common/usbx_host_classes/src/ux_host_class_audio_control_value_set.c index 84d13c2..97c4ffb 100644 --- a/common/usbx_host_classes/src/ux_host_class_audio_control_value_set.c +++ b/common/usbx_host_classes/src/ux_host_class_audio_control_value_set.c @@ -263,3 +263,54 @@ UCHAR * control_buffer; return(status); #endif } + + +/**************************************************************************/ +/* */ +/* FUNCTION RELEASE */ +/* */ +/* _uxe_host_class_audio_control_value_set PORTABLE C */ +/* 6.x */ +/* AUTHOR */ +/* */ +/* Chaoqiong Xiao, Microsoft Corporation */ +/* */ +/* DESCRIPTION */ +/* */ +/* This function checks errors in audio control value set function */ +/* call. */ +/* */ +/* INPUT */ +/* */ +/* audio Pointer to audio class */ +/* audio_control Pointer to audio control */ +/* */ +/* OUTPUT */ +/* */ +/* Status */ +/* */ +/* CALLS */ +/* */ +/* _uxe_host_class_audio_control_value_set */ +/* Set audio control value */ +/* */ +/* CALLED BY */ +/* */ +/* Application */ +/* */ +/* RELEASE HISTORY */ +/* */ +/* DATE NAME DESCRIPTION */ +/* */ +/* xx-xx-xxxx Chaoqiong Xiao Initial Version 6.x */ +/* */ +/**************************************************************************/ +UINT _uxe_host_class_audio_control_value_set(UX_HOST_CLASS_AUDIO *audio, UX_HOST_CLASS_AUDIO_CONTROL *audio_control) +{ + + if ((audio == UX_NULL) || (audio_control == UX_NULL)) + return(UX_INVALID_PARAMETER); + + /* Invoke audio control set function. */ + return(_ux_host_class_audio_control_value_set(audio, audio_control)); +} diff --git a/common/usbx_host_classes/src/ux_host_class_audio_descriptors_parse.c b/common/usbx_host_classes/src/ux_host_class_audio_descriptors_parse.c index cf8e326..0170b31 100644 --- a/common/usbx_host_classes/src/ux_host_class_audio_descriptors_parse.c +++ b/common/usbx_host_classes/src/ux_host_class_audio_descriptors_parse.c @@ -35,14 +35,14 @@ /* FUNCTION RELEASE */ /* */ /* _ux_host_class_audio_descriptors_parse PORTABLE C */ -/* 6.1.12 */ +/* 6.x */ /* AUTHOR */ /* */ /* Chaoqiong Xiao, Microsoft Corporation */ /* */ /* DESCRIPTION */ /* */ -/* This function parsees all interface descriptors and their audio */ +/* This function parses all interface descriptors and their audio */ /* class specific descriptors relates to current audio instance. */ /* */ /* The function scans the device configuration descriptor. Once the */ @@ -79,6 +79,8 @@ /* DATE NAME DESCRIPTION */ /* */ /* 07-29-2022 Chaoqiong Xiao Initial Version 6.1.12 */ +/* xx-xx-xxxx Chaoqiong Xiao Modified comment(s), */ +/* resulting in version 6.x */ /* */ /**************************************************************************/ UINT _ux_host_class_audio_descriptors_parse(UX_HOST_CLASS_AUDIO *audio, @@ -204,3 +206,62 @@ UINT status; /* We get here when all descriptors scanned. */ return(UX_SUCCESS); } + + +/**************************************************************************/ +/* */ +/* FUNCTION RELEASE */ +/* */ +/* _uxe_host_class_audio_descriptors_parse PORTABLE C */ +/* 6.x */ +/* AUTHOR */ +/* */ +/* Chaoqiong Xiao, Microsoft Corporation */ +/* */ +/* DESCRIPTION */ +/* */ +/* This function checks errors in audio descriptors parse function */ +/* call. */ +/* */ +/* INPUT */ +/* */ +/* audio Pointer to audio instance */ +/* parse_function Parse function for each */ +/* audio class descriptor */ +/* arg Parse function argument */ +/* */ +/* OUTPUT */ +/* */ +/* Status */ +/* */ +/* CALLS */ +/* */ +/* _uxe_host_class_audio_descriptors_parse */ +/* Parse audio descriptors */ +/* */ +/* CALLED BY */ +/* */ +/* Application */ +/* */ +/* RELEASE HISTORY */ +/* */ +/* DATE NAME DESCRIPTION */ +/* */ +/* xx-xx-xxxx Chaoqiong Xiao Initial Version 6.x */ +/* */ +/**************************************************************************/ +UINT _uxe_host_class_audio_descriptors_parse(UX_HOST_CLASS_AUDIO *audio, + UINT(*parse_function)(VOID *arg, + UCHAR *packed_interface_descriptor, + UCHAR *packed_endpoint_descriptor, + UCHAR *packed_audio_descriptor), + VOID* arg) +{ + + /* Sanity checks. */ + if ((audio == UX_NULL) || (parse_function == UX_NULL)) + return(UX_INVALID_PARAMETER); + + /* Invoke audio descriptor parse function. */ + return(_ux_host_class_audio_descriptors_parse(audio, parse_function, arg)); +} diff --git a/common/usbx_host_classes/src/ux_host_class_audio_entity_control_get.c b/common/usbx_host_classes/src/ux_host_class_audio_entity_control_get.c index 22f0618..a17eb54 100644 --- a/common/usbx_host_classes/src/ux_host_class_audio_entity_control_get.c +++ b/common/usbx_host_classes/src/ux_host_class_audio_entity_control_get.c @@ -334,3 +334,55 @@ ULONG n_subs, sub, pos, min, max, res, size; /* Return completion status. */ return(status); } + + +/**************************************************************************/ +/* */ +/* FUNCTION RELEASE */ +/* */ +/* _uxe_host_class_audio_entity_control_get PORTABLE C */ +/* 6.x */ +/* AUTHOR */ +/* */ +/* Chaoqiong Xiao, Microsoft Corporation */ +/* */ +/* DESCRIPTION */ +/* */ +/* This function checks errors in audio entity control get function */ +/* call. */ +/* */ +/* INPUT */ +/* */ +/* audio Pointer to audio class */ +/* audio_control Pointer to audio control */ +/* */ +/* OUTPUT */ +/* */ +/* Status */ +/* */ +/* CALLS */ +/* */ +/* _uxe_host_class_audio_entity_control_get */ +/* Get audio entity control */ +/* */ +/* CALLED BY */ +/* */ +/* Application */ +/* */ +/* RELEASE HISTORY */ +/* */ +/* DATE NAME DESCRIPTION */ +/* */ +/* xx-xx-xxxx Chaoqiong Xiao Initial Version 6.x */ +/* */ +/**************************************************************************/ +UINT _uxe_host_class_audio_entity_control_get(UX_HOST_CLASS_AUDIO *audio, UX_HOST_CLASS_AUDIO_CONTROL *audio_control) +{ + + /* Sanity checks. */ + if ((audio == UX_NULL) || (audio_control == UX_NULL)) + return(UX_INVALID_PARAMETER); + + /* Invoke entity control get function. */ + return(_ux_host_class_audio_entity_control_get(audio, audio_control)); +} diff --git a/common/usbx_host_classes/src/ux_host_class_audio_entity_control_value_get.c b/common/usbx_host_classes/src/ux_host_class_audio_entity_control_value_get.c index 7652437..948a3f4 100644 --- a/common/usbx_host_classes/src/ux_host_class_audio_entity_control_value_get.c +++ b/common/usbx_host_classes/src/ux_host_class_audio_entity_control_value_get.c @@ -151,3 +151,55 @@ ULONG actual_size; /* Return completion status. */ return(status); } + + +/**************************************************************************/ +/* */ +/* FUNCTION RELEASE */ +/* */ +/* _uxe_host_class_audio_entity_control_value_get PORTABLE C */ +/* 6.x */ +/* AUTHOR */ +/* */ +/* Chaoqiong Xiao, Microsoft Corporation */ +/* */ +/* DESCRIPTION */ +/* */ +/* This function checks errors in audio entity control value get */ +/* function call. */ +/* */ +/* INPUT */ +/* */ +/* audio Pointer to audio class */ +/* audio_control Pointer to audio control */ +/* */ +/* OUTPUT */ +/* */ +/* Status */ +/* */ +/* CALLS */ +/* */ +/* _uxe_host_class_audio_entity_control_value_get */ +/* Get audio entity control */ +/* */ +/* CALLED BY */ +/* */ +/* Application */ +/* */ +/* RELEASE HISTORY */ +/* */ +/* DATE NAME DESCRIPTION */ +/* */ +/* xx-xx-xxxx Chaoqiong Xiao Initial Version 6.x */ +/* */ +/**************************************************************************/ +UINT _uxe_host_class_audio_entity_control_value_get(UX_HOST_CLASS_AUDIO *audio, UX_HOST_CLASS_AUDIO_CONTROL *audio_control) +{ + + /* Sanity checks. */ + if ((audio == UX_NULL) || (audio_control == UX_NULL)) + return(UX_INVALID_PARAMETER); + + /* Invoke entity control get function. */ + return(_ux_host_class_audio_entity_control_value_get(audio, audio_control)); +} diff --git a/common/usbx_host_classes/src/ux_host_class_audio_entity_control_value_set.c b/common/usbx_host_classes/src/ux_host_class_audio_entity_control_value_set.c index f846e53..16e9088 100644 --- a/common/usbx_host_classes/src/ux_host_class_audio_entity_control_value_set.c +++ b/common/usbx_host_classes/src/ux_host_class_audio_entity_control_value_set.c @@ -141,3 +141,55 @@ ULONG actual_size; /* Return completion status. */ return(status); } + + +/**************************************************************************/ +/* */ +/* FUNCTION RELEASE */ +/* */ +/* _uxe_host_class_audio_entity_control_value_set PORTABLE C */ +/* 6.x */ +/* AUTHOR */ +/* */ +/* Chaoqiong Xiao, Microsoft Corporation */ +/* */ +/* DESCRIPTION */ +/* */ +/* This function checks errors in audio entity control value set */ +/* function call. */ +/* */ +/* INPUT */ +/* */ +/* audio Pointer to audio class */ +/* audio_control Pointer to audio control */ +/* */ +/* OUTPUT */ +/* */ +/* Status */ +/* */ +/* CALLS */ +/* */ +/* _uxe_host_class_audio_entity_control_value_set */ +/* Set audio entity control */ +/* */ +/* CALLED BY */ +/* */ +/* Application */ +/* */ +/* RELEASE HISTORY */ +/* */ +/* DATE NAME DESCRIPTION */ +/* */ +/* xx-xx-xxxx Chaoqiong Xiao Initial Version 6.x */ +/* */ +/**************************************************************************/ +UINT _uxe_host_class_audio_entity_control_value_set(UX_HOST_CLASS_AUDIO *audio, UX_HOST_CLASS_AUDIO_CONTROL *audio_control) +{ + + /* Sanity checks. */ + if ((audio == UX_NULL) || (audio_control == UX_NULL)) + return(UX_INVALID_PARAMETER); + + /* Invoke entity control set function. */ + return(_ux_host_class_audio_entity_control_value_set(audio, audio_control)); +} diff --git a/common/usbx_host_classes/src/ux_host_class_audio_feedback_get.c b/common/usbx_host_classes/src/ux_host_class_audio_feedback_get.c index 78cfea0..2b5bea1 100644 --- a/common/usbx_host_classes/src/ux_host_class_audio_feedback_get.c +++ b/common/usbx_host_classes/src/ux_host_class_audio_feedback_get.c @@ -98,3 +98,54 @@ UINT _ux_host_class_audio_feedback_get(UX_HOST_CLASS_AUDIO *audio, UCHAR *feedb return(UX_SUCCESS); #endif } + + +/**************************************************************************/ +/* */ +/* FUNCTION RELEASE */ +/* */ +/* _uxe_host_class_audio_feedback_get PORTABLE C */ +/* 6.x */ +/* AUTHOR */ +/* */ +/* Chaoqiong Xiao, Microsoft Corporation */ +/* */ +/* DESCRIPTION */ +/* */ +/* This function checks errors in audio feedback get function call. */ +/* */ +/* INPUT */ +/* */ +/* audio Pointer to audio class */ +/* feedback Pointer to buffer to fill */ +/* packed feedback data */ +/* */ +/* OUTPUT */ +/* */ +/* Status */ +/* */ +/* CALLS */ +/* */ +/* _uxe_host_class_audio_feedback_get Get audio feedback */ +/* */ +/* CALLED BY */ +/* */ +/* Application */ +/* */ +/* RELEASE HISTORY */ +/* */ +/* DATE NAME DESCRIPTION */ +/* */ +/* xx-xx-xxxx Chaoqiong Xiao Initial Version 6.x */ +/* */ +/**************************************************************************/ +UINT _uxe_host_class_audio_feedback_get(UX_HOST_CLASS_AUDIO *audio, UCHAR *feedback) +{ + + /* Sanity checks. */ + if ((audio == UX_NULL) || (feedback == UX_NULL)) + return(UX_INVALID_PARAMETER); + + /* Invoke audio feedback get function. */ + return(_ux_host_class_audio_feedback_get(audio, feedback)); +} diff --git a/common/usbx_host_classes/src/ux_host_class_audio_feedback_set.c b/common/usbx_host_classes/src/ux_host_class_audio_feedback_set.c index bc61c2c..69eb990 100644 --- a/common/usbx_host_classes/src/ux_host_class_audio_feedback_set.c +++ b/common/usbx_host_classes/src/ux_host_class_audio_feedback_set.c @@ -115,3 +115,54 @@ UX_TRANSFER *transfer; return(UX_SUCCESS); #endif } + + +/**************************************************************************/ +/* */ +/* FUNCTION RELEASE */ +/* */ +/* _uxe_host_class_audio_feedback_set PORTABLE C */ +/* 6.x */ +/* AUTHOR */ +/* */ +/* Chaoqiong Xiao, Microsoft Corporation */ +/* */ +/* DESCRIPTION */ +/* */ +/* This function checks errors in audio feedback set function call. */ +/* */ +/* INPUT */ +/* */ +/* audio Pointer to audio class */ +/* feedback Pointer to buffer to fill */ +/* packed feedback data */ +/* */ +/* OUTPUT */ +/* */ +/* Status */ +/* */ +/* CALLS */ +/* */ +/* _uxe_host_class_audio_feedback_set Set audio feedback */ +/* */ +/* CALLED BY */ +/* */ +/* Application */ +/* */ +/* RELEASE HISTORY */ +/* */ +/* DATE NAME DESCRIPTION */ +/* */ +/* xx-xx-xxxx Chaoqiong Xiao Initial Version 6.x */ +/* */ +/**************************************************************************/ +UINT _uxe_host_class_audio_feedback_set(UX_HOST_CLASS_AUDIO *audio, UCHAR *feedback) +{ + + /* Sanity checks. */ + if ((audio == UX_NULL) || (feedback == UX_NULL)) + return(UX_INVALID_PARAMETER); + + /* Invoke audio feedback set function. */ + return(_ux_host_class_audio_feedback_set(audio, feedback)); +} diff --git a/common/usbx_host_classes/src/ux_host_class_audio_interrupt_start.c b/common/usbx_host_classes/src/ux_host_class_audio_interrupt_start.c index 11b9edd..ddeb6c3 100644 --- a/common/usbx_host_classes/src/ux_host_class_audio_interrupt_start.c +++ b/common/usbx_host_classes/src/ux_host_class_audio_interrupt_start.c @@ -138,3 +138,61 @@ UINT status; return(status); #endif } + + +/**************************************************************************/ +/* */ +/* FUNCTION RELEASE */ +/* */ +/* _uxe_host_class_audio_interrupt_start PORTABLE C */ +/* 6.x */ +/* AUTHOR */ +/* */ +/* Chaoqiong Xiao, Microsoft Corporation */ +/* */ +/* DESCRIPTION */ +/* */ +/* This function checks errors in audio interrupt start function call. */ +/* */ +/* INPUT */ +/* */ +/* audio Pointer to audio control (AC) */ +/* instance */ +/* callback_function Callback function invoked on */ +/* interrupt message reception */ +/* arg Callback argument passed to */ +/* callback function */ +/* */ +/* OUTPUT */ +/* */ +/* Status */ +/* */ +/* CALLS */ +/* */ +/* _uxe_host_class_audio_interrupt_start Start audio interrupt polling */ +/* */ +/* CALLED BY */ +/* */ +/* Application */ +/* */ +/* RELEASE HISTORY */ +/* */ +/* DATE NAME DESCRIPTION */ +/* */ +/* xx-xx-xxxx Chaoqiong Xiao Initial Version 6.x */ +/* */ +/**************************************************************************/ +UINT _uxe_host_class_audio_interrupt_start(UX_HOST_CLASS_AUDIO_AC *audio, + VOID(*callback_function)(UX_HOST_CLASS_AUDIO_AC *audio, + UCHAR *message, ULONG length, + VOID *arg), + VOID *arg) +{ + + /* Sanity checks. */ + if (audio == UX_NULL) + return(UX_INVALID_PARAMETER); + + /* Invoke interrupt start function. */ + return(_ux_host_class_audio_interrupt_start(audio, callback_function, arg)); +} diff --git a/common/usbx_host_classes/src/ux_host_class_audio_raw_sampling_parse.c b/common/usbx_host_classes/src/ux_host_class_audio_raw_sampling_parse.c index 62407e9..94d793a 100644 --- a/common/usbx_host_classes/src/ux_host_class_audio_raw_sampling_parse.c +++ b/common/usbx_host_classes/src/ux_host_class_audio_raw_sampling_parse.c @@ -745,3 +745,63 @@ UINT status; return(status); } #endif /* defined(UX_HOST_CLASS_AUDIO_2_SUPPORT) */ + + +/**************************************************************************/ +/* */ +/* FUNCTION RELEASE */ +/* */ +/* _uxe_host_class_audio_raw_sampling_parse PORTABLE C */ +/* 6.x */ +/* AUTHOR */ +/* */ +/* Chaoqiong Xiao, Microsoft Corporation */ +/* */ +/* DESCRIPTION */ +/* */ +/* This function checks errors in audio RAW sampling parse function */ +/* call. */ +/* */ +/* INPUT */ +/* */ +/* audio Pointer to audio control (AC) */ +/* instance */ +/* callback_function Callback function invoked on */ +/* interrupt message reception */ +/* arg Callback argument passed to */ +/* callback function */ +/* */ +/* OUTPUT */ +/* */ +/* Status */ +/* */ +/* CALLS */ +/* */ +/* _ux_host_class_audio_raw_sampling_parse */ +/* Parse RAW sampling properties */ +/* */ +/* CALLED BY */ +/* */ +/* Application */ +/* */ +/* RELEASE HISTORY */ +/* */ +/* DATE NAME DESCRIPTION */ +/* */ +/* xx-xx-xxxx Chaoqiong Xiao Initial Version 6.x */ +/* */ +/**************************************************************************/ +UINT _uxe_host_class_audio_raw_sampling_parse(UX_HOST_CLASS_AUDIO *audio, + UINT(*parse_function)(VOID *arg, + UCHAR *packed_interface_descriptor, + UX_HOST_CLASS_AUDIO_SAMPLING_CHARACTERISTICS *sam_attr), + VOID* arg) +{ + + /* Sanity checks. */ + if ((audio == UX_NULL) || (parse_function == UX_NULL)) + return(UX_INVALID_PARAMETER); + + /* Invoke sampling characteristics parse function. */ + return(_ux_host_class_audio_raw_sampling_parse(audio, parse_function, arg)); +} diff --git a/common/usbx_host_classes/src/ux_host_class_audio_read.c b/common/usbx_host_classes/src/ux_host_class_audio_read.c index 920ba9f..b7654b9 100644 --- a/common/usbx_host_classes/src/ux_host_class_audio_read.c +++ b/common/usbx_host_classes/src/ux_host_class_audio_read.c @@ -148,3 +148,53 @@ ULONG mps; /* Return completion status. */ return(status); } + + +/**************************************************************************/ +/* */ +/* FUNCTION RELEASE */ +/* */ +/* _uxe_host_class_audio_read PORTABLE C */ +/* 6.x */ +/* AUTHOR */ +/* */ +/* Chaoqiong Xiao, Microsoft Corporation */ +/* */ +/* DESCRIPTION */ +/* */ +/* This function checks errors in audio read function call. */ +/* */ +/* INPUT */ +/* */ +/* audio Pointer to audio class */ +/* audio_transfer_request Pointer to transfer request */ +/* */ +/* OUTPUT */ +/* */ +/* Status */ +/* */ +/* CALLS */ +/* */ +/* _ux_host_class_audio_read Hook a audio read request */ +/* */ +/* CALLED BY */ +/* */ +/* Application */ +/* */ +/* RELEASE HISTORY */ +/* */ +/* DATE NAME DESCRIPTION */ +/* */ +/* xx-xx-xxxx Chaoqiong Xiao Initial Version 6.x */ +/* */ +/**************************************************************************/ +UINT _uxe_host_class_audio_read(UX_HOST_CLASS_AUDIO *audio, UX_HOST_CLASS_AUDIO_TRANSFER_REQUEST *audio_transfer_request) +{ + + /* Sanity checks. */ + if ((UX_NULL == audio) || (audio_transfer_request == UX_NULL)) + return(UX_INVALID_PARAMETER); + + /* Invoke audio read function. */ + return(_ux_host_class_audio_read(audio, audio_transfer_request)); +} diff --git a/common/usbx_host_classes/src/ux_host_class_audio_stop.c b/common/usbx_host_classes/src/ux_host_class_audio_stop.c index 0b8791c..5c33ffa 100644 --- a/common/usbx_host_classes/src/ux_host_class_audio_stop.c +++ b/common/usbx_host_classes/src/ux_host_class_audio_stop.c @@ -167,3 +167,52 @@ UINT streaming_interface; /* Return failed completion status. */ return(UX_NO_ALTERNATE_SETTING); } + + +/**************************************************************************/ +/* */ +/* FUNCTION RELEASE */ +/* */ +/* _uxe_host_class_audio_stop PORTABLE C */ +/* 6.x */ +/* AUTHOR */ +/* */ +/* Chaoqiong Xiao, Microsoft Corporation */ +/* */ +/* DESCRIPTION */ +/* */ +/* This function checks errors in audio stop function call. */ +/* */ +/* INPUT */ +/* */ +/* audio Pointer to audio class */ +/* */ +/* OUTPUT */ +/* */ +/* Status */ +/* */ +/* CALLS */ +/* */ +/* _ux_host_class_audio_stop Hook a audio stop request */ +/* */ +/* CALLED BY */ +/* */ +/* Application */ +/* */ +/* RELEASE HISTORY */ +/* */ +/* DATE NAME DESCRIPTION */ +/* */ +/* xx-xx-xxxx Chaoqiong Xiao Initial Version 6.x */ +/* */ +/**************************************************************************/ +UINT _uxe_host_class_audio_stop(UX_HOST_CLASS_AUDIO *audio) +{ + + /* Sanity check. */ + if (audio == UX_NULL) + return(UX_INVALID_PARAMETER); + + /* Invoke audio stop function. */ + return(_ux_host_class_audio_stop(audio)); +} diff --git a/common/usbx_host_classes/src/ux_host_class_audio_streaming_sampling_get.c b/common/usbx_host_classes/src/ux_host_class_audio_streaming_sampling_get.c index d5fbf64..5c9c1af 100644 --- a/common/usbx_host_classes/src/ux_host_class_audio_streaming_sampling_get.c +++ b/common/usbx_host_classes/src/ux_host_class_audio_streaming_sampling_get.c @@ -404,3 +404,54 @@ UINT previous_match_found; return(UX_NO_ALTERNATE_SETTING); } + +/**************************************************************************/ +/* */ +/* FUNCTION RELEASE */ +/* */ +/* _uxe_host_class_audio_streaming_sampling_get PORTABLE C */ +/* 6.x */ +/* AUTHOR */ +/* */ +/* Chaoqiong Xiao, Microsoft Corporation */ +/* */ +/* DESCRIPTION */ +/* */ +/* This function checks errors in audio sampling characteristics get */ +/* function call. */ +/* */ +/* INPUT */ +/* */ +/* audio Pointer to audio class */ +/* audio_sampling Pointer to audio sampling */ +/* */ +/* OUTPUT */ +/* */ +/* Status */ +/* */ +/* CALLS */ +/* */ +/* _ux_host_class_audio_streaming_sampling_get */ +/* Get sampling characteristics */ +/* */ +/* CALLED BY */ +/* */ +/* Application */ +/* */ +/* RELEASE HISTORY */ +/* */ +/* DATE NAME DESCRIPTION */ +/* */ +/* xx-xx-xxxx Chaoqiong Xiao Initial Version 6.x */ +/* */ +/**************************************************************************/ +UINT _uxe_host_class_audio_streaming_sampling_get(UX_HOST_CLASS_AUDIO *audio, UX_HOST_CLASS_AUDIO_SAMPLING_CHARACTERISTICS *audio_sampling) +{ + + /* Sanity checks. */ + if ((audio == UX_NULL) || (audio_sampling == UX_NULL)) + return(UX_INVALID_PARAMETER); + + /* Invoke sampling characteristics get function. */ + return(_ux_host_class_audio_streaming_sampling_get(audio, audio_sampling)); +} diff --git a/common/usbx_host_classes/src/ux_host_class_audio_streaming_sampling_set.c b/common/usbx_host_classes/src/ux_host_class_audio_streaming_sampling_set.c index 7a97642..c7731b8 100644 --- a/common/usbx_host_classes/src/ux_host_class_audio_streaming_sampling_set.c +++ b/common/usbx_host_classes/src/ux_host_class_audio_streaming_sampling_set.c @@ -386,3 +386,55 @@ ULONG res_bytes; /* We get here if we could not get the right alternate setting. */ return(UX_NO_ALTERNATE_SETTING); } + + +/**************************************************************************/ +/* */ +/* FUNCTION RELEASE */ +/* */ +/* _uxe_host_class_audio_streaming_sampling_set PORTABLE C */ +/* 6.x */ +/* AUTHOR */ +/* */ +/* Chaoqiong Xiao, Microsoft Corporation */ +/* */ +/* DESCRIPTION */ +/* */ +/* This function checks errors in audio sampling characteristics set */ +/* function call. */ +/* */ +/* INPUT */ +/* */ +/* audio Pointer to audio class */ +/* audio_sampling Pointer to audio sampling */ +/* */ +/* OUTPUT */ +/* */ +/* Status */ +/* */ +/* CALLS */ +/* */ +/* _ux_host_class_audio_streaming_sampling_set */ +/* Set sampling characteristics */ +/* */ +/* CALLED BY */ +/* */ +/* Application */ +/* */ +/* RELEASE HISTORY */ +/* */ +/* DATE NAME DESCRIPTION */ +/* */ +/* xx-xx-xxxx Chaoqiong Xiao Initial Version 6.x */ +/* */ +/**************************************************************************/ +UINT _uxe_host_class_audio_streaming_sampling_set(UX_HOST_CLASS_AUDIO *audio, UX_HOST_CLASS_AUDIO_SAMPLING *audio_sampling) +{ + + /* Sanity checks. */ + if ((audio == UX_NULL) || (audio_sampling == UX_NULL)) + return(UX_INVALID_PARAMETER); + + /* Invoke sampling characteristics set function. */ + return(_ux_host_class_audio_streaming_sampling_set(audio, audio_sampling)); +} diff --git a/common/usbx_host_classes/src/ux_host_class_audio_write.c b/common/usbx_host_classes/src/ux_host_class_audio_write.c index 51ea4ea..f2724f8 100644 --- a/common/usbx_host_classes/src/ux_host_class_audio_write.c +++ b/common/usbx_host_classes/src/ux_host_class_audio_write.c @@ -144,3 +144,53 @@ ULONG mps; /* Return completion status. */ return(status); } + + +/**************************************************************************/ +/* */ +/* FUNCTION RELEASE */ +/* */ +/* _uxe_host_class_audio_write PORTABLE C */ +/* 6.x */ +/* AUTHOR */ +/* */ +/* Chaoqiong Xiao, Microsoft Corporation */ +/* */ +/* DESCRIPTION */ +/* */ +/* This function checks errors in audio write function call. */ +/* */ +/* INPUT */ +/* */ +/* audio Pointer to audio class */ +/* audio_transfer_request Pointer to transfer request */ +/* */ +/* OUTPUT */ +/* */ +/* Status */ +/* */ +/* CALLS */ +/* */ +/* _ux_host_class_audio_write Hook a audio write request */ +/* */ +/* CALLED BY */ +/* */ +/* Application */ +/* */ +/* RELEASE HISTORY */ +/* */ +/* DATE NAME DESCRIPTION */ +/* */ +/* xx-xx-xxxx Chaoqiong Xiao Initial Version 6.x */ +/* */ +/**************************************************************************/ +UINT _uxe_host_class_audio_write(UX_HOST_CLASS_AUDIO *audio, UX_HOST_CLASS_AUDIO_TRANSFER_REQUEST *audio_transfer_request) +{ + + /* Sanity checks. */ + if ((UX_NULL == audio) || (audio_transfer_request == UX_NULL)) + return(UX_INVALID_PARAMETER); + + /* Invoke audio write function. */ + return(_ux_host_class_audio_write(audio, audio_transfer_request)); +} diff --git a/common/usbx_host_classes/src/ux_host_class_cdc_acm_command.c b/common/usbx_host_classes/src/ux_host_class_cdc_acm_command.c index dfa8028..e0f92f2 100644 --- a/common/usbx_host_classes/src/ux_host_class_cdc_acm_command.c +++ b/common/usbx_host_classes/src/ux_host_class_cdc_acm_command.c @@ -209,3 +209,59 @@ ULONG request_direction; /* Return completion status. */ return(status); } + + +/**************************************************************************/ +/* */ +/* FUNCTION RELEASE */ +/* */ +/* _uxe_host_class_cdc_acm_command PORTABLE C */ +/* 6.x */ +/* AUTHOR */ +/* */ +/* Chaoqiong Xiao, Microsoft Corporation */ +/* */ +/* DESCRIPTION */ +/* */ +/* This function checks errors in CDC ACM command function call. */ +/* */ +/* INPUT */ +/* */ +/* cdc_acm Pointer to CDC ACM class */ +/* command command value */ +/* value value to be sent in the */ +/* command request */ +/* data_buffer buffer to be sent */ +/* data_length length of the buffer to send */ +/* */ +/* OUTPUT */ +/* */ +/* Status */ +/* */ +/* CALLS */ +/* */ +/* _ux_host_class_cdc_acm_command Send CDC ACM request */ +/* */ +/* CALLED BY */ +/* */ +/* Application */ +/* CDC ACM Class */ +/* */ +/* RELEASE HISTORY */ +/* */ +/* DATE NAME DESCRIPTION */ +/* */ +/* xx-xx-xxxx Chaoqiong Xiao Initial Version 6.x */ +/* */ +/**************************************************************************/ +UINT _uxe_host_class_cdc_acm_command(UX_HOST_CLASS_CDC_ACM *cdc_acm, ULONG command, + ULONG value, UCHAR *data_buffer, ULONG data_length) +{ + + /* Sanity check. */ + if (cdc_acm == UX_NULL) + return(UX_INVALID_PARAMETER); + + /* Invoke CDC ACM command send function. */ + return(_ux_host_class_cdc_acm_command(cdc_acm, command, value, data_buffer, data_length)); +} diff --git a/common/usbx_host_classes/src/ux_host_class_cdc_acm_ioctl.c b/common/usbx_host_classes/src/ux_host_class_cdc_acm_ioctl.c index eed2056..4f1a8fd 100644 --- a/common/usbx_host_classes/src/ux_host_class_cdc_acm_ioctl.c +++ b/common/usbx_host_classes/src/ux_host_class_cdc_acm_ioctl.c @@ -35,7 +35,7 @@ /* FUNCTION RELEASE */ /* */ /* _ux_host_class_cdc_acm_ioctl PORTABLE C */ -/* 6.1.10 */ +/* 6.x */ /* AUTHOR */ /* */ /* Chaoqiong Xiao, Microsoft Corporation */ @@ -48,7 +48,7 @@ /* */ /* INPUT */ /* */ -/* acm Pointer to acm class */ +/* cdc_acm Pointer to CDC ACM class */ /* ioctl_function ioctl function */ /* parameter pointer to structure */ /* */ @@ -79,6 +79,8 @@ /* 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), */ +/* resulting in version 6.x */ /* */ /**************************************************************************/ UINT _ux_host_class_cdc_acm_ioctl(UX_HOST_CLASS_CDC_ACM *cdc_acm, ULONG ioctl_function, @@ -340,3 +342,55 @@ UX_TRANSFER *transfer; return(status); } + +/**************************************************************************/ +/* */ +/* FUNCTION RELEASE */ +/* */ +/* _uxe_host_class_cdc_acm_ioctl PORTABLE C */ +/* 6.x */ +/* AUTHOR */ +/* */ +/* Chaoqiong Xiao, Microsoft Corporation */ +/* */ +/* DESCRIPTION */ +/* */ +/* This function checks errors in CDC ACM ioctl function call. */ +/* */ +/* INPUT */ +/* */ +/* cdc_acm Pointer to CDC ACM class */ +/* ioctl_function ioctl function */ +/* parameter pointer to structure */ +/* */ +/* OUTPUT */ +/* */ +/* Status */ +/* */ +/* CALLS */ +/* */ +/* _ux_host_class_cdc_acm_ioctl CDC ACM ioctl */ +/* */ +/* CALLED BY */ +/* */ +/* Application */ +/* */ +/* RELEASE HISTORY */ +/* */ +/* DATE NAME DESCRIPTION */ +/* */ +/* xx-xx-xxxx Chaoqiong Xiao Initial Version 6.x */ +/* */ +/**************************************************************************/ +UINT _uxe_host_class_cdc_acm_ioctl(UX_HOST_CLASS_CDC_ACM *cdc_acm, ULONG ioctl_function, + VOID *parameter) +{ + + /* Sanity checks. */ + if (cdc_acm == UX_NULL) + return(UX_INVALID_PARAMETER); + + /* Invoke CDC ACM ioctl function. */ + return(_ux_host_class_cdc_acm_ioctl(cdc_acm, ioctl_function, parameter)); + +} diff --git a/common/usbx_host_classes/src/ux_host_class_cdc_acm_read.c b/common/usbx_host_classes/src/ux_host_class_cdc_acm_read.c index ad3093e..4bb0c5c 100644 --- a/common/usbx_host_classes/src/ux_host_class_cdc_acm_read.c +++ b/common/usbx_host_classes/src/ux_host_class_cdc_acm_read.c @@ -232,3 +232,55 @@ ULONG transfer_flags; return(UX_SUCCESS); } + +/**************************************************************************/ +/* */ +/* FUNCTION RELEASE */ +/* */ +/* _uxe_host_class_cdc_acm_read PORTABLE C */ +/* 6.x */ +/* AUTHOR */ +/* */ +/* Chaoqiong Xiao, Microsoft Corporation */ +/* */ +/* DESCRIPTION */ +/* */ +/* This function checks errors in CDC ACM read function call. */ +/* */ +/* INPUT */ +/* */ +/* cdc_acm Pointer to CDC ACM class */ +/* data_pointer Pointer to buffer */ +/* requested_length Requested data read */ +/* actual_length Actual data read */ +/* */ +/* OUTPUT */ +/* */ +/* Status */ +/* */ +/* CALLS */ +/* */ +/* _ux_host_class_cdc_acm_read CDC ACM read */ +/* */ +/* CALLED BY */ +/* */ +/* Application */ +/* */ +/* RELEASE HISTORY */ +/* */ +/* DATE NAME DESCRIPTION */ +/* */ +/* xx-xx-xxxx Chaoqiong Xiao Initial Version 6.x */ +/* */ +/**************************************************************************/ +UINT _uxe_host_class_cdc_acm_read (UX_HOST_CLASS_CDC_ACM *cdc_acm, UCHAR *data_pointer, + ULONG requested_length, ULONG *actual_length) +{ + + /* Sanity checks. */ + if ((cdc_acm == UX_NULL) || (data_pointer == UX_NULL) || (actual_length == UX_NULL)) + return(UX_INVALID_PARAMETER); + + /* Invoke CDC ACM read function. */ + return(_ux_host_class_cdc_acm_read(cdc_acm, data_pointer, requested_length, actual_length)); +} diff --git a/common/usbx_host_classes/src/ux_host_class_cdc_acm_reception_start.c b/common/usbx_host_classes/src/ux_host_class_cdc_acm_reception_start.c index a74276f..547176a 100644 --- a/common/usbx_host_classes/src/ux_host_class_cdc_acm_reception_start.c +++ b/common/usbx_host_classes/src/ux_host_class_cdc_acm_reception_start.c @@ -142,3 +142,54 @@ UINT status; return(status); } + +/**************************************************************************/ +/* */ +/* FUNCTION RELEASE */ +/* */ +/* _uxe_host_class_cdc_acm_reception_start PORTABLE C */ +/* 6.x */ +/* AUTHOR */ +/* */ +/* Chaoqiong Xiao, Microsoft Corporation */ +/* */ +/* DESCRIPTION */ +/* */ +/* This function checks errors in CDC ACM reception function call. */ +/* */ +/* INPUT */ +/* */ +/* cdc_acm Pointer to CDC ACM class */ +/* cdc_acm_reception Pointer to reception struct */ +/* */ +/* OUTPUT */ +/* */ +/* Status */ +/* */ +/* CALLS */ +/* */ +/* _ux_host_class_cdc_acm_reception_start */ +/* CDC ACM reception start */ +/* */ +/* CALLED BY */ +/* */ +/* Application */ +/* */ +/* RELEASE HISTORY */ +/* */ +/* DATE NAME DESCRIPTION */ +/* */ +/* xx-xx-xxxx Chaoqiong Xiao Initial Version 6.x */ +/* */ +/**************************************************************************/ +UINT _uxe_host_class_cdc_acm_reception_start (UX_HOST_CLASS_CDC_ACM *cdc_acm, + UX_HOST_CLASS_CDC_ACM_RECEPTION *cdc_acm_reception) +{ + + /* Sanity checks. */ + if ((cdc_acm == UX_NULL) || (cdc_acm_reception == UX_NULL)) + return(UX_INVALID_PARAMETER); + + /* Invoke CDC ACM reception start function. */ + return(_ux_host_class_cdc_acm_reception_start(cdc_acm, cdc_acm_reception)); +} diff --git a/common/usbx_host_classes/src/ux_host_class_cdc_acm_reception_stop.c b/common/usbx_host_classes/src/ux_host_class_cdc_acm_reception_stop.c index 99f6063..7030a40 100644 --- a/common/usbx_host_classes/src/ux_host_class_cdc_acm_reception_stop.c +++ b/common/usbx_host_classes/src/ux_host_class_cdc_acm_reception_stop.c @@ -140,3 +140,53 @@ UX_TRANSFER *transfer_request; return(UX_SUCCESS); } + +/**************************************************************************/ +/* */ +/* FUNCTION RELEASE */ +/* */ +/* _uxe_host_class_cdc_acm_reception_stop PORTABLE C */ +/* 6.x */ +/* AUTHOR */ +/* */ +/* Chaoqiong Xiao, Microsoft Corporation */ +/* */ +/* DESCRIPTION */ +/* */ +/* This function checks errors in CDC ACM reception function call. */ +/* */ +/* INPUT */ +/* */ +/* cdc_acm Pointer to CDC ACM class */ +/* cdc_acm_reception Pointer to reception struct */ +/* */ +/* OUTPUT */ +/* */ +/* Status */ +/* */ +/* CALLS */ +/* */ +/* _ux_host_class_cdc_acm_reception_stop CDC ACM reception stop */ +/* */ +/* CALLED BY */ +/* */ +/* Application */ +/* */ +/* RELEASE HISTORY */ +/* */ +/* DATE NAME DESCRIPTION */ +/* */ +/* xx-xx-xxxx Chaoqiong Xiao Initial Version 6.x */ +/* */ +/**************************************************************************/ +UINT _uxe_host_class_cdc_acm_reception_stop(UX_HOST_CLASS_CDC_ACM *cdc_acm, + UX_HOST_CLASS_CDC_ACM_RECEPTION *cdc_acm_reception) +{ + + /* Sanity checks. */ + if ((cdc_acm == UX_NULL) || (cdc_acm_reception == UX_NULL)) + return(UX_INVALID_PARAMETER); + + /* Invoke CDC ACM reception function. */ + return(_ux_host_class_cdc_acm_reception_stop(cdc_acm, cdc_acm_reception)); +} 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 be58e0f..5bf47e7 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 @@ -248,3 +248,59 @@ ULONG transfer_flags; return(UX_SUCCESS); } + +/**************************************************************************/ +/* */ +/* FUNCTION RELEASE */ +/* */ +/* _uxe_host_class_cdc_acm_write PORTABLE C */ +/* 6.x */ +/* AUTHOR */ +/* */ +/* Chaoqiong Xiao, Microsoft Corporation */ +/* */ +/* DESCRIPTION */ +/* */ +/* This function checks errors in CDC ACM write function call. */ +/* */ +/* INPUT */ +/* */ +/* cdc_acm Pointer to CDC ACM class */ +/* data_pointer Pointer to data to write */ +/* requested_length Length of data to write */ +/* actual_length Actual length of data written */ +/* */ +/* OUTPUT */ +/* */ +/* Status */ +/* */ +/* CALLS */ +/* */ +/* _ux_host_class_cdc_acm_write CDC ACM write */ +/* */ +/* CALLED BY */ +/* */ +/* Application */ +/* */ +/* RELEASE HISTORY */ +/* */ +/* DATE NAME DESCRIPTION */ +/* */ +/* xx-xx-xxxx Chaoqiong Xiao Initial Version 6.x */ +/* */ +/**************************************************************************/ +UINT _uxe_host_class_cdc_acm_write(UX_HOST_CLASS_CDC_ACM *cdc_acm, UCHAR *data_pointer, + ULONG requested_length, ULONG *actual_length) +{ + + /* Sanity checks. */ + if ((cdc_acm == UX_NULL) || + ((data_pointer == UX_NULL) && (requested_length != 0)) || + (actual_length == UX_NULL)) + { + return(UX_INVALID_PARAMETER); + } + + /* Invoke CDC ACM write function. */ + return(_ux_host_class_cdc_acm_write(cdc_acm, data_pointer, requested_length, actual_length)); +} diff --git a/common/usbx_host_classes/src/ux_host_class_cdc_acm_write_with_callback.c b/common/usbx_host_classes/src/ux_host_class_cdc_acm_write_with_callback.c index 596a51f..a9dfa11 100644 --- a/common/usbx_host_classes/src/ux_host_class_cdc_acm_write_with_callback.c +++ b/common/usbx_host_classes/src/ux_host_class_cdc_acm_write_with_callback.c @@ -160,4 +160,60 @@ ULONG transfer_request_length; return((status == UX_STATE_WAIT) ? UX_SUCCESS : transfer_request -> ux_transfer_request_completion_code); } + + +/**************************************************************************/ +/* */ +/* FUNCTION RELEASE */ +/* */ +/* _uxe_host_class_cdc_acm_write_with_callback PORTABLE C */ +/* 6.x */ +/* AUTHOR */ +/* */ +/* Chaoqiong Xiao, Microsoft Corporation */ +/* */ +/* DESCRIPTION */ +/* */ +/* This function checks errors in CDC ACM write function call. */ +/* */ +/* INPUT */ +/* */ +/* cdc_acm Pointer to CDC ACM class */ +/* data_pointer Pointer to data to write */ +/* requested_length Length of data to write */ +/* */ +/* OUTPUT */ +/* */ +/* Status */ +/* */ +/* CALLS */ +/* */ +/* _ux_host_class_cdc_acm_write_with_callback */ +/* CDC ACM write with callback */ +/* */ +/* CALLED BY */ +/* */ +/* Application */ +/* */ +/* RELEASE HISTORY */ +/* */ +/* DATE NAME DESCRIPTION */ +/* */ +/* xx-xx-xxxx Chaoqiong Xiao Initial Version 6.x */ +/* */ +/**************************************************************************/ +UINT _uxe_host_class_cdc_acm_write_with_callback(UX_HOST_CLASS_CDC_ACM *cdc_acm, + UCHAR *data_pointer, ULONG requested_length) +{ + + /* Sanity checks. */ + if ((cdc_acm == UX_NULL) || + ((data_pointer == UX_NULL) && (requested_length != 0))) + { + return(UX_INVALID_PARAMETER); + } + + /* Invoke CDC ACM write with callback function. */ + return(_ux_host_class_cdc_acm_write_with_callback(cdc_acm, data_pointer, requested_length)); +} #endif diff --git a/common/usbx_host_classes/src/ux_host_class_gser_command.c b/common/usbx_host_classes/src/ux_host_class_gser_command.c index cf9e0c8..a4e300c 100644 --- a/common/usbx_host_classes/src/ux_host_class_gser_command.c +++ b/common/usbx_host_classes/src/ux_host_class_gser_command.c @@ -166,3 +166,58 @@ ULONG request_direction; return(status); } + +/**************************************************************************/ +/* */ +/* FUNCTION RELEASE */ +/* */ +/* _uxe_host_class_gser_command PORTABLE C */ +/* 6.x */ +/* AUTHOR */ +/* */ +/* Chaoqiong Xiao, Microsoft Corporation */ +/* */ +/* DESCRIPTION */ +/* */ +/* This function checks errors in GSER command function call. */ +/* */ +/* INPUT */ +/* */ +/* gser Pointer to GSER class */ +/* command command value */ +/* value value to be sent in the */ +/* command request */ +/* data_buffer buffer to be sent */ +/* data_length length of the buffer to send */ +/* */ +/* OUTPUT */ +/* */ +/* Status */ +/* */ +/* CALLS */ +/* */ +/* _ux_host_class_gser_command Send GSER request */ +/* */ +/* CALLED BY */ +/* */ +/* Application */ +/* */ +/* RELEASE HISTORY */ +/* */ +/* DATE NAME DESCRIPTION */ +/* */ +/* xx-xx-xxxx Chaoqiong Xiao Initial Version 6.x */ +/* */ +/**************************************************************************/ +UINT _uxe_host_class_gser_command(UX_HOST_CLASS_GSER *gser, ULONG interface_index, ULONG command, + ULONG value, UCHAR *data_buffer, ULONG data_length) +{ + + /* Sanity check. */ + if (gser == UX_NULL) + return(UX_INVALID_PARAMETER); + + /* Invoke GSER command function. */ + return(_ux_host_class_gser_command(gser, interface_index, + command, value, data_buffer, data_length)); +} diff --git a/common/usbx_host_classes/src/ux_host_class_gser_ioctl.c b/common/usbx_host_classes/src/ux_host_class_gser_ioctl.c index 4458c6a..8e359bf 100644 --- a/common/usbx_host_classes/src/ux_host_class_gser_ioctl.c +++ b/common/usbx_host_classes/src/ux_host_class_gser_ioctl.c @@ -48,7 +48,7 @@ /* */ /* INPUT */ /* */ -/* acm Pointer to acm class */ +/* gser Pointer to gser class */ /* ioctl_function ioctl function */ /* parameter pointer to structure */ /* */ @@ -287,3 +287,54 @@ ULONG value; return(status); } + +/**************************************************************************/ +/* */ +/* FUNCTION RELEASE */ +/* */ +/* _uxe_host_class_gser_ioctl PORTABLE C */ +/* 6.x */ +/* AUTHOR */ +/* */ +/* Chaoqiong Xiao, Microsoft Corporation */ +/* */ +/* DESCRIPTION */ +/* */ +/* This function checks errors in GSER ioctl function call. */ +/* */ +/* INPUT */ +/* */ +/* gser Pointer to GSER class */ +/* ioctl_function ioctl function */ +/* parameter pointer to structure */ +/* */ +/* OUTPUT */ +/* */ +/* Status */ +/* */ +/* CALLS */ +/* */ +/* _ux_host_class_gser_ioctl GSER ioctl */ +/* */ +/* CALLED BY */ +/* */ +/* Application */ +/* */ +/* RELEASE HISTORY */ +/* */ +/* DATE NAME DESCRIPTION */ +/* */ +/* xx-xx-xxxx Chaoqiong Xiao Initial Version 6.x */ +/* */ +/**************************************************************************/ +UINT _uxe_host_class_gser_ioctl(UX_HOST_CLASS_GSER *gser, ULONG interface_index, ULONG ioctl_function, + VOID *parameter) +{ + + /* Sanity check. */ + if (gser == UX_NULL) + return(UX_INVALID_PARAMETER); + + /* Invoke GSER ioctl function. */ + return(_ux_host_class_gser_ioctl(gser, interface_index, ioctl_function, parameter)); +} diff --git a/common/usbx_host_classes/src/ux_host_class_gser_read.c b/common/usbx_host_classes/src/ux_host_class_gser_read.c index 3b2b700..f1bba72 100644 --- a/common/usbx_host_classes/src/ux_host_class_gser_read.c +++ b/common/usbx_host_classes/src/ux_host_class_gser_read.c @@ -217,3 +217,60 @@ ULONG transfer_request_length; return(UX_SUCCESS); } + +/**************************************************************************/ +/* */ +/* FUNCTION RELEASE */ +/* */ +/* _uxe_host_class_gser_read PORTABLE C */ +/* 6.x */ +/* AUTHOR */ +/* */ +/* Chaoqiong Xiao, Microsoft Corporation */ +/* */ +/* DESCRIPTION */ +/* */ +/* This function checks errors in GSER read function call. */ +/* */ +/* INPUT */ +/* */ +/* gser Pointer to GSER class */ +/* data_pointer Pointer to buffer */ +/* requested_length Requested data read */ +/* actual_length Actual data read */ +/* */ +/* OUTPUT */ +/* */ +/* Status */ +/* */ +/* CALLS */ +/* */ +/* _ux_host_class_gser_read GSER read */ +/* */ +/* CALLED BY */ +/* */ +/* Application */ +/* */ +/* RELEASE HISTORY */ +/* */ +/* DATE NAME DESCRIPTION */ +/* */ +/* xx-xx-xxxx Chaoqiong Xiao Initial Version 6.x */ +/* */ +/**************************************************************************/ +UINT _uxe_host_class_gser_read(UX_HOST_CLASS_GSER *gser, + ULONG interface_index, + UCHAR *data_pointer, + ULONG requested_length, + ULONG *actual_length) +{ + + /* Sanity checks. */ + if ((gser == UX_NULL) || (data_pointer == UX_NULL) || (actual_length == UX_NULL)) + { + return(UX_INVALID_PARAMETER); + } + + /* Invoke GSER read function. */ + return(_ux_host_class_gser_read(gser, interface_index, data_pointer, requested_length, actual_length)); +} diff --git a/common/usbx_host_classes/src/ux_host_class_gser_reception_start.c b/common/usbx_host_classes/src/ux_host_class_gser_reception_start.c index 4642b2e..bdd8150 100644 --- a/common/usbx_host_classes/src/ux_host_class_gser_reception_start.c +++ b/common/usbx_host_classes/src/ux_host_class_gser_reception_start.c @@ -135,3 +135,54 @@ ULONG interface_index; return(status); } + +/**************************************************************************/ +/* */ +/* FUNCTION RELEASE */ +/* */ +/* _uxe_host_class_gser_reception_start PORTABLE C */ +/* 6.x */ +/* AUTHOR */ +/* */ +/* Chaoqiong Xiao, Microsoft Corporation */ +/* */ +/* DESCRIPTION */ +/* */ +/* This function checks errors in CDC ACM reception function call. */ +/* */ +/* INPUT */ +/* */ +/* gser Pointer to CDC ACM class */ +/* gser_reception Pointer to reception struct */ +/* */ +/* OUTPUT */ +/* */ +/* Status */ +/* */ +/* CALLS */ +/* */ +/* _ux_host_class_gser_reception_start */ +/* GSER reception start */ +/* */ +/* CALLED BY */ +/* */ +/* Application */ +/* */ +/* RELEASE HISTORY */ +/* */ +/* DATE NAME DESCRIPTION */ +/* */ +/* xx-xx-xxxx Chaoqiong Xiao Initial Version 6.x */ +/* */ +/**************************************************************************/ +UINT _uxe_host_class_gser_reception_start (UX_HOST_CLASS_GSER *gser, + UX_HOST_CLASS_GSER_RECEPTION *gser_reception) +{ + + /* Sanity checks. */ + if ((gser == UX_NULL) || (gser_reception == UX_NULL)) + return(UX_INVALID_PARAMETER); + + /* Invoke CDC ACM reception start function. */ + return(_ux_host_class_gser_reception_start(gser, gser_reception)); +} diff --git a/common/usbx_host_classes/src/ux_host_class_gser_reception_stop.c b/common/usbx_host_classes/src/ux_host_class_gser_reception_stop.c index c0cda17..c5d8ecc 100644 --- a/common/usbx_host_classes/src/ux_host_class_gser_reception_stop.c +++ b/common/usbx_host_classes/src/ux_host_class_gser_reception_stop.c @@ -111,3 +111,53 @@ ULONG interface_index; return(UX_SUCCESS); } + +/**************************************************************************/ +/* */ +/* FUNCTION RELEASE */ +/* */ +/* _uxe_host_class_gser_reception_stop PORTABLE C */ +/* 6.x */ +/* AUTHOR */ +/* */ +/* Chaoqiong Xiao, Microsoft Corporation */ +/* */ +/* DESCRIPTION */ +/* */ +/* This function checks errors in CDC ACM reception function call. */ +/* */ +/* INPUT */ +/* */ +/* gser Pointer to CDC ACM class */ +/* gser_reception Pointer to reception struct */ +/* */ +/* OUTPUT */ +/* */ +/* Status */ +/* */ +/* CALLS */ +/* */ +/* _ux_host_class_gser_reception_stop GSER reception stop */ +/* */ +/* CALLED BY */ +/* */ +/* Application */ +/* */ +/* RELEASE HISTORY */ +/* */ +/* DATE NAME DESCRIPTION */ +/* */ +/* xx-xx-xxxx Chaoqiong Xiao Initial Version 6.x */ +/* */ +/**************************************************************************/ +UINT _uxe_host_class_gser_reception_stop (UX_HOST_CLASS_GSER *gser, + UX_HOST_CLASS_GSER_RECEPTION *gser_reception) +{ + + /* Sanity checks. */ + if ((gser == UX_NULL) || (gser_reception == UX_NULL)) + return(UX_INVALID_PARAMETER); + + /* Invoke CDC ACM reception stop function. */ + return(_ux_host_class_gser_reception_stop(gser, gser_reception)); +} diff --git a/common/usbx_host_classes/src/ux_host_class_gser_write.c b/common/usbx_host_classes/src/ux_host_class_gser_write.c index 4a6c3e6..d2b4e4a 100644 --- a/common/usbx_host_classes/src/ux_host_class_gser_write.c +++ b/common/usbx_host_classes/src/ux_host_class_gser_write.c @@ -211,3 +211,62 @@ ULONG transfer_request_length; return(UX_SUCCESS); } + +/**************************************************************************/ +/* */ +/* FUNCTION RELEASE */ +/* */ +/* _uxe_host_class_gser_write PORTABLE C */ +/* 6.x */ +/* AUTHOR */ +/* */ +/* Chaoqiong Xiao, Microsoft Corporation */ +/* */ +/* DESCRIPTION */ +/* */ +/* This function checks errors in GSER write function call. */ +/* */ +/* INPUT */ +/* */ +/* gser Pointer to GSER class */ +/* data_pointer Pointer to buffer */ +/* requested_length Requested data write */ +/* actual_length Actual data write */ +/* */ +/* OUTPUT */ +/* */ +/* Status */ +/* */ +/* CALLS */ +/* */ +/* _ux_host_class_gser_write GSER write */ +/* */ +/* CALLED BY */ +/* */ +/* Application */ +/* */ +/* RELEASE HISTORY */ +/* */ +/* DATE NAME DESCRIPTION */ +/* */ +/* xx-xx-xxxx Chaoqiong Xiao Initial Version 6.x */ +/* */ +/**************************************************************************/ +UINT _uxe_host_class_gser_write(UX_HOST_CLASS_GSER *gser, + ULONG interface_index, + UCHAR *data_pointer, + ULONG requested_length, + ULONG *actual_length) +{ + + /* Sanity checks. */ + if ((gser == UX_NULL) || + ((data_pointer == UX_NULL) && (requested_length != 0)) || + (actual_length == UX_NULL)) + { + return(UX_INVALID_PARAMETER); + } + + /* Invoke GSER write function. */ + return(_ux_host_class_gser_write(gser, interface_index, data_pointer, requested_length, actual_length)); +} diff --git a/common/usbx_host_classes/src/ux_host_class_hid_client_register.c b/common/usbx_host_classes/src/ux_host_class_hid_client_register.c index 680efa8..3497abe 100644 --- a/common/usbx_host_classes/src/ux_host_class_hid_client_register.c +++ b/common/usbx_host_classes/src/ux_host_class_hid_client_register.c @@ -189,3 +189,52 @@ UINT client_name_length = 0; return(UX_MEMORY_ARRAY_FULL); } +/**************************************************************************/ +/* */ +/* FUNCTION RELEASE */ +/* */ +/* _uxe_host_class_hid_client_register PORTABLE C */ +/* 6.x */ +/* AUTHOR */ +/* */ +/* Chaoqiong Xiao, Microsoft Corporation */ +/* */ +/* DESCRIPTION */ +/* */ +/* This function checks errors in HID client register function call. */ +/* */ +/* INPUT */ +/* */ +/* hid_client_name Name of HID client */ +/* hid_client_handler Handler for HID client */ +/* */ +/* OUTPUT */ +/* */ +/* Status */ +/* */ +/* CALLS */ +/* */ +/* _ux_host_class_hid_client_register Register an HID client */ +/* */ +/* CALLED BY */ +/* */ +/* Application */ +/* */ +/* RELEASE HISTORY */ +/* */ +/* DATE NAME DESCRIPTION */ +/* */ +/* xx-xx-xxxx Chaoqiong Xiao Initial Version 6.x */ +/* */ +/**************************************************************************/ +UINT _uxe_host_class_hid_client_register(UCHAR *hid_client_name, + UINT (*hid_client_handler)(struct UX_HOST_CLASS_HID_CLIENT_COMMAND_STRUCT *)) +{ + + /* Sanity checks. */ + if ((hid_client_name == UX_NULL) || (hid_client_handler == UX_NULL)) + return(UX_INVALID_PARAMETER); + + /* Invoke client register function. */ + return(_ux_host_class_hid_client_register(hid_client_name, hid_client_handler)); +} diff --git a/common/usbx_host_classes/src/ux_host_class_hid_idle_get.c b/common/usbx_host_classes/src/ux_host_class_hid_idle_get.c index c4922c1..d748966 100644 --- a/common/usbx_host_classes/src/ux_host_class_hid_idle_get.c +++ b/common/usbx_host_classes/src/ux_host_class_hid_idle_get.c @@ -209,3 +209,53 @@ UINT status; /* Return the completion status. */ return(status); } + +/**************************************************************************/ +/* */ +/* FUNCTION RELEASE */ +/* */ +/* _uxe_host_class_hid_report_idle_get PORTABLE C */ +/* 6.x */ +/* AUTHOR */ +/* */ +/* Chaoqiong Xiao, Microsoft Corporation */ +/* */ +/* DESCRIPTION */ +/* */ +/* This function checks errors in HID idle get function call. */ +/* */ +/* INPUT */ +/* */ +/* hid Pointer to HID class */ +/* idle_time Idle time */ +/* report_id Report ID */ +/* */ +/* OUTPUT */ +/* */ +/* Status */ +/* */ +/* CALLS */ +/* */ +/* _ux_host_class_hid_idle_get Get idle rate */ +/* */ +/* CALLED BY */ +/* */ +/* Application */ +/* */ +/* RELEASE HISTORY */ +/* */ +/* DATE NAME DESCRIPTION */ +/* */ +/* xx-xx-xxxx Chaoqiong Xiao Initial Version 6.x */ +/* */ +/**************************************************************************/ +UINT _uxe_host_class_hid_idle_get(UX_HOST_CLASS_HID *hid, USHORT *idle_time, USHORT report_id) +{ + + /* Sanity checks. */ + if ((hid == UX_NULL) || (idle_time == UX_NULL)) + return(UX_INVALID_PARAMETER); + + /* Invoke idle get function. */ + return(_ux_host_class_hid_idle_get(hid, idle_time, report_id)); +} diff --git a/common/usbx_host_classes/src/ux_host_class_hid_idle_set.c b/common/usbx_host_classes/src/ux_host_class_hid_idle_set.c index c407bbd..64662fb 100644 --- a/common/usbx_host_classes/src/ux_host_class_hid_idle_set.c +++ b/common/usbx_host_classes/src/ux_host_class_hid_idle_set.c @@ -149,3 +149,53 @@ UINT status; return(status); #endif } + +/**************************************************************************/ +/* */ +/* FUNCTION RELEASE */ +/* */ +/* _uxe_host_class_hid_idle_set PORTABLE C */ +/* 6.x */ +/* AUTHOR */ +/* */ +/* Chaoqiong Xiao, Microsoft Corporation */ +/* */ +/* DESCRIPTION */ +/* */ +/* This function checks errors in HID IDLE set function call. */ +/* */ +/* INPUT */ +/* */ +/* hid Pointer to HID class */ +/* idle_time Idle time */ +/* report_id Report ID */ +/* */ +/* OUTPUT */ +/* */ +/* Status */ +/* */ +/* CALLS */ +/* */ +/* _ux_host_class_hid_idle_set Issue SET_IDLE to device */ +/* */ +/* CALLED BY */ +/* */ +/* Application */ +/* */ +/* RELEASE HISTORY */ +/* */ +/* DATE NAME DESCRIPTION */ +/* */ +/* xx-xx-xxxx Chaoqiong Xiao Initial Version 6.x */ +/* */ +/**************************************************************************/ +UINT _uxe_host_class_hid_idle_set(UX_HOST_CLASS_HID *hid, USHORT idle_time, USHORT report_id) +{ + + /* Sanity check. */ + if (hid == UX_NULL) + return(UX_INVALID_PARAMETER); + + /* Invoke IDLE set function. */ + return(_ux_host_class_hid_idle_set(hid, idle_time, report_id)); +} diff --git a/common/usbx_host_classes/src/ux_host_class_hid_idle_set_run.c b/common/usbx_host_classes/src/ux_host_class_hid_idle_set_run.c index fa8d87d..3c5d9aa 100644 --- a/common/usbx_host_classes/src/ux_host_class_hid_idle_set_run.c +++ b/common/usbx_host_classes/src/ux_host_class_hid_idle_set_run.c @@ -178,4 +178,54 @@ UINT status; /* Return the function status. */ return(status); } + +/**************************************************************************/ +/* */ +/* FUNCTION RELEASE */ +/* */ +/* _uxe_host_class_hid_idle_set_run PORTABLE C */ +/* 6.x */ +/* AUTHOR */ +/* */ +/* Chaoqiong Xiao, Microsoft Corporation */ +/* */ +/* DESCRIPTION */ +/* */ +/* This function checks errors in HID idle set function call. */ +/* */ +/* INPUT */ +/* */ +/* hid Pointer to HID class */ +/* idle_time Idle time */ +/* report_id Report ID */ +/* */ +/* OUTPUT */ +/* */ +/* Status */ +/* */ +/* CALLS */ +/* */ +/* _ux_host_class_hid_idle_set_run Get idle rate */ +/* */ +/* CALLED BY */ +/* */ +/* Application */ +/* */ +/* RELEASE HISTORY */ +/* */ +/* DATE NAME DESCRIPTION */ +/* */ +/* xx-xx-xxxx Chaoqiong Xiao Initial Version 6.x */ +/* */ +/**************************************************************************/ +UINT _uxe_host_class_hid_idle_set_run(UX_HOST_CLASS_HID *hid, USHORT idle_time, USHORT report_id) +{ + + /* Sanity check. */ + if (hid == UX_NULL) + return(UX_STATE_ERROR); + + /* Invoke idle set function. */ + return(_ux_host_class_hid_idle_set_run(hid, idle_time, report_id)); +} #endif diff --git a/common/usbx_host_classes/src/ux_host_class_hid_keyboard_ioctl.c b/common/usbx_host_classes/src/ux_host_class_hid_keyboard_ioctl.c index 46aad27..47f532c 100644 --- a/common/usbx_host_classes/src/ux_host_class_hid_keyboard_ioctl.c +++ b/common/usbx_host_classes/src/ux_host_class_hid_keyboard_ioctl.c @@ -124,3 +124,53 @@ UINT status = UX_SUCCESS; return(status); } +/**************************************************************************/ +/* */ +/* FUNCTION RELEASE */ +/* */ +/* _uxe_host_class_hid_keyboard_ioctl PORTABLE C */ +/* 6.x */ +/* AUTHOR */ +/* */ +/* Chaoqiong Xiao, Microsoft Corporation */ +/* */ +/* DESCRIPTION */ +/* */ +/* This function checks errors in HID keyboard ioctl function call. */ +/* */ +/* INPUT */ +/* */ +/* keyboard_instance Pointer to hid keyboard */ +/* ioctl_function IOCTL function */ +/* parameter Pointer to parameter/structure */ +/* */ +/* OUTPUT */ +/* */ +/* Status */ +/* */ +/* CALLS */ +/* */ +/* _ux_host_class_hid_keyboard_ioctl IOCTL function */ +/* */ +/* CALLED BY */ +/* */ +/* Application */ +/* */ +/* RELEASE HISTORY */ +/* */ +/* DATE NAME DESCRIPTION */ +/* */ +/* xx-xx-xxxx Chaoqiong Xiao Initial Version 6.x */ +/* */ +/**************************************************************************/ +UINT _uxe_host_class_hid_keyboard_ioctl(UX_HOST_CLASS_HID_KEYBOARD *keyboard_instance, + ULONG ioctl_function, VOID *parameter) +{ + + /* Sanity checks. */ + if (keyboard_instance == UX_NULL) + return(UX_INVALID_PARAMETER); + + /* Invoke report ID get function. */ + return(_ux_host_class_hid_keyboard_ioctl(keyboard_instance, ioctl_function, parameter)); +} diff --git a/common/usbx_host_classes/src/ux_host_class_hid_keyboard_key_get.c b/common/usbx_host_classes/src/ux_host_class_hid_keyboard_key_get.c index ea5e69c..3e18fea 100644 --- a/common/usbx_host_classes/src/ux_host_class_hid_keyboard_key_get.c +++ b/common/usbx_host_classes/src/ux_host_class_hid_keyboard_key_get.c @@ -123,3 +123,55 @@ UX_HOST_CLASS_HID *hid; return(UX_SUCCESS); } +/**************************************************************************/ +/* */ +/* FUNCTION RELEASE */ +/* */ +/* _uxe_host_class_hid_keyboard_key_get PORTABLE C */ +/* 6.x */ +/* AUTHOR */ +/* */ +/* Chaoqiong Xiao, Microsoft Corporation */ +/* */ +/* DESCRIPTION */ +/* */ +/* This function checks errors in HID key get function call. */ +/* */ +/* INPUT */ +/* */ +/* keyboard_instance Pointer to remote control */ +/* keyboard key Pointer to keyboard key */ +/* keyboard state Pointer to keyboard state */ +/* */ +/* OUTPUT */ +/* */ +/* Status */ +/* */ +/* CALLS */ +/* */ +/* _ux_host_class_hid_keyboard_key_get Get a keyboard key */ +/* */ +/* CALLED BY */ +/* */ +/* Application */ +/* */ +/* RELEASE HISTORY */ +/* */ +/* DATE NAME DESCRIPTION */ +/* */ +/* xx-xx-xxxx Chaoqiong Xiao Initial Version 6.x */ +/* */ +/**************************************************************************/ +UINT _uxe_host_class_hid_keyboard_key_get(UX_HOST_CLASS_HID_KEYBOARD *keyboard_instance, + ULONG *keyboard_key, ULONG *keyboard_state) +{ + + /* Sanity checks. */ + if ((keyboard_instance == UX_NULL) || + (keyboard_key == UX_NULL) || (keyboard_state == UX_NULL) || + (keyboard_key == keyboard_state)) + return(UX_INVALID_PARAMETER); + + /* Invoke key get function. */ + return(_ux_host_class_hid_keyboard_key_get(keyboard_instance, keyboard_key, keyboard_state)); +} diff --git a/common/usbx_host_classes/src/ux_host_class_hid_mouse_buttons_get.c b/common/usbx_host_classes/src/ux_host_class_hid_mouse_buttons_get.c index d1e5295..d6cdc14 100644 --- a/common/usbx_host_classes/src/ux_host_class_hid_mouse_buttons_get.c +++ b/common/usbx_host_classes/src/ux_host_class_hid_mouse_buttons_get.c @@ -100,3 +100,53 @@ UX_HOST_CLASS_HID *hid; return(UX_SUCCESS); } +/**************************************************************************/ +/* */ +/* FUNCTION RELEASE */ +/* */ +/* _uxe_host_class_hid_mouse_buttons_get PORTABLE C */ +/* 6.x */ +/* AUTHOR */ +/* */ +/* Chaoqiong Xiao, Microsoft Corporation */ +/* */ +/* DESCRIPTION */ +/* */ +/* This function checks errors in HID mouse buttons get function call. */ +/* */ +/* INPUT */ +/* */ +/* mouse_instance Pointer to mouse instance */ +/* mouse_buttons Current Mouse Buttons */ +/* */ +/* OUTPUT */ +/* */ +/* Status */ +/* */ +/* CALLS */ +/* */ +/* _ux_host_class_hid_mouse_buttons_get Get mouse buttons */ +/* */ +/* CALLED BY */ +/* */ +/* Application */ +/* */ +/* RELEASE HISTORY */ +/* */ +/* DATE NAME DESCRIPTION */ +/* */ +/* xx-xx-xxxx Chaoqiong Xiao Initial Version 6.x */ +/* */ +/**************************************************************************/ +UINT _uxe_host_class_hid_mouse_buttons_get(UX_HOST_CLASS_HID_MOUSE *mouse_instance, + ULONG *mouse_buttons) +{ + + /* Sanity checks. */ + if ((mouse_instance == UX_NULL) || (mouse_buttons == UX_NULL)) + return(UX_INVALID_PARAMETER); + + /* Invoke mouse buttons get function. */ + return(_ux_host_class_hid_mouse_buttons_get(mouse_instance, mouse_buttons)); + +} diff --git a/common/usbx_host_classes/src/ux_host_class_hid_mouse_position_get.c b/common/usbx_host_classes/src/ux_host_class_hid_mouse_position_get.c index df28dc1..3c4425f 100644 --- a/common/usbx_host_classes/src/ux_host_class_hid_mouse_position_get.c +++ b/common/usbx_host_classes/src/ux_host_class_hid_mouse_position_get.c @@ -106,3 +106,59 @@ UX_HOST_CLASS_HID *hid; return(UX_SUCCESS); } +/**************************************************************************/ +/* */ +/* FUNCTION RELEASE */ +/* */ +/* _uxe_host_class_hid_mouse_position_get PORTABLE C */ +/* 6.x */ +/* AUTHOR */ +/* */ +/* Chaoqiong Xiao, Microsoft Corporation */ +/* */ +/* DESCRIPTION */ +/* */ +/* This function checks errors in HID mouse position get function call.*/ +/* */ +/* INPUT */ +/* */ +/* mouse_instance Pointer to mouse instance */ +/* mouse_x_position Current Mouse X Position */ +/* mouse_y_position Current Mouse Y Position */ +/* */ +/* OUTPUT */ +/* */ +/* Status */ +/* */ +/* CALLS */ +/* */ +/* _ux_host_class_hid_mouse_position_get Get mouse position */ +/* */ +/* CALLED BY */ +/* */ +/* Application */ +/* */ +/* RELEASE HISTORY */ +/* */ +/* DATE NAME DESCRIPTION */ +/* */ +/* xx-xx-xxxx Chaoqiong Xiao Initial Version 6.x */ +/* */ +/**************************************************************************/ +UINT _uxe_host_class_hid_mouse_position_get(UX_HOST_CLASS_HID_MOUSE *mouse_instance, + SLONG *mouse_x_position, + SLONG *mouse_y_position) +{ + + /* Sanity checks. */ + if ((mouse_instance == UX_NULL) || + (mouse_x_position == UX_NULL) || (mouse_y_position == UX_NULL) || + (mouse_x_position == mouse_y_position)) + { + return(UX_INVALID_PARAMETER); + } + + /* Invoke position get function. */ + return(_ux_host_class_hid_mouse_position_get(mouse_instance, + mouse_x_position, mouse_y_position)); +} diff --git a/common/usbx_host_classes/src/ux_host_class_hid_mouse_wheel_get.c b/common/usbx_host_classes/src/ux_host_class_hid_mouse_wheel_get.c index f20ecef..5826a61 100644 --- a/common/usbx_host_classes/src/ux_host_class_hid_mouse_wheel_get.c +++ b/common/usbx_host_classes/src/ux_host_class_hid_mouse_wheel_get.c @@ -100,3 +100,52 @@ UX_HOST_CLASS_HID *hid; return(UX_SUCCESS); } +/**************************************************************************/ +/* */ +/* FUNCTION RELEASE */ +/* */ +/* _uxe_host_class_hid_mouse_wheel_get PORTABLE C */ +/* 6.x */ +/* AUTHOR */ +/* */ +/* Chaoqiong Xiao, Microsoft Corporation */ +/* */ +/* DESCRIPTION */ +/* */ +/* This function checks errors in HID mouse wheel get function call. */ +/* */ +/* INPUT */ +/* */ +/* mouse_instance Pointer to mouse instance */ +/* mouse_wheel_movement Current Mouse wheel movement */ +/* */ +/* OUTPUT */ +/* */ +/* Status */ +/* */ +/* CALLS */ +/* */ +/* _ux_host_class_hid_mouse_wheel_get Get mouse wheel */ +/* */ +/* CALLED BY */ +/* */ +/* Application */ +/* */ +/* RELEASE HISTORY */ +/* */ +/* DATE NAME DESCRIPTION */ +/* */ +/* xx-xx-xxxx Chaoqiong Xiao Initial Version 6.x */ +/* */ +/**************************************************************************/ +UINT _uxe_host_class_hid_mouse_wheel_get(UX_HOST_CLASS_HID_MOUSE *mouse_instance, + SLONG *mouse_wheel_movement) +{ + + /* Sanity checks. */ + if ((mouse_instance == UX_NULL) || (mouse_wheel_movement == UX_NULL)) + return(UX_INVALID_PARAMETER); + + /* Invoke mouse wheel get function. */ + return(_ux_host_class_hid_mouse_wheel_get(mouse_instance, mouse_wheel_movement)); +} diff --git a/common/usbx_host_classes/src/ux_host_class_hid_periodic_report_start.c b/common/usbx_host_classes/src/ux_host_class_hid_periodic_report_start.c index 73323c6..8b5465d 100644 --- a/common/usbx_host_classes/src/ux_host_class_hid_periodic_report_start.c +++ b/common/usbx_host_classes/src/ux_host_class_hid_periodic_report_start.c @@ -136,3 +136,53 @@ UX_TRANSFER *transfer_request; /* Return the function status */ return(status); } + +/**************************************************************************/ +/* */ +/* FUNCTION RELEASE */ +/* */ +/* _uxe_host_class_hid_periodic_report_start PORTABLE C */ +/* 6.x */ +/* AUTHOR */ +/* */ +/* Chaoqiong Xiao, Microsoft Corporation */ +/* */ +/* DESCRIPTION */ +/* */ +/* This function checks errors in HID periodic report start function */ +/* call. */ +/* */ +/* INPUT */ +/* */ +/* hid Pointer to HID class */ +/* */ +/* OUTPUT */ +/* */ +/* Status */ +/* */ +/* CALLS */ +/* */ +/* _ux_host_class_hid_periodic_report_start */ +/* Start polling periodic report */ +/* */ +/* CALLED BY */ +/* */ +/* Application */ +/* */ +/* RELEASE HISTORY */ +/* */ +/* DATE NAME DESCRIPTION */ +/* */ +/* xx-xx-xxxx Chaoqiong Xiao Initial Version 6.x */ +/* */ +/**************************************************************************/ +UINT _uxe_host_class_hid_periodic_report_start(UX_HOST_CLASS_HID *hid) +{ + + /* Sanity check. */ + if (hid == UX_NULL) + return(UX_INVALID_PARAMETER); + + /* Invoke periodic start function. */ + return(_ux_host_class_hid_periodic_report_start(hid)); +} diff --git a/common/usbx_host_classes/src/ux_host_class_hid_periodic_report_stop.c b/common/usbx_host_classes/src/ux_host_class_hid_periodic_report_stop.c index e003248..ebfa979 100644 --- a/common/usbx_host_classes/src/ux_host_class_hid_periodic_report_stop.c +++ b/common/usbx_host_classes/src/ux_host_class_hid_periodic_report_stop.c @@ -116,3 +116,53 @@ UINT _ux_host_class_hid_periodic_report_stop(UX_HOST_CLASS_HID *hid) return(UX_SUCCESS); } +/**************************************************************************/ +/* */ +/* FUNCTION RELEASE */ +/* */ +/* _uxe_host_class_hid_periodic_report_stop PORTABLE C */ +/* 6.x */ +/* AUTHOR */ +/* */ +/* Chaoqiong Xiao, Microsoft Corporation */ +/* */ +/* DESCRIPTION */ +/* */ +/* This function checks errors in HID periodic report stop function */ +/* call. */ +/* */ +/* INPUT */ +/* */ +/* hid Pointer to HID class */ +/* */ +/* OUTPUT */ +/* */ +/* Status */ +/* */ +/* CALLS */ +/* */ +/* _ux_host_class_hid_periodic_report_stop */ +/* Stop polling periodic report */ +/* */ +/* CALLED BY */ +/* */ +/* Application */ +/* */ +/* RELEASE HISTORY */ +/* */ +/* DATE NAME DESCRIPTION */ +/* */ +/* xx-xx-xxxx Chaoqiong Xiao Initial Version 6.x */ +/* */ +/**************************************************************************/ +UINT _uxe_host_class_hid_periodic_report_stop(UX_HOST_CLASS_HID *hid) +{ + + /* Sanity check. */ + if (hid == UX_NULL) + return(UX_INVALID_PARAMETER); + + /* Invoke periodic stop function. */ + return(_ux_host_class_hid_periodic_report_stop(hid)); +} + diff --git a/common/usbx_host_classes/src/ux_host_class_hid_remote_control_usage_get.c b/common/usbx_host_classes/src/ux_host_class_hid_remote_control_usage_get.c index 7d48323..bc05f2a 100644 --- a/common/usbx_host_classes/src/ux_host_class_hid_remote_control_usage_get.c +++ b/common/usbx_host_classes/src/ux_host_class_hid_remote_control_usage_get.c @@ -125,3 +125,57 @@ UX_HOST_CLASS_HID *hid; return(UX_SUCCESS); } +/**************************************************************************/ +/* */ +/* FUNCTION RELEASE */ +/* */ +/* _uxe_host_class_hid_remote_control_usage_get PORTABLE C */ +/* 6.x */ +/* AUTHOR */ +/* */ +/* Chaoqiong Xiao, Microsoft Corporation */ +/* */ +/* DESCRIPTION */ +/* */ +/* This function checks errors in HID remote control get function call.*/ +/* */ +/* INPUT */ +/* */ +/* remote_control_instance Pointer to remote control */ +/* usage Pointer to usage */ +/* value Pointer to value */ +/* */ +/* OUTPUT */ +/* */ +/* Status */ +/* */ +/* CALLS */ +/* */ +/* _ux_host_class_hid_remote_control_usage_get */ +/* Get remote control usage */ +/* */ +/* CALLED BY */ +/* */ +/* Application */ +/* */ +/* RELEASE HISTORY */ +/* */ +/* DATE NAME DESCRIPTION */ +/* */ +/* xx-xx-xxxx Chaoqiong Xiao Initial Version 6.x */ +/* */ +/**************************************************************************/ +UINT _uxe_host_class_hid_remote_control_usage_get( + UX_HOST_CLASS_HID_REMOTE_CONTROL *remote_control_instance, + ULONG *usage, ULONG *value) +{ + + /* Sanity checks. */ + if ((remote_control_instance == UX_NULL) || + (usage == UX_NULL) || (value == UX_NULL) || + (usage == value)) + return(UX_INVALID_PARAMETER); + + /* Invoke remote control get function. */ + return(_ux_host_class_hid_remote_control_usage_get(remote_control_instance, usage, value)); +} diff --git a/common/usbx_host_classes/src/ux_host_class_hid_report_callback_register.c b/common/usbx_host_classes/src/ux_host_class_hid_report_callback_register.c index cfe67d4..82283e9 100644 --- a/common/usbx_host_classes/src/ux_host_class_hid_report_callback_register.c +++ b/common/usbx_host_classes/src/ux_host_class_hid_report_callback_register.c @@ -147,3 +147,54 @@ UX_HOST_CLASS_HID_REPORT *hid_report; return(UX_HOST_CLASS_HID_REPORT_ERROR); } + +/**************************************************************************/ +/* */ +/* FUNCTION RELEASE */ +/* */ +/* _uxe_host_class_hid_report_callback_register PORTABLE C */ +/* 6.x */ +/* AUTHOR */ +/* */ +/* Chaoqiong Xiao, Microsoft Corporation */ +/* */ +/* DESCRIPTION */ +/* */ +/* This function checks errors in HID report callback register function*/ +/* call. */ +/* */ +/* INPUT */ +/* */ +/* hid Pointer to HID class */ +/* call_back HID report callback */ +/* */ +/* OUTPUT */ +/* */ +/* Status */ +/* */ +/* CALLS */ +/* */ +/* _ux_host_class_hid_report_callback_register */ +/* Register a report callback */ +/* */ +/* CALLED BY */ +/* */ +/* Application */ +/* */ +/* RELEASE HISTORY */ +/* */ +/* DATE NAME DESCRIPTION */ +/* */ +/* xx-xx-xxxx Chaoqiong Xiao Initial Version 6.x */ +/* */ +/**************************************************************************/ +UINT _uxe_host_class_hid_report_callback_register(UX_HOST_CLASS_HID *hid, UX_HOST_CLASS_HID_REPORT_CALLBACK *call_back) +{ + + /* Sanity check. */ + if ((hid == UX_NULL) || (call_back == UX_NULL)) + return(UX_INVALID_PARAMETER); + + /* Invoke periodic start function. */ + return(_ux_host_class_hid_report_callback_register(hid, call_back)); +} diff --git a/common/usbx_host_classes/src/ux_host_class_hid_report_get.c b/common/usbx_host_classes/src/ux_host_class_hid_report_get.c index 4f58413..c4ae1dd 100644 --- a/common/usbx_host_classes/src/ux_host_class_hid_report_get.c +++ b/common/usbx_host_classes/src/ux_host_class_hid_report_get.c @@ -272,3 +272,51 @@ UINT status; return(status); } +/**************************************************************************/ +/* */ +/* FUNCTION RELEASE */ +/* */ +/* _uxe_host_class_hid_report_get PORTABLE C */ +/* 6.x */ +/* AUTHOR */ +/* */ +/* Chaoqiong Xiao, Microsoft Corporation */ +/* */ +/* DESCRIPTION */ +/* */ +/* This function checks errors in HID report get function call. */ +/* */ +/* INPUT */ +/* */ +/* hid Pointer to HID class */ +/* client_report Pointer to client report */ +/* */ +/* OUTPUT */ +/* */ +/* Status */ +/* */ +/* CALLS */ +/* */ +/* _ux_host_class_hid_report_get get a report */ +/* */ +/* CALLED BY */ +/* */ +/* Application */ +/* */ +/* RELEASE HISTORY */ +/* */ +/* DATE NAME DESCRIPTION */ +/* */ +/* xx-xx-xxxx Chaoqiong Xiao Initial Version 6.x */ +/* */ +/**************************************************************************/ +UINT _uxe_host_class_hid_report_get(UX_HOST_CLASS_HID *hid, UX_HOST_CLASS_HID_CLIENT_REPORT *client_report) +{ + + /* Sanity checks. */ + if ((hid == UX_NULL) || (client_report == UX_NULL)) + return(UX_INVALID_PARAMETER); + + /* Invoke report ID get function. */ + return(_ux_host_class_hid_report_get(hid, client_report)); +} diff --git a/common/usbx_host_classes/src/ux_host_class_hid_report_id_get.c b/common/usbx_host_classes/src/ux_host_class_hid_report_id_get.c index 28774bd..9ce374a 100644 --- a/common/usbx_host_classes/src/ux_host_class_hid_report_id_get.c +++ b/common/usbx_host_classes/src/ux_host_class_hid_report_id_get.c @@ -181,3 +181,51 @@ UX_HOST_CLASS_HID_REPORT *next_hid_report; return(status); } +/**************************************************************************/ +/* */ +/* FUNCTION RELEASE */ +/* */ +/* _uxe_host_class_hid_report_id_get PORTABLE C */ +/* 6.x */ +/* AUTHOR */ +/* */ +/* Chaoqiong Xiao, Microsoft Corporation */ +/* */ +/* DESCRIPTION */ +/* */ +/* This function checks errors in HID report ID get function call. */ +/* */ +/* INPUT */ +/* */ +/* hid Pointer to HID class */ +/* report_id Report id structure */ +/* */ +/* OUTPUT */ +/* */ +/* Status */ +/* */ +/* CALLS */ +/* */ +/* _ux_host_class_hid_report_id_get Get a report */ +/* */ +/* CALLED BY */ +/* */ +/* Application */ +/* */ +/* RELEASE HISTORY */ +/* */ +/* DATE NAME DESCRIPTION */ +/* */ +/* xx-xx-xxxx Chaoqiong Xiao Initial Version 6.x */ +/* */ +/**************************************************************************/ +UINT _uxe_host_class_hid_report_id_get(UX_HOST_CLASS_HID *hid, UX_HOST_CLASS_HID_REPORT_GET_ID *report_id) +{ + + /* Sanity checks. */ + if ((hid == UX_NULL) || (report_id == UX_NULL)) + return(UX_INVALID_PARAMETER); + + /* Invoke report ID get function. */ + return(_ux_host_class_hid_report_id_get(hid, report_id)); +} diff --git a/common/usbx_host_classes/src/ux_host_class_hid_report_set.c b/common/usbx_host_classes/src/ux_host_class_hid_report_set.c index 1731a58..05376ad 100644 --- a/common/usbx_host_classes/src/ux_host_class_hid_report_set.c +++ b/common/usbx_host_classes/src/ux_host_class_hid_report_set.c @@ -315,3 +315,51 @@ UINT status; #endif } +/**************************************************************************/ +/* */ +/* FUNCTION RELEASE */ +/* */ +/* _uxe_host_class_hid_report_set PORTABLE C */ +/* 6.x */ +/* AUTHOR */ +/* */ +/* Chaoqiong Xiao, Microsoft Corporation */ +/* */ +/* DESCRIPTION */ +/* */ +/* This function checks errors in HID report set function call. */ +/* */ +/* INPUT */ +/* */ +/* hid Pointer to HID class */ +/* client_report Pointer to client report */ +/* */ +/* OUTPUT */ +/* */ +/* Status */ +/* */ +/* CALLS */ +/* */ +/* _ux_host_class_hid_report_set Set a report */ +/* */ +/* CALLED BY */ +/* */ +/* Application */ +/* */ +/* RELEASE HISTORY */ +/* */ +/* DATE NAME DESCRIPTION */ +/* */ +/* xx-xx-xxxx Chaoqiong Xiao Initial Version 6.x */ +/* */ +/**************************************************************************/ +UINT _uxe_host_class_hid_report_set(UX_HOST_CLASS_HID *hid, UX_HOST_CLASS_HID_CLIENT_REPORT *client_report) +{ + + /* Sanity checks. */ + if ((hid == UX_NULL) || (client_report == UX_NULL)) + return(UX_INVALID_PARAMETER); + + /* Invoke report set function. */ + return(_ux_host_class_hid_report_set(hid, client_report)); +} diff --git a/common/usbx_host_classes/src/ux_host_class_hid_report_set_run.c b/common/usbx_host_classes/src/ux_host_class_hid_report_set_run.c index 6d6edf9..8add05c 100644 --- a/common/usbx_host_classes/src/ux_host_class_hid_report_set_run.c +++ b/common/usbx_host_classes/src/ux_host_class_hid_report_set_run.c @@ -246,4 +246,53 @@ UINT status; /* Return the function status */ return(status); } + +/**************************************************************************/ +/* */ +/* FUNCTION RELEASE */ +/* */ +/* _uxe_host_class_hid_report_set_run PORTABLE C */ +/* 6.x */ +/* AUTHOR */ +/* */ +/* Chaoqiong Xiao, Microsoft Corporation */ +/* */ +/* DESCRIPTION */ +/* */ +/* This function checks errors in HID report set function call. */ +/* */ +/* INPUT */ +/* */ +/* hid Pointer to HID class */ +/* client_report Pointer to client report */ +/* */ +/* OUTPUT */ +/* */ +/* Status */ +/* */ +/* CALLS */ +/* */ +/* _ux_host_class_hid_report_set_run Set a report */ +/* */ +/* CALLED BY */ +/* */ +/* Application */ +/* */ +/* RELEASE HISTORY */ +/* */ +/* DATE NAME DESCRIPTION */ +/* */ +/* xx-xx-xxxx Chaoqiong Xiao Initial Version 6.x */ +/* */ +/**************************************************************************/ +UINT _uxe_host_class_hid_report_set_run(UX_HOST_CLASS_HID *hid, UX_HOST_CLASS_HID_CLIENT_REPORT *client_report) +{ + + /* Sanity checks. */ + if ((hid == UX_NULL) || (client_report == UX_NULL)) + return(UX_INVALID_PARAMETER); + + /* Invoke report set function. */ + return(_ux_host_class_hid_report_set(hid, client_report)); +} #endif diff --git a/common/usbx_host_classes/src/ux_host_class_prolific_command.c b/common/usbx_host_classes/src/ux_host_class_prolific_command.c index 9044e15..eb8de28 100644 --- a/common/usbx_host_classes/src/ux_host_class_prolific_command.c +++ b/common/usbx_host_classes/src/ux_host_class_prolific_command.c @@ -122,3 +122,57 @@ UINT status; return(status); } + +/**************************************************************************/ +/* */ +/* FUNCTION RELEASE */ +/* */ +/* _uxe_host_class_prolific_command PORTABLE C */ +/* 6.x */ +/* AUTHOR */ +/* */ +/* Chaoqiong Xiao, Microsoft Corporation */ +/* */ +/* DESCRIPTION */ +/* */ +/* This function checks errors in PROLIFIC command function call. */ +/* */ +/* INPUT */ +/* */ +/* prolific Pointer to prolific class */ +/* command command value */ +/* value value to be sent in the */ +/* command request */ +/* data_buffer buffer to be sent */ +/* data_length length of the buffer to send */ +/* */ +/* OUTPUT */ +/* */ +/* Status */ +/* */ +/* CALLS */ +/* */ +/* _ux_host_class_prolific_command PROLIFIC command */ +/* */ +/* CALLED BY */ +/* */ +/* Application */ +/* */ +/* RELEASE HISTORY */ +/* */ +/* DATE NAME DESCRIPTION */ +/* */ +/* xx-xx-xxxx Chaoqiong Xiao Initial Version 6.x */ +/* */ +/**************************************************************************/ +UINT _uxe_host_class_prolific_command(UX_HOST_CLASS_PROLIFIC *prolific, ULONG command, + ULONG value, UCHAR *data_buffer, ULONG data_length) +{ + + /* Sanity check. */ + if (prolific == UX_NULL) + return(UX_INVALID_PARAMETER); + + /* Invoke PROLIFIC command function. */ + return(_ux_host_class_prolific_command(prolific, command, value, data_buffer, data_length)); +} diff --git a/common/usbx_host_classes/src/ux_host_class_prolific_ioctl.c b/common/usbx_host_classes/src/ux_host_class_prolific_ioctl.c index 890ba9d..2dcc938 100644 --- a/common/usbx_host_classes/src/ux_host_class_prolific_ioctl.c +++ b/common/usbx_host_classes/src/ux_host_class_prolific_ioctl.c @@ -335,3 +335,54 @@ VOID (*callback_function) (struct UX_HOST_CLASS_P return(status); } + +/**************************************************************************/ +/* */ +/* FUNCTION RELEASE */ +/* */ +/* _uxe_host_class_prolific_ioctl PORTABLE C */ +/* 6.x */ +/* AUTHOR */ +/* */ +/* Chaoqiong Xiao, Microsoft Corporation */ +/* */ +/* DESCRIPTION */ +/* */ +/* This function checks errors in PROLIFIC ioctl function call. */ +/* */ +/* INPUT */ +/* */ +/* prolific Pointer to PROLIFIC class */ +/* ioctl_function ioctl function */ +/* parameter pointer to structure */ +/* */ +/* OUTPUT */ +/* */ +/* Status */ +/* */ +/* CALLS */ +/* */ +/* _ux_host_class_prolific_ioctl PROLIFIC ioctl */ +/* */ +/* CALLED BY */ +/* */ +/* Application */ +/* */ +/* RELEASE HISTORY */ +/* */ +/* DATE NAME DESCRIPTION */ +/* */ +/* xx-xx-xxxx Chaoqiong Xiao Initial Version 6.x */ +/* */ +/**************************************************************************/ +UINT _uxe_host_class_prolific_ioctl(UX_HOST_CLASS_PROLIFIC *prolific, ULONG ioctl_function, + VOID *parameter) +{ + + /* Sanity check. */ + if (prolific == UX_NULL) + return(UX_INVALID_PARAMETER); + + /* Invoke PROLIFIC ioctl function. */ + return(_ux_host_class_prolific_ioctl(prolific, ioctl_function, parameter)); +} diff --git a/common/usbx_host_classes/src/ux_host_class_prolific_read.c b/common/usbx_host_classes/src/ux_host_class_prolific_read.c index ca2faa7..adca0cb 100644 --- a/common/usbx_host_classes/src/ux_host_class_prolific_read.c +++ b/common/usbx_host_classes/src/ux_host_class_prolific_read.c @@ -195,3 +195,55 @@ ULONG transfer_request_length; return(UX_SUCCESS); } + +/**************************************************************************/ +/* */ +/* FUNCTION RELEASE */ +/* */ +/* _uxe_host_class_prolific_read PORTABLE C */ +/* 6.x */ +/* AUTHOR */ +/* */ +/* Chaoqiong Xiao, Microsoft Corporation */ +/* */ +/* DESCRIPTION */ +/* */ +/* This function checks errors in PROLIFIC read function call. */ +/* */ +/* INPUT */ +/* */ +/* prolific Pointer to PROLIFIC class */ +/* data_pointer Pointer to buffer */ +/* requested_length Requested data read */ +/* actual_length Actual data read */ +/* */ +/* OUTPUT */ +/* */ +/* Status */ +/* */ +/* CALLS */ +/* */ +/* _ux_host_class_prolific_read PROLIFIC read */ +/* */ +/* CALLED BY */ +/* */ +/* Application */ +/* */ +/* RELEASE HISTORY */ +/* */ +/* DATE NAME DESCRIPTION */ +/* */ +/* xx-xx-xxxx Chaoqiong Xiao Initial Version 6.x */ +/* */ +/**************************************************************************/ +UINT _uxe_host_class_prolific_read (UX_HOST_CLASS_PROLIFIC *prolific, UCHAR *data_pointer, + ULONG requested_length, ULONG *actual_length) +{ + + /* Sanity checks. */ + if ((prolific == UX_NULL) || (data_pointer == UX_NULL) || (actual_length == UX_NULL)) + return(UX_INVALID_PARAMETER); + + /* Invoke PROLIFIC read function. */ + return(_ux_host_class_prolific_read(prolific, data_pointer, requested_length, actual_length)); +} diff --git a/common/usbx_host_classes/src/ux_host_class_prolific_reception_start.c b/common/usbx_host_classes/src/ux_host_class_prolific_reception_start.c index 65041c5..1ade3ac 100644 --- a/common/usbx_host_classes/src/ux_host_class_prolific_reception_start.c +++ b/common/usbx_host_classes/src/ux_host_class_prolific_reception_start.c @@ -128,3 +128,54 @@ UINT status; return(status); } + +/**************************************************************************/ +/* */ +/* FUNCTION RELEASE */ +/* */ +/* _uxe_host_class_prolific_reception_start PORTABLE C */ +/* 6.x */ +/* AUTHOR */ +/* */ +/* Chaoqiong Xiao, Microsoft Corporation */ +/* */ +/* DESCRIPTION */ +/* */ +/* This function checks errors in PROLIFIC reception function call. */ +/* */ +/* INPUT */ +/* */ +/* prolific Pointer to PROLIFIC class */ +/* prolific_reception Pointer to reception struct */ +/* */ +/* OUTPUT */ +/* */ +/* Status */ +/* */ +/* CALLS */ +/* */ +/* _ux_host_class_prolific_reception_start */ +/* PROLIFIC reception start */ +/* */ +/* CALLED BY */ +/* */ +/* Application */ +/* */ +/* RELEASE HISTORY */ +/* */ +/* DATE NAME DESCRIPTION */ +/* */ +/* xx-xx-xxxx Chaoqiong Xiao Initial Version 6.x */ +/* */ +/**************************************************************************/ +UINT _uxe_host_class_prolific_reception_start (UX_HOST_CLASS_PROLIFIC *prolific, + UX_HOST_CLASS_PROLIFIC_RECEPTION *prolific_reception) +{ + + /* Sanity checks. */ + if ((prolific == UX_NULL) || (prolific_reception == UX_NULL)) + return(UX_INVALID_PARAMETER); + + /* Invoke PROLIFIC reception start function. */ + return(_ux_host_class_prolific_reception_start(prolific, prolific_reception)); +} diff --git a/common/usbx_host_classes/src/ux_host_class_prolific_reception_stop.c b/common/usbx_host_classes/src/ux_host_class_prolific_reception_stop.c index f73d35c..4a9b6af 100644 --- a/common/usbx_host_classes/src/ux_host_class_prolific_reception_stop.c +++ b/common/usbx_host_classes/src/ux_host_class_prolific_reception_stop.c @@ -109,3 +109,54 @@ UINT _ux_host_class_prolific_reception_stop (UX_HOST_CLASS_PROLIFIC *prolific, return(UX_SUCCESS); } + +/**************************************************************************/ +/* */ +/* FUNCTION RELEASE */ +/* */ +/* _uxe_host_class_prolific_reception_stop PORTABLE C */ +/* 6.x */ +/* AUTHOR */ +/* */ +/* Chaoqiong Xiao, Microsoft Corporation */ +/* */ +/* DESCRIPTION */ +/* */ +/* This function checks errors in PROLIFIC reception function call. */ +/* */ +/* INPUT */ +/* */ +/* prolific Pointer to PROLIFIC class */ +/* prolific_reception Pointer to reception struct */ +/* */ +/* OUTPUT */ +/* */ +/* Status */ +/* */ +/* CALLS */ +/* */ +/* _ux_host_class_prolific_reception_stop */ +/* PROLIFIC reception stop */ +/* */ +/* CALLED BY */ +/* */ +/* Application */ +/* */ +/* RELEASE HISTORY */ +/* */ +/* DATE NAME DESCRIPTION */ +/* */ +/* xx-xx-xxxx Chaoqiong Xiao Initial Version 6.x */ +/* */ +/**************************************************************************/ +UINT _uxe_host_class_prolific_reception_stop (UX_HOST_CLASS_PROLIFIC *prolific, + UX_HOST_CLASS_PROLIFIC_RECEPTION *prolific_reception) +{ + + /* Sanity checks. */ + if ((prolific == UX_NULL) || (prolific_reception == UX_NULL)) + return(UX_INVALID_PARAMETER); + + /* Invoke PROLIFIC reception stop function. */ + return(_ux_host_class_prolific_reception_stop(prolific, prolific_reception)); +} diff --git a/common/usbx_host_classes/src/ux_host_class_prolific_write.c b/common/usbx_host_classes/src/ux_host_class_prolific_write.c index 183ae2b..b670562 100644 --- a/common/usbx_host_classes/src/ux_host_class_prolific_write.c +++ b/common/usbx_host_classes/src/ux_host_class_prolific_write.c @@ -194,3 +194,59 @@ ULONG transfer_request_length; return(UX_SUCCESS); } + +/**************************************************************************/ +/* */ +/* FUNCTION RELEASE */ +/* */ +/* _uxe_host_class_prolific_write PORTABLE C */ +/* 6.x */ +/* AUTHOR */ +/* */ +/* Chaoqiong Xiao, Microsoft Corporation */ +/* */ +/* DESCRIPTION */ +/* */ +/* This function checks errors in PROLIFIC write function call. */ +/* */ +/* INPUT */ +/* */ +/* prolific Pointer to PROLIFIC class */ +/* data_pointer Pointer to data to write */ +/* requested_length Length of data to write */ +/* actual_length Actual length of data written */ +/* */ +/* OUTPUT */ +/* */ +/* Status */ +/* */ +/* CALLS */ +/* */ +/* _ux_host_class_prolific_write PROLIFIC write */ +/* */ +/* CALLED BY */ +/* */ +/* Application */ +/* */ +/* RELEASE HISTORY */ +/* */ +/* DATE NAME DESCRIPTION */ +/* */ +/* xx-xx-xxxx Chaoqiong Xiao Initial Version 6.x */ +/* */ +/**************************************************************************/ +UINT _uxe_host_class_prolific_write(UX_HOST_CLASS_PROLIFIC *prolific, UCHAR *data_pointer, + ULONG requested_length, ULONG *actual_length) +{ + + /* Sanity checks. */ + if ((prolific == UX_NULL) || + ((data_pointer == UX_NULL) && (requested_length != 0)) || + (actual_length == UX_NULL)) + { + return(UX_INVALID_PARAMETER); + } + + /* Invoke PROLIFIC write function. */ + return(_ux_host_class_prolific_write(prolific, data_pointer, requested_length, actual_length)); +} diff --git a/common/usbx_host_classes/src/ux_host_class_swar_ioctl.c b/common/usbx_host_classes/src/ux_host_class_swar_ioctl.c index 47f128a..8ff9f8a 100644 --- a/common/usbx_host_classes/src/ux_host_class_swar_ioctl.c +++ b/common/usbx_host_classes/src/ux_host_class_swar_ioctl.c @@ -127,3 +127,54 @@ UINT status; return(status); } + +/**************************************************************************/ +/* */ +/* FUNCTION RELEASE */ +/* */ +/* _uxe_host_class_swar_ioctl PORTABLE C */ +/* 6.x */ +/* AUTHOR */ +/* */ +/* Chaoqiong Xiao, Microsoft Corporation */ +/* */ +/* DESCRIPTION */ +/* */ +/* This function checks errors in SWAR ioctl function call. */ +/* */ +/* INPUT */ +/* */ +/* swar Pointer to SWAR class */ +/* ioctl_function ioctl function */ +/* parameter pointer to structure */ +/* */ +/* OUTPUT */ +/* */ +/* Status */ +/* */ +/* CALLS */ +/* */ +/* _ux_host_class_swar_ioctl SWAR ioctl */ +/* */ +/* CALLED BY */ +/* */ +/* Application */ +/* */ +/* RELEASE HISTORY */ +/* */ +/* DATE NAME DESCRIPTION */ +/* */ +/* xx-xx-xxxx Chaoqiong Xiao Initial Version 6.x */ +/* */ +/**************************************************************************/ +UINT _uxe_host_class_swar_ioctl(UX_HOST_CLASS_SWAR *swar, ULONG ioctl_function, + VOID *parameter) +{ + + /* Sanity check. */ + if (swar == UX_NULL) + return(UX_INVALID_PARAMETER); + + /* Invoke SWAR ioctl function. */ + return(_ux_host_class_swar_ioctl(swar, ioctl_function, parameter)); +} diff --git a/common/usbx_host_classes/src/ux_host_class_swar_read.c b/common/usbx_host_classes/src/ux_host_class_swar_read.c index dbd6a93..b0aef07 100644 --- a/common/usbx_host_classes/src/ux_host_class_swar_read.c +++ b/common/usbx_host_classes/src/ux_host_class_swar_read.c @@ -212,3 +212,55 @@ ULONG transfer_request_length; return(UX_SUCCESS); } + +/**************************************************************************/ +/* */ +/* FUNCTION RELEASE */ +/* */ +/* _uxe_host_class_swar_read PORTABLE C */ +/* 6.x */ +/* AUTHOR */ +/* */ +/* Chaoqiong Xiao, Microsoft Corporation */ +/* */ +/* DESCRIPTION */ +/* */ +/* This function checks errors in SWAR read function call. */ +/* */ +/* INPUT */ +/* */ +/* swar Pointer to SWAR class */ +/* data_pointer Pointer to buffer */ +/* requested_length Requested data read */ +/* actual_length Actual data read */ +/* */ +/* OUTPUT */ +/* */ +/* Status */ +/* */ +/* CALLS */ +/* */ +/* _ux_host_class_swar_read SWAR read */ +/* */ +/* CALLED BY */ +/* */ +/* Application */ +/* */ +/* RELEASE HISTORY */ +/* */ +/* DATE NAME DESCRIPTION */ +/* */ +/* xx-xx-xxxx Chaoqiong Xiao Initial Version 6.x */ +/* */ +/**************************************************************************/ +UINT _uxe_host_class_swar_read (UX_HOST_CLASS_SWAR *swar, UCHAR *data_pointer, + ULONG requested_length, ULONG *actual_length) +{ + + /* Sanity checks. */ + if ((swar == UX_NULL) || (data_pointer == UX_NULL) || (actual_length == UX_NULL)) + return(UX_INVALID_PARAMETER); + + /* Invoke SWAR read function. */ + return(_ux_host_class_swar_read(swar, data_pointer, requested_length, actual_length)); +} diff --git a/common/usbx_host_classes/src/ux_host_class_swar_reception_start.c b/common/usbx_host_classes/src/ux_host_class_swar_reception_start.c index 1aed62a..4866a86 100644 --- a/common/usbx_host_classes/src/ux_host_class_swar_reception_start.c +++ b/common/usbx_host_classes/src/ux_host_class_swar_reception_start.c @@ -129,3 +129,54 @@ UINT status; return(status); } + +/**************************************************************************/ +/* */ +/* FUNCTION RELEASE */ +/* */ +/* _uxe_host_class_swar_reception_start PORTABLE C */ +/* 6.x */ +/* AUTHOR */ +/* */ +/* Chaoqiong Xiao, Microsoft Corporation */ +/* */ +/* DESCRIPTION */ +/* */ +/* This function checks errors in SWAR reception function call. */ +/* */ +/* INPUT */ +/* */ +/* swar Pointer to SWAR class */ +/* swar_reception Pointer to reception struct */ +/* */ +/* OUTPUT */ +/* */ +/* Status */ +/* */ +/* CALLS */ +/* */ +/* _ux_host_class_swar_reception_start */ +/* SWAR reception start */ +/* */ +/* CALLED BY */ +/* */ +/* Application */ +/* */ +/* RELEASE HISTORY */ +/* */ +/* DATE NAME DESCRIPTION */ +/* */ +/* xx-xx-xxxx Chaoqiong Xiao Initial Version 6.x */ +/* */ +/**************************************************************************/ +UINT _uxe_host_class_swar_reception_start (UX_HOST_CLASS_SWAR *swar, + UX_HOST_CLASS_SWAR_RECEPTION *swar_reception) +{ + + /* Sanity checks. */ + if ((swar == UX_NULL) || (swar_reception == UX_NULL)) + return(UX_INVALID_PARAMETER); + + /* Invoke SWAR reception start function. */ + return(_ux_host_class_swar_reception_start(swar, swar_reception)); +} diff --git a/common/usbx_host_classes/src/ux_host_class_swar_reception_stop.c b/common/usbx_host_classes/src/ux_host_class_swar_reception_stop.c index e52ea0a..f80a501 100644 --- a/common/usbx_host_classes/src/ux_host_class_swar_reception_stop.c +++ b/common/usbx_host_classes/src/ux_host_class_swar_reception_stop.c @@ -110,3 +110,53 @@ UINT _ux_host_class_swar_reception_stop (UX_HOST_CLASS_SWAR *swar, return(UX_SUCCESS); } + +/**************************************************************************/ +/* */ +/* FUNCTION RELEASE */ +/* */ +/* _uxe_host_class_swar_reception_stop PORTABLE C */ +/* 6.x */ +/* AUTHOR */ +/* */ +/* Chaoqiong Xiao, Microsoft Corporation */ +/* */ +/* DESCRIPTION */ +/* */ +/* This function checks errors in SWAR reception function call. */ +/* */ +/* INPUT */ +/* */ +/* swar Pointer to SWAR class */ +/* swar_reception Pointer to reception struct */ +/* */ +/* OUTPUT */ +/* */ +/* Status */ +/* */ +/* CALLS */ +/* */ +/* _ux_host_class_swar_reception_stop SWAR reception stop */ +/* */ +/* CALLED BY */ +/* */ +/* Application */ +/* */ +/* RELEASE HISTORY */ +/* */ +/* DATE NAME DESCRIPTION */ +/* */ +/* xx-xx-xxxx Chaoqiong Xiao Initial Version 6.x */ +/* */ +/**************************************************************************/ +UINT _uxe_host_class_swar_reception_stop (UX_HOST_CLASS_SWAR *swar, + UX_HOST_CLASS_SWAR_RECEPTION *swar_reception) +{ + + /* Sanity checks. */ + if ((swar == UX_NULL) || (swar_reception == UX_NULL)) + return(UX_INVALID_PARAMETER); + + /* Invoke SWAR reception start function. */ + return(_ux_host_class_swar_reception_start(swar, swar_reception)); +} diff --git a/common/usbx_host_classes/src/ux_host_class_swar_write.c b/common/usbx_host_classes/src/ux_host_class_swar_write.c index e8a96ad..6f9b9da 100644 --- a/common/usbx_host_classes/src/ux_host_class_swar_write.c +++ b/common/usbx_host_classes/src/ux_host_class_swar_write.c @@ -213,3 +213,59 @@ ULONG transfer_request_length; return(UX_SUCCESS); } + +/**************************************************************************/ +/* */ +/* FUNCTION RELEASE */ +/* */ +/* _uxe_host_class_swar_write PORTABLE C */ +/* 6.x */ +/* AUTHOR */ +/* */ +/* Chaoqiong Xiao, Microsoft Corporation */ +/* */ +/* DESCRIPTION */ +/* */ +/* This function checks errors in SWAR write function call. */ +/* */ +/* INPUT */ +/* */ +/* swar Pointer to SWAR class */ +/* data_pointer Pointer to data to write */ +/* requested_length Length of data to write */ +/* actual_length Actual length of data written */ +/* */ +/* OUTPUT */ +/* */ +/* Status */ +/* */ +/* CALLS */ +/* */ +/* _ux_host_class_swar_write SWAR write */ +/* */ +/* CALLED BY */ +/* */ +/* Application */ +/* */ +/* RELEASE HISTORY */ +/* */ +/* DATE NAME DESCRIPTION */ +/* */ +/* xx-xx-xxxx Chaoqiong Xiao Initial Version 6.x */ +/* */ +/**************************************************************************/ +UINT _uxe_host_class_swar_write(UX_HOST_CLASS_SWAR *swar, UCHAR *data_pointer, + ULONG requested_length, ULONG *actual_length) +{ + + /* Sanity checks. */ + if ((swar == UX_NULL) || + ((data_pointer == UX_NULL) && (requested_length != 0)) || + (actual_length == UX_NULL)) + { + return(UX_INVALID_PARAMETER); + } + + /* Invoke SWAR write function. */ + return(_ux_host_class_swar_write(swar, data_pointer, requested_length, actual_length)); +} |
