diff options
Diffstat (limited to 'common')
12 files changed, 141 insertions, 48 deletions
diff --git a/common/core/inc/ux_api.h b/common/core/inc/ux_api.h index 903e3ed..4dacbcf 100644 --- a/common/core/inc/ux_api.h +++ b/common/core/inc/ux_api.h @@ -26,7 +26,7 @@ /* APPLICATION INTERFACE DEFINITION RELEASE */ /* */ /* ux_api.h PORTABLE C */ -/* 6.0.1 */ +/* 6.0.2 */ /* AUTHOR */ /* */ /* Chaoqiong Xiao, Microsoft Corporation */ @@ -49,6 +49,9 @@ /* avoided div 0 in overflow */ /* checking macro, */ /* resulting in version 6.0.1 */ +/* 08-14-2020 Chaoqiong Xiao Modified comment(s), and */ +/* updated product constants, */ +/* resulting in version 6.0.2 */ /* */ /**************************************************************************/ @@ -137,7 +140,7 @@ typedef signed char SCHAR; #define AZURE_RTOS_USBX #define USBX_MAJOR_VERSION 6 #define USBX_MINOR_VERSION 0 -#define USBX_PATCH_VERSION 1 +#define USBX_PATCH_VERSION 2 /* Macros for concatenating tokens, where UX_CONCATn concatenates n tokens. */ 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 c1ca49b..c2e7858 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.0 */ +/* 6.0.2 */ /* AUTHOR */ /* */ /* Chaoqiong Xiao, Microsoft Corporation */ @@ -41,6 +41,9 @@ /* DATE NAME DESCRIPTION */ /* */ /* 05-19-2020 Chaoqiong Xiao Initial Version 6.0 */ +/* 08-14-2020 Chaoqiong Xiao Modified comment(s), */ +/* added mode related macros, */ +/* resulting in version 6.0.2 */ /* */ /**************************************************************************/ @@ -167,12 +170,23 @@ #define UX_SLAVE_CLASS_STORAGE_MODE_SENSE_PARAMETER_MEDIUM_TYPE_6 1 #define UX_SLAVE_CLASS_STORAGE_MODE_SENSE_PARAMETER_MEDIUM_TYPE_10 2 +#define UX_SLAVE_CLASS_STORAGE_MODE_SENSE_PARAMETER_FLAGS_6 2 +#define UX_SLAVE_CLASS_STORAGE_MODE_SENSE_PARAMETER_FLAGS_10 3 +#define UX_SLAVE_CLASS_STORAGE_MODE_SENSE_PARAMETER_FLAG_WP 0x80 #define UX_SLAVE_CLASS_STORAGE_MODE_SENSE_PARAMETER_HEADER_LENGTH_6 4 #define UX_SLAVE_CLASS_STORAGE_MODE_SENSE_PARAMETER_HEADER_LENGTH_10 8 #define UX_SLAVE_CLASS_STORAGE_MODE_SENSE_COMMAND_LENGTH_UFI 12 #define UX_SLAVE_CLASS_STORAGE_MODE_SENSE_COMMAND_LENGTH_SBC 12 +#define UX_SLAVE_CLASS_STORAGE_IEC_MODE_PAGE_PAGE_LENGTH 0x0A + +#define UX_SLAVE_CLASS_STORAGE_CACHING_MODE_PAGE_PAGE_LENGTH 0x12 +#define UX_SLAVE_CLASS_STORAGE_CACHING_MODE_PAGE_CODE 0 +#define UX_SLAVE_CLASS_STORAGE_CACHING_MODE_PAGE_LENGTH 1 +#define UX_SLAVE_CLASS_STORAGE_CACHING_MODE_PAGE_FLAGS 2 +#define UX_SLAVE_CLASS_STORAGE_CACHING_MODE_PAGE_FLAG_WCE (1u<<2) + /* Define Storage Class SCSI request sense command constants. */ 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 53934c5..c7a1829 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 @@ -47,8 +47,8 @@ UCHAR usbx_device_class_storage_mode_sense_page_cdrom[USBX_DEVICE_CLASS_STORAGE_ #else #define USBX_DEVICE_CLASS_STORAGE_MODE_SENSE_PAGE_CDROM_LENGTH (0) #endif -#define USBX_DEVICE_CLASS_STORAGE_MODE_SENSE_PAGE_CACHE_LENGTH (0x12 + 2) -#define USBX_DEVICE_CLASS_STORAGE_MODE_SENSE_PAGE_IEC_LENGTH (0x0A + 2) +#define USBX_DEVICE_CLASS_STORAGE_MODE_SENSE_PAGE_CACHE_LENGTH (UX_SLAVE_CLASS_STORAGE_CACHING_MODE_PAGE_PAGE_LENGTH + 2) +#define USBX_DEVICE_CLASS_STORAGE_MODE_SENSE_PAGE_IEC_LENGTH (UX_SLAVE_CLASS_STORAGE_IEC_MODE_PAGE_PAGE_LENGTH + 2) /* Ensure sense pages can fit in the bulk in endpoint's transfer buffer. */ #define USBX_DEVICE_CLASS_STORAGE_MODE_SENSE_PAGE_ALL_RESPONSE_LENGTH ( \ @@ -65,7 +65,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.0 */ +/* 6.0.2 */ /* AUTHOR */ /* */ /* Chaoqiong Xiao, Microsoft Corporation */ @@ -104,6 +104,11 @@ UCHAR usbx_device_class_storage_mode_sense_page_cdrom[USBX_DEVICE_CLASS_STORAGE_ /* DATE NAME DESCRIPTION */ /* */ /* 05-19-2020 Chaoqiong Xiao Initial Version 6.0 */ +/* 08-14-2020 Chaoqiong Xiao Modified comment(s), */ +/* used mode related macros, */ +/* verified memset and memcpy */ +/* cases, */ +/* resulting in version 6.0.2 */ /* */ /**************************************************************************/ UINT _ux_device_class_storage_mode_sense(UX_SLAVE_CLASS_STORAGE *storage, @@ -120,7 +125,7 @@ ULONG page_code; ULONG mode_sense_command; UCHAR read_only_flag; ULONG response_header_length; -ULONG medium_type_index; +ULONG flags_index; ULONG mode_data_length; UCHAR *page_pointer; ULONG page_length; @@ -146,7 +151,7 @@ ULONG page_length; /* Extract the length to be returned by the cbwcb. */ mode_sense_reply_length = (ULONG) *(cbwcb + UX_SLAVE_CLASS_STORAGE_MODE_SENSE_ALLOCATION_LENGTH_6); - medium_type_index = UX_SLAVE_CLASS_STORAGE_MODE_SENSE_PARAMETER_MEDIUM_TYPE_6; + flags_index = UX_SLAVE_CLASS_STORAGE_MODE_SENSE_PARAMETER_FLAGS_6; response_header_length = UX_SLAVE_CLASS_STORAGE_MODE_SENSE_PARAMETER_HEADER_LENGTH_6; } @@ -155,7 +160,7 @@ ULONG page_length; /* Extract the length to be returned by the cbwcb. */ mode_sense_reply_length = _ux_utility_short_get_big_endian(cbwcb + UX_SLAVE_CLASS_STORAGE_MODE_SENSE_ALLOCATION_LENGTH_10); - medium_type_index = UX_SLAVE_CLASS_STORAGE_MODE_SENSE_PARAMETER_MEDIUM_TYPE_10; + flags_index = UX_SLAVE_CLASS_STORAGE_MODE_SENSE_PARAMETER_FLAGS_10; response_header_length = UX_SLAVE_CLASS_STORAGE_MODE_SENSE_PARAMETER_HEADER_LENGTH_10; } @@ -164,13 +169,13 @@ ULONG page_length; mode_sense_reply_length = UX_SLAVE_CLASS_STORAGE_BUFFER_SIZE; /* Ensure memory buffer cleaned. */ - _ux_utility_memory_set(transfer_request -> ux_slave_transfer_request_data_pointer, 0, mode_sense_reply_length); + _ux_utility_memory_set(transfer_request -> ux_slave_transfer_request_data_pointer, 0, mode_sense_reply_length); /* Use case of memset is verified. */ /* Establish READ ONLY flag. */ if (storage -> ux_slave_class_storage_lun[lun].ux_slave_class_storage_media_read_only_flag == UX_TRUE) /* This device is Read Only. */ - read_only_flag = 0x80; + read_only_flag = UX_SLAVE_CLASS_STORAGE_MODE_SENSE_PARAMETER_FLAG_WP; else @@ -191,7 +196,7 @@ ULONG page_length; page_length = USBX_DEVICE_CLASS_STORAGE_MODE_SENSE_PAGE_CDROM_LENGTH; /* Copy page data. */ - _ux_utility_memory_copy(page_pointer, usbx_device_class_storage_mode_sense_page_cdrom, page_length); + _ux_utility_memory_copy(page_pointer, usbx_device_class_storage_mode_sense_page_cdrom, page_length); /* Use case of memcpy is verified. */ /* Update pointer and length. */ mode_data_length += page_length; @@ -210,10 +215,12 @@ ULONG page_length; *(page_pointer) = UX_SLAVE_CLASS_STORAGE_PAGE_CODE_CACHE; /* Store the length of the page data. */ - *(page_pointer + 1) = 0x12; + *(page_pointer + UX_SLAVE_CLASS_STORAGE_CACHING_MODE_PAGE_LENGTH) = + UX_SLAVE_CLASS_STORAGE_CACHING_MODE_PAGE_PAGE_LENGTH; /* Set the Write Cache Enabled (WCE) bit. */ - *(page_pointer + 2) |= 0x04; + *(page_pointer + UX_SLAVE_CLASS_STORAGE_CACHING_MODE_PAGE_FLAGS) |= + UX_SLAVE_CLASS_STORAGE_CACHING_MODE_PAGE_FLAG_WCE; mode_data_length += page_length; page_pointer += page_length; @@ -229,7 +236,7 @@ ULONG page_length; *(page_pointer) = UX_SLAVE_CLASS_STORAGE_PAGE_CODE_IEC; /* Store the length of the page data. */ - *(page_pointer + 1) = 0x0A; + *(page_pointer + 1) = UX_SLAVE_CLASS_STORAGE_IEC_MODE_PAGE_PAGE_LENGTH; mode_data_length += page_length; page_pointer += page_length; @@ -242,7 +249,7 @@ ULONG page_length; _ux_utility_short_put_big_endian(transfer_request -> ux_slave_transfer_request_data_pointer, (USHORT)mode_data_length); /* Store the write protection flag. */ - *(transfer_request -> ux_slave_transfer_request_data_pointer + medium_type_index + 1) = read_only_flag; + *(transfer_request -> ux_slave_transfer_request_data_pointer + flags_index) = read_only_flag; /* Send a payload with the response buffer. */ _ux_device_stack_transfer_request(transfer_request, mode_sense_reply_length, mode_sense_reply_length); 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 acce24e..d7aa0d5 100644 --- a/common/usbx_host_classes/inc/ux_host_class_hid.h +++ b/common/usbx_host_classes/inc/ux_host_class_hid.h @@ -26,7 +26,7 @@ /* COMPONENT DEFINITION RELEASE */ /* */ /* ux_host_class_hid.h PORTABLE C */ -/* 6.0 */ +/* 6.0.2 */ /* AUTHOR */ /* */ /* Chaoqiong Xiao, Microsoft Corporation */ @@ -41,6 +41,10 @@ /* DATE NAME DESCRIPTION */ /* */ /* 05-19-2020 Chaoqiong Xiao Initial Version 6.0 */ +/* 08-14-2020 Chaoqiong Xiao Modified comment(s), */ +/* fixed struct field */ +/* definition issues, */ +/* resulting in version 6.0.2 */ /* */ /**************************************************************************/ @@ -847,7 +851,7 @@ typedef struct UX_HOST_CLASS_HID_FIELD_STRUCT ULONG ux_host_class_hid_field_number_usage; ULONG *ux_host_class_hid_field_values; ULONG ux_host_class_hid_field_number_values; - struct UX_HOST_CLASS_HID_REPORT + struct UX_HOST_CLASS_HID_REPORT_STRUCT *ux_host_class_hid_field_report; struct UX_HOST_CLASS_HID_FIELD_STRUCT *ux_host_class_hid_field_next_field; 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 acf0f01..5deb535 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 @@ -35,7 +35,7 @@ /* FUNCTION RELEASE */ /* */ /* _ux_host_class_hid_idle_get PORTABLE C */ -/* 6.0 */ +/* 6.0.2 */ /* AUTHOR */ /* */ /* Chaoqiong Xiao, Microsoft Corporation */ @@ -70,6 +70,10 @@ /* DATE NAME DESCRIPTION */ /* */ /* 05-19-2020 Chaoqiong Xiao Initial Version 6.0 */ +/* 08-14-2020 Chaoqiong Xiao Modified comment(s), */ +/* protected default control */ +/* endpoint before using it, */ +/* resulting in version 6.0.2 */ /* */ /**************************************************************************/ UINT _ux_host_class_hid_idle_get(UX_HOST_CLASS_HID *hid, USHORT *idle_time, USHORT report_id) @@ -116,6 +120,25 @@ UINT status; return(UX_MEMORY_INSUFFICIENT); } + /* Protect the control endpoint semaphore here. It will be unprotected in the + transfer request function. */ + status = _ux_utility_semaphore_get(&hid -> ux_host_class_hid_device -> ux_device_protection_semaphore, UX_WAIT_FOREVER); + + /* Check for status. */ + if (status != UX_SUCCESS) + { + + /* Something went wrong. */ + + /* Free allocated memory. */ + _ux_utility_memory_free(idle_byte); + + /* Unprotect thread reentry to this instance. */ + _ux_utility_semaphore_put(&hid -> ux_host_class_hid_semaphore); + + return(status); + } + /* Create a transfer request for the GET_IDLE request. */ transfer_request -> ux_transfer_request_data_pointer = idle_byte; transfer_request -> ux_transfer_request_requested_length = 1; 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 a7fd64d..42eaf96 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 @@ -35,7 +35,7 @@ /* FUNCTION RELEASE */ /* */ /* _ux_host_class_hid_idle_set PORTABLE C */ -/* 6.0 */ +/* 6.0.2 */ /* AUTHOR */ /* */ /* Chaoqiong Xiao, Microsoft Corporation */ @@ -70,6 +70,10 @@ /* DATE NAME DESCRIPTION */ /* */ /* 05-19-2020 Chaoqiong Xiao Initial Version 6.0 */ +/* 08-14-2020 Chaoqiong Xiao Modified comment(s), */ +/* protected default control */ +/* endpoint before using it, */ +/* resulting in version 6.0.2 */ /* */ /**************************************************************************/ UINT _ux_host_class_hid_idle_set(UX_HOST_CLASS_HID *hid, USHORT idle_time, USHORT report_id) @@ -97,6 +101,21 @@ UINT status; if (status != UX_SUCCESS) return(status); + /* Protect the control endpoint semaphore here. It will be unprotected in the + transfer request function. */ + status = _ux_utility_semaphore_get(&hid -> ux_host_class_hid_device -> ux_device_protection_semaphore, UX_WAIT_FOREVER); + + /* Check for status. */ + if (status != UX_SUCCESS) + { + + /* Something went wrong. */ + /* Unprotect thread reentry to this instance. */ + _ux_utility_semaphore_put(&hid -> ux_host_class_hid_semaphore); + + return(status); + } + /* We need to get the default control endpoint transfer request pointer. */ control_endpoint = &hid -> ux_host_class_hid_device -> ux_device_control_endpoint; transfer_request = &control_endpoint -> ux_endpoint_transfer_request; 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 add69ce..0c3cd1d 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 @@ -35,7 +35,7 @@ /* FUNCTION RELEASE */ /* */ /* _ux_host_class_hid_report_get PORTABLE C */ -/* 6.0 */ +/* 6.0.2 */ /* AUTHOR */ /* */ /* Chaoqiong Xiao, Microsoft Corporation */ @@ -75,6 +75,11 @@ /* DATE NAME DESCRIPTION */ /* */ /* 05-19-2020 Chaoqiong Xiao Initial Version 6.0 */ +/* 08-14-2020 Chaoqiong Xiao Modified comment(s), */ +/* verified memset and memcpy */ +/* cases, accepted both INPUT */ +/* and FEATURE reports, */ +/* resulting in version 6.0.2 */ /* */ /**************************************************************************/ UINT _ux_host_class_hid_report_get(UX_HOST_CLASS_HID *hid, UX_HOST_CLASS_HID_CLIENT_REPORT *client_report) @@ -112,8 +117,9 @@ UINT status; /* Get the report pointer from the caller. */ hid_report = client_report -> ux_host_class_hid_client_report; - /* Ensure this is a INPUT report. */ - if (hid_report -> ux_host_class_hid_report_type != UX_HOST_CLASS_HID_REPORT_TYPE_INPUT) + /* Ensure this is a INPUT report or FEATURE report. */ + if (hid_report -> ux_host_class_hid_report_type != UX_HOST_CLASS_HID_REPORT_TYPE_INPUT && + hid_report -> ux_host_class_hid_report_type != UX_HOST_CLASS_HID_REPORT_TYPE_FEATURE) { /* Unprotect thread reentry to this instance. */ @@ -202,7 +208,7 @@ UINT status; { /* We have enough memory to store the raw buffer. */ - _ux_utility_memory_copy(client_report -> ux_host_class_hid_client_report_buffer, report_buffer, transfer_request -> ux_transfer_request_actual_length); + _ux_utility_memory_copy(client_report -> ux_host_class_hid_client_report_buffer, report_buffer, transfer_request -> ux_transfer_request_actual_length); /* Use case of memcpy is verified. */ /* Set status to success. */ status = UX_SUCCESS; diff --git a/common/usbx_host_controllers/src/ux_hcd_ohci_asynchronous_endpoint_destroy.c b/common/usbx_host_controllers/src/ux_hcd_ohci_asynchronous_endpoint_destroy.c index fb2cee4..4c30840 100644 --- a/common/usbx_host_controllers/src/ux_hcd_ohci_asynchronous_endpoint_destroy.c +++ b/common/usbx_host_controllers/src/ux_hcd_ohci_asynchronous_endpoint_destroy.c @@ -35,7 +35,7 @@ /* FUNCTION RELEASE */ /* */ /* _ux_hcd_ohci_asynchronous_endpoint_destroy PORTABLE C */ -/* 6.0 */ +/* 6.0.2 */ /* AUTHOR */ /* */ /* Chaoqiong Xiao, Microsoft Corporation */ @@ -70,6 +70,10 @@ /* DATE NAME DESCRIPTION */ /* */ /* 05-19-2020 Chaoqiong Xiao Initial Version 6.0 */ +/* 08-14-2020 Chaoqiong Xiao Modified comment(s), */ +/* fixed physical and virtual */ +/* address conversion, */ +/* resulting in version 6.0.2 */ /* */ /**************************************************************************/ UINT _ux_hcd_ohci_asynchronous_endpoint_destroy(UX_HCD_OHCI *hcd_ohci, UX_ENDPOINT *endpoint) @@ -162,14 +166,10 @@ ULONG ohci_register; if (next_ed != UX_NULL) next_ed -> ux_ohci_ed_previous_ed = previous_ed; - /* We use the tail TD as a pointer to the Dummy TD. */ - tail_td = (UX_OHCI_TD *) _ux_utility_virtual_address(ed -> ux_ohci_ed_tail_td); - /* Ensure that the potential Halt bit is removed in the head ED. */ value_td = (ULONG) _ux_utility_virtual_address(ed -> ux_ohci_ed_head_td) & UX_OHCI_ED_MASK_TD; - head_td = (UX_OHCI_TD *) _ux_utility_physical_address((VOID *) value_td); - ed -> ux_ohci_ed_head_td = head_td; - + head_td = (UX_OHCI_TD *) value_td; + /* Remove all the tds from this ED and leave the head and tail pointing to the dummy TD. */ tail_td = _ux_utility_virtual_address(ed -> ux_ohci_ed_tail_td); diff --git a/common/usbx_host_controllers/src/ux_hcd_ohci_interrupt_endpoint_create.c b/common/usbx_host_controllers/src/ux_hcd_ohci_interrupt_endpoint_create.c index 5ecf246..932925e 100644 --- a/common/usbx_host_controllers/src/ux_hcd_ohci_interrupt_endpoint_create.c +++ b/common/usbx_host_controllers/src/ux_hcd_ohci_interrupt_endpoint_create.c @@ -35,7 +35,7 @@ /* FUNCTION RELEASE */ /* */ /* _ux_hcd_ohci_interrupt_endpoint_create PORTABLE C */ -/* 6.0 */ +/* 6.0.2 */ /* AUTHOR */ /* */ /* Chaoqiong Xiao, Microsoft Corporation */ @@ -87,6 +87,10 @@ /* DATE NAME DESCRIPTION */ /* */ /* 05-19-2020 Chaoqiong Xiao Initial Version 6.0 */ +/* 08-14-2020 Chaoqiong Xiao Modified comment(s), */ +/* fixed physical and virtual */ +/* address conversion, */ +/* resulting in version 6.0.2 */ /* */ /**************************************************************************/ UINT _ux_hcd_ohci_interrupt_endpoint_create(UX_HCD_OHCI *hcd_ohci, UX_ENDPOINT *endpoint) @@ -199,7 +203,10 @@ UINT interval_ohci; /* Check for end of tree which happens for devices with interval of 1. In this case there might not be a next_ed. */ if (next_ed != UX_NULL) + { + next_ed = _ux_utility_virtual_address(next_ed); next_ed -> ux_ohci_ed_previous_ed = ed; + } ed -> ux_ohci_ed_next_ed = _ux_utility_physical_address(next_ed); ed -> ux_ohci_ed_previous_ed = ed_list; ed_list -> ux_ohci_ed_next_ed = _ux_utility_physical_address(ed); diff --git a/common/usbx_host_controllers/src/ux_hcd_ohci_next_td_clean.c b/common/usbx_host_controllers/src/ux_hcd_ohci_next_td_clean.c index dd185c0..b6b57e2 100644 --- a/common/usbx_host_controllers/src/ux_hcd_ohci_next_td_clean.c +++ b/common/usbx_host_controllers/src/ux_hcd_ohci_next_td_clean.c @@ -35,7 +35,7 @@ /* FUNCTION RELEASE */ /* */ /* _ux_hcd_ohci_next_td_clean PORTABLE C */ -/* 6.0 */ +/* 6.0.2 */ /* AUTHOR */ /* */ /* Chaoqiong Xiao, Microsoft Corporation */ @@ -67,6 +67,10 @@ /* DATE NAME DESCRIPTION */ /* */ /* 05-19-2020 Chaoqiong Xiao Initial Version 6.0 */ +/* 08-14-2020 Chaoqiong Xiao Modified comment(s), */ +/* fixed physical and virtual */ +/* address conversion, */ +/* resulting in version 6.0.2 */ /* */ /**************************************************************************/ VOID _ux_hcd_ohci_next_td_clean(UX_OHCI_TD *td) @@ -83,12 +87,12 @@ ULONG value_carry; ed = td -> ux_ohci_td_ed; /* Ensure that the potential Carry bit is maintained in the head ED. */ - value_carry = (ULONG) _ux_utility_virtual_address(ed -> ux_ohci_ed_head_td) & UX_OHCI_ED_TOGGLE_CARRY; + value_carry = (ULONG)(ed -> ux_ohci_ed_head_td) & UX_OHCI_ED_TOGGLE_CARRY; /* Ensure that the potential Halt bit is removed in the head ED. */ value_td = (ULONG) _ux_utility_virtual_address(ed -> ux_ohci_ed_head_td) & UX_OHCI_ED_MASK_TD; - head_td = (UX_OHCI_TD *) _ux_utility_physical_address((VOID *) value_td); - + head_td = (UX_OHCI_TD *)value_td; + /* Remove all the tds from this ED and leave the head and tail pointing to the dummy TD. */ tail_td = _ux_utility_virtual_address(ed -> ux_ohci_ed_tail_td); diff --git a/common/usbx_host_controllers/src/ux_hcd_ohci_periodic_endpoint_destroy.c b/common/usbx_host_controllers/src/ux_hcd_ohci_periodic_endpoint_destroy.c index f99fe04..9e70d63 100644 --- a/common/usbx_host_controllers/src/ux_hcd_ohci_periodic_endpoint_destroy.c +++ b/common/usbx_host_controllers/src/ux_hcd_ohci_periodic_endpoint_destroy.c @@ -35,7 +35,7 @@ /* FUNCTION RELEASE */ /* */ /* _ux_hcd_ohci_periodic_endpoint_destroy PORTABLE C */ -/* 6.0 */ +/* 6.0.2 */ /* AUTHOR */ /* */ /* Chaoqiong Xiao, Microsoft Corporation */ @@ -66,6 +66,10 @@ /* DATE NAME DESCRIPTION */ /* */ /* 05-19-2020 Chaoqiong Xiao Initial Version 6.0 */ +/* 08-14-2020 Chaoqiong Xiao Modified comment(s), */ +/* fixed physical and virtual */ +/* address conversion, */ +/* resulting in version 6.0.2 */ /* */ /**************************************************************************/ UINT _ux_hcd_ohci_periodic_endpoint_destroy(UX_HCD_OHCI *hcd_ohci, UX_ENDPOINT *endpoint) @@ -113,18 +117,17 @@ ULONG value_td; /* There may not be any next endpoint. But if there is one, link it to the previous ED. */ if (next_ed != UX_NULL) + { /* Update the previous ED pointer in the next ED. */ + next_ed = _ux_utility_virtual_address(next_ed); next_ed -> ux_ohci_ed_previous_ed = previous_ed; - - /* We use the tail TD as a pointer to the Dummy TD. */ - tail_td = (UX_OHCI_TD *) _ux_utility_virtual_address(ed -> ux_ohci_ed_tail_td); + } /* Ensure that the potential Halt bit is removed in the head ED. */ value_td = (ULONG) _ux_utility_virtual_address(ed -> ux_ohci_ed_head_td) & UX_OHCI_ED_MASK_TD; - head_td = (UX_OHCI_TD *) _ux_utility_physical_address((VOID *) value_td); - ed -> ux_ohci_ed_head_td = head_td; - + head_td = (UX_OHCI_TD *)value_td; + /* Remove all the tds from this ED and leave the head and tail pointing to the dummy TD. */ tail_td = _ux_utility_virtual_address(ed -> ux_ohci_ed_tail_td); diff --git a/common/usbx_host_controllers/src/ux_hcd_ohci_transfer_abort.c b/common/usbx_host_controllers/src/ux_hcd_ohci_transfer_abort.c index 61c7a9e..e76fb2f 100644 --- a/common/usbx_host_controllers/src/ux_hcd_ohci_transfer_abort.c +++ b/common/usbx_host_controllers/src/ux_hcd_ohci_transfer_abort.c @@ -35,7 +35,7 @@ /* FUNCTION RELEASE */ /* */ /* _ux_hcd_ohci_transfer_abort PORTABLE C */ -/* 6.0 */ +/* 6.0.2 */ /* AUTHOR */ /* */ /* Chaoqiong Xiao, Microsoft Corporation */ @@ -69,6 +69,10 @@ /* DATE NAME DESCRIPTION */ /* */ /* 05-19-2020 Chaoqiong Xiao Initial Version 6.0 */ +/* 08-14-2020 Chaoqiong Xiao Modified comment(s), */ +/* fixed physical and virtual */ +/* address conversion, */ +/* resulting in version 6.0.2 */ /* */ /**************************************************************************/ UINT _ux_hcd_ohci_transfer_abort(UX_HCD_OHCI *hcd_ohci, UX_TRANSFER *transfer_request) @@ -108,13 +112,12 @@ ULONG value_carry; _ux_utility_delay_ms(1); /* Ensure that the potential Carry bit is maintained in the head ED. */ - value_carry = (ULONG) _ux_utility_virtual_address(ed -> ux_ohci_ed_head_td) & UX_OHCI_ED_TOGGLE_CARRY; + value_carry = (ULONG)(ed -> ux_ohci_ed_head_td) & UX_OHCI_ED_TOGGLE_CARRY; /* Ensure that the potential Halt bit is removed in the head ED. */ value_td = (ULONG) _ux_utility_virtual_address(ed -> ux_ohci_ed_head_td) & UX_OHCI_ED_MASK_TD; - head_td = (UX_OHCI_TD *) _ux_utility_physical_address((VOID *) value_td); - ed -> ux_ohci_ed_head_td = head_td; - + head_td = (UX_OHCI_TD *)value_td; + /* Remove all the tds from this ED and leave the head and tail pointing to the dummy TD. */ tail_td = _ux_utility_virtual_address(ed -> ux_ohci_ed_tail_td); |
