]> git.karo-electronics.de Git - karo-tx-uboot.git/blob - drivers/sk98lin/h/skgeinit.h
8f7f392f7d95218af85ffde1247e8ac1b8428b50
[karo-tx-uboot.git] / drivers / sk98lin / h / skgeinit.h
1 /******************************************************************************
2  *
3  * Name:        skgeinit.h
4  * Project:     GEnesis, PCI Gigabit Ethernet Adapter
5  * Version:     $Revision$
6  * Date:        $Date$
7  * Purpose:     Structures and prototypes for the GE Init Module
8  *
9  ******************************************************************************/
10
11 /******************************************************************************
12  *
13  *      (C)Copyright 1998-2003 SysKonnect GmbH.
14  *
15  *      This program is free software; you can redistribute it and/or modify
16  *      it under the terms of the GNU General Public License as published by
17  *      the Free Software Foundation; either version 2 of the License, or
18  *      (at your option) any later version.
19  *
20  *      The information in this file is provided "AS IS" without warranty.
21  *
22  ******************************************************************************/
23
24 /******************************************************************************
25  *
26  * History:
27  *
28  *      $Log$
29  *      Revision 1.1  2007-03-09 09:43:58  lothar
30  *      Initial revision
31  *
32  *      Revision 1.75  2003/02/05 13:36:39  rschmidt
33  *      Added define SK_FACT_78 for YUKON's Host Clock of 78.12 MHz
34  *      Editorial changes
35  *
36  *      Revision 1.74  2003/01/28 09:39:16  rschmidt
37  *      Added entry GIYukonLite in s_GeInit structure
38  *      Editorial changes
39  *
40  *      Revision 1.73  2002/11/15 12:47:25  rschmidt
41  *      Replaced error message SKERR_HWI_E024 for Cable Diagnostic with
42  *      Rx queue error in SkGeStopPort().
43  *
44  *      Revision 1.72  2002/11/12 17:08:35  rschmidt
45  *      Added entries for Cable Diagnostic to Port structure
46  *      Added entries GIPciSlot64 and GIPciClock66 in s_GeInit structure
47  *      Added error message for Cable Diagnostic
48  *      Added prototypes for SkGmCableDiagStatus()
49  *      Editorial changes
50  *
51  *      Revision 1.71  2002/10/21 11:26:10  mkarl
52  *      Changed interface of SkGeInitAssignRamToQueues().
53  *
54  *      Revision 1.70  2002/10/14 08:21:32  rschmidt
55  *      Changed type of GICopperType, GIVauxAvail to SK_BOOL
56  *      Added entry PRxOverCnt to Port structure
57  *      Added entry GIYukon32Bit in s_GeInit structure
58  *      Editorial changes
59  *
60  *      Revision 1.69  2002/10/09 16:57:15  mkarl
61  *      Added some constants and macros for SkGeInitAssignRamToQueues().
62  *
63  *      Revision 1.68  2002/09/12 08:58:51  rwahl
64  *      Retrieve counters needed for XMAC errata workarounds directly because
65  *      PNMI returns corrected counter values (e.g. #10620).
66  *
67  *      Revision 1.67  2002/08/16 14:40:30  rschmidt
68  *      Added entries GIGenesis and GICopperType in s_GeInit structure
69  *      Added prototypes for SkMacHashing()
70  *      Editorial changes
71  *
72  *      Revision 1.66  2002/08/12 13:27:21  rschmidt
73  *      Added defines for Link speed capabilities
74  *      Added entry PLinkSpeedCap to Port structure
75  *      Added entry GIVauxAvail in s_GeInit structure
76  *      Added prototypes for SkMacPromiscMode()
77  *      Editorial changes
78  *
79  *      Revision 1.65  2002/08/08 15:46:18  rschmidt
80  *      Added define SK_PHY_ACC_TO for PHY access timeout
81  *      Added define SK_XM_RX_HI_WM for XMAC Rx High Watermark
82  *      Added define SK_MIN_TXQ_SIZE for Min RAM Buffer Tx Queue Size
83  *      Added entry PhyId1 to Port structure
84  *
85  *      Revision 1.64  2002/07/23 16:02:56  rschmidt
86  *      Added entry GIWolOffs in s_GeInit struct (HW-Bug in YUKON 1st rev.)
87  *      Added prototypes for: SkGePhyRead(), SkGePhyWrite()
88  *
89  *      Revision 1.63  2002/07/18 08:17:38  rwahl
90  *      Corrected definitions for SK_LSPEED_xxx & SK_LSPEED_STAT_xxx.
91  *
92  *      Revision 1.62  2002/07/17 18:21:55  rwahl
93  *      Added SK_LSPEED_INDETERMINATED define.
94  *
95  *      Revision 1.61  2002/07/17 17:16:03  rwahl
96  *      - MacType now member of GIni struct.
97  *      - Struct alignment to 32bit.
98  *      - Editorial change.
99  *
100  *      Revision 1.60  2002/07/15 18:23:39  rwahl
101  *      Added GeMacFunc to GE Init structure.
102  *      Added prototypes for SkXmUpdateStats(), SkGmUpdateStats(),
103  *        SkXmMacStatistic(), SkGmMacStatistic(), SkXmResetCounter(),
104  *        SkGmResetCounter(), SkXmOverflowStatus(), SkGmOverflowStatus().
105  *      Added defines for current link speed state.
106  *      Added ERRMSG defintions for MacUpdateStat() & MacStatistics().
107  *
108  *      Revision 1.59  2002/07/15 15:40:22  rschmidt
109  *      Added entry PLinkSpeedUsed to Port structure
110  *      Editorial changes
111  *
112  *      Revision 1.58  2002/06/10 09:36:30  rschmidt
113  *      Editorial changes.
114  *
115  *      Revision 1.57  2002/06/05 08:18:00  rschmidt
116  *      Corrected alignment in Port Structure
117  *      Added new prototypes for GMAC
118  *      Editorial changes
119  *
120  *      Revision 1.56  2002/04/25 11:38:12  rschmidt
121  *      Added defines for Link speed values
122  *      Added defines for Loopback parameters for MAC and PHY
123  *      Removed entry PRxCmd from Port structure
124  *      Added entry PLinkSpeed to Port structure
125  *      Added entries GIChipId and GIChipRev to GE Init structure
126  *      Removed entry GIAnyPortAct from GE Init structure
127  *      Added prototypes for: SkMacInit(), SkMacInitPhy(),
128  *      SkMacRxTxDisable(), SkMacSoftRst(), SkMacHardRst(), SkMacIrq(),
129  *      SkMacIrqDisable(), SkMacFlushTxFifo(), SkMacFlushRxFifo(),
130  *      SkMacAutoNegDone(), SkMacAutoNegLipaPhy(), SkMacSetRxTxEn(),
131  *      SkXmPhyRead(), SkXmPhyRead(), SkGmPhyWrite(), SkGmPhyWrite();
132  *      Removed prototypes for static functions in SkXmac2.c
133  *      Editorial changes
134  *
135  *      Revision 1.55  2002/02/26 15:24:53  rwahl
136  *      Fix: no link with manual configuration (#10673). The previous fix for
137  *      #10639 was removed. So for RLMT mode = CLS the RLMT may switch to
138  *      misconfigured port. It should not occur for the other RLMT modes.
139  *
140  *      Revision 1.54  2002/01/18 16:52:52  rwahl
141  *      Editorial corrections.
142  *
143  *      Revision 1.53  2001/11/20 09:19:58  rwahl
144  *      Reworked bugfix #10639 (no dependency to RLMT mode).
145  *
146  *      Revision 1.52  2001/10/26 07:52:23  afischer
147  *      Port switching bug in `check local link` mode
148  *
149  *      Revision 1.51  2001/02/09 12:26:38  cgoos
150  *      Inserted #ifdef DIAG for half duplex workaround timer.
151  *
152  *      Revision 1.50  2001/02/07 07:56:40  rassmann
153  *      Corrected copyright.
154  *
155  *      Revision 1.49  2001/01/31 15:32:18  gklug
156  *      fix: problem with autosensing an SR8800 switch
157  *      add: counter for autoneg timeouts
158  *
159  *      Revision 1.48  2000/11/09 11:30:10  rassmann
160  *      WA: Waiting after releasing reset until BCom chip is accessible.
161  *
162  *      Revision 1.47  2000/10/18 12:22:40  cgoos
163  *      Added workaround for half duplex hangup.
164  *
165  *      Revision 1.46  2000/08/10 11:28:00  rassmann
166  *      Editorial changes.
167  *      Preserving 32-bit alignment in structs for the adapter context.
168  *
169  *      Revision 1.45  1999/11/22 13:56:19  cgoos
170  *      Changed license header to GPL.
171  *
172  *      Revision 1.44  1999/10/26 07:34:15  malthoff
173  *      The define SK_LNK_ON has been lost in v1.41.
174  *
175  *      Revision 1.43  1999/10/06 09:30:16  cgoos
176  *      Changed SK_XM_THR_JUMBO.
177  *
178  *      Revision 1.42  1999/09/16 12:58:26  cgoos
179  *      Changed SK_LED_STANDY macro to be independent of HW link sync.
180  *
181  *      Revision 1.41  1999/07/30 06:56:14  malthoff
182  *      Correct comment for SK_MS_STAT_UNSET.
183  *
184  *      Revision 1.40  1999/05/27 13:38:46  cgoos
185  *      Added SK_BMU_TX_WM.
186  *      Made SK_BMU_TX_WM and SK_BMU_RX_WM user-definable.
187  *      Changed XMAC Tx treshold to max. values.
188  *
189  *      Revision 1.39  1999/05/20 14:35:26  malthoff
190  *      Remove prototypes for SkGeLinkLED().
191  *
192  *      Revision 1.38  1999/05/19 11:59:12  cgoos
193  *      Added SK_MS_CAP_INDETERMINATED define.
194  *
195  *      Revision 1.37  1999/05/19 07:32:33  cgoos
196  *      Changes for 1000Base-T.
197  *      LED-defines for HWAC_LINK_LED macro.
198  *
199  *      Revision 1.36  1999/04/08 14:00:24  gklug
200  *      add:Port struct field PLinkResCt
201  *
202  *      Revision 1.35  1999/03/25 07:43:07  malthoff
203  *      Add error string for SKERR_HWI_E018MSG.
204  *
205  *      Revision 1.34  1999/03/12 16:25:57  malthoff
206  *      Remove PPollRxD and PPollTxD.
207  *      Add SKERR_HWI_E017MSG. and SK_DPOLL_MAX.
208  *
209  *      Revision 1.33  1999/03/12 13:34:41  malthoff
210  *      Add Autonegotiation error codes.
211  *      Change defines for parameter Mode in SkXmSetRxCmd().
212  *      Replace __STDC__ by SK_KR_PROTO.
213  *
214  *      Revision 1.32  1999/01/25 14:40:20  mhaveman
215  *      Added new return states for the virtual management port if multiple
216  *      ports are active but differently configured.
217  *
218  *      Revision 1.31  1998/12/11 15:17:02  gklug
219  *      add: Link partnet autoneg states : Unknown Manual and Auto-negotiation
220  *
221  *      Revision 1.30  1998/12/07 12:17:04  gklug
222  *      add: Link Partner auto-negotiation flag
223  *
224  *      Revision 1.29  1998/12/01 10:54:42  gklug
225  *      add: variables for XMAC Errata
226  *
227  *      Revision 1.28  1998/12/01 10:14:15  gklug
228  *      add: PIsave saves the Interrupt status word
229  *
230  *      Revision 1.27  1998/11/26 15:24:52  mhaveman
231  *      Added link status states SK_LMODE_STAT_AUTOHALF and
232  *      SK_LMODE_STAT_AUTOFULL which are used by PNMI.
233  *
234  *      Revision 1.26  1998/11/26 14:53:01  gklug
235  *      add:autoNeg Timeout variable
236  *
237  *      Revision 1.25  1998/11/26 08:58:50  gklug
238  *      add: Link Mode configuration (AUTO Sense mode)
239  *
240  *      Revision 1.24  1998/11/24 13:30:27  gklug
241  *      add: PCheckPar to port struct
242  *
243  *      Revision 1.23  1998/11/18 13:23:26  malthoff
244  *      Add SK_PKT_TO_MAX.
245  *
246  *      Revision 1.22  1998/11/18 13:19:54  gklug
247  *      add: PPrevShorts and PLinkBroken to port struct for WA XMAC Errata #C1
248  *
249  *      Revision 1.21  1998/10/26 08:02:57  malthoff
250  *      Add GIRamOffs.
251  *
252  *      Revision 1.20  1998/10/19 07:28:37  malthoff
253  *      Add prototype for SkGeInitRamIface().
254  *
255  *      Revision 1.19  1998/10/14 14:47:48  malthoff
256  *      SK_TIMER should not be defined for Diagnostics.
257  *      Add SKERR_HWI_E015MSG and SKERR_HWI_E016MSG.
258  *
259  *      Revision 1.18  1998/10/14 14:00:03  gklug
260  *      add: timer to port struct for workaround of Errata #2
261  *
262  *      Revision 1.17  1998/10/14 11:23:09  malthoff
263  *      Add prototype for SkXmAutoNegDone().
264  *      Fix SkXmSetRxCmd() prototype statement.
265  *
266  *      Revision 1.16  1998/10/14 05:42:29  gklug
267  *      add: HWLinkUp flag to Port struct
268  *
269  *      Revision 1.15  1998/10/09 08:26:33  malthoff
270  *      Rename SK_RB_ULPP_B to SK_RB_LLPP_B.
271  *
272  *      Revision 1.14  1998/10/09 07:11:13  malthoff
273  *      bug fix: SK_FACT_53 is 85 not 117.
274  *      Rework time out init values.
275  *      Add GIPortUsage and corresponding defines.
276  *      Add some error log messages.
277  *
278  *      Revision 1.13  1998/10/06 14:13:14  malthoff
279  *      Add prototype for SkGeLoadLnkSyncCnt().
280  *
281  *      Revision 1.12  1998/10/05 11:29:53  malthoff
282  *      bug fix: A comment was not closed.
283  *
284  *      Revision 1.11  1998/10/05 08:01:59  malthoff
285  *      Add default Timeout- Threshold- and
286  *      Watermark constants. Add QRam start and end
287  *      variables. Also add vars to store the polling
288  *      mode and receive command. Add new Error Log
289  *      Messages and function prototypes.
290  *
291  *      Revision 1.10  1998/09/28 13:34:48  malthoff
292  *      Add mode bits for LED functions.
293  *      Move Autoneg and Flow Ctrl bits from shgesirq.h
294  *      Add the required Error Log Entries
295  *      and Function Prototypes.
296  *
297  *      Revision 1.9  1998/09/16 14:38:41  malthoff
298  *      Rework the SK_LNK_xxx defines.
299  *      Add error log message defines.
300  *      Add prototypes for skxmac2.c
301  *
302  *      Revision 1.8  1998/09/11 05:29:18  gklug
303  *      add: init state of a port
304  *
305  *      Revision 1.7  1998/09/08 08:35:52  gklug
306  *      add: defines of the Init Levels
307  *
308  *      Revision 1.6  1998/09/03 13:48:42  gklug
309  *      add: Link strati, capabilities to Port struct
310  *
311  *      Revision 1.5  1998/09/03 13:30:59  malthoff
312  *      Add SK_LNK_BLINK and SK_LNK_PERM.
313  *
314  *      Revision 1.4  1998/09/03 09:55:31  malthoff
315  *      Add constants for parameters Dir and RstMode
316  *      when calling SkGeStopPort().
317  *      Rework the prototype section.
318  *      Add Queue Address offsets PRxQOff, PXsQOff, and PXaQOff.
319  *      Remove Ioc with IoC.
320  *
321  *      Revision 1.3  1998/08/19 09:11:54  gklug
322  *      fix: struct are removed from c-source (see CCC)
323  *      add: typedefs for all structs
324  *
325  *      Revision 1.2  1998/07/28 12:38:26  malthoff
326  *      The prototypes got the parameter 'IoC'.
327  *
328  *      Revision 1.1  1998/07/23 09:50:24  malthoff
329  *      Created.
330  *
331  ******************************************************************************/
332
333 #ifndef __INC_SKGEINIT_H_
334 #define __INC_SKGEINIT_H_
335
336 #ifdef __cplusplus
337 extern "C" {
338 #endif  /* __cplusplus */
339
340 /* defines ********************************************************************/
341
342 /* modifying Link LED behaviour (used with SkGeLinkLED()) */
343 #define SK_LNK_OFF              LED_OFF
344 #define SK_LNK_ON               (LED_ON | LED_BLK_OFF | LED_SYNC_OFF)
345 #define SK_LNK_BLINK    (LED_ON | LED_BLK_ON  | LED_SYNC_ON)
346 #define SK_LNK_PERM             (LED_ON | LED_BLK_OFF | LED_SYNC_ON)
347 #define SK_LNK_TST              (LED_ON | LED_BLK_ON  | LED_SYNC_OFF)
348
349 /* parameter 'Mode' when calling SK_HWAC_LINK_LED() */
350 #define SK_LED_OFF              LED_OFF
351 #define SK_LED_ACTIVE   (LED_ON | LED_BLK_OFF | LED_SYNC_OFF)
352 #define SK_LED_STANDBY  (LED_ON | LED_BLK_ON  | LED_SYNC_OFF)
353
354 /* addressing LED Registers in SkGeXmitLED() */
355 #define XMIT_LED_INI    0
356 #define XMIT_LED_CNT    (RX_LED_VAL - RX_LED_INI)
357 #define XMIT_LED_CTRL   (RX_LED_CTRL- RX_LED_INI)
358 #define XMIT_LED_TST    (RX_LED_TST - RX_LED_INI)
359
360 /* parameter 'Mode' when calling SkGeXmitLED() */
361 #define SK_LED_DIS      0
362 #define SK_LED_ENA      1
363 #define SK_LED_TST      2
364
365 /* Counter and Timer constants, for a host clock of 62.5 MHz */
366 #define SK_XMIT_DUR             0x002faf08L             /*  50 ms */
367 #define SK_BLK_DUR              0x01dcd650L             /* 500 ms */
368
369 #define SK_DPOLL_DEF    0x00ee6b28L             /* 250 ms at 62.5 MHz */
370
371 #define SK_DPOLL_MAX    0x00ffffffL             /* 268 ms at 62.5 MHz */
372                                                                                 /* 215 ms at 78.12 MHz */
373
374 #define SK_FACT_62              100                     /* is given in percent */
375 #define SK_FACT_53               85         /* on GENESIS:      53.12 MHz */
376 #define SK_FACT_78              125                     /* on YUKON:    78.12 MHz */
377
378 /* Timeout values */
379 #define SK_MAC_TO_53    72                      /* MAC arbiter timeout */
380 #define SK_PKT_TO_53    0x2000          /* Packet arbiter timeout */
381 #define SK_PKT_TO_MAX   0xffff          /* Maximum value */
382 #define SK_RI_TO_53             36                      /* RAM interface timeout */
383
384 #define SK_PHY_ACC_TO   600000          /* PHY access timeout */
385
386 /* RAM Buffer High Pause Threshold values */
387 #define SK_RB_ULPP              ( 8 * 1024)     /* Upper Level in kB/8 */
388 #define SK_RB_LLPP_S    (10 * 1024)     /* Lower Level for small Queues */
389 #define SK_RB_LLPP_B    (16 * 1024)     /* Lower Level for big Queues */
390
391 #ifndef SK_BMU_RX_WM
392 #define SK_BMU_RX_WM    0x600           /* BMU Rx Watermark */
393 #endif
394 #ifndef SK_BMU_TX_WM
395 #define SK_BMU_TX_WM    0x600           /* BMU Tx Watermark */
396 #endif
397
398 /* XMAC II Rx High Watermark */
399 #define SK_XM_RX_HI_WM  0x05aa          /* 1450 */
400
401 /* XMAC II Tx Threshold */
402 #define SK_XM_THR_REDL  0x01fb          /* .. for redundant link usage */
403 #define SK_XM_THR_SL    0x01fb          /* .. for single link adapters */
404 #define SK_XM_THR_MULL  0x01fb          /* .. for multiple link usage */
405 #define SK_XM_THR_JUMBO 0x03fc          /* .. for jumbo frame usage */
406
407 /* values for GIPortUsage */
408 #define SK_RED_LINK             1               /* redundant link usage */
409 #define SK_MUL_LINK             2               /* multiple link usage */
410 #define SK_JUMBO_LINK   3               /* driver uses jumbo frames */
411
412 /* Minimum RAM Buffer Rx Queue Size */
413 #define SK_MIN_RXQ_SIZE 16              /* 16 kB */
414
415 /* Minimum RAM Buffer Tx Queue Size */
416 #define SK_MIN_TXQ_SIZE 16              /* 16 kB */
417
418 /* Queue Size units */
419 #define QZ_UNITS                0x7
420 #define QZ_STEP                 8
421
422 /* Percentage of queue size from whole memory */
423 /* 80 % for receive */
424 #define RAM_QUOTA_RX    80L
425 /* 0% for sync transfer */
426 #define RAM_QUOTA_SYNC  0L
427 /* the rest (20%) is taken for async transfer */
428
429 /* Get the rounded queue size in Bytes in 8k steps */
430 #define ROUND_QUEUE_SIZE(SizeInBytes)                                   \
431         ((((unsigned long) (SizeInBytes) + (QZ_STEP*1024L)-1) / 1024) & \
432         ~(QZ_STEP-1))
433
434 /* Get the rounded queue size in KBytes in 8k steps */
435 #define ROUND_QUEUE_SIZE_KB(Kilobytes) \
436         ROUND_QUEUE_SIZE((Kilobytes) * 1024L)
437
438 /* Types of RAM Buffer Queues */
439 #define SK_RX_SRAM_Q    1       /* small receive queue */
440 #define SK_RX_BRAM_Q    2       /* big receive queue */
441 #define SK_TX_RAM_Q             3       /* small or big transmit queue */
442
443 /* parameter 'Dir' when calling SkGeStopPort() */
444 #define SK_STOP_TX      1       /* Stops the transmit path, resets the XMAC */
445 #define SK_STOP_RX      2       /* Stops the receive path */
446 #define SK_STOP_ALL     3       /* Stops Rx and Tx path, resets the XMAC */
447
448 /* parameter 'RstMode' when calling SkGeStopPort() */
449 #define SK_SOFT_RST     1       /* perform a software reset */
450 #define SK_HARD_RST     2       /* perform a hardware reset */
451
452 /* Init Levels */
453 #define SK_INIT_DATA    0       /* Init level 0: init data structures */
454 #define SK_INIT_IO              1       /* Init level 1: init with IOs */
455 #define SK_INIT_RUN             2       /* Init level 2: init for run time */
456
457 /* Link Mode Parameter */
458 #define SK_LMODE_HALF           1       /* Half Duplex Mode */
459 #define SK_LMODE_FULL           2       /* Full Duplex Mode */
460 #define SK_LMODE_AUTOHALF       3       /* AutoHalf Duplex Mode */
461 #define SK_LMODE_AUTOFULL       4       /* AutoFull Duplex Mode */
462 #define SK_LMODE_AUTOBOTH       5       /* AutoBoth Duplex Mode */
463 #define SK_LMODE_AUTOSENSE      6       /* configured mode auto sensing */
464 #define SK_LMODE_INDETERMINATED 7       /* indeterminated */
465
466 /* Auto-negotiation timeout in 100ms granularity */
467 #define SK_AND_MAX_TO           6       /* Wait 600 msec before link comes up */
468
469 /* Auto-negotiation error codes */
470 #define SK_AND_OK                       0       /* no error */
471 #define SK_AND_OTHER            1       /* other error than below */
472 #define SK_AND_DUP_CAP          2       /* Duplex capabilities error */
473
474
475 /* Link Speed Capabilities */
476 #define SK_LSPEED_CAP_AUTO                      (1<<0)  /* Automatic resolution */
477 #define SK_LSPEED_CAP_10MBPS            (1<<1)  /* 10 Mbps */
478 #define SK_LSPEED_CAP_100MBPS           (1<<2)  /* 100 Mbps */
479 #define SK_LSPEED_CAP_1000MBPS          (1<<3)  /* 1000 Mbps */
480 #define SK_LSPEED_CAP_INDETERMINATED (1<<4) /* indeterminated */
481
482 /* Link Speed Parameter */
483 #define SK_LSPEED_AUTO                          1       /* Automatic resolution */
484 #define SK_LSPEED_10MBPS                        2       /* 10 Mbps */
485 #define SK_LSPEED_100MBPS                       3       /* 100 Mbps */
486 #define SK_LSPEED_1000MBPS                      4       /* 1000 Mbps */
487 #define SK_LSPEED_INDETERMINATED        5       /* indeterminated */
488
489 /* Link Speed Current State */
490 #define SK_LSPEED_STAT_UNKNOWN          1
491 #define SK_LSPEED_STAT_10MBPS           2
492 #define SK_LSPEED_STAT_100MBPS          3
493 #define SK_LSPEED_STAT_1000MBPS         4
494 #define SK_LSPEED_STAT_INDETERMINATED 5
495
496
497 /* Link Capability Parameter */
498 #define SK_LMODE_CAP_HALF               (1<<0)  /* Half Duplex Mode */
499 #define SK_LMODE_CAP_FULL               (1<<1)  /* Full Duplex Mode */
500 #define SK_LMODE_CAP_AUTOHALF   (1<<2)  /* AutoHalf Duplex Mode */
501 #define SK_LMODE_CAP_AUTOFULL   (1<<3)  /* AutoFull Duplex Mode */
502 #define SK_LMODE_CAP_INDETERMINATED (1<<4) /* indeterminated */
503
504 /* Link Mode Current State */
505 #define SK_LMODE_STAT_UNKNOWN   1       /* Unknown Duplex Mode */
506 #define SK_LMODE_STAT_HALF              2       /* Half Duplex Mode */
507 #define SK_LMODE_STAT_FULL              3       /* Full Duplex Mode */
508 #define SK_LMODE_STAT_AUTOHALF  4       /* Half Duplex Mode obtained by Auto-Neg */
509 #define SK_LMODE_STAT_AUTOFULL  5       /* Full Duplex Mode obtained by Auto-Neg */
510 #define SK_LMODE_STAT_INDETERMINATED 6  /* indeterminated */
511
512 /* Flow Control Mode Parameter (and capabilities) */
513 #define SK_FLOW_MODE_NONE               1       /* No Flow-Control */
514 #define SK_FLOW_MODE_LOC_SEND   2       /* Local station sends PAUSE */
515 #define SK_FLOW_MODE_SYMMETRIC  3       /* Both stations may send PAUSE */
516 #define SK_FLOW_MODE_SYM_OR_REM 4       /* Both stations may send PAUSE or
517                                          * just the remote station may send PAUSE
518                                          */
519 #define SK_FLOW_MODE_INDETERMINATED 5   /* indeterminated */
520
521 /* Flow Control Status Parameter */
522 #define SK_FLOW_STAT_NONE               1       /* No Flow Control */
523 #define SK_FLOW_STAT_REM_SEND   2       /* Remote Station sends PAUSE */
524 #define SK_FLOW_STAT_LOC_SEND   3       /* Local station sends PAUSE */
525 #define SK_FLOW_STAT_SYMMETRIC  4       /* Both station may send PAUSE */
526 #define SK_FLOW_STAT_INDETERMINATED 5   /* indeterminated */
527
528 /* Master/Slave Mode Capabilities */
529 #define SK_MS_CAP_AUTO          (1<<0)  /* Automatic resolution */
530 #define SK_MS_CAP_MASTER        (1<<1)  /* This station is master */
531 #define SK_MS_CAP_SLAVE         (1<<2)  /* This station is slave */
532 #define SK_MS_CAP_INDETERMINATED (1<<3) /* indeterminated */
533
534 /* Set Master/Slave Mode Parameter (and capabilities) */
535 #define SK_MS_MODE_AUTO         1       /* Automatic resolution */
536 #define SK_MS_MODE_MASTER       2       /* This station is master */
537 #define SK_MS_MODE_SLAVE        3       /* This station is slave */
538 #define SK_MS_MODE_INDETERMINATED 4     /* indeterminated */
539
540 /* Master/Slave Status Parameter */
541 #define SK_MS_STAT_UNSET        1       /* The M/S status is not set */
542 #define SK_MS_STAT_MASTER       2       /* This station is Master */
543 #define SK_MS_STAT_SLAVE        3       /* This station is Dlave */
544 #define SK_MS_STAT_FAULT        4       /* M/S resolution failed */
545 #define SK_MS_STAT_INDETERMINATED 5     /* indeterminated */
546
547 /* parameter 'Mode' when calling SkXmSetRxCmd() */
548 #define SK_STRIP_FCS_ON         (1<<0)  /* Enable  FCS stripping of Rx frames */
549 #define SK_STRIP_FCS_OFF        (1<<1)  /* Disable FCS stripping of Rx frames */
550 #define SK_STRIP_PAD_ON         (1<<2)  /* Enable  pad byte stripping of Rx fr */
551 #define SK_STRIP_PAD_OFF        (1<<3)  /* Disable pad byte stripping of Rx fr */
552 #define SK_LENERR_OK_ON         (1<<4)  /* Don't chk fr for in range len error */
553 #define SK_LENERR_OK_OFF        (1<<5)  /* Check frames for in range len error */
554 #define SK_BIG_PK_OK_ON         (1<<6)  /* Don't set Rx Error bit for big frames */
555 #define SK_BIG_PK_OK_OFF        (1<<7)  /* Set Rx Error bit for big frames */
556 #define SK_SELF_RX_ON           (1<<8)  /* Enable  Rx of own packets */
557 #define SK_SELF_RX_OFF          (1<<9)  /* Disable Rx of own packets */
558
559 /* parameter 'Para' when calling SkMacSetRxTxEn() */
560 #define SK_MAC_LOOPB_ON         (1<<0)  /* Enable  MAC Loopback Mode */
561 #define SK_MAC_LOOPB_OFF        (1<<1)  /* Disable MAC Loopback Mode */
562 #define SK_PHY_LOOPB_ON         (1<<2)  /* Enable  PHY Loopback Mode */
563 #define SK_PHY_LOOPB_OFF        (1<<3)  /* Disable PHY Loopback Mode */
564 #define SK_PHY_FULLD_ON         (1<<4)  /* Enable  GMII Full Duplex */
565 #define SK_PHY_FULLD_OFF        (1<<5)  /* Disable GMII Full Duplex */
566
567 /* States of PState */
568 #define SK_PRT_RESET    0       /* the port is reset */
569 #define SK_PRT_STOP             1       /* the port is stopped (similar to SW reset) */
570 #define SK_PRT_INIT             2       /* the port is initialized */
571 #define SK_PRT_RUN              3       /* the port has an active link */
572
573 /* Default receive frame limit for Workaround of XMAC Errata */
574 #define SK_DEF_RX_WA_LIM        SK_CONSTU64(100)
575
576 /* Link Partner Status */
577 #define SK_LIPA_UNKNOWN 0       /* Link partner is in unknown state */
578 #define SK_LIPA_MANUAL  1       /* Link partner is in detected manual state */
579 #define SK_LIPA_AUTO    2       /* Link partner is in auto-negotiation state */
580
581 /* Maximum Restarts before restart is ignored (3Com WA) */
582 #define SK_MAX_LRESTART 3       /* Max. 3 times the link is restarted */
583
584 /* Max. Auto-neg. timeouts before link detection in sense mode is reset */
585 #define SK_MAX_ANEG_TO  10      /* Max. 10 times the sense mode is reset */
586
587 /* structures *****************************************************************/
588
589 /*
590  * MAC specific functions
591  */
592 typedef struct s_GeMacFunc {
593         int  (*pFnMacUpdateStats)(SK_AC *pAC, SK_IOC IoC, unsigned int Port);
594         int  (*pFnMacStatistic)(SK_AC *pAC, SK_IOC IoC, unsigned int Port,
595                                                         SK_U16 StatAddr, SK_U32 *pVal);
596         int  (*pFnMacResetCounter)(SK_AC *pAC, SK_IOC IoC, unsigned int Port);
597         int  (*pFnMacOverflow)(SK_AC *pAC, SK_IOC IoC, unsigned int Port,
598                                                    SK_U16 IStatus, SK_U64 *pVal);
599 } SK_GEMACFUNC;
600
601 /*
602  * Port Structure
603  */
604 typedef struct s_GePort {
605 #ifndef SK_DIAG
606         SK_TIMER        PWaTimer;       /* Workaround Timer */
607         SK_TIMER        HalfDupChkTimer;
608 #endif /* SK_DIAG */
609         SK_U32  PPrevShorts;    /* Previous short Counter checking */
610         SK_U32  PPrevFcs;               /* Previous FCS Error Counter checking */
611         SK_U64  PPrevRx;                /* Previous RxOk Counter checking */
612         SK_U64  PRxLim;                 /* Previous RxOk Counter checking */
613         SK_U64  LastOctets;             /* For half duplex hang check */
614         int             PLinkResCt;             /* Link Restart Counter */
615         int             PAutoNegTimeOut;/* Auto-negotiation timeout current value */
616         int             PAutoNegTOCt;   /* Auto-negotiation Timeout Counter */
617         int             PRxQSize;               /* Port Rx Queue Size in kB */
618         int             PXSQSize;               /* Port Synchronous  Transmit Queue Size in kB */
619         int             PXAQSize;               /* Port Asynchronous Transmit Queue Size in kB */
620         SK_U32  PRxQRamStart;   /* Receive Queue RAM Buffer Start Address */
621         SK_U32  PRxQRamEnd;             /* Receive Queue RAM Buffer End Address */
622         SK_U32  PXsQRamStart;   /* Sync Tx Queue RAM Buffer Start Address */
623         SK_U32  PXsQRamEnd;             /* Sync Tx Queue RAM Buffer End Address */
624         SK_U32  PXaQRamStart;   /* Async Tx Queue RAM Buffer Start Address */
625         SK_U32  PXaQRamEnd;             /* Async Tx Queue RAM Buffer End Address */
626         SK_U32  PRxOverCnt;             /* Receive Overflow Counter */
627         int             PRxQOff;                /* Rx Queue Address Offset */
628         int             PXsQOff;                /* Synchronous Tx Queue Address Offset */
629         int             PXaQOff;                /* Asynchronous Tx Queue Address Offset */
630         int             PhyType;                /* PHY used on this port */
631         SK_U16  PhyId1;                 /* PHY Id1 on this port */
632         SK_U16  PhyAddr;                /* MDIO/MDC PHY address */
633         SK_U16  PIsave;                 /* Saved Interrupt status word */
634         SK_U16  PSsave;                 /* Saved PHY status word */
635         SK_BOOL PHWLinkUp;              /* The hardware Link is up (wiring) */
636         SK_BOOL PState;                 /* Is port initialized ? */
637         SK_BOOL PLinkBroken;    /* Is Link broken ? */
638         SK_BOOL PCheckPar;              /* Do we check for parity errors ? */
639         SK_BOOL HalfDupTimerActive;
640         SK_U8   PLinkCap;               /* Link Capabilities */
641         SK_U8   PLinkModeConf;  /* Link Mode configured */
642         SK_U8   PLinkMode;              /* Link Mode currently used */
643         SK_U8   PLinkModeStatus;/* Link Mode Status */
644         SK_U8   PLinkSpeedCap;  /* Link Speed Capabilities(10/100/1000 Mbps) */
645         SK_U8   PLinkSpeed;             /* configured Link Speed (10/100/1000 Mbps) */
646         SK_U8   PLinkSpeedUsed; /* current Link Speed (10/100/1000 Mbps) */
647         SK_U8   PFlowCtrlCap;   /* Flow Control Capabilities */
648         SK_U8   PFlowCtrlMode;  /* Flow Control Mode */
649         SK_U8   PFlowCtrlStatus;/* Flow Control Status */
650         SK_U8   PMSCap;                 /* Master/Slave Capabilities */
651         SK_U8   PMSMode;                /* Master/Slave Mode */
652         SK_U8   PMSStatus;              /* Master/Slave Status */
653         SK_U8   PAutoNegFail;   /* Auto-negotiation fail flag */
654         SK_U8   PLipaAutoNeg;   /* Auto-negotiation possible with Link Partner */
655         SK_U8   PCableLen;              /* Cable Length */
656         SK_U8   PMdiPairLen[4]; /* MDI[0..3] Pair Length */
657         SK_U8   PMdiPairSts[4]; /* MDI[0..3] Pair Diagnostic Status */
658 } SK_GEPORT;
659
660 /*
661  * Gigabit Ethernet Initialization Struct
662  * (has to be included in the adapter context)
663  */
664 typedef struct s_GeInit {
665         SK_U8           GIPciHwRev;             /* PCI HW Revision Number */
666         SK_U8           GIChipId;               /* Chip Identification Number */
667         SK_U8           GIChipRev;              /* Chip Revision Number */
668         SK_BOOL         GIGenesis;              /* Genesis adapter ? */
669         SK_BOOL         GICopperType;   /* Copper Type adapter ? */
670         SK_BOOL         GIPciSlot64;    /* 64-bit PCI Slot */
671         SK_BOOL         GIPciClock66;   /* 66 MHz PCI Clock */
672         SK_BOOL         GIVauxAvail;    /* VAUX available (YUKON) */
673         SK_BOOL         GIYukon32Bit;   /* 32-Bit YUKON adapter */
674         SK_BOOL         GIYukonLite;    /* YUKON-Lite chip */
675         int                     GIMacsFound;    /* Number of MACs found on this adapter */
676         int                     GIMacType;              /* MAC Type used on this adapter */
677         int                     GIHstClkFact;   /* Host Clock Factor (62.5 / HstClk * 100) */
678         int                     GIPortUsage;    /* Driver Port Usage */
679         int                     GILevel;                /* Initialization Level completed */
680         int                     GIRamSize;              /* The RAM size of the adapter in kB */
681         int                     GIWolOffs;              /* WOL Register Offset (HW-Bug in Rev. A) */
682         SK_U32          GIRamOffs;              /* RAM Address Offset for addr calculation */
683         SK_U32          GIPollTimerVal; /* Descr. Poll Timer Init Val (HstClk ticks) */
684         SK_GEPORT       GP[SK_MAX_MACS];/* Port Dependent Information */
685         SK_GEMACFUNC GIFunc;            /* MAC depedent functions */
686 } SK_GEINIT;
687
688 /*
689  * Error numbers and messages for skxmac2.c and skgeinit.c
690  */
691 #define SKERR_HWI_E001          (SK_ERRBASE_HWINIT)
692 #define SKERR_HWI_E001MSG       "SkXmClrExactAddr() has got illegal parameters"
693 #define SKERR_HWI_E002          (SKERR_HWI_E001+1)
694 #define SKERR_HWI_E002MSG       "SkGeInit(): Level 1 call missing"
695 #define SKERR_HWI_E003          (SKERR_HWI_E002+1)
696 #define SKERR_HWI_E003MSG       "SkGeInit() called with illegal init Level"
697 #define SKERR_HWI_E004          (SKERR_HWI_E003+1)
698 #define SKERR_HWI_E004MSG       "SkGeInitPort(): Queue Size illegal configured"
699 #define SKERR_HWI_E005          (SKERR_HWI_E004+1)
700 #define SKERR_HWI_E005MSG       "SkGeInitPort(): cannot init running ports"
701 #define SKERR_HWI_E006          (SKERR_HWI_E005+1)
702 #define SKERR_HWI_E006MSG       "SkGeMacInit(): PState does not match HW state"
703 #define SKERR_HWI_E007          (SKERR_HWI_E006+1)
704 #define SKERR_HWI_E007MSG       "SkXmInitDupMd() called with invalid Dup Mode"
705 #define SKERR_HWI_E008          (SKERR_HWI_E007+1)
706 #define SKERR_HWI_E008MSG       "SkXmSetRxCmd() called with invalid Mode"
707 #define SKERR_HWI_E009          (SKERR_HWI_E008+1)
708 #define SKERR_HWI_E009MSG       "SkGeCfgSync() called although PXSQSize zero"
709 #define SKERR_HWI_E010          (SKERR_HWI_E009+1)
710 #define SKERR_HWI_E010MSG       "SkGeCfgSync() called with invalid parameters"
711 #define SKERR_HWI_E011          (SKERR_HWI_E010+1)
712 #define SKERR_HWI_E011MSG       "SkGeInitPort(): Receive Queue Size too small"
713 #define SKERR_HWI_E012          (SKERR_HWI_E011+1)
714 #define SKERR_HWI_E012MSG       "SkGeInitPort(): invalid Queue Size specified"
715 #define SKERR_HWI_E013          (SKERR_HWI_E012+1)
716 #define SKERR_HWI_E013MSG       "SkGeInitPort(): cfg changed for running queue"
717 #define SKERR_HWI_E014          (SKERR_HWI_E013+1)
718 #define SKERR_HWI_E014MSG       "SkGeInitPort(): unknown GIPortUsage specified"
719 #define SKERR_HWI_E015          (SKERR_HWI_E014+1)
720 #define SKERR_HWI_E015MSG       "Illegal Link mode parameter"
721 #define SKERR_HWI_E016          (SKERR_HWI_E015+1)
722 #define SKERR_HWI_E016MSG       "Illegal Flow control mode parameter"
723 #define SKERR_HWI_E017          (SKERR_HWI_E016+1)
724 #define SKERR_HWI_E017MSG       "Illegal value specified for GIPollTimerVal"
725 #define SKERR_HWI_E018          (SKERR_HWI_E017+1)
726 #define SKERR_HWI_E018MSG       "FATAL: SkGeStopPort() does not terminate (Tx)"
727 #define SKERR_HWI_E019          (SKERR_HWI_E018+1)
728 #define SKERR_HWI_E019MSG       "Illegal Speed parameter"
729 #define SKERR_HWI_E020          (SKERR_HWI_E019+1)
730 #define SKERR_HWI_E020MSG       "Illegal Master/Slave parameter"
731 #define SKERR_HWI_E021          (SKERR_HWI_E020+1)
732 #define SKERR_HWI_E021MSG       "MacUpdateStats(): cannot update statistic counter"
733 #define SKERR_HWI_E022          (SKERR_HWI_E021+1)
734 #define SKERR_HWI_E022MSG       "MacStatistic(): illegal statistic base address"
735 #define SKERR_HWI_E023          (SKERR_HWI_E022+1)
736 #define SKERR_HWI_E023MSG       "SkGeInitPort(): Transmit Queue Size too small"
737 #define SKERR_HWI_E024          (SKERR_HWI_E023+1)
738 #define SKERR_HWI_E024MSG       "FATAL: SkGeStopPort() does not terminate (Rx)"
739 #define SKERR_HWI_E025          (SKERR_HWI_E024+1)
740 #define SKERR_HWI_E025MSG       ""
741
742 /* function prototypes ********************************************************/
743
744 #ifndef SK_KR_PROTO
745
746 /*
747  * public functions in skgeinit.c
748  */
749 extern void     SkGePollRxD(
750         SK_AC   *pAC,
751         SK_IOC  IoC,
752         int             Port,
753         SK_BOOL PollRxD);
754
755 extern void     SkGePollTxD(
756         SK_AC   *pAC,
757         SK_IOC  IoC,
758         int             Port,
759         SK_BOOL PollTxD);
760
761 extern void     SkGeYellowLED(
762         SK_AC   *pAC,
763         SK_IOC  IoC,
764         int             State);
765
766 extern int      SkGeCfgSync(
767         SK_AC   *pAC,
768         SK_IOC  IoC,
769         int             Port,
770         SK_U32  IntTime,
771         SK_U32  LimCount,
772         int             SyncMode);
773
774 extern void     SkGeLoadLnkSyncCnt(
775         SK_AC   *pAC,
776         SK_IOC  IoC,
777         int             Port,
778         SK_U32  CntVal);
779
780 extern void     SkGeStopPort(
781         SK_AC   *pAC,
782         SK_IOC  IoC,
783         int             Port,
784         int             Dir,
785         int             RstMode);
786
787 extern int      SkGeInit(
788         SK_AC   *pAC,
789         SK_IOC  IoC,
790         int             Level);
791
792 extern void     SkGeDeInit(
793         SK_AC   *pAC,
794         SK_IOC  IoC);
795
796 extern int      SkGeInitPort(
797         SK_AC   *pAC,
798         SK_IOC  IoC,
799         int             Port);
800
801 extern void     SkGeXmitLED(
802         SK_AC   *pAC,
803         SK_IOC  IoC,
804         int             Led,
805         int             Mode);
806
807 extern void     SkGeInitRamIface(
808         SK_AC   *pAC,
809         SK_IOC  IoC);
810
811 extern int      SkGeInitAssignRamToQueues(
812         SK_AC   *pAC,
813         int             ActivePort,
814         SK_BOOL DualNet);
815
816 /*
817  * public functions in skxmac2.c
818  */
819 extern void SkMacRxTxDisable(
820         SK_AC   *pAC,
821         SK_IOC  IoC,
822         int             Port);
823
824 extern void     SkMacSoftRst(
825         SK_AC   *pAC,
826         SK_IOC  IoC,
827         int             Port);
828
829 extern void     SkMacHardRst(
830         SK_AC   *pAC,
831         SK_IOC  IoC,
832         int             Port);
833
834 extern void     SkXmInitMac(
835         SK_AC   *pAC,
836         SK_IOC  IoC,
837         int             Port);
838
839 extern void     SkGmInitMac(
840         SK_AC   *pAC,
841         SK_IOC  IoC,
842         int             Port);
843
844 extern void SkMacInitPhy(
845         SK_AC   *pAC,
846         SK_IOC  IoC,
847         int             Port,
848         SK_BOOL DoLoop);
849
850 extern void SkMacIrqDisable(
851         SK_AC   *pAC,
852         SK_IOC  IoC,
853         int             Port);
854
855 extern void     SkMacFlushTxFifo(
856         SK_AC   *pAC,
857         SK_IOC  IoC,
858         int             Port);
859
860 extern void     SkMacFlushRxFifo(
861         SK_AC   *pAC,
862         SK_IOC  IoC,
863         int             Port);
864
865 extern void     SkMacIrq(
866         SK_AC   *pAC,
867         SK_IOC  IoC,
868         int             Port);
869
870 extern int      SkMacAutoNegDone(
871         SK_AC   *pAC,
872         SK_IOC  IoC,
873         int             Port);
874
875 extern void     SkMacAutoNegLipaPhy(
876         SK_AC   *pAC,
877         SK_IOC  IoC,
878         int             Port,
879         SK_U16  IStatus);
880
881 extern void  SkMacSetRxTxEn(
882         SK_AC   *pAC,
883         SK_IOC  IoC,
884         int             Port,
885         int             Para);
886
887 extern int  SkMacRxTxEnable(
888         SK_AC   *pAC,
889         SK_IOC  IoC,
890         int             Port);
891
892 extern void     SkMacPromiscMode(
893         SK_AC   *pAC,
894         SK_IOC  IoC,
895         int             Port,
896         SK_BOOL Enable);
897
898 extern void     SkMacHashing(
899         SK_AC   *pAC,
900         SK_IOC  IoC,
901         int             Port,
902         SK_BOOL Enable);
903
904 extern void     SkXmPhyRead(
905         SK_AC   *pAC,
906         SK_IOC  IoC,
907         int             Port,
908         int             Addr,
909         SK_U16  *pVal);
910
911 extern void     SkXmPhyWrite(
912         SK_AC   *pAC,
913         SK_IOC  IoC,
914         int             Port,
915         int             Addr,
916         SK_U16  Val);
917
918 extern void     SkGmPhyRead(
919         SK_AC   *pAC,
920         SK_IOC  IoC,
921         int             Port,
922         int             Addr,
923         SK_U16  *pVal);
924
925 extern void     SkGmPhyWrite(
926         SK_AC   *pAC,
927         SK_IOC  IoC,
928         int             Port,
929         int             Addr,
930         SK_U16  Val);
931
932 extern void     SkGePhyRead(
933         SK_AC   *pAC,
934         SK_IOC  IoC,
935         int             Port,
936         int             Addr,
937         SK_U16  *pVal);
938
939 extern void     SkGePhyWrite(
940         SK_AC   *pAC,
941         SK_IOC  IoC,
942         int             Port,
943         int             Addr,
944         SK_U16  Val);
945
946 extern void     SkXmClrExactAddr(
947         SK_AC   *pAC,
948         SK_IOC  IoC,
949         int             Port,
950         int             StartNum,
951         int             StopNum);
952
953 extern void     SkXmInitDupMd(
954         SK_AC   *pAC,
955         SK_IOC  IoC,
956         int             Port);
957
958 extern void     SkXmInitPauseMd(
959         SK_AC   *pAC,
960         SK_IOC  IoC,
961         int             Port);
962
963 extern void     SkXmAutoNegLipaXmac(
964         SK_AC   *pAC,
965         SK_IOC  IoC,
966         int             Port,
967         SK_U16  IStatus);
968
969 extern int SkXmUpdateStats(
970         SK_AC   *pAC,
971         SK_IOC  IoC,
972         unsigned int Port);
973
974 extern int SkGmUpdateStats(
975         SK_AC   *pAC,
976         SK_IOC  IoC,
977         unsigned int Port);
978
979 extern int SkXmMacStatistic(
980         SK_AC   *pAC,
981         SK_IOC  IoC,
982         unsigned int Port,
983         SK_U16  StatAddr,
984         SK_U32  *pVal);
985
986 extern int SkGmMacStatistic(
987         SK_AC   *pAC,
988         SK_IOC  IoC,
989         unsigned int Port,
990         SK_U16  StatAddr,
991         SK_U32  *pVal);
992
993 extern int SkXmResetCounter(
994         SK_AC   *pAC,
995         SK_IOC  IoC,
996         unsigned int Port);
997
998 extern int SkGmResetCounter(
999         SK_AC   *pAC,
1000         SK_IOC  IoC,
1001         unsigned int Port);
1002
1003 extern int SkXmOverflowStatus(
1004         SK_AC   *pAC,
1005         SK_IOC  IoC,
1006         unsigned int Port,
1007         SK_U16  IStatus,
1008         SK_U64  *pStatus);
1009
1010 extern int SkGmOverflowStatus(
1011         SK_AC   *pAC,
1012         SK_IOC  IoC,
1013         unsigned int Port,
1014         SK_U16  MacStatus,
1015         SK_U64  *pStatus);
1016
1017 extern int SkGmCableDiagStatus(
1018         SK_AC   *pAC,
1019         SK_IOC  IoC,
1020         int             Port,
1021         SK_BOOL StartTest);
1022
1023 #ifdef SK_DIAG
1024 extern void     SkMacSetRxCmd(
1025         SK_AC   *pAC,
1026         SK_IOC  IoC,
1027         int             Port,
1028         int             Mode);
1029 extern void     SkMacCrcGener(
1030         SK_AC   *pAC,
1031         SK_IOC  IoC,
1032         int             Port,
1033         SK_BOOL Enable);
1034 extern void     SkMacTimeStamp(
1035         SK_AC   *pAC,
1036         SK_IOC  IoC,
1037         int             Port,
1038         SK_BOOL Enable);
1039 extern void     SkXmSendCont(
1040         SK_AC   *pAC,
1041         SK_IOC  IoC,
1042         int             Port,
1043         SK_BOOL Enable);
1044 #endif /* SK_DIAG */
1045
1046 #else   /* SK_KR_PROTO */
1047
1048 /*
1049  * public functions in skgeinit.c
1050  */
1051 extern void     SkGePollRxD();
1052 extern void     SkGePollTxD();
1053 extern void     SkGeYellowLED();
1054 extern int      SkGeCfgSync();
1055 extern void     SkGeLoadLnkSyncCnt();
1056 extern void     SkGeStopPort();
1057 extern int      SkGeInit();
1058 extern void     SkGeDeInit();
1059 extern int      SkGeInitPort();
1060 extern void     SkGeXmitLED();
1061 extern void     SkGeInitRamIface();
1062 extern int      SkGeInitAssignRamToQueues();
1063
1064 /*
1065  * public functions in skxmac2.c
1066  */
1067 extern void SkMacRxTxDisable();
1068 extern void     SkMacSoftRst();
1069 extern void     SkMacHardRst();
1070 extern void SkMacInitPhy();
1071 extern int  SkMacRxTxEnable();
1072 extern void SkMacPromiscMode();
1073 extern void SkMacHashing();
1074 extern void SkMacIrqDisable();
1075 extern void     SkMacFlushTxFifo();
1076 extern void     SkMacFlushRxFifo();
1077 extern void     SkMacIrq();
1078 extern int      SkMacAutoNegDone();
1079 extern void     SkMacAutoNegLipaPhy();
1080 extern void SkMacSetRxTxEn();
1081 extern void     SkGePhyRead();
1082 extern void     SkGePhyWrite();
1083 extern void     SkXmInitMac();
1084 extern void     SkXmPhyRead();
1085 extern void     SkXmPhyWrite();
1086 extern void     SkGmInitMac();
1087 extern void     SkGmPhyRead();
1088 extern void     SkGmPhyWrite();
1089 extern void     SkXmClrExactAddr();
1090 extern void     SkXmInitDupMd();
1091 extern void     SkXmInitPauseMd();
1092 extern void     SkXmAutoNegLipaXmac();
1093 extern int      SkXmUpdateStats();
1094 extern int      SkGmUpdateStats();
1095 extern int      SkXmMacStatistic();
1096 extern int      SkGmMacStatistic();
1097 extern int      SkXmResetCounter();
1098 extern int      SkGmResetCounter();
1099 extern int      SkXmOverflowStatus();
1100 extern int      SkGmOverflowStatus();
1101 extern int      SkGmCableDiagStatus();
1102
1103 #ifdef SK_DIAG
1104 extern void     SkMacSetRxCmd();
1105 extern void     SkMacCrcGener();
1106 extern void     SkMacTimeStamp();
1107 extern void     SkXmSendCont();
1108 #endif /* SK_DIAG */
1109
1110 #endif  /* SK_KR_PROTO */
1111
1112 #ifdef __cplusplus
1113 }
1114 #endif  /* __cplusplus */
1115
1116 #endif  /* __INC_SKGEINIT_H_ */