Lines Matching refs:nd_cmd
235 struct nd_intel_fw_info *nd_cmd, unsigned int buf_len, in nd_intel_test_get_fw_info() argument
242 __func__, t, nd_cmd, buf_len, idx); in nd_intel_test_get_fw_info()
244 if (buf_len < sizeof(*nd_cmd)) in nd_intel_test_get_fw_info()
247 nd_cmd->status = 0; in nd_intel_test_get_fw_info()
248 nd_cmd->storage_size = INTEL_FW_STORAGE_SIZE; in nd_intel_test_get_fw_info()
249 nd_cmd->max_send_len = INTEL_FW_MAX_SEND_LEN; in nd_intel_test_get_fw_info()
250 nd_cmd->query_interval = INTEL_FW_QUERY_INTERVAL; in nd_intel_test_get_fw_info()
251 nd_cmd->max_query_time = INTEL_FW_QUERY_MAX_TIME; in nd_intel_test_get_fw_info()
252 nd_cmd->update_cap = 0; in nd_intel_test_get_fw_info()
253 nd_cmd->fis_version = INTEL_FW_FIS_VERSION; in nd_intel_test_get_fw_info()
254 nd_cmd->run_version = 0; in nd_intel_test_get_fw_info()
255 nd_cmd->updated_version = fw->version; in nd_intel_test_get_fw_info()
261 struct nd_intel_fw_start *nd_cmd, unsigned int buf_len, in nd_intel_test_start_update() argument
268 __func__, t, nd_cmd, buf_len, idx); in nd_intel_test_start_update()
270 if (buf_len < sizeof(*nd_cmd)) in nd_intel_test_start_update()
275 nd_cmd->status = 0x10007; in nd_intel_test_start_update()
282 nd_cmd->status = 0; in nd_intel_test_start_update()
283 nd_cmd->context = fw->context; in nd_intel_test_start_update()
285 dev_dbg(dev, "%s: context issued: %#x\n", __func__, nd_cmd->context); in nd_intel_test_start_update()
291 struct nd_intel_fw_send_data *nd_cmd, unsigned int buf_len, in nd_intel_test_send_data() argument
296 u32 *status = (u32 *)&nd_cmd->data[nd_cmd->length]; in nd_intel_test_send_data()
299 __func__, t, nd_cmd, buf_len, idx); in nd_intel_test_send_data()
301 if (buf_len < sizeof(*nd_cmd)) in nd_intel_test_send_data()
306 dev_dbg(dev, "%s: cmd->data[0]: %#x\n", __func__, nd_cmd->data[0]); in nd_intel_test_send_data()
307 dev_dbg(dev, "%s: cmd->data[%u]: %#x\n", __func__, nd_cmd->length-1, in nd_intel_test_send_data()
308 nd_cmd->data[nd_cmd->length-1]); in nd_intel_test_send_data()
316 if (nd_cmd->context != fw->context) { in nd_intel_test_send_data()
318 __func__, nd_cmd->context, fw->context); in nd_intel_test_send_data()
327 if (nd_cmd->offset + nd_cmd->length > INTEL_FW_STORAGE_SIZE || in nd_intel_test_send_data()
328 nd_cmd->length > INTEL_FW_MAX_SEND_LEN) { in nd_intel_test_send_data()
334 fw->size_received += nd_cmd->length; in nd_intel_test_send_data()
336 __func__, nd_cmd->length, fw->size_received); in nd_intel_test_send_data()
342 struct nd_intel_fw_finish_update *nd_cmd, in nd_intel_test_finish_fw() argument
349 __func__, t, nd_cmd, buf_len, idx); in nd_intel_test_finish_fw()
353 nd_cmd->status = 0x20007; in nd_intel_test_finish_fw()
358 __func__, nd_cmd->context, nd_cmd->ctrl_flags); in nd_intel_test_finish_fw()
360 switch (nd_cmd->ctrl_flags) { in nd_intel_test_finish_fw()
362 if (nd_cmd->context != fw->context) { in nd_intel_test_finish_fw()
364 __func__, nd_cmd->context, in nd_intel_test_finish_fw()
366 nd_cmd->status = 0x10007; in nd_intel_test_finish_fw()
369 nd_cmd->status = 0; in nd_intel_test_finish_fw()
378 nd_cmd->status = 0x40007; in nd_intel_test_finish_fw()
385 __func__, nd_cmd->ctrl_flags); in nd_intel_test_finish_fw()
393 struct nd_intel_fw_finish_query *nd_cmd, in nd_intel_test_finish_query() argument
400 __func__, t, nd_cmd, buf_len, idx); in nd_intel_test_finish_query()
402 if (buf_len < sizeof(*nd_cmd)) in nd_intel_test_finish_query()
405 if (nd_cmd->context != fw->context) { in nd_intel_test_finish_query()
407 __func__, nd_cmd->context, fw->context); in nd_intel_test_finish_query()
408 nd_cmd->status = 0x10007; in nd_intel_test_finish_query()
412 dev_dbg(dev, "%s context: %#x\n", __func__, nd_cmd->context); in nd_intel_test_finish_query()
416 nd_cmd->updated_fw_rev = 0; in nd_intel_test_finish_query()
417 nd_cmd->status = 0; in nd_intel_test_finish_query()
423 nd_cmd->status = 0x40007; in nd_intel_test_finish_query()
424 nd_cmd->updated_fw_rev = 0; in nd_intel_test_finish_query()
430 nd_cmd->updated_fw_rev = 0; in nd_intel_test_finish_query()
431 nd_cmd->status = 0x20007; in nd_intel_test_finish_query()
440 nd_cmd->status = 0; in nd_intel_test_finish_query()
442 fw->version = nd_cmd->updated_fw_rev = in nd_intel_test_finish_query()
454 static int nfit_test_cmd_get_config_size(struct nd_cmd_get_config_size *nd_cmd, in nfit_test_cmd_get_config_size() argument
457 if (buf_len < sizeof(*nd_cmd)) in nfit_test_cmd_get_config_size()
460 nd_cmd->status = 0; in nfit_test_cmd_get_config_size()
461 nd_cmd->config_size = LABEL_SIZE; in nfit_test_cmd_get_config_size()
462 nd_cmd->max_xfer = SZ_4K; in nfit_test_cmd_get_config_size()
468 *nd_cmd, unsigned int buf_len, void *label) in nfit_test_cmd_get_config_data()
470 unsigned int len, offset = nd_cmd->in_offset; in nfit_test_cmd_get_config_data()
473 if (buf_len < sizeof(*nd_cmd)) in nfit_test_cmd_get_config_data()
477 if (nd_cmd->in_length + sizeof(*nd_cmd) > buf_len) in nfit_test_cmd_get_config_data()
480 nd_cmd->status = 0; in nfit_test_cmd_get_config_data()
481 len = min(nd_cmd->in_length, LABEL_SIZE - offset); in nfit_test_cmd_get_config_data()
482 memcpy(nd_cmd->out_buf, label + offset, len); in nfit_test_cmd_get_config_data()
483 rc = buf_len - sizeof(*nd_cmd) - len; in nfit_test_cmd_get_config_data()
488 static int nfit_test_cmd_set_config_data(struct nd_cmd_set_config_hdr *nd_cmd, in nfit_test_cmd_set_config_data() argument
491 unsigned int len, offset = nd_cmd->in_offset; in nfit_test_cmd_set_config_data()
495 if (buf_len < sizeof(*nd_cmd)) in nfit_test_cmd_set_config_data()
499 if (nd_cmd->in_length + sizeof(*nd_cmd) + 4 > buf_len) in nfit_test_cmd_set_config_data()
502 status = (void *)nd_cmd + nd_cmd->in_length + sizeof(*nd_cmd); in nfit_test_cmd_set_config_data()
504 len = min(nd_cmd->in_length, LABEL_SIZE - offset); in nfit_test_cmd_set_config_data()
505 memcpy(label + offset, nd_cmd->in_buf, len); in nfit_test_cmd_set_config_data()
506 rc = buf_len - sizeof(*nd_cmd) - (len + 4); in nfit_test_cmd_set_config_data()
513 static int nfit_test_cmd_ars_cap(struct nd_cmd_ars_cap *nd_cmd, in nfit_test_cmd_ars_cap() argument
518 if (buf_len < sizeof(*nd_cmd)) in nfit_test_cmd_ars_cap()
524 nd_cmd->max_ars_out = sizeof(struct nd_cmd_ars_status) in nfit_test_cmd_ars_cap()
526 nd_cmd->status = (ND_ARS_PERSISTENT | ND_ARS_VOLATILE) << 16; in nfit_test_cmd_ars_cap()
527 nd_cmd->clear_err_unit = NFIT_TEST_CLEAR_ERR_UNIT; in nfit_test_cmd_ars_cap()
907 struct nd_intel_lss *nd_cmd, unsigned int buf_len) in nd_intel_test_cmd_set_lss_status() argument
911 if (buf_len < sizeof(*nd_cmd)) in nd_intel_test_cmd_set_lss_status()
914 switch (nd_cmd->enable) { in nd_intel_test_cmd_set_lss_status()
916 nd_cmd->status = 0; in nd_intel_test_cmd_set_lss_status()
921 nd_cmd->status = 0; in nd_intel_test_cmd_set_lss_status()
926 dev_warn(dev, "Unknown enable value: %#x\n", nd_cmd->enable); in nd_intel_test_cmd_set_lss_status()
927 nd_cmd->status = 0x3; in nd_intel_test_cmd_set_lss_status()
946 struct nd_intel_get_security_state *nd_cmd, in nd_intel_test_cmd_security_status() argument
952 nd_cmd->status = 0; in nd_intel_test_cmd_security_status()
953 nd_cmd->state = sec->state; in nd_intel_test_cmd_security_status()
954 nd_cmd->extended_state = sec->ext_state; in nd_intel_test_cmd_security_status()
955 dev_dbg(dev, "security state (%#x) returned\n", nd_cmd->state); in nd_intel_test_cmd_security_status()
961 struct nd_intel_unlock_unit *nd_cmd, in nd_intel_test_cmd_unlock_unit() argument
969 nd_cmd->status = ND_INTEL_STATUS_INVALID_STATE; in nd_intel_test_cmd_unlock_unit()
972 } else if (memcmp(nd_cmd->passphrase, sec->passphrase, in nd_intel_test_cmd_unlock_unit()
974 nd_cmd->status = ND_INTEL_STATUS_INVALID_PASS; in nd_intel_test_cmd_unlock_unit()
977 nd_cmd->status = 0; in nd_intel_test_cmd_unlock_unit()
982 dev_dbg(dev, "unlocking status returned: %#x\n", nd_cmd->status); in nd_intel_test_cmd_unlock_unit()
987 struct nd_intel_set_passphrase *nd_cmd, in nd_intel_test_cmd_set_pass() argument
994 nd_cmd->status = ND_INTEL_STATUS_INVALID_STATE; in nd_intel_test_cmd_set_pass()
996 } else if (memcmp(nd_cmd->old_pass, sec->passphrase, in nd_intel_test_cmd_set_pass()
998 nd_cmd->status = ND_INTEL_STATUS_INVALID_PASS; in nd_intel_test_cmd_set_pass()
1001 memcpy(sec->passphrase, nd_cmd->new_pass, in nd_intel_test_cmd_set_pass()
1004 nd_cmd->status = 0; in nd_intel_test_cmd_set_pass()
1012 struct nd_intel_freeze_lock *nd_cmd, in nd_intel_test_cmd_freeze_lock() argument
1019 nd_cmd->status = ND_INTEL_STATUS_INVALID_STATE; in nd_intel_test_cmd_freeze_lock()
1023 nd_cmd->status = 0; in nd_intel_test_cmd_freeze_lock()
1031 struct nd_intel_disable_passphrase *nd_cmd, in nd_intel_test_cmd_disable_pass() argument
1039 nd_cmd->status = ND_INTEL_STATUS_INVALID_STATE; in nd_intel_test_cmd_disable_pass()
1041 } else if (memcmp(nd_cmd->passphrase, sec->passphrase, in nd_intel_test_cmd_disable_pass()
1043 nd_cmd->status = ND_INTEL_STATUS_INVALID_PASS; in nd_intel_test_cmd_disable_pass()
1055 struct nd_intel_secure_erase *nd_cmd, in nd_intel_test_cmd_secure_erase() argument
1062 nd_cmd->status = ND_INTEL_STATUS_INVALID_STATE; in nd_intel_test_cmd_secure_erase()
1064 } else if (memcmp(nd_cmd->passphrase, sec->passphrase, in nd_intel_test_cmd_secure_erase()
1066 nd_cmd->status = ND_INTEL_STATUS_INVALID_PASS; in nd_intel_test_cmd_secure_erase()
1070 && (memcmp(nd_cmd->passphrase, zero_key, in nd_intel_test_cmd_secure_erase()
1086 struct nd_intel_overwrite *nd_cmd, in nd_intel_test_cmd_overwrite() argument
1093 memcmp(nd_cmd->passphrase, sec->passphrase, in nd_intel_test_cmd_overwrite()
1095 nd_cmd->status = ND_INTEL_STATUS_INVALID_PASS; in nd_intel_test_cmd_overwrite()
1109 struct nd_intel_query_overwrite *nd_cmd, in nd_intel_test_cmd_query_overwrite() argument
1116 nd_cmd->status = ND_INTEL_STATUS_OQUERY_SEQUENCE_ERR; in nd_intel_test_cmd_query_overwrite()
1127 nd_cmd->status = ND_INTEL_STATUS_OQUERY_INPROGRESS; in nd_intel_test_cmd_query_overwrite()
1132 struct nd_intel_set_master_passphrase *nd_cmd, in nd_intel_test_cmd_master_set_pass() argument
1139 nd_cmd->status = ND_INTEL_STATUS_NOT_SUPPORTED; in nd_intel_test_cmd_master_set_pass()
1142 nd_cmd->status = ND_INTEL_STATUS_INVALID_STATE; in nd_intel_test_cmd_master_set_pass()
1144 } else if (memcmp(nd_cmd->old_pass, sec->master_passphrase, in nd_intel_test_cmd_master_set_pass()
1146 nd_cmd->status = ND_INTEL_STATUS_INVALID_PASS; in nd_intel_test_cmd_master_set_pass()
1149 memcpy(sec->master_passphrase, nd_cmd->new_pass, in nd_intel_test_cmd_master_set_pass()
1159 struct nd_intel_master_secure_erase *nd_cmd, in nd_intel_test_cmd_master_secure_erase() argument
1166 nd_cmd->status = ND_INTEL_STATUS_NOT_SUPPORTED; in nd_intel_test_cmd_master_secure_erase()
1169 nd_cmd->status = ND_INTEL_STATUS_INVALID_STATE; in nd_intel_test_cmd_master_secure_erase()
1171 } else if (memcmp(nd_cmd->passphrase, sec->master_passphrase, in nd_intel_test_cmd_master_secure_erase()
1173 nd_cmd->status = ND_INTEL_STATUS_INVALID_PASS; in nd_intel_test_cmd_master_secure_erase()
1189 struct nd_intel_bus_fw_activate_businfo *nd_cmd, in nvdimm_bus_intel_fw_activate_businfo() argument
1216 *nd_cmd = (struct nd_intel_bus_fw_activate_businfo) { in nvdimm_bus_intel_fw_activate_businfo()
1231 struct nd_intel_bus_fw_activate *nd_cmd, in nvdimm_bus_intel_fw_activate() argument
1247 nd_cmd->status = status; in nvdimm_bus_intel_fw_activate()
1269 struct nd_intel_fw_activate_dimminfo *nd_cmd, in nd_intel_test_cmd_fw_activate_dimminfo() argument
1296 *nd_cmd = (struct nd_intel_fw_activate_dimminfo) { in nd_intel_test_cmd_fw_activate_dimminfo()
1305 struct nd_intel_fw_activate_arm *nd_cmd, in nd_intel_test_cmd_fw_activate_arm() argument
1310 fw->armed = nd_cmd->activate_arm == ND_INTEL_DIMM_FWA_ARM; in nd_intel_test_cmd_fw_activate_arm()
1311 nd_cmd->status = 0; in nd_intel_test_cmd_fw_activate_arm()