108 if (status != NT_SUCCESS)
111 (void)printf(
"\nAdapter %u Product Information", (
unsigned)
adapterNo);
112 (void)printf(
"\n-------------------------------------------\n");
114 (void)printf(
"%-24s : %s\n",
"P/N", pi->
ProductId);
115 (void)printf(
"%-24s : %s\n",
"Serial No", pi->
SerialNo[0]);
116 (void)printf(
"%-24s : %s\n",
"PBA", pi->
PbaId[0]);
117 (void)printf(
"%-24s : %s\n",
"CPLD", pi->
CpldVersion);
118 assert(
sizeof(imageStr) >=
sizeof(pi->
fpgaId1));
121 (void)printf(
"%-24s : %s\n",
"FPGA flash image #0", imageStr);
122 assert(
sizeof(imageStr) >=
sizeof(pi->
fpgaId2));
125 (void)printf(
"%-24s : %s\n",
"FPGA flash image #1", imageStr);
127 (void)printf(
"%-24s : %s\n",
"P/N", pi->
ProductId);
128 (void)printf(
"%-24s : %s\n",
"Main Board Serial No", pi->
SerialNo[0]);
129 (void)printf(
"%-24s : %s\n",
"Main Board PBA", pi->
PbaId[0]);
130 assert(
sizeof(imageStr) >=
sizeof(pi->
AvrId[0]));
131 (void)memcpy(imageStr, pi->
AvrId[0],
sizeof(pi->
AvrId[0]));
133 (void)printf(
"%-24s : %s\n",
"Main Board AVR", imageStr);
134 assert(
sizeof(imageStr) >=
sizeof(pi->
fpgaId1));
137 (void)printf(
"%-24s : %s\n",
"FPGA flash image #0", imageStr);
138 assert(
sizeof(imageStr) >=
sizeof(pi->
fpgaId2));
141 (void)printf(
"%-24s : %s\n",
"FPGA flash image #1", imageStr);
142 (void)printf(
"%-24s : %s\n",
"Front Board Serial No", pi->
SerialNo[1]);
143 (void)printf(
"%-24s : %s\n",
"Front Board PBA", pi->
PbaId[1]);
144 assert(
sizeof(imageStr) >=
sizeof(pi->
AvrId[1]));
145 (void)memcpy(imageStr, pi->
AvrId[1],
sizeof(pi->
AvrId[1]));
147 (void)printf(
"%-24s : %s\n",
"Front Board AVR", imageStr);
149 (void)printf(
"%-24s : %s\n",
"P/N", pi->
ProductId);
150 (void)printf(
"%-24s : %s\n",
"Serial No", pi->
SerialNo[0]);
151 (void)printf(
"%-24s : %s\n",
"PBA", pi->
PbaId[0]);
152 assert(
sizeof(imageStr) >=
sizeof(pi->
AvrId[0]));
153 (void)memcpy(imageStr, pi->
AvrId[0],
sizeof(pi->
AvrId[0]));
155 (void)printf(
"%-24s : %s\n",
"AVR Version", imageStr);
156 assert(
sizeof(imageStr) >=
sizeof(pi->
fpgaId1));
159 (void)printf(
"%-24s : %s\n",
"FPGA flash image #0", imageStr);
160 assert(
sizeof(imageStr) >=
sizeof(pi->
fpgaId2));
163 (void)printf(
"%-24s : %s\n",
"FPGA flash image #1", imageStr);
168 (void)printf(
"%-24s : %s\n",
"P/N", pi->
ProductId);
169 (void)printf(
"%-24s : %s\n",
"Serial No", pi->
SerialNo[0]);
170 (void)printf(
"%-24s : %s\n",
"PBA", pi->
PbaId[0]);
171 (void)printf(
"%-24s : %s\n",
"Firmware id", pi->
AvrId[0]);
175 return NT_ERROR_INTERNAL_ERROR;
190 if ((status =
NT_Init(NTAPI_VERSION)) != NT_SUCCESS) {
193 fprintf(stderr,
"NT_Init() failed: %s\n", errorBuffer);
198 if ((status =
NT_InfoOpen(&hInfoStream,
"ExampleInfo")) != NT_SUCCESS) {
201 fprintf(stderr,
"NT_InfoOpen() failed: %s\n", errorBuffer);
207 if ((status =
NT_InfoRead(hInfoStream, &hInfo)) != NT_SUCCESS) {
210 fprintf(stderr,
"NT_InfoRead() failed: %s\n", errorBuffer);
215 printf(
"The system contains %d adapter(s), %d port(s), and %d NUMA node(s)\n",
221 for (i = 0; i < numAdapters; i++) {
224 if (status != NT_SUCCESS) {
225 if (status == NT_ERROR_VPD_FAILED) {
226 (void)printf(
"Product information does not apply to adapter %u.\n",
231 (void)fprintf(stderr,
"Cannot read product info: %s\n", errorBuffer);
238 if ((status =
NT_InfoRead(hInfoStream, &hInfo)) != NT_SUCCESS) {
241 fprintf(stderr,
"NT_InfoRead() failed: %s\n", errorBuffer);
246 printf(
"\n%-24s : %04X:%04X : %04X:%02X:%02X.%X \n",
257 if ((status =
NT_InfoClose(hInfoStream)) != NT_SUCCESS) {
260 fprintf(stderr,
"NT_InfoClose() failed: %s\n", errorBuffer);