Вы не можете выбрать более 25 тем Темы должны начинаться с буквы или цифры, могут содержать дефисы(-) и должны содержать не более 35 символов.

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