xref: /titanic_52/usr/src/cmd/sasinfo/printAttrs.h (revision 9e86db79b7d1bbc5f2f04e99954cbd5eae0e22bb)
1*9e86db79SHyon Kim /*
2*9e86db79SHyon Kim  * CDDL HEADER START
3*9e86db79SHyon Kim  *
4*9e86db79SHyon Kim  * The contents of this file are subject to the terms of the
5*9e86db79SHyon Kim  * Common Development and Distribution License (the "License").
6*9e86db79SHyon Kim  * You may not use this file except in compliance with the License.
7*9e86db79SHyon Kim  *
8*9e86db79SHyon Kim  * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
9*9e86db79SHyon Kim  * or http://www.opensolaris.org/os/licensing.
10*9e86db79SHyon Kim  * See the License for the specific language governing permissions
11*9e86db79SHyon Kim  * and limitations under the License.
12*9e86db79SHyon Kim  *
13*9e86db79SHyon Kim  * When distributing Covered Code, include this CDDL HEADER in each
14*9e86db79SHyon Kim  * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
15*9e86db79SHyon Kim  * If applicable, add the following below this CDDL HEADER, with the
16*9e86db79SHyon Kim  * fields enclosed by brackets "[]" replaced with your own identifying
17*9e86db79SHyon Kim  * information: Portions Copyright [yyyy] [name of copyright owner]
18*9e86db79SHyon Kim  *
19*9e86db79SHyon Kim  * CDDL HEADER END
20*9e86db79SHyon Kim  */
21*9e86db79SHyon Kim /*
22*9e86db79SHyon Kim  * Copyright 2009 Sun Microsystems, Inc.  All rights reserved.
23*9e86db79SHyon Kim  * Use is subject to license terms.
24*9e86db79SHyon Kim  */
25*9e86db79SHyon Kim 
26*9e86db79SHyon Kim #ifndef	_PRINTATTRS_H
27*9e86db79SHyon Kim #define	_PRINTATTRS_H
28*9e86db79SHyon Kim 
29*9e86db79SHyon Kim #ifdef	__cplusplus
30*9e86db79SHyon Kim extern "C" {
31*9e86db79SHyon Kim #endif
32*9e86db79SHyon Kim 
33*9e86db79SHyon Kim #include <sasinfo.h>
34*9e86db79SHyon Kim 
35*9e86db79SHyon Kim typedef enum {
36*9e86db79SHyon Kim 	PHY_STATE,
37*9e86db79SHyon Kim 	PHY_SPEED
38*9e86db79SHyon Kim } phystat_type;
39*9e86db79SHyon Kim 
40*9e86db79SHyon Kim typedef struct state_string {
41*9e86db79SHyon Kim 	int	key;
42*9e86db79SHyon Kim 	char	*value;
43*9e86db79SHyon Kim } SAS_STATE;
44*9e86db79SHyon Kim 
45*9e86db79SHyon Kim extern SAS_STATE porttype_string[];
46*9e86db79SHyon Kim extern SAS_STATE portstate_string[];
47*9e86db79SHyon Kim 
48*9e86db79SHyon Kim #define	MAXINDENT	64
49*9e86db79SHyon Kim 
50*9e86db79SHyon Kim char *getHBAStatus(HBA_STATUS hbaStatus);
51*9e86db79SHyon Kim uint64_t wwnConversion(uchar_t *wwn);
52*9e86db79SHyon Kim void printHBAInfo(SMHBA_ADAPTERATTRIBUTES *attrs, int pflag, int numberOfPorts,
53*9e86db79SHyon Kim     const char *adapterName);
54*9e86db79SHyon Kim void printHBAPortInfo(SMHBA_PORTATTRIBUTES *port,
55*9e86db79SHyon Kim     SMHBA_ADAPTERATTRIBUTES *attrs, int pflag);
56*9e86db79SHyon Kim void printHBAPortPhyInfo(SMHBA_SAS_PHY *phyinfo);
57*9e86db79SHyon Kim void printHBAPortPhyStatistics(SMHBA_SASPHYSTATISTICS *phystat);
58*9e86db79SHyon Kim extern void
59*9e86db79SHyon Kim printLogicalUnit(int pflag, SMHBA_TARGETMAPPING *map);
60*9e86db79SHyon Kim extern int
61*9e86db79SHyon Kim printOSDeviceNameInfo(discoveredDevice *devListWalk, boolean_t verbose);
62*9e86db79SHyon Kim extern int
63*9e86db79SHyon Kim printTargetPortInfo(targetPortList_t *TPListWalk, int pflag);
64*9e86db79SHyon Kim extern char *getStateString(HBA_UINT32 key, SAS_STATE *stat_string);
65*9e86db79SHyon Kim extern char *getIndentSpaces(int number);
66*9e86db79SHyon Kim extern char *getDTypeString(uchar_t dType);
67*9e86db79SHyon Kim 
68*9e86db79SHyon Kim #ifdef __cplusplus
69*9e86db79SHyon Kim }
70*9e86db79SHyon Kim #endif
71*9e86db79SHyon Kim 
72*9e86db79SHyon Kim #endif /* _PRINTATTRS_H */
73