Commit e5440a2c authored by Kishen Maloor's avatar Kishen Maloor

oc_mnt: fix RESET flow via pstat

Change-Id: I42b6a9e700c258712a2030b9214e51e627153525
Signed-off-by: Kishen Maloor's avatarKishen Maloor <kishen.maloor@intel.com>
parent ecc31485
......@@ -52,7 +52,7 @@ post_mnt(oc_request_t *request, oc_interface_mask_t iface_mask, void *data)
if (oc_rep_get_bool(request->request_payload, "fr", &fr)) {
if (fr) {
#ifdef OC_SECURITY
if (oc_pstat_reset_device(request->resource->device)) {
if (oc_pstat_reset_device(request->resource->device, false)) {
success = true;
}
#else /* OC_SECURITY */
......
......@@ -602,10 +602,10 @@ post_pstat(oc_request_t *request, oc_interface_mask_t iface_mask, void *data)
}
bool
oc_pstat_reset_device(size_t device)
oc_pstat_reset_device(size_t device, bool self_reset)
{
oc_sec_pstat_t ps = {.s = OC_DOS_RESET };
bool ret = oc_pstat_handle_state(&ps, device, false, true);
bool ret = oc_pstat_handle_state(&ps, device, false, self_reset);
oc_sec_dump_pstat(device);
return ret;
}
......@@ -615,7 +615,7 @@ oc_reset()
{
size_t device;
for (device = 0; device < oc_core_get_num_devices(); device++) {
oc_pstat_reset_device(device);
oc_pstat_reset_device(device, true);
}
}
#endif /* OC_SECURITY */
......@@ -61,7 +61,7 @@ void get_pstat(oc_request_t *request, oc_interface_mask_t iface_mask,
void *data);
void post_pstat(oc_request_t *request, oc_interface_mask_t iface_mask,
void *data);
bool oc_pstat_reset_device(size_t device);
bool oc_pstat_reset_device(size_t device, bool self_reset);
void oc_sec_pstat_set_current_mode(size_t device, oc_dpmtype_t cm);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment