fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte/*
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * CDDL HEADER START
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte *
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * The contents of this file are subject to the terms of the
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * Common Development and Distribution License (the "License").
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * You may not use this file except in compliance with the License.
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte *
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * or http://www.opensolaris.org/os/licensing.
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * See the License for the specific language governing permissions
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * and limitations under the License.
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte *
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * When distributing Covered Code, include this CDDL HEADER in each
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * If applicable, add the following below this CDDL HEADER, with the
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * fields enclosed by brackets "[]" replaced with your own identifying
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * information: Portions Copyright [yyyy] [name of copyright owner]
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte *
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * CDDL HEADER END
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte/*
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * Copyright 2008 Sun Microsystems, Inc. All rights reserved.
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * Use is subject to license terms.
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte#include <stdio.h>
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte#include <hbaapi.h>
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte#include <string.h>
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte#include <sys/types.h>
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte#include <netinet/in.h>
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte#include <inttypes.h>
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte#include <ctype.h>
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte#include "fcinfo.h"
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte#ifdef _BIG_ENDIAN
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte#define htonll(x) (x)
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte#define ntohll(x) (x)
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte#else
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte#define htonll(x) ((((unsigned long long)htonl(x)) << 32) + htonl(x >> 32))
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte#define ntohll(x) ((((unsigned long long)ntohl(x)) << 32) + ntohl(x >> 32))
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte#endif
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte/* Fc4 Types Format */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte#define FC4_TYPE_WORD_POS(x) ((uint_t)((uint_t)(x) >> 5))
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte#define FC4_TYPE_BIT_POS(x) ((uchar_t)(x) & 0x1F)
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte#define TYPE_IP_FC 0x05
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte#define TYPE_SCSI_FCP 0x08
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Fortestatic int fc4_map_is_set(uint32_t *map, uchar_t ulp_type);
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Fortestatic char *getPortType(HBA_PORTTYPE portType);
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Fortestatic char *getPortState(HBA_PORTSTATE portState);
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Fortestatic void printPortSpeed(HBA_PORTSPEED portSpeed);
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Fortestatic char *getDTypeString(uchar_t dType);
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forteuint64_t wwnConversion(uchar_t *wwn) {
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte uint64_t tmp;
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte memcpy(&tmp, wwn, sizeof (uint64_t));
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte return (ntohll(tmp));
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte}
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Fortestatic char *
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn FortegetPortType(HBA_PORTTYPE portType) {
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte switch (portType) {
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte case HBA_PORTTYPE_UNKNOWN:
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte return ("unknown");
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte case HBA_PORTTYPE_OTHER:
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte return ("other");
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte case HBA_PORTTYPE_NOTPRESENT:
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte return ("not present");
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte case HBA_PORTTYPE_NPORT:
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte return ("N-port");
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte case HBA_PORTTYPE_NLPORT:
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte return ("NL-port");
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte case HBA_PORTTYPE_FLPORT:
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte return ("FL-port");
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte case HBA_PORTTYPE_FPORT:
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte return ("F-port");
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte case HBA_PORTTYPE_LPORT:
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte return ("L-port");
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte case HBA_PORTTYPE_PTP:
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte return ("point-to-point");
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte default:
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte return ("unrecognized type");
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte }
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte}
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Fortestatic char *
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn FortegetPortState(HBA_PORTSTATE portState) {
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte switch (portState) {
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte case HBA_PORTSTATE_UNKNOWN:
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte return ("unknown");
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte case HBA_PORTSTATE_ONLINE:
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte return ("online");
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte case HBA_PORTSTATE_OFFLINE:
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte return ("offline");
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte case HBA_PORTSTATE_BYPASSED:
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte return ("bypassed");
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte case HBA_PORTSTATE_DIAGNOSTICS:
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte return ("diagnostics");
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte case HBA_PORTSTATE_LINKDOWN:
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte return ("link down");
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte case HBA_PORTSTATE_ERROR:
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte return ("error");
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte case HBA_PORTSTATE_LOOPBACK:
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte return ("loopback");
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte default:
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte return ("unrecognized state");
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte }
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte}
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Fortestatic void
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn ForteprintPortSpeed(HBA_PORTSPEED portSpeed) {
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte int foundSpeed = 0;
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte if ((portSpeed & HBA_PORTSPEED_1GBIT) == HBA_PORTSPEED_1GBIT) {
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte fprintf(stdout, "1Gb ");
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte foundSpeed = 1;
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte }
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte if ((portSpeed & HBA_PORTSPEED_2GBIT) == HBA_PORTSPEED_2GBIT) {
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte fprintf(stdout, "2Gb ");
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte foundSpeed = 1;
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte }
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte if ((portSpeed & HBA_PORTSPEED_4GBIT) == HBA_PORTSPEED_4GBIT) {
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte fprintf(stdout, "4Gb ");
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte foundSpeed = 1;
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte }
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte if ((portSpeed & HBA_PORTSPEED_8GBIT) == HBA_PORTSPEED_8GBIT) {
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte fprintf(stdout, "8Gb ");
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte foundSpeed = 1;
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte }
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte if ((portSpeed & HBA_PORTSPEED_10GBIT) == HBA_PORTSPEED_10GBIT) {
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte fprintf(stdout, "10Gb ");
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte foundSpeed = 1;
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte }
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte if ((portSpeed & HBA_PORTSPEED_16GBIT) == HBA_PORTSPEED_16GBIT) {
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte fprintf(stdout, "16Gb ");
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte foundSpeed = 1;
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte }
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte if ((portSpeed & HBA_PORTSPEED_NOT_NEGOTIATED)
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte == HBA_PORTSPEED_NOT_NEGOTIATED) {
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte fprintf(stdout, "not established ");
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte foundSpeed = 1;
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte }
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte if (foundSpeed == 0) {
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte fprintf(stdout, "not established ");
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte }
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte}
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Fortevoid
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn ForteprintDiscoPortInfo(HBA_PORTATTRIBUTES *discoPort, int scsiTargetType) {
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte int fc4_types = 0;
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte fprintf(stdout, gettext("Remote Port WWN: %016llx\n"),
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte wwnConversion(discoPort->PortWWN.wwn));
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte fprintf(stdout, gettext("\tActive FC4 Types: "));
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte if (fc4_map_is_set(
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte (uint32_t *)discoPort->PortActiveFc4Types.bits,
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte TYPE_SCSI_FCP)) {
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte fprintf(stdout, gettext("SCSI"));
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte fc4_types++;
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte }
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte if (fc4_map_is_set(
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte (uint32_t *)discoPort->PortActiveFc4Types.bits,
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte TYPE_IP_FC)) {
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte if (fc4_types != 0) {
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte fprintf(stdout, ",");
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte }
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte fprintf(stdout, gettext("IP"));
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte fc4_types++;
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte }
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte fprintf(stdout, "\n");
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte /* print out scsi target type information */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte fprintf(stdout, gettext("\tSCSI Target: "));
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte if (scsiTargetType == SCSI_TARGET_TYPE_YES) {
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte fprintf(stdout, gettext("yes\n"));
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte } else if (scsiTargetType == SCSI_TARGET_TYPE_NO) {
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte fprintf(stdout, gettext("no\n"));
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte } else {
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte fprintf(stdout, gettext("unknown\n"));
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte }
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte fprintf(stdout, gettext("\tPort Symbolic Name: %s\n"),
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte discoPort->PortSymbolicName);
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte fprintf(stdout, gettext("\tNode WWN: %016llx\n"),
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte wwnConversion(discoPort->NodeWWN.wwn));
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte}
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte/*
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * scan the bitmap array for the specifed ULP type. The bit map array
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * is 32 bytes long
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Fortestatic int
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Fortefc4_map_is_set(uint32_t *map, uchar_t ulp_type)
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte{
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte map += FC4_TYPE_WORD_POS(ulp_type) * 4;
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte if (ntohl((*(uint32_t *)map)) & (1 << FC4_TYPE_BIT_POS(ulp_type))) {
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte return (1);
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte }
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte return (0);
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte}
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte/*
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * prints out all the HBA port information
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Fortevoid
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn ForteprintHBAPortInfo(HBA_PORTATTRIBUTES *port,
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte HBA_ADAPTERATTRIBUTES *attrs, int mode) {
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte if (attrs == NULL || port == NULL) {
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte return;
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte }
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte fprintf(stdout, gettext("HBA Port WWN: %016llx\n"),
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte wwnConversion(port->PortWWN.wwn));
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte fprintf(stdout, gettext("\tPort Mode: %s\n"),
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte (mode == INITIATOR_MODE) ? "Initiator" : "Target");
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte fprintf(stdout, gettext("\tPort ID: %x\n"),
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte port->PortFcId);
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte fprintf(stdout, gettext("\tOS Device Name: %s\n"), port->OSDeviceName);
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte fprintf(stdout, gettext("\tManufacturer: %s\n"),
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte attrs->Manufacturer);
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte fprintf(stdout, gettext("\tModel: %s\n"), attrs->Model);
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte fprintf(stdout, gettext("\tFirmware Version: %s\n"),
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte attrs->FirmwareVersion);
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte fprintf(stdout, gettext("\tFCode/BIOS Version: %s\n"),
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte attrs->OptionROMVersion);
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte fprintf(stdout, gettext("\tSerial Number: %s\n"),
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte attrs->SerialNumber[0] == 0? "not available":attrs->SerialNumber);
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte fprintf(stdout, gettext("\tDriver Name: %s\n"),
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte attrs->DriverName[0] == 0? "not available":attrs->DriverName);
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte fprintf(stdout, gettext("\tDriver Version: %s\n"),
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte attrs->DriverVersion[0] == 0? "not available":attrs->DriverVersion);
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte fprintf(stdout, gettext("\tType: %s\n"),
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte getPortType(port->PortType));
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte fprintf(stdout, gettext("\tState: %s\n"),
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte getPortState(port->PortState));
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte fprintf(stdout, gettext("\tSupported Speeds: "));
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte printPortSpeed(port->PortSupportedSpeed);
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte fprintf(stdout, "\n");
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte fprintf(stdout, gettext("\tCurrent Speed: "));
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte printPortSpeed(port->PortSpeed);
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte fprintf(stdout, "\n");
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte fprintf(stdout, gettext("\tNode WWN: %016llx\n"),
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte wwnConversion(port->NodeWWN.wwn));
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte}
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Fortevoid
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn ForteprintStatus(HBA_STATUS status) {
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte switch (status) {
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte case HBA_STATUS_OK:
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte fprintf(stderr, gettext("OK"));
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte return;
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte case HBA_STATUS_ERROR:
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte fprintf(stderr, gettext("ERROR"));
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte return;
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte case HBA_STATUS_ERROR_NOT_SUPPORTED:
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte fprintf(stderr, gettext("NOT SUPPORTED"));
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte return;
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte case HBA_STATUS_ERROR_INVALID_HANDLE:
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte fprintf(stderr, gettext("INVALID HANDLE"));
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte return;
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte case HBA_STATUS_ERROR_ARG:
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte fprintf(stderr, gettext("ERROR ARG"));
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte return;
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte case HBA_STATUS_ERROR_ILLEGAL_WWN:
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte fprintf(stderr, gettext("ILLEGAL WWN"));
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte return;
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte case HBA_STATUS_ERROR_ILLEGAL_INDEX:
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte fprintf(stderr, gettext("ILLEGAL INDEX"));
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte return;
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte case HBA_STATUS_ERROR_MORE_DATA:
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte fprintf(stderr, gettext("MORE DATA"));
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte return;
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte case HBA_STATUS_ERROR_STALE_DATA:
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte fprintf(stderr, gettext("STALE DATA"));
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte return;
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte case HBA_STATUS_SCSI_CHECK_CONDITION:
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte fprintf(stderr, gettext("SCSI CHECK CONDITION"));
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte return;
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte case HBA_STATUS_ERROR_BUSY:
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte fprintf(stderr, gettext("BUSY"));
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte return;
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte case HBA_STATUS_ERROR_TRY_AGAIN:
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte fprintf(stderr, gettext("TRY AGAIN"));
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte return;
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte case HBA_STATUS_ERROR_UNAVAILABLE:
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte fprintf(stderr, gettext("UNAVAILABLE"));
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte return;
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte default:
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte fprintf(stderr, "%s %d",
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte gettext("Undefined error code "), status);
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte return;
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte }
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte}
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Fortevoid
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn ForteprintLUNInfo(struct scsi_inquiry *inq, HBA_UINT32 scsiLUN, char *devpath) {
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte fprintf(stdout, "\tLUN: %d\n", scsiLUN);
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte fprintf(stdout, "\t Vendor: %c%c%c%c%c%c%c%c\n",
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte inq->inq_vid[0],
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte inq->inq_vid[1],
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte inq->inq_vid[2],
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte inq->inq_vid[3],
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte inq->inq_vid[4],
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte inq->inq_vid[5],
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte inq->inq_vid[6],
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte inq->inq_vid[7]);
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte fprintf(stdout, "\t Product: %c%c%c%c%c%c%c%c%c%c%c%c%c%c%c%c\n",
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte inq->inq_pid[0],
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte inq->inq_pid[1],
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte inq->inq_pid[2],
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte inq->inq_pid[3],
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte inq->inq_pid[4],
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte inq->inq_pid[5],
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte inq->inq_pid[6],
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte inq->inq_pid[7],
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte inq->inq_pid[8],
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte inq->inq_pid[9],
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte inq->inq_pid[10],
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte inq->inq_pid[11],
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte inq->inq_pid[12],
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte inq->inq_pid[13],
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte inq->inq_pid[14],
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte inq->inq_pid[15]);
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte fprintf(stdout, gettext("\t OS Device Name: %s\n"), devpath);
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte}
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Fortevoid
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn ForteprintPortStat(fc_rls_acc_t *rls_payload) {
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte fprintf(stdout, gettext("\tLink Error Statistics:\n"));
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte fprintf(stdout, gettext("\t\tLink Failure Count: %u\n"),
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte rls_payload->rls_link_fail);
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte fprintf(stdout, gettext("\t\tLoss of Sync Count: %u\n"),
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte rls_payload->rls_sync_loss);
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte fprintf(stdout, gettext("\t\tLoss of Signal Count: %u\n"),
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte rls_payload->rls_sig_loss);
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte fprintf(stdout, gettext("\t\tPrimitive Seq Protocol Error Count: %u\n"),
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte rls_payload->rls_prim_seq_err);
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte fprintf(stdout, gettext("\t\tInvalid Tx Word Count: %u\n"),
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte rls_payload->rls_invalid_word);
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte fprintf(stdout, gettext("\t\tInvalid CRC Count: %u\n"),
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte rls_payload->rls_invalid_crc);
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte}
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte/*
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * return device type description
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte *
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * Arguments:
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * dType - Device type returned from Standard INQUIRY
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * Returns:
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * char string description for device type
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Fortestatic char *
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn FortegetDTypeString(uchar_t dType)
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte{
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte switch (dType & DTYPE_MASK) {
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte case DTYPE_DIRECT:
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte return ("Disk Device");
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte case DTYPE_SEQUENTIAL:
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte return ("Tape Device");
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte case DTYPE_PRINTER:
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte return ("Printer Device");
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte case DTYPE_PROCESSOR:
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte return ("Processor Device");
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte case DTYPE_WORM:
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte return ("WORM Device");
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte case DTYPE_RODIRECT:
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte return ("CD/DVD Device");
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte case DTYPE_SCANNER:
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte return ("Scanner Device");
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte case DTYPE_OPTICAL:
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte return ("Optical Memory Device");
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte case DTYPE_CHANGER:
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte return ("Medium Changer Device");
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte case DTYPE_COMM:
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte return ("Communications Device");
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte case DTYPE_ARRAY_CTRL:
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte return ("Storage Array Controller Device");
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte case DTYPE_ESI:
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte return ("Enclosure Services Device");
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte case DTYPE_RBC:
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte return ("Simplified Direct-access Device");
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte case DTYPE_OCRW:
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte return ("Optical Card Reader/Writer Device");
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte case DTYPE_BCC:
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte return ("Bridge Controller Commands");
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte case DTYPE_OSD:
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte return ("Object-based Storage Device");
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte case DTYPE_ADC:
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte return ("Automation/Drive Interface");
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte case DTYPE_WELLKNOWN:
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte return ("Well Known Logical Unit");
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte case DTYPE_UNKNOWN:
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte return ("Unknown Device");
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte default:
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte return ("Undefined");
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte }
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte}
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte/*
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * print the OS device name for the logical-unit object
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte *
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * Arguments:
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * devListWalk - OS device path info
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * verbose - boolean indicating whether to display additional info
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte *
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * returns:
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * none
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Fortevoid
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn ForteprintOSDeviceNameInfo(discoveredDevice *devListWalk, boolean_t verbose)
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte{
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte portWWNList *WWNList;
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte tgtPortWWNList *tgtWWNList;
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte int i, count;
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte fprintf(stdout, "OS Device Name: %s\n", devListWalk->OSDeviceName);
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte if (verbose == B_TRUE) {
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte for (WWNList = devListWalk->HBAPortWWN;
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte WWNList != NULL; WWNList = WWNList->next) {
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte fprintf(stdout, "\tHBA Port WWN: ");
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte fprintf(stdout, "%016llx",
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte wwnConversion(WWNList->portWWN.wwn));
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte for (tgtWWNList = WWNList->tgtPortWWN;
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte tgtWWNList != NULL; tgtWWNList = tgtWWNList->next) {
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte fprintf(stdout, "\n\t\tRemote Port WWN: ");
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte fprintf(stdout, "%016llx",
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte wwnConversion(tgtWWNList->portWWN.wwn));
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte fprintf(stdout, "\n\t\t\tLUN: %d",
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte tgtWWNList->scsiOSLun);
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte }
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte fprintf(stdout, "\n");
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte }
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte fprintf(stdout, "\tVendor: ");
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte for (count = sizeof (devListWalk->VID), i = 0; i < count; i++) {
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte if (isprint(devListWalk->VID[i]))
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte fprintf(stdout, "%c", devListWalk->VID[i]);
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte }
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte fprintf(stdout, "\n\tProduct: ");
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte for (count = sizeof (devListWalk->PID), i = 0; i < count; i++) {
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte if (isprint(devListWalk->PID[i]))
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte fprintf(stdout, "%c", devListWalk->PID[i]);
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte }
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte fprintf(stdout, "\n\tDevice Type: %s\n",
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte getDTypeString(devListWalk->dType));
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte }
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte}