Lines Matching refs:cmd
60 struct nd_cmd_get_config_size *cmd = &ndd->nsarea; in nvdimm_init_nsarea() local
69 if (cmd->config_size) in nvdimm_init_nsarea()
72 memset(cmd, 0, sizeof(*cmd)); in nvdimm_init_nsarea()
75 ND_CMD_GET_CONFIG_SIZE, cmd, sizeof(*cmd), &cmd_rc); in nvdimm_init_nsarea()
87 struct nd_cmd_get_config_data_hdr *cmd; in nvdimm_get_config_data() local
97 cmd = kvzalloc(max_cmd_size + sizeof(*cmd), GFP_KERNEL); in nvdimm_get_config_data()
98 if (!cmd) in nvdimm_get_config_data()
102 len -= cmd->in_length, buf_offset += cmd->in_length) { in nvdimm_get_config_data()
105 cmd->in_offset = offset + buf_offset; in nvdimm_get_config_data()
106 cmd->in_length = min(max_cmd_size, len); in nvdimm_get_config_data()
108 cmd_size = sizeof(*cmd) + cmd->in_length; in nvdimm_get_config_data()
111 ND_CMD_GET_CONFIG_DATA, cmd, cmd_size, &cmd_rc); in nvdimm_get_config_data()
120 memcpy(buf + buf_offset, cmd->out_buf, cmd->in_length); in nvdimm_get_config_data()
122 kvfree(cmd); in nvdimm_get_config_data()
131 struct nd_cmd_set_config_hdr *cmd; in nvdimm_set_config_data() local
143 cmd = kvzalloc(max_cmd_size + sizeof(*cmd) + sizeof(u32), GFP_KERNEL); in nvdimm_set_config_data()
144 if (!cmd) in nvdimm_set_config_data()
147 for (buf_offset = 0; len; len -= cmd->in_length, in nvdimm_set_config_data()
148 buf_offset += cmd->in_length) { in nvdimm_set_config_data()
151 cmd->in_offset = offset + buf_offset; in nvdimm_set_config_data()
152 cmd->in_length = min(max_cmd_size, len); in nvdimm_set_config_data()
153 memcpy(cmd->in_buf, buf + buf_offset, cmd->in_length); in nvdimm_set_config_data()
156 cmd_size = sizeof(*cmd) + cmd->in_length + sizeof(u32); in nvdimm_set_config_data()
159 ND_CMD_SET_CONFIG_DATA, cmd, cmd_size, &cmd_rc); in nvdimm_set_config_data()
167 kvfree(cmd); in nvdimm_set_config_data()
278 int cmd, len = 0; in commands_show() local
283 for_each_set_bit(cmd, &nvdimm->cmd_mask, BITS_PER_LONG) in commands_show()
284 len += sprintf(buf + len, "%s ", nvdimm_cmd_name(cmd)); in commands_show()