View | Details | Raw Unified | Return to bug 254841 | Differences between
and this patch

Collapse All | Expand All

(-)b/usr.sbin/mpsutil/Makefile (-1 / +1 lines)
Lines 1-7 Link Here
1
# $FreeBSD$
1
# $FreeBSD$
2
2
3
PROG=	mpsutil
3
PROG=	mpsutil
4
SRCS=	mps_cmd.c mps_debug.c mps_flash.c mps_show.c mps_slot.c mpsutil.c
4
SRCS=	mps_cmd.c mps_debug.c mps_flash.c mps_set.c mps_show.c mps_slot.c mpsutil.c
5
MAN=	mpsutil.8
5
MAN=	mpsutil.8
6
6
7
WARNS?= 3
7
WARNS?= 3
(-)b/usr.sbin/mpsutil/mps_show.c (+34 lines)
Lines 58-69 MPS_TABLE(top, show); Link Here
58
static int
58
static int
59
show_adapter(int ac, char **av)
59
show_adapter(int ac, char **av)
60
{
60
{
61
	const char* pcie_speed[] = { "2.5", "5.0", "8.0" };
62
	const char* temp_units[] = { "", "F", "C" };
63
	const char* ioc_speeds[] = { "", "Full", "Half", "Quarter", "Eighth" };
64
61
	MPI2_CONFIG_PAGE_SASIOUNIT_0	*sas0;
65
	MPI2_CONFIG_PAGE_SASIOUNIT_0	*sas0;
62
	MPI2_CONFIG_PAGE_SASIOUNIT_1	*sas1;
66
	MPI2_CONFIG_PAGE_SASIOUNIT_1	*sas1;
63
	MPI2_SAS_IO_UNIT0_PHY_DATA	*phy0;
67
	MPI2_SAS_IO_UNIT0_PHY_DATA	*phy0;
64
	MPI2_SAS_IO_UNIT1_PHY_DATA	*phy1;
68
	MPI2_SAS_IO_UNIT1_PHY_DATA	*phy1;
65
	MPI2_CONFIG_PAGE_MAN_0 *man0;
69
	MPI2_CONFIG_PAGE_MAN_0 *man0;
66
	MPI2_CONFIG_PAGE_BIOS_3 *bios3;
70
	MPI2_CONFIG_PAGE_BIOS_3 *bios3;
71
	MPI2_CONFIG_PAGE_IO_UNIT_1 *iounit1;
72
	MPI2_CONFIG_PAGE_IO_UNIT_7 *iounit7;
67
	MPI2_IOC_FACTS_REPLY *facts;
73
	MPI2_IOC_FACTS_REPLY *facts;
68
	U16 IOCStatus;
74
	U16 IOCStatus;
69
	char *speed, *minspeed, *maxspeed, *isdisabled, *type;
75
	char *speed, *minspeed, *maxspeed, *isdisabled, *type;
Lines 125-130 show_adapter(int ac, char **av) Link Here
125
	    ? "yes" : "no");
131
	    ? "yes" : "no");
126
	free(facts);
132
	free(facts);
127
133
134
	iounit1 = mps_read_config_page(fd, MPI2_CONFIG_PAGETYPE_IO_UNIT, 1, 0, NULL);
135
	if (iounit1 == NULL) {
136
		error = errno;
137
		warn("Failed to get IOUNIT page 1 info");
138
		return (error);
139
	}
140
	printf("         SATA NCQ: %s\n",
141
		((iounit1->Flags & MPI2_IOUNITPAGE1_NATIVE_COMMAND_Q_DISABLE) == 0) ?
142
		"ENABLED" : "DISABLED");
143
	free(iounit1);
144
145
	iounit7 = mps_read_config_page(fd, MPI2_CONFIG_PAGETYPE_IO_UNIT, 7, 0, NULL);
146
	if (iounit7 == NULL) {
147
		error = errno;
148
		warn("Failed to get IOUNIT page 7 info");
149
		return (error);
150
	}
151
	printf(" PCIe Width/Speed: x%d (%s GB/sec)\n", iounit7->PCIeWidth,
152
		pcie_speed[iounit7->PCIeSpeed]);
153
	printf("        IOC Speed: %s\n", ioc_speeds[iounit7->IOCSpeed]);
154
	printf("      Temperature: ");
155
	if (iounit7->IOCTemperatureUnits == MPI2_IOUNITPAGE7_IOC_TEMP_NOT_PRESENT)
156
		printf("Unknown/Unsupported\n");
157
	else
158
		printf("%d %s\n", iounit7->IOCTemperature,
159
			temp_units[iounit7->IOCTemperatureUnits]);
160
	free(iounit7);
161
128
	fd = mps_open(mps_unit);
162
	fd = mps_open(mps_unit);
129
	if (fd < 0) {
163
	if (fd < 0) {
130
		error = errno;
164
		error = errno;

Return to bug 254841