Lines Matching +full:0 +full:- +full:n

1 /*-
2 * SPDX-License-Identifier: BSD-2-Clause
4 * Copyright (C) 2012-2013 Intel Corporation
6 * Copyright (C) 2018-2019 Alexander Motin <mav@FreeBSD.org>
58 oncs = cdata->oncs; in nvme_print_controller()
63 oacs = cdata->oacs; in nvme_print_controller()
69 fw_num_slots = NVMEV(NVME_CTRLR_DATA_FRMW_NUM_SLOTS, cdata->frmw); in nvme_print_controller()
70 fw_slot1_ro = NVMEV(NVME_CTRLR_DATA_FRMW_SLOT1_RO, cdata->frmw); in nvme_print_controller()
71 fwug = cdata->fwug; in nvme_print_controller()
73 ns_smart = NVMEV(NVME_CTRLR_DATA_LPA_NS_SMART, cdata->lpa); in nvme_print_controller()
75 sqes_min = NVMEV(NVME_CTRLR_DATA_SQES_MIN, cdata->sqes); in nvme_print_controller()
76 sqes_max = NVMEV(NVME_CTRLR_DATA_SQES_MAX, cdata->sqes); in nvme_print_controller()
78 cqes_min = NVMEV(NVME_CTRLR_DATA_CQES_MIN, cdata->cqes); in nvme_print_controller()
79 cqes_max = NVMEV(NVME_CTRLR_DATA_CQES_MAX, cdata->cqes); in nvme_print_controller()
81 printf("Controller Capabilities/Features\n"); in nvme_print_controller()
82 printf("================================\n"); in nvme_print_controller()
83 printf("Vendor ID: %04x\n", cdata->vid); in nvme_print_controller()
84 printf("Subsystem Vendor ID: %04x\n", cdata->ssvid); in nvme_print_controller()
85 nvme_strvis(str, cdata->sn, sizeof(str), NVME_SERIAL_NUMBER_LENGTH); in nvme_print_controller()
86 printf("Serial Number: %s\n", str); in nvme_print_controller()
87 nvme_strvis(str, cdata->mn, sizeof(str), NVME_MODEL_NUMBER_LENGTH); in nvme_print_controller()
88 printf("Model Number: %s\n", str); in nvme_print_controller()
89 nvme_strvis(str, cdata->fr, sizeof(str), NVME_FIRMWARE_REVISION_LENGTH); in nvme_print_controller()
90 printf("Firmware Version: %s\n", str); in nvme_print_controller()
91 printf("Recommended Arb Burst: %d\n", cdata->rab); in nvme_print_controller()
92 printf("IEEE OUI Identifier: %02x %02x %02x\n", in nvme_print_controller()
93 cdata->ieee[2], cdata->ieee[1], cdata->ieee[0]); in nvme_print_controller()
94 printf("Multi-Path I/O Capabilities: %s%s%s%s%s\n", in nvme_print_controller()
95 (cdata->mic == 0) ? "Not Supported" : "", in nvme_print_controller()
96 NVMEV(NVME_CTRLR_DATA_MIC_ANAR, cdata->mic) != 0 ? in nvme_print_controller()
98 NVMEV(NVME_CTRLR_DATA_MIC_SRIOVVF, cdata->mic) != 0 ? in nvme_print_controller()
99 "SR-IOV VF, " : "", in nvme_print_controller()
100 NVMEV(NVME_CTRLR_DATA_MIC_MCTRLRS, cdata->mic) != 0 ? in nvme_print_controller()
102 NVMEV(NVME_CTRLR_DATA_MIC_MPORTS, cdata->mic) != 0 ? in nvme_print_controller()
106 if (cdata->mdts == 0) in nvme_print_controller()
107 printf("Unlimited\n"); in nvme_print_controller()
109 printf("%ld bytes\n", PAGE_SIZE * (1L << cdata->mdts)); in nvme_print_controller()
110 printf("Sanitize Crypto Erase: %s\n", in nvme_print_controller()
111 NVMEV(NVME_CTRLR_DATA_SANICAP_CES, cdata->sanicap) != 0 ? in nvme_print_controller()
113 printf("Sanitize Block Erase: %s\n", in nvme_print_controller()
114 NVMEV(NVME_CTRLR_DATA_SANICAP_BES, cdata->sanicap) != 0 ? in nvme_print_controller()
116 printf("Sanitize Overwrite: %s\n", in nvme_print_controller()
117 NVMEV(NVME_CTRLR_DATA_SANICAP_OWS, cdata->sanicap) != 0 ? in nvme_print_controller()
119 printf("Sanitize NDI: %s\n", in nvme_print_controller()
120 NVMEV(NVME_CTRLR_DATA_SANICAP_NDI, cdata->sanicap) != 0 ? in nvme_print_controller()
123 switch (NVMEV(NVME_CTRLR_DATA_SANICAP_NODMMAS, cdata->sanicap)) { in nvme_print_controller()
125 printf("Undefined\n"); in nvme_print_controller()
128 printf("No\n"); in nvme_print_controller()
131 printf("Yes\n"); in nvme_print_controller()
134 printf("Unknown\n"); in nvme_print_controller()
137 printf("Controller ID: 0x%04x\n", cdata->ctrlr_id); in nvme_print_controller()
138 printf("Version: %d.%d.%d\n", in nvme_print_controller()
139 (cdata->ver >> 16) & 0xffff, (cdata->ver >> 8) & 0xff, in nvme_print_controller()
140 cdata->ver & 0xff); in nvme_print_controller()
141 printf("Traffic Based Keep Alive: %sSupported\n", in nvme_print_controller()
142 NVMEV(NVME_CTRLR_DATA_CTRATT_TBKAS, cdata->ctratt) ? "" : "Not "); in nvme_print_controller()
144 switch (cdata->cntrltype) { in nvme_print_controller()
145 case 0: in nvme_print_controller()
146 printf("Not Reported\n"); in nvme_print_controller()
149 printf("I/O Controller\n"); in nvme_print_controller()
152 printf("Discovery Controller\n"); in nvme_print_controller()
155 printf("Administrative Controller\n"); in nvme_print_controller()
158 printf("%d (Reserved)\n", cdata->cntrltype); in nvme_print_controller()
162 if (cdata->kas == 0) in nvme_print_controller()
163 printf("Not Supported\n"); in nvme_print_controller()
165 printf("%u ms granularity\n", cdata->kas * 100); in nvme_print_controller()
167 if (cdata->maxcmd == 0) in nvme_print_controller()
168 printf("Not Specified\n"); in nvme_print_controller()
170 printf("%u\n", cdata->maxcmd); in nvme_print_controller()
171 printf("\n"); in nvme_print_controller()
173 printf("Admin Command Set Attributes\n"); in nvme_print_controller()
174 printf("============================\n"); in nvme_print_controller()
175 printf("Security Send/Receive: %s\n", in nvme_print_controller()
177 printf("Format NVM: %s\n", in nvme_print_controller()
179 printf("Firmware Activate/Download: %s\n", in nvme_print_controller()
181 printf("Namespace Management: %s\n", in nvme_print_controller()
183 printf("Device Self-test: %sSupported\n", in nvme_print_controller()
184 NVMEV(NVME_CTRLR_DATA_OACS_SELFTEST, oacs) != 0 ? "" : "Not "); in nvme_print_controller()
185 printf("Directives: %sSupported\n", in nvme_print_controller()
186 NVMEV(NVME_CTRLR_DATA_OACS_DIRECTIVES, oacs) != 0 ? "" : "Not "); in nvme_print_controller()
187 printf("NVMe-MI Send/Receive: %sSupported\n", in nvme_print_controller()
188 NVMEV(NVME_CTRLR_DATA_OACS_NVMEMI, oacs) != 0 ? "" : "Not "); in nvme_print_controller()
189 printf("Virtualization Management: %sSupported\n", in nvme_print_controller()
190 NVMEV(NVME_CTRLR_DATA_OACS_VM, oacs) != 0 ? "" : "Not "); in nvme_print_controller()
191 printf("Doorbell Buffer Config: %sSupported\n", in nvme_print_controller()
192 NVMEV(NVME_CTRLR_DATA_OACS_DBBUFFER, oacs) != 0 ? "" : "Not "); in nvme_print_controller()
193 printf("Get LBA Status: %sSupported\n", in nvme_print_controller()
194 NVMEV(NVME_CTRLR_DATA_OACS_GETLBA, oacs) != 0 ? "" : "Not "); in nvme_print_controller()
196 if (cdata->sanicap != 0) { in nvme_print_controller()
197 printf("%s%s%s\n", in nvme_print_controller()
198 NVMEV(NVME_CTRLR_DATA_SANICAP_CES, cdata->sanicap) != 0 ? in nvme_print_controller()
200 NVMEV(NVME_CTRLR_DATA_SANICAP_BES, cdata->sanicap) != 0 ? in nvme_print_controller()
202 NVMEV(NVME_CTRLR_DATA_SANICAP_OWS, cdata->sanicap) != 0 ? in nvme_print_controller()
205 printf("Not Supported\n"); in nvme_print_controller()
207 printf("Abort Command Limit: %d\n", cdata->acl+1); in nvme_print_controller()
208 printf("Async Event Request Limit: %d\n", cdata->aerl+1); in nvme_print_controller()
209 printf("Number of Firmware Slots: %d\n", fw_num_slots); in nvme_print_controller()
210 printf("Firmware Slot 1 Read-Only: %s\n", fw_slot1_ro ? "Yes" : "No"); in nvme_print_controller()
211 printf("Per-Namespace SMART Log: %s\n", in nvme_print_controller()
213 printf("Error Log Page Entries: %d\n", cdata->elpe+1); in nvme_print_controller()
214 printf("Number of Power States: %d\n", cdata->npss+1); in nvme_print_controller()
215 if (cdata->ver >= 0x010200) { in nvme_print_controller()
216 printf("Total NVM Capacity: %s bytes\n", in nvme_print_controller()
217 uint128_to_str(to128(cdata->untncap.tnvmcap), in nvme_print_controller()
219 printf("Unallocated NVM Capacity: %s bytes\n", in nvme_print_controller()
220 uint128_to_str(to128(cdata->untncap.unvmcap), in nvme_print_controller()
224 if (fwug == 0) in nvme_print_controller()
225 printf("(Not Reported)\n"); in nvme_print_controller()
226 else if (fwug == 0xFF) in nvme_print_controller()
227 printf("(No Granularity)\n"); in nvme_print_controller()
229 printf("(%d bytes)\n", ((uint32_t)fwug << 12)); in nvme_print_controller()
230 printf("Host Buffer Preferred Size: %llu bytes\n", in nvme_print_controller()
231 (long long unsigned)cdata->hmpre * 4096); in nvme_print_controller()
232 printf("Host Buffer Minimum Size: %llu bytes\n", in nvme_print_controller()
233 (long long unsigned)cdata->hmmin * 4096); in nvme_print_controller()
235 printf("\n"); in nvme_print_controller()
236 printf("NVM Command Set Attributes\n"); in nvme_print_controller()
237 printf("==========================\n"); in nvme_print_controller()
238 printf("Submission Queue Entry Size\n"); in nvme_print_controller()
239 printf(" Max: %d\n", 1 << sqes_max); in nvme_print_controller()
240 printf(" Min: %d\n", 1 << sqes_min); in nvme_print_controller()
241 printf("Completion Queue Entry Size\n"); in nvme_print_controller()
242 printf(" Max: %d\n", 1 << cqes_max); in nvme_print_controller()
243 printf(" Min: %d\n", 1 << cqes_min); in nvme_print_controller()
244 printf("Number of Namespaces: %d\n", cdata->nn); in nvme_print_controller()
245 printf("Compare Command: %s\n", in nvme_print_controller()
247 printf("Write Uncorrectable Command: %s\n", in nvme_print_controller()
249 printf("Dataset Management Command: %s\n", in nvme_print_controller()
251 printf("Write Zeroes Command: %sSupported\n", in nvme_print_controller()
252 NVMEV(NVME_CTRLR_DATA_ONCS_WRZERO, oncs) != 0 ? "" : "Not "); in nvme_print_controller()
253 printf("Save Features: %sSupported\n", in nvme_print_controller()
254 NVMEV(NVME_CTRLR_DATA_ONCS_SAVEFEAT, oncs) != 0 ? "" : "Not "); in nvme_print_controller()
255 printf("Reservations: %sSupported\n", in nvme_print_controller()
256 NVMEV(NVME_CTRLR_DATA_ONCS_RESERV, oncs) != 0 ? "" : "Not "); in nvme_print_controller()
257 printf("Timestamp feature: %sSupported\n", in nvme_print_controller()
258 NVMEV(NVME_CTRLR_DATA_ONCS_TIMESTAMP, oncs) != 0 ? "" : "Not "); in nvme_print_controller()
259 printf("Verify feature: %sSupported\n", in nvme_print_controller()
260 NVMEV(NVME_CTRLR_DATA_ONCS_VERIFY, oncs) != 0 ? "" : "Not "); in nvme_print_controller()
261 printf("Fused Operation Support: %s%s\n", in nvme_print_controller()
262 (cdata->fuses == 0) ? "Not Supported" : "", in nvme_print_controller()
263 NVMEV(NVME_CTRLR_DATA_FUSES_CNW, cdata->fuses) != 0 ? in nvme_print_controller()
265 printf("Format NVM Attributes: %s%s Erase, %s Format\n", in nvme_print_controller()
266 NVMEV(NVME_CTRLR_DATA_FNA_CRYPTO_ERASE, cdata->fna) != 0 ? in nvme_print_controller()
268 NVMEV(NVME_CTRLR_DATA_FNA_ERASE_ALL, cdata->fna) != 0 ? in nvme_print_controller()
269 "All-NVM" : "Per-NS", in nvme_print_controller()
270 NVMEV(NVME_CTRLR_DATA_FNA_FORMAT_ALL, cdata->fna) != 0 ? in nvme_print_controller()
271 "All-NVM" : "Per-NS"); in nvme_print_controller()
272 t = NVMEV(NVME_CTRLR_DATA_VWC_ALL, cdata->vwc); in nvme_print_controller()
273 printf("Volatile Write Cache: %s%s\n", in nvme_print_controller()
274 NVMEV(NVME_CTRLR_DATA_VWC_PRESENT, cdata->vwc) != 0 ? in nvme_print_controller()
279 if (cdata->ver >= 0x010201) in nvme_print_controller()
280 printf("\nNVM Subsystem Name: %.256s\n", cdata->subnqn); in nvme_print_controller()
282 if (cdata->ioccsz != 0) { in nvme_print_controller()
283 printf("\n"); in nvme_print_controller()
284 printf("Fabrics Attributes\n"); in nvme_print_controller()
285 printf("==================\n"); in nvme_print_controller()
286 printf("I/O Command Capsule Size: %d bytes\n", in nvme_print_controller()
287 cdata->ioccsz * 16); in nvme_print_controller()
288 printf("I/O Response Capsule Size: %d bytes\n", in nvme_print_controller()
289 cdata->iorcsz * 16); in nvme_print_controller()
290 printf("In Capsule Data Offset: %d bytes\n", in nvme_print_controller()
291 cdata->icdoff * 16); in nvme_print_controller()
292 printf("Controller Model: %s\n", in nvme_print_controller()
293 (cdata->fcatt & 1) == 0 ? "Dynamic" : "Static"); in nvme_print_controller()
295 if (cdata->msdbd == 0) in nvme_print_controller()
296 printf("Unlimited\n"); in nvme_print_controller()
298 printf("%d\n", cdata->msdbd); in nvme_print_controller()
299 printf("Disconnect of I/O Queues: %sSupported\n", in nvme_print_controller()
300 (cdata->ofcs & 1) == 1 ? "" : "Not "); in nvme_print_controller()