skgeinit.h 35 KB

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