413781302c7768b631e21cd1a15b2ef7ddfc798c
[linux-flexiantxendom0-3.2.10.git] / drivers / net / sk98lin / h / skgeinit.h
1 /******************************************************************************
2  *
3  * Name:        skgeinit.h
4  * Project:     GEnesis, PCI Gigabit Ethernet Adapter
5  * Version:     $Revision: 1.51 $
6  * Date:        $Date: 2001/02/09 12:26:38 $
7  * Purpose:     Structures and prototypes for the GE Init Module
8  *
9  ******************************************************************************/
10
11 /******************************************************************************
12  *
13  *      (C)Copyright 1998-2001 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.51  2001/02/09 12:26:38  cgoos
30  *      Inserted #ifdef DIAG for half duplex workaround timer.
31  *      
32  *      Revision 1.50  2001/02/07 07:56:40  rassmann
33  *      Corrected copyright.
34  *      
35  *      Revision 1.49  2001/01/31 15:32:18  gklug
36  *      fix: problem with autosensing an SR8800 switch
37  *      add: counter for autoneg timeouts
38  *      
39  *      Revision 1.48  2000/11/09 11:30:10  rassmann
40  *      WA: Waiting after releasing reset until BCom chip is accessible.
41  *      
42  *      Revision 1.47  2000/10/18 12:22:40  cgoos
43  *      Added workaround for half duplex hangup.
44  *      
45  *      Revision 1.46  2000/08/10 11:28:00  rassmann
46  *      Editorial changes.
47  *      Preserving 32-bit alignment in structs for the adapter context.
48  *      
49  *      Revision 1.45  1999/11/22 13:56:19  cgoos
50  *      Changed license header to GPL.
51  *      
52  *      Revision 1.44  1999/10/26 07:34:15  malthoff
53  *      The define SK_LNK_ON has been lost in v1.41.
54  *      
55  *      Revision 1.43  1999/10/06 09:30:16  cgoos
56  *      Changed SK_XM_THR_JUMBO.
57  *      
58  *      Revision 1.42  1999/09/16 12:58:26  cgoos
59  *      Changed SK_LED_STANDY macro to be independent of HW link sync.
60  *      
61  *      Revision 1.41  1999/07/30 06:56:14  malthoff
62  *      Correct comment for SK_MS_STAT_UNSET.
63  *      
64  *      Revision 1.40  1999/05/27 13:38:46  cgoos
65  *      Added SK_BMU_TX_WM.
66  *      Made SK_BMU_TX_WM and SK_BMU_RX_WM user-definable.
67  *      Changed XMAC Tx treshold to max. values.
68  *      
69  *      Revision 1.39  1999/05/20 14:35:26  malthoff
70  *      Remove prototypes for SkGeLinkLED().
71  *      
72  *      Revision 1.38  1999/05/19 11:59:12  cgoos
73  *      Added SK_MS_CAP_INDETERMINATED define.
74  *      
75  *      Revision 1.37  1999/05/19 07:32:33  cgoos
76  *      Changes for 1000Base-T.
77  *      LED-defines for HWAC_LINK_LED macro.
78  *      
79  *      Revision 1.36  1999/04/08 14:00:24  gklug
80  *      add:Port struct field PLinkResCt
81  *      
82  *      Revision 1.35  1999/03/25 07:43:07  malthoff
83  *      Add error string for SKERR_HWI_E018MSG.
84  *      
85  *      Revision 1.34  1999/03/12 16:25:57  malthoff
86  *      Remove PPollRxD and PPollTxD.
87  *      Add SKERR_HWI_E017MSG. and SK_DPOLL_MAX.
88  *      
89  *      Revision 1.33  1999/03/12 13:34:41  malthoff
90  *      Add Autonegotiation error codes.
91  *      Change defines for parameter Mode in SkXmSetRxCmd().
92  *      Replace __STDC__ by SK_KR_PROTO.
93  *      
94  *      Revision 1.32  1999/01/25 14:40:20  mhaveman
95  *      Added new return states for the virtual management port if multiple
96  *      ports are active but differently configured.
97  *      
98  *      Revision 1.31  1998/12/11 15:17:02  gklug
99  *      add: Link partnet autoneg states : Unknown Manual and Autonegotiation
100  *      
101  *      Revision 1.30  1998/12/07 12:17:04  gklug
102  *      add: Link Partner autonegotiation flag
103  *      
104  *      Revision 1.29  1998/12/01 10:54:42  gklug
105  *      add: variables for XMAC Errata
106  *      
107  *      Revision 1.28  1998/12/01 10:14:15  gklug
108  *      add: PIsave saves the Interrupt status word
109  *      
110  *      Revision 1.27  1998/11/26 15:24:52  mhaveman
111  *      Added link status states SK_LMODE_STAT_AUTOHALF and
112  *      SK_LMODE_STAT_AUTOFULL which are used by PNMI.
113  *      
114  *      Revision 1.26  1998/11/26 14:53:01  gklug
115  *      add:autoNeg Timeout variable
116  *      
117  *      Revision 1.25  1998/11/26 08:58:50  gklug
118  *      add: Link Mode configuration (AUTO Sense mode)
119  *      
120  *      Revision 1.24  1998/11/24 13:30:27  gklug
121  *      add: PCheckPar to port struct
122  *      
123  *      Revision 1.23  1998/11/18 13:23:26  malthoff
124  *      Add SK_PKT_TO_MAX.
125  *      
126  *      Revision 1.22  1998/11/18 13:19:54  gklug
127  *      add: PPrevShorts and PLinkBroken to port struct for WA XMAC Errata #C1
128  *
129  *      Revision 1.21  1998/10/26 08:02:57  malthoff
130  *      Add GIRamOffs.
131  *      
132  *      Revision 1.20  1998/10/19 07:28:37  malthoff
133  *      Add prototyp for SkGeInitRamIface().
134  *      
135  *      Revision 1.19  1998/10/14 14:47:48  malthoff
136  *      SK_TIMER should not be defined for Diagnostics.
137  *      Add SKERR_HWI_E015MSG and SKERR_HWI_E016MSG.
138  *      
139  *      Revision 1.18  1998/10/14 14:00:03  gklug
140  *      add: timer to port struct for workaround of Errata #2
141  *      
142  *      Revision 1.17  1998/10/14 11:23:09  malthoff
143  *      Add prototype for SkXmAutoNegDone().
144  *      Fix SkXmSetRxCmd() prototype statement.
145  *
146  *      Revision 1.16  1998/10/14 05:42:29  gklug
147  *      add: HWLinkUp flag to Port struct
148  *      
149  *      Revision 1.15  1998/10/09 08:26:33  malthoff
150  *      Rename SK_RB_ULPP_B to SK_RB_LLPP_B.
151  *      
152  *      Revision 1.14  1998/10/09 07:11:13  malthoff
153  *      bug fix: SK_FACT_53 is 85 not 117.
154  *      Rework time out init values.
155  *      Add GIPortUsage and corresponding defines.
156  *      Add some error log messages.
157  *      
158  *      Revision 1.13  1998/10/06 14:13:14  malthoff
159  *      Add prototyp for SkGeLoadLnkSyncCnt().
160  *
161  *      Revision 1.12  1998/10/05 11:29:53  malthoff
162  *      bug fix: A comment was not closed.
163  *
164  *      Revision 1.11  1998/10/05 08:01:59  malthoff
165  *      Add default Timeout- Threshold- and
166  *      Watermark constants. Add QRam start and end
167  *      variables. Also add vars to store the polling
168  *      mode and receive command. Add new Error Log
169  *      Messages and function prototypes.
170  *
171  *      Revision 1.10  1998/09/28 13:34:48  malthoff
172  *      Add mode bits for LED functions.
173  *      Move Autoneg and Flow Ctrl bits from shgesirq.h
174  *      Add the required Error Log Entries
175  *      and Function Prototypes.
176  *
177  *      Revision 1.9  1998/09/16 14:38:41  malthoff
178  *      Rework the SK_LNK_xxx defines.
179  *      Add error log message defines.
180  *      Add prototypes for skxmac2.c
181  *
182  *      Revision 1.8  1998/09/11 05:29:18  gklug
183  *      add: init state of a port
184  *
185  *      Revision 1.7  1998/09/08 08:35:52  gklug
186  *      add: defines of the Init Levels
187  *
188  *      Revision 1.6  1998/09/03 13:48:42  gklug
189  *      add: Link strati, capabilities to Port struct
190  *
191  *      Revision 1.5  1998/09/03 13:30:59  malthoff
192  *      Add SK_LNK_BLINK and SK_LNK_PERM.
193  *
194  *      Revision 1.4  1998/09/03 09:55:31  malthoff
195  *      Add constants for parameters Dir and RstMode
196  *      when calling SkGeStopPort().
197  *      Rework the prototyp section.
198  *      Add Queue Address offsets PRxQOff, PXsQOff, and PXaQOff.
199  *      Remove Ioc with IoC.
200  *
201  *      Revision 1.3  1998/08/19 09:11:54  gklug
202  *      fix: struct are removed from c-source (see CCC)
203  *      add: typedefs for all structs
204  *
205  *      Revision 1.2  1998/07/28 12:38:26  malthoff
206  *      The prototypes got the parameter 'IoC'.
207  *
208  *      Revision 1.1  1998/07/23 09:50:24  malthoff
209  *      Created.
210  *
211  *
212  ******************************************************************************/
213
214 #ifndef __INC_SKGEINIT_H_
215 #define __INC_SKGEINIT_H_
216
217 #ifdef __cplusplus
218 extern "C" {
219 #endif  /* __cplusplus */
220
221 /* defines ********************************************************************/
222
223 /*
224  * defines for modifying Link LED behaviour (has been used with SkGeLinkLED())
225  */
226 #define SK_LNK_OFF      LED_OFF
227 #define SK_LNK_ON       (LED_ON | LED_BLK_OFF| LED_SYNC_OFF)    
228 #define SK_LNK_BLINK    (LED_ON | LED_BLK_ON | LED_SYNC_ON)
229 #define SK_LNK_PERM     (LED_ON | LED_BLK_OFF| LED_SYNC_ON)
230 #define SK_LNK_TST      (LED_ON | LED_BLK_ON | LED_SYNC_OFF)
231
232 /*
233  * defines for parameter 'Mode' when calling SK_HWAC_LINK_LED()
234  */
235 #define SK_LED_OFF      LED_OFF
236 #define SK_LED_ACTIVE   (LED_ON | LED_BLK_OFF| LED_SYNC_OFF)
237 #define SK_LED_STANDBY  (LED_ON | LED_BLK_ON| LED_SYNC_OFF)
238
239 /*
240  * defines for parameter 'Mode' when calling SkGeXmitLED()
241  */
242 #define SK_LED_DIS      0
243 #define SK_LED_ENA      1
244 #define SK_LED_TST      2
245
246 /*
247  * Counter and Timer constants, for a host clock of 62.5 MHz
248  */
249 #define SK_XMIT_DUR     0x002faf08L             /*  50 ms */
250 #define SK_BLK_DUR      0x01dcd650L             /* 500 ms */
251
252 #define SK_DPOLL_DEF    0x00EE6B28L             /* 250 ms */
253 #define SK_DPOLL_MAX    0x00FFFFFFL             /* ca. 268ms */
254
255 #define SK_FACT_62      100                     /* is given in percent */
256 #define SK_FACT_53       85
257
258 /*
259  * Timeout values
260  */
261 #define SK_MAC_TO_53    72              /* MAC arbiter timeout */
262 #define SK_PKT_TO_53    0x2000          /* Packet arbiter timeout */
263 #define SK_PKT_TO_MAX   0xffff          /* Maximum value */
264 #define SK_RI_TO_53     36              /* RAM interface timeout */
265
266 /*
267  * RAM Buffer High Pause Threshold values
268  */
269 #define SK_RB_ULPP      ( 8 * 1024)     /* Upper Level in kB/8 */
270 #define SK_RB_LLPP_S    (10 * 1024)     /* Lower Level for small Queues */
271 #define SK_RB_LLPP_B    (16 * 1024)     /* Lower Level for big Queues */
272
273 #ifndef SK_BMU_RX_WM
274 #define SK_BMU_RX_WM    0x600           /* BMU Rx Watermark */
275 #endif
276 #ifndef SK_BMU_TX_WM
277 #define SK_BMU_TX_WM    0x600           /* BMU Rx Watermark */
278 #endif
279
280 /* XMAC II Tx Threshold */
281 #define SK_XM_THR_REDL  0x01fb          /* .. for redundant link usage */
282 #define SK_XM_THR_SL    0x01fb          /* .. for single link adapters */
283 #define SK_XM_THR_MULL  0x01fb          /* .. for multiple link usage */
284 #define SK_XM_THR_JUMBO 0x03fc          /* .. for jumbo frame usage */
285
286 /* values for GIPortUsage */
287 #define SK_RED_LINK     1               /* redundant link usage */
288 #define SK_MUL_LINK     2               /* multiple link usage */
289 #define SK_JUMBO_LINK   3               /* driver uses jumbo frames */
290
291 /* Minimum RAM Buffer Receive Queue Size */
292 #define SK_MIN_RXQ_SIZE 16      /* 16 kB */
293 /*
294  * defines for parameter 'Dir' when calling SkGeStopPort()
295  */
296 #define SK_STOP_TX      1       /* Stops the transmit path, resets the XMAC */
297 #define SK_STOP_RX      2       /* Stops the receive path */
298 #define SK_STOP_ALL     3       /* Stops rx and tx path, resets the XMAC */
299
300 /*
301  * defines for parameter 'RstMode' when calling SkGeStopPort()
302  */
303 #define SK_SOFT_RST     1       /* perform a software reset */
304 #define SK_HARD_RST     2       /* perform a hardware reset */
305
306 /*
307  * Define Init Levels
308  */
309 #define SK_INIT_DATA    0       /* Init level 0: init data structures */
310 #define SK_INIT_IO      1       /* Init level 1: init with IOs */
311 #define SK_INIT_RUN     2       /* Init level 2: init for run time */
312
313 /*
314  * Set Link Mode Parameter
315  */
316 #define SK_LMODE_HALF           1       /* Half Duplex Mode */
317 #define SK_LMODE_FULL           2       /* Full Duplex Mode */
318 #define SK_LMODE_AUTOHALF       3       /* AutoHalf Duplex Mode */
319 #define SK_LMODE_AUTOFULL       4       /* AutoFull Duplex Mode */
320 #define SK_LMODE_AUTOBOTH       5       /* AutoBoth Duplex Mode */
321 #define SK_LMODE_AUTOSENSE      6       /* configured mode auto sensing */
322 #define SK_LMODE_INDETERMINATED 7       /* Return value for virtual port if
323                                          * multiple ports are differently
324                                          * configured.
325                                          */
326
327 /*
328  * Autonegotiation timeout in 100ms granularity.
329  */
330 #define SK_AND_MAX_TO           6       /* Wait 600 msec before link comes up */
331
332 /*
333  * Define Autonegotiation error codes here
334  */
335 #define SK_AND_OK               0       /* no error */
336 #define SK_AND_OTHER            1       /* other error than below */
337 #define SK_AND_DUP_CAP          2       /* Duplex capabilities error */
338
339 /*
340  * Link Capability value
341  */
342 #define SK_LMODE_CAP_HALF       (1<<0)  /* Half Duplex Mode */
343 #define SK_LMODE_CAP_FULL       (1<<1)  /* Full Duplex Mode */
344 #define SK_LMODE_CAP_AUTOHALF   (1<<2)  /* AutoHalf Duplex Mode */
345 #define SK_LMODE_CAP_AUTOFULL   (1<<3)  /* AutoFull Duplex Mode */
346 #define SK_LMODE_CAP_INDETERMINATED (1<<4) /* Return value for virtual port if
347                                          * multiple ports are differently
348                                          * configured.
349                                          */
350
351 /*
352  * Link mode current state
353  */
354 #define SK_LMODE_STAT_UNKNOWN   1       /* Unknown Duplex Mode */
355 #define SK_LMODE_STAT_HALF      2       /* Half Duplex Mode */
356 #define SK_LMODE_STAT_FULL      3       /* Full Duplex Mode */
357 #define SK_LMODE_STAT_AUTOHALF  4       /* Half Duplex Mode obtained by AutoNeg */
358 #define SK_LMODE_STAT_AUTOFULL  5       /* Half Duplex Mode obtained by AutoNeg */
359 #define SK_LMODE_STAT_INDETERMINATED 6  /* Return value for virtual port if
360                                          * multiple ports are differently
361                                          * configured.
362                                          */
363 /*
364  * Set Flow Control Mode Parameter (and capabilities)
365  */
366 #define SK_FLOW_MODE_NONE       1       /* No Flow Control */
367 #define SK_FLOW_MODE_LOC_SEND   2       /* Local station sends PAUSE */
368 #define SK_FLOW_MODE_SYMMETRIC  3       /* Both station may send PAUSE */
369 #define SK_FLOW_MODE_SYM_OR_REM 4       /* Both station may send PAUSE or
370                                          * just the remote station may send
371                                          * PAUSE
372                                          */
373 #define SK_FLOW_MODE_INDETERMINATED 5   /* Return value for virtual port if
374                                          * multiple ports are differently
375                                          * configured.
376                                          */
377
378 /*
379  * Flow Control Status Parameter
380  */
381 #define SK_FLOW_STAT_NONE       1       /* No Flow Control */
382 #define SK_FLOW_STAT_REM_SEND   2       /* Remote Station sends PAUSE */
383 #define SK_FLOW_STAT_LOC_SEND   3       /* Local station sends PAUSE */
384 #define SK_FLOW_STAT_SYMMETRIC  4       /* Both station may send PAUSE */
385 #define SK_FLOW_STAT_INDETERMINATED 5   /* Return value for virtual port if
386                                          * multiple ports are differently
387                                          * configured.
388                                          */
389 /*
390  * Master/Slave Mode capabilities
391  */
392 #define SK_MS_CAP_AUTO          (1<<0)  /* Automatic resolution */
393 #define SK_MS_CAP_MASTER        (1<<1)  /* This station is master */
394 #define SK_MS_CAP_SLAVE         (1<<2)  /* This station is slave */
395 #define SK_MS_CAP_INDETERMINATED (1<<3) /* Return value for virtual port if
396                                          * multiple ports are differently
397                                          * configured.
398                                          */
399
400 /*
401  * Set Master/Slave Mode Parameter (and capabilities)
402  */
403 #define SK_MS_MODE_AUTO         1       /* Automatic resolution */
404 #define SK_MS_MODE_MASTER       2       /* This station is master */
405 #define SK_MS_MODE_SLAVE        3       /* This station is slave */
406 #define SK_MS_MODE_INDETERMINATED 4     /* Return value for virtual port if 
407                                          * multiple ports are differently
408                                          */
409
410 /*
411  * Master/Slave Status Parameter
412  */
413 #define SK_MS_STAT_UNSET        1       /* The MS status is never been determ*/
414 #define SK_MS_STAT_MASTER       2       /* This station is master */
415 #define SK_MS_STAT_SLAVE        3       /* This station is slave */
416 #define SK_MS_STAT_FAULT        4       /* MS resolution failed */
417 #define SK_MS_STAT_INDETERMINATED 5     /* Return value for virtual port if
418                                          * multiple ports are differently
419                                          */
420
421 /*
422  * defines for parameter 'Mode' when calling SkXmSetRxCmd()
423  */
424 #define SK_STRIP_FCS_ON         (1<<0)  /* Enable FCS stripping of rx frames */
425 #define SK_STRIP_FCS_OFF        (1<<1)  /* Disable FCS stripping of rx frames */
426 #define SK_STRIP_PAD_ON         (1<<2)  /* Enable pad byte stripping of rx f */
427 #define SK_STRIP_PAD_OFF        (1<<3)  /* Disable pad byte stripping of rx f */
428 #define SK_LENERR_OK_ON         (1<<4)  /* Don't chk fr for in range len error*/
429 #define SK_LENERR_OK_OFF        (1<<5)  /* Check frames for in range len error*/
430 #define SK_BIG_PK_OK_ON         (1<<6)  /* Don't set rcvError bit for big fr */
431 #define SK_BIG_PK_OK_OFF        (1<<7)  /* Set rcvError bit for big frames */   
432
433 /*
434  * States of PState
435  */
436 #define SK_PRT_RESET    0       /* the port is reset */
437 #define SK_PRT_STOP     1       /* the port is stopped (similar to sw reset) */
438 #define SK_PRT_INIT     2       /* the port is initialized */
439 #define SK_PRT_RUN      3       /* the port has an active link */
440
441 /*
442  * Default receive frame limit for Workaround of XMAC Errata
443  */
444 #define SK_DEF_RX_WA_LIM        SK_CONSTU64(100)
445
446 /*
447  * Define link partner Status
448  */
449 #define SK_LIPA_UNKNOWN 0       /* Link partner is in unknown state */
450 #define SK_LIPA_MANUAL  1       /* Link partner is in detected manual state */
451 #define SK_LIPA_AUTO    2       /* Link partner is in autonegotiation state */
452
453 /*
454  * Define Maximum Restarts before restart is ignored (3com WA)
455  */
456 #define SK_MAX_LRESTART 3       /* Max. 3 times the link is restarted */
457
458 /*
459  * define max. autonegotiation timeouts before link detection in sense mode is
460  * reset.
461  */
462 #define SK_MAX_ANEG_TO  10      /* Max. 10 times the sense mode is reset */
463
464 /* structures *****************************************************************/
465
466 /*
467  * Port Structure
468  */
469 typedef struct s_GePort {
470 #ifndef SK_DIAG
471         SK_TIMER        PWaTimer;       /* Workaround Timer */
472 #endif
473         SK_U64  PPrevShorts;    /* Previous short Counter checking */
474         SK_U64  PPrevRx;                /* Previous RxOk Counter checking */
475         SK_U64  PPrevFcs;               /* Previous FCS Error Counter checking */
476         SK_U64  PRxLim;                 /* Previous RxOk Counter checking */
477         SK_U64  LastOctets;             /* For half duplex hang check */
478 #ifndef SK_DIAG
479         SK_TIMER        HalfDupChkTimer;
480 #endif
481         int             PLinkResCt;             /* Link Restart Counter */
482         int             PAutoNegTimeOut;/* AutoNegotiation timeout current value */
483         int             PAutoNegTOCt;   /* AutoNeg Timeout Counter */
484         int             PRxQSize;               /* Port Rx Queue Size in kB */
485         int             PXSQSize;               /* Port Synchronous Transmit Queue Size in kB */
486         int             PXAQSize;               /* Port Asynchronous Transmit Queue Size in kB*/
487         SK_U32  PRxQRamStart;   /* Receive Queue RAM Buffer Start Address */
488         SK_U32  PRxQRamEnd;             /* Receive Queue RAM Buffer End Address */
489         SK_U32  PXsQRamStart;   /* Sync Tx Queue RAM Buffer Start Address */
490         SK_U32  PXsQRamEnd;             /* Sync Tx Queue RAM Buffer End Address */
491         SK_U32  PXaQRamStart;   /* Async Tx Queue RAM Buffer Start Address */
492         SK_U32  PXaQRamEnd;             /* Async Tx Queue RAM Buffer End Address */
493         int             PRxQOff;                /* Rx Queue Address Offset */
494         int             PXsQOff;                /* Synchronous Tx Queue Address Offset */
495         int             PXaQOff;                /* Asynchronous Tx Queue Address Offset */
496         int             PhyType;                /* PHY used on this port */
497         SK_U16  PhyAddr;                /* MDIO/MDC PHY address */
498         SK_U16  PRxCmd;                 /* Port Receive Command Configuration Value */
499         SK_U16  PIsave;                 /* Saved Interrupt status word */
500         SK_U16  PSsave;                 /* Saved PHY status word */
501         SK_U16  Align01;
502         SK_BOOL PHWLinkUp;              /* The hardware Link is up (wireing) */
503         SK_BOOL PState;                 /* Is port initialized ? */
504         SK_BOOL PLinkBroken;    /* Is Link broken ? */
505         SK_BOOL PCheckPar;              /* Do we check for parity errors ? */
506         SK_BOOL HalfDupTimerActive;
507         SK_U8   PLinkCap;               /* Link Capabilities */
508         SK_U8   PLinkModeConf;  /* Link Mode configured */
509         SK_U8   PLinkMode;              /* Link Mode currently used */
510         SK_U8   PLinkModeStatus;/* Link Mode Status */
511         SK_U8   PFlowCtrlCap;   /* Flow Control Capabilities */
512         SK_U8   PFlowCtrlMode;  /* Flow Control Mode */
513         SK_U8   PFlowCtrlStatus;/* Flow Control Status */
514         SK_U8   PMSCap;                 /* Master/Slave Capabilities */
515         SK_U8   PMSMode;                /* Master/Slave Mode */
516         SK_U8   PMSStatus;              /* Master/Slave Status */
517         SK_U8   PAutoNegFail;   /* Autonegotiation fail flag */
518         SK_U8   PLipaAutoNeg;   /* Autonegotiation possible with Link Partner */
519         SK_U8   Align02;
520 } SK_GEPORT;
521
522 /*
523  * Gigabit Ethernet Initalization Struct
524  * (has to be included in the adapter context)
525  */
526 typedef struct s_GeInit {
527         int                     GIMacsFound;    /* Number of MACs found on this adapter */
528         int                     GIPciHwRev;             /* PCI HW Revision Number */
529         SK_U32          GIRamOffs;              /* RAM Address Offset for addr calculation */
530         int                     GIRamSize;              /* The RAM size of the adapter in kB */
531         int                     GIHstClkFact;   /* Host Clock Factor (62.5 / HstClk * 100) */
532         int                     GIPortUsage;    /* driver port usage: SK_RED_LINK/SK_MUL_LINK */
533         SK_U32          GIPollTimerVal; /* Descriptor Poll Timer Init Val in clk ticks*/
534         int                     GILevel;                /* Initialization Level Completed */
535         SK_GEPORT       GP[SK_MAX_MACS];/* Port Dependent Information */
536         SK_BOOL         GIAnyPortAct;   /* Is True if one or more port is initialized */
537         SK_U8           Align01;
538         SK_U16          Align02;
539 } SK_GEINIT;
540
541 /*
542  * Define the error numbers and messages for xmac_ii.c and skgeinit.c
543  */
544 #define SKERR_HWI_E001          (SK_ERRBASE_HWINIT)
545 #define SKERR_HWI_E001MSG       "SkXmClrExactAddr() has got illegal parameters"
546 #define SKERR_HWI_E002          (SKERR_HWI_E001+1)
547 #define SKERR_HWI_E002MSG       "SkGeInit() Level 1 call missing"
548 #define SKERR_HWI_E003          (SKERR_HWI_E002+1)
549 #define SKERR_HWI_E003MSG       "SkGeInit() called with illegal init Level"
550 #define SKERR_HWI_E004          (SKERR_HWI_E003+1)
551 #define SKERR_HWI_E004MSG       "SkGeInitPort() Queue size illegal configured"
552 #define SKERR_HWI_E005          (SKERR_HWI_E004+1)
553 #define SKERR_HWI_E005MSG       "SkGeInitPort() cannot init running ports"
554 #define SKERR_HWI_E006          (SKERR_HWI_E005+1)
555 #define SKERR_HWI_E006MSG       "SkGeXmInit(): PState does not match HW state"
556 #define SKERR_HWI_E007          (SKERR_HWI_E006+1)
557 #define SKERR_HWI_E007MSG       "SkXmInitDupMd() called with invalid Dup Mode"
558 #define SKERR_HWI_E008          (SKERR_HWI_E007+1)
559 #define SKERR_HWI_E008MSG       "SkXmSetRxCmd() called with invalid Mode"
560 #define SKERR_HWI_E009          (SKERR_HWI_E008+1)
561 #define SKERR_HWI_E009MSG       "SkGeCfgSync() called although PXSQSize zero"
562 #define SKERR_HWI_E010          (SKERR_HWI_E009+1)
563 #define SKERR_HWI_E010MSG       "SkGeCfgSync() called with invalid parameters"
564 #define SKERR_HWI_E011          (SKERR_HWI_E010+1)
565 #define SKERR_HWI_E011MSG       "SkGeInitPort() Receive Queue Size to small"
566 #define SKERR_HWI_E012          (SKERR_HWI_E011+1)
567 #define SKERR_HWI_E012MSG       "SkGeInitPort() invalid Queue Size specified"
568 #define SKERR_HWI_E013          (SKERR_HWI_E012+1)
569 #define SKERR_HWI_E013MSG       "SkGeInitPort() cfg changed for running queue"
570 #define SKERR_HWI_E014          (SKERR_HWI_E013+1)
571 #define SKERR_HWI_E014MSG       "SkGeInitPort() unknown GIPortUsage specified"
572 #define SKERR_HWI_E015          (SKERR_HWI_E014+1)
573 #define SKERR_HWI_E015MSG       "Illegal Link mode parameter"
574 #define SKERR_HWI_E016          (SKERR_HWI_E015+1)
575 #define SKERR_HWI_E016MSG       "Illegal Flow control mode parameter"
576 #define SKERR_HWI_E017          (SKERR_HWI_E016+1)
577 #define SKERR_HWI_E017MSG       "Illegal value specified for GIPollTimerVal"
578 #define SKERR_HWI_E018          (SKERR_HWI_E017+1)
579 #define SKERR_HWI_E018MSG       "FATAL: SkGeStopPort() does not terminate"
580 #define SKERR_HWI_E019          (SKERR_HWI_E018+1)
581 #define SKERR_HWI_E019MSG       ""
582
583 /* function prototypes ********************************************************/
584
585 #ifndef SK_KR_PROTO
586
587 /*
588  * public functions in skgeinit.c
589  */
590 extern void     SkGePollRxD(
591         SK_AC           *pAC,
592         SK_IOC          IoC,
593         int             Port,
594         SK_BOOL         PollRxD);
595
596 extern void     SkGePollTxD(
597         SK_AC           *pAC,
598         SK_IOC          IoC,
599         int             Port,
600         SK_BOOL         PollTxD);
601
602 extern void     SkGeYellowLED(
603         SK_AC           *pAC,
604         SK_IOC          IoC,
605         int             State);
606
607 extern int      SkGeCfgSync(
608         SK_AC           *pAC,
609         SK_IOC          IoC,
610         int             Port,
611         SK_U32          IntTime,
612         SK_U32          LimCount,
613         int             SyncMode);
614
615 extern void     SkGeLoadLnkSyncCnt(
616         SK_AC           *pAC,
617         SK_IOC          IoC,
618         int             Port,
619         SK_U32          CntVal);
620
621 extern void     SkGeStopPort(
622         SK_AC           *pAC,
623         SK_IOC          IoC,
624         int             Port,
625         int             Dir,
626         int             RstMode);
627
628 extern int      SkGeInit(
629         SK_AC           *pAC,
630         SK_IOC          IoC,
631         int             Level);
632
633 extern void     SkGeDeInit(
634         SK_AC           *pAC,
635         SK_IOC          IoC);
636
637 extern int      SkGeInitPort(
638         SK_AC           *pAC,
639         SK_IOC          IoC,
640         int             Port);
641
642 extern void     SkGeXmitLED(
643         SK_AC           *pAC,
644         SK_IOC          IoC,
645         int             Led,
646         int             Mode);
647
648 extern void     SkGeInitRamIface(
649         SK_AC           *pAC,
650         SK_IOC          IoC);
651
652 /*
653  * public functions in skxmac2.c
654  */
655 extern void     SkXmSetRxCmd(
656         SK_AC           *pAC,
657         SK_IOC          IoC,
658         int             Port,
659         int             Mode);
660
661 extern void     SkXmClrExactAddr(
662         SK_AC           *pAC,
663         SK_IOC          IoC,
664         int             Port,
665         int             StartNum,
666         int             StopNum);
667
668 extern void     SkXmFlushTxFifo(
669         SK_AC           *pAC,
670         SK_IOC          IoC,
671         int             Port);
672
673 extern void     SkXmFlushRxFifo(
674         SK_AC           *pAC,
675         SK_IOC          IoC,
676         int             Port);
677
678 extern void     SkXmSoftRst(
679         SK_AC           *pAC,
680         SK_IOC          IoC,
681         int             Port);
682
683 extern void     SkXmHardRst(
684         SK_AC           *pAC,
685         SK_IOC          IoC,
686         int             Port);
687
688 extern void     SkXmInitMac(
689         SK_AC           *pAC,
690         SK_IOC          IoC,
691         int             Port);
692
693 extern void     SkXmInitDupMd(
694         SK_AC           *pAC,
695         SK_IOC          IoC,
696         int             Port);
697
698 extern void     SkXmInitPauseMd(
699         SK_AC           *pAC,
700         SK_IOC          IoC,
701         int             Port);
702
703 extern int      SkXmAutoNegDone(
704         SK_AC           *pAC,
705         SK_IOC          IoC,
706         int             Port);
707
708 extern void     SkXmAutoNegLipaXmac(
709         SK_AC           *pAC,
710         SK_IOC          IoC,
711         int             Port,
712         SK_U16          IStatus);
713
714 extern void     SkXmAutoNegLipaBcom(
715         SK_AC           *pAC,
716         SK_IOC          IoC,
717         int             Port,
718         SK_U16          IStatus);
719
720 extern void     SkXmAutoNegLipaLone(
721         SK_AC           *pAC,
722         SK_IOC          IoC,
723         int             Port,
724         SK_U16          IStatus);
725
726 extern void     SkXmIrq(
727         SK_AC           *pAC,
728         SK_IOC          IoC,
729         int             Port,
730         SK_U16          IStatus);
731
732 #else   /* SK_KR_PROTO */
733
734 /*
735  * public functions in skgeinit.c
736  */
737 extern void     SkGePollRxD();
738 extern void     SkGePollTxD();
739 extern void     SkGeYellowLED();
740 extern int      SkGeCfgSync();
741 extern void     SkGeLoadLnkSyncCnt();
742 extern void     SkGeStopPort();
743 extern int      SkGeInit();
744 extern void     SkGeDeInit();
745 extern int      SkGeInitPort();
746 extern void     SkGeXmitLED();
747 extern void     SkGeInitRamIface();
748
749 /*
750  * public functions in skxmac2.c
751  */
752 extern void     SkXmSetRxCmd();
753 extern void     SkXmClrExactAddr();
754 extern void     SkXmFlushTxFifo();
755 extern void     SkXmFlushRxFifo();
756 extern void     SkXmSoftRst();
757 extern void     SkXmHardRst();
758 extern void     SkXmInitMac();
759 extern void     SkXmInitDupMd();
760 extern void     SkXmInitPauseMd();
761 extern int      SkXmAutoNegDone();
762 extern void     SkXmAutoNegLipa();
763 extern void     SkXmIrq();
764
765 #endif  /* SK_KR_PROTO */
766
767 #ifdef __cplusplus
768 }
769 #endif  /* __cplusplus */
770
771 #endif  /* __INC_SKGEINIT_H_ */