You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

amd8111e.h 16KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636
  1. /*
  2. * Advanced Micro Devices Inc. AMD8111E Linux Network Driver
  3. * Copyright (C) 2003 Advanced Micro Devices
  4. *
  5. * This program is free software; you can redistribute it and/or modify
  6. * it under the terms of the GNU General Public License as published by
  7. * the Free Software Foundation; either version 2 of the License, or
  8. * (at your option) any later version.
  9. *
  10. * This program is distributed in the hope that it will be useful,
  11. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  12. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  13. * GNU General Public License for more details.
  14. *
  15. * You should have received a copy of the GNU General Public License
  16. * along with this program; if not, write to the Free Software
  17. * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
  18. * 02110-1301, USA.
  19. *
  20. * You can also choose to distribute this program under the terms of
  21. * the Unmodified Binary Distribution Licence (as given in the file
  22. * COPYING.UBDL), provided that you have satisfied its requirements.
  23. * USA
  24. Module Name:
  25. amd8111e.h
  26. Abstract:
  27. AMD8111 based 10/100 Ethernet Controller driver definitions.
  28. Environment:
  29. Kernel Mode
  30. Revision History:
  31. 3.0.0
  32. Initial Revision.
  33. 3.0.1
  34. */
  35. FILE_LICENCE ( GPL2_OR_LATER_OR_UBDL );
  36. #ifndef _AMD811E_H
  37. #define _AMD811E_H
  38. /* Command style register access
  39. Registers CMD0, CMD2, CMD3,CMD7 and INTEN0 uses a write access technique called command style access. It allows the write to selected bits of this register without altering the bits that are not selected. Command style registers are divided into 4 bytes that can be written independently. Higher order bit of each byte is the value bit that specifies the value that will be written into the selected bits of register.
  40. eg., if the value 10011010b is written into the least significant byte of a command style register, bits 1,3 and 4 of the register will be set to 1, and the other bits will not be altered. If the value 00011010b is written into the same byte, bits 1,3 and 4 will be cleared to 0 and the other bits will not be altered.
  41. */
  42. /* Offset for Memory Mapped Registers. */
  43. /* 32 bit registers */
  44. #define ASF_STAT 0x00 /* ASF status register */
  45. #define CHIPID 0x04 /* Chip ID regsiter */
  46. #define MIB_DATA 0x10 /* MIB data register */
  47. #define MIB_ADDR 0x14 /* MIB address register */
  48. #define STAT0 0x30 /* Status0 register */
  49. #define INT0 0x38 /* Interrupt0 register */
  50. #define INTEN0 0x40 /* Interrupt0 enable register*/
  51. #define CMD0 0x48 /* Command0 register */
  52. #define CMD2 0x50 /* Command2 register */
  53. #define CMD3 0x54 /* Command3 resiter */
  54. #define CMD7 0x64 /* Command7 register */
  55. #define CTRL1 0x6C /* Control1 register */
  56. #define CTRL2 0x70 /* Control2 register */
  57. #define XMT_RING_LIMIT 0x7C /* Transmit ring limit register */
  58. #define AUTOPOLL0 0x88 /* Auto-poll0 register */
  59. #define AUTOPOLL1 0x8A /* Auto-poll1 register */
  60. #define AUTOPOLL2 0x8C /* Auto-poll2 register */
  61. #define AUTOPOLL3 0x8E /* Auto-poll3 register */
  62. #define AUTOPOLL4 0x90 /* Auto-poll4 register */
  63. #define AUTOPOLL5 0x92 /* Auto-poll5 register */
  64. #define AP_VALUE 0x98 /* Auto-poll value register */
  65. #define DLY_INT_A 0xA8 /* Group A delayed interrupt register */
  66. #define DLY_INT_B 0xAC /* Group B delayed interrupt register */
  67. #define FLOW_CONTROL 0xC8 /* Flow control register */
  68. #define PHY_ACCESS 0xD0 /* PHY access register */
  69. #define STVAL 0xD8 /* Software timer value register */
  70. #define XMT_RING_BASE_ADDR0 0x100 /* Transmit ring0 base addr register */
  71. #define XMT_RING_BASE_ADDR1 0x108 /* Transmit ring1 base addr register */
  72. #define XMT_RING_BASE_ADDR2 0x110 /* Transmit ring2 base addr register */
  73. #define XMT_RING_BASE_ADDR3 0x118 /* Transmit ring2 base addr register */
  74. #define RCV_RING_BASE_ADDR0 0x120 /* Transmit ring0 base addr register */
  75. #define PMAT0 0x190 /* OnNow pattern register0 */
  76. #define PMAT1 0x194 /* OnNow pattern register1 */
  77. /* 16bit registers */
  78. #define XMT_RING_LEN0 0x140 /* Transmit Ring0 length register */
  79. #define XMT_RING_LEN1 0x144 /* Transmit Ring1 length register */
  80. #define XMT_RING_LEN2 0x148 /* Transmit Ring2 length register */
  81. #define XMT_RING_LEN3 0x14C /* Transmit Ring3 length register */
  82. #define RCV_RING_LEN0 0x150 /* Receive Ring0 length register */
  83. #define SRAM_SIZE 0x178 /* SRAM size register */
  84. #define SRAM_BOUNDARY 0x17A /* SRAM boundary register */
  85. /* 48bit register */
  86. #define PADR 0x160 /* Physical address register */
  87. #define IFS1 0x18C /* Inter-frame spacing Part1 register */
  88. #define IFS 0x18D /* Inter-frame spacing register */
  89. #define IPG 0x18E /* Inter-frame gap register */
  90. /* 64bit register */
  91. #define LADRF 0x168 /* Logical address filter register */
  92. /* Register Bit Definitions */
  93. typedef enum {
  94. ASF_INIT_DONE = (1 << 1),
  95. ASF_INIT_PRESENT = (1 << 0),
  96. }STAT_ASF_BITS;
  97. typedef enum {
  98. MIB_CMD_ACTIVE = (1 << 15 ),
  99. MIB_RD_CMD = (1 << 13 ),
  100. MIB_CLEAR = (1 << 12 ),
  101. MIB_ADDRESS = (1 << 0) | (1 << 1) | (1 << 2) | (1 << 3)|
  102. (1 << 4) | (1 << 5),
  103. }MIB_ADDR_BITS;
  104. typedef enum {
  105. PMAT_DET = (1 << 12),
  106. MP_DET = (1 << 11),
  107. LC_DET = (1 << 10),
  108. SPEED_MASK = (1 << 9)|(1 << 8)|(1 << 7),
  109. FULL_DPLX = (1 << 6),
  110. LINK_STATS = (1 << 5),
  111. AUTONEG_COMPLETE = (1 << 4),
  112. MIIPD = (1 << 3),
  113. RX_SUSPENDED = (1 << 2),
  114. TX_SUSPENDED = (1 << 1),
  115. RUNNING = (1 << 0),
  116. }STAT0_BITS;
  117. #define PHY_SPEED_10 0x2
  118. #define PHY_SPEED_100 0x3
  119. /* INT0 0x38, 32bit register */
  120. typedef enum {
  121. INTR = (1 << 31),
  122. PCSINT = (1 << 28),
  123. LCINT = (1 << 27),
  124. APINT5 = (1 << 26),
  125. APINT4 = (1 << 25),
  126. APINT3 = (1 << 24),
  127. TINT_SUM = (1 << 23),
  128. APINT2 = (1 << 22),
  129. APINT1 = (1 << 21),
  130. APINT0 = (1 << 20),
  131. MIIPDTINT = (1 << 19),
  132. MCCINT = (1 << 17),
  133. MREINT = (1 << 16),
  134. RINT_SUM = (1 << 15),
  135. SPNDINT = (1 << 14),
  136. MPINT = (1 << 13),
  137. SINT = (1 << 12),
  138. TINT3 = (1 << 11),
  139. TINT2 = (1 << 10),
  140. TINT1 = (1 << 9),
  141. TINT0 = (1 << 8),
  142. UINT = (1 << 7),
  143. STINT = (1 << 4),
  144. RINT0 = (1 << 0),
  145. }INT0_BITS;
  146. typedef enum {
  147. VAL3 = (1 << 31), /* VAL bit for byte 3 */
  148. VAL2 = (1 << 23), /* VAL bit for byte 2 */
  149. VAL1 = (1 << 15), /* VAL bit for byte 1 */
  150. VAL0 = (1 << 7), /* VAL bit for byte 0 */
  151. }VAL_BITS;
  152. typedef enum {
  153. /* VAL3 */
  154. LCINTEN = (1 << 27),
  155. APINT5EN = (1 << 26),
  156. APINT4EN = (1 << 25),
  157. APINT3EN = (1 << 24),
  158. /* VAL2 */
  159. APINT2EN = (1 << 22),
  160. APINT1EN = (1 << 21),
  161. APINT0EN = (1 << 20),
  162. MIIPDTINTEN = (1 << 19),
  163. MCCIINTEN = (1 << 18),
  164. MCCINTEN = (1 << 17),
  165. MREINTEN = (1 << 16),
  166. /* VAL1 */
  167. SPNDINTEN = (1 << 14),
  168. MPINTEN = (1 << 13),
  169. TINTEN3 = (1 << 11),
  170. SINTEN = (1 << 12),
  171. TINTEN2 = (1 << 10),
  172. TINTEN1 = (1 << 9),
  173. TINTEN0 = (1 << 8),
  174. /* VAL0 */
  175. STINTEN = (1 << 4),
  176. RINTEN0 = (1 << 0),
  177. INTEN0_CLEAR = 0x1F7F7F1F, /* Command style register */
  178. }INTEN0_BITS;
  179. typedef enum {
  180. /* VAL2 */
  181. RDMD0 = (1 << 16),
  182. /* VAL1 */
  183. TDMD3 = (1 << 11),
  184. TDMD2 = (1 << 10),
  185. TDMD1 = (1 << 9),
  186. TDMD0 = (1 << 8),
  187. /* VAL0 */
  188. UINTCMD = (1 << 6),
  189. RX_FAST_SPND = (1 << 5),
  190. TX_FAST_SPND = (1 << 4),
  191. RX_SPND = (1 << 3),
  192. TX_SPND = (1 << 2),
  193. INTREN = (1 << 1),
  194. RUN = (1 << 0),
  195. CMD0_CLEAR = 0x000F0F7F, /* Command style register */
  196. }CMD0_BITS;
  197. typedef enum {
  198. /* VAL3 */
  199. CONDUIT_MODE = (1 << 29),
  200. /* VAL2 */
  201. RPA = (1 << 19),
  202. DRCVPA = (1 << 18),
  203. DRCVBC = (1 << 17),
  204. PROM = (1 << 16),
  205. /* VAL1 */
  206. ASTRP_RCV = (1 << 13),
  207. RCV_DROP0 = (1 << 12),
  208. EMBA = (1 << 11),
  209. DXMT2PD = (1 << 10),
  210. LTINTEN = (1 << 9),
  211. DXMTFCS = (1 << 8),
  212. /* VAL0 */
  213. APAD_XMT = (1 << 6),
  214. DRTY = (1 << 5),
  215. INLOOP = (1 << 4),
  216. EXLOOP = (1 << 3),
  217. REX_RTRY = (1 << 2),
  218. REX_UFLO = (1 << 1),
  219. REX_LCOL = (1 << 0),
  220. CMD2_CLEAR = 0x3F7F3F7F, /* Command style register */
  221. }CMD2_BITS;
  222. typedef enum {
  223. /* VAL3 */
  224. ASF_INIT_DONE_ALIAS = (1 << 29),
  225. /* VAL2 */
  226. JUMBO = (1 << 21),
  227. VSIZE = (1 << 20),
  228. VLONLY = (1 << 19),
  229. VL_TAG_DEL = (1 << 18),
  230. /* VAL1 */
  231. EN_PMGR = (1 << 14),
  232. INTLEVEL = (1 << 13),
  233. FORCE_FULL_DUPLEX = (1 << 12),
  234. FORCE_LINK_STATUS = (1 << 11),
  235. APEP = (1 << 10),
  236. MPPLBA = (1 << 9),
  237. /* VAL0 */
  238. RESET_PHY_PULSE = (1 << 2),
  239. RESET_PHY = (1 << 1),
  240. PHY_RST_POL = (1 << 0),
  241. }CMD3_BITS;
  242. typedef enum {
  243. /* VAL0 */
  244. PMAT_SAVE_MATCH = (1 << 4),
  245. PMAT_MODE = (1 << 3),
  246. MPEN_SW = (1 << 1),
  247. LCMODE_SW = (1 << 0),
  248. CMD7_CLEAR = 0x0000001B /* Command style register */
  249. }CMD7_BITS;
  250. typedef enum {
  251. RESET_PHY_WIDTH = (0xF << 16) | (0xF<< 20), /* 0x00FF0000 */
  252. XMTSP_MASK = (1 << 9) | (1 << 8), /* 9:8 */
  253. XMTSP_128 = (1 << 9), /* 9 */
  254. XMTSP_64 = (1 << 8),
  255. CACHE_ALIGN = (1 << 4),
  256. BURST_LIMIT_MASK = (0xF << 0 ),
  257. CTRL1_DEFAULT = 0x00010111,
  258. }CTRL1_BITS;
  259. typedef enum {
  260. FMDC_MASK = (1 << 9)|(1 << 8), /* 9:8 */
  261. XPHYRST = (1 << 7),
  262. XPHYANE = (1 << 6),
  263. XPHYFD = (1 << 5),
  264. XPHYSP = (1 << 4) | (1 << 3), /* 4:3 */
  265. APDW_MASK = (1 << 2) | (1 << 1) | (1 << 0), /* 2:0 */
  266. }CTRL2_BITS;
  267. /* XMT_RING_LIMIT 0x7C, 32bit register */
  268. typedef enum {
  269. XMT_RING2_LIMIT = (0xFF << 16), /* 23:16 */
  270. XMT_RING1_LIMIT = (0xFF << 8), /* 15:8 */
  271. XMT_RING0_LIMIT = (0xFF << 0), /* 7:0 */
  272. }XMT_RING_LIMIT_BITS;
  273. typedef enum {
  274. AP_REG0_EN = (1 << 15),
  275. AP_REG0_ADDR_MASK = (0xF << 8) |(1 << 12),/* 12:8 */
  276. AP_PHY0_ADDR_MASK = (0xF << 0) |(1 << 4),/* 4:0 */
  277. }AUTOPOLL0_BITS;
  278. /* AUTOPOLL1 0x8A, 16bit register */
  279. typedef enum {
  280. AP_REG1_EN = (1 << 15),
  281. AP_REG1_ADDR_MASK = (0xF << 8) |(1 << 12),/* 12:8 */
  282. AP_PRE_SUP1 = (1 << 6),
  283. AP_PHY1_DFLT = (1 << 5),
  284. AP_PHY1_ADDR_MASK = (0xF << 0) |(1 << 4),/* 4:0 */
  285. }AUTOPOLL1_BITS;
  286. typedef enum {
  287. AP_REG2_EN = (1 << 15),
  288. AP_REG2_ADDR_MASK = (0xF << 8) |(1 << 12),/* 12:8 */
  289. AP_PRE_SUP2 = (1 << 6),
  290. AP_PHY2_DFLT = (1 << 5),
  291. AP_PHY2_ADDR_MASK = (0xF << 0) |(1 << 4),/* 4:0 */
  292. }AUTOPOLL2_BITS;
  293. typedef enum {
  294. AP_REG3_EN = (1 << 15),
  295. AP_REG3_ADDR_MASK = (0xF << 8) |(1 << 12),/* 12:8 */
  296. AP_PRE_SUP3 = (1 << 6),
  297. AP_PHY3_DFLT = (1 << 5),
  298. AP_PHY3_ADDR_MASK = (0xF << 0) |(1 << 4),/* 4:0 */
  299. }AUTOPOLL3_BITS;
  300. typedef enum {
  301. AP_REG4_EN = (1 << 15),
  302. AP_REG4_ADDR_MASK = (0xF << 8) |(1 << 12),/* 12:8 */
  303. AP_PRE_SUP4 = (1 << 6),
  304. AP_PHY4_DFLT = (1 << 5),
  305. AP_PHY4_ADDR_MASK = (0xF << 0) |(1 << 4),/* 4:0 */
  306. }AUTOPOLL4_BITS;
  307. typedef enum {
  308. AP_REG5_EN = (1 << 15),
  309. AP_REG5_ADDR_MASK = (0xF << 8) |(1 << 12),/* 12:8 */
  310. AP_PRE_SUP5 = (1 << 6),
  311. AP_PHY5_DFLT = (1 << 5),
  312. AP_PHY5_ADDR_MASK = (0xF << 0) |(1 << 4),/* 4:0 */
  313. }AUTOPOLL5_BITS;
  314. /* AP_VALUE 0x98, 32bit ragister */
  315. typedef enum {
  316. AP_VAL_ACTIVE = (1 << 31),
  317. AP_VAL_RD_CMD = ( 1 << 29),
  318. AP_ADDR = (1 << 18)|(1 << 17)|(1 << 16), /* 18:16 */
  319. AP_VAL = (0xF << 0) | (0xF << 4) |( 0xF << 8) |
  320. (0xF << 12), /* 15:0 */
  321. }AP_VALUE_BITS;
  322. typedef enum {
  323. DLY_INT_A_R3 = (1 << 31),
  324. DLY_INT_A_R2 = (1 << 30),
  325. DLY_INT_A_R1 = (1 << 29),
  326. DLY_INT_A_R0 = (1 << 28),
  327. DLY_INT_A_T3 = (1 << 27),
  328. DLY_INT_A_T2 = (1 << 26),
  329. DLY_INT_A_T1 = (1 << 25),
  330. DLY_INT_A_T0 = ( 1 << 24),
  331. EVENT_COUNT_A = (0xF << 16) | (0x1 << 20),/* 20:16 */
  332. MAX_DELAY_TIME_A = (0xF << 0) | (0xF << 4) | (1 << 8)|
  333. (1 << 9) | (1 << 10), /* 10:0 */
  334. }DLY_INT_A_BITS;
  335. typedef enum {
  336. DLY_INT_B_R3 = (1 << 31),
  337. DLY_INT_B_R2 = (1 << 30),
  338. DLY_INT_B_R1 = (1 << 29),
  339. DLY_INT_B_R0 = (1 << 28),
  340. DLY_INT_B_T3 = (1 << 27),
  341. DLY_INT_B_T2 = (1 << 26),
  342. DLY_INT_B_T1 = (1 << 25),
  343. DLY_INT_B_T0 = ( 1 << 24),
  344. EVENT_COUNT_B = (0xF << 16) | (0x1 << 20),/* 20:16 */
  345. MAX_DELAY_TIME_B = (0xF << 0) | (0xF << 4) | (1 << 8)|
  346. (1 << 9) | (1 << 10), /* 10:0 */
  347. }DLY_INT_B_BITS;
  348. /* FLOW_CONTROL 0xC8, 32bit register */
  349. typedef enum {
  350. PAUSE_LEN_CHG = (1 << 30),
  351. FTPE = (1 << 22),
  352. FRPE = (1 << 21),
  353. NAPA = (1 << 20),
  354. NPA = (1 << 19),
  355. FIXP = ( 1 << 18),
  356. FCCMD = ( 1 << 16),
  357. PAUSE_LEN = (0xF << 0) | (0xF << 4) |( 0xF << 8) | (0xF << 12), /* 15:0 */
  358. }FLOW_CONTROL_BITS;
  359. /* PHY_ ACCESS 0xD0, 32bit register */
  360. typedef enum {
  361. PHY_CMD_ACTIVE = (1 << 31),
  362. PHY_WR_CMD = (1 << 30),
  363. PHY_RD_CMD = (1 << 29),
  364. PHY_RD_ERR = (1 << 28),
  365. PHY_PRE_SUP = (1 << 27),
  366. PHY_ADDR = (1 << 21) | (1 << 22) | (1 << 23)|
  367. (1 << 24) |(1 << 25),/* 25:21 */
  368. PHY_REG_ADDR = (1 << 16) | (1 << 17) | (1 << 18)| (1 << 19) | (1 << 20),/* 20:16 */
  369. PHY_DATA = (0xF << 0)|(0xF << 4) |(0xF << 8)|
  370. (0xF << 12),/* 15:0 */
  371. }PHY_ACCESS_BITS;
  372. /* PMAT0 0x190, 32bit register */
  373. typedef enum {
  374. PMR_ACTIVE = (1 << 31),
  375. PMR_WR_CMD = (1 << 30),
  376. PMR_RD_CMD = (1 << 29),
  377. PMR_BANK = (1 <<28),
  378. PMR_ADDR = (0xF << 16)|(1 << 20)|(1 << 21)|
  379. (1 << 22),/* 22:16 */
  380. PMR_B4 = (0xF << 0) | (0xF << 4),/* 15:0 */
  381. }PMAT0_BITS;
  382. /* PMAT1 0x194, 32bit register */
  383. typedef enum {
  384. PMR_B3 = (0xF << 24) | (0xF <<28),/* 31:24 */
  385. PMR_B2 = (0xF << 16) |(0xF << 20),/* 23:16 */
  386. PMR_B1 = (0xF << 8) | (0xF <<12), /* 15:8 */
  387. PMR_B0 = (0xF << 0)|(0xF << 4),/* 7:0 */
  388. }PMAT1_BITS;
  389. /************************************************************************/
  390. /* */
  391. /* MIB counter definitions */
  392. /* */
  393. /************************************************************************/
  394. #define rcv_miss_pkts 0x00
  395. #define rcv_octets 0x01
  396. #define rcv_broadcast_pkts 0x02
  397. #define rcv_multicast_pkts 0x03
  398. #define rcv_undersize_pkts 0x04
  399. #define rcv_oversize_pkts 0x05
  400. #define rcv_fragments 0x06
  401. #define rcv_jabbers 0x07
  402. #define rcv_unicast_pkts 0x08
  403. #define rcv_alignment_errors 0x09
  404. #define rcv_fcs_errors 0x0A
  405. #define rcv_good_octets 0x0B
  406. #define rcv_mac_ctrl 0x0C
  407. #define rcv_flow_ctrl 0x0D
  408. #define rcv_pkts_64_octets 0x0E
  409. #define rcv_pkts_65to127_octets 0x0F
  410. #define rcv_pkts_128to255_octets 0x10
  411. #define rcv_pkts_256to511_octets 0x11
  412. #define rcv_pkts_512to1023_octets 0x12
  413. #define rcv_pkts_1024to1518_octets 0x13
  414. #define rcv_unsupported_opcode 0x14
  415. #define rcv_symbol_errors 0x15
  416. #define rcv_drop_pkts_ring1 0x16
  417. #define rcv_drop_pkts_ring2 0x17
  418. #define rcv_drop_pkts_ring3 0x18
  419. #define rcv_drop_pkts_ring4 0x19
  420. #define rcv_jumbo_pkts 0x1A
  421. #define xmt_underrun_pkts 0x20
  422. #define xmt_octets 0x21
  423. #define xmt_packets 0x22
  424. #define xmt_broadcast_pkts 0x23
  425. #define xmt_multicast_pkts 0x24
  426. #define xmt_collisions 0x25
  427. #define xmt_unicast_pkts 0x26
  428. #define xmt_one_collision 0x27
  429. #define xmt_multiple_collision 0x28
  430. #define xmt_deferred_transmit 0x29
  431. #define xmt_late_collision 0x2A
  432. #define xmt_excessive_defer 0x2B
  433. #define xmt_loss_carrier 0x2C
  434. #define xmt_excessive_collision 0x2D
  435. #define xmt_back_pressure 0x2E
  436. #define xmt_flow_ctrl 0x2F
  437. #define xmt_pkts_64_octets 0x30
  438. #define xmt_pkts_65to127_octets 0x31
  439. #define xmt_pkts_128to255_octets 0x32
  440. #define xmt_pkts_256to511_octets 0x33
  441. #define xmt_pkts_512to1023_octets 0x34
  442. #define xmt_pkts_1024to1518_octet 0x35
  443. #define xmt_oversize_pkts 0x36
  444. #define xmt_jumbo_pkts 0x37
  445. /* ipg parameters */
  446. #define DEFAULT_IPG 0x60
  447. #define IFS1_DELTA 36
  448. #define IPG_CONVERGE_JIFFIES (HZ/2)
  449. #define IPG_STABLE_TIME 5
  450. #define MIN_IPG 96
  451. #define MAX_IPG 255
  452. #define IPG_STEP 16
  453. #define CSTATE 1
  454. #define SSTATE 2
  455. /* amd8111e descriptor flag definitions */
  456. typedef enum {
  457. OWN_BIT = (1 << 15),
  458. ADD_FCS_BIT = (1 << 13),
  459. LTINT_BIT = (1 << 12),
  460. STP_BIT = (1 << 9),
  461. ENP_BIT = (1 << 8),
  462. KILL_BIT = (1 << 6),
  463. TCC_VLAN_INSERT = (1 << 1),
  464. TCC_VLAN_REPLACE = (1 << 1) |( 1<< 0),
  465. }TX_FLAG_BITS;
  466. typedef enum {
  467. ERR_BIT = (1 << 14),
  468. FRAM_BIT = (1 << 13),
  469. OFLO_BIT = (1 << 12),
  470. CRC_BIT = (1 << 11),
  471. PAM_BIT = (1 << 6),
  472. LAFM_BIT = (1 << 5),
  473. BAM_BIT = (1 << 4),
  474. TT_VLAN_TAGGED = (1 << 3) |(1 << 2),/* 0x000 */
  475. TT_PRTY_TAGGED = (1 << 3),/* 0x0008 */
  476. }RX_FLAG_BITS;
  477. #define RESET_RX_FLAGS 0x0000
  478. #define TT_MASK 0x000c
  479. #define TCC_MASK 0x0003
  480. /* driver ioctl parameters */
  481. #define AMD8111E_REG_DUMP_LEN 13*sizeof(u32)
  482. /* crc generator constants */
  483. #define CRC32 0xedb88320
  484. #define INITCRC 0xFFFFFFFF
  485. /* kernel provided writeq does not write 64 bits into the amd8111e device register instead writes only higher 32bits data into lower 32bits of the register.
  486. BUG? */
  487. #define amd8111e_writeq(_UlData,_memMap) \
  488. writel(*(u32*)(&_UlData), _memMap); \
  489. writel(*(u32*)((u8*)(&_UlData)+4), _memMap+4)
  490. /* maps the external speed options to internal value */
  491. typedef enum {
  492. SPEED_AUTONEG,
  493. SPEED10_HALF,
  494. SPEED10_FULL,
  495. SPEED100_HALF,
  496. SPEED100_FULL,
  497. }EXT_PHY_OPTION;
  498. #endif /* _AMD8111E_H */