bool human_readable;
};
-struct nvme_dev _nvme_dev;
-struct nvme_dev *nvme_dev = &_nvme_dev;
+static struct nvme_dev _nvme_dev;
+static struct nvme_dev *nvme_dev = &_nvme_dev;
static const char nvme_version_string[] = NVME_VERSION;
void dev_close(struct nvme_dev *dev);
-extern struct nvme_dev *nvme_dev;
extern const char *output_format;
enum nvme_print_flags validate_output_format(const char *format);
return err;
nvme_get_log_smart(dev->fd, cfg.namespace_id, false, &smart_log);
- nvme_show_smart_log(&smart_log, cfg.namespace_id,
- nvme_dev->name, NORMAL);
+ nvme_show_smart_log(&smart_log, cfg.namespace_id, dev->name, NORMAL);
printf("DW0[0-1] Defect Cnt : %u\n", pvsc_smart->defect_cnt);
printf("DW0[2-3] Slc Spb Cnt : %u\n", pvsc_smart->slc_spb_cnt);
if (!err) {
if (cfg.json)
show_intel_smart_log_jsn(&smart_log, cfg.namespace_id,
- nvme_dev->name);
+ dev->name);
else if (!cfg.raw_binary)
show_intel_smart_log(&smart_log, cfg.namespace_id,
- nvme_dev->name);
+ dev->name);
else
d_raw((unsigned char *)&smart_log, sizeof(smart_log));
}
if (!err) {
if (!cfg.raw_binary)
err = show_memblaze_smart_log(dev->fd, cfg.namespace_id,
- nvme_dev->name,
- &smart_log);
+ dev->name, &smart_log);
else
d_raw((unsigned char *)&smart_log, sizeof(smart_log));
}
if (!err) {
if (cfg.json)
show_sfx_smart_log_jsn(&smart_log, cfg.namespace_id,
- nvme_dev->name);
+ dev->name);
else if (!cfg.raw_binary)
show_sfx_smart_log(&smart_log, cfg.namespace_id,
- nvme_dev->name);
+ dev->name);
else
d_raw((unsigned char *)&smart_log, sizeof(smart_log));
}
if (!cfg.raw_binary) {
printf("Device:%s log-id:%d namespace-id:%#x\n",
- nvme_dev->name, cfg.log_id,
+ dev->name, cfg.log_id,
cfg.namespace_id);
printf("Data Block 1 Last Block:%d Data Block 2 Last Block:%d Data Block 3 Last Block:%d\n",
tele_log.tele_data_area1, tele_log.tele_data_area2, tele_log.tele_data_area3);
if (!cfg.raw_binary) {
printf("Device:%s namespace-id:%#x\n",
- nvme_dev->name, cfg.namespace_id);
+ dev->name, cfg.namespace_id);
printf("Data Block 1 Last Block:%d Data Block 2 Last Block:%d Data Block 3 Last Block:%d\n",
tele_log.tele_data_area1, tele_log.tele_data_area2, tele_log.tele_data_area3);
if (!err) {
if (!cfg.raw_binary)
show_shannon_smart_log(&smart_log, cfg.namespace_id,
- nvme_dev->name);
+ dev->name);
else
d_raw((unsigned char *)&smart_log, sizeof(smart_log));
}
if (flags & BINARY) {
d_raw((unsigned char *)&gc_log, sizeof(gc_log));
} else if (flags & JSON) {
- vu_gc_log_show_json(&gc_log, nvme_dev->name);
+ vu_gc_log_show_json(&gc_log, dev->name);
} else {
- vu_gc_log_show(&gc_log, nvme_dev->name);
+ vu_gc_log_show(&gc_log, dev->name);
}
}
else if (err > 0) {
if (!err) {
if (flags & JSON) {
vu_smart_log_show_json(&smart_log_payload,
- cfg.namespace_id,
- nvme_dev->name);
+ cfg.namespace_id, dev->name);
} else if (flags & BINARY) {
d_raw((unsigned char *)&smart_log_payload, sizeof(smart_log_payload));
} else {
vu_smart_log_show(&smart_log_payload, cfg.namespace_id,
- nvme_dev->name);
+ dev->name);
}
} else if (err > 0) {
nvme_show_status(err);
if (fmt == NORMAL) {
/* print the temperature stats */
printf("Temperature Stats for NVME device:%s namespace-id:%x\n",
- nvme_dev->name, WDC_DE_GLOBAL_NSID);
+ dev->name, WDC_DE_GLOBAL_NSID);
printf("Current Composite Temperature : %d °C\n", temperature);
printf("WCTEMP : %"PRIu16" °C\n", id_ctrl.wctemp - 273);
capabilities = wdc_get_drive_capabilities(r, dev);
/* print command and supported status */
- printf("WDC Plugin Capabilities for NVME device:%s\n", nvme_dev->name);
+ printf("WDC Plugin Capabilities for NVME device:%s\n", dev->name);
printf("cap-diag : %s\n",
capabilities & WDC_DRIVE_CAP_CAP_DIAG ? "Supported" : "Not Supported");
printf("drive-log : %s\n",