2 * Copyright (c) 2004-2007 Voltaire Inc. All rights reserved.
\r
3 * Copyright (c) 2007 Xsigo Systems Inc. All rights reserved.
\r
5 * This software is available to you under a choice of one of two
\r
6 * licenses. You may choose to be licensed under the terms of the GNU
\r
7 * General Public License (GPL) Version 2, available from the file
\r
8 * COPYING in the main directory of this source tree, or the
\r
9 * OpenIB.org BSD license below:
\r
11 * Redistribution and use in source and binary forms, with or
\r
12 * without modification, are permitted provided that the following
\r
13 * conditions are met:
\r
15 * - Redistributions of source code must retain the above
\r
16 * copyright notice, this list of conditions and the following
\r
19 * - Redistributions in binary form must reproduce the above
\r
20 * copyright notice, this list of conditions and the following
\r
21 * disclaimer in the documentation and/or other materials
\r
22 * provided with the distribution.
\r
24 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
\r
25 * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
\r
26 * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
\r
27 * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS
\r
28 * BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
\r
29 * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
\r
30 * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
\r
35 #ifndef _GROUPING_H_
\r
36 #define _GROUPING_H_
\r
38 /*========================================================*/
\r
39 /* FABRIC SCANNER SPECIFIC DATA */
\r
40 /*========================================================*/
\r
42 #define SPINES_MAX_NUM 12
\r
43 #define LINES_MAX_NUM 36
\r
45 typedef struct ChassisList ChassisList;
\r
46 typedef struct AllChassisList AllChassisList;
\r
48 struct ChassisList {
\r
50 uint64_t chassisguid;
\r
53 int nodecount; /* used for grouping by SystemImageGUID */
\r
54 Node *spinenode[SPINES_MAX_NUM + 1];
\r
55 Node *linenode[LINES_MAX_NUM + 1];
\r
58 struct AllChassisList {
\r
60 ChassisList *current;
\r
64 /*========================================================*/
\r
65 /* CHASSIS RECOGNITION SPECIFIC DATA */
\r
66 /*========================================================*/
\r
69 #define VTR_DEVID_IB_FC_ROUTER 0x5a00
\r
70 #define VTR_DEVID_IB_IP_ROUTER 0x5a01
\r
71 #define VTR_DEVID_ISR9600_SPINE 0x5a02
\r
72 #define VTR_DEVID_ISR9600_LEAF 0x5a03
\r
73 #define VTR_DEVID_HCA1 0x5a04
\r
74 #define VTR_DEVID_HCA2 0x5a44
\r
75 #define VTR_DEVID_HCA3 0x6278
\r
76 #define VTR_DEVID_SW_6IB4 0x5a05
\r
77 #define VTR_DEVID_ISR9024 0x5a06
\r
78 #define VTR_DEVID_ISR9288 0x5a07
\r
79 #define VTR_DEVID_SLB24 0x5a09
\r
80 #define VTR_DEVID_SFB12 0x5a08
\r
81 #define VTR_DEVID_SFB4 0x5a0b
\r
82 #define VTR_DEVID_ISR9024_12 0x5a0c
\r
83 #define VTR_DEVID_SLB8 0x5a0d
\r
84 #define VTR_DEVID_RLX_SWITCH_BLADE 0x5a20
\r
85 #define VTR_DEVID_ISR9024_DDR 0x5a31
\r
86 #define VTR_DEVID_SFB12_DDR 0x5a32
\r
87 #define VTR_DEVID_SFB4_DDR 0x5a33
\r
88 #define VTR_DEVID_SLB24_DDR 0x5a34
\r
89 #define VTR_DEVID_SFB2012 0x5a37
\r
90 #define VTR_DEVID_SLB2024 0x5a38
\r
91 #define VTR_DEVID_ISR2012 0x5a39
\r
92 #define VTR_DEVID_SFB2004 0x5a40
\r
93 #define VTR_DEVID_ISR2004 0x5a41
\r
95 enum ChassisType { UNRESOLVED_CT, ISR9288_CT, ISR9096_CT, ISR2012_CT, ISR2004_CT };
\r
96 enum ChassisSlot { UNRESOLVED_CS, LINE_CS, SPINE_CS, SRBD_CS };
\r
98 /*========================================================*/
\r
99 /* External interface */
\r
100 /*========================================================*/
\r
102 ChassisList *group_nodes();
\r
103 char *portmapstring(Port *port);
\r
104 char *get_chassis_type(unsigned char chassistype);
\r
105 char *get_chassis_slot(unsigned char chassisslot);
\r
106 uint64_t get_chassis_guid(unsigned char chassisnum);
\r
108 int is_xsigo_guid(uint64_t guid);
\r
109 int is_xsigo_tca(uint64_t guid);
\r
110 int is_xsigo_hca(uint64_t guid);
\r
112 #endif /* _GROUPING_H_ */
\r