xref: /titanic_44/usr/src/uts/common/io/bnxe/577xx/drivers/common/lm/include/common_uif.h (revision d14abf155341d55053c76eeec58b787a456b753b)
1 #ifndef _COMMON_UIF_H
2 #define _COMMON_UIF_H
3 
4 /*
5 I M P O R T A N T
6 BEFORE YOU MODIFY THESE STRUCTS:
7 please make sure that DIAG was updated accordingly.
8 windiag\ediag should be checked to compile and run correctly
9 modification is in file: tcl_driver.c,  function: driver_init_stats_object,  macros: REGISTER_STAT_FIELD
10 */
11 
12 
13 /*******************************************************************************
14  * Hardware statistics structure for B10_IOC_GET_L2_CHIP_STATISTICS
15  ******************************************************************************/
16 typedef struct _b10_l2_chip_statistics_t
17 {
18     u64_t ver_num;
19     #define L2_CHIP_STATISTICS_VER_NUM_1 1
20     #define L2_CHIP_STATISTICS_VER_NUM_2 2
21     #define L2_CHIP_STATISTICS_VER_NUM_3 3
22     u64_t  IfHCInOctets;
23     u64_t  IfHCInBadOctets;
24     u64_t  IfHCOutOctets;
25     u64_t  IfHCOutBadOctets;
26     u64_t  IfHCOutPkts ;
27     u64_t  IfHCInPkts ;
28     u64_t  IfHCInUcastPkts;
29     u64_t  IfHCInMulticastPkts;
30     u64_t  IfHCInBroadcastPkts;
31     u64_t  IfHCOutUcastPkts;
32     u64_t  IfHCOutMulticastPkts;
33     u64_t  IfHCOutBroadcastPkts;
34     u64_t  IfHCInUcastOctets ;
35     u64_t  IfHCInMulticastOctets ;
36     u64_t  IfHCInBroadcastOctets ;
37     u64_t  IfHCOutUcastOctets ;
38     u64_t  IfHCOutMulticastOctets ;
39     u64_t  IfHCOutBroadcastOctets ;
40     u64_t  IfHCOutDiscards ;
41     u64_t  IfHCInFalseCarrierErrors ;
42     u64_t  Dot3StatsInternalMacTransmitErrors;
43     u64_t  Dot3StatsCarrierSenseErrors;
44     u64_t  Dot3StatsFCSErrors;
45     u64_t  Dot3StatsAlignmentErrors;
46     u64_t  Dot3StatsSingleCollisionFrames;
47     u64_t  Dot3StatsMultipleCollisionFrames;
48     u64_t  Dot3StatsDeferredTransmissions;
49     u64_t  Dot3StatsExcessiveCollisions;
50     u64_t  Dot3StatsLateCollisions;
51     u64_t  EtherStatsCollisions;
52     u64_t  EtherStatsFragments;
53     u64_t  EtherStatsJabbers;
54     u64_t  EtherStatsUndersizePkts;
55     u64_t  EtherStatsOverrsizePkts;
56     u64_t  EtherStatsPktsTx64Octets;
57     u64_t  EtherStatsPktsTx65Octetsto127Octets;
58     u64_t  EtherStatsPktsTx128Octetsto255Octets;
59     u64_t  EtherStatsPktsTx256Octetsto511Octets;
60     u64_t  EtherStatsPktsTx512Octetsto1023Octets;
61     u64_t  EtherStatsPktsTx1024Octetsto1522Octets;
62     u64_t  EtherStatsPktsTxOver1522Octets;
63     u64_t  XonPauseFramesReceived;
64     u64_t  XoffPauseFramesReceived;
65     u64_t  OutXonSent;
66     u64_t  OutXoffSent;
67     u64_t  FlowControlDone;
68     u64_t  MacControlFramesReceived;
69     u64_t  XoffStateEntered;
70     u64_t  IfInFramesL2FilterDiscards;
71     u64_t  IfInTTL0Discards ;
72     u64_t  IfInxxOverflowDiscards ;
73     u64_t  IfInMBUFDiscards;
74     u64_t  IfInErrors;
75     u64_t  IfInErrorsOctets;
76     u64_t  IfInNoBrbBuffer;
77     //u64_t  Reserved0 ;
78     //u64_t  Reserved1 ;
79     //u64_t  Reserved2 ;
80     //u64_t  Reserved3 ;
81 
82     // Nig statistics
83     u64_t  Nig_brb_packet             ;
84     u64_t  Nig_brb_truncate           ;
85     u64_t  Nig_flow_ctrl_discard      ;
86     u64_t  Nig_flow_ctrl_octets       ;
87     u64_t  Nig_flow_ctrl_packet       ;
88     u64_t  Nig_mng_discard            ;
89     u64_t  Nig_mng_octet_inp          ;
90     u64_t  Nig_mng_octet_out          ;
91     u64_t  Nig_mng_packet_inp         ;
92     u64_t  Nig_mng_packet_out         ;
93     u64_t  Nig_pbf_octets             ;
94     u64_t  Nig_pbf_packet             ;
95     u64_t  Nig_safc_inp               ;
96 
97 } b10_l2_chip_statistics_t;
98 
99 typedef struct _b10_l2_chip_statistics_v2_t
100 {
101     struct _b10_l2_chip_statistics_t v1;
102 
103     struct _v2
104     {
105         u64_t Tx_lpi_count;			// This counter counts the number of timers the debounced version of EEE link idle is asserted�
106     } v2;
107 
108 } b10_l2_chip_statistics_v2_t;
109 
110 typedef struct _b10_l2_chip_statistics_v3_t
111 {
112     struct  _b10_l2_chip_statistics_v2_t v2;
113     struct _v3
114     {
115         u64_t   coalesced_pkts        /* the number of packets coalesced in all aggregations */;
116         u64_t   coalesced_bytes       /* the number of bytes coalesced in all aggregations */;
117         u64_t   coalesced_events      /* the number of aggregations */;
118         u64_t   coalesced_aborts      /* the number of exception which avoid aggregation */;
119     } v3;
120 
121 } b10_l2_chip_statistics_v3_t;
122 
123 
124 /*******************************************************************************
125  * Hardware statistics structure for B10_IOC_GET_L4_CHIP_STATISTICS
126  ******************************************************************************/
127 typedef struct _b10_l4_chip_statistics_t
128 {
129     u64_t ver_num;
130     #define L4_CHIP_STATISTISTCS_VER_NUM 1
131     u64_t NoTxCqes ;
132     u64_t InTCP4Segments ;
133     u64_t OutTCP4Segments ;
134     u64_t RetransmittedTCP4Segments ;
135     u64_t InTCP4Errors ;
136     u64_t InIP4Receives ;
137     u64_t InIP4HeaderErrors ;
138     u64_t InIP4Discards ;
139     u64_t InIP4Delivers ;
140     u64_t InIP4Octets ;
141     u64_t OutIP4Octets ;
142     u64_t InIP4TruncatedPackets ;
143     u64_t InTCP6Segments ;
144     u64_t OutTCP6Segments ;
145     u64_t RetransmittedTCP6Segments ;
146     u64_t InTCP6Errors ;
147     u64_t InIP6Receives ;
148     u64_t InIP6HeaderErrors ;
149     u64_t InIP6Discards ;
150     u64_t InIP6Delivers ;
151     u64_t InIP6Octets ;
152     u64_t OutIP6Octets ;
153     u64_t InIP6TruncatedPackets ;
154     //u64_t Reserved0 ;
155     //u64_t Reserved1 ;
156     //u64_t Reserved2 ;
157     //u64_t Reserved3 ;
158 
159 } b10_l4_chip_statistics_t;
160 
161 /*******************************************************************************
162  * Driver statistics structure for B10_IOC_GET_L2_DRIVER_STATISTICS
163  ******************************************************************************/
164 typedef struct _b10_l2_driver_statistics_t
165 {
166     u64_t ver_num;
167     #define L2_DRIVER_STATISTISTCS_VER_NUM 1
168     u64_t RxIPv4FragCount;
169     u64_t RxIpCsErrorCount;
170     u64_t RxTcpCsErrorCount;
171     u64_t RxLlcSnapCount;
172     u64_t RxPhyErrorCount;
173     u64_t RxIpv6ExtCount;
174     u64_t TxNoL2Bd;
175     u64_t TxNoSqWqe;
176     u64_t TxL2AssemblyBufUse;
177     //u64_t Reserved0 ;
178     //u64_t Reserved1 ;
179     //u64_t Reserved2 ;
180     //u64_t Reserved3 ;
181 } b10_l2_driver_statistics_t;
182 
183 /*******************************************************************************
184  * Driver statistics structure for B10_IOC_GET_L4_DRIVER_STATISTICS
185  ******************************************************************************/
186 
187 typedef struct _b10_l4_driver_statistics_t
188 {
189     u64_t ver_num;
190     #define L4_DRIVER_STATISTISTCS_VER_NUM 1
191     u64_t CurrentlyIpv4Established ;
192     u64_t OutIpv4Resets ;
193     u64_t OutIpv4Fin ;
194     u64_t InIpv4Reset ;
195     u64_t InIpv4Fin ;
196     u64_t CurrentlyIpv6Established ;
197     u64_t OutIpv6Resets ;
198     u64_t OutIpv6Fin ;
199     u64_t InIpv6Reset ;
200     u64_t InIpv6Fin ;
201     u64_t RxIndicateReturnPendingCnt;
202     u64_t RxIndicateReturnDoneCnt;
203     u64_t RxActiveGenBufCnt;
204     u64_t TxNoL4Bd;
205     u64_t TxL4AssemblyBufUse ;
206     //u64_t Reserved0 ;
207     //u64_t Reserved1 ;
208     //u64_t Reserved2 ;
209     //u64_t Reserved3 ;
210 
211 } b10_l4_driver_statistics_t;
212 
213 /*******************************************************************************
214  * Driver statistics structure for B10_IOC_GET_DRIVER_STATISTICS.
215  ******************************************************************************/
216 typedef struct _b10_driver_statistics_t
217 {
218     u64_t ver_num;
219     #define DRIVER_STATISTISTCS_VER_NUM 1
220     u64_t tx_lso_frames;        // supported
221     u64_t tx_aborted;           // supported
222     u64_t tx_no_bd;
223     u64_t tx_no_desc;
224     u64_t tx_no_coalesce_buf;   // supported
225     u64_t tx_no_map_reg;
226     u64_t rx_aborted;           // supported
227     u64_t rx_err;
228     u64_t rx_crc;
229     u64_t rx_phy_err;
230     u64_t rx_alignment;
231     u64_t rx_short_packet;
232     u64_t rx_giant_packet;
233     //u64_t Reserved0 ;
234     //u64_t Reserved1 ;
235     //u64_t Reserved2 ;
236     //u64_t Reserved3 ;
237 } b10_driver_statistics_t;
238 
239 
240 #define DCBX_CONFIG_INV_VALUE            (0xFFFFFFFF)
241 enum
242 {
243     OVERWRITE_SETTINGS_DISABLE  = 0,
244     OVERWRITE_SETTINGS_ENABLE   = 1,
245     OVERWRITE_SETTINGS_INVALID  = DCBX_CONFIG_INV_VALUE
246 };
247 /*******************************************************************************
248  * LLDP protocol registry configuration parameters.
249  ******************************************************************************/
250 typedef struct _config_lldp_params_t
251 {
252     u32_t   overwrite_settings;
253     u32_t   msg_tx_hold;
254     u32_t   msg_fast_tx;
255     u32_t   tx_credit_max;
256     u32_t   msg_tx_interval;
257     u32_t   tx_fast;
258 }config_lldp_params_t;
259 
260 /*******************************************************************************
261  * LLDP structure for B10_IOC_GET_LLDP_PARAMS.
262  ******************************************************************************/
263 typedef struct _b10_lldp_params_get_t
264 {
265     u32_t ver_num;
266     #define LLDP_PARAMS_VER_NUM 2
267     config_lldp_params_t config_lldp_params;
268     // The reserved field should follow in case the struct above will increase
269     u32_t _reserved[50];
270     u32_t 	admin_status;
271         #define LLDP_TX_ONLY  0x01
272         #define LLDP_RX_ONLY  0x02
273         #define LLDP_TX_RX    0x03
274         #define LLDP_DISABLED 0x04
275     u32_t   remote_chassis_id[65];
276     u32_t   remote_port_id[65];
277     u32_t   local_chassis_id[2];
278     u32_t   local_port_id[2];
279 }b10_lldp_params_get_t;
280 
281 
282 /*******************************************************************************
283  * DCBX protocol registry configuration parameters.
284  ******************************************************************************/
285 
286 typedef struct _admin_priority_app_table_t
287 {
288     u32_t valid;
289     u32_t priority;
290 #define INVALID_TRAFFIC_TYPE_PRIORITY                  (0xFFFFFFFF)
291     u32_t traffic_type;
292     #define TRAFFIC_TYPE_ETH    0
293     #define TRAFFIC_TYPE_PORT   1
294     u32_t app_id;
295 }admin_priority_app_table_t;
296 
297 typedef struct _config_dcbx_params_t
298 {
299     u32_t dcb_enable;
300     u32_t admin_dcbx_enable;
301     // "admin_dcbx_enable" and "dcb_enable" are stand alone registry keys(if present
302     // will always be valid and not ignored), for all other DCBX registry set only
303     // if the entire DCBX registry set is present and differ from 0xFFFFFFFF (invalid
304     // value) the DCBX registry parameters are taken, otherwise the registry key set
305     // is ignored.)(Expect "admin_dcbx_enable" and "dcb_enable")
306     u32_t overwrite_settings;
307     u32_t admin_dcbx_version;
308     #define ADMIN_DCBX_VERSION_CEE 0
309     #define ADMIN_DCBX_VERSION_IEEE 1
310     u32_t admin_ets_enable;
311     u32_t admin_pfc_enable;
312     u32_t admin_tc_supported_tx_enable;
313     u32_t admin_ets_configuration_tx_enable;
314     u32_t admin_ets_recommendation_tx_enable;
315     u32_t admin_pfc_tx_enable;
316     u32_t admin_application_priority_tx_enable;
317     u32_t admin_ets_willing;
318     u32_t admin_ets_reco_valid;
319     u32_t admin_pfc_willing;
320     u32_t admin_app_priority_willing;
321     u32_t admin_configuration_bw_percentage[8];
322     u32_t admin_configuration_ets_pg[8];
323     u32_t admin_recommendation_bw_percentage[8];
324     u32_t admin_recommendation_ets_pg[8];
325     u32_t admin_pfc_bitmap;
326 
327     admin_priority_app_table_t admin_priority_app_table[4];
328     u32_t admin_default_priority;
329 }config_dcbx_params_t;
330 
331 
332 /*******************************************************************************
333  * DCBX structure for B10_IOC_GET_DCBX_PARAMS.
334  ******************************************************************************/
335 typedef struct _b10_dcbx_params_get_t
336 {
337     u32_t ver_num;
338     #define DCBX_PARAMS_VER_NUM 4
339     config_dcbx_params_t config_dcbx_params;
340     // The reserved field should follow in case the struct above will increase
341     u32_t _reserved[49];
342 
343     u32_t dcb_current_oper_state_bitmap;
344     #define DCBX_CURRENT_STATE_IS_SYNC                  (1 << 0)
345     #define PFC_IS_CURRENTLY_OPERATIONAL                (1 << 1)
346     #define ETS_IS_CURRENTLY_OPERATIONAL                (1 << 2)
347     #define PRIORITY_TAGGING_IS_CURRENTLY_OPERATIONAL   (1 << 3)
348     #define DRIVER_CONFIGURED_BY_OS_QOS                 (1 << 4)
349     #define DRIVER_CONFIGURED_BY_OS_QOS_TO_WILLING      (1 << 5)
350 
351 
352     u32_t local_tc_supported;
353     u32_t local_pfc_caps;
354     u32_t remote_tc_supported;
355     u32_t remote_pfc_cap;
356     u32_t remote_ets_willing;
357     u32_t remote_ets_reco_valid;
358     u32_t remote_pfc_willing;
359     u32_t remote_app_priority_willing;
360     u32_t remote_configuration_bw_percentage[8];
361     u32_t remote_configuration_ets_pg[8];
362     u32_t remote_recommendation_bw_percentage[8];
363     u32_t remote_recommendation_ets_pg[8];
364     u32_t remote_pfc_bitmap;
365     admin_priority_app_table_t remote_priority_app_table[16];
366     u32_t local_ets_enable;
367     u32_t local_pfc_enable;
368     u32_t local_configuration_bw_percentage[8];
369     u32_t local_configuration_ets_pg[8];
370     u32_t local_pfc_bitmap;
371     admin_priority_app_table_t local_priority_app_table[16];
372     u32_t pfc_mismatch;
373     u32_t priority_app_mismatch;
374     u32_t dcbx_frames_sent;
375     u32_t dcbx_frames_received;
376     u64_t pfc_frames_sent;
377     u64_t pfc_frames_received;
378 }b10_dcbx_params_get_t;
379 
380 /*******************************************************************************
381  * Transceiver Data B10_IOC_GET_TRANSCEIVER_DATA
382  ******************************************************************************/
383 
384 typedef struct _b10_transceiver_data_t
385 {
386     u8_t ver_num;
387     #define TRANSCEIVER_DATA_VER_NUM   1
388 
389     u8_t _pad[3];
390 
391     // NOTE: All these strings are ASCII buffers without trailing NULL '\0'
392 
393     u8_t vendor_name[16];  // ELINK_SFP_EEPROM_VENDOR_NAME_ADDR
394     u8_t model_num[16];    // ELINK_SFP_EEPROM_PART_NO_ADDR
395     u8_t serial_num[16];   // ELINK_SFP_EEPROM_SERIAL_ADDR
396     u8_t revision_num[4];  // ELINK_SFP_EEPROM_REVISION_ADDR
397     u8_t mfg_date[6];      // ELINK_SFP_EEPROM_DATE_ADDR
398 
399     u8_t _pad_[2];
400 
401     u32_t reserved[40];
402 
403 } b10_transceiver_data_t;
404 
405 #endif // _COMMON_UIF_H
406