Print this page
NEX-3168 sasinfo does not know about 12gb sas
Reviewed by: Kevin Crowe <kevin.crowe@nexenta.com>
Reviewed by: Josef 'Jeff' Sipek <josef.sipek@nexenta.com>
| Split |
Close |
| Expand all |
| Collapse all |
--- old/usr/src/cmd/sasinfo/printAttrs.c
+++ new/usr/src/cmd/sasinfo/printAttrs.c
1 1 /*
2 2 * CDDL HEADER START
3 3 *
4 4 * The contents of this file are subject to the terms of the
5 5 * Common Development and Distribution License (the "License").
6 6 * You may not use this file except in compliance with the License.
7 7 *
8 8 * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
9 9 * or http://www.opensolaris.org/os/licensing.
10 10 * See the License for the specific language governing permissions
11 11 * and limitations under the License.
12 12 *
13 13 * When distributing Covered Code, include this CDDL HEADER in each
14 14 * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
15 15 * If applicable, add the following below this CDDL HEADER, with the
16 16 * fields enclosed by brackets "[]" replaced with your own identifying
17 17 * information: Portions Copyright [yyyy] [name of copyright owner]
18 18 *
19 19 * CDDL HEADER END
20 20 */
21 21 /*
22 22 * Copyright 2009 Sun Microsystems, Inc. All rights reserved.
23 23 * Use is subject to license terms.
24 24 */
25 25
26 26 #include <ctype.h>
27 27 #include <printAttrs.h>
28 28
29 29 static SAS_STATE hbastatus_string[] = {
30 30 HBA_STATUS_OK, "Okay",
31 31 HBA_STATUS_ERROR, "Error",
32 32 HBA_STATUS_ERROR_NOT_SUPPORTED, "Not Supported",
33 33 HBA_STATUS_ERROR_INVALID_HANDLE, "Invalid Handle",
34 34 HBA_STATUS_ERROR_ARG, "Argument Error",
35 35 HBA_STATUS_ERROR_ILLEGAL_WWN, "Illegal WWN",
36 36 HBA_STATUS_ERROR_ILLEGAL_INDEX, "Illegal Index",
37 37 HBA_STATUS_ERROR_MORE_DATA, "Not Enough Buffer for Data",
38 38 HBA_STATUS_ERROR_STALE_DATA, "Stale Data",
39 39 HBA_STATUS_SCSI_CHECK_CONDITION, "SCSI Check Condition",
40 40 HBA_STATUS_ERROR_BUSY, "Busy",
41 41 HBA_STATUS_ERROR_TRY_AGAIN, "Try Again",
42 42 HBA_STATUS_ERROR_UNAVAILABLE, "Unavailable",
43 43 HBA_STATUS_ERROR_ELS_REJECT, "ELS Reject",
44 44 HBA_STATUS_ERROR_INVALID_LUN, "Invalid LUN",
45 45 HBA_STATUS_ERROR_INCOMPATIBLE, "Request Incompatible",
46 46 HBA_STATUS_ERROR_AMBIGUOUS_WWN, "Ambiguous WWN",
47 47 HBA_STATUS_ERROR_LOCAL_BUS, "Local Bus Error",
48 48 HBA_STATUS_ERROR_LOCAL_TARGET, "Local Target Error",
49 49 HBA_STATUS_ERROR_LOCAL_LUN, "Local LUN Error",
50 50 HBA_STATUS_ERROR_LOCAL_SCSIID_BOUND, "Local SCSIID Bound",
51 51 HBA_STATUS_ERROR_TARGET_FCID, "Target FCID Error",
52 52 HBA_STATUS_ERROR_TARGET_NODE_WWN, "Target Node WWN Error",
53 53 HBA_STATUS_ERROR_TARGET_PORT_WWN, "Target Port WWN Error",
54 54 HBA_STATUS_ERROR_TARGET_LUN, "Target LUN Error",
55 55 HBA_STATUS_ERROR_TARGET_LUID, "Target LUID Error",
56 56 HBA_STATUS_ERROR_NO_SUCH_BINDING, "No Such Binding",
57 57 HBA_STATUS_ERROR_NOT_A_TARGET, "Not a Target",
58 58 HBA_STATUS_ERROR_UNSUPPORTED_FC4, "Unsupported FC4",
59 59 HBA_STATUS_ERROR_INCAPABLE, "Incapable",
60 60 HBA_STATUS_ERROR_TARGET_BUSY, "Target Busy",
61 61 HBA_STATUS_ERROR_NOT_LOADED, "Not Loaded",
62 62 HBA_STATUS_ERROR_ALREADY_LOADED, "Alreday Loaded",
63 63 HBA_STATUS_ERROR_ILLEGAL_FCID, "Illegal FCID",
64 64 HBA_STATUS_ERROR_NOT_ASCSIDEVICE, "Not a SCSI Device",
65 65 HBA_STATUS_ERROR_INVALID_PROTOCOL_TYPE, "Invalid Protocol Type",
66 66 HBA_STATUS_ERROR_BAD_EVENT_TYPE, "Bad Event Type",
67 67 -1, NULL
68 68 };
69 69
70 70 SAS_STATE porttype_string[] = {
71 71 HBA_PORTTYPE_UNKNOWN, "UNKNOWN",
72 72 HBA_PORTTYPE_OTHER, "OTHER",
73 73 HBA_PORTTYPE_NOTPRESENT, "NOT Present",
74 74 HBA_PORTTYPE_SASDEVICE, "SAS Device",
75 75 HBA_PORTTYPE_SATADEVICE, "SATA Device",
76 76 HBA_PORTTYPE_SASEXPANDER, "SAS Expander",
77 77 -1, NULL,
78 78 };
79 79
80 80 SAS_STATE portstate_string[] = {
81 81 HBA_PORTSTATE_UNKNOWN, "unknown",
82 82 HBA_PORTSTATE_ONLINE, "online",
83 83 HBA_PORTSTATE_OFFLINE, "offline",
84 84 HBA_PORTSTATE_BYPASSED, "bypassed",
85 85 HBA_PORTSTATE_DIAGNOSTICS, "diagnostics",
86 86 HBA_PORTSTATE_LINKDOWN, "link Down",
87 87 HBA_PORTSTATE_ERROR, "port Error",
88 88 HBA_PORTSTATE_LOOPBACK, "loopback",
89 89 HBA_PORTSTATE_DEGRADED, "degraded",
90 90 -1, NULL,
91 91 };
|
↓ open down ↓ |
91 lines elided |
↑ open up ↑ |
92 92
93 93 static SAS_STATE phystate_string[] = {
94 94 HBA_SASSTATE_UNKNOWN, "unknown",
95 95 HBA_SASSTATE_DISABLED, "disabled",
96 96 HBA_SASSTATE_FAILED, "failed",
97 97 HBA_SASSTATE_SATASPINUP, "sata-spinup",
98 98 HBA_SASSTATE_SATAPORTSEL, "sata-portselector",
99 99 HBA_SASSPEED_1_5GBIT, "1.5Gbit",
100 100 HBA_SASSPEED_3GBIT, "3Gbit",
101 101 HBA_SASSPEED_6GBIT, "6Gbit",
102 + HBA_SASSPEED_12GBIT, "12Gbit",
102 103 -1, NULL,
103 104 };
104 105
105 106 static SAS_STATE dtype_string[] = {
106 107 DTYPE_DIRECT, "Disk Device",
107 108 DTYPE_SEQUENTIAL, "Tape Device",
108 109 DTYPE_PRINTER, "Printer Device",
109 110 DTYPE_PROCESSOR, "Processor Device",
110 111 DTYPE_WORM, "WORM Device",
111 112 DTYPE_RODIRECT, "CD/DVD Device",
112 113 DTYPE_SCANNER, "Scanner Device",
113 114 DTYPE_OPTICAL, "Optical Memory Device",
114 115 DTYPE_CHANGER, "Medium Changer Device",
115 116 DTYPE_COMM, "Communications Device",
116 117 DTYPE_ARRAY_CTRL, "Storage Array Controller Device",
117 118 DTYPE_ESI, "Enclosure Services Device",
118 119 DTYPE_RBC, "Simplified Direct-access Device",
119 120 DTYPE_OCRW, "Optical Card Reader/Writer Device",
120 121 DTYPE_BCC, "Bridge Controller Commands",
121 122 DTYPE_OSD, "Object-based Storage Device",
122 123 DTYPE_ADC, "Automation/Drive Interface",
123 124 DTYPE_WELLKNOWN, "Well Known Logical Unit",
124 125 DTYPE_UNKNOWN, "Unknown Device",
125 126 -1, NULL
126 127 };
127 128
128 129 static char *getPhyStateString(HBA_UINT32 key, phystat_type phyt);
129 130
130 131 char *
131 132 getIndentSpaces(int number)
132 133 {
133 134 int i = 0;
134 135 /* the maximum indent with terminator '\0' */
135 136 static char ret[MAXINDENT+1];
136 137
137 138 if (number > MAXINDENT)
138 139 number = MAXINDENT;
139 140
140 141 for (i = 0; i < number; i++) {
141 142 ret[i] = ' ';
142 143 }
143 144 ret[i] = '\0';
144 145 return (ret);
145 146 }
146 147
147 148 char *
148 149 getStateString(HBA_UINT32 key, SAS_STATE *stat_string)
149 150 {
150 151 static char ret[64];
151 152 while (stat_string->key != -1) {
152 153 if (stat_string->key == key) {
153 154 return ((char *)stat_string->value);
154 155 }
155 156 stat_string++;
156 157 }
157 158 (void *) sprintf(ret, "Undefined value (%d)", key);
|
↓ open down ↓ |
46 lines elided |
↑ open up ↑ |
158 159 return (ret);
159 160 }
160 161
161 162 static char *
162 163 getPhyStateString(HBA_UINT32 key, phystat_type phyt)
163 164 {
164 165 int i = 0, len = 0, match = 0;
165 166 HBA_UINT32 physpeed[] = {
166 167 HBA_SASSPEED_1_5GBIT,
167 168 HBA_SASSPEED_3GBIT,
168 - HBA_SASSPEED_6GBIT
169 + HBA_SASSPEED_6GBIT,
170 + HBA_SASSPEED_12GBIT
169 171 };
170 172
171 173 len = sizeof (physpeed) / sizeof (HBA_UINT32);
172 174 for (i = 0; i < len; i++) {
173 175 if (key == physpeed[i]) {
174 176 match = 1;
175 177 break;
176 178 }
177 179 }
178 180
179 181 if (match == 1) {
180 182 if (phyt == PHY_STATE)
181 183 return ("enabled");
182 184 else
183 185 return (getStateString(key, phystate_string));
184 186 } else {
185 187 if (phyt == PHY_STATE)
186 188 return (getStateString(key, phystate_string));
187 189 else
188 190 return ("not available");
189 191 }
190 192 }
191 193
192 194 char *
193 195 getHBAStatus(HBA_STATUS key)
194 196 {
195 197 return (getStateString(key, hbastatus_string));
196 198 }
197 199
198 200 /*
199 201 * return device type description
200 202 *
201 203 * Arguments:
202 204 * dType - Device type returned from Standard INQUIRY
203 205 * Returns:
204 206 * char string description for device type
205 207 */
206 208 char *
207 209 getDTypeString(uchar_t dType)
208 210 {
209 211 return (getStateString((dType & DTYPE_MASK), dtype_string));
210 212 }
211 213
212 214 uint64_t
213 215 wwnConversion(uchar_t *wwn)
214 216 {
215 217 uint64_t tmp;
216 218 (void *) memcpy(&tmp, wwn, sizeof (uint64_t));
217 219 return (ntohll(tmp));
218 220 }
219 221
220 222 /*
221 223 * prints out HBA information
222 224 */
223 225 void
224 226 printHBAInfo(SMHBA_ADAPTERATTRIBUTES *attrs, int pflag, int numberOfPorts,
225 227 const char *adapterName)
226 228 {
227 229
228 230 (void *) fprintf(stdout, "%s %s\n", "HBA Name:", adapterName);
229 231
230 232 if (pflag & PRINT_VERBOSE) {
231 233 (void *) fprintf(stdout, "%s%s %s\n",
232 234 getIndentSpaces(4), "Manufacturer:",
233 235 attrs->Manufacturer[0] == 0?
234 236 "not available":attrs->Manufacturer);
235 237 (void *) fprintf(stdout, "%s%s %s\n",
236 238 getIndentSpaces(4), "Model: ",
237 239 attrs->Model[0] == 0? "not available":attrs->Model);
238 240 (void *) fprintf(stdout, "%s%s %s\n",
239 241 getIndentSpaces(4),
240 242 "Firmware Version:",
241 243 attrs->FirmwareVersion[0] == 0? "not available":
242 244 attrs->FirmwareVersion);
243 245 (void *) fprintf(stdout, "%s%s %s\n",
244 246 getIndentSpaces(4),
245 247 "FCode/BIOS Version:",
246 248 attrs->OptionROMVersion[0] == 0? "not available":
247 249 attrs->OptionROMVersion);
248 250 (void *) fprintf(stdout, "%s%s %s\n",
249 251 getIndentSpaces(4),
250 252 "Serial Number:",
251 253 attrs->SerialNumber[0] == 0? "not available":
252 254 attrs->SerialNumber);
253 255 (void *) fprintf(stdout, "%s%s %s\n",
254 256 getIndentSpaces(4),
255 257 "Driver Name:",
256 258 attrs->DriverName[0] == 0? "not available":
257 259 attrs->DriverName);
258 260 (void *) fprintf(stdout, "%s%s %s\n",
259 261 getIndentSpaces(4),
260 262 "Driver Version:",
261 263 attrs->DriverVersion[0] == 0? "not available":
262 264 attrs->DriverVersion);
263 265 (void *) fprintf(stdout, "%s%s %d\n",
264 266 getIndentSpaces(4),
265 267 "Number of HBA Ports:",
266 268 numberOfPorts);
267 269 }
268 270 }
269 271
270 272 /*
271 273 * prints out all the HBA port information
272 274 */
273 275 void
274 276 printHBAPortInfo(SMHBA_PORTATTRIBUTES *port,
275 277 SMHBA_ADAPTERATTRIBUTES *attrs, int pflag) {
276 278
277 279 if ((port == NULL) || (attrs == NULL)) {
278 280 return;
279 281 }
280 282
281 283 (void *) fprintf(stdout, "%s%s %s\n",
282 284 getIndentSpaces(2),
283 285 "HBA Port Name:",
284 286 port->OSDeviceName);
285 287
286 288 if (!(pflag & PRINT_VERBOSE)) {
287 289 return;
288 290 }
289 291
290 292 if (port->PortType != HBA_PORTTYPE_SASDEVICE)
291 293 return;
292 294
293 295 (void *) fprintf(stdout, "%s%s %s\n",
294 296 getIndentSpaces(4),
295 297 "Type:",
296 298 getStateString(port->PortType, porttype_string));
297 299 (void *) fprintf(stdout, "%s%s %s\n",
298 300 getIndentSpaces(4),
299 301 "State:",
300 302 getStateString(port->PortState, portstate_string));
301 303
302 304 (void *) fprintf(stdout, "%s%s %016llx\n",
303 305 getIndentSpaces(4),
304 306 "Local SAS Address:",
305 307 wwnConversion(port->PortSpecificAttribute.SASPort->\
306 308 LocalSASAddress.wwn));
307 309
308 310 (void *) fprintf(stdout, "%s%s %016llx\n",
309 311 getIndentSpaces(4),
310 312 "Attached SAS Address:",
311 313 wwnConversion(port->PortSpecificAttribute.SASPort->\
312 314 AttachedSASAddress.wwn));
313 315
314 316 (void *) fprintf(stdout, "%s%s %d\n",
315 317 getIndentSpaces(4),
316 318 "Number of Phys:",
317 319 port->PortSpecificAttribute.SASPort->NumberofPhys);
318 320 }
319 321
320 322 void
321 323 printHBAPortPhyInfo(SMHBA_SAS_PHY *phyinfo)
322 324 {
323 325 if (phyinfo == NULL)
324 326 return;
325 327
326 328 (void *) fprintf(stdout, "%s%s %u\n",
327 329 getIndentSpaces(6),
328 330 "Identifier:",
329 331 phyinfo->PhyIdentifier);
330 332
331 333 (void *) fprintf(stdout, "%s%s %s\n",
332 334 getIndentSpaces(8),
333 335 "State: ",
334 336 getPhyStateString(phyinfo->NegotiatedLinkRate, PHY_STATE));
335 337 (void *) fprintf(stdout, "%s%s %s/%s\n",
336 338 getIndentSpaces(8),
337 339 "HardwareLinkRate(Min/Max):",
338 340 getPhyStateString(phyinfo->HardwareMinLinkRate, PHY_SPEED),
339 341 getPhyStateString(phyinfo->HardwareMaxLinkRate, PHY_SPEED));
340 342 (void *) fprintf(stdout, "%s%s %s/%s\n",
341 343 getIndentSpaces(8),
342 344 "ProgrammedLinkRate(Min/Max):",
343 345 getPhyStateString(phyinfo->ProgrammedMinLinkRate, PHY_SPEED),
344 346 getPhyStateString(phyinfo->ProgrammedMaxLinkRate, PHY_SPEED));
345 347 (void *) fprintf(stdout, "%s%s %s\n",
346 348 getIndentSpaces(8),
347 349 "NegotiatedLinkRate:",
348 350 getPhyStateString(phyinfo->NegotiatedLinkRate, PHY_SPEED));
349 351 }
350 352
351 353 void
352 354 printHBAPortPhyStatistics(SMHBA_SASPHYSTATISTICS *phystat)
353 355 {
354 356 if (phystat == NULL)
355 357 return;
356 358
357 359 (void *) fprintf(stdout, "%s%s\n",
358 360 getIndentSpaces(8),
359 361 "Link Error Statistics:");
360 362 (void *) fprintf(stdout, "%s%s %llu\n",
361 363 getIndentSpaces(12),
362 364 "Invalid Dword:",
363 365 phystat->InvalidDwordCount);
364 366 (void *) fprintf(stdout, "%s%s %llu\n",
365 367 getIndentSpaces(12),
366 368 "Running Disparity Error:",
367 369 phystat->RunningDisparityErrorCount);
368 370 (void *) fprintf(stdout, "%s%s %llu\n",
369 371 getIndentSpaces(12),
370 372 "Loss of Dword Sync:",
371 373 phystat->LossofDwordSyncCount);
372 374 (void *) fprintf(stdout, "%s%s %llu\n",
373 375 getIndentSpaces(12),
374 376 "Reset Problem:",
375 377 phystat->PhyResetProblemCount);
376 378 }
377 379
378 380 /*
379 381 * print the OS device name for the logical-unit object
380 382 *
381 383 * Arguments:
382 384 * devListWalk - OS device path info
383 385 * verbose - boolean indicating whether to display additional info
384 386 *
385 387 * returns:
386 388 * 0 - we're good.
387 389 * >0 - we met issues.
388 390 */
389 391 int
390 392 printTargetPortInfo(targetPortList_t *TPListWalk, int pflag)
391 393 {
392 394 targetPortConfig_t *configList;
393 395 targetPortMappingData_t *mapList;
394 396 int count, i;
395 397 int ret = 0;
396 398
397 399 (void *) fprintf(stdout, "Target Port SAS Address: %016llx\n",
398 400 wwnConversion(TPListWalk->sasattr.LocalSASAddress.wwn));
399 401 if ((pflag & PRINT_VERBOSE) || (pflag & PRINT_TARGET_SCSI)) {
400 402 (void *) fprintf(stdout, "%sType: %s\n", getIndentSpaces(4),
401 403 getStateString(TPListWalk->targetattr.PortType,
402 404 porttype_string));
403 405 for (configList = TPListWalk->configEntry;
404 406 configList != NULL; configList = configList->next) {
405 407 (void *) fprintf(stdout, "%sHBA Port Name: %s\n",
406 408 getIndentSpaces(4), configList->hbaPortName);
407 409 if (wwnConversion(configList->expanderSASAddr.wwn) !=
408 410 0) {
409 411 if (configList->expanderValid) {
410 412 (void *) fprintf(stdout,
411 413 "%sExpander Device SAS Address:"
412 414 " %016llx",
413 415 getIndentSpaces(8),
414 416 wwnConversion(configList->
415 417 expanderSASAddr.wwn));
416 418 } else {
417 419 (void *) fprintf(stdout,
418 420 "%sExpander Device SAS Address:"
419 421 " %016llx (Failed to Validate"
420 422 " Attached Port.)",
421 423 getIndentSpaces(8),
422 424 wwnConversion(configList->
423 425 expanderSASAddr.wwn));
424 426 ret++;
425 427 }
426 428 } else {
427 429 if (configList->expanderValid) {
428 430 (void *) fprintf(stdout,
429 431 "%sExpander Device SAS Address: %s",
430 432 getIndentSpaces(8),
431 433 "None (direct attached)");
432 434 } else {
433 435 (void *) fprintf(stdout,
434 436 "%sExpander Device SAS Address: %s",
435 437 getIndentSpaces(8),
436 438 "None (Failed to Get"
437 439 " Attached Port)");
438 440 }
439 441 }
440 442 (void *) fprintf(stdout, "\n");
441 443 if (pflag & PRINT_TARGET_SCSI) {
442 444
443 445 if (configList->reportLUNsFailed) {
444 446 (void *) fprintf(stdout,
445 447 "%s %016llx\n",
446 448 gettext("Error: Failed to get "
447 449 "ReportLun Data on"),
448 450 wwnConversion(TPListWalk->
449 451 sasattr.LocalSASAddress.wwn));
450 452 ret++;
451 453 continue;
452 454 }
453 455
454 456 for (mapList = configList->map;
455 457 mapList != NULL; mapList = mapList->next) {
456 458 (void *) fprintf(stdout, "%sLUN : %d\n",
457 459 getIndentSpaces(12),
458 460 mapList->osLUN);
459 461 if (mapList->mappingExist) {
460 462 (void *) fprintf(stdout,
461 463 "%sOS Device Name : %s\n",
462 464 getIndentSpaces(14),
463 465 (mapList->osDeviceName[0] ==
464 466 '\0') ? "Not avaialble" :
465 467 mapList->osDeviceName);
466 468 } else {
467 469 (void *) fprintf(stdout,
468 470 "%sOS Device Name : %s\n",
469 471 getIndentSpaces(14), "No "
470 472 "matching OS Device "
471 473 "found.");
472 474 ret++;
473 475 }
474 476 /* indentation changed here */
475 477 if (mapList->inquiryFailed) {
476 478 (void *) fprintf(stdout, "%s %s LUN %d\n",
477 479 gettext("Error: Failed to get Inquiry Data on"),
478 480 mapList->osDeviceName, mapList->osLUN);
479 481 ret++;
480 482 } else {
481 483 (void *) fprintf(stdout, "%sVendor: ",
482 484 getIndentSpaces(14));
483 485 for (count = sizeof (mapList->inq_vid), i = 0;
484 486 i < count; i++) {
485 487 if (isprint(mapList->inq_vid[i]))
486 488 (void *) fprintf(stdout, "%c",
487 489 mapList->inq_vid[i]);
488 490 }
489 491
490 492 (void *) fprintf(stdout, "\n%sProduct: ",
491 493 getIndentSpaces(14));
492 494 for (count = sizeof (mapList->inq_pid), i = 0;
493 495 i < count; i++) {
494 496 if (isprint(mapList->inq_pid[i]))
495 497 (void *) fprintf(stdout, "%c",
496 498 mapList->inq_pid[i]);
497 499 }
498 500
499 501 (void *) fprintf(stdout, "\n%sDevice Type: %s\n",
500 502 getIndentSpaces(14),
501 503 getDTypeString(mapList->inq_dtype));
502 504 }
503 505 /* indentation changed back */
504 506 }
505 507 }
506 508 }
507 509 }
508 510 return (ret);
509 511 }
510 512
511 513 /*
512 514 * print the OS device name for the logical-unit object
513 515 *
514 516 * Arguments:
515 517 * devListWalk - OS device path info
516 518 * verbose - boolean indicating whether to display additional info
517 519 *
518 520 * returns:
519 521 * 0 - we're good.
520 522 * >0 - we met issues.
521 523 */
522 524 int
523 525 printOSDeviceNameInfo(discoveredDevice *devListWalk, boolean_t verbose)
524 526 {
525 527 portList *portElem;
526 528 tgtPortWWNList *tgtWWNList;
527 529 int i, count;
528 530 int ret = 0;
529 531
530 532 (void *) fprintf(stdout, "OS Device Name: %s\n",
531 533 devListWalk->OSDeviceName);
532 534 if (verbose == B_TRUE) {
533 535 for (portElem = devListWalk->HBAPortList;
534 536 portElem != NULL; portElem = portElem->next) {
535 537 (void *) fprintf(stdout, "%sHBA Port Name: ",
536 538 getIndentSpaces(4));
537 539 (void *) fprintf(stdout, "%s", portElem->portName);
538 540 for (tgtWWNList = portElem->tgtPortWWN;
539 541 tgtWWNList != NULL; tgtWWNList = tgtWWNList->next) {
540 542 (void *) fprintf(stdout,
541 543 "\n%sTarget Port SAS Address: ",
542 544 getIndentSpaces(8));
543 545 (void *) fprintf(stdout, "%016llx",
544 546 wwnConversion(tgtWWNList->portWWN.wwn));
545 547 (void *) fprintf(stdout, "\n%sLUN: %u",
546 548 getIndentSpaces(12),
547 549 tgtWWNList->scsiOSLun);
548 550 }
549 551 (void *) fprintf(stdout, "\n");
550 552 }
551 553
552 554 if (devListWalk->inquiryFailed) {
553 555 (void *) fprintf(stdout, "%s %s\n",
554 556 gettext("Error: Failed to get Inquiry data "
555 557 "on device"), devListWalk->OSDeviceName);
556 558 ret++;
557 559 } else {
558 560 (void *) fprintf(stdout, "%sVendor: ",
559 561 getIndentSpaces(4));
560 562 for (count = sizeof (devListWalk->VID), i = 0;
561 563 i < count; i++) {
562 564 if (isprint(devListWalk->VID[i]))
563 565 (void *) fprintf(stdout, "%c",
564 566 devListWalk->VID[i]);
565 567 }
566 568
567 569 (void *) fprintf(stdout, "\n%sProduct: ",
568 570 getIndentSpaces(4));
569 571 for (count = sizeof (devListWalk->PID), i = 0;
570 572 i < count; i++) {
571 573 if (isprint(devListWalk->PID[i]))
572 574 (void *) fprintf(stdout, "%c",
573 575 devListWalk->PID[i]);
574 576 }
575 577
576 578 (void *) fprintf(stdout, "\n%sDevice Type: %s\n",
577 579 getIndentSpaces(4),
578 580 getDTypeString(devListWalk->dType));
579 581 }
580 582 }
581 583 return (ret);
582 584 }
|
↓ open down ↓ |
404 lines elided |
↑ open up ↑ |
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX