Lines Matching refs:sec
145 if (!nvdimm->sec.ops->change_key) in nvdimm_key_revalidate()
154 rc = nvdimm->sec.ops->change_key(nvdimm, data, data, NVDIMM_USER); in nvdimm_key_revalidate()
161 nvdimm->sec.flags = nvdimm_security_flags(nvdimm, NVDIMM_USER); in nvdimm_key_revalidate()
176 if (!nvdimm->sec.ops || !nvdimm->sec.ops->unlock in __nvdimm_security_unlock()
177 || !nvdimm->sec.flags) in __nvdimm_security_unlock()
181 if (test_bit(NVDIMM_SECURITY_DISABLED, &nvdimm->sec.flags)) in __nvdimm_security_unlock()
196 if (test_bit(NVDIMM_SECURITY_UNLOCKED, &nvdimm->sec.flags)) { in __nvdimm_security_unlock()
204 rc = nvdimm->sec.ops->unlock(nvdimm, data); in __nvdimm_security_unlock()
209 nvdimm->sec.flags = nvdimm_security_flags(nvdimm, NVDIMM_USER); in __nvdimm_security_unlock()
228 if (test_bit(NVDIMM_SECURITY_FROZEN, &nvdimm->sec.flags)) { in check_security_state()
230 nvdimm->sec.flags); in check_security_state()
253 if (!nvdimm->sec.ops || !nvdimm->sec.ops->disable in security_disable()
254 || !nvdimm->sec.flags) in security_disable()
266 rc = nvdimm->sec.ops->disable(nvdimm, data); in security_disable()
271 nvdimm->sec.flags = nvdimm_security_flags(nvdimm, NVDIMM_USER); in security_disable()
288 if (!nvdimm->sec.ops || !nvdimm->sec.ops->change_key in security_update()
289 || !nvdimm->sec.flags) in security_update()
308 rc = nvdimm->sec.ops->change_key(nvdimm, data, newdata, pass_type); in security_update()
317 nvdimm->sec.ext_flags = nvdimm_security_flags(nvdimm, in security_update()
320 nvdimm->sec.flags = nvdimm_security_flags(nvdimm, in security_update()
337 if (!nvdimm->sec.ops || !nvdimm->sec.ops->erase in security_erase()
338 || !nvdimm->sec.flags) in security_erase()
345 if (!test_bit(NVDIMM_SECURITY_UNLOCKED, &nvdimm->sec.ext_flags) in security_erase()
357 rc = nvdimm->sec.ops->erase(nvdimm, data, pass_type); in security_erase()
363 nvdimm->sec.flags = nvdimm_security_flags(nvdimm, NVDIMM_USER); in security_erase()
378 if (!nvdimm->sec.ops || !nvdimm->sec.ops->overwrite in security_overwrite()
379 || !nvdimm->sec.flags) in security_overwrite()
391 rc = nvdimm->sec.ops->overwrite(nvdimm, data); in security_overwrite()
399 set_bit(NVDIMM_SECURITY_OVERWRITE, &nvdimm->sec.flags); in security_overwrite()
427 tmo = nvdimm->sec.overwrite_tmo; in __nvdimm_security_overwrite_query()
429 if (!nvdimm->sec.ops || !nvdimm->sec.ops->query_overwrite in __nvdimm_security_overwrite_query()
430 || !nvdimm->sec.flags) in __nvdimm_security_overwrite_query()
433 rc = nvdimm->sec.ops->query_overwrite(nvdimm); in __nvdimm_security_overwrite_query()
439 nvdimm->sec.overwrite_tmo = min(15U * 60U, tmo); in __nvdimm_security_overwrite_query()
453 nvdimm->sec.overwrite_tmo = 0; in __nvdimm_security_overwrite_query()
456 nvdimm->sec.flags = nvdimm_security_flags(nvdimm, NVDIMM_USER); in __nvdimm_security_overwrite_query()
457 nvdimm->sec.ext_flags = nvdimm_security_flags(nvdimm, NVDIMM_MASTER); in __nvdimm_security_overwrite_query()
458 if (nvdimm->sec.overwrite_state) in __nvdimm_security_overwrite_query()
459 sysfs_notify_dirent(nvdimm->sec.overwrite_state); in __nvdimm_security_overwrite_query()