Lines Matching refs:nd_cmd
232 struct nd_intel_fw_info *nd_cmd, unsigned int buf_len, in nd_intel_test_get_fw_info() argument
239 __func__, t, nd_cmd, buf_len, idx); in nd_intel_test_get_fw_info()
241 if (buf_len < sizeof(*nd_cmd)) in nd_intel_test_get_fw_info()
244 nd_cmd->status = 0; in nd_intel_test_get_fw_info()
245 nd_cmd->storage_size = INTEL_FW_STORAGE_SIZE; in nd_intel_test_get_fw_info()
246 nd_cmd->max_send_len = INTEL_FW_MAX_SEND_LEN; in nd_intel_test_get_fw_info()
247 nd_cmd->query_interval = INTEL_FW_QUERY_INTERVAL; in nd_intel_test_get_fw_info()
248 nd_cmd->max_query_time = INTEL_FW_QUERY_MAX_TIME; in nd_intel_test_get_fw_info()
249 nd_cmd->update_cap = 0; in nd_intel_test_get_fw_info()
250 nd_cmd->fis_version = INTEL_FW_FIS_VERSION; in nd_intel_test_get_fw_info()
251 nd_cmd->run_version = 0; in nd_intel_test_get_fw_info()
252 nd_cmd->updated_version = fw->version; in nd_intel_test_get_fw_info()
258 struct nd_intel_fw_start *nd_cmd, unsigned int buf_len, in nd_intel_test_start_update() argument
265 __func__, t, nd_cmd, buf_len, idx); in nd_intel_test_start_update()
267 if (buf_len < sizeof(*nd_cmd)) in nd_intel_test_start_update()
272 nd_cmd->status = 0x10007; in nd_intel_test_start_update()
279 nd_cmd->status = 0; in nd_intel_test_start_update()
280 nd_cmd->context = fw->context; in nd_intel_test_start_update()
282 dev_dbg(dev, "%s: context issued: %#x\n", __func__, nd_cmd->context); in nd_intel_test_start_update()
288 struct nd_intel_fw_send_data *nd_cmd, unsigned int buf_len, in nd_intel_test_send_data() argument
293 u32 *status = (u32 *)&nd_cmd->data[nd_cmd->length]; in nd_intel_test_send_data()
296 __func__, t, nd_cmd, buf_len, idx); in nd_intel_test_send_data()
298 if (buf_len < sizeof(*nd_cmd)) in nd_intel_test_send_data()
303 dev_dbg(dev, "%s: cmd->data[0]: %#x\n", __func__, nd_cmd->data[0]); in nd_intel_test_send_data()
304 dev_dbg(dev, "%s: cmd->data[%u]: %#x\n", __func__, nd_cmd->length-1, in nd_intel_test_send_data()
305 nd_cmd->data[nd_cmd->length-1]); in nd_intel_test_send_data()
313 if (nd_cmd->context != fw->context) { in nd_intel_test_send_data()
315 __func__, nd_cmd->context, fw->context); in nd_intel_test_send_data()
324 if (nd_cmd->offset + nd_cmd->length > INTEL_FW_STORAGE_SIZE || in nd_intel_test_send_data()
325 nd_cmd->length > INTEL_FW_MAX_SEND_LEN) { in nd_intel_test_send_data()
331 fw->size_received += nd_cmd->length; in nd_intel_test_send_data()
333 __func__, nd_cmd->length, fw->size_received); in nd_intel_test_send_data()
339 struct nd_intel_fw_finish_update *nd_cmd, in nd_intel_test_finish_fw() argument
346 __func__, t, nd_cmd, buf_len, idx); in nd_intel_test_finish_fw()
350 nd_cmd->status = 0x20007; in nd_intel_test_finish_fw()
355 __func__, nd_cmd->context, nd_cmd->ctrl_flags); in nd_intel_test_finish_fw()
357 switch (nd_cmd->ctrl_flags) { in nd_intel_test_finish_fw()
359 if (nd_cmd->context != fw->context) { in nd_intel_test_finish_fw()
361 __func__, nd_cmd->context, in nd_intel_test_finish_fw()
363 nd_cmd->status = 0x10007; in nd_intel_test_finish_fw()
366 nd_cmd->status = 0; in nd_intel_test_finish_fw()
375 nd_cmd->status = 0x40007; in nd_intel_test_finish_fw()
382 __func__, nd_cmd->ctrl_flags); in nd_intel_test_finish_fw()
390 struct nd_intel_fw_finish_query *nd_cmd, in nd_intel_test_finish_query() argument
397 __func__, t, nd_cmd, buf_len, idx); in nd_intel_test_finish_query()
399 if (buf_len < sizeof(*nd_cmd)) in nd_intel_test_finish_query()
402 if (nd_cmd->context != fw->context) { in nd_intel_test_finish_query()
404 __func__, nd_cmd->context, fw->context); in nd_intel_test_finish_query()
405 nd_cmd->status = 0x10007; in nd_intel_test_finish_query()
409 dev_dbg(dev, "%s context: %#x\n", __func__, nd_cmd->context); in nd_intel_test_finish_query()
413 nd_cmd->updated_fw_rev = 0; in nd_intel_test_finish_query()
414 nd_cmd->status = 0; in nd_intel_test_finish_query()
420 nd_cmd->status = 0x40007; in nd_intel_test_finish_query()
421 nd_cmd->updated_fw_rev = 0; in nd_intel_test_finish_query()
427 nd_cmd->updated_fw_rev = 0; in nd_intel_test_finish_query()
428 nd_cmd->status = 0x20007; in nd_intel_test_finish_query()
437 nd_cmd->status = 0; in nd_intel_test_finish_query()
439 fw->version = nd_cmd->updated_fw_rev = in nd_intel_test_finish_query()
451 static int nfit_test_cmd_get_config_size(struct nd_cmd_get_config_size *nd_cmd, in nfit_test_cmd_get_config_size() argument
454 if (buf_len < sizeof(*nd_cmd)) in nfit_test_cmd_get_config_size()
457 nd_cmd->status = 0; in nfit_test_cmd_get_config_size()
458 nd_cmd->config_size = LABEL_SIZE; in nfit_test_cmd_get_config_size()
459 nd_cmd->max_xfer = SZ_4K; in nfit_test_cmd_get_config_size()
465 *nd_cmd, unsigned int buf_len, void *label) in nfit_test_cmd_get_config_data()
467 unsigned int len, offset = nd_cmd->in_offset; in nfit_test_cmd_get_config_data()
470 if (buf_len < sizeof(*nd_cmd)) in nfit_test_cmd_get_config_data()
474 if (nd_cmd->in_length + sizeof(*nd_cmd) > buf_len) in nfit_test_cmd_get_config_data()
477 nd_cmd->status = 0; in nfit_test_cmd_get_config_data()
478 len = min(nd_cmd->in_length, LABEL_SIZE - offset); in nfit_test_cmd_get_config_data()
479 memcpy(nd_cmd->out_buf, label + offset, len); in nfit_test_cmd_get_config_data()
480 rc = buf_len - sizeof(*nd_cmd) - len; in nfit_test_cmd_get_config_data()
485 static int nfit_test_cmd_set_config_data(struct nd_cmd_set_config_hdr *nd_cmd, in nfit_test_cmd_set_config_data() argument
488 unsigned int len, offset = nd_cmd->in_offset; in nfit_test_cmd_set_config_data()
492 if (buf_len < sizeof(*nd_cmd)) in nfit_test_cmd_set_config_data()
496 if (nd_cmd->in_length + sizeof(*nd_cmd) + 4 > buf_len) in nfit_test_cmd_set_config_data()
499 status = (void *)nd_cmd + nd_cmd->in_length + sizeof(*nd_cmd); in nfit_test_cmd_set_config_data()
501 len = min(nd_cmd->in_length, LABEL_SIZE - offset); in nfit_test_cmd_set_config_data()
502 memcpy(label + offset, nd_cmd->in_buf, len); in nfit_test_cmd_set_config_data()
503 rc = buf_len - sizeof(*nd_cmd) - (len + 4); in nfit_test_cmd_set_config_data()
510 static int nfit_test_cmd_ars_cap(struct nd_cmd_ars_cap *nd_cmd, in nfit_test_cmd_ars_cap() argument
515 if (buf_len < sizeof(*nd_cmd)) in nfit_test_cmd_ars_cap()
521 nd_cmd->max_ars_out = sizeof(struct nd_cmd_ars_status) in nfit_test_cmd_ars_cap()
523 nd_cmd->status = (ND_ARS_PERSISTENT | ND_ARS_VOLATILE) << 16; in nfit_test_cmd_ars_cap()
524 nd_cmd->clear_err_unit = NFIT_TEST_CLEAR_ERR_UNIT; in nfit_test_cmd_ars_cap()
904 struct nd_intel_lss *nd_cmd, unsigned int buf_len) in nd_intel_test_cmd_set_lss_status() argument
908 if (buf_len < sizeof(*nd_cmd)) in nd_intel_test_cmd_set_lss_status()
911 switch (nd_cmd->enable) { in nd_intel_test_cmd_set_lss_status()
913 nd_cmd->status = 0; in nd_intel_test_cmd_set_lss_status()
918 nd_cmd->status = 0; in nd_intel_test_cmd_set_lss_status()
923 dev_warn(dev, "Unknown enable value: %#x\n", nd_cmd->enable); in nd_intel_test_cmd_set_lss_status()
924 nd_cmd->status = 0x3; in nd_intel_test_cmd_set_lss_status()
943 struct nd_intel_get_security_state *nd_cmd, in nd_intel_test_cmd_security_status() argument
949 nd_cmd->status = 0; in nd_intel_test_cmd_security_status()
950 nd_cmd->state = sec->state; in nd_intel_test_cmd_security_status()
951 nd_cmd->extended_state = sec->ext_state; in nd_intel_test_cmd_security_status()
952 dev_dbg(dev, "security state (%#x) returned\n", nd_cmd->state); in nd_intel_test_cmd_security_status()
958 struct nd_intel_unlock_unit *nd_cmd, in nd_intel_test_cmd_unlock_unit() argument
966 nd_cmd->status = ND_INTEL_STATUS_INVALID_STATE; in nd_intel_test_cmd_unlock_unit()
969 } else if (memcmp(nd_cmd->passphrase, sec->passphrase, in nd_intel_test_cmd_unlock_unit()
971 nd_cmd->status = ND_INTEL_STATUS_INVALID_PASS; in nd_intel_test_cmd_unlock_unit()
974 nd_cmd->status = 0; in nd_intel_test_cmd_unlock_unit()
979 dev_dbg(dev, "unlocking status returned: %#x\n", nd_cmd->status); in nd_intel_test_cmd_unlock_unit()
984 struct nd_intel_set_passphrase *nd_cmd, in nd_intel_test_cmd_set_pass() argument
991 nd_cmd->status = ND_INTEL_STATUS_INVALID_STATE; in nd_intel_test_cmd_set_pass()
993 } else if (memcmp(nd_cmd->old_pass, sec->passphrase, in nd_intel_test_cmd_set_pass()
995 nd_cmd->status = ND_INTEL_STATUS_INVALID_PASS; in nd_intel_test_cmd_set_pass()
998 memcpy(sec->passphrase, nd_cmd->new_pass, in nd_intel_test_cmd_set_pass()
1001 nd_cmd->status = 0; in nd_intel_test_cmd_set_pass()
1009 struct nd_intel_freeze_lock *nd_cmd, in nd_intel_test_cmd_freeze_lock() argument
1016 nd_cmd->status = ND_INTEL_STATUS_INVALID_STATE; in nd_intel_test_cmd_freeze_lock()
1020 nd_cmd->status = 0; in nd_intel_test_cmd_freeze_lock()
1028 struct nd_intel_disable_passphrase *nd_cmd, in nd_intel_test_cmd_disable_pass() argument
1036 nd_cmd->status = ND_INTEL_STATUS_INVALID_STATE; in nd_intel_test_cmd_disable_pass()
1038 } else if (memcmp(nd_cmd->passphrase, sec->passphrase, in nd_intel_test_cmd_disable_pass()
1040 nd_cmd->status = ND_INTEL_STATUS_INVALID_PASS; in nd_intel_test_cmd_disable_pass()
1052 struct nd_intel_secure_erase *nd_cmd, in nd_intel_test_cmd_secure_erase() argument
1059 nd_cmd->status = ND_INTEL_STATUS_INVALID_STATE; in nd_intel_test_cmd_secure_erase()
1061 } else if (memcmp(nd_cmd->passphrase, sec->passphrase, in nd_intel_test_cmd_secure_erase()
1063 nd_cmd->status = ND_INTEL_STATUS_INVALID_PASS; in nd_intel_test_cmd_secure_erase()
1067 && (memcmp(nd_cmd->passphrase, zero_key, in nd_intel_test_cmd_secure_erase()
1083 struct nd_intel_overwrite *nd_cmd, in nd_intel_test_cmd_overwrite() argument
1090 memcmp(nd_cmd->passphrase, sec->passphrase, in nd_intel_test_cmd_overwrite()
1092 nd_cmd->status = ND_INTEL_STATUS_INVALID_PASS; in nd_intel_test_cmd_overwrite()
1106 struct nd_intel_query_overwrite *nd_cmd, in nd_intel_test_cmd_query_overwrite() argument
1113 nd_cmd->status = ND_INTEL_STATUS_OQUERY_SEQUENCE_ERR; in nd_intel_test_cmd_query_overwrite()
1124 nd_cmd->status = ND_INTEL_STATUS_OQUERY_INPROGRESS; in nd_intel_test_cmd_query_overwrite()
1129 struct nd_intel_set_master_passphrase *nd_cmd, in nd_intel_test_cmd_master_set_pass() argument
1136 nd_cmd->status = ND_INTEL_STATUS_NOT_SUPPORTED; in nd_intel_test_cmd_master_set_pass()
1139 nd_cmd->status = ND_INTEL_STATUS_INVALID_STATE; in nd_intel_test_cmd_master_set_pass()
1141 } else if (memcmp(nd_cmd->old_pass, sec->master_passphrase, in nd_intel_test_cmd_master_set_pass()
1143 nd_cmd->status = ND_INTEL_STATUS_INVALID_PASS; in nd_intel_test_cmd_master_set_pass()
1146 memcpy(sec->master_passphrase, nd_cmd->new_pass, in nd_intel_test_cmd_master_set_pass()
1156 struct nd_intel_master_secure_erase *nd_cmd, in nd_intel_test_cmd_master_secure_erase() argument
1163 nd_cmd->status = ND_INTEL_STATUS_NOT_SUPPORTED; in nd_intel_test_cmd_master_secure_erase()
1166 nd_cmd->status = ND_INTEL_STATUS_INVALID_STATE; in nd_intel_test_cmd_master_secure_erase()
1168 } else if (memcmp(nd_cmd->passphrase, sec->master_passphrase, in nd_intel_test_cmd_master_secure_erase()
1170 nd_cmd->status = ND_INTEL_STATUS_INVALID_PASS; in nd_intel_test_cmd_master_secure_erase()
1186 struct nd_intel_bus_fw_activate_businfo *nd_cmd, in nvdimm_bus_intel_fw_activate_businfo() argument
1213 *nd_cmd = (struct nd_intel_bus_fw_activate_businfo) { in nvdimm_bus_intel_fw_activate_businfo()
1228 struct nd_intel_bus_fw_activate *nd_cmd, in nvdimm_bus_intel_fw_activate() argument
1244 nd_cmd->status = status; in nvdimm_bus_intel_fw_activate()
1266 struct nd_intel_fw_activate_dimminfo *nd_cmd, in nd_intel_test_cmd_fw_activate_dimminfo() argument
1293 *nd_cmd = (struct nd_intel_fw_activate_dimminfo) { in nd_intel_test_cmd_fw_activate_dimminfo()
1302 struct nd_intel_fw_activate_arm *nd_cmd, in nd_intel_test_cmd_fw_activate_arm() argument
1307 fw->armed = nd_cmd->activate_arm == ND_INTEL_DIMM_FWA_ARM; in nd_intel_test_cmd_fw_activate_arm()
1308 nd_cmd->status = 0; in nd_intel_test_cmd_fw_activate_arm()