/src/wireshark/epan/dissectors/packet-ncsi.c
Line | Count | Source |
1 | | /* packet-ncsi.c |
2 | | * |
3 | | * Extends NCSI dissection based on DMTF Document Identifier: DSP0222 Version: 1.2.0_2b |
4 | | * Copyright 2019-2021, Caleb Chiu <caleb.chiu@macnica.com> |
5 | | * |
6 | | * Routines for NCSI dissection |
7 | | * Copyright 2017-2019, Jeremy Kerr <jk@ozlabs.org> |
8 | | * |
9 | | * Wireshark - Network traffic analyzer |
10 | | * By Gerald Combs <gerald@wireshark.org> |
11 | | * Copyright 1998 Gerald Combs |
12 | | * |
13 | | * SPDX-License-Identifier: GPL-2.0-or-later |
14 | | */ |
15 | | |
16 | | /* |
17 | | * Network Controller Sideband Interface (NCSI) protocol support. |
18 | | * Specs at http://www.dmtf.org/sites/default/files/standards/documents/DSP0222_1.0.1.pdf |
19 | | */ |
20 | | |
21 | | |
22 | | #include <config.h> |
23 | | |
24 | | #include <epan/packet.h> |
25 | | #include <epan/etypes.h> |
26 | | #include <epan/tfs.h> |
27 | | #include <wsutil/array.h> |
28 | | #include <epan/addr_resolv.h> |
29 | | #include <epan/charsets.h> |
30 | | #include "packet-mctp.h" |
31 | | #include "data-ncsi.h" |
32 | | |
33 | | void proto_reg_handoff_ncsi(void); |
34 | | void proto_register_ncsi(void); |
35 | | |
36 | | static int proto_ncsi; |
37 | | static dissector_handle_t ncsi_handle; |
38 | | |
39 | | /* Common header fields */ |
40 | | static int hf_ncsi_mc_id; |
41 | | static int hf_ncsi_revision; |
42 | | static int hf_ncsi_iid; |
43 | | static int hf_ncsi_type; |
44 | | static int hf_ncsi_type_code; |
45 | | static int hf_ncsi_type_code_masked; |
46 | | static int hf_ncsi_type_resp; |
47 | | static int hf_ncsi_chan; |
48 | | static int hf_ncsi_plen; |
49 | | |
50 | | /* Decode the Package# and internal channel# */ |
51 | | static int hf_ncsi_pkg; |
52 | | static int hf_ncsi_ichan; |
53 | | |
54 | | /* Response generics */ |
55 | | static int hf_ncsi_resp; |
56 | | static int hf_ncsi_reason; |
57 | | |
58 | | /* Select package */ |
59 | | static int hf_ncsi_sp_hwarb; |
60 | | |
61 | | /* Disable channel */ |
62 | | static int hf_ncsi_dc_ald; |
63 | | |
64 | | /* AEN enable */ |
65 | | static int hf_ncsi_aene_mc; |
66 | | |
67 | | /* Set MAC Address */ |
68 | | static int hf_ncsi_sm_mac; |
69 | | static int hf_ncsi_sm_macno; |
70 | | static int hf_ncsi_sm_at; |
71 | | static int hf_ncsi_sm_e; |
72 | | |
73 | | /* Broadcast filter */ |
74 | | static int hf_ncsi_bf; |
75 | | static int hf_ncsi_bf_arp; |
76 | | static int hf_ncsi_bf_dhcpc; |
77 | | static int hf_ncsi_bf_dhcps; |
78 | | static int hf_ncsi_bf_netbios; |
79 | | |
80 | | /* AEN payload fields */ |
81 | | static int hf_ncsi_aen_type; |
82 | | static int hf_ncsi_aen_lsc_oemstat; |
83 | | static int hf_ncsi_aen_hcds; |
84 | | static int hf_ncsi_aen_drr_orig_type; |
85 | | static int hf_ncsi_aen_drr_orig_iid; |
86 | | |
87 | | /* generic link status */ |
88 | | static int hf_ncsi_lstat; |
89 | | static int hf_ncsi_lstat_flag; |
90 | | static int hf_ncsi_lstat_speed_duplex; |
91 | | static int hf_ncsi_lstat_autoneg; |
92 | | static int hf_ncsi_lstat_autoneg_complete; |
93 | | static int hf_ncsi_lstat_parallel_detection; |
94 | | static int hf_ncsi_lstat_1000TFD; |
95 | | static int hf_ncsi_lstat_1000THD; |
96 | | static int hf_ncsi_lstat_100T4; |
97 | | static int hf_ncsi_lstat_100TXFD; |
98 | | static int hf_ncsi_lstat_100TXHD; |
99 | | static int hf_ncsi_lstat_10TFD; |
100 | | static int hf_ncsi_lstat_10THD; |
101 | | static int hf_ncsi_lstat_tx_flow; |
102 | | static int hf_ncsi_lstat_rx_flow; |
103 | | static int hf_ncsi_lstat_partner_flow; |
104 | | static int hf_ncsi_lstat_serdes; |
105 | | static int hf_ncsi_lstat_oem_speed_valid; |
106 | | |
107 | | /* Set Link command (0x09) */ |
108 | | static int hf_ncsi_ls; |
109 | | static int hf_ncsi_ls_an; |
110 | | static int hf_ncsi_ls_10m; |
111 | | static int hf_ncsi_ls_100m; |
112 | | static int hf_ncsi_ls_1g; |
113 | | static int hf_ncsi_ls_10g; |
114 | | static int hf_ncsi_ls_20g; |
115 | | static int hf_ncsi_ls_25g; |
116 | | static int hf_ncsi_ls_40g; |
117 | | static int hf_ncsi_ls_hd; |
118 | | static int hf_ncsi_ls_fd; |
119 | | static int hf_ncsi_ls_pc; |
120 | | static int hf_ncsi_ls_apc; |
121 | | static int hf_ncsi_ls_50g; |
122 | | static int hf_ncsi_ls_100g; |
123 | | static int hf_ncsi_ls_2_5g; |
124 | | static int hf_ncsi_ls_5g; |
125 | | static int hf_ncsi_ls_rsv; |
126 | | static int hf_ncsi_ls_oemls; |
127 | | |
128 | | /*Get Capabilities*/ |
129 | | static int hf_ncsi_cap_flag; /* Offset 20..23 Capabilities Flags */ |
130 | | static int hf_ncsi_cap_flag_ha; /* bit 0 Hardware Arbitration */ |
131 | | static int hf_ncsi_cap_flag_op; /* bit 1 OS Presence */ |
132 | | static int hf_ncsi_cap_flag_n2mfc; /* bit 2 Network Controller to Management Controller Flow Control Support */ |
133 | | static int hf_ncsi_cap_flag_m2nfc; /* bit 3 Management Controller to Network Controller Flow Control Support */ |
134 | | static int hf_ncsi_cap_flag_ama; /* bit 4 All multicast addresses support */ |
135 | | |
136 | | static int hf_ncsi_cap_bf; /* Offset 24..27 Broadcast Packet Filter Capabilities, the variable names are align with Broadcast filter above */ |
137 | | static int hf_ncsi_cap_bf_arp; |
138 | | static int hf_ncsi_cap_bf_dhcpc; |
139 | | static int hf_ncsi_cap_bf_dhcps; |
140 | | static int hf_ncsi_cap_bf_netbios; |
141 | | |
142 | | static int hf_ncsi_cap_mf; /* Offset 28..31 Multicast Packet Filter Capabilities */ |
143 | | static int hf_ncsi_cap_mf_v6na; |
144 | | static int hf_ncsi_cap_mf_v6ra; |
145 | | static int hf_ncsi_cap_mf_dhcpv6; |
146 | | |
147 | | static int hf_ncsi_cap_buf; /* Offset 32..35 Buffering Capability */ |
148 | | |
149 | | static int hf_ncsi_cap_aen; /* Offset 36..39 AEN Control Support */ |
150 | | static int hf_ncsi_cap_aen_lstat; /* bit 0 Link Status Change AEN control */ |
151 | | static int hf_ncsi_cap_aen_cfg; /* bit 1 Configuration Required AEN control */ |
152 | | static int hf_ncsi_cap_aen_drv; /* bit 2 Host NC Driver Status Change AEN control */ |
153 | | static int hf_ncsi_cap_aen_resv; /* bit 3..15 Reserved Reserved */ |
154 | | static int hf_ncsi_cap_aen_oem; /* bit 16..31 OEM-specific AEN control OEM */ |
155 | | |
156 | | static int hf_ncsi_cap_vcnt; /* VLAN Filter Count */ |
157 | | static int hf_ncsi_cap_mixcnt; /* Mixed Filter Count */ |
158 | | static int hf_ncsi_cap_mccnt; /* Multicast Filter Count */ |
159 | | static int hf_ncsi_cap_uccnt; /* Unicast Filter Count */ |
160 | | |
161 | | static int hf_ncsi_cap_vmode; /* VLAN Mode Support */ |
162 | | static int hf_ncsi_cap_vmode_vo; /* bit 0 VLAN only */ |
163 | | static int hf_ncsi_cap_vmode_both; /* bit 1 VLAN + non-VLAN */ |
164 | | static int hf_ncsi_cap_vmode_any; /* bit 2 Any VLAN + non-VLAN */ |
165 | | static int hf_ncsi_cap_chcnt; /* Channel Count */ |
166 | | |
167 | | /*Get Version ID*/ |
168 | | static int hf_ncsi_ver; |
169 | | static int hf_ncsi_fw_name; |
170 | | static int hf_ncsi_fw_ver; |
171 | | static int hf_ncsi_pci_did; |
172 | | static int hf_ncsi_pci_vid; |
173 | | static int hf_ncsi_pci_ssid; |
174 | | static int hf_ncsi_iana; |
175 | | |
176 | | /* OEM ID */ |
177 | | static int hf_ncsi_oem_id; |
178 | | /* OEM Mellanox Command, Parameter, Host number */ |
179 | | static int hf_ncsi_mlnx_cmd; |
180 | | static int hf_ncsi_mlnx_parm; |
181 | | static int hf_ncsi_mlnx_host; |
182 | | /* OEM Mellanox Set MC Affinity (Command = 0x1, parameter 0x7) */ |
183 | | static int hf_ncsi_mlnx_rbt; /* MC RBT address */ |
184 | | static int hf_ncsi_mlnx_sms; /* Supported Medias Status */ |
185 | | static int hf_ncsi_mlnx_sms_rbt; |
186 | | static int hf_ncsi_mlnx_sms_smbus; |
187 | | static int hf_ncsi_mlnx_sms_pcie; |
188 | | static int hf_ncsi_mlnx_sms_rbts; |
189 | | static int hf_ncsi_mlnx_sms_smbuss; |
190 | | static int hf_ncsi_mlnx_sms_pcies; |
191 | | |
192 | | static int hf_ncsi_mlnx_beid; /* MC SMBus EID */ |
193 | | static int hf_ncsi_mlnx_bidx; /* SMBus INDX */ |
194 | | static int hf_ncsi_mlnx_baddr; /* MC SMBus Address */ |
195 | | static int hf_ncsi_mlnx_peid; /* MC PCIe EID */ |
196 | | static int hf_ncsi_mlnx_pidx; /* PCIe INDX */ |
197 | | static int hf_ncsi_mlnx_paddr; /* MC PCIe Address */ |
198 | | static int hf_ncsi_mlnx_ifm; /* IP Filter Mode */ |
199 | | static int hf_ncsi_mlnx_ifm_byip; /* Bits 1-0 - Filter by IP Address */ |
200 | | static int hf_ncsi_mlnx_ifm_v4en; /* Bit 2 - IPv4 Enable */ |
201 | | static int hf_ncsi_mlnx_ifm_v6len; /* Bit 3 - IPv6 Link Local Address Enable */ |
202 | | static int hf_ncsi_mlnx_ifm_v6gen; /* Bit 4 - IPv6 Global Address Enable */ |
203 | | static int hf_ncsi_mlnx_v4addr; /* MC IPv4 Address */ |
204 | | static int hf_ncsi_mlnx_v6local; /* MC IPv6 Link Local Address */ |
205 | | static int hf_ncsi_mlnx_v6gbl; /* MC IPv6 Global Address */ |
206 | | |
207 | | /* Get Allocated Management Address (Command = 0x0, Parameter 0x1B) */ |
208 | | static int hf_ncsi_mlnx_gama_st; /*Get Allocated Management Address Status */ |
209 | | static int hf_ncsi_mlnx_gama_mac; /*Allocated MC MAC address */ |
210 | | |
211 | | /* Get Temperature (Command = 0x13, Parameter = 0x2) */ |
212 | | static int hf_ncsi_mlnx_gtemp_index; /*Sensor index */ |
213 | | static int hf_ncsi_mlnx_gtemp_sp; /*ST */ |
214 | | static int hf_ncsi_mlnx_gtemp_sindex; /*Sensor index */ |
215 | | static int hf_ncsi_mlnx_gtemp_pad_mms; |
216 | | static int hf_ncsi_mlnx_gtemp_pad; |
217 | | static int hf_ncsi_mlnx_gtemp_mms; |
218 | | static int hf_ncsi_mlnx_temp1; |
219 | | static int hf_ncsi_mlnx_temp2; |
220 | | static int hf_ncsi_mlnx_temp3; |
221 | | |
222 | | |
223 | | static int ett_ncsi; |
224 | | static int ett_ncsi_type; |
225 | | static int ett_ncsi_chan; |
226 | | static int ett_ncsi_payload; |
227 | | static int ett_ncsi_lstat; |
228 | | static int ett_ncsi_cap_flag; |
229 | | static int ett_ncsi_cap_bf; |
230 | | static int ett_ncsi_cap_mf; |
231 | | static int ett_ncsi_cap_aen; |
232 | | static int ett_ncsi_cap_vmode; |
233 | | static int ett_ncsi_ls; |
234 | | static int ett_ncsi_mlnx; |
235 | | static int ett_ncsi_mlnx_sms; |
236 | | static int ett_ncsi_mlnx_ifm; |
237 | | static int ett_ncsi_mlnx_gtemp; |
238 | | |
239 | 28 | #define NCSI_MIN_LENGTH 8 |
240 | | |
241 | | /* DMTF Document Identifier: DSP0222 Version: 1.2.0_2b */ |
242 | | enum ncsi_type { |
243 | | NCSI_TYPE_CLS = 0x00, /* Clear Initial State */ |
244 | | NCSI_TYPE_SEL = 0x01, /* Select Package */ |
245 | | NCSI_TYPE_DSL = 0x02, /* Deselect Package */ |
246 | | NCSI_TYPE_ECH = 0x03, /* Enable Channel */ |
247 | | NCSI_TYPE_DCH = 0x04, /* Disable Channel */ |
248 | | NCSI_TYPE_RCH = 0x05, /* Reset Channel */ |
249 | | NCSI_TYPE_ETX = 0x06, /* Enable Channel Network TX */ |
250 | | NCSI_TYPE_DTX = 0x07, /* Disable Channel Network TX */ |
251 | | NCSI_TYPE_ANE = 0x08, /* AEN Enable */ |
252 | | NCSI_TYPE_SLK = 0x09, /* Set Link */ |
253 | | NCSI_TYPE_GLS = 0x0a, /* Get Link Status */ |
254 | | NCSI_TYPE_SVF = 0x0b, /* Set VLAN Filter */ |
255 | | NCSI_TYPE_EVL = 0x0c, /* Enable VLAN */ |
256 | | NCSI_TYPE_DVL = 0x0d, /* Disable VLAN */ |
257 | | NCSI_TYPE_MAC = 0x0e, /* Set MAC Address */ |
258 | | NCSI_TYPE_EBF = 0x10, /* Enable Broadcast Filter */ |
259 | | NCSI_TYPE_DBF = 0x11, /* Disable Broadcast Filter */ |
260 | | NCSI_TYPE_EMF = 0x12, /* Enable Global Multicast Filter */ |
261 | | NCSI_TYPE_DMF = 0x13, /* Disable Global Multicast Filter */ |
262 | | NCSI_TYPE_SFC = 0x14, /* Set NC-SI Flow Control */ |
263 | | NCSI_TYPE_VER = 0x15, /* Get Version ID */ |
264 | | NCSI_TYPE_CAP = 0x16, /* Get Capabilities */ |
265 | | NCSI_TYPE_PAR = 0x17, /* Get Parameters */ |
266 | | NCSI_TYPE_CPS = 0x18, /* Get Controller Packet Statistics */ |
267 | | NCSI_TYPE_GST = 0x19, /* Get NC-SI Statistics */ |
268 | | NCSI_TYPE_PST = 0x1a, /* Get NC-SI Pass- through Statistics */ |
269 | | NCSI_TYPE_GPS = 0x1b, /* Get Package Status */ |
270 | | NCSI_TYPE_GPA = 0x1c, /* Get PF Assignment */ |
271 | | NCSI_TYPE_SPA = 0x1d, /* Set PF Assignment */ |
272 | | NCSI_TYPE_GBC = 0x1e, /* Get Boot Config */ |
273 | | NCSI_TYPE_SBC = 0x1f, /* Set Boot Config */ |
274 | | NCSI_TYPE_IOS = 0x20, /* Get iSCSI Offload Statistics */ |
275 | | NCSI_TYPE_GPB = 0x21, /* Get Partition TX Bandwidth */ |
276 | | NCSI_TYPE_SPB = 0x22, /* Set Partition TX Bandwidth */ |
277 | | NCSI_TYPE_GIT = 0x23, /* Get ASIC Temperature */ |
278 | | NCSI_TYPE_GAT = 0x24, /* Get Ambient Temperature */ |
279 | | NCSI_TYPE_GMT = 0x25, /* Get SFF Module Temp */ |
280 | | NCSI_TYPE_OEM = 0x50, /* OEM Command */ |
281 | | NCSI_TYPE_PLDM = 0x51, /* PLDM */ |
282 | | NCSI_TYPE_UUID = 0x52, /* Get Package UUID */ |
283 | | NCSI_TYPE_AEN = 0xff, |
284 | | }; |
285 | | |
286 | | |
287 | | enum ncsi_oem_id { |
288 | | NCSI_OEM_MLX = 0x8119, |
289 | | NCSI_OEM_BCM = 0x113d, |
290 | | }; |
291 | | |
292 | | static const value_string ncsi_resp_code_vals[] = { |
293 | | { 0x0000, "Command Completed" }, |
294 | | { 0x0001, "Command Failed" }, |
295 | | { 0x0002, "Command Unavailable" }, |
296 | | { 0x0003, "Command Unsupported" }, |
297 | | { 0x0004, "Delayed" }, |
298 | | { 0, NULL }, |
299 | | }; |
300 | | |
301 | | static const value_string ncsi_resp_reason_vals[] = { |
302 | | { 0x0000, "No Error/No Reason Code" }, |
303 | | { 0x0001, "Interface Initialization Required" }, |
304 | | { 0x0002, "Parameter Is Invalid, Unsupported, or Out-of-Range" }, |
305 | | { 0x0003, "Channel Not Ready" }, |
306 | | { 0x0004, "Package Not Ready" }, |
307 | | { 0x0005, "Invalid payload length" }, |
308 | | { 0x0006, "Information not available" }, |
309 | | { 0x0901, "Set Link Host OS/ Driver Conflict" }, |
310 | | { 0x0902, "Set Link Media Conflict" }, |
311 | | { 0x0903, "Set Link Parameter Conflict" }, |
312 | | { 0x0904, "Set Link Power Mode Conflict" }, |
313 | | { 0x0905, "Set Link Speed Conflict" }, |
314 | | { 0x0906, "Link Command Failed-Hardware Access Error" }, |
315 | | { 0x0a06, "Link Command Failed-Hardware Access Error" }, |
316 | | { 0x0b07, "VLAN Tag Is Invalid"}, |
317 | | { 0x0e08, "MAC Address Is Zero"}, |
318 | | { 0x1409, "Independent transmit and receive enable/disable control is not supported"}, |
319 | | { 0x800c, "Link Command Failed-Hardware Access Error"}, |
320 | | { 0, NULL }, |
321 | | }; |
322 | | |
323 | | |
324 | | |
325 | | static const value_string ncsi_type_vals[] = { |
326 | | { NCSI_TYPE_CLS, "Clear Initial State" }, |
327 | | { NCSI_TYPE_SEL, "Select Package" }, |
328 | | { NCSI_TYPE_DSL, "Deselect Package" }, |
329 | | { NCSI_TYPE_ECH, "Enable Channel" }, |
330 | | { NCSI_TYPE_DCH, "Disable Channel" }, |
331 | | { NCSI_TYPE_RCH, "Reset Channel" }, |
332 | | { NCSI_TYPE_ETX, "Enable Channel Network TX" }, |
333 | | { NCSI_TYPE_DTX, "Disable Channel Network TX" }, |
334 | | { NCSI_TYPE_ANE, "AEN Enable" }, |
335 | | { NCSI_TYPE_SLK, "Set Link" }, |
336 | | { NCSI_TYPE_GLS, "Get Link Status" }, |
337 | | { NCSI_TYPE_SVF, "Set VLAN Filter" }, |
338 | | { NCSI_TYPE_EVL, "Enable VLAN" }, |
339 | | { NCSI_TYPE_DVL, "Disable VLAN" }, |
340 | | { NCSI_TYPE_MAC, "Set MAC Address" }, |
341 | | { NCSI_TYPE_EBF, "Enable Broadcast Filter" }, |
342 | | { NCSI_TYPE_DBF, "Disable Broadcast Filter" }, |
343 | | { NCSI_TYPE_EMF, "Enable Global Multicast Filter" }, |
344 | | { NCSI_TYPE_DMF, "Disable Global Multicast Filter" }, |
345 | | { NCSI_TYPE_SFC, "Set NC-SI Flow Control" }, |
346 | | { NCSI_TYPE_VER, "Get Version ID" }, |
347 | | { NCSI_TYPE_CAP, "Get Capabilities" }, |
348 | | { NCSI_TYPE_PAR, "Get Parameters" }, |
349 | | { NCSI_TYPE_CPS, "Get Controller Packet Statistics" }, |
350 | | { NCSI_TYPE_GST, "Get NC-SI Statistics" }, |
351 | | { NCSI_TYPE_PST, "Get NC-SI Pass- through Statistics" }, |
352 | | { NCSI_TYPE_GPS, "Get Package Status" }, |
353 | | { NCSI_TYPE_GPA, "Get PF Assignment" }, |
354 | | { NCSI_TYPE_SPA, "Set PF Assignment" }, |
355 | | { NCSI_TYPE_GBC, "Get Boot Config" }, |
356 | | { NCSI_TYPE_SBC, "Set Boot Config" }, |
357 | | { NCSI_TYPE_IOS, "Get iSCSI Offload Statistics" }, |
358 | | { NCSI_TYPE_GPB, "Get Partition TX Bandwidth" }, |
359 | | { NCSI_TYPE_SPB, "Set Partition TX Bandwidth" }, |
360 | | { NCSI_TYPE_GIT, "Get ASIC Temperature" }, |
361 | | { NCSI_TYPE_GAT, "Get Ambient Temperature" }, |
362 | | { NCSI_TYPE_GMT, "Get SFF Module Temp" }, |
363 | | { NCSI_TYPE_OEM, "OEM Command" }, |
364 | | { NCSI_TYPE_PLDM, "PLDM" }, |
365 | | { NCSI_TYPE_UUID, "Get Package UUID" }, |
366 | | { NCSI_TYPE_AEN, "Async Event Notification" }, |
367 | | { 0, NULL }, |
368 | | }; |
369 | | |
370 | | static const value_string ncsi_oem_id_vals[] = { |
371 | | { NCSI_OEM_MLX, "Mellanox" }, |
372 | | { NCSI_OEM_BCM, "Broadcom" }, |
373 | | { 0, NULL }, |
374 | | }; |
375 | | |
376 | | static const value_string ncsi_type_resp_vals[] = { |
377 | | { 0x00, "request" }, |
378 | | { 0x01, "response" }, |
379 | | { 0, NULL }, |
380 | | }; |
381 | | |
382 | | static const value_string ncsi_aen_type_vals[] = { |
383 | | { 0x00, "Link status change" }, |
384 | | { 0x01, "Configuration required" }, |
385 | | { 0x02, "Host NC driver status change" }, |
386 | | { 0x03, "Delayed Response Ready" }, |
387 | | { 0, NULL }, |
388 | | }; |
389 | | |
390 | | static const true_false_string tfs_linkup_linkdown = { "Link up", "Link down" }; |
391 | | |
392 | | static const value_string ncsi_lstat_speed_duplex_vals[] = { |
393 | | { 0x00, "Auto-negotiate not complete" }, |
394 | | { 0x01, "10BaseT half duplex" }, |
395 | | { 0x02, "10BaseT full duplex" }, |
396 | | { 0x03, "100BaseT half duplex" }, |
397 | | { 0x04, "100BaseT4" }, |
398 | | { 0x05, "100BaseTX full duplex" }, |
399 | | { 0x06, "1000BaseT half duplex" }, |
400 | | { 0x07, "1000BaseT full duplex" }, |
401 | | { 0x08, "10GBaseT support" }, |
402 | | { 0, NULL }, |
403 | | }; |
404 | | |
405 | | /* Mellanox MC IP Filter Mode */ |
406 | | static const value_string ncsi_mlnx_ifm_byip_vals[] = { |
407 | | { 0x00, "MAC address is used and IP address is ignored on pass-through" }, |
408 | | { 0x01, "MAC address is used and IP address is used on pass-through" }, |
409 | | { 0x02, "MAC address is ignored and IP address is used on pass-through" }, |
410 | | { 0x03, "Reserved" }, |
411 | | { 0, NULL }, |
412 | | }; |
413 | | |
414 | | static const true_false_string tfs_complete_disable_inprog = { "Complete", "Disabled/In-progress" }; |
415 | | |
416 | | static const value_string ncsi_partner_flow_vals[] = { |
417 | | { 0x00, "Not pause capable" }, |
418 | | { 0x01, "Symmetric pause" }, |
419 | | { 0x02, "Asymmetric pause" }, |
420 | | { 0x03, "Symmetric & Asymmetric pause" }, |
421 | | { 0, NULL }, |
422 | | }; |
423 | | |
424 | | |
425 | | static const value_string ncsi_mlnx_gama_st_vals[] = { |
426 | | { 0x00, "No MAC address was allocated for the requested BMC channel" }, |
427 | | { 0x01, "An address was allocated for the requested BMC channel" }, |
428 | | { 0, NULL }, |
429 | | }; |
430 | | |
431 | | static const true_false_string tfs_running_not_running = { "Running", "Not running" }; |
432 | | |
433 | | static const value_string ncsi_sm_at_vals[] = { |
434 | | { 0x00, "unicast" }, |
435 | | { 0x01, "multicast" }, |
436 | | { 0, NULL }, |
437 | | }; |
438 | | |
439 | | static const value_string ncsi_bf_filter_vals[] = { |
440 | | { 0x00, "drop" }, |
441 | | { 0x01, "forward" }, |
442 | | { 0, NULL }, |
443 | | }; |
444 | | |
445 | | static const value_string ncsi_mlnx_gtemp_sp_vals[] = { |
446 | | { 0x00, "Select system and on-chip sensor" }, |
447 | | { 0x01, "Select Port sensor" }, |
448 | | { 0, NULL }, |
449 | | }; |
450 | | |
451 | | |
452 | | static void |
453 | | ncsi_proto_tree_add_lstat(tvbuff_t *tvb, proto_tree *tree, int offset) |
454 | 0 | { |
455 | 0 | static int * const lstat_fields[] = { |
456 | 0 | &hf_ncsi_lstat_flag, |
457 | 0 | &hf_ncsi_lstat_speed_duplex, |
458 | 0 | &hf_ncsi_lstat_autoneg, |
459 | 0 | &hf_ncsi_lstat_autoneg_complete, |
460 | 0 | &hf_ncsi_lstat_parallel_detection, |
461 | 0 | &hf_ncsi_lstat_1000TFD, |
462 | 0 | &hf_ncsi_lstat_1000THD, |
463 | 0 | &hf_ncsi_lstat_100T4, |
464 | 0 | &hf_ncsi_lstat_100TXFD, |
465 | 0 | &hf_ncsi_lstat_100TXHD, |
466 | 0 | &hf_ncsi_lstat_10TFD, |
467 | 0 | &hf_ncsi_lstat_10THD, |
468 | 0 | &hf_ncsi_lstat_tx_flow, |
469 | 0 | &hf_ncsi_lstat_rx_flow, |
470 | 0 | &hf_ncsi_lstat_partner_flow, |
471 | 0 | &hf_ncsi_lstat_serdes, |
472 | 0 | &hf_ncsi_lstat_oem_speed_valid, |
473 | 0 | NULL, |
474 | 0 | }; |
475 | |
|
476 | 0 | proto_tree_add_bitmask_with_flags(tree, tvb, offset, hf_ncsi_lstat, |
477 | 0 | ett_ncsi_lstat, lstat_fields, ENC_BIG_ENDIAN, BMT_NO_APPEND); |
478 | 0 | } |
479 | | |
480 | | static void |
481 | | dissect_ncsi_aen(tvbuff_t *tvb, proto_tree *tree) |
482 | 3 | { |
483 | 3 | uint8_t type = tvb_get_uint8(tvb, 19); |
484 | 3 | proto_item *pi; |
485 | | |
486 | 3 | pi = proto_tree_add_item(tree, hf_ncsi_aen_type, tvb, 19, 1, ENC_NA); |
487 | | |
488 | 3 | if(type >= 0x4 && type <= 0x6f) |
489 | 1 | { |
490 | 1 | proto_item_set_text(pi, "Reserved (0x%02x)", type); |
491 | 1 | } |
492 | 2 | else |
493 | 2 | if(type >= 0x70 && type <= 0x7f) |
494 | 1 | { |
495 | 1 | proto_item_set_text(pi, "Transport-specific AENs (0x%02x)", type); |
496 | 1 | } |
497 | 1 | else |
498 | 1 | if(type >= 0x80) |
499 | 1 | { |
500 | 1 | proto_item_set_text(pi, "OEM-specific AENs (0x%02x)", type); |
501 | 1 | } |
502 | | |
503 | 3 | switch (type) { |
504 | 0 | case 0x00: //Link Status Change |
505 | 0 | ncsi_proto_tree_add_lstat(tvb, tree, 20); |
506 | 0 | proto_tree_add_item(tree, hf_ncsi_aen_lsc_oemstat, tvb, 24, 4, ENC_BIG_ENDIAN); |
507 | 0 | break; |
508 | 0 | case 0x02: //Host Network Controller Driver Status |
509 | 0 | proto_tree_add_item(tree, hf_ncsi_aen_hcds, tvb, 20, 4, ENC_BIG_ENDIAN); |
510 | 0 | break; |
511 | 0 | case 0x03: //Delayed Response Ready |
512 | 0 | proto_tree_add_item(tree, hf_ncsi_aen_drr_orig_type, tvb, 20, 1, ENC_NA); |
513 | 0 | proto_tree_add_item(tree, hf_ncsi_aen_drr_orig_iid, tvb, 21, 1, ENC_NA); |
514 | |
|
515 | 0 | break; |
516 | 3 | } |
517 | 3 | } |
518 | | |
519 | | |
520 | | |
521 | | /* NC-SI Version encoding |
522 | | * |
523 | | * EXAMPLE: Version 3.7.10a ï‚® 0xF3F7104100 |
524 | | * Version 10.01.7 ï‚® 0x1001F70000 |
525 | | * Version 3.1 ï‚® 0xF3F1FF0000 |
526 | | * Version 1.0a ï‚® 0xF1F0FF4100 |
527 | | * Version 1.0ab ï‚® 0xF1F0FF4142 (Alpha1 = 0x41, Alpha2 = 0x42) |
528 | | */ |
529 | | |
530 | 70 | #define HEXSTR(x) (((x) < 10)? '0' + (x): 'A' + ((x) - 10)) |
531 | | |
532 | | static const char * |
533 | | ncsi_bcd_dig_to_str(wmem_allocator_t *scope, tvbuff_t *tvb, const int offset) |
534 | 5 | { |
535 | 5 | uint8_t octet; |
536 | 5 | int i; |
537 | 5 | char digit_str[16]; /* MM.mm.uu.aa.bb */ |
538 | 5 | int str_offset = 0; |
539 | | |
540 | 20 | for (i = 0 ; i < 3; i++) { |
541 | 15 | octet = tvb_get_uint8(tvb, offset + i); |
542 | | |
543 | 15 | if (octet == 0xff) { |
544 | 0 | break; |
545 | 0 | } |
546 | | |
547 | 15 | if (i != 0) { |
548 | 10 | digit_str[str_offset++] = '.'; |
549 | 10 | } |
550 | | |
551 | 15 | digit_str[str_offset++] = HEXSTR((octet >> 4) & 0x0f); |
552 | 15 | digit_str[str_offset++] = HEXSTR(octet & 0x0f); |
553 | | |
554 | 15 | } |
555 | | |
556 | 5 | octet = tvb_get_uint8(tvb, offset + 3); |
557 | 5 | if (octet) { |
558 | 3 | digit_str[str_offset++] = '.'; |
559 | 3 | digit_str[str_offset++] = octet; |
560 | | |
561 | 3 | octet = tvb_get_uint8(tvb, offset + 7); |
562 | 3 | if (octet) { |
563 | 2 | digit_str[str_offset++] = '.'; |
564 | 2 | digit_str[str_offset++] = octet; |
565 | 2 | } |
566 | | |
567 | 3 | } |
568 | | |
569 | 5 | digit_str[str_offset] = '\0'; |
570 | 5 | return (const char*)get_utf_8_string(scope, (uint8_t*)digit_str, strlen(digit_str)); |
571 | | |
572 | 5 | } |
573 | | |
574 | | |
575 | | static const char * |
576 | | ncsi_fw_version(wmem_allocator_t *scope, tvbuff_t *tvb, const int offset) |
577 | 5 | { |
578 | 5 | int length = 16; /* hh.hh.hh.hh */ |
579 | 5 | uint8_t octet; |
580 | 5 | int i; |
581 | 5 | char *ver_str; |
582 | 5 | int str_offset = 0; |
583 | | |
584 | | |
585 | 5 | ver_str = (char *)wmem_alloc(scope, length); |
586 | | |
587 | 25 | for (i = 0 ; i < 4; i++) { |
588 | 20 | octet = tvb_get_uint8(tvb, offset + i); |
589 | | |
590 | 20 | if (i != 0) { |
591 | 15 | ver_str[str_offset++] = '.'; |
592 | 15 | } |
593 | | |
594 | 20 | ver_str[str_offset++] = HEXSTR((octet >> 4) & 0x0f); |
595 | 20 | ver_str[str_offset++] = HEXSTR(octet & 0x0f); |
596 | | |
597 | 20 | } |
598 | 5 | ver_str[str_offset++] = 0; |
599 | 5 | return ver_str; |
600 | 5 | } |
601 | | |
602 | | |
603 | | static void |
604 | | ncsi_proto_tree_add_cap(tvbuff_t *tvb, proto_tree *tree, int offset) |
605 | 1 | { |
606 | 1 | static int * const cap_fields[] = { |
607 | 1 | &hf_ncsi_cap_flag_ha, |
608 | 1 | &hf_ncsi_cap_flag_op, |
609 | 1 | &hf_ncsi_cap_flag_n2mfc, |
610 | 1 | &hf_ncsi_cap_flag_m2nfc, |
611 | 1 | &hf_ncsi_cap_flag_ama, |
612 | 1 | NULL, |
613 | 1 | }; |
614 | | |
615 | 1 | static int * const cap_bf_fields[] = { |
616 | 1 | &hf_ncsi_cap_bf_arp, |
617 | 1 | &hf_ncsi_cap_bf_dhcpc, |
618 | 1 | &hf_ncsi_cap_bf_dhcps, |
619 | 1 | &hf_ncsi_cap_bf_netbios, |
620 | 1 | NULL, |
621 | 1 | }; |
622 | | |
623 | 1 | static int * const cap_mf_fields[] = { |
624 | 1 | &hf_ncsi_cap_mf_v6na, |
625 | 1 | &hf_ncsi_cap_mf_v6ra, |
626 | 1 | &hf_ncsi_cap_mf_dhcpv6, |
627 | 1 | NULL, |
628 | 1 | }; |
629 | | |
630 | 1 | static int * const cap_aen_fields[] = { |
631 | 1 | &hf_ncsi_cap_aen_lstat, |
632 | 1 | &hf_ncsi_cap_aen_cfg, |
633 | 1 | &hf_ncsi_cap_aen_drv, |
634 | 1 | &hf_ncsi_cap_aen_resv, |
635 | 1 | &hf_ncsi_cap_aen_oem, |
636 | 1 | NULL, |
637 | 1 | }; |
638 | | |
639 | 1 | static int * const cap_vmode_fields[] = { |
640 | 1 | &hf_ncsi_cap_vmode_vo, |
641 | 1 | &hf_ncsi_cap_vmode_both, |
642 | 1 | &hf_ncsi_cap_vmode_any, |
643 | 1 | NULL, |
644 | 1 | }; |
645 | | |
646 | 1 | proto_tree_add_bitmask_with_flags(tree, tvb, offset, hf_ncsi_cap_flag, |
647 | 1 | ett_ncsi_cap_flag, cap_fields, ENC_BIG_ENDIAN, BMT_NO_APPEND); |
648 | 1 | offset += 4; |
649 | | |
650 | 1 | proto_tree_add_bitmask_with_flags(tree, tvb, offset, hf_ncsi_cap_bf, |
651 | 1 | ett_ncsi_cap_bf, cap_bf_fields, ENC_BIG_ENDIAN, BMT_NO_APPEND); |
652 | 1 | offset += 4; |
653 | | |
654 | 1 | proto_tree_add_bitmask_with_flags(tree, tvb, offset, hf_ncsi_cap_mf, |
655 | 1 | ett_ncsi_cap_mf, cap_mf_fields, ENC_BIG_ENDIAN, BMT_NO_APPEND); |
656 | 1 | offset += 4; |
657 | | |
658 | 1 | proto_tree_add_item(tree, hf_ncsi_cap_buf, tvb, offset, 4, ENC_BIG_ENDIAN); |
659 | 1 | offset += 4; |
660 | | |
661 | 1 | proto_tree_add_bitmask_with_flags(tree, tvb, offset, hf_ncsi_cap_aen, |
662 | 1 | ett_ncsi_cap_aen, cap_aen_fields, ENC_BIG_ENDIAN, BMT_NO_APPEND); |
663 | 1 | offset += 4; |
664 | | |
665 | 1 | proto_tree_add_item(tree, hf_ncsi_cap_vcnt, tvb, offset, 1, ENC_NA); |
666 | 1 | offset++; |
667 | | |
668 | 1 | proto_tree_add_item(tree, hf_ncsi_cap_mixcnt, tvb, offset, 1, ENC_NA); |
669 | 1 | offset++; |
670 | | |
671 | 1 | proto_tree_add_item(tree, hf_ncsi_cap_mccnt, tvb, offset, 1, ENC_NA); |
672 | 1 | offset++; |
673 | | |
674 | 1 | proto_tree_add_item(tree, hf_ncsi_cap_uccnt, tvb, offset, 1, ENC_NA); |
675 | 1 | offset++; |
676 | | |
677 | 1 | offset += 2; /* 2 reserved bytes */ |
678 | | |
679 | 1 | proto_tree_add_bitmask_with_flags(tree, tvb, offset, hf_ncsi_cap_vmode, |
680 | 1 | ett_ncsi_cap_vmode, cap_vmode_fields, ENC_BIG_ENDIAN, BMT_NO_APPEND); |
681 | 1 | offset++; |
682 | | |
683 | 1 | proto_tree_add_item(tree, hf_ncsi_cap_chcnt, tvb, offset, 1, ENC_NA); |
684 | 1 | } |
685 | | |
686 | | |
687 | | static void |
688 | | ncsi_proto_tree_add_setlink(tvbuff_t *tvb, proto_tree *tree, int offset) |
689 | 0 | { |
690 | |
|
691 | 0 | static int * const ls_fields[] = { |
692 | 0 | &hf_ncsi_ls_an, |
693 | 0 | &hf_ncsi_ls_10m, |
694 | 0 | &hf_ncsi_ls_100m, |
695 | 0 | &hf_ncsi_ls_1g, |
696 | 0 | &hf_ncsi_ls_10g, |
697 | 0 | &hf_ncsi_ls_20g, |
698 | 0 | &hf_ncsi_ls_25g, |
699 | 0 | &hf_ncsi_ls_40g, |
700 | 0 | &hf_ncsi_ls_hd, |
701 | 0 | &hf_ncsi_ls_fd, |
702 | 0 | &hf_ncsi_ls_pc, |
703 | 0 | &hf_ncsi_ls_apc, |
704 | 0 | &hf_ncsi_ls_50g, |
705 | 0 | &hf_ncsi_ls_100g, |
706 | 0 | &hf_ncsi_ls_2_5g, |
707 | 0 | &hf_ncsi_ls_5g, |
708 | 0 | &hf_ncsi_ls_rsv, |
709 | 0 | NULL, |
710 | 0 | }; |
711 | | |
712 | | |
713 | |
|
714 | 0 | proto_tree_add_bitmask_with_flags(tree, tvb, offset, hf_ncsi_ls, |
715 | 0 | ett_ncsi_ls, ls_fields, ENC_BIG_ENDIAN, BMT_NO_APPEND); |
716 | |
|
717 | 0 | proto_tree_add_item(tree, hf_ncsi_ls_oemls, tvb, offset + 4, 4, ENC_BIG_ENDIAN); |
718 | 0 | } |
719 | | |
720 | | /* Code to actually dissect the packets */ |
721 | | static int |
722 | | dissect_ncsi(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, |
723 | | void *data _U_) |
724 | 28 | { |
725 | 28 | proto_tree *ncsi_tree, *ncsi_payload_tree; |
726 | 28 | proto_item *ti, *pti; |
727 | 28 | uint8_t type, plen, poffset; |
728 | 28 | uint32_t resp_code, reason_code; |
729 | | |
730 | 28 | static int * const type_masked_fields[] = { |
731 | 28 | &hf_ncsi_type_code_masked, |
732 | 28 | &hf_ncsi_type_resp, |
733 | 28 | NULL, |
734 | 28 | }; |
735 | | |
736 | 28 | static int * const chan_fields[] = { |
737 | 28 | &hf_ncsi_pkg, |
738 | 28 | &hf_ncsi_ichan, |
739 | 28 | NULL, |
740 | 28 | }; |
741 | | |
742 | | /* Check that the packet is long enough for it to belong to us. */ |
743 | 28 | if (tvb_reported_length(tvb) < NCSI_MIN_LENGTH) |
744 | 1 | return 0; |
745 | | |
746 | | |
747 | 27 | col_set_str(pinfo->cinfo, COL_PROTOCOL, "NCSI"); |
748 | | |
749 | 27 | type = tvb_get_uint8(tvb, 4); |
750 | 27 | plen = tvb_get_uint8(tvb, 7); |
751 | | |
752 | 27 | col_clear(pinfo->cinfo, COL_INFO); |
753 | 27 | if (type == 0xff) { |
754 | 3 | col_add_fstr(pinfo->cinfo, COL_INFO, |
755 | 3 | "Async Event Notification, chan 0x%02x", |
756 | 3 | tvb_get_uint8(tvb, 5)); |
757 | 24 | } else { |
758 | 24 | col_add_fstr(pinfo->cinfo, COL_INFO, "%s %s, id 0x%02x, chan 0x%02x", |
759 | 24 | val_to_str(pinfo->pool, type & 0x7f, ncsi_type_vals, "Unknown type 0x%02x"), |
760 | 24 | type & 0x80 ? "response" : "request ", |
761 | 24 | tvb_get_uint8(tvb, 3), |
762 | 24 | tvb_get_uint8(tvb, 5)); |
763 | 24 | } |
764 | | |
765 | | |
766 | | /* Top-level NCSI protocol item & tree */ |
767 | 27 | ti = proto_tree_add_item(tree, proto_ncsi, tvb, 0, -1, ENC_NA); |
768 | 27 | ncsi_tree = proto_item_add_subtree(ti, ett_ncsi); |
769 | | /* Standard header fields */ |
770 | 27 | proto_tree_add_item(ncsi_tree, hf_ncsi_mc_id, tvb, 0, 1, ENC_NA); |
771 | 27 | proto_tree_add_item(ncsi_tree, hf_ncsi_revision, tvb, 1, 1, ENC_NA); |
772 | 27 | proto_tree_add_item(ncsi_tree, hf_ncsi_iid, tvb, 3, 1, ENC_NA); |
773 | 27 | if (type == NCSI_TYPE_AEN) |
774 | 3 | proto_tree_add_uint(ncsi_tree, hf_ncsi_type_code, tvb, 4, 1, type); |
775 | 24 | else |
776 | 24 | proto_tree_add_bitmask(ncsi_tree, tvb, 4, hf_ncsi_type, |
777 | 24 | ett_ncsi_type, type_masked_fields, ENC_NA); |
778 | | /* Package# and internal channel id */ |
779 | 27 | proto_tree_add_bitmask(ncsi_tree, tvb, 5, hf_ncsi_chan, |
780 | 27 | ett_ncsi_chan, chan_fields, ENC_NA); |
781 | 27 | proto_tree_add_item(ncsi_tree, hf_ncsi_plen, tvb, 7, 1, ENC_NA); |
782 | 27 | if (!plen) |
783 | 1 | return 16; |
784 | | |
785 | | /* Payload tree */ |
786 | 26 | ncsi_payload_tree = proto_tree_add_subtree(ncsi_tree, tvb, 16, |
787 | 26 | plen, ett_ncsi_payload, &pti, "Payload"); |
788 | | |
789 | | /* All responses start with response code & reason data */ |
790 | 26 | resp_code = 0; |
791 | 26 | reason_code = 0; |
792 | 26 | if (type != 0xff && type & 0x80) { |
793 | 12 | proto_tree_add_item_ret_uint(ncsi_payload_tree, hf_ncsi_resp, tvb, |
794 | 12 | 16, 2, ENC_BIG_ENDIAN, &resp_code); |
795 | 12 | proto_tree_add_item_ret_uint(ncsi_payload_tree, hf_ncsi_reason, tvb, |
796 | 12 | 18, 2, ENC_BIG_ENDIAN, &reason_code); |
797 | 12 | } |
798 | | |
799 | 26 | if (type == NCSI_TYPE_AEN) { |
800 | 3 | proto_item_set_text(pti, "Async Event Notification"); |
801 | 23 | } else { |
802 | 23 | proto_item_set_text(pti,"%s", val_to_str(pinfo->pool, (type & 0x7f), ncsi_type_vals, "Unknown type 0x%02x")); |
803 | 23 | proto_item_append_text(pti, type & 0x80 ? " response" : " request"); |
804 | 23 | } |
805 | | |
806 | 26 | switch (type) { |
807 | 0 | case 0x01: |
808 | 0 | proto_tree_add_item(ncsi_payload_tree, hf_ncsi_sp_hwarb, tvb, |
809 | 0 | 19, 1, ENC_NA); |
810 | 0 | break; |
811 | 0 | case 0x04: |
812 | 0 | proto_tree_add_item(ncsi_payload_tree, hf_ncsi_dc_ald, tvb, |
813 | 0 | 19, 1, ENC_NA); |
814 | 0 | break; |
815 | 0 | case 0x08: |
816 | 0 | proto_tree_add_item(ncsi_payload_tree, hf_ncsi_aene_mc, tvb, |
817 | 0 | 19, 1, ENC_NA); |
818 | 0 | break; |
819 | | |
820 | 0 | case 0x09: |
821 | 0 | ncsi_proto_tree_add_setlink(tvb, ncsi_payload_tree, 16); |
822 | 0 | break; |
823 | | |
824 | 0 | case 0x0e: |
825 | 0 | proto_tree_add_item(ncsi_payload_tree, hf_ncsi_sm_mac, tvb, |
826 | 0 | 16, 6, ENC_NA); |
827 | 0 | proto_tree_add_item(ncsi_payload_tree, hf_ncsi_sm_macno, tvb, |
828 | 0 | 22, 1, ENC_NA); |
829 | 0 | proto_tree_add_item(ncsi_payload_tree, hf_ncsi_sm_at, tvb, |
830 | 0 | 23, 1, ENC_NA); |
831 | 0 | proto_tree_add_item(ncsi_payload_tree, hf_ncsi_sm_e, tvb, |
832 | 0 | 23, 1, ENC_NA); |
833 | 0 | break; |
834 | 0 | case 0x10: |
835 | 0 | proto_tree_add_item(ncsi_payload_tree, hf_ncsi_bf, tvb, |
836 | 0 | 16, 4, ENC_BIG_ENDIAN); |
837 | 0 | proto_tree_add_item(ncsi_payload_tree, hf_ncsi_bf_arp, tvb, |
838 | 0 | 16, 4, ENC_BIG_ENDIAN); |
839 | 0 | proto_tree_add_item(ncsi_payload_tree, hf_ncsi_bf_dhcpc, tvb, |
840 | 0 | 16, 4, ENC_BIG_ENDIAN); |
841 | 0 | proto_tree_add_item(ncsi_payload_tree, hf_ncsi_bf_dhcps, tvb, |
842 | 0 | 16, 4, ENC_BIG_ENDIAN); |
843 | 0 | proto_tree_add_item(ncsi_payload_tree, hf_ncsi_bf_netbios, tvb, |
844 | 0 | 16, 4, ENC_BIG_ENDIAN); |
845 | 0 | break; |
846 | 0 | case NCSI_TYPE_OEM: |
847 | 0 | case NCSI_TYPE_OEM | 0x80: |
848 | 0 | poffset = 0; |
849 | 0 | if (type == (NCSI_TYPE_OEM | 0x80)) { |
850 | 0 | poffset = 4; |
851 | 0 | } |
852 | |
|
853 | 0 | proto_tree_add_item(ncsi_payload_tree, hf_ncsi_oem_id, tvb, |
854 | 0 | 16 + poffset, 4, ENC_BIG_ENDIAN); |
855 | |
|
856 | 0 | if (tvb_get_uint32(tvb, 16 + poffset, ENC_BIG_ENDIAN) == NCSI_OEM_MLX) { |
857 | 0 | proto_item *opti; |
858 | 0 | proto_tree *oem_payload_tree; |
859 | 0 | unsigned mlnx_cmd, mlnx_param; |
860 | | |
861 | | /* Mellanox OEM command */ |
862 | 0 | static int * const mlx_gtemp_fields[] = { |
863 | 0 | &hf_ncsi_mlnx_gtemp_sp, |
864 | 0 | &hf_ncsi_mlnx_gtemp_sindex, |
865 | 0 | NULL, |
866 | 0 | }; |
867 | |
|
868 | 0 | mlnx_cmd = tvb_get_uint8(tvb, 16 + poffset + 5); |
869 | 0 | mlnx_param = tvb_get_uint8(tvb, 16 + poffset + 6); |
870 | | /* OEM payload tree */ |
871 | 0 | oem_payload_tree = proto_tree_add_subtree(ncsi_payload_tree, tvb, 16 + poffset + 4, plen - poffset - 4, ett_ncsi_mlnx, &opti, "Mellanox OEM"); |
872 | |
|
873 | 0 | proto_tree_add_item(oem_payload_tree, hf_ncsi_mlnx_cmd, tvb, 16 + poffset + 5, 1, ENC_NA); |
874 | 0 | proto_tree_add_item(oem_payload_tree, hf_ncsi_mlnx_parm, tvb, 16 + poffset + 6, 1, ENC_NA); |
875 | | |
876 | |
|
877 | 0 | if (type == (NCSI_TYPE_OEM | 0x80)) { /* Reply */ |
878 | |
|
879 | 0 | static int * const mlx_gtemp_pad_fields[] = { |
880 | 0 | &hf_ncsi_mlnx_gtemp_pad, |
881 | 0 | &hf_ncsi_mlnx_gtemp_mms, |
882 | 0 | NULL, |
883 | 0 | }; |
884 | |
|
885 | 0 | if (mlnx_cmd == 0x0 && mlnx_param == 0x1b) { /* Get Allocated Management Address (Command = 0x0, Parameter 0x1B) */ |
886 | 0 | proto_tree_add_item(oem_payload_tree, hf_ncsi_mlnx_host, tvb, 16 + poffset + 7, 1, ENC_NA); |
887 | 0 | proto_item_set_text(opti, "Get Allocated Management Address reply"); |
888 | 0 | proto_tree_add_item(oem_payload_tree, hf_ncsi_mlnx_gama_st, tvb, 28, 1, ENC_NA); |
889 | 0 | proto_tree_add_item(oem_payload_tree, hf_ncsi_mlnx_gama_mac, tvb, 32, 6, ENC_NA); |
890 | 0 | } else if (mlnx_cmd == 0x1 && mlnx_param == 0x7) { /* Set MC Affinity (Command = 0x1, parameter 0x7) */ |
891 | 0 | proto_item_set_text(opti, "Set MC Affinity reply"); |
892 | 0 | } else if (mlnx_cmd == 0x13 && mlnx_param == 0x2){ /* Get Temperature (Command = 0x13, parameter 0x2) */ |
893 | 0 | proto_item_set_text(opti, "Get Temperature reply"); |
894 | 0 | proto_tree_add_bitmask(oem_payload_tree, tvb, 16 + poffset + 7, hf_ncsi_mlnx_gtemp_index, ett_ncsi_mlnx, mlx_gtemp_fields, ENC_NA); |
895 | 0 | proto_tree_add_bitmask(oem_payload_tree, tvb, 16 + poffset + 8, hf_ncsi_mlnx_gtemp_pad_mms, ett_ncsi_mlnx, mlx_gtemp_pad_fields, ENC_NA); |
896 | 0 | if(resp_code ==0 && reason_code == 0) { |
897 | 0 | proto_tree_add_item(oem_payload_tree, hf_ncsi_mlnx_temp1, tvb, 16 + poffset + 9, 1, ENC_NA); |
898 | 0 | proto_tree_add_item(oem_payload_tree, hf_ncsi_mlnx_temp2, tvb, 16 + poffset + 10, 1, ENC_NA); |
899 | 0 | proto_tree_add_item(oem_payload_tree, hf_ncsi_mlnx_temp3, tvb, 16 + poffset + 11, 1, ENC_NA); |
900 | 0 | } |
901 | 0 | } else { |
902 | 0 | proto_item_set_text(opti, "Unknown OEM reply"); |
903 | 0 | } |
904 | 0 | break; |
905 | 0 | } |
906 | | |
907 | | /* Request */ |
908 | | |
909 | 0 | if (mlnx_cmd == 0x0 && mlnx_param == 0x1b) { /* Get Allocated Management Address (Command = 0x0, Parameter 0x1B) */ |
910 | 0 | proto_item_set_text(opti, "Get Allocated Management Address request"); |
911 | 0 | } else if (mlnx_cmd == 0x1 && mlnx_param == 0x7) { /* Set MC Affinity (Command = 0x1, parameter 0x7) */ |
912 | 0 | static int * const mlnx_sms_fields[] = { |
913 | 0 | &hf_ncsi_mlnx_sms_rbt, |
914 | 0 | &hf_ncsi_mlnx_sms_smbus, |
915 | 0 | &hf_ncsi_mlnx_sms_pcie, |
916 | 0 | &hf_ncsi_mlnx_sms_rbts, |
917 | 0 | &hf_ncsi_mlnx_sms_smbuss, |
918 | 0 | &hf_ncsi_mlnx_sms_pcies, |
919 | 0 | NULL, |
920 | 0 | }; |
921 | |
|
922 | 0 | static int * const mlnx_ifm_fields[] = { |
923 | 0 | &hf_ncsi_mlnx_ifm_byip, |
924 | 0 | &hf_ncsi_mlnx_ifm_v4en, |
925 | 0 | &hf_ncsi_mlnx_ifm_v6len, |
926 | 0 | &hf_ncsi_mlnx_ifm_v6gen, |
927 | 0 | NULL, |
928 | 0 | }; |
929 | |
|
930 | 0 | proto_item_set_text(opti, "Set MC Affinity request"); |
931 | 0 | proto_tree_add_item(oem_payload_tree, hf_ncsi_mlnx_rbt, tvb, 24, 6, ENC_NA); |
932 | 0 | proto_tree_add_bitmask_with_flags(oem_payload_tree, tvb, 30, hf_ncsi_mlnx_sms, ett_ncsi_mlnx_sms, mlnx_sms_fields, ENC_BIG_ENDIAN, BMT_NO_APPEND); |
933 | 0 | proto_tree_add_item(oem_payload_tree, hf_ncsi_mlnx_beid, tvb, 31, 1, ENC_NA); |
934 | 0 | proto_tree_add_item(oem_payload_tree, hf_ncsi_mlnx_bidx, tvb, 32, 1, ENC_NA); |
935 | 0 | proto_tree_add_item(oem_payload_tree, hf_ncsi_mlnx_baddr, tvb, 33, 1, ENC_NA); |
936 | 0 | proto_tree_add_item(oem_payload_tree, hf_ncsi_mlnx_peid, tvb, 34, 1, ENC_NA); |
937 | 0 | proto_tree_add_item(oem_payload_tree, hf_ncsi_mlnx_pidx, tvb, 35, 1, ENC_NA); |
938 | 0 | proto_tree_add_item(oem_payload_tree, hf_ncsi_mlnx_paddr, tvb, 36, 2, ENC_BIG_ENDIAN); |
939 | |
|
940 | 0 | proto_tree_add_bitmask_with_flags(oem_payload_tree, tvb, 30, hf_ncsi_mlnx_ifm, ett_ncsi_mlnx_ifm, mlnx_ifm_fields, ENC_BIG_ENDIAN, BMT_NO_APPEND); |
941 | | |
942 | | /* IP Filter Mode */ |
943 | |
|
944 | 0 | proto_tree_add_item(oem_payload_tree, hf_ncsi_mlnx_v4addr, tvb, 40, 4, ENC_BIG_ENDIAN); |
945 | 0 | proto_tree_add_item(oem_payload_tree, hf_ncsi_mlnx_v6local, tvb, 44, 16, ENC_NA); |
946 | 0 | proto_tree_add_item(oem_payload_tree, hf_ncsi_mlnx_v6gbl, tvb, 60, 16, ENC_NA); |
947 | 0 | } else if (mlnx_cmd == 0x13 && mlnx_param == 0x2) { /* Get Temperature (Command = 0x13, parameter 0x2) */ |
948 | 0 | proto_item_set_text(opti, "Get Temperature"); |
949 | 0 | proto_tree_add_bitmask(oem_payload_tree, tvb, 16 + poffset + 7, hf_ncsi_mlnx_gtemp_index, ett_ncsi_mlnx, mlx_gtemp_fields, ENC_NA); |
950 | 0 | } |
951 | 0 | else { |
952 | 0 | proto_item_set_text(opti, "Unknown OEM request"); |
953 | 0 | } |
954 | |
|
955 | 0 | } /* NCSI_OEM_MLX */ |
956 | | |
957 | 0 | break; |
958 | 0 | case NCSI_TYPE_GLS | 0x80: |
959 | 0 | ncsi_proto_tree_add_lstat(tvb, ncsi_payload_tree, 20); |
960 | 0 | break; |
961 | 3 | case NCSI_TYPE_AEN: |
962 | 3 | dissect_ncsi_aen(tvb, ncsi_payload_tree); |
963 | 3 | break; |
964 | 6 | case NCSI_TYPE_VER | 0x80: |
965 | 6 | if (plen >= 40) { /* We got complete payload*/ |
966 | 5 | const char *ver_str; |
967 | 5 | proto_tree *ncsi_ver_tree; |
968 | 5 | char *fw_name; |
969 | 5 | uint16_t vid, did, svid, ssid; |
970 | | |
971 | 5 | ncsi_ver_tree = proto_tree_add_subtree(ncsi_payload_tree, tvb, 20, |
972 | 5 | plen - 4, ett_ncsi_payload, NULL, "Version ID"); |
973 | 5 | ver_str = ncsi_bcd_dig_to_str(pinfo->pool, tvb, 20); |
974 | 5 | proto_tree_add_string(ncsi_ver_tree, hf_ncsi_ver, tvb, 20, 8, ver_str); |
975 | | |
976 | 5 | fw_name = (char*)tvb_get_string_enc(pinfo->pool, tvb, 28, 12, ENC_ASCII); |
977 | 5 | proto_tree_add_string(ncsi_ver_tree, hf_ncsi_fw_name, tvb, 28, 12, fw_name); |
978 | 5 | proto_tree_add_string(ncsi_ver_tree, hf_ncsi_fw_ver, tvb, 40, 4, ncsi_fw_version(pinfo->pool, tvb, 40)); |
979 | | |
980 | 5 | vid = tvb_get_uint16(tvb, 46, ENC_BIG_ENDIAN); |
981 | 5 | did = tvb_get_uint16(tvb, 44, ENC_BIG_ENDIAN); |
982 | 5 | svid = tvb_get_uint16(tvb, 50, ENC_BIG_ENDIAN); |
983 | 5 | ssid = tvb_get_uint16(tvb, 48, ENC_BIG_ENDIAN); |
984 | | |
985 | 5 | proto_tree_add_string(ncsi_ver_tree, hf_ncsi_pci_vid, tvb, 46, 2, pci_id_str(vid, 0xffff, 0xffff, 0xffff)); |
986 | 5 | proto_tree_add_string(ncsi_ver_tree, hf_ncsi_pci_did, tvb, 44, 2, pci_id_str(vid, did, 0xffff, 0xffff)); |
987 | 5 | proto_tree_add_string(ncsi_ver_tree, hf_ncsi_pci_ssid, tvb, 48, 4, pci_id_str(vid, did, svid, ssid)); |
988 | 5 | proto_tree_add_item(ncsi_ver_tree, hf_ncsi_iana, tvb, 52, 4, ENC_BIG_ENDIAN); |
989 | 5 | } |
990 | 6 | break; |
991 | 2 | case NCSI_TYPE_CAP | 0x80: |
992 | 2 | if (plen >= 32) { /* We got complete payload */ |
993 | 1 | ncsi_proto_tree_add_cap(tvb, ncsi_payload_tree, 20); |
994 | 1 | } |
995 | 2 | break; |
996 | 26 | } |
997 | | |
998 | 24 | return tvb_captured_length(tvb); |
999 | 26 | } |
1000 | | |
1001 | | void |
1002 | | proto_register_ncsi(void) |
1003 | 14 | { |
1004 | | /* *INDENT-OFF* */ |
1005 | | /* Field definitions */ |
1006 | 14 | static hf_register_info hf[] = { |
1007 | 14 | { &hf_ncsi_mc_id, |
1008 | 14 | { "MC ID", "ncsi.mc_id", |
1009 | 14 | FT_UINT8, BASE_HEX, NULL, 0x0, |
1010 | 14 | "Management controller ID", HFILL }, |
1011 | 14 | }, |
1012 | 14 | { &hf_ncsi_revision, |
1013 | 14 | { "Revision", "ncsi.revision", |
1014 | 14 | FT_UINT8, BASE_HEX, NULL, 0x0, |
1015 | 14 | "Header revision", HFILL }, |
1016 | 14 | }, |
1017 | 14 | { &hf_ncsi_iid, |
1018 | 14 | { "IID", "ncsi.iid", |
1019 | 14 | FT_UINT8, BASE_HEX, NULL, 0x0, |
1020 | 14 | "Instance ID", HFILL }, |
1021 | 14 | }, |
1022 | 14 | { &hf_ncsi_type, |
1023 | 14 | { "Type", "ncsi.type", |
1024 | 14 | FT_UINT8, BASE_HEX, NULL, 0x0, |
1025 | 14 | "Packet type", HFILL }, |
1026 | 14 | }, |
1027 | 14 | { &hf_ncsi_type_code, |
1028 | 14 | { "Type code", "ncsi.type.code", |
1029 | 14 | FT_UINT8, BASE_HEX, VALS(ncsi_type_vals), 0, |
1030 | 14 | "Packet type code", HFILL }, |
1031 | 14 | }, |
1032 | 14 | { &hf_ncsi_type_code_masked, |
1033 | 14 | { "Type code", "ncsi.type.code_masked", |
1034 | 14 | FT_UINT8, BASE_HEX, VALS(ncsi_type_vals), 0x7f, |
1035 | 14 | "Packet type code (masked)", HFILL }, |
1036 | 14 | }, |
1037 | 14 | { &hf_ncsi_type_resp, |
1038 | 14 | { "Type req/resp", "ncsi.type.resp", |
1039 | 14 | FT_UINT8, BASE_HEX, VALS(ncsi_type_resp_vals), 0x80, |
1040 | 14 | "Packet type request/response", HFILL }, |
1041 | 14 | }, |
1042 | | |
1043 | 14 | { &hf_ncsi_chan, |
1044 | 14 | { "Channel", "ncsi.chan", |
1045 | 14 | FT_UINT8, BASE_HEX, NULL, 0x0, |
1046 | 14 | "NCSI Channel", HFILL }, |
1047 | 14 | }, |
1048 | 14 | { &hf_ncsi_pkg, |
1049 | 14 | { "Package ID", "ncsi.pkg", |
1050 | 14 | FT_UINT8, BASE_HEX, NULL, 0xe0, /* bits 7..5 */ |
1051 | 14 | "NCSI Internal Channel", HFILL }, |
1052 | 14 | }, |
1053 | 14 | { &hf_ncsi_ichan, |
1054 | 14 | { "Internal Channel ID", "ncsi.ichan", /* bits 4..0 */ |
1055 | 14 | FT_UINT8, BASE_HEX, NULL, 0x1f, |
1056 | 14 | "NCSI Internal Channel", HFILL }, |
1057 | 14 | }, |
1058 | 14 | { &hf_ncsi_plen, |
1059 | 14 | { "Payload Length", "ncsi.plen", |
1060 | 14 | FT_UINT8, BASE_HEX, NULL, 0x0, |
1061 | 14 | NULL, HFILL }, |
1062 | 14 | }, |
1063 | 14 | { &hf_ncsi_resp, |
1064 | 14 | { "Response", "ncsi.resp", |
1065 | 14 | FT_UINT16, BASE_HEX, VALS(ncsi_resp_code_vals), 0x0, |
1066 | 14 | "Response code", HFILL }, |
1067 | 14 | }, |
1068 | 14 | { &hf_ncsi_reason, |
1069 | 14 | { "Reason", "ncsi.reason", |
1070 | 14 | FT_UINT16, BASE_HEX, VALS(ncsi_resp_reason_vals), 0x0, |
1071 | 14 | "Reason code", HFILL }, |
1072 | 14 | }, |
1073 | 14 | { &hf_ncsi_sp_hwarb, |
1074 | 14 | { "Hardware arbitration disable", "ncsi.sp.hwarb", |
1075 | 14 | FT_UINT8, BASE_HEX, NULL, 0x0, |
1076 | 14 | NULL, HFILL }, |
1077 | 14 | }, |
1078 | 14 | { &hf_ncsi_dc_ald, |
1079 | 14 | { "Allow link down", "ncsi.dc.ald", |
1080 | 14 | FT_UINT8, BASE_HEX, NULL, 0x1, |
1081 | 14 | NULL, HFILL }, |
1082 | 14 | }, |
1083 | 14 | { &hf_ncsi_aene_mc, |
1084 | 14 | { "Management controller ID", "ncsi.aene.mc", |
1085 | 14 | FT_UINT8, BASE_HEX, NULL, 0x1, |
1086 | 14 | NULL, HFILL }, |
1087 | 14 | }, |
1088 | 14 | { &hf_ncsi_sm_mac, |
1089 | 14 | { "MAC address", "ncsi.sm.mac", |
1090 | 14 | FT_ETHER, BASE_NONE, NULL, 0, |
1091 | 14 | NULL, HFILL }, |
1092 | 14 | }, |
1093 | 14 | { &hf_ncsi_sm_macno, |
1094 | 14 | { "MAC address number", "ncsi.sm.macno", |
1095 | 14 | FT_UINT8, BASE_HEX, NULL, 0, |
1096 | 14 | NULL, HFILL }, |
1097 | 14 | }, |
1098 | 14 | { &hf_ncsi_sm_at, |
1099 | 14 | { "Address type", "ncsi.sm.at", |
1100 | 14 | FT_UINT8, BASE_HEX, VALS(ncsi_sm_at_vals), 0xe0, |
1101 | 14 | NULL, HFILL }, |
1102 | 14 | }, |
1103 | 14 | { &hf_ncsi_sm_e, |
1104 | 14 | { "Enabled", "ncsi.sm.e", |
1105 | 14 | FT_BOOLEAN, 8, TFS(&tfs_enabled_disabled), 0x1, |
1106 | 14 | NULL, HFILL }, |
1107 | 14 | }, |
1108 | 14 | { &hf_ncsi_aen_type, |
1109 | 14 | { "AEN type", "ncsi.aen_type", |
1110 | 14 | FT_UINT8, BASE_HEX, VALS(ncsi_aen_type_vals), 0, |
1111 | 14 | NULL, HFILL }, |
1112 | 14 | }, |
1113 | 14 | { &hf_ncsi_aen_lsc_oemstat, |
1114 | 14 | { "AEN link OEM status", "ncsi.aen_lsc_oemstat", |
1115 | 14 | FT_UINT32, BASE_HEX, NULL, 0x0, |
1116 | 14 | NULL, HFILL }, |
1117 | 14 | }, |
1118 | 14 | { &hf_ncsi_aen_hcds, |
1119 | 14 | { "AEN Host Network Controller Driver Status", "ncsi.aen_hcds", |
1120 | 14 | FT_BOOLEAN, 32, TFS(&tfs_running_not_running), 1 << 0, |
1121 | 14 | NULL, HFILL }, |
1122 | 14 | }, |
1123 | 14 | { &hf_ncsi_aen_drr_orig_type, |
1124 | 14 | { "Original Command Type", "ncsi.aen_drr.otype", |
1125 | 14 | FT_UINT8, BASE_HEX, NULL, 0x0, |
1126 | 14 | NULL, HFILL }, |
1127 | 14 | }, |
1128 | 14 | { &hf_ncsi_aen_drr_orig_iid, |
1129 | 14 | { "Original Command IID", "ncsi.aen_drr.oiid", |
1130 | 14 | FT_UINT8, BASE_HEX, NULL, 0x0, |
1131 | 14 | NULL, HFILL }, |
1132 | 14 | }, |
1133 | | /* Broadcast filter */ |
1134 | 14 | { &hf_ncsi_bf, |
1135 | 14 | { "Broadcast filter settings", "ncsi.bf.settings", |
1136 | 14 | FT_UINT32, BASE_HEX, NULL, 0x0, |
1137 | 14 | NULL, HFILL }, |
1138 | 14 | }, |
1139 | 14 | { &hf_ncsi_bf_arp, |
1140 | 14 | { "ARP", "ncsi.bf.settings.arp", |
1141 | 14 | FT_UINT32, BASE_HEX, VALS(ncsi_bf_filter_vals), 1 << 0, |
1142 | 14 | NULL, HFILL }, |
1143 | 14 | }, |
1144 | 14 | { &hf_ncsi_bf_dhcpc, |
1145 | 14 | { "DHCP Client", "ncsi.bf.settings.dhcpc", |
1146 | 14 | FT_UINT32, BASE_HEX, VALS(ncsi_bf_filter_vals), 1 << 1, |
1147 | 14 | NULL, HFILL }, |
1148 | 14 | }, |
1149 | 14 | { &hf_ncsi_bf_dhcps, |
1150 | 14 | { "DHCP Server", "ncsi.bf.settings.dhcps", |
1151 | 14 | FT_UINT32, BASE_HEX, VALS(ncsi_bf_filter_vals), 1 << 2, |
1152 | 14 | NULL, HFILL }, |
1153 | 14 | }, |
1154 | 14 | { &hf_ncsi_bf_netbios, |
1155 | 14 | { "NetBIOS", "ncsi.bf.settings.netbios", |
1156 | 14 | FT_UINT32, BASE_HEX, VALS(ncsi_bf_filter_vals), 1 << 3, |
1157 | 14 | NULL, HFILL }, |
1158 | 14 | }, |
1159 | | /* Link settings */ |
1160 | 14 | { &hf_ncsi_ls, |
1161 | 14 | { "Link Settings", "ncsi.ls", |
1162 | 14 | FT_UINT32, BASE_HEX, NULL, 0x0, |
1163 | 14 | NULL, HFILL }, |
1164 | 14 | }, |
1165 | 14 | { &hf_ncsi_ls_an, |
1166 | 14 | { "Auto Negotiation", "ncsi.ls.an", |
1167 | 14 | FT_BOOLEAN, 32, TFS(&tfs_enabled_disabled), 1 << 0, |
1168 | 14 | NULL, HFILL }, |
1169 | 14 | }, |
1170 | 14 | { &hf_ncsi_ls_10m, |
1171 | 14 | { "enable 10 Mbps", "ncsi.ls.10m", |
1172 | 14 | FT_BOOLEAN, 32, TFS(&tfs_set_notset), 1 << 1, |
1173 | 14 | NULL, HFILL }, |
1174 | 14 | }, |
1175 | 14 | { &hf_ncsi_ls_100m, |
1176 | 14 | { "enable 100 Mbps", "ncsi.ls.100m", |
1177 | 14 | FT_BOOLEAN, 32, TFS(&tfs_set_notset), 1 << 2, |
1178 | 14 | NULL, HFILL }, |
1179 | 14 | }, |
1180 | 14 | { &hf_ncsi_ls_1g, |
1181 | 14 | { "enable 1000 Mbps (1 Gbps)", "ncsi.ls.1g", |
1182 | 14 | FT_BOOLEAN, 32, TFS(&tfs_set_notset), 1 << 3, |
1183 | 14 | NULL, HFILL }, |
1184 | 14 | }, |
1185 | 14 | { &hf_ncsi_ls_10g, |
1186 | 14 | { "enable 10 Gbps", "ncsi.ls.10g", |
1187 | 14 | FT_BOOLEAN, 32, TFS(&tfs_set_notset), 1 << 4, |
1188 | 14 | NULL, HFILL }, |
1189 | 14 | }, |
1190 | 14 | { &hf_ncsi_ls_20g, |
1191 | 14 | { "enable 20 Gbps", "ncsi.ls.20g", |
1192 | 14 | FT_BOOLEAN, 32, TFS(&tfs_set_notset), 1 << 5, |
1193 | 14 | NULL, HFILL }, |
1194 | 14 | }, |
1195 | 14 | { &hf_ncsi_ls_25g, |
1196 | 14 | { "enable 25 Gbps", "ncsi.ls.25g", |
1197 | 14 | FT_BOOLEAN, 32, TFS(&tfs_set_notset), 1 << 6, |
1198 | 14 | NULL, HFILL }, |
1199 | 14 | }, |
1200 | 14 | { &hf_ncsi_ls_40g, |
1201 | 14 | { "enable 40 Gbps", "ncsi.ls.40g", |
1202 | 14 | FT_BOOLEAN, 32, TFS(&tfs_set_notset), 1 << 7, |
1203 | 14 | NULL, HFILL }, |
1204 | 14 | }, |
1205 | 14 | { &hf_ncsi_ls_hd, |
1206 | 14 | { "enable half-duplex", "ncsi.ls.hd", |
1207 | 14 | FT_BOOLEAN, 32, TFS(&tfs_set_notset), 1 << 8, |
1208 | 14 | NULL, HFILL }, |
1209 | 14 | }, |
1210 | 14 | { &hf_ncsi_ls_fd, |
1211 | 14 | { "enable full-duplex", "ncsi.ls.fd", |
1212 | 14 | FT_BOOLEAN, 32, TFS(&tfs_set_notset), 1 << 9, |
1213 | 14 | NULL, HFILL }, |
1214 | 14 | }, |
1215 | 14 | { &hf_ncsi_ls_pc, |
1216 | 14 | { "Pause Capability", "ncsi.ls.pc", |
1217 | 14 | FT_BOOLEAN, 32, TFS(&tfs_enabled_disabled), 1 << 10, |
1218 | 14 | NULL, HFILL }, |
1219 | 14 | }, |
1220 | 14 | { &hf_ncsi_ls_apc, |
1221 | 14 | { "Asymmetric Pause Capability", "ncsi.ls.apc", |
1222 | 14 | FT_BOOLEAN, 32, TFS(&tfs_enabled_disabled), 1 << 11, |
1223 | 14 | NULL, HFILL }, |
1224 | 14 | }, |
1225 | 14 | { &hf_ncsi_ls_50g, |
1226 | 14 | { "enable 50 Gbps", "ncsi.ls.50g", |
1227 | 14 | FT_BOOLEAN, 32, TFS(&tfs_set_notset), 1 << 13, |
1228 | 14 | NULL, HFILL }, |
1229 | 14 | }, |
1230 | 14 | { &hf_ncsi_ls_100g, |
1231 | 14 | { "enable 100 Gbps", "ncsi.ls.100g", |
1232 | 14 | FT_BOOLEAN, 32, TFS(&tfs_set_notset), 1 << 14, |
1233 | 14 | NULL, HFILL }, |
1234 | 14 | }, |
1235 | 14 | { &hf_ncsi_ls_2_5g, |
1236 | 14 | { "enable 2.5 Gbps", "ncsi.ls.2_5g", |
1237 | 14 | FT_BOOLEAN, 32, TFS(&tfs_set_notset), 1 << 15, |
1238 | 14 | NULL, HFILL }, |
1239 | 14 | }, |
1240 | 14 | { &hf_ncsi_ls_5g, |
1241 | 14 | { "enable 2.5 Gbps", "ncsi.ls.5g", |
1242 | 14 | FT_BOOLEAN, 32, TFS(&tfs_set_notset), 1 << 16, |
1243 | 14 | NULL, HFILL }, |
1244 | 14 | }, |
1245 | 14 | { &hf_ncsi_ls_rsv, |
1246 | 14 | { "Reserved", "ncsi.ls.rsv", |
1247 | 14 | FT_UINT32, BASE_HEX, NULL, 0xfffe0000, /* bits 17..31 */ |
1248 | 14 | NULL, HFILL }, |
1249 | 14 | }, |
1250 | 14 | { &hf_ncsi_ls_oemls, |
1251 | 14 | { "OEM Link Settings", "ncsi.ls.oemls", |
1252 | 14 | FT_UINT32, BASE_HEX, NULL, 0x0 , |
1253 | 14 | NULL, HFILL }, |
1254 | 14 | }, |
1255 | | |
1256 | | /* generic link status */ |
1257 | 14 | { &hf_ncsi_lstat, |
1258 | 14 | { "Link status", "ncsi.lstat", |
1259 | 14 | FT_UINT32, BASE_HEX, NULL, 0x0, |
1260 | 14 | NULL, HFILL }, |
1261 | 14 | }, |
1262 | 14 | { &hf_ncsi_lstat_flag, |
1263 | 14 | { "Link flag", "ncsi.lstat.flag", |
1264 | 14 | FT_BOOLEAN, 32, TFS(&tfs_linkup_linkdown), 0x1, |
1265 | 14 | NULL, HFILL }, |
1266 | 14 | }, |
1267 | 14 | { &hf_ncsi_lstat_speed_duplex, |
1268 | 14 | { "Speed & duplex", "ncsi.lstat.speed_duplex", |
1269 | 14 | FT_UINT32, BASE_HEX, VALS(ncsi_lstat_speed_duplex_vals), 0x1e, |
1270 | 14 | NULL, HFILL }, |
1271 | 14 | }, |
1272 | 14 | { &hf_ncsi_lstat_autoneg, |
1273 | 14 | { "Autonegotiation", "ncsi.lstat.autoneg", |
1274 | 14 | FT_BOOLEAN, 32, TFS(&tfs_enabled_disabled), 1 << 5, |
1275 | 14 | NULL, HFILL }, |
1276 | 14 | }, |
1277 | 14 | { &hf_ncsi_lstat_autoneg_complete, |
1278 | 14 | { "Autonegotiation complete", "ncsi.lstat.autoneg_complete", |
1279 | 14 | FT_BOOLEAN, 32, TFS(&tfs_complete_disable_inprog), 1 << 6, |
1280 | 14 | NULL, HFILL }, |
1281 | 14 | }, |
1282 | 14 | { &hf_ncsi_lstat_parallel_detection, |
1283 | 14 | { "Parallel detection", "ncsi.lstat.parallel_detection", |
1284 | 14 | FT_BOOLEAN, 32, TFS(&tfs_used_notused), 1 << 7, |
1285 | 14 | NULL, HFILL }, |
1286 | 14 | }, |
1287 | 14 | { &hf_ncsi_lstat_1000TFD, |
1288 | 14 | { "1000TFD", "ncsi.lstat.1000tfd", |
1289 | 14 | FT_BOOLEAN, 32, TFS(&tfs_capable_not_capable), 1 << 9, |
1290 | 14 | "Partner advertised 1000TFD", HFILL }, |
1291 | 14 | }, |
1292 | 14 | { &hf_ncsi_lstat_1000THD, |
1293 | 14 | { "1000THD", "ncsi.lstat.1000thd", |
1294 | 14 | FT_BOOLEAN, 32, TFS(&tfs_capable_not_capable), 1 << 10, |
1295 | 14 | "Partner advertised 1000THD", HFILL }, |
1296 | 14 | }, |
1297 | 14 | { &hf_ncsi_lstat_100T4, |
1298 | 14 | { "100T4", "ncsi.lstat.100t4", |
1299 | 14 | FT_BOOLEAN, 32, TFS(&tfs_capable_not_capable), 1 << 11, |
1300 | 14 | "Partner advertised 100T4", HFILL }, |
1301 | 14 | }, |
1302 | 14 | { &hf_ncsi_lstat_100TXFD, |
1303 | 14 | { "100TXFD", "ncsi.lstat.100txfd", |
1304 | 14 | FT_BOOLEAN, 32, TFS(&tfs_capable_not_capable), 1 << 12, |
1305 | 14 | "Partner advertised 100TXFD", HFILL }, |
1306 | 14 | }, |
1307 | 14 | { &hf_ncsi_lstat_100TXHD, |
1308 | 14 | { "100TXHD", "ncsi.lstat.100txhd", |
1309 | 14 | FT_BOOLEAN, 32, TFS(&tfs_capable_not_capable), 1 << 13, |
1310 | 14 | "Partner advertised 100TXHD", HFILL }, |
1311 | 14 | }, |
1312 | 14 | { &hf_ncsi_lstat_10TFD, |
1313 | 14 | { "10TFD", "ncsi.lstat.10tfd", |
1314 | 14 | FT_BOOLEAN, 32, TFS(&tfs_capable_not_capable), 1 << 14, |
1315 | 14 | "Partner advertised 10TFD", HFILL }, |
1316 | 14 | }, |
1317 | 14 | { &hf_ncsi_lstat_10THD, |
1318 | 14 | { "10THD", "ncsi.lstat.10thd", |
1319 | 14 | FT_BOOLEAN, 32, TFS(&tfs_capable_not_capable), 1 << 15, |
1320 | 14 | "Partner advertised 10THD", HFILL }, |
1321 | 14 | }, |
1322 | 14 | { &hf_ncsi_lstat_tx_flow, |
1323 | 14 | { "TX flow", "ncsi.lstat.tx_flow", |
1324 | 14 | FT_BOOLEAN, 32, TFS(&tfs_enabled_disabled), 1 << 16, |
1325 | 14 | "TX flow control", HFILL }, |
1326 | 14 | }, |
1327 | 14 | { &hf_ncsi_lstat_rx_flow, |
1328 | 14 | { "RX flow", "ncsi.lstat.rx_flow", |
1329 | 14 | FT_BOOLEAN, 32, TFS(&tfs_enabled_disabled), 1 << 17, |
1330 | 14 | "RX flow control", HFILL }, |
1331 | 14 | }, |
1332 | 14 | { &hf_ncsi_lstat_partner_flow, |
1333 | 14 | { "Partner flow", "ncsi.lstat.partner_flow", |
1334 | 14 | FT_UINT32, BASE_HEX, VALS(ncsi_partner_flow_vals), 3<<18, |
1335 | 14 | "Partner-advertised flow control", HFILL }, |
1336 | 14 | }, |
1337 | 14 | { &hf_ncsi_lstat_serdes, |
1338 | 14 | { "SerDes", "ncsi.lstat.serdes", |
1339 | 14 | FT_BOOLEAN, 32, TFS(&tfs_used_notused), 1 << 20, |
1340 | 14 | NULL, HFILL }, |
1341 | 14 | }, |
1342 | 14 | { &hf_ncsi_lstat_oem_speed_valid, |
1343 | 14 | { "OEM Speed", "ncsi.lstat.oem_speed_valid", |
1344 | 14 | FT_BOOLEAN, 32, TFS(&tfs_valid_invalid), 1 << 21, |
1345 | 14 | NULL, HFILL }, |
1346 | 14 | }, |
1347 | | |
1348 | | /* Get Version ID */ |
1349 | 14 | { &hf_ncsi_ver, |
1350 | 14 | { "NC-SI version", "ncsi.ver", |
1351 | 14 | FT_STRING, BASE_NONE, NULL, 0, |
1352 | 14 | NULL, HFILL }, |
1353 | 14 | }, |
1354 | | |
1355 | 14 | { &hf_ncsi_fw_name, |
1356 | 14 | { "Firmware name", "ncsi.fw.name", |
1357 | 14 | FT_STRING, BASE_NONE, NULL, 0, |
1358 | 14 | NULL, HFILL }, |
1359 | 14 | }, |
1360 | 14 | { &hf_ncsi_fw_ver, |
1361 | 14 | { "Firmware version", "ncsi.fw.ver", |
1362 | 14 | FT_STRING, BASE_NONE, NULL, 0, |
1363 | 14 | NULL, HFILL }, |
1364 | 14 | }, |
1365 | 14 | { &hf_ncsi_pci_did, |
1366 | 14 | { "PCI DID", "ncsi.pci.did", |
1367 | 14 | FT_STRING, BASE_NONE, NULL, 0, |
1368 | 14 | NULL, HFILL }, |
1369 | 14 | }, |
1370 | 14 | { &hf_ncsi_pci_vid, |
1371 | 14 | { "PCI VID", "ncsi.pci.vid", |
1372 | 14 | FT_STRING, BASE_NONE, NULL, 0, |
1373 | 14 | NULL, HFILL }, |
1374 | 14 | }, |
1375 | 14 | { &hf_ncsi_pci_ssid, |
1376 | 14 | { "PCI SVID-SSID", "ncsi.pci.ssid", |
1377 | 14 | FT_STRING, BASE_NONE, NULL, 0, |
1378 | 14 | NULL, HFILL }, |
1379 | 14 | }, |
1380 | 14 | { &hf_ncsi_iana, |
1381 | 14 | { "IANA Enterprise Number", "ncsi.iana", |
1382 | 14 | FT_UINT32, BASE_ENTERPRISES, STRINGS_ENTERPRISES, 0, |
1383 | 14 | NULL, HFILL }, |
1384 | 14 | }, |
1385 | | |
1386 | | /* Get Capabilities */ |
1387 | 14 | { &hf_ncsi_cap_flag, |
1388 | 14 | { "Capabilities Flags", "ncsi.cap", |
1389 | 14 | FT_UINT32, BASE_HEX, NULL, 0x0, |
1390 | 14 | NULL, HFILL }, |
1391 | 14 | }, |
1392 | 14 | { &hf_ncsi_cap_flag_ha, |
1393 | 14 | { "Hardware Arbitration", "ncsi.cap.ha", |
1394 | 14 | FT_BOOLEAN, 32, TFS(&tfs_capable_not_capable), 1 << 0, |
1395 | 14 | NULL, HFILL }, |
1396 | 14 | }, |
1397 | 14 | { &hf_ncsi_cap_flag_op, |
1398 | 14 | { "OS Presence", "ncsi.cap.op", |
1399 | 14 | FT_BOOLEAN, 32, TFS(&tfs_capable_not_capable), 1 << 1, |
1400 | 14 | NULL, HFILL }, |
1401 | 14 | }, |
1402 | 14 | { &hf_ncsi_cap_flag_n2mfc, |
1403 | 14 | { "Network Controller to Management Controller Flow Control Support", "ncsi.cap.n2mfc", |
1404 | 14 | FT_BOOLEAN, 32, TFS(&tfs_capable_not_capable), 1 << 2, |
1405 | 14 | NULL, HFILL }, |
1406 | 14 | }, |
1407 | 14 | { &hf_ncsi_cap_flag_m2nfc, |
1408 | 14 | { "Management Controller to Network Controller Flow Control Support", "ncsi.cap.m2nfc", |
1409 | 14 | FT_BOOLEAN, 32, TFS(&tfs_capable_not_capable), 1 << 3, |
1410 | 14 | NULL, HFILL }, |
1411 | 14 | }, |
1412 | 14 | { &hf_ncsi_cap_flag_ama, |
1413 | 14 | { "All multicast addresses support", "ncsi.cap.ama", |
1414 | 14 | FT_BOOLEAN, 32, TFS(&tfs_capable_not_capable), 1 << 4, |
1415 | 14 | NULL, HFILL }, |
1416 | 14 | }, |
1417 | | /* Broadcast Packet Filter Capabilities*/ |
1418 | 14 | { &hf_ncsi_cap_bf, |
1419 | 14 | { "Broadcast Packet Filter Capabilities", "ncsi.cap.bf", |
1420 | 14 | FT_UINT32, BASE_HEX, NULL, 0x0, |
1421 | 14 | NULL, HFILL }, |
1422 | 14 | }, |
1423 | 14 | { &hf_ncsi_cap_bf_arp, |
1424 | 14 | { "ARP", "ncsi.cap.bf.arp", |
1425 | 14 | FT_BOOLEAN, 32, TFS(&tfs_capable_not_capable), 1 << 0, |
1426 | 14 | NULL, HFILL }, |
1427 | 14 | }, |
1428 | 14 | { &hf_ncsi_cap_bf_dhcpc, |
1429 | 14 | { "DHCP Client", "ncsi.cap.bf.dhcpc", |
1430 | 14 | FT_BOOLEAN, 32, TFS(&tfs_capable_not_capable), 1 << 1, |
1431 | 14 | NULL, HFILL }, |
1432 | 14 | }, |
1433 | 14 | { &hf_ncsi_cap_bf_dhcps, |
1434 | 14 | { "DHCP Server", "ncsi.cap.bf.dhcps", |
1435 | 14 | FT_BOOLEAN, 32, TFS(&tfs_capable_not_capable), 1 << 2, |
1436 | 14 | NULL, HFILL }, |
1437 | 14 | }, |
1438 | 14 | { &hf_ncsi_cap_bf_netbios, |
1439 | 14 | { "NetBIOS", "ncsi.cap.bf.netbios", |
1440 | 14 | FT_BOOLEAN, 32, TFS(&tfs_capable_not_capable), 1 << 3, |
1441 | 14 | NULL, HFILL }, |
1442 | 14 | }, |
1443 | | /*Multicast Packet Filter Capabilities*/ |
1444 | 14 | { &hf_ncsi_cap_mf, |
1445 | 14 | { "Multicast Packet Filter Capabilities", "ncsi.cap.mf", |
1446 | 14 | FT_UINT32, BASE_HEX, NULL, 0x0, |
1447 | 14 | NULL, HFILL }, |
1448 | 14 | }, |
1449 | 14 | { &hf_ncsi_cap_mf_v6na, |
1450 | 14 | { "IPv6 Neighbor Advertisement", "ncsi.cap.mf.v6na", |
1451 | 14 | FT_BOOLEAN, 32, TFS(&tfs_capable_not_capable), 1 << 0, |
1452 | 14 | NULL, HFILL }, |
1453 | 14 | }, |
1454 | 14 | { &hf_ncsi_cap_mf_v6ra, |
1455 | 14 | { "IPv6 Router Advertisement", "ncsi.cap.mf.v6ra", |
1456 | 14 | FT_BOOLEAN, 32, TFS(&tfs_capable_not_capable), 1 << 1, |
1457 | 14 | NULL, HFILL }, |
1458 | 14 | }, |
1459 | 14 | { &hf_ncsi_cap_mf_dhcpv6, |
1460 | 14 | { "DHCPv6 relay and server multicast", "ncsi.cap.mf.v6dhcp", |
1461 | 14 | FT_BOOLEAN, 32, TFS(&tfs_capable_not_capable), 1 << 2, |
1462 | 14 | NULL, HFILL }, |
1463 | 14 | }, |
1464 | | /*Buffering Capability*/ |
1465 | 14 | { &hf_ncsi_cap_buf, |
1466 | 14 | { "Buffering Capability (bytes)", "ncsi.cap.buf", |
1467 | 14 | FT_UINT32, BASE_HEX, NULL, 0x0, |
1468 | 14 | NULL, HFILL }, |
1469 | 14 | }, |
1470 | | /*AEN Control Support*/ |
1471 | 14 | { &hf_ncsi_cap_aen, |
1472 | 14 | { "AEN Control Support", "ncsi.cap.aen", |
1473 | 14 | FT_UINT32, BASE_HEX, NULL, 0x0, |
1474 | 14 | NULL, HFILL }, |
1475 | 14 | }, |
1476 | 14 | { &hf_ncsi_cap_aen_lstat, |
1477 | 14 | { "Link Status Change AEN control", "ncsi.cap.aen.lstat", |
1478 | 14 | FT_BOOLEAN, 32, TFS(&tfs_capable_not_capable), 1 << 0, |
1479 | 14 | NULL, HFILL }, |
1480 | 14 | }, |
1481 | 14 | { &hf_ncsi_cap_aen_cfg, |
1482 | 14 | { "Configuration Required AEN control", "ncsi.cap.aen.cfg", |
1483 | 14 | FT_BOOLEAN, 32, TFS(&tfs_capable_not_capable), 1 << 1, |
1484 | 14 | NULL, HFILL }, |
1485 | 14 | }, |
1486 | 14 | { &hf_ncsi_cap_aen_drv, |
1487 | 14 | { "Host NC Driver Status Change AEN control", "ncsi.cap.mf.drv", |
1488 | 14 | FT_BOOLEAN, 32, TFS(&tfs_capable_not_capable), 1 << 2, |
1489 | 14 | NULL, HFILL }, |
1490 | 14 | }, |
1491 | 14 | { &hf_ncsi_cap_aen_resv, /* bit 3..15 Reserved Reserved */ |
1492 | 14 | { "Reserved", "ncsi.cap.mf.resv", |
1493 | 14 | FT_UINT32, BASE_HEX, NULL, 0xfff8, |
1494 | 14 | NULL, HFILL }, |
1495 | 14 | }, |
1496 | 14 | { &hf_ncsi_cap_aen_oem, |
1497 | 14 | { "OEM-specific AEN control", "ncsi.cap.mf.oem", |
1498 | 14 | FT_UINT32, BASE_HEX, NULL, 0xffff0000, |
1499 | 14 | NULL, HFILL }, |
1500 | 14 | }, |
1501 | | |
1502 | 14 | { &hf_ncsi_cap_vcnt, |
1503 | 14 | { "VLAN Filter Count", "ncsi.cap.vcnt", |
1504 | 14 | FT_UINT8, BASE_HEX, NULL, 0x0, |
1505 | 14 | NULL, HFILL }, |
1506 | 14 | }, |
1507 | 14 | { &hf_ncsi_cap_mixcnt, |
1508 | 14 | { "Mixed Filter Count", "ncsi.cap.mixcnt", |
1509 | 14 | FT_UINT8, BASE_HEX, NULL, 0x0, |
1510 | 14 | NULL, HFILL }, |
1511 | 14 | }, |
1512 | 14 | { &hf_ncsi_cap_mccnt, |
1513 | 14 | { "Multicast Filter Count", "ncsi.cap.mccnt", |
1514 | 14 | FT_UINT8, BASE_HEX, NULL, 0x0, |
1515 | 14 | NULL, HFILL }, |
1516 | 14 | }, |
1517 | 14 | { &hf_ncsi_cap_uccnt, |
1518 | 14 | { "Unicast Filter Count", "ncsi.cap.uccnt", |
1519 | 14 | FT_UINT8, BASE_HEX, NULL, 0x0, |
1520 | 14 | NULL, HFILL }, |
1521 | 14 | }, |
1522 | | /*VLAN mode*/ |
1523 | 14 | { &hf_ncsi_cap_vmode, |
1524 | 14 | { "VLAN Mode Support", "ncsi.cap.vmode", |
1525 | 14 | FT_UINT8, BASE_HEX, NULL, 0x0, |
1526 | 14 | NULL, HFILL }, |
1527 | 14 | }, |
1528 | 14 | { &hf_ncsi_cap_vmode_vo, |
1529 | 14 | { "VLAN only", "ncsi.cap.aen.vmode.vo", |
1530 | 14 | FT_BOOLEAN, 8, TFS(&tfs_capable_not_capable), 1 << 0, |
1531 | 14 | NULL, HFILL }, |
1532 | 14 | }, |
1533 | 14 | { &hf_ncsi_cap_vmode_both, |
1534 | 14 | { "VLAN + non-VLAN", "ncsi.cap.aen.vmode.both", |
1535 | 14 | FT_BOOLEAN, 8, TFS(&tfs_capable_not_capable), 1 << 1, |
1536 | 14 | NULL, HFILL }, |
1537 | 14 | }, |
1538 | 14 | { &hf_ncsi_cap_vmode_any, |
1539 | 14 | { "Any VLAN + non-VLAN", "ncsi.cap.aen.vmode.any", |
1540 | 14 | FT_BOOLEAN, 8, TFS(&tfs_capable_not_capable), 1 << 2, |
1541 | 14 | NULL, HFILL }, |
1542 | 14 | }, |
1543 | 14 | { &hf_ncsi_cap_chcnt, |
1544 | 14 | { "Channel Count", "ncsi.cap.chcnt", |
1545 | 14 | FT_UINT8, BASE_HEX, NULL, 0x0, |
1546 | 14 | NULL, HFILL }, |
1547 | 14 | }, |
1548 | | /* OEM command */ |
1549 | 14 | { &hf_ncsi_oem_id, |
1550 | 14 | { "OEM ID", "ncsi.oem.id", |
1551 | 14 | FT_UINT32, BASE_HEX, VALS(ncsi_oem_id_vals), 0x0, |
1552 | 14 | "Manufacturer ID (IANA)", HFILL }, |
1553 | 14 | }, |
1554 | | /* OEM Mellanox Command, Parameter, Host number */ |
1555 | 14 | { &hf_ncsi_mlnx_cmd, |
1556 | 14 | { "Command ID", "ncsi.mlnx.cmd", |
1557 | 14 | FT_UINT8, BASE_HEX, NULL, 0x0, |
1558 | 14 | "Mellanox command id", HFILL }, |
1559 | 14 | }, |
1560 | 14 | { &hf_ncsi_mlnx_parm, |
1561 | 14 | { "Parameter", "ncsi.mlnx.parm", |
1562 | 14 | FT_UINT8, BASE_HEX, NULL, 0x0, |
1563 | 14 | "Mellanox parameter", HFILL }, |
1564 | 14 | }, |
1565 | 14 | { &hf_ncsi_mlnx_host, |
1566 | 14 | { "Host number", "ncsi.mlnx.host", |
1567 | 14 | FT_UINT8, BASE_HEX, NULL, 0x0, |
1568 | 14 | "Mellanox host number", HFILL }, |
1569 | 14 | }, |
1570 | | /* OEM Mellanox Set MC Affinity (Command = 0x1, parameter 0x7) */ |
1571 | 14 | { &hf_ncsi_mlnx_rbt, |
1572 | 14 | { "MC RBT address", "ncsi.mlnx.rbt", |
1573 | 14 | FT_ETHER, BASE_NONE, NULL, 0x0, |
1574 | 14 | NULL, HFILL }, |
1575 | 14 | }, |
1576 | | |
1577 | 14 | { &hf_ncsi_mlnx_sms, |
1578 | 14 | { "Supported Medias Status", "ncsi.mlx.sms", |
1579 | 14 | FT_UINT8, BASE_HEX, NULL, 0x0, |
1580 | 14 | NULL, HFILL }, |
1581 | 14 | }, |
1582 | 14 | { &hf_ncsi_mlnx_sms_rbt, |
1583 | 14 | { "RBT", "ncsi.mlx.sms.rbt", |
1584 | 14 | FT_BOOLEAN, 8, TFS(&tfs_supported_not_supported), 1 << 0, |
1585 | 14 | "When set the MC supports RBT", HFILL }, |
1586 | 14 | }, |
1587 | 14 | { &hf_ncsi_mlnx_sms_smbus, |
1588 | 14 | { "SMBus", "ncsi.mlx.sms.smbus", |
1589 | 14 | FT_BOOLEAN, 8, TFS(&tfs_supported_not_supported), 1 << 1, |
1590 | 14 | "When set, the MC supports MCTP over SMBus", HFILL }, |
1591 | 14 | }, |
1592 | 14 | { &hf_ncsi_mlnx_sms_pcie, |
1593 | 14 | { "PCIe", "ncsi.mlx.sms.pcie", |
1594 | 14 | FT_BOOLEAN, 8, TFS(&tfs_supported_not_supported), 1 << 2, |
1595 | 14 | "When set, the MC supports MCTP over PCIe", HFILL }, |
1596 | 14 | }, |
1597 | 14 | { &hf_ncsi_mlnx_sms_rbts, |
1598 | 14 | { "RBT medium status", "ncsi.mlx.sms.rbts", |
1599 | 14 | FT_BOOLEAN, 8, TFS(&tfs_available_not_available), 1 << 3, |
1600 | 14 | NULL, HFILL }, |
1601 | 14 | }, |
1602 | 14 | { &hf_ncsi_mlnx_sms_smbuss, |
1603 | 14 | { "SMBus medium status", "ncsi.mlx.sms.smbuss", |
1604 | 14 | FT_BOOLEAN, 8, TFS(&tfs_available_not_available), 1 << 4, |
1605 | 14 | NULL, HFILL }, |
1606 | 14 | }, |
1607 | 14 | { &hf_ncsi_mlnx_sms_pcies, |
1608 | 14 | { "PCIe medium status", "ncsi.mlx.sms.pcies", |
1609 | 14 | FT_BOOLEAN, 8, TFS(&tfs_available_not_available), 1 << 5, |
1610 | 14 | NULL, HFILL }, |
1611 | 14 | }, |
1612 | 14 | { &hf_ncsi_mlnx_beid, |
1613 | 14 | { "MC SMBus EID", "ncsi.mlx.beid", |
1614 | 14 | FT_UINT8, BASE_HEX, NULL, 0x0, |
1615 | 14 | NULL, HFILL }, |
1616 | 14 | }, |
1617 | 14 | { &hf_ncsi_mlnx_bidx, |
1618 | 14 | { "SMBus index", "ncsi.mlx.bidx", |
1619 | 14 | FT_UINT8, BASE_HEX, NULL, 0x0, |
1620 | 14 | NULL, HFILL }, |
1621 | 14 | }, |
1622 | 14 | { &hf_ncsi_mlnx_baddr, |
1623 | 14 | { "MC SMBus address", "ncsi.mlx.baddr", |
1624 | 14 | FT_UINT8, BASE_HEX, NULL, 0x0, |
1625 | 14 | NULL, HFILL }, |
1626 | 14 | }, |
1627 | 14 | { &hf_ncsi_mlnx_peid, |
1628 | 14 | { "MC PCIe EID", "ncsi.mlx.peid", |
1629 | 14 | FT_UINT8, BASE_HEX, NULL, 0x0, |
1630 | 14 | NULL, HFILL }, |
1631 | 14 | }, |
1632 | 14 | { &hf_ncsi_mlnx_pidx, |
1633 | 14 | { "PCIe index", "ncsi.mlx.pidx", |
1634 | 14 | FT_UINT8, BASE_HEX, NULL, 0x0, |
1635 | 14 | NULL, HFILL }, |
1636 | 14 | }, |
1637 | 14 | { &hf_ncsi_mlnx_paddr, |
1638 | 14 | { "MC PCIe Address", "ncsi.mlx.paddr", |
1639 | 14 | FT_UINT16, BASE_HEX, NULL, 0x0, |
1640 | 14 | NULL, HFILL }, |
1641 | 14 | }, |
1642 | 14 | { &hf_ncsi_mlnx_ifm, |
1643 | 14 | { "MC IP Filter Mode", "ncsi.mlx.ifm", |
1644 | 14 | FT_UINT8, BASE_HEX, NULL, 0x0, |
1645 | 14 | NULL, HFILL }, |
1646 | 14 | }, |
1647 | 14 | { &hf_ncsi_mlnx_ifm_byip, |
1648 | 14 | { "Filter by IP Address", "ncsi.mlx.ifm.byip", |
1649 | 14 | FT_UINT8, BASE_HEX, VALS(ncsi_mlnx_ifm_byip_vals), 0x3, |
1650 | 14 | NULL, HFILL }, |
1651 | 14 | }, |
1652 | 14 | { &hf_ncsi_mlnx_ifm_v4en, |
1653 | 14 | { "IPv4", "ncsi.mlx.ifm.v4en", |
1654 | 14 | FT_BOOLEAN, 8, TFS(&tfs_used_notused), 1 << 2, |
1655 | 14 | NULL, HFILL }, |
1656 | 14 | }, |
1657 | 14 | { &hf_ncsi_mlnx_ifm_v6len, |
1658 | 14 | { "IPv6 Link Local Address", "ncsi.mlx.ifm.v6len", |
1659 | 14 | FT_BOOLEAN, 8, TFS(&tfs_used_notused), 1 << 3, |
1660 | 14 | NULL, HFILL }, |
1661 | 14 | }, |
1662 | 14 | { &hf_ncsi_mlnx_ifm_v6gen, |
1663 | 14 | { "IPv6 Global Address", "ncsi.mlx.ifm.v6gen", |
1664 | 14 | FT_BOOLEAN, 8, TFS(&tfs_used_notused), 1 << 4, |
1665 | 14 | NULL, HFILL }, |
1666 | 14 | }, |
1667 | 14 | { &hf_ncsi_mlnx_v4addr, |
1668 | 14 | { "MC IPv4 Address", "ncsi.mlnx.v4addr", |
1669 | 14 | FT_IPv4, BASE_NONE, NULL, 0x0, |
1670 | 14 | NULL, HFILL }, |
1671 | 14 | }, |
1672 | 14 | { &hf_ncsi_mlnx_v6local, |
1673 | 14 | { "MC IPv6 Link Local Address", "ncsi.mlnx.v6local", |
1674 | 14 | FT_IPv6, BASE_NONE, NULL, 0x0, |
1675 | 14 | NULL, HFILL }, |
1676 | 14 | }, |
1677 | 14 | { &hf_ncsi_mlnx_v6gbl, |
1678 | 14 | { "MC IPv6 Global Address", "ncsi.mlnx.v6gbl", |
1679 | 14 | FT_IPv6, BASE_NONE, NULL, 0x0, |
1680 | 14 | NULL, HFILL }, |
1681 | 14 | }, |
1682 | | /* Get Allocated Management Address (Command = 0x0, Parameter 0x1B) */ |
1683 | 14 | { &hf_ncsi_mlnx_gama_st, |
1684 | 14 | { "Status", "ncsi.mlx.gama.st", |
1685 | 14 | FT_UINT8, BASE_HEX, VALS(ncsi_mlnx_gama_st_vals), 0x0, |
1686 | 14 | NULL, HFILL }, |
1687 | 14 | }, |
1688 | 14 | { &hf_ncsi_mlnx_gama_mac, |
1689 | 14 | { "Allocated MC MAC address", "ncsi.mlx.gama.mac", |
1690 | 14 | FT_ETHER, BASE_NONE, NULL, 0x0, |
1691 | 14 | NULL, HFILL }, |
1692 | 14 | }, |
1693 | | /* Get Temperature (Command = 0x13, Parameter = 0x2) */ |
1694 | 14 | { &hf_ncsi_mlnx_gtemp_index, |
1695 | 14 | { "Get sensor index", "ncsi.mlx.temp.index", |
1696 | 14 | FT_UINT8, BASE_HEX, NULL, 0x0, |
1697 | 14 | NULL, HFILL }, |
1698 | 14 | }, |
1699 | 14 | { &hf_ncsi_mlnx_gtemp_sp, |
1700 | 14 | { "SP", "ncsi.mlx.temp.sp", |
1701 | 14 | FT_UINT8, BASE_HEX, VALS(ncsi_mlnx_gtemp_sp_vals), 0x80, /* bits 7 */ |
1702 | 14 | NULL, HFILL }, |
1703 | 14 | }, |
1704 | 14 | { &hf_ncsi_mlnx_gtemp_sindex, |
1705 | 14 | { "Sensor index", "ncsi.mlx.temp.sindex", |
1706 | 14 | FT_UINT8, BASE_HEX, NULL, 0x7f, /* bits 6..0 */ |
1707 | 14 | NULL, HFILL }, |
1708 | 14 | }, |
1709 | | |
1710 | 14 | { &hf_ncsi_mlnx_gtemp_pad_mms, |
1711 | 14 | { "PAD_MMS", "ncsi.mlx.temp.pad_mms", |
1712 | 14 | FT_UINT8, BASE_HEX, NULL, 0x0, |
1713 | 14 | "PAD and MMS", HFILL }, |
1714 | 14 | }, |
1715 | 14 | { &hf_ncsi_mlnx_gtemp_pad, |
1716 | 14 | { "PAD", "ncsi.mlx.temp.pad", |
1717 | 14 | FT_UINT8, BASE_HEX, NULL, 0xfe, /* bits 7..1 */ |
1718 | 14 | NULL, HFILL }, |
1719 | 14 | }, |
1720 | 14 | { &hf_ncsi_mlnx_gtemp_mms, |
1721 | 14 | { "MMS", "ncsi.mlx.temp.mms", |
1722 | 14 | FT_UINT8, BASE_HEX, NULL, 0x1, /* bits 0 */ |
1723 | 14 | NULL, HFILL }, |
1724 | 14 | }, |
1725 | 14 | { &hf_ncsi_mlnx_temp1, |
1726 | 14 | { "Max Meas Temperature", "ncsi.mlx.maxmeas_temp", |
1727 | 14 | FT_UINT8, BASE_DEC, NULL, 0x0, |
1728 | 14 | NULL, HFILL }, |
1729 | 14 | }, |
1730 | 14 | { &hf_ncsi_mlnx_temp2, |
1731 | 14 | { "Max Op Temperature", "ncsi.mlx.maxop_temp", |
1732 | 14 | FT_UINT8, BASE_DEC, NULL, 0x0, |
1733 | 14 | NULL, HFILL }, |
1734 | 14 | }, |
1735 | 14 | { &hf_ncsi_mlnx_temp3, |
1736 | 14 | { "Current Temperature", "ncsi.mlx.current_temp", |
1737 | 14 | FT_UINT8, BASE_DEC, NULL, 0x0, |
1738 | 14 | NULL, HFILL }, |
1739 | 14 | }, |
1740 | | |
1741 | 14 | }; |
1742 | | |
1743 | | /* *INDENT-ON* */ |
1744 | | |
1745 | | /* Setup protocol subtree array */ |
1746 | 14 | static int *ett[] = { |
1747 | 14 | &ett_ncsi, |
1748 | 14 | &ett_ncsi_type, |
1749 | 14 | &ett_ncsi_chan, |
1750 | 14 | &ett_ncsi_payload, |
1751 | 14 | &ett_ncsi_lstat, |
1752 | 14 | &ett_ncsi_cap_flag, |
1753 | 14 | &ett_ncsi_cap_bf, |
1754 | 14 | &ett_ncsi_cap_mf, |
1755 | 14 | &ett_ncsi_cap_aen, |
1756 | 14 | &ett_ncsi_cap_vmode, |
1757 | 14 | &ett_ncsi_ls, |
1758 | 14 | &ett_ncsi_mlnx, |
1759 | 14 | &ett_ncsi_mlnx_sms, |
1760 | 14 | &ett_ncsi_mlnx_ifm, |
1761 | 14 | &ett_ncsi_mlnx_gtemp, |
1762 | 14 | }; |
1763 | | |
1764 | | /* Register the protocol name and description */ |
1765 | 14 | proto_ncsi = proto_register_protocol("NCSI", "NCSI", "ncsi"); |
1766 | 14 | ncsi_handle = register_dissector("ncsi", dissect_ncsi, proto_ncsi); |
1767 | | |
1768 | | /* Required function calls to register the header fields and subtrees */ |
1769 | 14 | proto_register_field_array(proto_ncsi, hf, array_length(hf)); |
1770 | 14 | proto_register_subtree_array(ett, array_length(ett)); |
1771 | 14 | } |
1772 | | |
1773 | | void |
1774 | | proto_reg_handoff_ncsi(void) |
1775 | 14 | { |
1776 | 14 | dissector_add_uint("ethertype", ETHERTYPE_NCSI, ncsi_handle); |
1777 | 14 | dissector_add_uint("mctp.encap-type", MCTP_TYPE_NCSI, ncsi_handle); |
1778 | 14 | } |
1779 | | |
1780 | | /* |
1781 | | * Editor modelines - https://www.wireshark.org/tools/modelines.html |
1782 | | * |
1783 | | * Local variables: |
1784 | | * c-basic-offset: 4 |
1785 | | * tab-width: 8 |
1786 | | * indent-tabs-mode: nil |
1787 | | * End: |
1788 | | * |
1789 | | * vi: set shiftwidth=4 tabstop=8 expandtab: |
1790 | | * :indentSize=4:tabSize=8:noTabs=true: |
1791 | | */ |
1792 | | |
1793 | | /* |
1794 | | * Formatted by AStyle (3.1) -A10YcHjk3pUxUxBxt2 if under Windows |
1795 | | */ |