diff --git a/include/openseachest_util_options.h b/include/openseachest_util_options.h index 068041a..b2d271a 100644 --- a/include/openseachest_util_options.h +++ b/include/openseachest_util_options.h @@ -537,6 +537,12 @@ extern "C" #define ZERO_VERIFY_LONG_OPT_STRING "zeroVerify" #define ZERO_VERIFY_LONG_OPT { ZERO_VERIFY_LONG_OPT_STRING, required_argument, NULL, 0 } + //before erasing a drive, restore the max LBA to make sure all user accessible spaces will be erased. + #define ERASE_RESTORE_MAX_PREP eraseRestoreMaxLBAPrep + #define ERASE_RESTORE_MAX_VAR getOptBool ERASE_RESTORE_MAX_PREP = goFalse; + #define ERASE_RESTORE_MAX_PREP_LONG_OPT_STRING "eraseRestoreMaxPrep" + #define ERASE_RESTORE_MAX_PREP_LONG_OPT { ERASE_RESTORE_MAX_PREP_LONG_OPT_STRING, no_argument, &ERASE_RESTORE_MAX_PREP, goTrue } + //Generic read test options #define GENERIC_TEST_MODE_FLAG genericTestMode #define GENERIC_TEST_MODE_VAR int genericTestMode = 0; //0 = read, 1 = write, 2 = verify @@ -3483,6 +3489,9 @@ extern "C" void print_Persistent_Reservations_Preempt_Abort_Help(bool shortHelp); void print_Zero_Verify_Help(bool shortHelp); + + void print_Erase_Restore_Max_Prep_Help(bool shortHelp); + void print_NVME_Health_Help(bool shortHelp); void print_Delay_CMD_Segment_Help(bool shortHelp); diff --git a/meson.build b/meson.build index fb63811..8382232 100644 --- a/meson.build +++ b/meson.build @@ -80,28 +80,38 @@ endif add_project_arguments(c.get_supported_arguments(warning_flags), language : 'c') -if not (target_machine.system() == 'sunos') and (c.get_id() == 'gcc' or c.get_id() == 'clang') - add_global_arguments( +small_code_cc_flags = [] +small_code_link_flags = [] + +if (c.get_id() == 'gcc' or c.get_id() == 'clang') + + small_code_cc_flags = [ '-ffunction-sections', '-fdata-sections', - language: 'c', - ) - add_global_link_arguments( + ] + small_code_link_flags = [ '-Wl,--gc-sections', - language: 'c', - ) + ] + #if GCC less than 5, need to set -std=gnu99 at minimum. gnu11 became the default in 5, 17 default in 7 or 8. #TODO: May be able to move to c11/gnu11 instead, but will need to do a lot of testing first #skipping sunos since this was a compatibility issue that was reported earlier. May be able to find a better way to handle this in the future. if not (target_machine.system() == 'sunos') and c.get_id().contains('gcc') - verStr = c.version().split('.') - if verStr.get(0).to_int() < 5 + if c.version().version_compare('<5.0') + if c.has_argument('-std=gnu99') + #Add this argument to the list since C99 is a minimum required C compiler standard add_global_arguments('-std=gnu99', language: 'c',) + else + error('C99/GNU99 standard is required but was not able to be set!') + endif endif endif endif +add_global_arguments(c.get_supported_arguments(small_code_cc_flags), language : 'c') +add_global_link_arguments(c.get_supported_link_arguments(small_code_link_flags), language : 'c') + if not get_option('tcg').enabled() add_project_arguments('-DDISABLE_TCG_SUPPORT', language : 'c') endif diff --git a/src/openseachest_util_options.c b/src/openseachest_util_options.c index eab0735..e5fa99f 100644 --- a/src/openseachest_util_options.c +++ b/src/openseachest_util_options.c @@ -4351,6 +4351,30 @@ void print_Persistent_Reservations_Preempt_Abort_Help(bool shortHelp) } } +void print_Erase_Restore_Max_Prep_Help(bool shortHelp) +{ + printf("\t--%s\n", ERASE_RESTORE_MAX_PREP_LONG_OPT_STRING); + if (!shortHelp) + { + printf("\t\tThis option will attempt to restore the max LBA to the highest\n"); + printf("\t\tuser addressable sector prior to beginning a drive erasure.\n"); + printf("\t\tIf any failure is encountered while restoring the maxLBA, then\n"); + printf("\t\tan error will be indicated and the erase will not be started or\n"); + printf("\t\tattempted until other user intervention can be completed.\n"); + printf("\t\tIf a feature is frozen, locked, or has already been used during\n"); + printf("\t\tthe current power cycle, then these things can cause a failure.\n"); + printf("\t\tThe solution is to power cycle the drive, but in some cases it may\n"); + printf("\t\tbe necessary to try a different computer or adapter as commands may\n"); + printf("\t\tbe blocked by the system or automatically issued by the BIOS to lock\n"); + printf("\t\taccess to capacity changing commands.\n"); + printf("\t\tThis option will handle the ATA HPA (Host Protected Area), AMAC (Accessible\n"); + printf("\t\tMax Address Configuration), HPA Security Extension, and DCO (Device\n"); + printf("\t\tConfiguration Overlay) features in accordance with the specifications.\n"); + printf("\t\tIf the restore completes without error, then the erase will proceed\n"); + printf("\t\tand additional errors will only be in relation to those erasure methods.\n\n"); + } +} + void print_Zero_Verify_Help(bool shortHelp) { printf("\t--%s [full | quick]\n", ZERO_VERIFY_LONG_OPT_STRING); diff --git a/subprojects/opensea-common b/subprojects/opensea-common index 8daf4b6..e602e7f 160000 --- a/subprojects/opensea-common +++ b/subprojects/opensea-common @@ -1 +1 @@ -Subproject commit 8daf4b6288f3b68aa8c0826af423aab3a8fe0183 +Subproject commit e602e7f8068e44391cdd19bc1333dcc693dc4196 diff --git a/subprojects/opensea-operations b/subprojects/opensea-operations index 46fbf30..28c4075 160000 --- a/subprojects/opensea-operations +++ b/subprojects/opensea-operations @@ -1 +1 @@ -Subproject commit 46fbf302cc0bdc720e12c172bbf8321eca8fcdf8 +Subproject commit 28c4075baee7bf424c5677f3204b609c5f5bcce4 diff --git a/subprojects/opensea-transport b/subprojects/opensea-transport index 2a2349c..6fe60c8 160000 --- a/subprojects/opensea-transport +++ b/subprojects/opensea-transport @@ -1 +1 @@ -Subproject commit 2a2349c78e9d5d3bb2a13c06bd616a6889ae42e1 +Subproject commit 6fe60c8a043547b6c41f6b32503f77257ff67607 diff --git a/subprojects/wingetopt b/subprojects/wingetopt index 310d683..2821208 160000 --- a/subprojects/wingetopt +++ b/subprojects/wingetopt @@ -1 +1 @@ -Subproject commit 310d683dbe643c4c7b4e6aee5bec0bf1a8e10612 +Subproject commit 28212084ce0008588605e91f3a041dcc805642a4 diff --git a/utils/C/openSeaChest/openSeaChest_Configure.c b/utils/C/openSeaChest/openSeaChest_Configure.c index a50ab6b..85434a4 100644 --- a/utils/C/openSeaChest/openSeaChest_Configure.c +++ b/utils/C/openSeaChest/openSeaChest_Configure.c @@ -33,7 +33,7 @@ // Global Variables // //////////////////////// const char *util_name = "openSeaChest_Configure"; -const char *buildVersion = "2.4.1"; +const char *buildVersion = "2.4.5"; //////////////////////////// // functions to declare // @@ -1845,12 +1845,21 @@ int32_t main(int argc, char *argv[]) if (ATA_DCO_RESTORE) { + bool scsiAtaInSync = false; switch (dco_Restore(&deviceList[deviceIter])) { case SUCCESS: + scsiAtaInSync = is_Max_LBA_In_Sync_With_Adapter_Or_Driver(&deviceList[deviceIter], false); + fill_Drive_Info_Data(&deviceList[deviceIter]); if (VERBOSITY_QUIET < toolVerbosity) { printf("Successfully restored factory settings using DCO.\n"); + if (!scsiAtaInSync) + { + printf("\nWARNING: The adapter/driver/bridge is not in sync with the capacity change!\n"); + printf(" A reboot is strongly recommended to make sure the system works without\n"); + printf(" errors with the drive at its new capacity.\n\n"); + } } break; case NOT_SUPPORTED: @@ -1895,6 +1904,7 @@ int32_t main(int argc, char *argv[]) if (ATA_DCO_DISABLE_FEATURES || ATA_DCO_SETMAXMODE || ATA_DCO_SETMAXLBA) { dcoData dco; + bool scsiAtaInSync = false; memset(&dco, 0, sizeof(dcoData)); switch (dco_Identify(&deviceList[deviceIter], &dco)) { @@ -2098,9 +2108,20 @@ int32_t main(int argc, char *argv[]) switch (dco_Set(&deviceList[deviceIter], &dco)) { case SUCCESS: + if (ATA_DCO_SETMAXLBA) + { + scsiAtaInSync = is_Max_LBA_In_Sync_With_Adapter_Or_Driver(&deviceList[deviceIter], false); + fill_Drive_Info_Data(&deviceList[deviceIter]); + } if (VERBOSITY_QUIET < toolVerbosity) { printf("Successfully configured available features/modes/maxLBA using DCO.\n"); + if (!scsiAtaInSync) + { + printf("\nWARNING: The adapter/driver/bridge is not in sync with the capacity change!\n"); + printf(" A reboot is strongly recommended to make sure the system works without\n"); + printf(" errors with the drive at its new capacity.\n\n"); + } } break; case NOT_SUPPORTED: @@ -2979,6 +3000,7 @@ int32_t main(int argc, char *argv[]) if (SET_MAX_LBA_FLAG) { + bool scsiAtaInSync = false; if (VERBOSITY_QUIET < toolVerbosity) { printf("Setting MaxLBA to %"PRIu64"\n", SET_MAX_LBA_VALUE); @@ -2986,18 +3008,32 @@ int32_t main(int argc, char *argv[]) switch (set_Max_LBA(&deviceList[deviceIter], SET_MAX_LBA_VALUE, false)) { case SUCCESS: + scsiAtaInSync = is_Max_LBA_In_Sync_With_Adapter_Or_Driver(&deviceList[deviceIter], false); fill_Drive_Info_Data(&deviceList[deviceIter]); if (VERBOSITY_QUIET < toolVerbosity) { double mCapacity = 0, capacity = 0; char mCapUnits[UNIT_STRING_LENGTH] = { 0 }, capUnits[UNIT_STRING_LENGTH] = { 0 }; char* mCapUnit = &mCapUnits[0], * capUnit = &capUnits[0]; - mCapacity = C_CAST(double, deviceList[deviceIter].drive_info.deviceMaxLba * deviceList[deviceIter].drive_info.deviceBlockSize); + if (deviceList[deviceIter].drive_info.bridge_info.isValid) + { + mCapacity = C_CAST(double, deviceList[deviceIter].drive_info.bridge_info.childDeviceMaxLba * deviceList[deviceIter].drive_info.bridge_info.childDeviceBlockSize); + } + else + { + mCapacity = C_CAST(double, deviceList[deviceIter].drive_info.deviceMaxLba * deviceList[deviceIter].drive_info.deviceBlockSize); + } capacity = mCapacity; metric_Unit_Convert(&mCapacity, &mCapUnit); capacity_Unit_Convert(&capacity, &capUnit); printf("Successfully set the max LBA to %" PRIu64 "\n", SET_MAX_LBA_VALUE); printf("New Drive Capacity (%s/%s): %0.02f/%0.02f\n", mCapUnit, capUnit, mCapacity, capacity); + if (!scsiAtaInSync) + { + printf("\nWARNING: The adapter/driver/bridge is not in sync with the capacity change!\n"); + printf(" A reboot is strongly recommended to make sure the system works without\n"); + printf(" errors with the drive at its new capacity.\n\n"); + } } break; case NOT_SUPPORTED: @@ -3018,6 +3054,7 @@ int32_t main(int argc, char *argv[]) } if (RESTORE_MAX_LBA_FLAG) { + bool scsiAtaInSync = false; if (VERBOSITY_QUIET < toolVerbosity) { printf("Restoring max LBA\n"); @@ -3025,17 +3062,32 @@ int32_t main(int argc, char *argv[]) switch (set_Max_LBA(&deviceList[deviceIter], 0, true)) { case SUCCESS: + scsiAtaInSync = is_Max_LBA_In_Sync_With_Adapter_Or_Driver(&deviceList[deviceIter], false); + fill_Drive_Info_Data(&deviceList[deviceIter]); if (VERBOSITY_QUIET < toolVerbosity) { double mCapacity = 0, capacity = 0; char mCapUnits[UNIT_STRING_LENGTH] = { 0 }, capUnits[UNIT_STRING_LENGTH] = { 0 }; char* mCapUnit = &mCapUnits[0], * capUnit = &capUnits[0]; - mCapacity = C_CAST(double, deviceList[deviceIter].drive_info.deviceMaxLba * deviceList[deviceIter].drive_info.deviceBlockSize); + if (deviceList[deviceIter].drive_info.bridge_info.isValid) + { + mCapacity = C_CAST(double, deviceList[deviceIter].drive_info.bridge_info.childDeviceMaxLba * deviceList[deviceIter].drive_info.bridge_info.childDeviceBlockSize); + } + else + { + mCapacity = C_CAST(double, deviceList[deviceIter].drive_info.deviceMaxLba * deviceList[deviceIter].drive_info.deviceBlockSize); + } capacity = mCapacity; metric_Unit_Convert(&mCapacity, &mCapUnit); capacity_Unit_Convert(&capacity, &capUnit); printf("Successfully restored the max LBA\n"); printf("New Drive Capacity (%s/%s): %0.02f/%0.02f\n", mCapUnit, capUnit, mCapacity, capacity); + if (!scsiAtaInSync) + { + printf("\nWARNING: The adapter/driver/bridge is not in sync with the capacity change!\n"); + printf(" A reboot is strongly recommended to make sure the system works without\n"); + printf(" errors with the drive at its new capacity.\n\n"); + } } break; case NOT_SUPPORTED: diff --git a/utils/C/openSeaChest/openSeaChest_Erase.c b/utils/C/openSeaChest/openSeaChest_Erase.c index 9361316..9a9b822 100644 --- a/utils/C/openSeaChest/openSeaChest_Erase.c +++ b/utils/C/openSeaChest/openSeaChest_Erase.c @@ -42,11 +42,12 @@ #include "format.h" #include "platform_helper.h" #include "generic_tests.h" +#include "set_max_lba.h" //////////////////////// // Global Variables // //////////////////////// const char *util_name = "openSeaChest_Erase"; -const char *buildVersion = "4.2.0"; +const char *buildVersion = "4.3.4"; typedef enum _eSeaChestEraseExitCodes { @@ -150,6 +151,7 @@ int32_t main(int argc, char *argv[]) #endif HIDE_LBA_COUNTER_VAR LOWLEVEL_INFO_VAR + ERASE_RESTORE_MAX_VAR int args = 0; int argIndex = 0; @@ -219,6 +221,7 @@ int32_t main(int argc, char *argv[]) NVM_FORMAT_LONG_OPT, NVM_FORMAT_OPTIONS_LONG_OPTS, ZERO_VERIFY_LONG_OPT, + ERASE_RESTORE_MAX_PREP_LONG_OPT, LONG_OPT_TERMINATOR }; @@ -1178,6 +1181,7 @@ int32_t main(int argc, char *argv[]) || DISPLAY_LBA_FLAG || NVM_FORMAT_FLAG || ZERO_VERIFY_FLAG + || ERASE_RESTORE_MAX_PREP )) { utility_Usage(true); @@ -1647,6 +1651,102 @@ int32_t main(int argc, char *argv[]) } } + if (ERASE_RESTORE_MAX_PREP) + { + bool doNotContinueToErase = true; + bool scsiAtaInSync = false; + switch (restore_Max_LBA_For_Erase(&deviceList[deviceIter])) + { + case SUCCESS: + doNotContinueToErase = false;//successfully restored so continuing onwards to erase is fine. + scsiAtaInSync = is_Max_LBA_In_Sync_With_Adapter_Or_Driver(&deviceList[deviceIter], false); + fill_Drive_Info_Data(&deviceList[deviceIter]);//refresh stale data + if (VERBOSITY_QUIET < toolVerbosity) + { + double mCapacity = 0, capacity = 0; + char mCapUnits[UNIT_STRING_LENGTH] = { 0 }, capUnits[UNIT_STRING_LENGTH] = { 0 }; + char* mCapUnit = &mCapUnits[0], * capUnit = &capUnits[0]; + if (deviceList[deviceIter].drive_info.bridge_info.isValid) + { + mCapacity = C_CAST(double, deviceList[deviceIter].drive_info.bridge_info.childDeviceMaxLba * deviceList[deviceIter].drive_info.bridge_info.childDeviceBlockSize); + } + else + { + mCapacity = C_CAST(double, deviceList[deviceIter].drive_info.deviceMaxLba * deviceList[deviceIter].drive_info.deviceBlockSize); + } + capacity = mCapacity; + metric_Unit_Convert(&mCapacity, &mCapUnit); + capacity_Unit_Convert(&capacity, &capUnit); + printf("Successfully restored maxLBA to highest possible user addressable LBA!\n"); + printf("New Drive Capacity (%s/%s): %0.02f/%0.02f\n", mCapUnit, capUnit, mCapacity, capacity); + if (!scsiAtaInSync) + { + printf("\nWARNING: The adapter/driver/bridge is not in sync with the capacity change!\n"); + printf(" If using a drive managed erase, this will not be an issue since the\n"); + printf(" drive firmware will handle this change properly.\n"); + printf(" If performing a manual overwrite, such as --%s, then a power cycle\n", OVERWRITE_LONG_OPT_STRING); + printf(" is strongly recommended to make sure all writes complete without error.\n"); + } + } + break; + case DEVICE_ACCESS_DENIED: + case FROZEN: + case ABORTED: + if (VERBOSITY_QUIET < toolVerbosity) + { + printf("Drive aborted the command to restore max LBA. The device may already be at maxLBA,\n"); + printf("the restore command may have been blocked, the feature may be locked/frozen\n"); + printf("or some other unknown reason caused the abort.\n"); + printf("Try power cycling the drive/system and try again or try a different system\n"); + printf("or method of attaching the drive to run this command.\n"); + printf("When a feature is \"frozen\" the drive must be power cycled to clear this condition.\n"); + printf("Some systems will issue the freeze commands on boot which is why changing which system\n"); + printf("is used or how the drive is attached to the system can get around this issue.\n"); + printf("If the device supports the HPA security extension feature, then changes to HPA may be\n"); + printf("blocked by the password set by this feature. You must either unlock the HPA security\n"); + printf("feature, or power cycle the drive to remove the password and lock.\n"); + printf("If you think that the device is already at maxLBA or want to proceed to erase anyways,\n"); + printf("remove the --%s option from the command line and try again.\n", ERASE_RESTORE_MAX_PREP_LONG_OPT_STRING); + printf("Erase will not be started while this is failing.\n\n"); + } + exitCode = UTIL_EXIT_OPERATION_FAILURE; + break; + case NOT_SUPPORTED: + if (VERBOSITY_QUIET < toolVerbosity) + { + printf("Restoring maxLBA does not appear to be supported on this device.\n"); + printf("If you believe this is an error, try changing how the device is\n"); + printf("attached to the system (move from USB to SATA or from SAS HBA to\n"); + printf("the motherboard) and try again.\n"); + printf("If this does not work, try another system.\n"); + printf("If you think that the device is already at maxLBA or want to proceed to erase anyways,\n"); + printf("remove the --%s option from the command line and try again.\n", ERASE_RESTORE_MAX_PREP_LONG_OPT_STRING); + printf("Erase will not be started while this is failing.\n\n"); + } + exitCode = UTIL_EXIT_OPERATION_NOT_SUPPORTED; + break; + case FAILURE: + default: + if (VERBOSITY_QUIET < toolVerbosity) + { + printf("Failed to restore max LBA. The device may already be at maxLBA, the restore\n"); + printf("command may have been blocked, or some other unknown reason caused the failure.\n"); + printf("Try power cycling the drive/system and try again or try a different system\n"); + printf("or method of attaching the drive to run this command.\n"); + printf("If you think that the device is already at maxLBA or want to proceed to erase anyways,\n"); + printf("remove the --%s option from the command line and try again.\n", ERASE_RESTORE_MAX_PREP_LONG_OPT_STRING); + printf("Erase will not be started while this is failing.\n\n"); + } + exitCode = UTIL_EXIT_OPERATION_FAILURE; + break; + } + if (doNotContinueToErase) + { + //continue the loop to any additional drives since they may pass + continue; + } + } + #ifdef DISABLE_TCG_SUPPORT #else @@ -2870,6 +2970,8 @@ void utility_Usage(bool shortUsage) printf("\t%s -d %s --%s 4096 --%s\n", util_name, deviceHandleExample, NVM_FORMAT_LONG_OPT_STRING, POLL_LONG_OPT_STRING); printf("\t%s -d %s --%s current --%s --%s user\n", util_name, deviceHandleExample, NVM_FORMAT_LONG_OPT_STRING, POLL_LONG_OPT_STRING, NVM_FORMAT_SECURE_ERASE_LONG_OPT_STRING); printf("\t%s -d %s --%s current --%s --%s 1\n", util_name, deviceHandleExample, NVM_FORMAT_LONG_OPT_STRING, POLL_LONG_OPT_STRING, NVM_FORMAT_PI_TYPE_LONG_OPT_STRING); + printf("\t%s -d %s --%s\n", util_name, deviceHandleExample, ERASE_RESTORE_MAX_PREP_LONG_OPT_STRING); + printf("\t%s -d %s --%s --%s 0\n", util_name, deviceHandleExample, ERASE_RESTORE_MAX_PREP_LONG_OPT_STRING, OVERWRITE_LONG_OPT_STRING); //return codes printf("\nReturn codes\n"); printf("============\n"); @@ -2943,6 +3045,7 @@ void utility_Usage(bool shortUsage) print_TCG_PSID_Help(shortUsage); #endif print_Time_Seconds_Help(shortUsage); + print_Erase_Restore_Max_Prep_Help(shortUsage); print_Show_Supported_Erase_Modes_Help(shortUsage); #if !defined(DISABLE_TCG_SUPPORT) print_TCG_SID_Help(shortUsage); diff --git a/utils/C/openSeaChest/openSeaChest_Format.c b/utils/C/openSeaChest/openSeaChest_Format.c index 215a518..2cc70ca 100644 --- a/utils/C/openSeaChest/openSeaChest_Format.c +++ b/utils/C/openSeaChest/openSeaChest_Format.c @@ -32,7 +32,7 @@ // Global Variables // //////////////////////// const char *util_name = "openSeaChest_Format"; -const char *buildVersion = "3.0.1"; +const char *buildVersion = "3.0.2"; //////////////////////////// // functions to declare // @@ -1428,19 +1428,6 @@ int32_t main(int argc, char *argv[]) if (VERBOSITY_QUIET < toolVerbosity) { printf("Set Sector Size to %" PRIu32 "\n", SET_SECTOR_SIZE_SIZE); - printf("\nWARNING: It is not recommended to do this on USB enclosures as not\n"); - printf(" all USB adapters can handle a 4k sector size.\n"); - printf("WARNING (SATA): Do not interrupt this operation once it has started or \n"); - printf(" it may cause the drive to become unusable. Stop all possible background\n"); - printf(" activity that would attempt to communicate with the device while this\n"); - printf(" operation is in progress\n"); - printf("Press CTRL-C to cancel this operation before the timer runs out.\n"); - for (uint8_t timer = UINT8_C(30); timer > 0; --timer) - { - printf("\r %2" PRIu8, timer); - delay_Seconds(UINT32_C(1)); - } - printf("\r 0\n"); } switch (set_Sector_Configuration(&deviceList[deviceIter], SET_SECTOR_SIZE_SIZE)) { @@ -1452,6 +1439,11 @@ int32_t main(int argc, char *argv[]) { printf("NOTE: This command may have affected more than 1 logical unit\n"); } + printf("NOTE: After changing the sector size the drive may need to perform additional\n"); + printf(" background operations in order to ensure full functionality and reliability.\n"); + printf(" This background activity may take a long time and will prevent the drive from\n"); + printf(" entering power saving modes like idle or standby until these operations have\n"); + printf(" completed. These operations may take a very long time to complete.\n"); } break; case NOT_SUPPORTED: diff --git a/utils/C/openSeaChest/openSeaChest_GenericTests.c b/utils/C/openSeaChest/openSeaChest_GenericTests.c index 69c5a66..f3e5bd2 100644 --- a/utils/C/openSeaChest/openSeaChest_GenericTests.c +++ b/utils/C/openSeaChest/openSeaChest_GenericTests.c @@ -30,7 +30,7 @@ // Global Variables // //////////////////////// const char *util_name = "openSeaChest_GenericTests"; -const char *buildVersion = "2.2.1"; +const char *buildVersion = "2.2.2"; //////////////////////////// // functions to declare // @@ -1284,16 +1284,17 @@ int32_t main(int argc, char *argv[]) else { //timed test - uint64_t timeInSeconds = SECONDS_TIME_FLAG + (MINUTES_TIME_FLAG * 60) + (HOURS_TIME_FLAG * 3600); + uint64_t timeInSeconds = C_CAST(uint64_t, SECONDS_TIME_FLAG) + (C_CAST(uint64_t, MINUTES_TIME_FLAG) * UINT64_C(60)) + (C_CAST(uint64_t, HOURS_TIME_FLAG) * UINT64_C(3600)); if (VERBOSITY_QUIET < toolVerbosity) { - uint8_t days = 0, hours = 0, minutes = 0, seconds = 0; + uint16_t days = 0; + uint8_t hours = 0, minutes = 0, seconds = 0; convert_Seconds_To_Displayable_Time(timeInSeconds, NULL, &days, &hours, &minutes, &seconds); - printf("Starting user generic timed test at LBA %"PRIu64" for", USER_GENERIC_START_FLAG); + printf("Starting user generic timed test at LBA %" PRIu64 " for", USER_GENERIC_START_FLAG); print_Time_To_Screen(NULL, &days, &hours, &minutes, &seconds); printf("\n"); } - if(ERROR_LIMIT_LOGICAL_COUNT) + if (ERROR_LIMIT_LOGICAL_COUNT) { ERROR_LIMIT_FLAG *= C_CAST(uint16_t, deviceList[deviceIter].drive_info.devicePhyBlockSize / deviceList[deviceIter].drive_info.deviceBlockSize); } diff --git a/utils/C/openSeaChest/openSeaChest_PassthroughTest.c b/utils/C/openSeaChest/openSeaChest_PassthroughTest.c index 324416e..44afa26 100644 --- a/utils/C/openSeaChest/openSeaChest_PassthroughTest.c +++ b/utils/C/openSeaChest/openSeaChest_PassthroughTest.c @@ -33,7 +33,7 @@ // Global Variables // //////////////////////// const char *util_name = "openSeaChest_PassthroughTest"; -const char *buildVersion = "1.3.2"; +const char *buildVersion = "1.3.3"; //////////////////////////// // functions to declare // @@ -7128,7 +7128,7 @@ static bool test_SAT_Capabilities(ptrPassthroughTestParams inputs, ptrScsiDevInf set_Console_Colors(true, LIKELY_HACK_COLOR); printf("HACK FOUND: SPIO\n"); set_Console_Colors(true, DEFAULT); - inputs->device->drive_info.passThroughHacks.ataPTHacks.singleSectorPIOOnly; + inputs->device->drive_info.passThroughHacks.ataPTHacks.singleSectorPIOOnly = true; } //In next tests, need to make sure we actually get response information that makes sense.