Lines Matching +full:- +full:- +full:id
13 #include "sff-common.h"
20 static void sff8079_show_identifier(const __u8 *id) in sff8079_show_identifier() argument
22 sff8024_show_identifier(id, 0); in sff8079_show_identifier()
25 static void sff8079_show_ext_identifier(const __u8 *id) in sff8079_show_ext_identifier() argument
27 printf("\t%-41s : 0x%02x", "Extended identifier", id[1]); in sff8079_show_ext_identifier()
28 if (id[1] == 0x00) in sff8079_show_ext_identifier()
30 else if (id[1] == 0x04) in sff8079_show_ext_identifier()
31 printf(" (GBIC/SFP defined by 2-wire interface ID)\n"); in sff8079_show_ext_identifier()
32 else if (id[1] <= 0x07) in sff8079_show_ext_identifier()
33 printf(" (GBIC compliant with MOD_DEF %u)\n", id[1]); in sff8079_show_ext_identifier()
38 static void sff8079_show_connector(const __u8 *id) in sff8079_show_connector() argument
40 sff8024_show_connector(id, 2); in sff8079_show_connector()
43 static void sff8079_show_transceiver(const __u8 *id) in sff8079_show_transceiver() argument
48 printf("\t%-41s : 0x%02x 0x%02x 0x%02x " \ in sff8079_show_transceiver()
51 id[3], id[4], id[5], id[6], in sff8079_show_transceiver()
52 id[7], id[8], id[9], id[10], id[36]); in sff8079_show_transceiver()
54 if (id[3] & (1 << 7)) in sff8079_show_transceiver()
55 printf("%s 10G Ethernet: 10G Base-ER" \ in sff8079_show_transceiver()
56 " [SFF-8472 rev10.4 onwards]\n", pfx); in sff8079_show_transceiver()
57 if (id[3] & (1 << 6)) in sff8079_show_transceiver()
58 printf("%s 10G Ethernet: 10G Base-LRM\n", pfx); in sff8079_show_transceiver()
59 if (id[3] & (1 << 5)) in sff8079_show_transceiver()
60 printf("%s 10G Ethernet: 10G Base-LR\n", pfx); in sff8079_show_transceiver()
61 if (id[3] & (1 << 4)) in sff8079_show_transceiver()
62 printf("%s 10G Ethernet: 10G Base-SR\n", pfx); in sff8079_show_transceiver()
64 if (id[3] & (1 << 3)) in sff8079_show_transceiver()
66 if (id[3] & (1 << 2)) in sff8079_show_transceiver()
68 if (id[3] & (1 << 1)) in sff8079_show_transceiver()
70 if (id[3] & (1 << 0)) in sff8079_show_transceiver()
73 if (id[4] & (1 << 7)) in sff8079_show_transceiver()
75 if (id[4] & (1 << 6)) in sff8079_show_transceiver()
78 if (id[4] & (1 << 5)) in sff8079_show_transceiver()
79 printf("%s SONET: OC-192, short reach\n", pfx); in sff8079_show_transceiver()
80 if (id[4] & (1 << 4)) in sff8079_show_transceiver()
82 if (id[4] & (1 << 3)) in sff8079_show_transceiver()
84 if (id[4] & (1 << 2)) in sff8079_show_transceiver()
85 printf("%s SONET: OC-48, long reach\n", pfx); in sff8079_show_transceiver()
86 if (id[4] & (1 << 1)) in sff8079_show_transceiver()
87 printf("%s SONET: OC-48, intermediate reach\n", pfx); in sff8079_show_transceiver()
88 if (id[4] & (1 << 0)) in sff8079_show_transceiver()
89 printf("%s SONET: OC-48, short reach\n", pfx); in sff8079_show_transceiver()
90 if (id[5] & (1 << 6)) in sff8079_show_transceiver()
91 printf("%s SONET: OC-12, single mode, long reach\n", pfx); in sff8079_show_transceiver()
92 if (id[5] & (1 << 5)) in sff8079_show_transceiver()
93 printf("%s SONET: OC-12, single mode, inter. reach\n", pfx); in sff8079_show_transceiver()
94 if (id[5] & (1 << 4)) in sff8079_show_transceiver()
95 printf("%s SONET: OC-12, short reach\n", pfx); in sff8079_show_transceiver()
96 if (id[5] & (1 << 2)) in sff8079_show_transceiver()
97 printf("%s SONET: OC-3, single mode, long reach\n", pfx); in sff8079_show_transceiver()
98 if (id[5] & (1 << 1)) in sff8079_show_transceiver()
99 printf("%s SONET: OC-3, single mode, inter. reach\n", pfx); in sff8079_show_transceiver()
100 if (id[5] & (1 << 0)) in sff8079_show_transceiver()
101 printf("%s SONET: OC-3, short reach\n", pfx); in sff8079_show_transceiver()
103 if (id[6] & (1 << 7)) in sff8079_show_transceiver()
104 printf("%s Ethernet: BASE-PX\n", pfx); in sff8079_show_transceiver()
105 if (id[6] & (1 << 6)) in sff8079_show_transceiver()
106 printf("%s Ethernet: BASE-BX10\n", pfx); in sff8079_show_transceiver()
107 if (id[6] & (1 << 5)) in sff8079_show_transceiver()
108 printf("%s Ethernet: 100BASE-FX\n", pfx); in sff8079_show_transceiver()
109 if (id[6] & (1 << 4)) in sff8079_show_transceiver()
110 printf("%s Ethernet: 100BASE-LX/LX10\n", pfx); in sff8079_show_transceiver()
111 if (id[6] & (1 << 3)) in sff8079_show_transceiver()
112 printf("%s Ethernet: 1000BASE-T\n", pfx); in sff8079_show_transceiver()
113 if (id[6] & (1 << 2)) in sff8079_show_transceiver()
114 printf("%s Ethernet: 1000BASE-CX\n", pfx); in sff8079_show_transceiver()
115 if (id[6] & (1 << 1)) in sff8079_show_transceiver()
116 printf("%s Ethernet: 1000BASE-LX\n", pfx); in sff8079_show_transceiver()
117 if (id[6] & (1 << 0)) in sff8079_show_transceiver()
118 printf("%s Ethernet: 1000BASE-SX\n", pfx); in sff8079_show_transceiver()
120 if (id[7] & (1 << 7)) in sff8079_show_transceiver()
122 if (id[7] & (1 << 6)) in sff8079_show_transceiver()
124 if (id[7] & (1 << 5)) in sff8079_show_transceiver()
126 if (id[7] & (1 << 4)) in sff8079_show_transceiver()
128 if (id[7] & (1 << 3)) in sff8079_show_transceiver()
131 if (id[7] & (1 << 2)) in sff8079_show_transceiver()
133 if (id[7] & (1 << 1)) in sff8079_show_transceiver()
135 if (id[7] & (1 << 0)) in sff8079_show_transceiver()
136 printf("%s FC: Electrical inter-enclosure (EL)\n", pfx); in sff8079_show_transceiver()
137 if (id[8] & (1 << 7)) in sff8079_show_transceiver()
138 printf("%s FC: Electrical intra-enclosure (EL)\n", pfx); in sff8079_show_transceiver()
139 if (id[8] & (1 << 6)) in sff8079_show_transceiver()
141 if (id[8] & (1 << 5)) in sff8079_show_transceiver()
143 if (id[8] & (1 << 4)) in sff8079_show_transceiver()
145 if (id[8] & (1 << 3)) in sff8079_show_transceiver()
147 if (id[8] & (1 << 2)) in sff8079_show_transceiver()
149 if (id[8] & (1 << 1)) in sff8079_show_transceiver()
150 printf("%s FC: Copper FC-BaseT\n", pfx); in sff8079_show_transceiver()
152 if (id[9] & (1 << 7)) in sff8079_show_transceiver()
154 if (id[9] & (1 << 6)) in sff8079_show_transceiver()
156 if (id[9] & (1 << 5)) in sff8079_show_transceiver()
158 if (id[9] & (1 << 4)) in sff8079_show_transceiver()
160 if (id[9] & (1 << 3)) in sff8079_show_transceiver()
162 if (id[9] & (1 << 2)) in sff8079_show_transceiver()
164 if (id[9] & (1 << 0)) in sff8079_show_transceiver()
167 if (id[10] & (1 << 7)) in sff8079_show_transceiver()
169 if (id[10] & (1 << 6)) in sff8079_show_transceiver()
171 if (id[10] & (1 << 4)) in sff8079_show_transceiver()
173 if (id[10] & (1 << 2)) in sff8079_show_transceiver()
175 if (id[10] & (1 << 0)) in sff8079_show_transceiver()
177 /* Extended Specification Compliance Codes from SFF-8024 */ in sff8079_show_transceiver()
178 if (id[36] == 0x1) in sff8079_show_transceiver()
179 printf("%s Extended: 100G AOC or 25GAUI C2M AOC with worst BER of 5x10^(-5)\n", pfx); in sff8079_show_transceiver()
180 if (id[36] == 0x2) in sff8079_show_transceiver()
181 printf("%s Extended: 100G Base-SR4 or 25GBase-SR\n", pfx); in sff8079_show_transceiver()
182 if (id[36] == 0x3) in sff8079_show_transceiver()
183 printf("%s Extended: 100G Base-LR4 or 25GBase-LR\n", pfx); in sff8079_show_transceiver()
184 if (id[36] == 0x4) in sff8079_show_transceiver()
185 printf("%s Extended: 100G Base-ER4 or 25GBase-ER\n", pfx); in sff8079_show_transceiver()
186 if (id[36] == 0x8) in sff8079_show_transceiver()
187 printf("%s Extended: 100G ACC or 25GAUI C2M ACC with worst BER of 5x10^(-5)\n", pfx); in sff8079_show_transceiver()
188 if (id[36] == 0xb) in sff8079_show_transceiver()
189 printf("%s Extended: 100G Base-CR4 or 25G Base-CR CA-L\n", pfx); in sff8079_show_transceiver()
190 if (id[36] == 0xc) in sff8079_show_transceiver()
191 printf("%s Extended: 25G Base-CR CA-S\n", pfx); in sff8079_show_transceiver()
192 if (id[36] == 0xd) in sff8079_show_transceiver()
193 printf("%s Extended: 25G Base-CR CA-N\n", pfx); in sff8079_show_transceiver()
194 if (id[36] == 0x16) in sff8079_show_transceiver()
195 printf("%s Extended: 10Gbase-T with SFI electrical interface\n", pfx); in sff8079_show_transceiver()
196 if (id[36] == 0x18) in sff8079_show_transceiver()
197 printf("%s Extended: 100G AOC or 25GAUI C2M AOC with worst BER of 10^(-12)\n", pfx); in sff8079_show_transceiver()
198 if (id[36] == 0x19) in sff8079_show_transceiver()
199 printf("%s Extended: 100G ACC or 25GAUI C2M ACC with worst BER of 10^(-12)\n", pfx); in sff8079_show_transceiver()
200 if (id[36] == 0x1a) in sff8079_show_transceiver()
201 …printf("%s Extended: 100GE-DWDM2 (DWDM transceiver using 2 wavelengths on a 1550 nm DWDM grid with… in sff8079_show_transceiver()
203 if (id[36] == 0x1b) in sff8079_show_transceiver()
205 if (id[36] == 0x1c) in sff8079_show_transceiver()
206 printf("%s Extended: 10Gbase-T Short Reach\n", pfx); in sff8079_show_transceiver()
207 if (id[36] == 0x1d) in sff8079_show_transceiver()
208 printf("%s Extended: 5GBASE-T\n", pfx); in sff8079_show_transceiver()
209 if (id[36] == 0x1e) in sff8079_show_transceiver()
210 printf("%s Extended: 2.5GBASE-T\n", pfx); in sff8079_show_transceiver()
211 if (id[36] == 0x1f) in sff8079_show_transceiver()
213 if (id[36] == 0x20) in sff8079_show_transceiver()
215 if (id[36] == 0x21) in sff8079_show_transceiver()
217 if (id[36] == 0x22) in sff8079_show_transceiver()
218 …printf("%s Extended: 4WDM-10 MSA (10km version of 100G CWDM4 with same RS(528,514) FEC in host sys… in sff8079_show_transceiver()
220 if (id[36] == 0x23) in sff8079_show_transceiver()
221 …printf("%s Extended: 4WDM-20 MSA (20km version of 100GBASE-LR4 with RS(528,514) FEC in host system… in sff8079_show_transceiver()
223 if (id[36] == 0x24) in sff8079_show_transceiver()
224 …printf("%s Extended: 4WDM-40 MSA (40km reach with APD receiver and RS(528,514) FEC in host system)… in sff8079_show_transceiver()
226 if (id[36] == 0x25) in sff8079_show_transceiver()
227 printf("%s Extended: 100GBASE-DR (clause 140), CAUI-4 (no FEC)\n", pfx); in sff8079_show_transceiver()
228 if (id[36] == 0x26) in sff8079_show_transceiver()
229 printf("%s Extended: 100G-FR or 100GBASE-FR1 (clause 140), CAUI-4 (no FEC)\n", pfx); in sff8079_show_transceiver()
230 if (id[36] == 0x27) in sff8079_show_transceiver()
231 printf("%s Extended: 100G-LR or 100GBASE-LR1 (clause 140), CAUI-4 (no FEC)\n", pfx); in sff8079_show_transceiver()
232 if (id[36] == 0x30) in sff8079_show_transceiver()
233 …s Extended: Active Copper Cable with 50GAUI, 100GAUI-2 or 200GAUI-4 C2M. Providing a worst BER of … in sff8079_show_transceiver()
235 if (id[36] == 0x31) in sff8079_show_transceiver()
236 … Extended: Active Optical Cable with 50GAUI, 100GAUI-2 or 200GAUI-4 C2M. Providing a worst BER of … in sff8079_show_transceiver()
238 if (id[36] == 0x32) in sff8079_show_transceiver()
239 …d: Active Copper Cable with 50GAUI, 100GAUI-2 or 200GAUI-4 C2M. Providing a worst BER of 2.6x10-4 … in sff8079_show_transceiver()
241 if (id[36] == 0x33) in sff8079_show_transceiver()
242 …: Active Optical Cable with 50GAUI, 100GAUI-2 or 200GAUI-4 C2M. Providing a worst BER of 2.6x10-4 … in sff8079_show_transceiver()
244 if (id[36] == 0x40) in sff8079_show_transceiver()
245 printf("%s Extended: 50GBASE-CR, 100GBASE-CR2, or 200GBASE-CR4\n", pfx); in sff8079_show_transceiver()
246 if (id[36] == 0x41) in sff8079_show_transceiver()
247 printf("%s Extended: 50GBASE-SR, 100GBASE-SR2, or 200GBASE-SR4\n", pfx); in sff8079_show_transceiver()
248 if (id[36] == 0x42) in sff8079_show_transceiver()
249 printf("%s Extended: 50GBASE-FR or 200GBASE-DR4\n", pfx); in sff8079_show_transceiver()
250 if (id[36] == 0x43) in sff8079_show_transceiver()
251 printf("%s Extended: 200GBASE-FR4\n", pfx); in sff8079_show_transceiver()
252 if (id[36] == 0x44) in sff8079_show_transceiver()
254 if (id[36] == 0x45) in sff8079_show_transceiver()
255 printf("%s Extended: 50GBASE-LR\n", pfx); in sff8079_show_transceiver()
256 if (id[36] == 0x46) in sff8079_show_transceiver()
257 printf("%s Extended: 200GBASE-LR4\n", pfx); in sff8079_show_transceiver()
258 if (id[36] == 0x50) in sff8079_show_transceiver()
260 if (id[36] == 0x51) in sff8079_show_transceiver()
262 if (id[36] == 0x52) in sff8079_show_transceiver()
264 if (id[36] == 0x53) in sff8079_show_transceiver()
266 if (id[36] == 0x54) in sff8079_show_transceiver()
268 if (id[36] == 0x55) in sff8079_show_transceiver()
272 static void sff8079_show_encoding(const __u8 *id) in sff8079_show_encoding() argument
274 sff8024_show_encoding(id, 11, ETH_MODULE_SFF_8472); in sff8079_show_encoding()
277 static void sff8079_show_rate_identifier(const __u8 *id) in sff8079_show_rate_identifier() argument
279 printf("\t%-41s : 0x%02x", "Rate identifier", id[13]); in sff8079_show_rate_identifier()
280 switch (id[13]) { in sff8079_show_rate_identifier()
302 static void sff8079_show_oui(const __u8 *id) in sff8079_show_oui() argument
304 printf("\t%-41s : %02x:%02x:%02x\n", "Vendor OUI", in sff8079_show_oui()
305 id[37], id[38], id[39]); in sff8079_show_oui()
308 static void sff8079_show_wavelength_or_copper_compliance(const __u8 *id) in sff8079_show_wavelength_or_copper_compliance() argument
310 if (id[8] & (1 << 2)) { in sff8079_show_wavelength_or_copper_compliance()
311 printf("\t%-41s : 0x%02x", "Passive Cu cmplnce.", id[60]); in sff8079_show_wavelength_or_copper_compliance()
312 switch (id[60]) { in sff8079_show_wavelength_or_copper_compliance()
317 printf(" (SFF-8431 appendix E)"); in sff8079_show_wavelength_or_copper_compliance()
323 printf(" [SFF-8472 rev10.4 only]\n"); in sff8079_show_wavelength_or_copper_compliance()
324 } else if (id[8] & (1 << 3)) { in sff8079_show_wavelength_or_copper_compliance()
325 printf("\t%-41s : 0x%02x", "Active Cu cmplnce.", id[60]); in sff8079_show_wavelength_or_copper_compliance()
326 switch (id[60]) { in sff8079_show_wavelength_or_copper_compliance()
331 printf(" (SFF-8431 appendix E)"); in sff8079_show_wavelength_or_copper_compliance()
334 printf(" (SFF-8431 limiting)"); in sff8079_show_wavelength_or_copper_compliance()
340 printf(" [SFF-8472 rev10.4 only]\n"); in sff8079_show_wavelength_or_copper_compliance()
342 printf("\t%-41s : %unm\n", "Laser wavelength", in sff8079_show_wavelength_or_copper_compliance()
343 (id[60] << 8) | id[61]); in sff8079_show_wavelength_or_copper_compliance()
347 static void sff8079_show_value_with_unit(const __u8 *id, unsigned int reg, in sff8079_show_value_with_unit() argument
351 unsigned int val = id[reg]; in sff8079_show_value_with_unit()
353 printf("\t%-41s : %u%s\n", name, val * mult, unit); in sff8079_show_value_with_unit()
356 static void sff8079_show_ascii(const __u8 *id, unsigned int first_reg, in sff8079_show_ascii() argument
361 printf("\t%-41s : ", name); in sff8079_show_ascii()
362 while (first_reg <= last_reg && id[last_reg] == ' ') in sff8079_show_ascii()
363 last_reg--; in sff8079_show_ascii()
365 val = id[reg]; in sff8079_show_ascii()
371 static void sff8079_show_options(const __u8 *id) in sff8079_show_options() argument
376 printf("\t%-41s : 0x%02x 0x%02x\n", "Option values", id[64], id[65]); in sff8079_show_options()
377 if (id[65] & (1 << 1)) in sff8079_show_options()
379 if (id[65] & (1 << 2)) in sff8079_show_options()
381 if (id[65] & (1 << 3)) in sff8079_show_options()
383 if (id[65] & (1 << 4)) in sff8079_show_options()
385 if (id[65] & (1 << 5)) in sff8079_show_options()
387 if (id[65] & (1 << 6)) in sff8079_show_options()
389 if (id[65] & (1 << 7)) in sff8079_show_options()
391 if (id[64] & (1 << 0)) in sff8079_show_options()
393 if (id[64] & (1 << 1)) in sff8079_show_options()
395 if (id[64] & (1 << 2)) in sff8079_show_options()
397 if (id[64] & (1 << 3)) in sff8079_show_options()
399 if (id[64] & (1 << 4)) in sff8079_show_options()
401 if (id[64] & (1 << 5)) in sff8079_show_options()
405 static void sff8079_show_all_common(const __u8 *id) in sff8079_show_all_common() argument
407 sff8079_show_identifier(id); in sff8079_show_all_common()
408 if (((id[0] == 0x02) || (id[0] == 0x03)) && (id[1] == 0x04)) { in sff8079_show_all_common()
411 if (id[12] == 0) { in sff8079_show_all_common()
413 } else if (id[12] == 255) { in sff8079_show_all_common()
414 br_nom = id[66] * 250; in sff8079_show_all_common()
415 br_max = id[67]; in sff8079_show_all_common()
416 br_min = id[67]; in sff8079_show_all_common()
418 br_nom = id[12] * 100; in sff8079_show_all_common()
419 br_max = id[66]; in sff8079_show_all_common()
420 br_min = id[67]; in sff8079_show_all_common()
422 sff8079_show_ext_identifier(id); in sff8079_show_all_common()
423 sff8079_show_connector(id); in sff8079_show_all_common()
424 sff8079_show_transceiver(id); in sff8079_show_all_common()
425 sff8079_show_encoding(id); in sff8079_show_all_common()
426 printf("\t%-41s : %u%s\n", "BR, Nominal", br_nom, "MBd"); in sff8079_show_all_common()
427 sff8079_show_rate_identifier(id); in sff8079_show_all_common()
428 sff8079_show_value_with_unit(id, 14, in sff8079_show_all_common()
430 sff8079_show_value_with_unit(id, 15, "Length (SMF)", 100, "m"); in sff8079_show_all_common()
431 sff8079_show_value_with_unit(id, 16, "Length (50um)", 10, "m"); in sff8079_show_all_common()
432 sff8079_show_value_with_unit(id, 17, in sff8079_show_all_common()
434 sff8079_show_value_with_unit(id, 18, "Length (Copper)", 1, "m"); in sff8079_show_all_common()
435 sff8079_show_value_with_unit(id, 19, "Length (OM3)", 10, "m"); in sff8079_show_all_common()
436 sff8079_show_wavelength_or_copper_compliance(id); in sff8079_show_all_common()
437 sff8079_show_ascii(id, 20, 35, "Vendor name"); in sff8079_show_all_common()
438 sff8079_show_oui(id); in sff8079_show_all_common()
439 sff8079_show_ascii(id, 40, 55, "Vendor PN"); in sff8079_show_all_common()
440 sff8079_show_ascii(id, 56, 59, "Vendor rev"); in sff8079_show_all_common()
441 sff8079_show_options(id); in sff8079_show_all_common()
442 printf("\t%-41s : %u%s\n", "BR margin, max", br_max, "%"); in sff8079_show_all_common()
443 printf("\t%-41s : %u%s\n", "BR margin, min", br_min, "%"); in sff8079_show_all_common()
444 sff8079_show_ascii(id, 68, 83, "Vendor SN"); in sff8079_show_all_common()
445 sff8079_show_ascii(id, 84, 91, "Date code"); in sff8079_show_all_common()
449 void sff8079_show_all_ioctl(const __u8 *id) in sff8079_show_all_ioctl() argument
451 sff8079_show_all_common(id); in sff8079_show_all_ioctl()
475 /* The SFF-8472 parser expects a single buffer that contains the in sff8079_show_all_nl()
481 return -ENOMEM; in sff8079_show_all_nl()