const char *namespace_id = "name of desired namespace";
const char *lbaf = "LBA format to apply (req'd)";
const char *ses = "[0-2]: secure erase";
- const char *pil = "[0-3]: protection info location";
- const char *pi = "[0-1]: protection info off/on";
+ const char *pil = "[0-1]: protection info location last/first 8 bytes of metadata";
+ const char *pi = "[0-3]: protection info off/Type 1/Type 2/Type 3";
const char *ms = "[0-1]: extended format off/on";
const char *timeout = "timeout value";
int err;
get_dev(1, argc, argv);
- if (cfg.ses > 7) {
+ if (cfg.ses > 2) {
fprintf(stderr, "invalid secure erase settings:%d\n", cfg.ses);
return EINVAL;
}
fprintf(stderr, "invalid lbaf:%d\n", cfg.lbaf);
return EINVAL;
}
- if (cfg.pi > 7) {
+ if (cfg.pi > 3) {
fprintf(stderr, "invalid pi:%d\n", cfg.pi);
return EINVAL;
}
+ if (cfg.pil > 1) {
+ fprintf(stderr, "invalid pil:%d\n", cfg.pil);
+ return EINVAL;
+ }
+ if (cfg.ms > 1) {
+ fprintf(stderr, "invalid ms:%d\n", cfg.ms);
+ return EINVAL;
+ }
if (S_ISBLK(nvme_stat.st_mode)) {
cfg.namespace_id = nvme_get_nsid(fd);
if (cfg.namespace_id <= 0) {