xref: /titanic_52/usr/src/lib/libsff/common/sff.h (revision 59596c01ca1b980a016d25670874f53e64c27ec0)
1*59596c01SRobert Mustacchi /*
2*59596c01SRobert Mustacchi  * This file and its contents are supplied under the terms of the
3*59596c01SRobert Mustacchi  * Common Development and Distribution License ("CDDL"), version 1.0.
4*59596c01SRobert Mustacchi  * You may only use this file in accordance with the terms of version
5*59596c01SRobert Mustacchi  * 1.0 of the CDDL.
6*59596c01SRobert Mustacchi  *
7*59596c01SRobert Mustacchi  * A full copy of the text of the CDDL should have accompanied this
8*59596c01SRobert Mustacchi  * source.  A copy of the CDDL is also available via the Internet at
9*59596c01SRobert Mustacchi  * http://www.illumos.org/license/CDDL.
10*59596c01SRobert Mustacchi  */
11*59596c01SRobert Mustacchi 
12*59596c01SRobert Mustacchi /*
13*59596c01SRobert Mustacchi  * Copyright (c) 2017, Joyent, Inc.
14*59596c01SRobert Mustacchi  */
15*59596c01SRobert Mustacchi 
16*59596c01SRobert Mustacchi #ifndef _SFF_H
17*59596c01SRobert Mustacchi #define	_SFF_H
18*59596c01SRobert Mustacchi 
19*59596c01SRobert Mustacchi /*
20*59596c01SRobert Mustacchi  * Definitions internal to libsfp for various SFF versions. This generally
21*59596c01SRobert Mustacchi  * contains offsets for each byte and its purpose. The meaning of the values are
22*59596c01SRobert Mustacchi  * not generally found in this header.
23*59596c01SRobert Mustacchi  */
24*59596c01SRobert Mustacchi 
25*59596c01SRobert Mustacchi #ifdef __cplusplus
26*59596c01SRobert Mustacchi extern "C" {
27*59596c01SRobert Mustacchi #endif
28*59596c01SRobert Mustacchi 
29*59596c01SRobert Mustacchi /*
30*59596c01SRobert Mustacchi  * This table is derived from SFF 8024 Section 4.1, Table 4-1.
31*59596c01SRobert Mustacchi  */
32*59596c01SRobert Mustacchi typedef enum sff_8024_id {
33*59596c01SRobert Mustacchi 	SFF_8024_ID_UNKNOWN	= 0x00,
34*59596c01SRobert Mustacchi 	SFF_8024_ID_GBIC	= 0x01,
35*59596c01SRobert Mustacchi 	SFF_8024_ID_SOLDERED	= 0x02,
36*59596c01SRobert Mustacchi 	SFF_8024_ID_SFP		= 0x03, /* SFP, SFP+, SFP28 */
37*59596c01SRobert Mustacchi 	SFF_8024_ID_XBI		= 0x04,
38*59596c01SRobert Mustacchi 	SFF_8024_ID_XENPAK	= 0x05,
39*59596c01SRobert Mustacchi 	SFF_8024_ID_XFP		= 0x06,
40*59596c01SRobert Mustacchi 	SFF_8024_ID_XFF		= 0x07,
41*59596c01SRobert Mustacchi 	SFF_8024_ID_XFP_E	= 0x08,
42*59596c01SRobert Mustacchi 	SFF_8024_ID_XPAK	= 0x09,
43*59596c01SRobert Mustacchi 	SFF_8024_ID_X2		= 0x0A,
44*59596c01SRobert Mustacchi 	SFF_8024_ID_DWDM_SFP	= 0x0B,
45*59596c01SRobert Mustacchi 	SFF_8024_ID_QSFP	= 0x0C,
46*59596c01SRobert Mustacchi 	SFF_8024_ID_QSFP_PLUS	= 0x0D,
47*59596c01SRobert Mustacchi 	SFF_8024_ID_CXP		= 0x0E,
48*59596c01SRobert Mustacchi 	SFF_8024_ID_SMMHD4X	= 0x0F,
49*59596c01SRobert Mustacchi 	SFF_8024_ID_SMMHD8X	= 0x10,
50*59596c01SRobert Mustacchi 	SFF_8024_ID_QSFP28	= 0x11,
51*59596c01SRobert Mustacchi 	SFF_8024_ID_CXP2	= 0x12,
52*59596c01SRobert Mustacchi 	SFF_8024_ID_CDFP	= 0x13,
53*59596c01SRobert Mustacchi 	SFF_8024_ID_SMMHD4XF	= 0x14,
54*59596c01SRobert Mustacchi 	SFF_8024_ID_SMMHD8XF	= 0x15,
55*59596c01SRobert Mustacchi 	SFF_8024_ID_CDFP3	= 0x16,
56*59596c01SRobert Mustacchi 	SFF_8024_ID_MICROQSFP	= 0x17,
57*59596c01SRobert Mustacchi 	SFF_8024_NIDS		= 0x18,
58*59596c01SRobert Mustacchi 	SFF_8024_VENDOR		= 0x80
59*59596c01SRobert Mustacchi } sff_8024_id_t;
60*59596c01SRobert Mustacchi 
61*59596c01SRobert Mustacchi 
62*59596c01SRobert Mustacchi /*
63*59596c01SRobert Mustacchi  * Byte offsets for SFF-8472. Note that most of this applies to INF-8074.
64*59596c01SRobert Mustacchi  * Generally speaking, SFF-8472 is a backwards compatible evolution of INF-8074.
65*59596c01SRobert Mustacchi  */
66*59596c01SRobert Mustacchi #define	SFF_8472_IDENTIFIER			0
67*59596c01SRobert Mustacchi #define	SFF_8472_EXT_IDENTIFER			1
68*59596c01SRobert Mustacchi #define	SFF_8472_CONNECTOR			2
69*59596c01SRobert Mustacchi 
70*59596c01SRobert Mustacchi /*
71*59596c01SRobert Mustacchi  * Note that several constants overlap here as the offset is used for multiple
72*59596c01SRobert Mustacchi  * purposes.
73*59596c01SRobert Mustacchi  */
74*59596c01SRobert Mustacchi #define	SFF_8472_COMPLIANCE_10GE		3
75*59596c01SRobert Mustacchi #define	SFF_8472_COMPLIANCE_IB			3
76*59596c01SRobert Mustacchi #define	SFF_8472_COMPLIANCE_ESCON		4
77*59596c01SRobert Mustacchi #define	SFF_8472_COMPLIANCE_SONET_LOW		4
78*59596c01SRobert Mustacchi #define	SFF_8472_COMPLIANCE_SONET_HIGH		5
79*59596c01SRobert Mustacchi #define	SFF_8472_COMPLIANCE_ETHERNET		6
80*59596c01SRobert Mustacchi #define	SFF_8472_COMPLIANCE_FCLEN		7
81*59596c01SRobert Mustacchi #define	SFF_8472_COMPLIANCE_FC_LOW		7
82*59596c01SRobert Mustacchi #define	SFF_8472_COMPLIANCE_FC_HIGH		8
83*59596c01SRobert Mustacchi #define	SFF_8472_COMPLIANCE_SFP			8
84*59596c01SRobert Mustacchi #define	SFF_8472_COMPLIANCE_FC_MEDIA		9
85*59596c01SRobert Mustacchi #define	SFF_8472_COMPLIANCE_FC_SPEED		10
86*59596c01SRobert Mustacchi 
87*59596c01SRobert Mustacchi #define	SFF_8472_ENCODING			11
88*59596c01SRobert Mustacchi #define	SFF_8472_BR_NOMINAL			12
89*59596c01SRobert Mustacchi #define	SFF_8472_RATE_IDENTIFIER		13
90*59596c01SRobert Mustacchi #define	SFF_8472_LENGTH_SMF_KM			14
91*59596c01SRobert Mustacchi #define	SFF_8472_LENGTH_SMF			15
92*59596c01SRobert Mustacchi #define	SFF_8472_LENGTH_50UM			16
93*59596c01SRobert Mustacchi #define	SFF_8472_LENGTH_62UM			17
94*59596c01SRobert Mustacchi #define	SFF_8472_LENGTH_COPPER			18
95*59596c01SRobert Mustacchi #define	SFF_8472_LENGTH_OM3			19
96*59596c01SRobert Mustacchi 
97*59596c01SRobert Mustacchi #define	SFF_8472_VENDOR				20
98*59596c01SRobert Mustacchi #define	SFF_8472_VENDOR_LEN			16
99*59596c01SRobert Mustacchi #define	SFF_8472_TRANSCEIVER			36
100*59596c01SRobert Mustacchi #define	SFF_8472_OUI				37
101*59596c01SRobert Mustacchi #define	SFF_8472_OUI_LEN			3
102*59596c01SRobert Mustacchi #define	SFF_8472_VENDOR_PN			40
103*59596c01SRobert Mustacchi #define	SFF_8472_VENDOR_PN_LEN			16
104*59596c01SRobert Mustacchi #define	SFF_8472_VENDOR_REV			56
105*59596c01SRobert Mustacchi #define	SFF_8472_VENDOR_REV_LEN			4
106*59596c01SRobert Mustacchi 
107*59596c01SRobert Mustacchi #define	SFF_8472_PASSIVE_SPEC			60
108*59596c01SRobert Mustacchi #define	SFF_8472_ACTIVE_SPEC			60
109*59596c01SRobert Mustacchi #define	SFF_8472_WAVELENGTH_HI			60
110*59596c01SRobert Mustacchi #define	SFF_8472_WAVELENGTH_LOW			61
111*59596c01SRobert Mustacchi 
112*59596c01SRobert Mustacchi #define	SFF_8472_CC_BASE			63
113*59596c01SRobert Mustacchi 
114*59596c01SRobert Mustacchi #define	SFF_8472_OPTIONS_HI			64
115*59596c01SRobert Mustacchi #define	SFF_8472_OPTIONS_LOW			65
116*59596c01SRobert Mustacchi #define	SFF_8472_BR_MAX				66
117*59596c01SRobert Mustacchi #define	SFF_8472_BR_MIN				67
118*59596c01SRobert Mustacchi #define	SFF_8472_VENDOR_SN			68
119*59596c01SRobert Mustacchi #define	SFF_8472_VENDOR_SN_LEN			16
120*59596c01SRobert Mustacchi #define	SFF_8472_DATE_CODE			84
121*59596c01SRobert Mustacchi #define	SFF_8472_DATE_CODE_LEN			8
122*59596c01SRobert Mustacchi #define	SFF_8472_DIAG_MONITORING		92
123*59596c01SRobert Mustacchi #define	SFF_8472_ENHANCED_OPTIONS		93
124*59596c01SRobert Mustacchi #define	SFF_8472_SFF_8472_COMPLIANCE		94
125*59596c01SRobert Mustacchi 
126*59596c01SRobert Mustacchi #define	SFF_8472_CC_EXT				95
127*59596c01SRobert Mustacchi #define	SFF_8472_VENDOR_SPECIFIC		96
128*59596c01SRobert Mustacchi #define	SFF_8472_RESERVED			128
129*59596c01SRobert Mustacchi 
130*59596c01SRobert Mustacchi /*
131*59596c01SRobert Mustacchi  * These values are factors by which we should multiple or divide various units.
132*59596c01SRobert Mustacchi  */
133*59596c01SRobert Mustacchi #define	SFF_8472_BR_NOMINAL_FACTOR		100
134*59596c01SRobert Mustacchi #define	SFF_8472_BR_MAX_FACTOR			250
135*59596c01SRobert Mustacchi #define	SFF_8472_BR_MIN_FACTOR			250
136*59596c01SRobert Mustacchi #define	SFF_8472_LENGTH_SMF_KM_FACTOR		1
137*59596c01SRobert Mustacchi #define	SFF_8472_LENGTH_SMF_FACTOR		100
138*59596c01SRobert Mustacchi #define	SFF_8472_LENGTH_50UM_FACTOR		10
139*59596c01SRobert Mustacchi #define	SFF_8472_LENGTH_62UM_FACTOR		10
140*59596c01SRobert Mustacchi #define	SFF_8472_LENGTH_COPPER_FACTOR		1
141*59596c01SRobert Mustacchi #define	SFF_8472_LENGTH_OM3_FACTOR		10
142*59596c01SRobert Mustacchi #define	SFF_8472_WAVELENGTH_FACTOR		1
143*59596c01SRobert Mustacchi 
144*59596c01SRobert Mustacchi 
145*59596c01SRobert Mustacchi /*
146*59596c01SRobert Mustacchi  * SFF 8636 related constants
147*59596c01SRobert Mustacchi  */
148*59596c01SRobert Mustacchi #define	SFF_8636_IDENTIFIER			0
149*59596c01SRobert Mustacchi #define	SFF_8636_EXT_IDENTIFIER			129
150*59596c01SRobert Mustacchi #define	SFF_8636_CONNECTOR			130
151*59596c01SRobert Mustacchi 
152*59596c01SRobert Mustacchi #define	SFF_8636_COMPLIANCE_10GBEP		131
153*59596c01SRobert Mustacchi #define	SFF_8636_COMPLIANCE_SONET		132
154*59596c01SRobert Mustacchi #define	SFF_8636_COMPLIANCE_SAS			133
155*59596c01SRobert Mustacchi #define	SFF_8636_COMPLIANCE_ETHERNET		134
156*59596c01SRobert Mustacchi #define	SFF_8636_COMPLIANCE_FCLEN		135
157*59596c01SRobert Mustacchi #define	SFF_8636_COMPLIANCE_FC_LOW		135
158*59596c01SRobert Mustacchi #define	SFF_8636_COMPLIANCE_FC_HIGH		136
159*59596c01SRobert Mustacchi #define	SFF_8636_COMPLIANCE_FC_MEDIA		137
160*59596c01SRobert Mustacchi #define	SFF_8636_COMPLIANCE_FC_SPEED		138
161*59596c01SRobert Mustacchi 
162*59596c01SRobert Mustacchi #define	SFF_8636_ENCODING			139
163*59596c01SRobert Mustacchi #define	SFF_8636_BR_NOMINAL			140
164*59596c01SRobert Mustacchi #define	SFF_8636_BR_EXT_RATE_SELECT		141
165*59596c01SRobert Mustacchi #define	SFF_8636_LENGTH_SMF			142
166*59596c01SRobert Mustacchi #define	SFF_8636_LENGTH_OM3			143
167*59596c01SRobert Mustacchi #define	SFF_8636_LENGTH_OM2			144
168*59596c01SRobert Mustacchi #define	SFF_8636_LENGTH_OM1			145
169*59596c01SRobert Mustacchi #define	SFF_8636_LENGTH_COPPER			146
170*59596c01SRobert Mustacchi #define	SFF_8636_DEVICE_TECH			147
171*59596c01SRobert Mustacchi #define	SFF_8636_VENDOR				148
172*59596c01SRobert Mustacchi #define	SFF_8636_VENDOR_LEN			16
173*59596c01SRobert Mustacchi #define	SFF_8636_EXTENDED_MODULE		164
174*59596c01SRobert Mustacchi #define	SFF_8636_OUI				165
175*59596c01SRobert Mustacchi #define	SFF_8636_OUI_LEN			3
176*59596c01SRobert Mustacchi #define	SFF_8636_VENDOR_PN			168
177*59596c01SRobert Mustacchi #define	SFF_8636_VENDOR_PN_LEN			16
178*59596c01SRobert Mustacchi #define	SFF_8636_VENDOR_REV			184
179*59596c01SRobert Mustacchi #define	SFF_8636_VENDOR_REV_LEN			2
180*59596c01SRobert Mustacchi 
181*59596c01SRobert Mustacchi #define	SFF_8636_ATTENUATE_2G			186
182*59596c01SRobert Mustacchi #define	SFF_8636_ATTENUATE_5G			187
183*59596c01SRobert Mustacchi #define	SFF_8636_ATTENUATE_7G			188
184*59596c01SRobert Mustacchi #define	SFF_8636_ATTENUATE_12G			189
185*59596c01SRobert Mustacchi #define	SFF_8636_WAVELENGTH_NOMINAL_HI		186
186*59596c01SRobert Mustacchi #define	SFF_8636_WAVELENGTH_NOMINAL_LOW		187
187*59596c01SRobert Mustacchi #define	SFF_8636_WAVELENGTH_TOLERANCE_HI	188
188*59596c01SRobert Mustacchi #define	SFF_8636_WAVELENGTH_TOLERANCE_LOW	189
189*59596c01SRobert Mustacchi #define	SFF_8636_MAX_CASE_TEMP			190
190*59596c01SRobert Mustacchi #define	SFF_8636_CC_BASE			191
191*59596c01SRobert Mustacchi 
192*59596c01SRobert Mustacchi #define	SFF_8636_LINK_CODES			192
193*59596c01SRobert Mustacchi #define	SFF_8636_OPTIONS_HI			193
194*59596c01SRobert Mustacchi #define	SFF_8636_OPTIONS_MID			194
195*59596c01SRobert Mustacchi #define	SFF_8636_OPTIONS_LOW			195
196*59596c01SRobert Mustacchi #define	SFF_8636_VENDOR_SN			196
197*59596c01SRobert Mustacchi #define	SFF_8636_VENDOR_SN_LEN			16
198*59596c01SRobert Mustacchi #define	SFF_8636_DATE_CODE			212
199*59596c01SRobert Mustacchi #define	SFF_8636_DATE_CODE_LEN			8
200*59596c01SRobert Mustacchi #define	SFF_8636_DIAG_MONITORING		220
201*59596c01SRobert Mustacchi #define	SFF_8636_ENHANCED_OPTIONS		221
202*59596c01SRobert Mustacchi #define	SFF_8636_BR_NOMINAL_EXT			222
203*59596c01SRobert Mustacchi #define	SFF_8636_CC_EXT				223
204*59596c01SRobert Mustacchi #define	SFF_866_VENDOR_SPECIFIC			224
205*59596c01SRobert Mustacchi 
206*59596c01SRobert Mustacchi /*
207*59596c01SRobert Mustacchi  * SFF 8636 multiplication factors
208*59596c01SRobert Mustacchi  */
209*59596c01SRobert Mustacchi #define	SFF_8636_BR_NOMINAL_FACTOR		100
210*59596c01SRobert Mustacchi #define	SFF_8636_BR_NOMINAL_EXT_FACTOR		250
211*59596c01SRobert Mustacchi #define	SFF_8636_LENGTH_SMF_FACTOR		1
212*59596c01SRobert Mustacchi #define	SFF_8636_LENGTH_OM3_FACTOR		2
213*59596c01SRobert Mustacchi #define	SFF_8636_LENGTH_OM2_FACTOR		1
214*59596c01SRobert Mustacchi #define	SFF_8636_LENGTH_OM1_FACTOR		1
215*59596c01SRobert Mustacchi #define	SFF_8636_LENGTH_COPPER_FACTOR		1
216*59596c01SRobert Mustacchi 
217*59596c01SRobert Mustacchi #ifdef __cplusplus
218*59596c01SRobert Mustacchi }
219*59596c01SRobert Mustacchi #endif
220*59596c01SRobert Mustacchi 
221*59596c01SRobert Mustacchi #endif /* _SFF_H */
222