Lines Matching +full:vendor +full:- +full:specific

1 /*-
2 * SPDX-License-Identifier: BSD-2-Clause
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>
63 const char *vendor; member
72 .vendor = NULL,
85 "Log Specific Field"),
87 "Log Specific Identifier"),
90 OPT("vendor", 'v', arg_string, opt, vendor,
91 "Vendor specific formatting"),
104 .descr = "Print logpages in human-readable form",
123 if ((a->vendor == NULL) != (b->vendor == NULL)) in logpage_compare()
124 return (a->vendor == NULL ? -1 : 1); in logpage_compare()
125 if (a->vendor != NULL) { in logpage_compare()
126 c = strcmp(a->vendor, b->vendor); in logpage_compare()
130 return ((int)a->log_page - (int)b->log_page); in logpage_compare()
159 if (kv->key == key) in kv_lookup()
160 return kv->name; in kv_lookup()
199 numd = payload_size / sizeof(uint32_t) - 1; in read_logpage()
239 if (letoh(entry->error_count) == 0) { in print_log_error()
246 if (letoh(entry->error_count) == 0) in print_log_error()
249 status = letoh(entry->status); in print_log_error()
259 printf(" Error count: %ju\n", letoh(entry->error_count)); in print_log_error()
260 printf(" Submission queue ID: %u\n", letoh(entry->sqid)); in print_log_error()
261 printf(" Command ID: %u\n", letoh(entry->cid)); in print_log_error()
269 printf(" Error location: %u\n", letoh(entry->error_location)); in print_log_error()
270 printf(" LBA: %ju\n", letoh(entry->lba)); in print_log_error()
271 printf(" Namespace ID: %u\n", letoh(entry->nsid)); in print_log_error()
272 printf(" Vendor specific info: %u\n", letoh(entry->vendor_specific)); in print_log_error()
273 printf(" Transport type: %u\n", letoh(entry->trtype)); in print_log_error()
274 printf(" Command specific info:%ju\n", letoh(entry->csi)); in print_log_error()
275 printf(" Transport specific: %u\n", letoh(entry->ttsi)); in print_log_error()
282 printf("%u K, %2.2f C, %3.2f F\n", t, (float)t - 273.15, (float)t * 9 / 5 - 459.67); in print_temp_K()
299 warning = letoh(health->critical_warning); in print_log_health()
316 print_temp_K(letoh(health->temperature)); in print_log_health()
318 letoh(health->available_spare)); in print_log_health()
320 letoh(health->available_spare_threshold)); in print_log_health()
322 letoh(health->percentage_used)); in print_log_health()
325 uint128_to_str(to128(health->data_units_read), cbuf, sizeof(cbuf))); in print_log_health()
327 uint128_to_str(to128(health->data_units_written), cbuf, sizeof(cbuf))); in print_log_health()
329 uint128_to_str(to128(health->host_read_commands), cbuf, sizeof(cbuf))); in print_log_health()
331 uint128_to_str(to128(health->host_write_commands), cbuf, sizeof(cbuf))); in print_log_health()
333 uint128_to_str(to128(health->controller_busy_time), cbuf, sizeof(cbuf))); in print_log_health()
335 uint128_to_str(to128(health->power_cycles), cbuf, sizeof(cbuf))); in print_log_health()
337 uint128_to_str(to128(health->power_on_hours), cbuf, sizeof(cbuf))); in print_log_health()
339 uint128_to_str(to128(health->unsafe_shutdowns), cbuf, sizeof(cbuf))); in print_log_health()
341 uint128_to_str(to128(health->media_errors), cbuf, sizeof(cbuf))); in print_log_health()
343 uint128_to_str(to128(health->num_error_info_log_entries), cbuf, sizeof(cbuf))); in print_log_health()
345 printf("Warning Temp Composite Time: %d\n", letoh(health->warning_temp_time)); in print_log_health()
346 printf("Error Temp Composite Time: %d\n", letoh(health->error_temp_time)); in print_log_health()
348 if (letoh(health->temp_sensor[i]) == 0) in print_log_health()
351 print_temp_K(letoh(health->temp_sensor[i])); in print_log_health()
353 printf("Temperature 1 Transition Count: %d\n", letoh(health->tmt1tc)); in print_log_health()
354 printf("Temperature 2 Transition Count: %d\n", letoh(health->tmt2tc)); in print_log_health()
355 printf("Total Time For Temperature 1: %d\n", letoh(health->ttftmt1)); in print_log_health()
356 printf("Total Time For Temperature 2: %d\n", letoh(health->ttftmt2)); in print_log_health()
369 afi_slot = NVMEV(NVME_FIRMWARE_PAGE_AFI_SLOT, fw->afi); in print_log_firmware()
371 oacs_fw = NVMEV(NVME_CTRLR_DATA_OACS_FIRMWARE, cdata->oacs); in print_log_firmware()
372 fw_num_slots = NVMEV(NVME_CTRLR_DATA_FRMW_NUM_SLOTS, cdata->frmw); in print_log_firmware()
389 if (fw->revision[i][0] == '\0') in print_log_firmware()
392 printf("[%s] %.8s\n", status, fw->revision[i]); in print_log_firmware()
407 for (i = 0; i < nitems(nsl->ns) && letoh(nsl->ns[i]) != 0; i++) { in print_log_ns()
408 printf("%08x\n", letoh(nsl->ns[i])); in print_log_ns()
426 s = letoh(ce->acs[i]); in print_log_command_effects()
438 s = letoh(ce->iocs[i]); in print_log_command_effects()
462 (uintmax_t)letoh(rn->log_page_count)); in print_log_res_notification()
464 switch (letoh(rn->log_page_type)) { in print_log_res_notification()
478 printf("Unknown %x\n", letoh(rn->log_page_type)); in print_log_res_notification()
481 printf("Number of Available Log Pages: %d\n", letoh(rn->available_log_pages)); in print_log_res_notification()
482 printf("Namespace ID: 0x%x\n", letoh(rn->nsid)); in print_log_res_notification()
497 sprog = letoh(ss->sprog); in print_log_sanitize_status()
501 sstat = letoh(ss->sstat); in print_log_sanitize_status()
528 printf("Sanitize Command Dword 10: 0x%x\n", letoh(ss->scdw10)); in print_log_sanitize_status()
529 printf("Time For Overwrite: %u sec\n", letoh(ss->etfo)); in print_log_sanitize_status()
530 printf("Time For Block Erase: %u sec\n", letoh(ss->etfbe)); in print_log_sanitize_status()
531 printf("Time For Crypto Erase: %u sec\n", letoh(ss->etfce)); in print_log_sanitize_status()
532 printf("Time For Overwrite No-Deallocate: %u sec\n", letoh(ss->etfownd)); in print_log_sanitize_status()
533 printf("Time For Block Erase No-Deallocate: %u sec\n", letoh(ss->etfbewnd)); in print_log_sanitize_status()
534 printf("Time For Crypto Erase No-Deallocate: %u sec\n", letoh(ss->etfcewnd)); in print_log_sanitize_status()
540 [1] = "aborted by a Device Self-test command",
561 printf("Device Self-test Status\n"); in print_log_self_test_status()
565 switch (letoh(dst->curr_operation)) { in print_log_self_test_status()
567 printf("No device self-test operation in progress\n"); in print_log_self_test_status()
570 printf("Short device self-test operation in progress\n"); in print_log_self_test_status()
573 printf("Extended device self-test operation in progress\n"); in print_log_self_test_status()
576 printf("Vendor specific\n"); in print_log_self_test_status()
579 printf("Reserved (0x%x)\n", letoh(dst->curr_operation)); in print_log_self_test_status()
582 if (letoh(dst->curr_operation) != 0) in print_log_self_test_status()
583 printf("Current Completion: %u%%\n", letoh(dst->curr_compl) & 0x7f); in print_log_self_test_status()
590 status = letoh(dst->result[r].status); in print_log_self_test_status()
600 printf("Short device self-test"); in print_log_self_test_status()
603 printf("Extended device self-test"); in print_log_self_test_status()
606 printf("Vendor specific"); in print_log_self_test_status()
618 letoh(dst->result[r].segment_num)); in print_log_self_test_status()
621 if (letoh(dst->result[r].valid_diag_info) & BIT(0)) in print_log_self_test_status()
622 printf(" NSID=0x%x", letoh(dst->result[r].nsid)); in print_log_self_test_status()
623 if (letoh(dst->result[r].valid_diag_info) & BIT(1)) { in print_log_self_test_status()
624 memcpy(&failing_lba, dst->result[r].failing_lba, in print_log_self_test_status()
628 if (letoh(dst->result[r].valid_diag_info) & BIT(2)) in print_log_self_test_status()
629 printf(" SCT=0x%x", letoh(dst->result[r].status_code_type)); in print_log_self_test_status()
630 if (letoh(dst->result[r].valid_diag_info) & BIT(3)) in print_log_self_test_status()
631 printf(" SC=0x%x", letoh(dst->result[r].status_code)); in print_log_self_test_status()
633 memcpy(&vs, dst->result[r].vendor_specific, sizeof(vs)); in print_log_self_test_status()
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"); in logpage_help()
705 fprintf(stderr, "-------- ---------- ----------\n"); in logpage_help()
707 v = f->vendor == NULL ? "-" : f->vendor; in logpage_help()
708 fprintf(stderr, "0x%02x %-10s %s\n", f->log_page, v, f->name); in logpage_help()
733 if (opt.vendor != NULL && strcmp(opt.vendor, "help") == 0) in logpage()
736 fprintf(stderr, "Missing page_id (-p).\n"); in logpage()
777 * (print_hex). If there was a vendor specified by the user, and in logpage()
778 * the page is vendor specific, don't match the print function in logpage()
782 if (lpf->vendor != NULL && opt.vendor != NULL && in logpage()
783 strcmp(lpf->vendor, opt.vendor) != 0) in logpage()
785 if (opt.page != lpf->log_page) in logpage()
787 if (lpf->print_fn != NULL) in logpage()
788 print_fn = lpf->print_fn; in logpage()
789 size = lpf->size; in logpage()