This stack check implementation leverages the compiler's profiling (gcc -p)
[linux-2.6.git] / drivers / net / sk98lin / h / skgepnmi.h
1 /*****************************************************************************
2  *
3  * Name:        skgepnmi.h
4  * Project:     GEnesis, PCI Gigabit Ethernet Adapter
5  * Version:     $Revision: 1.62 $
6  * Date:        $Date: 2003/08/15 12:31:52 $
7  * Purpose:     Defines for Private Network Management Interface
8  *
9  ****************************************************************************/
10
11 /******************************************************************************
12  *
13  *      (C)Copyright 1998-2002 SysKonnect GmbH.
14  *      (C)Copyright 2002-2003 Marvell.
15  *
16  *      This program is free software; you can redistribute it and/or modify
17  *      it under the terms of the GNU General Public License as published by
18  *      the Free Software Foundation; either version 2 of the License, or
19  *      (at your option) any later version.
20  *
21  *      The information in this file is provided "AS IS" without warranty.
22  *
23  ******************************************************************************/
24
25 #ifndef _SKGEPNMI_H_
26 #define _SKGEPNMI_H_
27
28 /*
29  * Include dependencies
30  */
31 #include "h/sktypes.h"
32 #include "h/skerror.h"
33 #include "h/sktimer.h"
34 #include "h/ski2c.h"
35 #include "h/skaddr.h"
36 #include "h/skrlmt.h"
37 #include "h/skvpd.h"
38
39 /*
40  * Management Database Version
41  */
42 #define SK_PNMI_MDB_VERSION             0x00030001      /* 3.1 */
43
44
45 /*
46  * Event definitions
47  */
48 #define SK_PNMI_EVT_SIRQ_OVERFLOW               1       /* Counter overflow */
49 #define SK_PNMI_EVT_SEN_WAR_LOW                 2       /* Lower war thres exceeded */
50 #define SK_PNMI_EVT_SEN_WAR_UPP                 3       /* Upper war thres exceeded */
51 #define SK_PNMI_EVT_SEN_ERR_LOW                 4       /* Lower err thres exceeded */
52 #define SK_PNMI_EVT_SEN_ERR_UPP                 5       /* Upper err thres exceeded */
53 #define SK_PNMI_EVT_CHG_EST_TIMER               6       /* Timer event for RLMT Chg */
54 #define SK_PNMI_EVT_UTILIZATION_TIMER   7       /* Timer event for Utiliza. */
55 #define SK_PNMI_EVT_CLEAR_COUNTER               8       /* Clear statistic counters */
56 #define SK_PNMI_EVT_XMAC_RESET                  9       /* XMAC will be reset */
57
58 #define SK_PNMI_EVT_RLMT_PORT_UP                10      /* Port came logically up */
59 #define SK_PNMI_EVT_RLMT_PORT_DOWN              11      /* Port went logically down */
60 #define SK_PNMI_EVT_RLMT_SEGMENTATION   13      /* Two SP root bridges found */
61 #define SK_PNMI_EVT_RLMT_ACTIVE_DOWN    14      /* Port went logically down */
62 #define SK_PNMI_EVT_RLMT_ACTIVE_UP              15      /* Port came logically up */
63 #define SK_PNMI_EVT_RLMT_SET_NETS               16      /* 1. Parameter is number of nets
64                                                                                                 1 = single net; 2 = dual net */
65 #define SK_PNMI_EVT_VCT_RESET           17      /* VCT port reset timer event started with SET. */
66
67
68 /*
69  * Return values
70  */
71 #define SK_PNMI_ERR_OK                          0
72 #define SK_PNMI_ERR_GENERAL                     1
73 #define SK_PNMI_ERR_TOO_SHORT           2
74 #define SK_PNMI_ERR_BAD_VALUE           3
75 #define SK_PNMI_ERR_READ_ONLY           4
76 #define SK_PNMI_ERR_UNKNOWN_OID         5
77 #define SK_PNMI_ERR_UNKNOWN_INST        6
78 #define SK_PNMI_ERR_UNKNOWN_NET         7
79 #define SK_PNMI_ERR_NOT_SUPPORTED       10
80
81
82 /*
83  * Return values of driver reset function SK_DRIVER_RESET() and
84  * driver event function SK_DRIVER_EVENT()
85  */
86 #define SK_PNMI_ERR_OK                  0
87 #define SK_PNMI_ERR_FAIL                1
88
89
90 /*
91  * Return values of driver test function SK_DRIVER_SELFTEST()
92  */
93 #define SK_PNMI_TST_UNKNOWN             (1 << 0)
94 #define SK_PNMI_TST_TRANCEIVER          (1 << 1)
95 #define SK_PNMI_TST_ASIC                (1 << 2)
96 #define SK_PNMI_TST_SENSOR              (1 << 3)
97 #define SK_PNMI_TST_POWERMGMT           (1 << 4)
98 #define SK_PNMI_TST_PCI                 (1 << 5)
99 #define SK_PNMI_TST_MAC                 (1 << 6)
100
101
102 /*
103  * RLMT specific definitions
104  */
105 #define SK_PNMI_RLMT_STATUS_STANDBY     1
106 #define SK_PNMI_RLMT_STATUS_ACTIVE      2
107 #define SK_PNMI_RLMT_STATUS_ERROR       3
108
109 #define SK_PNMI_RLMT_LSTAT_PHY_DOWN     1
110 #define SK_PNMI_RLMT_LSTAT_AUTONEG      2
111 #define SK_PNMI_RLMT_LSTAT_LOG_DOWN     3
112 #define SK_PNMI_RLMT_LSTAT_LOG_UP       4
113 #define SK_PNMI_RLMT_LSTAT_INDETERMINATED 5
114
115 #define SK_PNMI_RLMT_MODE_CHK_LINK      (SK_RLMT_CHECK_LINK)
116 #define SK_PNMI_RLMT_MODE_CHK_RX        (SK_RLMT_CHECK_LOC_LINK)
117 #define SK_PNMI_RLMT_MODE_CHK_SPT       (SK_RLMT_CHECK_SEG)
118 /* #define SK_PNMI_RLMT_MODE_CHK_EX */
119
120 /*
121  * OID definition
122  */
123 #ifndef _NDIS_  /* Check, whether NDIS already included OIDs */
124
125 #define OID_GEN_XMIT_OK                                 0x00020101
126 #define OID_GEN_RCV_OK                                  0x00020102
127 #define OID_GEN_XMIT_ERROR                              0x00020103
128 #define OID_GEN_RCV_ERROR                               0x00020104
129 #define OID_GEN_RCV_NO_BUFFER                   0x00020105
130
131 /* #define OID_GEN_DIRECTED_BYTES_XMIT  0x00020201 */
132 #define OID_GEN_DIRECTED_FRAMES_XMIT    0x00020202
133 /* #define OID_GEN_MULTICAST_BYTES_XMIT 0x00020203 */
134 #define OID_GEN_MULTICAST_FRAMES_XMIT   0x00020204
135 /* #define OID_GEN_BROADCAST_BYTES_XMIT 0x00020205 */
136 #define OID_GEN_BROADCAST_FRAMES_XMIT   0x00020206
137 /* #define OID_GEN_DIRECTED_BYTES_RCV   0x00020207 */
138 #define OID_GEN_DIRECTED_FRAMES_RCV             0x00020208
139 /* #define OID_GEN_MULTICAST_BYTES_RCV  0x00020209 */
140 #define OID_GEN_MULTICAST_FRAMES_RCV    0x0002020A
141 /* #define OID_GEN_BROADCAST_BYTES_RCV  0x0002020B */
142 #define OID_GEN_BROADCAST_FRAMES_RCV    0x0002020C
143 #define OID_GEN_RCV_CRC_ERROR                   0x0002020D
144 #define OID_GEN_TRANSMIT_QUEUE_LENGTH   0x0002020E
145
146 #define OID_802_3_PERMANENT_ADDRESS             0x01010101
147 #define OID_802_3_CURRENT_ADDRESS               0x01010102
148 /* #define OID_802_3_MULTICAST_LIST             0x01010103 */
149 /* #define OID_802_3_MAXIMUM_LIST_SIZE  0x01010104 */
150 /* #define OID_802_3_MAC_OPTIONS                0x01010105 */
151                         
152 #define OID_802_3_RCV_ERROR_ALIGNMENT   0x01020101
153 #define OID_802_3_XMIT_ONE_COLLISION    0x01020102
154 #define OID_802_3_XMIT_MORE_COLLISIONS  0x01020103
155 #define OID_802_3_XMIT_DEFERRED                 0x01020201
156 #define OID_802_3_XMIT_MAX_COLLISIONS   0x01020202
157 #define OID_802_3_RCV_OVERRUN                   0x01020203
158 #define OID_802_3_XMIT_UNDERRUN                 0x01020204
159 #define OID_802_3_XMIT_TIMES_CRS_LOST   0x01020206
160 #define OID_802_3_XMIT_LATE_COLLISIONS  0x01020207
161
162 /*
163  * PnP and PM OIDs
164  */
165 #ifdef SK_POWER_MGMT
166 #define OID_PNP_CAPABILITIES                    0xFD010100
167 #define OID_PNP_SET_POWER                               0xFD010101
168 #define OID_PNP_QUERY_POWER                             0xFD010102
169 #define OID_PNP_ADD_WAKE_UP_PATTERN             0xFD010103
170 #define OID_PNP_REMOVE_WAKE_UP_PATTERN  0xFD010104
171 #define OID_PNP_ENABLE_WAKE_UP                  0xFD010106
172 #endif /* SK_POWER_MGMT */
173
174 #endif /* _NDIS_ */
175
176 #define OID_SKGE_MDB_VERSION                    0xFF010100
177 #define OID_SKGE_SUPPORTED_LIST                 0xFF010101
178 #define OID_SKGE_VPD_FREE_BYTES                 0xFF010102
179 #define OID_SKGE_VPD_ENTRIES_LIST               0xFF010103
180 #define OID_SKGE_VPD_ENTRIES_NUMBER             0xFF010104
181 #define OID_SKGE_VPD_KEY                                0xFF010105
182 #define OID_SKGE_VPD_VALUE                              0xFF010106
183 #define OID_SKGE_VPD_ACCESS                             0xFF010107
184 #define OID_SKGE_VPD_ACTION                             0xFF010108
185                         
186 #define OID_SKGE_PORT_NUMBER                    0xFF010110
187 #define OID_SKGE_DEVICE_TYPE                    0xFF010111
188 #define OID_SKGE_DRIVER_DESCR                   0xFF010112
189 #define OID_SKGE_DRIVER_VERSION                 0xFF010113
190 #define OID_SKGE_HW_DESCR                               0xFF010114
191 #define OID_SKGE_HW_VERSION                             0xFF010115
192 #define OID_SKGE_CHIPSET                                0xFF010116
193 #define OID_SKGE_ACTION                                 0xFF010117
194 #define OID_SKGE_RESULT                                 0xFF010118
195 #define OID_SKGE_BUS_TYPE                               0xFF010119
196 #define OID_SKGE_BUS_SPEED                              0xFF01011A
197 #define OID_SKGE_BUS_WIDTH                              0xFF01011B
198 /* 0xFF01011C unused */
199 #define OID_SKGE_DIAG_ACTION                    0xFF01011D
200 #define OID_SKGE_DIAG_RESULT                    0xFF01011E
201 #define OID_SKGE_MTU                                    0xFF01011F
202 #define OID_SKGE_PHYS_CUR_ADDR                  0xFF010120
203 #define OID_SKGE_PHYS_FAC_ADDR                  0xFF010121
204 #define OID_SKGE_PMD                                    0xFF010122
205 #define OID_SKGE_CONNECTOR                              0xFF010123
206 #define OID_SKGE_LINK_CAP                               0xFF010124
207 #define OID_SKGE_LINK_MODE                              0xFF010125
208 #define OID_SKGE_LINK_MODE_STATUS               0xFF010126
209 #define OID_SKGE_LINK_STATUS                    0xFF010127
210 #define OID_SKGE_FLOWCTRL_CAP                   0xFF010128
211 #define OID_SKGE_FLOWCTRL_MODE                  0xFF010129
212 #define OID_SKGE_FLOWCTRL_STATUS                0xFF01012A
213 #define OID_SKGE_PHY_OPERATION_CAP              0xFF01012B
214 #define OID_SKGE_PHY_OPERATION_MODE             0xFF01012C
215 #define OID_SKGE_PHY_OPERATION_STATUS   0xFF01012D
216 #define OID_SKGE_MULTICAST_LIST                 0xFF01012E
217 #define OID_SKGE_CURRENT_PACKET_FILTER  0xFF01012F
218
219 #define OID_SKGE_TRAP                                   0xFF010130
220 #define OID_SKGE_TRAP_NUMBER                    0xFF010131
221
222 #define OID_SKGE_RLMT_MODE                              0xFF010140
223 #define OID_SKGE_RLMT_PORT_NUMBER               0xFF010141
224 #define OID_SKGE_RLMT_PORT_ACTIVE               0xFF010142
225 #define OID_SKGE_RLMT_PORT_PREFERRED    0xFF010143
226 #define OID_SKGE_INTERMEDIATE_SUPPORT   0xFF010160
227
228 #define OID_SKGE_SPEED_CAP                              0xFF010170
229 #define OID_SKGE_SPEED_MODE                             0xFF010171
230 #define OID_SKGE_SPEED_STATUS                   0xFF010172
231
232 #define OID_SKGE_BOARDLEVEL                             0xFF010180
233
234 #define OID_SKGE_SENSOR_NUMBER                  0xFF020100                      
235 #define OID_SKGE_SENSOR_INDEX                   0xFF020101
236 #define OID_SKGE_SENSOR_DESCR                   0xFF020102
237 #define OID_SKGE_SENSOR_TYPE                    0xFF020103
238 #define OID_SKGE_SENSOR_VALUE                   0xFF020104
239 #define OID_SKGE_SENSOR_WAR_THRES_LOW   0xFF020105
240 #define OID_SKGE_SENSOR_WAR_THRES_UPP   0xFF020106
241 #define OID_SKGE_SENSOR_ERR_THRES_LOW   0xFF020107
242 #define OID_SKGE_SENSOR_ERR_THRES_UPP   0xFF020108
243 #define OID_SKGE_SENSOR_STATUS                  0xFF020109
244 #define OID_SKGE_SENSOR_WAR_CTS                 0xFF02010A
245 #define OID_SKGE_SENSOR_ERR_CTS                 0xFF02010B
246 #define OID_SKGE_SENSOR_WAR_TIME                0xFF02010C
247 #define OID_SKGE_SENSOR_ERR_TIME                0xFF02010D
248
249 #define OID_SKGE_CHKSM_NUMBER                   0xFF020110
250 #define OID_SKGE_CHKSM_RX_OK_CTS                0xFF020111
251 #define OID_SKGE_CHKSM_RX_UNABLE_CTS    0xFF020112
252 #define OID_SKGE_CHKSM_RX_ERR_CTS               0xFF020113
253 #define OID_SKGE_CHKSM_TX_OK_CTS                0xFF020114
254 #define OID_SKGE_CHKSM_TX_UNABLE_CTS    0xFF020115
255
256 #define OID_SKGE_STAT_TX                                0xFF020120
257 #define OID_SKGE_STAT_TX_OCTETS                 0xFF020121
258 #define OID_SKGE_STAT_TX_BROADCAST              0xFF020122
259 #define OID_SKGE_STAT_TX_MULTICAST              0xFF020123
260 #define OID_SKGE_STAT_TX_UNICAST                0xFF020124
261 #define OID_SKGE_STAT_TX_LONGFRAMES             0xFF020125
262 #define OID_SKGE_STAT_TX_BURST                  0xFF020126
263 #define OID_SKGE_STAT_TX_PFLOWC                 0xFF020127
264 #define OID_SKGE_STAT_TX_FLOWC                  0xFF020128
265 #define OID_SKGE_STAT_TX_SINGLE_COL             0xFF020129
266 #define OID_SKGE_STAT_TX_MULTI_COL              0xFF02012A
267 #define OID_SKGE_STAT_TX_EXCESS_COL             0xFF02012B
268 #define OID_SKGE_STAT_TX_LATE_COL               0xFF02012C
269 #define OID_SKGE_STAT_TX_DEFFERAL               0xFF02012D
270 #define OID_SKGE_STAT_TX_EXCESS_DEF             0xFF02012E
271 #define OID_SKGE_STAT_TX_UNDERRUN               0xFF02012F
272 #define OID_SKGE_STAT_TX_CARRIER                0xFF020130
273 /* #define OID_SKGE_STAT_TX_UTIL                0xFF020131 */
274 #define OID_SKGE_STAT_TX_64                             0xFF020132
275 #define OID_SKGE_STAT_TX_127                    0xFF020133
276 #define OID_SKGE_STAT_TX_255                    0xFF020134
277 #define OID_SKGE_STAT_TX_511                    0xFF020135
278 #define OID_SKGE_STAT_TX_1023                   0xFF020136
279 #define OID_SKGE_STAT_TX_MAX                    0xFF020137
280 #define OID_SKGE_STAT_TX_SYNC                   0xFF020138
281 #define OID_SKGE_STAT_TX_SYNC_OCTETS    0xFF020139
282 #define OID_SKGE_STAT_RX                                0xFF02013A
283 #define OID_SKGE_STAT_RX_OCTETS                 0xFF02013B
284 #define OID_SKGE_STAT_RX_BROADCAST              0xFF02013C
285 #define OID_SKGE_STAT_RX_MULTICAST              0xFF02013D
286 #define OID_SKGE_STAT_RX_UNICAST                0xFF02013E
287 #define OID_SKGE_STAT_RX_PFLOWC                 0xFF02013F
288 #define OID_SKGE_STAT_RX_FLOWC                  0xFF020140
289 #define OID_SKGE_STAT_RX_PFLOWC_ERR             0xFF020141
290 #define OID_SKGE_STAT_RX_FLOWC_UNKWN    0xFF020142
291 #define OID_SKGE_STAT_RX_BURST                  0xFF020143
292 #define OID_SKGE_STAT_RX_MISSED                 0xFF020144
293 #define OID_SKGE_STAT_RX_FRAMING                0xFF020145
294 #define OID_SKGE_STAT_RX_OVERFLOW               0xFF020146
295 #define OID_SKGE_STAT_RX_JABBER                 0xFF020147
296 #define OID_SKGE_STAT_RX_CARRIER                0xFF020148
297 #define OID_SKGE_STAT_RX_IR_LENGTH              0xFF020149
298 #define OID_SKGE_STAT_RX_SYMBOL                 0xFF02014A
299 #define OID_SKGE_STAT_RX_SHORTS                 0xFF02014B
300 #define OID_SKGE_STAT_RX_RUNT                   0xFF02014C
301 #define OID_SKGE_STAT_RX_CEXT                   0xFF02014D
302 #define OID_SKGE_STAT_RX_TOO_LONG               0xFF02014E
303 #define OID_SKGE_STAT_RX_FCS                    0xFF02014F
304 /* #define OID_SKGE_STAT_RX_UTIL                0xFF020150 */
305 #define OID_SKGE_STAT_RX_64                             0xFF020151
306 #define OID_SKGE_STAT_RX_127                    0xFF020152
307 #define OID_SKGE_STAT_RX_255                    0xFF020153
308 #define OID_SKGE_STAT_RX_511                    0xFF020154
309 #define OID_SKGE_STAT_RX_1023                   0xFF020155
310 #define OID_SKGE_STAT_RX_MAX                    0xFF020156
311 #define OID_SKGE_STAT_RX_LONGFRAMES             0xFF020157
312
313 #define OID_SKGE_RLMT_CHANGE_CTS                0xFF020160
314 #define OID_SKGE_RLMT_CHANGE_TIME               0xFF020161
315 #define OID_SKGE_RLMT_CHANGE_ESTIM              0xFF020162
316 #define OID_SKGE_RLMT_CHANGE_THRES              0xFF020163
317
318 #define OID_SKGE_RLMT_PORT_INDEX                0xFF020164
319 #define OID_SKGE_RLMT_STATUS                    0xFF020165
320 #define OID_SKGE_RLMT_TX_HELLO_CTS              0xFF020166
321 #define OID_SKGE_RLMT_RX_HELLO_CTS              0xFF020167
322 #define OID_SKGE_RLMT_TX_SP_REQ_CTS             0xFF020168
323 #define OID_SKGE_RLMT_RX_SP_CTS                 0xFF020169
324
325 #define OID_SKGE_RLMT_MONITOR_NUMBER    0xFF010150
326 #define OID_SKGE_RLMT_MONITOR_INDEX             0xFF010151
327 #define OID_SKGE_RLMT_MONITOR_ADDR              0xFF010152
328 #define OID_SKGE_RLMT_MONITOR_ERRS              0xFF010153
329 #define OID_SKGE_RLMT_MONITOR_TIMESTAMP 0xFF010154
330 #define OID_SKGE_RLMT_MONITOR_ADMIN             0xFF010155
331
332 #define OID_SKGE_TX_SW_QUEUE_LEN                0xFF020170
333 #define OID_SKGE_TX_SW_QUEUE_MAX                0xFF020171
334 #define OID_SKGE_TX_RETRY                               0xFF020172
335 #define OID_SKGE_RX_INTR_CTS                    0xFF020173
336 #define OID_SKGE_TX_INTR_CTS                    0xFF020174
337 #define OID_SKGE_RX_NO_BUF_CTS                  0xFF020175
338 #define OID_SKGE_TX_NO_BUF_CTS                  0xFF020176
339 #define OID_SKGE_TX_USED_DESCR_NO               0xFF020177
340 #define OID_SKGE_RX_DELIVERED_CTS               0xFF020178
341 #define OID_SKGE_RX_OCTETS_DELIV_CTS    0xFF020179
342 #define OID_SKGE_RX_HW_ERROR_CTS                0xFF02017A
343 #define OID_SKGE_TX_HW_ERROR_CTS                0xFF02017B
344 #define OID_SKGE_IN_ERRORS_CTS                  0xFF02017C
345 #define OID_SKGE_OUT_ERROR_CTS                  0xFF02017D
346 #define OID_SKGE_ERR_RECOVERY_CTS               0xFF02017E
347 #define OID_SKGE_SYSUPTIME                              0xFF02017F
348
349 #define OID_SKGE_ALL_DATA                               0xFF020190
350
351 /* Defines for VCT. */
352 #define OID_SKGE_VCT_GET                                0xFF020200
353 #define OID_SKGE_VCT_SET                                0xFF020201
354 #define OID_SKGE_VCT_STATUS                             0xFF020202
355
356 #ifdef SK_DIAG_SUPPORT
357 /* Defines for driver DIAG mode. */
358 #define OID_SKGE_DIAG_MODE                              0xFF020204
359 #endif /* SK_DIAG_SUPPORT */
360
361 /* New OIDs */
362 #define OID_SKGE_DRIVER_RELDATE                 0xFF020210
363 #define OID_SKGE_DRIVER_FILENAME                0xFF020211
364 #define OID_SKGE_CHIPID                                 0xFF020212
365 #define OID_SKGE_RAMSIZE                                0xFF020213
366 #define OID_SKGE_VAUXAVAIL                              0xFF020214
367 #define OID_SKGE_PHY_TYPE                               0xFF020215
368 #define OID_SKGE_PHY_LP_MODE                    0xFF020216
369
370 /* VCT struct to store a backup copy of VCT data after a port reset. */
371 typedef struct s_PnmiVct {
372         SK_U8                   VctStatus;
373         SK_U8                   PCableLen;
374         SK_U32                  PMdiPairLen[4];
375         SK_U8                   PMdiPairSts[4];
376 } SK_PNMI_VCT;
377
378
379 /* VCT status values (to be given to CPA via OID_SKGE_VCT_STATUS). */
380 #define SK_PNMI_VCT_NONE                0
381 #define SK_PNMI_VCT_OLD_VCT_DATA        1
382 #define SK_PNMI_VCT_NEW_VCT_DATA        2
383 #define SK_PNMI_VCT_OLD_DSP_DATA        4
384 #define SK_PNMI_VCT_NEW_DSP_DATA        8
385 #define SK_PNMI_VCT_RUNNING             16
386
387
388 /* VCT cable test status. */
389 #define SK_PNMI_VCT_NORMAL_CABLE                0
390 #define SK_PNMI_VCT_SHORT_CABLE                 1
391 #define SK_PNMI_VCT_OPEN_CABLE                  2
392 #define SK_PNMI_VCT_TEST_FAIL                   3
393 #define SK_PNMI_VCT_IMPEDANCE_MISMATCH          4
394
395 #define OID_SKGE_TRAP_SEN_WAR_LOW               500
396 #define OID_SKGE_TRAP_SEN_WAR_UPP               501
397 #define OID_SKGE_TRAP_SEN_ERR_LOW               502
398 #define OID_SKGE_TRAP_SEN_ERR_UPP               503
399 #define OID_SKGE_TRAP_RLMT_CHANGE_THRES 520
400 #define OID_SKGE_TRAP_RLMT_CHANGE_PORT  521
401 #define OID_SKGE_TRAP_RLMT_PORT_DOWN    522
402 #define OID_SKGE_TRAP_RLMT_PORT_UP              523
403 #define OID_SKGE_TRAP_RLMT_SEGMENTATION 524
404
405 #ifdef SK_DIAG_SUPPORT
406 /* Defines for driver DIAG mode. */
407 #define SK_DIAG_ATTACHED        2
408 #define SK_DIAG_RUNNING         1
409 #define SK_DIAG_IDLE            0
410 #endif /* SK_DIAG_SUPPORT */
411
412 /*
413  * Generic PNMI IOCTL subcommand definitions.
414  */
415 #define SK_GET_SINGLE_VAR               1
416 #define SK_SET_SINGLE_VAR               2
417 #define SK_PRESET_SINGLE_VAR    3
418 #define SK_GET_FULL_MIB                 4
419 #define SK_SET_FULL_MIB                 5
420 #define SK_PRESET_FULL_MIB              6
421
422
423 /*
424  * Define error numbers and messages for syslog
425  */
426 #define SK_PNMI_ERR001          (SK_ERRBASE_PNMI + 1)
427 #define SK_PNMI_ERR001MSG       "SkPnmiGetStruct: Unknown OID"
428 #define SK_PNMI_ERR002          (SK_ERRBASE_PNMI + 2)
429 #define SK_PNMI_ERR002MSG       "SkPnmiGetStruct: Cannot read VPD keys"
430 #define SK_PNMI_ERR003          (SK_ERRBASE_PNMI + 3)
431 #define SK_PNMI_ERR003MSG       "OidStruct: Called with wrong OID"
432 #define SK_PNMI_ERR004          (SK_ERRBASE_PNMI + 4)
433 #define SK_PNMI_ERR004MSG       "OidStruct: Called with wrong action"
434 #define SK_PNMI_ERR005          (SK_ERRBASE_PNMI + 5)
435 #define SK_PNMI_ERR005MSG       "Perform: Cannot reset driver"
436 #define SK_PNMI_ERR006          (SK_ERRBASE_PNMI + 6)
437 #define SK_PNMI_ERR006MSG       "Perform: Unknown OID action command"
438 #define SK_PNMI_ERR007          (SK_ERRBASE_PNMI + 7)
439 #define SK_PNMI_ERR007MSG       "General: Driver description not initialized"
440 #define SK_PNMI_ERR008          (SK_ERRBASE_PNMI + 8)
441 #define SK_PNMI_ERR008MSG       "Addr: Tried to get unknown OID"
442 #define SK_PNMI_ERR009          (SK_ERRBASE_PNMI + 9)
443 #define SK_PNMI_ERR009MSG       "Addr: Unknown OID"
444 #define SK_PNMI_ERR010          (SK_ERRBASE_PNMI + 10)
445 #define SK_PNMI_ERR010MSG       "CsumStat: Unknown OID"
446 #define SK_PNMI_ERR011          (SK_ERRBASE_PNMI + 11)
447 #define SK_PNMI_ERR011MSG       "SensorStat: Sensor descr string too long"
448 #define SK_PNMI_ERR012          (SK_ERRBASE_PNMI + 12)
449 #define SK_PNMI_ERR012MSG       "SensorStat: Unknown OID"
450 #define SK_PNMI_ERR013          (SK_ERRBASE_PNMI + 13)
451 #define SK_PNMI_ERR013MSG       ""
452 #define SK_PNMI_ERR014          (SK_ERRBASE_PNMI + 14)
453 #define SK_PNMI_ERR014MSG       "Vpd: Cannot read VPD keys"
454 #define SK_PNMI_ERR015          (SK_ERRBASE_PNMI + 15)
455 #define SK_PNMI_ERR015MSG       "Vpd: Internal array for VPD keys to small"
456 #define SK_PNMI_ERR016          (SK_ERRBASE_PNMI + 16)
457 #define SK_PNMI_ERR016MSG       "Vpd: Key string too long"
458 #define SK_PNMI_ERR017          (SK_ERRBASE_PNMI + 17)
459 #define SK_PNMI_ERR017MSG       "Vpd: Invalid VPD status pointer"
460 #define SK_PNMI_ERR018          (SK_ERRBASE_PNMI + 18)
461 #define SK_PNMI_ERR018MSG       "Vpd: VPD data not valid"
462 #define SK_PNMI_ERR019          (SK_ERRBASE_PNMI + 19)
463 #define SK_PNMI_ERR019MSG       "Vpd: VPD entries list string too long"
464 #define SK_PNMI_ERR021          (SK_ERRBASE_PNMI + 21)
465 #define SK_PNMI_ERR021MSG       "Vpd: VPD data string too long"
466 #define SK_PNMI_ERR022          (SK_ERRBASE_PNMI + 22)
467 #define SK_PNMI_ERR022MSG       "Vpd: VPD data string too long should be errored before"
468 #define SK_PNMI_ERR023          (SK_ERRBASE_PNMI + 23)
469 #define SK_PNMI_ERR023MSG       "Vpd: Unknown OID in get action"
470 #define SK_PNMI_ERR024          (SK_ERRBASE_PNMI + 24)
471 #define SK_PNMI_ERR024MSG       "Vpd: Unknown OID in preset/set action"
472 #define SK_PNMI_ERR025          (SK_ERRBASE_PNMI + 25)
473 #define SK_PNMI_ERR025MSG       "Vpd: Cannot write VPD after modify entry"
474 #define SK_PNMI_ERR026          (SK_ERRBASE_PNMI + 26)
475 #define SK_PNMI_ERR026MSG       "Vpd: Cannot update VPD"
476 #define SK_PNMI_ERR027          (SK_ERRBASE_PNMI + 27)
477 #define SK_PNMI_ERR027MSG       "Vpd: Cannot delete VPD entry"
478 #define SK_PNMI_ERR028          (SK_ERRBASE_PNMI + 28)
479 #define SK_PNMI_ERR028MSG       "Vpd: Cannot update VPD after delete entry"
480 #define SK_PNMI_ERR029          (SK_ERRBASE_PNMI + 29)
481 #define SK_PNMI_ERR029MSG       "General: Driver description string too long"
482 #define SK_PNMI_ERR030          (SK_ERRBASE_PNMI + 30)
483 #define SK_PNMI_ERR030MSG       "General: Driver version not initialized"
484 #define SK_PNMI_ERR031          (SK_ERRBASE_PNMI + 31)
485 #define SK_PNMI_ERR031MSG       "General: Driver version string too long"
486 #define SK_PNMI_ERR032          (SK_ERRBASE_PNMI + 32)
487 #define SK_PNMI_ERR032MSG       "General: Cannot read VPD Name for HW descr"
488 #define SK_PNMI_ERR033          (SK_ERRBASE_PNMI + 33)
489 #define SK_PNMI_ERR033MSG       "General: HW description string too long"
490 #define SK_PNMI_ERR034          (SK_ERRBASE_PNMI + 34)
491 #define SK_PNMI_ERR034MSG       "General: Unknown OID"
492 #define SK_PNMI_ERR035          (SK_ERRBASE_PNMI + 35)
493 #define SK_PNMI_ERR035MSG       "Rlmt: Unknown OID"
494 #define SK_PNMI_ERR036          (SK_ERRBASE_PNMI + 36)
495 #define SK_PNMI_ERR036MSG       ""
496 #define SK_PNMI_ERR037          (SK_ERRBASE_PNMI + 37)
497 #define SK_PNMI_ERR037MSG       "Rlmt: SK_RLMT_MODE_CHANGE event return not 0"
498 #define SK_PNMI_ERR038          (SK_ERRBASE_PNMI + 38)
499 #define SK_PNMI_ERR038MSG       "Rlmt: SK_RLMT_PREFPORT_CHANGE event return not 0"
500 #define SK_PNMI_ERR039          (SK_ERRBASE_PNMI + 39)
501 #define SK_PNMI_ERR039MSG       "RlmtStat: Unknown OID"
502 #define SK_PNMI_ERR040          (SK_ERRBASE_PNMI + 40)
503 #define SK_PNMI_ERR040MSG       "PowerManagement: Unknown OID"
504 #define SK_PNMI_ERR041          (SK_ERRBASE_PNMI + 41)
505 #define SK_PNMI_ERR041MSG       "MacPrivateConf: Unknown OID"
506 #define SK_PNMI_ERR042          (SK_ERRBASE_PNMI + 42)
507 #define SK_PNMI_ERR042MSG       "MacPrivateConf: SK_HWEV_SET_ROLE returned not 0"
508 #define SK_PNMI_ERR043          (SK_ERRBASE_PNMI + 43)
509 #define SK_PNMI_ERR043MSG       "MacPrivateConf: SK_HWEV_SET_LMODE returned not 0"
510 #define SK_PNMI_ERR044          (SK_ERRBASE_PNMI + 44)
511 #define SK_PNMI_ERR044MSG       "MacPrivateConf: SK_HWEV_SET_FLOWMODE returned not 0"
512 #define SK_PNMI_ERR045          (SK_ERRBASE_PNMI + 45)
513 #define SK_PNMI_ERR045MSG       "MacPrivateConf: SK_HWEV_SET_SPEED returned not 0"
514 #define SK_PNMI_ERR046          (SK_ERRBASE_PNMI + 46)
515 #define SK_PNMI_ERR046MSG       "Monitor: Unknown OID"
516 #define SK_PNMI_ERR047          (SK_ERRBASE_PNMI + 47)
517 #define SK_PNMI_ERR047MSG       "SirqUpdate: Event function returns not 0"
518 #define SK_PNMI_ERR048          (SK_ERRBASE_PNMI + 48)
519 #define SK_PNMI_ERR048MSG       "RlmtUpdate: Event function returns not 0"
520 #define SK_PNMI_ERR049          (SK_ERRBASE_PNMI + 49)
521 #define SK_PNMI_ERR049MSG       "SkPnmiInit: Invalid size of 'CounterOffset' struct!!"
522 #define SK_PNMI_ERR050          (SK_ERRBASE_PNMI + 50)
523 #define SK_PNMI_ERR050MSG       "SkPnmiInit: Invalid size of 'StatAddr' table!!"
524 #define SK_PNMI_ERR051          (SK_ERRBASE_PNMI + 51)
525 #define SK_PNMI_ERR051MSG       "SkPnmiEvent: Port switch suspicious"
526 #define SK_PNMI_ERR052          (SK_ERRBASE_PNMI + 52)
527 #define SK_PNMI_ERR052MSG       ""
528 #define SK_PNMI_ERR053          (SK_ERRBASE_PNMI + 53)
529 #define SK_PNMI_ERR053MSG       "General: Driver release date not initialized"
530 #define SK_PNMI_ERR054          (SK_ERRBASE_PNMI + 54)
531 #define SK_PNMI_ERR054MSG       "General: Driver release date string too long"
532 #define SK_PNMI_ERR055          (SK_ERRBASE_PNMI + 55)
533 #define SK_PNMI_ERR055MSG       "General: Driver file name not initialized"
534 #define SK_PNMI_ERR056          (SK_ERRBASE_PNMI + 56)
535 #define SK_PNMI_ERR056MSG       "General: Driver file name string too long"
536
537 /*
538  * Management counter macros called by the driver
539  */
540 #define SK_PNMI_SET_DRIVER_DESCR(pAC,v) ((pAC)->Pnmi.pDriverDescription = \
541         (char *)(v))
542
543 #define SK_PNMI_SET_DRIVER_VER(pAC,v)   ((pAC)->Pnmi.pDriverVersion = \
544         (char *)(v))
545
546 #define SK_PNMI_SET_DRIVER_RELDATE(pAC,v)       ((pAC)->Pnmi.pDriverReleaseDate = \
547         (char *)(v))
548
549 #define SK_PNMI_SET_DRIVER_FILENAME(pAC,v)      ((pAC)->Pnmi.pDriverFileName = \
550         (char *)(v))
551
552 #define SK_PNMI_CNT_TX_QUEUE_LEN(pAC,v,p) \
553         { \
554                 (pAC)->Pnmi.Port[p].TxSwQueueLen = (SK_U64)(v); \
555                 if ((pAC)->Pnmi.Port[p].TxSwQueueLen > (pAC)->Pnmi.Port[p].TxSwQueueMax) { \
556                         (pAC)->Pnmi.Port[p].TxSwQueueMax = (pAC)->Pnmi.Port[p].TxSwQueueLen; \
557                 } \
558         }
559 #define SK_PNMI_CNT_TX_RETRY(pAC,p)     (((pAC)->Pnmi.Port[p].TxRetryCts)++)
560 #define SK_PNMI_CNT_RX_INTR(pAC,p)      (((pAC)->Pnmi.Port[p].RxIntrCts)++)
561 #define SK_PNMI_CNT_TX_INTR(pAC,p)      (((pAC)->Pnmi.Port[p].TxIntrCts)++)
562 #define SK_PNMI_CNT_NO_RX_BUF(pAC,p)    (((pAC)->Pnmi.Port[p].RxNoBufCts)++)
563 #define SK_PNMI_CNT_NO_TX_BUF(pAC,p)    (((pAC)->Pnmi.Port[p].TxNoBufCts)++)
564 #define SK_PNMI_CNT_USED_TX_DESCR(pAC,v,p) \
565         ((pAC)->Pnmi.Port[p].TxUsedDescrNo=(SK_U64)(v));
566 #define SK_PNMI_CNT_RX_OCTETS_DELIVERED(pAC,v,p) \
567         { \
568                 ((pAC)->Pnmi.Port[p].RxDeliveredCts)++; \
569                 (pAC)->Pnmi.Port[p].RxOctetsDeliveredCts += (SK_U64)(v); \
570         }
571 #define SK_PNMI_CNT_ERR_RECOVERY(pAC,p) (((pAC)->Pnmi.Port[p].ErrRecoveryCts)++);
572
573 #define SK_PNMI_CNT_SYNC_OCTETS(pAC,p,v) \
574         { \
575                 if ((p) < SK_MAX_MACS) { \
576                         ((pAC)->Pnmi.Port[p].StatSyncCts)++; \
577                         (pAC)->Pnmi.Port[p].StatSyncOctetsCts += (SK_U64)(v); \
578                 } \
579         }
580
581 #define SK_PNMI_CNT_RX_LONGFRAMES(pAC,p) \
582         { \
583                 if ((p) < SK_MAX_MACS) { \
584                         ((pAC)->Pnmi.Port[p].StatRxLongFrameCts++); \
585                 } \
586         }
587
588 #define SK_PNMI_CNT_RX_FRAMETOOLONG(pAC,p) \
589         { \
590                 if ((p) < SK_MAX_MACS) { \
591                         ((pAC)->Pnmi.Port[p].StatRxFrameTooLongCts++); \
592                 } \
593         }
594
595 #define SK_PNMI_CNT_RX_PMACC_ERR(pAC,p) \
596         { \
597                 if ((p) < SK_MAX_MACS) { \
598                         ((pAC)->Pnmi.Port[p].StatRxPMaccErr++); \
599                 } \
600         }
601
602 /*
603  * Conversion Macros
604  */
605 #define SK_PNMI_PORT_INST2LOG(i)        ((unsigned int)(i) - 1)
606 #define SK_PNMI_PORT_LOG2INST(l)        ((unsigned int)(l) + 1)
607 #define SK_PNMI_PORT_PHYS2LOG(p)        ((unsigned int)(p) + 1)
608 #define SK_PNMI_PORT_LOG2PHYS(pAC,l)    ((unsigned int)(l) - 1)
609 #define SK_PNMI_PORT_PHYS2INST(pAC,p)   \
610         (pAC->Pnmi.DualNetActiveFlag ? 2 : ((unsigned int)(p) + 2))
611 #define SK_PNMI_PORT_INST2PHYS(pAC,i)   ((unsigned int)(i) - 2)
612
613 /*
614  * Structure definition for SkPnmiGetStruct and SkPnmiSetStruct
615  */
616 #define SK_PNMI_VPD_KEY_SIZE    5
617 #define SK_PNMI_VPD_BUFSIZE             (VPD_SIZE)
618 #define SK_PNMI_VPD_ENTRIES             (VPD_SIZE / 4)
619 #define SK_PNMI_VPD_DATALEN             128 /*  Number of data bytes */
620
621 #define SK_PNMI_MULTICAST_LISTLEN       64
622 #define SK_PNMI_SENSOR_ENTRIES          (SK_MAX_SENSORS)
623 #define SK_PNMI_CHECKSUM_ENTRIES        3
624 #define SK_PNMI_MAC_ENTRIES                     (SK_MAX_MACS + 1)
625 #define SK_PNMI_MONITOR_ENTRIES         20
626 #define SK_PNMI_TRAP_ENTRIES            10
627 #define SK_PNMI_TRAPLEN                         128
628 #define SK_PNMI_STRINGLEN1                      80
629 #define SK_PNMI_STRINGLEN2                      25
630 #define SK_PNMI_TRAP_QUEUE_LEN          512
631
632 typedef struct s_PnmiVpd {
633         char                    VpdKey[SK_PNMI_VPD_KEY_SIZE];
634         char                    VpdValue[SK_PNMI_VPD_DATALEN];
635         SK_U8                   VpdAccess;
636         SK_U8                   VpdAction;
637 } SK_PNMI_VPD;
638
639 typedef struct s_PnmiSensor {
640         SK_U8                   SensorIndex;
641         char                    SensorDescr[SK_PNMI_STRINGLEN2];
642         SK_U8                   SensorType;
643         SK_U32                  SensorValue;
644         SK_U32                  SensorWarningThresholdLow;
645         SK_U32                  SensorWarningThresholdHigh;
646         SK_U32                  SensorErrorThresholdLow;
647         SK_U32                  SensorErrorThresholdHigh;
648         SK_U8                   SensorStatus;
649         SK_U64                  SensorWarningCts;
650         SK_U64                  SensorErrorCts;
651         SK_U64                  SensorWarningTimestamp;
652         SK_U64                  SensorErrorTimestamp;
653 } SK_PNMI_SENSOR;
654
655 typedef struct s_PnmiChecksum {
656         SK_U64                  ChecksumRxOkCts;
657         SK_U64                  ChecksumRxUnableCts;
658         SK_U64                  ChecksumRxErrCts;
659         SK_U64                  ChecksumTxOkCts;
660         SK_U64                  ChecksumTxUnableCts;
661 } SK_PNMI_CHECKSUM;
662
663 typedef struct s_PnmiStat {
664         SK_U64                  StatTxOkCts;
665         SK_U64                  StatTxOctetsOkCts;
666         SK_U64                  StatTxBroadcastOkCts;
667         SK_U64                  StatTxMulticastOkCts;
668         SK_U64                  StatTxUnicastOkCts;
669         SK_U64                  StatTxLongFramesCts;
670         SK_U64                  StatTxBurstCts;
671         SK_U64                  StatTxPauseMacCtrlCts;
672         SK_U64                  StatTxMacCtrlCts;
673         SK_U64                  StatTxSingleCollisionCts;
674         SK_U64                  StatTxMultipleCollisionCts;
675         SK_U64                  StatTxExcessiveCollisionCts;
676         SK_U64                  StatTxLateCollisionCts;
677         SK_U64                  StatTxDeferralCts;
678         SK_U64                  StatTxExcessiveDeferralCts;
679         SK_U64                  StatTxFifoUnderrunCts;
680         SK_U64                  StatTxCarrierCts;
681         SK_U64                  Dummy1; /* StatTxUtilization */
682         SK_U64                  StatTx64Cts;
683         SK_U64                  StatTx127Cts;
684         SK_U64                  StatTx255Cts;
685         SK_U64                  StatTx511Cts;
686         SK_U64                  StatTx1023Cts;
687         SK_U64                  StatTxMaxCts;
688         SK_U64                  StatTxSyncCts;
689         SK_U64                  StatTxSyncOctetsCts;
690         SK_U64                  StatRxOkCts;
691         SK_U64                  StatRxOctetsOkCts;
692         SK_U64                  StatRxBroadcastOkCts;
693         SK_U64                  StatRxMulticastOkCts;
694         SK_U64                  StatRxUnicastOkCts;
695         SK_U64                  StatRxLongFramesCts;
696         SK_U64                  StatRxPauseMacCtrlCts;
697         SK_U64                  StatRxMacCtrlCts;
698         SK_U64                  StatRxPauseMacCtrlErrorCts;
699         SK_U64                  StatRxMacCtrlUnknownCts;
700         SK_U64                  StatRxBurstCts;
701         SK_U64                  StatRxMissedCts;
702         SK_U64                  StatRxFramingCts;
703         SK_U64                  StatRxFifoOverflowCts;
704         SK_U64                  StatRxJabberCts;
705         SK_U64                  StatRxCarrierCts;
706         SK_U64                  StatRxIRLengthCts;
707         SK_U64                  StatRxSymbolCts;
708         SK_U64                  StatRxShortsCts;
709         SK_U64                  StatRxRuntCts;
710         SK_U64                  StatRxCextCts;
711         SK_U64                  StatRxTooLongCts;
712         SK_U64                  StatRxFcsCts;
713         SK_U64                  Dummy2; /* StatRxUtilization */
714         SK_U64                  StatRx64Cts;
715         SK_U64                  StatRx127Cts;
716         SK_U64                  StatRx255Cts;
717         SK_U64                  StatRx511Cts;
718         SK_U64                  StatRx1023Cts;
719         SK_U64                  StatRxMaxCts;
720 } SK_PNMI_STAT;
721
722 typedef struct s_PnmiConf {
723         char                    ConfMacCurrentAddr[6];
724         char                    ConfMacFactoryAddr[6];
725         SK_U8                   ConfPMD;
726         SK_U8                   ConfConnector;
727         SK_U32                  ConfPhyType;
728         SK_U32                  ConfPhyMode;
729         SK_U8                   ConfLinkCapability;
730         SK_U8                   ConfLinkMode;
731         SK_U8                   ConfLinkModeStatus;
732         SK_U8                   ConfLinkStatus;
733         SK_U8                   ConfFlowCtrlCapability;
734         SK_U8                   ConfFlowCtrlMode;
735         SK_U8                   ConfFlowCtrlStatus;
736         SK_U8                   ConfPhyOperationCapability;
737         SK_U8                   ConfPhyOperationMode;
738         SK_U8                   ConfPhyOperationStatus;
739         SK_U8                   ConfSpeedCapability;
740         SK_U8                   ConfSpeedMode;
741         SK_U8                   ConfSpeedStatus;
742 } SK_PNMI_CONF;
743
744 typedef struct s_PnmiRlmt {
745         SK_U32                  RlmtIndex;
746         SK_U32                  RlmtStatus;
747         SK_U64                  RlmtTxHelloCts;
748         SK_U64                  RlmtRxHelloCts;
749         SK_U64                  RlmtTxSpHelloReqCts;
750         SK_U64                  RlmtRxSpHelloCts;
751 } SK_PNMI_RLMT;
752
753 typedef struct s_PnmiRlmtMonitor {
754         SK_U32                  RlmtMonitorIndex;
755         char                    RlmtMonitorAddr[6];
756         SK_U64                  RlmtMonitorErrorCts;
757         SK_U64                  RlmtMonitorTimestamp;
758         SK_U8                   RlmtMonitorAdmin;
759 } SK_PNMI_RLMT_MONITOR;
760
761 typedef struct s_PnmiRequestStatus {
762         SK_U32                  ErrorStatus;
763         SK_U32                  ErrorOffset;
764 } SK_PNMI_REQUEST_STATUS;
765
766 typedef struct s_PnmiStrucData {
767         SK_U32                  MgmtDBVersion;
768         SK_PNMI_REQUEST_STATUS  ReturnStatus;
769         SK_U32                  VpdFreeBytes;
770         char                    VpdEntriesList[SK_PNMI_VPD_ENTRIES * SK_PNMI_VPD_KEY_SIZE];
771         SK_U32                  VpdEntriesNumber;
772         SK_PNMI_VPD             Vpd[SK_PNMI_VPD_ENTRIES];
773         SK_U32                  PortNumber;
774         SK_U32                  DeviceType;
775         char                    DriverDescr[SK_PNMI_STRINGLEN1];
776         char                    DriverVersion[SK_PNMI_STRINGLEN2];
777         char                    DriverReleaseDate[SK_PNMI_STRINGLEN1];
778         char                    DriverFileName[SK_PNMI_STRINGLEN1];
779         char                    HwDescr[SK_PNMI_STRINGLEN1];
780         char                    HwVersion[SK_PNMI_STRINGLEN2];
781         SK_U16                  Chipset;
782         SK_U32                  ChipId;
783         SK_U8                   VauxAvail;
784         SK_U32                  RamSize;
785         SK_U32                  MtuSize;
786         SK_U32                  Action;
787         SK_U32                  TestResult;
788         SK_U8                   BusType;
789         SK_U8                   BusSpeed;
790         SK_U8                   BusWidth;
791         SK_U8                   SensorNumber;
792         SK_PNMI_SENSOR  Sensor[SK_PNMI_SENSOR_ENTRIES];
793         SK_U8                   ChecksumNumber;
794         SK_PNMI_CHECKSUM        Checksum[SK_PNMI_CHECKSUM_ENTRIES];
795         SK_PNMI_STAT    Stat[SK_PNMI_MAC_ENTRIES];
796         SK_PNMI_CONF    Conf[SK_PNMI_MAC_ENTRIES];
797         SK_U8                   RlmtMode;
798         SK_U32                  RlmtPortNumber;
799         SK_U8                   RlmtPortActive;
800         SK_U8                   RlmtPortPreferred;
801         SK_U64                  RlmtChangeCts;
802         SK_U64                  RlmtChangeTime;
803         SK_U64                  RlmtChangeEstimate;
804         SK_U64                  RlmtChangeThreshold;
805         SK_PNMI_RLMT    Rlmt[SK_MAX_MACS];
806         SK_U32                  RlmtMonitorNumber;
807         SK_PNMI_RLMT_MONITOR    RlmtMonitor[SK_PNMI_MONITOR_ENTRIES];
808         SK_U32                  TrapNumber;
809         SK_U8                   Trap[SK_PNMI_TRAP_QUEUE_LEN];
810         SK_U64                  TxSwQueueLen;
811         SK_U64                  TxSwQueueMax;
812         SK_U64                  TxRetryCts;
813         SK_U64                  RxIntrCts;
814         SK_U64                  TxIntrCts;
815         SK_U64                  RxNoBufCts;
816         SK_U64                  TxNoBufCts;
817         SK_U64                  TxUsedDescrNo;
818         SK_U64                  RxDeliveredCts;
819         SK_U64                  RxOctetsDeliveredCts;
820         SK_U64                  RxHwErrorsCts;
821         SK_U64                  TxHwErrorsCts;
822         SK_U64                  InErrorsCts;
823         SK_U64                  OutErrorsCts;
824         SK_U64                  ErrRecoveryCts;
825         SK_U64                  SysUpTime;
826 } SK_PNMI_STRUCT_DATA;
827
828 #define SK_PNMI_STRUCT_SIZE     (sizeof(SK_PNMI_STRUCT_DATA))
829 #define SK_PNMI_MIN_STRUCT_SIZE ((unsigned int)(SK_UPTR)\
830                                  &(((SK_PNMI_STRUCT_DATA *)0)->VpdFreeBytes))
831                                                                                                                 /*
832                                                                                                                  * ReturnStatus field
833                                                                                                                  * must be located
834                                                                                                                  * before VpdFreeBytes
835                                                                                                                  */
836
837 /*
838  * Various definitions
839  */
840 #define SK_PNMI_MAX_PROTOS              3
841
842 #define SK_PNMI_CNT_NO                  66      /* Must have the value of the enum
843                                                                          * SK_PNMI_MAX_IDX. Define SK_PNMI_CHECK
844                                                                          * for check while init phase 1
845                                                                          */
846
847 /*
848  * Estimate data structure
849  */
850 typedef struct s_PnmiEstimate {
851         unsigned int    EstValueIndex;
852         SK_U64                  EstValue[7];
853         SK_U64                  Estimate;
854         SK_TIMER                EstTimer;
855 } SK_PNMI_ESTIMATE;
856
857
858 /*
859  * VCT timer data structure
860  */
861 typedef struct s_VctTimer {
862         SK_TIMER                VctTimer;
863 } SK_PNMI_VCT_TIMER;
864
865
866 /*
867  * PNMI specific adapter context structure
868  */
869 typedef struct s_PnmiPort {
870         SK_U64                  StatSyncCts;
871         SK_U64                  StatSyncOctetsCts;
872         SK_U64                  StatRxLongFrameCts;
873         SK_U64                  StatRxFrameTooLongCts;
874         SK_U64                  StatRxPMaccErr;
875         SK_U64                  TxSwQueueLen;
876         SK_U64                  TxSwQueueMax;
877         SK_U64                  TxRetryCts;
878         SK_U64                  RxIntrCts;
879         SK_U64                  TxIntrCts;
880         SK_U64                  RxNoBufCts;
881         SK_U64                  TxNoBufCts;
882         SK_U64                  TxUsedDescrNo;
883         SK_U64                  RxDeliveredCts;
884         SK_U64                  RxOctetsDeliveredCts;
885         SK_U64                  RxHwErrorsCts;
886         SK_U64                  TxHwErrorsCts;
887         SK_U64                  InErrorsCts;
888         SK_U64                  OutErrorsCts;
889         SK_U64                  ErrRecoveryCts;
890         SK_U64                  RxShortZeroMark;
891         SK_U64                  CounterOffset[SK_PNMI_CNT_NO];
892         SK_U32                  CounterHigh[SK_PNMI_CNT_NO];
893         SK_BOOL                 ActiveFlag;
894         SK_U8                   Align[3];
895 } SK_PNMI_PORT;
896
897
898 typedef struct s_PnmiData {
899         SK_PNMI_PORT    Port    [SK_MAX_MACS];
900         SK_PNMI_PORT    BufPort [SK_MAX_MACS]; /* 2002-09-13 pweber  */
901         SK_U64                  VirtualCounterOffset[SK_PNMI_CNT_NO];
902         SK_U32                  TestResult;
903         char                    HwVersion[10];
904         SK_U16                  Align01;
905
906         char                    *pDriverDescription;
907         char                    *pDriverVersion;
908         char                    *pDriverReleaseDate;
909         char                    *pDriverFileName;
910
911         int                             MacUpdatedFlag;
912         int                             RlmtUpdatedFlag;
913         int                             SirqUpdatedFlag;
914
915         SK_U64                  RlmtChangeCts;
916         SK_U64                  RlmtChangeTime;
917         SK_PNMI_ESTIMATE        RlmtChangeEstimate;
918         SK_U64                  RlmtChangeThreshold;
919
920         SK_U64                  StartUpTime;
921         SK_U32                  DeviceType;
922         char                    PciBusSpeed;
923         char                    PciBusWidth;
924         char                    Chipset;
925         char                    PMD;
926         char                    Connector;
927         SK_BOOL                 DualNetActiveFlag;
928         SK_U16                  Align02;
929
930         char                    TrapBuf[SK_PNMI_TRAP_QUEUE_LEN];
931         unsigned int    TrapBufFree;
932         unsigned int    TrapQueueBeg;
933         unsigned int    TrapQueueEnd;
934         unsigned int    TrapBufPad;
935         unsigned int    TrapUnique;
936         SK_U8           VctStatus[SK_MAX_MACS];
937         SK_PNMI_VCT     VctBackup[SK_MAX_MACS];
938         SK_PNMI_VCT_TIMER VctTimeout[SK_MAX_MACS];
939 #ifdef SK_DIAG_SUPPORT
940         SK_U32                  DiagAttached;
941 #endif /* SK_DIAG_SUPPORT */
942 } SK_PNMI;
943
944
945 /*
946  * Function prototypes
947  */
948 extern int SkPnmiInit(SK_AC *pAC, SK_IOC IoC, int Level);
949 extern int SkPnmiGetVar(SK_AC *pAC, SK_IOC IoC, SK_U32 Id, void* pBuf,
950         unsigned int* pLen, SK_U32 Instance, SK_U32 NetIndex);
951 extern int SkPnmiPreSetVar(SK_AC *pAC, SK_IOC IoC, SK_U32 Id,
952         void* pBuf, unsigned int *pLen, SK_U32 Instance, SK_U32 NetIndex);
953 extern int SkPnmiSetVar(SK_AC *pAC, SK_IOC IoC, SK_U32 Id, void* pBuf,
954         unsigned int *pLen, SK_U32 Instance, SK_U32 NetIndex);
955 extern int SkPnmiGetStruct(SK_AC *pAC, SK_IOC IoC, void* pBuf,
956         unsigned int *pLen, SK_U32 NetIndex);
957 extern int SkPnmiPreSetStruct(SK_AC *pAC, SK_IOC IoC, void* pBuf,
958         unsigned int *pLen, SK_U32 NetIndex);
959 extern int SkPnmiSetStruct(SK_AC *pAC, SK_IOC IoC, void* pBuf,
960         unsigned int *pLen, SK_U32 NetIndex);
961 extern int SkPnmiEvent(SK_AC *pAC, SK_IOC IoC, SK_U32 Event,
962         SK_EVPARA Param);
963 extern int SkPnmiGenIoctl(SK_AC *pAC, SK_IOC IoC, void * pBuf,
964         unsigned int * pLen, SK_U32 NetIndex);
965
966 #endif