Lines Matching refs:nd_cmd

224 		struct nd_intel_fw_info *nd_cmd, unsigned int buf_len,  in nd_intel_test_get_fw_info()  argument
231 __func__, t, nd_cmd, buf_len, idx); in nd_intel_test_get_fw_info()
233 if (buf_len < sizeof(*nd_cmd)) in nd_intel_test_get_fw_info()
236 nd_cmd->status = 0; in nd_intel_test_get_fw_info()
237 nd_cmd->storage_size = INTEL_FW_STORAGE_SIZE; in nd_intel_test_get_fw_info()
238 nd_cmd->max_send_len = INTEL_FW_MAX_SEND_LEN; in nd_intel_test_get_fw_info()
239 nd_cmd->query_interval = INTEL_FW_QUERY_INTERVAL; in nd_intel_test_get_fw_info()
240 nd_cmd->max_query_time = INTEL_FW_QUERY_MAX_TIME; in nd_intel_test_get_fw_info()
241 nd_cmd->update_cap = 0; in nd_intel_test_get_fw_info()
242 nd_cmd->fis_version = INTEL_FW_FIS_VERSION; in nd_intel_test_get_fw_info()
243 nd_cmd->run_version = 0; in nd_intel_test_get_fw_info()
244 nd_cmd->updated_version = fw->version; in nd_intel_test_get_fw_info()
250 struct nd_intel_fw_start *nd_cmd, unsigned int buf_len, in nd_intel_test_start_update() argument
257 __func__, t, nd_cmd, buf_len, idx); in nd_intel_test_start_update()
259 if (buf_len < sizeof(*nd_cmd)) in nd_intel_test_start_update()
264 nd_cmd->status = 0x10007; in nd_intel_test_start_update()
271 nd_cmd->status = 0; in nd_intel_test_start_update()
272 nd_cmd->context = fw->context; in nd_intel_test_start_update()
274 dev_dbg(dev, "%s: context issued: %#x\n", __func__, nd_cmd->context); in nd_intel_test_start_update()
280 struct nd_intel_fw_send_data *nd_cmd, unsigned int buf_len, in nd_intel_test_send_data() argument
285 u32 *status = (u32 *)&nd_cmd->data[nd_cmd->length]; in nd_intel_test_send_data()
288 __func__, t, nd_cmd, buf_len, idx); in nd_intel_test_send_data()
290 if (buf_len < sizeof(*nd_cmd)) in nd_intel_test_send_data()
295 dev_dbg(dev, "%s: cmd->data[0]: %#x\n", __func__, nd_cmd->data[0]); in nd_intel_test_send_data()
296 dev_dbg(dev, "%s: cmd->data[%u]: %#x\n", __func__, nd_cmd->length-1, in nd_intel_test_send_data()
297 nd_cmd->data[nd_cmd->length-1]); in nd_intel_test_send_data()
305 if (nd_cmd->context != fw->context) { in nd_intel_test_send_data()
307 __func__, nd_cmd->context, fw->context); in nd_intel_test_send_data()
316 if (nd_cmd->offset + nd_cmd->length > INTEL_FW_STORAGE_SIZE || in nd_intel_test_send_data()
317 nd_cmd->length > INTEL_FW_MAX_SEND_LEN) { in nd_intel_test_send_data()
323 fw->size_received += nd_cmd->length; in nd_intel_test_send_data()
325 __func__, nd_cmd->length, fw->size_received); in nd_intel_test_send_data()
331 struct nd_intel_fw_finish_update *nd_cmd, in nd_intel_test_finish_fw() argument
338 __func__, t, nd_cmd, buf_len, idx); in nd_intel_test_finish_fw()
342 nd_cmd->status = 0x20007; in nd_intel_test_finish_fw()
347 __func__, nd_cmd->context, nd_cmd->ctrl_flags); in nd_intel_test_finish_fw()
349 switch (nd_cmd->ctrl_flags) { in nd_intel_test_finish_fw()
351 if (nd_cmd->context != fw->context) { in nd_intel_test_finish_fw()
353 __func__, nd_cmd->context, in nd_intel_test_finish_fw()
355 nd_cmd->status = 0x10007; in nd_intel_test_finish_fw()
358 nd_cmd->status = 0; in nd_intel_test_finish_fw()
367 nd_cmd->status = 0x40007; in nd_intel_test_finish_fw()
374 __func__, nd_cmd->ctrl_flags); in nd_intel_test_finish_fw()
382 struct nd_intel_fw_finish_query *nd_cmd, in nd_intel_test_finish_query() argument
389 __func__, t, nd_cmd, buf_len, idx); in nd_intel_test_finish_query()
391 if (buf_len < sizeof(*nd_cmd)) in nd_intel_test_finish_query()
394 if (nd_cmd->context != fw->context) { in nd_intel_test_finish_query()
396 __func__, nd_cmd->context, fw->context); in nd_intel_test_finish_query()
397 nd_cmd->status = 0x10007; in nd_intel_test_finish_query()
401 dev_dbg(dev, "%s context: %#x\n", __func__, nd_cmd->context); in nd_intel_test_finish_query()
405 nd_cmd->updated_fw_rev = 0; in nd_intel_test_finish_query()
406 nd_cmd->status = 0; in nd_intel_test_finish_query()
412 nd_cmd->status = 0x40007; in nd_intel_test_finish_query()
413 nd_cmd->updated_fw_rev = 0; in nd_intel_test_finish_query()
419 nd_cmd->updated_fw_rev = 0; in nd_intel_test_finish_query()
420 nd_cmd->status = 0x20007; in nd_intel_test_finish_query()
429 nd_cmd->status = 0; in nd_intel_test_finish_query()
431 fw->version = nd_cmd->updated_fw_rev = in nd_intel_test_finish_query()
443 static int nfit_test_cmd_get_config_size(struct nd_cmd_get_config_size *nd_cmd, in nfit_test_cmd_get_config_size() argument
446 if (buf_len < sizeof(*nd_cmd)) in nfit_test_cmd_get_config_size()
449 nd_cmd->status = 0; in nfit_test_cmd_get_config_size()
450 nd_cmd->config_size = LABEL_SIZE; in nfit_test_cmd_get_config_size()
451 nd_cmd->max_xfer = SZ_4K; in nfit_test_cmd_get_config_size()
457 *nd_cmd, unsigned int buf_len, void *label) in nfit_test_cmd_get_config_data()
459 unsigned int len, offset = nd_cmd->in_offset; in nfit_test_cmd_get_config_data()
462 if (buf_len < sizeof(*nd_cmd)) in nfit_test_cmd_get_config_data()
466 if (nd_cmd->in_length + sizeof(*nd_cmd) > buf_len) in nfit_test_cmd_get_config_data()
469 nd_cmd->status = 0; in nfit_test_cmd_get_config_data()
470 len = min(nd_cmd->in_length, LABEL_SIZE - offset); in nfit_test_cmd_get_config_data()
471 memcpy(nd_cmd->out_buf, label + offset, len); in nfit_test_cmd_get_config_data()
472 rc = buf_len - sizeof(*nd_cmd) - len; in nfit_test_cmd_get_config_data()
477 static int nfit_test_cmd_set_config_data(struct nd_cmd_set_config_hdr *nd_cmd, in nfit_test_cmd_set_config_data() argument
480 unsigned int len, offset = nd_cmd->in_offset; in nfit_test_cmd_set_config_data()
484 if (buf_len < sizeof(*nd_cmd)) in nfit_test_cmd_set_config_data()
488 if (nd_cmd->in_length + sizeof(*nd_cmd) + 4 > buf_len) in nfit_test_cmd_set_config_data()
491 status = (void *)nd_cmd + nd_cmd->in_length + sizeof(*nd_cmd); in nfit_test_cmd_set_config_data()
493 len = min(nd_cmd->in_length, LABEL_SIZE - offset); in nfit_test_cmd_set_config_data()
494 memcpy(label + offset, nd_cmd->in_buf, len); in nfit_test_cmd_set_config_data()
495 rc = buf_len - sizeof(*nd_cmd) - (len + 4); in nfit_test_cmd_set_config_data()
502 static int nfit_test_cmd_ars_cap(struct nd_cmd_ars_cap *nd_cmd, in nfit_test_cmd_ars_cap() argument
507 if (buf_len < sizeof(*nd_cmd)) in nfit_test_cmd_ars_cap()
513 nd_cmd->max_ars_out = sizeof(struct nd_cmd_ars_status) in nfit_test_cmd_ars_cap()
515 nd_cmd->status = (ND_ARS_PERSISTENT | ND_ARS_VOLATILE) << 16; in nfit_test_cmd_ars_cap()
516 nd_cmd->clear_err_unit = NFIT_TEST_CLEAR_ERR_UNIT; in nfit_test_cmd_ars_cap()
896 struct nd_intel_lss *nd_cmd, unsigned int buf_len) in nd_intel_test_cmd_set_lss_status() argument
900 if (buf_len < sizeof(*nd_cmd)) in nd_intel_test_cmd_set_lss_status()
903 switch (nd_cmd->enable) { in nd_intel_test_cmd_set_lss_status()
905 nd_cmd->status = 0; in nd_intel_test_cmd_set_lss_status()
910 nd_cmd->status = 0; in nd_intel_test_cmd_set_lss_status()
915 dev_warn(dev, "Unknown enable value: %#x\n", nd_cmd->enable); in nd_intel_test_cmd_set_lss_status()
916 nd_cmd->status = 0x3; in nd_intel_test_cmd_set_lss_status()