identify.c (253437) | identify.c (253476) |
---|---|
1/*- 2 * Copyright (C) 2012-2013 Intel Corporation 3 * All rights reserved. 4 * 5 * Redistribution and use in source and binary forms, with or without 6 * modification, are permitted provided that the following conditions 7 * are met: 8 * 1. Redistributions of source code must retain the above copyright --- 11 unchanged lines hidden (view full) --- 20 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 21 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 22 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 23 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 24 * SUCH DAMAGE. 25 */ 26 27#include <sys/cdefs.h> | 1/*- 2 * Copyright (C) 2012-2013 Intel Corporation 3 * All rights reserved. 4 * 5 * Redistribution and use in source and binary forms, with or without 6 * modification, are permitted provided that the following conditions 7 * are met: 8 * 1. Redistributions of source code must retain the above copyright --- 11 unchanged lines hidden (view full) --- 20 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 21 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 22 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 23 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 24 * SUCH DAMAGE. 25 */ 26 27#include <sys/cdefs.h> |
28__FBSDID("$FreeBSD: head/sbin/nvmecontrol/identify.c 253437 2013-07-17 23:23:38Z jimharris $"); | 28__FBSDID("$FreeBSD: head/sbin/nvmecontrol/identify.c 253476 2013-07-19 21:40:57Z jimharris $"); |
29 30#include <sys/param.h> 31 32#include <ctype.h> 33#include <err.h> 34#include <fcntl.h> 35#include <stddef.h> 36#include <stdio.h> 37#include <stdlib.h> 38#include <string.h> 39#include <unistd.h> 40 41#include "nvmecontrol.h" 42 43static void 44print_controller(struct nvme_controller_data *cdata) 45{ | 29 30#include <sys/param.h> 31 32#include <ctype.h> 33#include <err.h> 34#include <fcntl.h> 35#include <stddef.h> 36#include <stdio.h> 37#include <stdlib.h> 38#include <string.h> 39#include <unistd.h> 40 41#include "nvmecontrol.h" 42 43static void 44print_controller(struct nvme_controller_data *cdata) 45{ |
46 uint8_t str[128]; 47 |
|
46 printf("Controller Capabilities/Features\n"); 47 printf("================================\n"); 48 printf("Vendor ID: %04x\n", cdata->vid); 49 printf("Subsystem Vendor ID: %04x\n", cdata->ssvid); | 48 printf("Controller Capabilities/Features\n"); 49 printf("================================\n"); 50 printf("Vendor ID: %04x\n", cdata->vid); 51 printf("Subsystem Vendor ID: %04x\n", cdata->ssvid); |
50 printf("Serial Number: %.*s\n", 51 NVME_SERIAL_NUMBER_LENGTH, cdata->sn); 52 printf("Model Number: %.*s\n", 53 NVME_MODEL_NUMBER_LENGTH, cdata->mn); 54 printf("Firmware Version: %.*s\n", 55 NVME_FIRMWARE_REVISION_LENGTH, cdata->fr); | 52 nvme_strvis(str, cdata->sn, sizeof(str), NVME_SERIAL_NUMBER_LENGTH); 53 printf("Serial Number: %s\n", str); 54 nvme_strvis(str, cdata->mn, sizeof(str), NVME_MODEL_NUMBER_LENGTH); 55 printf("Model Number: %s\n", str); 56 nvme_strvis(str, cdata->fr, sizeof(str), NVME_FIRMWARE_REVISION_LENGTH); 57 printf("Firmware Version: %s\n", str); |
56 printf("Recommended Arb Burst: %d\n", cdata->rab); 57 printf("IEEE OUI Identifier: %02x %02x %02x\n", 58 cdata->ieee[0], cdata->ieee[1], cdata->ieee[2]); 59 printf("Multi-Interface Cap: %02x\n", cdata->mic); 60 /* TODO: Use CAP.MPSMIN to determine true memory page size. */ 61 printf("Max Data Transfer Size: "); 62 if (cdata->mdts == 0) 63 printf("Unlimited\n"); --- 219 unchanged lines hidden --- | 58 printf("Recommended Arb Burst: %d\n", cdata->rab); 59 printf("IEEE OUI Identifier: %02x %02x %02x\n", 60 cdata->ieee[0], cdata->ieee[1], cdata->ieee[2]); 61 printf("Multi-Interface Cap: %02x\n", cdata->mic); 62 /* TODO: Use CAP.MPSMIN to determine true memory page size. */ 63 printf("Max Data Transfer Size: "); 64 if (cdata->mdts == 0) 65 printf("Unlimited\n"); --- 219 unchanged lines hidden --- |