diff options
Diffstat (limited to 'drivers/net/sk98lin/h/skgeinit.h')
-rw-r--r-- | drivers/net/sk98lin/h/skgeinit.h | 853 |
1 files changed, 853 insertions, 0 deletions
diff --git a/drivers/net/sk98lin/h/skgeinit.h b/drivers/net/sk98lin/h/skgeinit.h new file mode 100644 index 000000000000..184f47c5a60f --- /dev/null +++ b/drivers/net/sk98lin/h/skgeinit.h | |||
@@ -0,0 +1,853 @@ | |||
1 | /****************************************************************************** | ||
2 | * | ||
3 | * Name: skgeinit.h | ||
4 | * Project: Gigabit Ethernet Adapters, Common Modules | ||
5 | * Version: $Revision: 1.83 $ | ||
6 | * Date: $Date: 2003/09/16 14:07:37 $ | ||
7 | * Purpose: Structures and prototypes for the GE Init Module | ||
8 | * | ||
9 | ******************************************************************************/ | ||
10 | |||
11 | /****************************************************************************** | ||
12 | * | ||
13 | * (C)Copyright 1998-2002 SysKonnect. | ||
14 | * (C)Copyright 2002-2003 Marvell. | ||
15 | * | ||
16 | * This program is free software; you can redistribute it and/or modify | ||
17 | * it under the terms of the GNU General Public License as published by | ||
18 | * the Free Software Foundation; either version 2 of the License, or | ||
19 | * (at your option) any later version. | ||
20 | * | ||
21 | * The information in this file is provided "AS IS" without warranty. | ||
22 | * | ||
23 | ******************************************************************************/ | ||
24 | |||
25 | #ifndef __INC_SKGEINIT_H_ | ||
26 | #define __INC_SKGEINIT_H_ | ||
27 | |||
28 | #ifdef __cplusplus | ||
29 | extern "C" { | ||
30 | #endif /* __cplusplus */ | ||
31 | |||
32 | /* defines ********************************************************************/ | ||
33 | |||
34 | #define SK_TEST_VAL 0x11335577UL | ||
35 | |||
36 | /* modifying Link LED behaviour (used with SkGeLinkLED()) */ | ||
37 | #define SK_LNK_OFF LED_OFF | ||
38 | #define SK_LNK_ON (LED_ON | LED_BLK_OFF | LED_SYNC_OFF) | ||
39 | #define SK_LNK_BLINK (LED_ON | LED_BLK_ON | LED_SYNC_ON) | ||
40 | #define SK_LNK_PERM (LED_ON | LED_BLK_OFF | LED_SYNC_ON) | ||
41 | #define SK_LNK_TST (LED_ON | LED_BLK_ON | LED_SYNC_OFF) | ||
42 | |||
43 | /* parameter 'Mode' when calling SK_HWAC_LINK_LED() */ | ||
44 | #define SK_LED_OFF LED_OFF | ||
45 | #define SK_LED_ACTIVE (LED_ON | LED_BLK_OFF | LED_SYNC_OFF) | ||
46 | #define SK_LED_STANDBY (LED_ON | LED_BLK_ON | LED_SYNC_OFF) | ||
47 | |||
48 | /* addressing LED Registers in SkGeXmitLED() */ | ||
49 | #define XMIT_LED_INI 0 | ||
50 | #define XMIT_LED_CNT (RX_LED_VAL - RX_LED_INI) | ||
51 | #define XMIT_LED_CTRL (RX_LED_CTRL- RX_LED_INI) | ||
52 | #define XMIT_LED_TST (RX_LED_TST - RX_LED_INI) | ||
53 | |||
54 | /* parameter 'Mode' when calling SkGeXmitLED() */ | ||
55 | #define SK_LED_DIS 0 | ||
56 | #define SK_LED_ENA 1 | ||
57 | #define SK_LED_TST 2 | ||
58 | |||
59 | /* Counter and Timer constants, for a host clock of 62.5 MHz */ | ||
60 | #define SK_XMIT_DUR 0x002faf08UL /* 50 ms */ | ||
61 | #define SK_BLK_DUR 0x01dcd650UL /* 500 ms */ | ||
62 | |||
63 | #define SK_DPOLL_DEF 0x00ee6b28UL /* 250 ms at 62.5 MHz */ | ||
64 | |||
65 | #define SK_DPOLL_MAX 0x00ffffffUL /* 268 ms at 62.5 MHz */ | ||
66 | /* 215 ms at 78.12 MHz */ | ||
67 | |||
68 | #define SK_FACT_62 100 /* is given in percent */ | ||
69 | #define SK_FACT_53 85 /* on GENESIS: 53.12 MHz */ | ||
70 | #define SK_FACT_78 125 /* on YUKON: 78.12 MHz */ | ||
71 | |||
72 | /* Timeout values */ | ||
73 | #define SK_MAC_TO_53 72 /* MAC arbiter timeout */ | ||
74 | #define SK_PKT_TO_53 0x2000 /* Packet arbiter timeout */ | ||
75 | #define SK_PKT_TO_MAX 0xffff /* Maximum value */ | ||
76 | #define SK_RI_TO_53 36 /* RAM interface timeout */ | ||
77 | |||
78 | #define SK_PHY_ACC_TO 600000 /* PHY access timeout */ | ||
79 | |||
80 | /* RAM Buffer High Pause Threshold values */ | ||
81 | #define SK_RB_ULPP ( 8 * 1024) /* Upper Level in kB/8 */ | ||
82 | #define SK_RB_LLPP_S (10 * 1024) /* Lower Level for small Queues */ | ||
83 | #define SK_RB_LLPP_B (16 * 1024) /* Lower Level for big Queues */ | ||
84 | |||
85 | #ifndef SK_BMU_RX_WM | ||
86 | #define SK_BMU_RX_WM 0x600 /* BMU Rx Watermark */ | ||
87 | #endif | ||
88 | #ifndef SK_BMU_TX_WM | ||
89 | #define SK_BMU_TX_WM 0x600 /* BMU Tx Watermark */ | ||
90 | #endif | ||
91 | |||
92 | /* XMAC II Rx High Watermark */ | ||
93 | #define SK_XM_RX_HI_WM 0x05aa /* 1450 */ | ||
94 | |||
95 | /* XMAC II Tx Threshold */ | ||
96 | #define SK_XM_THR_REDL 0x01fb /* .. for redundant link usage */ | ||
97 | #define SK_XM_THR_SL 0x01fb /* .. for single link adapters */ | ||
98 | #define SK_XM_THR_MULL 0x01fb /* .. for multiple link usage */ | ||
99 | #define SK_XM_THR_JUMBO 0x03fc /* .. for jumbo frame usage */ | ||
100 | |||
101 | /* values for GIPortUsage */ | ||
102 | #define SK_RED_LINK 1 /* redundant link usage */ | ||
103 | #define SK_MUL_LINK 2 /* multiple link usage */ | ||
104 | #define SK_JUMBO_LINK 3 /* driver uses jumbo frames */ | ||
105 | |||
106 | /* Minimum RAM Buffer Rx Queue Size */ | ||
107 | #define SK_MIN_RXQ_SIZE 16 /* 16 kB */ | ||
108 | |||
109 | /* Minimum RAM Buffer Tx Queue Size */ | ||
110 | #define SK_MIN_TXQ_SIZE 16 /* 16 kB */ | ||
111 | |||
112 | /* Queue Size units */ | ||
113 | #define QZ_UNITS 0x7 | ||
114 | #define QZ_STEP 8 | ||
115 | |||
116 | /* Percentage of queue size from whole memory */ | ||
117 | /* 80 % for receive */ | ||
118 | #define RAM_QUOTA_RX 80L | ||
119 | /* 0% for sync transfer */ | ||
120 | #define RAM_QUOTA_SYNC 0L | ||
121 | /* the rest (20%) is taken for async transfer */ | ||
122 | |||
123 | /* Get the rounded queue size in Bytes in 8k steps */ | ||
124 | #define ROUND_QUEUE_SIZE(SizeInBytes) \ | ||
125 | ((((unsigned long) (SizeInBytes) + (QZ_STEP*1024L)-1) / 1024) & \ | ||
126 | ~(QZ_STEP-1)) | ||
127 | |||
128 | /* Get the rounded queue size in KBytes in 8k steps */ | ||
129 | #define ROUND_QUEUE_SIZE_KB(Kilobytes) \ | ||
130 | ROUND_QUEUE_SIZE((Kilobytes) * 1024L) | ||
131 | |||
132 | /* Types of RAM Buffer Queues */ | ||
133 | #define SK_RX_SRAM_Q 1 /* small receive queue */ | ||
134 | #define SK_RX_BRAM_Q 2 /* big receive queue */ | ||
135 | #define SK_TX_RAM_Q 3 /* small or big transmit queue */ | ||
136 | |||
137 | /* parameter 'Dir' when calling SkGeStopPort() */ | ||
138 | #define SK_STOP_TX 1 /* Stops the transmit path, resets the XMAC */ | ||
139 | #define SK_STOP_RX 2 /* Stops the receive path */ | ||
140 | #define SK_STOP_ALL 3 /* Stops Rx and Tx path, resets the XMAC */ | ||
141 | |||
142 | /* parameter 'RstMode' when calling SkGeStopPort() */ | ||
143 | #define SK_SOFT_RST 1 /* perform a software reset */ | ||
144 | #define SK_HARD_RST 2 /* perform a hardware reset */ | ||
145 | |||
146 | /* Init Levels */ | ||
147 | #define SK_INIT_DATA 0 /* Init level 0: init data structures */ | ||
148 | #define SK_INIT_IO 1 /* Init level 1: init with IOs */ | ||
149 | #define SK_INIT_RUN 2 /* Init level 2: init for run time */ | ||
150 | |||
151 | /* Link Mode Parameter */ | ||
152 | #define SK_LMODE_HALF 1 /* Half Duplex Mode */ | ||
153 | #define SK_LMODE_FULL 2 /* Full Duplex Mode */ | ||
154 | #define SK_LMODE_AUTOHALF 3 /* AutoHalf Duplex Mode */ | ||
155 | #define SK_LMODE_AUTOFULL 4 /* AutoFull Duplex Mode */ | ||
156 | #define SK_LMODE_AUTOBOTH 5 /* AutoBoth Duplex Mode */ | ||
157 | #define SK_LMODE_AUTOSENSE 6 /* configured mode auto sensing */ | ||
158 | #define SK_LMODE_INDETERMINATED 7 /* indeterminated */ | ||
159 | |||
160 | /* Auto-negotiation timeout in 100ms granularity */ | ||
161 | #define SK_AND_MAX_TO 6 /* Wait 600 msec before link comes up */ | ||
162 | |||
163 | /* Auto-negotiation error codes */ | ||
164 | #define SK_AND_OK 0 /* no error */ | ||
165 | #define SK_AND_OTHER 1 /* other error than below */ | ||
166 | #define SK_AND_DUP_CAP 2 /* Duplex capabilities error */ | ||
167 | |||
168 | |||
169 | /* Link Speed Capabilities */ | ||
170 | #define SK_LSPEED_CAP_AUTO (1<<0) /* Automatic resolution */ | ||
171 | #define SK_LSPEED_CAP_10MBPS (1<<1) /* 10 Mbps */ | ||
172 | #define SK_LSPEED_CAP_100MBPS (1<<2) /* 100 Mbps */ | ||
173 | #define SK_LSPEED_CAP_1000MBPS (1<<3) /* 1000 Mbps */ | ||
174 | #define SK_LSPEED_CAP_INDETERMINATED (1<<4) /* indeterminated */ | ||
175 | |||
176 | /* Link Speed Parameter */ | ||
177 | #define SK_LSPEED_AUTO 1 /* Automatic resolution */ | ||
178 | #define SK_LSPEED_10MBPS 2 /* 10 Mbps */ | ||
179 | #define SK_LSPEED_100MBPS 3 /* 100 Mbps */ | ||
180 | #define SK_LSPEED_1000MBPS 4 /* 1000 Mbps */ | ||
181 | #define SK_LSPEED_INDETERMINATED 5 /* indeterminated */ | ||
182 | |||
183 | /* Link Speed Current State */ | ||
184 | #define SK_LSPEED_STAT_UNKNOWN 1 | ||
185 | #define SK_LSPEED_STAT_10MBPS 2 | ||
186 | #define SK_LSPEED_STAT_100MBPS 3 | ||
187 | #define SK_LSPEED_STAT_1000MBPS 4 | ||
188 | #define SK_LSPEED_STAT_INDETERMINATED 5 | ||
189 | |||
190 | |||
191 | /* Link Capability Parameter */ | ||
192 | #define SK_LMODE_CAP_HALF (1<<0) /* Half Duplex Mode */ | ||
193 | #define SK_LMODE_CAP_FULL (1<<1) /* Full Duplex Mode */ | ||
194 | #define SK_LMODE_CAP_AUTOHALF (1<<2) /* AutoHalf Duplex Mode */ | ||
195 | #define SK_LMODE_CAP_AUTOFULL (1<<3) /* AutoFull Duplex Mode */ | ||
196 | #define SK_LMODE_CAP_INDETERMINATED (1<<4) /* indeterminated */ | ||
197 | |||
198 | /* Link Mode Current State */ | ||
199 | #define SK_LMODE_STAT_UNKNOWN 1 /* Unknown Duplex Mode */ | ||
200 | #define SK_LMODE_STAT_HALF 2 /* Half Duplex Mode */ | ||
201 | #define SK_LMODE_STAT_FULL 3 /* Full Duplex Mode */ | ||
202 | #define SK_LMODE_STAT_AUTOHALF 4 /* Half Duplex Mode obtained by Auto-Neg */ | ||
203 | #define SK_LMODE_STAT_AUTOFULL 5 /* Full Duplex Mode obtained by Auto-Neg */ | ||
204 | #define SK_LMODE_STAT_INDETERMINATED 6 /* indeterminated */ | ||
205 | |||
206 | /* Flow Control Mode Parameter (and capabilities) */ | ||
207 | #define SK_FLOW_MODE_NONE 1 /* No Flow-Control */ | ||
208 | #define SK_FLOW_MODE_LOC_SEND 2 /* Local station sends PAUSE */ | ||
209 | #define SK_FLOW_MODE_SYMMETRIC 3 /* Both stations may send PAUSE */ | ||
210 | #define SK_FLOW_MODE_SYM_OR_REM 4 /* Both stations may send PAUSE or | ||
211 | * just the remote station may send PAUSE | ||
212 | */ | ||
213 | #define SK_FLOW_MODE_INDETERMINATED 5 /* indeterminated */ | ||
214 | |||
215 | /* Flow Control Status Parameter */ | ||
216 | #define SK_FLOW_STAT_NONE 1 /* No Flow Control */ | ||
217 | #define SK_FLOW_STAT_REM_SEND 2 /* Remote Station sends PAUSE */ | ||
218 | #define SK_FLOW_STAT_LOC_SEND 3 /* Local station sends PAUSE */ | ||
219 | #define SK_FLOW_STAT_SYMMETRIC 4 /* Both station may send PAUSE */ | ||
220 | #define SK_FLOW_STAT_INDETERMINATED 5 /* indeterminated */ | ||
221 | |||
222 | /* Master/Slave Mode Capabilities */ | ||
223 | #define SK_MS_CAP_AUTO (1<<0) /* Automatic resolution */ | ||
224 | #define SK_MS_CAP_MASTER (1<<1) /* This station is master */ | ||
225 | #define SK_MS_CAP_SLAVE (1<<2) /* This station is slave */ | ||
226 | #define SK_MS_CAP_INDETERMINATED (1<<3) /* indeterminated */ | ||
227 | |||
228 | /* Set Master/Slave Mode Parameter (and capabilities) */ | ||
229 | #define SK_MS_MODE_AUTO 1 /* Automatic resolution */ | ||
230 | #define SK_MS_MODE_MASTER 2 /* This station is master */ | ||
231 | #define SK_MS_MODE_SLAVE 3 /* This station is slave */ | ||
232 | #define SK_MS_MODE_INDETERMINATED 4 /* indeterminated */ | ||
233 | |||
234 | /* Master/Slave Status Parameter */ | ||
235 | #define SK_MS_STAT_UNSET 1 /* The M/S status is not set */ | ||
236 | #define SK_MS_STAT_MASTER 2 /* This station is master */ | ||
237 | #define SK_MS_STAT_SLAVE 3 /* This station is slave */ | ||
238 | #define SK_MS_STAT_FAULT 4 /* M/S resolution failed */ | ||
239 | #define SK_MS_STAT_INDETERMINATED 5 /* indeterminated */ | ||
240 | |||
241 | /* parameter 'Mode' when calling SkXmSetRxCmd() */ | ||
242 | #define SK_STRIP_FCS_ON (1<<0) /* Enable FCS stripping of Rx frames */ | ||
243 | #define SK_STRIP_FCS_OFF (1<<1) /* Disable FCS stripping of Rx frames */ | ||
244 | #define SK_STRIP_PAD_ON (1<<2) /* Enable pad byte stripping of Rx fr */ | ||
245 | #define SK_STRIP_PAD_OFF (1<<3) /* Disable pad byte stripping of Rx fr */ | ||
246 | #define SK_LENERR_OK_ON (1<<4) /* Don't chk fr for in range len error */ | ||
247 | #define SK_LENERR_OK_OFF (1<<5) /* Check frames for in range len error */ | ||
248 | #define SK_BIG_PK_OK_ON (1<<6) /* Don't set Rx Error bit for big frames */ | ||
249 | #define SK_BIG_PK_OK_OFF (1<<7) /* Set Rx Error bit for big frames */ | ||
250 | #define SK_SELF_RX_ON (1<<8) /* Enable Rx of own packets */ | ||
251 | #define SK_SELF_RX_OFF (1<<9) /* Disable Rx of own packets */ | ||
252 | |||
253 | /* parameter 'Para' when calling SkMacSetRxTxEn() */ | ||
254 | #define SK_MAC_LOOPB_ON (1<<0) /* Enable MAC Loopback Mode */ | ||
255 | #define SK_MAC_LOOPB_OFF (1<<1) /* Disable MAC Loopback Mode */ | ||
256 | #define SK_PHY_LOOPB_ON (1<<2) /* Enable PHY Loopback Mode */ | ||
257 | #define SK_PHY_LOOPB_OFF (1<<3) /* Disable PHY Loopback Mode */ | ||
258 | #define SK_PHY_FULLD_ON (1<<4) /* Enable GMII Full Duplex */ | ||
259 | #define SK_PHY_FULLD_OFF (1<<5) /* Disable GMII Full Duplex */ | ||
260 | |||
261 | /* States of PState */ | ||
262 | #define SK_PRT_RESET 0 /* the port is reset */ | ||
263 | #define SK_PRT_STOP 1 /* the port is stopped (similar to SW reset) */ | ||
264 | #define SK_PRT_INIT 2 /* the port is initialized */ | ||
265 | #define SK_PRT_RUN 3 /* the port has an active link */ | ||
266 | |||
267 | /* PHY power down modes */ | ||
268 | #define PHY_PM_OPERATIONAL_MODE 0 /* PHY operational mode */ | ||
269 | #define PHY_PM_DEEP_SLEEP 1 /* coma mode --> minimal power */ | ||
270 | #define PHY_PM_IEEE_POWER_DOWN 2 /* IEEE 22.2.4.1.5 compl. power down */ | ||
271 | #define PHY_PM_ENERGY_DETECT 3 /* energy detect */ | ||
272 | #define PHY_PM_ENERGY_DETECT_PLUS 4 /* energy detect plus */ | ||
273 | |||
274 | /* Default receive frame limit for Workaround of XMAC Errata */ | ||
275 | #define SK_DEF_RX_WA_LIM SK_CONSTU64(100) | ||
276 | |||
277 | /* values for GILedBlinkCtrl (LED Blink Control) */ | ||
278 | #define SK_ACT_LED_BLINK (1<<0) /* Active LED blinking */ | ||
279 | #define SK_DUP_LED_NORMAL (1<<1) /* Duplex LED normal */ | ||
280 | #define SK_LED_LINK100_ON (1<<2) /* Link 100M LED on */ | ||
281 | |||
282 | /* Link Partner Status */ | ||
283 | #define SK_LIPA_UNKNOWN 0 /* Link partner is in unknown state */ | ||
284 | #define SK_LIPA_MANUAL 1 /* Link partner is in detected manual state */ | ||
285 | #define SK_LIPA_AUTO 2 /* Link partner is in auto-negotiation state */ | ||
286 | |||
287 | /* Maximum Restarts before restart is ignored (3Com WA) */ | ||
288 | #define SK_MAX_LRESTART 3 /* Max. 3 times the link is restarted */ | ||
289 | |||
290 | /* Max. Auto-neg. timeouts before link detection in sense mode is reset */ | ||
291 | #define SK_MAX_ANEG_TO 10 /* Max. 10 times the sense mode is reset */ | ||
292 | |||
293 | /* structures *****************************************************************/ | ||
294 | |||
295 | /* | ||
296 | * MAC specific functions | ||
297 | */ | ||
298 | typedef struct s_GeMacFunc { | ||
299 | int (*pFnMacUpdateStats)(SK_AC *pAC, SK_IOC IoC, unsigned int Port); | ||
300 | int (*pFnMacStatistic)(SK_AC *pAC, SK_IOC IoC, unsigned int Port, | ||
301 | SK_U16 StatAddr, SK_U32 SK_FAR *pVal); | ||
302 | int (*pFnMacResetCounter)(SK_AC *pAC, SK_IOC IoC, unsigned int Port); | ||
303 | int (*pFnMacOverflow)(SK_AC *pAC, SK_IOC IoC, unsigned int Port, | ||
304 | SK_U16 IStatus, SK_U64 SK_FAR *pVal); | ||
305 | } SK_GEMACFUNC; | ||
306 | |||
307 | /* | ||
308 | * Port Structure | ||
309 | */ | ||
310 | typedef struct s_GePort { | ||
311 | #ifndef SK_DIAG | ||
312 | SK_TIMER PWaTimer; /* Workaround Timer */ | ||
313 | SK_TIMER HalfDupChkTimer; | ||
314 | #endif /* SK_DIAG */ | ||
315 | SK_U32 PPrevShorts; /* Previous Short Counter checking */ | ||
316 | SK_U32 PPrevFcs; /* Previous FCS Error Counter checking */ | ||
317 | SK_U64 PPrevRx; /* Previous RxOk Counter checking */ | ||
318 | SK_U64 PRxLim; /* Previous RxOk Counter checking */ | ||
319 | SK_U64 LastOctets; /* For half duplex hang check */ | ||
320 | int PLinkResCt; /* Link Restart Counter */ | ||
321 | int PAutoNegTimeOut;/* Auto-negotiation timeout current value */ | ||
322 | int PAutoNegTOCt; /* Auto-negotiation Timeout Counter */ | ||
323 | int PRxQSize; /* Port Rx Queue Size in kB */ | ||
324 | int PXSQSize; /* Port Synchronous Transmit Queue Size in kB */ | ||
325 | int PXAQSize; /* Port Asynchronous Transmit Queue Size in kB */ | ||
326 | SK_U32 PRxQRamStart; /* Receive Queue RAM Buffer Start Address */ | ||
327 | SK_U32 PRxQRamEnd; /* Receive Queue RAM Buffer End Address */ | ||
328 | SK_U32 PXsQRamStart; /* Sync Tx Queue RAM Buffer Start Address */ | ||
329 | SK_U32 PXsQRamEnd; /* Sync Tx Queue RAM Buffer End Address */ | ||
330 | SK_U32 PXaQRamStart; /* Async Tx Queue RAM Buffer Start Address */ | ||
331 | SK_U32 PXaQRamEnd; /* Async Tx Queue RAM Buffer End Address */ | ||
332 | SK_U32 PRxOverCnt; /* Receive Overflow Counter */ | ||
333 | int PRxQOff; /* Rx Queue Address Offset */ | ||
334 | int PXsQOff; /* Synchronous Tx Queue Address Offset */ | ||
335 | int PXaQOff; /* Asynchronous Tx Queue Address Offset */ | ||
336 | int PhyType; /* PHY used on this port */ | ||
337 | int PState; /* Port status (reset, stop, init, run) */ | ||
338 | SK_U16 PhyId1; /* PHY Id1 on this port */ | ||
339 | SK_U16 PhyAddr; /* MDIO/MDC PHY address */ | ||
340 | SK_U16 PIsave; /* Saved Interrupt status word */ | ||
341 | SK_U16 PSsave; /* Saved PHY status word */ | ||
342 | SK_U16 PGmANegAdv; /* Saved GPhy AutoNegAdvertisment register */ | ||
343 | SK_BOOL PHWLinkUp; /* The hardware Link is up (wiring) */ | ||
344 | SK_BOOL PLinkBroken; /* Is Link broken ? */ | ||
345 | SK_BOOL PCheckPar; /* Do we check for parity errors ? */ | ||
346 | SK_BOOL HalfDupTimerActive; | ||
347 | SK_U8 PLinkCap; /* Link Capabilities */ | ||
348 | SK_U8 PLinkModeConf; /* Link Mode configured */ | ||
349 | SK_U8 PLinkMode; /* Link Mode currently used */ | ||
350 | SK_U8 PLinkModeStatus;/* Link Mode Status */ | ||
351 | SK_U8 PLinkSpeedCap; /* Link Speed Capabilities(10/100/1000 Mbps) */ | ||
352 | SK_U8 PLinkSpeed; /* configured Link Speed (10/100/1000 Mbps) */ | ||
353 | SK_U8 PLinkSpeedUsed; /* current Link Speed (10/100/1000 Mbps) */ | ||
354 | SK_U8 PFlowCtrlCap; /* Flow Control Capabilities */ | ||
355 | SK_U8 PFlowCtrlMode; /* Flow Control Mode */ | ||
356 | SK_U8 PFlowCtrlStatus;/* Flow Control Status */ | ||
357 | SK_U8 PMSCap; /* Master/Slave Capabilities */ | ||
358 | SK_U8 PMSMode; /* Master/Slave Mode */ | ||
359 | SK_U8 PMSStatus; /* Master/Slave Status */ | ||
360 | SK_BOOL PAutoNegFail; /* Auto-negotiation fail flag */ | ||
361 | SK_U8 PLipaAutoNeg; /* Auto-negotiation possible with Link Partner */ | ||
362 | SK_U8 PCableLen; /* Cable Length */ | ||
363 | SK_U8 PMdiPairLen[4]; /* MDI[0..3] Pair Length */ | ||
364 | SK_U8 PMdiPairSts[4]; /* MDI[0..3] Pair Diagnostic Status */ | ||
365 | SK_U8 PPhyPowerState; /* PHY current power state */ | ||
366 | int PMacColThres; /* MAC Collision Threshold */ | ||
367 | int PMacJamLen; /* MAC Jam length */ | ||
368 | int PMacJamIpgVal; /* MAC Jam IPG */ | ||
369 | int PMacJamIpgData; /* MAC IPG Jam to Data */ | ||
370 | int PMacIpgData; /* MAC Data IPG */ | ||
371 | SK_BOOL PMacLimit4; /* reset collision counter and backoff algorithm */ | ||
372 | } SK_GEPORT; | ||
373 | |||
374 | /* | ||
375 | * Gigabit Ethernet Initialization Struct | ||
376 | * (has to be included in the adapter context) | ||
377 | */ | ||
378 | typedef struct s_GeInit { | ||
379 | int GIChipId; /* Chip Identification Number */ | ||
380 | int GIChipRev; /* Chip Revision Number */ | ||
381 | SK_U8 GIPciHwRev; /* PCI HW Revision Number */ | ||
382 | SK_BOOL GIGenesis; /* Genesis adapter ? */ | ||
383 | SK_BOOL GIYukon; /* YUKON-A1/Bx chip */ | ||
384 | SK_BOOL GIYukonLite; /* YUKON-Lite chip */ | ||
385 | SK_BOOL GICopperType; /* Copper Type adapter ? */ | ||
386 | SK_BOOL GIPciSlot64; /* 64-bit PCI Slot */ | ||
387 | SK_BOOL GIPciClock66; /* 66 MHz PCI Clock */ | ||
388 | SK_BOOL GIVauxAvail; /* VAUX available (YUKON) */ | ||
389 | SK_BOOL GIYukon32Bit; /* 32-Bit YUKON adapter */ | ||
390 | SK_U16 GILedBlinkCtrl; /* LED Blink Control */ | ||
391 | int GIMacsFound; /* Number of MACs found on this adapter */ | ||
392 | int GIMacType; /* MAC Type used on this adapter */ | ||
393 | int GIHstClkFact; /* Host Clock Factor (62.5 / HstClk * 100) */ | ||
394 | int GIPortUsage; /* Driver Port Usage */ | ||
395 | int GILevel; /* Initialization Level completed */ | ||
396 | int GIRamSize; /* The RAM size of the adapter in kB */ | ||
397 | int GIWolOffs; /* WOL Register Offset (HW-Bug in Rev. A) */ | ||
398 | SK_U32 GIRamOffs; /* RAM Address Offset for addr calculation */ | ||
399 | SK_U32 GIPollTimerVal; /* Descr. Poll Timer Init Val (HstClk ticks) */ | ||
400 | SK_U32 GIValIrqMask; /* Value for Interrupt Mask */ | ||
401 | SK_U32 GITimeStampCnt; /* Time Stamp High Counter (YUKON only) */ | ||
402 | SK_GEPORT GP[SK_MAX_MACS];/* Port Dependent Information */ | ||
403 | SK_GEMACFUNC GIFunc; /* MAC depedent functions */ | ||
404 | } SK_GEINIT; | ||
405 | |||
406 | /* | ||
407 | * Error numbers and messages for skxmac2.c and skgeinit.c | ||
408 | */ | ||
409 | #define SKERR_HWI_E001 (SK_ERRBASE_HWINIT) | ||
410 | #define SKERR_HWI_E001MSG "SkXmClrExactAddr() has got illegal parameters" | ||
411 | #define SKERR_HWI_E002 (SKERR_HWI_E001+1) | ||
412 | #define SKERR_HWI_E002MSG "SkGeInit(): Level 1 call missing" | ||
413 | #define SKERR_HWI_E003 (SKERR_HWI_E002+1) | ||
414 | #define SKERR_HWI_E003MSG "SkGeInit() called with illegal init Level" | ||
415 | #define SKERR_HWI_E004 (SKERR_HWI_E003+1) | ||
416 | #define SKERR_HWI_E004MSG "SkGeInitPort(): Queue Size illegal configured" | ||
417 | #define SKERR_HWI_E005 (SKERR_HWI_E004+1) | ||
418 | #define SKERR_HWI_E005MSG "SkGeInitPort(): cannot init running ports" | ||
419 | #define SKERR_HWI_E006 (SKERR_HWI_E005+1) | ||
420 | #define SKERR_HWI_E006MSG "SkGeMacInit(): PState does not match HW state" | ||
421 | #define SKERR_HWI_E007 (SKERR_HWI_E006+1) | ||
422 | #define SKERR_HWI_E007MSG "SkXmInitDupMd() called with invalid Dup Mode" | ||
423 | #define SKERR_HWI_E008 (SKERR_HWI_E007+1) | ||
424 | #define SKERR_HWI_E008MSG "SkXmSetRxCmd() called with invalid Mode" | ||
425 | #define SKERR_HWI_E009 (SKERR_HWI_E008+1) | ||
426 | #define SKERR_HWI_E009MSG "SkGeCfgSync() called although PXSQSize zero" | ||
427 | #define SKERR_HWI_E010 (SKERR_HWI_E009+1) | ||
428 | #define SKERR_HWI_E010MSG "SkGeCfgSync() called with invalid parameters" | ||
429 | #define SKERR_HWI_E011 (SKERR_HWI_E010+1) | ||
430 | #define SKERR_HWI_E011MSG "SkGeInitPort(): Receive Queue Size too small" | ||
431 | #define SKERR_HWI_E012 (SKERR_HWI_E011+1) | ||
432 | #define SKERR_HWI_E012MSG "SkGeInitPort(): invalid Queue Size specified" | ||
433 | #define SKERR_HWI_E013 (SKERR_HWI_E012+1) | ||
434 | #define SKERR_HWI_E013MSG "SkGeInitPort(): cfg changed for running queue" | ||
435 | #define SKERR_HWI_E014 (SKERR_HWI_E013+1) | ||
436 | #define SKERR_HWI_E014MSG "SkGeInitPort(): unknown GIPortUsage specified" | ||
437 | #define SKERR_HWI_E015 (SKERR_HWI_E014+1) | ||
438 | #define SKERR_HWI_E015MSG "Illegal Link mode parameter" | ||
439 | #define SKERR_HWI_E016 (SKERR_HWI_E015+1) | ||
440 | #define SKERR_HWI_E016MSG "Illegal Flow control mode parameter" | ||
441 | #define SKERR_HWI_E017 (SKERR_HWI_E016+1) | ||
442 | #define SKERR_HWI_E017MSG "Illegal value specified for GIPollTimerVal" | ||
443 | #define SKERR_HWI_E018 (SKERR_HWI_E017+1) | ||
444 | #define SKERR_HWI_E018MSG "FATAL: SkGeStopPort() does not terminate (Tx)" | ||
445 | #define SKERR_HWI_E019 (SKERR_HWI_E018+1) | ||
446 | #define SKERR_HWI_E019MSG "Illegal Speed parameter" | ||
447 | #define SKERR_HWI_E020 (SKERR_HWI_E019+1) | ||
448 | #define SKERR_HWI_E020MSG "Illegal Master/Slave parameter" | ||
449 | #define SKERR_HWI_E021 (SKERR_HWI_E020+1) | ||
450 | #define SKERR_HWI_E021MSG "MacUpdateStats(): cannot update statistic counter" | ||
451 | #define SKERR_HWI_E022 (SKERR_HWI_E021+1) | ||
452 | #define SKERR_HWI_E022MSG "MacStatistic(): illegal statistic base address" | ||
453 | #define SKERR_HWI_E023 (SKERR_HWI_E022+1) | ||
454 | #define SKERR_HWI_E023MSG "SkGeInitPort(): Transmit Queue Size too small" | ||
455 | #define SKERR_HWI_E024 (SKERR_HWI_E023+1) | ||
456 | #define SKERR_HWI_E024MSG "FATAL: SkGeStopPort() does not terminate (Rx)" | ||
457 | #define SKERR_HWI_E025 (SKERR_HWI_E024+1) | ||
458 | #define SKERR_HWI_E025MSG "" | ||
459 | |||
460 | /* function prototypes ********************************************************/ | ||
461 | |||
462 | #ifndef SK_KR_PROTO | ||
463 | |||
464 | /* | ||
465 | * public functions in skgeinit.c | ||
466 | */ | ||
467 | extern void SkGePollRxD( | ||
468 | SK_AC *pAC, | ||
469 | SK_IOC IoC, | ||
470 | int Port, | ||
471 | SK_BOOL PollRxD); | ||
472 | |||
473 | extern void SkGePollTxD( | ||
474 | SK_AC *pAC, | ||
475 | SK_IOC IoC, | ||
476 | int Port, | ||
477 | SK_BOOL PollTxD); | ||
478 | |||
479 | extern void SkGeYellowLED( | ||
480 | SK_AC *pAC, | ||
481 | SK_IOC IoC, | ||
482 | int State); | ||
483 | |||
484 | extern int SkGeCfgSync( | ||
485 | SK_AC *pAC, | ||
486 | SK_IOC IoC, | ||
487 | int Port, | ||
488 | SK_U32 IntTime, | ||
489 | SK_U32 LimCount, | ||
490 | int SyncMode); | ||
491 | |||
492 | extern void SkGeLoadLnkSyncCnt( | ||
493 | SK_AC *pAC, | ||
494 | SK_IOC IoC, | ||
495 | int Port, | ||
496 | SK_U32 CntVal); | ||
497 | |||
498 | extern void SkGeStopPort( | ||
499 | SK_AC *pAC, | ||
500 | SK_IOC IoC, | ||
501 | int Port, | ||
502 | int Dir, | ||
503 | int RstMode); | ||
504 | |||
505 | extern int SkGeInit( | ||
506 | SK_AC *pAC, | ||
507 | SK_IOC IoC, | ||
508 | int Level); | ||
509 | |||
510 | extern void SkGeDeInit( | ||
511 | SK_AC *pAC, | ||
512 | SK_IOC IoC); | ||
513 | |||
514 | extern int SkGeInitPort( | ||
515 | SK_AC *pAC, | ||
516 | SK_IOC IoC, | ||
517 | int Port); | ||
518 | |||
519 | extern void SkGeXmitLED( | ||
520 | SK_AC *pAC, | ||
521 | SK_IOC IoC, | ||
522 | int Led, | ||
523 | int Mode); | ||
524 | |||
525 | extern void SkGeInitRamIface( | ||
526 | SK_AC *pAC, | ||
527 | SK_IOC IoC); | ||
528 | |||
529 | extern int SkGeInitAssignRamToQueues( | ||
530 | SK_AC *pAC, | ||
531 | int ActivePort, | ||
532 | SK_BOOL DualNet); | ||
533 | |||
534 | /* | ||
535 | * public functions in skxmac2.c | ||
536 | */ | ||
537 | extern void SkMacRxTxDisable( | ||
538 | SK_AC *pAC, | ||
539 | SK_IOC IoC, | ||
540 | int Port); | ||
541 | |||
542 | extern void SkMacSoftRst( | ||
543 | SK_AC *pAC, | ||
544 | SK_IOC IoC, | ||
545 | int Port); | ||
546 | |||
547 | extern void SkMacHardRst( | ||
548 | SK_AC *pAC, | ||
549 | SK_IOC IoC, | ||
550 | int Port); | ||
551 | |||
552 | extern void SkMacClearRst( | ||
553 | SK_AC *pAC, | ||
554 | SK_IOC IoC, | ||
555 | int Port); | ||
556 | |||
557 | extern void SkXmInitMac( | ||
558 | SK_AC *pAC, | ||
559 | SK_IOC IoC, | ||
560 | int Port); | ||
561 | |||
562 | extern void SkGmInitMac( | ||
563 | SK_AC *pAC, | ||
564 | SK_IOC IoC, | ||
565 | int Port); | ||
566 | |||
567 | extern void SkMacInitPhy( | ||
568 | SK_AC *pAC, | ||
569 | SK_IOC IoC, | ||
570 | int Port, | ||
571 | SK_BOOL DoLoop); | ||
572 | |||
573 | extern void SkMacIrqDisable( | ||
574 | SK_AC *pAC, | ||
575 | SK_IOC IoC, | ||
576 | int Port); | ||
577 | |||
578 | extern void SkMacFlushTxFifo( | ||
579 | SK_AC *pAC, | ||
580 | SK_IOC IoC, | ||
581 | int Port); | ||
582 | |||
583 | extern void SkMacFlushRxFifo( | ||
584 | SK_AC *pAC, | ||
585 | SK_IOC IoC, | ||
586 | int Port); | ||
587 | |||
588 | extern void SkMacIrq( | ||
589 | SK_AC *pAC, | ||
590 | SK_IOC IoC, | ||
591 | int Port); | ||
592 | |||
593 | extern int SkMacAutoNegDone( | ||
594 | SK_AC *pAC, | ||
595 | SK_IOC IoC, | ||
596 | int Port); | ||
597 | |||
598 | extern void SkMacAutoNegLipaPhy( | ||
599 | SK_AC *pAC, | ||
600 | SK_IOC IoC, | ||
601 | int Port, | ||
602 | SK_U16 IStatus); | ||
603 | |||
604 | extern void SkMacSetRxTxEn( | ||
605 | SK_AC *pAC, | ||
606 | SK_IOC IoC, | ||
607 | int Port, | ||
608 | int Para); | ||
609 | |||
610 | extern int SkMacRxTxEnable( | ||
611 | SK_AC *pAC, | ||
612 | SK_IOC IoC, | ||
613 | int Port); | ||
614 | |||
615 | extern void SkMacPromiscMode( | ||
616 | SK_AC *pAC, | ||
617 | SK_IOC IoC, | ||
618 | int Port, | ||
619 | SK_BOOL Enable); | ||
620 | |||
621 | extern void SkMacHashing( | ||
622 | SK_AC *pAC, | ||
623 | SK_IOC IoC, | ||
624 | int Port, | ||
625 | SK_BOOL Enable); | ||
626 | |||
627 | extern void SkXmPhyRead( | ||
628 | SK_AC *pAC, | ||
629 | SK_IOC IoC, | ||
630 | int Port, | ||
631 | int Addr, | ||
632 | SK_U16 SK_FAR *pVal); | ||
633 | |||
634 | extern void SkXmPhyWrite( | ||
635 | SK_AC *pAC, | ||
636 | SK_IOC IoC, | ||
637 | int Port, | ||
638 | int Addr, | ||
639 | SK_U16 Val); | ||
640 | |||
641 | extern void SkGmPhyRead( | ||
642 | SK_AC *pAC, | ||
643 | SK_IOC IoC, | ||
644 | int Port, | ||
645 | int Addr, | ||
646 | SK_U16 SK_FAR *pVal); | ||
647 | |||
648 | extern void SkGmPhyWrite( | ||
649 | SK_AC *pAC, | ||
650 | SK_IOC IoC, | ||
651 | int Port, | ||
652 | int Addr, | ||
653 | SK_U16 Val); | ||
654 | |||
655 | extern void SkXmClrExactAddr( | ||
656 | SK_AC *pAC, | ||
657 | SK_IOC IoC, | ||
658 | int Port, | ||
659 | int StartNum, | ||
660 | int StopNum); | ||
661 | |||
662 | extern void SkXmInitDupMd( | ||
663 | SK_AC *pAC, | ||
664 | SK_IOC IoC, | ||
665 | int Port); | ||
666 | |||
667 | extern void SkXmInitPauseMd( | ||
668 | SK_AC *pAC, | ||
669 | SK_IOC IoC, | ||
670 | int Port); | ||
671 | |||
672 | extern void SkXmAutoNegLipaXmac( | ||
673 | SK_AC *pAC, | ||
674 | SK_IOC IoC, | ||
675 | int Port, | ||
676 | SK_U16 IStatus); | ||
677 | |||
678 | extern int SkXmUpdateStats( | ||
679 | SK_AC *pAC, | ||
680 | SK_IOC IoC, | ||
681 | unsigned int Port); | ||
682 | |||
683 | extern int SkGmUpdateStats( | ||
684 | SK_AC *pAC, | ||
685 | SK_IOC IoC, | ||
686 | unsigned int Port); | ||
687 | |||
688 | extern int SkXmMacStatistic( | ||
689 | SK_AC *pAC, | ||
690 | SK_IOC IoC, | ||
691 | unsigned int Port, | ||
692 | SK_U16 StatAddr, | ||
693 | SK_U32 SK_FAR *pVal); | ||
694 | |||
695 | extern int SkGmMacStatistic( | ||
696 | SK_AC *pAC, | ||
697 | SK_IOC IoC, | ||
698 | unsigned int Port, | ||
699 | SK_U16 StatAddr, | ||
700 | SK_U32 SK_FAR *pVal); | ||
701 | |||
702 | extern int SkXmResetCounter( | ||
703 | SK_AC *pAC, | ||
704 | SK_IOC IoC, | ||
705 | unsigned int Port); | ||
706 | |||
707 | extern int SkGmResetCounter( | ||
708 | SK_AC *pAC, | ||
709 | SK_IOC IoC, | ||
710 | unsigned int Port); | ||
711 | |||
712 | extern int SkXmOverflowStatus( | ||
713 | SK_AC *pAC, | ||
714 | SK_IOC IoC, | ||
715 | unsigned int Port, | ||
716 | SK_U16 IStatus, | ||
717 | SK_U64 SK_FAR *pStatus); | ||
718 | |||
719 | extern int SkGmOverflowStatus( | ||
720 | SK_AC *pAC, | ||
721 | SK_IOC IoC, | ||
722 | unsigned int Port, | ||
723 | SK_U16 MacStatus, | ||
724 | SK_U64 SK_FAR *pStatus); | ||
725 | |||
726 | extern int SkGmCableDiagStatus( | ||
727 | SK_AC *pAC, | ||
728 | SK_IOC IoC, | ||
729 | int Port, | ||
730 | SK_BOOL StartTest); | ||
731 | |||
732 | extern int SkGmEnterLowPowerMode( | ||
733 | SK_AC *pAC, | ||
734 | SK_IOC IoC, | ||
735 | int Port, | ||
736 | SK_U8 Mode); | ||
737 | |||
738 | extern int SkGmLeaveLowPowerMode( | ||
739 | SK_AC *pAC, | ||
740 | SK_IOC IoC, | ||
741 | int Port); | ||
742 | |||
743 | #ifdef SK_DIAG | ||
744 | extern void SkGePhyRead( | ||
745 | SK_AC *pAC, | ||
746 | SK_IOC IoC, | ||
747 | int Port, | ||
748 | int Addr, | ||
749 | SK_U16 *pVal); | ||
750 | |||
751 | extern void SkGePhyWrite( | ||
752 | SK_AC *pAC, | ||
753 | SK_IOC IoC, | ||
754 | int Port, | ||
755 | int Addr, | ||
756 | SK_U16 Val); | ||
757 | |||
758 | extern void SkMacSetRxCmd( | ||
759 | SK_AC *pAC, | ||
760 | SK_IOC IoC, | ||
761 | int Port, | ||
762 | int Mode); | ||
763 | extern void SkMacCrcGener( | ||
764 | SK_AC *pAC, | ||
765 | SK_IOC IoC, | ||
766 | int Port, | ||
767 | SK_BOOL Enable); | ||
768 | extern void SkMacTimeStamp( | ||
769 | SK_AC *pAC, | ||
770 | SK_IOC IoC, | ||
771 | int Port, | ||
772 | SK_BOOL Enable); | ||
773 | extern void SkXmSendCont( | ||
774 | SK_AC *pAC, | ||
775 | SK_IOC IoC, | ||
776 | int Port, | ||
777 | SK_BOOL Enable); | ||
778 | #endif /* SK_DIAG */ | ||
779 | |||
780 | #else /* SK_KR_PROTO */ | ||
781 | |||
782 | /* | ||
783 | * public functions in skgeinit.c | ||
784 | */ | ||
785 | extern void SkGePollRxD(); | ||
786 | extern void SkGePollTxD(); | ||
787 | extern void SkGeYellowLED(); | ||
788 | extern int SkGeCfgSync(); | ||
789 | extern void SkGeLoadLnkSyncCnt(); | ||
790 | extern void SkGeStopPort(); | ||
791 | extern int SkGeInit(); | ||
792 | extern void SkGeDeInit(); | ||
793 | extern int SkGeInitPort(); | ||
794 | extern void SkGeXmitLED(); | ||
795 | extern void SkGeInitRamIface(); | ||
796 | extern int SkGeInitAssignRamToQueues(); | ||
797 | |||
798 | /* | ||
799 | * public functions in skxmac2.c | ||
800 | */ | ||
801 | extern void SkMacRxTxDisable(); | ||
802 | extern void SkMacSoftRst(); | ||
803 | extern void SkMacHardRst(); | ||
804 | extern void SkMacClearRst(); | ||
805 | extern void SkMacInitPhy(); | ||
806 | extern int SkMacRxTxEnable(); | ||
807 | extern void SkMacPromiscMode(); | ||
808 | extern void SkMacHashing(); | ||
809 | extern void SkMacIrqDisable(); | ||
810 | extern void SkMacFlushTxFifo(); | ||
811 | extern void SkMacFlushRxFifo(); | ||
812 | extern void SkMacIrq(); | ||
813 | extern int SkMacAutoNegDone(); | ||
814 | extern void SkMacAutoNegLipaPhy(); | ||
815 | extern void SkMacSetRxTxEn(); | ||
816 | extern void SkXmInitMac(); | ||
817 | extern void SkXmPhyRead(); | ||
818 | extern void SkXmPhyWrite(); | ||
819 | extern void SkGmInitMac(); | ||
820 | extern void SkGmPhyRead(); | ||
821 | extern void SkGmPhyWrite(); | ||
822 | extern void SkXmClrExactAddr(); | ||
823 | extern void SkXmInitDupMd(); | ||
824 | extern void SkXmInitPauseMd(); | ||
825 | extern void SkXmAutoNegLipaXmac(); | ||
826 | extern int SkXmUpdateStats(); | ||
827 | extern int SkGmUpdateStats(); | ||
828 | extern int SkXmMacStatistic(); | ||
829 | extern int SkGmMacStatistic(); | ||
830 | extern int SkXmResetCounter(); | ||
831 | extern int SkGmResetCounter(); | ||
832 | extern int SkXmOverflowStatus(); | ||
833 | extern int SkGmOverflowStatus(); | ||
834 | extern int SkGmCableDiagStatus(); | ||
835 | extern int SkGmEnterLowPowerMode(); | ||
836 | extern int SkGmLeaveLowPowerMode(); | ||
837 | |||
838 | #ifdef SK_DIAG | ||
839 | extern void SkGePhyRead(); | ||
840 | extern void SkGePhyWrite(); | ||
841 | extern void SkMacSetRxCmd(); | ||
842 | extern void SkMacCrcGener(); | ||
843 | extern void SkMacTimeStamp(); | ||
844 | extern void SkXmSendCont(); | ||
845 | #endif /* SK_DIAG */ | ||
846 | |||
847 | #endif /* SK_KR_PROTO */ | ||
848 | |||
849 | #ifdef __cplusplus | ||
850 | } | ||
851 | #endif /* __cplusplus */ | ||
852 | |||
853 | #endif /* __INC_SKGEINIT_H_ */ | ||