Nevar pievienot vairāk kā 25 tēmas Tēmai ir jāsākas ar burtu vai ciparu, tā var saturēt domu zīmes ('-') un var būt līdz 35 simboliem gara.

smc9000.h 18KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433
  1. /*------------------------------------------------------------------------
  2. * smc9000.h
  3. *
  4. * Copyright (C) 1998 by Daniel Engström
  5. * Copyright (C) 1996 by Erik Stahlman
  6. *
  7. * This software may be used and distributed according to the terms
  8. * of the GNU Public License, incorporated herein by reference.
  9. *
  10. * This file contains register information and access macros for
  11. * the SMC91xxx chipset.
  12. *
  13. * Information contained in this file was obtained from the SMC91C94
  14. * manual from SMC. To get a copy, if you really want one, you can find
  15. * information under www.smsc.com in the components division.
  16. * ( this thanks to advice from Donald Becker ).
  17. *
  18. * Authors
  19. * Daniel Engström <daniel.engstrom@riksnett.no>
  20. * Erik Stahlman <erik@vt.edu>
  21. *
  22. * History
  23. * 96-01-06 Erik Stahlman moved definitions here from main .c
  24. * file
  25. * 96-01-19 Erik Stahlman polished this up some, and added
  26. * better error handling
  27. * 98-09-25 Daniel Engström adjusted for Etherboot
  28. * 98-09-27 Daniel Engström moved some static strings back to the
  29. * main .c file
  30. * --------------------------------------------------------------------------*/
  31. #ifndef _SMC9000_H_
  32. # define _SMC9000_H_
  33. /* I want some simple types */
  34. typedef unsigned char byte;
  35. typedef unsigned short word;
  36. typedef unsigned long int dword;
  37. /*---------------------------------------------------------------
  38. *
  39. * A description of the SMC registers is probably in order here,
  40. * although for details, the SMC datasheet is invaluable.
  41. *
  42. * Basically, the chip has 4 banks of registers ( 0 to 3 ), which
  43. * are accessed by writing a number into the BANK_SELECT register
  44. * ( I also use a SMC_SELECT_BANK macro for this ).
  45. *
  46. * The banks are configured so that for most purposes, bank 2 is all
  47. * that is needed for simple run time tasks.
  48. * ----------------------------------------------------------------------*/
  49. /*
  50. * Bank Select Register:
  51. *
  52. * yyyy yyyy 0000 00xx
  53. * xx = bank number
  54. * yyyy yyyy = 0x33, for identification purposes.
  55. */
  56. #define BANK_SELECT 14
  57. /* BANK 0 */
  58. #define TCR 0 /* transmit control register */
  59. #define TCR_ENABLE 0x0001 /* if this is 1, we can transmit */
  60. #define TCR_FDUPLX 0x0800 /* receive packets sent out */
  61. #define TCR_STP_SQET 0x1000 /* stop transmitting if Signal quality error */
  62. #define TCR_MON_CNS 0x0400 /* monitors the carrier status */
  63. #define TCR_PAD_ENABLE 0x0080 /* pads short packets to 64 bytes */
  64. #define TCR_CLEAR 0 /* do NOTHING */
  65. /* the normal settings for the TCR register : */
  66. #define TCR_NORMAL (TCR_ENABLE | TCR_PAD_ENABLE)
  67. #define EPH_STATUS 2
  68. #define ES_LINK_OK 0x4000 /* is the link integrity ok ? */
  69. #define RCR 4
  70. #define RCR_SOFTRESET 0x8000 /* resets the chip */
  71. #define RCR_STRIP_CRC 0x200 /* strips CRC */
  72. #define RCR_ENABLE 0x100 /* IFF this is set, we can receive packets */
  73. #define RCR_ALMUL 0x4 /* receive all multicast packets */
  74. #define RCR_PROMISC 0x2 /* enable promiscuous mode */
  75. /* the normal settings for the RCR register : */
  76. #define RCR_NORMAL (RCR_STRIP_CRC | RCR_ENABLE)
  77. #define RCR_CLEAR 0x0 /* set it to a base state */
  78. #define COUNTER 6
  79. #define MIR 8
  80. #define MCR 10
  81. /* 12 is reserved */
  82. // Receive/Phy Control Register
  83. /* BANK 0 */
  84. #define RPC_REG 0x000A
  85. #define RPC_SPEED 0x2000 // When 1 PHY is in 100Mbps mode.
  86. #define RPC_DPLX 0x1000 // When 1 PHY is in Full-Duplex Mode
  87. #define RPC_ANEG 0x0800 // When 1 PHY is in Auto-Negotiate Mode
  88. #define RPC_LSXA_SHFT 5 // Bits to shift LS2A,LS1A,LS0A to lsb
  89. #define RPC_LSXB_SHFT 2 // Bits to get LS2B,LS1B,LS0B to lsb
  90. #define RPC_LED_100_10 (0x00) // LED = 100Mbps OR's with 10Mbps link detect
  91. #define RPC_LED_RES (0x01) // LED = Reserved
  92. #define RPC_LED_10 (0x02) // LED = 10Mbps link detect
  93. #define RPC_LED_FD (0x03) // LED = Full Duplex Mode
  94. #define RPC_LED_TX_RX (0x04) // LED = TX or RX packet occurred
  95. #define RPC_LED_100 (0x05) // LED = 100Mbps link dectect
  96. #define RPC_LED_TX (0x06) // LED = TX packet occurred
  97. #define RPC_LED_RX (0x07) // LED = RX packet occurred
  98. #define RPC_DEFAULT (RPC_ANEG | (RPC_LED_100 << RPC_LSXA_SHFT) | (RPC_LED_FD << RPC_LSXB_SHFT) | RPC_SPEED | RPC_DPLX)
  99. // Receive/Phy Control Register
  100. /* BANK 0 */
  101. #define RPC_REG 0x000A
  102. #define RPC_SPEED 0x2000 // When 1 PHY is in 100Mbps mode.
  103. #define RPC_DPLX 0x1000 // When 1 PHY is in Full-Duplex Mode
  104. #define RPC_ANEG 0x0800 // When 1 PHY is in Auto-Negotiate Mode
  105. #define RPC_LSXA_SHFT 5 // Bits to shift LS2A,LS1A,LS0A to lsb
  106. #define RPC_LSXB_SHFT 2 // Bits to get LS2B,LS1B,LS0B to lsb
  107. #define RPC_LED_100_10 (0x00) // LED = 100Mbps OR's with 10Mbps link detect
  108. #define RPC_LED_RES (0x01) // LED = Reserved
  109. #define RPC_LED_10 (0x02) // LED = 10Mbps link detect
  110. #define RPC_LED_FD (0x03) // LED = Full Duplex Mode
  111. #define RPC_LED_TX_RX (0x04) // LED = TX or RX packet occurred
  112. #define RPC_LED_100 (0x05) // LED = 100Mbps link dectect
  113. #define RPC_LED_TX (0x06) // LED = TX packet occurred
  114. #define RPC_LED_RX (0x07) // LED = RX packet occurred
  115. #define RPC_DEFAULT (RPC_ANEG | (RPC_LED_100 << RPC_LSXA_SHFT) | (RPC_LED_FD << RPC_LSXB_SHFT) | RPC_SPEED | RPC_DPLX)
  116. /* BANK 1 */
  117. #define CONFIG 0
  118. #define CFG_AUI_SELECT 0x100
  119. #define BASE 2
  120. #define ADDR0 4
  121. #define ADDR1 6
  122. #define ADDR2 8
  123. #define GENERAL 10
  124. #define CONTROL 12
  125. #define CTL_POWERDOWN 0x2000
  126. #define CTL_LE_ENABLE 0x80
  127. #define CTL_CR_ENABLE 0x40
  128. #define CTL_TE_ENABLE 0x0020
  129. #define CTL_AUTO_RELEASE 0x0800
  130. #define CTL_EPROM_ACCESS 0x0003 /* high if Eprom is being read */
  131. /* BANK 2 */
  132. #define MMU_CMD 0
  133. #define MC_BUSY 1 /* only readable bit in the register */
  134. #define MC_NOP 0
  135. #define MC_ALLOC 0x20 /* or with number of 256 byte packets */
  136. #define MC_RESET 0x40
  137. #define MC_REMOVE 0x60 /* remove the current rx packet */
  138. #define MC_RELEASE 0x80 /* remove and release the current rx packet */
  139. #define MC_FREEPKT 0xA0 /* Release packet in PNR register */
  140. #define MC_ENQUEUE 0xC0 /* Enqueue the packet for transmit */
  141. #define PNR_ARR 2
  142. #define FIFO_PORTS 4
  143. #define FP_RXEMPTY 0x8000
  144. #define FP_TXEMPTY 0x80
  145. #define POINTER 6
  146. #define PTR_READ 0x2000
  147. #define PTR_RCV 0x8000
  148. #define PTR_AUTOINC 0x4000
  149. #define PTR_AUTO_INC 0x0040
  150. #define DATA_1 8
  151. #define DATA_2 10
  152. #define INTERRUPT 12
  153. #define INT_MASK 13
  154. #define IM_RCV_INT 0x1
  155. #define IM_TX_INT 0x2
  156. #define IM_TX_EMPTY_INT 0x4
  157. #define IM_ALLOC_INT 0x8
  158. #define IM_RX_OVRN_INT 0x10
  159. #define IM_EPH_INT 0x20
  160. #define IM_ERCV_INT 0x40 /* not on SMC9192 */
  161. /* BANK 3 */
  162. #define MULTICAST1 0
  163. #define MULTICAST2 2
  164. #define MULTICAST3 4
  165. #define MULTICAST4 6
  166. #define MGMT 8
  167. #define REVISION 10 /* ( hi: chip id low: rev # ) */
  168. // Management Interface Register (MII)
  169. #define MII_REG 0x0008
  170. #define MII_MSK_CRS100 0x4000 // Disables CRS100 detection during tx half dup
  171. #define MII_MDOE 0x0008 // MII Output Enable
  172. #define MII_MCLK 0x0004 // MII Clock, pin MDCLK
  173. #define MII_MDI 0x0002 // MII Input, pin MDI
  174. #define MII_MDO 0x0001 // MII Output, pin MDO
  175. /* this is NOT on SMC9192 */
  176. #define ERCV 12
  177. /* Note that 9194 and 9196 have the smame chip id,
  178. * the 9196 will have revisions starting at 6 */
  179. #define CHIP_9190 3
  180. #define CHIP_9194 4
  181. #define CHIP_9195 5
  182. #define CHIP_9196 4
  183. #define CHIP_91100 7
  184. #define CHIP_91100FD 8
  185. #define REV_9196 6
  186. /*
  187. * Transmit status bits
  188. */
  189. #define TS_SUCCESS 0x0001
  190. #define TS_LOSTCAR 0x0400
  191. #define TS_LATCOL 0x0200
  192. #define TS_16COL 0x0010
  193. /*
  194. * Receive status bits
  195. */
  196. #define RS_ALGNERR 0x8000
  197. #define RS_BADCRC 0x2000
  198. #define RS_ODDFRAME 0x1000
  199. #define RS_TOOLONG 0x0800
  200. #define RS_TOOSHORT 0x0400
  201. #define RS_MULTICAST 0x0001
  202. #define RS_ERRORS (RS_ALGNERR | RS_BADCRC | RS_TOOLONG | RS_TOOSHORT)
  203. // Management Interface Register (MII)
  204. #define MII_REG 0x0008
  205. #define MII_MSK_CRS100 0x4000 // Disables CRS100 detection during tx half dup
  206. #define MII_MDOE 0x0008 // MII Output Enable
  207. #define MII_MCLK 0x0004 // MII Clock, pin MDCLK
  208. #define MII_MDI 0x0002 // MII Input, pin MDI
  209. #define MII_MDO 0x0001 // MII Output, pin MDO
  210. // PHY Register Addresses (LAN91C111 Internal PHY)
  211. // PHY Control Register
  212. #define PHY_CNTL_REG 0x00
  213. #define PHY_CNTL_RST 0x8000 // 1=PHY Reset
  214. #define PHY_CNTL_LPBK 0x4000 // 1=PHY Loopback
  215. #define PHY_CNTL_SPEED 0x2000 // 1=100Mbps, 0=10Mpbs
  216. #define PHY_CNTL_ANEG_EN 0x1000 // 1=Enable Auto negotiation
  217. #define PHY_CNTL_PDN 0x0800 // 1=PHY Power Down mode
  218. #define PHY_CNTL_MII_DIS 0x0400 // 1=MII 4 bit interface disabled
  219. #define PHY_CNTL_ANEG_RST 0x0200 // 1=Reset Auto negotiate
  220. #define PHY_CNTL_DPLX 0x0100 // 1=Full Duplex, 0=Half Duplex
  221. #define PHY_CNTL_COLTST 0x0080 // 1= MII Colision Test
  222. // PHY Status Register
  223. #define PHY_STAT_REG 0x01
  224. #define PHY_STAT_CAP_T4 0x8000 // 1=100Base-T4 capable
  225. #define PHY_STAT_CAP_TXF 0x4000 // 1=100Base-X full duplex capable
  226. #define PHY_STAT_CAP_TXH 0x2000 // 1=100Base-X half duplex capable
  227. #define PHY_STAT_CAP_TF 0x1000 // 1=10Mbps full duplex capable
  228. #define PHY_STAT_CAP_TH 0x0800 // 1=10Mbps half duplex capable
  229. #define PHY_STAT_CAP_SUPR 0x0040 // 1=recv mgmt frames with not preamble
  230. #define PHY_STAT_ANEG_ACK 0x0020 // 1=ANEG has completed
  231. #define PHY_STAT_REM_FLT 0x0010 // 1=Remote Fault detected
  232. #define PHY_STAT_CAP_ANEG 0x0008 // 1=Auto negotiate capable
  233. #define PHY_STAT_LINK 0x0004 // 1=valid link
  234. #define PHY_STAT_JAB 0x0002 // 1=10Mbps jabber condition
  235. #define PHY_STAT_EXREG 0x0001 // 1=extended registers implemented
  236. // PHY Identifier Registers
  237. #define PHY_ID1_REG 0x02 // PHY Identifier 1
  238. #define PHY_ID2_REG 0x03 // PHY Identifier 2
  239. // PHY Auto-Negotiation Advertisement Register
  240. #define PHY_AD_REG 0x04
  241. #define PHY_AD_NP 0x8000 // 1=PHY requests exchange of Next Page
  242. #define PHY_AD_ACK 0x4000 // 1=got link code word from remote
  243. #define PHY_AD_RF 0x2000 // 1=advertise remote fault
  244. #define PHY_AD_T4 0x0200 // 1=PHY is capable of 100Base-T4
  245. #define PHY_AD_TX_FDX 0x0100 // 1=PHY is capable of 100Base-TX FDPLX
  246. #define PHY_AD_TX_HDX 0x0080 // 1=PHY is capable of 100Base-TX HDPLX
  247. #define PHY_AD_10_FDX 0x0040 // 1=PHY is capable of 10Base-T FDPLX
  248. #define PHY_AD_10_HDX 0x0020 // 1=PHY is capable of 10Base-T HDPLX
  249. #define PHY_AD_CSMA 0x0001 // 1=PHY is capable of 802.3 CMSA
  250. // PHY Auto-negotiation Remote End Capability Register
  251. #define PHY_RMT_REG 0x05
  252. // Uses same bit definitions as PHY_AD_REG
  253. // PHY Configuration Register 1
  254. #define PHY_CFG1_REG 0x10
  255. #define PHY_CFG1_LNKDIS 0x8000 // 1=Rx Link Detect Function disabled
  256. #define PHY_CFG1_XMTDIS 0x4000 // 1=TP Transmitter Disabled
  257. #define PHY_CFG1_XMTPDN 0x2000 // 1=TP Transmitter Powered Down
  258. #define PHY_CFG1_BYPSCR 0x0400 // 1=Bypass scrambler/descrambler
  259. #define PHY_CFG1_UNSCDS 0x0200 // 1=Unscramble Idle Reception Disable
  260. #define PHY_CFG1_EQLZR 0x0100 // 1=Rx Equalizer Disabled
  261. #define PHY_CFG1_CABLE 0x0080 // 1=STP(150ohm), 0=UTP(100ohm)
  262. #define PHY_CFG1_RLVL0 0x0040 // 1=Rx Squelch level reduced by 4.5db
  263. #define PHY_CFG1_TLVL_SHIFT 2 // Transmit Output Level Adjust
  264. #define PHY_CFG1_TLVL_MASK 0x003C
  265. #define PHY_CFG1_TRF_MASK 0x0003 // Transmitter Rise/Fall time
  266. // PHY Configuration Register 2
  267. #define PHY_CFG2_REG 0x11
  268. #define PHY_CFG2_APOLDIS 0x0020 // 1=Auto Polarity Correction disabled
  269. #define PHY_CFG2_JABDIS 0x0010 // 1=Jabber disabled
  270. #define PHY_CFG2_MREG 0x0008 // 1=Multiple register access (MII mgt)
  271. #define PHY_CFG2_INTMDIO 0x0004 // 1=Interrupt signaled with MDIO pulseo
  272. // PHY Status Output (and Interrupt status) Register
  273. #define PHY_INT_REG 0x12 // Status Output (Interrupt Status)
  274. #define PHY_INT_INT 0x8000 // 1=bits have changed since last read
  275. #define PHY_INT_LNKFAIL 0x4000 // 1=Link Not detected
  276. #define PHY_INT_LOSSSYNC 0x2000 // 1=Descrambler has lost sync
  277. #define PHY_INT_CWRD 0x1000 // 1=Invalid 4B5B code detected on rx
  278. #define PHY_INT_SSD 0x0800 // 1=No Start Of Stream detected on rx
  279. #define PHY_INT_ESD 0x0400 // 1=No End Of Stream detected on rx
  280. #define PHY_INT_RPOL 0x0200 // 1=Reverse Polarity detected
  281. #define PHY_INT_JAB 0x0100 // 1=Jabber detected
  282. #define PHY_INT_SPDDET 0x0080 // 1=100Base-TX mode, 0=10Base-T mode
  283. #define PHY_INT_DPLXDET 0x0040 // 1=Device in Full Duplex
  284. // PHY Interrupt/Status Mask Register
  285. #define PHY_MASK_REG 0x13 // Interrupt Mask
  286. // Uses the same bit definitions as PHY_INT_REG
  287. // PHY Register Addresses (LAN91C111 Internal PHY)
  288. // PHY Control Register
  289. #define PHY_CNTL_REG 0x00
  290. #define PHY_CNTL_RST 0x8000 // 1=PHY Reset
  291. #define PHY_CNTL_LPBK 0x4000 // 1=PHY Loopback
  292. #define PHY_CNTL_SPEED 0x2000 // 1=100Mbps, 0=10Mpbs
  293. #define PHY_CNTL_ANEG_EN 0x1000 // 1=Enable Auto negotiation
  294. #define PHY_CNTL_PDN 0x0800 // 1=PHY Power Down mode
  295. #define PHY_CNTL_MII_DIS 0x0400 // 1=MII 4 bit interface disabled
  296. #define PHY_CNTL_ANEG_RST 0x0200 // 1=Reset Auto negotiate
  297. #define PHY_CNTL_DPLX 0x0100 // 1=Full Duplex, 0=Half Duplex
  298. #define PHY_CNTL_COLTST 0x0080 // 1= MII Colision Test
  299. // PHY Status Register
  300. #define PHY_STAT_REG 0x01
  301. #define PHY_STAT_CAP_T4 0x8000 // 1=100Base-T4 capable
  302. #define PHY_STAT_CAP_TXF 0x4000 // 1=100Base-X full duplex capable
  303. #define PHY_STAT_CAP_TXH 0x2000 // 1=100Base-X half duplex capable
  304. #define PHY_STAT_CAP_TF 0x1000 // 1=10Mbps full duplex capable
  305. #define PHY_STAT_CAP_TH 0x0800 // 1=10Mbps half duplex capable
  306. #define PHY_STAT_CAP_SUPR 0x0040 // 1=recv mgmt frames with not preamble
  307. #define PHY_STAT_ANEG_ACK 0x0020 // 1=ANEG has completed
  308. #define PHY_STAT_REM_FLT 0x0010 // 1=Remote Fault detected
  309. #define PHY_STAT_CAP_ANEG 0x0008 // 1=Auto negotiate capable
  310. #define PHY_STAT_LINK 0x0004 // 1=valid link
  311. #define PHY_STAT_JAB 0x0002 // 1=10Mbps jabber condition
  312. #define PHY_STAT_EXREG 0x0001 // 1=extended registers implemented
  313. // PHY Identifier Registers
  314. #define PHY_ID1_REG 0x02 // PHY Identifier 1
  315. #define PHY_ID2_REG 0x03 // PHY Identifier 2
  316. // PHY Auto-Negotiation Advertisement Register
  317. #define PHY_AD_REG 0x04
  318. #define PHY_AD_NP 0x8000 // 1=PHY requests exchange of Next Page
  319. #define PHY_AD_ACK 0x4000 // 1=got link code word from remote
  320. #define PHY_AD_RF 0x2000 // 1=advertise remote fault
  321. #define PHY_AD_T4 0x0200 // 1=PHY is capable of 100Base-T4
  322. #define PHY_AD_TX_FDX 0x0100 // 1=PHY is capable of 100Base-TX FDPLX
  323. #define PHY_AD_TX_HDX 0x0080 // 1=PHY is capable of 100Base-TX HDPLX
  324. #define PHY_AD_10_FDX 0x0040 // 1=PHY is capable of 10Base-T FDPLX
  325. #define PHY_AD_10_HDX 0x0020 // 1=PHY is capable of 10Base-T HDPLX
  326. #define PHY_AD_CSMA 0x0001 // 1=PHY is capable of 802.3 CMSA
  327. // PHY Auto-negotiation Remote End Capability Register
  328. #define PHY_RMT_REG 0x05
  329. // Uses same bit definitions as PHY_AD_REG
  330. // PHY Configuration Register 1
  331. #define PHY_CFG1_REG 0x10
  332. #define PHY_CFG1_LNKDIS 0x8000 // 1=Rx Link Detect Function disabled
  333. #define PHY_CFG1_XMTDIS 0x4000 // 1=TP Transmitter Disabled
  334. #define PHY_CFG1_XMTPDN 0x2000 // 1=TP Transmitter Powered Down
  335. #define PHY_CFG1_BYPSCR 0x0400 // 1=Bypass scrambler/descrambler
  336. #define PHY_CFG1_UNSCDS 0x0200 // 1=Unscramble Idle Reception Disable
  337. #define PHY_CFG1_EQLZR 0x0100 // 1=Rx Equalizer Disabled
  338. #define PHY_CFG1_CABLE 0x0080 // 1=STP(150ohm), 0=UTP(100ohm)
  339. #define PHY_CFG1_RLVL0 0x0040 // 1=Rx Squelch level reduced by 4.5db
  340. #define PHY_CFG1_TLVL_SHIFT 2 // Transmit Output Level Adjust
  341. #define PHY_CFG1_TLVL_MASK 0x003C
  342. #define PHY_CFG1_TRF_MASK 0x0003 // Transmitter Rise/Fall time
  343. // PHY Configuration Register 2
  344. #define PHY_CFG2_REG 0x11
  345. #define PHY_CFG2_APOLDIS 0x0020 // 1=Auto Polarity Correction disabled
  346. #define PHY_CFG2_JABDIS 0x0010 // 1=Jabber disabled
  347. #define PHY_CFG2_MREG 0x0008 // 1=Multiple register access (MII mgt)
  348. #define PHY_CFG2_INTMDIO 0x0004 // 1=Interrupt signaled with MDIO pulseo
  349. // PHY Status Output (and Interrupt status) Register
  350. #define PHY_INT_REG 0x12 // Status Output (Interrupt Status)
  351. #define PHY_INT_INT 0x8000 // 1=bits have changed since last read
  352. #define PHY_INT_LNKFAIL 0x4000 // 1=Link Not detected
  353. #define PHY_INT_LOSSSYNC 0x2000 // 1=Descrambler has lost sync
  354. #define PHY_INT_CWRD 0x1000 // 1=Invalid 4B5B code detected on rx
  355. #define PHY_INT_SSD 0x0800 // 1=No Start Of Stream detected on rx
  356. #define PHY_INT_ESD 0x0400 // 1=No End Of Stream detected on rx
  357. #define PHY_INT_RPOL 0x0200 // 1=Reverse Polarity detected
  358. #define PHY_INT_JAB 0x0100 // 1=Jabber detected
  359. #define PHY_INT_SPDDET 0x0080 // 1=100Base-TX mode, 0=10Base-T mode
  360. #define PHY_INT_DPLXDET 0x0040 // 1=Device in Full Duplex
  361. // PHY Interrupt/Status Mask Register
  362. #define PHY_MASK_REG 0x13 // Interrupt Mask
  363. // Uses the same bit definitions as PHY_INT_REG
  364. /*-------------------------------------------------------------------------
  365. * I define some macros to make it easier to do somewhat common
  366. * or slightly complicated, repeated tasks.
  367. --------------------------------------------------------------------------*/
  368. /* select a register bank, 0 to 3 */
  369. #define SMC_SELECT_BANK(x, y) { _outw( y, x + BANK_SELECT ); }
  370. /* define a small delay for the reset */
  371. #define SMC_DELAY(x) { inw( x + RCR );\
  372. inw( x + RCR );\
  373. inw( x + RCR ); }
  374. #endif /* _SMC_9000_H_ */