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