}
int nvme_get_lba_status(int fd, __u32 namespace_id, __u64 slba, __u32 mndw,
- __u8 atype, __u16 rl, void *data)
+ __u8 atype, __u16 rl, void *data, __u32 timeout_ms)
{
struct nvme_admin_cmd cmd = {
.opcode = nvme_admin_get_lba_status,
.cdw11 = slba >> 32,
.cdw12 = mndw,
.cdw13 = (atype << 24) | rl,
+ .timeout_ms = timeout_ms,
};
return nvme_submit_admin_passthru(fd, &cmd);
int nvme_ns_rescan(int fd);
int nvme_get_lba_status(int fd, __u32 namespace_id, __u64 slba, __u32 mndw,
- __u8 atype, __u16 rl, void *data);
+ __u8 atype, __u16 rl, void *data, __u32 timeout_ms);
int nvme_dir_send(int fd, __u32 nsid, __u16 dspec, __u8 dtype, __u8 doper,
__u32 data_len, __u32 dw12, void *data, __u32 *result);
int nvme_dir_recv(int fd, __u32 nsid, __u16 dspec, __u8 dtype, __u8 doper,
" Status Descriptors to return.";
const char *rl = "Range Length(RL) specifies the length of the range"\
" of contiguous LBAs beginning at SLBA";
+ const char *timeout = "timeout value, in milliseconds";
enum nvme_print_flags flags;
unsigned long buf_len;
__u32 mndw;
__u8 atype;
__u16 rl;
+ __u32 timeout;
char *output_format;
};
.mndw = 0,
.atype = 0,
.rl = 0,
+ .timeout = 0,
.output_format = "normal",
};
OPT_UINT("max-dw", 'm', &cfg.mndw, mndw),
OPT_BYTE("action", 'a', &cfg.atype, atype),
OPT_SHRT("range-len", 'l', &cfg.rl, rl),
+ OPT_UINT("timeout", 't', &cfg.timeout, timeout),
OPT_FMT("output-format", 'o', &cfg.output_format, output_format),
OPT_END()
};
}
err = nvme_get_lba_status(fd, cfg.namespace_id, cfg.slba, cfg.mndw,
- cfg.atype, cfg.rl, buf);
+ cfg.atype, cfg.rl, buf, cfg.timeout);
if (!err)
nvme_show_lba_status(buf, buf_len, flags);
else if (err > 0)