Lines Matching +full:emc +full:- +full:tables
1 /*-
2 * SPDX-License-Identifier: BSD-2-Clause
4 * Copyright (c) 2013 EMC Corp.
7 * Copyright (C) 2012-2013 Intel Corporation
9 * Copyright (C) 2016-2023 Warner Losh <imp@FreeBSD.org>
10 * Copyright (C) 2018-2019 Alexander Motin <mav@FreeBSD.org>
51 /* Tables for command line parsing */
104 .descr = "Print logpages in human-readable form",
112 /* End of tables for command line parsing */
123 if ((a->vendor == NULL) != (b->vendor == NULL))
124 return (a->vendor == NULL ? -1 : 1);
125 if (a->vendor != NULL) {
126 c = strcmp(a->vendor, b->vendor);
130 return ((int)a->log_page - (int)b->log_page);
159 if (kv->key == key)
160 return kv->name;
199 numd = payload_size / sizeof(uint32_t) - 1;
239 if (letoh(entry->error_count) == 0) {
246 if (letoh(entry->error_count) == 0)
249 status = letoh(entry->status);
259 printf(" Error count: %ju\n", letoh(entry->error_count));
260 printf(" Submission queue ID: %u\n", letoh(entry->sqid));
261 printf(" Command ID: %u\n", letoh(entry->cid));
269 printf(" Error location: %u\n", letoh(entry->error_location));
270 printf(" LBA: %ju\n", letoh(entry->lba));
271 printf(" Namespace ID: %u\n", letoh(entry->nsid));
272 printf(" Vendor specific info: %u\n", letoh(entry->vendor_specific));
273 printf(" Transport type: %u\n", letoh(entry->trtype));
274 printf(" Command specific info:%ju\n", letoh(entry->csi));
275 printf(" Transport specific: %u\n", letoh(entry->ttsi));
282 printf("%u K, %2.2f C, %3.2f F\n", t, (float)t - 273.15, (float)t * 9 / 5 - 459.67);
299 warning = letoh(health->critical_warning);
316 print_temp_K(letoh(health->temperature));
318 letoh(health->available_spare));
320 letoh(health->available_spare_threshold));
322 letoh(health->percentage_used));
325 uint128_to_str(to128(health->data_units_read), cbuf, sizeof(cbuf)));
327 uint128_to_str(to128(health->data_units_written), cbuf, sizeof(cbuf)));
329 uint128_to_str(to128(health->host_read_commands), cbuf, sizeof(cbuf)));
331 uint128_to_str(to128(health->host_write_commands), cbuf, sizeof(cbuf)));
333 uint128_to_str(to128(health->controller_busy_time), cbuf, sizeof(cbuf)));
335 uint128_to_str(to128(health->power_cycles), cbuf, sizeof(cbuf)));
337 uint128_to_str(to128(health->power_on_hours), cbuf, sizeof(cbuf)));
339 uint128_to_str(to128(health->unsafe_shutdowns), cbuf, sizeof(cbuf)));
341 uint128_to_str(to128(health->media_errors), cbuf, sizeof(cbuf)));
343 uint128_to_str(to128(health->num_error_info_log_entries), cbuf, sizeof(cbuf)));
345 printf("Warning Temp Composite Time: %d\n", letoh(health->warning_temp_time));
346 printf("Error Temp Composite Time: %d\n", letoh(health->error_temp_time));
348 if (letoh(health->temp_sensor[i]) == 0)
351 print_temp_K(letoh(health->temp_sensor[i]));
353 printf("Temperature 1 Transition Count: %d\n", letoh(health->tmt1tc));
354 printf("Temperature 2 Transition Count: %d\n", letoh(health->tmt2tc));
355 printf("Total Time For Temperature 1: %d\n", letoh(health->ttftmt1));
356 printf("Total Time For Temperature 2: %d\n", letoh(health->ttftmt2));
369 afi_slot = NVMEV(NVME_FIRMWARE_PAGE_AFI_SLOT, fw->afi);
371 oacs_fw = NVMEV(NVME_CTRLR_DATA_OACS_FIRMWARE, cdata->oacs);
372 fw_num_slots = NVMEV(NVME_CTRLR_DATA_FRMW_NUM_SLOTS, cdata->frmw);
389 if (fw->revision[i][0] == '\0')
392 printf("[%s] %.8s\n", status, fw->revision[i]);
407 for (i = 0; i < nitems(nsl->ns) && letoh(nsl->ns[i]) != 0; i++) {
408 printf("%08x\n", letoh(nsl->ns[i]));
426 s = letoh(ce->acs[i]);
438 s = letoh(ce->iocs[i]);
462 (uintmax_t)letoh(rn->log_page_count));
464 switch (letoh(rn->log_page_type)) {
478 printf("Unknown %x\n", letoh(rn->log_page_type));
481 printf("Number of Available Log Pages: %d\n", letoh(rn->available_log_pages));
482 printf("Namespace ID: 0x%x\n", letoh(rn->nsid));
497 sprog = letoh(ss->sprog);
501 sstat = letoh(ss->sstat);
528 printf("Sanitize Command Dword 10: 0x%x\n", letoh(ss->scdw10));
529 printf("Time For Overwrite: %u sec\n", letoh(ss->etfo));
530 printf("Time For Block Erase: %u sec\n", letoh(ss->etfbe));
531 printf("Time For Crypto Erase: %u sec\n", letoh(ss->etfce));
532 printf("Time For Overwrite No-Deallocate: %u sec\n", letoh(ss->etfownd));
533 printf("Time For Block Erase No-Deallocate: %u sec\n", letoh(ss->etfbewnd));
534 printf("Time For Crypto Erase No-Deallocate: %u sec\n", letoh(ss->etfcewnd));
540 [1] = "aborted by a Device Self-test command",
561 printf("Device Self-test Status\n");
565 switch (letoh(dst->curr_operation)) {
567 printf("No device self-test operation in progress\n");
570 printf("Short device self-test operation in progress\n");
573 printf("Extended device self-test operation in progress\n");
579 printf("Reserved (0x%x)\n", letoh(dst->curr_operation));
582 if (letoh(dst->curr_operation) != 0)
583 printf("Current Completion: %u%%\n", letoh(dst->curr_compl) & 0x7f);
590 status = letoh(dst->result[r].status);
600 printf("Short device self-test");
603 printf("Extended device self-test");
618 letoh(dst->result[r].segment_num));
621 if (letoh(dst->result[r].valid_diag_info) & BIT(0))
622 printf(" NSID=0x%x", letoh(dst->result[r].nsid));
623 if (letoh(dst->result[r].valid_diag_info) & BIT(1)) {
624 memcpy(&failing_lba, dst->result[r].failing_lba,
628 if (letoh(dst->result[r].valid_diag_info) & BIT(2))
629 printf(" SCT=0x%x", letoh(dst->result[r].status_code_type));
630 if (letoh(dst->result[r].valid_diag_info) & BIT(3))
631 printf(" SC=0x%x", letoh(dst->result[r].status_code));
633 memcpy(&vs, dst->result[r].vendor_specific, sizeof(vs));
642 * Make sure you keep all the pages of one vendor together so -v help
661 NVME_LOG_DEVICE_SELF_TEST, NULL, "Device Self-test",
664 NVME_LOG_TELEMETRY_HOST_INITIATED, NULL, "Telemetry Host-Initiated",
667 NVME_LOG_TELEMETRY_CONTROLLER_INITIATED, NULL, "Telemetry Controller-Initiated",
704 fprintf(stderr, "%-8s %-10s %s\n", "Page", "Vendor","Page Name");
705 fprintf(stderr, "-------- ---------- ----------\n");
707 v = f->vendor == NULL ? "-" : f->vendor;
708 fprintf(stderr, "0x%02x %-10s %s\n", f->log_page, v, f->name);
736 fprintf(stderr, "Missing page_id (-p).\n");
782 if (lpf->vendor != NULL && opt.vendor != NULL &&
783 strcmp(lpf->vendor, opt.vendor) != 0)
785 if (opt.page != lpf->log_page)
787 if (lpf->print_fn != NULL)
788 print_fn = lpf->print_fn;
789 size = lpf->size;