Lines Matching +full:min +full:- +full:len

1 /*-
73 OPT("data-area", 'd', arg_uint8, opt, data_area,
74 "Data-area to retrieve up to"),
79 { arg_string, &opt.dev, "controller-id" },
84 .name = "cap-diag",
86 .descr = "Retrieve the cap-diag logs from the drive",
116 wdc_append_serial_name(int fd, char *buf, size_t len, const char *suffix) in wdc_append_serial_name() argument
122 len -= strlen(buf); in wdc_append_serial_name()
127 walker = sn + NVME_SERIAL_NUMBER_LENGTH - 1; in wdc_append_serial_name()
129 walker--; in wdc_append_serial_name()
131 snprintf(buf, len, "_%s_%s.bin", sn, suffix); in wdc_append_serial_name()
135 wdc_get_data(int fd, uint32_t opcode, uint32_t len, uint32_t off, uint32_t cmd, in wdc_get_data() argument
142 pt.cmd.cdw10 = htole32(len / sizeof(uint32_t)); in wdc_get_data()
149 pt.len = buflen; in wdc_get_data()
166 uint32_t len, offset; in wdc_do_dump_e6() local
173 len = WDC_NVME_LOG_SIZE_HDR_LEN; in wdc_do_dump_e6()
175 hdr = malloc(len); in wdc_do_dump_e6()
178 wdc_get_data(fd, opcode, len, offset, cmd, hdr, len, false); in wdc_do_dump_e6()
193 len = max_xfer_size; in wdc_do_dump_e6()
197 resid = MIN(len, max_xfer_size); in wdc_do_dump_e6()
201 len = be32dec(buf + len_off); in wdc_do_dump_e6()
202 if (len == 0) in wdc_do_dump_e6()
205 printf("Dumping %d bytes of version %d.%d log to %s\n", len, in wdc_do_dump_e6()
212 if (resid > len) in wdc_do_dump_e6()
213 resid = len; in wdc_do_dump_e6()
219 len -= resid; in wdc_do_dump_e6()
220 } while (len > 0); in wdc_do_dump_e6()
227 wdc_get_data_dui(int fd, uint32_t opcode, uint32_t len, uint64_t off, in wdc_get_data_dui() argument
235 pt.cmd.cdw10 = htole32((len / sizeof(uint32_t)) - 1) ; in wdc_get_data_dui()
239 pt.len = buflen; in wdc_get_data_dui()
272 uint16_t len; in wdc_get_dui_log_size() local
276 len = 1024; in wdc_get_dui_log_size()
277 tofree = hdr = (uint8_t*)malloc(len); in wdc_get_dui_log_size()
280 wdc_get_data_dui(fd, opcode, len, 0, hdr, len); in wdc_get_dui_log_size()
345 resid = MIN(log_len, max_xfer_size); in wdc_do_dump_dui()
357 log_len -= resid; in wdc_do_dump_dui()
379 fprintf(stderr, "Data area range 1-4, supplied %d.\n", opt.data_area); in wdc_cap_diag()
472 printf(" %-30s: %jd\n", kv_lookup(kv, kv_count, ptype), (uintmax_t)param); in print_hgst_info_subpage_gen()
483 { 0x0002, "Re-Writes" }, in print_hgst_info_write_errors()
503 { 0x0002, "Re-Reads" }, in print_hgst_info_read_errors()
524 { 0x0002, "Re-Reads" }, in print_hgst_info_verify_errors()
555 printf(" %-30s: %d\n", "Recent Test", code); in print_hgst_info_self_test()
556 printf(" %-28s: %#x\n", "Self-Test Results", *walker & 0xf); in print_hgst_info_self_test()
557 printf(" %-28s: %#x\n", "Self-Test Code", (*walker >> 5) & 0x7); in print_hgst_info_self_test()
559 printf(" %-28s: %#x\n", "Self-Test Number", *walker++); in print_hgst_info_self_test()
564 printf(" %-28s: %u\n", "Total Power On Hrs", hrs); in print_hgst_info_self_test()
565 printf(" %-28s: %#jx (%jd)\n", "LBA", (uintmax_t)lba, (uintmax_t)lba); in print_hgst_info_self_test()
566 printf(" %-28s: %#x\n", "Sense Key", *walker++ & 0xf); in print_hgst_info_self_test()
567 printf(" %-28s: %#x\n", "Additional Sense Code", *walker++); in print_hgst_info_self_test()
568 printf(" %-28s: %#x\n", "Additional Sense Qualifier", *walker++); in print_hgst_info_self_test()
569 printf(" %-28s: %#x\n", "Vendor Specific Detail", *walker++); in print_hgst_info_self_test()
603 printf(" %-30s: %d\n", "Power On Minutes", pom); in print_hgst_info_background_scan()
604 printf(" %-30s: %x (%s)\n", "BMS Status", status, in print_hgst_info_background_scan()
606 printf(" %-30s: %d\n", "Number of BMS", nscan); in print_hgst_info_background_scan()
607 printf(" %-30s: %d\n", "Progress Current BMS", progress); in print_hgst_info_background_scan()
609 if (walker - (uint8_t *)buf != 20) { in print_hgst_info_background_scan()
613 size -= 20; in print_hgst_info_background_scan()
614 printf(" %-30s: %d\n", "BMS retirements", size / 0x18); in print_hgst_info_background_scan()
641 printf(" %-30s: %d\n", "Retirement number", code); in print_hgst_info_background_scan()
642 printf(" %-28s: %#x\n", "NAND (C/T)BBBPPP", nand); in print_hgst_info_background_scan()
657 { 0x0002, "Re-Erase" }, in print_hgst_info_erase_errors()
665 { 0x8003, "Erase Count -- User" }, in print_hgst_info_erase_errors()
666 { 0x8004, "Erase Count -- System" }, in print_hgst_info_erase_errors()
676 /* My drive doesn't export this -- so not coding up */ in print_hgst_info_erase_counts()
684 uint32_t min; in print_hgst_info_temp_history() local
687 printf(" %-30s: %d C\n", "Current Temperature", *walker++); in print_hgst_info_temp_history()
688 printf(" %-30s: %d C\n", "Reference Temperature", *walker++); in print_hgst_info_temp_history()
689 printf(" %-30s: %d C\n", "Maximum Temperature", *walker++); in print_hgst_info_temp_history()
690 printf(" %-30s: %d C\n", "Minimum Temperature", *walker++); in print_hgst_info_temp_history()
691 min = le32dec(walker); in print_hgst_info_temp_history()
693 printf(" %-30s: %d:%02d:00\n", "Max Temperature Time", min / 60, min % 60); in print_hgst_info_temp_history()
694 min = le32dec(walker); in print_hgst_info_temp_history()
696 printf(" %-30s: %d:%02d:00\n", "Over Temperature Duration", min / 60, min % 60); in print_hgst_info_temp_history()
697 min = le32dec(walker); in print_hgst_info_temp_history()
699 printf(" %-30s: %d:%02d:00\n", "Min Temperature Time", min / 60, min % 60); in print_hgst_info_temp_history()
711 printf(" %-30s: %ju\n", "Host Read Commands", val); in print_hgst_info_ssd_perf()
714 printf(" %-30s: %ju\n", "Host Read Blocks", val); in print_hgst_info_ssd_perf()
717 printf(" %-30s: %ju\n", "Host Cache Read Hits Commands", val); in print_hgst_info_ssd_perf()
720 printf(" %-30s: %ju\n", "Host Cache Read Hits Blocks", val); in print_hgst_info_ssd_perf()
723 printf(" %-30s: %ju\n", "Host Read Commands Stalled", val); in print_hgst_info_ssd_perf()
726 printf(" %-30s: %ju\n", "Host Write Commands", val); in print_hgst_info_ssd_perf()
729 printf(" %-30s: %ju\n", "Host Write Blocks", val); in print_hgst_info_ssd_perf()
732 printf(" %-30s: %ju\n", "Host Write Odd Start Commands", val); in print_hgst_info_ssd_perf()
735 printf(" %-30s: %ju\n", "Host Write Odd End Commands", val); in print_hgst_info_ssd_perf()
738 printf(" %-30s: %ju\n", "Host Write Commands Stalled", val); in print_hgst_info_ssd_perf()
741 printf(" %-30s: %ju\n", "NAND Read Commands", val); in print_hgst_info_ssd_perf()
744 printf(" %-30s: %ju\n", "NAND Read Blocks", val); in print_hgst_info_ssd_perf()
747 printf(" %-30s: %ju\n", "NAND Write Commands", val); in print_hgst_info_ssd_perf()
750 printf(" %-30s: %ju\n", "NAND Write Blocks", val); in print_hgst_info_ssd_perf()
753 printf(" %-30s: %ju\n", "NAND Read Before Writes", val); in print_hgst_info_ssd_perf()
762 printf(" %-30s: %d\n", "Firmware Downloads", le32dec(walker)); in print_hgst_info_firmware_load()
771 if (sp->key == subtype) { in kv_indirect()
772 sp->fn(buf, subtype, res, size); in kv_indirect()
783 uint16_t len; in print_hgst_info_log() local
791 len = le16dec(walker); in print_hgst_info_log()
793 end = walker + len; /* Length is exclusive of this header */ in print_hgst_info_log()
799 len = le16dec(walker); in print_hgst_info_log()
800 walker += len + 2; /* Length, not incl header */ in print_hgst_info_log()
805 kv_indirect(subpage, subtype, res, len, hgst_subpage, nitems(hgst_subpage)); in print_hgst_info_log()