Skip to content

Commit

Permalink
Remove nvme_wear_level routine
Browse files Browse the repository at this point in the history
  • Loading branch information
cyhuang1230 committed Apr 3, 2024
1 parent f0cb369 commit b12d807
Show file tree
Hide file tree
Showing 5 changed files with 1 addition and 63 deletions.
13 changes: 0 additions & 13 deletions src/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -305,11 +305,6 @@ class Routine {
| -------------- | ------ | ------------------------------------- |
| length_seconds | number | Length of time to run the routine for |

### NvmeWearLevelRoutineParams
| Property Name | Type | Description |
| -------------------- | ------ | ------------------------------------------------------------------------------- |
| wear_level_threshold | number | Threshold number in percentage which routine examines wear level status against |

### NvmeSelfTestRoutineParams
| Property Name | Type | Description |
| ------------- | ------ | ------------------------------------------------ |
Expand Down Expand Up @@ -523,7 +518,6 @@ Source:
| Function Name | Definition | Permission needed to access | Released in `dpsl` version |
| ----------------------- | ----------------------------------------------------------- | --------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| runSmartctlCheckRoutine | (params: SmartctlCheckRoutineParams?) => Promise\<Routine\> | `os.diagnostics` | intial release: 1.3.0, new parameter added: 1.3.3. The parameter is only available if "smartctl_check_with_percentage_used" is returned from `GetAvailableRoutines` |
| runWearLevelRoutine | (params: NvmeWearLevelRoutineParams) => Promise\<Routine\> | `os.diagnostics` | 1.3.0 |
| runSelfTestRoutine | (params: NvmeSelfTestRoutineParams) => Promise\<Routine\> | `os.diagnostics` | 1.3.3 |

### dpsl.diagnostics.ufs.*
Expand Down Expand Up @@ -812,13 +806,6 @@ No codes are defined for Floating Point Accuracy.
| **`0x0000002`** | SelfTest status: ERROR, cannot get percent info. |
| **`0x0000002`** | SelfTest status: Unknown complete status. |

#### NVMe Wear Level
| Code | Status message |
| --------------- | ------------------------------------------------------------------------------------ |
| `0x0240001` | Wear-level status: FAILED, exceed the limitation value. |
| **`0x0000002`** | Wear-level status: ERROR, threshold in percentage should be non-empty and under 100. |
| **`0x0000002`** | Wear-level status: ERROR, cannot get wear level info. |

#### Prime Search
No codes are defined for Prime Search.

Expand Down
7 changes: 1 addition & 6 deletions src/__tests__/dpsl.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -501,7 +501,7 @@ describe('dpsl.diagnostics tests', () => {
'battery_discharge', 'battery_health', 'cpu_cache',
'cpu_stress', 'memory', 'disk-read', 'dns_provider_present',
'dns_resolution', 'gateway_can_be_pinged', 'smartctl-check',
'signal_strength', 'nvme-wear-level', 'nvme_self_test',
'signal_strength', 'nvme_self_test',
'sensitive_sensor', 'fingerprint_alive', 'emmc_lifetime',
'smartctl_check_with_percentage_used', 'audio_driver',
'ufs_lifetime', 'power_button'],
Expand Down Expand Up @@ -794,11 +794,6 @@ describe('dpsl.diagnostics tests', () => {
'getStatusCodeFunc': statusCodeUtils.getStatusCodeForNvmeSelfTest,
'chromeOsRoutineFunction': 'runNvmeSelfTestRoutine',
},
{
'dpslRoutineFunction': dpsl.diagnostics.nvme.runWearLevelRoutine,
'getStatusCodeFunc': statusCodeUtils.getStatusCodeForNvmeWearLevel,
'chromeOsRoutineFunction': 'runNvmeWearLevelRoutine',
},
{
'dpslRoutineFunction': dpsl.diagnostics.ufs.runUfsLifetimeRoutine,
'getStatusCodeFunc': statusCodeUtils.getStatusCodeForUfsLifeTime,
Expand Down
18 changes: 0 additions & 18 deletions src/diagnostics_manager.js
Original file line number Diff line number Diff line change
Expand Up @@ -399,24 +399,6 @@ class NvmeManager {
(response) => new Routine(response.id,
statusCodeUtils.getStatusCodeForNvmeSelfTest));
}

/**
* Runs NVMe wear level test.
* @param {!dpsl.NvmeWearLevelRoutineParams} params
* @return { !Promise<!Routine> }
* @public
*/
async runWearLevelRoutine(params) {
const functionName = 'runNvmeWearLevelRoutine';
if (!isSupported(functionName)) {
throw new MethodNotFoundError(API_NAME, functionName,
/* chromeVersion */ 100);
}

return chrome.os.diagnostics.runNvmeWearLevelRoutine(params).then(
(response) => new Routine(response.id,
statusCodeUtils.getStatusCodeForNvmeWearLevel));
}
}

/**
Expand Down
20 changes: 0 additions & 20 deletions src/status_codes.js
Original file line number Diff line number Diff line change
Expand Up @@ -579,25 +579,6 @@ function getStatusCodeForNvmeSelfTest(routineStatus) {
}
}

/**
* Get status code based on the specified status message for routine "NVMe Wear
* Level".
* @param {!function} routineStatus
* @return {number?}
*/
function getStatusCodeForNvmeWearLevel(routineStatus) {
switch (routineStatus.status_message) {
case 'Wear-level status: FAILED, exceed the limitation value.':
return 0x0240001;
case 'Wear-level status: ERROR, threshold in percentage should be ' +
'non-empty and under 100.':
case 'Wear-level status: ERROR, cannot get wear level info.':
return CODE_ROUTINE_EXCEPTION;
default:
return undefined;
}
}

/**
* Get status code based on the specified status message for routine "Power
* Button".
Expand Down Expand Up @@ -738,7 +719,6 @@ module.exports = {
getStatusCodeForLanConnectivity,
getStatusCodeForMemory,
getStatusCodeForNvmeSelfTest,
getStatusCodeForNvmeWearLevel,
getStatusCodeForPowerButton,
getStatusCodeForPrimeSearch,
getStatusCodeForSensitiveSensor,
Expand Down
6 changes: 0 additions & 6 deletions src/types.js
Original file line number Diff line number Diff line change
Expand Up @@ -403,12 +403,6 @@ dpsl.CpuRoutineDurationParams;
*/
dpsl.NvmeSelfTestRoutineParams;

/**
* Params object of dpsl.diagnostics.nvme.runWearLevelRoutine()
* @typedef {{wear_level_threshold: !number}}
*/
dpsl.NvmeWearLevelRoutineParams;

/**
* Params object of dpsl.diagnostics.nvme.runSmartctlCheckRoutine()
* @typedef {{percentage_used_threshold: !number}}
Expand Down

0 comments on commit b12d807

Please sign in to comment.