int nvme_get_property(int fd, int offset, uint64_t *value)
{
struct nvme_passthru_cmd pcmd;
- struct nvme_command gcmd = {
- .prop_get = {
- .opcode = nvme_fabrics_command,
- .fctype = nvme_fabrics_type_property_get,
- .offset = cpu_to_le32(offset),
- .attrib = is_64bit_reg(offset),
- }
+ struct nvmf_property_get_command pg = {
+ .opcode = nvme_fabrics_command,
+ .fctype = nvme_fabrics_type_property_get,
+ .offset = cpu_to_le32(offset),
+ .attrib = is_64bit_reg(offset),
};
+ struct nvme_command gcmd;
int err;
+ gcmd.prop_get = pg;
nvme_to_passthru_cmd(&pcmd, &gcmd);
err = nvme_submit_admin_passthru(fd, &pcmd);
if (!err) {
int nvme_set_property(int fd, int offset, uint64_t value)
{
- struct nvme_command scmd = {
- .prop_set = {
- .opcode = nvme_fabrics_command,
- .fctype = nvme_fabrics_type_property_set,
- .offset = cpu_to_le32(offset),
- .value = cpu_to_le64(value),
- .attrib = is_64bit_reg(offset),
- }
+ struct nvmf_property_set_command ps = {
+ .opcode = nvme_fabrics_command,
+ .fctype = nvme_fabrics_type_property_set,
+ .offset = cpu_to_le32(offset),
+ .value = cpu_to_le64(value),
+ .attrib = is_64bit_reg(offset),
};
+ struct nvme_command scmd;
struct nvme_passthru_cmd pcmd;
+ scmd.prop_set = ps;
nvme_to_passthru_cmd(&pcmd, &scmd);
return nvme_submit_admin_passthru(fd, &pcmd);
}