printAttrs.c revision fcf3ce441efd61da9bb2884968af01cb7c1452cc
/*
* CDDL HEADER START
*
* The contents of this file are subject to the terms of the
* Common Development and Distribution License (the "License").
* You may not use this file except in compliance with the License.
*
* You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
* See the License for the specific language governing permissions
* and limitations under the License.
*
* When distributing Covered Code, include this CDDL HEADER in each
* file and include the License file at usr/src/OPENSOLARIS.LICENSE.
* If applicable, add the following below this CDDL HEADER, with the
* fields enclosed by brackets "[]" replaced with your own identifying
* information: Portions Copyright [yyyy] [name of copyright owner]
*
* CDDL HEADER END
*/
/*
* Copyright 2008 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
*/
#include <stdio.h>
#include <hbaapi.h>
#include <string.h>
#include <inttypes.h>
#include <ctype.h>
#include "fcinfo.h"
#ifdef _BIG_ENDIAN
#define htonll(x) (x)
#define ntohll(x) (x)
#else
#endif
/* Fc4 Types Format */
#define TYPE_IP_FC 0x05
#define TYPE_SCSI_FCP 0x08
}
static char *
switch (portType) {
case HBA_PORTTYPE_UNKNOWN:
return ("unknown");
case HBA_PORTTYPE_OTHER:
return ("other");
case HBA_PORTTYPE_NOTPRESENT:
return ("not present");
case HBA_PORTTYPE_NPORT:
return ("N-port");
case HBA_PORTTYPE_NLPORT:
return ("NL-port");
case HBA_PORTTYPE_FLPORT:
return ("FL-port");
case HBA_PORTTYPE_FPORT:
return ("F-port");
case HBA_PORTTYPE_LPORT:
return ("L-port");
case HBA_PORTTYPE_PTP:
return ("point-to-point");
default:
return ("unrecognized type");
}
}
static char *
switch (portState) {
case HBA_PORTSTATE_UNKNOWN:
return ("unknown");
case HBA_PORTSTATE_ONLINE:
return ("online");
case HBA_PORTSTATE_OFFLINE:
return ("offline");
case HBA_PORTSTATE_BYPASSED:
return ("bypassed");
return ("diagnostics");
case HBA_PORTSTATE_LINKDOWN:
return ("link down");
case HBA_PORTSTATE_ERROR:
return ("error");
case HBA_PORTSTATE_LOOPBACK:
return ("loopback");
default:
return ("unrecognized state");
}
}
static void
int foundSpeed = 0;
foundSpeed = 1;
}
foundSpeed = 1;
}
foundSpeed = 1;
}
foundSpeed = 1;
}
foundSpeed = 1;
}
foundSpeed = 1;
}
foundSpeed = 1;
}
if (foundSpeed == 0) {
}
}
void
int fc4_types = 0;
if (fc4_map_is_set(
TYPE_SCSI_FCP)) {
fc4_types++;
}
if (fc4_map_is_set(
TYPE_IP_FC)) {
if (fc4_types != 0) {
}
fc4_types++;
}
/* print out scsi target type information */
if (scsiTargetType == SCSI_TARGET_TYPE_YES) {
} else if (scsiTargetType == SCSI_TARGET_TYPE_NO) {
} else {
}
}
/*
* scan the bitmap array for the specifed ULP type. The bit map array
* is 32 bytes long
*/
static int
{
return (1);
}
return (0);
}
/*
* prints out all the HBA port information
*/
void
return;
}
}
void
switch (status) {
case HBA_STATUS_OK:
return;
case HBA_STATUS_ERROR:
return;
return;
return;
case HBA_STATUS_ERROR_ARG:
return;
return;
return;
return;
return;
return;
case HBA_STATUS_ERROR_BUSY:
return;
return;
return;
default:
return;
}
}
void
}
void
}
/*
* return device type description
*
* Arguments:
* dType - Device type returned from Standard INQUIRY
* Returns:
* char string description for device type
*/
static char *
{
switch (dType & DTYPE_MASK) {
case DTYPE_DIRECT:
return ("Disk Device");
case DTYPE_SEQUENTIAL:
return ("Tape Device");
case DTYPE_PRINTER:
return ("Printer Device");
case DTYPE_PROCESSOR:
return ("Processor Device");
case DTYPE_WORM:
return ("WORM Device");
case DTYPE_RODIRECT:
case DTYPE_SCANNER:
return ("Scanner Device");
case DTYPE_OPTICAL:
return ("Optical Memory Device");
case DTYPE_CHANGER:
return ("Medium Changer Device");
case DTYPE_COMM:
return ("Communications Device");
case DTYPE_ARRAY_CTRL:
return ("Storage Array Controller Device");
case DTYPE_ESI:
return ("Enclosure Services Device");
case DTYPE_RBC:
return ("Simplified Direct-access Device");
case DTYPE_OCRW:
case DTYPE_BCC:
return ("Bridge Controller Commands");
case DTYPE_OSD:
return ("Object-based Storage Device");
case DTYPE_ADC:
return ("Automation/Drive Interface");
case DTYPE_WELLKNOWN:
return ("Well Known Logical Unit");
case DTYPE_UNKNOWN:
return ("Unknown Device");
default:
return ("Undefined");
}
}
/*
* print the OS device name for the logical-unit object
*
* Arguments:
* devListWalk - OS device path info
* verbose - boolean indicating whether to display additional info
*
* returns:
* none
*/
void
{
int i, count;
}
}
}
}
}
}