Lines Matching refs:nvdimm
325 struct nvdimm_bus *nvdimm_to_bus(struct nvdimm *nvdimm) in nvdimm_to_bus() argument
327 return to_nvdimm_bus(nvdimm->dev.parent); in nvdimm_to_bus()
850 u32 nd_cmd_in_size(struct nvdimm *nvdimm, int cmd, in nd_cmd_in_size() argument
859 if (nvdimm && cmd == ND_CMD_SET_CONFIG_DATA && idx == 2) { in nd_cmd_in_size()
863 } else if (nvdimm && cmd == ND_CMD_VENDOR && idx == 2) { in nd_cmd_in_size()
877 u32 nd_cmd_out_size(struct nvdimm *nvdimm, int cmd, in nd_cmd_out_size() argument
887 if (nvdimm && cmd == ND_CMD_GET_CONFIG_DATA && idx == 1) in nd_cmd_out_size()
889 else if (nvdimm && cmd == ND_CMD_VENDOR && idx == 2) in nd_cmd_out_size()
891 else if (!nvdimm && cmd == ND_CMD_ARS_STATUS && idx == 2) { in nd_cmd_out_size()
983 struct nvdimm *nvdimm, unsigned int cmd, void *data) in nd_cmd_clear_to_send() argument
989 int rc = nd_desc->clear_to_send(nd_desc, nvdimm, cmd, data); in nd_cmd_clear_to_send()
996 if (!nvdimm && cmd == ND_CMD_CLEAR_ERROR) in nd_cmd_clear_to_send()
1000 if (!nvdimm || cmd != ND_CMD_SET_CONFIG_DATA) in nd_cmd_clear_to_send()
1005 if (atomic_read(&nvdimm->busy)) in nd_cmd_clear_to_send()
1010 static int __nd_ioctl(struct nvdimm_bus *nvdimm_bus, struct nvdimm *nvdimm, in __nd_ioctl() argument
1028 if (nvdimm) { in __nd_ioctl()
1031 cmd_mask = nvdimm->cmd_mask; in __nd_ioctl()
1032 dimm_name = dev_name(&nvdimm->dev); in __nd_ioctl()
1047 if (nvdimm) { in __nd_ioctl()
1076 nvdimm ? nvdimm_cmd_name(cmd) in __nd_ioctl()
1090 in_size = nd_cmd_in_size(nvdimm, cmd, desc, i, in_env); in __nd_ioctl()
1123 u32 out_size = nd_cmd_out_size(nvdimm, cmd, desc, i, in __nd_ioctl()
1166 rc = nd_cmd_clear_to_send(nvdimm_bus, nvdimm, func, buf); in __nd_ioctl()
1170 rc = nd_desc->ndctl(nd_desc, nvdimm, cmd, buf, buf_len, &cmd_rc); in __nd_ioctl()
1174 if (!nvdimm && cmd == ND_CMD_CLEAR_ERROR && cmd_rc >= 0) { in __nd_ioctl()
1204 struct nvdimm *nvdimm = to_nvdimm(dev); in match_dimm() local
1206 return nvdimm->id == id; in match_dimm()
1218 struct nvdimm *nvdimm = NULL; in nd_ioctl() local
1231 nvdimm = to_nvdimm(dev); in nd_ioctl()
1248 rc = __nd_ioctl(nvdimm_bus, nvdimm, ro, cmd, arg); in nd_ioctl()
1250 if (nvdimm) in nd_ioctl()
1251 put_device(&nvdimm->dev); in nd_ioctl()